/* Data Genie — accounts and the customer dashboard.
   Builds on styles.css (tokens, buttons, type). Everything here is light-surface UI. */

:root {
  --sidebar: 248px;
  --field: var(--surface);
  --field-line: var(--line);
  --ok: var(--up);
  --warn: #B7791F;
  --warn-soft: #FDF3DC;
  --info: #2F5BD3;
  --info-soft: #E3EAFC;
  --ok-soft: #DDF3EC;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --field: var(--paper-2);
    --warn: #F2B94B; --warn-soft: #33270F;
    --info: #8DA8FF; --info-soft: #18223F;
    --ok-soft: #10302A;
  }
}

/* ------------------------------------------------------------- shared form */
.field { display: grid; gap: 7px; }
.field > span, .field-label { font-size: .86rem; font-weight: 600; color: var(--ink); }
.field small, .field-help { color: var(--muted); font-size: .8rem; font-weight: 400; }
.input, .field input, .field select, .field textarea {
  font: inherit; font-size: .95rem; color: var(--ink); background: var(--field);
  border: 1px solid var(--field-line); border-radius: 10px; padding: 11px 13px; width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { resize: vertical; min-height: 96px; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus {
  outline: none; border-color: var(--signal); box-shadow: 0 0 0 3px color-mix(in srgb, var(--signal) 18%, transparent);
}
.field input[readonly] { color: var(--muted); background: var(--paper-2); }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 64px; }
.pw-toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted); font: 600 .78rem var(--body); cursor: pointer; padding: 6px 8px; border-radius: 6px; }
.pw-toggle:hover { color: var(--ink); background: var(--paper-2); }
.msg { margin: 0; font-size: .88rem; min-height: 1.3em; }
.msg.err { color: var(--down); } .msg.ok { color: var(--up); }
.btn.loading { pointer-events: none; opacity: .75; }
.btn-quiet { --b: var(--paper-2); color: var(--ink); border-color: var(--line-2); }
.btn-quiet:hover { box-shadow: none; border-color: var(--line); }
.btn-danger { --b: transparent; color: var(--down); border-color: color-mix(in srgb, var(--down) 40%, transparent); }
.btn-danger:hover { --b: color-mix(in srgb, var(--down) 10%, transparent); box-shadow: none; }
.link-btn { border: 0; background: none; padding: 0; font: inherit; color: var(--signal); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); }

/* ---------------------------------------------------------------- auth pages */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(380px, 1fr) minmax(0, 1.1fr); background: var(--surface); }
.auth-side {
  background: var(--board); color: var(--board-ink); padding: 40px clamp(32px, 4vw, 56px);
  display: flex; flex-direction: column; gap: 40px; position: relative; overflow: hidden;
}
.auth-side::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(255,255,255,.016) 0 1px, transparent 1px 3px); }
.auth-side .logo-tile { fill: #E6ECF5; }
.auth-side .logo-mark { stroke: var(--board); }
.auth-side h2 { color: #fff; font-size: clamp(1.8rem, 2.8vw, 2.4rem); max-width: 22ch; }
.auth-side .lede-sm { color: #B9C3D3; margin: 14px 0 0; max-width: 40ch; }
.auth-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.auth-points li { display: grid; grid-template-columns: 34px 1fr; gap: 14px; align-items: start; }
.auth-points .ico { width: 34px; height: 34px; border-radius: 9px; background: var(--board-2); display: grid; place-items: center; color: var(--amber); }
.auth-points .ico svg { width: 18px; height: 18px; }
.auth-points b { display: block; color: #fff; font-weight: 600; }
.auth-points span { color: #B9C3D3; font-size: .92rem; }
.auth-ticker { margin-top: auto; font-family: var(--mono); font-size: .8rem; border-top: 1px solid rgba(255,255,255,.08); padding-top: 18px; display: grid; gap: 8px; }
.auth-ticker .t-head { color: var(--board-muted); font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; display: flex; align-items: center; gap: 8px; }
.auth-ticker .t-row { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; animation: rowin .5s ease both; }
.auth-ticker .cc { color: var(--amber); font-weight: 600; letter-spacing: .06em; }
.auth-ticker .nm { color: var(--board-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.auth-ticker .px { font-variant-numeric: tabular-nums; }

.auth-main { display: grid; place-items: center; padding: 48px 24px; }
.auth-card { width: min(420px, 100%); display: grid; gap: 22px; }
.auth-card h1 { font-size: clamp(1.9rem, 3vw, 2.3rem); }
.auth-card .sub { color: var(--muted); margin: 8px 0 0; }
.auth-card form { display: grid; gap: 16px; }
.auth-foot { color: var(--muted); font-size: .9rem; text-align: center; }
.auth-foot a { color: var(--ink); font-weight: 600; }
.auth-back { position: absolute; top: 24px; right: 28px; font-size: .88rem; color: var(--muted); text-decoration: none; }
.auth-back:hover { color: var(--ink); }
.auth-main { position: relative; }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; font-size: .9rem; background: var(--info-soft); color: var(--ink); border: 1px solid color-mix(in srgb, var(--info) 25%, transparent); }
.notice svg { width: 18px; height: 18px; flex: none; margin-top: 2px; color: var(--info); }
.fineprint { color: var(--muted); font-size: .8rem; margin: 0; }
.strength { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 2px; }
.strength i { height: 4px; border-radius: 4px; background: var(--line-2); transition: background .2s; }
.strength[data-s="1"] i:nth-child(-n+1) { background: var(--down); }
.strength[data-s="2"] i:nth-child(-n+2) { background: var(--warn); }
.strength[data-s="3"] i:nth-child(-n+3) { background: var(--up); }
.strength[data-s="4"] i { background: var(--up); }

.req-summary { border: 1px solid var(--line-2); border-radius: 14px; padding: 14px 16px; background: var(--paper); display: grid; gap: 10px; }
.req-head { display: flex; justify-content: space-between; align-items: center; }
.req-edit { font-size: .85rem; color: var(--muted); }
.req-summary dl { margin: 0; display: grid; gap: 6px; }
.req-summary dl div { display: grid; grid-template-columns: 130px 1fr; gap: 10px; font-size: .88rem; }
.req-summary dt { color: var(--muted); }
.req-summary dd { margin: 0; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ------------------------------------------------------------- app shell */
.app { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); background: var(--paper); }
.side {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px;
  padding: 18px 14px; background: var(--surface); border-right: 1px solid var(--line-2);
}
.side .logo { padding: 6px 8px 14px; }
.org-chip { display: grid; grid-template-columns: 36px 1fr; gap: 10px; align-items: center; padding: 10px; border-radius: 12px; background: var(--paper); border: 1px solid var(--line-2); margin-bottom: 10px; }
.org-av { width: 36px; height: 36px; border-radius: 9px; background: var(--ink); color: var(--paper); display: grid; place-items: center; font: 700 .95rem var(--display); }
.org-chip b { display: block; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.org-chip small { color: var(--muted); font-size: .76rem; }
.nav-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 10px; border-radius: 9px;
  border: 0; background: none; color: var(--ink-2); font: 500 .93rem var(--body); text-align: left; cursor: pointer; text-decoration: none;
}
.nav-item svg { width: 18px; height: 18px; flex: none; color: var(--muted); }
.nav-item:hover { background: var(--paper); color: var(--ink); }
.nav-item[aria-current="page"] { background: color-mix(in srgb, var(--signal) 10%, var(--surface)); color: var(--ink); font-weight: 600; }
.nav-item[aria-current="page"] svg { color: var(--signal); }
.nav-item .badge { margin-left: auto; }
.side-foot { margin-top: auto; display: grid; gap: 2px; border-top: 1px solid var(--line-2); padding-top: 12px; }
.me > div, .org-chip > div, .person > div { min-width: 0; }
.me { display: grid; grid-template-columns: 32px 1fr; gap: 10px; align-items: center; padding: 8px 10px; }
.me-av { width: 32px; height: 32px; border-radius: 50%; background: var(--paper-2); display: grid; place-items: center; font: 600 .8rem var(--body); color: var(--ink-2); }
.me b { display: block; font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me small { display: block; color: var(--muted); font-size: .76rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.content { min-width: 0; }
.main { min-width: 0; padding: 30px clamp(20px, 3.4vw, 44px) 64px; }
.page-head { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; justify-content: space-between; margin-bottom: 26px; }
.page-head h1 { font-size: clamp(1.7rem, 2.6vw, 2.1rem); font-weight: 700; }
.page-head p { margin: 6px 0 0; color: var(--muted); max-width: 60ch; }
.view { display: grid; gap: 20px; max-width: 1240px; animation: cardin .3s ease both; }
.view[hidden] { display: none; }
.view > *, .grid-2 > * { min-width: 0; }
.tbl a { white-space: nowrap; }

.card { background: var(--surface); border: 1px solid var(--line-2); border-radius: 16px; padding: 22px; }
.card-head { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; margin-bottom: 16px; }
.card-head h2 { font: 700 1.12rem/1.3 var(--display); letter-spacing: -0.01em; }
.card-head p { margin: 4px 0 0; color: var(--muted); font-size: .9rem; }
.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font: 600 .76rem/1.2 var(--body); letter-spacing: 0; white-space: nowrap; background: var(--paper-2); color: var(--ink-2); }
.badge.dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ok { background: var(--ok-soft); color: var(--up); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.bad { background: var(--signal-soft); color: var(--down); }
.badge.count { background: var(--signal); color: #fff; min-width: 20px; justify-content: center; padding: 2px 7px; }

/* status hero */
.status-card { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; }
.status-card h2 { font: 700 1.35rem/1.25 var(--display); letter-spacing: -0.015em; margin: 10px 0 6px; }
.status-card p { margin: 0; color: var(--ink-2); max-width: 58ch; }
.status-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.card-head > .status-actions, .card-head > .btn { flex: none; }
.stepper { list-style: none; margin: 22px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; grid-column: 1 / -1; }
.stepper li { display: grid; gap: 8px; font-size: .84rem; color: var(--muted); }
.stepper li::before { content: ""; height: 4px; border-radius: 4px; background: var(--line-2); }
.stepper li.done::before { background: var(--up); }
.stepper li.now::before { background: linear-gradient(to right, var(--signal) 50%, var(--line-2) 50%); }
.stepper li.done, .stepper li.now { color: var(--ink); }
.stepper b { font-weight: 600; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px; padding: 16px 18px; }
.kpi dt { font: 500 .7rem/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.kpi dd { margin: 8px 0 0; font: 700 1.6rem/1.1 var(--display); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi .sk { display: inline-block; width: 90px; height: 22px; border-radius: 6px; background: var(--paper-2); animation: shimmer 1.1s ease-in-out infinite; vertical-align: middle; }

.actions { display: grid; gap: 10px; }
.action { display: grid; grid-template-columns: 40px 1fr auto; gap: 14px; align-items: center; padding: 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); text-decoration: none; color: inherit; cursor: pointer; text-align: left; font: inherit; width: 100%; transition: border-color .15s, transform .15s; }
.action:hover { border-color: var(--line); transform: translateY(-1px); }
.action .ico { width: 40px; height: 40px; border-radius: 10px; background: var(--paper-2); display: grid; place-items: center; color: var(--ink-2); }
.action .ico svg { width: 19px; height: 19px; }
.action b { display: block; font-weight: 600; font-size: .95rem; }
.action span { color: var(--muted); font-size: .85rem; }
.action .go { color: var(--muted); width: 18px; height: 18px; }
.action.done .ico { background: var(--ok-soft); color: var(--up); }

/* tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line-2); border-radius: 12px; }
.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th { text-align: left; font: 500 .7rem/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 11px 14px; background: var(--paper); white-space: nowrap; border-bottom: 1px solid var(--line-2); }
.tbl td { padding: 12px 14px; border-top: 1px solid var(--line-2); vertical-align: middle; }
.tbl tr:first-child td { border-top: 0; }
.tbl .num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .mono { font-size: .82rem; }
.tbl .clip { max-width: 230px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person { display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: center; }
.person .me-av { width: 34px; height: 34px; }
.person b { display: block; font-weight: 600; }
.person small { color: var(--muted); font-size: .82rem; }
.tbl select { font: inherit; font-size: .85rem; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--field); color: var(--ink); }

/* sample */
.sample-hero { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center; }
.sample-facts { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 14px 0 0; }
.sample-facts div { display: grid; gap: 2px; }
.sample-facts dt { font: 500 .68rem/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.sample-facts dd { margin: 0; font: 700 1.25rem/1.2 var(--display); font-variant-numeric: tabular-nums; }
.tbl td:has(> .thumb) { width: 64px; }
.thumb-none { display: block; }
.thumb { width: 44px; max-width: none; height: 44px; border-radius: 8px; object-fit: contain; background: var(--paper); border: 1px solid var(--line-2); }
.cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0 24px; margin: 0; }
.cols div { display: grid; grid-template-columns: 1fr; gap: 3px; padding: 11px 0; border-top: 1px solid var(--line-2); }
.cols dt { font: 600 .82rem var(--mono); color: var(--ink); }
.cols dd { margin: 0; color: var(--muted); font-size: .86rem; }

/* access request */
.chips-input { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-toggle { border: 1px solid var(--line); background: var(--field); color: var(--ink-2); border-radius: 999px; padding: 7px 13px; font: 500 .85rem var(--body); cursor: pointer; transition: all .12s; }
.chip-toggle:hover { border-color: var(--ink-2); }
.chip-toggle[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.option { position: relative; display: grid; gap: 4px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; background: var(--field); }
.option input { position: absolute; opacity: 0; pointer-events: none; }
.option b { font-size: .92rem; }
.option span { color: var(--muted); font-size: .82rem; }
.option:has(input:checked) { border-color: var(--signal); box-shadow: 0 0 0 1px var(--signal); }
.option:has(input:focus-visible) { outline: 2px solid var(--signal); outline-offset: 2px; }
.form-grid { display: grid; gap: 18px; }
.form-foot { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; border-top: 1px solid var(--line-2); padding-top: 18px; }
.summary { margin: 0; display: grid; gap: 0; }
.summary div { display: grid; grid-template-columns: 160px 1fr; gap: 16px; padding: 11px 0; border-top: 1px solid var(--line-2); }
.summary div:first-child { border-top: 0; }
.summary dt { color: var(--muted); font-size: .88rem; }
.summary dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }

.nudge { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; margin-top: 16px; padding: 14px 16px; border-radius: 12px; background: var(--signal-soft); border: 1px solid color-mix(in srgb, var(--signal) 25%, transparent); }
.nudge b { display: block; font-weight: 600; }
.nudge span { color: var(--ink-2); font-size: .9rem; }

/* messages */
.thread-card { display: grid; grid-template-rows: auto 1fr auto; padding: 0; overflow: hidden; min-height: 560px; }
.thread-head { padding: 18px 22px; border-bottom: 1px solid var(--line-2); display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.thread-head h2 { font: 700 1.05rem var(--display); }
.thread-head p { margin: 2px 0 0; color: var(--muted); font-size: .85rem; }
.thread { padding: 22px; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; max-height: 60vh; background: var(--paper); }
.bubble { max-width: min(560px, 85%); display: grid; gap: 5px; }
.bubble .who { font-size: .76rem; color: var(--muted); display: flex; gap: 8px; }
.bubble .who b { color: var(--ink-2); font-weight: 600; }
.bubble .text { padding: 12px 15px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line-2); white-space: pre-wrap; overflow-wrap: anywhere; font-size: .94rem; }
.bubble.mine { align-self: flex-end; }
.bubble.mine .who { justify-content: flex-end; }
.bubble.mine .text { background: var(--ink); color: var(--paper); border-color: var(--ink); border-bottom-right-radius: 4px; }
.bubble.team .text { border-bottom-left-radius: 4px; }
.day { align-self: center; font: 500 .72rem var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.composer { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; padding: 14px; border-top: 1px solid var(--line-2); background: var(--surface); align-items: end; }
.composer #attach-btn { align-self: end; }
.composer textarea { min-height: 46px; max-height: 200px; resize: none; }
.thread-empty { margin: auto; text-align: center; color: var(--muted); max-width: 36ch; display: grid; gap: 8px; justify-items: center; }
.thread-empty svg { width: 34px; height: 34px; color: var(--line); }

/* invite result */
.invite-link { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 12px; padding: 12px; border-radius: 12px; background: var(--ok-soft); border: 1px solid color-mix(in srgb, var(--up) 30%, transparent); }
.invite-link p { grid-column: 1 / -1; margin: 0; font-size: .86rem; }
.invite-link input { font: 500 .82rem var(--mono); padding: 9px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); width: 100%; }

.empty-state { text-align: center; color: var(--muted); padding: 30px 12px; font-size: .92rem; }
.skeleton { height: 14px; border-radius: 6px; background: var(--paper-2); animation: shimmer 1.1s ease-in-out infinite; }
.loading-screen { min-height: 100vh; display: grid; place-items: center; color: var(--muted); }

.mobile-bar { display: none; }

@media (max-width: 1080px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: min(290px, 86vw); z-index: 40; transform: translateX(-102%); transition: transform .22s ease; box-shadow: var(--shadow); }
  .app.nav-open .side { transform: none; }
  .scrim { position: fixed; inset: 0; background: rgba(8,13,23,.45); z-index: 35; }
  .mobile-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; position: sticky; top: 0; z-index: 30; padding: 10px 16px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line-2); }
  .menu-btn { border: 1px solid var(--line); background: var(--surface); border-radius: 9px; width: 40px; height: 40px; display: grid; place-items: center; color: var(--ink); cursor: pointer; }
  .menu-btn svg { width: 20px; height: 20px; }
  .main { padding: 22px 16px 56px; }
  .status-card, .sample-hero { grid-template-columns: 1fr; }
  .stepper { grid-template-columns: repeat(2, 1fr); }
  .options, .grid-3, .row-2 { grid-template-columns: 1fr; }
  .summary div { grid-template-columns: 1fr; gap: 4px; }
  .thread-card { min-height: 480px; }
}
@media (max-width: 520px) {
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi dd { font-size: 1.3rem; }
}

/* =====================================================================
   Refined app styling (2026-10-15). Quieter than the marketing site:
   ink buttons, hairline borders, orange only where attention is needed.
   Later rules here override the ones above.
   ===================================================================== */
.app, .auth-main {
  --r: 8px;
  --r-card: 12px;
  font-size: 15px;
}
.app .btn, .auth-main .btn, .dd-btn {
  border-radius: var(--r, 8px);
}
.app .btn, .auth-main .btn {
  --b: var(--ink);
  background: var(--ink); color: var(--paper); border: 1px solid var(--ink);
  padding: 10px 16px; font: 500 .9rem/1.2 var(--body); letter-spacing: 0;
  box-shadow: none; transform: none; gap: 8px;
}
.app .btn:hover, .auth-main .btn:hover { background: color-mix(in srgb, var(--ink) 86%, var(--paper)); box-shadow: none; transform: none; }
.app .btn:active, .auth-main .btn:active { background: color-mix(in srgb, var(--ink) 78%, var(--paper)); }
.app .btn-ghost, .app .btn-quiet {
  background: var(--surface); color: var(--ink); border-color: var(--line);
}
.app .btn-ghost:hover, .app .btn-quiet:hover { background: var(--paper); border-color: color-mix(in srgb, var(--ink) 30%, var(--line)); }
.app .btn-danger { background: transparent; color: var(--down); border-color: var(--line); }
.app .btn-danger:hover { background: color-mix(in srgb, var(--down) 8%, transparent); border-color: color-mix(in srgb, var(--down) 40%, var(--line)); }
.app .btn-small { padding: 6px 11px; font-size: .84rem; }
.app .btn .btn-icon, .auth-main .btn .btn-icon { width: 16px; height: 16px; }
.auth-main .btn { padding: 12px 16px; font-size: .95rem; }

/* surfaces */
.card, .kpi, .action, .req-summary, .thread-card { border-radius: var(--r-card); box-shadow: none; }
.card { padding: 20px 22px; border-color: var(--line-2); }
.card-head { margin-bottom: 14px; }
.card-head h2, .thread-head h2 { font: 600 1rem/1.35 var(--body); letter-spacing: -0.005em; }
.card-head p { font-size: .87rem; }

/* headings: smaller and calmer */
.page-head { margin-bottom: 22px; padding-bottom: 18px; border-bottom: 1px solid var(--line-2); }
.page-head h1 { font: 600 1.6rem/1.2 var(--display); letter-spacing: -0.02em; }
.page-head p { font-size: .93rem; }
.auth-card h1 { font: 700 1.75rem/1.15 var(--display); letter-spacing: -0.02em; }
.status-card h2 { font: 600 1.2rem/1.3 var(--display); letter-spacing: -0.015em; margin: 8px 0 6px; }

/* status: a dot and a word, not a pastel pill */
.badge { background: none; padding: 0; font: 500 .82rem/1.3 var(--body); color: var(--ink-2); gap: 7px; border-radius: 0; }
.badge.dot::before { width: 7px; height: 7px; }
.badge.ok { background: none; color: var(--ink-2); } .badge.ok.dot::before { background: var(--up); }
.badge.warn { background: none; color: var(--ink-2); } .badge.warn.dot::before { background: var(--warn); }
.badge.info { background: none; color: var(--ink-2); } .badge.info.dot::before { background: var(--info); }
.badge.bad { background: none; color: var(--ink-2); } .badge.bad.dot::before { background: var(--down); }
.badge:not(.dot):not(.count) { padding: 2px 8px; border: 1px solid var(--line); border-radius: 6px; font-size: .78rem; }
.badge.count { background: var(--signal); color: #fff; border: 0; border-radius: 999px; padding: 1px 7px; font: 600 .72rem/1.4 var(--body); }
.nav-item .badge:not(.count) { border: 0; padding: 0; font-size: .76rem; color: var(--muted); }

/* sidebar */
.side { padding: 16px 12px; }
.org-chip { border-radius: 10px; background: transparent; border-color: var(--line-2); }
.org-av { border-radius: 8px; font: 600 .85rem var(--body); }
.nav-item { border-radius: 7px; padding: 8px 10px; font-size: .9rem; }
.nav-item[aria-current="page"] { background: var(--paper); color: var(--ink); font-weight: 600; box-shadow: inset 2px 0 0 var(--signal); border-radius: 0 7px 7px 0; }
.nav-item[aria-current="page"] svg { color: var(--ink); }

/* progress: a thin line, ink when done */
.stepper { gap: 6px; margin-top: 20px; }
.stepper li { font-size: .82rem; gap: 9px; }
.stepper li::before { height: 2px; border-radius: 2px; }
.stepper li.done::before { background: var(--ink); }
.stepper li.now::before { background: linear-gradient(to right, var(--signal) 45%, var(--line-2) 45%); }

/* checklist */
.action { padding: 12px 14px; grid-template-columns: 34px 1fr auto; transform: none; }
.action:hover { transform: none; background: var(--paper); border-color: var(--line); }
.action .ico { width: 34px; height: 34px; border-radius: 8px; background: transparent; border: 1px solid var(--line-2); }
.action .ico svg { width: 17px; height: 17px; }
.action.done .ico { background: transparent; color: var(--up); border-color: color-mix(in srgb, var(--up) 35%, var(--line-2)); }
.action.done b { color: var(--muted); font-weight: 500; text-decoration: line-through; text-decoration-color: var(--line); }

/* labels in sentence case, not shouted */
.sample-facts dt, .tbl th, .cols dt { text-transform: none; letter-spacing: 0; }
.sample-facts dt { font: 400 .8rem/1 var(--body); color: var(--muted); }
.sample-facts dd { font: 600 1.15rem/1.2 var(--body); }
.tbl th { font: 500 .78rem/1 var(--body); color: var(--muted); background: transparent; }
.table-wrap { border-radius: 10px; }
.tbl td { padding: 11px 14px; }

/* form choices: ink when chosen */
.chip-toggle { border-radius: 7px; padding: 6px 11px; font-size: .84rem; }
.chip-toggle[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.option { border-radius: 10px; }
.option:has(input:checked) { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.field input, .field select, .field textarea, .input { border-radius: 8px; }

/* messages */
.bubble .text { border-radius: 10px; }
.bubble.mine .text { border-bottom-right-radius: 3px; }
.bubble.team .text { border-bottom-left-radius: 3px; }

/* misc boxes */
.notice { border-radius: 10px; background: var(--paper); border-color: var(--line-2); }
.notice svg { color: var(--ink-2); }
.invite-link { border-radius: 10px; background: var(--paper); border-color: var(--line-2); }
.req-summary { background: transparent; }
.toast { border-radius: 8px; font-size: .88rem; padding: 10px 14px; }
.me-av { font-weight: 600; }
.pw-toggle { font-weight: 500; }

/* auth side panel: quieter icons */
.auth-points .ico { background: transparent; border: 1px solid rgba(255,255,255,.12); color: #E6ECF5; }

#invite-form .btn { height: 46px; }

/* credits */
.quote { font-variant-numeric: tabular-nums; color: var(--ink-2); min-height: 1.5em; }
.quote b { font: 700 1.25rem/1.2 var(--display); letter-spacing: -0.015em; color: var(--ink); margin-right: 4px; }
#topup-records { max-width: 260px; font-variant-numeric: tabular-nums; }
.seg { display: inline-flex; padding: 3px; gap: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--field); width: max-content; }
.seg button { border: 0; background: transparent; color: var(--ink-2); font: 500 .88rem var(--body); padding: 7px 14px; border-radius: 7px; cursor: pointer; }
.seg button[aria-checked="true"] { background: var(--ink); color: var(--paper); }
.seg button:focus-visible { outline: 2px solid var(--signal); outline-offset: 1px; }
.wh-result { margin-top: 14px; display: grid; gap: 10px; }
.wh-result pre { margin: 0; max-height: 320px; overflow: auto; background: var(--paper-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 12px 14px; font: 12px/1.55 var(--mono); white-space: pre; }
#v-webhook code { font-family: var(--mono); font-size: .9em; }
.credits-grid { align-items: start; }
.tbl tr.now td { color: var(--ink); font-weight: 600; }

/* ---- message attachments (files & media in the thread) ---- */
.composer #attach-btn { padding: 8px 10px; }
.attach-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.attach-list[hidden] { display: none; }
.att-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--line, #eee); border-radius: 8px; padding: 4px 8px; font-size: 13px; }
.att-chip small { opacity: .6; }
.att-chip button { border: 0; background: none; cursor: pointer; font-size: 16px; line-height: 1; opacity: .7; }
.att-chip button:hover { opacity: 1; }
.bubble .attachments { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.att-img img, .att-vid { max-width: 220px; max-height: 220px; border-radius: 10px; display: block; }
.att-file { display: inline-flex; align-items: center; gap: 8px; max-width: 260px; padding: 8px 10px; border: 1px solid var(--line, #e4e4e4); border-radius: 10px; text-decoration: none; color: inherit; background: rgba(0,0,0,.02); }
.att-file:hover { background: rgba(0,0,0,.05); }
.att-file .att-ic { width: 18px; height: 18px; flex: none; opacity: .7; }
.att-file .att-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-file .att-size { margin-left: auto; opacity: .6; font-size: 12px; flex: none; }
