/* Shared site theme: colors, layout shell, header, footer, buttons and forms.
   Flat solid colors only: no gradients, shadows, blur or transparency effects. */
:root {
    color-scheme: dark;
    --bg: #0a0a0a;
    --surface: #161616;
    --surface-raised: #222022;
    --border: #2d2c31;
    --border-strong: #4f4e58;
    --text: #e3dfff;
    --muted: #c2bbd0;
    --subtle: #a59dae;
    --accent: #baa9ef;
    --accent-deep: #2b2635;
    --button-text: #15101d;
    --graphic-fill: #594a6c;
    --danger: #f2a7b4;
    --radius: 12px;
    --radius-small: 8px;
    --shell: 1120px;
    --gutter: 32px;
}
:root[data-theme="light"] {
    color-scheme: light;
    --bg: #dadada;
    --surface: #f8f9fa;
    --surface-raised: #edebef;
    --border: #c1bcbf;
    --border-strong: #aaa2a8;
    --text: #553e4e;
    --muted: #645663;
    --subtle: #766979;
    --accent: #654a83;
    --accent-deep: #e6deef;
    --button-text: #ffffff;
    --graphic-fill: #beabc9;
    --danger: #a2263f;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 32px; }
body { margin: 0; min-width: 320px; min-height: 100vh; display: flex; flex-direction: column; font: 400 16px/1.6 'Roboto', Arial, system-ui, sans-serif; background: var(--bg); color: var(--text); }
main { flex: 1 0 auto; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; overflow-wrap: break-word; }
h1, h2, h3 { letter-spacing: -.03em; line-height: 1.15; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
::selection { background: var(--accent); color: var(--bg); }

.shell { width: min(var(--shell), calc(100% - var(--gutter) * 2)); margin-inline: auto; }
.skip-link { position: fixed; top: -90px; left: 16px; z-index: 99; background: var(--accent); color: var(--button-text); padding: 10px 16px; border-radius: var(--radius-small); }
.skip-link:focus { top: 12px; }
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }

/* Code-drawn line icons from partials/icons.html. */
.icon { display: inline-block; width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }

/* Header */
.site-header { border-bottom: 1px solid var(--border); background: var(--bg); }
.header-inner { min-height: 76px; display: flex; align-items: center; gap: 28px; }
.brand { display: inline-flex; align-items: center; gap: 12px; white-space: nowrap; }
.brand-mark { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; flex: 0 0 40px; border: 1px solid var(--border-strong); border-radius: var(--radius-small); background: var(--accent-deep); color: var(--accent); font: 700 13px/1 'Roboto', sans-serif; }
.brand-name { font: 700 18px/1 'Roboto', sans-serif; letter-spacing: -.03em; }
.brand-name span, .footer-brand span { color: var(--accent); }
.site-nav { display: flex; align-items: center; gap: 24px; margin-left: auto; }
.site-nav a, .header-link { font-size: 14px; font-weight: 500; color: var(--muted); }
.site-nav a:hover, .header-link:hover, .footer-links a:hover { color: var(--accent); }
.header-actions { display: flex; align-items: center; gap: 12px; }
.theme-button { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-small); background: transparent; color: var(--muted); cursor: pointer; }
.theme-button:hover { border-color: var(--border-strong); color: var(--text); }

/* Buttons */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; padding: 0 20px; border: 1px solid transparent; border-radius: var(--radius-small); font-size: 14px; font-weight: 500; line-height: 1; cursor: pointer; transition: border-color .2s, background .2s, color .2s; }
.button-small { min-height: 38px; padding: 0 16px; }
.button-primary { background: var(--accent); color: var(--button-text); }
.button-primary:hover { background: var(--text); }
.button-outline { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.button-outline:hover { border-color: var(--accent); }
.button-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.button-danger:hover { background: var(--danger); color: var(--bg); }
.button-block { width: 100%; }
.button-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* Flash messages */
.flash-list { display: grid; gap: 8px; margin: 24px 0 0; padding: 0; list-style: none; }
.flash { padding: 12px 16px; border: 1px solid var(--border-strong); border-left: 3px solid var(--accent); border-radius: var(--radius-small); background: var(--surface); font-size: 14px; }
.flash-danger, .flash-warning { border-left-color: var(--danger); }

/* Panels and forms used by account pages */
.page { padding: 64px 0 96px; }
.page-narrow { width: min(440px, 100%); margin-inline: auto; }
.page-title { font-size: 32px; margin-bottom: 20px; }
.page-title + .page-lead { margin-top: -12px; }
.page-lead { color: var(--muted); font-size: 15px; margin-bottom: 28px; }
.panel { padding: 28px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.panel + .panel { margin-top: 20px; }
.panel h2 { font-size: 20px; margin-bottom: 18px; }
.form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 13px; font-weight: 500; color: var(--muted); }
.field input, .field select { width: 100%; min-height: 44px; padding: 0 14px; border: 1px solid var(--border-strong); border-radius: var(--radius-small); background: var(--bg); }
.field input:focus, .field select:focus { border-color: var(--accent); outline: none; }
.field-hint { font-size: 12px; color: var(--subtle); }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.form-links { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; margin-top: 20px; font-size: 14px; color: var(--muted); }
.form-links a { color: var(--accent); }
.form-links a:hover { text-decoration: underline; }
.divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--subtle); font-size: 12px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
/* Honeypot field for bots: kept out of view and out of the tab order. */
.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Tables (owner Users page) */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table th { font-size: 12px; font-weight: 500; color: var(--subtle); background: var(--surface); }
.table tr:last-child td { border-bottom: 0; }
.table td.actions { text-align: right; }
.table form { display: inline; }
.badge { display: inline-block; padding: 2px 8px; border: 1px solid var(--border-strong); border-radius: 99px; font-size: 12px; color: var(--muted); }
.toolbar { display: flex; gap: 12px; margin-bottom: 20px; }
.toolbar .field { flex: 1; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 96px; padding: 24px 0; }
.footer-brand { font: 700 18px/1 'Roboto', sans-serif; letter-spacing: -.03em; }
.footer-links { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.footer-links a, .footer-copy { font-size: 14px; color: var(--muted); }

@media (max-width: 760px) {
    :root { --gutter: 20px; }
    .header-inner { flex-wrap: wrap; gap: 12px 16px; padding: 14px 0; }
    .header-actions { margin-left: auto; }
    .site-nav { order: 3; width: 100%; justify-content: center; gap: 28px; margin: 0; padding-top: 12px; border-top: 1px solid var(--border); }
    .footer-inner { flex-direction: column; align-items: flex-start; }
    .page { padding: 40px 0 72px; }
    .panel { padding: 22px; }
}
@media (max-width: 420px) {
    :root { --gutter: 16px; }
    .brand-name { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition-duration: .01ms !important; }
}
