/* Powermator: Dark Dev theme, amber accent */
:root {
  --bg: #0B0F14;
  --bg-header: #0E141B;
  --surface: #121821;
  --surface-2: #16202B;
  --border: #232C38;
  --text: #E6EDF3;
  --text-strong: #C4CED9;
  --muted: #9AA7B5;
  --accent: #FFB020;
  --accent-hover: #FFC857;
  --accent-soft: #FFD27A;
  --accent-tint: #2A2112;
  --accent-border: #5A4416;
  --on-accent: #1A1205;
  --radius: 14px;
  --radius-sm: 8px;
  --font-body: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-head: "Space Grotesk", Inter, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; }

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
}

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

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

h1, h2 { font-family: var(--font-head); letter-spacing: -0.01em; margin: 0; }
h1 { font-size: 2rem; font-weight: 700; }
h2 { font-size: 1.25rem; font-weight: 600; }

code { font-family: var(--font-mono); font-size: 0.875em; color: var(--accent-soft); }

.muted { color: var(--muted); font-size: 0.875rem; }
.lead { color: var(--muted); font-size: 1.0625rem; max-width: 46rem; margin: 0.5rem 0 0; }
.label { font-family: var(--font-mono); font-size: 0.75rem; color: var(--accent); margin: 0 0 0.25rem; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Header */
.site-header {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.75rem;
  padding: 0.875rem 2rem;
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
}
.brand { display: inline-flex; align-items: center; gap: 0.625rem; text-decoration: none; color: var(--text); }
.brand-name { font: 700 1.25rem var(--font-head); letter-spacing: -0.01em; }
.brand-accent { color: var(--accent); }
.main-nav { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.nav-link {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 0.875rem;
  border-radius: var(--radius-sm); color: var(--muted); text-decoration: none;
  font-size: 0.875rem; font-weight: 500;
}
.nav-link:hover { color: var(--text); }
.nav-link.active { background: var(--surface-2); color: var(--accent); font-weight: 600; }

/* Layout */
.site-main { flex: 1 0 auto; width: 100%; max-width: 1200px; margin: 0 auto; padding: 2rem; }
.page { display: flex; flex-direction: column; gap: 1.5rem; align-items: flex-start; }
.page > * { max-width: 100%; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; width: 100%; }

/* Hero */
.hero { padding: 2rem 0 2.5rem; }
.hero h1 { font-size: clamp(2rem, 5vw, 3rem); max-width: 22ch; line-height: 1.15; }
.hero-actions { margin-top: 1.5rem; }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.5rem; }
.card {
  display: flex; flex-direction: column; gap: 0.875rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem; min-width: 0;
}
.card p { margin: 0; color: var(--muted); }
.card label { font-size: 0.875rem; font-weight: 600; color: var(--text-strong); }

.badge {
  align-self: flex-start;
  font: 500 0.75rem var(--font-mono);
  color: var(--muted); border: 1px solid var(--border);
  border-radius: 6px; padding: 0.125rem 0.5rem;
}
.badge-live { color: var(--accent); border-color: var(--accent-border); background: var(--accent-tint); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 1.5rem;
  border: 0; border-radius: var(--radius-sm);
  background: var(--accent); color: var(--on-accent);
  font: 700 0.9375rem var(--font-head); text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--accent-hover); color: var(--on-accent); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip {
  min-height: 44px; padding: 0 0.875rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--muted);
  font: 500 0.8125rem var(--font-mono); cursor: pointer;
}
.chip:hover { color: var(--text); }
.chip.active { border-color: var(--accent); background: var(--accent-tint); color: var(--accent); font-weight: 600; }

textarea {
  width: 100%; resize: vertical;
  padding: 0.875rem; border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg); color: var(--text);
  font: 400 0.8125rem/1.7 var(--font-mono);
}

.row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; justify-content: space-between; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 2rem; text-align: center;
}
.site-footer p { margin: 0.25rem 0; }

/* Blazor error bar */
#blazor-error-ui {
  position: fixed; inset: auto 0 0 0; z-index: 1000;
  padding: 0.75rem 1.25rem;
  background: var(--accent-tint); color: var(--accent-soft);
  border-top: 1px solid var(--accent-border);
}
#blazor-error-ui[hidden] { display: none; }
#blazor-error-ui .reload { margin-left: 0.5rem; }

/* Account pages */
.narrow { max-width: 30rem; width: 100%; margin: 0 auto; align-items: stretch; }
.form { gap: 0.625rem; }
.form input[type="email"],
.form input[type="password"],
.form input[type="text"],
.form input:not([type]) {
  width: 100%; min-height: 44px; padding: 0 0.875rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text); font: inherit;
}
.form input:focus-visible { border-color: var(--accent); }
.form .btn { margin-top: 0.5rem; }
.check { display: flex; align-items: center; gap: 0.5rem; font-weight: 400 !important; }
.check input { width: 1.125rem; height: 1.125rem; accent-color: var(--accent); }

.alert { margin: 0; padding: 0.75rem 1rem; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.alert-error { background: #2A1414; border-color: #6B2B2B; color: #FFB4B4; }
.alert-info { background: var(--accent-tint); border-color: var(--accent-border); color: var(--accent-soft); }
.validation-message { color: #FFB4B4; font-size: 0.875rem; }
.validation-errors { margin: 0; padding-left: 1.25rem; }

.header-actions { margin-left: auto; display: flex; align-items: center; gap: 0.5rem; }
.inline-form { margin: 0; }
.user-name { max-width: 14rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-small { min-height: 40px; padding: 0 1rem; font-size: 0.875rem; }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); min-height: 40px; padding: 0 1rem; font-size: 0.875rem; }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.account-email { font-size: 1.125rem; margin: 0; color: var(--text) !important; word-break: break-all; }

@media (max-width: 860px) {
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .site-header { padding: 0.75rem 1rem; }
  .site-main { padding: 1.25rem 1rem; }
}

/* Pricing */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.5rem; width: 100%; align-items: stretch; }
.plan { display: flex; flex-direction: column; gap: 0.75rem; }
.plan .btn { margin-top: auto; align-self: flex-start; }
.price { margin: 0; color: var(--text) !important; }
.price .amount { font: 700 2rem var(--font-head); color: var(--accent); }
.price .per { color: var(--muted); font-size: 0.875rem; }
.features { margin: 0; padding-left: 1.125rem; color: var(--text-strong); display: grid; gap: 0.375rem; }
.btn:disabled { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }

/* Legal pages */
.legal { max-width: 46rem; gap: 1.25rem; }
.legal section { display: grid; gap: 0.5rem; }
.legal p, .legal li { color: var(--text-strong); margin: 0; }
.legal ul { margin: 0; padding-left: 1.25rem; display: grid; gap: 0.375rem; }

/* Signed-in panel */
.panel { display: grid; grid-template-columns: 14rem minmax(0, 1fr); gap: 2rem; align-items: start; }
.panel-nav { display: flex; flex-direction: column; gap: 0.25rem; position: sticky; top: 1rem; }
.panel-link {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  padding: 0.5rem 0.75rem; border-radius: var(--radius-sm);
  color: var(--muted); text-decoration: none; min-height: 40px;
}
a.panel-link:hover { color: var(--text); background: var(--surface); }
.panel-link.active { background: var(--surface-2); color: var(--accent); font-weight: 600; }
.panel-link-soon { opacity: 0.6; cursor: default; }
.soon { font: 500 0.6875rem var(--font-mono); border: 1px solid var(--border); border-radius: 6px; padding: 0 0.375rem; }
.panel-cards { width: 100%; }

.footer-links { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 0.5rem; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--text); }

@media (max-width: 760px) {
  .panel { grid-template-columns: 1fr; gap: 1rem; }
  .panel-nav { flex-direction: row; overflow-x: auto; position: static; padding-bottom: 0.25rem; }
  .panel-link { white-space: nowrap; }
}

/* Error Lens */
select {
  width: 100%; min-height: 44px; padding: 0 0.75rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text); font: inherit;
}
.result h3, .result h4 { margin: 0; }
.result { display: flex; flex-direction: column; gap: 0.75rem; }
.result-title { font-size: 1.25rem; color: var(--text-strong); }
.result h4 { font-size: 0.875rem; color: var(--text-strong); margin-top: 0.5rem; }
.result-list { margin: 0; padding-left: 1.25rem; color: var(--muted); display: flex; flex-direction: column; gap: 0.375rem; }
.result-list li { padding-left: 0.25rem; }
.usage { margin-top: 1rem; border-top: 1px solid var(--border); padding-top: 0.75rem; }

/* Code output */
pre.code {
  margin: 0; padding: 0.875rem; overflow: auto; max-height: 28rem;
  border: 1px solid var(--border); border-radius: 10px; background: var(--bg);
  font: 400 0.8125rem/1.6 var(--font-mono); color: var(--text);
}
pre.code code { font: inherit; white-space: pre; }
.warn-title { margin: 0.5rem 0 0; font-size: 0.875rem; color: var(--accent); }

/* Flow Reviewer */
.finding { border: 1px solid var(--border); border-left-width: 4px; border-radius: var(--radius-sm); padding: 0.875rem 1rem; display: flex; flex-direction: column; gap: 0.5rem; background: var(--bg); }
.finding header { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.finding h3 { margin: 0; font-size: 1rem; color: var(--text-strong); }
.finding p { margin: 0; color: var(--muted); }
.finding summary { cursor: pointer; color: var(--muted); font-size: 0.875rem; }
.finding code { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--text); word-break: break-word; }
.sev-badge { font-family: var(--font-mono); font-size: 0.6875rem; padding: 0.125rem 0.5rem; border-radius: 999px; border: 1px solid currentColor; }
.sev-high { border-left-color: #E5484D; } .sev-high .sev-badge { color: #FF8A8E; }
.sev-medium { border-left-color: var(--accent); } .sev-medium .sev-badge { color: var(--accent); }
.sev-low { border-left-color: #6E7C8E; } .sev-low .sev-badge { color: #9AA7B6; }
.sev-info { border-left-color: #3E4B5B; } .sev-info .sev-badge { color: #8693A3; }
.stats { margin: 0; }

/* Expert Help */
.chat { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.75rem; }
.msg { padding: 0.75rem 1rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); max-width: 46rem; }
.msg-expert { border-color: var(--accent-border); background: var(--accent-tint); align-self: flex-end; }
.msg-meta { display: flex; gap: 0.75rem; align-items: baseline; margin: 0 0 0.25rem; font-size: 0.8125rem; color: var(--muted); }
.msg-meta strong { color: var(--text-strong); }
.msg-body { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); }
.card .msg-body { color: var(--text); }
.status-pill { font: 500 0.6875rem var(--font-mono); padding: 0.125rem 0.5rem; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); }
.status-open { color: var(--accent); border-color: var(--accent-border); }
.status-answered { color: #7CD39A; border-color: #2F5A41; }
.thread-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.75rem; }
.thread-list li { display: flex; flex-wrap: wrap; gap: 0.5rem 0.75rem; align-items: center; padding-bottom: 0.75rem; border-bottom: 1px solid var(--border); }
.thread-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.thread-preview { flex-basis: 100%; overflow-wrap: anywhere; }
.filters { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; }
.filters a { text-decoration: none; color: var(--muted); }
.filters a.active { color: var(--accent); font-weight: 600; }

/* Manager panel */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th, .table td { text-align: left; padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.table th { color: var(--muted); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }
.table td.mono, .mono { font-family: var(--font-mono); font-size: 0.85rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; }
.stat .value { font-family: var(--font-head); font-size: 1.75rem; font-weight: 700; color: var(--text-strong); }
.stat .label { color: var(--muted); font-size: 0.8rem; }
.filter-form { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: end; }
.filter-form label { display: block; font-size: 0.8rem; color: var(--muted); margin-bottom: 0.25rem; }
.filter-form input, .filter-form select, .form-grid input, .form-grid select {
  min-height: 40px; padding: 0 0.75rem; background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm); font: inherit;
}
.form-grid input { width: 100%; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.form-grid .hint { color: var(--muted); font-size: 0.8rem; margin: 0.25rem 0 0; }
.pager { display: flex; gap: 1rem; margin-top: 1rem; }
.tag { display: inline-block; padding: 0.05rem 0.5rem; border-radius: 999px; border: 1px solid var(--border); font-size: 0.75rem; color: var(--muted); }
.tag-ok { color: #8FE3A4; border-color: #2D5B3A; }
.tag-bad { color: #FFB4B4; border-color: #6B2B2B; }
