:root { --serif: 'Newsreader', Georgia, serif; }
* { -webkit-tap-highlight-color: transparent; box-sizing: border-box; }
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100%;
}
body {
    font-family: 'Mulish', -apple-system, system-ui, sans-serif;
    background: oklch(0.945 0.006 150);
    color: #222;
    min-height: 100dvh;
    overflow: hidden;
}
button, textarea, input, select { font-family: inherit; }
button { cursor: pointer; }
::placeholder { color: oklch(0.7 0.01 150); }
::-webkit-scrollbar { width: 0; height: 0; }

.loading, .scale-wrap {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: stretch;
    justify-content: center;
    background: oklch(0.945 0.006 150);
}

.phone {
    width: 100%;
    max-width: 430px;
    height: 100dvh;
    max-height: none;
    border-radius: 0;
    overflow: hidden;
    box-shadow: none;
}

.app-shell {
    position: relative;
    height: 100dvh;
    display: flex;
    flex-direction: column;
}

/*.topbar {
    padding: calc(14px + env(safe-area-inset-top)) 20px 6px;
}

.tabbar {
    padding: 8px 10px calc(10px + env(safe-area-inset-bottom));
}*/
.topbar { padding: 10px 20px 6px; display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.brand, .topbar-right { display: flex; align-items: center; gap: 8px; height: 28px; }
.brand-dot {
    width: 13px;
    height: 13px;
    border-radius: 99px;
    display: inline-block;
}
.brand-name, .serif { font-family: var(--serif); }
.brand-name { font-size: 19px; font-weight: 600; letter-spacing: .01em; }
.section { font-size: 11.5px; font-weight: 700; opacity: .72; text-transform: uppercase; letter-spacing: .06em; }
.today-btn { border: none; border-radius: 10px; padding: 6px 12px; font-weight: 700; }
.screen { flex: 1; min-height: 0; }
.tabbar { flex-shrink: 0; display: flex; padding: 0px 10px 12px; box-shadow: 0 -2px 20px oklch(0.4 0.02 150 / .05); }
.tabitem { flex: 1; border: none; background: transparent; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 4px 0; }
.tabitem span { font-size: 10.5px; }
.screen-col { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.day-nav, .month-nav { padding: 6px 20px 16px; display: flex; align-items: center; justify-content: space-between; }
.nav-btn { border: none; width: 38px; height: 38px; border-radius: 14px; font-size: 28px; line-height: 1; color: var(--ink);}
.day-title { text-align: center; line-height: 1; }
.day-title .serif { font-size: 30px; font-weight: 500; letter-spacing: -.01em; }
.soft { font-size: 14px; opacity: .75; line-height: 1.5; }
.day-title .soft { font-size: 13px; margin-top: 5px; text-transform: capitalize; }
.treat-strip {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    overflow: visible;
    padding-top: 2px;
    padding-left: 22px;
}
/*.pill { display: inline-flex; align-items: center; gap: 7px; border-radius: 99px; padding: 7px 8px 7px 12px; font-size: 13px; font-weight: 700; white-space: nowrap; } */
.pill {
    height: 28px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    width: auto;
    min-width: 0;
    padding: 4px 4px 4px 8px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    flex: 0 0 auto;
    white-space: nowrap;
    transform: translateY(-2px);
}
.add-treatment-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1.5px dashed var(--line-color);
    background: transparent;
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.tiny-x {
    border: none;
    background: transparent;
    opacity: .7;
    font-weight: 800;
}
.sym-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 11px; padding: 18px; }
.sym-btn {
    border: 1.5px solid transparent;
    border-radius: 20px;
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    font-weight: 800;
    font-size: 15.5px;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}
.sym-btn-active {
    border-color: currentColor;
}
.sym-btn b { width: 26px; height: 26px; border-radius: 99px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; }
.timeline { margin: 0 20px 20px; border-radius: 20px; padding: 16px; overflow: auto; }
.timeline h3, .card h3 { margin: 0 0 4px; font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; opacity: .7; }
.entry-row { display: flex; gap: 11px; align-items: flex-start; padding: 4px 0; border-top: 1px solid rgba(0,0,0,.05); }
.entry-row small { display: block; opacity: .65; margin-top: 3px; }
.entry-row p { margin: 6px 0 0; }
.delete-btn { margin-left: auto; border: none; background: transparent; font-size: 22px; opacity: .5; }
.dot {
    width: 12px;
    height: 12px;
    border-radius: 99px;
    display: inline-block;
    flex-shrink: 0;
}
.registro-dot {
    width: 12px;
    height: 12px;
    border-radius: 99px;
    display: inline-block;
    flex-shrink: 0;
    transform: translateY(6px);
}
.legend-dot {
    width: 6px;
    height: 6px;
    border-radius: 99px;
    flex-shrink: 0;
}
.dot.mini { width: 6px; height: 6px; }
/*.sheet-layer { position: absolute; inset: 0; z-index: 80; display: flex; flex-direction: column; justify-content: flex-end; }
.sheet-backdrop { position: absolute; inset: 0; background: oklch(0.2 0.02 150 / .34); backdrop-filter: blur(2px); }
.sheet { position: relative; border-radius: 28px 28px 0 0; padding: 14px 20px 30px; box-shadow: 0 -8px 40px oklch(0.2 0.02 150 / .18); }*/
.grab { width: 38px; height: 5px; border-radius: 99px; margin: 0 auto 16px; }
.sheet h2 { margin: 0 0 18px; font-family: var(--serif); font-size: 28px; font-weight: 500; }
.sheet label, .add-box label { display: block; font-size: 13px; font-weight: 800; opacity: .65; margin: 14px 0 8px; }
.segmented { display: flex; gap: 6px; padding: 5px; border-radius: 14px; }
    .segmented button {
        flex: 1;
        border: none;
        border-radius: 10px;
        padding: 11px 10px;
        font-weight: 800;
        background: var(--surface);
        color: var(--ink);
        border: 1px solid white;
    }
textarea, input, select { width: 100%; border: none; border-radius: 13px; padding: 12px 14px; outline: none; background: rgba(0,0,0,.04); font-size: 15px; margin-bottom: 10px; }
textarea { min-height: 90px; resize: none; }
.save-btn { width: 100%; border: none; border-radius: 15px; padding: 15px; font-size: 15px; font-weight: 800; margin-top: 10px; }

.calendar-wrap, .scroll-pad { flex: 1; overflow-y: auto; padding: 0 16px 0px; }
.month-title { font-family: var(--serif); font-size: 23px; font-weight: 500; text-transform: capitalize; }
.weekday-row, .calendar-grid { display: grid; grid-template-columns: repeat(7,1fr); }
.weekday-row { margin-bottom: 6px; }
.weekday-row div { text-align: center; font-size: 11.5px; font-weight: 800; opacity: .65; text-transform: uppercase; }
.calendar-grid { gap: 5px; }
.cal-cell { aspect-ratio: 1; border: none; border-radius: 13px; padding: 4px; display: flex; flex-direction: column; align-items: center; justify-content: space-between; position: relative; }
.cal-cell span { font-size: 14px; margin-top: 3px; font-variant-numeric: tabular-nums; }
.cal-cell i { position: absolute; top: 3px; right: 4px; width: 6px; height: 6px; border-radius: 99px; }
.dots { display: flex; gap: 3px; margin-bottom: 5px; min-height: 6px; }
.legend { margin-top: 22px; border-radius: 16px; padding: 15px 16px; }
.legend p { margin: 0 0 11px; display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.legend small { opacity: .85; }

.period-switch { display: flex; gap: 6px; margin: 2px 20px 14px; padding: 5px; border-radius: 14px; }
.period-switch button { flex: 1; border: none; border-radius: 10px; padding: 11px 10px; font-weight: 800; }
.stats { display: flex; gap: 11px; margin-bottom: 18px; }
.stat { flex: 1; border-radius: 18px; padding: 15px 16px; }
.stat b { display: block; font-family: var(--serif); font-size: 30px; font-weight: 500; }
.stat span { font-size: 12.5px; opacity: .7; }
.card { border-radius: 20px; padding: 17px; margin-bottom: 16px; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 116px; padding-top: 8px; }
.bars div { flex: 1; min-height: 3px; border-radius: 4px; }
.top-row { display: flex; align-items: center; gap: 11px; margin: 11px 0; }
.top-row span { width: 116px; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-row b { width: 22px; text-align: right; font-size: 13px; opacity: .75; }
.bar-bg { flex: 1; height: 12px; border-radius: 99px; overflow: hidden; }
.bar-bg div { height: 100%; border-radius: 99px; }
.intervention-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-top: 1px solid rgba(0,0,0,.05); }
.intervention-row small { display: block; opacity: .65; margin-top: 3px; }
.intervention-row button { border: none; background: transparent; font-size: 22px; opacity: .5; }

.setting-row { display: flex; align-items: center; gap: 12px; border-radius: 15px; padding: 11px 14px; margin-bottom: 8px; }
/*.setting-row > span:nth-child(2) { flex: 1; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }*/
.setting-row button { border: none; background: transparent; font-size: 20px; }
.setting-row > .label {
    flex: 1;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.setting-row > .label.wrap {
    white-space: normal;
}

.setting-text {
    flex: 1;
    min-width: 0;
}

.setting-text .label {
    display: block;
    font-weight: 700;
}

.hint {
    font-size: 12px;
    opacity: .65;
    margin-top: 2px;
}

.toggle { width: 46px; height: 28px; border-radius: 99px; padding: 3px; display: grid; }
.toggle i { width: 22px; height: 22px; border-radius: 99px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.add-symptom {
    margin-top: 14px;
    margin-bottom: 14px;
    width: 100%;
    border: 1.5px dashed;
    background: transparent;
    border-radius: 15px;
    padding: 14px;
    font-size: 15px;
    font-weight: 800;
}
.add-box {
    margin-top: 14px;
    margin-bottom: 14px;
    border-radius: 18px;
    padding: 16px;
}
.hues { display: flex; flex-wrap: wrap; gap: 10px; }
.hues button { width: 34px; height: 34px; border-radius: 99px; border: none; }
.actions { display: flex; gap: 10px; margin-top: 18px; }
.actions button { flex: 1; border: none; border-radius: 14px; padding: 14px; font-weight: 800; }
.reset { margin-top: 26px; width: 100%; border: none; background: transparent; color: oklch(0.6 0.12 25); font-size: 13.5px; font-weight: 700; padding: 8px; }
.disclaimer { font-size: 12px; text-align: center; opacity: .7; line-height: 1.5; }

.sheet-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(20, 30, 25, 0.35);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 30px;
}

.sheet {
    width: 100%;
    max-width: 390px;
    background: #fff;
    border-radius: 28px;
    padding: 10px 20px 22px;
    box-sizing: border-box;
    box-shadow: 0 12px 40px rgba(0,0,0,.18);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.sheet-handle {
    width: 36px;
    height: 4px;
    border-radius: 999px;
    background: #d7ddd7;
    margin: 0 auto 14px;
}

button.active {
    background: #7ea17d;
    color: white;
}

.save-treatment {
    width: 100%;
    height: 48px;
    border: none;
    border-radius: 16px;
    background: #cfd6cf;
    color: white;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    margin-top: 20px;
    transition: all .15s ease;
}

.save-treatment:disabled {
    background: #d7ddd7;
    color: #f4f4f4;
    cursor: not-allowed;
}

.save-treatment:not(:disabled) {
    background: #789c78;
    color: white;
}

.save-treatment:not(:disabled):hover {
    background: #6f936f;
}

.add-treatment-plus {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 999px;
    background: #e3f1e4;
    color: #2f6f42;
    font-size: 20px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transform: translateY(-2px);
}

.sym-sheet-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sheet-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    flex-shrink: 0;
}

.sheet-subtitle {
    margin: -4px 0 18px;
    font-size: 14px;
    color: #6f766f;
}

.sym-sheet-layer {
    position: absolute;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.sym-sheet-backdrop {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: rgba(35, 45, 38, 0.35);
    backdrop-filter: blur(3px);
}

.sym-sheet {
    position: relative;
    z-index: 2;
    width: 100%;
    background: #ffffff;
    border-radius: 28px 28px 0 0;
    padding: 10px 20px 28px;
    box-sizing: border-box;
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.18);
}

.sym-grab {
    width: 36px;
    height: 4px;
    border-radius: 999px;
    margin: 0 auto 16px;
}

.sym-sheet-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
    font-size: 24px;
    font-weight: 700;
}

.sym-sheet-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    flex-shrink: 0;
}

.sym-sheet-subtitle {
    margin: 0 0 20px;
    font-size: 14px;
    color: #6f766f;
}

.sym-sheet label {
    display: block;
    margin: 16px 0 8px;
    font-size: 13px;
    font-weight: 800;
    color: #687068;
}

.sym-segmented {
    display: flex;
    border-radius: 12px;
    padding: 5px;
    gap: 4px;
}

    .sym-segmented button {
        flex: 1;
        border: none;
        border-radius: 9px;
        background: transparent;
        padding: 12px 0;
        font-size: 14px;
        font-weight: 800;
        cursor: pointer;
    }

.sym-note {
    width: 100%;
    min-height: 86px;
    border: none;
    border-radius: 14px;
    padding: 16px;
    box-sizing: border-box;
    font-size: 14px;
    resize: none;
    outline: none;
}

.sym-save-btn {
    width: 100%;
    height: 50px;
    border: none;
    border-radius: 16px;
    margin-top: 22px;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
}

.registered-box {
    margin-top: 22px;
    border-radius: 16px;
    padding: 0px 16px 16px 16px;
    max-height: 190px;
    overflow-y: auto;
}

.setting-details {
    padding: 14px 14px 0 14px;
}

.field-error {
    font-size: 12px;
    color: #b94a48;
    margin: -4px 0 8px 4px;
}

.input-error {
    border: 1px solid #b94a48 !important;
}

.events-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 18px 2px 10px;
}

.events-head h3 {
    margin: 0;
}

.add-small {
    border: 0;
    border-radius: 12px;
    padding: 8px 14px;
    font-weight: 700;
}

.intervention-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.intervention-title-row strong {
    display: block;
    font-size: 16px;
}

.intervention-title-row small {
    display: block;
    margin-top: 3px;
    color: #7b7b7b;
}

.trash-btn {
    border: 0;
    background: transparent;
    font-size: 16px;
}

.compare-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
}

.compare-box {
    flex: 1;
    border-radius: 12px;
    padding: 12px;
}

.compare-box b {
    display: block;
    font-size: 22px;
    font-weight: 500;
}

.compare-box small {
    font-size: 12px;
    color: #777;
}

.arrow {
    font-size: 30px;
    color: #6aa078;
}

.compare-text {
    margin: 14px 0 0;
    font-size: 14px;
}

.compare-text strong {
    color: #3f8f58;
}

.selected-row {
    display: flex;
    gap: 12px;
}

.settings-select {
    flex: 1;
    background: var(--surface);
    color: var(--ink);
}

input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

.backup-card {
    flex-direction: column;
    align-items: stretch;
    border-radius: 16px;
    gap: 14px;
    padding: 12px;
}

.data-head h3 {
    margin: 0 0 6px;
    font-size: 12px;
    font-weight: 800;
}

.data-head p {
    /*margin: 0;*/
    font-size: 13px;
    line-height: 1.45;
}

.data-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.data-btn {
    width: 100%;
    border-radius: 16px;
    padding: 8px 8px;
    font-size: 14px;
    text-align: center;
    cursor: pointer;
}

.data-btn.primary {
    border: 0;
}

.data-btn.secondary {
    display: block;
    font-size: 14px;
    text-align: center;
}

.reset-link {
    align-self: center;
    border: 0;
    background: transparent;
    color: #c94f4f;
    font-size: 14px;
    padding: 12px 6px 0px 6px;
    margin-top: -2px;
    opacity: .85;
}

.data-message {
    font-size: 12px;
    text-align: center;
}

.profile-btn {
    border-radius: 16px;
    padding: 8px 8px;
    font-size: 14px;
    text-align: center;
    height: 45px;
}

.profile-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .35);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px;
    z-index: 999;
}

.profile-modal {
    width: 100%;
    max-width: 340px;
    border-radius: 22px;
    padding: 22px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .22);
}

.profile-modal h3 {
    margin: 0 0 10px;
    font-size: 18px;
}

.profile-modal p {
    margin: 0;
    font-size: 14px;
    line-height: 1.45;
}

.profile-modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.profile-modal-btn {
    flex: 1;
    border-radius: 14px;
    padding: 12px 14px;
    font-size: 14px;
    font-weight: 750;
    cursor: pointer;
}