:root {
    color-scheme: light;
    --th-color-ink: #0f172a;
    --th-color-surface: #ffffff;
    --th-color-surface-muted: #f1f5f9;
    --th-color-border: #cbd5e1;
    --th-color-primary: #12304a;
    --th-color-accent: #c58b18;
    --th-color-danger: #b42318;
    --th-color-success: #067647;
    --th-radius-control: 0.75rem;
    --th-radius-panel: 1rem;
    --th-focus-ring: 0 0 0 3px rgb(37 99 235 / 45%);
    --th-content-width: 80rem;
}

*, *::before, *::after { box-sizing: border-box; }
button, input, select, textarea { font: inherit; }
:focus-visible { outline: 3px solid #2563eb; outline-offset: 2px; }
[dir="rtl"] { text-align: start; }

.th-shell { width: min(100% - 2rem, var(--th-content-width)); margin-inline: auto; }
.th-panel { border: 1px solid var(--th-color-border); border-radius: var(--th-radius-panel); background: var(--th-color-surface); }
.th-field {
    width: 100%; min-height: 2.75rem; padding: 0.65rem 0.8rem;
    border: 1px solid var(--th-color-border); border-radius: var(--th-radius-control);
}
.th-field:focus-visible { outline: none; box-shadow: var(--th-focus-ring); }
.th-button { min-height: 2.75rem; padding: 0.65rem 1rem; border: 1px solid transparent; border-radius: var(--th-radius-control); font-weight: 700; cursor: pointer; }
.th-button:disabled { cursor: wait; opacity: 0.65; }
.th-button-primary { background: var(--th-color-primary); color: #fff; }
.th-button-secondary { background: var(--th-color-surface-muted); border-color: var(--th-color-border); color: var(--th-color-ink); }
.th-alert { border: 1px solid var(--th-color-border); border-radius: var(--th-radius-control); padding: 0.75rem 1rem; }
.th-alert[role="alert"] { border-color: #fda29b; color: var(--th-color-danger); }
.th-alert[role="status"] { border-color: #6ce9a6; color: var(--th-color-success); }

@media (max-width: 640px) {
    .th-shell { width: min(100% - 1.25rem, var(--th-content-width)); }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
