:root {
    --bg: #f5f5f2;
    --panel: rgba(255, 255, 255, 0.78);
    --panel-strong: #ffffff;
    --ink: #171717;
    --ink-soft: #5b5b57;
    --line: rgba(23, 23, 23, 0.1);
    --line-strong: rgba(23, 23, 23, 0.16);
    --accent: #111111;
    --danger: #6c2c2c;
    --shadow: 0 20px 50px rgba(17, 17, 17, 0.08);
}
* {
    box-sizing: border-box;
}
html {
    min-height: 100%;
}
body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.85), transparent 25%),
        linear-gradient(180deg, #f8f8f5 0%, #f1f1ed 100%);
    color: var(--ink);
    font-family: "Manrope", "Segoe UI", sans-serif;
}
button,
input,
textarea {
    font: inherit;
}
button {
    color: inherit;
}
.hidden {
    display: none !important;
}
.shell {
    width: min(1460px, calc(100% - 1.5rem));
    margin: 0 auto;
    padding: 1rem 0 1.25rem;
}
.hero {
    display: grid;
    gap: 0.4rem;
    justify-items: start;
    max-width: 980px;
    margin-bottom: 0.8rem;
}

.eyebrow,
.section-label {
    margin: 0;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-soft);
}
.hero h1,
.section-head h2,
.container-head h3,
.session-card h3,
.modal-card h2,
.empty-state h4 {
    margin: 0;
    font-family: "Instrument Serif", Georgia, serif;
    font-weight: 400;
    letter-spacing: 0.01em;
}
.hero h1 {
    font-size: clamp(2.9rem, 5vw, 4.9rem);
    line-height: 0.9;
}
.hero-copy,
.section-copy,
.helper-text,
.container-caption,
.modal-meta,
.empty-state p {
    margin: 0;
    color: var(--ink-soft);
    line-height: 1.6;
}
.compact-copy {
    max-width: 36rem;
}
.setup-banner {
    margin-bottom: 0.75rem;
    padding: 0.85rem 1rem;
    border: 1px solid rgba(108, 44, 44, 0.15);
    border-radius: 18px;
    background: rgba(255, 251, 251, 0.9);
    color: #5d3e3e;
}
.layout {
    display: grid;
    grid-template-columns: minmax(270px, 330px) minmax(0, 1fr);
    column-gap: 0.9rem;
    row-gap: 0.55rem;
    align-items: start;
}

.auth-panel {
    grid-column: 1;
    grid-row: 1;
}

.log-panel {
    grid-column: 1;
    grid-row: 2;
}

.app-panel {
    grid-column: 2;
    grid-row: 1 / span 2;
}
.panel {
    border: 1px solid var(--line);
    border-radius: 28px;
    background: var(--panel);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
}
.auth-panel,
.app-panel,
.log-panel {
    padding: 1rem;
}
.section-head {
    display: grid;
    gap: 0.35rem;
}
.auth-card,
.session-card {
    display: grid;
    gap: 0.8rem;
    margin-top: 0.85rem;
    padding: 0.9rem;
    border-radius: 22px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.72);
}
.auth-toggle {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    padding: 0.25rem;
    border-radius: 999px;
    background: rgba(17, 17, 17, 0.05);
}
.auth-tab {
    border: 0;
    border-radius: 999px;
    padding: 0.62rem 0.8rem;
    background: transparent;
    cursor: pointer;
    font-weight: 700;
}
.auth-tab.active {
    background: var(--panel-strong);
    box-shadow: 0 8px 16px rgba(17, 17, 17, 0.08);
}
.stack-form {
    display: grid;
    gap: 0.75rem;
}
.auth-status {
    min-height: 1.2rem;
}
.auth-status.is-error {
    color: var(--danger);
}
.auth-status.is-success {
    color: #2f5b3f;
}
.field {
    display: grid;
    gap: 0.35rem;
}
.field span {
    font-size: 0.9rem;
    font-weight: 700;
}
.field input,
.entry-form textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--ink);
    transition: border-color 180ms ease, box-shadow 180ms ease;
}
.field input {
    padding: 0.8rem 0.95rem;
}
.field input:focus,
.entry-form textarea:focus {
    outline: none;
    border-color: var(--line-strong);
    box-shadow: 0 0 0 4px rgba(17, 17, 17, 0.05);
}
.primary-button,
.secondary-button {
    border: 0;
    border-radius: 999px;
    padding: 0.88rem 1.05rem;
    cursor: pointer;
    transition: transform 180ms ease, opacity 180ms ease;
}
.primary-button {
    background: var(--accent);
    color: #ffffff;
    font-weight: 700;
}
.secondary-button {
    background: rgba(17, 17, 17, 0.07);
    color: var(--ink);
    font-weight: 700;
}
.danger-button {
    background: rgba(108, 44, 44, 0.08);
    color: var(--danger);
}
.primary-button:hover,
.secondary-button:hover,
.auth-tab:hover,
.entry-dot:hover,
.log-item:hover,
.icon-button:hover {
    transform: translateY(-1px);
}
.primary-button:disabled,
.secondary-button:disabled,
.field input:disabled,
.entry-form textarea:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.panel-top {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: start;
}
.panel-top.compact {
    margin-bottom: 0.7rem;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.55rem;
    min-width: min(100%, 312px);
}
.stat {
    display: grid;
    gap: 0.15rem;
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.72);
}
.stat-value {
    font-size: 1.35rem;
    font-weight: 800;
}
.stat-label {
    color: var(--ink-soft);
    font-size: 0.84rem;
}
.entry-form {
    display: grid;
    gap: 0.6rem;
    margin: 0.7rem 0 0.85rem;
}
.entry-form textarea {
    min-height: 108px;
    max-height: 108px;
    resize: none;
    padding: 0.85rem 1rem;
    line-height: 1.55;
}
.form-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
}
.counter {
    display: inline-flex;
    gap: 0.08rem;
    align-items: baseline;
    font-weight: 800;
    color: var(--ink-soft);
}
.container-panel {
    border-top: 1px solid var(--line);
    padding-top: 0.8rem;
}
.container-head {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: end;
    margin-bottom: 0.55rem;
}
.container-head h3 {
    font-size: 1.7rem;
}
.drift-shell {
    display: grid;
    justify-items: center;
    padding-top: 0.3rem;
}
.drift-lid {
    width: min(300px, 52%);
    height: 22px;
    border-radius: 999px;
    background: linear-gradient(180deg, #1f1f1f, #2d2d2d);
    margin-bottom: -4px;
}
.drift-container {
    position: relative;
    width: min(100%, 760px);
    min-height: 430px;
    border-radius: 34px 34px 108px 108px;
    border: 1px solid rgba(17, 17, 17, 0.1);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(245, 245, 242, 0.84)),
        rgba(255, 255, 255, 0.7);
    box-shadow:
        inset 12px 0 28px rgba(255, 255, 255, 0.75),
        inset -10px 0 18px rgba(17, 17, 17, 0.03);
    overflow: hidden;
    padding: 1rem 0.85rem 1.2rem;
}
.drift-container::before {
    content: "";
    position: absolute;
    top: 8%;
    left: 8%;
    width: 16%;
    height: 42%;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0));
    pointer-events: none;
}
.dot-field {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(10, minmax(0, 1fr));
    gap: 0.75rem 0.55rem;
    min-height: 340px;
    align-content: start;
}
.entry-dot {
    width: 20px;
    height: 20px;
    margin: 0 auto;
    border: 0;
    padding: 0;
    border-radius: 999px;
    background: transparent;
    cursor: pointer;
}
.entry-dot-core {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(180deg, #1a1a1a, #5e615f);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.35),
        0 8px 18px rgba(17, 17, 17, 0.14);
}
.entry-dot.today .entry-dot-core {
    background: linear-gradient(180deg, #1a1a1a, #111111);
}
.entry-dot.in-streak .entry-dot-core {
    box-shadow:
        0 0 0 4px rgba(23, 23, 23, 0.08),
        0 0 0 8px rgba(23, 23, 23, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.35),
        0 8px 18px rgba(17, 17, 17, 0.14);
}
.entry-dot:focus-visible,
.log-item:focus-visible,
.icon-button:focus-visible,
.primary-button:focus-visible,
.secondary-button:focus-visible {
    outline: 3px solid rgba(17, 17, 17, 0.2);
    outline-offset: 3px;
}
.empty-state {
    position: absolute;
    inset: 0;
    display: none;
    place-items: center;
    text-align: center;
    padding: 1.5rem;
}
.empty-state.visible {
    display: grid;
}
.empty-state h4 {
    font-size: 1.75rem;
    margin-bottom: 0.35rem;
}
.log-list {
    display: grid;
    gap: 0.55rem;
    max-height: 610px;
    overflow: auto;
    padding-right: 0.15rem;
}
.log-item {
    display: grid;
    gap: 0.3rem;
    width: 100%;
    text-align: left;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 0.75rem 0.8rem;
    background: rgba(255, 255, 255, 0.78);
    cursor: pointer;
}
.log-meta {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: center;
}
.log-date {
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-soft);
}
.log-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.28rem 0.6rem;
    border-radius: 999px;
    background: rgba(17, 17, 17, 0.08);
    color: var(--ink);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
}
.log-message {
    color: var(--ink);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.modal {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgba(17, 17, 17, 0.18);
    backdrop-filter: blur(8px);
}
.modal-card {
    position: relative;
    width: min(560px, 100%);
    padding: 1.3rem;
    border-radius: 28px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 30px 70px rgba(17, 17, 17, 0.16);
}
.modal-card h2 {
    font-size: 2.4rem;
}
.modal-meta {
    margin-top: 0.5rem;
}
.modal-text {
    margin: 1.2rem 0 1.5rem;
    padding: 1rem;
    border-radius: 22px;
    background: rgba(17, 17, 17, 0.03);
    line-height: 1.8;
    white-space: pre-wrap;
}
.modal-actions {
    display: flex;
    justify-content: flex-start;
}
.icon-button {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 2.5rem;
    height: 2.5rem;
    display: inline-grid;
    place-items: center;
    border: 0;
    border-radius: 999px;
    background: rgba(17, 17, 17, 0.05);
    cursor: pointer;
    font-size: 1.4rem;
}
.toast {
    position: fixed;
    left: 50%;
    bottom: 1.5rem;
    transform: translateX(-50%);
    padding: 0.9rem 1.1rem;
    border-radius: 999px;
    background: #121212;
    color: #ffffff;
    box-shadow: var(--shadow);
    z-index: 20;
}
@media (max-width: 1280px) {
    .layout {
    display: grid;
    grid-template-columns: minmax(270px, 330px) minmax(0, 1fr);
    column-gap: 0.9rem;
    row-gap: 0.55rem;
    align-items: start;
}

.auth-panel {
    grid-column: 1;
    grid-row: 1;
}

.log-panel {
    grid-column: 1;
    grid-row: 2;
}

.app-panel {
    grid-column: 2;
    grid-row: 1 / span 2;
}
    .log-panel {
        grid-column: 1 / -1;
    }
    .log-list {
        max-height: 260px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 760px) {
    .shell {
        width: min(100% - 1rem, 100%);
        padding-top: 1rem;
    }
    .layout {
    display: grid;
    grid-template-columns: minmax(270px, 330px) minmax(0, 1fr);
    column-gap: 0.9rem;
    row-gap: 0.55rem;
    align-items: start;
}

.auth-panel {
    grid-column: 1;
    grid-row: 1;
}

.log-panel {
    grid-column: 1;
    grid-row: 2;
}

.app-panel {
    grid-column: 2;
    grid-row: 1 / span 2;
}
    .panel-top,
    .container-head,
    .form-row {
        display: grid;
    }
    .stats-grid,
    .log-list {
        grid-template-columns: 1fr;
    }
    .hero {
        margin-bottom: 0.75rem;
    }
    .drift-container {
    position: relative;
    width: min(100%, 760px);
    min-height: 430px;
        padding-inline: 0.85rem;
    }
    .dot-field {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(10, minmax(0, 1fr));
    gap: 0.75rem 0.55rem;
    min-height: 340px;
    }
}
@media (max-width: 520px) {
    .hero h1 {
        font-size: 3.2rem;
    }
    .auth-panel,
    .app-panel,
    .log-panel {
        padding: 1rem;
    }
    .drift-lid {
        width: 56%;
    }
    .drift-container {
    position: relative;
    width: min(100%, 760px);
    min-height: 430px;
        border-radius: 30px 30px 92px 92px;
    }
    .dot-field {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(10, minmax(0, 1fr));
    gap: 0.75rem 0.55rem;
    min-height: 340px;
    }
}






