:root {
  color-scheme: light dark;
  --font:
    -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display', 'PingFang SC',
    'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --bg: #f4f6f9;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --faint: #8e8e93;
  --accent: #0a84ff;
  --accent-strong: #0071e3;
  --teal: #30b0c7;
  --glass: rgba(255, 255, 255, 0.72);
  --glass-strong: rgba(255, 255, 255, 0.94);
  --surface: rgba(255, 255, 255, 0.97);
  --glass-border: rgba(255, 255, 255, 0.72);
  --line: rgba(60, 60, 67, 0.12);
  --line-strong: rgba(60, 60, 67, 0.18);
  --sidebar: rgba(246, 248, 251, 0.8);
  --shadow: 0 18px 50px rgba(22, 34, 51, 0.1), 0 2px 8px rgba(22, 34, 51, 0.04);
  --shadow-soft: 0 8px 24px rgba(22, 34, 51, 0.07);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-pill: 999px;
  --sidebar-width: 248px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0c0f;
    --ink: #f5f5f7;
    --muted: #a1a1a6;
    --faint: #7c7c82;
    --accent: #0a84ff;
    --accent-strong: #409cff;
    --teal: #64d2ff;
    --glass: rgba(28, 30, 35, 0.72);
    --glass-strong: rgba(36, 38, 44, 0.94);
    --surface: rgba(30, 32, 37, 0.98);
    --glass-border: rgba(255, 255, 255, 0.1);
    --line: rgba(255, 255, 255, 0.12);
    --line-strong: rgba(255, 255, 255, 0.18);
    --sidebar: rgba(22, 24, 29, 0.84);
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.45), 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.3);
  }
}
* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body::before {
  content: '';
  position: fixed;
  inset: -20%;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(circle at 14% 6%, rgba(10, 132, 255, 0.17), transparent 32%),
    radial-gradient(circle at 88% 18%, rgba(48, 176, 199, 0.16), transparent 30%),
    radial-gradient(circle at 55% 95%, rgba(191, 90, 242, 0.08), transparent 35%);
  filter: blur(20px);
}
button,
input,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
  border: 0;
  -webkit-tap-highlight-color: transparent;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(10, 132, 255, 0.55);
  outline-offset: 3px;
}
button:active {
  transform: scale(0.985);
}
[hidden] {
  display: none !important;
}
.icon-library {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
.icon {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.glass {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  backdrop-filter: blur(28px) saturate(180%);
}
.app-shell {
  min-height: 100dvh;
}
/* Floating iOS-style sidebar */
.sidebar {
  position: fixed;
  inset: 16px auto 16px 16px;
  width: var(--sidebar-width);
  z-index: 20;
  display: flex;
  flex-direction: column;
  padding: 18px 12px 14px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--glass-border);
  background: var(--sidebar);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(34px) saturate(170%);
  backdrop-filter: blur(34px) saturate(170%);
  overflow: hidden;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 8px 18px;
  color: var(--ink);
  text-decoration: none;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  color: #fff;
  font-size: 21px;
  font-weight: 650;
  background: linear-gradient(145deg, #0a84ff, #30b0c7);
  box-shadow:
    0 5px 16px rgba(10, 132, 255, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
.brand-copy strong {
  display: block;
  font-size: 22px;
  line-height: 1;
  letter-spacing: -0.8px;
}
.brand-copy small {
  display: block;
  margin-top: 4px;
  color: var(--faint);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.13em;
}
.workspace-card {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 2px 14px;
  padding: 9px 10px;
  border-radius: 13px;
  background: rgba(120, 120, 128, 0.09);
}
.avatar {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  color: #fff;
  background: linear-gradient(145deg, #30b0c7, #5e5ce6);
  font-size: 12px;
  font-weight: 650;
}
.workspace-card strong {
  display: block;
  font-size: 12px;
  line-height: 1.3;
}
.workspace-card small {
  display: block;
  color: var(--faint);
  font-size: 10px;
}
.sidebar-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 2px;
  scrollbar-width: none;
}
.sidebar-scroll::-webkit-scrollbar {
  display: none;
}
.nav-label {
  margin: 14px 10px 5px;
  color: var(--faint);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.08em;
}
.side-nav {
  display: grid;
  gap: 2px;
}
.side-nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 37px;
  padding: 7px 10px;
  margin: 0;
  border-radius: 11px;
  color: var(--muted);
  background: transparent;
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  transition:
    background 0.18s ease,
    color 0.18s ease;
}
.side-nav button:hover {
  background: rgba(120, 120, 128, 0.1);
  color: var(--ink);
}
.side-nav button.active {
  color: var(--ink);
  background: var(--glass-strong);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
.side-nav button.active .icon {
  color: var(--accent);
}
.sidebar-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 10px 2px;
  color: var(--faint);
  font-size: 10px;
  border-top: 1px solid var(--line);
  margin-top: 8px;
}
.status-dot,
.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #30d158;
  box-shadow: 0 0 0 3px rgba(48, 209, 88, 0.12);
  flex: 0 0 auto;
}
.main-column {
  margin-left: calc(var(--sidebar-width) + 32px);
  padding: 16px 22px 64px;
}
/* Top toolbar */
.topbar {
  position: sticky;
  top: 16px;
  z-index: 15;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  max-width: 1180px;
  margin: 0 auto 18px;
  padding: 18px 22px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  backdrop-filter: blur(28px) saturate(180%);
}
.eyebrow {
  margin: 0 0 4px;
  color: var(--faint);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
}
.page-heading h1 {
  margin: 0;
  font-size: clamp(26px, 3.4vw, 34px);
  line-height: 1.1;
  letter-spacing: -0.7px;
  font-weight: 650;
}
.page-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.icon-button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin: 0;
  border-radius: 50%;
  color: var(--muted);
  background: rgba(120, 120, 128, 0.1);
  transition:
    background 0.18s ease,
    color 0.18s ease;
}
.icon-button:hover {
  color: var(--ink);
  background: rgba(120, 120, 128, 0.16);
}
.content {
  max-width: 1180px;
  margin: 0 auto;
  padding-bottom: 40px;
}
/* Status is a subtle floating toast, not a layout row. */
.status {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 40;
  max-width: min(360px, calc(100vw - 32px));
  margin: 0;
  padding: 9px 13px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--glass-border);
  color: var(--muted);
  background: var(--glass-strong);
  box-shadow: var(--shadow-soft);
  font-size: 11px;
  line-height: 1.35;
  -webkit-backdrop-filter: blur(22px);
  backdrop-filter: blur(22px);
}
.status:empty {
  display: none;
}
/* Pages */
.screen {
  animation: screen-in 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes screen-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.995);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 292px;
  padding: 34px 36px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--glass-border);
  overflow: hidden;
  background:
    radial-gradient(circle at 14% 18%, rgba(10, 132, 255, 0.2), transparent 34%),
    radial-gradient(circle at 84% 18%, rgba(48, 176, 199, 0.22), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(240, 247, 255, 0.64));
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(30px) saturate(170%);
  backdrop-filter: blur(30px) saturate(170%);
}
@media (prefers-color-scheme: dark) {
  .hero {
    background:
      radial-gradient(circle at 14% 18%, rgba(10, 132, 255, 0.26), transparent 34%),
      radial-gradient(circle at 84% 18%, rgba(48, 176, 199, 0.2), transparent 34%),
      linear-gradient(135deg, rgba(35, 39, 48, 0.94), rgba(16, 20, 28, 0.9));
  }
}
.hero-copy {
  position: relative;
  z-index: 2;
  max-width: 570px;
}
.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  background: rgba(120, 120, 128, 0.1);
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.08em;
}
.hero h2 {
  margin: 18px 0 12px;
  font-size: clamp(34px, 5vw, 52px);
  line-height: 1.05;
  letter-spacing: -1.8px;
  font-weight: 650;
}
.hero p {
  max-width: 470px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 24px;
}
.hero-orbit {
  position: relative;
  flex: 0 0 300px;
  height: 250px;
}
.orbit {
  position: absolute;
  left: 50%;
  top: 50%;
  border: 1px solid rgba(10, 132, 255, 0.22);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: inset 0 0 30px rgba(10, 132, 255, 0.04);
}
.orbit-a {
  width: 240px;
  height: 240px;
}
.orbit-b {
  width: 170px;
  height: 170px;
  border-color: rgba(48, 176, 199, 0.28);
}
.orbit-node {
  position: absolute;
  display: grid;
  place-items: center;
  min-width: 72px;
  padding: 9px 12px;
  border-radius: 14px;
  border: 1px solid var(--glass-border);
  background: var(--glass-strong);
  box-shadow: var(--shadow-soft);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}
.node-model {
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
}
.node-state {
  bottom: 32px;
  left: 6px;
}
.node-memory {
  right: 0;
  bottom: 72px;
}
.metric-grid {
  display: grid;
  grid-template-columns: 1.35fr repeat(3, 1fr);
  gap: 12px;
  margin-top: 14px;
}
.metric-card {
  min-width: 0;
  padding: 17px 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
  background: var(--glass);
  box-shadow: var(--shadow-soft);
  -webkit-backdrop-filter: blur(24px) saturate(170%);
  backdrop-filter: blur(24px) saturate(170%);
}
.metric-card span {
  display: block;
  color: var(--faint);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.metric-card strong {
  display: block;
  margin-top: 7px;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.4px;
  overflow-wrap: anywhere;
}
.metric-card p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 12px;
}
.quick-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-height: 118px;
  padding: 16px;
  margin: 0;
  border-radius: var(--radius-lg);
  color: var(--ink);
  text-align: left;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}
.quick-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.quick-card .icon {
  color: var(--accent);
  margin-bottom: 8px;
}
.quick-card strong {
  font-size: 14px;
}
.quick-card span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}
/* Panels */
.panel {
  border-radius: var(--radius-xl);
  padding: 24px;
}
.panel-head,
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.panel h2,
.modal h2 {
  margin: 0;
  font-size: 21px;
  line-height: 1.2;
  letter-spacing: -0.4px;
}
.panel-head p:not(.eyebrow),
.modal-head p:not(.eyebrow) {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
}
.split {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 14px;
  align-items: start;
}
.subhead {
  margin: 22px 0 2px;
  font-size: 13px;
  color: var(--muted);
}
/* Forms and controls */
label {
  display: block;
  margin: 12px 0 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}
input,
textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  color: var(--ink);
  background: rgba(120, 120, 128, 0.07);
  font-size: 14px;
  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease;
}
input::placeholder,
textarea::placeholder {
  color: var(--faint);
}
input:focus,
textarea:focus {
  outline: none;
  border-color: rgba(10, 132, 255, 0.5);
  background: var(--glass-strong);
  box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.13);
}
textarea {
  resize: vertical;
  min-height: 100px;
}
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 8px 15px;
  margin: 0;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 550;
  letter-spacing: -0.1px;
  transition:
    background 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease;
}
.pill.primary {
  color: #fff;
  background: linear-gradient(180deg, #0a84ff, #0071e3);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.pill.primary:hover {
  background: linear-gradient(180deg, #1a8cff, #0077ed);
}
.pill.subtle {
  color: var(--ink);
  background: rgba(120, 120, 128, 0.11);
}
.pill.subtle:hover {
  background: rgba(120, 120, 128, 0.17);
}
.pill.wide {
  width: 100%;
  margin-top: 16px;
}
button.pill {
  cursor: pointer;
}
.hint {
  margin: 10px 0 0;
  color: var(--faint);
  font-size: 11px;
  line-height: 1.5;
}
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  color: var(--muted);
  background: rgba(120, 120, 128, 0.11);
  font-size: 10px;
  font-weight: 550;
  white-space: nowrap;
}
/* Lists */
.list {
  padding: 0;
  margin: 0;
  list-style: none;
}
.list.inset {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.26);
  overflow: hidden;
}
.list.inset > li {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  line-height: 1.45;
}
.list.inset > li:last-child {
  border-bottom: 0;
}
.list.inset > li:hover {
  background: rgba(120, 120, 128, 0.06);
}
.list strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.list small {
  display: block;
  margin-top: 3px;
  color: var(--faint);
  font-size: 10.5px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.list > li > button:not(.pill) {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  color: var(--ink);
  background: transparent;
  text-align: left;
  font-weight: 600;
}
.list > li > button:not(.pill):hover {
  color: var(--accent);
}
.list .actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}
.list .actions button {
  margin: 0;
  font-size: 11px;
  min-height: 29px;
  padding: 5px 10px;
}
.list .actions .hint {
  margin: 0;
}
.button-link {
  display: inline-flex;
  align-items: center;
  margin: 0 0 4px;
  color: var(--accent);
  text-decoration: none;
  font-size: 13px;
  font-weight: 550;
}
.button-link:hover {
  text-decoration: underline;
}
/* Metrics / progress / pending */
.metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}
.metrics > div {
  min-width: 0;
  padding: 12px;
  border-radius: 14px;
  background: rgba(120, 120, 128, 0.08);
}
.metrics strong {
  display: block;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.4px;
}
.metrics span {
  display: block;
  margin-top: 2px;
  color: var(--faint);
  font-size: 10px;
}
.pending-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}
.pending-grid > div {
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(120, 120, 128, 0.05);
}
.pending-grid strong {
  display: block;
  font-size: 13px;
}
.pending-grid span {
  display: block;
  margin-top: 4px;
  color: var(--faint);
  font-size: 11px;
  line-height: 1.45;
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 52vh;
  margin: 12px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(120, 120, 128, 0.07);
  font:
    12px/1.6 ui-monospace,
    SFMono-Regular,
    Menlo,
    monospace;
  overflow: auto;
}
#knowledge-content {
  min-height: 260px;
}
/* Login */
.login-screen {
  display: grid;
  place-items: center;
  min-height: calc(100dvh - 160px);
  padding: 20px 0 60px;
}
.login-card {
  width: min(410px, 100%);
  padding: 30px 26px 26px;
  border-radius: var(--radius-xl);
  text-align: left;
}
.login-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 18px;
  border-radius: 15px;
  color: #fff;
  background: linear-gradient(145deg, #0a84ff, #30b0c7);
  box-shadow: 0 8px 22px rgba(10, 132, 255, 0.28);
}
.login-card h2 {
  margin: 2px 0 8px;
  font-size: 30px;
  letter-spacing: -0.8px;
}
.login-card > p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
/* Modal sheets */
.modal {
  position: fixed;
  z-index: 60;
  top: 50%;
  left: 50%;
  width: min(760px, calc(100vw - 40px));
  max-height: min(82dvh, 820px);
  overflow-y: auto;
  padding: 24px;
  border-radius: var(--radius-xl);
  transform: translate(-50%, -50%);
  background: var(--surface);
  border: 1px solid var(--glass-border);
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.3);
  -webkit-backdrop-filter: blur(38px) saturate(180%);
  backdrop-filter: blur(38px) saturate(180%);
  animation: modal-in 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes modal-in {
  from {
    opacity: 0;
    transform: translate(-50%, calc(-50% + 12px)) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(12, 16, 24, 0.32);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  animation: backdrop-in 0.2s ease;
}
@keyframes backdrop-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.modal-head {
  margin-bottom: 10px;
}
.modal-head h2 {
  margin-top: 1px;
}
/* Mobile tab bar + More sheet */
.tabbar {
  display: none;
}
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  align-items: end;
  background: rgba(12, 16, 24, 0.3);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
}
.more-sheet {
  width: 100%;
  max-height: 78dvh;
  padding: 8px 18px calc(24px + env(safe-area-inset-bottom));
  border-radius: 28px 28px 0 0;
  border-bottom: 0;
  overflow-y: auto;
  animation: sheet-in 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes sheet-in {
  from {
    transform: translateY(100%);
  }
  to {
    transform: none;
  }
}
.sheet-handle {
  width: 36px;
  height: 4px;
  margin: 0 auto 16px;
  border-radius: 99px;
  background: var(--line-strong);
}
.more-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.more-grid button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  min-height: 76px;
  padding: 12px 6px;
  margin: 0;
  border-radius: 16px;
  color: var(--ink);
  background: rgba(120, 120, 128, 0.08);
  font-size: 10px;
}
.more-grid button .icon {
  color: var(--accent);
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
/* Tablet: compact icon rail */
@media (max-width: 1120px) {
  :root {
    --sidebar-width: 82px;
  }
  .sidebar {
    padding: 16px 9px 12px;
    align-items: center;
  }
  .brand {
    padding: 2px 0 16px;
  }
  .brand-copy,
  .workspace-card,
  .nav-label,
  .sidebar-foot,
  .side-nav button span {
    display: none;
  }
  .side-nav button {
    justify-content: center;
    width: 46px;
    min-height: 42px;
    padding: 0;
  }
  .sidebar-scroll {
    width: 100%;
  }
  .side-nav {
    justify-items: center;
  }
  .main-column {
    margin-left: calc(var(--sidebar-width) + 32px);
  }
  .hero {
    min-height: 260px;
    padding: 28px;
  }
  .hero-orbit {
    flex-basis: 240px;
    transform: scale(0.86);
  }
  .quick-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .metric-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
/* Phone: iOS-style bottom bar and sheets */
@media (max-width: 760px) {
  :root {
    --sidebar-width: 0px;
  }
  .sidebar {
    display: none;
  }
  .main-column {
    margin-left: 0;
    padding: 10px 10px calc(96px + env(safe-area-inset-bottom));
  }
  .topbar {
    top: 8px;
    margin: 0 0 10px;
    padding: 14px 15px;
    border-radius: 20px;
    align-items: center;
  }
  .page-heading h1 {
    font-size: 25px;
  }
  .page-subtitle {
    display: none;
  }
  .top-actions .icon-button {
    width: 33px;
    height: 33px;
  }
  .content {
    padding-bottom: 0;
  }
  .hero {
    min-height: 250px;
    padding: 24px 20px;
    border-radius: 26px;
  }
  .hero h2 {
    margin-top: 14px;
    font-size: 32px;
    letter-spacing: -1px;
  }
  .hero p {
    font-size: 12px;
  }
  .hero-orbit {
    display: none;
  }
  .hero-actions {
    gap: 7px;
    margin-top: 18px;
  }
  .hero-actions .pill {
    min-height: 34px;
    padding: 7px 12px;
    font-size: 12px;
  }
  .metric-grid,
  .quick-grid {
    gap: 9px;
    margin-top: 9px;
  }
  .metric-card {
    padding: 14px;
    border-radius: 19px;
  }
  .metric-card strong {
    font-size: 18px;
  }
  .quick-card {
    min-height: 104px;
    padding: 14px;
    border-radius: 19px;
  }
  .quick-card span {
    font-size: 10px;
  }
  .panel {
    padding: 18px 16px;
    border-radius: 24px;
  }
  .panel h2 {
    font-size: 19px;
  }
  .panel-head {
    margin-bottom: 12px;
  }
  .split {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .metrics {
    grid-template-columns: repeat(2, 1fr);
  }
  .pending-grid {
    grid-template-columns: 1fr;
  }
  .tabbar {
    display: grid;
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
    z-index: 45;
    grid-template-columns: repeat(5, 1fr);
    padding: 7px;
    border-radius: 24px;
    border: 1px solid var(--glass-border);
    background: var(--glass-strong);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.18);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    backdrop-filter: blur(30px) saturate(180%);
  }
  .tabbar button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 44px;
    padding: 3px 0;
    margin: 0;
    border-radius: 16px;
    color: var(--faint);
    background: transparent;
    font-size: 9px;
  }
  .tabbar button .icon {
    width: 21px;
    height: 21px;
  }
  .tabbar button.active {
    color: var(--accent);
    background: rgba(10, 132, 255, 0.1);
  }
  .status {
    left: 50%;
    right: auto;
    bottom: calc(82px + env(safe-area-inset-bottom));
    transform: translateX(-50%);
    max-width: calc(100vw - 40px);
    text-align: center;
  }
  .modal {
    top: auto;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: 88dvh;
    border-radius: 28px 28px 0 0;
    border-bottom: 0;
    transform: none;
    padding: 20px 18px calc(24px + env(safe-area-inset-bottom));
    animation: sheet-in 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  }
  @keyframes modal-in {
    from {
      opacity: 0;
      transform: translateY(100%);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }
  .more-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .login-screen {
    min-height: calc(100dvh - 100px);
    padding-bottom: 40px;
  }
  .login-card {
    padding: 24px 20px;
  }
  .login-card h2 {
    font-size: 27px;
  }
}
@media (max-width: 380px) {
  .metrics {
    grid-template-columns: 1fr;
  }
  .quick-grid {
    grid-template-columns: 1fr;
  }
  .hero h2 {
    font-size: 29px;
  }
}

/* Post-screenshot refinements */
.list .actions button {
  color: var(--ink);
  background: rgba(120, 120, 128, 0.11);
  border-radius: var(--radius-pill);
}
.list .actions button:hover {
  background: rgba(120, 120, 128, 0.18);
}
body:not(.authenticated) .side-nav,
body:not(.authenticated) .workspace-card,
body:not(.authenticated) .tabbar {
  display: none;
}
@media (max-width: 1024px) {
  .hero-orbit {
    display: none;
  }
  .hero-copy {
    max-width: 100%;
  }
  .hero h2 {
    font-size: clamp(33px, 4.6vw, 40px);
    letter-spacing: -1.2px;
  }
}
@media (max-width: 760px) {
  .hero h2 {
    font-size: 28px;
    letter-spacing: -0.9px;
  }
}

.overview-recent {
  margin-top: 12px;
}

@media (max-width: 760px) {
  .modal {
    min-height: 260px;
    padding-bottom: calc(28px + env(safe-area-inset-bottom));
  }
}

body:has(.modal:not([hidden])) {
  overflow: hidden;
}
@media (max-width: 760px) {
  .modal::before {
    display: none;
  }
  .modal::after {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    width: 36px;
    height: 4px;
    border-radius: 99px;
    background: var(--line-strong);
    transform: translateX(-50%);
  }
  .modal {
    padding-top: 28px;
  }
}

body:not(.authenticated) .sidebar {
  display: none;
}
body:not(.authenticated) .main-column {
  margin-left: 0;
}

@media (max-width: 760px) {
  .metrics > div:last-child:nth-child(odd) {
    grid-column: span 2;
  }
}
@media (prefers-color-scheme: dark) {
  .list.inset {
    background: rgba(255, 255, 255, 0.035);
  }
  .list.inset > li:hover {
    background: rgba(255, 255, 255, 0.06);
  }
  .quick-card,
  .metric-card {
    background: rgba(30, 32, 38, 0.72);
  }
}

/* iOS Safari: avoid input auto-zoom and keep touch targets comfortable. */
@media (max-width: 760px) {
  input,
  textarea {
    font-size: 16px;
  }
  .pill {
    min-height: 40px;
  }
  .list .actions button {
    min-height: 34px;
    font-size: 12px;
  }
  .topbar .icon-button,
  .top-actions .icon-button {
    width: 38px;
    height: 38px;
  }
}

.text-button {
  margin: 10px auto 0;
  padding: 0;
  color: var(--accent);
  background: transparent;
  font-size: 12px;
  font-weight: 500;
}
.text-button:hover {
  text-decoration: underline;
}
#account-form {
  max-width: 460px;
}
#account-form .actions {
  margin-top: 14px;
}
