/* JWM Call Copilot. Same tokens as sem.jwmhub.com / JWM Hub (--hub-*):
   dark by default, light via <html data-theme="light"> or the OS preference
   on a first visit. The sidebar stays navy in both themes. */
:root {
    color-scheme: dark;
    --hub-sidebar-bg: #081c31; --hub-sidebar-hover: #0b2944; --hub-sidebar-active: #0d4679;
    --hub-sidebar-text: #f4f7fa; --hub-sidebar-muted: #a8b5c2; --hub-sidebar-divider: #1d3a52;
    --hub-bg: #0c1d2d; --hub-surface: #0d1f2f; --hub-surface-subtle: #12283c; --hub-surface-hover: #183149;
    --hub-border: #29465f; --hub-border-strong: #3b5b73;
    --hub-text: #f1f5f8; --hub-text-secondary: #b5c2ce; --hub-text-muted: #8fa0b2;
    --hub-primary: #235e8b; --hub-primary-hover: #2c6a98; --hub-primary-subtle: #16344d; --hub-link: #8cb2ce;
    --hub-success: #247153; --hub-success-bg: #14382d; --hub-success-text: #7fd3ad;
    --hub-warning: #9a671d; --hub-warning-bg: #3b2c16; --hub-warning-text: #e3b866;
    --hub-danger: #b83c47; --hub-danger-bg: #401f27; --hub-danger-text: #f0a3ac;
    --hub-info: #3e6f94; --hub-info-bg: #19364c; --hub-info-text: #a9cde6;
    --hub-neutral-bg: #263747;
    --hub-focus-glow: rgba(35, 94, 139, .25);
    --hub-radius: 8px;
    --hub-shadow: 0 4px 16px rgba(0, 0, 0, .22);
    --hub-font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    --me: #8cb2ce; --them: #e3b866;
}
:root[data-theme="light"] {
    color-scheme: light;
    --hub-bg: #f4f6f7; --hub-surface: #ffffff; --hub-surface-subtle: #eef2f5; --hub-surface-hover: #e6edf1;
    --hub-border: #d5dee4; --hub-border-strong: #b7c5cf;
    --hub-text: #17212a; --hub-text-secondary: #42515e; --hub-text-muted: #596975;
    --hub-primary: #0d6388; --hub-primary-hover: #084f70; --hub-primary-subtle: #d9eef7; --hub-link: #066a93;
    --hub-success: #6fb58a; --hub-success-bg: #e2f5e8; --hub-success-text: #176b37;
    --hub-warning: #d4ae4c; --hub-warning-bg: #fff2c8; --hub-warning-text: #6f5200;
    --hub-danger: #d8716a; --hub-danger-bg: #fde9e7; --hub-danger-text: #a92d24;
    --hub-info: #6fb0cb; --hub-info-bg: #def1f8; --hub-info-text: #075d80;
    --hub-neutral-bg: #e9eef1;
    --hub-focus-glow: rgba(13, 99, 136, .2);
    --hub-shadow: 0 4px 16px rgba(18, 35, 46, .08);
    --me: #066a93; --them: #8a5a00;
}

* { box-sizing: border-box; }
body {
    margin: 0; font-family: var(--hub-font); font-size: 14px; line-height: 1.5;
    background: var(--hub-bg); color: var(--hub-text); -webkit-font-smoothing: antialiased;
}
a { color: var(--hub-link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 16px; margin: 0 0 12px; }
h3 { font-size: 14px; margin: 16px 0 8px; }
.muted { color: var(--hub-text-muted); }
.small { font-size: 12px; }

/* Shell */
.shell { display: flex; min-height: 100vh; }
.sidebar {
    width: 220px; flex: 0 0 220px; background: var(--hub-sidebar-bg); color: var(--hub-sidebar-text);
    display: flex; flex-direction: column; padding: 16px 12px;
}
/* Same wordmark as JWM Hub (300x53, white for navy): keep its shape, never a square. */
.brand { display: flex; flex-direction: column; gap: 6px; padding: 6px 8px 18px; color: var(--hub-sidebar-muted); text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand img { display: block; width: 100%; max-width: 180px; height: auto; }
.brand span { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.login-brand { margin: -18px -18px 16px; padding: 18px; background: var(--hub-sidebar-bg); border-radius: 12px 12px 0 0; color: var(--hub-sidebar-muted); }
.login-brand img { display: block; width: 100%; max-width: 200px; height: auto; }
.login-brand span { display: block; margin-top: 6px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.nav a {
    display: block; padding: 8px 10px; border-radius: var(--hub-radius); color: var(--hub-sidebar-muted); font-weight: 500;
}
.nav a:hover { background: var(--hub-sidebar-hover); color: var(--hub-sidebar-text); text-decoration: none; }
.nav a[aria-current="page"] { background: var(--hub-sidebar-active); color: #fff; }
.sidebar-foot { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid var(--hub-sidebar-divider); font-size: 12px; color: var(--hub-sidebar-muted); }
.sidebar-foot button { background: none; border: 0; color: var(--hub-sidebar-muted); cursor: pointer; padding: 0; font: inherit; }
.sidebar-foot button:hover { color: var(--hub-sidebar-text); text-decoration: underline; }
.theme-seg { display: inline-flex; gap: 2px; padding: 2px; margin-bottom: 10px; border: 1px solid var(--hub-sidebar-divider); border-radius: 999px; }
.theme-seg button { border: 0; background: transparent; cursor: pointer; font: inherit; font-size: 12px; font-weight: 600; color: var(--hub-sidebar-muted); padding: 4px 12px; border-radius: 999px; }
.theme-seg button[aria-pressed="true"] { background: var(--hub-sidebar-active); color: #fff; }
.main { flex: 1; min-width: 0; padding: 24px 28px 48px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }

@media (max-width: 760px) {
    .shell { flex-direction: column; }
    .sidebar { width: auto; flex: none; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 16px; gap: 4px; }
    .brand { padding: 0 8px 0 0; }
    .brand img { width: 120px; }
    .brand span { display: none; }
    .nav { display: flex; flex-wrap: wrap; gap: 2px; }
    .nav a { padding: 6px 8px; }
    .sidebar-foot { display: none; }
    .main { padding: 16px; }
}

/* Panels, tables */
.panel { background: var(--hub-surface); border: 1px solid var(--hub-border); border-radius: 12px; padding: 18px; margin-bottom: 16px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-2 { display: grid; gap: 16px; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
@media (max-width: 1000px) { .grid-2 { grid-template-columns: 1fr; } }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--hub-border); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--hub-text-muted); font-weight: 600; }
tbody tr:hover { background: var(--hub-surface-hover); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stats { display: flex; flex-wrap: wrap; gap: 24px; }
.stat b { display: block; font-size: 20px; }
.stat span { font-size: 12px; color: var(--hub-text-muted); }

/* Forms and buttons */
label { display: block; font-weight: 600; margin: 12px 0 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], select, textarea {
    width: 100%; padding: 8px 10px; border-radius: var(--hub-radius); border: 1px solid var(--hub-border-strong);
    background: var(--hub-surface-subtle); color: var(--hub-text); font: inherit;
}
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--hub-primary); box-shadow: 0 0 0 3px var(--hub-focus-glow); }
.help { font-size: 12px; color: var(--hub-text-muted); margin-top: 4px; }
.btn {
    display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: var(--hub-radius);
    border: 1px solid var(--hub-primary); background: var(--hub-primary); color: #fff; font: inherit; font-weight: 600;
    cursor: pointer; text-decoration: none; min-height: 36px;
}
.btn:hover { background: var(--hub-primary-hover); text-decoration: none; }
.btn.btn-ghost { background: transparent; color: var(--hub-text); border-color: var(--hub-border-strong); }
.btn.btn-ghost:hover { background: var(--hub-surface-hover); }
.btn.btn-danger { background: var(--hub-danger-bg); color: var(--hub-danger-text); border-color: var(--hub-danger); }
.btn.btn-sm { padding: 4px 10px; min-height: 30px; font-size: 13px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 16px; }
.inline { display: inline; }
.key-row { padding: 4px 0 14px; border-bottom: 1px solid var(--hub-border); margin-bottom: 4px; }
.key-row label:first-child { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.key-row .btn { margin-top: 8px; }
.inline-check { display: flex; gap: 6px; align-items: center; font-weight: 400; margin: 8px 0 0; font-size: 13px; }

/* Notices and badges */
.notice { padding: 10px 14px; border-radius: var(--hub-radius); border: 1px solid var(--hub-info); background: var(--hub-info-bg); color: var(--hub-info-text); margin-bottom: 16px; }
.notice.ok { border-color: var(--hub-success); background: var(--hub-success-bg); color: var(--hub-success-text); }
.notice.err { border-color: var(--hub-danger); background: var(--hub-danger-bg); color: var(--hub-danger-text); }
.notice.warn { border-color: var(--hub-warning); background: var(--hub-warning-bg); color: var(--hub-warning-text); }
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--hub-neutral-bg); color: var(--hub-text-secondary); white-space: nowrap; }
.badge.ok { background: var(--hub-success-bg); color: var(--hub-success-text); }
.badge.warn { background: var(--hub-warning-bg); color: var(--hub-warning-text); }
.badge.live { background: var(--hub-danger-bg); color: var(--hub-danger-text); }

/* Transcript */
.transcript { max-height: 70vh; overflow-y: auto; }
.line { display: grid; grid-template-columns: 52px 110px minmax(0, 1fr); gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--hub-border); }
.line .t { color: var(--hub-text-muted); font-variant-numeric: tabular-nums; font-size: 12px; padding-top: 2px; }
.line .who { font-weight: 600; color: var(--them); overflow-wrap: anywhere; }
.line.me .who { color: var(--me); }
.line.hit { background: var(--hub-warning-bg); }
@media (max-width: 600px) { .line { grid-template-columns: 44px minmax(0, 1fr); } .line .who { grid-column: 2; } .line .txt { grid-column: 1 / -1; } }
.compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.check { list-style: none; padding: 0; margin: 0; }
.check li { padding: 8px 0; border-bottom: 1px solid var(--hub-border); }
.check .q { font-weight: 600; }
.check .ev { color: var(--hub-text-secondary); font-style: italic; }
.md p { margin: 0 0 10px; }
.md ul { margin: 0 0 10px; padding-left: 20px; }
.md h1, .md h2, .md h3 { font-size: 15px; margin: 14px 0 6px; }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: 100%; max-width: 380px; }
