/* Kquika Team. Apple-style restraint: system type, generous space, frosted
   surfaces, one accent color, no stripes. Tokens live in theme.css and are
   overridden by the active design kit (/brand/theme.css). */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.47 var(--font); letter-spacing: -0.01em; color: var(--text); background: var(--canvas);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--ink); margin: 0; letter-spacing: -0.022em; }
h1 { font-size: 32px; font-weight: 700; line-height: 1.1; }
h2 { font-size: 19px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 620; }
p { margin: 0 0 10px; }
code, .mono { font-family: var(--mono); font-size: 13px; letter-spacing: 0; }
.muted { color: var(--muted); } .faint { color: var(--faint); }
.small { font-size: 13px; } .tiny { font-size: 12px; }
.nowrap { white-space: nowrap; } .right { text-align: right; } .center { text-align: center; }
.num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
.i { width: 1.25em; text-align: center; font-size: 15px; flex: 0 0 auto; }
.i.sm { font-size: 13px; }

/* ---------------------------------------------------------------- shell */
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 18px 14px 28px; z-index: 40;
  background: var(--glass); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 1px 0 0 var(--hairline); }
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 16px; }
.brand img { height: 26px; width: auto; display: block; }
.brand .env { margin-left: auto; font-size: 10.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--muted); background: var(--sunken); border-radius: var(--radius-pill); padding: 2px 8px; }
.nav-section { margin-top: 18px; }
.nav-section > .label { font-size: 11.5px; font-weight: 600; color: var(--faint); padding: 0 10px 6px; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 7px 10px; border-radius: 9px; color: var(--ink);
  font-size: 14px; font-weight: 500; }
.nav-item .i { color: var(--muted); }
.nav-item:hover { background: rgba(0, 0, 0, .045); text-decoration: none; }
.nav-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-item.active .i { color: var(--accent); }
.scrim { display: none; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { height: var(--topbar-h); position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px;
  padding: 0 32px; background: rgba(245, 245, 247, .8); backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px); box-shadow: 0 1px 0 var(--hairline); }
.menu-btn { display: none; }
.topbar .search { flex: 1; max-width: 460px; position: relative; }
.topbar .search input { width: 100%; height: 36px; min-height: 36px; padding: 0 14px 0 36px; border-radius: var(--radius-pill);
  box-shadow: none; background: rgba(0, 0, 0, .055); font-size: 14px; }
.topbar .search input:focus { background: #fff; box-shadow: 0 0 0 4px var(--accent-soft); }
.topbar .search .i { position: absolute; left: 12px; top: 11px; color: var(--faint); }
.topbar .spacer { flex: 1; }
.flash-pill { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 14px; border-radius: var(--radius-pill);
  background: var(--danger-bg); color: var(--danger); font-weight: 600; font-size: 13px; }
.flash-pill:hover { text-decoration: none; }
.flash-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--flash); animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 59, 48, .55); } 70% { box-shadow: 0 0 0 8px rgba(255, 59, 48, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 59, 48, 0); } }
.usermenu { display: flex; align-items: center; gap: 8px; }
.usermenu > a { color: inherit; } .usermenu > a:hover { text-decoration: none; }
.usermenu .who { text-align: right; line-height: 1.25; }
.usermenu .who b { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.usermenu .who span { font-size: 12px; color: var(--muted); }

.content { padding: 36px 40px 80px; max-width: 1280px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.page-head .titles { flex: 1; min-width: 240px; }
.page-head p { margin: 8px 0 0; color: var(--muted); font-size: 16px; max-width: 720px; }
.eyebrow { font-size: 13px; font-weight: 600; color: var(--accent); margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------------------------------------------------------------- layout */
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.stack > * + * { margin-top: 18px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; } .row.between { justify-content: space-between; }

/* ---------------------------------------------------------------- surfaces */
.card { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.card > .hd { display: flex; align-items: center; gap: 10px; padding: 20px 22px 8px; flex-wrap: wrap; }
.card > .hd > .i { color: var(--accent); }
.card > .hd h2, .card > .hd h3 { flex: 1; }
.card > .hd h2 { font-size: 17px; }
.card > .bd { padding: 14px 22px 22px; }
.card > .bd.flush { padding: 6px 8px 10px; }
.card > .ft { padding: 14px 22px 18px; color: var(--muted); }
.card.danger { background: #fff8f7; }
.card.flat { box-shadow: none; background: var(--canvas); }
a.card { color: inherit; display: block; }
a.card:hover { text-decoration: none; box-shadow: var(--shadow), 0 0 0 1px var(--accent-soft); }

.stat { padding: 20px 22px; }
.stat .k { font-size: 13px; color: var(--muted); font-weight: 500; display: flex; align-items: center; gap: 6px; }
.stat .v { font: 700 32px/1.1 var(--font-display); color: var(--ink); letter-spacing: -0.03em; margin-top: 8px; font-variant-numeric: tabular-nums; }
.stat .s { font-size: 12.5px; color: var(--faint); margin-top: 4px; }

.hero { border-radius: 24px; padding: 40px 44px; color: #f5f5f7; position: relative; overflow: hidden;
  background: radial-gradient(90% 140% at 100% 0%, rgba(46, 107, 255, .55), transparent 55%), var(--kq-navy-950); }
.hero .eyebrow { color: var(--kq-cyan-400); }
.hero h1 { color: #fff; font-size: 40px; max-width: 760px; }
.hero p { color: rgba(245, 245, 247, .72); margin-top: 10px; font-size: 17px; max-width: 680px; }
.hero .chips { margin-top: 20px; display: flex; gap: 6px; flex-wrap: wrap; }
.hero .chip { background: rgba(255, 255, 255, .1); color: #fff; }

/* ---------------------------------------------------------------- controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 16px;
  border-radius: var(--radius-pill); border: 0; background: rgba(0, 0, 0, .06); color: var(--ink);
  font: 500 14px/1 var(--font); cursor: pointer; white-space: nowrap; transition: background .15s, transform .05s; }
.btn:hover { background: rgba(0, 0, 0, .1); text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--accent-soft); }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.dark { background: var(--ink); color: #fff; }
.btn.danger { color: var(--danger); background: var(--danger-bg); }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: rgba(0, 0, 0, .06); }
.btn.sm { height: 30px; padding: 0 12px; font-size: 13px; }
.btn.block { width: 100%; height: 46px; font-size: 16px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
form.inline { display: inline; }

label { display: block; font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.field { margin-bottom: 16px; }
.field .hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
input[type=text], input[type=email], input[type=search], input[type=date], input[type=datetime-local], input[type=number],
input[type=password], input[type=url], input[type=color], select, textarea {
  width: 100%; min-height: 40px; padding: 9px 13px; border: 0; border-radius: var(--radius); background: var(--canvas);
  box-shadow: inset 0 0 0 1px var(--hairline); font: inherit; color: var(--ink); transition: box-shadow .15s, background .15s; }
input:focus, select:focus, textarea:focus { background: #fff; box-shadow: inset 0 0 0 1px var(--accent), 0 0 0 4px var(--accent-soft); outline: none; }
input[type=color] { padding: 4px; height: 40px; }
textarea { min-height: 96px; resize: vertical; }
input[type=file] { font: inherit; font-size: 13.5px; max-width: 100%; }
input[type=file]::file-selector-button { border: 0; border-radius: var(--radius-pill); background: rgba(0, 0, 0, .06); padding: 7px 14px; margin-right: 10px; font: 500 13px var(--font); cursor: pointer; }
.check { display: flex; align-items: flex-start; gap: 10px; font-weight: 400; font-size: 14px; color: var(--text); margin: 0; }
.check input { margin-top: 3px; accent-color: var(--accent); width: 16px; height: 16px; flex: 0 0 auto; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.otp { font: 600 28px/1 var(--mono) !important; letter-spacing: .45em; text-align: center; padding: 16px !important; }

/* ---------------------------------------------------------------- tables and lists (no rules, no stripes) */
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.table th { text-align: left; font-size: 12.5px; color: var(--muted); font-weight: 600; padding: 10px 14px; white-space: nowrap; }
.table td { padding: 12px 14px; vertical-align: middle; }
.table tbody tr td:first-child { border-radius: 12px 0 0 12px; } .table tbody tr td:last-child { border-radius: 0 12px 12px 0; }
.table tbody tr:hover td { background: var(--canvas); }
.table .who { display: flex; align-items: center; gap: 12px; }
.table .who b { display: block; color: var(--ink); font-weight: 600; }
.table .who span { font-size: 12.5px; color: var(--muted); }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.list { list-style: none; margin: 0; padding: 0 8px 8px; }
.list > li { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px; flex-wrap: wrap; }
.list > li:hover { background: var(--canvas); }
.list .grow { flex: 1; min-width: 180px; }
.list .title { font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .sub { font-size: 12.5px; color: var(--muted); }

/* ---------------------------------------------------------------- badges, chips, avatars */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 600; background: var(--sunken); color: var(--muted); white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.danger { background: var(--danger-bg); color: var(--danger); }
.badge.info { background: var(--accent-soft); color: var(--accent); }
.badge.dark { background: var(--ink); color: #fff; }
.badge.outline { background: transparent; box-shadow: inset 0 0 0 1px var(--hairline-strong); }
.badge.FLASH, .badge.SEV1 { background: var(--flash); color: #fff; }
.badge.IMMEDIATE, .badge.SEV2 { background: var(--immediate); color: #2a1700; }
.badge.PRIORITY, .badge.SEV3 { background: var(--accent-soft); color: var(--accent); }
.badge.ROUTINE, .badge.SEV4 { background: var(--sunken); color: var(--muted); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--radius-pill); font-size: 12.5px;
  font-weight: 500; background: var(--canvas); color: var(--ink); font-family: var(--mono); letter-spacing: 0; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 12.5px; font-weight: 600;
  color: #fff; background: linear-gradient(160deg, var(--kq-blue-400), var(--kq-blue-600)); flex: 0 0 auto; position: relative; }
.avatar.lg { width: 64px; height: 64px; font-size: 22px; } .avatar.sm { width: 26px; height: 26px; font-size: 10.5px; }
.avatar.online::after { content: ""; position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border-radius: 50%; background: #30d158; box-shadow: 0 0 0 2px #fff; }

.flashes { display: grid; gap: 8px; margin-bottom: 22px; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: 14px; font-size: 14px; background: var(--surface); box-shadow: var(--shadow-sm); }
.alert.success { background: var(--ok-bg); color: #0d5a39; }
.alert.error { background: var(--danger-bg); color: #8d1d22; }
.alert.info { background: var(--accent-soft); color: var(--accent-ink); }
.alert.warn { background: var(--warn-bg); color: #6b4500; }

.empty { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty .i { font-size: 30px; width: auto; color: var(--faint); margin-bottom: 12px; display: block; }
.empty h3 { margin-bottom: 4px; }

.fileicon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft);
  color: var(--accent); font: 700 10px/1 var(--mono); text-transform: uppercase; flex: 0 0 auto; }
.fileicon.pdf { background: #ffecec; color: #d63a3f; } .fileicon.xlsx, .fileicon.csv { background: #e8f6ee; color: #1a8f5c; }
.fileicon.docx { background: #e9f0ff; color: #2459f5; } .fileicon.pptx { background: #fff1e5; color: #c45a00; }
.fileicon.png, .fileicon.jpg, .fileicon.jpeg, .fileicon.webp, .fileicon.svg { background: #f3ecff; color: #7a3ee0; }

.resource { display: flex; gap: 12px; padding: 12px; border-radius: 14px; color: inherit; align-items: center; }
.resource:hover { background: var(--canvas); text-decoration: none; }
.resource .ic { width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.resource b { color: var(--ink); display: block; font-size: 14px; font-weight: 600; }
.resource span { color: var(--muted); font-size: 13px; }

.product { padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.product .logo { width: 48px; height: 48px; border-radius: 13px; display: grid; place-items: center; color: #fff; font: 700 17px var(--font-display);
  background: linear-gradient(160deg, var(--kq-navy-700), var(--kq-navy-950)); }

progress { width: 100%; height: 6px; border: 0; border-radius: 99px; overflow: hidden; background: var(--sunken); appearance: none; -webkit-appearance: none; }
progress::-webkit-progress-bar { background: var(--sunken); border-radius: 99px; }
progress::-webkit-progress-value { background: var(--accent); border-radius: 99px; }
progress::-moz-progress-bar { background: var(--accent); border-radius: 99px; }
progress.warn::-webkit-progress-value { background: var(--immediate); } progress.warn::-moz-progress-bar { background: var(--immediate); }
progress.danger::-webkit-progress-value { background: var(--flash); } progress.danger::-moz-progress-bar { background: var(--flash); }

.tabs { display: inline-flex; gap: 2px; padding: 3px; background: rgba(0, 0, 0, .06); border-radius: var(--radius-pill); margin-bottom: 20px; flex-wrap: wrap; }
.tabs a { padding: 6px 16px; color: var(--ink); font-weight: 500; font-size: 13.5px; border-radius: var(--radius-pill); }
.tabs a.active { background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .12); font-weight: 600; }
.tabs a:hover { text-decoration: none; }

details.box { border-radius: 14px; background: var(--canvas); }
details.box > summary { cursor: pointer; padding: 12px 16px; font-weight: 600; color: var(--ink); list-style: none; display: flex; align-items: center; gap: 8px; }
details.box > summary::-webkit-details-marker { display: none; }
details.box > .in { padding: 0 16px 16px; }

/* ---------------------------------------------------------------- permission matrix */
.matrix { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.matrix fieldset { border: 0; border-radius: var(--radius-lg); padding: 8px 6px 10px; margin: 0; background: var(--surface); box-shadow: var(--shadow); min-width: 0; }
.matrix legend { float: left; width: 100%; padding: 10px 12px 6px; font-weight: 650; color: var(--ink); font-size: 15px; }
.perm { display: grid; grid-template-columns: 20px 1fr auto; gap: 10px; align-items: start; padding: 9px 12px; margin: 0; border-radius: 10px; font-weight: 400; cursor: pointer; clear: both; }
.perm:hover { background: var(--canvas); }
.perm input { margin-top: 3px; accent-color: var(--accent); width: 16px; height: 16px; }
.perm code { font-size: 12.5px; color: var(--ink); font-weight: 600; }
.perm .d { font-size: 12.5px; color: var(--muted); }
.perm.inherited { cursor: default; } .perm.inherited code { color: var(--muted); }

/* ---------------------------------------------------------------- kanban */
.board { display: grid; grid-template-columns: repeat(4, minmax(240px, 1fr)); gap: 16px; overflow-x: auto; padding-bottom: 6px; }
.col { background: rgba(0, 0, 0, .035); border-radius: var(--radius-lg); padding: 12px; min-height: 220px; }
.col h3 { display: flex; align-items: center; gap: 8px; padding: 4px 6px 12px; text-transform: capitalize; }
.task { background: var(--surface); border-radius: 14px; padding: 14px; margin-bottom: 10px; box-shadow: var(--shadow-sm), 0 0 0 1px var(--hairline); }
.task .t { font-weight: 600; color: var(--ink); margin-bottom: 8px; }
.task .meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 12.5px; color: var(--muted); }
.task form { margin-top: 10px; display: flex; gap: 6px; }
.task select { min-height: 30px; padding: 4px 10px; font-size: 13px; border-radius: var(--radius-pill); }

/* ---------------------------------------------------------------- chat */
.chat { display: grid; grid-template-columns: 270px minmax(0, 1fr) 270px; height: calc(100vh - var(--topbar-h)); margin: -36px -40px -80px; background: var(--surface); }
.chat .chans { overflow-y: auto; padding: 16px 12px; background: var(--canvas); }
.chat .chans .grp { font-size: 12px; color: var(--faint); font-weight: 600; padding: 14px 10px 6px; }
.chat .chans a { display: flex; align-items: center; gap: 9px; padding: 7px 10px; border-radius: 9px; color: var(--ink); font-size: 14px; }
.chat .chans a.active { background: #fff; box-shadow: var(--shadow-sm); font-weight: 600; }
.chat .chans a:hover { text-decoration: none; background: rgba(0, 0, 0, .04); }
.chat .room { display: flex; flex-direction: column; min-width: 0; }
.chat .room .hd { display: flex; align-items: center; gap: 10px; padding: 14px 22px; box-shadow: 0 1px 0 var(--hairline); flex-wrap: wrap; }
.chat .room .hd h2 { flex: 1; font-size: 17px; }
.chat .stream { flex: 1; overflow-y: auto; padding: 18px 16px; }
.msg { display: flex; gap: 12px; padding: 10px 12px; border-radius: 14px; }
.msg:hover { background: var(--canvas); }
.msg .body { min-width: 0; flex: 1; }
.msg .head { display: flex; gap: 8px; align-items: center; font-size: 12.5px; flex-wrap: wrap; }
.msg .head b { color: var(--ink); font-size: 14px; }
.msg .text { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 2px; }
.msg.FLASH { background: #fff1f0; } .msg.IMMEDIATE { background: #fff7ea; }
.msg.system .text { color: var(--muted); }
.composer { padding: 12px 16px 16px; }
.composer textarea { min-height: 48px; max-height: 200px; border-radius: 16px; }
.composer .row { margin-top: 8px; flex-wrap: wrap; }
.composer select { width: auto; min-height: 32px; padding: 4px 12px; font-size: 13px; border-radius: var(--radius-pill); }
.chat .side { overflow-y: auto; padding: 18px; background: var(--canvas); }
.typing { font-size: 12.5px; color: var(--muted); height: 18px; padding: 0 24px; }
.chans-toggle { display: none; }

/* ---------------------------------------------------------------- auth */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(400px, .9fr); background: var(--surface); }
.auth-art { position: relative; overflow: hidden; color: #f5f5f7; padding: 48px 56px; display: flex; flex-direction: column;
  background: radial-gradient(70% 55% at 80% 15%, rgba(46, 107, 255, .5), transparent 60%),
              radial-gradient(55% 45% at 10% 95%, rgba(34, 211, 238, .16), transparent 60%), var(--kq-navy-950); }
.auth-art img.logo { height: 32px; width: auto; align-self: flex-start; }
.auth-art .pitch { margin-top: auto; max-width: 560px; }
.auth-art .pitch .eyebrow { color: var(--kq-cyan-400); }
.auth-art .pitch h1 { color: #fff; font-size: 48px; line-height: 1.05; letter-spacing: -0.035em; }
.auth-art .pitch p { color: rgba(245, 245, 247, .7); font-size: 18px; margin-top: 16px; }
.auth-art .ticker { margin-top: 34px; display: flex; gap: 32px; color: rgba(245, 245, 247, .55); font-size: 13px; }
.auth-art .ticker b { display: block; color: #fff; font: 650 20px var(--font-display); }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 40px 28px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card .mark { height: 34px; width: auto; margin-bottom: 28px; display: block; }
.auth-card h2 { font-size: 28px; margin-bottom: 8px; letter-spacing: -0.03em; }
.auth-card > p.muted { margin-bottom: 26px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 12.5px; margin: 24px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--hairline); }
.gbtn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 48px; border-radius: var(--radius-pill);
  background: var(--ink); color: #fff; font: 500 16px var(--font); }
.gbtn:hover { opacity: .9; text-decoration: none; }
.secure-note { display: flex; gap: 8px; align-items: center; margin-top: 26px; font-size: 12.5px; color: var(--muted); }
.qr { width: 196px; height: 196px; border-radius: 16px; padding: 10px; background: #fff; box-shadow: var(--shadow); display: block; }

/* ---------------------------------------------------------------- signing */
.signing { display: grid; grid-template-columns: minmax(0, 1fr) 400px; height: 100vh; }
.signing .doc { display: flex; flex-direction: column; min-width: 0; background: #2c2c2e; }
.signing .doc .bar { display: flex; align-items: center; gap: 12px; padding: 12px 20px; background: #1c1c1e; color: #f5f5f7; }
.signing .doc .bar img { height: 22px; }
.signing .doc .bar .t { flex: 1; font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.signing iframe { flex: 1; width: 100%; border: 0; }
.signing .panel { background: var(--surface); padding: 32px 28px; overflow-y: auto; }
.signature-preview { font: italic 500 30px/1.2 "Snell Roundhand", "Apple Chancery", "Segoe Script", "Brush Script MT", cursive;
  color: var(--accent); min-height: 52px; padding: 8px 12px; margin: 4px 0 18px; background: var(--canvas); border-radius: var(--radius); }
.steps { display: flex; gap: 6px; margin-bottom: 20px; }
.steps span { width: 8px; height: 8px; border-radius: 50%; background: var(--sunken); }
.steps span.on { background: var(--accent); }

.centered { min-height: 100vh; display: grid; place-items: center; padding: 28px; }
.centered .card { width: 100%; max-width: 540px; }
.centered .card > .bd { padding: 36px; }

.kv { display: grid; grid-template-columns: 150px 1fr; gap: 10px 16px; font-size: 14px; margin: 0; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; color: var(--ink); min-width: 0; overflow-wrap: anywhere; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 16px 26px; font-size: 14px; }
.timeline li::before { content: ""; position: absolute; left: 4px; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }

mark { background: #fff3a8; color: inherit; padding: 0 2px; border-radius: 4px; }
.snippet { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.answer { white-space: pre-wrap; line-height: 1.65; font-size: 15.5px; }
.bars { display: flex; align-items: flex-end; gap: 8px; height: 80px; }
.bars div { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; text-align: center; font-size: 12px; color: var(--muted); }
.bars i { display: block; background: var(--accent); border-radius: 6px; margin-bottom: 6px; min-height: 3px; }
.b0 { height: 3px; } .b1 { height: 10%; } .b2 { height: 20%; } .b3 { height: 30%; } .b4 { height: 40%; } .b5 { height: 50%; }
.b6 { height: 60%; } .b7 { height: 70%; } .b8 { height: 80%; } .b9 { height: 90%; } .b10 { height: 100%; }

/* ---------------------------------------------------------------- code repositories */
.repo-path { font: 600 15px var(--mono); letter-spacing: 0; overflow-wrap: anywhere; }
.tree { list-style: none; margin: 0; padding: 4px 8px 8px; }
.tree li a { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; color: var(--ink); font-size: 14px; }
.tree li a:hover { background: var(--canvas); text-decoration: none; }
.tree li a .i { color: var(--muted); } .tree li a .dir { color: var(--accent); }
.tree li a .sz { margin-left: auto; color: var(--faint); font-size: 12.5px; }
.code { margin: 0; overflow-x: auto; font: 13px/1.6 var(--mono); letter-spacing: 0; background: #fbfbfd; border-radius: 0 0 var(--radius-lg) var(--radius-lg); counter-reset: ln; padding: 10px 0; }
.code .ln { display: block; padding: 0 18px 0 0; white-space: pre; }
.code .ln::before { counter-increment: ln; content: counter(ln); display: inline-block; width: 56px; padding-right: 16px; text-align: right; color: #b0b0b5; user-select: none; }
.code .ln.add { background: #ebfaef; } .code .ln.del { background: #fdeeee; } .code .ln.hunk { color: var(--accent); background: var(--accent-soft); }
.code.diff .ln::before { content: ""; width: 16px; }
.readme { font-size: 15px; line-height: 1.65; white-space: pre-wrap; }

/* ---------------------------------------------------------------- brand kit */
.swatch { border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); background: #fff; }
.swatch svg { display: block; width: 100%; height: 88px; }
.swatch .meta { padding: 10px 12px; font-size: 12.5px; }
.swatch .meta b { display: block; color: var(--ink); font-size: 13px; }
.logo-tile { border-radius: 16px; display: grid; place-items: center; height: 120px; padding: 20px; }
.logo-tile.light { background: var(--canvas); } .logo-tile.dark { background: var(--kq-navy-950); }
.logo-tile img { max-height: 48px; max-width: 100%; }

/* ---------------------------------------------------------------- events */
.event-card { overflow: hidden; display: flex; flex-direction: column; color: inherit; transition: transform .2s; }
.event-card:hover { text-decoration: none; transform: translateY(-2px); }
.event-card .cover { aspect-ratio: 16 / 9; display: grid; place-items: center; color: #fff;
  background: radial-gradient(80% 120% at 100% 0%, rgba(46, 107, 255, .55), transparent 60%), var(--kq-navy-950); }
.event-card .cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.event-card .cover .date { text-align: center; font-family: var(--font-display); }
.event-card .cover .date b { display: block; font-size: 40px; line-height: 1; }
.event-card .cover .date span { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; opacity: .75; }
.event-card .body { padding: 18px 20px 20px; }
.event-hero { border-radius: 24px; overflow: hidden; aspect-ratio: 21 / 8; margin-bottom: 24px; display: grid; place-items: center; color: #fff;
  background: radial-gradient(80% 140% at 100% 0%, rgba(46, 107, 255, .55), transparent 60%), var(--kq-navy-950); }
.event-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.event-hero h1 { color: #fff; font-size: 44px; text-align: center; padding: 0 24px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.gallery a { display: block; border-radius: 14px; overflow: hidden; aspect-ratio: 1; background: var(--canvas); }
.gallery img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.gallery a:hover img { transform: scale(1.04); }

/* ---------------------------------------------------------------- utilities (CSP forbids inline styles) */
.mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }
.my-16 { margin: 16px 0; } .my-tl { margin: 22px 0 26px; }
.pad-xl { padding: 80px 20px !important; }
.mw-520 { max-width: 520px; margin-left: auto; margin-right: auto; }
.logo-34 { height: 34px; width: auto; display: block; margin-bottom: 20px; }
.break { word-break: break-all; }
.w-auto { width: auto !important; } .w-120 { width: 120px !important; } .w-160 { width: 160px !important; } .w-220 { width: 220px !important; }
.gap-20 { gap: 20px; } .top { align-items: flex-start; } .grow { flex: 1; min-width: 0; } .pre { white-space: pre-wrap; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1100px) {
  .g4 { grid-template-columns: repeat(2, 1fr); } .g3 { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: 1fr; }
  .chat { grid-template-columns: 240px 1fr; } .chat .side { display: none; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 84vw; max-width: 300px; transform: translateX(-105%);
    transition: transform .28s cubic-bezier(.2, .8, .2, 1); background: rgba(250, 250, 252, .97); box-shadow: var(--shadow-lg); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .3); z-index: 35; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 0 12px; gap: 8px; }
  .topbar .search { max-width: none; }
  .usermenu .who { display: none; }
  .flash-pill { padding: 0 10px; font-size: 0; gap: 0; } .flash-pill .dot { width: 9px; height: 9px; }
  .content { padding: 22px 16px 60px; }
  h1 { font-size: 27px; } .hero { padding: 28px 22px; border-radius: 20px; } .hero h1 { font-size: 30px; } .hero p { font-size: 15.5px; }
  .page-head { margin-bottom: 20px; } .page-head p { font-size: 15px; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .card > .hd { padding: 18px 18px 6px; } .card > .bd { padding: 12px 18px 18px; }
  .list > li { padding: 11px 10px; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; } .kv dd { margin-bottom: 8px; }
  .board { grid-template-columns: repeat(4, 82vw); scroll-snap-type: x mandatory; } .col { scroll-snap-align: start; }
  .chat { grid-template-columns: 1fr; margin: -22px -16px -60px; height: calc(100dvh - var(--topbar-h)); }
  .chat .chans { display: none; } .chat.show-chans .chans { display: block; } .chat.show-chans .room { display: none; }
  .chans-toggle { display: inline-flex; }
  .auth-wrap { grid-template-columns: 1fr; } .auth-art { display: none; }
  .signing { grid-template-columns: 1fr; height: auto; } .signing iframe { height: 62vh; } .signing .panel { padding: 24px 18px; }
  .event-hero { aspect-ratio: 16 / 9; } .event-hero h1 { font-size: 28px; }
  .table th, .table td { padding: 10px; }
  input, select, textarea { font-size: 16px; } /* stops iOS zoom on focus */
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------------------------------------------------------------- sub-tabs */
[data-panel] { display: none; }
[data-panel].on { display: block; }
.no-js [data-panel] { display: block; }
.tabs.sticky { position: sticky; top: calc(var(--topbar-h) + 10px); z-index: 10; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
@media (max-width: 860px) { .tabs { display: flex; flex-wrap: nowrap; overflow-x: auto; max-width: 100%; scrollbar-width: none; } .tabs a { white-space: nowrap; } }

/* ---------------------------------------------------------------- pager (shared by every list) */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px 16px; flex-wrap: wrap; }
.pager .count { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pager .pages { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: var(--radius-pill); background: rgba(0, 0, 0, .05); }
.pager .pg { min-width: 32px; height: 30px; padding: 0 10px; display: inline-grid; place-items: center; border-radius: var(--radius-pill);
  font-size: 13.5px; font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums; }
.pager a.pg:hover { background: rgba(255, 255, 255, .8); text-decoration: none; }
.pager .pg.on { background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .12); font-weight: 650; }
.pager .pg.off { color: var(--faint); }
.pager .gap { padding: 0 4px; color: var(--faint); }
.pager .pg .fa-solid { font-size: 11px; }
@media (max-width: 860px) { .pager { justify-content: center; } .pager .count { width: 100%; text-align: center; } }

/* ---------------------------------------------------------------- polish fixes */
.topbar .menu-btn { display: none; }
.list > li { flex-wrap: nowrap; }
.list .grow { min-width: 0; }
.split > *, .stack, .row > .tabs { min-width: 0; max-width: 100%; }
.bd.tight { display: grid; gap: 2px; }
@media (max-width: 860px) {
  .topbar .menu-btn { display: inline-flex; }
  .topbar .search { min-width: 0; }
  .list > li { flex-wrap: wrap; }
  .list .grow { min-width: 55%; }
  .chat .side .list > li { flex-wrap: nowrap; }
}
.email-preview { width: 100%; height: 760px; border: 0; border-radius: 14px; background: #f5f5f7; }
