:root {
    color-scheme: dark;
    --bg: #090909;
    --surface: #151515;
    --surface-raised: #1d1d1d;
    --surface-soft: #242321;
    --text: #f4f1ed;
    --text-secondary: #cbc6c0;
    --muted: #928b84;
    --accent: #a98a72;
    --accent-strong: #c3a084;
    --line: #383431;
    --line-strong: #514940;
    --like: #a97979;
    --helped: #78947f;
    --thought: #7e90aa;
    --danger: #c88484;
    --success: #8dad94;
    --shadow: rgba(0, 0, 0, 0.32);
    --header-height: 76px;
    --content-width: 1180px;
}

[data-theme="light"] {
    color-scheme: light;
    --bg: #f4f2ef;
    --surface: #ffffff;
    --surface-raised: #eeebe7;
    --surface-soft: #e7e2dd;
    --text: #211d19;
    --text-secondary: #4f4943;
    --muted: #756d66;
    --accent: #876149;
    --accent-strong: #694832;
    --line: #d7d0c9;
    --line-strong: #bcb1a7;
    --like: #995f65;
    --helped: #55765f;
    --thought: #596e8c;
    --danger: #9e4f4f;
    --success: #52765b;
    --shadow: rgba(60, 46, 35, 0.12);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-height) + 20px);
}

body {
    min-width: 320px;
    overflow-x: hidden;
    background: var(--bg);
    color: var(--text-secondary);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
}

button,
input,
textarea,
select {
    font: inherit;
}

button,
select {
    cursor: pointer;
}

a {
    color: inherit;
}

img {
    display: block;
    max-width: 100%;
}

.skip-link {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 100;
    padding: 10px 14px;
    background: var(--text);
    color: var(--bg);
    transform: translateY(-160%);
}

.skip-link:focus {
    transform: translateY(0);
}

.page-shell {
    width: min(var(--content-width), calc(100% - 40px));
    margin-inline: auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 30;
    height: var(--header-height);
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: blur(16px);
}

.header-inner {
    width: min(var(--content-width), calc(100% - 40px));
    height: 100%;
    margin-inline: auto;
    display: grid;
    grid-template-columns: minmax(205px, 1fr) auto minmax(205px, 1fr);
    align-items: center;
    gap: 28px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    width: max-content;
    color: var(--text);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 750;
    text-transform: uppercase;
}

.brand img {
    width: 44px;
    height: 44px;
    object-fit: contain;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 30px;
}

.main-nav a {
    position: relative;
    padding: 8px 0;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 650;
}

.main-nav a::after {
    content: "";
    position: absolute;
    inset: auto 0 2px;
    height: 1px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 180ms ease;
}

.main-nav a:hover {
    color: var(--text);
}

.main-nav a:hover::after,
.main-nav a:focus-visible::after {
    transform: scaleX(1);
    transform-origin: left;
}

.header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.button {
    min-height: 44px;
    padding: 0 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 4px;
    font-weight: 750;
    text-decoration: none;
    transition: border-color 180ms ease, background 180ms ease, color 180ms ease, transform 180ms ease;
}

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

.button-primary {
    border-color: var(--accent);
    background: var(--accent);
    color: #080706;
}

.button-primary:hover {
    border-color: var(--accent-strong);
    background: var(--accent-strong);
}

.button-secondary {
    border-color: var(--line-strong);
    background: transparent;
    color: var(--text);
}

.button-secondary:hover {
    border-color: var(--accent);
    background: var(--surface-raised);
}

.icon-button {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    flex: 0 0 42px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--surface);
    color: var(--text);
    font-size: 1rem;
    transition: border-color 180ms ease, background 180ms ease;
}

.icon-button:hover {
    border-color: var(--accent);
    background: var(--surface-raised);
}

.menu-button {
    display: none;
}

:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--accent) 62%, transparent);
    outline-offset: 3px;
}

.daily-hero {
    position: relative;
    min-height: calc(100vh - var(--header-height));
    padding: 86px 0 92px;
    overflow: hidden;
    border-bottom: 1px solid var(--line);
}

.hero-mark {
    position: absolute;
    inset: -80px -150px auto auto;
    width: min(720px, 62vw);
    aspect-ratio: 1;
    background: url("brand-mark.png") center / contain no-repeat;
    opacity: 0.065;
    pointer-events: none;
}

[data-theme="light"] .hero-mark {
    opacity: 0.045;
}

.hero-shell {
    position: relative;
    z-index: 1;
}

.section-kicker,
.quiet-label,
.topic-label,
.coming-soon {
    color: var(--accent-strong);
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
}

.section-kicker {
    margin-bottom: 12px;
}

h1,
h2,
h3,
blockquote {
    color: var(--text);
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 500;
}

h1 {
    max-width: 850px;
    margin-bottom: 44px;
    font-size: clamp(2.45rem, 5.2vw, 5.2rem);
    line-height: 1;
}

.daily-card {
    width: min(900px, 100%);
    margin-inline: auto;
    padding: clamp(28px, 5vw, 58px);
    border: 1px solid var(--line-strong);
    border-top: 3px solid var(--accent);
    border-radius: 6px;
    background: var(--surface);
    box-shadow: 0 24px 70px var(--shadow);
}

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

.daily-date {
    margin-top: 2px;
    color: var(--muted);
    font-size: 0.82rem;
}

.topic-label {
    padding: 6px 10px;
    border: 1px solid var(--line-strong);
    border-radius: 3px;
    text-align: right;
}

blockquote {
    max-width: 770px;
    margin: 48px auto;
    font-size: clamp(2rem, 4.3vw, 4rem);
    line-height: 1.16;
    text-align: center;
}

.quote-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
    gap: 10px;
}

.reaction-button,
.save-button {
    min-height: 48px;
    padding: 8px 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--surface-raised);
    color: var(--text-secondary);
    font-weight: 700;
    transition: border-color 180ms ease, background 180ms ease, color 180ms ease;
}

.reaction-button span:first-child {
    font-size: 1.15rem;
}

.reaction-count {
    min-width: 24px;
    margin-left: auto;
    padding: 1px 6px;
    border: 1px solid var(--line);
    border-radius: 3px;
    color: var(--muted);
    font-size: 0.72rem;
    text-align: center;
}

.reaction-button:hover,
.reaction-button[aria-pressed="true"] {
    color: var(--text);
}

.reaction-like:hover,
.reaction-like[aria-pressed="true"] {
    border-color: var(--like);
    background: color-mix(in srgb, var(--like) 18%, var(--surface));
}

.reaction-helped:hover,
.reaction-helped[aria-pressed="true"] {
    border-color: var(--helped);
    background: color-mix(in srgb, var(--helped) 18%, var(--surface));
}

.reaction-thought:hover,
.reaction-thought[aria-pressed="true"] {
    border-color: var(--thought);
    background: color-mix(in srgb, var(--thought) 18%, var(--surface));
}

.save-button {
    border-color: var(--accent);
    background: transparent;
    color: var(--accent-strong);
}

.save-button:hover,
.save-button[aria-pressed="true"] {
    background: var(--accent);
    color: #080706;
}

.reflection-card {
    width: min(900px, 100%);
    margin: 22px auto 0;
    padding: 26px 30px;
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    align-items: start;
    gap: 22px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: color-mix(in srgb, var(--surface) 86%, transparent);
}

.reflection-number,
.ranking-index,
.explore-index {
    color: var(--muted);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 0.85rem;
}

.reflection-card h2 {
    margin-top: 5px;
    font-size: clamp(1.35rem, 2.4vw, 2rem);
    line-height: 1.3;
}

.saved-section {
    padding: 86px 0;
    border-bottom: 1px solid var(--line);
    background: var(--bg);
}

.saved-quotes-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.saved-quotes-list > .empty-state {
    grid-column: 1 / -1;
}

.saved-quote-card {
    min-width: 0;
    padding: 26px;
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 20px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
}

.saved-quote-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.saved-quote-meta time {
    color: var(--muted);
    font-size: 0.75rem;
}

.saved-quote-card blockquote {
    margin: 0;
    color: var(--text);
    font-size: clamp(1.35rem, 2.5vw, 2rem);
    line-height: 1.28;
    text-align: left;
    overflow-wrap: anywhere;
}

.saved-remove-button {
    width: max-content;
    min-height: 38px;
    padding: 6px 12px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--surface-raised);
    color: var(--text-secondary);
    font-weight: 700;
}

.saved-remove-button:hover {
    border-color: var(--accent);
    color: var(--text);
}

.community-section,
.rankings-section,
.explore-section {
    padding: 96px 0;
}

.community-section {
    background: var(--surface);
}

.rankings-section {
    border-block: 1px solid var(--line);
    background: var(--bg);
}

.explore-section {
    background: var(--surface);
}

.section-heading {
    margin-bottom: 38px;
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 30px;
}

.section-heading h2 {
    max-width: 760px;
    font-size: clamp(2.2rem, 4.7vw, 4.6rem);
    line-height: 1.05;
}

.section-intro {
    max-width: 330px;
    color: var(--muted);
    text-align: right;
}

.privacy-notices {
    margin-bottom: 28px;
    padding: 18px 22px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    border-left: 3px solid var(--accent);
    background: var(--surface-raised);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.connection-status {
    grid-column: 1 / -1;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    color: var(--muted);
}

.connection-status::before {
    content: "";
    width: 8px;
    height: 8px;
    margin-right: 8px;
    display: inline-block;
    border: 2px solid currentColor;
    border-radius: 50%;
}

.connection-status[data-mode="online"] {
    color: var(--success);
}

.connection-status[data-mode="local"] {
    color: var(--accent-strong);
}

.community-layout {
    display: grid;
    grid-template-columns: minmax(280px, 0.78fr) minmax(0, 1.4fr);
    gap: 32px;
    align-items: start;
}

.comment-form {
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--bg);
}

.field-group + .field-group {
    margin-top: 20px;
}

.field-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text);
    font-size: 0.88rem;
    font-weight: 700;
}

.field-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.field-label-row span {
    color: var(--muted);
    font-size: 0.75rem;
}

.field-help {
    margin-top: 7px;
    color: var(--muted);
    font-size: 0.76rem;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--surface);
    color: var(--text);
}

input,
textarea {
    padding: 13px 14px;
}

textarea {
    min-height: 160px;
    resize: vertical;
}

input::placeholder,
textarea::placeholder {
    color: var(--muted);
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--accent);
    outline: 3px solid color-mix(in srgb, var(--accent) 20%, transparent);
}

.publish-button {
    width: 100%;
    margin-top: 22px;
}

.turnstile-container {
    min-height: 65px;
    margin-top: 22px;
}

.turnstile-container[hidden] {
    display: none;
}

.exercise-closing {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
    color: var(--text-secondary);
    font-style: italic;
}

.exercise-period {
    margin-bottom: 14px;
    color: var(--accent-strong);
    font-size: 0.8rem;
    font-weight: 800;
}

.exercise-closing[hidden] {
    display: none;
}

.form-status {
    min-height: 24px;
    margin-top: 10px;
    font-size: 0.82rem;
}

.form-status.error {
    color: var(--danger);
}

.form-status.success {
    color: var(--success);
}

.form-status.warning {
    color: var(--accent-strong);
}

.comments-panel {
    min-width: 0;
}

.comments-toolbar {
    min-height: 54px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.comments-toolbar h3 {
    font-size: 1.65rem;
}

.sort-control {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: 0.8rem;
}

.sort-control select {
    width: auto;
    min-width: 154px;
    padding: 9px 34px 9px 11px;
}

.comments-list {
    display: grid;
    gap: 12px;
}

.comment-card {
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--bg);
}

.comment-card[data-state="pendiente"] {
    border-style: dashed;
    border-color: var(--accent);
}

.comment-header {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.comment-author {
    color: var(--text);
    font-weight: 800;
}

.comment-author-group,
.comment-badges {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.comment-badge {
    padding: 2px 7px;
    border: 1px solid var(--line-strong);
    border-radius: 3px;
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
}

.comment-badge-featured {
    border-color: var(--accent);
    color: var(--accent-strong);
}

.comment-badge-pending {
    border-style: dashed;
    border-color: var(--accent);
    color: var(--text);
}

.comment-badge-local {
    color: var(--muted);
}

.comment-time {
    color: var(--muted);
    font-size: 0.76rem;
}

.comment-text {
    color: var(--text-secondary);
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.comment-footer {
    margin-top: 16px;
    padding-top: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-top: 1px solid var(--line);
}

.comment-topic {
    color: var(--accent-strong);
    font-size: 0.76rem;
    font-weight: 750;
}

.comment-reactions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 7px;
}

.comment-reaction-button {
    min-height: 36px;
    padding: 5px 11px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--surface-raised);
    color: var(--text-secondary);
    font-weight: 700;
}

.comment-reaction-button:hover,
.comment-reaction-button[aria-pressed="true"] {
    border-color: var(--accent);
    color: var(--text);
}

.comment-reaction-button[aria-pressed="true"] {
    background: color-mix(in srgb, var(--accent) 18%, var(--surface-raised));
}

.comment-reaction-button:disabled {
    cursor: not-allowed;
    opacity: 0.52;
}

.comment-reaction-count {
    min-width: 22px;
    padding-left: 7px;
    border-left: 1px solid var(--line);
    text-align: center;
}

.own-comment-note {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
}

.empty-state {
    padding: 34px 22px;
    border: 1px dashed var(--line-strong);
    color: var(--muted);
    text-align: center;
}

.rankings-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-top: 1px solid var(--line);
    border-left: 1px solid var(--line);
}

.ranking-card {
    min-height: 285px;
    padding: 26px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.ranking-card h3 {
    min-height: 66px;
    margin: 14px 0 24px;
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 750;
    line-height: 1.35;
}

.ranking-content {
    display: grid;
    gap: 10px;
}

.ranking-content .empty-ranking {
    color: var(--muted);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.05rem;
    font-style: italic;
}

.ranking-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
    color: var(--text-secondary);
    font-size: 0.82rem;
}

.ranking-item:first-child {
    padding-top: 0;
    border-top: 0;
}

.ranking-item span:first-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ranking-score {
    color: var(--accent-strong);
    font-weight: 800;
}

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

.explore-card,
.exercise-card,
.topics-card {
    position: relative;
    min-height: 260px;
    padding: 30px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--bg);
}

.explore-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-decoration: none;
}

.explore-podcast {
    transition: border-color 180ms ease, transform 180ms ease, background 180ms ease;
}

.explore-podcast:hover {
    border-color: var(--accent);
    background: var(--surface-raised);
    transform: translateY(-2px);
}

.explore-card h3,
.exercise-card h3,
.topics-card h3 {
    margin: 8px 0 12px;
    font-size: clamp(1.8rem, 3vw, 2.8rem);
    line-height: 1.05;
}

.explore-card p:not(.quiet-label),
.exercise-card p:not(.quiet-label) {
    max-width: 500px;
    color: var(--muted);
}

.explore-arrow {
    position: absolute;
    right: 28px;
    bottom: 26px;
    color: var(--accent-strong);
    font-size: 1.7rem;
}

.coming-soon {
    width: max-content;
    padding-top: 18px;
}

.exercise-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 24px;
}

.topics-card {
    grid-column: 1 / -1;
    min-height: 0;
}

.topics-heading {
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    gap: 28px;
}

.topic-status {
    max-width: 280px;
    color: var(--muted);
    font-size: 0.82rem;
    text-align: right;
}

.topic-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.topic-list button {
    min-height: 40px;
    padding: 7px 13px;
    border: 1px solid var(--line);
    border-radius: 3px;
    background: var(--surface);
    color: var(--text-secondary);
    font-weight: 650;
}

.topic-list button:hover,
.topic-list button[aria-pressed="true"] {
    border-color: var(--accent);
    background: var(--surface-raised);
    color: var(--text);
}

.topic-archive {
    margin-top: 34px;
    padding-top: 28px;
    border-top: 1px solid var(--line);
}

.topic-archive[hidden] {
    display: none;
}

.topic-archive-heading {
    margin-bottom: 18px;
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
}

.topic-archive-heading h4 {
    margin-top: 5px;
    font-size: clamp(1.55rem, 3vw, 2.35rem);
}

.topic-archive-heading > p {
    color: var(--muted);
    font-size: 0.8rem;
}

.topic-archive-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.topic-archive-card {
    min-width: 0;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: var(--surface-raised);
}

.topic-archive-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.topic-archive-meta time {
    color: var(--muted);
    font-size: 0.72rem;
    text-align: right;
}

.topic-archive-card blockquote {
    margin: 20px 0;
    color: var(--text);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.32rem;
    line-height: 1.38;
}

.topic-archive-reflection {
    padding-top: 15px;
    border-top: 1px solid var(--line);
}

.topic-archive-reflection p {
    margin-top: 6px;
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.55;
}

.site-footer {
    padding: 38px 0;
    border-top: 1px solid var(--line);
    background: var(--bg);
}

.footer-grid {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 36px;
}

.footer-purpose {
    display: flex;
    align-items: center;
    gap: 16px;
}

.footer-purpose img {
    width: 52px;
    height: 52px;
}

.footer-purpose strong {
    color: var(--text);
    text-transform: uppercase;
}

.footer-purpose p {
    max-width: 540px;
    margin-top: 2px;
    color: var(--muted);
    font-size: 0.84rem;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 24px;
}

.footer-links a,
.footer-links button {
    border: 0;
    background: transparent;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 700;
}

.footer-links a:hover,
.footer-links button:hover {
    color: var(--accent-strong);
}

.site-dialog {
    width: min(500px, calc(100% - 32px));
    margin: auto;
    padding: 28px;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text-secondary);
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
}

.site-dialog::backdrop {
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(4px);
}

.dialog-header {
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.dialog-header h2 {
    font-size: 2rem;
}

.dialog-close {
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--surface-raised);
    color: var(--text);
    font-size: 1.5rem;
}

.site-dialog > .button {
    width: 100%;
    margin-top: 24px;
}

.auth-tabs {
    margin-bottom: 22px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    border: 1px solid var(--line);
    border-radius: 4px;
    overflow: hidden;
}

.auth-tabs button {
    min-height: 44px;
    padding: 8px 12px;
    border: 0;
    background: var(--surface);
    color: var(--muted);
    font-weight: 750;
}

.auth-tabs button + button {
    border-left: 1px solid var(--line);
}

.auth-tabs button[aria-selected="true"] {
    background: var(--accent);
    color: #090909;
}

.auth-form .button,
.account-view .button {
    width: 100%;
    margin-top: 22px;
}

.auth-form[hidden],
.account-view[hidden],
.admin-link[hidden] {
    display: none;
}

.account-view strong {
    display: block;
    margin: 8px 0 4px;
    color: var(--text);
    font-size: 1.4rem;
}

.account-view p:not(.quiet-label) {
    color: var(--muted);
}

.auth-status {
    margin-bottom: 0;
}

@media (max-width: 980px) {
    .header-inner {
        grid-template-columns: 1fr auto;
    }

    .main-nav {
        position: absolute;
        inset: var(--header-height) 0 auto;
        padding: 18px 20px 22px;
        display: none;
        align-items: stretch;
        flex-direction: column;
        gap: 4px;
        border-bottom: 1px solid var(--line);
        background: var(--bg);
        box-shadow: 0 16px 32px var(--shadow);
    }

    .main-nav.open {
        display: flex;
    }

    .main-nav a {
        padding: 12px;
        border-bottom: 1px solid var(--line);
    }

    .main-nav a:last-child {
        border-bottom: 0;
    }

    .main-nav a::after {
        display: none;
    }

    .menu-button {
        display: grid;
    }

    .quote-actions {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .save-button {
        grid-column: 1 / -1;
    }

    .community-layout {
        grid-template-columns: 1fr;
    }

    .rankings-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    :root {
        --header-height: 68px;
    }

    .page-shell,
    .header-inner {
        width: min(var(--content-width), calc(100% - 28px));
    }

    .brand {
        gap: 8px;
        font-size: 0.7rem;
    }

    .brand img {
        width: 38px;
        height: 38px;
    }

    .login-button {
        max-width: 94px;
        min-height: 38px;
        padding: 6px 10px;
        overflow: hidden;
        font-size: 0.7rem;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .admin-link:not([hidden]) {
        display: none;
    }

    .header-actions {
        gap: 8px;
    }

    .daily-hero {
        min-height: 0;
        padding: 58px 0 68px;
    }

    .hero-mark {
        inset: 10px -125px auto auto;
        width: 420px;
    }

    h1 {
        max-width: 330px;
        margin-bottom: 28px;
        font-size: clamp(2.55rem, 13vw, 4rem);
    }

    .daily-card {
        padding: 24px 18px;
    }

    .daily-meta {
        align-items: flex-start;
    }

    .topic-label {
        max-width: 48%;
    }

    blockquote {
        margin: 36px auto;
        font-size: clamp(1.75rem, 8.7vw, 2.7rem);
        text-align: left;
    }

    .quote-actions {
        grid-template-columns: 1fr;
    }

    .save-button {
        grid-column: auto;
    }

    .reaction-button,
    .save-button {
        justify-content: flex-start;
        padding-inline: 14px;
    }

    .reflection-card {
        padding: 22px 18px;
        grid-template-columns: 34px minmax(0, 1fr);
        gap: 12px;
    }

    .saved-quotes-list {
        grid-template-columns: 1fr;
    }

    .community-section,
    .saved-section,
    .rankings-section,
    .explore-section {
        padding: 68px 0;
    }

    .section-heading {
        margin-bottom: 28px;
        align-items: flex-start;
        flex-direction: column;
        gap: 14px;
    }

    .section-heading h2 {
        font-size: clamp(2.3rem, 12vw, 3.8rem);
    }

    .section-intro {
        max-width: none;
        text-align: left;
    }

    .privacy-notices {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .comment-form {
        padding: 20px;
    }

    .comments-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .sort-control {
        width: 100%;
        justify-content: space-between;
    }

    .sort-control select {
        min-width: 0;
        width: 62%;
    }

    .comment-header,
    .comment-footer {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .comment-reactions {
        width: 100%;
        justify-content: flex-start;
    }

    .comment-reaction-button {
        flex: 1 1 145px;
        justify-content: space-between;
    }

    .rankings-grid {
        grid-template-columns: 1fr;
    }

    .ranking-card {
        min-height: 230px;
    }

    .explore-grid {
        grid-template-columns: 1fr;
    }

    .topics-card {
        grid-column: auto;
    }

    .explore-card,
    .exercise-card,
    .topics-card {
        min-height: 230px;
        padding: 24px;
    }

    .topics-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .topic-status {
        text-align: left;
    }

    .topic-list {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .topic-list button {
        width: 100%;
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .topic-archive-heading,
    .topic-archive-meta {
        align-items: flex-start;
        flex-direction: column;
    }

    .topic-archive-heading > p,
    .topic-archive-meta time {
        text-align: left;
    }

    .topic-archive-list {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        align-items: flex-start;
        flex-direction: column;
    }

    .footer-links {
        width: 100%;
        justify-content: space-between;
        gap: 14px;
    }
}

@media (max-width: 380px) {
    .brand span {
        max-width: 98px;
        line-height: 1.15;
    }

    .topic-list {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
