/* ============================================================================
   Kanso Design System
   Notion Workspace Layout × Claude Code Warm Charcoal/Terracotta × AWS 1px Grid
   ============================================================================ */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root,
[data-theme="dark"] {
  color-scheme: dark;
  --bg-canvas: #141413;
  --bg-sidebar: #1A1917;
  --bg-surface: #1F1E1B;
  --bg-surface-hover: #272622;
  --bg-elevated: #2B2A26;
  --bg-code: #10100F;
  --bg-input: #171614;

  --border-subtle: #2E2D29;
  --border-strong: #413F39;
  --border-focus: #D97757;

  --text-primary: #ECEBE6;
  --text-secondary: #A6A39B;
  --text-tertiary: #737069;

  --accent: #D97757;
  --accent-hover: #E58A6C;
  --accent-soft: rgba(217, 119, 87, 0.14);
  --accent-border: rgba(217, 119, 87, 0.42);
  --accent-contrast: #141413;

  --status-success: #6FA67B;
  --status-success-soft: rgba(111, 166, 123, 0.14);
  --status-warn: #D4A359;
  --status-warn-soft: rgba(212, 163, 89, 0.14);
  --status-danger: #E06C65;
  --status-danger-soft: rgba(224, 108, 101, 0.14);
  --status-info: #7E97A6;
  --status-info-soft: rgba(126, 151, 166, 0.14);

  /* Syntax highlighting (Claude Code dark terminal) */
  --syn-comment: #6D6A62;
  --syn-keyword: #D97757;
  --syn-string: #8BB58A;
  --syn-number: #D4A359;
  --syn-func: #E5C07B;
  --syn-type: #7E97A6;
  --syn-op: #A6A39B;
  --syn-error: #E06C65;
}

[data-theme="light"] {
  color-scheme: light;
  --bg-canvas: #FAF9F5;
  --bg-sidebar: #F3F1EA;
  --bg-surface: #FFFFFF;
  --bg-surface-hover: #F5F2EB;
  --bg-elevated: #FFFFFF;
  --bg-code: #F2F0E8;
  --bg-input: #FFFFFF;

  --border-subtle: #E3E0D6;
  --border-strong: #CBC6B8;
  --border-focus: #C15F3C;

  --text-primary: #1C1B18;
  --text-secondary: #5C5952;
  --text-tertiary: #8A867C;

  --accent: #C15F3C;
  --accent-hover: #A94E2E;
  --accent-soft: rgba(193, 95, 60, 0.10);
  --accent-border: rgba(193, 95, 60, 0.35);
  --accent-contrast: #FFFFFF;

  --status-success: #3B7A4B;
  --status-success-soft: rgba(59, 122, 75, 0.10);
  --status-warn: #A36E1D;
  --status-warn-soft: rgba(163, 110, 29, 0.11);
  --status-danger: #C0443E;
  --status-danger-soft: rgba(192, 68, 62, 0.10);
  --status-info: #476C80;
  --status-info-soft: rgba(71, 108, 128, 0.10);

  /* Syntax highlighting (Claude Code warm parchment) */
  --syn-comment: #8A867C;
  --syn-keyword: #B24C2B;
  --syn-string: #3A7349;
  --syn-number: #9B6418;
  --syn-func: #7C5295;
  --syn-type: #3E667A;
  --syn-op: #5C5952;
  --syn-error: #C0443E;
}

[data-theme="aws"] {
  color-scheme: dark;
  --bg-canvas: #0F1B2A;
  --bg-sidebar: #09111B;
  --bg-surface: #162436;
  --bg-surface-hover: #1D2E44;
  --bg-elevated: #1E3046;
  --bg-code: #080F18;
  --bg-input: #111D2C;

  --border-subtle: #24354A;
  --border-strong: #374F6B;
  --border-focus: #FF9900;

  --text-primary: #F2F4F8;
  --text-secondary: #A9B8CC;
  --text-tertiary: #7388A3;

  --accent: #FF9900;
  --accent-hover: #FFAD33;
  --accent-soft: rgba(255, 153, 0, 0.14);
  --accent-border: rgba(255, 153, 0, 0.44);
  --accent-contrast: #09111B;

  --status-success: #53B978;
  --status-success-soft: rgba(83, 185, 120, 0.14);
  --status-warn: #FFAD33;
  --status-warn-soft: rgba(255, 173, 51, 0.14);
  --status-danger: #F06A6A;
  --status-danger-soft: rgba(240, 106, 106, 0.14);
  --status-info: #539FE5;
  --status-info-soft: rgba(83, 159, 229, 0.14);

  --syn-comment: #6D829E;
  --syn-keyword: #FF9900;
  --syn-string: #6BCB8B;
  --syn-number: #FFBD59;
  --syn-func: #68B0F2;
  --syn-type: #7DD3FC;
  --syn-op: #A9B8CC;
  --syn-error: #F06A6A;
}

[data-theme="nord"] {
  color-scheme: dark;
  --bg-canvas: #1B2028;
  --bg-sidebar: #161A21;
  --bg-surface: #222833;
  --bg-surface-hover: #2A313E;
  --bg-elevated: #2D3544;
  --bg-code: #14181E;
  --bg-input: #1A1F27;

  --border-subtle: #2E3744;
  --border-strong: #414D5E;
  --border-focus: #88C0D0;

  --text-primary: #ECEFF4;
  --text-secondary: #B4BECB;
  --text-tertiary: #7C8797;

  --accent: #88C0D0;
  --accent-hover: #9AD0DF;
  --accent-soft: rgba(136, 192, 208, 0.14);
  --accent-border: rgba(136, 192, 208, 0.42);
  --accent-contrast: #161A21;

  --status-success: #A3BE8C;
  --status-success-soft: rgba(163, 190, 140, 0.14);
  --status-warn: #EBCB8B;
  --status-warn-soft: rgba(235, 203, 139, 0.14);
  --status-danger: #BF616A;
  --status-danger-soft: rgba(191, 97, 106, 0.15);
  --status-info: #81A1C1;
  --status-info-soft: rgba(129, 161, 193, 0.14);

  --syn-comment: #727E8E;
  --syn-keyword: #88C0D0;
  --syn-string: #A3BE8C;
  --syn-number: #EBCB8B;
  --syn-func: #B48EAD;
  --syn-type: #81A1C1;
  --syn-op: #B4BECB;
  --syn-error: #BF616A;
}

[data-theme="paper"] {
  color-scheme: light;
  --bg-canvas: #FFFFFF;
  --bg-sidebar: #F4F5F7;
  --bg-surface: #FFFFFF;
  --bg-surface-hover: #F6F8FA;
  --bg-elevated: #FFFFFF;
  --bg-code: #F4F6F8;
  --bg-input: #FFFFFF;

  --border-subtle: #E2E5EA;
  --border-strong: #C6CCD6;
  --border-focus: #2563EB;

  --text-primary: #111827;
  --text-secondary: #4B5563;
  --text-tertiary: #7B8494;

  --accent: #2563EB;
  --accent-hover: #1D4ED8;
  --accent-soft: rgba(37, 99, 235, 0.09);
  --accent-border: rgba(37, 99, 235, 0.34);
  --accent-contrast: #FFFFFF;

  --status-success: #16803D;
  --status-success-soft: rgba(22, 128, 61, 0.10);
  --status-warn: #B45309;
  --status-warn-soft: rgba(180, 83, 9, 0.10);
  --status-danger: #DC2626;
  --status-danger-soft: rgba(220, 38, 38, 0.09);
  --status-info: #0284C7;
  --status-info-soft: rgba(2, 132, 199, 0.10);

  --syn-comment: #7B8494;
  --syn-keyword: #1D4ED8;
  --syn-string: #15803D;
  --syn-number: #B45309;
  --syn-func: #7C3AED;
  --syn-type: #0369A1;
  --syn-op: #4B5563;
  --syn-error: #DC2626;
}

:root {
  --font-sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  --sidebar-width: 256px;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
}

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

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg-canvas);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

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

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

/* ============================================================================
   App Shell (Notion Sidebar + AWS Precision Topbar)
   ============================================================================ */

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

.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 30;
  transition: width 0.16s ease, transform 0.2s ease;
}

.app-shell.sidebar-collapsed .sidebar {
  width: 0;
  border-right: none;
  overflow: hidden;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  gap: 8px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand-mark {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.brand-name {
  font-size: 14px;
  color: var(--text-primary);
}

.brand-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-tertiary);
  border: 1px solid var(--border-subtle);
  padding: 1px 5px;
  border-radius: var(--radius-sm);
}

.sidebar-search-btn {
  margin: 10px 12px 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 12.5px;
  transition: border-color 0.12s, background 0.12s;
}

.sidebar-search-btn:hover {
  border-color: var(--border-strong);
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

.kbd-hint {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-tertiary);
  background: var(--bg-canvas);
  border: 1px solid var(--border-subtle);
  padding: 1px 5px;
  border-radius: var(--radius-sm);
}

.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 8px 10px 16px;
}

.sidebar-section {
  margin-top: 16px;
}

.sidebar-section:first-child {
  margin-top: 4px;
}

.sidebar-kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px 6px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.sidebar-add-btn {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-tertiary);
  width: 20px;
  height: 20px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
}

.sidebar-add-btn:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-subtle);
  color: var(--text-primary);
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  transition: background 0.1s, color 0.1s, border-color 0.1s;
}

.nav-item:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--bg-surface);
  border-color: var(--border-subtle);
  color: var(--text-primary);
}

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

.nav-item-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.nav-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-icon {
  font-family: var(--font-mono);
  font-size: 13px;
  width: 18px;
  text-align: center;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.nav-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-tertiary);
  padding: 0 5px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-canvas);
}

.sidebar-quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 10px 12px;
  border-top: 1px solid var(--border-subtle);
}

.sidebar-footer {
  padding: 10px 12px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
  padding: 4px 6px;
  border-radius: var(--radius-md);
}

.user-pill:hover {
  background: var(--bg-surface-hover);
}

.user-meta {
  min-width: 0;
}

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

.user-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================================================
   Main Workspace & Topbar
   ============================================================================ */

.main-column {
  flex: 1;
  min-width: 0;
  overflow-x: clip;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 48px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-canvas);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 20;
  gap: 12px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.breadcrumbs .crumb-sep {
  color: var(--text-tertiary);
  font-family: var(--font-mono);
}

.breadcrumbs .crumb-current {
  color: var(--text-primary);
  font-weight: 600;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-content {
  padding: 24px 28px 48px;
  max-width: 1480px;
  width: 100%;
  margin: 0 auto;
}

/* ============================================================================
   Buttons, Inputs, Badges, Avatars (AWS 1px Precision)
   ============================================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.btn:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-strong);
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-contrast);
  font-weight: 600;
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-subtle);
  color: var(--text-primary);
}

.btn-danger {
  background: var(--status-danger-soft);
  border-color: rgba(224, 108, 101, 0.35);
  color: var(--status-danger);
}

.btn-danger:hover {
  background: rgba(224, 108, 101, 0.22);
}

.btn-sm {
  height: 28px;
  padding: 0 9px;
  font-size: 12px;
}

.btn-icon {
  width: 30px;
  height: 30px;
  padding: 0;
}

.input,
.select,
.textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  padding: 7px 10px;
  font-size: 13.5px;
  transition: border-color 0.12s;
}

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

.input-sm,
.select-sm {
  height: 30px;
  padding: 4px 8px;
  font-size: 12.5px;
}

.textarea {
  resize: vertical;
  line-height: 1.55;
}

.form-grid {
  display: grid;
  gap: 14px;
}

.form-grid > * {
  min-width: 0;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  margin-bottom: 5px;
}

.checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-primary);
}

.checkbox-row input[type="checkbox"] {
  accent-color: var(--accent);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.avatar {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  color: #141413;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.avatar-sm {
  width: 20px;
  height: 20px;
  font-size: 9.5px;
}

.avatar-lg {
  width: 44px;
  height: 44px;
  font-size: 16px;
  border-radius: var(--radius-md);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-canvas);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
}

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

.badge-private {
  background: var(--status-warn-soft);
  border-color: rgba(212, 163, 89, 0.35);
  color: var(--status-warn);
}

.badge-shared {
  background: var(--status-info-soft);
  border-color: rgba(126, 151, 166, 0.35);
  color: var(--status-info);
}

.badge-success {
  background: var(--status-success-soft);
  border-color: rgba(111, 166, 123, 0.35);
  color: var(--status-success);
}

.badge-danger {
  background: var(--status-danger-soft);
  border-color: rgba(224, 108, 101, 0.35);
  color: var(--status-danger);
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-canvas);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
}

.tag-chip:hover {
  border-color: var(--accent-border);
  color: var(--accent);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.task-key {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
  white-space: nowrap;
  flex-shrink: 0;
}

.task-title-input {
  font-size: 19px;
  font-weight: 600;
  line-height: 1.35;
  border-color: transparent;
  background: transparent;
  padding: 2px 0;
  resize: vertical;
}

.task-title-input:focus {
  background: var(--bg-input);
  padding: 4px 8px;
}

.alert {
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  font-size: 13px;
  margin-bottom: 14px;
}

.alert-error {
  background: var(--status-danger-soft);
  border-color: rgba(224, 108, 101, 0.45);
  color: var(--status-danger);
}

.alert-success {
  background: var(--status-success-soft);
  border-color: rgba(111, 166, 123, 0.45);
  color: var(--status-success);
}

/* ============================================================================
   Page Headers, AWS Stats Grid, Cards
   ============================================================================ */

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.page-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-icon {
  font-family: var(--font-mono);
  font-size: 18px;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.page-title {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.page-subtitle {
  margin: 4px 0 0;
  color: var(--text-secondary);
  font-size: 13.5px;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

.stat-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
}

.stat-value {
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.1;
}

.stat-value-accent {
  color: var(--accent);
}

.panel {
  min-width: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  gap: 10px;
}

.panel-title {
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-body {
  padding: 14px 16px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 18px;
  align-items: start;
}

.dashboard-grid > * {
  min-width: 0;
}

.quick-add-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.quick-add-bar .input {
  flex: 1 1 200px;
  min-width: 0;
}

.quick-add-bar .select {
  width: auto;
  min-width: 142px;
  white-space: nowrap;
}

.focus-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.1s, border-color 0.1s;
}

.focus-row + .focus-row {
  border-top: 1px solid var(--border-subtle);
  border-radius: 0;
}

.focus-row:hover {
  background: var(--bg-surface-hover);
}

.focus-row-left {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.focus-title {
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.focus-row-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 0;
}

.activity-item + .activity-item {
  border-top: 1px solid var(--border-subtle);
}

.activity-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.45;
}

.activity-text strong {
  color: var(--text-primary);
  font-weight: 600;
}

.activity-link {
  color: var(--accent);
  font-weight: 500;
}

.activity-link:hover {
  text-decoration: underline;
}

.activity-time {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-tertiary);
}

/* ============================================================================
   Tasks Toolbar, Segmented Switchers, Kanban Board, Table & List Views
   ============================================================================ */

.toolbar-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
  padding: 10px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.filter-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.segmented {
  display: inline-flex;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-canvas);
  padding: 2px;
  gap: 2px;
}

.seg-btn {
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
}

.seg-btn:hover {
  color: var(--text-primary);
}

.seg-btn.active {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

.kanban-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(245px, 1fr));
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 10px;
  align-items: start;
}

.kanban-column {
  background: var(--bg-sidebar);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  min-height: 420px;
}

.kanban-column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.kanban-column-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 600;
}

.kanban-column-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-tertiary);
  background: var(--bg-canvas);
  border: 1px solid var(--border-subtle);
  padding: 0 6px;
  border-radius: var(--radius-sm);
}

.kanban-column-body {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-height: 180px;
  transition: background 0.12s, outline 0.12s;
}

.kanban-column-body.drag-over {
  background: var(--accent-soft);
  outline: 1px dashed var(--accent);
  outline-offset: -3px;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.kanban-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 11px;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}

.kanban-card:hover {
  border-color: var(--border-strong);
  background: var(--bg-surface-hover);
}

.kanban-card.dragging {
  opacity: 0.45;
  border-color: var(--accent);
}

.kanban-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 6px;
}

.kanban-card-title {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 8px;
}

.kanban-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
}

.kanban-card-badges {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.aws-table-wrap {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow-x: auto;
}

.aws-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.aws-table th {
  text-align: left;
  padding: 9px 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.aws-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.aws-table tr:last-child td {
  border-bottom: none;
}

.aws-table tbody tr {
  cursor: pointer;
  transition: background 0.1s;
}

.aws-table tbody tr:hover {
  background: var(--bg-surface-hover);
}

.list-group {
  margin-bottom: 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.list-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 12.5px;
  font-weight: 600;
}

/* ============================================================================
   Notion Side-Peek Drawer & Modals
   ============================================================================ */

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 60;
  display: none;
  justify-content: flex-end;
}

.drawer-backdrop.open {
  display: flex;
}

.drawer-panel {
  width: min(600px, 100vw);
  height: 100vh;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-strong);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.drawer-topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
}

.drawer-body {
  padding: 18px 22px 32px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.56);
  z-index: 70;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 8vh 16px 24px;
}

.modal-backdrop.open {
  display: flex;
}

.modal-card {
  width: min(560px, 100%);
  max-height: 82vh;
  overflow-y: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-body {
  padding: 16px;
}

/* Notion Property Rows inside Task Detail */
.notion-props {
  display: grid;
  gap: 8px;
  padding: 12px 0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  margin: 12px 0 16px;
}

.notion-prop-row {
  display: grid;
  grid-template-columns: 145px 1fr;
  align-items: center;
  gap: 10px;
}

.notion-prop-label {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-tertiary);
}

.checklist-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-canvas);
  margin-bottom: 6px;
}

.checklist-item.done .checklist-title {
  text-decoration: line-through;
  color: var(--text-tertiary);
}

/* ============================================================================
   Dev-Blog Index, Notion Reading Canvas, Split Editor & Markdown Prose
   ============================================================================ */

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 14px;
}

.blog-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  transition: border-color 0.12s, background 0.12s;
}

.blog-card:hover {
  border-color: var(--border-strong);
  background: var(--bg-surface-hover);
}

.blog-card-pinned {
  border-top: 2px solid var(--accent);
}

.blog-card-title {
  margin: 6px 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.blog-card-excerpt {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
}

.blog-reader-layout {
  display: grid;
  grid-template-columns: minmax(0, 780px) 220px;
  gap: 32px;
  justify-content: center;
  align-items: start;
}

.blog-article {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 32px 38px;
}

.blog-toc {
  position: sticky;
  top: 72px;
  border-left: 1px solid var(--border-subtle);
  padding-left: 14px;
}

.blog-toc-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}

.blog-toc a {
  display: block;
  font-size: 12.5px;
  color: var(--text-secondary);
  padding: 3px 0;
  line-height: 1.35;
}

.blog-toc a:hover {
  color: var(--accent);
}

.blog-toc a.toc-lvl-2 {
  padding-left: 8px;
}

.blog-toc a.toc-lvl-3 {
  padding-left: 18px;
  font-size: 12px;
}

.prose {
  font-size: 15px;
  line-height: 1.72;
  color: var(--text-primary);
}

.prose h1,
.prose h2,
.prose h3,
.prose h4 {
  margin: 1.4em 0 0.55em;
  line-height: 1.3;
  letter-spacing: -0.015em;
  font-weight: 600;
}

.prose h1 { font-size: 1.65em; }
.prose h2 {
  font-size: 1.32em;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-subtle);
}
.prose h3 { font-size: 1.12em; }

.prose p {
  margin: 0.85em 0;
}

.prose ul,
.prose ol {
  margin: 0.8em 0;
  padding-left: 1.5em;
}

.prose li.md-task-item {
  list-style: none;
  margin-left: -1.2em;
}

.prose blockquote {
  margin: 1.1em 0;
  padding: 10px 14px;
  border-left: 3px solid var(--accent);
  background: var(--bg-canvas);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--text-secondary);
}

.prose code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--bg-code);
  border: 1px solid var(--border-subtle);
  padding: 1px 5px;
  border-radius: var(--radius-sm);
}

.prose .highlight,
.prose pre {
  background: var(--bg-code);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  overflow-x: auto;
  margin: 1.1em 0;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.55;
}

.prose .highlight pre {
  border: none;
  padding: 0;
  margin: 0;
  background: transparent;
}

.prose .highlight code,
.prose pre code {
  border: none;
  padding: 0;
  background: transparent;
  font-size: inherit;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2em 0;
  font-size: 13.5px;
  border: 1px solid var(--border-subtle);
}

.prose th,
.prose td {
  padding: 8px 11px;
  border: 1px solid var(--border-subtle);
  text-align: left;
}

.prose th {
  background: var(--bg-sidebar);
  font-family: var(--font-mono);
  font-size: 11.5px;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.prose a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.prose a.task-ref {
  display: inline-flex;
  align-items: center;
  padding: 0 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--accent-border);
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.85em;
  font-weight: 600;
  text-decoration: none;
}

.prose a.task-ref:hover {
  background: var(--accent);
  color: var(--accent-contrast);
}

/* Pygments Highlight Token Mapping */
.highlight .c, .highlight .c1, .highlight .cm, .highlight .cs { color: var(--syn-comment); font-style: italic; }
.highlight .k, .highlight .kd, .highlight .kn, .highlight .kp, .highlight .kr, .highlight .kt { color: var(--syn-keyword); font-weight: 500; }
.highlight .s, .highlight .s1, .highlight .s2, .highlight .sb, .highlight .sc, .highlight .sd, .highlight .se, .highlight .sh, .highlight .si { color: var(--syn-string); }
.highlight .m, .highlight .mi, .highlight .mf, .highlight .mh, .highlight .mo { color: var(--syn-number); }
.highlight .nf, .highlight .fm { color: var(--syn-func); }
.highlight .nc, .highlight .nn, .highlight .nb { color: var(--syn-type); }
.highlight .o, .highlight .ow { color: var(--syn-op); }
.highlight .err { color: var(--syn-error); }

/* Split Markdown Editor */
.editor-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px 10px;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-subtle);
  border-bottom: none;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.editor-tool-btn {
  padding: 4px 8px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 11.5px;
  cursor: pointer;
}

.editor-tool-btn:hover {
  background: var(--bg-surface);
  border-color: var(--border-subtle);
  color: var(--text-primary);
}

.editor-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--border-subtle);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  overflow: hidden;
  min-height: 460px;
}

.editor-pane-textarea {
  width: 100%;
  min-height: 460px;
  padding: 14px 16px;
  border: none;
  border-right: 1px solid var(--border-subtle);
  background: var(--bg-input);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  resize: vertical;
}

.editor-pane-textarea:focus {
  outline: none;
}

.editor-pane-preview {
  padding: 14px 18px;
  background: var(--bg-surface);
  overflow-y: auto;
  max-height: 640px;
}

.preview-placeholder {
  color: var(--text-tertiary);
  font-size: 13px;
}

/* ============================================================================
   Team Cards, Auth Screens, Command Palette & Toast
   ============================================================================ */

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: var(--bg-canvas);
}

.auth-card {
  width: min(420px, 100%);
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 26px 28px;
}

.search-result-group {
  margin-bottom: 14px;
}

.search-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
}

.search-result-item:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-subtle);
}

.toast-stack {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast-item {
  background: var(--bg-elevated);
  border: 1px solid var(--accent-border);
  border-left: 3px solid var(--accent);
  color: var(--text-primary);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-family: var(--font-sans);
}

.empty-state {
  padding: 32px 18px;
  text-align: center;
  color: var(--text-secondary);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-md);
}

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

@media (max-width: 1120px) {
  .blog-reader-layout {
    grid-template-columns: 1fr;
  }
  .blog-toc {
    display: none;
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .stats-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .editor-split {
    grid-template-columns: 1fr;
  }
  .editor-pane-textarea {
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
    min-height: 280px;
  }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-100%);
  }
  .app-shell.mobile-sidebar-open .sidebar {
    transform: translateX(0);
    width: var(--sidebar-width);
  }
}

.code-snippet {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-code);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  overflow-x: auto;
  color: var(--text-primary);
}

.prose img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  display: block;
  margin: 12px 0;
}

.attachments-grid {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.attachments-grid:empty {
  display: none;
}

.attachment-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-canvas);
}

.attachment-thumb-link {
  flex-shrink: 0;
  display: inline-flex;
}

.attachment-thumb {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  display: block;
}

.attachment-file-badge {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

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

.attachment-name {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.attachment-name:hover {
  color: var(--accent);
}

.attachment-size {
  font-size: 11px;
  color: var(--text-tertiary);
}

.attachment-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.upload-drop-active {
  border-color: var(--accent) !important;
  background: var(--accent-soft) !important;
}

@media (max-width: 600px) {
  .page-content {
    padding: 16px 14px 36px;
  }
  .blog-article {
    padding: 20px 18px;
  }
  .form-row-2 {
    grid-template-columns: 1fr;
  }
  .notion-prop-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

/* ============================================================================
   Infrastructure Dependency & Topology Studio (/infra)
   ============================================================================ */

.infra-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}

.infra-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.14s ease, background 0.14s ease;
}

.infra-card:hover {
  border-color: var(--border-strong);
  background: var(--bg-surface-hover);
}

.infra-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.infra-card-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.infra-card-date {
  font-size: 11.5px;
  color: var(--text-tertiary);
}

.infra-card-title {
  font-size: 15.5px;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  line-height: 1.35;
}

.infra-card-title:hover {
  color: var(--accent);
}

.infra-card-desc {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.infra-card-desc.muted-desc {
  color: var(--text-tertiary);
}

.infra-card-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-canvas);
  overflow: hidden;
}

.infra-metric-cell {
  padding: 8px 10px;
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.infra-metric-cell:last-child {
  border-right: none;
}

.infra-metric-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
}

.infra-metric-val {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
}

.infra-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 4px;
}

.infra-card-regions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.pill-region {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-canvas);
  color: var(--text-secondary);
}

/* Editor Topbar & Studio Shell */
.infra-topbar-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  margin-bottom: 12px;
}

.infra-topbar-main {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  flex: 1 1 420px;
}

.infra-title-heading {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.25;
}

.infra-save-pill {
  font-size: 11px;
  font-family: var(--font-mono);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  color: var(--status-success);
  background: var(--status-success-soft);
}

.infra-save-pill.unsaved {
  color: var(--status-warn);
  background: var(--status-warn-soft);
  border-color: rgba(212, 163, 89, 0.35);
}

.infra-summary-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.infra-summary-chip {
  font-size: 11.5px;
  color: var(--text-secondary);
  background: var(--bg-canvas);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 3px 8px;
}

.infra-summary-chip strong {
  color: var(--text-primary);
}

.infra-topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.infra-zoom-group {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-canvas);
  padding: 1px;
}

.infra-zoom-label {
  font-size: 11.5px;
  min-width: 44px;
  text-align: center;
  color: var(--text-secondary);
}

.btn.active-toggle {
  border-color: var(--accent-border);
  background: var(--accent-soft);
  color: var(--accent);
}

.infra-studio {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr) 292px;
  height: calc(100vh - 220px);
  min-height: 580px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--bg-canvas);
  overflow: hidden;
}

/* Left Palette */
.infra-palette {
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.infra-tool-modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 10px;
  border-bottom: 1px solid var(--border-subtle);
}

.infra-mode-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.infra-mode-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.infra-mode-btn.active {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--accent);
}

.infra-palette-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.infra-palette-kicker {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  margin-bottom: 6px;
  padding-left: 2px;
}

.infra-palette-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.infra-palette-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 12.5px;
  text-align: left;
  cursor: grab;
  transition: border-color 0.12s ease, background 0.12s ease;
}

.infra-palette-item:hover {
  border-color: var(--accent-border);
  background: var(--bg-surface-hover);
}

.infra-palette-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  background: var(--bg-canvas);
  border: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.infra-palette-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Infinite Excalidraw-style Canvas */
.infra-canvas-wrap {
  position: relative;
  overflow: hidden;
  background: var(--bg-canvas);
  user-select: none;
  outline: none;
  cursor: grab;
}

.infra-canvas-wrap.is-panning,
.infra-canvas-wrap.is-space-pan {
  cursor: grabbing;
}

.infra-canvas-wrap.is-connect-mode {
  cursor: crosshair;
}

.infra-canvas-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, var(--border-strong) 1px, transparent 1px);
  opacity: 0.55;
}

.infra-world {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  transform-origin: 0 0;
}

.infra-edges-svg {
  position: absolute;
  left: 0;
  top: 0;
  width: 10px;
  height: 10px;
  overflow: visible;
  pointer-events: none;
  z-index: 5;
}

.infra-edge-hit {
  fill: none;
  stroke: transparent;
  stroke-width: 16px;
  pointer-events: stroke;
  cursor: pointer;
}

.infra-edge-path {
  fill: none;
  stroke: var(--text-tertiary);
  stroke-width: 1.9;
  pointer-events: none;
  transition: stroke 0.12s ease;
}

.infra-edge-path.style-dashed {
  stroke-dasharray: 7 5;
}

.infra-edge-path.style-animated {
  stroke: var(--accent);
  stroke-dasharray: 8 5;
  animation: infraFlow 1.1s linear infinite;
}

@keyframes infraFlow {
  from { stroke-dashoffset: 26; }
  to { stroke-dashoffset: 0; }
}

.infra-edge-group:hover .infra-edge-path,
.infra-edge-path.is-selected {
  stroke: var(--accent);
  stroke-width: 2.5;
}

.infra-edge-preview {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-dasharray: 6 4;
  pointer-events: none;
}

.infra-arrow-head {
  fill: var(--text-tertiary);
}

.infra-arrow-head.active,
.infra-edge-group:hover .infra-arrow-head {
  fill: var(--accent);
}

.infra-edge-label-bg {
  fill: var(--bg-surface);
  stroke: var(--border-strong);
  stroke-width: 1;
  pointer-events: all;
  cursor: pointer;
}

.infra-edge-group.is-selected .infra-edge-label-bg {
  stroke: var(--accent);
}

.infra-edge-label-text {
  fill: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 10.5px;
  pointer-events: none;
}

.infra-nodes-layer {
  position: absolute;
  left: 0;
  top: 0;
}

.infra-node {
  position: absolute;
  box-sizing: border-box;
  border-radius: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-left: 4px solid var(--node-accent, var(--accent));
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: move;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.infra-node:hover {
  border-color: var(--node-accent, var(--accent));
}

.infra-node.is-selected {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.infra-node.is-connect-src {
  outline: 2px dashed var(--accent);
  outline-offset: 3px;
}

.infra-node.is-zone {
  background: rgba(126, 151, 166, 0.06);
  border: 1.6px dashed var(--node-accent, var(--border-strong));
  border-left-width: 1.6px;
  box-shadow: none;
  justify-content: flex-start;
}

[data-theme-scheme="light"] .infra-node.is-zone {
  background: rgba(100, 110, 120, 0.045);
}

.infra-node-head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.infra-node-icon {
  color: var(--node-accent, var(--accent));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--bg-canvas);
  border: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.infra-node.is-zone .infra-node-icon {
  width: 22px;
  height: 22px;
}

.infra-node-titles {
  min-width: 0;
  flex: 1;
}

.infra-node-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.infra-node-sub {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.infra-node-kind-pill {
  font-size: 9.5px;
  color: var(--text-tertiary);
  border: 1px solid var(--border-subtle);
  background: var(--bg-canvas);
  border-radius: 4px;
  padding: 1px 5px;
  flex-shrink: 0;
  max-width: 78px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.infra-node-specs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

.infra-spec-chip {
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--bg-canvas);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

.infra-node-foot {
  margin-top: auto;
  font-size: 10px;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Connection Ports & Resize Handle */
.infra-port {
  position: absolute;
  width: 11px;
  height: 11px;
  padding: 0;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  background: var(--bg-surface);
  opacity: 0;
  cursor: crosshair;
  z-index: 20;
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.infra-node:hover .infra-port,
.infra-node.is-selected .infra-port,
.infra-canvas-wrap.is-connect-mode .infra-port {
  opacity: 1;
}

.infra-port:hover {
  background: var(--accent);
  transform: scale(1.25);
}

.infra-port-top { top: -6px; left: calc(50% - 5.5px); }
.infra-port-bottom { bottom: -6px; left: calc(50% - 5.5px); }
.infra-port-left { left: -6px; top: calc(50% - 5.5px); }
.infra-port-right { right: -6px; top: calc(50% - 5.5px); }

.infra-resize-handle {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 12px;
  height: 12px;
  cursor: nwse-resize;
  opacity: 0;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  border-bottom-right-radius: 3px;
}

.infra-node:hover .infra-resize-handle,
.infra-node.is-selected .infra-resize-handle {
  opacity: 0.9;
}

.infra-canvas-hint {
  position: absolute;
  left: 12px;
  bottom: 10px;
  z-index: 15;
  padding: 5px 10px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  font-size: 11px;
  color: var(--text-tertiary);
  pointer-events: none;
  opacity: 0.9;
}

/* Right Inspector */
.infra-inspector {
  background: var(--bg-sidebar);
  border-left: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.infra-inspector-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
}

.infra-inspector-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px 20px;
}

.infra-inspector-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.infra-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.infra-inspector-kicker {
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
}

.infra-swatch-row {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.infra-swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
}

.infra-swatch.active {
  border-color: var(--text-primary);
  box-shadow: 0 0 0 2px var(--bg-sidebar);
}

.infra-edge-route-box {
  padding: 8px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
}

.infra-inspector-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}

.infra-inventory-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.infra-inventory-row {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 7px 9px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  text-align: left;
  cursor: pointer;
}

.infra-inventory-row:hover {
  border-color: var(--accent-border);
}

.infra-inv-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.infra-inv-spec {
  font-size: 11px;
  color: var(--text-secondary);
}

@media (max-width: 1120px) {
  .infra-studio {
    grid-template-columns: 185px minmax(0, 1fr) 250px;
  }
}

@media (max-width: 860px) {
  .infra-studio {
    grid-template-columns: 1fr;
    height: auto;
  }
  .infra-palette {
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
    max-height: 210px;
  }
  .infra-canvas-wrap {
    height: 460px;
  }
  .infra-inspector {
    border-left: none;
    border-top: 1px solid var(--border-subtle);
  }
}

/* ============================================================================
   Multi-Theme Picker (Topbar Dropdown + Profile Appearance Grid)
   ============================================================================ */

.theme-picker {
  position: relative;
  display: inline-flex;
}

.theme-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 244px;
  padding: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
  display: none;
  flex-direction: column;
  gap: 2px;
  z-index: 85;
}

.theme-menu.open {
  display: flex;
}

.theme-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-primary);
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
}

.theme-option:hover {
  background: var(--bg-surface-hover);
}

.theme-option.active {
  background: var(--accent-soft);
  border-color: var(--accent-border);
}

.theme-swatch {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.theme-swatch-split {
  background: linear-gradient(135deg, #141413 50%, #FAF9F5 50%);
}

.theme-swatch-dark {
  background: radial-gradient(circle at 65% 35%, #D97757 32%, #141413 34%);
}

.theme-swatch-light {
  background: radial-gradient(circle at 65% 35%, #C15F3C 32%, #FAF9F5 34%);
}

.theme-swatch-aws {
  background: radial-gradient(circle at 65% 35%, #FF9900 32%, #0F1B2A 34%);
}

.theme-swatch-nord {
  background: radial-gradient(circle at 65% 35%, #88C0D0 32%, #1B2028 34%);
}

.theme-swatch-paper {
  background: radial-gradient(circle at 65% 35%, #2563EB 32%, #FFFFFF 34%);
}

.theme-option-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.theme-option-title {
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.25;
}

.theme-option-sub {
  font-size: 10.5px;
  color: var(--text-tertiary);
}

.theme-option-check {
  font-size: 12px;
  color: var(--accent);
  opacity: 0;
  flex-shrink: 0;
}

.theme-option.active .theme-option-check {
  opacity: 1;
}

.theme-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(176px, 1fr));
  gap: 10px;
}

.theme-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-canvas);
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}

.theme-card:hover {
  border-color: var(--border-strong);
  background: var(--bg-surface-hover);
}

.theme-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
  background: var(--accent-soft);
}

.theme-card-preview {
  height: 44px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  display: flex;
  overflow: hidden;
}

.theme-card-preview-side {
  width: 28%;
  height: 100%;
}

.theme-card-preview-main {
  flex: 1;
  padding: 7px 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.theme-card-preview-bar {
  width: 58%;
  height: 6px;
  border-radius: 3px;
}

.theme-card-preview-line {
  width: 82%;
  height: 4px;
  border-radius: 2px;
  opacity: 0.45;
}

.theme-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.theme-card-desc {
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.35;
}

/* ============================================================================
   AI Task Report & Separate HashiCorp Vault Checklist Block
   ============================================================================ */

.ai-section-wrap {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
  display: grid;
  gap: 12px;
}

.ai-report-card {
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-md);
  background: var(--bg-canvas);
  padding: 12px 14px;
}

.ai-report-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.ai-report-prose {
  font-size: 13.5px;
}

.vault-req-card {
  border: 1px solid var(--status-warn);
  border-left: 3px solid var(--status-warn);
  border-radius: var(--radius-md);
  background: var(--bg-canvas);
  padding: 12px 14px;
  display: grid;
  gap: 10px;
}

.vault-req-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.badge-vault {
  color: var(--status-warn);
  background: var(--status-warn-soft);
  border-color: rgba(212, 163, 89, 0.35);
}

.vault-req-list {
  display: grid;
  gap: 6px;
}

.vault-req-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
}

.vault-req-item.is-done {
  opacity: 0.68;
}

.vault-req-item.is-done .vault-req-key {
  text-decoration: line-through;
}

.vault-req-toggle-form {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex: 1;
  min-width: 0;
  margin: 0;
}

.vault-req-num {
  font-size: 12px;
  color: var(--text-tertiary);
  padding-top: 2px;
  flex-shrink: 0;
}

.vault-req-main {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 2px;
}

.vault-req-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.vault-req-key {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-code);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 1px 6px;
}

.vault-req-path {
  font-size: 11px;
  color: var(--text-tertiary);
}

.vault-req-desc {
  font-size: 12px;
  color: var(--text-secondary);
}

.vault-req-add-form {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding-top: 6px;
  border-top: 1px dashed var(--border-subtle);
}

.agent-vault-preview {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(212, 163, 89, 0.35);
  background: var(--status-warn-soft);
}

.agent-vault-preview-title {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--status-warn);
  margin-bottom: 4px;
}

.agent-vault-preview-list {
  margin: 0;
  padding-left: 18px;
  font-size: 12px;
  color: var(--text-primary);
  display: grid;
  gap: 2px;
}

.agent-vault-preview-list li.is-done span:first-child {
  text-decoration: line-through;
  opacity: 0.65;
}
