/* =========================================================
   格物 LabOS · Research Operations
   ========================================================= */
:root {
  --ink: #10231c;
  --ink-2: #25352d;
  --muted: #6f7b73;
  --muted-2: #939d95;
  --paper: #f3f5ef;
  --paper-2: #eef1e9;
  --surface: #fffefb;
  --surface-2: #f8f9f4;
  --surface-3: #f1f4ec;
  --line: #e2e7dc;
  --line-strong: #d3dbce;
  --pine: #0c2119;
  --pine-2: #153329;
  --pine-3: #1b4434;
  --green: #2b684c;
  --green-2: #4c8a69;
  --lime: #cbf56b;
  --lime-2: #b6e84d;
  --lime-soft: #effbd5;
  --blue: #5a80df;
  --blue-soft: #edf2ff;
  --amber: #d99a2f;
  --amber-soft: #fff5df;
  --coral: #dd6e4d;
  --coral-soft: #fff0ea;
  --purple: #806bd1;
  --purple-soft: #f2efff;
  --teal: #32988d;
  --radius: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 35, 28, .03), 0 12px 32px -20px rgba(16, 35, 28, .22);
  --shadow-lg: 0 30px 80px -30px rgba(7, 28, 20, .4);
  --font: "Inter", "SF Pro Display", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "SFMono-Regular", "Cascadia Code", "Roboto Mono", "Microsoft YaHei", monospace;
  --sidebar-w: 258px;
  --topbar-h: 72px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: clip; }
body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 82% -8%, rgba(203, 245, 107, .12), transparent 30rem),
    var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.no-scroll { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; }
h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
table { border-collapse: collapse; width: 100%; }
::selection { background: var(--lime); color: var(--pine); }
:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; border-radius: 6px; }
button:focus:not(:focus-visible), a:focus:not(:focus-visible) { outline: none; }

.tabular, .num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); }

/* ===== Boot ===== */
.boot-loader {
  position: fixed; inset: 0; z-index: 400;
  display: grid; place-content: center; justify-items: center;
  gap: 10px; background: var(--pine); color: #fff;
  transition: opacity .5s ease, visibility .5s ease;
}
.boot-loader.done { opacity: 0; visibility: hidden; pointer-events: none; }
.boot-mark { width: 64px; color: var(--lime); animation: bootFloat 2.4s ease-in-out infinite; }
.boot-mark svg { width: 100%; }
.boot-word { font-size: 23px; font-weight: 650; letter-spacing: .02em; }
.boot-word span { color: var(--lime); font-weight: 450; }
.boot-loader p { color: rgba(255,255,255,.48); font-size: 12px; margin-top: 4px; }
.boot-bar { width: 132px; height: 2px; overflow: hidden; border-radius: 2px; background: rgba(255,255,255,.13); margin-top: 8px; }
.boot-bar i { display: block; width: 40%; height: 100%; border-radius: 2px; background: var(--lime); animation: bootSlide 1.1s ease-in-out infinite; }
@keyframes bootSlide { 0% { transform: translateX(-120%); } 100% { transform: translateX(350%); } }
@keyframes bootFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* ===== Shell ===== */
.app-shell { min-height: 100vh; }
.app-main { min-height: 100vh; margin-left: var(--sidebar-w); display: flex; flex-direction: column; }
.app-view {
  width: 100%; max-width: 1480px;
  margin: 0 auto; padding: 28px 34px 56px;
  flex: 1;
  animation: viewIn .42s cubic-bezier(.2,.7,.3,1);
}
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ===== Sidebar ===== */
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 80;
  width: var(--sidebar-w);
  display: flex; flex-direction: column;
  color: rgba(255,255,255,.72);
  background:
    radial-gradient(120% 70% at 10% 0%, rgba(76,138,105,.22), transparent 55%),
    linear-gradient(178deg, #0d241b 0%, #0a1d16 62%, #081811 100%);
  border-right: 1px solid rgba(255,255,255,.06);
  overflow: visible;
}
.sidebar::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .2;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(to bottom, #000, transparent 62%);
}
.sidebar > * { position: relative; z-index: 1; }
.sidebar-head { display: flex; align-items: center; padding: 22px 20px 18px; }
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; color: #fff; }
.brand-mark { width: 39px; height: 39px; color: var(--lime); flex: none; filter: drop-shadow(0 0 16px rgba(203,245,107,.16)); }
.brand-mark svg { width: 100%; height: 100%; }
.brand-type { display: flex; flex-direction: column; line-height: 1.25; }
.brand-type strong { font-size: 17px; font-weight: 640; letter-spacing: .02em; white-space: nowrap; }
.brand-type em { font-style: normal; font-weight: 440; color: var(--lime); }
.brand-type small { margin-top: 4px; font-size: 10px; letter-spacing: .12em; color: rgba(255,255,255,.4); white-space: nowrap; }
.sidebar-close { display: none; margin-left: auto; border: 0; background: none; color: rgba(255,255,255,.6); width: 34px; height: 34px; border-radius: 9px; }
.sidebar-close:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar-close svg { width: 20px; margin: auto; }

.sidebar-scroll { flex: 1; overflow-y: auto; padding: 6px 14px 20px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }
.sidebar-scroll::-webkit-scrollbar { width: 4px; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 4px; }
.nav-label {
  padding: 11px 12px 7px; font-size: 9.5px; letter-spacing: .16em;
  color: rgba(255,255,255,.32); text-transform: uppercase; font-weight: 650;
}
.nav-label-spaced { margin-top: 22px; }
.nav-list { display: grid; gap: 3px; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 11px;
  min-height: 43px; padding: 0 12px; border-radius: 11px;
  font-size: 13.5px; font-weight: 500; color: rgba(255,255,255,.62);
  transition: background .18s ease, color .18s ease, transform .18s ease;
}
.nav-item:hover { color: #fff; background: rgba(255,255,255,.055); }
.nav-item.active { color: #fff; background: linear-gradient(90deg, rgba(203,245,107,.15), rgba(255,255,255,.04)); box-shadow: inset 0 0 0 1px rgba(203,245,107,.08); }
.nav-item.active::before { content: ""; position: absolute; left: -14px; top: 50%; width: 3px; height: 21px; transform: translateY(-50%); border-radius: 0 4px 4px 0; background: var(--lime); box-shadow: 0 0 12px rgba(203,245,107,.55); }
.nav-icon { display: grid; place-items: center; width: 22px; height: 22px; flex: none; color: rgba(255,255,255,.52); }
.nav-icon svg { width: 19px; height: 19px; }
.nav-item.active .nav-icon { color: var(--lime); }
.nav-badge {
  margin-left: auto; min-width: 21px; height: 19px; padding: 0 6px;
  display: grid; place-items: center; border-radius: 6px;
  background: rgba(203,245,107,.14); color: var(--lime);
  font-size: 10.5px; font-weight: 650; font-variant-numeric: tabular-nums;
}
.quick-links { display: grid; gap: 2px; }
.quick-link {
  display: flex; align-items: center; gap: 9px; width: 100%;
  border: 0; background: transparent; color: rgba(255,255,255,.54);
  padding: 8px 12px; border-radius: 9px; font-size: 12.5px; text-align: left;
  transition: background .18s, color .18s;
}
.quick-link:hover { background: rgba(255,255,255,.05); color: #fff; }
.quick-dot { width: 6px; height: 6px; border-radius: 50%; flex: none; }
.quick-dot.amber { background: var(--amber); box-shadow: 0 0 0 3px rgba(217,154,47,.12); }
.quick-dot.coral { background: var(--coral); box-shadow: 0 0 0 3px rgba(221,110,77,.12); }
.quick-dot.blue { background: var(--blue); box-shadow: 0 0 0 3px rgba(90,128,223,.12); }
.quick-count { margin-left: auto; color: rgba(255,255,255,.35); font-size: 11px; font-variant-numeric: tabular-nums; }
.sidebar-note {
  margin: 25px 5px 0; padding: 13px 14px;
  border: 1px solid rgba(255,255,255,.07); border-radius: 12px;
  background: rgba(255,255,255,.035);
}
.note-top { display: flex; justify-content: space-between; align-items: center; font-size: 10.5px; color: rgba(255,255,255,.48); }
.note-top b { color: rgba(255,255,255,.75); font-weight: 600; font-size: 10.5px; }
.storage-bar { height: 3px; border-radius: 3px; background: rgba(255,255,255,.1); margin: 9px 0 7px; overflow: hidden; }
.storage-bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--green-2), var(--lime)); transition: width .4s ease; }
.sidebar-note p { font-size: 10px; color: rgba(255,255,255,.3); }

.sidebar-footer { position: relative; padding: 12px 14px 16px; border-top: 1px solid rgba(255,255,255,.065); }
.user-card {
  width: 100%; display: flex; align-items: center; gap: 10px;
  border: 0; background: none; color: #fff; padding: 8px;
  border-radius: 12px; text-align: left; transition: background .18s;
}
.user-card:hover { background: rgba(255,255,255,.055); }
.avatar {
  display: inline-grid; place-items: center; flex: none;
  width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%;
  background: #e6ebe1; color: var(--ink-2);
  font-size: 10.5px; font-weight: 650; letter-spacing: -.02em; line-height: 1;
  white-space: nowrap; overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(16,35,28,.06);
}
.avatar-lime { background: var(--lime); color: var(--pine); }
.avatar-top { width: 36px; height: 36px; cursor: pointer; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line); }
.user-meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.user-meta strong { font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.user-meta small { font-size: 9.5px; color: rgba(255,255,255,.36); white-space: nowrap; margin-top: 3px; }
.user-card .chev { width: 16px; height: 16px; margin-left: auto; color: rgba(255,255,255,.3); }
.profile-menu {
  position: absolute; left: 14px; right: 14px; bottom: 78px; z-index: 20;
  background: #142d23; border: 1px solid rgba(255,255,255,.1); border-radius: 13px;
  box-shadow: 0 20px 50px -16px rgba(0,0,0,.6); padding: 6px;
  animation: popIn .18s ease;
}
.profile-menu-head { display: flex; gap: 9px; align-items: center; padding: 9px 8px 11px; border-bottom: 1px solid rgba(255,255,255,.08); margin-bottom: 4px; }
.profile-menu-head div { display: flex; flex-direction: column; min-width: 0; }
.profile-menu-head strong { font-size: 12.5px; color: #fff; }
.profile-menu-head small { font-size: 9.5px; color: rgba(255,255,255,.4); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; }
.profile-menu button { display: block; width: 100%; border: 0; background: none; color: rgba(255,255,255,.62); font-size: 11.5px; text-align: left; padding: 9px 9px; border-radius: 7px; }
.profile-menu button:hover { background: rgba(255,255,255,.06); color: #fff; }
.profile-menu-foot { padding: 8px 9px 3px; font-size: 9px; color: rgba(255,255,255,.25); border-top: 1px solid rgba(255,255,255,.06); margin-top: 4px; }
.sidebar-scrim { display: none; }

/* ===== Topbar ===== */
.topbar {
  position: sticky; top: 0; z-index: 60;
  height: var(--topbar-h); padding: 0 34px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  background: rgba(243,245,239,.86);
  border-bottom: 1px solid rgba(211,219,206,.75);
  backdrop-filter: blur(18px) saturate(1.2);
}
.topbar-left { display: flex; align-items: center; gap: 13px; min-width: 0; }
.crumb { display: flex; align-items: center; gap: 8px; font-size: 12px; white-space: nowrap; overflow: hidden; }
.crumb span { color: var(--muted-2); }
.crumb i { font-style: normal; color: #c1c9be; }
.crumb strong { font-weight: 600; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 11px; border: 1px solid transparent;
  display: grid; place-items: center; background: transparent; color: var(--muted);
  transition: background .18s, color .18s, border-color .18s;
}
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn:hover { background: var(--surface); border-color: var(--line); color: var(--ink); }
.mobile-menu { display: none; }
.global-search { position: relative; width: 304px; }
.global-search > .search-icon { position: absolute; left: 12px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--muted-2); pointer-events: none; }
.global-search input {
  width: 100%; height: 38px; border: 1px solid var(--line);
  border-radius: 10px; background: rgba(255,255,255,.68);
  padding: 0 52px 0 35px; font-size: 12px; color: var(--ink);
  transition: background .2s, border-color .2s, box-shadow .2s;
}
.global-search input::placeholder { color: #9aa39b; }
.global-search input:focus { outline: none; border-color: #b8c6b3; background: #fff; box-shadow: 0 0 0 3px rgba(43,104,76,.08); }
.global-search kbd {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  padding: 2px 5px; border: 1px solid var(--line); border-radius: 5px;
  font-family: var(--font); font-size: 8.5px; color: var(--muted-2);
  background: var(--surface-2); letter-spacing: .02em;
}
.search-results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: 13px;
  box-shadow: var(--shadow-lg); padding: 6px; max-height: 390px; overflow-y: auto; z-index: 70;
  animation: popIn .16s ease;
}
.search-results .sr-label { padding: 7px 9px 5px; color: var(--muted-2); font-size: 9px; letter-spacing: .12em; text-transform: uppercase; }
.search-result {
  display: flex; align-items: center; gap: 9px; padding: 9px; border-radius: 8px;
  color: var(--ink-2); cursor: pointer; border: 0; background: none; width: 100%; text-align: left;
}
.search-result:hover, .search-result.active { background: var(--surface-3); }
.sr-icon { width: 27px; height: 27px; border-radius: 7px; display: grid; place-items: center; flex: none; background: var(--surface-3); color: var(--green); }
.sr-icon svg { width: 15px; height: 15px; }
.search-result div { min-width: 0; display: flex; flex-direction: column; }
.search-result strong { font-size: 11.5px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-result small { color: var(--muted-2); font-size: 9.5px; margin-top: 1px; }
.search-result .sr-type { margin-left: auto; font-size: 8.5px; color: var(--muted-2); border: 1px solid var(--line); padding: 2px 5px; border-radius: 4px; flex: none; }
.search-empty { padding: 18px 12px; text-align: center; color: var(--muted-2); font-size: 11.5px; }
.notify-wrap, .create-wrap { position: relative; }
.notice-btn { position: relative; }
.notice-dot { position: absolute; top: 9px; right: 9px; width: 6px; height: 6px; border-radius: 50%; background: var(--coral); border: 1.5px solid var(--paper); display: none; }
.notice-dot.show { display: block; }
.notify-panel {
  position: absolute; right: -45px; top: calc(100% + 10px); width: 345px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 15px;
  box-shadow: var(--shadow-lg); z-index: 70; overflow: hidden; animation: popIn .18s ease;
}
.notify-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 15px 11px; border-bottom: 1px solid var(--line); }
.notify-head div { display: flex; flex-direction: column; }
.notify-head strong { font-size: 13px; }
.notify-head small { color: var(--muted-2); font-size: 9.5px; margin-top: 2px; }
.notify-head button { border: 0; background: none; color: var(--green); font-size: 10px; padding: 4px; }
.notify-head button:hover { text-decoration: underline; }
.notify-list { max-height: 340px; overflow-y: auto; }
.notify-item { display: flex; gap: 10px; padding: 12px 15px; border-bottom: 1px solid #edf0e9; text-align: left; width: 100%; border-left: 0; border-right: 0; border-top: 0; background: none; }
.notify-item:hover { background: var(--surface-2); }
.notify-item.unread { background: #fbfdf5; }
.notify-item.unread:hover { background: #f6faeb; }
.notify-icon { width: 29px; height: 29px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.notify-icon svg { width: 15px; height: 15px; }
.notify-icon.green { background: var(--lime-soft); color: var(--green); }
.notify-icon.amber { background: var(--amber-soft); color: var(--amber); }
.notify-icon.blue { background: var(--blue-soft); color: var(--blue); }
.notify-icon.coral { background: var(--coral-soft); color: var(--coral); }
.notify-content { min-width: 0; }
.notify-content strong { display: block; font-size: 11.5px; font-weight: 580; color: var(--ink-2); }
.notify-content p { color: var(--muted); font-size: 10px; line-height: 1.55; margin-top: 2px; }
.notify-content time { display: block; color: var(--muted-2); font-size: 8.5px; margin-top: 4px; }
.notify-empty { padding: 30px 15px; text-align: center; color: var(--muted-2); font-size: 11px; }
.notify-foot { padding: 9px; text-align: center; font-size: 9px; color: var(--muted-2); border-top: 1px solid var(--line); background: var(--surface-2); }
.create-menu {
  position: absolute; right: 0; top: calc(100% + 9px); width: 252px;
  padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow-lg); z-index: 70; animation: popIn .18s ease;
}
.create-menu > p { font-size: 9px; letter-spacing: .12em; color: var(--muted-2); padding: 8px 9px 5px; text-transform: uppercase; }
.create-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px; border: 0; border-radius: 9px; background: none; text-align: left; }
.create-menu button:hover { background: var(--surface-3); }
.cm-icon { width: 29px; height: 29px; border-radius: 8px; flex: none; position: relative; }
.cm-icon::before, .cm-icon::after { content: ""; position: absolute; background: currentColor; border-radius: 2px; }
.cm-icon.lime { background: var(--lime-soft); color: var(--green); }
.cm-icon.blue { background: var(--blue-soft); color: var(--blue); }
.cm-icon.amber { background: var(--amber-soft); color: var(--amber); }
.cm-icon::before { width: 11px; height: 1.6px; left: 9px; top: 13.5px; }
.cm-icon::after { height: 11px; width: 1.6px; left: 13.5px; top: 9px; }
.create-menu div { display: flex; flex-direction: column; }
.create-menu strong { font-size: 11.5px; font-weight: 560; }
.create-menu small { font-size: 9.5px; color: var(--muted-2); margin-top: 2px; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 39px; padding: 0 15px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  font-size: 11.5px; font-weight: 560; white-space: nowrap;
  transition: transform .15s ease, background .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.btn svg { width: 15px; height: 15px; flex: none; }
.btn:hover { border-color: var(--line-strong); background: var(--surface-2); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--pine); border-color: var(--pine); color: #f8ffe9; box-shadow: 0 6px 18px -10px rgba(12,33,25,.55); }
.btn-primary:hover { background: var(--pine-2); border-color: var(--pine-2); }
.btn-lime { background: var(--lime); border-color: var(--lime); color: var(--pine); }
.btn-lime:hover { background: var(--lime-2); border-color: var(--lime-2); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-danger { color: var(--coral); border-color: #f0d5cb; background: #fffaf8; }
.btn-danger:hover { background: var(--coral-soft); border-color: #e8bfb1; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 10.5px; border-radius: 9px; }
.btn-sm svg { width: 14px; height: 14px; }
.btn-lg { height: 45px; padding: 0 20px; font-size: 12px; border-radius: 11px; }
.btn-icon { width: 34px; padding: 0; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.text-btn { border: 0; background: none; color: var(--green); font-size: 10.5px; font-weight: 560; padding: 4px; display: inline-flex; align-items: center; gap: 4px; }
.text-btn:hover { color: var(--pine); }
.text-btn svg { width: 13px; height: 13px; }
.link { color: var(--green); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(43,104,76,.3); }
.link:hover { color: var(--pine); }

/* ===== Page headings ===== */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.page-head .page-kicker { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 10px; letter-spacing: .09em; text-transform: uppercase; font-weight: 570; margin-bottom: 8px; }
.page-kicker .live-dot { width: 6px; height: 6px; border-radius: 50%; background: #65a956; box-shadow: 0 0 0 3px rgba(101,169,86,.12); }
.page-head h1 { font-size: clamp(25px, 2.2vw, 34px); line-height: 1.16; letter-spacing: -.035em; font-weight: 650; color: var(--ink); }
.page-head h1 em { font-style: normal; color: var(--green); }
.page-head .page-sub { color: var(--muted); font-size: 12px; margin-top: 8px; max-width: 580px; line-height: 1.65; }
.page-head .page-sub strong { color: var(--ink-2); font-weight: 600; }
.page-actions { display: flex; align-items: center; gap: 8px; flex: none; padding-bottom: 2px; }
.hero-date { display: inline-flex; align-items: center; gap: 7px; }
.hero-date svg { width: 13px; height: 13px; color: var(--muted-2); }

/* ===== Generic cards ===== */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  min-width: 0;
}
.card-pad { padding: 21px 22px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.card-head h2, .card-title { font-size: 14px; font-weight: 620; letter-spacing: -.01em; color: var(--ink-2); }
.card-head p, .card-sub { font-size: 10.5px; color: var(--muted-2); margin-top: 4px; line-height: 1.5; }
.card-head .head-actions { display: flex; align-items: center; gap: 6px; }
.card-link { font-size: 10px; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; padding: 4px; }
.card-link:hover { color: var(--ink); }
.card-link svg { width: 13px; height: 13px; }
.section-label { display: flex; align-items: center; gap: 8px; font-size: 10px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted-2); }
.section-label::before { content: ""; width: 12px; height: 1px; background: var(--line-strong); }

/* ===== Dashboard KPI ===== */
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi-card {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; min-height: 126px;
  padding: 17px 18px 15px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 17px;
  box-shadow: var(--shadow);
  transition: transform .2s ease, box-shadow .2s ease;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: 0 16px 35px -24px rgba(16,35,28,.3); }
.kpi-card.dark { background: linear-gradient(140deg, #102b20, #0b1e17 70%); border-color: #173b2c; color: #fff; }
.kpi-card.dark::after { content: ""; position: absolute; width: 140px; height: 140px; right: -50px; top: -70px; border-radius: 50%; border: 1px solid rgba(203,245,107,.15); box-shadow: 0 0 0 24px rgba(203,245,107,.03), 0 0 0 48px rgba(203,245,107,.02); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; position: relative; z-index: 1; }
.kpi-label { color: var(--muted); font-size: 10.5px; font-weight: 530; }
.kpi-card.dark .kpi-label { color: rgba(255,255,255,.58); }
.kpi-icon { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 8px; background: var(--surface-3); color: var(--green); }
.kpi-icon svg { width: 14px; height: 14px; }
.kpi-card.dark .kpi-icon { background: rgba(203,245,107,.11); color: var(--lime); }
.kpi-mid { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-top: 9px; position: relative; z-index: 1; }
.kpi-value { font-size: 29px; line-height: 1; font-weight: 640; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.kpi-value small { font-size: 11px; font-weight: 500; color: var(--muted-2); letter-spacing: 0; margin-left: 3px; }
.kpi-card.dark .kpi-value small { color: rgba(255,255,255,.4); }
.kpi-spark { width: 76px; height: 27px; opacity: .9; align-self: flex-end; }
.kpi-card.dark .kpi-spark { opacity: 1; }
.kpi-foot { display: flex; align-items: center; gap: 5px; margin-top: auto; padding-top: 8px; font-size: 9.5px; color: var(--muted-2); position: relative; z-index: 1; white-space: nowrap; }
.kpi-card.dark .kpi-foot { color: rgba(255,255,255,.36); }
.trend-up { color: #4f8d55; font-weight: 600; }
.trend-warn { color: var(--amber); font-weight: 600; }
.kpi-card.dark .trend-up { color: var(--lime); }
.kpi-dot { width: 3px; height: 3px; background: currentColor; border-radius: 50%; opacity: .55; }

/* ===== Dashboard grid ===== */
.dashboard-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; }
.span-12 { grid-column: span 12; }
.span-8 { grid-column: span 8; }
.span-7 { grid-column: span 7; }
.span-5 { grid-column: span 5; }
.span-4 { grid-column: span 4; }
.span-6 { grid-column: span 6; }

.chart-card { padding: 20px 22px 17px; }
.chart-card .card-head { margin-bottom: 8px; }
.chart-toggle { display: flex; align-items: center; background: var(--surface-3); border-radius: 8px; padding: 2px; }
.chart-toggle button { border: 0; background: transparent; border-radius: 6px; padding: 5px 9px; font-size: 9px; color: var(--muted-2); }
.chart-toggle button.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 4px rgba(16,35,28,.08); }
.chart-legend { display: flex; align-items: center; gap: 14px; margin-top: 2px; }
.legend-item { display: flex; align-items: center; gap: 5px; font-size: 9.5px; color: var(--muted-2); }
.legend-swatch { width: 7px; height: 7px; border-radius: 2px; }
.legend-swatch.green { background: var(--green-2); }
.legend-swatch.lime { background: var(--lime); }
.chart-wrap { position: relative; width: 100%; min-height: 218px; margin-top: 8px; }
.chart-wrap svg { width: 100%; height: auto; overflow: visible; }
.chart-axis-label { fill: #9aa39a; font-size: 9px; font-family: var(--font); }
.chart-value-label { fill: #5d6a60; font-size: 8.5px; font-family: var(--font); font-weight: 600; }
.chart-grid-line { stroke: #e8ece3; stroke-width: 1; stroke-dasharray: 3 4; }
.chart-bar { transition: opacity .15s; cursor: pointer; }
.chart-hover-zone { fill: transparent; cursor: pointer; }
.chart-hover-zone:hover + .chart-bar, .chart-bar:hover { opacity: .76; }
.chart-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 5px; padding-top: 12px; border-top: 1px solid #edf0e8; font-size: 9.5px; color: var(--muted-2); }
.chart-foot strong { color: var(--ink-2); font-weight: 570; }
.chart-foot .inline-trend { display: inline-flex; align-items: center; gap: 4px; color: #4f8d55; }
.chart-foot svg { width: 12px; height: 12px; }

.donut-card { padding: 20px 22px 18px; display: flex; flex-direction: column; }
.donut-body { display: flex; align-items: center; gap: 20px; flex: 1; }
.donut-wrap { position: relative; width: 144px; height: 144px; flex: none; }
.donut-wrap svg { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.donut-seg { cursor: pointer; transition: opacity .15s, stroke-width .15s; }
.donut-seg:hover { opacity: .82; }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.donut-center strong { font-size: 26px; line-height: 1; font-weight: 650; letter-spacing: -.04em; }
.donut-center span { margin-top: 5px; color: var(--muted-2); font-size: 8.5px; }
.donut-legend { display: grid; gap: 9px; flex: 1; min-width: 0; }
.donut-legend-item { display: flex; align-items: center; gap: 7px; font-size: 10px; color: var(--muted); }
.donut-legend-item .dot { width: 6px; height: 6px; border-radius: 50%; flex: none; }
.donut-legend-item strong { margin-left: auto; color: var(--ink-2); font-size: 10.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.donut-legend-item small { color: var(--muted-2); font-size: 8.5px; margin-left: 2px; }
.donut-foot { border-top: 1px solid #edf0e8; padding-top: 12px; margin-top: 12px; display: flex; justify-content: space-between; font-size: 9.5px; color: var(--muted-2); }
.donut-foot strong { color: var(--ink-2); font-weight: 570; }

/* ===== Lists / dashboard ===== */
.mini-exp-list { display: grid; gap: 3px; }
.mini-exp {
  display: flex; align-items: center; gap: 12px; padding: 10px 5px;
  border-bottom: 1px solid #eef1ea; cursor: pointer; border-radius: 8px;
  transition: background .16s;
}
.mini-exp:last-child { border-bottom: 0; }
.mini-exp:hover { background: var(--surface-2); }
.mini-exp-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--lime-soft); color: var(--green); flex: none; }
.mini-exp-icon svg { width: 17px; height: 17px; }
.mini-exp:nth-child(2) .mini-exp-icon { background: var(--blue-soft); color: var(--blue); }
.mini-exp:nth-child(3) .mini-exp-icon { background: var(--amber-soft); color: var(--amber); }
.mini-exp-main { min-width: 0; flex: 1; }
.mini-exp-main strong { display: block; font-size: 11.5px; font-weight: 560; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-exp-main span { display: flex; align-items: center; gap: 6px; color: var(--muted-2); font-size: 9px; margin-top: 3px; }
.mini-exp-progress { width: 108px; flex: none; }
.progress-track { display: block; width: 100%; height: 5px; border-radius: 5px; background: #e9ede5; overflow: hidden; }
.progress-track > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--green-2), var(--green)); transition: width .5s cubic-bezier(.2,.7,.3,1); }
.mini-exp-progress .progress-track { height: 4px; }
.mini-exp-progress span { display: block; text-align: right; font-size: 8.5px; color: var(--muted-2); margin-top: 4px; }
.mini-exp .chev { width: 15px; height: 15px; color: #c4ccc0; flex: none; }

.booking-list { display: grid; gap: 6px; }
.booking-row { display: flex; align-items: center; gap: 11px; padding: 10px 5px; border-bottom: 1px solid #eef1ea; cursor: pointer; border-radius: 8px; }
.booking-row:last-child { border-bottom: 0; }
.booking-row:hover { background: var(--surface-2); }
.booking-date {
  width: 37px; height: 40px; border-radius: 9px; background: var(--surface-3);
  display: flex; flex-direction: column; align-items: center; justify-content: center; flex: none;
  border: 1px solid #e9ede4;
}
.booking-date small { font-size: 8px; color: var(--muted-2); text-transform: uppercase; }
.booking-date strong { font-size: 14px; line-height: 1.15; font-weight: 620; color: var(--ink-2); }
.booking-info { flex: 1; min-width: 0; }
.booking-info strong { display: block; font-size: 10.5px; font-weight: 560; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.booking-info span { display: block; font-size: 9px; color: var(--muted-2); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.booking-time { flex: none; font-size: 9px; font-family: var(--mono); color: var(--muted); background: var(--surface-2); padding: 4px 6px; border-radius: 5px; }

.activity-strip { padding: 18px 22px 16px; }
.activity-strip-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 11px; }
.activity-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; }
.activity-item { display: flex; gap: 9px; padding: 4px 15px; border-left: 1px solid #edf0e8; min-width: 0; }
.activity-item:first-child { padding-left: 0; border-left: 0; }
.activity-avatar { width: 28px; height: 28px; flex: none; font-size: 9px; }
.activity-text { min-width: 0; }
.activity-text p { font-size: 10px; line-height: 1.55; color: var(--muted); }
.activity-text p strong { color: var(--ink-2); font-weight: 600; }
.activity-text time { display: block; margin-top: 4px; font-size: 8.5px; color: var(--muted-2); }

/* ===== Status badges ===== */
.status {
  display: inline-flex; align-items: center; gap: 5px; flex: none;
  padding: 4px 8px; border-radius: 999px;
  font-size: 9px; font-weight: 560; line-height: 1.4; white-space: nowrap;
}
.status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-active { color: #2f7251; background: #edf7ee; }
.status-planning { color: #6f67b5; background: #f2f0fb; }
.status-paused { color: #b17725; background: #fff5df; }
.status-completed { color: #5d6b64; background: #eef1ec; }
.status-available { color: #2f7251; background: #edf7ee; }
.status-in_use { color: #426bb4; background: #edf2fb; }
.status-maintenance { color: #b55f44; background: #fff0ea; }
.status-reserved { color: #7964bd; background: #f2effc; }

/* ===== Experiments page ===== */
.toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 18px; padding: 8px; border: 1px solid var(--line);
  border-radius: 14px; background: rgba(255,255,255,.65);
}
.tabs { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.tab {
  display: inline-flex; align-items: center; gap: 6px;
  border: 0; background: transparent; color: var(--muted); border-radius: 8px;
  padding: 8px 11px; font-size: 10.5px; font-weight: 540; white-space: nowrap;
}
.tab:hover { background: var(--surface-3); color: var(--ink); }
.tab.active { background: var(--pine); color: #fff; }
.tab-count { font-size: 8px; color: var(--muted-2); background: var(--surface-3); border-radius: 5px; padding: 1px 5px; font-variant-numeric: tabular-nums; }
.tab.active .tab-count { color: var(--lime); background: rgba(255,255,255,.1); }
.toolbar-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.compact-search { position: relative; }
.compact-search svg { position: absolute; left: 10px; top: 50%; width: 14px; height: 14px; transform: translateY(-50%); color: var(--muted-2); }
.compact-search input {
  height: 34px; width: 190px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); padding: 0 10px 0 31px; font-size: 10.5px;
}
.compact-search input:focus { outline: none; border-color: #b9c8b4; box-shadow: 0 0 0 3px rgba(43,104,76,.07); }
.select-wrap { position: relative; }
.select-wrap select {
  appearance: none; height: 34px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); padding: 0 29px 0 10px; font-size: 10px; color: var(--ink-2); cursor: pointer;
}
.select-wrap::after { content: ""; position: absolute; right: 10px; top: 50%; width: 5px; height: 5px; border-right: 1.3px solid var(--muted); border-bottom: 1.3px solid var(--muted); transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.select-wrap select:focus { outline: none; border-color: #b9c8b4; }
.view-toggle { display: flex; align-items: center; gap: 2px; background: var(--surface-3); padding: 2px; border-radius: 8px; }
.view-toggle button { width: 29px; height: 28px; border: 0; border-radius: 6px; background: transparent; color: var(--muted-2); display: grid; place-items: center; }
.view-toggle button.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 4px rgba(16,35,28,.08); }
.view-toggle svg { width: 14px; height: 14px; }

.experiment-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.experiment-card {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; min-height: 268px;
  padding: 18px 19px 16px; border: 1px solid var(--line); border-radius: 18px;
  background: var(--surface); box-shadow: var(--shadow); cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.experiment-card:hover { transform: translateY(-3px); border-color: #cfd9c9; box-shadow: 0 24px 45px -30px rgba(16,35,28,.34); }
.experiment-card::after {
  content: ""; position: absolute; right: -45px; top: -50px; width: 125px; height: 125px;
  border-radius: 50%; border: 1px solid rgba(43,104,76,.065); opacity: 0; transition: opacity .25s;
}
.experiment-card:hover::after { opacity: 1; }
.exp-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.exp-code { display: inline-flex; align-items: center; gap: 5px; font-family: var(--mono); font-size: 8.5px; letter-spacing: .02em; color: var(--muted-2); }
.exp-code .code-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--green-2); }
.exp-title { font-size: 15.5px; line-height: 1.5; font-weight: 610; letter-spacing: -.015em; color: var(--ink); min-height: 47px; }
.exp-desc { margin-top: 7px; font-size: 10.5px; color: var(--muted); line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 34px; }
.exp-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 10px; }
.tag { display: inline-flex; align-items: center; padding: 2px 7px; border-radius: 5px; font-size: 8.5px; color: #66736a; background: #f1f4ed; border: 1px solid #e9ede3; white-space: nowrap; }
.tag.blue { color: #5a6f9d; background: #f0f4fc; border-color: #e4ebf7; }
.tag.amber { color: #9a762f; background: #fdf7e9; border-color: #f4ebd4; }
.exp-progress { margin-top: auto; padding-top: 15px; }
.exp-progress-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; font-size: 9px; color: var(--muted-2); }
.exp-progress-top strong { color: var(--ink-2); font-weight: 620; font-size: 10px; font-variant-numeric: tabular-nums; }
.exp-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; padding-top: 11px; border-top: 1px solid #edf0e8; }
.avatar-stack { display: flex; align-items: center; padding-left: 2px; }
.avatar-stack .avatar { width: 24px; height: 24px; font-size: 7.5px; border: 2px solid var(--surface); margin-left: -6px; box-shadow: none; }
.avatar-stack .avatar:first-child { margin-left: 0; }
.avatar-more { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--surface-3); border: 2px solid var(--surface); margin-left: -6px; font-size: 7.5px; color: var(--muted); font-weight: 600; }
.exp-deadline { display: flex; align-items: center; gap: 4px; font-size: 8.5px; color: var(--muted-2); white-space: nowrap; }
.exp-deadline svg { width: 11px; height: 11px; }
.exp-deadline.urgent { color: var(--coral); }

.experiment-list { display: grid; gap: 8px; }
.experiment-list-row {
  display: grid; grid-template-columns: 1.45fr .7fr .8fr .8fr auto; align-items: center; gap: 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 13px; padding: 13px 16px;
  box-shadow: 0 1px 2px rgba(16,35,28,.02); cursor: pointer; transition: border-color .18s, transform .18s;
}
.experiment-list-row:hover { border-color: #cfd9c9; transform: translateX(2px); }
.exp-list-main { min-width: 0; }
.exp-list-main strong { display: block; font-size: 12px; font-weight: 590; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.exp-list-main span { display: block; color: var(--muted-2); font-family: var(--mono); font-size: 8.5px; margin-top: 3px; }
.exp-list-meta { font-size: 9.5px; color: var(--muted); min-width: 0; }
.exp-list-meta small { display: block; font-size: 8px; color: var(--muted-2); margin-bottom: 2px; }
.exp-list-progress { display: flex; align-items: center; gap: 8px; }
.exp-list-progress .progress-track { width: 70px; height: 4px; }
.exp-list-progress span { font-size: 9px; color: var(--muted); font-variant-numeric: tabular-nums; }
.exp-list-arrow { width: 26px; height: 26px; display: grid; place-items: center; color: #c1cabe; border-radius: 7px; border: 1px solid transparent; }
.experiment-list-row:hover .exp-list-arrow { border-color: var(--line); background: var(--surface-2); color: var(--green); }
.exp-list-arrow svg { width: 14px; height: 14px; }

.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 54px 24px; border: 1px dashed var(--line-strong);
  border-radius: 18px; background: rgba(255,255,255,.4);
}
.empty-icon { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 16px; background: var(--lime-soft); color: var(--green); margin-bottom: 13px; }
.empty-icon svg { width: 23px; height: 23px; }
.empty-state h3 { font-size: 14px; font-weight: 620; }
.empty-state p { color: var(--muted-2); font-size: 10.5px; margin-top: 5px; max-width: 320px; }
.empty-state .btn { margin-top: 15px; }

/* ===== Experiment detail ===== */
.back-link { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 10px; margin-bottom: 14px; padding: 4px 0; }
.back-link:hover { color: var(--ink); }
.back-link svg { width: 13px; height: 13px; }
.detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 20px; }
.detail-head-main { min-width: 0; }
.detail-meta-line { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 9px; }
.detail-code { font-family: var(--mono); font-size: 9px; color: var(--muted-2); letter-spacing: .02em; }
.detail-head h1 { font-size: clamp(23px, 2.2vw, 31px); line-height: 1.3; font-weight: 650; letter-spacing: -.035em; max-width: 850px; }
.detail-head .detail-sub { color: var(--muted); font-size: 11px; margin-top: 7px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.detail-sub .dot-sep { color: #c5cdc1; }
.detail-actions { display: flex; gap: 8px; flex: none; padding-top: 4px; }
.detail-progress-card { padding: 17px 20px; display: flex; align-items: center; gap: 22px; margin-bottom: 16px; }
.detail-progress-main { flex: 1; min-width: 0; }
.detail-progress-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.detail-progress-top span { font-size: 10px; color: var(--muted); }
.detail-progress-top strong { font-size: 19px; font-weight: 650; letter-spacing: -.03em; }
.detail-progress-meta { display: flex; align-items: center; gap: 16px; padding-left: 22px; border-left: 1px solid var(--line); flex: none; }
.detail-stat { min-width: 72px; }
.detail-stat small { display: block; color: var(--muted-2); font-size: 8.5px; margin-bottom: 3px; }
.detail-stat strong { display: block; font-size: 12px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(280px, .8fr); gap: 14px; align-items: start; }
.detail-main { display: grid; gap: 14px; }
.detail-side { display: grid; gap: 14px; position: sticky; top: calc(var(--topbar-h) + 18px); }
.detail-section { padding: 21px 22px; }
.detail-section > h2 { font-size: 13px; font-weight: 620; margin-bottom: 11px; }
.rich-text { color: #546259; font-size: 11.5px; line-height: 1.85; }
.rich-text p + p { margin-top: 9px; }
.objective-box { background: var(--surface-2); border: 1px solid #e9ede4; border-radius: 12px; padding: 14px 16px; margin-top: 13px; }
.objective-box span { font-size: 8.5px; letter-spacing: .08em; color: var(--muted-2); text-transform: uppercase; font-weight: 600; }
.objective-box p { margin-top: 5px; color: var(--ink-2); font-size: 11px; line-height: 1.75; }
.milestone-list { display: grid; gap: 2px; }
.milestone { display: flex; align-items: flex-start; gap: 11px; padding: 10px 2px; border-bottom: 1px solid #eef1ea; cursor: pointer; }
.milestone:last-child { border-bottom: 0; }
.milestone input { position: absolute; opacity: 0; pointer-events: none; }
.milestone-check { width: 18px; height: 18px; border: 1.4px solid #cbd4c6; border-radius: 6px; flex: none; margin-top: 1px; display: grid; place-items: center; color: transparent; transition: all .16s; background: var(--surface); }
.milestone-check svg { width: 11px; height: 11px; }
.milestone.done .milestone-check { background: var(--green); border-color: var(--green); color: #fff; }
.milestone-main { flex: 1; min-width: 0; }
.milestone-main strong { display: block; font-size: 10.5px; font-weight: 550; color: var(--ink-2); }
.milestone.done .milestone-main strong { color: var(--muted-2); text-decoration: line-through; text-decoration-color: #cbd4c6; }
.milestone-main span { display: block; color: var(--muted-2); font-size: 8.5px; margin-top: 3px; }
.milestone-tag { font-size: 8px; color: var(--muted-2); background: var(--surface-3); border-radius: 4px; padding: 2px 6px; flex: none; }
.milestone.done .milestone-tag { color: var(--green); background: var(--lime-soft); }

.timeline { position: relative; display: grid; gap: 0; }
.timeline-item { position: relative; display: grid; grid-template-columns: 35px 1fr; gap: 12px; padding-bottom: 19px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before { content: ""; position: absolute; left: 16.5px; top: 34px; bottom: 0; width: 1px; background: #e6eae1; }
.timeline-item:last-child::before { display: none; }
.timeline-avatar { width: 34px; height: 34px; font-size: 9.5px; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line); position: relative; z-index: 1; }
.timeline-body { min-width: 0; background: var(--surface-2); border: 1px solid #ebefe6; border-radius: 12px; padding: 12px 14px; }
.timeline-head { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.timeline-head strong { font-size: 10.5px; font-weight: 600; color: var(--ink-2); }
.timeline-head span { font-size: 8.5px; color: var(--muted-2); }
.timeline-head .status { margin-left: auto; font-size: 8px; padding: 2px 6px; }
.timeline-body p { margin-top: 6px; font-size: 10.5px; line-height: 1.7; color: #5a675e; }
.timeline-next { margin-top: 8px; border-top: 1px dashed #dfe5d9; padding-top: 7px; font-size: 9px; color: var(--muted-2); display: flex; gap: 5px; }
.timeline-next strong { color: var(--ink-2); font-weight: 550; }
.timeline-progress { display: inline-flex; align-items: center; gap: 4px; margin-top: 7px; font-size: 8.5px; color: var(--green); background: var(--lime-soft); border-radius: 5px; padding: 2px 6px; }
.timeline-progress svg { width: 10px; height: 10px; }
.timeline-empty { padding: 16px; text-align: center; color: var(--muted-2); font-size: 10px; border: 1px dashed var(--line); border-radius: 10px; }

.side-section { padding: 18px 19px; }
.side-section > h2 { font-size: 12px; font-weight: 620; margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; }
.side-section > h2 span { font-size: 8.5px; font-weight: 500; color: var(--muted-2); }
.team-list { display: grid; gap: 8px; }
.team-member { display: flex; align-items: center; gap: 9px; }
.team-member .avatar { width: 29px; height: 29px; font-size: 8px; }
.team-member div { min-width: 0; }
.team-member strong { display: block; font-size: 10px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.team-member small { display: block; font-size: 8px; color: var(--muted-2); margin-top: 1px; }
.team-member .lead-tag { margin-left: auto; font-size: 7.5px; color: var(--green); background: var(--lime-soft); padding: 2px 5px; border-radius: 4px; }
.linked-list { display: grid; gap: 6px; }
.linked-item { display: flex; align-items: center; gap: 9px; padding: 8px; border-radius: 8px; border: 1px solid #edf0e8; background: var(--surface-2); cursor: pointer; }
.linked-item:hover { border-color: #d9e1d3; background: var(--surface); }
.linked-icon { width: 26px; height: 26px; display: grid; place-items: center; background: var(--lime-soft); color: var(--green); border-radius: 7px; flex: none; }
.linked-icon.blue { background: var(--blue-soft); color: var(--blue); }
.linked-icon.amber { background: var(--amber-soft); color: var(--amber); }
.linked-icon svg { width: 13px; height: 13px; }
.linked-item div { min-width: 0; flex: 1; }
.linked-item strong { display: block; font-family: var(--font); font-size: 9.5px; font-weight: 540; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.linked-item small { display: block; font-size: 8px; color: var(--muted-2); margin-top: 1px; }
.linked-item > svg { width: 13px; height: 13px; color: #c3ccbf; }
.side-meta { display: grid; gap: 10px; }
.side-meta-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 9.5px; }
.side-meta-row span { color: var(--muted-2); }
.side-meta-row strong { color: var(--ink-2); font-weight: 550; text-align: right; }
.status-select { height: 30px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); padding: 0 7px; font-size: 9px; }

/* ===== Data page ===== */
.upload-panel {
  position: relative; overflow: hidden; margin-bottom: 16px;
  border-radius: 20px; background:
    radial-gradient(80% 150% at 95% 10%, rgba(203,245,107,.14), transparent 48%),
    linear-gradient(125deg, #0d251c 0%, #102e22 62%, #0b2018 100%);
  border: 1px solid #18382a; color: #fff;
  box-shadow: 0 22px 50px -38px rgba(6,27,19,.6);
}
.upload-panel::before {
  content: ""; position: absolute; inset: 0; opacity: .35;
  background-image: radial-gradient(rgba(255,255,255,.14) .7px, transparent .7px);
  background-size: 18px 18px; mask-image: linear-gradient(90deg, transparent 35%, #000);
  pointer-events: none;
}
.upload-panel-inner { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 26px 30px; }
.upload-copy { max-width: 480px; }
.upload-eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: 8.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--lime); border: 1px solid rgba(203,245,107,.22); border-radius: 999px; padding: 4px 9px; background: rgba(203,245,107,.07); }
.upload-eyebrow .pulse { width: 5px; height: 5px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 3px rgba(203,245,107,.13); }
.upload-copy h2 { font-size: clamp(20px, 2vw, 27px); font-weight: 620; letter-spacing: -.03em; margin-top: 11px; line-height: 1.3; }
.upload-copy h2 em { font-style: normal; color: var(--lime); }
.upload-copy p { margin-top: 7px; font-size: 10.5px; line-height: 1.7; color: rgba(255,255,255,.47); max-width: 430px; }
.upload-formats { display: flex; gap: 5px; margin-top: 11px; }
.format-chip { font-family: var(--mono); font-size: 8px; color: rgba(255,255,255,.52); background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); border-radius: 4px; padding: 2px 6px; }
.upload-drop {
  width: 370px; max-width: 42%; min-height: 130px; flex: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  border: 1.2px dashed rgba(203,245,107,.27); border-radius: 15px;
  background: rgba(255,255,255,.045); cursor: pointer; text-align: center; padding: 18px;
  transition: border-color .2s, background .2s, transform .2s;
}
.upload-drop:hover, .upload-drop.drag-over { border-color: var(--lime); background: rgba(203,245,107,.09); transform: translateY(-1px); }
.upload-drop .up-icon { width: 37px; height: 37px; border-radius: 11px; display: grid; place-items: center; background: var(--lime); color: var(--pine); margin-bottom: 2px; box-shadow: 0 5px 15px -8px rgba(203,245,107,.7); }
.upload-drop .up-icon svg { width: 18px; height: 18px; }
.upload-drop strong { font-size: 11.5px; font-weight: 550; }
.upload-drop span { font-size: 9px; color: rgba(255,255,255,.4); }
.upload-drop .browse { color: var(--lime); text-decoration: underline; text-underline-offset: 2px; }
.upload-visual { position: absolute; right: 390px; top: 50%; transform: translateY(-50%); opacity: .36; pointer-events: none; }
.upload-visual svg { width: 130px; height: 130px; }
.data-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.mini-stat { background: rgba(255,255,255,.7); border: 1px solid var(--line); border-radius: 13px; padding: 12px 14px; display: flex; align-items: center; gap: 10px; }
.mini-stat-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; flex: none; }
.mini-stat-icon svg { width: 14px; height: 14px; }
.mini-stat div { min-width: 0; }
.mini-stat small { display: block; font-size: 8.5px; color: var(--muted-2); }
.mini-stat strong { display: block; margin-top: 1px; font-size: 15px; font-weight: 640; letter-spacing: -.02em; }
.mini-stat strong em { font-style: normal; font-size: 8.5px; color: var(--muted-2); font-weight: 500; margin-left: 2px; }

.table-card { padding: 0; overflow: hidden; }
.table-card-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 17px 20px 14px; border-bottom: 1px solid #edf0e8; }
.table-card-head h2 { font-size: 13px; font-weight: 620; }
.table-card-head p { font-size: 9.5px; color: var(--muted-2); margin-top: 3px; }
.table-card-head .head-actions { display: flex; gap: 6px; }
.data-table-wrap { overflow-x: auto; }
.data-table { min-width: 800px; }
.data-table th {
  text-align: left; font-size: 8.5px; font-weight: 600; letter-spacing: .07em; color: var(--muted-2);
  text-transform: uppercase; background: var(--surface-2); padding: 9px 15px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.data-table td { padding: 12px 15px; border-bottom: 1px solid #eef1ea; font-size: 10.5px; color: var(--muted); vertical-align: middle; }
.data-table tbody tr { cursor: pointer; transition: background .15s; }
.data-table tbody tr:hover { background: #fafbf7; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.dataset-name-cell { display: flex; align-items: center; gap: 9px; min-width: 230px; }
.dataset-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; background: var(--lime-soft); color: var(--green); flex: none; }
.dataset-icon svg { width: 14px; height: 14px; }
.dataset-name-cell strong { display: block; color: var(--ink-2); font-size: 10.5px; font-weight: 560; max-width: 280px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dataset-name-cell small { display: block; color: var(--muted-2); font-size: 8.5px; margin-top: 2px; }
.table-actions { display: flex; justify-content: flex-end; gap: 2px; }
.row-action { width: 28px; height: 28px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--muted-2); display: grid; place-items: center; }
.row-action svg { width: 13px; height: 13px; }
.row-action:hover { background: var(--surface); border-color: var(--line); color: var(--ink); }
.row-action.danger:hover { color: var(--coral); background: var(--coral-soft); border-color: #f1d5cb; }
.data-type-pill { display: inline-flex; align-items: center; gap: 4px; font-size: 8.5px; color: #617468; background: var(--surface-3); border-radius: 4px; padding: 2px 6px; }
.data-type-pill::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: var(--green-2); }
.exp-link-pill { display: inline-flex; align-items: center; gap: 4px; font-size: 8.5px; color: var(--green); max-width: 160px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.exp-link-pill::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: var(--lime-2); flex: none; }
.table-empty { text-align: center; padding: 40px !important; color: var(--muted-2) !important; font-size: 10px !important; }
.data-footnote { display: flex; align-items: center; gap: 6px; justify-content: flex-end; padding: 9px 15px; border-top: 1px solid #eef1ea; color: var(--muted-2); font-size: 8.5px; }
.data-footnote svg { width: 11px; height: 11px; }

/* ===== Data detail ===== */
.data-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 16px; }
.file-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.file-badge { width: 45px; height: 45px; border-radius: 12px; background: var(--lime-soft); color: var(--green); display: grid; place-items: center; flex: none; }
.file-badge svg { width: 21px; height: 21px; }
.file-title h1 { font-size: clamp(20px, 2vw, 27px); font-weight: 630; letter-spacing: -.03em; line-height: 1.3; word-break: break-all; }
.file-title p { font-size: 9.5px; color: var(--muted-2); margin-top: 4px; display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.pill-ok { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 999px; background: #edf7ee; color: #397859; font-size: 8px; }
.pill-ok::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.data-detail-actions { display: flex; gap: 7px; flex: none; }
.data-stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.data-stat { background: var(--surface); border: 1px solid var(--line); border-radius: 13px; padding: 13px 15px; box-shadow: 0 1px 2px rgba(16,35,28,.02); }
.data-stat small { font-size: 8.5px; color: var(--muted-2); display: flex; align-items: center; gap: 5px; }
.data-stat small svg { width: 11px; height: 11px; }
.data-stat strong { display: block; margin-top: 6px; font-size: 20px; line-height: 1; font-weight: 640; letter-spacing: -.03em; }
.data-stat strong em { font-style: normal; font-size: 8.5px; color: var(--muted-2); margin-left: 3px; font-weight: 500; letter-spacing: 0; }
.data-stat span { display: block; margin-top: 5px; font-size: 8.5px; color: var(--muted-2); }
.analysis-grid { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(260px, .85fr); gap: 14px; align-items: start; }
.analysis-main { display: grid; gap: 14px; }
.analysis-side { display: grid; gap: 14px; }
.chart-panel { padding: 18px 20px 15px; }
.analysis-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.analysis-toolbar .field-mini { display: flex; align-items: center; gap: 5px; }
.analysis-toolbar label { font-size: 8.5px; color: var(--muted-2); }
.analysis-toolbar .select-wrap select { height: 30px; font-size: 9px; max-width: 160px; }
.chart-type-toggle { display: flex; gap: 2px; background: var(--surface-3); border-radius: 7px; padding: 2px; }
.chart-type-toggle button { height: 26px; border: 0; border-radius: 5px; background: transparent; color: var(--muted-2); font-size: 9px; padding: 0 8px; }
.chart-type-toggle button.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 4px rgba(16,35,28,.08); }
.analysis-chart-wrap { margin-top: 13px; min-height: 260px; }
.analysis-chart-wrap svg { width: 100%; height: auto; overflow: visible; }
.chart-note { display: flex; gap: 5px; align-items: center; margin-top: 8px; color: var(--muted-2); font-size: 8.5px; }
.chart-note svg { width: 11px; height: 11px; }
.stat-inline { display: flex; align-items: center; gap: 0; margin-top: 12px; border-top: 1px solid #edf0e8; padding-top: 10px; flex-wrap: wrap; }
.stat-inline div { min-width: 65px; padding-right: 16px; margin-right: 16px; border-right: 1px solid #edf0e8; }
.stat-inline div:last-child { border-right: 0; }
.stat-inline small { display: block; font-size: 8px; color: var(--muted-2); }
.stat-inline strong { display: block; margin-top: 2px; font-size: 11px; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.quality-card { padding: 19px 20px; }
.quality-score { display: flex; align-items: flex-end; gap: 5px; margin-top: 3px; }
.quality-score strong { font-size: 34px; line-height: 1; font-weight: 640; letter-spacing: -.045em; }
.quality-score span { font-size: 10px; color: var(--muted-2); padding-bottom: 3px; }
.quality-meter { height: 7px; border-radius: 7px; background: #e9ede4; margin: 11px 0 12px; overflow: hidden; }
.quality-meter i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--green-2), var(--lime-2)); }
.quality-rows { display: grid; gap: 7px; }
.quality-row { display: flex; align-items: center; justify-content: space-between; font-size: 9px; color: var(--muted); }
.quality-row span { display: flex; align-items: center; gap: 5px; }
.quality-row i { width: 5px; height: 5px; border-radius: 50%; }
.quality-row strong { color: var(--ink-2); font-weight: 580; }
.column-type-list { display: grid; gap: 7px; margin-top: 3px; }
.column-type-row { display: flex; align-items: center; gap: 7px; font-size: 9px; }
.column-type-row span { flex: 1; color: var(--muted); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.type-badge { flex: none; font-size: 7.5px; border-radius: 4px; padding: 1px 5px; }
.type-number { color: #3c7255; background: #edf7ee; }
.type-string { color: #5b6f9b; background: #eef2fb; }
.type-date { color: #9b7530; background: #fbf5e6; }
.type-bool { color: #7663b5; background: #f2effc; }
.type-empty { color: #8a948c; background: #f0f2ed; }
.correlation-card { padding: 18px 20px; }
.heatmap { display: grid; gap: 2px; margin-top: 9px; }
.heatmap-cell { aspect-ratio: 1; border-radius: 4px; display: grid; place-items: center; font-size: 8px; font-weight: 550; color: #23352c; cursor: default; transition: transform .12s; }
.heatmap-cell:hover { transform: scale(1.05); box-shadow: 0 3px 10px rgba(16,35,28,.13); }
.heatmap-labels-x { display: grid; gap: 2px; margin-top: 4px; }
.heatmap-labels-x span { font-size: 6.5px; color: var(--muted-2); text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-card { padding: 0; overflow: hidden; }
.preview-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px 12px; border-bottom: 1px solid #edf0e8; }
.preview-head h2 { font-size: 12.5px; font-weight: 620; }
.preview-head p { font-size: 8.5px; color: var(--muted-2); margin-top: 3px; }
.table-scroll { overflow: auto; max-height: 330px; }
.preview-table { min-width: 620px; font-size: 9.5px; }
.preview-table th { position: sticky; top: 0; z-index: 1; background: var(--surface-2); color: var(--muted-2); text-align: left; font-weight: 600; font-size: 8px; letter-spacing: .04em; padding: 8px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.preview-table td { padding: 7px 12px; border-bottom: 1px solid #f0f2ec; color: var(--muted); white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.preview-table td.numeric { font-family: var(--mono); font-size: 8.5px; color: #4c5e53; text-align: right; }
.preview-table th.numeric { text-align: right; }
.preview-table tr:hover td { background: #fbfcf8; }
.preview-table .row-index { color: #b2bbb1; font-family: var(--mono); font-size: 7.5px; text-align: right; width: 34px; }

/* ===== Instruments ===== */
.instrument-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.inst-sum-card { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); padding: 13px 15px; display: flex; align-items: center; gap: 11px; }
.inst-sum-icon { width: 33px; height: 33px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.inst-sum-icon svg { width: 16px; height: 16px; }
.inst-sum-card small { display: block; font-size: 8.5px; color: var(--muted-2); }
.inst-sum-card strong { display: block; font-size: 17px; font-weight: 640; letter-spacing: -.025em; margin-top: 1px; }
.inst-sum-card strong em { font-size: 8.5px; font-weight: 500; color: var(--muted-2); font-style: normal; letter-spacing: 0; margin-left: 2px; }
.inst-sum-card .mini-bar { margin-left: auto; width: 46px; height: 26px; flex: none; }
.schedule-card { padding: 19px 20px 15px; margin-bottom: 14px; scroll-margin-top: calc(var(--topbar-h) + 18px); }
.schedule-card .card-head { margin-bottom: 12px; }
.schedule-days { display: flex; gap: 5px; }
.schedule-day { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 8px; background: var(--surface-2); border: 1px solid #edf0e8; }
.schedule-day small { font-size: 7px; color: var(--muted-2); }
.schedule-day strong { font-size: 10px; font-weight: 600; color: var(--muted); line-height: 1.2; }
.schedule-day.today { background: var(--pine); border-color: var(--pine); }
.schedule-day.today small, .schedule-day.today strong { color: var(--lime); }
.schedule-body { display: grid; gap: 7px; overflow-x: auto; padding-bottom: 2px; }
.schedule-header { display: grid; grid-template-columns: 160px repeat(7, minmax(72px, 1fr)); gap: 4px; min-width: 720px; align-items: center; }
.schedule-header span { font-size: 7.5px; color: var(--muted-2); text-align: center; }
.schedule-header span:first-child { text-align: left; padding-left: 8px; }
.schedule-row { display: grid; grid-template-columns: 160px repeat(7, minmax(72px, 1fr)); gap: 4px; min-width: 720px; align-items: stretch; }
.schedule-name { display: flex; align-items: center; gap: 7px; min-width: 0; padding: 6px 8px; border-radius: 6px; background: var(--surface-2); }
.schedule-name span { font-size: 8px; font-weight: 520; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.schedule-name i { width: 4px; height: 18px; border-radius: 3px; flex: none; }
.schedule-cell { position: relative; min-height: 31px; border-radius: 5px; background: #f7f8f4; border: 1px solid #f0f2ec; padding: 3px; display: flex; flex-direction: column; gap: 2px; }
.schedule-chip { display: block; font-size: 7px; line-height: 1.35; color: #315d46; background: #e4f2df; border-radius: 3px; padding: 2px 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.schedule-chip.blue { background: #e8eefb; color: #4f67a0; }
.schedule-chip.amber { background: #fbf0d8; color: #926923; }
.schedule-chip.coral { background: #fbe8e1; color: #a9583e; }
.schedule-cell.today { background: #f3f7eb; }
.schedule-cell .more { font-size: 6.5px; color: var(--muted-2); }
.schedule-foot { display: flex; align-items: center; gap: 8px; margin-top: 11px; font-size: 8px; color: var(--muted-2); }

.instrument-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filter-chips { display: flex; gap: 5px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: rgba(255,255,255,.7); color: var(--muted); border-radius: 999px; padding: 5px 10px; font-size: 9px; }
.chip:hover { border-color: var(--line-strong); }
.chip.active { background: var(--pine); border-color: var(--pine); color: #fff; }
.instrument-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.instrument-card {
  position: relative; overflow: hidden; display: flex; flex-direction: column;
  border: 1px solid var(--line); border-radius: 17px; background: var(--surface);
  box-shadow: var(--shadow); cursor: pointer; transition: transform .2s, box-shadow .2s, border-color .2s;
}
.instrument-card:hover { transform: translateY(-3px); border-color: #cfd9c9; box-shadow: 0 24px 45px -30px rgba(16,35,28,.34); }
.instrument-visual { position: relative; height: 104px; overflow: hidden; background: linear-gradient(135deg, #eff5e8, #f8faf3 60%, #eef4e6); border-bottom: 1px solid #e9eee3; }
.instrument-visual::before { content: ""; position: absolute; inset: 0; opacity: .55; background-image: linear-gradient(rgba(43,104,76,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(43,104,76,.08) 1px, transparent 1px); background-size: 19px 19px; mask-image: linear-gradient(135deg, #000, transparent 80%); }
.instrument-visual.blue { background: linear-gradient(135deg, #edf2fb, #f8faff 60%, #edf2fa); }
.instrument-visual.amber { background: linear-gradient(135deg, #fbf4e6, #fffdf7 60%, #f7efdf); }
.instrument-visual.purple { background: linear-gradient(135deg, #f2effb, #fcfbff 60%, #f0edf9); }
.instrument-visual .art { position: absolute; right: 16px; bottom: -8px; width: 116px; height: 100px; color: rgba(43,104,76,.46); }
.instrument-visual.blue .art { color: rgba(90,128,223,.5); }
.instrument-visual.amber .art { color: rgba(180,130,47,.52); }
.instrument-visual.purple .art { color: rgba(128,107,209,.46); }
.instrument-visual .art svg { width: 100%; height: 100%; }
.instrument-visual .inst-cat { position: absolute; left: 13px; top: 12px; font-family: var(--mono); font-size: 7px; letter-spacing: .11em; color: var(--muted-2); text-transform: uppercase; }
.instrument-status { position: absolute; right: 12px; top: 11px; }
.instrument-body { padding: 14px 15px 13px; display: flex; flex-direction: column; flex: 1; }
.instrument-body h3 { font-size: 12.5px; line-height: 1.45; font-weight: 610; padding-right: 5px; }
.instrument-model { font-family: var(--mono); font-size: 8px; color: var(--muted-2); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.instrument-meta { display: flex; align-items: center; gap: 10px; margin-top: 9px; font-size: 8.5px; color: var(--muted-2); flex-wrap: wrap; }
.instrument-meta span { display: inline-flex; align-items: center; gap: 3px; }
.instrument-meta svg { width: 10px; height: 10px; }
.utilization { margin-top: 12px; }
.utilization-top { display: flex; justify-content: space-between; align-items: center; font-size: 8.5px; color: var(--muted-2); margin-bottom: 5px; }
.utilization-top strong { color: var(--ink-2); font-size: 9px; font-weight: 600; }
.utilization .progress-track { height: 4px; }
.utilization .progress-track > i.high { background: linear-gradient(90deg, #e0a33b, #e9bd63); }
.utilization .progress-track > i.mid { background: linear-gradient(90deg, var(--green-2), #74a883); }
.instrument-next { margin-top: 10px; padding: 7px 8px; border-radius: 7px; background: var(--surface-2); border: 1px solid #edf0e8; font-size: 8px; color: var(--muted-2); display: flex; align-items: center; gap: 5px; min-height: 28px; }
.instrument-next svg { width: 10px; height: 10px; flex: none; }
.instrument-next strong { color: var(--ink-2); font-weight: 540; }
.instrument-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 11px; padding-top: 10px; border-top: 1px solid #edf0e8; }
.custodian { display: flex; align-items: center; gap: 5px; font-size: 8px; color: var(--muted-2); }
.custodian .avatar { width: 20px; height: 20px; font-size: 6.5px; }
.inst-actions { display: flex; gap: 3px; }
.inst-actions .btn { height: 27px; padding: 0 9px; font-size: 8.5px; border-radius: 6px; }
.inst-actions .btn svg { width: 11px; height: 11px; }

/* Drawer */
.drawer-backdrop {
  position: fixed; inset: 0; z-index: 120; background: rgba(6,24,17,.38);
  backdrop-filter: blur(3px); display: flex; justify-content: flex-end;
  animation: fadeIn .2s ease;
}
.drawer {
  width: min(480px, 94vw); height: 100%; background: var(--surface);
  box-shadow: -30px 0 70px -20px rgba(7,28,20,.35);
  display: flex; flex-direction: column; animation: drawerIn .32s cubic-bezier(.2,.8,.2,1);
}
@keyframes drawerIn { from { transform: translateX(40px); opacity: .7; } to { transform: none; opacity: 1; } }
.drawer-head { padding: 17px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.drawer-head span { font-size: 9px; color: var(--muted-2); letter-spacing: .08em; text-transform: uppercase; }
.drawer-close { width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 8px; display: grid; place-items: center; background: var(--surface); color: var(--muted); }
.drawer-close:hover { background: var(--surface-2); color: var(--ink); }
.drawer-close svg { width: 15px; height: 15px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px; }
.drawer-visual { position: relative; height: 145px; border-radius: 15px; overflow: hidden; background: linear-gradient(135deg, #eff5e8, #f7faf1); border: 1px solid #e6ede0; margin-bottom: 16px; }
.drawer-visual::before { content: ""; position: absolute; inset: 0; opacity: .5; background-image: linear-gradient(rgba(43,104,76,.1) 1px, transparent 1px), linear-gradient(90deg, rgba(43,104,76,.1) 1px, transparent 1px); background-size: 22px 22px; mask-image: linear-gradient(135deg, #000, transparent 85%); }
.drawer-visual .art { position: absolute; right: 16px; bottom: -5px; width: 175px; height: 140px; color: rgba(43,104,76,.5); }
.drawer-visual .art svg { width: 100%; height: 100%; }
.drawer-visual .inst-cat { position: absolute; left: 14px; top: 13px; font-family: var(--mono); font-size: 7px; letter-spacing: .12em; color: var(--muted-2); }
.drawer-visual .drawer-status { position: absolute; left: 14px; bottom: 13px; }
.drawer-title h2 { font-size: 20px; font-weight: 630; letter-spacing: -.025em; line-height: 1.35; }
.drawer-title p { font-family: var(--mono); font-size: 8.5px; color: var(--muted-2); margin-top: 4px; }
.drawer-section { margin-top: 19px; }
.drawer-section > h3 { font-size: 10px; font-weight: 620; color: var(--ink-2); margin-bottom: 9px; display: flex; align-items: center; justify-content: space-between; }
.drawer-section > h3 span { font-size: 8px; color: var(--muted-2); font-weight: 500; }
.spec-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.spec-item { border: 1px solid #edf0e8; background: var(--surface-2); border-radius: 8px; padding: 8px 9px; }
.spec-item small { display: block; font-size: 7.5px; color: var(--muted-2); }
.spec-item strong { display: block; font-size: 9.5px; font-weight: 550; margin-top: 2px; color: var(--ink-2); }
.drawer-bookings { display: grid; gap: 6px; }
.drawer-booking { display: flex; align-items: center; gap: 9px; padding: 8px; border: 1px solid #edf0e8; border-radius: 8px; }
.drawer-booking-date { width: 34px; height: 34px; border-radius: 7px; background: var(--lime-soft); display: flex; flex-direction: column; align-items: center; justify-content: center; flex: none; }
.drawer-booking-date strong { font-size: 11px; font-weight: 620; line-height: 1.1; color: var(--green); }
.drawer-booking-date small { font-size: 6.5px; color: var(--green); }
.drawer-booking div { min-width: 0; flex: 1; }
.drawer-booking strong { display: block; font-size: 9px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drawer-booking small { display: block; font-size: 7.5px; color: var(--muted-2); margin-top: 2px; }
.drawer-booking .booking-time { font-size: 7.5px; }
.drawer-note { margin-top: 16px; padding: 10px 11px; border-radius: 8px; background: var(--amber-soft); color: #986928; font-size: 8.5px; line-height: 1.6; display: flex; gap: 7px; }
.drawer-note svg { width: 13px; height: 13px; flex: none; margin-top: 1px; }
.drawer-footer { padding: 13px 20px; border-top: 1px solid var(--line); display: flex; gap: 7px; background: var(--surface); }
.drawer-footer .btn { flex: 1; }
.maint-log { display: grid; gap: 6px; }
.maint-item { display: flex; gap: 8px; font-size: 8.5px; color: var(--muted); padding: 7px 0; border-bottom: 1px solid #eef1ea; }
.maint-item:last-child { border-bottom: 0; }
.maint-item time { flex: none; font-family: var(--mono); font-size: 7.5px; color: var(--muted-2); }
.maint-item span { flex: 1; }

/* ===== Modals & forms ===== */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  background: rgba(7,24,17,.45); backdrop-filter: blur(5px);
  animation: fadeIn .2s ease;
}
.modal {
  width: min(560px, 100%); max-height: calc(100vh - 48px);
  background: var(--surface); border-radius: 18px; box-shadow: 0 40px 100px -30px rgba(0,0,0,.5);
  display: flex; flex-direction: column; overflow: hidden;
  animation: modalIn .28s cubic-bezier(.2,.8,.2,1);
}
.modal.wide { width: min(760px, 100%); }
.modal.narrow { width: min(440px, 100%); }
@keyframes modalIn { from { opacity: 0; transform: translateY(16px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: none; } }
.modal-head { padding: 20px 23px 15px; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.modal-head .modal-kicker { font-size: 8px; letter-spacing: .11em; text-transform: uppercase; color: var(--muted-2); margin-bottom: 5px; display: flex; align-items: center; gap: 5px; }
.modal-head h2 { font-size: 19px; font-weight: 630; letter-spacing: -.025em; line-height: 1.3; }
.modal-head p { color: var(--muted); font-size: 10px; line-height: 1.55; margin-top: 4px; }
.modal-close { flex: none; width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--muted); display: grid; place-items: center; }
.modal-close:hover { background: var(--surface-2); color: var(--ink); }
.modal-close svg { width: 14px; height: 14px; }
.modal-body { padding: 19px 23px; overflow-y: auto; }
.modal-foot { padding: 14px 23px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; background: #fcfdf9; }
.modal-foot .foot-note { margin-right: auto; font-size: 8.5px; color: var(--muted-2); display: flex; align-items: center; gap: 4px; }
.modal-foot .foot-note svg { width: 11px; height: 11px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label { font-size: 9.5px; font-weight: 560; color: var(--ink-2); display: flex; align-items: center; gap: 4px; }
.field > label em { font-style: normal; color: var(--coral); }
.field > label span { font-weight: 400; color: var(--muted-2); font-size: 8px; margin-left: auto; }
.field input[type="text"], .field input[type="date"], .field input[type="time"], .field input[type="number"], .field select, .field textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
  padding: 9px 10px; font-size: 10.5px; color: var(--ink-2);
  transition: border-color .18s, box-shadow .18s;
}
.field textarea { resize: vertical; min-height: 78px; line-height: 1.6; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: #9eb79c; box-shadow: 0 0 0 3px rgba(43,104,76,.08); }
.field input::placeholder, .field textarea::placeholder { color: #adb5ad; }
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #7d897f 50%), linear-gradient(135deg, #7d897f 50%, transparent 50%); background-position: calc(100% - 13px) 50%, calc(100% - 9px) 50%; background-size: 4px 4px, 4px 4px; background-repeat: no-repeat; padding-right: 26px; cursor: pointer; }
.field-hint { font-size: 8px; color: var(--muted-2); margin-top: 1px; }
.field-error { font-size: 8.5px; color: var(--coral); margin-top: 2px; display: none; }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: #e0a18f; box-shadow: 0 0 0 3px rgba(221,110,77,.08); }
.field.invalid .field-error { display: block; }
.input-wrap { position: relative; }
.input-suffix { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: 8.5px; color: var(--muted-2); pointer-events: none; }
.input-wrap input { padding-right: 42px !important; }
.member-picker { display: flex; flex-wrap: wrap; gap: 5px; padding: 7px; border: 1px solid var(--line); border-radius: 8px; max-height: 100px; overflow-y: auto; }
.member-choice { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 999px; padding: 3px 7px 3px 4px; font-size: 8.5px; color: var(--muted); cursor: pointer; background: var(--surface); }
.member-choice .avatar { width: 18px; height: 18px; font-size: 6px; border: 0; box-shadow: none; }
.member-choice:has(input:checked) { background: var(--lime-soft); border-color: #d4e9b1; color: #375f47; }
.member-choice input { position: absolute; opacity: 0; pointer-events: none; }
.range-row { display: flex; align-items: center; gap: 12px; }
.range-row input[type="range"] { flex: 1; -webkit-appearance: none; appearance: none; height: 5px; border-radius: 5px; background: linear-gradient(90deg, var(--green) 0%, var(--green) var(--range-pct, 0%), #e8ede3 var(--range-pct, 0%), #e8ede3 100%); }
.range-row input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--lime); border: 3px solid var(--pine); box-shadow: 0 1px 5px rgba(16,35,28,.2); cursor: grab; }
.range-row input[type="range"]::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--lime); border: 3px solid var(--pine); cursor: grab; }
.range-value { width: 47px; flex: none; text-align: center; font-size: 11px; font-weight: 620; color: var(--ink-2); background: var(--surface-3); border-radius: 6px; padding: 5px 0; font-variant-numeric: tabular-nums; }
.modal-info { display: flex; gap: 8px; padding: 9px 10px; background: var(--surface-2); border: 1px solid #e9ede4; border-radius: 8px; color: var(--muted); font-size: 8.5px; line-height: 1.6; }
.modal-info svg { width: 13px; height: 13px; flex: none; margin-top: 1px; color: var(--green); }
.divider { height: 1px; background: var(--line); margin: 4px 0; }
.form-section-title { display: flex; align-items: center; gap: 8px; font-size: 8px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted-2); margin: 2px 0 -3px; }
.form-section-title::before { content: ""; width: 10px; height: 1px; background: var(--line-strong); }
.file-drop-inline { display: flex; align-items: center; gap: 9px; padding: 10px; border: 1px dashed var(--line-strong); border-radius: 8px; background: var(--surface-2); cursor: pointer; }
.file-drop-inline:hover { border-color: var(--green-2); background: var(--surface); }
.file-drop-inline .up-mini { width: 26px; height: 26px; display: grid; place-items: center; background: var(--lime-soft); color: var(--green); border-radius: 6px; flex: none; }
.file-drop-inline .up-mini svg { width: 13px; height: 13px; }
.file-drop-inline div { min-width: 0; flex: 1; }
.file-drop-inline strong { display: block; font-size: 9px; font-weight: 540; }
.file-drop-inline small { display: block; font-size: 8px; color: var(--muted-2); margin-top: 1px; }
.file-drop-inline > span { font-size: 8px; color: var(--muted-2); }
.upload-mini-progress { display: flex; align-items: center; gap: 7px; padding: 7px 0 0; font-size: 8px; color: var(--muted); }
.upload-mini-progress .progress-track { flex: 1; height: 4px; }

/* Confirm / toast / chart tip */
.confirm-body { padding: 24px; text-align: center; }
.confirm-icon { width: 48px; height: 48px; border-radius: 14px; background: var(--coral-soft); color: var(--coral); display: grid; place-items: center; margin: 0 auto 13px; }
.confirm-icon svg { width: 22px; height: 22px; }
.confirm-body h2 { font-size: 17px; font-weight: 630; }
.confirm-body p { color: var(--muted); font-size: 10.5px; line-height: 1.65; margin-top: 6px; }
.confirm-actions { display: flex; justify-content: center; gap: 8px; margin-top: 18px; }
.toast-region { position: fixed; right: 22px; bottom: 22px; z-index: 300; display: flex; flex-direction: column; gap: 8px; max-width: min(360px, calc(100vw - 32px)); }
.toast {
  display: flex; align-items: flex-start; gap: 9px; padding: 11px 13px;
  background: #102a20; color: #fff; border: 1px solid rgba(203,245,107,.16);
  border-radius: 11px; box-shadow: var(--shadow-lg);
  font-size: 10.5px; line-height: 1.55; animation: toastIn .3s ease;
}
.toast.out { animation: toastOut .25s ease forwards; }
.toast-icon { width: 22px; height: 22px; border-radius: 6px; background: rgba(203,245,107,.13); color: var(--lime); display: grid; place-items: center; flex: none; }
.toast-icon svg { width: 12px; height: 12px; }
.toast strong { display: block; font-size: 10.5px; font-weight: 580; }
.toast span { display: block; color: rgba(255,255,255,.5); font-size: 9px; margin-top: 2px; }
.toast.error { background: #3a1c17; border-color: rgba(221,110,77,.3); }
.toast.error .toast-icon { background: rgba(221,110,77,.18); color: #ffb49d; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(6px); } }
.chart-tip {
  position: fixed; z-index: 310; pointer-events: none; opacity: 0; transform: translate(-50%, -100%);
  background: #10271e; color: #fff; padding: 7px 9px; border-radius: 7px;
  font-size: 9px; line-height: 1.5; white-space: nowrap; box-shadow: 0 8px 25px -10px rgba(0,0,0,.45);
  transition: opacity .12s;
}
.chart-tip.show { opacity: 1; }
.chart-tip strong { display: block; font-weight: 570; }
.chart-tip span { color: rgba(255,255,255,.55); }

/* ===== Reports / misc ===== */
.insight-banner {
  display: flex; align-items: center; gap: 13px;
  border: 1px solid #e0e8d7; background: linear-gradient(100deg, #f6faec, #fbfcf7);
  border-radius: 14px; padding: 12px 15px; margin-top: 14px;
}
.insight-banner .ib-icon { width: 29px; height: 29px; border-radius: 8px; background: var(--lime-soft); color: var(--green); display: grid; place-items: center; flex: none; }
.insight-banner .ib-icon svg { width: 14px; height: 14px; }
.insight-banner p { font-size: 9.5px; color: var(--muted); line-height: 1.6; }
.insight-banner p strong { color: var(--ink-2); font-weight: 600; }
.insight-banner .btn { margin-left: auto; flex: none; }
.noscript { position: fixed; inset: auto 20px 20px; z-index: 350; background: var(--coral); color: white; padding: 14px; border-radius: 10px; text-align: center; }
.loading-block { display: grid; place-items: center; min-height: 280px; color: var(--muted-2); font-size: 11px; gap: 9px; }
.spinner { width: 23px; height: 23px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--green); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.hidden { display: none !important; }

/* ===== Supporting details ===== */
.badge-mono {
  font-family: var(--mono); font-size: 8px; color: var(--muted-2);
  border: 1px solid var(--line); border-radius: 5px; padding: 2px 6px;
  background: var(--surface-2); white-space: nowrap;
}
.heatmap-wrap { display: grid; gap: 3px; align-items: stretch; }
.heatmap-y {
  display: grid; gap: 2px; min-width: 0;
}
.heatmap-y span {
  display: flex; align-items: center; justify-content: flex-end;
  padding-right: 4px; font-size: 6.5px; line-height: 1.15; color: var(--muted-2);
  text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.heatmap-labels-x span { line-height: 1.2; }
.inst-sum-card .mini-bar svg { width: 46px !important; height: 26px !important; }
.inst-sum-card .mini-bar { display: flex; align-items: center; justify-content: flex-end; }
.drawer .sparkline, .drawer .kpi-spark { flex: none; }

/* ===== Responsive ===== */
@media (max-width: 1280px) {
  .experiment-grid, .instrument-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .activity-row { grid-template-columns: repeat(2, 1fr); row-gap: 12px; }
  .activity-item:nth-child(3) { padding-left: 0; border-left: 0; }
  .upload-visual { display: none; }
}
@media (min-width: 901px) and (max-width: 1199px) {
  :root { --sidebar-w: 82px; }
  .sidebar-head { justify-content: center; padding: 21px 10px 17px; }
  .brand-type, .nav-label, .nav-item > span:not(.nav-icon), .nav-badge,
  .quick-links, .sidebar-note, .user-meta, .user-card .chev, .profile-menu { display: none !important; }
  .nav-item { justify-content: center; padding: 0; height: 45px; }
  .nav-item.active::before { left: -7px; }
  .nav-icon { color: rgba(255,255,255,.55); }
  .nav-item.active .nav-icon { color: var(--lime); }
  .sidebar-footer { padding: 12px 10px 16px; }
  .user-card { justify-content: center; padding: 8px 0; }
  .topbar { padding: 0 24px; }
  .app-view { padding: 26px 24px 48px; }
  .global-search { width: 255px; }
  .detail-progress-meta { gap: 12px; padding-left: 16px; }
}
@media (max-width: 1080px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid .span-8, .dashboard-grid .span-7, .dashboard-grid .span-5, .dashboard-grid .span-4 { grid-column: span 12; }
  .donut-body { justify-content: flex-start; }
  .donut-legend { max-width: 230px; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-side { position: static; grid-template-columns: repeat(2, 1fr); }
  .analysis-grid { grid-template-columns: 1fr; }
  .analysis-side { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  :root { --sidebar-w: 0px; }
  .sidebar { width: 274px; transform: translateX(-100%); transition: transform .28s cubic-bezier(.2,.8,.2,1); box-shadow: 20px 0 60px rgba(0,0,0,.3); }
  .sidebar.open { transform: none; }
  .sidebar-close { display: grid; }
  .sidebar-scrim { display: block; position: fixed; inset: 0; z-index: 75; background: rgba(6,22,15,.4); backdrop-filter: blur(2px); opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s; }
  .sidebar-scrim.show { opacity: 1; visibility: visible; }
  .app-main { margin-left: 0; }
  .mobile-menu { display: grid; }
  .topbar { padding: 0 18px; height: 64px; }
  .app-view { padding: 22px 18px 46px; }
  .topbar-right { gap: 6px; }
  .global-search { width: 210px; }
  .global-search kbd { display: none; }
  .global-search input { padding-right: 12px; }
  .top-create span { display: none; }
  .top-create { width: 38px; padding: 0; }
  .page-head { align-items: flex-start; flex-direction: column; gap: 14px; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: none; }
  .upload-panel-inner { flex-direction: column; align-items: stretch; gap: 17px; padding: 23px; }
  .upload-drop { width: 100%; max-width: none; min-height: 107px; }
  .data-summary { grid-template-columns: repeat(2, 1fr); }
  .instrument-summary { grid-template-columns: repeat(2, 1fr); }
  .data-detail-head { flex-direction: column; gap: 13px; }
  .data-stat-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-head { flex-direction: column; gap: 13px; }
  .detail-actions { width: 100%; }
  .detail-progress-card { flex-wrap: wrap; gap: 14px; }
  .detail-progress-meta { width: 100%; border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 12px; justify-content: space-between; }
  .activity-row { grid-template-columns: 1fr 1fr; }
  .notify-panel { right: -10px; width: min(345px, calc(100vw - 28px)); }
}
@media (max-width: 720px) {
  .global-search { width: 38px; }
  .global-search > .search-icon { left: 11px; }
  .global-search input { width: 38px; padding: 0; color: transparent; cursor: pointer; }
  .global-search input::placeholder { color: transparent; }
  .global-search:focus-within { position: absolute; left: 16px; right: 16px; width: auto; z-index: 80; }
  .global-search:focus-within input { width: 100%; padding: 0 12px 0 35px; color: var(--ink); cursor: text; background: #fff; }
  .global-search:focus-within input::placeholder { color: #9aa39b; }
  .global-search:focus-within kbd { display: none; }
  .search-results { width: auto; }
  .experiment-grid, .instrument-grid { grid-template-columns: 1fr; }
  .experiment-card { min-height: 250px; }
  .toolbar { gap: 7px; }
  .toolbar-right { width: 100%; margin-left: 0; }
  .compact-search { flex: 1; }
  .compact-search input { width: 100%; }
  .experiment-list-row { grid-template-columns: 1fr auto; gap: 10px; }
  .exp-list-meta, .exp-list-progress { display: none; }
  .exp-list-arrow { grid-column: 2; grid-row: 1; }
  .detail-side { grid-template-columns: 1fr; }
  .analysis-side { grid-template-columns: 1fr; }
  .activity-row { grid-template-columns: 1fr; }
  .activity-item { padding: 8px 0; border-left: 0; border-top: 1px solid #edf0e8; }
  .activity-item:first-child { border-top: 0; }
  .activity-item:nth-child(3) { border-left: 0; }
  .card-pad { padding: 18px; }
  .chart-card, .donut-card, .detail-section, .side-section, .chart-panel, .quality-card, .correlation-card { padding-left: 17px; padding-right: 17px; }
  .form-grid { grid-template-columns: 1fr; }
  .modal-backdrop { padding: 12px; align-items: flex-end; }
  .modal { max-height: calc(100vh - 24px); border-radius: 17px; }
  .modal-head, .modal-body { padding-left: 18px; padding-right: 18px; }
  .modal-foot { padding-left: 18px; padding-right: 18px; }
  .schedule-card { padding-left: 15px; padding-right: 15px; }
  .heatmap-labels-x span { font-size: 6px; }
  .drawer { width: 100%; }
  .schedule-header, .schedule-row { grid-template-columns: 130px repeat(7, minmax(65px, 1fr)); }
  .data-table { min-width: 670px; }
  .notify-panel { position: fixed; top: 66px; right: 12px; left: 12px; width: auto; }
  .create-menu { position: fixed; top: 66px; right: 12px; width: 260px; }
  .page-head h1 { font-size: 26px; }
  .kpi-grid { gap: 9px; }
  .kpi-card { min-height: 118px; padding: 14px; }
  .kpi-value { font-size: 26px; }
  .kpi-spark { width: 58px; }
  .upload-copy h2 { font-size: 21px; }
  .toast-region { right: 12px; bottom: 12px; left: 12px; max-width: none; }
}
@media (max-width: 460px) {
  .app-view { padding: 19px 13px 40px; }
  .topbar { padding: 0 13px; }
  .crumb span, .crumb i { display: none; }
  .avatar-top { width: 32px; height: 32px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .kpi-card { min-height: 112px; }
  .kpi-label { font-size: 9.5px; }
  .kpi-spark { display: none; }
  .data-summary { grid-template-columns: 1fr 1fr; gap: 7px; }
  .mini-stat { padding: 10px; gap: 7px; }
  .mini-stat-icon { width: 26px; height: 26px; }
  .data-stat-grid { gap: 7px; }
  .data-stat { padding: 11px 12px; }
  .data-stat strong { font-size: 18px; }
  .instrument-summary { gap: 7px; }
  .inst-sum-card { padding: 10px; gap: 7px; }
  .inst-sum-icon { width: 28px; height: 28px; }
  .inst-sum-card .mini-bar { display: none; }
  .page-actions { flex-wrap: wrap; }
  .detail-actions { flex-wrap: wrap; }
  .page-actions .btn, .detail-actions .btn { flex: 1; }
  .upload-panel-inner { padding: 19px 16px; }
  .upload-copy h2 { font-size: 20px; }
  .data-detail-actions { flex-wrap: wrap; }
  .data-detail-actions .btn { flex: 1; }
  .schedule-row, .schedule-header { grid-template-columns: 115px repeat(7, 61px); }
  .tab { padding: 7px 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
