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

:root,
[data-theme="dark"] {
    --ao-bg: #121312;
    --ao-bg-alt: #171918;
    --ao-surface: rgba(28, 31, 29, 0.88);
    --ao-surface-2: #232826;
    --ao-surface-3: #2c312f;
    --ao-panel: rgba(35, 39, 37, 0.92);
    --ao-panel-soft: #303533;
    --ao-border: rgba(217, 201, 174, 0.12);
    --ao-border-light: rgba(217, 201, 174, 0.22);
    --ao-text: #f6f1e8;
    --ao-text-muted: #c8beb0;
    --ao-text-dim: #94897a;
    --ao-primary: #c79b62;
    --ao-primary-light: #e2bd85;
    --ao-primary-dark: #9a6f3c;
    --ao-primary-glow: rgba(226, 189, 133, 0.16);
    --ao-accent: #99abb6;
    --ao-accent-glow: rgba(153, 171, 182, 0.18);
    --ao-success: #8faa8c;
    --ao-success-bg: rgba(143, 170, 140, 0.16);
    --ao-warning: #d0a163;
    --ao-warning-bg: rgba(208, 161, 99, 0.16);
    --ao-danger: #d97e72;
    --ao-danger-bg: rgba(217, 126, 114, 0.15);
    --ao-info: #8fb3ce;
    --ao-info-bg: rgba(143, 179, 206, 0.15);
    --ao-shadow: 0 24px 80px rgba(3, 5, 4, 0.34);
    --ao-shadow-lg: 0 38px 110px rgba(3, 5, 4, 0.45);
    --ao-radius-sm: 16px;
    --ao-radius: 24px;
    --ao-radius-lg: 34px;
    --ao-transition: 0.24s cubic-bezier(0.22, 1, 0.36, 1);
    color-scheme: dark;
}

[data-theme="light"] {
    --ao-bg: #f2ebde;
    --ao-bg-alt: #e8decd;
    --ao-surface: rgba(255, 251, 244, 0.88);
    --ao-surface-2: #f7efe2;
    --ao-surface-3: #ede2cf;
    --ao-panel: rgba(255, 248, 239, 0.96);
    --ao-panel-soft: #f2e5d3;
    --ao-border: rgba(56, 41, 26, 0.12);
    --ao-border-light: rgba(56, 41, 26, 0.22);
    --ao-text: #23180f;
    --ao-text-muted: #64584c;
    --ao-text-dim: #8c7d6d;
    --ao-primary: #9a6b41;
    --ao-primary-light: #b67f4a;
    --ao-primary-dark: #764f2e;
    --ao-primary-glow: rgba(182, 127, 74, 0.14);
    --ao-accent: #6d8393;
    --ao-accent-glow: rgba(109, 131, 147, 0.14);
    --ao-success: #608163;
    --ao-success-bg: rgba(96, 129, 99, 0.12);
    --ao-warning: #b68044;
    --ao-warning-bg: rgba(182, 128, 68, 0.12);
    --ao-danger: #b55a55;
    --ao-danger-bg: rgba(181, 90, 85, 0.1);
    --ao-info: #5c7e99;
    --ao-info-bg: rgba(92, 126, 153, 0.1);
    --ao-shadow: 0 24px 80px rgba(50, 35, 20, 0.12);
    --ao-shadow-lg: 0 36px 100px rgba(50, 35, 20, 0.16);
    color-scheme: light;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: 'Manrope', 'Segoe UI', sans-serif;
    background:
        radial-gradient(circle at top left, rgba(217, 173, 122, 0.1), transparent 30%),
        radial-gradient(circle at 80% 10%, rgba(153, 171, 182, 0.08), transparent 24%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 32%),
        var(--ao-bg);
    color: var(--ao-text);
    min-height: 100vh;
    letter-spacing: -0.01em;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0.42;
    background:
        linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.18), transparent 72%);
}

body.admin-shell::before {
    background:
        linear-gradient(rgba(255, 255, 255, 0.012) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.012) 1px, transparent 1px);
}

body.app-shell::before {
    display: none;
}

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

a {
    color: var(--ao-primary-light);
    text-decoration: none;
    transition: color var(--ao-transition), opacity var(--ao-transition);
}

a:hover {
    color: var(--ao-accent);
}

h1,
h2,
h3,
h4 {
    margin: 0;
    color: var(--ao-text);
}

h1,
h2,
.page-title,
.panel-title,
.landing-title,
.auth-title,
.logo-text,
.stat-number,
.hp-section-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    letter-spacing: -0.04em;
}

p {
    margin: 0;
    color: var(--ao-text-muted);
    line-height: 1.8;
}

small {
    color: var(--ao-text-dim);
}

code {
    padding: 0.2rem 0.48rem;
    border-radius: 999px;
    background: var(--ao-surface-3);
    color: var(--ao-accent);
    font-size: 0.78rem;
    letter-spacing: 0.02em;
}

hr {
    border: 0;
    border-top: 1px solid var(--ao-border);
    margin: 1.5rem 0;
}

.container {
    max-width: 1480px;
    margin: 0 auto;
    padding: 0 2.25rem;
}

.page-content {
    padding: 2.5rem 0 5.5rem;
}

.app-main {
    position: relative;
    z-index: 1;
}

body.app-shell {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 18%),
        var(--ao-bg);
}

.app-shell .page-content {
    padding: 1.8rem 0 4rem;
}

.app-shell .workspace-title,
.app-shell .page-title,
.app-shell .panel-title {
    font-family: 'Manrope', 'Segoe UI', sans-serif;
    letter-spacing: -0.03em;
    font-weight: 800;
}

.app-shell .navbar-inner {
    min-height: 74px;
    gap: 1.1rem;
}

.app-shell .logo {
    gap: 0.9rem;
}

.app-shell .logo-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    font-size: 1.2rem;
}

.app-shell .logo-text {
    font-size: 1.48rem;
    line-height: 1;
}

.app-shell .logo-text span,
.app-shell .nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.app-shell .nav-links {
    gap: 0.4rem;
    row-gap: 0.5rem;
}

.app-shell .nav-links a {
    padding: 0.62rem 0.9rem;
    font-size: 0.83rem;
}

.app-shell .nav-user {
    gap: 0.65rem;
    padding: 0.2rem 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    font-size: 0.84rem;
}

.app-shell .nav-user-label {
    max-width: 9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.navbar {
    position: sticky;
    top: 0;
    z-index: 200;
    padding: 0 2.25rem;
    border-bottom: 1px solid var(--ao-border);
    background: rgba(18, 19, 18, 0.74);
    backdrop-filter: blur(24px);
}

[data-theme="light"] .navbar {
    background: rgba(242, 235, 222, 0.84);
}

.navbar-inner {
    max-width: 1380px;
    margin: 0 auto;
    min-height: 78px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 1.2rem;
    align-items: center;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.95rem;
}

.logo-icon {
    width: 54px;
    height: 54px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #8f6943, #d2a977 55%, #93a6b7);
    color: white;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.55rem;
    font-weight: 700;
    box-shadow: 0 18px 32px rgba(0, 0, 0, 0.22);
}

.logo-text {
    font-size: 2rem;
    line-height: 0.82;
    color: var(--ao-text);
}

.logo-text span {
    display: block;
    font-size: 1rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-family: 'Manrope', 'Segoe UI', sans-serif;
    font-weight: 700;
    color: var(--ao-text-dim);
    margin-top: 0.2rem;
}

.nav-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    list-style: none;
    padding: 0;
    margin: 0;
    flex-wrap: wrap;
}

.nav-links a {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.72rem 1rem;
    border-radius: 999px;
    color: var(--ao-text-muted);
    border: 1px solid transparent;
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.nav-links a:hover {
    color: var(--ao-text);
    background: rgba(255, 255, 255, 0.035);
}

.nav-links a.active {
    color: var(--ao-text);
    background: var(--ao-surface);
    border-color: var(--ao-border-light);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
}

.nav-icon {
    opacity: 0.72;
}

.nav-user {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.48rem 0.6rem 0.48rem 0.55rem;
    border-radius: 999px;
    background: var(--ao-surface);
    border: 1px solid var(--ao-border);
    box-shadow: 0 16px 28px rgba(0, 0, 0, 0.12);
    font-size: 0.88rem;
    font-weight: 700;
}

.nav-user-dot {
    width: 0.58rem;
    height: 0.58rem;
    border-radius: 50%;
    background: var(--ao-success);
}

.theme-toggle {
    width: 2.7rem;
    height: 2.7rem;
    border-radius: 999px;
    border: 1px solid var(--ao-border);
    background: transparent;
    color: var(--ao-text-muted);
    cursor: pointer;
    display: inline-grid;
    place-items: center;
    transition: all var(--ao-transition);
}

.theme-toggle:hover {
    border-color: var(--ao-border-light);
    background: rgba(255, 255, 255, 0.04);
    color: var(--ao-text);
}

.storage-banner,
.flash-msg {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    padding: 1rem 1.1rem;
    border-radius: 20px;
    border: 1px solid var(--ao-border);
    background: var(--ao-surface);
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.1);
}

.flash-messages {
    display: grid;
    gap: 0.7rem;
    margin-bottom: 1.25rem;
}

.storage-banner {
    margin-bottom: 1.25rem;
}

.storage-banner-warning,
.flash-warning {
    border-color: rgba(208, 161, 99, 0.28);
    background: linear-gradient(180deg, rgba(208, 161, 99, 0.12), transparent 160%), var(--ao-surface);
    color: var(--ao-warning);
}

.flash-success {
    border-color: rgba(143, 170, 140, 0.32);
    color: var(--ao-success);
}

.flash-error {
    border-color: rgba(217, 126, 114, 0.32);
    color: var(--ao-danger);
}

.flash-info {
    border-color: rgba(143, 179, 206, 0.32);
    color: var(--ao-info);
}

.editorial-page,
.workspace-stack {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.editorial-hero,
.landing-hero,
.auth-form-card,
.surface-panel,
.surface-note,
.landing-panel,
.auth-stage-card {
    border: 1px solid var(--ao-border);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 180px), var(--ao-surface);
    box-shadow: var(--ao-shadow);
}

.editorial-hero,
.landing-hero {
    border-radius: 34px;
    padding: 1.8rem;
}

.editorial-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
    gap: 1.5rem;
    align-items: stretch;
}

.app-shell .editorial-hero {
    grid-template-columns: 1fr;
    gap: 0.8rem;
    padding: 0 0 0.95rem;
    border: 0;
    border-bottom: 1px solid var(--ao-border);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.app-shell .editorial-hero .image-card {
    display: none;
}

.app-shell .page-title {
    font-size: clamp(2rem, 3.6vw, 3rem);
}

.app-shell .hero-copy {
    gap: 0.75rem;
}

.app-shell .lead {
    max-width: 58ch;
    font-size: 1rem;
}

.app-shell .metric-card {
    min-width: 8rem;
    padding: 0.9rem 0.95rem;
}

.workspace-page {
    gap: 1.5rem;
}

.workspace-header {
    display: grid;
    gap: 1rem;
    padding: 0 0 1.4rem;
    border-bottom: 1px solid var(--ao-border);
}

.workspace-header-top {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1.4rem;
    flex-wrap: wrap;
}

.workspace-header-copy {
    max-width: 60rem;
    display: grid;
    gap: 0.5rem;
}

.workspace-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: clamp(2rem, 3.3vw, 2.85rem);
    line-height: 1.02;
    letter-spacing: -0.04em;
    color: var(--ao-text);
}

.workspace-summary {
    max-width: 72ch;
    font-size: 1rem;
    line-height: 1.75;
}

.workspace-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
}

.workspace-stat {
    min-width: 9rem;
    padding: 0.9rem 1rem;
    border-radius: 16px;
    border: 1px solid var(--ao-border);
    background: var(--ao-panel);
    display: grid;
    gap: 0.24rem;
}

.workspace-stat span {
    color: var(--ao-text-dim);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.workspace-stat strong {
    color: var(--ao-text);
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.25;
    word-break: break-word;
}

.workspace-header .workspace-actions,
.app-shell .hero-actions,
.app-shell .quick-actions {
    gap: 0.7rem;
}

.app-shell .surface-panel {
    border-radius: 24px;
    padding: 1.35rem;
    box-shadow: 0 18px 40px rgba(3, 5, 4, 0.16);
}

.app-shell .surface-panel-header {
    margin-bottom: 1.1rem;
    align-items: flex-start;
}

.app-shell .panel-title {
    font-size: 1.32rem;
    line-height: 1.1;
}

.app-shell .panel-kicker {
    padding: 0.32rem 0.7rem;
    font-size: 0.66rem;
}

.app-shell .empty-state {
    padding: 2rem 1.4rem;
}

.hero-copy,
.landing-copy {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 1rem;
    min-width: 0;
}

.eyebrow,
.panel-kicker,
.page-kicker,
.auth-kicker,
.hp-badge,
.image-caption span,
.metric-label {
    display: inline-flex;
    align-self: flex-start;
    gap: 0.35rem;
    align-items: center;
    padding: 0.42rem 0.86rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: var(--ao-text-dim);
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

.page-title,
.landing-title,
.auth-title {
    font-size: clamp(3rem, 5vw, 4.7rem);
    line-height: 0.94;
}

.page-title strong,
.landing-title strong {
    color: var(--ao-primary-light);
    font-weight: 700;
}

.lead,
.landing-lead {
    max-width: 60ch;
    font-size: 1.04rem;
}

.hero-metrics,
.metric-strip,
.page-header-meta,
.hp-hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.metric-card,
.page-meta-chip {
    min-width: 9rem;
    padding: 1rem 1.05rem;
    border-radius: 22px;
    border: 1px solid var(--ao-border);
    background: var(--ao-panel);
    display: grid;
    gap: 0.35rem;
}

.metric-card strong,
.page-meta-chip strong {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 2rem;
    color: var(--ao-text);
    line-height: 0.92;
}

.metric-card span,
.page-meta-chip span {
    color: var(--ao-text-dim);
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

.hero-actions,
.quick-actions,
.hp-hero-actions,
.hp-closing-actions,
.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.image-card,
.image-stack-card,
.scene-card {
    position: relative;
    border-radius: 28px;
    overflow: hidden;
    min-height: 100%;
    background: var(--ao-panel-soft);
}

.image-card img,
.image-stack-card img,
.scene-card img,
.landing-shot img,
.auth-stage img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(0.92) contrast(1.02);
}

.image-card::after,
.image-stack-card::after,
.scene-card::after,
.landing-shot::after,
.auth-stage::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.03), rgba(0, 0, 0, 0.58));
}

.image-card--tall {
    min-height: 480px;
}

.image-stack {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 1rem;
    min-height: 100%;
}

.image-stack-col {
    display: grid;
    gap: 1rem;
}

.image-card--short {
    min-height: 230px;
}

.image-caption {
    position: absolute;
    inset: auto 0 0 0;
    z-index: 1;
    padding: 1.25rem 1.25rem 1.35rem;
    display: grid;
    gap: 0.4rem;
}

.image-caption strong {
    font-size: 1.1rem;
    line-height: 1.35;
}

.image-caption p {
    font-size: 0.92rem;
    color: rgba(255, 255, 255, 0.82);
}

.surface-band {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.surface-note,
.landing-panel {
    padding: 1.25rem 1.2rem;
    border-radius: 26px;
}

.surface-note strong {
    display: block;
    margin-bottom: 0.45rem;
    font-size: 1rem;
}

.workspace-grid,
.detail-grid,
.review-grid,
.settings-grid,
.finder-grid,
.admin-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(320px, 0.95fr);
    gap: 1.9rem;
}

.workspace-main,
.workspace-side,
.detail-main,
.detail-side,
.admin-main,
.admin-side {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

.surface-panel {
    border-radius: 30px;
    padding: 1.65rem;
}

.surface-panel-header,
.card-header,
.section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.2rem;
    margin-bottom: 1.2rem;
}

.panel-title,
.card-header h3,
.section-title {
    font-size: 2rem;
    line-height: 0.94;
}

.panel-copy {
    max-width: 56ch;
    line-height: 1.75;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
}

.grid-2,
.grid-3,
.grid-4,
.grid-5,
.admin-stat-row {
    display: grid;
    gap: 1.25rem;
}

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

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

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

.grid-5,
.admin-stat-row {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.stat-card {
    min-height: 150px;
    padding: 1.15rem;
    border-radius: 24px;
    border: 1px solid var(--ao-border);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 130px), var(--ao-panel);
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.stat-label {
    color: var(--ao-text-dim);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.stat-number {
    font-size: 3rem;
    line-height: 0.86;
    color: var(--ao-text);
}

.stat-footer {
    margin-top: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.status-list {
    display: grid;
    gap: 0.35rem;
}

.status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 0;
    border-top: 1px solid var(--ao-border);
}

.status-row:first-child {
    padding-top: 0.1rem;
    border-top: 0;
}

.status-row span {
    color: var(--ao-text-muted);
}

.status-row strong {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 2rem;
    line-height: 0.9;
    color: var(--ao-text);
}

.step-list {
    display: grid;
    gap: 1rem;
}

.step-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 1rem;
    padding: 1.15rem 1.2rem;
    border-radius: 22px;
    border: 1px solid var(--ao-border);
    background: var(--ao-panel);
}

.step-card strong {
    display: block;
    margin-bottom: 0.2rem;
    color: var(--ao-text);
}

.step-number {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--ao-primary-glow);
    color: var(--ao-primary-light);
    font-size: 0.85rem;
    font-weight: 800;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.72rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: capitalize;
}

.badge-new,
.badge-user,
.badge-generated {
    background: rgba(255, 255, 255, 0.05);
    color: var(--ao-text-muted);
}

.badge-enriched,
.badge-ready,
.badge-sent,
.badge-active,
.badge-success,
.badge-info {
    background: var(--ao-success-bg);
    color: var(--ao-success);
}

.badge-approved {
    background: var(--ao-info-bg);
    color: var(--ao-info);
}

.badge-edited,
.badge-skip,
.badge-needs_email {
    background: var(--ao-warning-bg);
    color: var(--ao-warning);
}

.badge-error,
.badge-rejected,
.badge-revoked,
.badge-failed {
    background: var(--ao-danger-bg);
    color: var(--ao-danger);
}

.badge-keyword {
    background: var(--ao-primary-glow);
    color: var(--ao-primary-light);
}

.badge-admin {
    background: rgba(145, 55, 55, 0.18);
    color: #f2aba4;
}

.badge-lg {
    padding: 0.45rem 0.82rem;
    font-size: 0.8rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.9rem 1.28rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: transform var(--ao-transition), box-shadow var(--ao-transition), border-color var(--ao-transition), background var(--ao-transition), color var(--ao-transition);
    text-decoration: none;
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--ao-primary), var(--ao-primary-light));
    color: #fff;
    box-shadow: 0 20px 34px rgba(0, 0, 0, 0.16);
}

.btn-primary:hover {
    color: #fff;
}

.btn-outline {
    background: transparent;
    border-color: var(--ao-border-light);
    color: var(--ao-text);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.04);
}

.btn-ghost {
    background: transparent;
    color: var(--ao-text-muted);
}

.btn-ghost:hover {
    color: var(--ao-text);
    background: rgba(255, 255, 255, 0.04);
}

.btn-danger {
    background: transparent;
    border-color: rgba(217, 126, 114, 0.35);
    color: var(--ao-danger);
}

.btn-danger:hover {
    background: rgba(217, 126, 114, 0.08);
}

.btn-success {
    background: linear-gradient(135deg, var(--ao-success), #a7c6a3);
    color: #fff;
}

.btn-sm {
    padding: 0.6rem 0.9rem;
    font-size: 0.78rem;
}

input,
select,
textarea {
    width: 100%;
    padding: 1rem 1.05rem !important;
    border-radius: 18px !important;
    border: 1px solid var(--ao-border) !important;
    background: var(--ao-panel) !important;
    color: var(--ao-text) !important;
    font-family: inherit !important;
    font-size: 0.94rem !important;
    line-height: 1.55 !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
    transition: border-color var(--ao-transition), box-shadow var(--ao-transition), transform var(--ao-transition);
}

input:focus,
select:focus,
textarea:focus {
    outline: none !important;
    border-color: rgba(217, 173, 122, 0.36) !important;
    box-shadow: 0 0 0 4px rgba(217, 173, 122, 0.08) !important;
}

label {
    display: block;
    margin-bottom: 0;
    color: var(--ao-text-dim);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.form-group {
    margin: 0;
    display: grid;
    gap: 0.4rem;
}

.form-hint {
    margin-top: 0;
    font-size: 0.8rem;
    color: var(--ao-text-dim);
    line-height: 1.6;
}

.checkbox-row {
    align-items: center;
    cursor: pointer;
    display: flex;
    gap: 0.7rem;
    line-height: 1.35;
}

.checkbox-row input[type="checkbox"] {
    height: 1rem;
    margin: 0;
    width: 1rem;
}

.diagnostic-grid {
    display: grid;
    gap: 0.8rem;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.diagnostic-card {
    background: var(--ao-surface-soft);
    border: 1px solid var(--ao-border);
    border-radius: 14px;
    padding: 1rem;
}

.diagnostic-card span {
    color: var(--ao-text-dim);
    display: block;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    margin-bottom: 0.35rem;
    text-transform: uppercase;
}

.diagnostic-card strong {
    display: block;
    font-size: 1rem;
    margin-bottom: 0.35rem;
}

.diagnostic-card p {
    color: var(--ao-text-muted);
    font-size: 0.86rem;
    line-height: 1.45;
    margin: 0;
}

.diagnostic-ready {
    border-color: color-mix(in srgb, var(--ao-success) 40%, var(--ao-border));
}

.diagnostic-blocked {
    border-color: color-mix(in srgb, var(--ao-danger) 48%, var(--ao-border));
}

.diagnostic-waiting {
    border-color: color-mix(in srgb, var(--ao-accent) 42%, var(--ao-border));
}

.toolbar,
.filter-bar,
.bulk-actions {
    border-radius: 26px;
    border: 1px solid var(--ao-border);
    background: var(--ao-surface);
    box-shadow: var(--ao-shadow);
    padding: 1.35rem;
}

.toolbar form,
.filter-bar form,
.bulk-actions form {
    margin: 0;
}

.toolbar-stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chip-row,
.keyword-tags,
.selected-tags,
.results-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.62rem 0.88rem;
    border-radius: 999px;
    border: 1px solid var(--ao-border);
    background: var(--ao-panel);
    color: var(--ao-text-muted);
    font-size: 0.8rem;
    font-weight: 700;
}

.chip strong {
    color: var(--ao-text);
}

.table-wrap {
    overflow-x: auto;
    border-radius: 26px;
    border: 1px solid var(--ao-border);
    background: var(--ao-surface);
    box-shadow: var(--ao-shadow);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: transparent;
}

thead {
    background: rgba(255, 255, 255, 0.035);
}

th {
    padding: 1.05rem 1.2rem;
    text-align: left;
    color: var(--ao-text-dim);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    border-bottom: 1px solid var(--ao-border);
}

td {
    padding: 1.05rem 1.2rem;
    border-bottom: 1px solid var(--ao-border);
    color: var(--ao-text-muted);
    font-size: 0.92rem;
    vertical-align: top;
}

tr:last-child td {
    border-bottom: none;
}

tbody tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.clickable-row {
    cursor: pointer;
}

.empty-state {
    padding: 2.8rem 2.2rem;
    text-align: center;
    border-radius: 26px;
    border: 1px dashed var(--ao-border-light);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 130px), var(--ao-surface);
}

.empty-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--ao-panel);
    color: var(--ao-primary-light);
    font-size: 1.5rem;
}

.score-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 3rem;
    padding: 0.38rem 0.68rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 800;
}

.score-high {
    background: var(--ao-success-bg);
    color: var(--ao-success);
}

.score-mid {
    background: var(--ao-warning-bg);
    color: var(--ao-warning);
}

.score-low {
    background: var(--ao-danger-bg);
    color: var(--ao-danger);
}

.scores-grid {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.score-item {
    display: grid;
    grid-template-columns: minmax(84px, 96px) minmax(0, 1fr);
    gap: 0.8rem;
    align-items: center;
}

.score-item label {
    margin: 0;
    font-size: 0.68rem;
}

.score-bar-container {
    height: 1.35rem;
    border-radius: 999px;
    overflow: hidden;
    background: var(--ao-surface-3);
}

.score-bar {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: end;
    padding-right: 0.5rem;
    color: white;
    font-size: 0.72rem;
    font-weight: 800;
}

.bar-high {
    background: linear-gradient(90deg, #6a8d67, #95ba92);
}

.bar-mid {
    background: linear-gradient(90deg, #b48144, #d2a463);
}

.bar-low {
    background: linear-gradient(90deg, #b65f55, #d4897c);
}

.warning-count {
    display: inline-grid;
    place-items: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    background: var(--ao-warning-bg);
    color: var(--ao-warning);
    font-size: 0.76rem;
    font-weight: 800;
}

.warnings-panel {
    border-left: 3px solid var(--ao-warning);
}

.warnings-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.5rem;
}

.warning-item {
    padding: 0.72rem 0.86rem;
    border-radius: 18px;
    background: var(--ao-warning-bg);
    color: var(--ao-warning);
    font-size: 0.86rem;
    font-weight: 700;
}

.email-preview {
    padding: 1.5rem;
    border-radius: 22px;
    border: 1px solid var(--ao-border);
    background: rgba(255, 255, 255, 0.02);
    white-space: pre-wrap;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.08rem;
    line-height: 1.8;
    color: var(--ao-text);
}

.subject-option {
    padding: 0.82rem 0.95rem;
    border-radius: 18px;
    border: 1px solid var(--ao-border);
    background: var(--ao-panel);
}

.subject-primary {
    border-color: rgba(217, 173, 122, 0.3);
}

.talking-points {
    margin: 0;
    padding-left: 1.1rem;
    display: grid;
    gap: 0.45rem;
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(300px, 0.9fr) minmax(0, 1.4fr);
    gap: 1.5rem;
    align-items: start;
}

.professor-context,
.draft-content-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.draft-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.footer-bar,
.app-footer,
.hp-footer {
    padding: 1.9rem 2.25rem 2.35rem;
    border-top: 1px solid var(--ao-border);
    color: var(--ao-text-dim);
    font-size: 0.8rem;
}

.app-footer-inner,
.hp-footer-inner {
    max-width: 1380px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.app-footer-tools {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    flex-wrap: wrap;
}

.footer-link-btn,
.chat-fab {
    border-radius: 999px;
    border: 1px solid var(--ao-border-light);
    background: var(--ao-surface);
    color: var(--ao-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.68rem 0.95rem;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 800;
    cursor: pointer;
    transition: background var(--ao-transition), border-color var(--ao-transition), color var(--ao-transition), transform var(--ao-transition);
}

.app-shell .footer-link-btn {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--ao-text-dim);
    font-size: 0.8rem;
    font-weight: 700;
    box-shadow: none;
}

/* Floating assistant FAB on app pages: a clean circular button. */
.app-shell .chat-fab {
    width: 56px;
    height: 56px;
    padding: 0;
    gap: 0;
    border: 0;
    border-radius: 50%;
    background: var(--ao-primary);
    color: #1a1206;
    box-shadow: var(--ao-shadow-lg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.app-shell .chat-fab .chat-fab-glyph {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.app-shell .chat-fab svg {
    width: 26px;
    height: 26px;
    display: block;
}

.footer-link-btn:hover,
.chat-fab:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--ao-border-light);
    color: var(--ao-text);
    transform: translateY(-1px);
}

.chat-widget {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    z-index: 1000;
}

.app-shell .footer-link-btn:hover {
    background: transparent;
    color: var(--ao-text);
}

.app-shell .chat-fab:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
}

.chat-panel {
    position: absolute;
    right: 0;
    bottom: calc(100% + 0.8rem);
    width: 380px;
    max-height: 560px;
    display: flex;
    flex-direction: column;
    border-radius: 26px;
    border: 1px solid var(--ao-border);
    background: rgba(28, 31, 29, 0.96);
    box-shadow: var(--ao-shadow-lg);
    backdrop-filter: blur(24px);
    opacity: 0;
    transform: translateY(10px) scale(0.96);
    pointer-events: none;
    transition: all var(--ao-transition);
}

[data-theme="light"] .chat-panel {
    background: rgba(255, 251, 244, 0.96);
}

.chat-panel-open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--ao-border);
}

.chat-close {
    border: 0;
    background: transparent;
    color: var(--ao-text-muted);
    font-size: 1.4rem;
    cursor: pointer;
}

.chat-body {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 0.85rem;
    overflow-y: auto;
    max-height: 340px;
}

.chat-msg-content {
    max-width: 85%;
    padding: 0.72rem 0.88rem;
    border-radius: 18px;
    font-size: 0.85rem;
    line-height: 1.65;
}

.chat-msg-bot .chat-msg-content {
    background: var(--ao-panel);
}

.chat-msg-user {
    justify-content: flex-end;
}

.chat-msg-user .chat-msg-content {
    background: var(--ao-primary);
    color: #fff;
}

.chat-prompts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.chat-prompt-btn {
    border: 1px solid var(--ao-border);
    background: transparent;
    color: var(--ao-text-muted);
    border-radius: 999px;
    padding: 0.42rem 0.75rem;
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
}

.chat-prompt-bug {
    color: var(--ao-danger);
    border-color: rgba(217, 126, 114, 0.3);
}

.chat-input-area {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem;
    border-top: 1px solid var(--ao-border);
}

.chat-input-area input {
    flex: 1;
}

.chat-send-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 0;
    background: var(--ao-primary);
    color: white;
    cursor: pointer;
}

.chat-bug-form {
    border-top: 1px solid var(--ao-border);
}

.chat-confirm {
    margin-top: 0.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.chat-confirm-note {
    font-size: 0.72rem;
    color: var(--ao-text-muted);
}

.chat-confirm-actions {
    display: flex;
    gap: 0.5rem;
}

.chat-confirm-yes,
.chat-confirm-no {
    border-radius: 999px;
    padding: 0.42rem 0.95rem;
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
}

.chat-confirm-yes {
    border: 0;
    background: var(--ao-primary);
    color: #1a1206;
}

.chat-confirm-no {
    border: 1px solid var(--ao-border);
    background: transparent;
    color: var(--ao-text-muted);
}

.chat-confirm-yes:disabled,
.chat-confirm-no:disabled {
    opacity: 0.5;
    cursor: default;
}

.chat-confirm-link {
    display: inline-block;
    margin-top: 0.35rem;
    color: var(--ao-primary);
    font-weight: 700;
    text-decoration: none;
}

.tutorial-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--ao-transition);
    z-index: 500;
}

.tutorial-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.tutorial-card {
    width: min(640px, 100%);
    padding: 2rem;
    border-radius: 30px;
    border: 1px solid var(--ao-border);
    background: var(--ao-surface);
    box-shadow: var(--ao-shadow-lg);
}

.tutorial-step-counter {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.1rem;
}

.tutorial-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--ao-surface-3);
}

.tutorial-dot.active {
    background: var(--ao-primary-light);
}

.tutorial-dot.done {
    background: var(--ao-success);
}

.tutorial-icon {
    font-size: 2.6rem;
    margin-bottom: 0.8rem;
}

.tutorial-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.tutorial-body {
    margin-bottom: 1.25rem;
}

.tutorial-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--ao-border);
}

.tutorial-skip {
    border: 0;
    background: transparent;
    color: var(--ao-text-dim);
    cursor: pointer;
}

.toast {
    position: fixed;
    right: 1.5rem;
    top: 5.25rem;
    z-index: 400;
    display: block;
    width: auto;
    max-width: min(320px, calc(100vw - 2rem));
    height: auto;
    padding: 0.88rem 1rem;
    border-radius: 20px;
    border: 1px solid var(--ao-border);
    background: var(--ao-surface);
    box-shadow: var(--ao-shadow);
    pointer-events: none;
    line-height: 1.4;
    white-space: normal;
}

.toast-success {
    color: var(--ao-success);
}

.toast-error {
    color: var(--ao-danger);
}

.toast-hide {
    opacity: 0;
}

.landing-body {
    padding-top: 1.35rem;
}

.hp-nav {
    position: sticky;
    top: 0;
    z-index: 200;
    padding: 0 1.75rem;
    background: rgba(18, 19, 18, 0.58);
    border-bottom: 1px solid var(--ao-border);
    backdrop-filter: blur(20px);
}

[data-theme="light"] .hp-nav {
    background: rgba(242, 235, 222, 0.76);
}

.hp-nav-inner {
    max-width: 1380px;
    margin: 0 auto;
    min-height: 74px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.hp-nav-meta {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.hp-nav-note {
    color: var(--ao-text-dim);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.landing-main {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    padding: 1.6rem 0 4rem;
}

.landing-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.02fr) minmax(340px, 0.98fr);
    gap: 1.5rem;
    overflow: hidden;
}

.landing-story,
.landing-gallery,
.landing-feature-grid,
.landing-quote-band {
    display: grid;
    gap: 1.2rem;
}

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

.landing-story {
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
}

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

.landing-shot {
    position: relative;
    min-height: 280px;
    overflow: hidden;
    border-radius: 30px;
    border: 1px solid var(--ao-border);
    background: var(--ao-surface);
}

.landing-panel {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1rem;
}

.landing-panel h3,
.surface-note h3 {
    font-size: 1.5rem;
    font-family: 'Cormorant Garamond', Georgia, serif;
}

.landing-quote-band {
    grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
}

.quote-block {
    padding: 1.6rem;
    border-radius: 30px;
    border: 1px solid var(--ao-border);
    background: var(--ao-surface);
    box-shadow: var(--ao-shadow);
}

.quote-block blockquote {
    margin: 0;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 2.15rem;
    line-height: 1.06;
    color: var(--ao-text);
}

.quote-block figcaption {
    margin-top: 1rem;
    color: var(--ao-text-dim);
    font-size: 0.86rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.auth-layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.02fr) minmax(420px, 0.98fr);
}

.auth-stage {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
}

.auth-stage-content {
    position: relative;
    z-index: 1;
    min-height: 100%;
    display: flex;
    align-items: flex-end;
    padding: 2.25rem;
}

.auth-stage-card {
    max-width: 560px;
    padding: 1.8rem;
    border-radius: 30px;
    backdrop-filter: blur(20px);
}

.auth-stage-card p,
.auth-stage-card li {
    color: rgba(255, 255, 255, 0.86);
}

.auth-stage-card ul {
    margin: 0;
    padding-left: 1rem;
    display: grid;
    gap: 0.35rem;
}

.auth-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-form-card {
    width: min(540px, 100%);
    padding: 2rem;
    border-radius: 32px;
}

.auth-form-stack {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.auth-title {
    font-size: clamp(2.7rem, 4vw, 4rem);
}

.auth-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    color: var(--ao-text-dim);
    font-size: 0.86rem;
}

.auth-key-card {
    padding: 1.15rem;
    border-radius: 24px;
    border: 1px solid rgba(143, 170, 140, 0.35);
    background: linear-gradient(180deg, rgba(143, 170, 140, 0.12), transparent 120px), var(--ao-panel);
}

.auth-key-value {
    margin-top: 0.9rem;
    padding: 1rem;
    border-radius: 22px;
    background: var(--ao-surface-2);
    text-align: center;
    word-break: break-all;
}

.auth-note {
    padding: 1rem 1.05rem;
    border-radius: 22px;
    background: var(--ao-panel);
    border: 1px solid var(--ao-border);
}

.page-block {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
}

.split-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
    gap: 1rem;
}

.mini-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.mini-metric {
    padding: 0.75rem 0.92rem;
    border-radius: 20px;
    background: var(--ao-panel);
    border: 1px solid var(--ao-border);
}

.mini-metric strong {
    display: block;
    color: var(--ao-text);
}

.mini-metric span {
    color: var(--ao-text-dim);
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.section {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
}

.results-shell {
    display: flex;
    flex-direction: column;
    gap: 1.35rem;
}

.pill-button {
    border: 1px solid var(--ao-border);
    background: transparent;
    color: var(--ao-text-muted);
    border-radius: 999px;
    padding: 0.62rem 0.92rem;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
}

.pill-button:hover {
    color: var(--ao-text);
    border-color: var(--ao-border-light);
}

.app-footer-mark {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--ao-text-muted);
}

.admin-shell {
    --ao-primary: #c79b62;
    --ao-primary-light: #e2bd85;
    --ao-primary-dark: #9a6f3c;
    --ao-primary-glow: rgba(226, 189, 133, 0.16);
}

.admin-shell .logo-icon {
    background: linear-gradient(135deg, #9a6f3c, #e2bd85 60%, #c9b79c);
}

.admin-note {
    padding: 1rem 1.1rem;
    border-radius: 24px;
    border: 1px solid rgba(207, 118, 107, 0.22);
    background: rgba(207, 118, 107, 0.08);
}

.animate-in {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.animate-visible,
.animate-in.animate-visible {
    opacity: 1;
    transform: translateY(0);
}

.animate-in-1 {
    transition-delay: 0.06s;
}

.animate-in-2 {
    transition-delay: 0.12s;
}

.animate-in-3 {
    transition-delay: 0.18s;
}

.animate-in-4 {
    transition-delay: 0.24s;
}

.animate-in-5 {
    transition-delay: 0.3s;
}

@media (max-width: 1220px) {
    .editorial-hero,
    .landing-hero,
    .workspace-grid,
    .detail-layout,
    .review-grid,
    .settings-grid,
    .finder-grid,
    .admin-grid,
    .split-hero,
    .landing-story,
    .landing-quote-band {
        grid-template-columns: 1fr;
    }

    .grid-5,
    .admin-stat-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .landing-feature-grid,
    .surface-band,
    .landing-gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 980px) {
    .navbar-inner {
        grid-template-columns: 1fr;
        justify-items: start;
        padding: 0.95rem 0;
    }

    .nav-links {
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        width: 100%;
        padding-bottom: 0.35rem;
    }

    .nav-user {
        justify-self: start;
    }

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

    .grid-3,
    .grid-2,
    .landing-feature-grid,
    .surface-band,
    .landing-gallery,
    .stat-grid {
        grid-template-columns: 1fr;
    }

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

    .auth-stage {
        min-height: 52vh;
    }

    .workspace-header-top {
        align-items: flex-start;
    }

    .app-shell .nav-user-label {
        max-width: none;
    }

    .editorial-page .editorial-hero .image-card {
        min-height: 320px;
    }
}

@media (max-width: 720px) {
    .container,
    .navbar,
    .hp-nav,
    .footer-bar,
    .app-footer,
    .hp-footer {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .page-content,
    .landing-main {
        padding-top: 1.2rem;
        padding-bottom: 3.8rem;
    }

    .logo-text {
        font-size: 1.55rem;
    }

    .logo-text span {
        font-size: 0.78rem;
        letter-spacing: 0.1em;
    }

    .navbar-inner {
        gap: 0.8rem;
    }

    .nav-links {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.55rem;
        overflow: visible;
        width: 100%;
        padding-bottom: 0;
    }

    .nav-links li {
        width: 100%;
    }

    .nav-links a {
        width: 100%;
        justify-content: flex-start;
        padding: 0.6rem 0.72rem;
        font-size: 0.84rem;
    }

    .nav-icon {
        display: none;
    }

    .nav-user {
        width: 100%;
        justify-content: flex-start;
        font-size: 0.82rem;
    }

    .workspace-title {
        font-size: 1.8rem;
    }

    .workspace-stats {
        display: grid;
        grid-template-columns: 1fr;
    }

    .workspace-stat {
        min-width: 0;
    }

    .editorial-hero,
    .landing-hero,
    .surface-panel,
    .auth-form-card,
    .auth-stage-card,
    .landing-panel,
    .surface-note,
    .toolbar,
    .filter-bar,
    .bulk-actions,
    .tutorial-card {
        border-radius: 24px;
        padding: 1.2rem;
    }

    .editorial-page .editorial-hero .image-card {
        display: none;
    }

    .workspace-grid,
    .review-grid,
    .finder-grid,
    .detail-layout,
    .settings-grid,
    .admin-grid {
        gap: 1.15rem;
    }

    .page-title,
    .landing-title,
    .auth-title {
        font-size: 2.5rem;
    }

    .panel-title,
    .section-title,
    .card-header h3,
    .quote-block blockquote {
        font-size: 1.7rem;
    }

    th,
    td {
        padding: 0.82rem 0.8rem;
    }

    .help-fab {
        display: none;
    }

    /* Keep the floating assistant reachable on phones (it's a fixed FAB now,
       not part of the hidden footer). Tuck it a little tighter to the corner. */
    .chat-widget {
        right: 1rem;
        bottom: 1rem;
    }

    .chat-panel {
        width: min(92vw, 380px);
        max-height: min(70vh, 560px);
    }
}

@media print {
    .navbar,
    .hp-nav,
    .app-footer,
    .footer-bar,
    .help-fab,
    .chat-widget,
    .tutorial-overlay,
    .action-buttons,
    .quick-actions {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }

    .surface-panel,
    .editorial-hero,
    .landing-hero,
    .table-wrap {
        box-shadow: none;
        background: white;
    }
}

/* App clarity pass: keep the authenticated workspace calm and task-focused. */
body.app-shell {
    --ao-bg: #f6f8fb;
    --ao-bg-alt: #eef2f7;
    --ao-surface: #ffffff;
    --ao-surface-2: #f2f5f9;
    --ao-surface-3: #e8edf4;
    --ao-panel: #ffffff;
    --ao-panel-soft: #f2f5f9;
    --ao-border: #d8e0eb;
    --ao-border-light: #c7d2e1;
    --ao-text: #111827;
    --ao-text-muted: #4b5563;
    --ao-text-dim: #6b7280;
    --ao-primary: #2563eb;
    --ao-primary-light: #1d4ed8;
    --ao-primary-dark: #1e40af;
    --ao-primary-glow: rgba(37, 99, 235, 0.10);
    --ao-accent: #0f766e;
    --ao-accent-glow: rgba(15, 118, 110, 0.10);
    --ao-success: #15803d;
    --ao-success-bg: rgba(21, 128, 61, 0.10);
    --ao-warning: #b45309;
    --ao-warning-bg: rgba(180, 83, 9, 0.10);
    --ao-danger: #b91c1c;
    --ao-danger-bg: rgba(185, 28, 28, 0.10);
    --ao-info: #0369a1;
    --ao-info-bg: rgba(3, 105, 161, 0.10);
    --ao-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
    --ao-shadow-lg: 0 10px 30px rgba(15, 23, 42, 0.08);
    background: var(--ao-bg);
    color: var(--ao-text);
    color-scheme: light;
    letter-spacing: 0;
}

html[data-theme="dark"] body.app-shell {
    --ao-bg: #0f172a;
    --ao-bg-alt: #111827;
    --ao-surface: #111827;
    --ao-surface-2: #172033;
    --ao-surface-3: #1f2937;
    --ao-panel: #111827;
    --ao-panel-soft: #172033;
    --ao-border: #263244;
    --ao-border-light: #334155;
    --ao-text: #f8fafc;
    --ao-text-muted: #cbd5e1;
    --ao-text-dim: #94a3b8;
    --ao-shadow: 0 1px 2px rgba(0, 0, 0, 0.20);
    --ao-shadow-lg: 0 12px 34px rgba(0, 0, 0, 0.28);
    background: var(--ao-bg);
    color-scheme: dark;
}

body.app-shell::before,
.app-shell .app-footer {
    display: none !important;
}

.app-shell h1,
.app-shell h2,
.app-shell h3,
.app-shell h4,
.app-shell .page-title,
.app-shell .panel-title,
.app-shell .workspace-title,
.app-shell .logo-text,
.app-shell .stat-number {
    font-family: 'Manrope', 'Segoe UI', sans-serif;
    letter-spacing: 0;
}

.app-shell p {
    line-height: 1.65;
}

.app-shell .container {
    max-width: 1220px;
    padding-left: 2rem;
    padding-right: 2rem;
}

.app-shell .page-content {
    padding-top: 2rem;
    padding-bottom: 4rem;
}

.app-shell .navbar {
    background: var(--ao-surface);
    border-color: var(--ao-border);
    box-shadow: none;
    backdrop-filter: none;
}

.app-shell .navbar-inner {
    max-width: none;
}

.app-shell .logo-icon {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: #111827;
    box-shadow: none;
    font-family: 'Manrope', 'Segoe UI', sans-serif;
    font-size: 0.85rem;
    letter-spacing: 0;
}

html[data-theme="dark"] .app-shell .logo-icon {
    background: #f8fafc;
    color: #0f172a;
}

.app-shell .logo-text {
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.25;
}

.app-shell .nav-links {
    list-style: none;
    margin: 0;
    padding: 0;
}

.app-shell .nav-links a {
    border-radius: 8px;
    border: 0;
    color: var(--ao-text-muted);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0;
    padding: 0.72rem 0.8rem;
}

.app-shell .nav-links a:hover,
.app-shell .nav-links a.active {
    background: var(--ao-surface-2);
    color: var(--ao-text);
    box-shadow: none;
}

.app-shell .nav-links a.active {
    box-shadow: inset 3px 0 0 var(--ao-primary);
}

.app-shell .nav-user {
    border-radius: 8px;
    background: transparent;
    border: 0;
    box-shadow: none;
    color: var(--ao-text-muted);
    font-size: 0.88rem;
    font-weight: 700;
}

.app-shell .theme-toggle {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 8px;
    background: var(--ao-surface-2);
}

.app-shell .btn {
    border-radius: 8px;
    box-shadow: none;
    letter-spacing: 0;
    padding: 0.72rem 1rem;
}

.app-shell .btn:hover {
    transform: none;
}

.app-shell .btn:disabled,
.app-shell .btn[disabled] {
    background: var(--ao-surface-3);
    border-color: var(--ao-border);
    box-shadow: none;
    color: var(--ao-text-dim);
    cursor: not-allowed;
    opacity: 1;
}

.app-shell .btn-primary {
    background: var(--ao-primary);
    color: #ffffff;
}

.app-shell .btn-primary:hover {
    background: var(--ao-primary-dark);
}

.app-shell .btn-outline {
    background: var(--ao-surface);
    border-color: var(--ao-border-light);
}

.app-shell .btn-ghost {
    border-color: transparent;
}

.app-shell .editorial-page,
.app-shell .workspace-page,
.app-shell .workspace-stack {
    gap: 1.5rem;
}

.app-shell .workspace-header {
    border-bottom: 0;
    display: grid;
    gap: 0.85rem;
    padding: 0;
}

.app-shell .workspace-header-top {
    align-items: flex-start;
    gap: 1rem;
}

.app-shell .workspace-header-copy {
    max-width: 720px;
    gap: 0.35rem;
}

.app-shell .eyebrow,
.app-shell .panel-kicker,
.app-shell .page-kicker {
    background: transparent;
    border: 0;
    color: var(--ao-text-dim);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    padding: 0;
}

.app-shell .workspace-title {
    color: var(--ao-text);
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.15;
    margin: 0;
}

.app-shell .workspace-summary {
    color: var(--ao-text-muted);
    font-size: 0.98rem;
    line-height: 1.65;
    max-width: 62ch;
}

.app-shell .workspace-stats {
    display: none;
}

.app-shell .surface-panel,
.app-shell .auth-note,
.app-shell .storage-banner,
.app-shell .flash-msg,
.app-shell .table-wrap,
.app-shell .empty-state,
.app-shell .step-card,
.app-shell .toolbar,
.app-shell .filter-bar,
.app-shell .bulk-actions,
.app-shell .subject-option,
.app-shell .email-preview {
    background: var(--ao-surface);
    border: 1px solid var(--ao-border);
    border-radius: 8px;
    box-shadow: var(--ao-shadow);
}

.app-shell .surface-panel {
    padding: 1.25rem;
}

.app-shell .surface-panel-header {
    align-items: flex-start;
    border-bottom: 1px solid var(--ao-border);
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.85rem;
}

.app-shell .panel-title {
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1.3;
}

.app-shell .panel-copy {
    color: var(--ao-text-muted);
}

.app-shell .workspace-grid,
.app-shell .detail-grid,
.app-shell .review-grid,
.app-shell .settings-grid,
.app-shell .finder-grid,
.app-shell .admin-grid {
    gap: 1.25rem;
    grid-template-columns: minmax(0, 1fr) 320px;
}

.app-shell .grid-2,
.app-shell .grid-3,
.app-shell .grid-4,
.app-shell .grid-5 {
    gap: 1rem;
}

.app-shell .status-row {
    padding: 0.75rem 0;
}

.app-shell .status-row strong {
    font-family: 'Manrope', 'Segoe UI', sans-serif;
    font-size: 1rem;
    letter-spacing: 0;
}

.app-shell .step-list {
    gap: 0.75rem;
}

.app-shell .step-card {
    gap: 0.85rem;
    padding: 0.95rem;
}

.app-shell .step-number {
    background: var(--ao-primary-glow);
    color: var(--ao-primary);
}

.app-shell input,
.app-shell select,
.app-shell textarea {
    background: var(--ao-surface) !important;
    border-color: var(--ao-border) !important;
    border-radius: 8px !important;
    box-shadow: none;
    color: var(--ao-text) !important;
    font-size: 0.94rem !important;
    padding: 0.78rem 0.85rem !important;
}

.app-shell input:focus,
.app-shell select:focus,
.app-shell textarea:focus {
    border-color: var(--ao-primary) !important;
    box-shadow: 0 0 0 3px var(--ao-primary-glow) !important;
}

.app-shell label {
    color: var(--ao-text-dim);
    letter-spacing: 0.06em;
}

.app-shell .pill-button,
.app-shell .chip,
.app-shell .badge,
.app-shell code,
.app-shell .score-badge {
    border-radius: 999px;
}

.app-shell .pill-button {
    background: var(--ao-surface);
    border-color: var(--ao-border);
    color: var(--ao-text-muted);
}

.app-shell .pill-button:hover {
    background: var(--ao-surface-2);
    border-color: var(--ao-border-light);
}

.app-shell th,
.app-shell td {
    letter-spacing: 0;
    padding: 0.85rem 0.95rem;
}

.app-shell th {
    background: var(--ao-surface-2);
    color: var(--ao-text-dim);
    font-size: 0.72rem;
}

.app-shell td {
    color: var(--ao-text-muted);
    font-size: 0.9rem;
}

.app-shell tbody tr:hover td {
    background: var(--ao-surface-2);
}

.app-shell .empty-state {
    padding: 2rem;
}

.app-shell .empty-state p {
    font-style: normal;
}

.app-shell .empty-icon {
    display: none;
}

.app-shell .flash-messages,
.app-shell .storage-banner {
    margin-bottom: 1rem;
}

.app-shell .storage-banner {
    box-shadow: none;
}

@media (min-width: 981px) {
    body.app-shell {
        padding-left: 264px;
    }

    .app-shell .navbar {
        border-bottom: 0;
        border-right: 1px solid var(--ao-border);
        height: 100svh;
        left: 0;
        padding: 0;
        position: fixed;
        top: 0;
        width: 264px;
        z-index: 300;
    }

    .app-shell .navbar-inner {
        align-items: stretch;
        display: flex;
        flex-direction: column;
        gap: 1.25rem;
        height: 100%;
        min-height: 0;
        padding: 1.25rem 1rem;
    }

    .app-shell .logo {
        padding: 0.25rem 0.25rem 1rem;
    }

    .app-shell .nav-links {
        align-items: stretch;
        display: flex;
        flex-direction: column;
        gap: 0.2rem;
        justify-content: flex-start;
    }

    .app-shell .nav-user {
        align-items: stretch;
        display: grid;
        gap: 0.55rem;
        margin-top: auto;
    }

    .app-shell .nav-user-dot {
        display: none;
    }

    .app-shell .nav-user-label {
        color: var(--ao-text);
        max-width: 100%;
        padding: 0.2rem 0.1rem;
    }

    .app-shell .theme-toggle,
    .app-shell .nav-user .btn {
        justify-self: start;
    }
}

@media (max-width: 1220px) {
    .app-shell .workspace-grid,
    .app-shell .detail-layout,
    .app-shell .review-grid,
    .app-shell .settings-grid,
    .app-shell .finder-grid,
    .app-shell .admin-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 980px) {
    body.app-shell {
        padding-left: 0;
    }

    .app-shell .navbar {
        position: sticky;
        top: 0;
        width: auto;
    }

    .app-shell .navbar-inner {
        display: grid;
        gap: 0.8rem;
        grid-template-columns: 1fr;
        min-height: 0;
        padding: 0.9rem 0;
    }

    .app-shell .nav-links {
        display: flex;
        flex-wrap: nowrap;
        gap: 0.35rem;
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 0.2rem;
        width: 100%;
    }

    .app-shell .nav-links li {
        width: auto;
    }

    .app-shell .nav-links a {
        white-space: nowrap;
        width: auto;
    }

    .app-shell .nav-user {
        display: flex;
        justify-content: flex-start;
        width: 100%;
    }
}

@media (max-width: 720px) {
    .app-shell .container,
    .app-shell .navbar {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .app-shell .page-content {
        padding-top: 1rem;
    }

    .app-shell .nav-links {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 0.35rem;
        overflow: visible;
        padding-bottom: 0;
    }

    .app-shell .nav-links a {
        justify-content: center;
        padding: 0.62rem 0.45rem;
        text-align: center;
        white-space: normal;
    }

    .app-shell .nav-user {
        align-items: center;
    }

    .app-shell .workspace-title {
        font-size: 1.6rem;
    }

    .app-shell .workspace-actions,
    .app-shell .hero-actions,
    .app-shell .quick-actions,
    .app-shell .results-actions {
        width: 100%;
    }

    .app-shell .workspace-actions .btn,
    .app-shell .hero-actions .btn,
    .app-shell .quick-actions .btn {
        width: 100%;
    }

    .app-shell .surface-panel {
        padding: 1rem;
    }

    .app-shell .grid-2,
    .app-shell .grid-3,
    .app-shell .grid-4,
    .app-shell .grid-5,
    .app-shell .stat-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================================================================
   Minimal redesign — global (login / signup / admin / landing pages).
   Loaded after the serif rules above; the app shell (workspace.css) handles
   the authenticated pages separately.
   ========================================================================= */
h1, h2, h3,
.page-title, .panel-title, .landing-title, .auth-title, .logo-text,
.stat-number, .hp-section-title, .hero-title {
    font-family: 'Manrope', 'Segoe UI', system-ui, sans-serif;
    letter-spacing: -0.01em;
}
/* Stock photos out everywhere. */
.image-card, .auth-visual, .hp-hero-visual { display: none !important; }
/* Auth pages: drop the photo stage, center the form card. */
.auth-stage { display: none !important; }
.auth-layout {
    display: flex !important;
    align-items: center;
    justify-content: center;
    min-height: 100svh;
    padding: 2rem;
}
.auth-panel { width: 100%; max-width: 440px; margin: 0 auto; }

/* =========================================================================
   Apple-style auth skin (login / signup) — scoped to body.ap-auth so it
   never touches the app pages. Matches the homepage aesthetic.
   ========================================================================= */
body.ap-auth {
    background: #060606 !important;
    color: #f5f5f7;
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}
body.ap-auth .auth-layout {
    display: flex !important; align-items: center; justify-content: center;
    min-height: 100svh; padding: 2rem;
}
body.ap-auth .auth-stage { display: none !important; }
body.ap-auth .auth-panel { width: 100%; max-width: 440px; margin: 0 auto; }
body.ap-auth .auth-form-card {
    background: #141416; border: 1px solid rgba(255,255,255,0.09);
    border-radius: 22px; padding: 38px 34px; box-shadow: none;
}
body.ap-auth .auth-kicker {
    color: #e2bd85; font-weight: 600; text-transform: none;
    letter-spacing: 0; font-size: 15px; margin-bottom: 6px;
}
body.ap-auth .auth-title,
body.ap-auth h1 { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; color: #f5f5f7; }
body.ap-auth p,
body.ap-auth .form-hint,
body.ap-auth .auth-note p { color: #a1a1a6; }
body.ap-auth label { color: #f5f5f7; font-weight: 600; }
body.ap-auth input {
    background: #0e0e0f; border: 1px solid rgba(255,255,255,0.14);
    color: #f5f5f7; border-radius: 10px;
}
body.ap-auth input::placeholder { color: #6e6e73; }
body.ap-auth input:focus { border-color: #e2bd85; outline: none; box-shadow: 0 0 0 3px rgba(226,189,133,0.22); }
body.ap-auth .btn-primary { background: linear-gradient(135deg, #c79b62, #e2bd85) !important; color: #1a1207 !important; border: 0; border-radius: 980px; font-weight: 650; transition: transform .18s cubic-bezier(.22,1,.36,1), filter .18s ease; }
body.ap-auth .btn-primary:hover { filter: brightness(1.05); transform: translateY(-1px); }
body.ap-auth .btn-outline { border: 1px solid rgba(255,255,255,0.2); color: #f5f5f7; border-radius: 980px; background: transparent; }
body.ap-auth a { color: #e2bd85; }
body.ap-auth .auth-note,
body.ap-auth .auth-key-card {
    background: #0e0e0f; border: 1px solid rgba(255,255,255,0.08); border-radius: 14px;
}
body.ap-auth .flash-error {
    background: rgba(217,126,114,0.14); border: 1px solid rgba(217,126,114,0.34);
    color: #e8b9b0; border-radius: 10px;
}

/* Crafted SVG nav icons (app + admin) — inherit the link's color. */
.nav-icon { display: inline-flex; align-items: center; justify-content: center; }
.nav-icon svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.85; stroke-linecap: round; stroke-linejoin: round; }
