:root {
    --ink: #18212f;
    --muted: #64748b;
    --line: #d9e2ef;
    --paper: #ffffff;
    --accent: #2f7d6d;
}

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    min-height: 100%;
    margin: 0;
}

body {
    overflow: hidden;
    background: #e8eef5;
    color: var(--ink);
    font-family: Arial, Helvetica, sans-serif;
    letter-spacing: 0;
}

.tv-shell {
    width: 100vw;
    height: 100vh;
    padding: 20px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(232, 238, 245, 0.96)), #e8eef5;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 82px;
    margin-bottom: 16px;
    padding: 14px 18px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 18px;
}

.identity {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 14px;
}

.logo-dot {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--accent);
    color: #ffffff;
    font-size: 28px;
    font-weight: 900;
}

h1,
h2,
p {
    margin: 0;
}

h1 {
    font-size: 30px;
    line-height: 1;
}

#tv-date {
    margin-top: 4px;
    color: var(--muted);
    font-size: 18px;
    font-weight: 700;
}

.clock-wrap {
    text-align: right;
}

#day-greeting {
    display: block;
    color: var(--muted);
    font-size: 16px;
    font-weight: 800;
    text-transform: uppercase;
}

.clock {
    margin-top: 2px;
    color: var(--ink);
    font-size: 46px;
    line-height: 1;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}

.dashboard-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    width: calc(100% - 8px);
    height: calc(100vh - 138px);
    align-content: stretch;
}

.dashboard-grid > article {
    min-width: 0;
    min-height: 0;
    padding: 16px;
    overflow: hidden;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 18px;
}

.agenda-card {
    flex: 0 0 100%;
    height: calc(66% - 8px);
}

.shopping-card {
    flex: 0 0 calc(46% - 11px);
    height: calc(34% - 8px);
}

.dates-card,
.payments-card {
    flex: 0 0 calc(27% - 11px);
    height: calc(34% - 8px);
}

.scene-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 52px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.eyebrow {
    color: var(--muted);
    font-size: 13px;
    font-weight: 900;
    text-transform: uppercase;
}

.scene-heading h2 {
    margin-top: 2px;
    font-size: 26px;
    line-height: 1.05;
}

.agenda-list-window,
.shopping-list-window {
    height: calc(100% - 60px);
    overflow: hidden;
}

.liam-now {
    height: 178px;
    margin-bottom: 12px;
}

.task-list-window {
    height: calc(100% - 190px);
    overflow: hidden;
    position: relative;
}

.agenda-card .agenda-list-tv {
    position: relative;
}

.agenda-list-tv,
.shopping-list-tv,
.compact-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.shopping-scroll .shopping-list-tv {
    animation: shopping-roll 42s linear infinite;
}

.agenda-item {
    display: flex;
    align-items: center;
    min-height: 72px;
    gap: 14px;
    padding: 10px 2px;
    border-bottom: 1px solid var(--line);
}

.agenda-routine {
    min-height: 94px;
}

.agenda-routine.is-now {
    height: 170px;
    margin: 8px 0 0;
    padding: 14px;
    background: #fff8df;
    border: 2px solid #f0c54a;
    border-radius: 14px;
}

.liam-empty {
    margin: 8px 0 12px;
    padding: 14px;
    background: #edf7f4;
    border-left: 5px solid var(--accent);
    border-radius: 12px;
}

.liam-empty strong {
    display: block;
    font-size: 24px;
    font-weight: 900;
}

.liam-empty span {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 16px;
    font-weight: 700;
}

.agenda-photo {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 180px;
    width: 180px;
    height: 136px;
    overflow: hidden;
    background-position: center;
    background-size: cover;
    border-radius: 12px;
    color: #ffffff;
    font-size: 72px;
    font-weight: 900;
}

.agenda-main {
    min-width: 0;
    flex: 1 1 auto;
}

.agenda-list-tv {
    display: table;
    width: 100%;
    table-layout: fixed;
}

.task-row {
    display: table-row;
}

.task-row > * {
    display: table-cell;
    vertical-align: middle;
    height: 42px;
    padding: 0 10px;
    border-bottom: 1px solid var(--line);
    overflow: hidden;
    line-height: 1.1;
    text-overflow: ellipsis;
}

.task-time {
    width: 132px;
    color: var(--ink);
    font-size: 18px;
    font-weight: 900;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.task-row strong {
    width: 32%;
    color: var(--ink);
    font-size: 19px;
    font-weight: 900;
    white-space: nowrap;
}

.task-row span:not(.task-time) {
    width: 18%;
    color: var(--muted);
    font-size: 16px;
    font-weight: 800;
    white-space: nowrap;
}

.task-row em {
    color: #334155;
    font-size: 16px;
    font-style: normal;
    font-weight: 700;
}

.agenda-main strong {
    display: block;
    overflow: hidden;
    color: var(--ink);
    font-size: 26px;
    line-height: 1.05;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.agenda-routine .agenda-main strong {
    font-size: 38px;
}

.agenda-routine .agenda-main small {
    font-size: 24px;
}

.agenda-routine em {
    flex-basis: 180px;
    font-size: 28px;
}

.agenda-main small {
    display: block;
    margin-top: 5px;
    overflow: hidden;
    color: var(--muted);
    font-size: 17px;
    line-height: 1.1;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.agenda-item em {
    flex: 0 0 142px;
    color: var(--ink);
    font-size: 21px;
    font-style: normal;
    font-weight: 900;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.shopping-list-tv li,
.compact-list li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
    align-items: center;
    min-height: 44px;
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
}

.shopping-list-tv strong,
.compact-list strong {
    overflow: hidden;
    color: var(--ink);
    font-size: 20px;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.shopping-list-tv span,
.compact-list small {
    color: var(--muted);
    font-size: 15px;
    font-weight: 800;
}

.shopping-list-tv em {
    color: var(--ink);
    font-size: 17px;
    font-style: normal;
    font-weight: 900;
}

.empty-state {
    padding: 12px 0;
    color: var(--muted);
    font-size: 18px;
    font-weight: 800;
}

@keyframes shopping-roll {
    0% {
        transform: translateY(0);
    }

    18% {
        transform: translateY(0);
    }

    82% {
        transform: translateY(calc(-100% + 100px));
    }

    100% {
        transform: translateY(0);
    }
}

.rest-screen {
    position: fixed;
    inset: 0;
    z-index: 15;
    display: none;
    align-items: flex-end;
    justify-content: flex-start;
    padding: 0 0 7vh 7vw;
    background: linear-gradient(90deg, rgba(7, 12, 22, 0.78), rgba(7, 12, 22, 0.22) 58%, rgba(7, 12, 22, 0.48)), url("../img/rest-nature.png"), #111827;
    background-position: center;
    background-size: cover;
}

.rest-content {
    color: #ffffff;
}

.rest-content p {
    color: rgba(255, 255, 255, 0.84);
    font-size: 30px;
    font-weight: 800;
    text-transform: uppercase;
}

.rest-content strong {
    display: block;
    margin-top: 4px;
    font-size: 158px;
    line-height: 1;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 18px 50px rgba(0, 0, 0, 0.42);
}

.rest-content span {
    display: block;
    max-width: 900px;
    margin-top: 12px;
    color: rgba(255, 255, 255, 0.88);
    font-size: 34px;
    font-weight: 800;
}

.rest-mode .rest-screen {
    display: flex;
}

.rest-mode .dashboard-grid,
.rest-mode .topbar {
    opacity: 0;
}

.liam-celebration {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.36);
    pointer-events: none;
}

.liam-celebration.is-visible {
    display: flex;
}

.celebration-card {
    position: relative;
    min-width: 58vw;
    max-width: 82vw;
    padding: 54px 64px;
    overflow: hidden;
    background: #fff8df;
    border: 5px solid #facc15;
    border-radius: 34px;
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.28);
    text-align: center;
    animation: celebration-pop 0.46s ease-out both;
}

.celebration-card strong {
    position: relative;
    z-index: 2;
    display: block;
    color: #18212f;
    font-size: 70px;
    line-height: 1;
    font-weight: 950;
}

.celebration-card span {
    position: relative;
    z-index: 2;
    display: block;
    margin-top: 18px;
    color: #2f7d6d;
    font-size: 42px;
    font-weight: 900;
}

.celebration-burst {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.celebration-burst i {
    position: absolute;
    top: -12%;
    width: 18px;
    height: 34px;
    border-radius: 5px;
    animation: celebration-fall 2.6s linear infinite;
}

@keyframes celebration-pop {
    0% {
        transform: scale(0.72);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes celebration-fall {
    0% {
        transform: translateY(-20px) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translateY(540px) rotate(260deg);
        opacity: 0;
    }
}

.soft-dim .tv-shell {
    background: #dde6ef;
}

.soft-dim .dashboard-grid > article,
.soft-dim .topbar {
    background: #f8fafc;
}

.burn-shift-1 .topbar,
.burn-shift-1 .dashboard-grid {
    transform: translate(3px, 5px);
}

.burn-shift-2 .topbar,
.burn-shift-2 .dashboard-grid {
    transform: translate(-4px, 7px);
}

.burn-shift-3 .topbar,
.burn-shift-3 .dashboard-grid {
    transform: translate(5px, -5px);
}

.burn-shift-4 .topbar,
.burn-shift-4 .dashboard-grid {
    transform: translate(-4px, -5px);
}

.burn-shift-5 .topbar,
.burn-shift-5 .dashboard-grid {
    transform: translate(5px, 8px);
}

.burn-shift-6 .topbar,
.burn-shift-6 .dashboard-grid {
    transform: translate(-5px, 4px);
}

.burn-shift-7 .topbar,
.burn-shift-7 .dashboard-grid {
    transform: translate(3px, -7px);
}

@media (max-height: 760px) and (min-width: 900px) {
    .tv-shell {
        padding: 14px;
    }

    .topbar {
        height: 68px;
        margin-bottom: 12px;
    }

    .clock {
        font-size: 38px;
    }

    .dashboard-grid {
        height: calc(100vh - 94px);
        gap: 12px;
        width: calc(100% - 6px);
    }

    .dashboard-grid > article {
        padding: 12px;
        border-radius: 14px;
    }

    .agenda-card {
        height: calc(66% - 6px);
    }

    .shopping-card {
        flex-basis: calc(46% - 8px);
        height: calc(34% - 6px);
    }

    .dates-card,
    .payments-card {
        flex-basis: calc(27% - 8px);
        height: calc(34% - 6px);
    }

    .scene-heading {
        height: 46px;
        padding-bottom: 8px;
    }

    .scene-heading h2 {
        font-size: 22px;
    }

    .agenda-item {
        min-height: 58px;
        padding: 7px 0;
    }

    .agenda-routine {
        min-height: 78px;
    }

    .agenda-photo {
        flex-basis: 136px;
        width: 136px;
        height: 96px;
    }

    .agenda-main strong {
        font-size: 22px;
    }

    .agenda-main small {
        font-size: 15px;
    }

    .agenda-item em {
        flex-basis: 118px;
        font-size: 18px;
    }

    .liam-now {
        height: 126px;
    }

    .agenda-routine.is-now {
        height: 120px;
    }

    .task-list-window {
        height: calc(100% - 138px);
    }

    .agenda-routine .agenda-main strong {
        font-size: 28px;
    }

    .agenda-routine .agenda-main small {
        font-size: 18px;
    }

    .task-row > * {
        height: 34px;
        padding: 0 8px;
    }

    .task-time {
        width: 112px;
        font-size: 15px;
    }

    .task-row strong {
        font-size: 16px;
    }

    .shopping-list-tv strong,
    .compact-list strong {
        font-size: 17px;
    }
}
