:root {
  --brand: #4f46e5; --brand-2: #6366f1; --brand-soft: #eef2ff; --accent: #f59e0b;
  --bg: #f6f7fb; --panel: #ffffff; --text: #1f2333; --muted: #6b7280; --line: #e5e7ef;
  --hover: #f1f3f9; --sel: #e8ecff; --danger: #dc2626; --ok: #16a34a; --warn: #d97706;
  --radius: 10px; --shadow: 0 8px 30px rgba(20, 24, 60, .12);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Devanagari", sans-serif;
  color-scheme: light;
}
:root[data-theme=dark] {
  --bg: #0f1220; --panel: #171a2b; --text: #e6e8f2; --muted: #9aa1b8; --line: #272b40;
  --hover: #1e2236; --sel: #252b4d; --brand-soft: #23264a; color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) {
    --bg: #0f1220; --panel: #171a2b; --text: #e6e8f2; --muted: #9aa1b8; --line: #272b40;
    --hover: #1e2236; --sel: #252b4d; --brand-soft: #23264a; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-size: 14px; }
a { color: var(--brand-2); }
button, input, select, textarea { font: inherit; color: inherit; }
.boot { display: grid; place-items: center; height: 100vh; color: var(--muted); }

/* buttons & forms */
.btn { border: 1px solid var(--line); background: var(--panel); padding: 7px 14px; border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn.primary:hover { background: var(--brand-2); }
.btn.danger { color: var(--danger); }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn.icon { padding: 6px 9px; }
.btn:disabled { opacity: .55; cursor: default; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], input[type=datetime-local], input[type=search], input[type=tel], input[type=date], input[type=time], input:not([type]), select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(99, 102, 241, .18); }
label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
.check { display: flex; gap: 8px; align-items: center; color: var(--text); font-size: 14px; }
.check input { width: auto; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.error { color: var(--danger); margin-top: 8px; min-height: 1em; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 12px; background: var(--hover); color: var(--muted); }
.pill.ok { background: #dcfce7; color: #166534; } .pill.bad { background: #fee2e2; color: #991b1b; } .pill.warn { background: #fef3c7; color: #92400e; }
@media (prefers-color-scheme: dark) { .pill.ok { background: #14361f; color: #86efac; } .pill.bad { background: #3b1414; color: #fca5a5; } .pill.warn { background: #3a2a0c; color: #fcd34d; } }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; word-break: break-all; }

/* auth */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(1200px 500px at 10% -10%, #c7d2fe55, transparent), radial-gradient(900px 400px at 110% 110%, #fde68a55, transparent); }
.auth-card { width: 100%; max-width: 400px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 28px; box-shadow: var(--shadow); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 20px; }
.brand img { width: 32px; height: 32px; }
.auth-card h1 { font-size: 18px; margin: 18px 0 4px; }
.auth-card .btn.primary { width: 100%; justify-content: center; margin-top: 16px; padding: 10px; }

/* app layout */
.app { display: grid; grid-template-columns: 240px 1fr; grid-template-rows: 56px 1fr; height: 100vh; }
.topbar { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; padding: 0 14px; background: var(--panel); border-bottom: 1px solid var(--line); }
.topbar .search { flex: 1; max-width: 680px; position: relative; }
.topbar .search input { padding-left: 34px; background: var(--bg); border-color: transparent; }
.topbar .search::before { content: "⌕"; position: absolute; left: 11px; top: 6px; font-size: 17px; color: var(--muted); }
.menu-btn { display: none; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 600; font-size: 13px; flex: none; }
.side { background: var(--panel); border-right: 1px solid var(--line); overflow-y: auto; padding: 12px 8px; }
.compose-btn { width: 100%; justify-content: center; padding: 11px; font-weight: 600; border-radius: 14px; margin-bottom: 12px; box-shadow: 0 2px 8px rgba(79, 70, 229, .3); }
.side select { margin-bottom: 10px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 12px; border-radius: 0 20px 20px 0; color: var(--text); text-decoration: none; margin-right: 6px; }
.nav a:hover { background: var(--hover); }
.nav a.active { background: var(--sel); color: var(--brand); font-weight: 600; }
.nav a .count { margin-left: auto; font-size: 12px; font-weight: 600; }
.nav .ico { width: 18px; text-align: center; opacity: .8; }
.nav-title { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 16px 12px 4px; display: flex; justify-content: space-between; align-items: center; }
.nav-title button { background: none; border: none; cursor: pointer; color: var(--muted); font-size: 16px; }
.main { display: grid; grid-template-columns: minmax(320px, 420px) 1fr; overflow: hidden; }
.main.single { grid-template-columns: 1fr; }

/* list */
.list { border-right: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; overflow: hidden; }
.list-tools { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--line); min-height: 46px; }
.list-tools .grow { font-size: 12px; color: var(--muted); text-align: right; }
.items { overflow-y: auto; flex: 1; }
.item { display: grid; grid-template-columns: 22px 1fr auto; gap: 4px 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); cursor: pointer; position: relative; }
.item:hover { background: var(--hover); }
.item.active { background: var(--sel); }
.item.unread .from, .item.unread .subj { font-weight: 700; }
.item.unread::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--brand); }
.item input[type=checkbox] { margin: 2px 0 0; }
.item .from { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .date { font-size: 12px; color: var(--muted); white-space: nowrap; }
.item .subj, .item .snip { grid-column: 2 / 4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .snip { color: var(--muted); font-size: 13px; }
.item .star { cursor: pointer; color: var(--muted); }
.item .star.on { color: var(--accent); }
.empty { padding: 50px 20px; text-align: center; color: var(--muted); }
.pager { display: flex; gap: 6px; align-items: center; }

/* reader */
.reader { overflow-y: auto; background: var(--bg); }
.reader-inner { max-width: 980px; margin: 0 auto; padding: 18px; }
.reader h2 { font-size: 21px; margin: 4px 0 14px; font-weight: 600; word-break: break-word; }
.reader-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; position: sticky; top: 0; background: var(--bg); padding: 6px 0; z-index: 2; }
.msg { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; overflow: hidden; }
.msg-head { display: flex; gap: 10px; padding: 12px 14px; align-items: flex-start; cursor: pointer; }
.msg-head .who { flex: 1; min-width: 0; }
.msg-head .who b { font-weight: 600; }
.msg-head .to { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.msg-body { padding: 0 14px 14px; }
.msg.collapsed .msg-body { display: none; }
.msg iframe { width: 100%; border: 0; min-height: 80px; background: #fff; border-radius: 6px; }
.msg pre.plain { white-space: pre-wrap; word-break: break-word; font: inherit; margin: 0; }
.banner { padding: 8px 12px; border-radius: 8px; margin: 0 0 10px; font-size: 13px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.banner.warn { background: #fef3c7; color: #78350f; } .banner.info { background: var(--brand-soft); }
@media (prefers-color-scheme: dark) { .banner.warn { background: #3a2a0c; color: #fde68a; } }
.atts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.att { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; display: flex; gap: 8px; align-items: center; max-width: 260px; cursor: pointer; background: var(--panel); text-decoration: none; color: var(--text); }
.att .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att.risky { border-color: var(--warn); }
.authline { font-size: 12px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }

/* compose */
.overlay { position: fixed; inset: 0; background: rgba(10, 12, 30, .35); display: flex; align-items: flex-end; justify-content: flex-end; padding: 16px; z-index: 50; }
.overlay.center { align-items: center; justify-content: center; }
.compose { width: min(720px, 100%); height: min(640px, calc(100vh - 32px)); background: var(--panel); border-radius: 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); }
.compose-head { display: flex; align-items: center; padding: 10px 14px; background: var(--brand); color: #fff; font-weight: 600; }
.compose-head button { background: none; border: none; color: #fff; cursor: pointer; font-size: 18px; margin-left: 6px; }
.compose .field { display: flex; align-items: center; border-bottom: 1px solid var(--line); padding: 0 12px; }
.compose .field span { color: var(--muted); width: 54px; font-size: 13px; flex: none; }
.compose .field input, .compose .field select { border: none; box-shadow: none; padding: 9px 4px; background: transparent; }
.compose .field .links { font-size: 12px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.toolbar { display: flex; gap: 2px; padding: 4px 8px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.toolbar button { border: none; background: none; padding: 4px 8px; border-radius: 6px; cursor: pointer; min-width: 30px; }
.toolbar button:hover { background: var(--hover); }
.editor { flex: 1; overflow-y: auto; padding: 12px 14px; outline: none; line-height: 1.5; }
.editor blockquote { border-left: 3px solid var(--line); margin: 6px 0; padding-left: 10px; color: var(--muted); }
.compose-foot { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; padding: 6px 12px; }
.chip { background: var(--hover); border-radius: 6px; padding: 3px 8px; font-size: 12px; display: flex; gap: 6px; align-items: center; }
.chip button { border: none; background: none; cursor: pointer; color: var(--muted); }

/* settings */
.page { overflow-y: auto; padding: 22px; }
.page-inner { max-width: 960px; margin: 0 auto; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; flex-wrap: wrap; }
.tabs a { padding: 9px 14px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs a.active { color: var(--brand); border-color: var(--brand); font-weight: 600; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px; margin-bottom: 16px; }
.card h3 { margin: 0 0 6px; font-size: 16px; }
.card h4 { margin: 14px 0 6px; font-size: 14px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 13px; }
th { color: var(--muted); font-weight: 500; font-size: 12px; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.stat b { display: block; font-size: 22px; margin-top: 4px; }
.modal { background: var(--panel); border-radius: 14px; padding: 20px; width: min(520px, 100%); box-shadow: var(--shadow); max-height: calc(100vh - 40px); overflow-y: auto; }
.modal h3 { margin-top: 0; }
.copy { cursor: pointer; }

/* toasts */
#toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast { background: #1f2333; color: #fff; padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow); font-size: 14px; display: flex; gap: 12px; align-items: center; }
.toast.err { background: var(--danger); }
.toast button { background: none; border: none; color: #a5b4fc; cursor: pointer; font-weight: 600; }

/* mobile */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .menu-btn { display: inline-flex; }
  .side { position: fixed; top: 56px; bottom: 0; left: 0; width: 260px; z-index: 40; transform: translateX(-100%); transition: transform .2s, box-shadow .2s; box-shadow: none; }
  .side.open { transform: none; box-shadow: var(--shadow); }
  .main { grid-template-columns: 1fr; }
  .main.reading .list { display: none; }
  .main:not(.reading) .reader { display: none; }
  .topbar .brand span { display: none; }
  .overlay { padding: 0; }
  .compose { height: 100vh; border-radius: 0; width: 100%; }
}

/* settings rows */
.setrow { display: grid; grid-template-columns: 260px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); align-items: start; }
.setrow:last-of-type { border-bottom: none; }
.radios { display: flex; gap: 16px; flex-wrap: wrap; }
.radios .check { margin: 0; }
.bar { height: 8px; background: var(--hover); border-radius: 99px; overflow: hidden; margin: 8px 0; }
.bar span { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.qr { display: flex; justify-content: center; margin: 8px 0 12px; }
.qr svg { border-radius: 8px; border: 1px solid var(--line); max-width: 100%; height: auto; }
pre.codes { background: var(--bg); padding: 12px; border-radius: 8px; font-size: 15px; line-height: 1.7; text-align: center; }
.editor.bordered { border: 1px solid var(--line); border-radius: 8px; min-height: 160px; }
.filter-form .check { margin: 4px 0; }

/* density */
body.compact .item { padding: 6px 12px; gap: 1px 8px; }
body.compact .item .snip { display: none; }
body.compact .nav a { padding: 5px 12px; }
body.compact .msg-head { padding: 9px 12px; }

/* reading pane off: list full width, message full width when open */
body.no-pane .main { grid-template-columns: 1fr; }
body.no-pane .main.reading .list { display: none; }
body.no-pane .main:not(.reading) .reader { display: none; }

/* swipe */
.item { transition: transform .15s ease; background: var(--panel); }
.item.swiping { transition: none; }
.item.swiping[data-dir=left] { box-shadow: inset -6px 0 0 var(--danger); }
.item.swiping[data-dir=right] { box-shadow: inset 6px 0 0 var(--ok); }
.empty div { margin-bottom: 8px; }
.install-btn[hidden] { display: none; }
@media (max-width: 900px) {
  .setrow { grid-template-columns: 1fr; gap: 6px; }
  .reader-actions { flex-wrap: nowrap; overflow-x: auto; }
  .install-btn, .topbar a.btn.icon { display: none; }
  .item { padding: 12px 14px; }
}
@media print { .topbar, .side, .list, .reader-actions { display: none !important; } }
.topbar a.btn { text-decoration: none; color: var(--text); font-size: 16px; }

/* app switcher */
.switcher { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-bottom: 12px; background: var(--bg); padding: 4px; border-radius: 12px; }
.switcher a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; border-radius: 9px; text-decoration: none; color: var(--muted); font-size: 12px; }
.switcher a span { font-size: 17px; }
.switcher a.active { background: var(--panel); color: var(--brand); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }

/* calendar */
.cal-page { padding: 14px 18px; }
.cal-wrap { display: flex; flex-direction: column; height: 100%; }
.cal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.cal-head h2 { margin: 0 8px; font-size: 20px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); grid-template-rows: auto repeat(6, minmax(92px, 1fr)); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--panel); flex: 1; }
.cal-dow { padding: 6px; font-size: 12px; color: var(--muted); text-align: center; border-bottom: 1px solid var(--line); }
.cal-cell { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 4px; min-width: 0; cursor: pointer; }
.cal-cell:nth-child(7n + 7) { border-right: none; }
.cal-cell.other { background: var(--bg); }
.cal-cell.other .cal-num { opacity: .5; }
.cal-num { font-size: 12px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; margin-bottom: 2px; }
.cal-cell.today .cal-num { background: var(--brand); color: #fff; font-weight: 700; }
.cal-ev { font-size: 12px; padding: 2px 6px; border-radius: 5px; margin-bottom: 2px; background: color-mix(in srgb, var(--c) 16%, transparent); border-left: 3px solid var(--c); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.cal-ev.pending { border-left-style: dashed; }
.cal-ev.cancelled, .agenda-item.cancelled { text-decoration: line-through; opacity: .6; }
.cal-more { font-size: 11px; color: var(--muted); padding: 0 6px; cursor: pointer; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.upcoming .up-item { display: flex; gap: 8px; padding: 6px 12px; cursor: pointer; border-radius: 8px; align-items: flex-start; }
.upcoming .up-item:hover { background: var(--hover); }
.upcoming .up-item .dot { margin-top: 4px; }
.agenda-day h3 { font-size: 14px; color: var(--muted); }
.agenda-item { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: 8px; cursor: pointer; flex-wrap: wrap; }
.agenda-item:hover { background: var(--hover); }
.swatch { width: 24px; height: 24px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; }
.swatch.on { border-color: var(--text); }
.rsvp { display: flex; gap: 6px; align-items: center; margin: 10px 0 4px; flex-wrap: wrap; }
.event-form input[type=text]:first-child { font-size: 18px; }
.invite-card { display: flex; gap: 14px; border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 12px; background: var(--brand-soft); }
.invite-date { width: 54px; flex: none; border-radius: 10px; overflow: hidden; background: var(--panel); text-align: center; border: 1px solid var(--line); align-self: flex-start; }
.invite-date b { display: block; background: var(--danger); color: #fff; font-size: 11px; padding: 2px 0; text-transform: uppercase; }
.invite-date span { display: block; font-size: 22px; font-weight: 700; padding: 4px 0; }

/* drive */
.page-inner.wide { max-width: 1200px; }
.drive-page.dropping { outline: 3px dashed var(--brand); outline-offset: -10px; }
.crumbs { font-size: 18px; font-weight: 600; }
.crumbs a { color: var(--text); text-decoration: none; }
.drive-list { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.drive-row { display: grid; grid-template-columns: 1fr 90px 110px auto; gap: 10px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.drive-row:last-child { border-bottom: none; }
.drive-row:hover { background: var(--hover); }
.drive-name { display: flex; align-items: center; gap: 10px; cursor: pointer; min-width: 0; }
.drive-name .fname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ficon { font-size: 22px; }
.dact { justify-content: flex-end; gap: 4px; flex-wrap: nowrap; }
.picker { max-height: 50vh; overflow-y: auto; }
.save-drive { margin-left: 4px; padding: 0 4px; border-radius: 4px; color: var(--muted); }
.save-drive:hover { background: var(--hover); color: var(--brand); }

/* AI */
.btn.ai, .toolbar .ai { color: #7c3aed; }
.ai-box { background: linear-gradient(135deg, #f5f3ff, #eef2ff); border: 1px solid #ddd6fe; border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; color: #1f2333; }
.chipbtn { border-radius: 99px; }

@media (max-width: 900px) {
  .cal-grid { grid-template-rows: auto repeat(6, minmax(64px, 1fr)); }
  .cal-ev { font-size: 10px; padding: 1px 3px; }
  .drive-row { grid-template-columns: 1fr auto; }
  .drive-row .dsize, .drive-row .ddate { display: none; }
}
.lchip { display: inline-block; font-size: 11px; padding: 0 7px; border-radius: 99px; margin-right: 5px; background: color-mix(in srgb, var(--c) 18%, transparent); color: var(--c); font-weight: 600; vertical-align: 1px; }
.lchip.big { font-size: 12px; padding: 2px 9px; }
.tg { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--bg); display: flex; flex-direction: column; min-height: 0; flex: 1; }
.tg-head, .tg-allday, .tg-body { display: grid; }
.tg-head { border-bottom: 1px solid var(--line); }
.tg-dh { text-align: center; padding: 6px 0; cursor: pointer; display: flex; flex-direction: column; }
.tg-dh b { font-size: 20px; font-weight: 500; }
.tg-dh.today b { color: var(--brand); }
.tg-allday { border-bottom: 1px solid var(--line); min-height: 26px; }
.tg-adcell { border-left: 1px solid var(--line); padding: 2px; }
.tg-gut { text-align: right; padding-right: 6px; }
.tg-hour { transform: translateY(-7px); box-sizing: border-box; }
.tg-scroll { overflow-y: auto; max-height: calc(100vh - 230px); }
.tg-col { position: relative; border-left: 1px solid var(--line); background-image: repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px 48px); }
.tg-col.today { background-color: color-mix(in srgb, var(--brand) 4%, transparent); }
.tg-ev { position: absolute; background: color-mix(in srgb, var(--c) 22%, var(--bg)); border-left: 3px solid var(--c); border-radius: 6px; padding: 2px 5px; font-size: 12px; overflow: hidden; cursor: pointer; box-sizing: border-box; }
.tg-ev.cancelled { opacity: .5; text-decoration: line-through; }
.tg-ev.pending { border-style: dashed; }
.tg-now { position: absolute; left: 0; right: 0; height: 2px; background: #ea4335; pointer-events: none; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; margin-bottom: 14px; }
.card.plan { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.card.plan h3 { margin: 0; }
.card.plan .price { font-size: 24px; font-weight: 700; }
.card.plan ul { padding-left: 18px; margin: 4px 0 10px; flex: 1; }
.card.plan.current { outline: 2px solid var(--brand); }
.note-box { background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px; padding: 10px 12px; margin: 6px 0 10px; }
.note-box.warn { background: #eff6ff; border-color: #bfdbfe; }
.note-box textarea { margin-top: 6px; }
[data-theme="dark"] .note-box { background: #2a2414; border-color: #5b4a17; }
[data-theme="dark"] .note-box.warn { background: #13233d; border-color: #1e3a8a; }
.assistant { position: fixed; right: 16px; bottom: 16px; width: min(420px, calc(100vw - 32px)); height: min(600px, calc(100vh - 90px)); background: var(--panel, #fff); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 12px 40px rgba(0,0,0,.18); display: flex; flex-direction: column; z-index: 60; overflow: hidden; }
.as-head { padding: 10px 12px; border-bottom: 1px solid var(--line); }
.as-log { flex: 1; min-height: 0; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.as-msg.me { align-self: flex-end; max-width: 85%; }
.as-msg.bot { align-self: flex-start; max-width: 92%; }
.as-bubble { white-space: pre-wrap; padding: 8px 11px; border-radius: 12px; background: var(--bg); }
.as-msg.me .as-bubble { background: var(--brand); color: #fff; }
.as-proposal { border: 1px solid var(--line); border-radius: 10px; padding: 8px; margin-top: 6px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.as-input { padding: 10px; border-top: 1px solid var(--line); align-items: flex-end; }
.as-input textarea { flex: 1; resize: none; }
.announce { display: flex; align-items: center; gap: 10px; padding: 8px 14px; font-size: 14px; background: #eff6ff; color: #1e3a8a; border-bottom: 1px solid #bfdbfe; }
.announce.warn { background: #fffbeb; color: #78350f; border-color: #fde68a; }
.app.has-announce { grid-template-rows: auto 56px 1fr; }
.app > .announce { grid-column: 1 / -1; }
.danger-zone { border-color: #fecaca; }
[data-theme="dark"] .announce { background: #13233d; color: #bfdbfe; border-color: #1e3a8a; }
[data-theme="dark"] .announce.warn { background: #2a2414; color: #fde68a; border-color: #5b4a17; }

/* ===== v2: launcher, account popover, tabs, search, compose extras ===== */
.switcher { grid-template-columns: repeat(auto-fit, minmax(52px, 1fr)); }
.switcher a { position: relative; }
.switcher .badge, .badge { position: absolute; top: 2px; right: 8px; background: var(--danger); color: #fff; font-style: normal; font-size: 10px; border-radius: 99px; padding: 0 5px; line-height: 15px; }
.launcher-btn { letter-spacing: -2px; font-weight: 700; }
.launcher { position: fixed; top: 58px; right: 56px; z-index: 60; background: var(--panel); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); padding: 14px; width: 330px; max-height: 75vh; overflow: auto; }
.launcher-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.launcher-grid a { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 4px; border-radius: 14px; text-decoration: none; color: var(--text); font-size: 12.5px; text-align: center; }
.launcher-grid a span { font-size: 28px; }
.launcher-grid a:hover, .launcher-grid a.active { background: var(--brand-soft); }
.account-pop { position: fixed; top: 58px; right: 12px; z-index: 60; width: 340px; background: var(--panel); border: 1px solid var(--line); border-radius: 26px; box-shadow: var(--shadow); padding: 18px 18px 14px; }
.ap-photo { position: relative; width: max-content; margin: 12px auto 4px; }
.ap-cam { position: absolute; right: -4px; bottom: -2px; border: 1px solid var(--line); background: var(--panel); border-radius: 50%; width: 28px; height: 28px; cursor: pointer; font-size: 13px; }
.ap-storage { background: var(--bg); border-radius: 14px; padding: 10px 14px; }
.ap-storage .bar, .bar { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; margin-top: 6px; }
.ap-storage .bar i { display: block; height: 100%; background: var(--brand); }
.avatar.photo { object-fit: cover; padding: 0; background: var(--line); border-radius: 50%; }
.search { position: relative; }
.search-opts { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; cursor: pointer; color: var(--muted); font-size: 15px; padding: 4px 6px; border-radius: 6px; }
.search-opts:hover { background: var(--hover); }
.adv-search { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 55; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 18px; min-width: 420px; }
.adv-row { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.adv-row > label { width: 118px; margin: 0; flex: none; color: var(--muted); }
.cat-tabs { display: flex; border-bottom: 1px solid var(--line); background: var(--panel); overflow-x: auto; }
.cat-tabs button { flex: 1; min-width: 110px; display: flex; align-items: center; gap: 8px; padding: 12px 14px; border: 0; border-bottom: 3px solid transparent; background: transparent; cursor: pointer; color: var(--muted); font-weight: 500; white-space: nowrap; }
.cat-tabs button:hover { background: var(--hover); }
.cat-tabs button.active { color: var(--brand); border-color: var(--brand); }
.cat-tabs button i { font-style: normal; font-size: 11px; background: var(--brand); color: #fff; border-radius: 99px; padding: 1px 7px; }
.cat-tabs.work button { flex: none; min-width: 0; padding: 9px 14px; }
.pick-list { display: flex; flex-direction: column; gap: 6px; }
.pick-list .btn { justify-content: flex-start; }
.conf-badge { display: flex; align-items: center; gap: 8px; padding: 6px 12px; background: #1f2937; color: #fff; font-size: 13px; }
.conf-badge .btn { color: var(--text); }
.editor .ghost { color: var(--muted); opacity: .7; pointer-events: none; }
.tb-select { width: auto !important; padding: 3px 6px !important; font-size: 12.5px; border-radius: 6px !important; }
.tb-color { position: relative; display: inline-flex !important; align-items: center; margin: 0 !important; padding: 2px 7px; cursor: pointer; color: var(--text) !important; font-weight: 700; border-radius: 6px; font-size: 14px !important; }
.tb-color input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.tb-color:hover { background: var(--hover); }
.auth-card.wide { max-width: 460px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; }
@media (max-width: 720px) { .grid2 { grid-template-columns: 1fr; } .adv-search { min-width: 0; } .adv-row > label { width: 90px; } .launcher, .account-pop { right: 8px; left: 8px; width: auto; } }
.switch { position: relative; display: inline-block; width: 38px; height: 22px; margin: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--line); border-radius: 99px; transition: .2s; cursor: pointer; }
.switch span:before { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span:before { transform: translateX(16px); }
.switch input:disabled + span { opacity: .5; cursor: default; }
.profile-card .ap-photo img, .profile-card .ap-photo .avatar { box-shadow: 0 0 0 4px var(--brand-soft); }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12.5px; padding: 8px; border-bottom: 1px solid var(--line); }
.table td { padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:hover td { background: var(--hover); }

/* ===== app modules: shared layout ===== */
.app-page { display: flex; flex-direction: column; height: 100%; min-height: 0; background: var(--panel); }
.app-head { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.app-head h2 { margin: 0; font-size: 19px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.app-body { flex: 1; min-height: 0; overflow: auto; padding: 18px; }
.app-side .nav-title { margin-top: 6px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; cursor: pointer; transition: .15s; text-decoration: none; color: inherit; display: block; }
.tile:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.tile .thumb { height: 120px; background: var(--bg); display: grid; place-items: center; font-size: 44px; border-bottom: 1px solid var(--line); overflow: hidden; }
.tile .meta { padding: 10px 12px; }
.tile .meta b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.tile .meta small { color: var(--muted); }
.new-row { display: flex; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.new-card { width: 150px; cursor: pointer; text-align: center; font-size: 13px; }
.new-card div { height: 110px; border: 1px solid var(--line); border-radius: 10px; display: grid; place-items: center; font-size: 46px; background: var(--panel); margin-bottom: 6px; transition: .15s; }
.new-card:hover div { border-color: var(--brand); }
.section-title { font-size: 13px; color: var(--muted); font-weight: 600; margin: 4px 0 10px; text-transform: uppercase; letter-spacing: .04em; }

/* chat */
.chat { display: grid; grid-template-columns: 300px 1fr; height: 100%; min-height: 0; }
.chat-list { border-right: 1px solid var(--line); overflow: auto; background: var(--panel); }
.chat-item { display: flex; gap: 10px; align-items: center; padding: 10px 14px; cursor: pointer; text-decoration: none; color: inherit; }
.chat-item:hover { background: var(--hover); } .chat-item.active { background: var(--sel); }
.chat-item .t { flex: 1; min-width: 0; } .chat-item .t b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.chat-item.unread .t b { font-weight: 700; }
.chat-item small { color: var(--muted); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-item i { font-style: normal; background: var(--brand); color: #fff; border-radius: 99px; font-size: 11px; padding: 1px 7px; }
.chat-room { display: flex; flex-direction: column; min-height: 0; background: var(--bg); }
.chat-msgs { flex: 1; overflow: auto; padding: 18px 22px; display: flex; flex-direction: column; gap: 2px; }
.cmsg { display: flex; gap: 10px; padding: 4px 6px; border-radius: 8px; }
.cmsg:hover { background: var(--hover); }
.cmsg .avatar { flex: none; margin-top: 2px; }
.cmsg .who { font-weight: 600; font-size: 13.5px; } .cmsg .who small { color: var(--muted); font-weight: 400; margin-left: 6px; }
.cmsg .body { white-space: pre-wrap; word-break: break-word; line-height: 1.45; }
.cmsg.cont { padding-left: 48px; } .cmsg.cont .avatar, .cmsg.cont .who { display: none; }
.cmsg.sys { justify-content: center; color: var(--muted); font-size: 12.5px; }
.cmsg .tools { visibility: hidden; margin-left: auto; } .cmsg:hover .tools { visibility: visible; }
.chat-input { display: flex; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); background: var(--panel); }
.chat-input textarea { flex: 1; resize: none; border-radius: 22px; padding: 10px 16px; max-height: 160px; }
.typing { font-size: 12px; color: var(--muted); padding: 0 22px 4px; min-height: 16px; }
.day-sep { text-align: center; color: var(--muted); font-size: 12px; margin: 12px 0 6px; }
@media (max-width: 800px) { .chat { grid-template-columns: 1fr; } .chat.in-room .chat-list { display: none; } .chat:not(.in-room) .chat-room { display: none; } }

/* meet */
.meet-lobby { max-width: 980px; margin: 0 auto; display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: center; padding: 40px 20px; }
.meet-lobby h1 { font-size: 34px; line-height: 1.15; margin: 0 0 14px; font-weight: 600; }
.meet-preview { position: relative; aspect-ratio: 16/10; background: #202124; border-radius: 14px; overflow: hidden; }
.meet-preview video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.meet-room { position: fixed; inset: 0; z-index: 80; background: #202124; color: #fff; display: flex; flex-direction: column; }
.meet-stage { flex: 1; min-height: 0; display: grid; gap: 10px; padding: 14px; grid-auto-rows: 1fr; }
.meet-tile { position: relative; background: #3c4043; border-radius: 12px; overflow: hidden; display: grid; place-items: center; min-height: 0; }
.meet-tile video { width: 100%; height: 100%; object-fit: cover; }
.meet-tile.me video { transform: scaleX(-1); }
.meet-tile.screen video { object-fit: contain; transform: none; }
.meet-tile .nm { position: absolute; left: 10px; bottom: 8px; font-size: 13px; background: rgba(0,0,0,.45); padding: 2px 8px; border-radius: 6px; }
.meet-tile .big { width: 84px; height: 84px; border-radius: 50%; background: var(--brand); display: grid; place-items: center; font-size: 34px; font-weight: 600; }
.meet-tile.speaking { box-shadow: 0 0 0 3px #8ab4f8 inset; }
.meet-bar { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 12px; position: relative; }
.meet-bar .info { position: absolute; left: 18px; font-size: 14px; opacity: .9; }
.meet-bar .right { position: absolute; right: 18px; display: flex; gap: 8px; }
.mbtn { width: 46px; height: 46px; border-radius: 50%; border: 0; background: #3c4043; color: #fff; font-size: 19px; cursor: pointer; display: grid; place-items: center; }
.mbtn:hover { background: #4a4e51; } .mbtn.off { background: #ea4335; } .mbtn.on { background: #8ab4f8; color: #202124; } .mbtn.end { background: #ea4335; width: 62px; border-radius: 24px; }
.meet-panel { position: absolute; right: 14px; top: 14px; bottom: 76px; width: 330px; background: #fff; color: #202124; border-radius: 12px; display: flex; flex-direction: column; overflow: hidden; }
.meet-panel .ph { padding: 14px 16px; font-weight: 600; display: flex; justify-content: space-between; }
.meet-panel .pb { flex: 1; overflow: auto; padding: 0 16px 10px; font-size: 14px; }
.meet-panel .pi { display: flex; gap: 8px; padding: 10px; border-top: 1px solid #eee; }
.meet-captions { position: absolute; left: 50%; transform: translateX(-50%); bottom: 82px; max-width: 70%; background: rgba(0,0,0,.7); padding: 8px 14px; border-radius: 8px; font-size: 16px; text-align: center; }
.meet-react { position: absolute; bottom: 90px; left: 50%; font-size: 40px; animation: floatup 2.4s ease-out forwards; pointer-events: none; }
@keyframes floatup { from { transform: translate(-50%, 0); opacity: 1; } to { transform: translate(-50%, -260px); opacity: 0; } }
@media (max-width: 800px) { .meet-lobby { grid-template-columns: 1fr; } .meet-panel { left: 10px; width: auto; } .meet-bar .info { display: none; } }

/* docs / sheets / slides */
.doc-shell { display: flex; flex-direction: column; height: 100%; min-height: 0; background: var(--bg); }
.doc-top { display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: var(--panel); border-bottom: 1px solid var(--line); }
.doc-top .title { font-size: 17px; border: 1px solid transparent; padding: 4px 8px; border-radius: 6px; background: transparent; width: auto; min-width: 140px; max-width: 420px; }
.doc-top .title:hover { border-color: var(--line); }
.doc-top .saved { color: var(--muted); font-size: 12.5px; }
.doc-toolbar { display: flex; gap: 2px; padding: 6px 12px; background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap; align-items: center; }
.doc-toolbar button { border: 0; background: transparent; padding: 5px 8px; border-radius: 6px; cursor: pointer; min-width: 30px; }
.doc-toolbar button:hover { background: var(--hover); }
.doc-toolbar .sep { width: 1px; height: 22px; background: var(--line); margin: 0 6px; }
.doc-scroll { flex: 1; overflow: auto; padding: 24px 12px 60px; }
.doc-page { max-width: 816px; min-height: 1056px; margin: 0 auto; background: #fff; color: #202124; box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 6px 24px rgba(0,0,0,.06); padding: 72px 84px; outline: none; font-size: 15px; line-height: 1.6; }
.doc-page h1 { font-size: 28px; } .doc-page h2 { font-size: 22px; } .doc-page table { border-collapse: collapse; } .doc-page td, .doc-page th { border: 1px solid #ccc; padding: 6px 8px; min-width: 40px; }
.doc-page img { max-width: 100%; }
@media (max-width: 860px) { .doc-page { padding: 28px 20px; min-height: 0; } }
.sheet-wrap { flex: 1; overflow: auto; background: var(--panel); position: relative; }
.sheet-bar { display: flex; gap: 8px; align-items: center; padding: 6px 12px; border-bottom: 1px solid var(--line); background: var(--panel); }
.sheet-bar .ref { width: 70px; font-weight: 600; text-align: center; border: 1px solid var(--line); border-radius: 6px; padding: 4px; }
.sheet-bar input.fx { flex: 1; font-family: ui-monospace, monospace; }
table.sheet { border-collapse: separate; border-spacing: 0; font-size: 13px; table-layout: fixed; }
table.sheet th { position: sticky; top: 0; background: var(--bg); color: var(--muted); font-weight: 500; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); height: 24px; z-index: 2; min-width: 100px; }
table.sheet th.rh { position: sticky; left: 0; z-index: 3; width: 46px; min-width: 46px; }
table.sheet td.rh { position: sticky; left: 0; background: var(--bg); color: var(--muted); text-align: center; z-index: 1; }
table.sheet td { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); height: 24px; padding: 0 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; cursor: cell; background: var(--panel); }
table.sheet td.sel { outline: 2px solid var(--brand); outline-offset: -2px; } table.sheet td.inrange { background: var(--brand-soft); }
table.sheet td.num { text-align: right; } table.sheet td.err { color: var(--danger); }
table.sheet td input { width: 100%; border: 0; outline: 0; padding: 0; height: 22px; font: inherit; background: transparent; }
.slides-shell { flex: 1; display: grid; grid-template-columns: 200px 1fr; min-height: 0; }
.slide-strip { overflow: auto; border-right: 1px solid var(--line); padding: 12px; background: var(--panel); }
.slide-thumb { aspect-ratio: 16/9; border: 2px solid var(--line); border-radius: 6px; margin-bottom: 10px; cursor: pointer; overflow: hidden; position: relative; font-size: 5px; }
.slide-thumb.active { border-color: var(--brand); } .slide-thumb .n { position: absolute; left: -2px; top: -2px; font-size: 10px; color: var(--muted); }
.slide-canvas-wrap { display: grid; place-items: center; overflow: auto; padding: 24px; }
.slide { aspect-ratio: 16/9; width: min(100%, 960px); background: #fff; color: #202124; border-radius: 4px; box-shadow: 0 2px 12px rgba(0,0,0,.15); position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: center; padding: 6% 8%; container-type: inline-size; }
.slide .s-title { font-size: 5.2cqw; font-weight: 700; outline: none; line-height: 1.15; }
.slide .s-body { font-size: 2.6cqw; margin-top: 3cqw; outline: none; white-space: pre-wrap; line-height: 1.4; }
.slide.layout-title { text-align: center; } .slide.layout-title .s-title { font-size: 6.4cqw; }
.slide.layout-content { justify-content: flex-start; } .slide.layout-section { background: var(--brand) !important; color: #fff !important; }
.slide img.s-img { max-height: 45cqw; max-width: 100%; margin: 2cqw auto 0; display: block; border-radius: 6px; }
.present { position: fixed; inset: 0; z-index: 90; background: #000; display: grid; place-items: center; }
.present .slide { width: min(100vw, 177.78vh); border-radius: 0; box-shadow: none; }
@media (max-width: 760px) { .slides-shell { grid-template-columns: 1fr; } .slide-strip { display: flex; gap: 8px; border-right: 0; border-bottom: 1px solid var(--line); } .slide-thumb { width: 120px; flex: none; } }

/* forms */
.form-edit { max-width: 760px; margin: 0 auto; }
.form-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 20px 22px; margin-bottom: 12px; position: relative; }
.form-card.head { border-top: 8px solid var(--brand); }
.form-card.active { border-left: 5px solid var(--brand); }
.form-card .ftools { display: flex; gap: 8px; justify-content: flex-end; align-items: center; margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.big-input { font-size: 26px !important; border: 0 !important; border-bottom: 1px solid var(--line) !important; border-radius: 0 !important; padding: 6px 0 !important; box-shadow: none !important; }
.resp-bar { display: flex; align-items: center; gap: 10px; margin: 4px 0; } .resp-bar .b { height: 18px; background: var(--brand); border-radius: 4px; min-width: 2px; }

/* keep */
.keep-new { max-width: 600px; margin: 0 auto 26px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 1px 4px rgba(0,0,0,.08); padding: 4px 14px; }
.keep-new input, .keep-new textarea { border: 0 !important; box-shadow: none !important; padding: 10px 0 !important; resize: none; background: transparent !important; }
.keep-grid { columns: 240px; column-gap: 14px; }
.knote { break-inside: avoid; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; cursor: pointer; position: relative; transition: box-shadow .15s; }
.knote:hover { box-shadow: 0 2px 10px rgba(0,0,0,.12); }
.knote b { display: block; margin-bottom: 6px; } .knote .kb { white-space: pre-wrap; word-break: break-word; font-size: 14px; max-height: 340px; overflow: hidden; }
.knote .kt { display: flex; gap: 2px; margin-top: 8px; opacity: 0; transition: .15s; } .knote:hover .kt { opacity: 1; }
.knote .kt button { border: 0; background: transparent; cursor: pointer; border-radius: 50%; width: 30px; height: 30px; }
.knote .kt button:hover { background: rgba(0,0,0,.07); }
.knote .pin { position: absolute; right: 8px; top: 8px; opacity: .5; }
.k-red { background: #faafa8 !important; } .k-orange { background: #f39f76 !important; } .k-yellow { background: #fff8b8 !important; } .k-green { background: #e2f6d3 !important; } .k-teal { background: #b4ddd3 !important; } .k-blue { background: #d4e4ed !important; } .k-purple { background: #d3bfdb !important; } .k-pink { background: #f6e2dd !important; } .k-brown { background: #e9e3d4 !important; } .k-gray { background: #efeff1 !important; }
[class*="k-"].knote, .knote[class*="k-"] { color: #202124; border-color: transparent; }
.kcolors { display: flex; gap: 4px; flex-wrap: wrap; } .kcolors button { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line); cursor: pointer; }

/* console */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.stat b { display: block; font-size: 24px; } .stat span { color: var(--muted); font-size: 12.5px; }
.console-nav { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.console-nav a { padding: 9px 14px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; }
.console-nav a.active { color: var(--brand); border-color: var(--brand); font-weight: 600; }

/* sign pad */
.sigpad { border: 1px dashed var(--muted); border-radius: 10px; background: #fff; touch-action: none; width: 100%; height: 160px; cursor: crosshair; }
.smart-replies{display:flex;flex-wrap:wrap;gap:8px;margin:6px 0 2px}
.chip-reply{border:1px solid color-mix(in srgb,var(--brand) 45%,var(--line,#ddd));color:var(--brand);background:transparent;border-radius:999px;padding:7px 16px;font:inherit;font-size:14px;cursor:pointer;transition:background .15s}
.chip-reply:hover{background:color-mix(in srgb,var(--brand) 10%,transparent)}
/* polish */
a.btn, a.btn:hover { text-decoration: none; color: inherit; }
a.btn.primary { color: #fff; }
* { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--muted, #888) 45%, transparent) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--muted, #888) 40%, transparent); border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background-color: color-mix(in srgb, var(--muted, #888) 65%, transparent); }
::-webkit-scrollbar-button { display: none; height: 0; width: 0; }
::-webkit-scrollbar-track { background: transparent; }

.cat-tabs { scrollbar-width: none; }
.cat-tabs::-webkit-scrollbar { display: none; }
.fab-compose { display: none; }
@media (max-width: 900px) {
  .fab-compose { display: inline-flex; position: fixed; right: 18px; bottom: 22px; z-index: 30; align-items: center; gap: 8px; padding: 14px 20px; border-radius: 18px; border: 0; background: var(--brand); color: #fff; font: inherit; font-weight: 650; box-shadow: 0 10px 24px rgba(16,24,40,.25); cursor: pointer; }
  body:has(.compose) .fab-compose { display: none; }
}
.meet-wait { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; background: rgba(32,33,36,.94); color: #e8eaed; text-align: center; padding: 24px; z-index: 5; }
.meet-wait h3 { margin: 10px 0 0; font-size: 22px; font-weight: 600; } .meet-wait p { margin: 0 0 14px; color: #bdc1c6; max-width: 380px; }
.meet-wait .spin { width: 38px; height: 38px; border-radius: 50%; border: 3px solid #5f6368; border-top-color: #8ab4f8; animation: zmspin 1s linear infinite; }
@keyframes zmspin { to { transform: rotate(360deg); } }
.meet-knocks { position: absolute; top: 16px; right: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 6; }
.knock { display: flex; align-items: center; gap: 10px; background: #fff; color: #202124; border-radius: 12px; padding: 10px 12px 10px 16px; box-shadow: 0 8px 24px rgba(0,0,0,.35); font-size: 14px; }
.knock span { flex: 1; font-weight: 500; }
.mbtn.small { width: auto; height: auto; border-radius: 18px; padding: 7px 14px; font-size: 14px; background: #1a73e8; }
.mbtn.small.ghost { background: transparent; color: #1a73e8; } .mbtn.small.ghost:hover { background: #e8f0fe; }
.mbtn.wide { width: auto; height: auto; border-radius: 20px; padding: 10px 22px; font-size: 15px; background: #8ab4f8; color: #202124; }

/* =====================================================================================
   Colourful theme: each app has its own accent (--app), the client's brand colour stays the main colour
   ===================================================================================== */
:root { --app: var(--brand); --grad: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 55%, #ec4899));
  --c1: #6366f1; --c2: #10b981; --c3: #f59e0b; --c4: #ec4899; --c5: #0ea5e9; --c6: #8b5cf6; --c7: #ef4444; --c8: #14b8a6;
  --shadow-sm: 0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.06); --shadow-md: 0 6px 18px -6px rgba(16,24,40,.14), 0 2px 6px rgba(16,24,40,.05); }
:root { --bg: color-mix(in srgb, var(--brand) 4%, #f7f8fc); }
:root[data-theme=dark] { --bg: #0d1020; }
@media (prefers-color-scheme: dark) { :root:not([data-theme=light]) { --bg: #0d1020; } }
[data-app=mail] { --app: var(--brand); }
[data-app=chat] { --app: #10b981; } [data-app=meet] { --app: #0d9488; } [data-app=calendar] { --app: #2563eb; }
[data-app=drive] { --app: #d97706; } [data-app=docs] { --app: #2563eb; } [data-app=sheets] { --app: #16a34a; }
[data-app=slides] { --app: #ea580c; } [data-app=forms] { --app: #7c3aed; } [data-app=keep] { --app: #ca8a04; }
[data-app=contacts] { --app: #0891b2; } [data-app=sign] { --app: #be185d; } [data-app=merge] { --app: #db2777; }
[data-app=console] { --app: #4338ca; } [data-app=admin] { --app: #e11d48; } [data-app=support] { --app: #f97316; } [data-app=settings] { --app: #6366f1; }

/* top bar: a thin brand gradient line under it */
.topbar { position: relative; box-shadow: var(--shadow-sm); }
.topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: linear-gradient(90deg, var(--brand), #ec4899 35%, #f59e0b 65%, #10b981); opacity: .85; }
.topbar .search input { background: color-mix(in srgb, var(--brand) 6%, var(--bg)); border-radius: 12px; transition: background .15s, box-shadow .15s; }
.topbar .search input:focus { background: var(--panel); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent), var(--shadow-md); border-color: transparent; }

/* sidebar */
.side { background: linear-gradient(180deg, color-mix(in srgb, var(--app) 6%, var(--panel)), var(--panel) 260px); }
.compose-btn { background: var(--grad) !important; border: 0 !important; border-radius: 16px; box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--brand) 70%, transparent); transition: transform .15s, box-shadow .15s; }
.compose-btn:hover { transform: translateY(-1px); box-shadow: 0 12px 26px -8px color-mix(in srgb, var(--brand) 75%, transparent); }
.nav a { transition: background .12s, color .12s; }
.nav a:hover { background: color-mix(in srgb, var(--app) 8%, transparent); }
.nav a.active { background: color-mix(in srgb, var(--app) 14%, transparent); color: var(--app); }
.nav a.active .ico { opacity: 1; }
.nav a .count { background: var(--app); color: #fff; border-radius: 999px; padding: 1px 8px; font-size: 11px; min-width: 22px; text-align: center; }
.nav-title { color: color-mix(in srgb, var(--app) 55%, var(--muted)); font-weight: 650; }

/* app switcher: every app has its own colour tile */
.switcher { background: color-mix(in srgb, var(--app) 7%, var(--bg)); }
.switcher a span { width: 34px; height: 30px; display: grid; place-items: center; border-radius: 10px; font-size: 16px; transition: transform .15s; }
.switcher a:hover span { transform: scale(1.08); }
.switcher a[href="#/mail"] span { background: #e0e7ff; } .switcher a[href="#/chat"] span { background: #d1fae5; }
.switcher a[href="#/meet"] span { background: #ccfbf1; } .switcher a[href="#/calendar"] span { background: #dbeafe; }
.switcher a[href="#/drive"] span { background: #fef3c7; }
.switcher a.active { color: var(--app); box-shadow: var(--shadow-sm); }
.launcher-grid a span { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 16px; background: var(--bg); transition: transform .15s; }
.launcher-grid a:hover span { transform: translateY(-2px) scale(1.05); }
.launcher-grid a:nth-child(8n+1) span { background: #e0e7ff; } .launcher-grid a:nth-child(8n+2) span { background: #d1fae5; }
.launcher-grid a:nth-child(8n+3) span { background: #ccfbf1; } .launcher-grid a:nth-child(8n+4) span { background: #dbeafe; }
.launcher-grid a:nth-child(8n+5) span { background: #fef3c7; } .launcher-grid a:nth-child(8n+6) span { background: #fce7f3; }
.launcher-grid a:nth-child(8n+7) span { background: #ede9fe; } .launcher-grid a:nth-child(8n+8) span { background: #ffedd5; }
:root[data-theme=dark] .switcher a span, :root[data-theme=dark] .launcher-grid a span { background: color-mix(in srgb, var(--app) 18%, transparent) !important; }
@media (prefers-color-scheme: dark) { :root:not([data-theme=light]) .switcher a span, :root:not([data-theme=light]) .launcher-grid a span { background: color-mix(in srgb, var(--app) 18%, transparent) !important; } }

/* buttons */
.btn { border-radius: 10px; transition: background .12s, border-color .12s, box-shadow .12s, transform .12s; }
.btn:hover { border-color: color-mix(in srgb, var(--app) 35%, var(--line)); }
.btn.primary { background: var(--grad); border-color: transparent; box-shadow: 0 4px 12px -4px color-mix(in srgb, var(--brand) 65%, transparent); }
.btn.primary:hover { background: var(--grad); filter: brightness(1.06); transform: translateY(-1px); }
.btn.danger:hover { background: color-mix(in srgb, var(--danger) 8%, transparent); border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }
.btn.ai { background: linear-gradient(135deg, #f5f3ff, #fdf2f8); border-color: #e9d5ff; color: #7c3aed; }
input:focus, select:focus, textarea:focus { outline: none; border-color: color-mix(in srgb, var(--app) 60%, var(--line)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--app) 16%, transparent); }

/* tabs become coloured pills */
.tabs { border-bottom: 0; gap: 6px; padding: 4px; background: color-mix(in srgb, var(--app) 6%, var(--panel)); border-radius: 14px; border: 1px solid color-mix(in srgb, var(--app) 12%, var(--line)); }
.tabs a { border: 0; border-radius: 10px; padding: 8px 14px; transition: background .12s, color .12s; }
.tabs a:hover { background: color-mix(in srgb, var(--app) 9%, transparent); color: var(--text); }
.tabs a.active { background: var(--panel); color: var(--app); box-shadow: var(--shadow-sm); border: 0; }

/* cards and stat tiles */
.card { border-radius: 16px; box-shadow: var(--shadow-sm); border-color: color-mix(in srgb, var(--app) 8%, var(--line)); }
.card h3 { display: flex; align-items: center; gap: 8px; }
.card h3::before { content: ""; width: 4px; height: 16px; border-radius: 4px; background: var(--app); }
.stat, .stats > *, .stat-grid > *, .stat-card { position: relative; overflow: hidden; border-radius: 16px; box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .15s; }
.stat:hover, .stats > *:hover , .stat-grid > *:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stats > *::before, .stat-grid > *::before, .stat::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--k, var(--c1)); }
.stats > *::after, .stat-grid > *::after, .stat::after { content: ""; position: absolute; right: -24px; top: -24px; width: 90px; height: 90px; border-radius: 50%; background: var(--k, var(--c1)); opacity: .08; }
.stats > :nth-child(8n+1), .stat-grid > :nth-child(8n+1) { --k: var(--c1); } .stats > :nth-child(8n+2), .stat-grid > :nth-child(8n+2) { --k: var(--c2); } .stats > :nth-child(8n+3), .stat-grid > :nth-child(8n+3) { --k: var(--c3); } .stats > :nth-child(8n+4), .stat-grid > :nth-child(8n+4) { --k: var(--c4); }
.stats > :nth-child(8n+5), .stat-grid > :nth-child(8n+5) { --k: var(--c5); } .stats > :nth-child(8n+6), .stat-grid > :nth-child(8n+6) { --k: var(--c6); } .stats > :nth-child(8n+7), .stat-grid > :nth-child(8n+7) { --k: var(--c7); } .stats > :nth-child(8n+8), .stat-grid > :nth-child(8n+8) { --k: var(--c8); }
.stats > * b, .stat-grid > * b, .stat b { color: color-mix(in srgb, var(--k, var(--c1)) 70%, var(--text)); }

/* mail list */
.list { background: var(--panel); }
.list-tools { background: color-mix(in srgb, var(--app) 3%, var(--panel)); }
.item { transition: background .1s; border-bottom-color: color-mix(in srgb, var(--line) 70%, transparent); }
.item:hover { background: color-mix(in srgb, var(--app) 5%, var(--panel)); box-shadow: inset 0 -1px 0 var(--line); }
.item.active { background: color-mix(in srgb, var(--app) 11%, var(--panel)); }
.item.unread::before { width: 4px; border-radius: 0 4px 4px 0; background: var(--grad); }
.item.unread .from { color: var(--text); }
.cat-tabs button.active { color: var(--app); box-shadow: inset 0 -3px 0 var(--app); }
.reader { background: var(--bg); }
.msg { border-radius: 16px; box-shadow: var(--shadow-sm); }
.lchip, .chip-reply { border-radius: 999px; }

/* app pages (Docs, Forms, Keep, Chat…) */
.app-head { background: linear-gradient(90deg, color-mix(in srgb, var(--app) 9%, var(--panel)), var(--panel) 60%); }
.app-head h2 { color: color-mix(in srgb, var(--app) 75%, var(--text)); }
.section-title { color: var(--app); font-weight: 700; letter-spacing: .06em; }
.new-card div { background: linear-gradient(160deg, color-mix(in srgb, var(--app) 10%, var(--panel)), var(--panel)); border-radius: 16px; transition: transform .15s, box-shadow .15s, border-color .15s; }
.new-card:hover div { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--app); }
h2 { letter-spacing: -.01em; }

/* toasts, badges, pills */
.toast { border-radius: 12px; box-shadow: var(--shadow-md); }
.pill.ok { background: #dcfce7; color: #15803d; } .pill.bad { background: #fee2e2; color: #b91c1c; } .pill.warn { background: #fef3c7; color: #b45309; }
.badge { background: #ef4444; }

/* admin and organisation console: rose / indigo accents, coloured health rows */
[data-app=admin] .card h3::before { background: linear-gradient(#e11d48, #f97316); }
[data-app=console] .card h3::before { background: linear-gradient(#4338ca, #06b6d4); }
.health-row, .check-row { border-radius: 10px; }

/* settings rows */
.setting-row:hover, .settings-row:hover { background: color-mix(in srgb, var(--app) 4%, transparent); }
table.health { width: 100%; border-collapse: separate; border-spacing: 0 6px; }
table.health tr td { padding: 10px 12px; background: color-mix(in srgb, var(--k) 7%, var(--panel)); }
table.health tr td:first-child { border-radius: 10px 0 0 10px; box-shadow: inset 4px 0 0 var(--k); text-align: center; }
table.health tr td:last-child { border-radius: 0 10px 10px 0; }
table.health tr.h-ok { --k: #16a34a; } table.health tr.h-warn { --k: #d97706; } table.health tr.h-fail { --k: #dc2626; } table.health tr.h-info { --k: #2563eb; }
