:root {
    --app-bg: #fdf9f3;
    --surface: #ffffff;
    --surface-muted: #f7f3ed;
    --surface-container: #f1ede7;
    --surface-container-high: #ebe8e2;
    --ink: #1c1c18;
    --ink-muted: #4f453f;
    --muted: #81756e;
    --outline: #81756e;
    --outline-variant: #d2c4bc;
    --primary: #26170c;
    --primary-container: #3d2b1f;
    --accent: #a03f29;
    --accent-strong: #812914;
    --accent-soft: #ffdad2;
    --tertiary: #ce8832;
    --success: #828e70;
    --danger: #ba1a1a;
    --warning: #ce8832;
    --line: #d2c4bc;
    --shadow: 0 2px 8px rgba(61, 43, 31, 0.10);
    --radius-s: 8px;
    --radius-m: 12px;
    --radius-l: 16px;
    --focus: 0 0 0 3px rgba(160, 63, 41, 0.20);
}

html,
body {
    min-height: 100%;
    background: var(--app-bg);
    color: var(--ink);
}

body {
    margin: 0;
    font-family: 'Fira Sans', 'Helvetica Neue', Arial, sans-serif;
}

a {
    color: inherit;
}

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

input:focus,
select:focus,
textarea:focus,
button:focus,
a:focus {
    outline: none;
    box-shadow: var(--focus);
}

.app-page {
    max-width: 84rem;
    margin: 0 auto;
}

.surface {
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    border-radius: var(--radius-m);
}

.shell-gradient {
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.08), transparent 32%),
        linear-gradient(180deg, #3d2b1f, #26170c);
}

.route-link-active {
    background: var(--accent-soft);
    color: var(--accent);
}

.page-grid {
    display: grid;
    gap: 1.25rem;
}

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

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

.entity-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
    gap: 1rem;
}

.stack-075 > * + * {
    margin-top: 0.75rem;
}

.stack-1 > * + * {
    margin-top: 1rem;
}

.stack-15 > * + * {
    margin-top: 1.5rem;
}

.muted {
    color: var(--muted);
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-weight: 700;
    white-space: nowrap;
    background: #ffdcbc;
    color: #683d00;
}

.data-list {
    display: grid;
    gap: 0.75rem;
}

.empty-copy {
    padding: 1rem;
    border: 1px dashed var(--line);
    border-radius: var(--radius-s);
    color: var(--muted);
    background: var(--surface);
}

.message-list {
    display: grid;
    gap: 0.75rem;
    max-height: 26rem;
    overflow: auto;
}

.message-bubble {
    padding: 0.8rem 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-m);
    background: var(--surface);
}

.message-bubble.self {
    background: var(--accent-soft);
    border-color: rgba(160, 63, 41, 0.2);
}

.hero-auth {
    min-height: 100vh;
}

@media screen and (max-width: 60em) {
    .page-grid-2,
    .page-grid-3 {
        grid-template-columns: 1fr;
    }
}
