/* ==========================================================================
   签到工作台 · design system
   Monochrome canvas with a dotted work surface. Status hues are reserved for semantics.
   ========================================================================== */

:root {
  --font-sans: "Inter", "Segoe UI Variable Text", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", "Songti SC", "Noto Serif SC", "STSong", serif;
  --font-mono: "SFMono-Regular", "JetBrains Mono", "Cascadia Code", Consolas, "Liberation Mono", monospace;

  --bg: #f2f2f2;
  --bg-deep: #eaeaea;
  --canvas: #fafafa;
  --dot: rgba(0, 0, 0, 0.055);
  --surface: #ffffff;
  --surface-2: #f5f5f5;
  --surface-3: #ececec;
  --line: #e5e5e5;
  --line-strong: #cfcfcf;
  --ink: #111111;
  --ink-2: #555555;
  --ink-3: #8a8a8a;
  --ink-4: #b0b0b0;

  --accent: #111111;
  --accent-strong: #000000;
  --accent-soft: #ededed;
  --accent-soft-strong: #e0e0e0;
  --accent-ink: #111111;
  --accent-contrast: #ffffff;
  --auth-panel: #0f0f0f;
  --auth-dot: rgba(255, 255, 255, 0.12);

  --success: #2f7d54;
  --success-soft: #e8f3ed;
  --warning: #8a5a00;
  --warning-soft: #f7efdf;
  --danger: #a93636;
  --danger-soft: #f7e9e7;
  --info: #35578a;
  --info-soft: #e9eef6;

  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-2: 0 18px 48px -28px rgba(0, 0, 0, 0.35), 0 2px 8px -4px rgba(0, 0, 0, 0.08);
  --shadow-3: 0 40px 100px -48px rgba(0, 0, 0, 0.55);
  --ring: 0 0 0 3px rgba(0, 0, 0, 0.12);

  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;

  --rail-w: 236px;
  --topbar-h: 64px;
  --page-pad: clamp(16px, 2.4vw, 32px);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

html[data-theme="dark"] {
  --bg: #090b10;
  --bg-deep: #050505;
  --canvas: #141414;
  --dot: rgba(255, 255, 255, 0.09);
  --surface: #181818;
  --surface-2: #1f1f1f;
  --surface-3: #282828;
  --line: #2a2a2a;
  --line-strong: #3c3c3c;
  --ink: #f4f4f4;
  --ink-2: #b4b4b4;
  --ink-3: #858585;
  --ink-4: #626262;

  --accent: #f2f2f2;
  --accent-strong: #ffffff;
  --accent-soft: #242424;
  --accent-soft-strong: #323232;
  --accent-ink: #f4f4f4;
  --accent-contrast: #0a0a0a;
  --auth-panel: #151515;
  --auth-dot: rgba(255, 255, 255, 0.1);

  --success: #7fc9a0;
  --success-soft: rgba(127, 201, 160, 0.12);
  --warning: #e0b35f;
  --warning-soft: rgba(224, 179, 95, 0.12);
  --danger: #ef8c82;
  --danger-soft: rgba(239, 140, 130, 0.12);
  --info: #9ab4e0;
  --info-soft: rgba(154, 180, 224, 0.12);

  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-2: 0 24px 60px -30px rgba(0, 0, 0, 0.8), 0 2px 8px -4px rgba(0, 0, 0, 0.5);
  --shadow-3: 0 50px 120px -50px rgba(0, 0, 0, 0.9);
  --ring: 0 0 0 3px rgba(255, 255, 255, 0.18);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  isolation: isolate;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--accent-soft-strong);
  color: var(--accent-ink);
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-strong);
}

h1,
h2,
h3,
h4,
p,
dl,
dd,
dt,
figure {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

code,
kbd,
pre {
  font-family: var(--font-mono);
}

code {
  font-size: 0.92em;
  padding: 0.12em 0.4em;
  border-radius: 5px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink-2);
}

kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink-3);
  font-size: 10px;
  line-height: 1;
  box-shadow: 0 1px 0 var(--line-strong);
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border: 3px solid transparent;
  background-clip: padding-box;
  border-radius: 999px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

.eyebrow {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.4;
  text-transform: uppercase;
  color: var(--ink-3);
}

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

.sep {
  color: var(--ink-4);
}

.required {
  color: var(--danger);
  font-weight: 700;
}

.row {
  display: flex;
  align-items: center;
}

.row--wrap {
  flex-wrap: wrap;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-sm {
  width: 15px;
  height: 15px;
}

.icon-lg {
  width: 22px;
  height: 22px;
}

.skip-link {
  position: fixed;
  top: -60px;
  left: 16px;
  z-index: 999;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-contrast);
  font-weight: 600;
  transition: top 0.15s var(--ease);
}

.skip-link:focus {
  top: 12px;
  color: var(--accent-contrast);
}

/* Dynamic background ------------------------------------------------------ */

.aurora-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 0%, rgba(7, 193, 96, 0.05) 0%, transparent 45%),
    radial-gradient(circle at 80% 100%, rgba(59, 130, 246, 0.03) 0%, transparent 50%);
}

.dot-field {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 58%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 58%, transparent 100%);
}

.dot-grid,
.dot-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.dot-grid {
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0 0.9px, transparent 1.6px);
  background-size: 26px 26px;
}

.dot-glow {
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.9) 0 1.15px, transparent 1.95px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(
    circle 240px at var(--mx, 50%) var(--my, 6%),
    #000 0%,
    rgba(0, 0, 0, 0.6) 42%,
    transparent 100%
  );
  mask-image: radial-gradient(
    circle 240px at var(--mx, 50%) var(--my, 6%),
    #000 0%,
    rgba(0, 0, 0, 0.6) 42%,
    transparent 100%
  );
}

.noscript-note {
  position: fixed;
  inset: auto 16px 16px;
  z-index: 300;
  padding: 12px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow-2);
  font-size: 12px;
  color: var(--ink-2);
}

/* ==========================================================================
   Shell
   ========================================================================== */

.app-shell {
  min-height: 100vh;
}

.rail {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  width: var(--rail-w);
  display: flex;
  flex-direction: column;
  padding: 20px 14px 14px;
  background: var(--bg);
  border-right: 1px solid var(--line);
}

.rail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 4px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 4px 4px 20px;
  color: var(--ink);
}

.brand:hover {
  color: var(--ink);
}

.brand-mark {
  width: 32px;
  height: 32px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--accent);
  color: var(--accent-contrast);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 5px 14px -8px rgba(0, 0, 0, 0.55);
}

.brand-mark svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.2;
}

.brand-copy strong {
  font-size: 13.5px;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.brand-copy span {
  margin-top: 3px;
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--ink-4);
}

.rail .rail-close {
  display: none;
}

.nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 0;
  overflow-y: auto;
  padding-top: 4px;
}

.nav-group {
  margin-top: 20px;
}

.nav-label {
  padding: 0 10px 7px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-4);
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 37px;
  padding: 0 10px;
  border-radius: 8px;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 520;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}

.nav-item .icon {
  width: 17px;
  height: 17px;
  color: var(--ink-3);
  transition: color 0.15s var(--ease);
}

.nav-item:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.nav-item:hover .icon {
  color: var(--ink-2);
}

.nav-item.is-active {
  background: var(--accent);
  color: var(--accent-contrast);
  font-weight: 620;
}

.nav-item.is-active .icon {
  color: var(--accent-contrast);
}

.nav-item.is-active:hover {
  background: var(--accent-strong);
  color: var(--accent-contrast);
}

.rail-foot {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.nav-item--settings {
  color: var(--ink-3);
}

.rail-user {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px;
  border-radius: 10px;
}

.rail-user-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.rail-user-copy strong {
  font-size: 12px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rail-user-copy span {
  margin-top: 2px;
  font-size: 10px;
  color: var(--ink-4);
}

.rail-scrim {
  display: none;
}

.main-column {
  position: relative;
  z-index: 0;
  min-width: 0;
  min-height: 100vh;
  margin-left: var(--rail-w);
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 var(--page-pad);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.topbar .rail-toggle {
  display: none;
}

.page-identity {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.15;
}

.page-kicker {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-4);
}

.page-identity h1 {
  margin-top: 3px;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink-3);
  font-size: 11.5px;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease), color 0.15s var(--ease);
}

.search-trigger:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
  color: var(--ink-2);
}

.search-trigger .icon {
  width: 15px;
  height: 15px;
}

.search-trigger kbd {
  margin-left: 2px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-2);
  transition: background 0.15s var(--ease), color 0.15s var(--ease), border-color 0.15s var(--ease);
}

.icon-btn:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.icon-btn .icon {
  width: 17px;
  height: 17px;
}

.theme-icon-dark {
  display: none;
}

html[data-theme="dark"] .theme-icon-light {
  display: none;
}

html[data-theme="dark"] .theme-icon-dark {
  display: block;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 550;
  white-space: nowrap;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}

.status-chip:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
  color: var(--ink);
}

.status-dot {
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--ink-4);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink-4) 14%, transparent);
}

.status-chip[data-state="online"] .status-dot,
[data-state="online"] > .status-dot {
  background: var(--success);
  box-shadow: 0 0 0 3px var(--success-soft);
  animation: status-pulse 2.6s ease-in-out infinite;
}

.status-chip[data-state="stale"] .status-dot,
[data-state="stale"] > .status-dot {
  background: var(--warning);
  box-shadow: 0 0 0 3px var(--warning-soft);
}

.status-chip[data-state="offline"] .status-dot,
[data-state="offline"] > .status-dot {
  background: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-soft);
}

.status-chip[data-state="checking"] .status-dot,
[data-state="checking"] > .status-dot {
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  animation: status-pulse 1.6s ease-in-out infinite;
}

.offline-banner {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 10px var(--page-pad) 0;
  padding: 8px 12px;
  border: 1px solid color-mix(in srgb, var(--warning) 28%, var(--line));
  border-radius: 8px;
  background: var(--warning-soft);
  color: var(--warning);
  font-size: 12px;
}

.offline-banner .icon {
  width: 15px;
  height: 15px;
}

.offline-banner .btn {
  margin-left: auto;
  color: var(--warning);
}

.page {
  width: 100%;
  max-width: 1440px;
  flex: 1;
  margin: 0 auto;
  padding: 24px var(--page-pad) 36px;
}

.page:focus {
  outline: none;
}

.page > .overview,
.page > .workspace,
.page > .page-stack,
.page > .settings-layout {
  animation: page-in 0.32s var(--ease) both;
}

.flash-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

/* ==========================================================================
   Buttons, inputs, small controls
   ========================================================================== */

.btn {
  --btn-bg: var(--surface);
  --btn-border: var(--line-strong);
  --btn-color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 34px;
  padding: 0 13px;
  border: 1px solid var(--btn-border);
  border-radius: 8px;
  background: var(--btn-bg);
  color: var(--btn-color);
  font-size: 12.5px;
  font-weight: 560;
  line-height: 1;
  white-space: nowrap;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease), transform 0.1s var(--ease);
}

.btn:hover {
  background: var(--surface-2);
  border-color: var(--ink-4);
  color: var(--ink);
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn .icon {
  width: 15px;
  height: 15px;
}

.btn-primary {
  --btn-bg: var(--accent);
  --btn-border: var(--accent);
  --btn-color: var(--accent-contrast);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 1px 2px rgba(0, 0, 0, 0.18);
}

.btn-primary:hover {
  --btn-bg: var(--accent-strong);
  --btn-border: var(--accent-strong);
  --btn-color: var(--accent-contrast);
  color: var(--accent-contrast);
}

.btn-quiet,
.btn-ghost {
  --btn-bg: transparent;
  --btn-border: transparent;
  --btn-color: var(--ink-2);
}

.btn-quiet:hover,
.btn-ghost:hover {
  background: var(--surface-2);
  border-color: transparent;
  color: var(--ink);
}

.btn-danger {
  --btn-bg: transparent;
  --btn-border: color-mix(in srgb, var(--danger) 28%, var(--line));
  --btn-color: var(--danger);
}

.btn-danger:hover {
  background: var(--danger-soft);
  border-color: color-mix(in srgb, var(--danger) 36%, var(--line));
  color: var(--danger);
}

.btn-sm {
  height: 30px;
  padding: 0 10px;
  font-size: 12px;
  border-radius: 7px;
}

.btn-block {
  width: 100%;
  height: 40px;
}

.btn.is-busy {
  pointer-events: none;
}

.btn.is-busy .icon,
.is-busy .icon {
  animation: spin 0.8s linear infinite;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
}

.field-hint {
  font-size: 11px;
  line-height: 1.5;
  color: var(--ink-3);
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease), background 0.15s var(--ease);
}

.input::placeholder,
.textarea::placeholder {
  color: var(--ink-4);
}

.input:hover,
.select:hover,
.textarea:hover {
  border-color: var(--ink-4);
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--ring);
}

.input:disabled,
.select:disabled,
.textarea:disabled {
  background: var(--surface-2);
  color: var(--ink-3);
  cursor: not-allowed;
}

.textarea {
  min-height: 90px;
  resize: vertical;
  line-height: 1.6;
}

.select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2383877e' stroke-width='1.8' 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 9px center;
}

html[data-theme="dark"] .select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23858b80' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

.search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink-3);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease), background 0.15s var(--ease);
}

.search-field .icon {
  width: 15px;
  height: 15px;
}

.search-field .input {
  flex: 1;
  min-width: 0;
  height: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  font-size: 12.5px;
}

.search-field .input:focus {
  box-shadow: none;
}

.search-field:focus-within {
  border-color: var(--accent);
  box-shadow: var(--ring);
  background: var(--surface);
}

.search-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 21px;
  height: 21px;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--ink-4);
}

.search-clear:hover {
  background: var(--surface-3);
  color: var(--ink-2);
}

.search-clear .icon {
  width: 12px;
  height: 12px;
}

.search-field--grow {
  flex: 1;
  min-width: 200px;
  max-width: 360px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.secret-wrap {
  position: relative;
  display: flex;
}

.secret-wrap .input {
  padding-right: 38px;
}

.secret-toggle {
  position: absolute;
  right: 3px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  color: var(--ink-3);
}

.radio-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.radio-card {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.radio-card:hover {
  border-color: var(--line-strong);
}

.radio-card:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.radio-card input {
  margin: 2px 0 0;
  accent-color: var(--accent);
}

.radio-card strong {
  display: block;
  font-size: 12.5px;
  font-weight: 620;
  color: var(--ink);
}

.radio-card span span {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.45;
  color: var(--ink-3);
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 12.5px;
  color: var(--ink-2);
  cursor: pointer;
  user-select: none;
}

.switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.switch-track {
  position: relative;
  width: 34px;
  height: 20px;
  flex: none;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-3);
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease);
}

.switch-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(20, 25, 21, 0.24);
  transition: transform 0.18s var(--ease), background 0.18s var(--ease);
}

.switch input:checked + .switch-track {
  border-color: var(--accent);
  background: var(--accent);
}

.switch input:checked + .switch-track::after {
  transform: translateX(14px);
  background: var(--accent-contrast);
}

.switch input:focus-visible + .switch-track {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.switch input:disabled + .switch-track {
  opacity: 0.5;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--ink-2);
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.badge .icon {
  width: 11px;
  height: 11px;
}

.badge-success {
  background: var(--success-soft);
  color: var(--success);
}

.badge-warning {
  background: var(--warning-soft);
  color: var(--warning);
}

.badge-danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.badge-info {
  background: var(--info-soft);
  color: var(--info);
}

.badge-accent {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.badge-neutral {
  background: var(--surface-3);
  color: var(--ink-2);
}

.tone-success {
  color: var(--success);
  background: var(--success-soft);
}

.tone-warning {
  color: var(--warning);
  background: var(--warning-soft);
}

.tone-danger {
  color: var(--danger);
  background: var(--danger-soft);
}

.tone-info {
  color: var(--info);
  background: var(--info-soft);
}

.tone-neutral {
  color: var(--ink-2);
  background: var(--surface-3);
}

.tone-accent {
  color: var(--accent-ink);
  background: var(--accent-soft);
}

.banner {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1.55;
}

.banner .icon {
  width: 16px;
  height: 16px;
  margin-top: 1px;
  flex: none;
}

.banner-info {
  border-color: var(--line);
  background: var(--surface-2);
  color: var(--ink-2);
}

.banner-success {
  border-color: color-mix(in srgb, var(--success) 20%, var(--line));
  background: var(--success-soft);
  color: var(--success);
}

.banner-warning {
  border-color: color-mix(in srgb, var(--warning) 22%, var(--line));
  background: var(--warning-soft);
  color: var(--warning);
}

.banner-danger {
  border-color: color-mix(in srgb, var(--danger) 22%, var(--line));
  background: var(--danger-soft);
  color: var(--danger);
}

.segmented {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  max-width: 100%;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.segmented button {
  height: 25px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-3);
  font-size: 11.5px;
  font-weight: 550;
  white-space: nowrap;
  transition: background 0.15s var(--ease), color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.segmented button:hover {
  color: var(--ink);
}

.segmented button.is-active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(30, 33, 27, 0.08);
}

.segmented--compact button {
  height: 23px;
  padding: 0 8px;
  font-size: 11px;
}

.segmented--view {
  padding: 3px;
  background: var(--surface);
}

.segmented--view button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 12px;
  font-size: 12px;
}

.segmented--view button.is-active {
  background: var(--accent);
  color: var(--accent-contrast);
  box-shadow: none;
}

.tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--ink-3);
  font-size: 9.5px;
  font-weight: 700;
}

.segmented--view button.is-active .tab-count {
  background: rgba(255, 255, 255, 0.18);
  color: var(--accent-contrast);
}

/* ==========================================================================
   States & skeletons
   ========================================================================== */

.state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 42px 24px;
  text-align: center;
}

.state-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  margin-bottom: 7px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--ink-3);
}

.state-icon .icon {
  width: 20px;
  height: 20px;
}

.state-title {
  font-size: 13.5px;
  font-weight: 620;
  color: var(--ink);
}

.state-text {
  max-width: 34ch;
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-3);
}

.state-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
}

.state-danger .state-icon {
  border-color: transparent;
  background: var(--danger-soft);
  color: var(--danger);
}

.skeleton {
  display: block;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}

.skeleton-line {
  height: 10px;
  max-width: 100%;
  margin: 7px 0;
}

.skeleton-avatar {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 9px;
}

.skeleton-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.skeleton-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.w-40 { width: 40%; }
.w-60 { width: 60%; }
.w-80 { width: 80%; }

.upcoming-skeleton,
.attention-skeleton,
.activity-skeleton {
  height: 52px;
  margin: 8px 0;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}

/* ==========================================================================
   Master-detail workspaces
   ========================================================================== */

.workspace {
  display: grid;
  grid-template-columns: minmax(300px, 358px) minmax(0, 1fr);
  height: calc(100dvh - var(--topbar-h) - 60px);
  min-height: 560px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.workspace--logs,
.workspace--monitors {
  height: calc(100dvh - var(--topbar-h) - 124px);
}

.object-list {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  border-right: 1px solid var(--line);
  background: var(--surface);
}

.list-head {
  flex: none;
  padding: 18px 16px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.list-head--plain {
  padding-bottom: 12px;
}

.list-head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.list-head-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.list-head-title {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.list-head-count {
  flex: none;
  padding-top: 2px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--ink-4);
  font-variant-numeric: tabular-nums;
}

.list-head-sub {
  margin-top: 3px;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--ink-3);
}

.list-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.list-tools .search-field {
  flex: 1;
  min-width: 0;
}

.list-add {
  flex: none;
}

.list-head .segmented {
  margin-top: 10px;
}

.list-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 6px 8px 14px;
  scroll-behavior: smooth;
}

.object-row {
  position: relative;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: inherit;
  text-align: left;
  transition: background 0.13s var(--ease), box-shadow 0.13s var(--ease);
}

.object-row + .object-row {
  margin-top: 1px;
}

.object-row:hover {
  background: var(--surface-2);
}

.object-row[aria-selected="true"] {
  background: var(--accent-soft);
  box-shadow: inset 2px 0 0 var(--accent);
}

.object-avatar {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.object-avatar .icon {
  width: 17px;
  height: 17px;
  color: var(--ink-3);
}

.object-row[aria-selected="true"] .object-avatar {
  border-color: color-mix(in srgb, var(--accent) 24%, var(--line));
  background: var(--accent);
  color: var(--accent-contrast);
}

.object-row[aria-selected="true"] .object-avatar .icon {
  color: var(--accent-contrast);
}

.object-main {
  min-width: 0;
}

.object-title {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  font-size: 13px;
  font-weight: 620;
  line-height: 1.35;
  color: var(--ink);
}

.object-title-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.object-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
  overflow: hidden;
  font-size: 11px;
  line-height: 1.4;
  color: var(--ink-3);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.object-trailing {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  flex: none;
}

.object-subtle {
  font-size: 10px;
  color: var(--ink-4);
  white-space: nowrap;
}

.object-dot {
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--ink-4);
}

.object-dot.is-online {
  background: var(--success);
  box-shadow: 0 0 0 2px var(--success-soft);
}

.object-dot.is-warning {
  background: var(--warning);
  box-shadow: 0 0 0 2px var(--warning-soft);
}

.object-dot.is-off {
  background: var(--ink-4);
}

.object-time {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  font-variant-numeric: tabular-nums;
}

.object-time strong {
  font-size: 12px;
  font-weight: 650;
  color: var(--ink-2);
}

.object-time span {
  font-size: 9.5px;
  color: var(--ink-4);
}

.detail-pane {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  background: var(--surface);
  scroll-behavior: smooth;
}

.detail-empty {
  flex: 1;
  display: grid;
  place-items: center;
}

.detail-head {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.detail-back {
  display: none;
  margin-left: -6px;
}

.detail-avatar {
  width: 40px;
  height: 40px;
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 700;
}

.detail-avatar .icon {
  width: 19px;
  height: 19px;
}

.detail-identity {
  flex: 1;
  min-width: 0;
}

.detail-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.015em;
  line-height: 1.3;
  color: var(--ink);
}

.detail-sub {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--ink-3);
}

.detail-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 7px;
  flex: none;
}

.detail-body {
  display: flex;
  flex-direction: column;
  padding: 0 24px 30px;
}

.detail-section {
  padding: 21px 0;
  border-bottom: 1px solid var(--line);
}

.detail-section:last-child {
  border-bottom: 0;
  padding-bottom: 4px;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-title {
  font-size: 12.5px;
  font-weight: 650;
  color: var(--ink);
}

.section-hint {
  font-size: 11px;
  color: var(--ink-3);
  line-height: 1.5;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px 28px;
}

.field-row {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 4px;
}

.field-row-label {
  font-size: 10.5px;
  font-weight: 550;
  letter-spacing: 0.02em;
  color: var(--ink-3);
}

.field-row-value {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.field-row-value.mono {
  font-size: 11.5px;
}

.copy-value {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
}

.copy-value button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--ink-4);
  opacity: 0;
  transition: opacity 0.13s var(--ease), background 0.13s var(--ease), color 0.13s var(--ease);
}

.copy-value:hover button,
.copy-value button:focus-visible {
  opacity: 1;
}

.copy-value button:hover {
  background: var(--surface-3);
  color: var(--ink-2);
}

.copy-value .icon {
  width: 13px;
  height: 13px;
}

.message-preview {
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.72;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.code-block {
  max-height: 300px;
  margin: 0;
  padding: 14px 15px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 11.5px;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.stat-strip {
  display: flex;
  flex-wrap: wrap;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
}

.stat {
  flex: 1;
  min-width: 92px;
  padding: 12px 14px;
  border-right: 1px solid var(--line);
}

.stat:last-child {
  border-right: 0;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 23px;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.stat-label {
  margin-top: 5px;
  font-size: 10.5px;
  color: var(--ink-3);
}

.health-list {
  display: flex;
  flex-direction: column;
}

.health-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.health-row:first-child {
  padding-top: 0;
}

.health-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.mini-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink-3);
}

.mini-icon .icon {
  width: 15px;
  height: 15px;
}

.health-row-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
}

.health-row-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}

.health-row-meta {
  font-size: 10.5px;
  line-height: 1.45;
  color: var(--ink-3);
}

.mini-list {
  display: flex;
  flex-direction: column;
}

.mini-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: inherit;
  text-align: left;
}

.mini-row:last-child {
  border-bottom: 0;
}

.mini-row-button {
  padding: 9px 8px;
  border-radius: 7px;
  transition: background 0.13s var(--ease);
}

.mini-row-button:hover {
  background: var(--surface-2);
}

.mini-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mini-title {
  overflow: hidden;
  font-size: 12px;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-meta {
  font-size: 10.5px;
  color: var(--ink-3);
}

.match-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.match-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 11px;
  line-height: 1.3;
}

.match-tag .icon {
  width: 12px;
  height: 12px;
  color: var(--ink-3);
}

.push-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.push-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 11.5px;
}

.push-pill .icon {
  width: 13px;
  height: 13px;
}

.push-pill.is-off {
  color: var(--ink-4);
  background: transparent;
  border-style: dashed;
}

.push-pill.is-off .icon {
  color: var(--ink-4);
}

/* ==========================================================================
   Page toolbars, pagination
   ========================================================================== */

.page-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  min-height: 38px;
}

.toolbar-spacer {
  flex: 1;
}

.toolbar-selects {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.toolbar-selects .select {
  width: auto;
  min-width: 118px;
  height: 32px;
  padding-top: 4px;
  padding-bottom: 4px;
  font-size: 11.5px;
}

.toolbar--logs .search-field--grow {
  max-width: 330px;
}

.toolbar-meta {
  font-size: 10.5px;
  color: var(--ink-4);
  font-variant-numeric: tabular-nums;
}

.pagination {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
  flex: none;
  padding: 9px 10px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 27px;
  height: 27px;
  padding: 0 5px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-2);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.page-btn:hover {
  background: var(--surface-2);
}

.page-btn.is-active {
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-weight: 650;
}

.page-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.page-btn .icon {
  width: 13px;
  height: 13px;
}

.pagination-label {
  margin-left: auto;
  font-size: 10.5px;
  color: var(--ink-4);
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Overview
   ========================================================================== */

.overview {
  display: flex;
  flex-direction: column;
  gap: 28px;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
}

.overview-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  padding-top: 8px;
}

.overview-copy {
  min-width: 0;
}

.overview-copy .eyebrow {
  color: var(--accent);
}

.overview-copy h2 {
  margin-top: 9px;
  font-size: clamp(27px, 3.2vw, 38px);
  font-weight: 640;
  letter-spacing: -0.035em;
  line-height: 1.14;
  color: var(--ink);
}

.overview-sub {
  max-width: 64ch;
  margin-top: 9px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-2);
}

.overview-summary {
  margin-top: 5px;
  font-size: 11.5px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.overview-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
  padding-bottom: 3px;
}

.agenda {
  position: relative;
  display: grid;
  grid-template-columns: minmax(200px, 0.75fr) 1px minmax(0, 1.7fr) auto;
  align-items: center;
  gap: 24px;
  padding: 24px 28px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-1);
}

.agenda::after {
  content: "";
  position: absolute;
  top: -130px;
  right: -70px;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-soft) 0%, transparent 68%);
  pointer-events: none;
}

.agenda-time {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.agenda-label {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.agenda-clock {
  margin-top: 2px;
  font-family: var(--font-display);
  font-size: clamp(42px, 5.4vw, 62px);
  font-weight: 500;
  line-height: 0.92;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.agenda-date {
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--ink-3);
}

.agenda-divider {
  width: 1px;
  height: 78px;
  background: var(--line);
}

.agenda-task {
  min-width: 0;
}

.agenda-task-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.agenda-task h3 {
  font-size: 18px;
  font-weight: 640;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--ink);
}

.agenda-task p {
  margin-top: 4px;
  font-size: 12px;
  color: var(--ink-3);
}

.agenda-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.agenda-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 10.5px;
  line-height: 1.35;
}

.agenda-tag .icon {
  width: 12px;
  height: 12px;
  color: var(--ink-3);
}

.agenda-actions {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 112px;
}

.agenda.is-empty .agenda-clock {
  font-family: var(--font-sans);
  font-size: 28px;
  font-weight: 620;
  letter-spacing: -0.02em;
}

.overview-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(270px, 0.85fr);
  align-items: start;
  gap: 36px;
}

.section {
  min-width: 0;
  padding-top: 17px;
  border-top: 1px solid var(--line);
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.section-head-copy {
  min-width: 0;
}

.section-head-copy h3 {
  font-size: 13.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.section-head-copy p {
  margin-top: 2px;
  font-size: 11px;
  color: var(--ink-3);
}

.section-count {
  flex: none;
  min-width: 24px;
  height: 20px;
  padding: 0 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--ink-3);
  font-size: 10px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.link-more {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex: none;
  padding-top: 2px;
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 520;
  transition: color 0.13s var(--ease), gap 0.13s var(--ease);
}

.link-more:hover {
  gap: 5px;
  color: var(--accent);
}

button.link-more {
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.upcoming-list {
  display: flex;
  flex-direction: column;
}

.upcoming-row {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 10px 2px;
  border-bottom: 1px solid var(--line);
}

.upcoming-row:first-child {
  border-top: 1px solid var(--line);
}

.upcoming-time {
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-variant-numeric: tabular-nums;
}

.upcoming-time strong {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.upcoming-time span {
  font-size: 9.5px;
  color: var(--ink-4);
}

.upcoming-link {
  display: block;
  min-width: 0;
  color: inherit;
}

.upcoming-link:hover {
  color: inherit;
}

.upcoming-name {
  display: block;
  overflow: hidden;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upcoming-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
  overflow: hidden;
  font-size: 10.5px;
  color: var(--ink-3);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upcoming-side {
  display: flex;
  align-items: center;
  gap: 6px;
}

.upcoming-countdown {
  font-size: 10.5px;
  color: var(--ink-4);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.row-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 27px;
  height: 27px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-3);
  transition: background 0.13s var(--ease), color 0.13s var(--ease), border-color 0.13s var(--ease);
}

.row-icon-btn:hover {
  border-color: var(--line);
  background: var(--surface-2);
  color: var(--accent);
}

.row-icon-btn .icon {
  width: 13px;
  height: 13px;
}

.attention-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.attention-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px;
  border-radius: 8px;
  color: inherit;
  transition: background 0.13s var(--ease);
}

.attention-item:hover {
  background: var(--surface-2);
  color: inherit;
}

.attention-icon {
  width: 28px;
  height: 28px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 8px;
}

.attention-icon .icon {
  width: 14px;
  height: 14px;
}

.attention-copy {
  flex: 1;
  min-width: 0;
}

.attention-copy strong {
  display: block;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink);
}

.attention-copy span {
  display: block;
  margin-top: 2px;
  font-size: 10.5px;
  line-height: 1.5;
  color: var(--ink-3);
}

.attention-chevron {
  width: 13px;
  height: 13px;
  margin-top: 7px;
  flex: none;
  color: var(--ink-4);
}

.attention-clear {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1px dashed color-mix(in srgb, var(--success) 28%, var(--line));
  border-radius: 9px;
  background: var(--success-soft);
  color: var(--success);
}

.attention-clear strong {
  display: block;
  font-size: 12px;
  font-weight: 650;
}

.attention-clear span {
  display: block;
  margin-top: 2px;
  font-size: 10.5px;
  line-height: 1.5;
  color: color-mix(in srgb, var(--success) 78%, var(--ink));
}

.system-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 13px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 10.5px;
  color: var(--ink-3);
}

.rhythm-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: none;
}

.rhythm-key {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  color: var(--ink-3);
}

.rhythm-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: var(--ink-4);
}

.rhythm-dot.is-success { background: var(--success); }
.rhythm-dot.is-failed { background: var(--danger); }

.rhythm {
  display: grid;
  grid-template-columns: repeat(24, minmax(0, 1fr));
  align-items: end;
  gap: 3px;
  height: 56px;
  padding-top: 4px;
  border-bottom: 1px solid var(--line);
}

.rhythm-bar {
  position: relative;
  display: flex;
  flex-direction: column-reverse;
  justify-self: center;
  justify-content: flex-start;
  width: 58%;
  height: 100%;
  min-height: 3px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--surface-2);
}

.rhythm-bar span {
  display: block;
  width: 100%;
  min-height: 0;
  transition: height 0.3s var(--ease);
}

.rhythm-bar .rhythm-success {
  background: var(--success);
}

.rhythm-bar .rhythm-failed {
  background: var(--danger);
}

.rhythm-bar.is-now {
  outline: 2px solid color-mix(in srgb, var(--accent) 58%, transparent);
  outline-offset: 1px;
}

.rhythm-axis {
  display: grid;
  grid-template-columns: repeat(24, minmax(0, 1fr));
  gap: 3px;
  margin-top: 4px;
}

.rhythm-axis span {
  font-size: 8.5px;
  line-height: 1;
  color: var(--ink-4);
  font-variant-numeric: tabular-nums;
}

.rhythm-empty {
  padding: 16px 0;
  font-size: 11.5px;
  color: var(--ink-3);
}

.activity-list {
  display: flex;
  flex-direction: column;
}

.activity-row {
  display: grid;
  grid-template-columns: 27px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 10px 2px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: inherit;
  text-align: left;
  transition: background 0.13s var(--ease);
}

.activity-row:first-child {
  border-top: 1px solid var(--line);
}

.activity-row:hover {
  background: var(--surface-2);
}

.activity-icon {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 7px;
}

.activity-icon .icon {
  width: 13px;
  height: 13px;
}

.activity-main {
  min-width: 0;
}

.activity-text {
  display: block;
  overflow: hidden;
  font-size: 12px;
  font-weight: 520;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-meta {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  font-size: 10.5px;
  color: var(--ink-3);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-time {
  font-size: 10.5px;
  color: var(--ink-4);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.overview-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 10px;
  color: var(--ink-4);
}

.foot-sep {
  color: var(--line-strong);
}

/* ==========================================================================
   Logs
   ========================================================================== */

.log-day {
  padding: 11px 10px 5px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-4);
}

.log-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  text-align: left;
  transition: background 0.13s var(--ease), box-shadow 0.13s var(--ease);
}

.log-row:hover {
  background: var(--surface-2);
}

.log-row[aria-selected="true"] {
  background: var(--accent-soft);
  box-shadow: inset 2px 0 0 var(--accent);
}

.log-mark {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 7px;
}

.log-mark .icon {
  width: 13px;
  height: 13px;
}

.log-main {
  min-width: 0;
}

.log-message {
  display: block;
  overflow: hidden;
  font-size: 12.5px;
  font-weight: 520;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.log-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 3px;
  font-size: 10.5px;
  color: var(--ink-3);
}

.log-meta .badge {
  height: 18px;
  font-size: 9.5px;
}

.log-time {
  font-size: 10px;
  color: var(--ink-4);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Monitors & events
   ========================================================================== */

.view-panel[hidden] {
  display: none !important;
}

.events-view {
  min-height: 0;
}

.events-panel {
  display: flex;
  flex-direction: column;
  height: calc(100dvh - var(--topbar-h) - 124px);
  min-height: 520px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.events-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 17px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.events-head-copy h3 {
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.events-head-copy p {
  margin-top: 2px;
  font-size: 11px;
  color: var(--ink-3);
}

.events-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.events-tools .search-field {
  width: 210px;
}

.events-tools .select {
  width: auto;
  min-width: 120px;
  height: 32px;
  font-size: 11.5px;
}

.auto-refresh {
  font-size: 11px;
  color: var(--ink-3);
}

.event-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scroll-behavior: smooth;
}

.event-item {
  border-bottom: 1px solid var(--line);
}

.event-item:last-child {
  border-bottom: 0;
}

.event-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 14px 20px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  transition: background 0.13s var(--ease);
}

.event-row:hover {
  background: var(--surface-2);
}

.event-item.is-expanded .event-row {
  background: var(--surface-2);
}

.event-avatar {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 10px;
  font-weight: 700;
}

.event-main {
  min-width: 0;
}

.event-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
}

.event-sender {
  font-size: 12.5px;
  font-weight: 620;
  color: var(--ink);
}

.event-chat {
  font-size: 10px;
  color: var(--ink-4);
}

.event-text {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}

.event-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}

.event-foot .badge {
  height: 18px;
  font-size: 9.5px;
}

.event-time {
  padding-top: 2px;
  font-size: 10px;
  color: var(--ink-4);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.event-extra {
  padding: 0 20px 15px 66px;
}

.event-extra dl {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 6px 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

.event-extra dt {
  font-size: 10.5px;
  color: var(--ink-3);
}

.event-extra dd {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}

.monitor-page {
  display: contents;
}

/* ==========================================================================
   Settings
   ========================================================================== */

.settings-layout {
  display: grid;
  grid-template-columns: 196px minmax(0, 1fr);
  gap: clamp(28px, 5vw, 64px);
  max-width: 1080px;
  padding-top: 8px;
}

.settings-nav {
  position: sticky;
  top: calc(var(--topbar-h) + 24px);
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.settings-nav > .eyebrow {
  padding: 0 10px 9px;
}

.settings-nav button {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-2);
  font-size: 12.5px;
  text-align: left;
  transition: background 0.13s var(--ease), color 0.13s var(--ease);
}

.settings-nav button .icon {
  width: 15px;
  height: 15px;
  color: var(--ink-3);
}

.settings-nav button:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.settings-nav button.is-active {
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-weight: 620;
}

.settings-nav button.is-active .icon {
  color: var(--accent);
}

.settings-nav-foot {
  display: flex;
  justify-content: space-between;
  margin-top: 22px;
  padding: 13px 10px 0;
  border-top: 1px solid var(--line);
  font-size: 9.5px;
  color: var(--ink-4);
}

.settings-content {
  min-width: 0;
}

.settings-section {
  display: none;
}

.settings-section.is-active {
  display: block;
  animation: page-in 0.25s var(--ease) both;
}

.settings-head {
  margin-bottom: 22px;
}

.settings-title {
  font-size: 23px;
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.settings-desc {
  max-width: 64ch;
  margin-top: 7px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-3);
}

.profile-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.profile-avatar {
  width: 42px;
  height: 42px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
}

.profile-copy {
  flex: 1;
  min-width: 0;
}

.profile-name {
  font-size: 13.5px;
  font-weight: 650;
}

.profile-meta {
  margin-top: 2px;
  font-size: 11px;
  color: var(--ink-3);
}

.settings-block {
  padding: 22px 0;
  border-top: 1px solid var(--line);
}

.settings-block:first-of-type {
  border-top: 0;
}

.settings-block-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
}

.settings-block-title {
  font-size: 12.5px;
  font-weight: 650;
  color: var(--ink);
}

.settings-block-desc {
  margin-top: 3px;
  font-size: 11px;
  color: var(--ink-3);
}

.settings-form {
  max-width: 620px;
}

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.settings-block--flush {
  padding-top: 0;
  border-top: 0;
}

.settings-block--channel {
  padding-top: 24px;
}

.channel-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 15px;
}

.channel-icon {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--ink-2);
}

.channel-icon .icon {
  width: 16px;
  height: 16px;
}

.channel-copy {
  flex: 1;
  min-width: 0;
}

.channel-name {
  display: block;
  font-size: 13px;
  font-weight: 650;
}

.channel-desc {
  display: block;
  margin-top: 2px;
  font-size: 10.5px;
  color: var(--ink-3);
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 28px;
}

.info-cell {
  min-width: 0;
}

.template-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.template-item:first-child {
  border-top: 1px solid var(--line);
}

.template-main {
  flex: 1;
  min-width: 0;
}

.template-name {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 620;
}

.template-content {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-2);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.template-meta {
  margin-top: 4px;
  font-size: 10.5px;
  color: var(--ink-3);
}

/* ==========================================================================
   Dialogs, sheets, palette, toasts
   ========================================================================== */

dialog {
  color: var(--ink);
}

.sheet {
  width: min(560px, calc(100vw - 32px));
  max-height: min(88dvh, 920px);
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-3);
}

.sheet::backdrop {
  background: rgba(12, 16, 13, 0.46);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.sheet[open] {
  animation: sheet-in 0.22s var(--ease) both;
}

.sheet-sm {
  width: min(440px, calc(100vw - 32px));
}

.sheet-lg {
  width: min(720px, calc(100vw - 32px));
}

.sheet-form {
  display: flex;
  flex-direction: column;
  max-height: inherit;
}

.sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px 14px;
}

.sheet-title {
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.015em;
  line-height: 1.3;
}

.sheet-desc {
  margin-top: 4px;
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--ink-3);
}

.sheet-close {
  margin: -4px -6px 0 0;
}

.sheet-body {
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding: 6px 24px 22px;
  overflow-y: auto;
}

.sheet-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 13px 24px;
  border-top: 1px solid var(--line);
  border-radius: 0 0 16px 16px;
  background: var(--surface-2);
}

.foot-hint {
  margin-right: auto;
  font-size: 10.5px;
  color: var(--ink-3);
}

.confirm-dialog {
  width: min(400px, calc(100vw - 32px));
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-3);
}

.confirm-dialog::backdrop {
  background: rgba(12, 16, 13, 0.46);
  backdrop-filter: blur(4px);
}

.confirm-dialog[open] {
  animation: sheet-in 0.2s var(--ease) both;
}

.confirm-body {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 22px 22px 12px;
}

.confirm-icon {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--danger-soft);
  color: var(--danger);
}

.confirm-icon .icon {
  width: 17px;
  height: 17px;
}

.confirm-title {
  font-size: 14px;
  font-weight: 650;
}

.confirm-text {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-3);
}

.confirm-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}

.qr-box {
  display: grid;
  place-items: center;
  min-height: 232px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.qr-box:empty::after {
  content: "正在生成二维码…";
  font-size: 12px;
  color: #7a7d74;
}

.qr-box svg {
  width: 196px;
  height: 196px;
}

.qr-scanned {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: #555555;
  font-size: 12px;
}

.qr-scanned .icon {
  width: 34px;
  height: 34px;
  color: #2f7d54;
}

.qr-status {
  margin-top: 2px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  text-align: center;
}

.qr-status.is-error {
  color: var(--danger);
}

.qr-hint {
  font-size: 10.5px;
  line-height: 1.55;
  color: var(--ink-3);
  text-align: center;
}

.palette {
  width: min(620px, calc(100vw - 32px));
  margin: 13vh auto auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 15px;
  background: var(--surface);
  box-shadow: var(--shadow-3);
}

.palette::backdrop {
  background: rgba(12, 16, 13, 0.42);
  backdrop-filter: blur(4px);
}

.palette[open] {
  animation: palette-in 0.18s var(--ease) both;
}

.palette-search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 15px;
  border-bottom: 1px solid var(--line);
}

.palette-search .icon {
  width: 17px;
  height: 17px;
  color: var(--ink-3);
}

.palette-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 13.5px;
}

.palette-search input::placeholder {
  color: var(--ink-4);
}

.palette-results {
  max-height: min(52vh, 430px);
  overflow-y: auto;
  padding: 7px;
}

.palette-group-label {
  padding: 10px 10px 5px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-4);
}

.palette-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  text-align: left;
}

.palette-item.is-active {
  background: var(--accent-soft);
}

.palette-icon {
  width: 28px;
  height: 28px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--ink-3);
}

.palette-icon .icon {
  width: 14px;
  height: 14px;
}

.palette-item.is-active .palette-icon {
  background: var(--accent);
  color: var(--accent-contrast);
}

.palette-copy {
  flex: 1;
  min-width: 0;
}

.palette-name {
  display: block;
  overflow: hidden;
  font-size: 12.5px;
  font-weight: 550;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.palette-meta {
  display: block;
  margin-top: 1px;
  overflow: hidden;
  font-size: 10px;
  color: var(--ink-3);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.palette-type {
  flex: none;
  padding: 2px 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--ink-4);
  font-size: 9px;
}

.palette-empty {
  padding: 34px 20px;
  color: var(--ink-3);
  font-size: 12px;
  text-align: center;
}

.palette-foot {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 9px 15px;
  border-top: 1px solid var(--line);
  border-radius: 0 0 15px 15px;
  background: var(--surface-2);
  color: var(--ink-3);
  font-size: 10px;
}

.palette-foot-hint {
  margin-left: auto;
}

mark {
  padding: 0 1px;
  border-radius: 3px;
  background: var(--accent-soft-strong);
  color: var(--accent-ink);
}

.toast-region {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 220;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow-2);
  pointer-events: auto;
  animation: toast-in 0.22s var(--ease) both;
}

.toast.is-leaving {
  opacity: 0;
  transform: translateY(5px);
  transition: opacity 0.16s var(--ease), transform 0.16s var(--ease);
}

.toast-icon {
  width: 26px;
  height: 26px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--ink-3);
}

.toast-icon .icon {
  width: 14px;
  height: 14px;
}

.toast-success .toast-icon { background: var(--success-soft); color: var(--success); }
.toast-error .toast-icon { background: var(--danger-soft); color: var(--danger); }
.toast-warning .toast-icon { background: var(--warning-soft); color: var(--warning); }
.toast-info .toast-icon { background: var(--info-soft); color: var(--info); }

.toast-copy {
  flex: 1;
  min-width: 0;
  padding-top: 3px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--ink);
}

.toast-close {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--ink-4);
}

.toast-close:hover {
  background: var(--surface-2);
  color: var(--ink-2);
}

.toast-close .icon {
  width: 12px;
  height: 12px;
}

/* ==========================================================================
   Auth
   ========================================================================== */

.auth-main {
  min-height: 100dvh;
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(380px, 0.92fr);
  min-height: 100dvh;
}

.auth-visual {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: clamp(32px, 4.4vw, 56px);
  overflow: hidden;
  background:
    radial-gradient(ellipse 70% 50% at 18% 0%, rgba(255, 255, 255, 0.07), transparent 58%),
    var(--auth-panel);
  color: #f5f5f5;
}

.auth-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 1px 1px, var(--auth-dot) 1.1px, transparent 1.3px);
  background-size: 22px 22px;
  pointer-events: none;
  z-index: 0;
}

.auth-brand {
  position: relative;
  z-index: 1;
  color: #fff;
  padding-bottom: 0;
}

.auth-brand:hover {
  color: #fff;
}

.auth-visual .brand-mark {
  background: #f5f5f5;
  color: #111111;
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow: none;
}

.auth-visual .brand-copy span {
  color: rgba(255, 255, 255, 0.5);
}

.auth-hero {
  position: relative;
  z-index: 1;
  max-width: 540px;
  margin-top: auto;
  margin-bottom: 38px;
}

.auth-hero .eyebrow {
  color: rgba(255, 255, 255, 0.48);
}

.auth-hero h1 {
  margin-top: 14px;
  font-size: clamp(30px, 3.5vw, 46px);
  font-weight: 580;
  letter-spacing: -0.04em;
  line-height: 1.16;
}

.auth-hero p {
  max-width: 44ch;
  margin-top: 16px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 12.5px;
  line-height: 1.75;
}

.auth-timeline {
  position: relative;
  z-index: 1;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.auth-timeline-row {
  display: grid;
  grid-template-columns: 46px 9px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.auth-timeline-time {
  font-family: var(--font-mono);
  font-size: 10px;
  color: rgba(255, 255, 255, 0.5);
  font-variant-numeric: tabular-nums;
}

.auth-timeline-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.26);
}

.auth-timeline-dot.is-accent {
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.16);
}

.auth-timeline-dot.is-live {
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
  animation: status-pulse 2.6s ease-in-out infinite;
}

.auth-timeline-copy {
  min-width: 0;
}

.auth-timeline-copy strong {
  display: block;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.9);
  font-size: 11.5px;
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-timeline-copy span {
  display: block;
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.46);
  font-size: 10px;
}

.auth-timeline-state {
  color: rgba(255, 255, 255, 0.48);
  font-size: 9.5px;
  white-space: nowrap;
}

.auth-foot {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 26px;
  color: rgba(255, 255, 255, 0.42);
  font-size: 10px;
}

.auth-form-side {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px clamp(28px, 6vw, 80px);
  background-color: var(--bg);
  background-image: radial-gradient(circle at 1px 1px, var(--dot) 1px, transparent 1.2px);
  background-size: 22px 22px;
}

.auth-mobile-brand {
  display: none;
}

.auth-theme {
  position: absolute;
  top: 22px;
  right: 22px;
}

.auth-form-head,
.auth-form,
.auth-error,
.auth-form-foot {
  width: 100%;
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}

.auth-form-head h2 {
  margin-top: 8px;
  font-size: 28px;
  font-weight: 650;
  letter-spacing: -0.035em;
  line-height: 1.2;
}

.auth-form-head p {
  margin-top: 6px;
  color: var(--ink-3);
  font-size: 12px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 28px;
}

.auth-form .input {
  height: 40px;
}

.auth-error {
  margin-top: 18px;
}

.auth-form-foot {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 28px;
  color: var(--ink-4);
  font-size: 10px;
}

.auth-form-foot .icon {
  width: 13px;
  height: 13px;
}

/* ==========================================================================
   Error page
   ========================================================================== */

.error-page {
  display: grid;
  grid-template-columns: auto minmax(0, 480px);
  align-items: center;
  justify-content: center;
  gap: clamp(28px, 6vw, 72px);
  min-height: calc(100dvh - var(--topbar-h) - 160px);
}

.error-mark {
  display: flex;
  align-items: center;
  justify-content: center;
}

.error-code {
  font-family: var(--font-display);
  font-size: clamp(96px, 16vw, 190px);
  font-weight: 500;
  line-height: 0.8;
  letter-spacing: -0.07em;
  color: var(--surface-3);
  -webkit-text-stroke: 1px var(--line-strong);
}

.error-copy h2 {
  margin-top: 9px;
  font-size: 28px;
  font-weight: 650;
  letter-spacing: -0.03em;
}

.error-copy p {
  margin-top: 9px;
  color: var(--ink-3);
  font-size: 12.5px;
  line-height: 1.65;
}

.error-copy .state-actions {
  justify-content: flex-start;
  margin-top: 20px;
}

/* ==========================================================================
   Animations
   ========================================================================== */

@keyframes page-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes sheet-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes palette-in {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shimmer {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0 50%;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes status-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.55;
  }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1180px) {
  .overview-columns {
    gap: 28px;
  }

  .agenda {
    grid-template-columns: minmax(170px, 0.68fr) 1px minmax(0, 1.5fr) auto;
    gap: 20px;
    padding: 22px 24px;
  }

  .detail-head {
    flex-wrap: wrap;
  }

  .detail-actions {
    width: 100%;
    justify-content: flex-start;
    padding-left: 52px;
  }
}

@media (max-width: 1024px) {
  .rail {
    transform: translateX(-100%);
    box-shadow: var(--shadow-3);
    transition: transform 0.24s var(--ease);
  }

  .rail .rail-close {
    display: inline-flex;
  }

  body.rail-open .rail {
    transform: translateX(0);
  }

  .rail-scrim {
    position: fixed;
    inset: 0;
    z-index: 45;
    display: block;
    background: rgba(12, 16, 13, 0.4);
    backdrop-filter: blur(2px);
  }

  .main-column {
    margin-left: 0;
  }

  .topbar .rail-toggle {
    display: inline-flex;
  }

  .page-identity {
    margin-left: 0;
  }

  .settings-layout {
    grid-template-columns: 176px minmax(0, 1fr);
    gap: 32px;
  }
}

@media (max-width: 900px) {
  .overview-columns {
    grid-template-columns: minmax(0, 1fr);
    gap: 26px;
  }

  .workspace {
    height: calc(100dvh - var(--topbar-h) - 48px);
    grid-template-columns: 300px minmax(0, 1fr);
  }

  .workspace--logs,
  .workspace--monitors {
    height: calc(100dvh - var(--topbar-h) - 112px);
  }

  .detail-actions {
    padding-left: 0;
  }

  .detail-head {
    align-items: flex-start;
  }

  .settings-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }

  .settings-nav {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
  }

  .settings-nav > .eyebrow,
  .settings-nav-foot {
    display: none;
  }

  .settings-nav button {
    width: auto;
    flex: 0 0 auto;
    padding: 0 11px;
  }

  .auth-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .auth-visual {
    display: none;
  }

  .auth-mobile-brand {
    display: flex;
    width: 100%;
    max-width: 360px;
    margin: 0 auto 34px;
    padding: 0;
  }

  .auth-mobile-brand .brand-copy strong {
    font-size: 13px;
  }

  .auth-form-side {
    min-height: 100dvh;
    padding: 64px 28px;
  }
}

@media (max-width: 760px) {
  :root {
    --topbar-h: 58px;
  }

  .page {
    padding-top: 18px;
  }

  .topbar {
    gap: 10px;
  }

  .search-trigger-label {
    display: none;
  }

  .search-trigger {
    width: 32px;
    padding: 0;
    justify-content: center;
  }

  .search-trigger kbd {
    display: none;
  }

  .page-kicker {
    display: none;
  }

  .page-identity h1 {
    margin-top: 0;
    font-size: 14px;
  }

  .status-chip {
    padding: 0 8px;
    font-size: 10px;
  }

  .overview-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .overview-actions {
    width: 100%;
  }

  .overview-actions .btn {
    flex: 1;
  }

  .agenda {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    padding: 20px;
  }

  .agenda-divider {
    width: 100%;
    height: 1px;
  }

  .agenda-actions {
    flex-direction: row;
    min-width: 0;
  }

  .agenda-actions .btn {
    flex: 1;
  }

  .agenda-clock {
    font-size: 44px;
  }

  .rhythm {
    height: 48px;
  }

  .rhythm-axis span:nth-child(even) {
    visibility: hidden;
  }

  .workspace {
    display: block;
    height: auto;
    min-height: calc(100dvh - var(--topbar-h) - 72px);
    overflow: visible;
  }

  .workspace .object-list {
    border-right: 0;
    min-height: calc(100dvh - var(--topbar-h) - 72px);
  }

  .workspace .detail-pane {
    display: none;
    min-height: calc(100dvh - var(--topbar-h) - 72px);
  }

  .workspace.is-detail-open .object-list {
    display: none;
  }

  .workspace.is-detail-open .detail-pane {
    display: flex;
  }

  .detail-back {
    display: inline-flex;
  }

  .detail-head {
    padding: 14px 16px;
  }

  .detail-title {
    font-size: 16px;
  }

  .detail-body {
    padding: 0 16px 24px;
  }

  .detail-section {
    padding: 18px 0;
  }

  .detail-grid,
  .info-grid,
  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .detail-head {
    flex-wrap: wrap;
  }

  .detail-actions {
    width: 100%;
    justify-content: flex-start;
    padding-left: 0;
  }

  .detail-avatar {
    width: 36px;
    height: 36px;
  }

  .list-head {
    padding: 15px 14px 11px;
  }

  .list-tools {
    flex-wrap: wrap;
  }

  .list-add {
    flex: 1;
  }

  .toolbar--logs {
    align-items: stretch;
  }

  .toolbar--logs .search-field--grow {
    max-width: none;
    flex-basis: 100%;
  }

  .toolbar-selects {
    width: 100%;
  }

  .toolbar-selects .select {
    flex: 1;
    min-width: 0;
  }

  .events-panel {
    height: auto;
    min-height: calc(100dvh - var(--topbar-h) - 100px);
  }

  .events-head {
    padding: 14px 16px;
  }

  .events-tools {
    width: 100%;
  }

  .events-tools .search-field {
    width: 100%;
  }

  .events-tools .select {
    flex: 1;
  }

  .event-row {
    grid-template-columns: 32px minmax(0, 1fr);
    padding: 13px 16px;
  }

  .event-time {
    grid-column: 2;
    padding-top: 0;
  }

  .event-extra {
    padding-left: 58px;
    padding-right: 16px;
  }

  .event-extra dl {
    grid-template-columns: minmax(0, 1fr);
  }

  .settings-nav {
    margin-right: -2px;
  }

  .settings-title {
    font-size: 21px;
  }

  .sheet {
    width: 100%;
    max-width: none;
    max-height: 92dvh;
    margin: auto 0 0;
    border-radius: 16px 16px 0 0;
  }

  .sheet[open] {
    animation: sheet-up 0.24s var(--ease) both;
  }

  .sheet-foot {
    border-radius: 0;
  }

  .sheet-head,
  .sheet-body,
  .sheet-foot {
    padding-left: 18px;
    padding-right: 18px;
  }

  .radio-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .auth-form-side {
    padding: 56px 22px 32px;
  }

  .auth-form-head h2 {
    font-size: 25px;
  }

  .toast-region {
    right: 12px;
    bottom: 12px;
    width: calc(100vw - 24px);
  }

  .error-page {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    min-height: auto;
    padding-top: 20px;
  }

  .error-mark {
    justify-content: flex-start;
  }

  .error-code {
    font-size: 92px;
  }
}

@media (max-width: 520px) {
  .overview-copy h2 {
    font-size: 26px;
  }

  .agenda-clock {
    font-size: 40px;
  }

  .upcoming-row {
    grid-template-columns: 52px minmax(0, 1fr) auto;
    gap: 10px;
  }

  .upcoming-countdown {
    display: none;
  }

  .stat {
    min-width: 50%;
  }

  .stat:nth-child(2n) {
    border-right: 0;
  }

  .stat:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .segmented {
    width: 100%;
    overflow-x: auto;
  }

  .segmented button {
    flex: 1;
  }

  .segmented--view {
    width: auto;
  }

  .segmented--view button {
    flex: none;
  }

  .settings-nav button span {
    font-size: 11.5px;
  }

  .auth-form-side {
    justify-content: flex-start;
    padding-top: 64px;
  }
}

@keyframes sheet-up {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
