:root {
    --paper: #f7f5ef;
    --surface: #ffffff;
    --ink: #19352e;
    --muted: #6e7d77;
    --line: #dfe5df;
    --green: #245c4d;
    --green-dark: #173e34;
    --green-soft: #dcebe2;
    --peach: #f3b49b;
    --peach-soft: #fbe9df;
    --amber: #a86024;
    --amber-soft: #fff0d9;
    --shadow: 0 18px 55px rgba(32, 60, 49, .07);
    --radius: 24px;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    margin: 0;
    min-width: 320px;
    color: var(--ink);
    background:
        radial-gradient(circle at 8% 8%, rgba(243, 180, 155, .18), transparent 25rem),
        radial-gradient(circle at 95% 35%, rgba(185, 216, 197, .2), transparent 28rem),
        var(--paper);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

button,
input,
textarea {
    font: inherit;
}

button,
a,
input,
textarea {
    -webkit-tap-highlight-color: transparent;
}

button {
    cursor: pointer;
}

button:disabled {
    cursor: wait;
    opacity: .65;
}

.site-header {
    width: min(100% - 40px, 1080px);
    min-height: 88px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: var(--ink);
    text-decoration: none;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -.8px;
}

.brand-dot {
    color: #d58061;
}

.brand-mark,
.ring-mark {
    position: relative;
    display: inline-block;
    width: 31px;
    height: 31px;
    border-radius: 10px;
    background: var(--green);
    transform: rotate(-5deg);
}

.brand-mark span,
.ring-mark span {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 14px;
    height: 3px;
    border-radius: 3px;
    background: white;
    transform: translate(-50%, -50%);
}

.brand-mark span:last-child,
.ring-mark span:last-child {
    transform: translate(-50%, -50%) rotate(90deg);
}

.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
}

.live-indicator > span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #60a781;
    box-shadow: 0 0 0 5px rgba(96, 167, 129, .12);
}

.page-shell {
    width: min(100% - 40px, 900px);
    margin: 0 auto;
    padding: 44px 0 56px;
}

.hero {
    max-width: 680px;
    margin-bottom: 32px;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--green);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.7px;
    text-transform: uppercase;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 14px;
    font-size: clamp(34px, 5.5vw, 54px);
    line-height: 1.08;
    letter-spacing: -2.1px;
}

h2 {
    margin-bottom: 0;
    font-size: 22px;
    line-height: 1.2;
    letter-spacing: -.6px;
}

.hero-subtitle {
    max-width: 590px;
    margin-bottom: 0;
    color: var(--muted);
    font-size: 17px;
}

.muted {
    color: var(--muted);
}

.small {
    font-size: 12px;
}

.status-card {
    position: relative;
    overflow: hidden;
    margin-bottom: 20px;
    padding: 26px 30px 30px;
    border-radius: 30px;
    color: white;
    background: var(--green-dark);
    box-shadow: 0 22px 50px rgba(23, 62, 52, .15);
}

.status-card::after {
    content: "";
    position: absolute;
    right: -90px;
    bottom: -140px;
    width: 340px;
    height: 340px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 50%;
    box-shadow: 0 0 0 45px rgba(255, 255, 255, .025), 0 0 0 90px rgba(255, 255, 255, .02);
    pointer-events: none;
}

.status-card[data-state="late"] {
    background: #65422e;
}

.status-heading {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.status-card .muted {
    color: rgba(255, 255, 255, .65);
}

.status-chip {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 11px;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 999px;
    color: #e6f6e9;
    background: rgba(255, 255, 255, .09);
    font-size: 11px;
    font-weight: 750;
    letter-spacing: .5px;
    text-transform: uppercase;
}

.status-chip[data-state="late"] {
    color: #ffe5ce;
}

.status-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 28px;
}

.countdown-ring {
    --progress: 360deg;
    flex: 0 0 auto;
    width: 118px;
    height: 118px;
    padding: 5px;
    border-radius: 50%;
    background: conic-gradient(var(--peach) var(--progress), rgba(255, 255, 255, .12) 0);
    transform: rotate(-90deg);
}

.countdown-ring-inner {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--green-dark);
    transform: rotate(90deg);
}

.status-card[data-state="late"] .countdown-ring-inner {
    background: #65422e;
}

.ring-mark {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .12);
}

.ring-mark span {
    width: 17px;
}

.status-copy {
    min-width: 0;
}

.status-copy p {
    margin-bottom: 4px;
}

.timer-primary {
    margin-bottom: 5px !important;
    font-size: clamp(30px, 5vw, 44px);
    font-weight: 760;
    line-height: 1.15;
    letter-spacing: -1.7px;
}

.status-message {
    max-width: 470px;
    margin-bottom: 0 !important;
    color: rgba(255, 255, 255, .72);
    font-size: 14px;
}

.panel {
    margin-bottom: 20px;
    padding: 28px;
    border: 1px solid rgba(32, 69, 56, .09);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .9);
    box-shadow: var(--shadow);
}

.section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 23px;
}

.section-number {
    color: #bdc9c3;
    font-size: 13px;
    font-weight: 700;
}

.mood-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 0 0 20px;
    padding: 0;
    border: 0;
}

.mood-option {
    position: relative;
    cursor: pointer;
}

.mood-option input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.mood-option > span {
    display: flex;
    min-height: 88px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    flex-direction: column;
    justify-content: center;
    background: #fbfcfa;
    transition: border-color .18s, background .18s, transform .18s;
}

.mood-option:hover > span {
    transform: translateY(-2px);
    border-color: #b4c9bb;
}

.mood-option input:checked + span {
    border-color: var(--green);
    background: var(--green-soft);
    box-shadow: inset 0 0 0 1px var(--green);
}

.mood-option input:focus-visible + span {
    outline: 3px solid rgba(36, 92, 77, .25);
    outline-offset: 2px;
}

.mood-option strong {
    margin-bottom: 3px;
    font-size: 14px;
}

.mood-option small {
    color: var(--muted);
    font-size: 11px;
}

.field-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 700;
}

.field-label span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 500;
}

input,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    outline: 0;
    color: var(--ink);
    background: #fbfcfa;
    transition: border-color .18s, box-shadow .18s;
}

input {
    height: 46px;
    padding: 0 13px;
}

textarea {
    min-height: 76px;
    padding: 12px 13px;
    resize: vertical;
}

input:focus,
textarea:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(36, 92, 77, .1);
}

input::placeholder,
textarea::placeholder {
    color: #9ba7a1;
}

.button {
    min-height: 46px;
    padding: 0 18px;
    border: 0;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 750;
    transition: transform .18s, background .18s;
}

.button:hover:not(:disabled) {
    transform: translateY(-1px);
}

.button:focus-visible {
    outline: 3px solid rgba(36, 92, 77, .25);
    outline-offset: 2px;
}

.button-primary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 14px;
    color: white;
    background: var(--green);
}

.button-primary:hover:not(:disabled) {
    background: var(--green-dark);
}

.button-secondary {
    color: var(--green-dark);
    background: var(--green-soft);
}

.button-dark {
    color: white;
    background: var(--green-dark);
}

.button-full {
    width: 100%;
}

.form-hint {
    margin: 9px 0 0;
    color: var(--muted);
    font-size: 11px;
    text-align: center;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.metric-panel {
    position: relative;
    min-width: 0;
}

.metric-icon {
    position: absolute;
    top: 25px;
    right: 25px;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 800;
}

.temperature-icon {
    color: #a75c3e;
    background: var(--peach-soft);
}

.medication-icon {
    color: var(--green);
    background: var(--green-soft);
}

.metric-value {
    overflow: hidden;
    margin: 19px 0 0;
    font-size: 38px;
    font-weight: 760;
    line-height: 1.15;
    letter-spacing: -1.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.metric-value-text {
    padding-right: 30px;
    font-size: 26px;
    letter-spacing: -.8px;
}

.metric-panel > .small {
    min-height: 18px;
    margin: 5px 0 0;
}

.compact-form {
    display: grid;
    gap: 9px;
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.input-with-unit {
    position: relative;
}

.input-with-unit input {
    padding-right: 50px;
}

.input-with-unit span {
    position: absolute;
    top: 50%;
    right: 14px;
    color: var(--muted);
    font-size: 13px;
    transform: translateY(-50%);
}

.share-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, .9fr);
    align-items: center;
    gap: 28px;
    background: #eef2e9;
    box-shadow: none;
}

.share-panel h2 {
    margin-bottom: 8px;
}

.share-panel p:last-child {
    margin-bottom: 0;
    font-size: 13px;
}

.share-row {
    display: flex;
    gap: 8px;
}

.share-row input {
    min-width: 0;
    background: white;
    font-size: 11px;
}

.history-section {
    padding: 30px 4px 0;
}

.history-heading {
    align-items: flex-end;
    padding: 0 5px;
}

.history-empty {
    padding: 34px 20px;
    border: 1px dashed #cbd5ce;
    border-radius: 18px;
    color: var(--muted);
    text-align: center;
}

.history-empty p {
    margin-bottom: 3px;
    color: var(--ink);
    font-weight: 650;
}

.history-empty span {
    font-size: 13px;
}

.timeline {
    margin: 0;
    padding: 0;
    list-style: none;
}

.timeline-item {
    position: relative;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 14px;
    padding: 0 5px 25px;
}

.timeline-item:not(:last-child)::before {
    content: "";
    position: absolute;
    top: 40px;
    bottom: 0;
    left: 25px;
    width: 1px;
    background: #d8dfd9;
}

.timeline-symbol {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid #d5e4d8;
    border-radius: 14px;
    color: var(--green);
    background: #eaf2e9;
    font-size: 12px;
    font-weight: 800;
}

.timeline-item[data-type="temperature"] .timeline-symbol {
    border-color: #f1d8c9;
    color: #a75c3e;
    background: var(--peach-soft);
}

.timeline-body {
    min-width: 0;
    padding-top: 1px;
}

.timeline-title {
    margin: 0 0 2px;
    font-size: 14px;
    font-weight: 750;
}

.timeline-detail {
    margin: 0 0 4px;
    overflow-wrap: anywhere;
    color: var(--muted);
    font-size: 13px;
}

.timeline-time {
    display: block;
    color: #89958f;
    font-size: 11px;
}

.delete-event {
    align-self: start;
    margin-top: 4px;
    padding: 4px 6px;
    border: 0;
    color: #9a6868;
    background: transparent;
    font-size: 11px;
}

.delete-event:hover {
    text-decoration: underline;
}

.care-note {
    max-width: 620px;
    margin: 24px auto 0;
    color: #7c8983;
    font-size: 11px;
    text-align: center;
}

.empty-state {
    max-width: 560px;
    margin: 70px auto;
    padding: 35px;
    text-align: center;
}

.empty-state h1 {
    font-size: 34px;
    letter-spacing: -1px;
}

.empty-state > p:last-child {
    color: var(--muted);
}

.empty-symbol {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    margin: 0 auto 25px;
    border-radius: 18px;
    color: white;
    background: var(--green);
    font-size: 30px;
}

.loader {
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid #d8e2da;
    border-top-color: var(--green);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}

.empty-state .loader + p {
    margin-top: 15px;
    color: var(--muted);
}

.toast {
    position: fixed;
    z-index: 10;
    right: 20px;
    bottom: 20px;
    max-width: min(390px, calc(100% - 40px));
    padding: 13px 18px;
    border-radius: 13px;
    color: white;
    background: var(--green-dark);
    box-shadow: 0 12px 35px rgba(20, 45, 37, .2);
    font-size: 13px;
    animation: toast-in .2s ease-out;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes toast-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 680px) {
    .site-header {
        width: min(100% - 30px, 1080px);
        min-height: 72px;
    }

    .live-indicator {
        max-width: 90px;
        line-height: 1.3;
        text-align: right;
    }

    .page-shell {
        width: min(100% - 28px, 900px);
        padding-top: 30px;
    }

    h1 {
        letter-spacing: -1.4px;
    }

    .hero-subtitle {
        font-size: 15px;
    }

    .status-card {
        padding: 22px;
        border-radius: 24px;
    }

    .status-heading {
        align-items: flex-start;
        margin-bottom: 22px;
    }

    .status-heading .small {
        max-width: 140px;
        text-align: right;
    }

    .status-content {
        gap: 18px;
    }

    .countdown-ring {
        width: 88px;
        height: 88px;
    }

    .ring-mark {
        width: 32px;
        height: 32px;
    }

    .timer-primary {
        font-size: 29px;
        letter-spacing: -1px;
    }

    .status-message {
        font-size: 12px;
    }

    .panel {
        padding: 22px;
        border-radius: 20px;
    }

    .mood-options {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .mood-option > span {
        min-height: 66px;
        padding: 12px 15px;
    }

    .metrics-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .share-panel {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .share-row {
        flex-direction: column;
    }

    .share-row .button {
        width: 100%;
    }

    .timeline-item {
        grid-template-columns: 38px minmax(0, 1fr) auto;
        gap: 11px;
    }

    .timeline-symbol {
        width: 38px;
        height: 38px;
    }

    .timeline-item:not(:last-child)::before {
        left: 24px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
