*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: "Geist", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  font-size: 13px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.wbp-app {
  --font-sans: "Geist", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --r-panel: 10px;
  --r-card: 8px;
  --r-ctrl: 6px;
  --r-pill: 9999px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  min-height: 100vh;
  background: var(--bg-canvas);
  color: var(--ink-primary);
  font-family: var(--font-sans);
  position: relative;
  transition: background-color 150ms var(--ease), color 150ms var(--ease);
}

.wbp-app[data-theme="light"] {
  color-scheme: light;
  --bg-canvas: #FFFFFF;
  --bg-rail: #F8FAFC;
  --bg-subtle: #F1F5F9;
  --bg-elevated: #FFFFFF;
  --bg-hover: #F8FAFC;

  --border-subtle: #EEF2F6;
  --border-default: #E2E8F0;
  --border-strong: #CBD5E1;

  --ink-primary: #0F172A;
  --ink-secondary: #475569;
  --ink-tertiary: #64748B;

  --accent: #4F46E5;
  --accent-hover: #4338CA;
  --accent-tint: #EEF2FF;
  --accent-tint-ink: #3730A3;
  --accent-ring: rgba(79, 70, 229, 0.22);

  --cta-bg: #0F172A;
  --cta-hover: #1E293B;
  --cta-ink: #FFFFFF;

  --success: #059669;
  --success-tint: #ECFDF5;
  --success-tint-ink: #047857;

  --warn: #D97706;
  --warn-tint: #FFFBEB;
  --warn-tint-ink: #92400E;

  --danger: #DC2626;
  --danger-tint: #FEF2F2;
  --danger-tint-ink: #B91C1C;

  --backdrop: rgba(15, 23, 42, 0.32);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-float: 0 12px 32px -4px rgba(15, 23, 42, 0.14), 0 0 0 1px rgba(15, 23, 42, 0.06);
}

.wbp-app[data-theme="dark"] {
  color-scheme: dark;
  --bg-canvas: #0B0D12;
  --bg-rail: #10131A;
  --bg-subtle: #161B24;
  --bg-elevated: #131720;
  --bg-hover: #181D27;

  --border-subtle: rgba(248, 250, 252, 0.06);
  --border-default: rgba(248, 250, 252, 0.10);
  --border-strong: rgba(248, 250, 252, 0.18);

  --ink-primary: #F8FAFC;
  --ink-secondary: #94A3B8;
  --ink-tertiary: #64748B;

  --accent: #6366F1;
  --accent-hover: #818CF8;
  --accent-tint: rgba(99, 102, 241, 0.15);
  --accent-tint-ink: #A5B4FC;
  --accent-ring: rgba(99, 102, 241, 0.30);

  --cta-bg: #F8FAFC;
  --cta-hover: #FFFFFF;
  --cta-ink: #0B0D12;

  --success: #10B981;
  --success-tint: rgba(16, 185, 129, 0.14);
  --success-tint-ink: #34D399;

  --warn: #F59E0B;
  --warn-tint: rgba(245, 158, 11, 0.14);
  --warn-tint-ink: #FBBF24;

  --danger: #EF4444;
  --danger-tint: rgba(239, 68, 68, 0.14);
  --danger-tint-ink: #F87171;

  --backdrop: rgba(2, 6, 23, 0.68);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-float: 0 20px 48px -8px rgba(0, 0, 0, 0.72), 0 0 0 1px rgba(248, 250, 252, 0.10);
}

.wbp-boot {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.wbp-wordmark {
  font-size: 14.5px;
  font-weight: 600;
  text-transform: lowercase;
  letter-spacing: -0.025em;
  color: var(--ink-primary);
}
.wbp-boot-note { font-size: 12px; color: var(--ink-tertiary); }

h1, h2, h3, h4, p { margin: 0; }
a { color: var(--accent-tint-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
button:disabled { opacity: 0.45; cursor: not-allowed; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.is-hidden { display: none !important; }

.brand-lockup { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.brand-wordmark {
  font-family: var(--font-sans);
  font-size: 14.5px;
  font-weight: 600;
  text-transform: lowercase;
  letter-spacing: -0.025em;
  line-height: 1;
  color: var(--ink-primary);
}

.t-h1 { font-size: 18px; line-height: 1.25; font-weight: 600; letter-spacing: -0.022em; color: var(--ink-primary); }
.t-h2 { font-size: 14px; line-height: 1.32; font-weight: 600; letter-spacing: -0.015em; color: var(--ink-primary); }
.t-body { font-size: 13px; line-height: 1.45; }
.t-sm { font-size: 12.5px; line-height: 1.42; }
.t-xs { font-size: 11.5px; line-height: 1.4; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.c-sec { color: var(--ink-secondary); }
.c-ter { color: var(--ink-tertiary); }

.row { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.stack-sm { display: flex; flex-direction: column; gap: 4px; }
.stack-lg { display: flex; flex-direction: column; gap: 15px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }

/* Shell */
.shell { display: grid; grid-template-columns: 224px minmax(0, 1fr); min-height: 100vh; }

.rail {
  background: var(--bg-rail);
  border-right: 1px solid var(--border-default);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 12px 10px;
  position: sticky;
  top: 0;
  height: 100vh;
  min-width: 0;
}
.rail-top { display: flex; flex-direction: column; gap: 9px; }
.rail-brand { padding: 3px 6px; }

.org-switch-wrap { position: relative; }
.org-switch-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  padding: 5px 8px;
  border-radius: var(--r-ctrl);
  border: 1px solid var(--border-default);
  background: var(--bg-elevated);
  color: var(--ink-primary);
  font-size: 12.5px;
  font-weight: 500;
  text-align: left;
  box-shadow: var(--shadow-sm);
}
.org-switch-btn:hover, .org-switch-btn.is-active { border-color: var(--border-strong); background: var(--bg-hover); }
.org-switch-main { display: flex; align-items: center; gap: 7px; min-width: 0; flex: 1; }
.org-monogram {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-default);
  color: var(--ink-primary);
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.org-switch-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.org-popover {
  position: absolute;
  left: 0;
  right: -14px;
  top: calc(100% + 5px);
  z-index: 48;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-panel);
  box-shadow: var(--shadow-float);
  padding: 5px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.org-popover.is-mobile { display: none; position: fixed; top: 48px; left: 10px; right: auto; width: 256px; max-width: calc(100vw - 20px); }
.org-section-lbl { padding: 4px 8px 2px; font-size: 11px; font-weight: 500; color: var(--ink-tertiary); }
.org-row-sub { font-size: 11.5px; color: var(--ink-tertiary); font-weight: 400; white-space: nowrap; }
.org-switch-btn.mobile-only-inline { display: none; }

.rail-nav { display: flex; flex-direction: column; gap: 2px; margin-top: 2px; }
.rail-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 8px;
  border-radius: var(--r-ctrl);
  color: var(--ink-secondary);
  font-size: 12.5px;
  font-weight: 500;
  text-align: left;
}
.rail-btn:hover { background: var(--bg-subtle); color: var(--ink-primary); }
.rail-btn.is-active { background: var(--bg-subtle); color: var(--ink-primary); font-weight: 600; }
.rail-btn-l { display: flex; align-items: center; gap: 8px; }
.badge-dot { width: 6px; height: 6px; border-radius: var(--r-pill); background: var(--accent); flex-shrink: 0; }
.rail-foot { border-top: 1px solid var(--border-subtle); padding-top: 8px; display: flex; flex-direction: column; gap: 5px; }
.account-menu-wrap { position: relative; }
.profile-btn { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 7px; padding: 5px 7px; border-radius: var(--r-ctrl); text-align: left; border: 1px solid transparent; }
.profile-btn:hover, .profile-btn.is-active { background: var(--bg-subtle); border-color: var(--border-subtle); }
.profile-avatar { width: 24px; height: 24px; border-radius: var(--r-ctrl); background: var(--cta-bg); color: var(--cta-ink); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; flex-shrink: 0; }
.profile-meta { min-width: 0; display: flex; flex-direction: column; gap: 0; flex: 1; }
.profile-name { font-size: 12.5px; font-weight: 600; color: var(--ink-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-email { font-size: 11.5px; color: var(--ink-tertiary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-popover { position: absolute; left: 0; right: -12px; bottom: calc(100% + 6px); z-index: 48; background: var(--bg-elevated); border: 1px solid var(--border-strong); border-radius: var(--r-panel); box-shadow: var(--shadow-float); padding: 5px; display: flex; flex-direction: column; gap: 2px; }
.account-popover.is-mobile { display: none; position: fixed; top: 48px; right: 10px; left: auto; bottom: auto; width: 236px; }
.menu-hdr { padding: 6px 8px; display: flex; flex-direction: column; gap: 1px; }
.menu-sep { height: 1px; background: var(--border-subtle); margin: 4px 2px; }
.menu-item { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px; border-radius: var(--r-ctrl); font-size: 12.5px; font-weight: 500; color: var(--ink-primary); text-align: left; }
.menu-item:hover { background: var(--bg-subtle); }
.menu-item--danger { color: var(--danger-tint-ink); }
.menu-item--danger:hover { background: var(--danger-tint); }
.menu-theme-row { padding: 5px 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--ink-secondary); }
.mobile-avatar-btn { display: none; width: 26px; height: 26px; border-radius: var(--r-ctrl); background: var(--cta-bg); color: var(--cta-ink); font-size: 11px; font-weight: 600; align-items: center; justify-content: center; flex-shrink: 0; }

.main-col { display: flex; flex-direction: column; min-width: 0; background: var(--bg-canvas); }
.topbar {
  height: 44px;
  padding: 0 22px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg-canvas);
}
.topbar-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.topbar-right { display: flex; align-items: center; gap: 7px; flex-shrink: 0; }
.mobile-only-inline, .btn.mobile-only-inline { display: none; }

.crumb-btn { font-size: 12.5px; font-weight: 500; color: var(--ink-secondary); padding: 3px 6px; border-radius: 5px; }
.crumb-btn:hover { background: var(--bg-subtle); color: var(--ink-primary); }

.main-view { width: 100%; max-width: 980px; margin: 0 auto; padding: 18px 22px 72px; display: flex; flex-direction: column; gap: 15px; min-width: 0; }

/* Buttons & Inputs */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 11px;
  border-radius: var(--r-ctrl);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  border: 1px solid transparent;
  text-decoration: none;
  transition: background-color 120ms var(--ease), border-color 120ms var(--ease), color 120ms var(--ease);
}
.btn:hover { text-decoration: none; }
.btn--accent { background: var(--accent); color: #FFFFFF; }
.btn--accent:hover { background: var(--accent-hover); }
.btn--primary { background: var(--cta-bg); color: var(--cta-ink); }
.btn--primary:hover { background: var(--cta-hover); }
.btn--secondary { background: var(--bg-elevated); color: var(--ink-primary); border-color: var(--border-default); box-shadow: var(--shadow-sm); }
.btn--secondary:hover { background: var(--bg-hover); border-color: var(--border-strong); }
.btn--danger { background: var(--danger); color: #FFFFFF; }
.btn--quiet { background: transparent; color: var(--ink-secondary); }
.btn--quiet:hover { background: var(--bg-subtle); color: var(--ink-primary); }
.btn--sm { padding: 5px 9px; font-size: 12px; }
.btn--xs { padding: 3px 7px; font-size: 11.5px; }

.icon-btn {
  position: relative;
  width: 30px;
  height: 30px;
  border-radius: var(--r-ctrl);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-secondary);
  border: 1px solid transparent;
}
.icon-btn:hover { background: var(--bg-subtle); color: var(--ink-primary); }
.bell-count {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  border-radius: 99px;
  background: var(--accent);
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.field { display: flex; flex-direction: column; gap: 5px; }
.field-head { display: flex; align-items: center; justify-content: space-between; font-size: 12px; font-weight: 500; color: var(--ink-primary); }
.input, .select, .textarea {
  width: 100%;
  padding: 6px 10px;
  border-radius: var(--r-ctrl);
  border: 1px solid var(--border-default);
  background-color: var(--bg-elevated);
  color: var(--ink-primary);
  font-size: 12.5px;
}
select.select {
  padding-right: 28px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}
.wbp-app[data-theme="dark"] select.select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.textarea { min-height: 76px; resize: vertical; }

.panel { background: var(--bg-elevated); border: 1px solid var(--border-default); border-radius: var(--r-card); }
.panel-pad { padding: 14px 16px; }

.callout {
  padding: 10px 13px;
  border-radius: var(--r-card);
  border: 1px solid var(--border-default);
  background: var(--bg-rail);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.callout--warn { background: var(--warn-tint); border-color: rgba(217, 119, 6, 0.28); color: var(--warn-tint-ink); }
.callout--danger { background: var(--danger-tint); border-color: rgba(220, 38, 38, 0.28); color: var(--danger-tint-ink); }
.callout--accent { background: var(--accent-tint); border-color: var(--accent-ring); }
.callout--success { background: var(--success-tint); border-color: rgba(5, 150, 105, 0.28); }

.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--border-default);
  border-radius: var(--r-card);
  background: var(--bg-rail);
  overflow: hidden;
}
.stat-cell { padding: 10px 14px; border-right: 1px solid var(--border-subtle); display: flex; flex-direction: column; gap: 2px; }
.stat-cell:last-child { border-right: 0; }
.stat-val { font-size: 15px; font-weight: 600; color: var(--ink-primary); font-variant-numeric: tabular-nums; }

.seg { display: inline-flex; padding: 2px; border-radius: var(--r-ctrl); background: var(--bg-subtle); border: 1px solid var(--border-subtle); gap: 2px; }
.seg-btn { padding: 4px 9px; border-radius: 5px; font-size: 12px; font-weight: 500; color: var(--ink-secondary); }
.seg-btn.is-active { background: var(--bg-elevated); color: var(--ink-primary); font-weight: 600; box-shadow: var(--shadow-sm); }

.status-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500; color: var(--ink-secondary); white-space: nowrap; }
.dot { width: 6px; height: 6px; border-radius: var(--r-pill); flex-shrink: 0; background: var(--ink-tertiary); }
.dot--live { background: var(--success); }
.dot--setup { background: var(--warn); }
.dot--danger { background: var(--danger); }

.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: var(--r-ctrl); font-size: 11.5px; font-weight: 500; background: var(--bg-subtle); color: var(--ink-secondary); white-space: nowrap; }
.chip--accent { background: var(--accent-tint); color: var(--accent-tint-ink); }
.chip--success { background: var(--success-tint); color: var(--success-tint-ink); }
.chip--warn { background: var(--warn-tint); color: var(--warn-tint-ink); }
.chip--danger { background: var(--danger-tint); color: var(--danger-tint-ink); }

/* Uniform 4-Column Publications Grid */
.linear-list { border: 1px solid var(--border-default); border-radius: var(--r-card); background: var(--bg-elevated); overflow: hidden; }
.linear-head {
  display: grid;
  grid-template-columns: minmax(200px, 1.6fr) 220px 176px 154px;
  align-items: center;
  gap: 14px;
  padding: 7px 14px;
  border-bottom: 1px solid var(--border-default);
  background: var(--bg-rail);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink-tertiary);
}
.linear-head > :last-child { text-align: right; }
.linear-row {
  display: grid;
  grid-template-columns: minmax(200px, 1.6fr) 220px 176px 154px;
  align-items: center;
  gap: 14px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background-color 110ms var(--ease);
}
.linear-row:last-child { border-bottom: 0; }
.linear-row:hover { background: var(--bg-hover); }
.linear-col { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.linear-ident { display: flex; align-items: center; gap: 10px; min-width: 0; }
.monogram { width: 26px; height: 26px; border-radius: var(--r-ctrl); background: var(--bg-subtle); border: 1px solid var(--border-default); color: var(--ink-primary); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; flex-shrink: 0; }
.linear-name-block { min-width: 0; display: flex; flex-direction: column; gap: 0; }
.linear-name { font-size: 13px; font-weight: 600; color: var(--ink-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.linear-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; white-space: nowrap; min-width: 0; }

.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.choice-card { background: var(--bg-elevated); border: 1px solid var(--border-default); border-radius: var(--r-card); padding: 16px; display: flex; flex-direction: column; justify-content: space-between; gap: 12px; }
.choice-card.is-featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-ring); }

.audit-row { padding: 9px 14px; border-bottom: 1px solid var(--border-subtle); display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.audit-row:last-child { border-bottom: 0; }
.kv-list { display: flex; flex-direction: column; }
.kv-row { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border-subtle); font-size: 12.5px; }
.kv-row:last-child { border-bottom: 0; }

.t-row { padding: 11px 14px; border-bottom: 1px solid var(--border-subtle); display: flex; flex-direction: column; gap: 6px; cursor: pointer; }
.t-row:last-child { border-bottom: 0; }
.t-row:hover { background: var(--bg-hover); }
.msg-bubble { padding: 9px 12px; border-radius: var(--r-card); border: 1px solid var(--border-subtle); background: var(--bg-rail); display: flex; flex-direction: column; gap: 3px; }

.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; text-align: left; font-size: 12.5px; }
table.tbl th { padding: 8px 14px; font-size: 11.5px; font-weight: 500; color: var(--ink-tertiary); border-bottom: 1px solid var(--border-default); background: var(--bg-rail); white-space: nowrap; }
table.tbl td { padding: 8px 14px; border-bottom: 1px solid var(--border-subtle); vertical-align: middle; }
table.tbl tr:last-child td { border-bottom: 0; }
.td-nowrap { white-space: nowrap; }
.id-col { display: inline-block; min-width: 68px; white-space: nowrap; }
.mobile-ledger { display: none; }

/* Support Attachments */
.attach-zone { border: 1px dashed var(--border-strong); border-radius: var(--r-card); background: var(--bg-rail); padding: 10px 12px; display: flex; flex-direction: column; gap: 7px; }
.attach-zone-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.attach-list { display: flex; flex-wrap: wrap; gap: 5px; }
.attach-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 7px; border-radius: var(--r-ctrl); background: var(--bg-elevated); border: 1px solid var(--border-default); font-size: 11.5px; color: var(--ink-primary); max-width: 100%; }
.attach-chip-name { max-width: 170px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.attach-err { padding: 8px 10px; border-radius: var(--r-ctrl); background: var(--danger-tint); border: 1px solid rgba(220, 38, 38, 0.28); color: var(--danger-tint-ink); font-size: 11.5px; display: flex; align-items: flex-start; gap: 7px; line-height: 1.4; }
.attach-row { padding: 7px 10px; border-radius: var(--r-ctrl); border: 1px solid var(--border-default); background: var(--bg-rail); display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* Drawer & Modal */
.drawer-backdrop { position: fixed; inset: 0; z-index: 50; background: var(--backdrop); opacity: 0; pointer-events: none; transition: opacity 180ms var(--ease); display: flex; justify-content: flex-end; }
.drawer-backdrop.is-open { opacity: 1; pointer-events: auto; }
.drawer-panel { width: 100%; max-width: 472px; height: 100vh; background: var(--bg-elevated); border-left: 1px solid var(--border-default); box-shadow: var(--shadow-float); display: flex; flex-direction: column; transform: translateX(100%); transition: transform 220ms var(--ease); }
.drawer-backdrop.is-open .drawer-panel { transform: translateX(0); }
.drawer-hd { padding: 13px 16px; border-bottom: 1px solid var(--border-subtle); display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.drawer-bd { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 11px; }
.drawer-ft { padding: 10px 16px; border-top: 1px solid var(--border-subtle); background: var(--bg-elevated); display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }

.modal-backdrop { position: fixed; inset: 0; z-index: 60; background: var(--backdrop); display: none; align-items: center; justify-content: center; padding: 16px; }
.modal-backdrop.is-open { display: flex; }
.modal-box { width: 100%; max-width: 420px; background: var(--bg-elevated); border: 1px solid var(--border-strong); border-radius: var(--r-panel); box-shadow: var(--shadow-float); padding: 18px; display: flex; flex-direction: column; gap: 12px; }

/* Notification Popover */
.notif-wrap { position: relative; }
.notif-popover {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  width: 320px;
  max-width: calc(100vw - 24px);
  z-index: 48;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-panel);
  box-shadow: var(--shadow-float);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.notif-list { max-height: 300px; overflow-y: auto; }
.notif-item { padding: 9px 12px; border-bottom: 1px solid var(--border-subtle); display: flex; flex-direction: column; gap: 2px; }
.notif-item:last-child { border-bottom: 0; }
.notif-item.is-unread { background: var(--accent-tint); }

/* Toast */
.toast-stack { position: fixed; left: 238px; bottom: 16px; z-index: 70; pointer-events: none; max-width: calc(100vw - 260px); }
.toast { pointer-events: auto; padding: 8px 13px; border-radius: var(--r-ctrl); background: var(--cta-bg); color: var(--cta-ink); box-shadow: var(--shadow-float); font-size: 12px; font-weight: 500; }
.toast--error { background: var(--danger); color: #FFFFFF; }

/* Auth */
.auth-canvas { min-height: 100vh; background: var(--bg-rail); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 28px 16px; gap: 16px; }
.auth-card { width: 100%; max-width: 400px; background: var(--bg-elevated); border: 1px solid var(--border-default); border-radius: var(--r-panel); box-shadow: var(--shadow-sm); padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.dev-code-box { padding: 8px 10px; border-radius: var(--r-ctrl); background: var(--accent-tint); border: 1px solid var(--accent-ring); color: var(--accent-tint-ink); font-size: 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.mobile-bottom-nav { display: none; }

@media (max-width: 1023px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail, .desktop-only, .row.desktop-only { display: none; }
  .topbar { padding: 7px 10px; min-height: 46px; height: auto; gap: 6px; }
  .topbar-left { min-width: 0; flex: 1; }
  .topbar-right { gap: 4px; }
  .mobile-only-inline, .btn.mobile-only-inline, .org-switch-btn.mobile-only-inline { display: inline-flex; }
  .mobile-avatar-btn { display: inline-flex; }
  .account-popover.is-mobile, .org-popover.is-mobile { display: flex; }
  .org-switch-btn.mobile-only-inline { width: auto; max-width: 152px; min-width: 0; padding: 4px 7px; gap: 6px; font-size: 12px; }
  .main-view { padding: 14px 12px 86px; }
  .toast-stack { left: 50%; bottom: 68px; transform: translateX(-50%); max-width: calc(100vw - 24px); }
  .mobile-bottom-nav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); position: fixed; left: 10px; right: 10px; bottom: 10px; z-index: 38; background: var(--bg-elevated); border: 1px solid var(--border-strong); border-radius: var(--r-panel); box-shadow: var(--shadow-float); padding: 4px; }
  .mobile-nav-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 5px 4px; border-radius: var(--r-ctrl); font-size: 11.5px; font-weight: 500; color: var(--ink-secondary); }
  .mobile-nav-btn.is-active { background: var(--bg-subtle); color: var(--ink-primary); font-weight: 600; }
}

@media (max-width: 720px) {
  .linear-head { display: none; }
  .linear-row { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .linear-actions { justify-content: flex-start; }
  .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-cell { border-right: 0; border-bottom: 1px solid var(--border-subtle); }
  .stat-cell:nth-child(odd) { border-right: 1px solid var(--border-subtle); }
  .stat-cell:nth-child(n+3) { border-bottom: 0; }
  .choice-grid, .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .tbl-wrap.desktop-tbl { display: none; }
  .mobile-ledger { display: flex; flex-direction: column; gap: 8px; }
  .drawer-panel { max-width: 100%; border-left: 0; }
}

.underline-tabs {
  display: flex;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid var(--border-subtle);
  overflow-x: auto;
}
.u-tab {
  position: relative;
  padding: 8px 2px 9px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-secondary);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 120ms var(--ease), border-color 120ms var(--ease);
}
.u-tab:hover { color: var(--ink-primary); }
.u-tab.is-active {
  color: var(--ink-primary);
  font-weight: 600;
  border-bottom-color: var(--accent);
}

.check-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-ctrl);
  background: var(--bg-canvas);
  overflow: hidden;
}
.check-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 11px;
  border-bottom: 1px solid var(--border-subtle);
}
.check-row:last-child { border-bottom: 0; }
.check-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

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