/* NEWERA — interface styles. Dark by default, light via [data-theme="light"]. */
:root {
  --bg: #0B1020;
  --bg-2: #0E1428;
  --surface: #121A30;
  --surface-2: #172039;
  --surface-3: #1D2744;
  --line: #232E4D;
  --line-2: #2E3A5E;
  --text: #E9EDF7;
  --text-2: #BCC4DA;
  --muted: #8791AF;
  --accent: #FFB020;
  --accent-2: #FFD166;
  --accent-ink: #1B1300;
  --accent-text: #FFC24D;
  --accent-soft: rgba(255, 176, 32, .12);
  --info: #8B97FF;
  --info-soft: rgba(139, 151, 255, .14);
  --ok: #37D28A;
  --ok-soft: rgba(55, 210, 138, .13);
  --warn: #FFB020;
  --danger: #FF6170;
  --danger-soft: rgba(255, 97, 112, .13);
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 12px 32px -18px rgba(0,0,0,.7);
  --shadow-lg: 0 24px 64px -20px rgba(0,0,0,.75);
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 18px;
  --side-w: 256px;
  --top-h: 68px;
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans Malayalam', 'Noto Sans', Arial, sans-serif;
  --display: 'Sora', 'Manrope', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #F3F5FA;
  --bg-2: #FFFFFF;
  --surface: #FFFFFF;
  --surface-2: #F5F7FC;
  --surface-3: #ECF0F8;
  --line: #E2E7F1;
  --line-2: #D3DAE8;
  --text: #0E1528;
  --text-2: #33405E;
  --muted: #647091;
  --accent: #FFAE1A;
  --accent-2: #FFC94D;
  --accent-ink: #1B1300;
  --accent-text: #A36400;
  --accent-soft: rgba(255, 160, 0, .14);
  --info: #4F5BD5;
  --info-soft: rgba(79, 91, 213, .1);
  --ok: #138A55;
  --ok-soft: rgba(19, 138, 85, .1);
  --danger: #D8323F;
  --danger-soft: rgba(216, 50, 63, .09);
  --shadow: 0 1px 2px rgba(14, 21, 40, .05), 0 10px 28px -18px rgba(14, 21, 40, .28);
  --shadow-lg: 0 28px 70px -24px rgba(14, 21, 40, .35);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 500 15px/1.55 var(--font);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  min-height: 100vh; min-height: 100dvh;
}
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }
h1, h2, h3, h4 { font-family: var(--display); letter-spacing: -.02em; margin: 0; line-height: 1.2; font-weight: 600; }
p { margin: 0 0 .75em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--accent); color: var(--accent-ink); }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.i.sm { width: 16px; height: 16px; }
.i.lg { width: 24px; height: 24px; }
.logo-mark { width: 32px; height: 32px; flex: none; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.stack { display: grid; gap: 14px; }
.hidden { display: none !important; }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ---------- Boot ---------- */
.boot { min-height: 100vh; display: grid; place-items: center; }
.boot-mark .logo-mark { width: 52px; height: 52px; animation: pulse 1.4s ease-in-out infinite; }
.boot-msg { color: var(--muted); text-align: center; }
@keyframes pulse { 50% { transform: scale(.92); opacity: .7; } }

/* ---------- Buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--surface-2); color: var(--text); font-weight: 600; font-size: 14px;
  white-space: nowrap; transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: var(--surface-3); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.danger { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.btn.danger:hover { background: var(--danger); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn.block { width: 100%; }
.btn.lg { height: 48px; font-size: 15px; border-radius: 12px; }
.icon-btn {
  width: 38px; height: 38px; display: inline-grid; place-items: center; flex: none;
  border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--text-2);
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.sm { width: 30px; height: 30px; border-radius: 8px; }
.icon-btn.on { color: var(--accent-text); }
.icon-btn.danger:hover { color: var(--danger); background: var(--danger-soft); }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.field { display: grid; gap: 6px; }
.field > label, .label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field .hint { font-size: 12.5px; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; height: 42px; padding: 0 13px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--line-2); color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; min-height: 110px; padding: 11px 13px; resize: vertical; line-height: 1.55; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input::placeholder, .textarea::placeholder { color: var(--muted); }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 18px, calc(100% - 13px) 18px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.input-wrap { position: relative; }
.input-wrap .input { padding-right: 44px; }
.input-wrap .icon-btn { position: absolute; right: 3px; top: 2px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 14px; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.switch { position: relative; width: 42px; height: 24px; flex: none; }
.switch input { opacity: 0; position: absolute; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--line-2); transition: background .2s; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.field > .seg { justify-self: start; max-width: 100%; }
.seg { display: inline-flex; padding: 3px; gap: 3px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line); }
.seg button { border: 0; background: transparent; color: var(--text-2); height: 34px; padding: 0 14px; border-radius: 8px; font-weight: 600; font-size: 13.5px; display: inline-flex; align-items: center; gap: 7px; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
[data-theme="dark"] .seg button.on { background: var(--surface-3); }
.form-error { display: none; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: var(--danger-soft); color: var(--danger); font-size: 13.5px; font-weight: 600; }
.form-error.show { display: flex; }
.meter { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: var(--danger); transition: width .25s, background .25s; }

/* ---------- Auth screens ---------- */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.auth-art {
  position: relative; overflow: hidden; padding: 44px; display: flex; flex-direction: column; justify-content: space-between;
  background: #0A0F1E; color: #E9EDF7; isolation: isolate;
}
.auth-art::before {
  content: ''; position: absolute; left: 50%; bottom: -46vh; width: 110vh; height: 110vh; transform: translateX(-50%);
  border-radius: 50%; background: radial-gradient(circle at 50% 50%, rgba(255, 176, 32, .55), rgba(255, 159, 28, .12) 45%, transparent 68%);
  z-index: -1; animation: rise 2.4s cubic-bezier(.2, .7, .2, 1) both;
}
.auth-art::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 22%; height: 1px; background: linear-gradient(90deg, transparent, rgba(255, 209, 102, .6), transparent); z-index: -1;
}
@keyframes rise { from { transform: translate(-50%, 18%); opacity: 0; } }
.brand { display: flex; align-items: center; gap: 11px; }
.wordmark { font-family: var(--display); font-weight: 700; font-size: 22px; letter-spacing: -.035em; }
.auth-art h1 { margin-bottom: 14px; font-size: clamp(30px, 3.4vw, 46px); font-weight: 600; letter-spacing: -.035em; max-width: 12ch; line-height: 1.08; }
.auth-art p { color: #A9B2CC; max-width: 38ch; font-size: 16px; }
.auth-foot { color: #6E7896; font-size: 13px; }
.auth-form { display: grid; place-items: center; padding: 40px 24px; background: var(--bg); }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h2 { font-size: 26px; margin-bottom: 6px; }
.auth-card .sub { color: var(--muted); margin-bottom: 26px; }
.auth-card form { display: grid; gap: 16px; }
.auth-card.wide { max-width: 520px; }
.steps { display: flex; gap: 6px; margin-bottom: 22px; }
.steps i { height: 4px; flex: 1; border-radius: 4px; background: var(--line); }
.steps i.on { background: var(--accent); }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.side {
  position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column;
  background: var(--bg-2); border-right: 1px solid var(--line); padding: 18px 14px 14px; z-index: 40;
}
.side .brand { padding: 4px 8px 20px; }
.side .brand .company { display: block; font-size: 12px; color: var(--muted); font-weight: 600; margin-top: -2px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav { display: grid; gap: 2px; align-content: start; overflow-y: auto; flex: 1; margin: 0 -6px; padding: 0 6px; }
.nav-group { font-size: 12px; color: var(--muted); font-weight: 600; padding: 16px 10px 6px; display: flex; align-items: center; gap: 6px; }
.nav a {
  display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 10px; border-radius: 10px;
  color: var(--text-2); font-weight: 600; font-size: 14px; text-decoration: none; position: relative;
}
.nav a:hover { background: var(--surface); color: var(--text); }
.nav a.on { background: var(--surface-2); color: var(--text); }
.nav a.on::before { content: ''; position: absolute; left: -6px; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--accent); }
.nav a.on .i { color: var(--accent-text); }
.nav .count { margin-left: auto; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.side-foot { border-top: 1px solid var(--line); margin: 10px -14px 0; padding: 12px 14px 0; }
.me { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 12px; width: 100%; background: transparent; border: 0; text-align: left; }
.me:hover { background: var(--surface); }
.me b { display: block; font-size: 14px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me small { color: var(--muted); font-size: 12px; }
.avatar {
  width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; flex: none;
  font-family: var(--display); font-weight: 600; font-size: 13.5px; letter-spacing: 0;
  background: var(--info-soft); color: var(--info);
}
.avatar.admin { background: var(--accent-soft); color: var(--accent-text); }
.avatar.lg { width: 56px; height: 56px; border-radius: 16px; font-size: 20px; }

.side-backdrop { display: none; }
.main-wrap { min-width: 0; display: flex; flex-direction: column; }
.top {
  position: sticky; top: 0; z-index: 30; height: var(--top-h); display: flex; align-items: center; gap: 14px;
  padding: 0 28px; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.hello { min-width: 0; }
.hello b { font-family: var(--display); font-weight: 600; font-size: 17px; letter-spacing: -.02em; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hello small { color: var(--muted); font-size: 12.5px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-trigger {
  margin-left: auto; width: min(420px, 42vw); height: 42px; display: flex; align-items: center; gap: 10px; padding: 0 8px 0 14px;
  border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); color: var(--muted); font-weight: 500; font-size: 14px; text-align: left;
}
.search-trigger:hover { border-color: var(--accent); color: var(--text-2); }
.search-trigger span { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
kbd { font: 600 11.5px/1 var(--font); padding: 4px 6px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--muted); }
.top-actions { display: flex; align-items: center; gap: 4px; }
.menu-btn { display: none; }
.role-badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 99px; font-size: 11.5px; font-weight: 700; background: var(--info-soft); color: var(--info); }
.role-badge.admin { background: var(--accent-soft); color: var(--accent-text); }

.main { padding: 28px 28px 110px; width: 100%; max-width: 1320px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 26px; }
.page-head p { color: var(--muted); margin: 4px 0 0; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.section { margin-top: 30px; }
.section-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.section-head h2 { font-size: 16px; font-weight: 600; }
.section-head .i { color: var(--muted); }
.section-head .more { margin-left: auto; font-size: 13px; font-weight: 600; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.panel-pad { padding: 20px; }
.panel-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.panel-head h3 { font-size: 15px; }
.panel-head .actions { margin-left: auto; display: flex; gap: 6px; }

/* ---------- Home hero ---------- */
.hero {
  position: relative; overflow: hidden; border-radius: 22px; padding: 30px 30px 26px; margin-bottom: 8px;
  background: linear-gradient(180deg, var(--surface), var(--surface)); border: 1px solid var(--line); isolation: isolate;
}
.hero::before {
  content: ''; position: absolute; right: -120px; top: -260px; width: 520px; height: 520px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 176, 32, .32), rgba(255, 176, 32, 0) 62%); z-index: -1;
}
.hero .date { color: var(--muted); font-size: 13.5px; font-weight: 600; }
.hero h1 { font-size: clamp(26px, 3vw, 36px); margin: 4px 0 18px; letter-spacing: -.035em; }
.ask {
  display: flex; align-items: center; gap: 10px; max-width: 720px; padding: 6px 6px 6px 16px; border-radius: 14px;
  background: var(--bg); border: 1px solid var(--line-2);
}
[data-theme="light"] .ask { background: var(--surface-2); }
.ask:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ask .i { color: var(--accent-text); }
.ask input { flex: 1; min-width: 0; border: 0; background: transparent; height: 42px; outline: none; font-size: 15px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; min-height: 32px; padding: 5px 12px; border-radius: 99px; text-align: left; line-height: 1.3;
  border: 1px solid var(--line-2); background: transparent; color: var(--text-2); font-size: 13px; font-weight: 600;
}
.chip:hover { border-color: var(--accent); color: var(--text); }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip .n { font-size: 11.5px; opacity: .7; }
.notice {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; margin-top: 18px;
  background: var(--accent-soft); color: var(--text); font-size: 14px;
}
.notice .i { color: var(--accent-text); margin-top: 1px; }
.notice.info { background: var(--info-soft); }
.notice.info .i { color: var(--info); }
.notice.danger { background: var(--danger-soft); }
.notice.danger .i { color: var(--danger); }
.notice b { display: block; }

/* ---------- Item cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(236px, 1fr)); gap: 12px; }
.cards.compact { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.card {
  position: relative; display: flex; align-items: center; gap: 12px; min-height: 72px; padding: 13px 14px; min-width: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); color: var(--text); text-decoration: none;
  transition: border-color .15s, background .15s;
}
a.card:hover, .card.link:hover { border-color: var(--line-2); background: var(--surface-2); text-decoration: none; }
.card .body { min-width: 0; flex: 1; }
.card .name { display: block; font-weight: 700; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .desc { display: block; color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .tools { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); display: flex; gap: 2px; padding: 2px; border-radius: 9px; background: var(--surface-3); box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity .15s; }
.card:hover .tools, .card:focus-within .tools { pointer-events: auto; }
.card:hover .tools, .card:focus-within .tools { opacity: 1; }
.card .pin-dot { position: absolute; top: 8px; right: 8px; color: var(--accent-text); }
.card .pin-dot .i { width: 13px; height: 13px; }
.fav {
  width: 40px; height: 40px; border-radius: 11px; flex: none; display: grid; place-items: center; overflow: hidden;
  background: var(--surface-3); border: 1px solid var(--line); font-family: var(--display); font-weight: 600; font-size: 14px; color: var(--text-2);
}
.fav img { width: 22px; height: 22px; object-fit: contain; }
.fav.prompt { background: var(--info-soft); color: var(--info); border-color: transparent; }
.fav.doc { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.dept-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.dept { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px; }
.dept-head { display: flex; align-items: center; gap: 10px; padding: 2px 2px 10px; }
.dept-head .ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); }
.dept-head h3 { font-size: 14.5px; font-family: var(--font); font-weight: 700; letter-spacing: 0; }
.dept-head .n { color: var(--muted); font-size: 12.5px; margin-left: auto; }
.dept-list { display: grid; gap: 6px; }
.dept-list .card { min-height: 56px; padding: 9px 10px; border-radius: 10px; background: var(--surface-2); border-color: transparent; }
.dept-list .card:hover { border-color: var(--line-2); }
.dept-list .fav { width: 34px; height: 34px; border-radius: 9px; }
.dept-empty { color: var(--muted); font-size: 13px; padding: 10px 4px 4px; }

.prompt-card { display: flex; flex-direction: column; gap: 10px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.prompt-card h3 { font-size: 15px; font-family: var(--font); font-weight: 700; letter-spacing: 0; display: flex; gap: 8px; align-items: center; }
.prompt-card .text { color: var(--text-2); font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap; }
.prompt-card .foot { display: flex; gap: 6px; align-items: center; margin-top: auto; flex-wrap: wrap; }
.prompt-card .foot .admin-tools { margin-left: auto; display: flex; gap: 2px; }
.prompt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; background: var(--surface-3); color: var(--text-2); font-size: 12px; font-weight: 600; }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.danger { background: var(--danger-soft); color: var(--danger); }
.tag.accent { background: var(--accent-soft); color: var(--accent-text); }
.tag.info { background: var(--info-soft); color: var(--info); }

.empty { text-align: center; padding: 42px 20px; border: 1px dashed var(--line-2); border-radius: var(--r-lg); color: var(--muted); }
.empty .i { width: 32px; height: 32px; color: var(--text-2); margin-bottom: 8px; }
.empty b { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }
.empty .btn { margin-top: 14px; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.filter-input { position: relative; flex: 1; min-width: 220px; max-width: 420px; }
.filter-input .i { position: absolute; left: 12px; top: 11px; color: var(--muted); }
.filter-input .input { padding-left: 40px; }

/* ---------- Knowledge ---------- */
.doc-list { display: grid; gap: 8px; }
.doc-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); cursor: pointer; text-align: left; width: 100%; color: var(--text); }
.doc-row:hover { border-color: var(--line-2); background: var(--surface-2); }
.doc-row .body { flex: 1; min-width: 0; }
.doc-row b { display: block; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-row small { color: var(--muted); font-size: 12.5px; }
.snippet { color: var(--text-2); font-size: 13px; margin-top: 3px; display: block; }
mark { background: var(--accent-soft); color: var(--accent-text); border-radius: 3px; padding: 0 1px; }
.dropzone { border: 1.5px dashed var(--line-2); border-radius: var(--r-lg); padding: 26px; text-align: center; color: var(--muted); transition: border-color .15s, background .15s; }
.dropzone.drag { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.dropzone .i { width: 30px; height: 30px; color: var(--accent-text); }
.upload-list { display: grid; gap: 6px; margin-top: 12px; }
.upload-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; background: var(--surface-2); font-size: 13.5px; }
.upload-item .st { margin-left: auto; font-size: 12.5px; font-weight: 600; }
.reader { white-space: pre-wrap; font-size: 14px; line-height: 1.7; color: var(--text-2); max-height: 62vh; overflow: auto; padding-right: 6px; }

/* ---------- Chat ---------- */
.chat-page { height: calc(100vh - var(--top-h) - 56px); height: calc(100dvh - var(--top-h) - 56px); min-height: 460px; }
.chat { display: flex; flex-direction: column; height: 100%; min-height: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.chat-head .av { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); }
.chat-head b { display: block; font-size: 14.5px; }
.chat-head small { color: var(--muted); font-size: 12px; }
.chat-head .tools { margin-left: auto; display: flex; gap: 2px; }
.msgs { flex: 1; overflow-y: auto; padding: 20px 18px; display: flex; flex-direction: column; gap: 16px; scroll-behavior: smooth; }
.msg { display: flex; gap: 10px; max-width: 100%; }
.msg .bubble { padding: 11px 14px; border-radius: 14px; font-size: 14.5px; line-height: 1.6; min-width: 0; overflow-wrap: anywhere; }
.msg.user { justify-content: flex-end; }
.msg.user .bubble { background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 4px; max-width: 82%; white-space: pre-wrap; font-weight: 600; }
.msg.ai .bubble { background: var(--surface-2); border: 1px solid var(--line); border-bottom-left-radius: 4px; max-width: 92%; }
.msg.ai .av { width: 28px; height: 28px; border-radius: 8px; flex: none; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); margin-top: 2px; }
.msg.ai .av .i { width: 16px; height: 16px; }
.msg.err .bubble { background: var(--danger-soft); border-color: transparent; color: var(--danger); font-weight: 600; }
.md p { margin: 0 0 .6em; }
.md p:last-child, .md ul:last-child, .md ol:last-child { margin-bottom: 0; }
.md ul, .md ol { margin: .2em 0 .7em; padding-left: 1.25em; }
.md li { margin: .15em 0; }
.md code { font: 13px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--surface-3); padding: 1px 5px; border-radius: 5px; }
.md pre { background: var(--bg); border: 1px solid var(--line); padding: 12px; border-radius: 10px; overflow-x: auto; margin: .4em 0 .8em; }
.md pre code { background: none; padding: 0; }
.md h4 { font-family: var(--font); font-size: 14.5px; font-weight: 800; margin: .6em 0 .3em; letter-spacing: 0; }
.md a { word-break: break-all; }
.msg-foot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.src { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 9px; border-radius: 7px; border: 1px solid var(--line-2); background: transparent; font-size: 12px; font-weight: 600; color: var(--text-2); max-width: 220px; }
.src span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.src:hover { border-color: var(--accent); color: var(--text); }
.typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.chat-empty { margin: auto; text-align: center; max-width: 440px; padding: 10px; }
.chat-empty .big { width: 52px; height: 52px; border-radius: 16px; display: inline-grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); margin-bottom: 12px; }
.chat-empty h3 { font-size: 19px; margin-bottom: 6px; }
.chat-empty p { color: var(--muted); font-size: 14px; }
.suggest { display: grid; gap: 8px; margin-top: 16px; text-align: left; }
.suggest button { padding: 11px 14px; border-radius: 11px; border: 1px solid var(--line-2); background: transparent; color: var(--text-2); font-size: 13.5px; font-weight: 600; text-align: left; }
.suggest button:hover { border-color: var(--accent); color: var(--text); }
.composer { display: flex; align-items: flex-end; gap: 8px; padding: 12px; border-top: 1px solid var(--line); background: var(--surface); }
.composer textarea { flex: 1; resize: none; min-height: 44px; max-height: 180px; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface-2); outline: none; line-height: 1.5; }
.composer textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.composer .send { width: 44px; height: 44px; border-radius: 12px; border: 0; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; flex: none; }
.composer .send:disabled { opacity: .45; cursor: not-allowed; }
.composer .send.stop { background: var(--surface-3); color: var(--text); }
.chat-note { font-size: 11.5px; color: var(--muted); text-align: center; padding: 0 12px 10px; background: var(--surface); }

.fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 50; height: 52px; padding: 0 20px 0 16px; border-radius: 16px; border: 0;
  display: inline-flex; align-items: center; gap: 9px; font-weight: 700; font-size: 14.5px;
  background: var(--accent); color: var(--accent-ink); box-shadow: 0 16px 36px -12px rgba(255, 159, 28, .6);
  transition: transform .15s;
}
.fab:hover { transform: translateY(-2px); }
.drawer {
  position: fixed; right: 22px; bottom: 22px; z-index: 60; width: min(440px, calc(100vw - 32px)); height: min(680px, calc(100dvh - 44px));
  display: none; box-shadow: var(--shadow-lg); border-radius: var(--r-lg);
}
.drawer.open { display: block; animation: pop .18s ease-out; }
@keyframes pop { from { transform: translateY(12px) scale(.98); opacity: 0; } }

/* ---------- Tables ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12.5px; font-weight: 700; color: var(--muted); padding: 11px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface-2); }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr.click { cursor: pointer; }
.table tbody tr.click:hover td { background: var(--surface-2); }
.table .user-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.table .user-cell b { display: block; font-size: 14px; }
.table .user-cell small { color: var(--muted); font-size: 12.5px; }
.table td.actions { text-align: right; white-space: nowrap; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); margin-right: 6px; vertical-align: middle; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.pager { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.pager .btn { margin-left: 4px; }
.pager .first { margin-left: auto; }

/* ---------- Admin overview ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat { padding: 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.stat .k { color: var(--muted); font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 7px; }
.stat .v { font-family: var(--display); font-size: 30px; font-weight: 600; letter-spacing: -.03em; margin-top: 6px; }
.stat .s { font-size: 12.5px; color: var(--muted); }
.two-col { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 14px; margin-top: 14px; align-items: start; }
.chart { width: 100%; height: 210px; display: block; }
.chart .bar-a { fill: var(--accent); }
.chart .bar-b { fill: var(--info); }
.chart text { fill: var(--muted); font-size: 11px; font-family: var(--font); font-weight: 600; }
.chart .grid { stroke: var(--line); stroke-dasharray: 3 4; }
.legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.feed { display: grid; }
.feed-row { display: flex; gap: 12px; padding: 11px 20px; border-bottom: 1px solid var(--line); font-size: 13.5px; align-items: flex-start; }
.feed-row:last-child { border-bottom: 0; }
.feed-row .ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); flex: none; }
.feed-row .ic .i { width: 15px; height: 15px; }
.feed-row .t { color: var(--muted); font-size: 12px; margin-left: auto; white-space: nowrap; padding-left: 8px; }
.feed-row .what { min-width: 0; }
.feed-row .what small { display: block; color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; }
.checklist { display: grid; gap: 2px; }
.check-row { display: flex; align-items: center; gap: 12px; padding: 12px 20px; font-size: 14px; }
.check-row .ic { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--ok-soft); color: var(--ok); }
.check-row.todo .ic { background: var(--accent-soft); color: var(--accent-text); }
.check-row .ic .i { width: 14px; height: 14px; }
.check-row small { display: block; color: var(--muted); font-size: 12.5px; }
.check-row .btn { margin-left: auto; }
.bar-list { display: grid; gap: 12px; padding: 16px 20px; }
.bar-item { display: grid; gap: 6px; font-size: 13.5px; }
.bar-item .row { justify-content: space-between; }
.bar-track { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.bar-track i { display: block; height: 100%; border-radius: 6px; background: var(--accent); }

/* ---------- Settings ---------- */
.settings { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 22px; align-items: start; }
.tabs { display: grid; gap: 2px; position: sticky; top: calc(var(--top-h) + 20px); }
.tabs .group { font-size: 12px; color: var(--muted); font-weight: 600; padding: 14px 12px 6px; }
.tabs button { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px; border-radius: 10px; border: 0; background: transparent; color: var(--text-2); font-weight: 600; font-size: 14px; text-align: left; }
.tabs button:hover { background: var(--surface); color: var(--text); }
.tabs button.on { background: var(--surface-2); color: var(--text); }
.tabs button.on .i { color: var(--accent-text); }
.set-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); margin-bottom: 16px; }
.set-card > header { padding: 18px 22px 0; }
.set-card > header h3 { font-size: 16px; }
.set-card > header p { color: var(--muted); font-size: 13.5px; margin: 4px 0 0; }
.set-body { padding: 18px 22px 22px; display: grid; gap: 16px; }
.set-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; align-items: center; }
.set-row { display: flex; align-items: center; gap: 16px; justify-content: space-between; }
.set-row .txt b { display: block; font-size: 14px; }
.set-row .txt small { color: var(--muted); font-size: 13px; }
.theme-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.theme-card { border: 1.5px solid var(--line-2); border-radius: 14px; padding: 10px; background: transparent; text-align: left; color: var(--text); }
.theme-card.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.theme-card .pv { height: 74px; border-radius: 9px; margin-bottom: 9px; display: grid; grid-template-columns: 28% 1fr; overflow: hidden; border: 1px solid var(--line); }
.theme-card .pv.dark { background: #121A30; }
.theme-card .pv.dark i { background: #0E1428; }
.theme-card .pv.light { background: #FFFFFF; }
.theme-card .pv.light i { background: #F3F5FA; }
.theme-card .pv.sys { background: linear-gradient(90deg, #121A30 50%, #FFFFFF 50%); }
.theme-card .pv.sys i { background: transparent; }
.theme-card .pv b { margin: 12px; height: 8px; border-radius: 4px; background: #FFB020; width: 50%; }
.theme-card span { font-weight: 700; font-size: 14px; display: flex; gap: 7px; align-items: center; }
.key-box { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13.5px; }
.key-box code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
.dept-edit { display: grid; gap: 8px; }
.dept-edit .row { background: var(--surface-2); border-radius: 10px; padding: 6px 6px 6px 10px; }
.dept-edit .input, .dept-edit .select { height: 36px; }
.dept-edit .select { max-width: 150px; }
.sec-list { display: grid; gap: 10px; }
.sec-item { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; }
.sec-item .ic { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--ok-soft); color: var(--ok); }
.sec-item.warn .ic { background: var(--accent-soft); color: var(--accent-text); }
.sec-item .ic .i { width: 14px; height: 14px; }
.sec-item small { display: block; color: var(--muted); font-size: 12.5px; }

/* ---------- Modal, menu, toast ---------- */
.overlay { position: fixed; inset: 0; z-index: 100; background: rgba(4, 7, 16, .62); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); display: grid; place-items: center; padding: 20px; animation: fade .15s ease-out; }
[data-theme="light"] .overlay { background: rgba(14, 21, 40, .35); }
@keyframes fade { from { opacity: 0; } }
.modal { width: 100%; max-width: 520px; max-height: calc(100dvh - 40px); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-lg); animation: pop .18s ease-out; }
.modal.wide { max-width: 760px; }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px 14px; }
.modal-head h3 { font-size: 18px; }
.modal-head p { color: var(--muted); font-size: 13.5px; margin: 2px 0 0; }
.modal-head .icon-btn { margin-left: auto; }
.modal-body { padding: 4px 20px 20px; overflow-y: auto; display: grid; gap: 14px; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--line); align-items: center; }
.modal-foot .left { margin-right: auto; }
.cred { display: grid; gap: 8px; padding: 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); font-size: 14px; }
.cred code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13.5px; }

.pop-menu { position: fixed; z-index: 120; min-width: 220px; padding: 6px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow-lg); animation: pop .12s ease-out; }
.pop-menu .hd { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.pop-menu .hd b { display: block; font-size: 14px; }
.pop-menu .hd small { color: var(--muted); font-size: 12.5px; }
.pop-menu button { width: 100%; display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 10px; border: 0; border-radius: 9px; background: transparent; color: var(--text-2); font-weight: 600; font-size: 14px; text-align: left; }
.pop-menu button:hover { background: var(--surface-2); color: var(--text); }
.pop-menu button.danger:hover { color: var(--danger); background: var(--danger-soft); }

#toast-root { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 200; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-radius: 12px; background: var(--text); color: var(--bg); font-weight: 700; font-size: 14px; box-shadow: var(--shadow-lg); animation: pop .18s ease-out; pointer-events: auto; max-width: min(520px, calc(100vw - 32px)); }
.toast.err { background: var(--danger); color: #fff; }
.toast .i { width: 18px; height: 18px; }

/* ---------- Command palette ---------- */
.palette-wrap { align-items: start; padding-top: 10vh; }
.palette { width: 100%; max-width: 680px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 20px; box-shadow: var(--shadow-lg); overflow: hidden; display: flex; flex-direction: column; max-height: 76vh; animation: pop .15s ease-out; }
.palette-top { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.palette-top .i { color: var(--accent-text); }
.palette-top input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; font-size: 17px; height: 32px; }
.palette-filters { display: flex; gap: 6px; padding: 10px 16px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.palette-filters::-webkit-scrollbar { display: none; }
.palette-filters .chip { height: 28px; flex: none; }
.palette-list { overflow-y: auto; padding: 6px 8px 10px; flex: 1; }
.p-group { font-size: 12px; color: var(--muted); font-weight: 700; padding: 12px 10px 5px; display: flex; justify-content: space-between; }
.p-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 10px; border-radius: 11px; border: 0; background: transparent; color: var(--text); text-align: left; }
.p-item.sel { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--accent); }
.p-item .fav { width: 34px; height: 34px; border-radius: 9px; }
.p-item .body { flex: 1; min-width: 0; }
.p-item b { display: block; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-item small { display: block; color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-item .kind { font-size: 11.5px; color: var(--muted); font-weight: 700; flex: none; }
.p-item .go { color: var(--muted); opacity: 0; }
.p-item.sel .go { opacity: 1; }
.palette-foot { display: flex; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); font-weight: 600; flex-wrap: wrap; }
.palette-foot span { display: inline-flex; gap: 6px; align-items: center; }
.p-empty { padding: 36px 20px; text-align: center; color: var(--muted); }
.p-empty b { display: block; color: var(--text); margin-bottom: 4px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two-col { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: min(290px, 86vw); transform: translateX(-102%); transition: transform .22s ease; box-shadow: var(--shadow-lg); }
  .side.open { transform: none; }
  .side-backdrop { position: fixed; inset: 0; z-index: 35; background: rgba(4, 7, 16, .55); }
  .side-backdrop.open { display: block; }
  .menu-btn { display: inline-grid; margin-left: -8px; }
  .top { padding: 0 16px; gap: 8px; }
  .search-trigger { width: 42px; padding: 0; justify-content: center; margin-left: auto; }
  .search-trigger span, .search-trigger kbd { display: none; }
  .main { padding: 20px 16px 110px; }
  .settings { grid-template-columns: minmax(0, 1fr); }
  .tabs { position: static; display: flex; overflow-x: auto; gap: 6px; padding-bottom: 4px; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs .group { display: none; }
  .tabs button { flex: none; background: var(--surface); border: 1px solid var(--line); height: 38px; }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-art { min-height: 220px; padding: 26px 24px; }
  .auth-art h1 { font-size: 28px; max-width: 16ch; }
  .auth-art p, .auth-foot { display: none; }
  .auth-art::before { bottom: -80vh; }
}
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .hero { padding: 22px 18px 18px; border-radius: 18px; }
  .page-head h1 { font-size: 22px; }
  .page-head .actions { margin-left: 0; width: 100%; }
  .cards, .cards.compact, .dept-grid, .prompt-grid { grid-template-columns: minmax(0, 1fr); }
  .card .tools { opacity: 1; position: static; transform: none; background: transparent; box-shadow: none; pointer-events: auto; }
  .stats { gap: 10px; }
  .stat { padding: 14px; }
  .stat .v { font-size: 24px; }
  .theme-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .theme-card .pv { height: 52px; }
  .hello small { display: none; }
  .fab { right: 16px; bottom: 16px; padding: 0; width: 54px; justify-content: center; }
  .fab span { display: none; }
  .drawer { inset: 0; width: 100%; height: 100%; border-radius: 0; }
  .drawer .chat { border-radius: 0; border: 0; }
  .chat-page { height: calc(100dvh - var(--top-h) - 40px); }
  .overlay { padding: 0; align-items: end; }
  .modal { max-width: none; border-radius: 20px 20px 0 0; max-height: 92dvh; }
  .palette-wrap { padding-top: 0; align-items: start; }
  .palette { border-radius: 0 0 20px 20px; max-height: 88dvh; }
  .palette-foot { display: none; }
  .table.responsive thead { display: none; }
  .table.responsive tr { display: grid; grid-template-columns: 1fr auto; padding: 12px 14px; border-bottom: 1px solid var(--line); gap: 4px 10px; }
  .table.responsive td { border: 0; padding: 0; }
  .table.responsive td[data-label]:not(.first)::before { content: attr(data-label) ': '; color: var(--muted); font-size: 12px; }
  .table.responsive td.first { grid-column: 1 / -1; }
  .table.responsive td.actions { grid-column: 2; grid-row: 1; }
  .table.responsive td.hide-m { display: none; }
  .feed-row { padding: 10px 14px; }
  .set-body { padding: 16px; }
  .set-card > header { padding: 16px 16px 0; }
  .set-foot { padding: 12px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print { .side, .top, .fab, .drawer { display: none !important; } }
