* { box-sizing: border-box; }
body {
  margin: 0;
  font: 15px/1.55 var(--font);
  background: var(--bg);
  color: var(--text);
}
h1, h2, h3 { margin: 0; line-height: 1.25; }
h2 { font-size: 22px; letter-spacing: -.01em; }
h3 { font-size: 16px; }
a { color: var(--text); text-underline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

button, input, select, textarea {
  font: inherit;
  color: inherit;
}
input, select, textarea {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 10px;
  min-width: 0;
}
textarea { width: 100%; resize: vertical; min-height: 110px; }
input:focus, select:focus, textarea:focus, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
button {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  cursor: pointer;
}
button:hover:not(:disabled) { background: var(--surface-2); }
button.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-text); font-weight: 600; }
button.primary:hover:not(:disabled) { filter: brightness(1.15); background: var(--primary); }
button:disabled { opacity: .5; cursor: not-allowed; }
button.link { border: 0; background: none; color: var(--text); text-decoration: underline; padding: 0; }

/* layout */
.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 10px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 5;
  flex-wrap: wrap;
}
.brand { font-weight: 700; }
.tabs { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.tabs button { border: 0; background: none; color: var(--muted); }
.tabs button.active { background: var(--surface-2); color: var(--text); font-weight: 600; }
.user { display: flex; align-items: center; gap: 10px; }
main { max-width: 1100px; margin: 0 auto; padding: 28px 24px 48px; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar .spacer { flex: 1; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}
.stack > * + * { margin-top: 12px; }
.split { display: grid; grid-template-columns: minmax(280px, 400px) 1fr; gap: 16px; align-items: start; }
@media (max-width: 820px) { .split { grid-template-columns: 1fr; } }

/* reviews */
.list { display: flex; flex-direction: column; gap: 8px; }
.item {
  text-align: left; width: 100%;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px; cursor: pointer; display: block;
}
.item:hover { background: var(--surface-2); }
.item.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.item .row { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.item .text { margin-top: 6px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.stars { color: var(--star); letter-spacing: 1px; white-space: nowrap; }
.review-text { white-space: pre-wrap; font-size: 15px; }
.quote { background: var(--surface-2); border-radius: 8px; padding: 10px 12px; white-space: pre-wrap; }

.badge {
  display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted); white-space: nowrap;
}
.badge.good { background: var(--good-bg); color: var(--good); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.platform { font-weight: 600; }

.notice { border-radius: 8px; padding: 10px 12px; }
.notice.warn { background: var(--warn-bg); color: var(--warn); }
.notice.bad { background: var(--bad-bg); color: var(--bad); }
.notice.good { background: var(--good-bg); color: var(--good); }
.notice.info { background: var(--surface-2); }

.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
label.check { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; }
label.check input { margin-top: 3px; }

/* tables */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: 12px; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--surface-2); }
.table-wrap { overflow-x: auto; }

/* report */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.kpi .value { font-size: 28px; font-weight: 700; margin-top: 4px; }
.bar { height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--accent); }

/* forms */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field > span { font-size: 12px; color: var(--muted); }

/* login */
.login { max-width: 380px; margin: 10vh auto; }
.login form { display: flex; flex-direction: column; gap: 10px; }
.demo-users { display: grid; gap: 6px; }
.demo-users button { text-align: left; }

#toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 8px;
  opacity: 0; transition: opacity .2s; pointer-events: none; max-width: calc(100% - 32px);
}
#toast.show { opacity: 1; }
.empty { text-align: center; color: var(--muted); padding: 32px 12px; }

/* ---- MVP additions ---- */
.tabs { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { white-space: nowrap; }
.icon-btn { padding: 6px 10px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
tr.mismatch td { background: var(--bad-bg); }
tr.mismatch td.status { color: var(--bad); font-weight: 600; }
td.status { white-space: nowrap; }
.confirm-panel { border: 1px solid var(--warn); background: var(--warn-bg); color: var(--text); border-radius: 8px; padding: 12px; }
.problems { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.problems li { padding: 8px 10px; border-radius: 8px; background: var(--surface-2); border-left: 3px solid var(--warn); }
.problems li.high { border-left-color: var(--bad); }
.stepper { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.stepper button { white-space: nowrap; border-radius: 999px; font-size: 13px; padding: 5px 12px; }
.stepper button.active { background: var(--primary); color: var(--primary-text); border-color: var(--primary); }
.stepper button.done:not(.active) { border-color: var(--good); color: var(--good); }
.script { font-size: 16px; line-height: 1.6; background: var(--surface-2); border-radius: 8px; padding: 14px; white-space: pre-wrap; }
.secret { font-family: ui-monospace, Consolas, monospace; word-break: break-all; background: var(--surface-2); padding: 8px; border-radius: 6px; }
.event { display: flex; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.event:last-child { border-bottom: 0; }
.event .when { color: var(--muted); font-size: 12px; min-width: 110px; }
.platform-card { border: 1px solid var(--border); border-radius: 8px; padding: 12px; }
.mobile-only { display: none; }
@media (max-width: 640px) {
  main { padding: 12px; }
  .topbar { padding: 8px 12px; gap: 8px; }
  .brand { flex: 1; }
  .tabs { order: 3; flex-basis: 100%; }
  .user .name { display: none; }
  .kpi .value { font-size: 22px; }
  .card { padding: 12px; }
  th, td { padding: 6px; }
  .mobile-only { display: initial; }
  .hide-mobile { display: none; }
}
@media print {
  .topbar, .toolbar button, .no-print { display: none !important; }
  body { background: #fff; color: #000; }
}

.nps-trend { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; align-items: end; }
.nps-week { text-align: center; }
.nps-bar-wrap { height: 54px; display: flex; align-items: flex-end; justify-content: center; }
.nps-bar-wrap span { width: 60%; border-radius: 4px 4px 0 0; display: block; }
.nps-bar-wrap span.pos { background: var(--good); }
.nps-bar-wrap span.neg { background: var(--bad); }


/* ---- redesign: shell, navigation, home screens ---- */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 6px; padding: 18px 12px;
}
.side-brand { padding: 4px 8px 16px; display: flex; align-items: center; min-height: 48px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav button {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  border: 0; background: none; color: var(--muted); padding: 10px 12px; border-radius: var(--radius-sm);
}
.nav button:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.nav button.active { background: var(--surface-2); color: var(--text); font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); }
.nav svg, .ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav-more { margin-top: 8px; }
.nav-more > summary { list-style: none; cursor: pointer; color: var(--muted); padding: 10px 12px; border-radius: var(--radius-sm); display: flex; gap: 12px; align-items: center; }
.nav-more > summary::-webkit-details-marker { display: none; }
.nav-more > summary:hover { background: var(--surface-2); color: var(--text); }
.side-user { margin-top: auto; border-top: 1px solid var(--border); padding: 12px 8px 0; display: flex; flex-direction: column; gap: 8px; }
.side-user .who { font-weight: 600; }
.content { min-width: 0; }
.mbar { display: none; }
.scrim { display: none; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head .sub { color: var(--muted); }
.section-title { margin: 28px 0 12px; }
.demo-banner { background: var(--accent-soft); border-bottom: 1px solid var(--border); padding: 10px 24px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--gap); margin-bottom: 24px; }
.tile { text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
button.tile:hover { background: var(--surface-2); }
.tile .label { color: var(--muted); font-size: 13px; }
.tile .value { font-size: 30px; font-weight: 700; line-height: 1.15; margin-top: 6px; }
.tile .hint { color: var(--muted); font-size: 12px; margin-top: 4px; }
.tile.alert .value { color: var(--bad); }

.task { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.task + .task { margin-top: 12px; }
.task .meta { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; align-items: center; }
.draft { background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px 14px; white-space: pre-wrap; }
.draft-label { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
details.more { margin-top: 24px; }
details.more > summary { cursor: pointer; font-weight: 600; padding: 10px 0; list-style: none; display: flex; align-items: center; gap: 8px; }
details.more > summary::before { content: "+"; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: var(--surface-2); }
details.more[open] > summary::before { content: "-"; }
details.more > summary::-webkit-details-marker { display: none; }
.empty-state { text-align: center; padding: 40px 16px; background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); }
.empty-state h3 { margin-bottom: 6px; }
.empty-state .muted { margin-bottom: 14px; }

.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login { width: 100%; max-width: 400px; margin: 0; padding: 28px; }
.login .brand-line { display: flex; justify-content: center; margin-bottom: 8px; }

@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 276px; z-index: 30; transform: translateX(-102%); transition: transform .2s; box-shadow: 0 0 40px rgba(0, 0, 0, .25); }
  .side.open { transform: none; }
  .scrim.show { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: 25; }
  .mbar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
  .mbar .icon-btn { border: 0; background: none; padding: 6px; }
  main { padding: 20px 16px 40px; }
  .demo-banner { padding: 10px 16px; }
}
@media (max-width: 640px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .tile { padding: 12px; }
  .tile .value { font-size: 24px; }
  h2 { font-size: 20px; }
}

/* ---- developer dark language: square buttons and fields, pill chips, monospace data, ring borders ---- */
body { font-family: var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-weight: 500; color: var(--strong); letter-spacing: -0.6px; }
h2 { letter-spacing: -1px; }
button, input, select, textarea { border-radius: 0; }
button { background: transparent; border-color: var(--ring); color: var(--text); padding: 8px 12px; font-weight: 500; }
button:hover:not(:disabled) { background: var(--surface-2); }
button.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
button.primary:hover:not(:disabled) { background: var(--primary); filter: brightness(.9); }
input, select, textarea { background: var(--surface); border-color: var(--ring); }
input:focus, select:focus, textarea:focus { border-color: var(--blue); outline: 2px solid var(--blue); outline-offset: 0; }
input[type=checkbox], input[type=radio] { accent-color: var(--blue); }
a { color: var(--strong); }
.card, .tile, .task, .platform-card, .item, .empty-state, .stack > .quote { border-color: var(--ring); border-radius: var(--radius); }
.card, .tile, .task { background: var(--surface); box-shadow: none; }
.item { background: var(--surface); }
.item:hover { background: var(--surface-2); }
.item.selected { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.quote, .draft { background: var(--surface-2); border-radius: 0; font-family: var(--font); }
.confirm-panel { border-color: var(--ring); background: var(--surface-2); border-radius: var(--radius); }
.bar { background: var(--surface-2); border-radius: 2px; }
.bar > span { background: var(--bar); border-radius: 2px; }
.nav button.active { box-shadow: inset 2px 0 0 var(--blue); }
.side { background: var(--bg); border-color: var(--ring); }
.mbar { background: var(--bg); border-color: var(--ring); }
.demo-banner { background: var(--surface-2); border-color: var(--ring); }
.stars { color: var(--star); }

/* status chips: the dot carries the state */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 100px; background: var(--chip-bg); color: var(--muted);
  font: 500 12px/1.2 var(--mono); text-transform: uppercase; letter-spacing: 0.02em; white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); flex: none; }
.badge.good { background: var(--chip-bg); color: var(--muted); }
.badge.good::before { background: var(--green); }
.badge.warn { background: var(--chip-bg); color: var(--muted); }
.badge.warn::before { background: var(--muted); }
.badge.bad { background: var(--chip-bg); color: var(--muted); }
.badge.bad::before { background: var(--strong); }
.notice { border: 1px solid var(--ring); border-radius: var(--radius); background: var(--surface); color: var(--text); }
.notice.good { border-color: var(--green); color: var(--text); background: var(--good-bg); }
.notice.warn, .notice.bad, .notice.info { background: var(--surface-2); color: var(--text); }
.notice.bad { border-color: var(--strong); }

/* data in monospace */
.tile .value, .kpi .value { font-family: var(--num); font-weight: 500; letter-spacing: -1.5px; color: var(--strong); }
.tile.alert .value { color: var(--strong); }
.tile.alert::after { content: ""; display: block; width: 6px; height: 6px; border-radius: 50%; background: var(--strong); margin-top: 8px; }
table { font-family: var(--mono); font-size: 13px; }
th { text-transform: uppercase; letter-spacing: 0.04em; font-size: 12px; font-weight: 500; }
td, th { border-bottom-color: var(--ring); }
td strong { font-family: var(--font); }
.event .when, .secret, .small.muted, .meta .muted { font-family: var(--mono); }
.secret { background: var(--surface-2); border-radius: 0; }
.login-wrap { background: radial-gradient(60% 50% at 50% 0%, var(--glow), transparent 70%); }
.login { background: var(--surface); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* cards that act as buttons are square like every other button */
button.item, button.tile, button.card, button.kpi { border-radius: 0; }
.stepper button { border-radius: 0; }
.stepper button.done:not(.active) { border-color: var(--green); color: var(--green); }

/* collapsible sidebar */
.shell { transition: grid-template-columns 0.25s ease; }
.shell.collapsed { grid-template-columns: 68px minmax(0, 1fr); }
.side-toggle { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; border-top: 1px solid var(--border); background: none; color: var(--muted); padding: 12px; border-radius: 0; text-align: left; }
.side-toggle:hover { color: var(--text); background: var(--surface-2); }
.side-toggle svg { transition: transform 0.25s; transform: rotate(180deg); }
.shell.collapsed .side-toggle svg { transform: none; }
.shell.collapsed .side { padding: 18px 8px; }
.shell.collapsed .nav button span, .shell.collapsed .nav-more > summary span, .shell.collapsed .side-toggle span,
.shell.collapsed .side-user .who, .shell.collapsed .side-user .muted, .shell.collapsed .side-user > button:not(.link) { display: none; }
.shell.collapsed .nav button, .shell.collapsed .nav-more > summary { justify-content: center; padding: 10px 0; }
.shell.collapsed .side-brand { justify-content: center; padding: 4px 0 16px; }
.shell.collapsed .brand-fallback span:not(.star) { display: none; }
.shell.collapsed .nav-more > summary { display: none; }
.shell.collapsed .side-user { align-items: center; }
@media (max-width: 899px) { .shell.collapsed { grid-template-columns: minmax(0, 1fr); } .side-toggle { display: none; } }
@media (prefers-reduced-motion: reduce) { .shell, .side-toggle svg { transition: none; } }

/* request screen */
.req-services { display: flex; flex-wrap: wrap; gap: 8px; }
.svc { border: 1px solid var(--border); border-radius: 12px; background: transparent; color: var(--text); padding: 8px 14px; text-align: left; line-height: 1.3; cursor: pointer; }
.svc:hover { border-color: var(--blue); }
.svc[aria-pressed="true"] { background: var(--primary); color: var(--primary-text); border-color: var(--primary); }
.req-plan { display: grid; gap: 10px; padding: 20px; max-width: 640px; border: 1px solid var(--blue); box-shadow: 0 0 0 1px var(--blue); background: var(--surface); border-radius: var(--radius); animation: reqIn 300ms cubic-bezier(.2, .7, .2, 1) both; }
.req-plan h3 { margin: 0; font-size: 24px; }
.req-price .num { font-size: 32px; font-weight: 500; letter-spacing: -1.5px; }
.plan-feat { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 14px; }
.plan-feat li { position: relative; padding-left: 30px; line-height: 1.45; }
.plan-feat li::before { content: ""; position: absolute; left: 0; top: 0; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--blue); background: var(--accent-soft); }
.plan-feat li::after { content: ""; position: absolute; left: 6px; top: 5px; width: 8px; height: 4px; border-left: 2px solid var(--blue); border-bottom: 2px solid var(--blue); transform: rotate(-45deg); }
@keyframes reqIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .req-plan { animation: none; } }
