:root {
  /* KiQHub palette — shared with KiQHub Office (office/server/static/css/office.css) */
  --indigo: #4C5BD4; --blue: #3563E9; --navy: #0f1629; --ink: #1f2328; --muted: #6b7280; --line: #e0e3e8; --bg: #f3f4f6; --panel: #fff; --tint: #eef1ff;
  --ok: #0f7b3f; --err: #c42b1c; --warn: #b35c00; --radius: 10px; --side: 250px; --list: 380px;
  --font-ui: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Inter", Roboto, "Helvetica Neue", Arial, sans-serif;
}
[data-theme=dark] { --navy: #e8eaed; --ink: #d9dce1; --muted: #9aa1ab; --line: #3a3f47; --bg: #1b1d21; --panel: #25282d; --tint: rgba(96, 153, 255, .16); }
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font: 14px/1.5 var(--font-ui); -webkit-font-smoothing: antialiased; color: var(--ink); background: var(--bg); }
a { color: var(--indigo); }
button, input, select, textarea { font: inherit; color: inherit; }
.boot { padding: 60px; text-align: center; color: var(--muted); }
.hidden { display: none !important; }

/* layout */
.shell { display: grid; grid-template-columns: var(--side) var(--list) 1fr; height: 100vh; height: 100dvh; }
.shell.single { grid-template-columns: var(--side) 1fr; }
.side { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; overflow: auto; }
.side .brand { display: flex; align-items: center; gap: 10px; padding: 16px 16px 10px; font-weight: 700; font-size: 17px; letter-spacing: -.2px; color: var(--navy); }
.brand .prod { font-weight: 400; color: var(--muted); }
.mark { width: 30px; height: 30px; border-radius: 8px; background: url(/static/img/kiqmail-icon.svg) center/cover; display: inline-block; flex: none; }
.side-compose { margin: 6px 14px 12px; height: 38px; justify-content: center; border-radius: 10px; font-size: 14px; background: linear-gradient(135deg, #5b6cf0, #4C5BD4); box-shadow: 0 6px 18px rgba(76, 91, 212, .30); }
.side-compose:hover { filter: none; box-shadow: 0 8px 22px rgba(76, 91, 212, .40); }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 7px 16px; cursor: pointer; border-radius: 0; color: var(--ink); text-decoration: none; }
.nav-item:hover { background: var(--tint); }
.nav-item.active { background: var(--tint); color: var(--indigo); font-weight: 700; }
.nav-item .badge { margin-left: auto; font-size: 11px; font-weight: 700; background: var(--indigo); color: #fff; border-radius: 999px; padding: 1px 7px; }
.nav-item .badge.err { background: var(--err); }
.nav-group { padding: 10px 16px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); font-weight: 700; display: flex; justify-content: space-between; align-items: center; }
.nav-group button { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0 2px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.side .foot { margin-top: auto; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; align-items: center; }

/* buttons & inputs */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 8px; border: 1px solid transparent; background: var(--indigo); color: #fff; font-weight: 700; cursor: pointer; font-size: 13px; }
.btn:hover { filter: brightness(.95); }
.btn.ghost { background: var(--panel); color: var(--navy); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--indigo); color: var(--indigo); }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.btn.danger { background: var(--err); }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn { border: 1px solid var(--line); background: var(--panel); border-radius: 8px; width: 32px; height: 32px; cursor: pointer; display: inline-grid; place-items: center; color: var(--ink); }
.icon-btn:hover { border-color: var(--indigo); color: var(--indigo); }
.icon-btn.active { background: var(--tint); color: var(--indigo); border-color: var(--indigo); }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; font-weight: 700; color: var(--navy); margin-bottom: 4px; }
.field input:not([type]), .field input[type=text], .field input[type=email], .field input[type=password], .field input[type=url], .field input[type=number], .field input[type=time], .field select, .field textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); font-size: 14px; }
.field textarea { min-height: 90px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--indigo); box-shadow: 0 0 0 3px var(--tint); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 10px; }
.help { font-size: 12px; color: var(--muted); }
.msg-ok { color: var(--ok); font-size: 13px; } .msg-err { color: var(--err); font-size: 13px; }

/* list */
.list { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-width: 0; }
.list-head { padding: 10px 12px; border-bottom: 1px solid var(--line); display: flex; gap: 8px; align-items: center; }
.list-head input { flex: 1; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.list-body { overflow: auto; flex: 1; }
.item { padding: 10px 12px; border-bottom: 1px solid var(--line); cursor: pointer; display: grid; grid-template-columns: 10px 1fr auto; gap: 8px; align-items: start; }
.item:hover { background: var(--tint); }
.item.active { background: var(--tint); box-shadow: inset 3px 0 0 var(--indigo); }
.item .who { font-weight: 700; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item.unread .who::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--blue); margin-right: 6px; vertical-align: middle; }
.item .subj { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item.unread .subj { font-weight: 600; }
.item .snip { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .when { font-size: 11px; color: var(--muted); white-space: nowrap; }
.item .flags { font-size: 11px; color: var(--warn); }
.item .cnt { font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 0 5px; }
.compact .item { padding: 6px 12px; } .compact .item .snip { display: none; }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }

/* reader */
.reader { display: flex; flex-direction: column; min-width: 0; overflow: auto; }
.reader-head { padding: 14px 20px; border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.reader-head h2 { margin: 0; font-size: 18px; color: var(--navy); }
.tools { display: flex; gap: 6px; flex-wrap: wrap; }
.mailmsg { margin: 14px 20px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.mailmsg .mhead { padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; cursor: pointer; }
.mailmsg .mhead b { color: var(--navy); }
.mailmsg .mhead .meta { font-size: 12px; color: var(--muted); }
.mailmsg .mbody { padding: 16px; overflow-x: auto; }
.mailmsg .mbody.plain { white-space: pre-wrap; font-family: inherit; }
.mailmsg.collapsed .mbody { display: none; }
.imgbar { background: var(--tint); padding: 6px 12px; font-size: 12px; display: flex; justify-content: space-between; align-items: center; }
.atts { padding: 8px 16px 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.att { border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-size: 12px; text-decoration: none; color: var(--ink); }
.aibox { margin: 0 20px 14px; background: var(--tint); border-radius: var(--radius); padding: 12px 16px; white-space: pre-wrap; font-size: 13px; }

/* compose */
.overlay { position: fixed; inset: 0; background: rgba(16, 36, 59, .35); z-index: 20; display: grid; place-items: end center; }
.compose { width: min(760px, 100%); max-height: 92vh; background: var(--panel); border-radius: 14px 14px 0 0; box-shadow: 0 -10px 40px rgba(0,0,0,.2); display: flex; flex-direction: column; }
.compose .chead { padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; font-weight: 700; color: var(--navy); }
.compose .cbody { padding: 12px 16px; overflow: auto; }
.compose .cline { display: flex; gap: 8px; align-items: center; border-bottom: 1px solid var(--line); padding: 6px 0; }
.compose .cline label { width: 60px; font-size: 12px; color: var(--muted); }
.compose .cline input, .compose .cline select { flex: 1; border: 0; background: none; padding: 4px 0; }
.compose .cline input:focus { outline: none; }
.compose textarea { width: 100%; min-height: 220px; border: 0; padding: 12px 0; resize: vertical; background: none; }
.compose textarea:focus { outline: none; }
.compose .cfoot { padding: 10px 16px; border-top: 1px solid var(--line); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.fnprev { border-top: 1px dashed var(--line); padding-top: 10px; margin-top: 6px; font-size: 12px; color: var(--muted); }

/* settings */
.settings { padding: 24px 28px; max-width: 900px; overflow: auto; }
.settings h1 { font-size: 24px; color: var(--navy); margin: 0 0 4px; }
.tabs { display: flex; gap: 6px; margin: 16px 0 20px; flex-wrap: wrap; }
.tab { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; font-weight: 600; }
.tab.active { background: var(--navy); color: var(--panel); border-color: var(--navy); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; }
.card h3 { margin: 0 0 8px; color: var(--navy); font-size: 16px; }
.acct-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.acct-row:last-child { border-bottom: 0; }
.acct-row .grow { flex: 1; min-width: 0; }
.acct-row .sub { font-size: 12px; color: var(--muted); }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.swatch { width: 22px; height: 22px; border-radius: 50%; cursor: pointer; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.swatch.active { box-shadow: 0 0 0 2px var(--indigo); }
.toggle { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.toggle input { width: 18px; height: 18px; }
.preset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; margin-bottom: 12px; }
.preset { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; background: var(--panel); text-align: left; }
.preset.active { border-color: var(--indigo); box-shadow: 0 0 0 3px var(--tint); }
.preset b { display: block; color: var(--navy); }
.preset span { font-size: 12px; color: var(--muted); }

/* auth */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth .card { width: min(420px, 100%); padding: 28px; }
.auth h1 { margin: 0 0 4px; color: var(--navy); font-size: 26px; }

/* toast */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 10px; font-weight: 600; z-index: 50; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
[data-theme=dark] .toast { background: #fff; color: #10243b; }

.mobile-bar { display: none; gap: 8px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--panel); }
@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 15; transform: translateX(-100%); transition: .2s; }
  .side.open { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.3); }
  .list, .reader, .settings { display: none; }
  .shell[data-pane=list] .list, .shell[data-pane=reader] .reader, .shell[data-pane=settings] .settings { display: flex; }
  .shell[data-pane=settings] .settings { display: block; }
  .list { border-right: 0; }
  .mobile-bar { display: flex; }
}

/* ---- hub panes (calendar / notes) ---- */
.hubpane { display: flex; flex-direction: column; min-width: 0; overflow: auto; background: var(--bg); }
.hub-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px 8px; flex-wrap: wrap; }
.hub-head h1 { margin: 0; font-size: 22px; color: var(--navy); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); margin: 8px 20px; }
.cal-dow { background: var(--panel); padding: 6px; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); text-align: center; font-weight: 700; }
.cal-day { background: var(--panel); min-height: 86px; padding: 4px 6px; cursor: pointer; font-size: 12px; }
.cal-day.other { opacity: .45; } .cal-day.today .num { background: var(--indigo); color: #fff; border-radius: 50%; }
.cal-day.sel { box-shadow: inset 0 0 0 2px var(--indigo); }
.cal-day .num { display: inline-block; width: 22px; height: 22px; line-height: 22px; text-align: center; font-weight: 700; color: var(--navy); }
.cal-ev { color: #fff; border-radius: 4px; padding: 1px 5px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11px; }
.agenda { margin: 8px 20px 20px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.agenda h3 { margin: 0 0 8px; color: var(--navy); font-size: 15px; }
.agenda-row { display: flex; gap: 8px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line); cursor: pointer; }
.notes-cols { display: grid; grid-template-columns: 320px 1fr; flex: 1; min-height: 0; }
.notes-list { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.note-edit { display: flex; flex-direction: column; min-height: 0; background: var(--panel); }
.note-title { border: 0; padding: 14px 20px 4px; font-size: 22px; font-weight: 800; color: var(--navy); background: none; }
.note-body { border: 0; padding: 8px 20px 20px; flex: 1; resize: none; background: none; font-size: 15px; line-height: 1.6; }
.note-title:focus, .note-body:focus { outline: none; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.card.featured { border-color: var(--indigo); box-shadow: 0 0 0 3px var(--tint); }
.price { font-size: 30px; font-weight: 800; color: var(--navy); letter-spacing: -1px; } .price span { font-size: 13px; color: var(--muted); font-weight: 600; letter-spacing: 0; }
.list { list-style: none; padding: 0; margin: 10px 0 14px; } .list li { padding: 4px 0 4px 22px; position: relative; font-size: 13px; } .list li::before { content: '✓'; position: absolute; left: 0; color: var(--ok); font-weight: 800; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; background: var(--tint); color: var(--indigo); }
.badge.ok { background: #e6f7f0; color: #0b6b4c; } .badge.warn { background: #fdf1ef; color: #8e2b20; }
[data-theme=dark] .badge.ok { background: #123b2c; color: #7de0b6; } [data-theme=dark] .badge.warn { background: #3b1b17; color: #f2a59a; }
@media (max-width: 980px) { .shell[data-pane=hub] .hubpane { display: flex; } .hubpane { display: none; } .notes-cols { grid-template-columns: 1fr; } .note-edit { display: none; } .grid3 { grid-template-columns: 1fr; } .cal-day { min-height: 56px; } .cal-ev { display: none; } .cal-day .num { font-size: 12px; } }
/* free kiqmail.net mailbox */
.addr-input { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); overflow: hidden; }
.addr-input input { flex: 1; border: 0 !important; padding: 9px 10px; background: none; font-size: 15px; min-width: 0; } .addr-input input:focus { outline: none; box-shadow: none !important; }
.addr-input span { padding: 9px 12px; color: var(--muted); background: var(--bg); border-left: 1px solid var(--line); white-space: nowrap; }
.addr-input:focus-within { border-color: var(--indigo); box-shadow: 0 0 0 3px var(--tint); }
.chip { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 3px 10px; font-size: 12px; cursor: pointer; margin: 2px 2px 0 0; } .chip:hover { border-color: var(--indigo); color: var(--indigo); }
.usage { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); } .usage-bar { width: 90px; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; display: inline-block; } .usage-bar i { display: block; height: 100%; }
.nav-item.promo { margin: 4px 10px; border-radius: 10px; background: var(--tint); color: var(--indigo); font-weight: 600; font-size: 13px; }
.nav-item.alert { margin: 4px 10px; border-radius: 10px; background: #fdf1ef; color: #8e2b20; font-size: 12px; } [data-theme=dark] .nav-item.alert { background: #3b1b17; color: #f2a59a; }
.managed-tag { font-size: 11px; font-weight: 700; color: var(--indigo); background: var(--tint); border-radius: 999px; padding: 1px 7px; margin-left: 6px; }

/* Sign in with Apple / Google (brand rules: Apple black, Google white with grey border) */
.idp-buttons { margin: 4px 0 12px; display: grid; gap: 10px; }
.idp-btn { display: flex; align-items: center; justify-content: center; gap: 10px; height: 44px; border-radius: 10px; font-weight: 600; font-size: 15px; text-decoration: none; }
.idp-apple { background: #000; color: #fff !important; } .idp-apple:hover { background: #1a1a1a; }
.idp-google { background: #fff; color: #1f1f1f !important; border: 1px solid #747775; } .idp-google:hover { background: #f8f9fa; }
[data-theme=dark] .idp-apple { background: #fff; color: #000 !important; } [data-theme=dark] .idp-apple:hover { background: #e8e8e8; }
.idp-or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin-top: 4px; } .idp-or::before, .idp-or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
/* footers */
.footer-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.footer-thumb { width: 260px; max-height: 90px; overflow: hidden; background: #fff; border-radius: 8px; padding: 8px; transform-origin: left top; flex: none; }
.footer-thumb table { transform: scale(.6); transform-origin: left top; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.tpl { text-align: left; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); padding: 12px; cursor: pointer; color: var(--ink); }
.tpl:hover { border-color: var(--indigo); } .tpl b { display: block; color: var(--navy); } .tpl span { font-size: 12px; color: var(--muted); }
.footer-editor { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 14px; }
.footer-preview { position: sticky; top: 10px; } .mail-mock { background: #fff; color: #334155; border: 1px solid var(--line); border-radius: 10px; padding: 20px; overflow-x: auto; }
.title-input { font-size: 20px; font-weight: 800; border: 1px solid transparent; border-radius: 8px; padding: 4px 8px; background: none; color: var(--navy); }
.title-input:hover, .title-input:focus { border-color: var(--line); outline: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; } .chip.on { background: var(--indigo); color: #fff; border-color: var(--indigo); }
/* referrals */
.ref-link { display: flex; gap: 8px; margin: 12px 0; flex-wrap: wrap; } .ref-link input { flex: 1; min-width: 220px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); font-size: 14px; }
.ref-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 8px 0 14px; } .ref-stats div { background: var(--bg); border-radius: 10px; padding: 12px; text-align: center; }
.ref-stats b { display: block; font-size: 24px; color: var(--navy); } .ref-stats span { font-size: 12px; color: var(--muted); }
.ref-progress .bar { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; margin-bottom: 6px; } .ref-progress .bar i { display: block; height: 100%; background: var(--indigo); }
@media (max-width: 980px) { .footer-editor { grid-template-columns: 1fr; } .footer-thumb { width: 180px; } .ref-stats { grid-template-columns: 1fr; } }
.footer-editor > div { min-width: 0; } .row > .field { min-width: 0; }
.footer-editor input[type=file] { max-width: 100%; font-size: 12px; }
.img-row { display: flex; align-items: center; gap: 10px; }
.eyebrow { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--indigo); margin-bottom: 4px; }

/* KiQHub Office look: line icons, softer rows */
.nav-ico { flex: none; color: var(--muted); }
.nav-item { border-radius: 8px; margin: 1px 8px; padding: 7px 10px; }
.nav-item.active .nav-ico, .nav-item:hover .nav-ico { color: var(--indigo); }
.side-compose .nav-ico { color: #fff; }
.nav-group { padding: 12px 18px 4px; }
.btn .nav-ico { color: inherit; width: 16px; height: 16px; }
.icon-btn .nav-ico { color: inherit; }

/* ═════════════ KiQHub Office "glass" skin — same look as KiQHub Office (office/server/static/css/skins.css) ═════════════ */
@font-face{font-family:'Inter';font-style:normal;font-weight:400;font-display:swap;src:url(/static/fonts/inter/inter-400-normal-latin.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'Inter';font-style:normal;font-weight:400;font-display:swap;src:url(/static/fonts/inter/inter-400-normal-latin-ext.woff2) format('woff2');unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:'Inter';font-style:normal;font-weight:500;font-display:swap;src:url(/static/fonts/inter/inter-500-normal-latin.woff2) format('woff2')}
@font-face{font-family:'Inter';font-style:normal;font-weight:600;font-display:swap;src:url(/static/fonts/inter/inter-600-normal-latin.woff2) format('woff2');unicode-range:U+0000-00FF,U+2000-206F,U+20AC}
@font-face{font-family:'Inter';font-style:normal;font-weight:600;font-display:swap;src:url(/static/fonts/inter/inter-600-normal-latin-ext.woff2) format('woff2');unicode-range:U+0100-02BA,U+1E00-1E9F,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:'Inter';font-style:normal;font-weight:700;font-display:swap;src:url(/static/fonts/inter/inter-700-normal-latin.woff2) format('woff2');unicode-range:U+0000-00FF,U+2000-206F,U+20AC}
@font-face{font-family:'Inter';font-style:normal;font-weight:700;font-display:swap;src:url(/static/fonts/inter/inter-700-normal-latin-ext.woff2) format('woff2');unicode-range:U+0100-02BA,U+1E00-1E9F,U+2C60-2C7F,U+A720-A7FF}
:root {
  --font-ui: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --glass: rgba(255, 255, 255, .64); --glass-strong: rgba(255, 255, 255, .80); --glass-rim: rgba(255, 255, 255, .78);
  --glass-edge: rgba(15, 23, 42, .08); --glass-blur: saturate(1.7) blur(22px); --topbar-h: 48px;
  --shadow-2: 0 8px 24px rgba(30, 41, 59, .10), 0 1px 3px rgba(30, 41, 59, .06);
}
[data-theme=dark] {
  --glass: rgba(26, 29, 36, .70); --glass-strong: rgba(30, 33, 41, .82); --glass-rim: rgba(255, 255, 255, .07);
  --glass-edge: rgba(255, 255, 255, .06); --glass-blur: saturate(1.5) blur(22px); --bg: #121419; --panel: #1c1f26; --line: #30353f;
}
body { font-family: var(--font-ui); font-size: 13.5px; letter-spacing: -0.003em;
  background: radial-gradient(1100px 520px at 0% -8%, rgba(76, 91, 212, .18), transparent 62%), radial-gradient(900px 560px at 100% -4%, rgba(168, 85, 247, .10), transparent 58%),
              radial-gradient(700px 500px at 60% 110%, rgba(56, 189, 248, .10), transparent 60%), linear-gradient(180deg, #f4f6fb 0%, #e9edf5 100%);
  background-attachment: fixed; }
[data-theme=dark] body { background: radial-gradient(1000px 520px at 0% -10%, rgba(76, 91, 212, .22), transparent 60%), radial-gradient(900px 600px at 100% 0%, rgba(168, 85, 247, .14), transparent 58%), linear-gradient(180deg, #15171c, #0f1115); background-attachment: fixed; }

/* frame: Office top bar + the mail shell under it */
.frame { height: 100vh; height: 100dvh; display: flex; flex-direction: column; }
.frame > .shell { height: auto; flex: 1; min-height: 0; }
.topbar { height: var(--topbar-h); flex: none; display: flex; align-items: center; gap: 8px; padding: 0 12px 0 8px; position: relative; z-index: 30;
  background: var(--glass); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); color: var(--ink);
  border-bottom: 1px solid var(--glass-edge); box-shadow: inset 0 -1px 0 rgba(255, 255, 255, .55); }
[data-theme=dark] .topbar { box-shadow: none; color: #eceef2; }
.k-icon-btn { width: 34px; height: 34px; border-radius: 9px; border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; color: var(--ink); }
.k-icon-btn:hover { background: rgba(15, 23, 42, .06); }
[data-theme=dark] .k-icon-btn:hover { background: rgba(255, 255, 255, .07); }
.tb-brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--navy); font-size: 15.5px; font-weight: 600; letter-spacing: -.2px; padding: 4px 8px 4px 4px; border-radius: 9px; }
.tb-brand b { color: var(--indigo); font-weight: 700; }
.tb-brand .mark { width: 26px; height: 26px; border-radius: 7px; }
.apptabs { display: flex; gap: 2px; padding: 3px; border-radius: 12px; margin-left: 6px; background: rgba(15, 23, 42, .045); box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .05); }
[data-theme=dark] .apptabs { background: rgba(255, 255, 255, .05); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); }
.apptab { display: flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px 0 7px; border-radius: 9px; color: var(--ink); opacity: .85; text-decoration: none; font-weight: 500; white-space: nowrap; }
.apptab img { width: 20px; height: 20px; border-radius: 5px; }
.apptab:hover { background: rgba(255, 255, 255, .7); opacity: 1; }
.apptab.on { background: #fff; color: var(--tab-color); font-weight: 600; opacity: 1;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .08), 0 6px 16px color-mix(in srgb, var(--tab-color) 22%, transparent), inset 0 0 0 1px rgba(255, 255, 255, .9); }
[data-theme=dark] .apptab:hover { background: rgba(255, 255, 255, .07); }
[data-theme=dark] .apptab.on { background: rgba(255, 255, 255, .11); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .10), 0 0 18px color-mix(in srgb, var(--tab-color) 35%, transparent); }
.apptab.off { opacity: .5; }
.tb-spacer { flex: 1; }
.tb-btn.ai { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 10px; border: 1px solid transparent; cursor: pointer; font-weight: 600; font-size: 13px; color: #fff;
  background: linear-gradient(135deg, #7c3aed, #db2777); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), inset 0 -1px 0 rgba(0, 0, 0, .1), 0 4px 14px rgba(124, 58, 237, .30); }
.tb-btn.ai .ico { color: #fff; } .tb-btn.ai .ico .ic-d { fill: #fff; opacity: .35; }
.tb-avatar { width: 30px; height: 30px; border-radius: 50%; border: 2px solid #fff; background: #ca5010; color: #fff; font: 600 12px var(--font-ui); cursor: pointer; box-shadow: 0 1px 3px rgba(0, 0, 0, .15); }
[data-theme=dark] .tb-avatar { border-color: #2a2f38; }
.tb-apps { position: relative; }
.apps-pop { position: absolute; top: 42px; left: 0; width: 360px; padding: 14px; border-radius: 16px; z-index: 50;
  background: var(--glass-strong); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); border: 1px solid var(--glass-rim); box-shadow: var(--shadow-2); }
.apps-pop-h b { display: block; font-size: 15px; color: var(--navy); } .apps-pop-h span { font-size: 12px; color: var(--muted); }
.apps-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.app-tile { display: grid; grid-template-columns: 34px 1fr; column-gap: 10px; align-items: center; padding: 10px; border-radius: 12px; text-decoration: none; color: var(--ink); background: rgba(255, 255, 255, .6); box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .05); }
[data-theme=dark] .app-tile { background: rgba(255, 255, 255, .05); }
.app-tile img { width: 34px; height: 34px; grid-row: span 2; }
.app-tile b { font-size: 13px; } .app-tile span { font-size: 11.5px; color: var(--muted); }
.app-tile:hover { background: #fff; } [data-theme=dark] .app-tile:hover { background: rgba(255, 255, 255, .1); }
.app-tile.off { opacity: .55; }

/* side bar: light glass, the chosen view is a white pill (Office file side bar) */
.side { background: var(--glass); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); border-right: 1px solid var(--glass-edge); }
@media (min-width: 981px) { .side .brand { display: none; } .side-compose { margin-top: 12px; } }
.nav-item { margin: 1px 8px; padding: 7px 10px; border-radius: 9px; color: var(--ink); font-weight: 500; }
.nav-item:hover { background: rgba(15, 23, 42, .05); }
.nav-item.active { background: rgba(255, 255, 255, .92); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(15, 23, 42, .06); }
[data-theme=dark] .nav-item:hover { background: rgba(255, 255, 255, .06); }
[data-theme=dark] .nav-item.active { background: rgba(255, 255, 255, .10); color: #fff; box-shadow: none; }
.nav-item .badge { background: transparent; color: var(--muted); font-weight: 600; }
.nav-group { text-transform: none; letter-spacing: 0; font-size: 12px; font-weight: 600; padding: 14px 18px 4px; }
.side .foot { border-top-color: var(--glass-edge); }

/* list + reader: floating glass cards on the canvas */
.list { background: transparent; border-right: 0; padding: 10px 6px 10px 10px; gap: 8px; }
.list-head { border: 1px solid var(--glass-rim); border-radius: 14px; background: var(--glass-strong); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); box-shadow: 0 6px 18px rgba(30, 41, 59, .06); }
.list-head input { background: rgba(255, 255, 255, .9); border: 0; box-shadow: inset 0 1px 2px rgba(15, 23, 42, .07), inset 0 0 0 1px rgba(15, 23, 42, .14); border-radius: 11px; }
[data-theme=dark] .list-head input { background: rgba(255, 255, 255, .07); box-shadow: none; }
.list-body { background: var(--glass-strong); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); border: 1px solid var(--glass-rim); border-radius: 16px;
  box-shadow: 0 10px 30px rgba(30, 41, 59, .08), 0 1px 2px rgba(30, 41, 59, .06), inset 0 1px 0 rgba(255, 255, 255, .95); }
[data-theme=dark] .list-body { box-shadow: 0 14px 36px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .05); }
.item { border-bottom-color: var(--glass-edge); }
.item:hover { background: rgba(15, 23, 42, .035); }
.item.active { background: color-mix(in srgb, var(--indigo) 10%, transparent); box-shadow: inset 3px 0 0 var(--indigo); }
[data-theme=dark] .item:hover { background: rgba(255, 255, 255, .04); }
.reader { background: transparent; padding: 10px 10px 10px 4px; }
.reader-head { border: 1px solid var(--glass-rim); border-radius: 16px; background: var(--glass-strong); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); box-shadow: 0 6px 18px rgba(30, 41, 59, .06); }
.card { background: var(--glass-strong); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); border: 1px solid var(--glass-rim); border-radius: 14px;
  box-shadow: 0 6px 18px rgba(30, 41, 59, .06), inset 0 1px 0 rgba(255, 255, 255, .9); }
[data-theme=dark] .card { box-shadow: 0 10px 28px rgba(0, 0, 0, .3); }
.settings h1 { font-size: 22px; font-weight: 600; }
.tab { background: var(--glass-strong); border-color: var(--glass-edge); font-weight: 500; }
.tab.active { background: color-mix(in srgb, var(--indigo) 12%, #fff); color: color-mix(in srgb, var(--indigo) 82%, #000); border-color: color-mix(in srgb, var(--indigo) 26%, transparent); font-weight: 600; }
[data-theme=dark] .tab.active { background: color-mix(in srgb, var(--indigo) 26%, transparent); color: #fff; }
.btn { border-radius: 10px; font-weight: 600; }
.btn:not(.ghost):not(.danger) { background: var(--indigo); box-shadow: 0 4px 14px color-mix(in srgb, var(--indigo) 35%, transparent); }
.btn.ghost { background: rgba(255, 255, 255, .7); border-color: rgba(15, 23, 42, .10); }
[data-theme=dark] .btn.ghost { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .14); }
.icon-btn { border-radius: 9px; background: rgba(255, 255, 255, .7); }
[data-theme=dark] .icon-btn { background: rgba(255, 255, 255, .06); }
.mobile-bar { background: var(--glass); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); border-bottom-color: var(--glass-edge); }

/* KiQHub icons (office/server/static/css/icons.css): flat duotone = tone surface under the ink */
:root {
  --t-blue: #3a76f0; --t-indigo: #5b5bd6; --t-violet: #8b5cf6; --t-teal: #0fa3a0; --t-green: #14a46b;
  --t-amber: #eda01a; --t-orange: #f0703c; --t-rose: #e5486a; --t-slate: #64748b; --ic-tint: .3;
}
[data-theme=dark] { --t-blue: #5b93ff; --t-indigo: #8285ff; --t-violet: #a67cff; --t-teal: #2cc7c0; --t-green: #2fc585; --t-amber: #f7b83a; --t-orange: #ff8a57; --t-rose: #ff6b8b; --t-slate: #8f9bb0; --ic-tint: .36; }
.ico { flex: none; overflow: visible; }
.ico .ic-o { fill: currentColor; }
.ico .ic-d { fill: var(--ic-tone, currentColor); opacity: var(--ic-tint); }
.ico[data-tone=blue] { --ic-tone: var(--t-blue); } .ico[data-tone=indigo] { --ic-tone: var(--t-indigo); } .ico[data-tone=violet] { --ic-tone: var(--t-violet); }
.ico[data-tone=teal] { --ic-tone: var(--t-teal); } .ico[data-tone=green] { --ic-tone: var(--t-green); } .ico[data-tone=amber] { --ic-tone: var(--t-amber); }
.ico[data-tone=orange] { --ic-tone: var(--t-orange); } .ico[data-tone=rose] { --ic-tone: var(--t-rose); } .ico[data-tone=slate] { --ic-tone: var(--t-slate); }
.nav-ico { color: var(--ink); }
.nav-item.active .nav-ico, .nav-item:hover .nav-ico { color: var(--ink); }
.topbar .ico .ic-d { fill: currentColor; opacity: .25; }
.side-compose .ico .ic-d, .btn .ico .ic-d { fill: currentColor; opacity: .3; }
.side-compose .nav-ico { color: #fff; }

@media (max-width: 980px) {
  .apptab .lbl, .tb-btn.ai .lbl { display: none; }
  .apptab { padding: 0 6px; }
  .tb-brand > span:last-child { display: none; }
  .apps-pop { width: min(360px, calc(100vw - 20px)); }
  .list, .reader { padding: 0; } .list-body, .list-head, .reader-head { border-radius: 0; border-left: 0; border-right: 0; }
}
/* emails are documents: like KiQHub Office's studio skin ("documents stay on white paper"), HTML mail keeps a white
   page in dark mode so senders' own colours stay readable */
[data-theme=dark] .mailmsg .mbody:not(.plain) { background: #fff; color: #1f2328; margin: 10px 12px 12px; border-radius: 10px; }
[data-theme=dark] .fnprev > div { background: #fff; color: #1f2328; padding: 10px; border-radius: 10px; }
