@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@600;700&display=swap');

:root {
    --ink: #030200;
    --muted: #5c6e80;
    --line: #e2e8ed;
    --accent: #785018;
    --accent-dark: #4a2f09;
    --accent-soft: #f3e4cf;
    --blue-soft: #ffe7e7;
    --surface: #ffffff;
    --canvas: #edf2f3;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "DM Sans", sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at 12% 15%, rgba(38, 124, 145, 0.13), transparent 22rem),
        linear-gradient(145deg, #f7fafb 0%, var(--canvas) 100%);
}

.app-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 40px 20px;
}

.agenda-panel {
    width: min(85%, 100%);
    min-height: 640px;
    background: var(--surface);
    border: 1px solid rgba(23, 34, 53, 0.06);
    border-radius: 24px;
    box-shadow: 0 24px 70px rgba(34, 62, 76, 0.14);
    padding: 34px 38px 24px;
}

.agenda-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
}

.eyebrow {
    margin: 0 0 5px;
    color: var(--accent-dark);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

h1 {
    margin: 0;
    font-family: "Manrope", sans-serif;
    font-size: clamp(1.55rem, 4vw, 2.15rem);
    letter-spacing: -0.04em;
}

.live-clock {
    display: flex;
    align-items: baseline;
    flex-shrink: 0;
    color: var(--accent-dark);
}

#clock-time {
    font-family: "Manrope", sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.04em;
}

#clock-period {
    margin-left: 5px;
    font-size: 0.75rem;
    font-weight: 700;
}

.agenda-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    padding-bottom: 22px;
    color: var(--muted);
    border-bottom: 1px solid var(--line);
    font-size: 0.86rem;
}

.agenda-meta strong {
    color: #536276;
    font-weight: 600;
}

.meta-divider {
    width: 3px;
    height: 3px;
    margin: 0 4px;
    border-radius: 50%;
    background: #bdc7d3;
}

.task-list {
    margin: 0;
    padding: 8px 0 0;
    list-style: none;
}

.task-item {
    position: relative;
    display: grid;
    grid-template-columns: 74px 18px minmax(0, 1fr) auto;
    align-items: start;
    gap: 14px;
    min-height: 82px;
    padding: 15px 10px 15px 2px;
    border-bottom: 1px solid var(--line);
    transition: opacity 180ms ease, background 180ms ease;
}

.task-item:last-child {
    border-bottom: 0;
}

.task-item.next {
    margin: 6px -12px;
    padding-left: 14px;
    padding-right: 14px;
    border: 1px solid #92836f;
    border-radius: 14px;
    background: var(--accent-soft);
}
.task-item.past .task-time,
.task-item.past .task-title {
    color: #596575;
}

.task-item.past .task-person {
    color: #596575;
    background: #e7eaed;
}

.task-time {
    padding-top: 2px;
    font-family: "Manrope", sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #203c5a;
}

.task-state {
    width: 9px;
    height: 9px;
    margin-top: 8px;
    border: 2px solid #b8c4d1;
    border-radius: 50%;
    background: #fff;
}

.task-item.next .task-state {
    border-color: var(--accent);
    background: var(--accent);
    box-shadow: 0 0 0 5px rgba(38, 124, 145, 0.14);
}

.task-item.past .task-state {
    border-color: #ccd4de;
    background: #ccd4de;
}

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

.task-title {
    margin: 0;
    font-size: 0.98rem;
    font-weight: 600;
    line-height: 1.45;
}

.task-person {
    display: inline-flex;
    align-items: center;
    margin-top: 8px;
    padding: 4px 10px;
    border-radius: 999px;
    color: var(--accent-dark);
    background: var(--blue-soft);
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.35;
}

.task-duration {
    margin-top: 1px;
    padding: 7px 11px;
    border: 1px solid #d9e3ea;
    border-radius: 10px;
    color: #203c5a;
    background: #f2f6f8;
    font-size: 0.9rem;
    font-weight: 700;
    white-space: nowrap;
}

.task-item.next .task-duration {
    color: var(--accent-dark);
    background: #fff;
    border-color: #c9e0e5;
}

.task-item.past .task-duration {
    color: #596575;
    background: #eceff1;
    border-color: #e0e4e7;
}

.loading-state,
.error-state {
    display: grid;
    place-items: center;
    min-height: 320px;
    color: var(--muted);
}

.error-state {
    color: #a73d3d;
}

@media (max-width: 680px) {
    body {
        background: #f3f6f7;
        -webkit-text-size-adjust: 100%;
    }

    .app-shell {
        display: block;
        min-height: 100vh;
        min-height: 100dvh;
        padding: 0;
    }

    .agenda-panel {
        width: 100%;
        min-height: 100vh;
        min-height: 100dvh;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        padding: max(22px, env(safe-area-inset-top)) 18px max(24px, env(safe-area-inset-bottom));
    }

    .agenda-header {
        align-items: center;
        gap: 10px;
    }

    .agenda-header > div:first-child {
        min-width: 0;
    }

    .eyebrow {
        margin-bottom: 4px;
        font-size: 0.7rem;
        letter-spacing: 0.12em;
    }

    h1 {
        font-size: clamp(1.35rem, 6vw, 1.8rem);
        line-height: 1.2;
        overflow-wrap: anywhere;
    }

    .live-clock {
        min-height: 44px;
        padding: 0 0 0 8px;
    }

    #clock-time {
        font-size: clamp(1.2rem, 5vw, 1.5rem);
    }

    #clock-period {
        margin-left: 3px;
        font-size: 0.68rem;
    }

    .agenda-meta {
        flex-wrap: wrap;
        gap: 5px 8px;
        margin-top: 12px;
        padding-bottom: 16px;
        font-size: 0.78rem;
    }

    .task-item {
        grid-template-columns: 60px 12px minmax(0, 1fr);
        align-items: start;
        column-gap: 9px;
        row-gap: 7px;
        min-height: 0;
        padding: 16px 2px;
    }

    .task-time {
        padding-top: 1px;
        font-size: 1rem;
        white-space: nowrap;
    }

    .task-state {
        margin-top: 7px;
    }

    .task-copy {
        overflow-wrap: anywhere;
    }

    .task-title {
        font-size: 0.96rem;
        line-height: 1.5;
    }

    .task-person {
        max-width: 100%;
        margin-top: 7px;
        padding: 4px 9px;
        font-size: 0.8rem;
        overflow-wrap: anywhere;
    }

    .task-duration {
        grid-column: 3;
        justify-self: start;
        margin-top: 0;
        padding: 5px 9px;
        font-size: 0.8rem;
        white-space: normal;
    }

    .task-item.next {
        margin: 6px -8px;
        padding: 14px 10px;
        border-radius: 12px;
    }

    .loading-state,
    .error-state {
        min-height: 42vh;
        min-height: 42dvh;
        text-align: center;
    }
}

@media (max-width: 380px) {
    .agenda-panel {
        padding-right: 14px;
        padding-left: 14px;
    }

    .task-item {
        grid-template-columns: 54px 10px minmax(0, 1fr);
        column-gap: 7px;
    }

    .task-time {
        font-size: 0.92rem;
    }

    .agenda-meta {
        font-size: 0.74rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}