:root {
    --bg: #0b0b0f;
    --tile-bg: #ffffff;
    --text: #1a1a1e;
    --muted: #8a8a92;
    --on-dark: #ffffff;
    --on-dark-muted: rgba(255, 255, 255, 0.55);
    --done: #34c759;
    --track: #eeeeee;
    --track-dark: rgba(255, 255, 255, 0.16);
    --danger: #ff3b30;
    --scale: 1;
}

body.text-large {
    --scale: 1.25;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    background: var(--bg);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", Segoe UI, sans-serif;
    -webkit-user-select: none;
    user-select: none;
    overflow: hidden;
}

.stage {
    height: 100dvh;
    width: 100vw;
    display: flex;
    align-items: stretch;
    justify-content: center;
    padding: 4vh 4vw;
}

.card {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
}

.date-block h1 {
    margin: 0;
    font-size: calc(17px * var(--scale));
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--on-dark);
}

#date {
    margin: 45px 0 0;
    font-size: calc(17px * var(--scale));
    color: var(--on-dark-muted);
    text-align: right;
}

.view-toggle {
    display: flex;
    gap: 6px;
    margin-top: 14px;
    visibility: hidden;
}

.toggle-btn {
    padding: 7px 16px;
    border-radius: 20px;
    border: 1px solid var(--on-dark-muted);
    background: transparent;
    font-size: 14px;
    font-weight: 600;
    color: var(--on-dark-muted);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.toggle-btn.active {
    background: var(--on-dark);
    color: var(--text);
    border-color: var(--on-dark);
}

.list-title {
    margin: 0 0 10px;
    padding: 0 2px;
    font-size: calc(34px * var(--scale));
    font-weight: 600;
    color: var(--on-dark-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.list-pager {
    flex: 1;
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.list-pager::-webkit-scrollbar {
    display: none;
}

.list-page {
    flex: 0 0 100%;
    min-width: 0;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.todo-list {
    list-style: none;
    margin: 0;
    padding: 4px 2px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow-y: auto;
    flex: 1;
}

.page-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 12px 0 2px;
}

.page-dot {
    width: 7px;
    height: 7px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: var(--on-dark-muted);
    opacity: 0.4;
    transition: opacity 0.2s ease, transform 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.page-dot.active {
    background: var(--on-dark);
    opacity: 1;
    transform: scale(1.3);
}

.todo-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--tile-bg);
    color: var(--text);
    border-radius: 999px;
    padding: 18px 26px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.label-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.due-date {
    font-size: calc(13px * var(--scale));
    color: var(--muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.todo-item .label {
    font-size: calc(20px * var(--scale));
    transition: color 0.2s ease, opacity 0.2s ease;
}

.todo-item .meta {
    font-size: calc(13px * var(--scale));
    color: var(--muted);
}

.todo-item.done .label {
    color: var(--muted);
    text-decoration: line-through;
    opacity: 0.7;
}

.todo-item.critical .status {
    border-color: var(--danger);
}

@keyframes tile-flash {
    0%, 100% { background-color: var(--tile-bg); }
    50% { background-color: #ffd2cf; }
}

.todo-item.flashing {
    animation: tile-flash 1s ease-in-out infinite;
}

.todo-item.flashing .label {
    color: var(--danger);
    font-weight: 700;
}

.status {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--track);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.todo-item:active .status {
    transform: scale(0.9);
}

.status svg {
    width: 18px;
    height: 18px;
    opacity: 0;
    transform: scale(0.6);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.todo-item.done .status {
    background: var(--done);
    border-color: var(--done);
}

.todo-item.done .status svg {
    opacity: 1;
    transform: scale(1);
}

.empty-state {
    text-align: center;
    color: var(--on-dark-muted);
    font-size: calc(18px * var(--scale));
    margin: 40px 0;
}

.card-footer {
    margin-top: 20px;
    padding: 0 2px;
}

.progress-label {
    margin: 0 0 10px;
    font-size: calc(14px * var(--scale));
    color: var(--on-dark-muted);
    font-weight: 600;
}

.progress-track {
    height: 6px;
    background: var(--track-dark);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: var(--done);
    border-radius: 3px;
    transition: width 0.3s ease;
}
