/* ============================================================
   fpos-tickets — Minimal premium white design system (0.5.0)
   Accent: violet #6d5efc · Light only · Spacious · App-like
   ============================================================ */
:root {
  --acc: #6d5efc;
  --acc-deep: #5646f6;
  --acc-tint: #eeecff;
  --acc-soft: #f6f4ff;
  --acc-glow: rgba(109, 94, 252, .18);
  --brand: #2563eb;
  --ink: #101828;
  --muted: #667085;
  --muted-2: #98a2b3;
  --canvas: #f3f5fb;
  --studio: #0f172a;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --line: #e6eaf2;
  --line-strong: #d8deea;
  --green: #12b76a;
  --green-soft: #e8fff3;
  --amber: #f79009;
  --amber-deep: #b54708;
  --amber-soft: #fff7e8;
  --red: #f04438;
  --red-soft: #fff0ef;
  --blue: #2563eb;
  --blue-deep: #175cd3;
  --blue-soft: #eef4ff;
  --purple: #7a5af8;
  --purple-soft: #f2efff;
  --gray: #475467;
  --gray-soft: #f2f4f7;
  --shadow-sm: 0 8px 18px rgba(16, 24, 40, .05);
  --shadow: 0 18px 40px rgba(16, 24, 40, .08);
  --shadow-lg: 0 28px 70px rgba(2, 6, 23, .24);
  --r-sm: 14px;
  --r: 22px;
  --r-lg: 34px;
  --appbar-h: 60px;
  --tabbar-h: 68px;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --font: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); background: var(--canvas); color: var(--ink);
  line-height: 1.45; font-size: 15px;
  padding-top: calc(var(--appbar-h) + var(--sat));
  padding-bottom: calc(var(--tabbar-h) + var(--sab));
  min-height: 100vh;
}
a { color: var(--acc-deep); text-decoration: none; }
h1 { font-size: 1.3rem; margin: 0 0 .9rem; letter-spacing: -.02em; }
h2 { font-size: 1.02rem; margin: 0 0 .7rem; letter-spacing: -.01em; }

/* ---------- App bar ---------- */
.appbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  min-height: calc(var(--appbar-h) + var(--sat));
  padding-top: var(--sat);
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: .7rem;
  padding-left: 1.1rem; padding-right: 1.1rem;
}
.appbar .brand { display: flex; align-items: center; gap: .7rem; color: var(--ink); min-width: 0; }
.appbar .brand .logo {
  width: 38px; height: 38px; border-radius: 14px;
  background: linear-gradient(135deg, var(--acc) 0%, var(--brand) 100%);
  display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 1rem;
  box-shadow: 0 12px 22px var(--acc-glow); flex-shrink: 0;
}
.appbar .brand .title { font-weight: 700; font-size: 1.02rem; letter-spacing: -.03em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.appbar .brand .subtitle { font-size: .72rem; color: var(--muted); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.appbar .spacer { flex: 1; }
.avatar {
  min-width: 42px; height: 42px; padding: 0 12px; border-radius: 999px;
  background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  display: flex; align-items: center; gap: 10px; font-size: .76rem; font-weight: 600; color: var(--ink);
  flex-shrink: 0;
}
.avatar-dot {
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; flex-shrink: 0;
  background: var(--acc-soft); color: var(--acc-deep); font-weight: 800; font-size: .8rem;
}
.appbar .who { display: flex; align-items: center; gap: .5rem; font-size: .82rem; color: var(--muted); }
.appbar .who .name { font-weight: 600; color: var(--ink); }

/* ---------- Main ---------- */
main { max-width: 640px; margin: 0 auto; padding: 1rem 1rem 1.6rem; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: 1rem; }
.page-head h1 { margin: 0; }

/* ---------- Cards ---------- */
.card, .panel, .banner, .sheet, .thread, .composer, .table-card, .hero-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow-sm);
}
.card, .panel, .banner, .table-card, .hero-card { padding: 16px; }
.card { margin-bottom: .9rem; }
.card h2 { display: flex; align-items: center; gap: .4rem; }
.hero-card {
  padding: 20px;
  background: linear-gradient(135deg, #fff 0%, #faf8ff 100%);
  border-color: #ebe6ff;
}
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cluster { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.grow { flex: 1; }
.flex { display: flex; align-items: center; gap: .5rem; }
.text-right { text-align: right; }
.hidden { display: none !important; }

/* ---------- Metrics (pulse dashboard) ---------- */
.metric {
  padding: 14px; border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f9faff 100%);
  border: 1px solid var(--line);
}
.metric .kpi { font-size: 28px; font-weight: 800; letter-spacing: -.04em; line-height: 1.1; }
.metric .cap { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* ---------- Pills / badges / chips / tags ---------- */
.pill, .badge, .chip, .tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px; border-radius: 999px; font-size: 12px; font-weight: 700;
  border: 1px solid transparent; white-space: nowrap;
}
.pill { background: #fff; border-color: var(--line); color: var(--muted); }
.pill.active { background: var(--acc-soft); color: var(--acc-deep); border-color: #e7e3ff; }
.badge.gray { background: var(--gray-soft); color: var(--gray); }
.badge.blue { background: var(--blue-soft); color: var(--blue); }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.amber { background: var(--amber-soft); color: var(--amber-deep); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.purple { background: var(--purple-soft); color: var(--purple); }
.badge.violet { background: var(--acc-soft); color: var(--acc-deep); }
.chip { background: #f8f9fc; color: #344054; border-color: var(--line); }
.tag { background: var(--acc-soft); color: var(--acc-deep); }

/* ---------- Ticket cards ---------- */
.ticket-list { display: flex; flex-direction: column; gap: 14px; }
.ticket-card {
  padding: 16px; border-radius: 22px; background: #fff;
  border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 12px; color: var(--ink);
  transition: transform .12s ease, box-shadow .12s ease;
}
a.ticket-card:active { transform: scale(.985); }
.ticket-card .row1 { display: flex; align-items: center; gap: .5rem; }
.ticket-card .ref { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .78rem; color: var(--muted); font-weight: 700; }
.ticket-card .subject { font-weight: 700; font-size: .98rem; letter-spacing: -.02em; }
.ticket-card .meta { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; font-size: .76rem; color: var(--muted); }
.ticket-card .meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--muted-2); }
.ticket-card .agent-chip {
  display: inline-flex; align-items: center; gap: .3rem; background: #f8f9fc; color: #344054;
  border: 1px solid var(--line); border-radius: 999px; padding: .12rem .55rem; font-size: .74rem; font-weight: 600;
}
.ticket-card .view { font-size: .76rem; color: var(--acc-deep); font-weight: 700; }

/* ---------- Status color rails (0.5.1) — at-a-glance ticket identity ---------- */
.ticket-card { position: relative; border-left: 6px solid var(--st, var(--line)); }
.ticket-card.st-new,
.ticket-card.st-under_review    { --st: var(--blue);   --st-tint: var(--blue-soft);   background: linear-gradient(135deg, #ffffff 0%, var(--blue-soft) 175%); }
.ticket-card.st-approved        { --st: var(--purple); --st-tint: var(--purple-soft); background: linear-gradient(135deg, #ffffff 0%, var(--purple-soft) 175%); }
.ticket-card.st-in_progress,
.ticket-card.st-reopened        { --st: var(--amber);  --st-tint: var(--amber-soft);  background: linear-gradient(135deg, #ffffff 0%, var(--amber-soft) 175%); }
.ticket-card.st-ready_for_testing { --st: var(--acc);  --st-tint: var(--acc-soft);    background: linear-gradient(135deg, #ffffff 0%, var(--acc-soft) 175%); }
.ticket-card.st-completed       { --st: var(--green);  --st-tint: var(--green-soft);  background: linear-gradient(135deg, #ffffff 0%, var(--green-soft) 175%); }
.ticket-card.st-rejected        { --st: var(--red);    --st-tint: var(--red-soft);    background: linear-gradient(135deg, #ffffff 0%, var(--red-soft) 175%); }
.ticket-card.st-closed          { --st: var(--gray);   --st-tint: var(--gray-soft);   background: linear-gradient(135deg, #ffffff 0%, var(--gray-soft) 175%); }
.ticket-card .ref { display: inline-flex; align-items: center; gap: 7px; }
.ticket-card .ref::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--st); box-shadow: 0 0 0 4px var(--st-tint, var(--line));
}
a.ticket-card:hover { border-left-color: var(--st, var(--line-strong)); }

/* ---------- Chat thread ---------- */
.thread { padding: 14px; display: flex; flex-direction: column; gap: 12px; margin-bottom: .9rem; }
.msg { max-width: 88%; padding: 12px 14px; border-radius: 18px; line-height: 1.45; font-size: 13px; border: 1px solid var(--line); }
.msg .meta { font-size: .7rem; color: var(--muted); margin-bottom: .25rem; display: flex; align-items: center; gap: .35rem; }
.msg .meta .badge { font-size: .66rem; padding: .1rem .5rem; }
.msg pre { background: rgba(0,0,0,.05); border-radius: 12px; padding: .6rem; overflow-x: auto; font-size: .78rem; white-space: pre-wrap; word-break: break-word; margin: .45rem 0 0; }
.msg .body { white-space: pre-wrap; word-break: break-word; }
.msg.agent { align-self: flex-start; background: #fff; border-bottom-left-radius: 6px; }
.msg.client { align-self: flex-end; background: var(--blue-soft); border-color: #d8e5ff; border-bottom-right-radius: 6px; margin-left: auto; }
.msg.admin { align-self: flex-start; background: var(--purple-soft); border-color: #e2dcff; border-bottom-left-radius: 6px; }
.msg.system { max-width: 100%; background: transparent; border: none; text-align: center; color: var(--muted); padding: 4px 0; font-size: .76rem; }
.thread-empty { text-align: center; color: var(--muted); padding: 2rem 1rem; font-size: .9rem; }
.codebox {
  margin-top: 8px; padding: 10px 12px; background: var(--amber-soft);
  border: 1px solid #f4d7a2; border-radius: 14px; font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: #925f13;
  white-space: pre-wrap; word-break: break-word;
}

/* ---------- Compose bar ---------- */
.compose { position: sticky; bottom: calc(var(--tabbar-h) + var(--sab)); background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 12px; margin-top: 12px; box-shadow: var(--shadow); }
.compose textarea { border: 0; outline: 0; resize: none; width: 100%; font-family: inherit; font-size: .95rem; min-height: 52px; max-height: 140px; padding: .3rem .4rem; background: transparent; }
.compose .row { display: flex; align-items: center; gap: .5rem; }

/* ---------- Forms ---------- */
label { display: block; font-size: .82rem; font-weight: 650; color: var(--ink); margin: .95rem 0 .3rem; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], input[type=date],
select, textarea {
  width: 100%; padding: 14px; border: 1px solid var(--line); border-radius: 18px;
  font-size: 14px; font-family: inherit; background: #fff; color: var(--ink);
  transition: border-color .12s ease, box-shadow .12s ease;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--acc); box-shadow: 0 0 0 3px var(--acc-glow); background: #fff; }
textarea { min-height: 100px; line-height: 1.55; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23667085' d='M6 8 0 0h12z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .9rem center; padding-right: 2.2rem; }
.upload {
  border: 1.5px dashed var(--line-strong); border-radius: 18px; padding: 16px; text-align: center;
  background: linear-gradient(180deg, #fff 0%, #fbfbff 100%); color: var(--muted); font-size: .86rem; cursor: pointer;
}
.form-hint { font-size: .76rem; color: var(--muted); margin-top: .25rem; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.desc-box { background: var(--surface-2); border: 1px solid var(--line); border-radius: 16px; padding: 14px; white-space: pre-wrap; font-size: .9rem; margin-top: .4rem; line-height: 1.55; }

/* ---------- Wizard (2-step raise) ---------- */
.wizard-step { display: none; }
.wizard-step.active { display: flex; flex-direction: column; gap: 12px; }
.wizard-nav { display: flex; gap: 10px; margin-top: 4px; }
.wizard-nav .btn { flex: 1; }
.step-dots { display: flex; gap: 6px; align-items: center; justify-content: center; margin: 0 0 14px; }
.step-dot { width: 8px; height: 8px; border-radius: 99px; background: var(--line-strong); transition: all .2s ease; }
.step-dot.active { width: 26px; background: var(--acc); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 18px; border-radius: 16px;
  font-size: 14px; font-weight: 800; font-family: inherit; cursor: pointer; text-decoration: none;
  border: none; transition: transform .1s ease, box-shadow .12s ease, background .12s ease;
}
.btn:active { transform: scale(.98); }
.btn.primary { background: linear-gradient(135deg, var(--acc) 0%, var(--brand) 100%); color: #fff; box-shadow: 0 14px 24px var(--acc-glow); }
.btn.primary:hover { box-shadow: 0 16px 30px var(--acc-glow); }
.btn.secondary { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn.success { background: var(--green); color: #fff; box-shadow: 0 14px 24px rgba(18, 183, 106, .18); }
.btn.danger { background: var(--red); color: #fff; }
.btn.small { min-height: 34px; padding: 0 12px; font-size: .78rem; border-radius: 12px; }
.btn.block { width: 100%; }
.btn svg { width: 16px; height: 16px; }

/* ---------- Alerts / banners ---------- */
.alert { padding: 14px; border-radius: 18px; font-size: .86rem; margin-bottom: .9rem; line-height: 1.4; border: 1px solid; }
.alert.error { background: var(--red-soft); color: var(--red); border-color: #ffd9d6; }
.alert.ok { background: var(--green-soft); color: #087443; border-color: #c7f4d8; }
.alert.info { background: var(--blue-soft); color: var(--blue); border-color: #d8e5ff; }
.banner { border-color: var(--line); }
.banner.error { background: var(--red-soft); color: var(--red); border-color: #ffd9d6; }
.banner.ok { background: var(--green-soft); color: #087443; border-color: #c7f4d8; }
.banner.info { background: var(--blue-soft); color: var(--blue); border-color: #d8e5ff; }
.banner.acc { background: var(--acc-soft); color: var(--acc-deep); border-color: #e5e0ff; }
.banner.warn { background: #fff7ed; border-color: #ffd5ab; color: var(--amber-deep); }

/* ---------- Tables / table-cards (admin, desktop-friendly) ---------- */
.table-card { padding: 16px; margin-bottom: .9rem; }
.table-card .table-row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--line); font-size: .86rem;
}
.table-card .table-row:last-child { border-bottom: none; }
.table-wrap { overflow-x: auto; border-radius: 14px; }
table { width: 100%; border-collapse: collapse; font-size: .86rem; }
th { text-align: left; color: var(--muted); font-weight: 650; padding: .55rem .6rem; border-bottom: 2px solid var(--line); white-space: nowrap; font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; }
td { padding: .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tr:hover td { background: #fafbfc; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .82rem; }
.muted { color: var(--muted); font-size: .82rem; }
.tiny { font-size: 12px; color: var(--muted); }

/* ---------- Stats (0.5.1 color-coded stat cards) ---------- */
.statgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); gap: 12px; margin-bottom: 14px; }
.stat {
  background: linear-gradient(180deg, #ffffff 0%, var(--sc-soft, #f8fafc) 130%);
  border-radius: 18px; box-shadow: var(--shadow-sm); border: 1px solid var(--line);
  border-left: 5px solid var(--sc, var(--line-strong));
  padding: 14px;
}
.stat .n { font-size: 1.55rem; font-weight: 800; letter-spacing: -.03em; color: var(--sc, var(--ink)); line-height: 1.1; }
.stat .l { font-size: .76rem; color: var(--muted); margin-top: .1rem; font-weight: 600; }
.stat .ic {
  display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px;
  border-radius: 10px; background: var(--sc-soft, var(--surface-2)); font-size: .95rem; margin-bottom: 8px;
}
.stat.sc-blue   { --sc: var(--blue);     --sc-soft: var(--blue-soft); }
.stat.sc-amber  { --sc: var(--amber-deep); --sc-soft: var(--amber-soft); }
.stat.sc-violet { --sc: var(--acc-deep); --sc-soft: var(--acc-soft); }
.stat.sc-green  { --sc: var(--green);    --sc-soft: var(--green-soft); }
.stat.sc-red    { --sc: var(--red);      --sc-soft: var(--red-soft); }
.stat.sc-gray   { --sc: var(--gray);     --sc-soft: var(--gray-soft); }
.stat.sc-purple { --sc: var(--purple);   --sc-soft: var(--purple-soft); }

/* ---------- Section headers (dashboard: Recent tickets → View all) ---------- */
.section-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin: 1.05rem 0 .65rem; }
.section-head h2 { margin: 0; font-size: 1rem; }
.section-head .view-all { font-size: .8rem; font-weight: 800; color: var(--acc-deep); display: inline-flex; align-items: center; gap: 4px; }

/* ---------- Filters ---------- */
.filters { display: flex; gap: .5rem; flex-wrap: wrap; align-items: end; margin-bottom: 14px; }
.filters .f { min-width: 140px; }
.filters .f label { margin: 0 0 .25rem; font-size: .74rem; }

/* ---------- Detail grid (ticket header) ---------- */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.detail-grid .f label { margin: 0 0 .15rem; font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.detail-grid .f .v { font-size: .92rem; font-weight: 600; }
.thumb { max-width: 130px; border-radius: 14px; border: 1px solid var(--line); margin: .25rem .4rem .25rem 0; }

/* ---------- Timeline ---------- */
.timeline { list-style: none; margin: .4rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.timeline li { display: flex; gap: 14px; font-size: .84rem; }
.timeline .tl-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--acc); margin-top: 6px; flex-shrink: 0; box-shadow: 0 0 0 6px var(--acc-soft); }
.timeline .tl-time { color: var(--muted); font-size: .74rem; margin-top: 1px; }

/* ---------- Bottom tab bar (floating dock) ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  background: rgba(255, 255, 255, .94); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  padding: 8px 14px calc(8px + var(--sab));
  display: flex; align-items: flex-end; justify-content: space-between;
}
.tabbar a, .tabbar button {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: .66rem; font-weight: 700; color: var(--muted-2); background: none; border: 0; cursor: pointer; font-family: inherit;
  min-height: 46px; border-radius: 14px;
}
.tabbar a svg, .tabbar button svg { width: 22px; height: 22px; }
.tabbar a.active { color: var(--acc-deep); }
.tabbar a.fab {
  flex: 0 0 auto;
  width: 58px; height: 58px; border-radius: 50%; margin-top: -30px;
  background: linear-gradient(135deg, var(--acc) 0%, var(--brand) 100%);
  color: #fff; display: grid; place-items: center;
  box-shadow: 0 18px 30px var(--acc-glow);
  flex-direction: column; gap: 0; font-size: .6rem; font-weight: 800; min-height: 58px;
}
.tabbar a.fab svg { width: 26px; height: 26px; }
.tabbar a.fab:active { transform: scale(.94); }
.tabbar a.fab span { font-size: .6rem; }

/* ---------- Bottom sheet ---------- */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 200; background: rgba(16, 24, 40, .45);
  opacity: 0; pointer-events: none; transition: opacity .2s ease;
}
.sheet-backdrop.open { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 201; background: var(--surface);
  border-radius: 28px 28px 20px 20px; padding: 14px 16px calc(14px + var(--sab));
  transform: translateY(100%); transition: transform .24s cubic-bezier(.32,.72,.3,1);
  max-height: 82vh; overflow-y: auto;
}
.sheet.open { transform: translateY(0); }
.sheet .grab, .sheet .handle { width: 48px; height: 5px; border-radius: 999px; background: #d5dae5; margin: 4px auto 14px; }
.sheet h3 { margin: 0 0 .4rem; font-size: 1.02rem; }
.sheet .sheet-item {
  display: flex; align-items: center; gap: .8rem; padding: .8rem .4rem; border-radius: 14px;
  color: var(--ink); font-weight: 600; font-size: .95rem; cursor: pointer; background: none; border: 0; width: 100%; font-family: inherit; text-align: left;
}
.sheet .sheet-item:active { background: var(--acc-soft); }
.sheet .sheet-item svg { width: 20px; height: 20px; color: var(--acc-deep); flex-shrink: 0; }
.sheet .sheet-item .desc { display: block; font-weight: 400; font-size: .76rem; color: var(--muted); }
.sheet .sep { height: 1px; background: var(--line); margin: .3rem 0; }

/* ---------- Install banner ---------- */
.install-banner {
  position: fixed; left: 1rem; right: 1rem; bottom: calc(var(--tabbar-h) + var(--sab) + .8rem); z-index: 150;
  background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-lg);
  padding: .85rem 1rem; display: flex; align-items: center; gap: .7rem;
  animation: slideUp .3s ease;
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.install-banner .logo { width: 42px; height: 42px; border-radius: 14px; background: linear-gradient(135deg, var(--acc) 0%, var(--brand) 100%); display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 1.1rem; flex-shrink: 0; }
.install-banner .txt { flex: 1; }
.install-banner .txt b { display: block; font-size: .9rem; }
.install-banner .txt span { font-size: .76rem; color: var(--muted); }
.install-banner .x { background: none; border: 0; color: var(--muted-2); font-size: 1.1rem; cursor: pointer; padding: .3rem; }

/* ---------- Login / standalone ---------- */
.standalone { padding: 0; }
.standalone .login-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1.5rem; gap: 1rem; }
.standalone .login-card { width: 100%; max-width: 420px; }
.standalone .login-card .logo { width: 58px; height: 58px; border-radius: 17px; margin: 0 auto; }
.standalone .login-title { text-align: center; font-weight: 800; font-size: 1.35rem; letter-spacing: -.03em; margin-bottom: 6px; }
.standalone .login-sub { text-align: center; color: var(--muted); font-size: .85rem; margin: 0 0 14px; }

/* ---------- Misc ---------- */
kbd { background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: .1rem .35rem; font-family: ui-monospace, Menlo, monospace; font-size: .78rem; }

/* ---------- Desktop ---------- */
@media (min-width: 768px) {
  body { padding-bottom: 2rem; }
  main { max-width: 1120px; }
  .card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
  .tabbar { display: none; }
  .appbar .desktop-nav { display: flex; gap: 8px; }
  .appbar .desktop-nav a { color: var(--muted); font-size: .84rem; font-weight: 700; padding: 8px 14px; border-radius: 999px; }
  .appbar .desktop-nav a:hover { background: var(--surface-2); color: var(--ink); }
  .appbar .desktop-nav a.active { background: var(--acc-soft); color: var(--acc-deep); border: 1px solid #e7e3ff; }
  .msg { max-width: 72%; }
  .desktop-body { display: grid; grid-template-columns: 300px 1fr; gap: 18px; align-items: start; }
  .sidebar { padding: 18px; border-radius: 22px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
}
@media (max-width: 767.98px) {
  .appbar .desktop-nav, .appbar .who .name, .appbar .who .role { display: none; }
  .grid2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .desktop-body { display: block; }
  .sidebar { margin-bottom: 1rem; }
}
