:root {
  --violet: #6D28D9;
  --violet-2: #3B0F7A;
  --violet-soft: #F1EBFE;
  --ink: #1E1B4B;
  --text: #2B2945;
  --muted: #6B6880;
  --line: #E7E4F2;
  --bg: #F7F6FB;
  --card: #FFFFFF;
  --profit: #16A34A;
  --profit-soft: #E8F8EE;
  --loss: #DC2626;
  --loss-soft: #FDECEC;
  --warn: #B45309;
  --warn-soft: #FFF6E0;
  --input: #FFFBEB;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(30, 27, 75, .05), 0 6px 20px rgba(30, 27, 75, .06);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Noto Sans Armenian", "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
a { color: var(--violet); text-decoration: none; }
h1, h2, h3 { color: var(--ink); margin: 0; letter-spacing: -.01em; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.muted { color: var(--muted); }
.pos { color: var(--profit); }
.neg { color: var(--loss); }
.hidden { display: none !important; }
.vh { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }

/* ---------- auth ---------- */
.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
}
.auth-hero {
  background: linear-gradient(140deg, #7C3AED, var(--violet-2));
  color: #fff;
  padding: 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.auth-hero h1 { color: #fff; font-size: 40px; line-height: 1.1; letter-spacing: -.02em; max-width: 460px; }
.auth-hero p { opacity: .85; font-size: 16px; max-width: 440px; }
.auth-hero ul { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 12px; }
.auth-hero li { display: flex; gap: 10px; align-items: flex-start; opacity: .95; }
.auth-hero li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #22C55E; margin-top: 7px; flex: none; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 32px 16px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card h2 { font-size: 24px; margin-bottom: 6px; }
.auth-card .sub { color: var(--muted); margin-bottom: 24px; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 600; font-size: 13px; color: var(--ink); }
.field input, .field select {
  height: 42px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; background: #fff; outline: none;
}
.field input:focus, .field select:focus { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(109, 40, 217, .15); }
.form-error { color: var(--loss); font-size: 13px; min-height: 18px; margin-bottom: 8px; }
.switch-link { margin-top: 16px; text-align: center; color: var(--muted); }
.demo-note { margin-top: 24px; padding: 12px 14px; background: var(--warn-soft); color: var(--warn); border-radius: 10px; font-size: 12.5px; }

/* ---------- buttons ---------- */
.btn {
  height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line); background: #fff;
  font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; justify-content: center;
}
.btn:hover { border-color: #CFC8E8; }
.btn-primary { background: var(--violet); border-color: var(--violet); color: #fff; }
.btn-primary:hover { background: #5B21B6; border-color: #5B21B6; }
.btn-block { width: 100%; height: 44px; }
.btn-sm { height: 32px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn-danger { color: var(--loss); }
.btn-ghost { background: transparent; border-color: transparent; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side {
  background: var(--ink);
  color: #CFCBEA;
  padding: 20px 14px;
  display: flex; flex-direction: column; gap: 4px;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 22px; color: #fff; font-weight: 800; font-size: 20px; letter-spacing: -.5px; }
.brand img { width: 32px; height: 32px; }
.brand span > svg, .paywall svg { width: 100%; height: auto; display: block; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: #CFCBEA; font-weight: 500;
}
.nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav a.active { background: rgba(124, 58, 237, .35); color: #fff; }
.nav svg { width: 18px; height: 18px; flex: none; }
.side-foot { margin-top: auto; padding: 12px; border-radius: 12px; background: rgba(255, 255, 255, .05); font-size: 12.5px; }
.side-foot b { color: #fff; display: block; overflow: hidden; text-overflow: ellipsis; }
.side-foot .plan { margin: 6px 0 10px; }
.side-foot button { width: 100%; height: 32px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, .15); background: transparent; color: #CFCBEA; cursor: pointer; }

.main { padding: 28px 32px 64px; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { font-size: 26px; }
.page-head p { margin: 4px 0 0; color: var(--muted); }

.banner { padding: 12px 16px; border-radius: 12px; margin-bottom: 18px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.banner.trial { background: var(--violet-soft); color: var(--violet-2); }
.banner.warn { background: var(--warn-soft); color: var(--warn); }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 20px; }
.card h3 { font-size: 15px; margin-bottom: 14px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi { padding: 16px 18px; }
.kpi .l { font-size: 12.5px; color: var(--muted); }
.kpi .v { font-size: 24px; font-weight: 800; color: var(--ink); margin-top: 4px; letter-spacing: -.02em; }
.kpi .s { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kpi.hero { background: linear-gradient(140deg, #7C3AED, var(--violet-2)); border: 0; }
.kpi.hero .l, .kpi.hero .s { color: rgba(255, 255, 255, .75); }
.kpi.hero .v { color: #fff; }

/* money flow */
.flow { display: grid; }
.flow .row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.flow .row.sub { padding-left: 14px; color: var(--muted); }
.flow .row.sub .num { color: var(--loss); }
.flow .row.strong { font-weight: 700; color: var(--ink); }
.flow .row.total { margin-top: 8px; border: 0; background: var(--ink); color: #fff; border-radius: 10px; padding: 12px 14px; font-weight: 800; font-size: 16px; }
.flow .row .pct { color: var(--muted); font-weight: 400; margin-left: 8px; }
.stats .row { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--line); }
.stats .row b { color: var(--ink); }

/* toolbar */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.page-head > .toolbar { margin-left: auto; justify-content: flex-end; } /* stays on the right even when it wraps under the title */
.select { height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; background: #fff; font-weight: 600; color: var(--ink); }
.search { height: 36px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; background: #fff; min-width: 200px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 22px 0 16px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 10px 14px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.active { color: var(--violet); border-bottom-color: var(--violet); }
.seg { display: inline-flex; background: #F1F0F6; border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; padding: 7px 14px; border-radius: 8px; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; }
.seg button.active { background: #fff; color: var(--violet); box-shadow: 0 1px 3px rgba(30,27,75,.12); }
.tabs .count { font-size: 11px; background: var(--violet-soft); color: var(--violet); padding: 1px 7px; border-radius: 99px; margin-left: 6px; }

/* tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 12px; font-weight: 600; color: var(--muted); background: #FBFAFE; position: sticky; top: 0; }
td.r, th.r { text-align: right; }
tr.total td { font-weight: 700; color: var(--ink); background: var(--violet-soft); }
tbody tr:hover td { background: #FCFBFF; }
.art { font-weight: 600; color: var(--ink); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; }
.pill.ok { background: var(--profit-soft); color: var(--profit); }
.pill.bad { background: var(--loss-soft); color: var(--loss); }
.pill.wait { background: #F1F0F6; color: var(--muted); }
.pill.vio { background: var(--violet-soft); color: var(--violet); }
.empty { padding: 48px 20px; text-align: center; color: var(--muted); }

/* dropzone */
.drop {
  display: block;
  border: 2px dashed #CDBDF5; border-radius: var(--radius); background: #FBF9FF; padding: 28px; text-align: center; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.drop.over { background: var(--violet-soft); border-color: var(--violet); }
.drop b { color: var(--ink); font-size: 15px; }
.drop p { margin: 6px 0 0; color: var(--muted); }
.weeks-list { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; border-radius: 99px; background: #fff; border: 1px solid var(--line); font-size: 12.5px; }
.chip button { border: 0; background: #F1F0F6; width: 22px; height: 22px; border-radius: 50%; cursor: pointer; color: var(--muted); }
.chip button:hover { background: var(--loss-soft); color: var(--loss); }

/* unit economics */
.ue { display: grid; grid-template-columns: 420px 1fr; gap: 16px; align-items: start; }
.inp-row { display: grid; grid-template-columns: 1fr 120px 28px; gap: 8px; align-items: center; padding: 6px 0; }
.inp-row label { color: var(--text); }
.inp-row input { height: 36px; border: 1px solid #F0D98C; background: var(--input); border-radius: 8px; padding: 0 10px; text-align: right; font-weight: 700; width: 100%; }
.inp-row input:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 3px rgba(109, 40, 217, .15); }
.inp-row .u { color: var(--muted); font-size: 12px; }
.inp-sep { height: 1px; background: var(--line); margin: 10px 0; }
.big-result { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.cell-inp { width: 96px; height: 32px; border: 1px solid #F0D98C; background: var(--input); border-radius: 6px; padding: 0 8px; text-align: right; }
.cell-inp.wide { width: 180px; text-align: left; }
.cell-inp::placeholder { color: #B9B4CC; font-weight: 400; }

/* admin */
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; }

/* paywall */
.paywall { max-width: 520px; margin: 10vh auto; text-align: center; padding: 36px; }
.paywall h1 { font-size: 26px; margin: 16px 0 8px; }
.paywall p { color: var(--muted); }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; box-shadow: var(--shadow); z-index: 50; max-width: calc(100vw - 32px);
}

.mob-top { display: none; }

/* KPI mock (landing + auth) */
.mock { background: #fff; color: var(--text); border-radius: 18px; padding: 18px 20px; box-shadow: 0 20px 50px rgba(30, 27, 75, .25); max-width: 440px; width: 100%; }
.mock-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.mock-row b { color: var(--ink); white-space: nowrap; }
.mock-row.minus b { color: var(--loss); }
.mock-total { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; padding: 14px 16px; border-radius: 12px; background: linear-gradient(140deg, #7C3AED, var(--violet-2)); color: #fff; font-weight: 700; }
.mock-total b { font-size: 20px; white-space: nowrap; }
.mock-note { font-size: 11.5px; color: var(--muted); margin-top: 10px; text-align: center; }
.auth-hero .mock { margin-top: 24px; }
.secure { font-size: 12.5px; color: var(--muted); margin-top: 12px; line-height: 1.5; }
.next-steps { margin: 14px 0 0; padding-left: 20px; color: var(--muted); font-size: 13px; display: grid; gap: 2px; }
.how { margin: 0; padding-left: 20px; display: grid; gap: 8px; }

/* landing */
.land { background: #fff; }
.land-wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.land-wrap.narrow { max-width: 760px; }
.land section { padding: 72px 0; }
.land h2 { font-size: 30px; line-height: 1.2; margin-bottom: 14px; }
.land p { font-size: 16px; color: var(--muted); }
.center { text-align: center; }
.land-top { position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.land-top .land-wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.land-top .brand { padding: 0; color: var(--ink); }
.land-top nav { display: flex; align-items: center; gap: 22px; }
.land-top nav a { color: var(--text); font-weight: 500; }
.hero { background: linear-gradient(180deg, #F4EFFF, #fff); }
.hero-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; }
.hero h1 { font-size: 46px; line-height: 1.08; letter-spacing: -.025em; margin: 10px 0 16px; }
.lead { font-size: 18px !important; }
.eyebrow { display: inline-block; font-size: 13px; font-weight: 700; color: var(--violet); background: var(--violet-soft); padding: 5px 12px; border-radius: 99px; }
.eyebrow.light { background: rgba(255, 255, 255, .12); color: #C4B5FD; }
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.btn-lg { height: 50px; padding: 0 24px; font-size: 16px; border-radius: 12px; }
.trust { margin-top: 14px; font-size: 13px; color: var(--muted); }
.band { background: var(--ink); }
.band h2, .dark h2 { color: #fff; }
.band p, .dark p { color: #C9C5E6; }
.band b { color: #fff; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 28px 0; }
.step { background: var(--bg); border: 1px solid var(--line); border-radius: 16px; padding: 22px; }
.step span { display: inline-flex; width: 34px; height: 34px; border-radius: 50%; background: var(--violet); color: #fff; align-items: center; justify-content: center; font-weight: 800; }
.step b { display: block; margin: 12px 0 6px; color: var(--ink); font-size: 17px; }
.step p { font-size: 14px; margin: 0; }
.alt { background: var(--bg); }
.features { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.feature { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 24px; }
.feature b { color: var(--ink); font-size: 18px; }
.feature p { margin: 8px 0 0; font-size: 15px; }
.dark { background: linear-gradient(140deg, #1E1B4B, #3B0F7A); }
.dark-mock { justify-self: end; }
.price-card { background: #fff; border: 2px solid var(--violet); border-radius: 20px; padding: 28px; margin-top: 20px; text-align: left; box-shadow: var(--shadow); }
.price-card ul { padding-left: 20px; color: var(--text); display: grid; gap: 6px; margin: 16px 0 20px; }
.founder { display: inline-block; background: #FFF4E5; color: #B45309; font-weight: 700; font-size: 13px; padding: 5px 12px; border-radius: 99px; }
.price { margin-top: 12px; color: var(--ink); }
.price s { color: var(--muted); font-size: 20px; margin-right: 6px; }
.price b { font-size: 42px; letter-spacing: -.02em; }
.price span { color: var(--muted); margin-left: 4px; }
.faq { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; margin-bottom: 10px; }
.faq summary { cursor: pointer; font-weight: 700; color: var(--ink); }
.faq p { margin: 10px 0 0; font-size: 15px; }
.final { background: linear-gradient(180deg, #fff, #F4EFFF); }
.land-foot { border-top: 1px solid var(--line); padding: 24px 0; color: var(--muted); font-size: 14px; }
.land-foot .land-wrap { display: flex; gap: 24px; flex-wrap: wrap; justify-content: space-between; }

/* compact upload bar */
.drop.compact { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 16px; text-align: left; border-width: 1.5px; }
.drop.compact .weeks-list { margin: 0 0 0 auto; }

/* billing */
.pay { display: grid; grid-template-columns: 1fr 220px; gap: 24px; align-items: start; }
.pay ol { padding-left: 20px; display: grid; gap: 10px; margin: 16px 0 20px; color: var(--text); }
.pay .copy { cursor: pointer; color: var(--violet); white-space: nowrap; }
.pay-qr img { width: 100%; border-radius: 14px; border: 1px solid var(--line); display: block; }
.paywall { max-width: 780px; }

/* fact + analysis */
.fact-edit td { background: var(--violet-soft) !important; }
.fact-form { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; padding: 6px 0; }
.fact-form label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.fact-form .cell-inp { width: 130px; }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; vertical-align: middle; }
.dot.green { background: #16A34A; } .dot.yellow { background: #EAB308; } .dot.red { background: #DC2626; }
.light-green { border-top: 4px solid #16A34A; } .light-yellow { border-top: 4px solid #EAB308; } .light-red { border-top: 4px solid #DC2626; }
.verdicts { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 14px; margin-top: 16px; }
.verdict { padding: 16px 18px; border-left: 6px solid; }
.verdict.green { border-left-color: #16A34A; } .verdict.yellow { border-left-color: #EAB308; } .verdict.red { border-left-color: #DC2626; }
.verdict-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.verdict ul { margin: 10px 0; padding-left: 18px; display: grid; gap: 4px; font-size: 13px; color: var(--text); }
.concl { font-size: 13.5px; padding: 10px 12px; border-radius: 10px; background: var(--bg); }
.verdict.red .concl { background: var(--loss-soft); } .verdict.green .concl { background: var(--profit-soft); } .verdict.yellow .concl { background: #FEF9C3; }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.checklist li { display: flex; gap: 10px; align-items: baseline; }
.checklist li span { width: 22px; height: 22px; border-radius: 50%; background: #F1F0F6; display: inline-flex; align-items: center; justify-content: center; flex: none; color: var(--muted); }
.checklist li.ok span { background: var(--profit-soft); color: var(--profit); }
.method { margin: 0; padding-left: 18px; display: grid; gap: 8px; color: var(--text); }

/* sign-up prompt (demo limits) */
#modal { position: fixed; inset: 0; z-index: 70; background: rgba(15, 13, 31, .6); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-card { width: 420px; max-width: 100%; background: #fff; border-radius: 18px; padding: 24px; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.modal-card b { color: var(--ink); font-size: 18px; }
.modal-card p { color: var(--muted); margin: 8px 0 12px; }
.modal-card ul { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 6px; }
.modal-card ul b { font-size: inherit; }

/* guided tour */
#tour { position: fixed; inset: 0; z-index: 60; cursor: pointer; }
.tour-dim { position: fixed; inset: 0; background: rgba(15, 13, 31, .6); }
.tour-hole { position: fixed; border-radius: 12px; box-shadow: 0 0 0 9999px rgba(15, 13, 31, .6); outline: 3px solid #A78BFA; pointer-events: none; transition: all .2s; }
.tour-card { position: fixed; width: 340px; max-width: calc(100vw - 24px); background: #fff; border-radius: 16px; padding: 18px; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); cursor: default; }
.tour-card b { color: var(--ink); font-size: 16px; }
.tour-card p { margin: 6px 0 14px; color: var(--muted); }
.tour-count { font-size: 12px; font-weight: 700; color: var(--violet); margin-bottom: 4px; }
.tour-actions { display: flex; justify-content: space-between; }

@media (max-width: 860px) {
  .hero-grid, .steps, .features, .pay { grid-template-columns: 1fr; }
  .hero h1 { font-size: 32px; }
  .land section { padding: 48px 0; }
  .land-top nav a:not(.btn) { display: none; }
  .dark-mock { justify-self: stretch; }
  .auth-hero .mock { display: none; }
  .pay-qr { max-width: 240px; }
}

/* support chat */
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: #EF4444; color: #fff; font-size: 11px; font-weight: 700; font-style: normal; margin-left: auto; }
.nav a .badge { margin-left: auto; }
.badge[hidden] { display: none; }
.chat-fab {
  position: fixed; right: 20px; bottom: 20px; z-index: 45; display: inline-flex; align-items: center; gap: 8px;
  height: 48px; padding: 0 18px; border: 0; border-radius: 99px; background: var(--violet); color: #fff; font-weight: 700; cursor: pointer;
  box-shadow: 0 8px 24px rgba(109, 40, 217, .35);
}
.chat-fab svg { width: 20px; height: 20px; }
.chat-fab .badge { margin-left: 4px; background: #22C55E; }
.chat-panel {
  position: fixed; right: 20px; bottom: 20px; z-index: 45; width: 360px; max-width: calc(100vw - 32px); height: 520px; max-height: calc(100vh - 40px);
  display: flex; flex-direction: column; background: #fff; border-radius: 16px; box-shadow: 0 16px 48px rgba(30, 27, 75, .25); overflow: hidden;
}
.chat-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; background: var(--ink); color: #fff; }
.chat-head b { display: block; }
.chat-head span { font-size: 12px; opacity: .75; }
.chat-head button { background: none; border: 0; color: #fff; font-size: 24px; cursor: pointer; line-height: 1; }
.chat-head.light { background: #FBFAFE; color: var(--ink); border-bottom: 1px solid var(--line); }
.chat-body { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; background: var(--bg); }
.chat-empty { color: var(--muted); text-align: center; margin: auto 0; padding: 20px; }
.msg { max-width: 80%; padding: 8px 12px; border-radius: 14px; background: #fff; border: 1px solid var(--line); align-self: flex-start; }
.msg.me { align-self: flex-end; background: var(--violet); color: #fff; border-color: var(--violet); }
.msg span { display: block; font-size: 10.5px; opacity: .65; margin-top: 3px; text-align: right; }
.chat-input { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); background: #fff; }
.chat-input textarea { flex: 1; resize: none; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font: inherit; outline: none; }
.chat-input textarea:focus { border-color: var(--violet); }
.chat-input .attach { width: 40px; padding: 0; font-size: 18px; position: relative; }
.chat-pay { padding: 10px 14px; background: var(--warn-soft); color: var(--warn); font-size: 13px; border-top: 1px solid var(--line); }
.chat-file { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 14px; background: var(--violet-soft); color: var(--violet-2); font-size: 13px; border-top: 1px solid var(--line); }
.chat-file button { border: 0; background: none; font-size: 18px; cursor: pointer; color: inherit; }
.chat-note { align-self: center; text-align: center; font-size: 12.5px; color: var(--profit); background: var(--profit-soft); padding: 8px 12px; border-radius: 10px; }
.msg .att { display: block; margin-bottom: 6px; color: inherit; text-decoration: underline; }
.msg .att img { display: block; max-width: 220px; max-height: 260px; border-radius: 10px; }
.modal-card.wide { width: 720px; }
.support { display: grid; grid-template-columns: 320px 1fr; gap: 16px; height: calc(100vh - 170px); min-height: 420px; }
.threads { overflow-y: auto; }
.thread { display: grid; gap: 2px; width: 100%; text-align: left; padding: 12px 14px; border: 0; border-bottom: 1px solid var(--line); background: #fff; cursor: pointer; }
.thread:hover { background: #FBFAFE; }
.thread.active { background: var(--violet-soft); }
.thread b { display: flex; align-items: center; gap: 6px; color: var(--ink); }
.thread span { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread small { color: var(--muted); font-size: 11px; }
.conv { display: flex; flex-direction: column; overflow: hidden; }
@media (max-width: 860px) { .support { grid-template-columns: 1fr; height: auto; } .conv { height: 480px; } }

@media (max-width: 1100px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ue { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-hero { padding: 32px 16px; }
  .auth-hero h1 { font-size: 28px; }
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .side.open { display: flex; position: fixed; inset: 0; z-index: 40; height: 100vh; width: 260px; }
  .mob-top { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--ink); color: #fff; position: sticky; top: 0; z-index: 30; }
  .mob-top button { background: none; border: 0; color: #fff; font-size: 22px; }
  .main { padding: 20px 16px 48px; }
  .g2 { grid-template-columns: 1fr; }
}

/* weekly/daily switch: pinned to the header's top-right corner so no text or selector can move it */
.page-head.pinned { position: relative; padding-right: 460px; }
.period-pin { position: absolute; top: 0; right: 0; display: flex; gap: 10px; align-items: center; }
@media (max-width: 760px) {
  .page-head.pinned { padding-right: 0; }
  .period-pin { position: static; flex-wrap: wrap; }
}

.note-line { background: var(--violet-soft); color: var(--ink); border-radius: 12px; padding: 10px 14px; font-size: 13.5px; margin: -8px 0 18px; }
