/* ============================================================
   慧涛 · 剧本协作空间
   视觉：深林绿 / 暖纸白 / 旧金
   ============================================================ */

:root {
  --forest-950: #07251d;
  --forest-900: #0c3026;
  --forest-850: #103a2e;
  --forest-800: #154436;
  --forest-700: #1d5544;
  --forest-600: #2b6a55;
  --forest-500: #3d8068;
  --sage: #8ba496;
  --cream-50: #fcfbf6;
  --cream-100: #f5f3ea;
  --cream-150: #f0eee4;
  --cream-200: #e9e6d9;
  --cream-300: #ded9c9;
  --paper: #fffdf8;
  --ink: #18261f;
  --ink-soft: #3e4c44;
  --muted: #788078;
  --muted-light: #9aa198;
  --line: #e5e1d3;
  --line-strong: #d4cebc;
  --gold: #b39458;
  --gold-soft: #eadfc7;
  --amber: #a96f2b;
  --amber-soft: #f8edda;
  --red: #a94f43;
  --red-soft: #f8e8e3;
  --green: #2f7458;
  --green-soft: #e6f1ea;
  --shadow-xs: 0 1px 2px rgba(24, 38, 31, .04);
  --shadow-sm: 0 5px 18px rgba(24, 38, 31, .06);
  --shadow-md: 0 16px 50px rgba(18, 44, 34, .13);
  --shadow-lg: 0 30px 80px rgba(7, 37, 29, .24);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --font-body: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Noto Sans CJK SC", system-ui, -apple-system, sans-serif;
  --font-display: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", "SimSun", serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--cream-100);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.modal-open { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
::selection { background: #d9e6dc; color: var(--forest-950); }
:focus-visible { outline: 2px solid var(--forest-600); outline-offset: 2px; }
[hidden] { display: none !important; }

.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.icon-sm { width: 15px; height: 15px; }
.icon-lg { width: 22px; height: 22px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------- generic components ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary {
  background: var(--forest-850);
  color: #fbf8ef;
  box-shadow: 0 8px 20px rgba(12, 48, 38, .16);
}
.btn-primary:hover { background: var(--forest-700); box-shadow: 0 10px 24px rgba(12, 48, 38, .22); }
.btn-secondary { background: var(--paper); border-color: var(--line-strong); color: var(--ink-soft); }
.btn-secondary:hover { border-color: var(--forest-600); color: var(--forest-800); background: #fff; }
.btn-ghost { color: var(--ink-soft); border-color: transparent; }
.btn-ghost:hover { background: var(--cream-150); color: var(--forest-800); }
.btn-gold { background: var(--gold-soft); color: #6d5425; border-color: #decfad; }
.btn-gold:hover { background: #e3d4b4; }
.btn-danger { background: var(--red-soft); color: var(--red); border-color: #ebcfc7; }
.btn-danger:hover { background: #f3dcd6; }
.btn-sm { height: 32px; padding: 0 11px; border-radius: 8px; font-size: 12px; gap: 6px; }
.btn-xs { height: 27px; padding: 0 9px; border-radius: 7px; font-size: 11.5px; gap: 4px; }
.btn-lg { height: 46px; padding: 0 22px; font-size: 14px; border-radius: 11px; }
.btn-block { width: 100%; }
.btn .icon { width: 16px; height: 16px; }
.btn-sm .icon { width: 14px; height: 14px; }
.btn.loading { pointer-events: none; opacity: .72; }
.btn.loading::before {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.btn.loading > .icon { display: none; }

.icon-btn {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  transition: .18s ease;
}
.icon-btn:hover { background: var(--cream-150); color: var(--forest-800); }
.icon-btn.bordered { border-color: var(--line); background: var(--paper); }
.icon-btn.danger:hover { background: var(--red-soft); color: var(--red); }
.icon-btn.loading .icon { animation: spin .7s linear infinite; }

.eyebrow {
  display: block;
  margin-bottom: 9px;
  color: #9b8a66;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
}
.muted { color: var(--muted); }
.tiny { font-size: 11px; }
.text-danger { color: var(--red); }
.text-green { color: var(--green); }

.avatar {
  width: 34px;
  height: 34px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--cream-200);
  color: var(--forest-800);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  border: 1px solid rgba(24, 38, 31, .07);
}
.avatar.sm { width: 26px; height: 26px; font-size: 11px; }
.avatar.lg { width: 44px; height: 44px; font-size: 18px; }
.avatar.green { background: #dfece4; color: #245642; }
.avatar.gold { background: #f3ead7; color: #775d2d; }
.avatar.rose { background: #f4e5e0; color: #8b5142; }
.avatar.slate { background: #e6eaec; color: #445a66; }
.avatar.violet { background: #eae5f1; color: #5b4a79; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 8px;
  border-radius: 5px;
  background: var(--cream-150);
  color: #666d65;
  font-size: 10.5px;
  white-space: nowrap;
}
.chip.tag { border: 1px solid #e8e3d4; background: #fbf9f2; color: #70776f; }
.chip.tag::before { content: "#"; opacity: .45; }
.chip.gold { background: var(--gold-soft); color: #745c2c; }
.chip.green { background: var(--green-soft); color: var(--green); }

.status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .01em;
  white-space: nowrap;
}
.status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-available { background: var(--green-soft); color: #2c6e53; }
.status-pending { background: var(--amber-soft); color: #986323; }
.status-claimed { background: #ecece5; color: #5f685f; }
.status-confirmed { background: var(--green-soft); color: #2c6e53; }
.status-rejected { background: var(--red-soft); color: var(--red); }
.status-cancelled, .status-released { background: #eeede6; color: #7d837b; }

.rule { height: 1px; background: var(--line); border: 0; margin: 0; }

/* ---------- boot ---------- */
.boot-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background:
    radial-gradient(circle at 50% 40%, rgba(255, 253, 247, .9), transparent 42%),
    var(--cream-100);
}
.boot-mark {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--forest-850);
  color: #f8f0dc;
  font-family: var(--font-display);
  font-size: 28px;
  box-shadow: var(--shadow-md);
}
.boot-name {
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 700;
  letter-spacing: .2em;
  padding-left: .2em;
}
.boot-line { width: 108px; height: 2px; overflow: hidden; background: var(--cream-300); border-radius: 9px; }
.boot-line span { display: block; width: 48%; height: 100%; background: var(--forest-700); animation: boot-slide 1.4s ease-in-out infinite; }
.boot-screen p { color: var(--muted-light); font-size: 11.5px; letter-spacing: .08em; }
.noscript { position: fixed; inset: 0; display: grid; place-items: center; background: var(--cream-100); z-index: 999; }

/* ---------- login ---------- */
.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(500px, 1.08fr) minmax(440px, .92fr);
  background: var(--cream-100);
}
.login-visual {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  padding: 42px 54px 34px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: #f4f0e4;
  background:
    radial-gradient(circle at 14% 10%, rgba(197, 164, 98, .17), transparent 34%),
    radial-gradient(circle at 88% 84%, rgba(60, 120, 94, .22), transparent 42%),
    linear-gradient(148deg, #0a2a21 0%, #103a2e 56%, #0b3026 100%);
}
.login-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  opacity: .22;
  background-image:
    linear-gradient(rgba(255, 255, 255, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .055) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, #000, transparent 88%);
}
.login-visual::after {
  content: "";
  position: absolute;
  width: 460px;
  height: 460px;
  right: -170px;
  top: -170px;
  border: 1px solid rgba(222, 201, 158, .18);
  border-radius: 50%;
  box-shadow: 0 0 0 55px rgba(222, 201, 158, .035), 0 0 0 110px rgba(222, 201, 158, .02);
  z-index: -1;
}
.login-brand { display: flex; align-items: center; gap: 12px; position: relative; z-index: 2; }
.brand-mark {
  width: 42px;
  height: 42px;
  flex: none;
  position: relative;
  display: grid;
  place-items: center;
  border: 1px solid rgba(238, 224, 193, .36);
  border-radius: 11px;
  background: rgba(255, 253, 246, .06);
  color: #f4ecd9;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .025);
}
.brand-mark::after {
  content: "";
  position: absolute;
  right: 7px;
  bottom: 7px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold);
}
.brand-word { display: flex; flex-direction: column; gap: 1px; }
.brand-name {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: .15em;
  color: #f8f3e5;
  line-height: 1.2;
}
.brand-sub { font-size: 8.5px; letter-spacing: .28em; color: rgba(244, 240, 228, .46); }
.brand-sub em { font-style: normal; letter-spacing: .17em; }
.login-hero { position: relative; z-index: 2; margin-top: clamp(70px, 12vh, 138px); }
.login-hero .eyebrow { color: #c9ae76; font-size: 9px; letter-spacing: .32em; margin-bottom: 22px; }
.login-hero h1 {
  max-width: 520px;
  font-family: var(--font-display);
  font-size: clamp(46px, 4.7vw, 66px);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: .015em;
  color: #f7f1e2;
}
.login-hero h1 em { color: #d8bd84; font-style: normal; }
.login-hero p {
  max-width: 410px;
  margin-top: 22px;
  color: rgba(238, 235, 223, .66);
  font-size: 13.5px;
  line-height: 2;
  letter-spacing: .04em;
}
.login-art { position: relative; flex: 1; min-height: 210px; margin: 12px 0 6px; z-index: 2; }
.paper-card {
  position: absolute;
  left: 26px;
  top: 22px;
  width: 286px;
  min-height: 198px;
  padding: 23px 24px 20px;
  border-radius: 3px;
  color: #314137;
  background:
    linear-gradient(105deg, rgba(255, 255, 255, .55), transparent 30%),
    #eee9da;
  box-shadow: 0 22px 50px rgba(0, 0, 0, .28);
  transform: rotate(-2.5deg);
}
.paper-card::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(61, 76, 65, .15);
  pointer-events: none;
}
.paper-card::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .4;
  background-image: repeating-linear-gradient(0deg, transparent 0 24px, rgba(71, 62, 43, .045) 24px 25px);
  pointer-events: none;
}
.paper-head { display: flex; justify-content: space-between; font-size: 8px; letter-spacing: .16em; color: #8f8a76; position: relative; z-index: 1; }
.paper-title {
  position: relative;
  z-index: 1;
  margin-top: 18px;
  font-family: var(--font-display);
  font-size: 27px;
  font-weight: 700;
  letter-spacing: .12em;
}
.paper-tags { position: relative; z-index: 1; display: flex; gap: 5px; margin-top: 7px; }
.paper-tags span { padding: 2px 5px; border: 1px solid rgba(49, 65, 55, .18); color: #637165; font-size: 7px; letter-spacing: .06em; }
.paper-lines { position: relative; z-index: 1; margin-top: 16px; display: grid; gap: 6px; }
.paper-lines i { display: block; height: 2px; background: rgba(49, 65, 55, .16); }
.paper-lines i:nth-child(1) { width: 92%; }
.paper-lines i:nth-child(2) { width: 80%; }
.paper-lines i:nth-child(3) { width: 87%; }
.paper-lines i:nth-child(4) { width: 55%; }
.paper-stamp {
  position: absolute;
  right: 25px;
  bottom: 20px;
  z-index: 1;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1.5px solid rgba(151, 74, 54, .45);
  border-radius: 50%;
  color: rgba(151, 74, 54, .62);
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: .06em;
  transform: rotate(9deg);
}
.art-note {
  position: absolute;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 8px;
  background: rgba(255, 253, 247, .075);
  color: rgba(247, 242, 229, .78);
  font-size: 9.5px;
  letter-spacing: .05em;
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .12);
}
.art-note b { color: #e5cf9e; font-size: 13px; font-family: var(--font-display); font-weight: 600; }
.art-note::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: #c4a667; }
.art-note.one { left: 388px; top: 30px; }
.art-note.two { left: 410px; top: 100px; }
.art-note.three { left: 326px; top: 214px; }
.art-orbit {
  position: absolute;
  left: 58px;
  top: 0;
  width: 370px;
  height: 240px;
  border: 1px solid rgba(213, 191, 148, .12);
  border-radius: 50%;
  transform: rotate(-14deg);
  pointer-events: none;
}
.art-orbit::after {
  content: "";
  position: absolute;
  right: 18px;
  top: 37px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 22px rgba(201, 172, 113, .7);
}
.login-foot {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 22px;
  border-top: 1px solid rgba(238, 232, 213, .11);
  color: rgba(238, 233, 218, .38);
  font-size: 9px;
  letter-spacing: .13em;
}
.login-foot .dots { display: flex; gap: 5px; }
.login-foot .dots i { width: 3px; height: 3px; border-radius: 50%; background: rgba(238, 233, 218, .32); }

.login-panel {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px clamp(28px, 6vw, 88px);
  position: relative;
  background:
    radial-gradient(circle at 100% 0%, rgba(218, 207, 181, .28), transparent 38%),
    var(--cream-100);
}
.login-panel::after {
  content: "HUITAO  /  SCRIPT COLLABORATION";
  position: absolute;
  right: 28px;
  bottom: 26px;
  color: #b5ae9d;
  font-size: 7.5px;
  letter-spacing: .25em;
}
.login-form { width: min(396px, 100%); position: relative; z-index: 1; }
.login-form .eyebrow { margin-bottom: 14px; }
.login-form h2 {
  font-family: var(--font-display);
  font-size: 35px;
  font-weight: 700;
  letter-spacing: .025em;
  line-height: 1.25;
}
.login-intro { margin-top: 9px; color: var(--muted); font-size: 12.5px; letter-spacing: .02em; }
.login-fields { margin-top: 38px; display: grid; gap: 17px; }
.login-field label { display: block; margin-bottom: 8px; color: #586259; font-size: 11.5px; font-weight: 600; letter-spacing: .04em; }
.input-wrap { position: relative; }
.input-wrap > .icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #9da39a;
  width: 17px;
  height: 17px;
  pointer-events: none;
}
.input-wrap input {
  width: 100%;
  height: 48px;
  padding: 0 14px 0 42px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: rgba(255, 253, 248, .85);
  font-size: 13.5px;
  transition: .18s ease;
}
.input-wrap input::placeholder { color: #b1b4ab; }
.input-wrap input:focus { outline: none; border-color: var(--forest-600); box-shadow: 0 0 0 3px rgba(43, 106, 85, .09); background: #fff; }
.login-submit { margin-top: 26px; height: 48px; border-radius: 10px; letter-spacing: .08em; }
.login-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 15px; color: var(--muted-light); font-size: 10.5px; }
.login-meta .lockline { display: flex; align-items: center; gap: 5px; }
.login-meta .icon { width: 12px; height: 12px; }
.login-hint {
  margin-top: 26px;
  padding: 13px 15px;
  border: 1px solid #e3dcc9;
  border-radius: 10px;
  background: rgba(250, 247, 238, .8);
  color: #7f7968;
  font-size: 10.5px;
  line-height: 1.8;
}
.login-hint b { color: #5f5a4b; font-weight: 600; }
.login-hint code {
  padding: 1px 5px;
  border-radius: 4px;
  background: #ebe4d4;
  color: #5d5139;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 10px;
}
.login-error {
  display: none;
  align-items: flex-start;
  gap: 7px;
  margin-top: 16px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 11.5px;
  line-height: 1.6;
}
.login-error.show { display: flex; }
.login-error .icon { width: 14px; height: 14px; margin-top: 2px; }
.login-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 28px;
  color: #9b8a66;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .18em;
}
.login-badge::before { content: ""; width: 18px; height: 1px; background: #c5b18a; }

/* ---------- app shell ---------- */
.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  width: 248px;
  padding: 0 15px 15px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  color: rgba(246, 242, 230, .72);
  background:
    radial-gradient(circle at 20% 0%, rgba(192, 159, 94, .12), transparent 30%),
    radial-gradient(circle at 100% 88%, rgba(55, 113, 87, .24), transparent 45%),
    linear-gradient(172deg, #0b2d24 0%, #0d3328 52%, #08271f 100%);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .15) transparent;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .15); border-radius: 9px; }
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 8px 25px;
  flex: none;
}
.sidebar-brand .brand-mark { width: 40px; height: 40px; font-size: 21px; }
.sidebar-brand .brand-name { font-size: 23px; }
.sidebar-brand .brand-sub { font-size: 8px; }
.workspace-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px 10px 10px;
  color: rgba(240, 235, 220, .33);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: .2em;
  border-top: 1px solid rgba(240, 235, 220, .09);
}
.workspace-label span:last-child { letter-spacing: .06em; color: rgba(200, 174, 118, .55); }
.side-nav { display: flex; flex-direction: column; gap: 2px; margin-top: 5px; }
.nav-section-label {
  padding: 19px 12px 7px;
  color: rgba(240, 235, 220, .29);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: .16em;
}
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 41px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: rgba(245, 241, 230, .67);
  font-size: 12.5px;
  letter-spacing: .02em;
  transition: .18s ease;
}
.nav-item .icon { width: 17px; height: 17px; opacity: .8; }
.nav-item:hover { background: rgba(255, 255, 255, .055); color: #faf6e9; }
.nav-item.active {
  background: #f3efe2;
  border-color: rgba(255, 255, 255, .22);
  color: var(--forest-900);
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .16);
}
.nav-item.active .icon { opacity: 1; }
.nav-item .nav-badge {
  margin-left: auto;
  min-width: 19px;
  height: 19px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, .11);
  color: rgba(255, 255, 255, .76);
  font-size: 9.5px;
}
.nav-item.active .nav-badge { background: var(--forest-850); color: #fff; }
.nav-item .nav-dot {
  margin-left: auto;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #d3b574;
  box-shadow: 0 0 0 3px rgba(211, 181, 116, .13);
}
.sidebar-spacer { flex: 1; min-height: 24px; }
.sidebar-quote {
  padding: 18px 12px 17px;
  border-top: 1px solid rgba(240, 235, 220, .09);
  color: rgba(240, 235, 220, .36);
  font-family: var(--font-display);
  font-size: 10.5px;
  line-height: 1.9;
  letter-spacing: .08em;
}
.sidebar-quote strong { display: block; color: rgba(232, 215, 177, .57); font-weight: 400; }
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 10px;
  background: rgba(255, 255, 255, .045);
}
.sidebar-user .avatar { background: rgba(243, 238, 224, .13); color: #f2ead7; border-color: rgba(255, 255, 255, .1); }
.sidebar-user-info { min-width: 0; flex: 1; }
.sidebar-user-name { color: #f5f0e0; font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user-role { color: rgba(240, 235, 220, .36); font-size: 8.5px; letter-spacing: .07em; margin-top: 1px; }
.sidebar-user .icon-btn { color: rgba(240, 235, 220, .44); width: 28px; height: 28px; }
.sidebar-user .icon-btn:hover { color: #fff; background: rgba(255, 255, 255, .08); }

.main { min-height: 100vh; margin-left: 248px; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 64px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 34px;
  border-bottom: 1px solid rgba(211, 204, 185, .55);
  background: rgba(245, 243, 234, .88);
  backdrop-filter: blur(16px);
}
.topbar-left { display: flex; align-items: center; gap: 13px; min-width: 0; }
.menu-btn { display: none; }
.crumb {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted-light);
  font-size: 10.5px;
  letter-spacing: .03em;
  white-space: nowrap;
}
.crumb .separator { color: #c5c0af; font-size: 9px; }
.crumb strong { color: var(--ink-soft); font-weight: 500; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.system-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding-right: 15px;
  border-right: 1px solid var(--line);
  color: var(--muted);
  font-size: 9.5px;
  letter-spacing: .03em;
}
.system-status i { width: 5px; height: 5px; border-radius: 50%; background: #54a37f; box-shadow: 0 0 0 3px rgba(84, 163, 127, .13); }
.topbar-user { position: relative; }
.user-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px 4px 4px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  transition: .18s ease;
}
.user-trigger:hover { background: rgba(255, 255, 255, .65); border-color: var(--line); }
.user-trigger .avatar { width: 30px; height: 30px; font-size: 12px; }
.user-trigger-name { text-align: left; line-height: 1.2; }
.user-trigger-name b { display: block; font-size: 11px; font-weight: 600; }
.user-trigger-name span { display: block; color: var(--muted-light); font-size: 8px; margin-top: 2px; }
.user-trigger .icon { width: 13px; height: 13px; color: var(--muted-light); }
.user-menu {
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  width: 208px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--paper);
  box-shadow: var(--shadow-md);
  animation: menu-in .15s ease;
  z-index: 60;
}
.user-menu-head { padding: 9px 10px 11px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.user-menu-head b { display: block; font-size: 12px; }
.user-menu-head span { display: block; color: var(--muted); font-size: 9.5px; margin-top: 3px; }
.user-menu button, .user-menu a {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 11.5px;
  text-align: left;
}
.user-menu button:hover, .user-menu a:hover { background: var(--cream-150); }
.user-menu .icon { width: 15px; height: 15px; color: var(--muted); }
.user-menu .danger { color: var(--red); }
.user-menu .danger .icon { color: var(--red); }

.page {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 33px 38px 18px;
  flex: 1;
}
.page-footer {
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  padding: 20px 38px 26px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: #a5ab9f;
  font-size: 8.5px;
  letter-spacing: .09em;
}
.page-enter { animation: page-in .3s ease both; }

/* ---------- page heading ---------- */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 26px;
  margin-bottom: 27px;
}
.page-head h1 {
  font-family: var(--font-display);
  font-size: 35px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: .015em;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.page-head .role-chip {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border: 1px solid #ded1b3;
  border-radius: 4px;
  background: #f5eddb;
  color: #856b35;
  font-family: var(--font-body);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: .1em;
}
.page-head .page-sub { margin-top: 8px; color: var(--muted); font-size: 12px; letter-spacing: .015em; }
.head-actions { display: flex; align-items: center; gap: 9px; flex: none; padding-bottom: 2px; }
.head-actions .btn { height: 38px; }
.page-head.compact { margin-bottom: 23px; }

/* ---------- dashboard ---------- */
.security-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: -6px 0 17px;
  padding: 10px 13px;
  border: 1px solid #e6d8b7;
  border-radius: 10px;
  background: #faf4e5;
  color: #7e6b44;
}
.security-banner-icon {
  width: 27px;
  height: 27px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: #f1e5cb;
  color: #927434;
}
.security-banner-icon .icon { width: 14px; height: 14px; }
.security-banner div { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.security-banner b { color: #66532c; font-size: 10px; font-weight: 600; }
.security-banner span { font-size: 9.5px; }
.security-banner .btn { flex: none; }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
  margin-bottom: 18px;
}
.stat-card {
  position: relative;
  min-height: 118px;
  padding: 18px 19px 15px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  box-shadow: var(--shadow-xs);
}
.stat-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.stat-label { color: var(--muted); font-size: 10.5px; letter-spacing: .04em; }
.stat-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--cream-150);
  color: #6e7d72;
}
.stat-icon .icon { width: 15px; height: 15px; }
.stat-value {
  margin-top: 15px;
  font-family: var(--font-display);
  font-size: 33px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: .01em;
  font-variant-numeric: tabular-nums;
}
.stat-value small { margin-left: 4px; font-family: var(--font-body); font-size: 11px; font-weight: 500; color: var(--muted-light); }
.stat-value.words-value { font-size: 25px; letter-spacing: .02em; padding-top: 5px; }
.stat-foot { margin-top: 9px; color: var(--muted-light); font-size: 9.5px; display: flex; align-items: center; gap: 5px; }
.stat-foot em { font-style: normal; color: var(--green); font-weight: 600; }
.stat-card.primary {
  color: #f6f1e3;
  border-color: transparent;
  background:
    radial-gradient(circle at 104% -10%, rgba(201, 169, 104, .25), transparent 46%),
    linear-gradient(145deg, #103a2e, #0a2c23);
  box-shadow: 0 13px 30px rgba(10, 44, 35, .16);
}
.stat-card.primary::after {
  content: "";
  position: absolute;
  right: -35px;
  bottom: -72px;
  width: 146px;
  height: 146px;
  border: 1px solid rgba(222, 201, 158, .17);
  border-radius: 50%;
  box-shadow: 0 0 0 26px rgba(222, 201, 158, .035);
}
.stat-card.primary .stat-label { color: rgba(246, 241, 227, .58); }
.stat-card.primary .stat-icon { color: #d9c28f; background: rgba(255, 255, 255, .075); }
.stat-card.primary .stat-value small { color: rgba(246, 241, 227, .38); }
.stat-card.primary .stat-foot { color: rgba(246, 241, 227, .42); }
.stat-card.primary .stat-foot em { color: #d8c08d; }

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.58fr) minmax(315px, .82fr);
  gap: 17px;
  align-items: start;
}
.dash-col { display: flex; flex-direction: column; gap: 17px; min-width: 0; }
.panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 54px;
  padding: 0 19px;
  border-bottom: 1px solid var(--line);
}
.panel-title { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; letter-spacing: .02em; }
.panel-title .count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 19px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--cream-150);
  color: #8a8f85;
  font-size: 9px;
  font-weight: 500;
}
.panel-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border: 0;
  background: transparent;
  color: #8b9188;
  font-size: 9.5px;
}
.panel-link:hover { color: var(--forest-700); }
.panel-link .icon { width: 12px; height: 12px; }
.panel-body { padding: 8px 19px 12px; }
.panel-body.flush { padding: 0; }

.mini-table { width: 100%; border-collapse: collapse; }
.mini-table th {
  padding: 11px 7px 8px;
  color: #a4a99e;
  font-size: 8.5px;
  font-weight: 500;
  letter-spacing: .1em;
  text-align: left;
  border-bottom: 1px solid #eeeae0;
}
.mini-table th:first-child, .mini-table td:first-child { padding-left: 2px; }
.mini-table th:last-child, .mini-table td:last-child { padding-right: 2px; text-align: right; }
.mini-table td { padding: 11px 7px; border-bottom: 1px solid #f0ede4; vertical-align: middle; }
.mini-table tr:last-child td { border-bottom: 0; }
.mini-table tr[data-action] { cursor: pointer; }
.mini-table tr[data-action]:hover td { background: #fcfaf4; }
.script-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mini-cover {
  width: 30px;
  height: 37px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  background: var(--tone-soft, #e7eee9);
  color: var(--tone, #346652);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  border-left: 2px solid var(--tone, #346652);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35);
}
.script-cell-text { min-width: 0; }
.script-cell-text b { display: block; font-size: 11.5px; font-weight: 600; color: #2b382f; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 210px; }
.script-cell-text span { display: block; margin-top: 3px; color: #a0a59b; font-size: 8.5px; }
.cell-category { color: #7f877d; font-size: 9.5px; white-space: nowrap; }
.cell-date { color: #a0a59b; font-size: 9px; white-space: nowrap; }
.row-arrow { color: #c2c5ba; }
.row-arrow .icon { width: 13px; height: 13px; }

.pending-list { display: flex; flex-direction: column; }
.pending-item { padding: 13px 0; border-bottom: 1px solid #f0ede4; }
.pending-item:first-child { padding-top: 8px; }
.pending-item:last-child { border-bottom: 0; padding-bottom: 5px; }
.pending-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.pending-title { font-family: var(--font-display); font-size: 13.5px; font-weight: 700; color: #27362d; line-height: 1.4; }
.pending-by { display: flex; align-items: center; gap: 6px; margin-top: 7px; color: #8e958a; font-size: 9px; }
.pending-by .avatar { width: 20px; height: 20px; font-size: 8px; }
.pending-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.pending-time { color: #b0b4a9; font-size: 8.5px; }
.pending-actions { display: flex; gap: 5px; }
.queue-empty { padding: 28px 8px 24px; text-align: center; }
.queue-empty .empty-icon { margin: 0 auto 9px; }
.queue-empty p { color: var(--muted-light); font-size: 10px; }
.mini-more { margin-top: 7px; }

.activity-list { display: flex; flex-direction: column; padding: 3px 0 4px; }
.activity-item { position: relative; display: flex; gap: 10px; padding: 9px 0; }
.activity-item:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 30px;
  bottom: -3px;
  width: 1px;
  background: #ece9de;
}
.activity-dot {
  width: 25px;
  height: 25px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--cream-150);
  color: #728177;
  position: relative;
  z-index: 1;
}
.activity-dot .icon { width: 12px; height: 12px; }
.activity-dot.green { background: var(--green-soft); color: var(--green); }
.activity-dot.gold { background: var(--gold-soft); color: #8a6b2f; }
.activity-dot.red { background: var(--red-soft); color: var(--red); }
.activity-copy { min-width: 0; padding-top: 1px; }
.activity-copy p { color: #5d665d; font-size: 9.5px; line-height: 1.6; }
.activity-copy p b { color: #344139; font-weight: 600; }
.activity-copy time { display: block; color: #b0b4a9; font-size: 8px; margin-top: 3px; }

.category-panel .panel-body { padding: 13px 19px 17px; }
.category-row { display: grid; grid-template-columns: 66px minmax(0, 1fr) 22px; align-items: center; gap: 10px; padding: 5px 0; }
.category-name { color: #6e766d; font-size: 9.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.category-track { height: 5px; border-radius: 99px; background: #efede4; overflow: hidden; }
.category-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, #2f6b56, #7b9d8a); }
.category-fill.gold { background: linear-gradient(90deg, #ab8d53, #d4bf92); }
.category-fill.slate { background: linear-gradient(90deg, #63766e, #9fada5); }
.category-count { color: #969c90; font-size: 8.5px; text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- library ---------- */
.library-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--paper);
  box-shadow: var(--shadow-xs);
}
.search-box { position: relative; flex: 1; min-width: 210px; }
.search-box > .icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: #a4a99f; pointer-events: none; }
.search-box input {
  width: 100%;
  height: 39px;
  padding: 0 37px 0 38px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #f8f6ef;
  color: var(--ink);
  font-size: 12px;
  transition: .18s ease;
}
.search-box input::placeholder { color: #aeb2a7; }
.search-box input:focus { outline: none; background: #fff; border-color: #c9d7cd; box-shadow: 0 0 0 3px rgba(43, 106, 85, .06); }
.search-box .clear-search {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 24px; height: 24px; border: 0; border-radius: 6px; background: transparent; color: #a4a99f;
  display: grid; place-items: center;
}
.search-box .clear-search:hover { background: var(--cream-150); color: var(--ink); }
.search-box .clear-search .icon { width: 12px; height: 12px; }
.select-wrap { position: relative; flex: none; }
.select-wrap select {
  height: 39px;
  min-width: 112px;
  padding: 0 31px 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: #697268;
  font-size: 10.5px;
  appearance: none;
  cursor: pointer;
}
.select-wrap select:focus { outline: none; border-color: #b9cbbf; box-shadow: 0 0 0 3px rgba(43, 106, 85, .06); }
.select-wrap .icon { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); width: 13px; height: 13px; color: #a4a99f; pointer-events: none; }
.filter-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin: 17px 0 14px;
  flex-wrap: wrap;
}
.segmented {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid #e4dfd1;
  border-radius: 9px;
  background: #ebe8dd;
}
.segmented button {
  height: 29px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #7d847a;
  font-size: 10px;
  white-space: nowrap;
  transition: .15s ease;
}
.segmented button:hover { color: var(--forest-800); }
.segmented button.active { background: var(--paper); color: var(--forest-900); font-weight: 600; box-shadow: 0 1px 4px rgba(24, 38, 31, .1); }
.segmented button .seg-count { margin-left: 4px; color: #a5aa9e; font-size: 8.5px; }
.segmented button.active .seg-count { color: #8f9a8f; }
.filter-right { display: flex; align-items: center; gap: 9px; }
.result-count { color: #9da298; font-size: 9.5px; white-space: nowrap; }
.result-count b { color: #687267; font-weight: 600; }
.clear-filters { height: 29px; padding: 0 9px; border: 0; background: transparent; color: #9a8b6d; font-size: 9.5px; }
.clear-filters:hover { color: var(--forest-700); }
.mobile-filter-btn { display: none; }

.scripts-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.script-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 302px;
  padding: 17px 18px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--paper);
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.script-card::before {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--tone, #3b705b), transparent 90%);
  opacity: .65;
}
.script-card:hover { transform: translateY(-2px); border-color: #d1ccbb; box-shadow: 0 14px 34px rgba(28, 46, 37, .08); }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 9px; margin-bottom: 13px; }
.batch-label { display: inline-flex; align-items: center; gap: 5px; color: #a8a89a; font-size: 8px; letter-spacing: .12em; }
.batch-label::before { content: ""; width: 10px; height: 1px; background: #c9c3b3; }
.card-category { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; color: var(--tone, #4e6b5b); font-size: 9.5px; font-weight: 600; letter-spacing: .06em; }
.card-category::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--tone, #4e6b5b); box-shadow: 0 0 0 3px var(--tone-soft, #edf2ee); }
.script-card h3 {
  margin: 3px 0 8px;
  color: #22332a;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: .03em;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-synopsis {
  min-height: 50px;
  color: #858c82;
  font-size: 10.5px;
  line-height: 1.75;
  letter-spacing: .005em;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 11px; }
.card-tags .chip { height: 20px; padding: 0 7px; font-size: 8.5px; }
.card-meta {
  display: flex;
  align-items: center;
  gap: 0;
  margin-top: 13px;
  padding-top: 11px;
  border-top: 1px dashed #e8e3d6;
  color: #939a90;
  font-size: 8.5px;
  flex-wrap: wrap;
}
.card-meta span { display: inline-flex; align-items: center; gap: 4px; }
.card-meta span:not(:last-child)::after { content: "·"; margin: 0 7px; color: #c6c3b5; }
.card-meta .icon { width: 11px; height: 11px; }
.card-meta .word-meta { color: #476554; font-weight: 600; }
.card-meta .word-meta .icon { color: #6b8b78; }
.word-count-value { color: #3d5d4c !important; font-weight: 600; }
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  margin-top: auto;
  padding-top: 14px;
}
.owner-line { display: flex; align-items: center; gap: 6px; min-width: 0; color: #8d9489; font-size: 8.5px; }
.owner-line .avatar { width: 22px; height: 22px; font-size: 8px; }
.owner-line b { color: #657066; font-weight: 600; }
.owner-line .owner-status-dot { width: 5px; height: 5px; border-radius: 50%; background: #c9a665; }
.owner-line .owner-status-dot.confirmed { background: #6a9a80; }
.card-actions { display: flex; align-items: center; gap: 4px; flex: none; }
.card-actions .download-btn { width: 29px; height: 29px; }
.card-actions .btn { height: 29px; padding: 0 9px; font-size: 9.5px; border-radius: 7px; }
.card-actions .btn .icon { width: 12px; height: 12px; }
.card-actions .btn-primary { box-shadow: none; }
.script-card.is-claimed { background: #fdfcf7; }
.script-card.is-claimed h3 { color: #566157; }

.empty-state {
  grid-column: 1 / -1;
  min-height: 300px;
  padding: 48px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px dashed #d9d3c2;
  border-radius: 14px;
  background: rgba(255, 253, 248, .55);
  text-align: center;
}
.empty-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid #dfd9c9;
  border-radius: 13px;
  background: var(--paper);
  color: #93a096;
  margin-bottom: 13px;
}
.empty-icon .icon { width: 20px; height: 20px; }
.empty-state h3 { font-family: var(--font-display); font-size: 18px; letter-spacing: .03em; }
.empty-state p { max-width: 330px; margin-top: 7px; color: #9a9f94; font-size: 10.5px; line-height: 1.8; }
.empty-state .btn { margin-top: 17px; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 5px; margin-top: 24px; }
.page-btn {
  min-width: 31px;
  height: 31px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #8c9388;
  font-size: 10px;
}
.page-btn:hover:not(:disabled) { background: var(--paper); border-color: var(--line); color: var(--forest-800); }
.page-btn.active { background: var(--forest-850); color: #fff; font-weight: 600; }
.page-btn:disabled { opacity: .35; cursor: default; }
.page-btn .icon { width: 13px; height: 13px; }
.pagination-info { margin-left: 8px; color: #a5aa9e; font-size: 9px; }

/* ---------- tables / claims / users ---------- */
.table-panel { border: 1px solid var(--line); border-radius: 14px; background: var(--paper); overflow: hidden; box-shadow: var(--shadow-xs); }
.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.table-toolbar .segmented { background: #f2f0e7; }
.table-toolbar-right { display: flex; align-items: center; gap: 8px; }
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 780px; }
.data-table th {
  padding: 10px 16px;
  background: #faf8f1;
  border-bottom: 1px solid var(--line);
  color: #9ca196;
  font-size: 8.5px;
  font-weight: 500;
  letter-spacing: .08em;
  text-align: left;
  white-space: nowrap;
}
.data-table td { padding: 13px 16px; border-bottom: 1px solid #efebe1; vertical-align: middle; font-size: 10.5px; color: #5e675e; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background .15s ease; }
.data-table tbody tr:hover { background: #fcfaf4; }
.data-table .title-cell { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.data-table .title-cell b { display: block; color: #2e3d33; font-size: 11px; font-weight: 600; max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.data-table .title-cell small { display: block; margin-top: 2px; color: #a4a99e; font-size: 8.5px; }
.person-cell { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.person-cell b { display: block; color: #435146; font-size: 10px; font-weight: 600; }
.person-cell span { display: block; color: #a4a99e; font-size: 8px; margin-top: 1px; }
.table-actions { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.table-empty { padding: 48px 20px; text-align: center; color: var(--muted-light); font-size: 10.5px; }
.claim-note-preview { max-width: 185px; color: #8b9287; font-size: 9px; line-height: 1.55; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.mono-date { white-space: nowrap; color: #8c9388; font-size: 9px; font-variant-numeric: tabular-nums; }

.summary-strip { display: flex; gap: 9px; margin-bottom: 16px; flex-wrap: wrap; }
.summary-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper);
  color: #7b8378;
  font-size: 9.5px;
}
.summary-pill b { color: var(--ink); font-family: var(--font-display); font-size: 16px; line-height: 1; }
.summary-pill .dot { width: 5px; height: 5px; border-radius: 50%; background: #b3b8ac; }
.summary-pill.amber .dot { background: #c18a42; }
.summary-pill.green .dot { background: #5d9276; }

.my-claims { display: flex; flex-direction: column; gap: 10px; }
.claim-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--paper);
  transition: .18s ease;
}
.claim-card:hover { border-color: #d5cfbe; box-shadow: var(--shadow-sm); }
.claim-card-main { min-width: 0; }
.claim-card-head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.claim-card-head h3 { font-family: var(--font-display); font-size: 19px; font-weight: 700; color: #28382e; letter-spacing: .02em; }
.claim-card-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 8px; color: #92998e; font-size: 9px; }
.claim-card-meta span { display: inline-flex; align-items: center; gap: 4px; }
.claim-card-meta .icon { width: 11px; height: 11px; }
.claim-note {
  margin-top: 10px;
  padding: 8px 10px;
  border-left: 2px solid #dfd8c6;
  background: #fbf9f3;
  color: #848c81;
  font-size: 9px;
  line-height: 1.65;
}
.claim-decision { margin-top: 9px; color: #8d9489; font-size: 8.5px; line-height: 1.6; }
.claim-card-side { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: 11px; min-width: 118px; }
.claim-card-side .status { height: 22px; font-size: 9px; }
.claim-card-actions { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }

.user-role-chip { display: inline-flex; align-items: center; height: 21px; padding: 0 7px; border-radius: 4px; background: #eef0e8; color: #6e786c; font-size: 8.5px; }
.user-role-chip.admin { background: #f1e8d4; color: #80642e; }
.user-role-chip.superadmin { background: #173f32; color: #f3e6c7; border: 1px solid #2c5a47; }
.user-status { display: inline-flex; align-items: center; gap: 5px; color: #6d776d; font-size: 9px; }
.user-status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: #5d987a; }
.user-status.off { color: #a1a69b; }
.user-status.off::before { background: #c0c3b8; }
.switch { position: relative; display: inline-flex; width: 30px; height: 17px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: #d7d9cf; transition: .2s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; left: 2px; top: 2px; width: 13px; height: 13px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .15); transition: .2s; }
.switch input:checked + span { background: #5f8f77; }
.switch input:checked + span::after { transform: translateX(13px); }

/* ---------- activity page ---------- */
.activity-page-list { display: flex; flex-direction: column; }
.activity-day { display: flex; align-items: center; gap: 9px; margin: 7px 0 5px; color: #9a9f94; font-size: 9px; letter-spacing: .08em; }
.activity-day::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.activity-row { display: flex; gap: 12px; padding: 11px 0; }
.activity-row .activity-dot { width: 30px; height: 30px; }
.activity-row .activity-dot .icon { width: 14px; height: 14px; }
.activity-row-main { flex: 1; min-width: 0; }
.activity-row-main p { color: #48564b; font-size: 10.5px; line-height: 1.6; }
.activity-row-main p b { color: #26372c; font-weight: 600; }
.activity-row-main .detail { color: #8d9489; }
.activity-row-time { flex: none; color: #a9aea2; font-size: 8.5px; padding-top: 2px; }

/* ---------- modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(7, 30, 23, .5);
  backdrop-filter: blur(4px);
  animation: fade-in .16s ease;
}
.modal {
  width: min(560px, 100%);
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: var(--shadow-lg);
  animation: modal-in .22s cubic-bezier(.2, .8, .2, 1);
}
.modal.modal-lg { width: min(880px, 100%); }
.modal.modal-md { width: min(660px, 100%); }
.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 21px 24px 17px;
  border-bottom: 1px solid var(--line);
  flex: none;
}
.modal-header .eyebrow { margin-bottom: 6px; font-size: 8px; }
.modal-title { font-family: var(--font-display); font-size: 21px; font-weight: 700; line-height: 1.35; letter-spacing: .02em; }
.modal-sub { margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.6; }
.modal-close { margin-top: -3px; margin-right: -5px; flex: none; }
.modal-body { padding: 21px 24px; overflow-y: auto; }
.modal-body.tight { padding: 16px 24px; }
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 24px;
  border-top: 1px solid var(--line);
  background: #fbf9f3;
  flex: none;
  flex-wrap: wrap;
}
.modal-footer .footer-left { margin-right: auto; }
.modal-footer .btn { height: 38px; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: flex; align-items: center; gap: 4px; margin-bottom: 6px; color: #5c675e; font-size: 10.5px; font-weight: 600; }
.field label .req { color: #b56b54; }
.field .hint { margin-top: 5px; color: #a3a89c; font-size: 8.5px; line-height: 1.5; }
.field input, .field select, .field textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fefdf9;
  color: var(--ink);
  font-size: 11.5px;
  transition: .18s ease;
}
.field input, .field select { height: 39px; padding: 0 11px; }
.field select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ba196' stroke-width='1.8'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; padding-right: 30px; }
.field textarea { min-height: 100px; padding: 10px 11px; line-height: 1.7; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: #b4b6ac; }
.field input:disabled, .field select:disabled { background: #f1efe7; color: #9ca197; cursor: not-allowed; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: #9db9a9; box-shadow: 0 0 0 3px rgba(43, 106, 85, .07); background: #fff; }
.input-suffix { position: relative; }
.input-suffix input { padding-right: 36px; }
.input-suffix span { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); color: #a4a99e; font-size: 9px; pointer-events: none; }
.detected-count {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 39px;
  padding: 4px 8px;
  border: 1px solid #dcd7c8;
  border-radius: 8px;
  background: #f8f6ee;
}
.detected-mark {
  width: 26px;
  height: 26px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: #e7eee7;
  color: #4d715d;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
}
.detected-copy { min-width: 0; line-height: 1.25; }
.detected-copy b { display: block; color: #4e5f53; font-size: 10px; font-weight: 600; }
.detected-copy small { display: block; margin-top: 2px; color: #a2a79b; font-size: 8px; }
.detected-count .recount-btn { margin-left: auto; width: 26px; height: 26px; flex: none; color: #86958a; }
.detected-count .recount-btn .icon { width: 13px; height: 13px; }
.form-note { display: flex; align-items: flex-start; gap: 7px; padding: 10px 12px; border-radius: 8px; background: #f6f3e9; color: #8a8677; font-size: 9px; line-height: 1.65; }
.form-note .icon { width: 13px; height: 13px; margin-top: 1px; flex: none; }
.form-note.danger { background: var(--red-soft); color: var(--red); }
.form-note.success { background: var(--green-soft); color: var(--green); }

.file-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 122px;
  padding: 20px;
  border: 1.5px dashed #d5cebb;
  border-radius: 11px;
  background: #fbf9f2;
  text-align: center;
  cursor: pointer;
  transition: .18s ease;
}
.file-drop:hover, .file-drop.dragover { border-color: #8fae9c; background: #f5f9f4; }
.file-drop.has-file { border-style: solid; border-color: #b6cdbd; background: #f4f8f2; }
.file-drop .drop-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: #ece7d8; color: #7c887d; margin-bottom: 9px; }
.file-drop.has-file .drop-icon { background: var(--green-soft); color: var(--green); }
.file-drop b { font-size: 11px; color: #526056; font-weight: 600; }
.file-drop span { margin-top: 4px; color: #a2a79c; font-size: 9px; }
.file-drop .file-types { margin-top: 7px; color: #b0b3a8; font-size: 8px; letter-spacing: .02em; }
.file-drop input { display: none; }
.file-input-hidden { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; pointer-events: none; }
.file-selected { display: flex; align-items: center; gap: 8px; margin-top: 8px; color: #5f7f6b; font-size: 9px; word-break: break-all; }
.file-selected .icon { width: 13px; height: 13px; }

.detail-body { padding: 0; }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(245px, .85fr); gap: 0; }
.detail-main { padding: 23px 25px 25px; min-width: 0; }
.detail-side { padding: 23px 22px; background: #faf8f1; border-left: 1px solid var(--line); }
.detail-category-line { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-bottom: 12px; }
.detail-category { display: inline-flex; align-items: center; gap: 6px; color: var(--tone, #426b58); font-size: 10px; font-weight: 600; letter-spacing: .07em; }
.detail-category::before { content: ""; width: 16px; height: 1px; background: var(--tone, #426b58); }
.detail-status { margin-left: auto; }
.detail-title { font-family: var(--font-display); font-size: 31px; font-weight: 700; line-height: 1.3; letter-spacing: .025em; color: #22332a; }
.detail-writer { margin-top: 7px; color: #90978c; font-size: 9.5px; }
.detail-section { margin-top: 23px; }
.detail-section h4 { display: flex; align-items: center; gap: 7px; margin-bottom: 9px; color: #46544a; font-size: 10px; font-weight: 600; letter-spacing: .06em; }
.detail-section h4::before { content: ""; width: 2px; height: 10px; background: #b9a477; }
.synopsis-text { color: #6f786e; font-size: 11px; line-height: 2; white-space: pre-wrap; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.file-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid #e7e1d3;
  border-radius: 9px;
  background: #fdfbf5;
}
.file-row-icon { width: 31px; height: 36px; display: grid; place-items: center; border-radius: 4px; background: #e9eee7; color: #54715e; font-size: 7px; font-weight: 700; letter-spacing: .04em; }
.file-row-info { flex: 1; min-width: 0; }
.file-row-info b { display: block; color: #4b594e; font-size: 9.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row-info span { display: block; color: #a1a69b; font-size: 8px; margin-top: 2px; }
.file-row .icon-btn { background: #fff; border-color: #e3ddcf; }
.detail-history { display: flex; flex-direction: column; gap: 0; }
.history-item { position: relative; padding: 0 0 13px 18px; border-left: 1px solid #e7e2d5; margin-left: 4px; }
.history-item:last-child { border-left-color: transparent; padding-bottom: 0; }
.history-item::before { content: ""; position: absolute; left: -3px; top: 4px; width: 5px; height: 5px; border-radius: 50%; background: #b5beb2; box-shadow: 0 0 0 3px #fdfbf6; }
.history-item:first-child::before { background: #6d9a7f; }
.history-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.history-top b { color: #4c5b50; font-size: 9px; font-weight: 600; }
.history-top time { color: #adafa4; font-size: 8px; }
.history-item p { margin-top: 3px; color: #92998f; font-size: 8.5px; line-height: 1.6; }
.side-block + .side-block { margin-top: 20px; padding-top: 19px; border-top: 1px solid #e8e3d5; }
.side-block h4 { margin-bottom: 9px; color: #566257; font-size: 9px; font-weight: 600; letter-spacing: .08em; }
.meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px 12px; }
.meta-grid dt { color: #a5aa9e; font-size: 8px; margin-bottom: 3px; }
.meta-grid dd { margin: 0; color: #4e5b50; font-size: 9.5px; line-height: 1.4; word-break: break-word; }
.side-owner { display: flex; align-items: center; gap: 9px; padding: 10px; border: 1px solid #e4dece; border-radius: 9px; background: #fffdf7; }
.side-owner-info b { display: block; color: #46544a; font-size: 10px; font-weight: 600; }
.side-owner-info span { display: block; color: #a0a59a; font-size: 8px; margin-top: 2px; }
.side-claim-btn { margin-top: 10px; width: 100%; }
.side-note { margin-top: 8px; color: #a1a69a; font-size: 8px; line-height: 1.6; text-align: center; }
.side-empty { color: #a4a99e; font-size: 9px; line-height: 1.7; }
.detail-admin-bar { display: flex; gap: 6px; padding-top: 18px; margin-top: 21px; border-top: 1px dashed #e6e1d3; }
.detail-admin-bar .spacer { flex: 1; }

.confirm-summary { padding: 14px; border: 1px solid #e7e1d3; border-radius: 10px; background: #fbf9f3; }
.confirm-summary .title { font-family: var(--font-display); font-size: 18px; font-weight: 700; }
.confirm-summary .meta { display: flex; align-items: center; gap: 8px; margin-top: 7px; color: #8d9489; font-size: 9px; flex-wrap: wrap; }
.confirm-copy { margin: 15px 0 0; color: #627066; font-size: 10.5px; line-height: 1.8; }

/* ---------- toast ---------- */
.toast-root { position: fixed; right: 24px; bottom: 24px; z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast {
  min-width: 220px;
  max-width: min(380px, calc(100vw - 32px));
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 10px;
  background: #12382c;
  color: #f5f1e4;
  box-shadow: 0 14px 40px rgba(7, 30, 23, .25);
  font-size: 10.5px;
  line-height: 1.6;
  animation: toast-in .24s ease both;
  pointer-events: auto;
}
.toast .icon { width: 15px; height: 15px; margin-top: 1px; color: #9ec7ac; }
.toast.error { background: #7f3a30; }
.toast.error .icon { color: #f0c3b8; }
.toast.leaving { animation: toast-out .2s ease both; }
.toast-close { margin-left: auto; border: 0; background: transparent; color: rgba(255, 255, 255, .4); padding: 0 0 0 5px; }
.toast-close .icon { width: 12px; height: 12px; }

/* ---------- loading / error ---------- */
.page-loading { min-height: 380px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: #a3a89d; font-size: 10px; }
.loader {
  width: 22px;
  height: 22px;
  border: 2px solid #dcd8cb;
  border-top-color: var(--forest-700);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.page-error {
  min-height: 330px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
}
.page-error .empty-icon { margin-bottom: 4px; }
.page-error h3 { font-family: var(--font-display); font-size: 19px; }
.page-error p { color: var(--muted); font-size: 10.5px; max-width: 360px; line-height: 1.7; }
.skeleton-card { min-height: 300px; border-radius: 13px; border: 1px solid var(--line); background: linear-gradient(100deg, #f6f3ea 30%, #fcfaf4 48%, #f6f3ea 66%); background-size: 300% 100%; animation: shimmer 1.5s infinite; }

/* ---------- animations ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes boot-slide { 0% { transform: translateX(-100%); } 50% { transform: translateX(120%); } 100% { transform: translateX(230%); } }
@keyframes page-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(5px); } }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* ---------- responsive ---------- */
@media (max-width: 1280px) {
  .sidebar { width: 230px; }
  .main { margin-left: 230px; }
  .page { padding-left: 30px; padding-right: 30px; }
  .topbar { padding: 0 30px; }
  .page-footer { padding-left: 30px; padding-right: 30px; }
  .scripts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: minmax(0, 1.45fr) minmax(290px, .85fr); }
  .script-cell-text b { max-width: 160px; }
}
@media (max-width: 1080px) {
  .sidebar { transform: translateX(-100%); transition: transform .24s ease; width: 248px; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .menu-btn { display: inline-flex; }
  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 45;
    background: rgba(7, 30, 23, .4);
    backdrop-filter: blur(2px);
  }
  .sidebar-backdrop.show { display: block; }
  .topbar { padding: 0 24px; }
  .page { padding: 28px 24px 16px; }
  .page-footer { padding: 18px 24px 24px; }
  .dashboard-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .login-page { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .login-panel { min-height: 100vh; padding: 32px 24px 60px; }
  .login-form { width: min(390px, 100%); }
  .login-form::before {
    content: "慧涛";
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin-bottom: 28px;
    border-radius: 11px;
    background: var(--forest-850);
    color: #f5ecd9;
    font-family: var(--font-display);
    font-size: 21px;
  }
  .login-form h2 { font-size: 32px; }
}
@media (max-width: 760px) {
  .topbar { height: 58px; padding: 0 16px; }
  .system-status { display: none; }
  .topbar-user .user-trigger-name { display: none; }
  .page { padding: 23px 16px 12px; }
  .page-footer { padding: 16px 16px 22px; font-size: 8px; }
  .page-head { align-items: flex-start; flex-direction: column; gap: 16px; margin-bottom: 21px; }
  .page-head h1 { font-size: 30px; }
  .page-head .page-sub { font-size: 11px; }
  .head-actions { width: 100%; }
  .head-actions .btn { flex: 1; }
  .head-actions .btn-secondary { flex: 0 0 auto; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .stat-card { min-height: 108px; padding: 14px; }
  .security-banner { align-items: flex-start; flex-wrap: wrap; margin-top: -2px; }
  .security-banner div { flex-direction: column; gap: 2px; }
  .security-banner .btn { margin-left: 37px; }
  .stat-value { font-size: 29px; margin-top: 12px; }
  .stat-icon { width: 27px; height: 27px; }
  .stat-foot { font-size: 8px; }
  .library-toolbar { flex-wrap: wrap; padding: 9px; gap: 8px; }
  .search-box { flex-basis: 100%; }
  .select-wrap { flex: 1; }
  .select-wrap select { width: 100%; }
  .filter-strip { align-items: flex-start; flex-direction: column; gap: 9px; margin-top: 13px; }
  .segmented { width: 100%; overflow-x: auto; scrollbar-width: none; }
  .segmented::-webkit-scrollbar { display: none; }
  .segmented button { flex: 1; }
  .filter-right { width: 100%; justify-content: space-between; }
  .scripts-grid { grid-template-columns: 1fr; gap: 10px; }
  .script-card { min-height: 285px; padding: 16px 16px 13px; }
  .script-card h3 { font-size: 21px; }
  .mini-table th:nth-child(2), .mini-table td:nth-child(2),
  .mini-table th:nth-child(4), .mini-table td:nth-child(4) { display: none; }
  .script-cell-text b { max-width: 195px; }
  .table-toolbar { align-items: flex-start; flex-direction: column; padding: 12px 13px; }
  .table-toolbar .segmented { width: 100%; }
  .table-toolbar .segmented button { flex: 1; }
  .table-toolbar-right { width: 100%; justify-content: flex-end; }
  .summary-strip { gap: 6px; }
  .summary-pill { flex: 1; min-width: 95px; justify-content: center; padding: 0 8px; }
  .claim-card { grid-template-columns: 1fr; gap: 13px; padding: 16px; }
  .claim-card-side { flex-direction: row; align-items: center; justify-content: space-between; }
  .claim-card-actions { justify-content: flex-start; }
  .modal-backdrop { padding: 0; align-items: flex-end; }
  .modal { width: 100%; max-height: calc(100vh - 18px); border-radius: 18px 18px 0 0; }
  .modal-header { padding: 18px 17px 14px; }
  .modal-body { padding: 17px; }
  .modal-body.tight { padding: 14px 17px; }
  .modal-footer { padding: 12px 17px calc(12px + env(safe-area-inset-bottom)); }
  .modal-title { font-size: 19px; }
  .detail-layout { grid-template-columns: 1fr; }
  .detail-main { padding: 19px 18px 20px; }
  .detail-side { padding: 18px; border-left: 0; border-top: 1px solid var(--line); }
  .detail-title { font-size: 27px; }
  .detail-layout .modal-body { padding: 0; }
  .form-grid { grid-template-columns: 1fr; gap: 13px; }
  .toast-root { left: 16px; right: 16px; bottom: 16px; align-items: stretch; }
  .toast { max-width: none; }
  .activity-row-time { display: none; }
  .pagination { flex-wrap: wrap; }
  .pagination-info { width: 100%; text-align: center; margin: 5px 0 0; }
}
@media (max-width: 430px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat-label { font-size: 9.5px; }
  .stat-value { font-size: 27px; }
  .stat-foot { line-height: 1.3; }
  .card-actions .btn span { display: none; }
  .card-actions .btn { width: 29px; padding: 0; }
  .card-actions .btn .icon { width: 13px; height: 13px; }
  .page-head h1 { font-size: 27px; }
  .login-form h2 { font-size: 29px; }
  .detail-title { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
