:root {
  --bg: #070b16; --bg2: #0d1424; --panel: #111a2e; --panel2: #16213a; --line: #24324f;
  --text: #e8eefb; --muted: #94a3c0; --accent: #2f7bff; --accent2: #22d3ee; --ok: #22c55e;
  --warn: #f59e0b; --bad: #ef4444; --radius: 12px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); }
a { color: var(--accent2); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea {
  width: 100%; padding: 9px 11px; background: var(--bg2); border: 1px solid var(--line);
  border-radius: 8px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
input[type=checkbox], input[type=radio] { width: auto; }
label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--panel2); cursor: pointer; text-decoration: none;
  color: var(--text); font-weight: 600; white-space: nowrap;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.1); }
.btn.danger { border-color: #5b2330; color: #fca5a5; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.badge {
  white-space: nowrap; flex: none; display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600;
  background: var(--panel2); border: 1px solid var(--line); color: var(--muted);
}
.badge.ok { color: #86efac; border-color: #1d5135; background: #0f2a1d; }
.badge.warn { color: #fcd34d; border-color: #5a4314; background: #2a210c; }
.badge.bad { color: #fca5a5; border-color: #5b2330; background: #2a1016; }
.badge.info { color: #93c5fd; border-color: #1e3a6e; background: #0f1d38; }
.error { color: #fca5a5; min-height: 1.2em; font-size: 14px; }
.notice { padding: 12px 14px; border-radius: 10px; border: 1px solid #5a4314; background: #2a210c; color: #fde68a; }
.notice.info { border-color: #1e3a6e; background: #0f1d38; color: #bfdbfe; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 13px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }
dialog {
  background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 16px;
  padding: 24px; width: min(440px, calc(100vw - 32px));
}
dialog::backdrop { background: rgba(0, 0, 0, .6); }

/* ---- public site ---- */
.site-nav {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 14px 24px; background: rgba(7, 11, 22, .9); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.logo { white-space: nowrap; font-weight: 800; font-size: 20px; letter-spacing: .5px; text-decoration: none; color: var(--text); }
.logo span { color: var(--accent2); }
.site-nav .links { display: flex; gap: 18px; align-items: center; }
.site-nav .links a.plain { color: var(--muted); text-decoration: none; }
.site-nav .links a.plain:hover { color: var(--text); }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.hero { padding: 80px 0 56px; }
.hero h1 { font-size: clamp(34px, 6vw, 58px); }
.hero h1 em { font-style: normal; background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { font-size: 19px; color: var(--muted); max-width: 640px; }
section.block { padding: 48px 0; border-top: 1px solid var(--line); }
.product h3 { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.price { font-size: 30px; font-weight: 800; }
.term-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.term-toggle button { border: 0; background: transparent; padding: 8px 14px; cursor: pointer; color: var(--muted); }
.term-toggle button.on { background: var(--accent); color: #fff; }
footer { padding: 32px 0 48px; color: var(--muted); border-top: 1px solid var(--line); font-size: 13px; }

/* ---- public site: services menu + detail pages ---- */
.site-layout { display: grid; grid-template-columns: 270px 1fr; align-items: start; }
.site-main { min-width: 0; }
.site-main .wrap { max-width: 1040px; }
.svc-side {
  position: sticky; top: 67px; max-height: calc(100vh - 67px); overflow-y: auto;
  background: var(--bg2); border-right: 1px solid var(--line); padding: 16px 10px 24px; min-height: calc(100vh - 67px);
}
.svc-toggle { display: none; }
.svc-title { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; padding: 4px 10px 10px; }
.svc-cat-btn {
  width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 8px;
  background: none; border: 0; padding: 10px 12px; border-radius: 8px; cursor: pointer; font-weight: 600; text-align: left;
}
.svc-cat-btn:hover { background: var(--panel); }
.svc-cat-btn.on { background: var(--panel2); box-shadow: inset 3px 0 0 var(--accent); }
.chev { display: inline-block; transition: transform .2s; color: var(--muted); }
.svc-cat:not(.open) .svc-cat-btn .chev { transform: rotate(-90deg); }
.svc-list { padding: 2px 0 8px 14px; border-left: 1px solid var(--line); margin-left: 18px; }
.svc-link {
  display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 6px;
  color: var(--muted); text-decoration: none; font-size: 14px;
}
.svc-link:hover { color: var(--text); background: var(--panel); }
.svc-link.on { color: var(--text); background: var(--panel2); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--warn); }
.dot.available { background: var(--ok); }
.dot.partial, .dot.setup { background: var(--accent); }
.card-link { display: block; text-decoration: none; color: inherit; transition: border-color .15s, transform .15s; }
.card-link:hover { border-color: var(--accent); transform: translateY(-2px); }
.detail { padding-top: 32px; padding-bottom: 48px; }
.detail h1 { font-size: clamp(28px, 4vw, 40px); margin: 0; }
.detail .lead { font-size: 18px; margin-top: 10px; }
.crumbs { color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.crumbs a { color: var(--muted); }
ul.ticks { list-style: none; padding: 0; margin: 0; }
ul.ticks li { padding: 6px 0 6px 26px; position: relative; }
ul.ticks li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-weight: 800; }
ol.steps { margin: 0; padding-left: 22px; }
ol.steps li { padding: 6px 0; }

/* ---- visible scroll bars (page + side menus) and a back-to-top button ---- */
html { scrollbar-color: #4b5d82 var(--bg2); scrollbar-width: auto; scroll-behavior: smooth; }
.svc-side, .side, .table-wrap { scrollbar-color: #4b5d82 transparent; scrollbar-width: thin; }
::-webkit-scrollbar { width: 14px; height: 12px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: #4b5d82; border-radius: 99px; border: 3px solid var(--bg2); }
::-webkit-scrollbar-thumb:hover { background: #6b7fa8; }
.svc-side::-webkit-scrollbar, .side::-webkit-scrollbar { width: 8px; }
.svc-side::-webkit-scrollbar-thumb, .side::-webkit-scrollbar-thumb { border-width: 2px; }
.to-top {
  position: fixed; right: 22px; bottom: 22px; z-index: 50; width: 46px; height: 46px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--accent); color: #fff; font-size: 20px; font-weight: 800;
  cursor: pointer; box-shadow: 0 6px 20px rgba(0, 0, 0, .4); opacity: 0; pointer-events: none; transition: opacity .2s;
}
.to-top.show { opacity: 1; pointer-events: auto; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ---- MAX assistant ---- */
.max-fab {
  position: fixed; right: 24px; bottom: 24px; z-index: 60; border: 0; border-radius: 99px; padding: 15px 24px; font-weight: 800; font-size: 17px;
  background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; cursor: pointer; box-shadow: 0 8px 26px rgba(0, 0, 0, .45);
  animation: max-glow 2.6s ease-in-out infinite;
}
.max-fab:hover { transform: translateY(-2px); }
@keyframes max-glow { 0%, 100% { box-shadow: 0 8px 26px rgba(0, 0, 0, .45), 0 0 0 0 rgba(56, 189, 248, .45); }
  50% { box-shadow: 0 8px 26px rgba(0, 0, 0, .45), 0 0 0 10px rgba(56, 189, 248, 0); } }
@media (prefers-reduced-motion: reduce) { .max-fab { animation: none; } }
.max-hero { background: linear-gradient(135deg, rgba(37, 99, 235, .25), rgba(56, 189, 248, .12)); border: 1px solid var(--line); border-radius: 18px; padding: 24px; }
.max-hero h1 { margin: 0 0 6px; }
.max-cap h3 { margin: 0 0 6px; }
.max-cap .ex { display: block; width: 100%; text-align: left; margin-top: 6px; white-space: normal; }
.nav.nav-max { font-weight: 800; color: var(--accent2); }
.max-fab.live { outline: 3px solid var(--accent2); }
.max-level { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.max-level span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #22c55e, #38bdf8); transition: width .08s linear; }
.max-orb.s-listening .core { transform: scale(calc(.94 + var(--lvl, 0) * .3)); transition: transform .08s linear; }
/* ---- MAX voice mode (full-screen orb) ---- */
.max-orb-wrap { position: fixed; inset: 0; z-index: 80; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  padding: 24px 16px; background: radial-gradient(circle at 50% 40%, rgba(30, 58, 138, .9), rgba(2, 6, 23, .98) 65%); color: #e2e8f0; overflow-y: auto;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.max-orb-wrap[hidden] { display: none; }
.max-orb-top { position: absolute; top: 14px; left: 16px; right: 16px; display: flex; justify-content: space-between; align-items: center; }
.max-orb { position: relative; width: 190px; height: 190px; border: 0; border-radius: 50%; background: transparent; cursor: pointer; flex: none; }
.max-orb .core { position: absolute; inset: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 26px;
  letter-spacing: 2px; color: #fff; background: radial-gradient(circle at 35% 30%, #7dd3fc, #2563eb 55%, #1e3a8a); box-shadow: 0 0 40px rgba(56, 189, 248, .55);
  transition: transform .3s ease; }
.max-orb .ring { position: absolute; inset: 10px; border-radius: 50%; border: 2px solid rgba(125, 211, 252, .45); }
.max-orb .r2 { inset: 0; border-color: rgba(125, 211, 252, .2); }
.max-orb.s-idle .core { animation: orb-breathe 3.2s ease-in-out infinite; }
.max-orb.s-listening .ring { animation: orb-pulse 1.1s ease-out infinite; } .max-orb.s-listening .r2 { animation-delay: .4s; }
.max-orb.s-listening .core { box-shadow: 0 0 60px rgba(56, 189, 248, .9); }
.max-orb.s-thinking .r1 { border-style: dashed; animation: orb-spin 1.2s linear infinite; }
.max-orb.s-speaking .core { animation: orb-talk .45s ease-in-out infinite alternate; }
.max-orb.s-speaking .ring { animation: orb-pulse 1.6s ease-out infinite; }
.max-orb.s-confirm .core { background: radial-gradient(circle at 35% 30%, #fde68a, #f59e0b 55%, #b45309); box-shadow: 0 0 50px rgba(245, 158, 11, .7); }
@keyframes orb-breathe { 0%, 100% { transform: scale(.94); } 50% { transform: scale(1); } }
@keyframes orb-pulse { 0% { transform: scale(.9); opacity: 1; } 100% { transform: scale(1.35); opacity: 0; } }
@keyframes orb-spin { to { transform: rotate(360deg); } }
@keyframes orb-talk { from { transform: scale(.95); } to { transform: scale(1.06); } }
@media (prefers-reduced-motion: reduce) { .max-orb *, .max-orb.s-idle .core { animation: none !important; } }
.max-orb-state { font-size: 18px; font-weight: 700; color: #7dd3fc; text-align: center; }
.max-orb-heard { font-size: 16px; color: #cbd5e1; min-height: 1.4em; text-align: center; max-width: 720px; }
.max-orb-reply { font-size: 20px; line-height: 1.5; text-align: center; max-width: 760px; min-height: 1.5em; }
.max-orb-actions, .max-orb-tools { justify-content: center; flex-wrap: wrap; gap: 8px; }
.max-orb-settings { width: min(420px, 100%); text-align: left; color: var(--text); }
.max-orb-settings select, .max-orb-settings input[type=range] { width: 100%; }
.max-orb-settings .chk { display: flex; gap: 8px; align-items: center; font-weight: 400; margin-top: 8px; }
.max-panel {
  position: fixed; right: 22px; bottom: 22px; z-index: 61; width: min(400px, calc(100vw - 32px)); max-height: min(620px, calc(100vh - 44px));
  display: flex; flex-direction: column; gap: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  padding: 14px; box-shadow: 0 16px 50px rgba(0, 0, 0, .55);
}
.max-panel[hidden] { display: none; }
.max-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.max-lang { width: auto; padding: 5px 8px; }
/* ---- minimized MAX: a small bar in the corner while the page MAX opened is in front ---- */
.max-mini { position: fixed; right: 20px; bottom: 20px; z-index: 70; display: flex; align-items: center; gap: 8px; max-width: min(460px, calc(100vw - 24px));
  padding: 8px 10px; border-radius: 16px; background: rgba(15, 23, 42, .95); border: 1px solid rgba(125, 211, 252, .35);
  box-shadow: 0 10px 34px rgba(0, 0, 0, .5); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.max-mini[hidden] { display: none; }
.max-mini .mini-main { display: flex; align-items: center; gap: 10px; background: none; border: 0; color: inherit; text-align: left; cursor: pointer; min-width: 0; flex: 1; padding: 0; }
.mini-orb { flex: none; width: 34px; height: 34px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #7dd3fc, #2563eb 55%, #1e3a8a);
  box-shadow: 0 0 14px rgba(56, 189, 248, .6); }
.mini-orb.s-listening { animation: mini-pulse 1.1s ease-in-out infinite; }
.mini-orb.s-thinking { animation: orb-spin 1.2s linear infinite; border: 2px dashed #7dd3fc; }
.mini-orb.s-speaking { animation: orb-talk .45s ease-in-out infinite alternate; }
.mini-orb.s-confirm { background: radial-gradient(circle at 35% 30%, #fde68a, #f59e0b 55%, #b45309); box-shadow: 0 0 14px rgba(245, 158, 11, .7); }
@keyframes mini-pulse { 0%, 100% { box-shadow: 0 0 8px rgba(56, 189, 248, .5); } 50% { box-shadow: 0 0 22px rgba(56, 189, 248, 1); } }
@media (prefers-reduced-motion: reduce) { .mini-orb { animation: none !important; } }
.mini-text { display: flex; flex-direction: column; min-width: 0; font-size: 13px; line-height: 1.35; }
.mini-text b { color: #7dd3fc; font-size: 12px; }
.mini-text span { color: #e2e8f0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.mini-actions { gap: 6px; flex: none; }
.mini-actions:empty { display: none; }
@media (max-width: 820px) { .max-mini { right: 8px; left: 8px; bottom: 8px; max-width: none; } }
.max-panel { overflow-y: auto; }
.max-msg.wait { align-self: flex-start; color: var(--muted); font-style: italic; }
.max-brain { margin-top: 4px; font-size: 11px; color: var(--muted); }
.max-panel > * { flex-shrink: 0; }  /* only the chat log shrinks, so long hints never overlap the checkbox */
.max-panel > .max-log { flex-shrink: 1; }
.max-hint { line-height: 1.4; max-height: 9em; overflow-y: auto; }
.max-log { flex: 1; overflow-y: auto; min-height: 140px; display: flex; flex-direction: column; gap: 8px; padding: 4px 2px; }
.max-msg { padding: 9px 12px; border-radius: 12px; max-width: 88%; line-height: 1.45; white-space: pre-wrap; }
.max-msg.max { background: var(--panel2); align-self: flex-start; }
.max-msg.me { background: var(--accent); color: #fff; align-self: flex-end; }
.max-msg.err { border: 1px solid var(--bad); }
.max-tips { display: flex; gap: 6px; flex-wrap: wrap; }
.max-tips .btn { font-weight: 500; }
.max-actions { display: flex; gap: 8px; }
.max-actions:empty { display: none; }
.max-bar { display: flex; gap: 6px; }
.max-mic { padding: 9px 14px; }
.max-mic.on { background: var(--bad); border-color: var(--bad); animation: pulse 1.2s infinite; }
@media (max-width: 820px) { .max-fab { right: 12px; bottom: 12px; padding: 13px 18px; font-size: 15px; } .max-panel { left: 8px; right: 8px; bottom: 8px; width: auto; } }

/* ---- pricing cards ---- */
.plan-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); align-items: stretch; margin-top: 26px; }
#pricing .wrap { max-width: 1240px; }
.plan-card {
  position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 26px 20px 20px;
  display: flex; flex-direction: column; text-align: center;
}
.plan-card.popular { border: 2px solid var(--accent); box-shadow: 0 10px 40px rgba(47, 123, 255, .25); transform: translateY(-6px); }
.plan-card .ribbon {
  position: absolute; top: -13px; left: 50%; transform: translateX(-50%); background: var(--accent); color: #fff;
  font-size: 12px; font-weight: 700; padding: 4px 14px; border-radius: 99px; white-space: nowrap;
}
.plan-card h3 { font-size: 20px; margin-bottom: 2px; }
.plan-card .plan-tag { min-height: 2.6em; margin: 0; }
.plan-card .price { font-size: 30px; font-weight: 800; margin-top: 6px; white-space: nowrap; }
.plan-card .price .per { font-size: 14px; font-weight: 500; color: var(--muted); }
.plan-card .plan-note { min-height: 2.6em; }
.plan-card .plan-btn { justify-content: center; width: 100%; margin: 6px 0 16px; }
.plan-features { list-style: none; padding: 0; margin: 0; text-align: left; font-size: 14px; }
.plan-features li { padding: 7px 0 7px 26px; position: relative; border-top: 1px solid var(--line); }
.plan-features li::before { content: "✓"; position: absolute; left: 4px; color: var(--ok); font-weight: 800; }
.plan-features li.soon { color: var(--muted); }
.plan-features li.soon::before { content: "○"; color: var(--muted); font-weight: 400; }
.tag { margin-left: 6px; font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--warn);
  border: 1px solid #5a4314; border-radius: 99px; padding: 1px 6px; white-space: nowrap; }
td.yes { color: var(--ok); font-weight: 800; }
.pbar { height: 5px; background: var(--panel2); border-radius: 99px; margin-top: 4px; min-width: 80px; overflow: hidden; }
.pbar span { display: block; height: 100%; border-radius: 99px; }

/* ---- e-sign: signing page + field placement ---- */
.sign-page { position: relative; background: #fff; border-radius: 6px; overflow: hidden; }
.sign-page img { display: block; width: 100%; height: auto; }
.sign-box {
  position: absolute; display: flex; align-items: center; justify-content: center; padding: 0 4px;
  border-radius: 4px; font-size: 13px; color: #0b2a6b; background: rgba(255, 221, 87, .55);
  border: 2px dashed #d4a106; overflow: hidden; cursor: pointer; width: auto;
}
input.sign-box { cursor: text; color: #111; }
.sign-box.need:not(.filled) { animation: pulse 1.6s ease-in-out infinite; }
.sign-box.filled { background: rgba(255, 255, 255, .2); border: 1px solid rgba(11, 42, 107, .25); }
.sign-box.auto { background: rgba(220, 234, 255, .7); border: 1px solid #93c5fd; cursor: default; }
@keyframes pulse { 50% { background: rgba(255, 221, 87, .85); } }
@media (prefers-reduced-motion: reduce) { .sign-box.need:not(.filled) { animation: none; } }
.sign-bar { position: fixed; left: 0; right: 0; bottom: 0; background: rgba(13, 20, 36, .97); border-top: 1px solid var(--line); padding: 12px 0; z-index: 20; }
.place-box { position: absolute; border: 2px solid; border-radius: 4px; font-size: 11px; display: flex; align-items: center;
  justify-content: space-between; padding: 0 4px; color: #111; font-weight: 600; overflow: hidden; }
.place-box button { background: rgba(0,0,0,.6); color: #fff; border: 0; border-radius: 3px; cursor: pointer; padding: 0 5px; font-size: 11px; }

/* ---- app shell ---- */
.shell { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.side { background: var(--bg2); border-right: 1px solid var(--line); padding: 18px 12px; display: flex; flex-direction: column; gap: 4px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .logo { padding: 4px 10px 16px; }
.side a.nav {
  display: block; padding: 9px 12px; border-radius: 8px; color: var(--muted); text-decoration: none; font-weight: 500;
}
.side a.nav:hover { background: var(--panel); color: var(--text); }
.side a.nav.on { background: var(--panel2); color: var(--text); box-shadow: inset 3px 0 0 var(--accent); }
.side .count { float: right; background: var(--accent); color: #fff; border-radius: 99px; padding: 0 7px; font-size: 12px; }
.main { min-width: 0; }
.topbar {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 24px; border-bottom: 1px solid var(--line); background: var(--bg);
}
.topbar select { width: auto; min-width: 200px; }
.content { padding: 24px; max-width: 1200px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.stat .label { color: var(--muted); font-size: 13px; }
.stat .value { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button { white-space: nowrap; background: none; border: 0; padding: 10px 14px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); }
.form-grid { display: grid; gap: 0 14px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.template-pick { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.template-pick button { text-align: left; padding: 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; }
.template-pick button.on { border-color: var(--accent); background: #0f1d38; }
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--panel2);
  border: 1px solid var(--line); padding: 10px 18px; border-radius: 10px; z-index: 100;
}
.toast.bad { border-color: var(--bad); }
pre.json { background: var(--bg2); padding: 10px; border-radius: 8px; overflow-x: auto; font-size: 12px; margin: 6px 0 0; }

@media (max-width: 820px) {
  .site-layout { grid-template-columns: 1fr; }
  .svc-side { position: static; max-height: none; min-height: 0; border-right: 0; border-bottom: 1px solid var(--line); padding: 10px 16px; }
  .svc-toggle {
    display: flex; width: 100%; justify-content: space-between; align-items: center; padding: 11px 14px;
    background: var(--panel); border: 1px solid var(--line); border-radius: 10px; font-weight: 600; cursor: pointer;
  }
  .svc-menu { display: none; padding-top: 10px; }
  .svc-side.open .svc-menu { display: block; }
  .svc-side:not(.open) .svc-toggle .chev { transform: rotate(-90deg); }
  .shell { grid-template-columns: 1fr; }
  .side { flex-direction: row; overflow-x: auto; padding: 8px; border-right: 0; border-bottom: 1px solid var(--line); position: static; height: auto; }
  .side .logo { display: none; }
  .side a.nav { white-space: nowrap; }
  .content, .topbar { padding: 16px; }
  .site-nav { padding: 12px 16px; }
  .site-nav .links a.plain { display: none; }
  .wrap { padding: 0 16px; }
}

/* ---- 🔔 alerts bell ---- */
.bell-box { position: relative; }
.bell { position: relative; }
.bell-count { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: #ef4444; color: #fff;
  font-size: 11px; font-weight: 800; line-height: 18px; text-align: center; }
.bell-count[hidden] { display: none; }
.bell-list { position: absolute; right: 0; top: calc(100% + 8px); width: min(360px, calc(100vw - 24px)); max-height: 70vh; overflow-y: auto; z-index: 75; text-align: left; }
.bell-list[hidden] { display: none; }
.bell-item { display: block; padding: 8px; border-radius: 8px; color: inherit; text-decoration: none; border-top: 1px solid var(--line); }
.bell-item:hover { background: rgba(56, 189, 248, .08); }
.bell-item.unread { border-left: 3px solid var(--accent2); }

/* ---- CRM ---- */
.deal-card { background: var(--bg, rgba(255,255,255,.03)); border: 1px solid var(--line); border-radius: 10px; padding: 8px; margin-top: 8px; }
.card.internal { border-color: rgba(245, 158, 11, .5); }
.logo-grid img { display: block; margin: 0 auto; }

/* ---- Office (Docs / Sheets / Slides) ---- */
.office-toolbar { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; padding: 6px; margin-bottom: 8px; background: var(--panel, #111827); border: 1px solid var(--line, #263042); border-radius: 10px; position: sticky; top: 0; z-index: 5; }
.office-toolbar .tb { min-width: 34px; padding: 4px 8px; }
.office-toolbar .tb.on { outline: 2px solid var(--accent, #2f7bff); }
.office-toolbar select, .office-toolbar input[type=number] { padding: 4px 6px; height: 32px; }
.tb-color { width: 34px; height: 32px; padding: 2px; border-radius: 6px; cursor: pointer; }
.tb-sep { width: 1px; height: 24px; background: var(--line, #263042); margin: 0 4px; }
.doc-desk { background: #e5e7eb; padding: 24px 12px; border-radius: 10px; overflow-x: auto; }
.doc-page { background: #fff; color: #111; max-width: 816px; min-height: 1056px; margin: 0 auto; padding: 72px 80px; box-shadow: 0 2px 12px rgba(0,0,0,.25); outline: none; font: 15px/1.6 Calibri, Arial, sans-serif; overflow-wrap: anywhere; }
.doc-page h1 { font-size: 30px; margin: .4em 0; color: #111; } .doc-page h2 { font-size: 23px; margin: .5em 0; color: #111; } .doc-page h3 { font-size: 18px; color: #111; }
.doc-page p { margin: 0 0 .6em; } .doc-page img { max-width: 100%; height: auto; }
.doc-page table { border-collapse: collapse; width: 100%; margin: 8px 0; } .doc-page td, .doc-page th { border: 1px solid #9ca3af; padding: 6px 8px; vertical-align: top; min-width: 40px; color: #111; }
.doc-page th { background: #f3f4f6; } .doc-page blockquote { border-left: 4px solid #d1d5db; margin: 0 0 .6em; padding-left: 12px; color: #4b5563; }
.doc-page pre { background: #f3f4f6; padding: 8px; border-radius: 4px; white-space: pre-wrap; } .doc-page a { color: #1155cc; }
.doc-page hr.page-break { border: 0; border-top: 2px dashed #9ca3af; margin: 24px -80px; position: relative; } .doc-page hr.page-break::after { content: "Page break"; position: absolute; right: 90px; top: -10px; font-size: 11px; color: #6b7280; background: #fff; padding: 0 4px; }
@media (max-width: 700px) { .doc-page { padding: 28px 18px; min-height: 600px; } .doc-page hr.page-break { margin: 24px -18px; } }
.fx-bar { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; } .fx-addr { min-width: 70px; font-weight: 700; font-family: Consolas, monospace; }
.fx-input { flex: 1; font-family: Consolas, monospace; }
.sheet-grid { position: relative; overflow: auto; height: min(68vh, 760px); background: #fff; color: #111; border: 1px solid var(--line, #263042); border-radius: 8px; outline: none; user-select: none; }
.sheet-grid .sh-c, .sheet-grid .sh-h, .sheet-grid .sh-r { position: absolute; height: 26px; line-height: 25px; padding: 0 5px; border-right: 1px solid #e5e7eb; border-bottom: 1px solid #e5e7eb; font: 13px/25px Calibri, Arial, sans-serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-sizing: border-box; }
.sheet-grid .sh-h { background: #f3f4f6; text-align: center; color: #374151; z-index: 2; font-weight: 600; } .sheet-grid .sh-h.on, .sheet-grid .sh-r.on { background: #dbeafe; color: #1e3a8a; }
.sheet-grid .sh-r { width: 46px; background: #f3f4f6; text-align: center; color: #374151; z-index: 2; } .sheet-grid .sh-corner { position: absolute; width: 46px; height: 26px; background: #e5e7eb; z-index: 3; }
.sheet-grid .sh-c.in { background-color: rgba(47, 123, 255, .10); } .sheet-grid .sh-c.cur { outline: 2px solid #2f7bff; outline-offset: -2px; z-index: 1; }
.sheet-grid .sh-rz { position: absolute; right: -3px; top: 0; width: 6px; height: 100%; cursor: col-resize; }
.cell-edit { position: absolute; z-index: 4; border: 2px solid #2f7bff; padding: 0 4px; font: 13px Calibri, Arial, sans-serif; background: #fff; color: #111; box-sizing: border-box; border-radius: 0; }
.sheet-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; } .sheet-tab { padding: 4px 12px; border-radius: 0 0 8px 8px; border: 1px solid var(--line, #263042); background: var(--panel, #111827); color: inherit; cursor: pointer; }
.sheet-tab.on { background: var(--accent, #2f7bff); color: #fff; }
.slides-layout { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 12px; }
@media (max-width: 760px) { .slides-layout { grid-template-columns: 1fr; } .slide-thumbs { flex-direction: row; overflow-x: auto; max-height: none; } }
.slide-thumbs { display: flex; flex-direction: column; gap: 8px; max-height: 70vh; overflow-y: auto; }
.slide-thumb { display: flex; gap: 6px; align-items: flex-start; cursor: pointer; padding: 4px; border-radius: 8px; border: 2px solid transparent; flex: none; }
.slide-thumb.on { border-color: var(--accent, #2f7bff); }
.slide-thumb-box { width: 153.6px; height: 86.4px; overflow: hidden; position: relative; border-radius: 4px; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.slide-canvas { position: absolute; left: 0; top: 0; transform-origin: 0 0; overflow: hidden; font-family: Arial, sans-serif; }
.slide-frame { position: relative; overflow: hidden; box-shadow: 0 4px 20px rgba(0,0,0,.35); border-radius: 4px; margin: 0 auto; }
.slide-el { position: absolute; box-sizing: border-box; }
.slide-text { white-space: pre-wrap; line-height: 1.2; padding: 4px 6px; overflow: hidden; overflow-wrap: anywhere; }
.slide-stage .slide-el { cursor: move; } .slide-stage .slide-el:hover { outline: 1px dashed rgba(47, 123, 255, .7); }
.slide-stage .slide-el.sel { outline: 2px solid #2f7bff; } .slide-stage .slide-el.sel::after { content: ""; position: absolute; right: -6px; bottom: -6px; width: 12px; height: 12px; background: #2f7bff; border-radius: 2px; cursor: nwse-resize; }
.slide-stage .slide-text[contenteditable] { cursor: text; outline: 2px solid #f59e0b; overflow: visible; }
.present { position: fixed; inset: 0; background: #000; z-index: 1000; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.present .slide-frame { box-shadow: none; border-radius: 0; } .present-count { position: absolute; right: 16px; bottom: 10px; color: #9ca3af; font-size: 13px; }
/* ---- Accounting: daily sales form ---- */
.dsr-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 14px; align-items: start; }
@media (max-width: 860px) { .dsr-layout { grid-template-columns: 1fr; } }
@media print { #side, .tabs, .office-toolbar, .btn, header, .topbar, #banner { display: none !important; } .content { padding: 0 !important; } }
