@import url('https://cdn.jsdelivr.net/npm/@fontsource/cascadia-mono@5.3.0/index.css');

/* ==========================================================================
   HATSTACK // MODERN DIRECTIVE SYSTEM STYLESHEET
   Refined Dark Cyberpunk / Executive Workstation Theme
   ========================================================================== */

:root {
  --bg-core: #08080A;
  --bg-elevated: #0E0E12;
  --bg: #08080A;
  --panel: #131317;
  --panel-hover: #1A1A22;
  --panel-active: #20202A;
  --panel-border: rgba(255, 255, 255, 0.07);
  --panel-border-hover: rgba(255, 154, 31, 0.35);

  --accent: #FF9A1F;
  --accent-hover: #FFB347;
  --accent-dim: #D97E14;
  --accent-subtle: rgba(255, 154, 31, 0.12);
  --accent-glow: rgba(255, 154, 31, 0.22);

  --text-main: #EDEDED;
  --text-muted: #8E8E98;
  --text-dim: #54545E;

  --user-teal: #00E5FF;
  --error: #EF4444;
  --error-subtle: rgba(239, 68, 68, 0.12);
  --success: #10B981;
  --success-subtle: rgba(16, 185, 129, 0.12);

  --font-sans: 'Cascadia Mono', 'Cascadia Code', 'JetBrains Mono', monospace;
  --font-mono: 'Cascadia Mono', 'Cascadia Code', 'JetBrains Mono', monospace;
  --font-main: 'Cascadia Mono', 'Cascadia Code', 'JetBrains Mono', monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body, button, input, select, textarea {
  font-family: var(--font-mono);
}

body {
  background-color: var(--bg-core);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  letter-spacing: -0.01em;
}

/* ── REFINED TERMINAL LOCK SCREEN ── */
.lock-overlay {
  position: fixed;
  inset: 0;
  background-color: #070709;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  font-family: 'Cascadia Mono', 'Cascadia Code', 'JetBrains Mono', monospace;
}

.terminal-frame {
  width: 100%;
  max-width: 380px;
  background: #0E0F14;
  border: 1px solid rgba(255, 154, 31, 0.24);
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55), 0 0 1px rgba(255, 154, 31, 0.2);
}

.terminal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.terminal-title,
.terminal-badge,
.terminal-prompt-symbol,
.terminal-frame,
.terminal-form,
.terminal-input-wrap,
.terminal-input-wrap input,
.terminal-lead-char,
.terminal-checkbox-wrap,
.terminal-submit-btn,
.terminal-error {
  font-family: 'Cascadia Mono', 'Cascadia Code', 'JetBrains Mono', monospace !important;
}

.terminal-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.terminal-prompt-symbol {
  color: var(--accent);
  font-weight: bold;
}

.terminal-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(239, 68, 68, 0.12);
  color: #EF4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

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

.terminal-input-wrap {
  display: flex;
  align-items: center;
  background: #07070A;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 10px 12px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.terminal-input-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(255, 154, 31, 0.25);
}

.terminal-lead-char {
  color: var(--accent);
  font-size: 14px;
  font-weight: bold;
  margin-right: 8px;
  user-select: none;
}

.terminal-input-wrap input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-family: inherit;
  font-size: 14px;
  letter-spacing: 0.5px;
  caret-color: var(--accent);
}

.terminal-input-wrap input::placeholder {
  color: var(--text-dim);
}

.terminal-toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
}

.terminal-toggle-btn:hover {
  color: var(--text-main);
}

.terminal-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 2px;
}

.terminal-checkbox-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  transition: color 0.15s;
}

.terminal-checkbox-wrap:hover {
  color: var(--text-main);
}

.terminal-checkbox-wrap input {
  display: none;
}

.term-check-box::after {
  content: '[ ]';
  font-weight: bold;
  color: var(--text-dim);
}

.terminal-checkbox-wrap input:checked + .term-check-box::after {
  content: '[X]';
  color: var(--accent);
}

.terminal-submit-btn {
  background: var(--accent);
  color: #070709;
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.terminal-submit-btn:hover {
  background: var(--accent-hover);
}

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

.terminal-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.terminal-error {
  color: var(--error);
  font-size: 11px;
  letter-spacing: 0.5px;
  min-height: 16px;
  text-align: left;
}

/* ── BUTTONS ── */
.btn-cyber-primary {
  background: var(--accent);
  color: #08080A;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: 0.5px;
  padding: 11px 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
}

.btn-cyber-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 14px var(--accent-glow);
}

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

.btn-secondary {
  background: var(--panel-active);
  color: var(--text-muted);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover {
  color: var(--text-main);
  border-color: var(--text-muted);
}

.btn-danger-outline {
  background: transparent;
  color: var(--error);
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-danger-outline:hover {
  background: var(--error-subtle);
  border-color: var(--error);
}

/* ── MODERN APP CONTAINER & PAGE LOCK ── */
.calendar-page-body {
  overflow: hidden;
  height: 100vh;
  max-height: 100vh;
}

.app-container {
  display: flex;
  flex-direction: column;
  flex: 1;
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
}

.top-bar,
.net-top-bar,
.vault-top-bar,
.projects-top-bar {
  background: rgba(14, 14, 18, 0.95);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--panel-border);
  height: 60px;
  min-height: 60px;
  max-height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 100;
  box-sizing: border-box;
  flex-shrink: 0;
  width: 100%;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.brand-logo-icon {
  background: linear-gradient(135deg, var(--accent), var(--accent-dim));
  color: #08080A;
  border-radius: var(--radius-sm);
  width: 32px;
  min-width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px var(--accent-glow);
  flex-shrink: 0;
}

.brand-headings {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-main {
  color: var(--text-main);
  font-family: var(--font-mono) !important;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 1.5px;
  line-height: 1;
}

.brand-pill {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--panel-border);
  color: var(--text-muted);
  font-family: var(--font-mono) !important;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  line-height: 1.2;
}

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

.live-clock-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-core);
  border: 1px solid var(--panel-border);
  padding: 0 12px;
  border-radius: 20px;
  height: 30px;
  box-sizing: border-box;
}

.live-dot {
  width: 7px;
  height: 7px;
  background: var(--user-teal);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--user-teal);
  animation: pulse 2s infinite ease-in-out;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.7; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.7; }
}

.clock-time {
  color: var(--text-main);
  font-family: var(--font-mono) !important;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  line-height: 1;
}

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

.btn-topbar {
  background: var(--panel);
  color: var(--text-muted);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  height: 34px;
  min-height: 34px;
  font-family: var(--font-mono) !important;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
  box-sizing: border-box;
  white-space: nowrap;
}

.btn-topbar:hover {
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text-main);
  background: var(--panel-hover);
}

.btn-topbar.btn-accent {
  background: var(--accent);
  color: #08080A;
  border-color: var(--accent);
}

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

.btn-topbar.btn-icon {
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.menu-btn {
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 4px;
  flex-shrink: 0;
}

.sync-icon.rotating {
  animation: spin 1s infinite linear;
}

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

/* ── MAIN LAYOUT ── */
.main-layout {
  display: flex;
  flex: 1;
  min-height: 0;
  height: calc(100vh - 60px);
  max-height: calc(100vh - 60px);
  overflow: hidden;
}

.matrix-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 16px 20px;
  border-right: 1px solid var(--panel-border);
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
}

.matrix-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 16px;
  flex-wrap: wrap;
}

.sub-lead {
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.5px;
  display: block;
  margin-bottom: 2px;
}

.month-title-wrap h1 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* Category Filter Chips */
.category-filter-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-core);
  border: 1px solid var(--panel-border);
  padding: 4px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
}

.filter-chip {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s;
  white-space: nowrap;
}

.filter-chip:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

.filter-chip.active {
  background: var(--panel-active);
  color: var(--text-main);
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

.cat-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.dot-work { background: var(--user-teal); }
.dot-meeting { background: var(--accent); }
.dot-class { background: #A855F7; }
.dot-poker { background: #F59E0B; }
.dot-holiday { background: #F43F5E; }

/* Segmented Controls */
.segmented-nav {
  display: flex;
  background: var(--bg-core);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  padding: 3px;
}

.btn-nav-seg {
  background: transparent;
  color: var(--text-muted);
  border: none;
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.btn-nav-seg:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.06);
}

.btn-seg-today {
  color: var(--accent);
  letter-spacing: 0.5px;
}

.btn-seg-today:hover {
  background: var(--accent-subtle);
  color: var(--accent-hover);
}

/* ── CALENDAR GRID ── */
.weekday-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  padding: 10px 0;
  border-bottom: 1px solid var(--panel-border);
}

.weekday-grid .weekend {
  color: var(--accent-dim);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-template-rows: repeat(5, minmax(0, 1fr));
  gap: 5px;
  padding-top: 8px;
  flex: 1;
  min-height: 0;
}

.calendar-grid.six-weeks {
  grid-template-rows: repeat(6, minmax(0, 1fr));
}

.day-cell {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  padding: 8px 9px;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  position: relative;
  min-height: 0;
  height: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.day-cell:hover {
  background: var(--panel-hover);
  border-color: rgba(255, 255, 255, 0.18);
}

.day-cell.selected {
  border-color: var(--accent);
  background: var(--panel-active);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.day-cell.today {
  border-color: var(--accent-dim);
}

.day-cell.today .day-number {
  background: var(--accent);
  color: #08080A;
  border-radius: 4px;
  padding: 1px 5px;
  font-weight: 800;
}

.day-cell.dimmed {
  opacity: 0.28;
}

.day-header-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 4px;
}

.day-number {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  font-family: var(--font-mono);
}

.day-pills {
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow: hidden;
}

.event-pill {
  font-size: 10px;
  font-weight: 500;
  padding: 2px 5px;
  border-radius: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: transparent;
  border: none;
  border-left: 3px solid var(--accent);
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: background 0.12s ease;
}

.event-pill:hover {
  background: rgba(255, 255, 255, 0.05);
}

.event-pill.done {
  text-decoration: line-through;
  opacity: 0.45;
}

.pill-work { border-left-color: var(--user-teal); }
.pill-meeting { border-left-color: var(--accent); }
.pill-class { border-left-color: #A855F7; }
.pill-exam { border-left-color: var(--error); }
.pill-poker { border-left-color: #F59E0B; }
.pill-social { border-left-color: #10B981; }
/* ── CALENDAR CONTROLS & AGENDA VIEW (GOOGLE CALENDAR STYLE) ── */
.cal-controls-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.cal-view-segmented {
  display: inline-flex;
  background: var(--bg-core);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  padding: 2px;
  gap: 2px;
}

.cal-view-segmented .view-mode-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.cal-view-segmented .view-mode-btn.active {
  background: var(--panel-active);
  color: var(--accent);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.agenda-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding: 20px 24px;
}

.agenda-header-banner {
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--panel-border);
}

.agenda-container {
  max-width: 820px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.agenda-day-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.agenda-date-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 0;
}

.agenda-date-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  height: 46px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.agenda-today .agenda-date-badge {
  background: var(--accent);
  border-color: var(--accent);
}

.agenda-badge-wkday {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.agenda-today .agenda-badge-wkday {
  color: #08080A;
}

.agenda-badge-day {
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
  color: var(--text-main);
  font-family: var(--font-mono);
}

.agenda-today .agenda-badge-day {
  color: #08080A;
}

.agenda-date-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.agenda-date-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: 0.5px;
}

.agenda-today-tag {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--accent);
  background: var(--accent-subtle);
  border: 1px solid rgba(255, 154, 31, 0.35);
  padding: 2px 7px;
  border-radius: 4px;
}

.agenda-cards-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-left: 58px;
}

.agenda-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.agenda-card:hover {
  background: var(--panel-hover);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.agenda-card.done {
  opacity: 0.45;
}

.agenda-card.done .agenda-card-title {
  text-decoration: line-through;
  color: var(--text-muted);
}

.agenda-check-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  flex-shrink: 0;
  transition: color 0.15s ease;
}

.agenda-check-btn:hover {
  color: var(--accent);
}

.agenda-card.done .agenda-check-btn {
  color: var(--success);
}

.agenda-card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.agenda-card-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.agenda-card-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.agenda-card-time {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  flex-shrink: 0;
}

.agenda-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.agenda-cat-chip {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.agenda-cat-chip.cat-work { color: var(--user-teal); }
.agenda-cat-chip.cat-meeting { color: var(--accent); }
.agenda-cat-chip.cat-class { color: #A855F7; }
.agenda-cat-chip.cat-exam { color: var(--error); }
.agenda-cat-chip.cat-poker { color: #F59E0B; }
.agenda-cat-chip.cat-social { color: #10B981; }
.agenda-cat-chip.cat-holiday { color: #F43F5E; }

.agenda-notes-preview {
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.agenda-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  color: var(--text-dim);
  gap: 12px;
}

.agenda-empty-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.agenda-empty-sub {
  font-size: 11.5px;
}

/* ── INSPECTOR PANE (SIDEBAR) ── */
.inspector-pane {
  width: 360px;
  background: var(--bg-elevated);
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  overflow: hidden;
  border-left: 1px solid var(--panel-border);
  flex-shrink: 0;
}

.inspector-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--panel-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--panel);
  flex-shrink: 0;
}

.inspector-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.inspector-title-wrap .sub-lead {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--accent);
  text-transform: uppercase;
  font-family: var(--font-mono);
  transition: color 0.2s;
}

.inspector-title-wrap h2 {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--text-main);
  font-family: var(--font-mono);
  margin: 0;
}

.inspector-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge-count {
  background: rgba(255, 154, 31, 0.1);
  border: 1px solid rgba(255, 154, 31, 0.25);
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 4px;
  font-family: var(--font-mono);
}

.btn-quick-add {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  color: var(--text-muted);
  width: 26px;
  height: 26px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.btn-quick-add:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #08080A;
}

.directives-list {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.directives-list::-webkit-scrollbar {
  width: 5px;
}
.directives-list::-webkit-scrollbar-track {
  background: transparent;
}
.directives-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}
.directives-list::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

.empty-state {
  color: var(--text-dim);
  font-size: 11px;
  font-style: italic;
  line-height: 1.5;
  text-align: center;
  padding: 40px 16px;
  font-family: var(--font-mono);
}

/* ── EXACT TINHORN DIRECTIVE CARD ── */
.directive-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-left: 3.5px solid var(--accent);
  border-radius: 6px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
  box-sizing: border-box;
}

.directive-card:hover {
  background: var(--panel-hover);
  border-color: rgba(255, 255, 255, 0.14);
}

.directive-card.done {
  opacity: 0.55;
  border-left-color: var(--panel-border) !important;
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-height: 18px;
}

.card-top-left {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 1;
  min-width: 0;
}

.card-checkbox {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

.card-time {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.card-cat-badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--font-mono);
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 3px;
  opacity: 0.75;
  transition: opacity 0.15s;
}

.directive-card:hover .card-actions {
  opacity: 1;
}

.btn-card-action {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  border-radius: 3px;
  padding: 0;
  transition: color 0.15s, background 0.15s;
}

.btn-card-action.btn-edit:hover {
  color: var(--accent-hover);
  background: rgba(255, 154, 31, 0.12);
}

.btn-card-action.action-delete {
  font-size: 11px;
  color: var(--text-dim);
}

.btn-card-action.action-delete:hover {
  color: #ff5555;
  background: rgba(255, 68, 68, 0.12);
}

.card-body {
  padding-left: 21px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.card-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  line-height: 1.35;
  word-break: break-word;
  transition: color 0.15s;
  font-family: var(--font-sans);
}

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

.directive-card.done .card-title {
  text-decoration: line-through;
  color: var(--text-dim);
}

.card-notes {
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.35;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ── MODAL ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
}

.modal-box {
  background: #0E0E14;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 520px;
  max-height: min(90vh, 880px);
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.95), 0 0 30px rgba(255, 154, 31, 0.08);
  position: relative;
  overflow: hidden;
  animation: modalEnter 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalEnter {
  from {
    opacity: 0;
    transform: scale(0.97) translateY(6px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes modalSlideUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid var(--panel-border);
  background: #121218;
  flex-shrink: 0;
}

.modal-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-icon-badge {
  background: var(--accent-subtle);
  color: var(--accent);
  border: 1px solid rgba(255, 154, 31, 0.25);
  border-radius: var(--radius-sm);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.modal-header h3 {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-main);
  font-family: var(--font-mono);
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background 0.15s;
}

.modal-close:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.06);
}

.modal-form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  padding: 0;
}

.modal-form-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 22px 24px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  flex: 1 1 auto;
  min-height: 0;
}

.modal-form-body::-webkit-scrollbar {
  width: 6px;
}
.modal-form-body::-webkit-scrollbar-track {
  background: #0B0B0F;
}
.modal-form-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 3px;
}
.modal-form-body::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

.form-row {
  display: flex;
  gap: 14px;
  width: 100%;
}

.flex-1 { flex: 1 1 0%; min-width: 0; }
.flex-2 { flex: 2 1 0%; min-width: 0; }
.flex-3 { flex: 3 1 0%; min-width: 0; }

/* ── FORM CONTROLS & INPUT GROUPS ── */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  min-width: 0;
}

.input-group label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: #9A9AA6;
  text-transform: uppercase;
  font-family: var(--font-mono);
  display: block;
}

.modal-form input[type="text"],
.modal-form input[type="email"],
.modal-form input[type="password"],
.modal-form input[type="date"],
.modal-form input[type="time"],
.modal-form select,
.modal-form textarea,
.input-group input,
.input-group select,
.input-group textarea,
.conn-add-row select {
  width: 100%;
  background: #0B0B10;
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 12px;
  font-family: var(--font-mono);
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}

.modal-form input::placeholder,
.modal-form textarea::placeholder,
.input-group input::placeholder,
.input-group textarea::placeholder {
  color: #4C4C58;
  font-family: var(--font-mono);
  font-size: 11.5px;
}

.modal-form input:hover,
.modal-form select:hover,
.modal-form textarea:hover,
.input-group input:hover,
.input-group select:hover,
.input-group textarea:hover,
.conn-add-row select:hover {
  border-color: rgba(255, 154, 31, 0.4);
  background: #0F0F16;
}

.modal-form input:focus,
.modal-form select:focus,
.modal-form textarea:focus,
.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus,
.conn-add-row select:focus {
  border-color: var(--accent);
  background: #111118;
  box-shadow: 0 0 0 2px var(--accent-subtle), 0 0 16px rgba(255, 154, 31, 0.18);
}

.modal-form select,
.input-group select,
.conn-add-row select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23FF9A1F' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: calc(100% - 12px) center;
  padding-right: 34px;
  cursor: pointer;
}

.modal-form select option,
.input-group select option,
.conn-add-row select option {
  background: #111118;
  color: var(--text-main);
  padding: 8px 12px;
}

.modal-form textarea,
.input-group textarea {
  resize: vertical;
  min-height: 64px;
  line-height: 1.5;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.8) sepia(100%) saturate(300%) hue-rotate(345deg);
  cursor: pointer;
}

.modal-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--panel-border);
  padding: 14px 24px;
  background: #111118;
  flex-shrink: 0;
  z-index: 10;
  box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.5);
}

.actions-right {
  display: flex;
  gap: 10px;
  margin-left: auto;
}

.hidden { display: none !important; }

/* ── RESPONSIVENESS (CALENDAR) ── */
@media (max-width: 920px) and (min-width: 641px) {
  .inspector-pane {
    width: 310px;
  }
  .matrix-pane {
    padding: 14px 14px;
  }
}

@media (max-width: 640px) {
  .calendar-page-body {
    overflow-y: auto;
    height: auto;
    min-height: 100dvh;
  }
  .app-container {
    height: auto;
    min-height: 100dvh;
    max-height: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .main-layout {
    flex-direction: column;
    overflow: visible;
    height: auto;
    max-height: none;
    min-height: 0;
  }
  .matrix-pane {
    border-right: none;
    border-bottom: 1px solid var(--panel-border);
    overflow: visible;
    height: auto;
    max-height: none;
    flex: none;
    padding: 14px 10px;
  }
  .inspector-pane {
    width: 100%;
    overflow: visible;
    height: auto;
    max-height: none;
    border-left: none;
  }
  .directives-list {
    overflow-y: visible;
    max-height: none;
  }
  .calendar-grid {
    grid-template-rows: repeat(5, minmax(54px, 1fr));
    gap: 4px;
  }
  .calendar-grid.six-weeks {
    grid-template-rows: repeat(6, minmax(54px, 1fr));
  }
  .day-cell {
    min-height: 54px;
    padding: 4px 3px;
  }
  .topbar-center {
    display: none;
  }
}

/* ── TOPBAR MENU BUTTON ── */
.menu-btn {
  margin-right: 6px;
}

/* ── COLLAPSIBLE NAVIGATION DRAWER ── */
.nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 4, 6, 0.7);
  backdrop-filter: blur(6px);
  z-index: 1100;
  opacity: 1;
  transition: opacity 0.25s ease;
}

.nav-backdrop.hidden {
  opacity: 0;
  pointer-events: none;
  display: block !important;
}

.nav-drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: 320px;
  max-width: 85vw;
  background: #0B0B0F;
  border-right: 1px solid rgba(255, 154, 31, 0.2);
  z-index: 1110;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 16px 0 40px rgba(0, 0, 0, 0.8);
  font-family: var(--font-mono) !important;
}

.nav-drawer.open {
  transform: translateX(0);
}

.nav-drawer-header {
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--panel-border);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: 0.5px;
}

.nav-brand-prefix {
  color: var(--accent);
  margin-right: 6px;
  font-weight: 800;
}

.nav-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
}

.nav-close-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.nav-drawer-section {
  padding: 20px;
  flex: 1;
  overflow-y: auto;
}

.nav-section-title {
  font-size: 10px;
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 12px;
  display: block;
}

.nav-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.nav-item:hover {
  background: rgba(255, 154, 31, 0.06);
  border-color: rgba(255, 154, 31, 0.25);
  color: var(--text-main);
}

.nav-item.active {
  background: rgba(255, 154, 31, 0.12);
  border-color: var(--accent);
  color: var(--accent-hover);
}

.nav-item-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  color: inherit;
  flex-shrink: 0;
}

.nav-item.active .nav-item-icon {
  background: rgba(255, 154, 31, 0.2);
  color: var(--accent);
}

.nav-item-title {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: inherit;
}

.nav-item-meta {
  display: block;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-dim);
  margin-top: 2px;
}

.nav-drawer-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--panel-border);
  background: #08080B;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.nav-system-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--success);
}

.status-indicator-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
}

.nav-logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--error);
  font-family: var(--font-mono);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.nav-logout-btn:hover {
  background: rgba(239, 68, 68, 0.18);
  border-color: var(--error);
}

/* ── HOMEPAGE STYLES ── */
.home-main-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}

.home-hero {
  text-align: center;
  margin-bottom: 36px;
}

.home-tag {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 1.5px;
  margin-bottom: 8px;
  font-weight: 700;
}

.home-title {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
  margin-bottom: 10px;
}

.home-subtitle {
  color: var(--text-muted);
  font-size: 15px;
  max-width: 540px;
  margin: 0 auto;
  line-height: 1.5;
}

.text-accent {
  color: var(--accent-hover);
  font-family: var(--font-mono);
}

.home-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  width: 100%;
}

.home-module-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.home-module-card:hover:not(.card-status-only) {
  border-color: var(--panel-border-hover);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 1px var(--accent-glow);
}

.card-icon-pill {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--accent-subtle);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  border: 1px solid rgba(255, 154, 31, 0.2);
}

.icon-status {
  background: rgba(16, 185, 129, 0.12);
  color: var(--success);
  border-color: rgba(16, 185, 129, 0.25);
}

.card-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--accent);
  margin-bottom: 6px;
  display: inline-block;
}

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

.card-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
}

.card-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 20px;
}

.card-action-link {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-hover);
  margin-top: auto;
}

.card-meta-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  margin-top: auto;
}

/* ── COMPREHENSIVE RESPONSIVENESS (MOBILE, TABLET, LAPTOP, DESKTOP) ── */

/* Tablet & Mobile (<= 920px) */
@media (max-width: 920px) {
  .top-bar,
  .net-top-bar,
  .vault-top-bar,
  .projects-top-bar {
    padding: 0 16px;
  }

  .home-main-container {
    padding: 32px 16px;
  }

  .home-title {
    font-size: 26px;
  }

  .home-cards-grid {
    grid-template-columns: 1fr;
    max-width: 500px;
  }

  .web-dashboard-container {
    padding: 18px 16px;
  }

  .horizon-cards-row {
    grid-template-columns: repeat(7, minmax(68px, 1fr));
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
  }
}

/* Smartphone (<= 640px) */
@media (max-width: 640px) {
  .top-bar,
  .net-top-bar,
  .vault-top-bar,
  .projects-top-bar {
    padding: 0 12px;
    height: 54px;
    min-height: 54px;
    max-height: 54px;
    flex-wrap: nowrap;
  }

  .live-clock-pill {
    display: none;
  }

  .brand-logo-icon {
    width: 28px;
    height: 28px;
  }

  .brand-main {
    font-size: 13px;
    letter-spacing: 1px;
  }

  .brand-pill {
    font-size: 9px;
    padding: 1px 5px;
  }

  .header-actions {
    gap: 6px;
  }

  .btn-topbar span {
    display: none;
  }

  .btn-topbar {
    padding: 6px 8px;
  }

  .home-main-container {
    padding: 24px 14px;
  }

  .home-hero {
    margin-bottom: 24px;
  }

  .home-title {
    font-size: 22px;
  }

  .home-subtitle {
    font-size: 13px;
  }

  .home-module-card {
    padding: 18px;
  }

  .matrix-pane {
    padding: 10px 6px;
    height: auto;
    flex: none;
    overflow: visible;
  }

  .matrix-nav-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .month-title-wrap {
    text-align: center;
  }

  .cal-controls-row {
    width: 100%;
    justify-content: space-between;
    gap: 8px;
  }

  .cal-view-segmented {
    flex: 1;
    justify-content: center;
  }

  .cal-view-segmented .view-mode-btn {
    flex: 1;
    justify-content: center;
    padding: 6px 8px;
    font-size: 10.5px;
  }

  .category-filter-bar {
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .category-filter-bar::-webkit-scrollbar {
    display: none;
  }

  .segmented-nav {
    justify-content: center;
  }

  .weekday-grid div {
    font-size: 9.5px;
    padding: 3px 0;
  }

  .calendar-grid {
    gap: 3px;
  }

  .day-cell {
    min-height: 52px;
    padding: 3px 2px;
  }

  .day-number {
    font-size: 10px;
  }

  .day-pills {
    gap: 2px;
  }

  .event-pill {
    font-size: 8.5px;
    padding: 1px 3px;
    line-height: 1.2;
    border-left-width: 2.5px;
  }

  .inspector-pane {
    padding: 14px 10px;
    width: 100%;
    height: auto;
    max-height: none;
    overflow: visible;
    border-left: none;
  }

  .agenda-pane {
    padding: 14px 10px;
  }

  .agenda-cards-list {
    margin-left: 0;
  }

  .agenda-date-badge {
    min-width: 40px;
    height: 40px;
  }

  .agenda-badge-wkday {
    font-size: 8px;
  }

  .agenda-badge-day {
    font-size: 14px;
  }

  .agenda-card {
    padding: 10px 12px;
    gap: 10px;
  }

  .agenda-card-title {
    font-size: 12.5px;
  }

  .modal-overlay {
    padding: 0;
    align-items: flex-end;
    overflow: hidden;
  }

  .modal-box,
  .modal-box-large {
    width: 100vw;
    max-width: 100vw;
    height: 92dvh;
    max-height: 92dvh;
    border-radius: 18px 18px 0 0;
    margin: 0;
    padding: 0;
    border-bottom: none;
    border-left: none;
    border-right: none;
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.95);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalSlideUp 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .modal-header {
    padding: 14px 16px;
    flex-shrink: 0;
  }

  .modal-form {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 0;
  }

  .modal-form-body {
    padding: 14px 14px 20px 14px;
    gap: 12px;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  .modal-actions {
    padding: 12px 14px;
    padding-bottom: max(14px, env(safe-area-inset-bottom, 14px));
    flex-shrink: 0;
    background: #0E0E14;
    border-top: 1px solid var(--panel-border);
    position: relative;
    z-index: 20;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.8);
  }

  .modal-actions .btn-cyber-primary,
  .modal-actions .btn-secondary,
  .modal-actions .btn-danger-outline {
    padding: 10px 14px;
    font-size: 12px;
    height: 40px;
  }

  .form-row {
    flex-direction: column;
    gap: 12px;
  }

  .web-dashboard-container {
    padding: 14px 10px;
    gap: 14px;
  }

  .web-telemetry-strip {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px 12px;
    padding: 10px 12px;
    font-size: 10px;
  }

  .web-directives-panel {
    padding: 14px 10px;
    gap: 12px;
  }

  .directives-filter-nav {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .filter-tab-group {
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }

  .directive-card {
    padding: 8px 10px;
    gap: 4px;
  }
}

/* ── HATSTACK WEB APPLICATION WORKSTATION STYLES ── */
.web-dashboard-container {
  flex: 1;
  max-width: 1040px;
  width: 100%;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
}

.web-telemetry-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  font-family: var(--font-mono);
  font-size: 11px;
}

.telemetry-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.telemetry-label {
  color: var(--text-dim);
}

.telemetry-val {
  color: var(--accent);
  font-weight: 700;
}

.telemetry-status-green {
  color: var(--success);
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
}

.horizon-strip-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text-dim);
  text-transform: uppercase;
}

.horizon-cards-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  overflow-x: auto;
}

.horizon-day-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  padding: 10px 6px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.horizon-day-card:hover {
  border-color: var(--accent);
  background: rgba(255, 154, 31, 0.05);
}

.horizon-day-card.active {
  border-color: var(--accent);
  background: var(--accent-subtle);
  box-shadow: 0 0 12px rgba(255, 154, 31, 0.15);
}

.horizon-day-name {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.horizon-day-number {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  margin: 2px 0;
}

.horizon-day-count {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--accent);
  font-weight: 600;
}

.web-directives-panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.directives-filter-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  border-bottom: 1px solid var(--panel-border);
  padding-bottom: 12px;
}

.filter-tab-group {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  white-space: nowrap;
}

.filter-tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.filter-tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

.filter-tab-btn.active {
  background: var(--accent-subtle);
  border-color: rgba(255, 154, 31, 0.3);
  color: var(--accent-hover);
}


/* ══════════════════════════════════════════════════════════════════ */
/* ── HATSTACK THE WEB // NET CANVAS & CONTACTS CHART STYLES ────── */
/* ══════════════════════════════════════════════════════════════════ */

.net-page-body {
  overflow: hidden;
  height: 100vh;
}

.net-app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  position: relative;
}


.net-topbar-center {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  max-width: 680px;
  margin: 0 20px;
}

.net-search-wrap {
  display: flex;
  align-items: center;
  position: relative;
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  padding: 0 10px;
  height: 36px;
  transition: border-color 0.15s;
}

.net-search-wrap:focus-within {
  border-color: var(--accent);
}

.net-search-wrap input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 13px;
  padding: 6px 8px;
  outline: none;
  font-family: var(--font-sans);
}

.search-icon {
  color: var(--text-dim);
  flex-shrink: 0;
}

.clear-search-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
  font-size: 12px;
  line-height: 1;
}

.clear-search-btn:hover {
  color: var(--text-main);
}

/* View Mode Segmented Switch */
.view-mode-segmented {
  display: flex;
  background: var(--bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 2px;
  flex-shrink: 0;
}

.view-mode-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: var(--font-sans);
}

.view-mode-btn:hover {
  color: var(--text-main);
}

.view-mode-btn.active {
  background: var(--accent-subtle);
  color: var(--accent-hover);
}

/* Telemetry & Filter Strip */
.net-telemetry-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 20px;
  background: rgba(14, 14, 14, 0.95);
  border-bottom: 1px solid var(--panel-border);
  z-index: 10;
  gap: 16px;
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.net-telemetry-bar::-webkit-scrollbar {
  display: none;
}

.net-stats-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  white-space: nowrap;
  letter-spacing: 0.5px;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent);
  animation: pulse-dot-anim 2s infinite ease-in-out;
}

@keyframes pulse-dot-anim {
  0%, 100% { opacity: 0.6; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.15); }
}

.net-category-chips-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
}

.net-category-chips-bar::-webkit-scrollbar {
  display: none;
}

/* Category Dot Colors */
.cat-dot.dot-mtu { background: #FFD54F; }
.cat-dot.dot-nmu { background: #4CAF50; }
.cat-dot.dot-wmaa { background: #183C82; }
.cat-dot.dot-mict { background: #F44336; }
.cat-dot.dot-tommys { background: #C41230; box-shadow: 0 0 6px rgba(196, 18, 48, 0.6); }
.cat-dot.dot-culvers { background: #0066B2; box-shadow: 0 0 6px rgba(0, 102, 178, 0.6); }
.cat-dot.dot-tcs { background: #2196F3; }
.cat-dot.dot-huisinga { background: #C8C8C8; }
.cat-dot.dot-poker { background: #1B5E20; }
.cat-dot.dot-lover { background: #FF3C78; }
.cat-dot.dot-close-friend { background: #FFEA00; box-shadow: 0 0 8px rgba(255, 234, 0, 0.8); }
.cat-dot.dot-friend { background: #00E5FF; }
.cat-dot.dot-family { background: #C8C8C8; }
.cat-dot.dot-acquaintance { background: #828282; }
.cat-dot.dot-enemy { background: #DC143C; box-shadow: 0 0 6px rgba(220, 20, 60, 0.7); }

/* Main Stage */
.net-main-stage {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
}

/* Graph View */
.net-graph-view {
  flex: 1;
  position: relative;
  overflow: hidden;
  height: 100%;
}

.net-graph-view canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.active-view {
  display: flex !important;
}

.net-chart-view.active-view {
  display: block !important;
}

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

/* Floating HUD Hover Card */
.net-hover-hud {
  position: absolute;
  width: 220px;
  background: rgba(10, 10, 10, 0.94);
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 10px 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8), 0 0 12px rgba(255, 154, 31, 0.15);
  pointer-events: none;
  z-index: 100;
  transition: opacity 0.15s ease;
  backdrop-filter: blur(8px);
}

.hover-hud-bracket {
  position: absolute;
  width: 8px;
  height: 8px;
  border-color: var(--accent-bright);
}

.hover-hud-bracket.tl { top: -1px; left: -1px; border-top: 2px solid; border-left: 2px solid; }
.hover-hud-bracket.tr { top: -1px; right: -1px; border-top: 2px solid; border-right: 2px solid; }
.hover-hud-bracket.bl { bottom: -1px; left: -1px; border-bottom: 2px solid; border-left: 2px solid; }
.hover-hud-bracket.br { bottom: -1px; right: -1px; border-bottom: 2px solid; border-right: 2px solid; }

.hover-title {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 12px;
  color: var(--accent-bright);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hover-subtitle {
  font-size: 11px;
  color: var(--text-main);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hover-location {
  font-size: 10px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hover-meta {
  font-size: 10px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-weight: 600;
}

/* Canvas HUD Panel at bottom-left */
.canvas-hud-panel {
  position: absolute;
  bottom: 16px;
  left: 16px;
  background: rgba(14, 14, 14, 0.88);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
  backdrop-filter: blur(8px);
  z-index: 10;
  pointer-events: auto;
}

.canvas-zoom-text {
  color: var(--accent);
  font-weight: 700;
}

.hud-divider {
  color: var(--panel-border);
}

.hud-action-btn {
  background: transparent;
  border: 1px solid var(--panel-border);
  color: var(--text-main);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  cursor: pointer;
  transition: all 0.15s;
}

.hud-action-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.hud-hint {
  color: var(--text-dim);
  font-size: 10px;
}

/* ── CONTACTS DIRECTORY CHART VIEW ── */
.net-chart-view {
  flex: 1;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding: 24px;
}

.contacts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  max-width: 1400px;
  margin: 0 auto;
}

.contact-person-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.15s ease;
  cursor: pointer;
}

.contact-person-card:hover {
  border-color: rgba(255, 154, 31, 0.4);
  background: rgba(30, 30, 30, 0.95);
  transform: translateY(-1px);
}

.contact-person-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 16px rgba(255, 154, 31, 0.2);
}

.card-top-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.card-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  font-family: var(--font-sans);
  flex-shrink: 0;
}

.card-title-group {
  flex: 1;
  min-width: 0;
}

.card-name-line {
  display: flex;
  align-items: baseline;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
}

.card-alias {
  font-size: 11px;
  color: var(--accent-dim);
  font-style: italic;
  font-family: var(--font-mono);
}

.card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 3px;
}

.card-badge {
  font-size: 10px;
  padding: 1px 7px;
  border-radius: 10px;
  font-weight: 600;
  font-family: var(--font-mono);
}

.badge-rel {
  background: var(--accent-subtle);
  color: var(--accent-hover);
  border: 1px solid rgba(255, 154, 31, 0.3);
}

.badge-age, .badge-loc {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
}

.card-role-line {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.role-icon {
  font-size: 11px;
}

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

.card-contacts-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.contact-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--bg);
  border: 1px solid var(--panel-border);
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 11px;
  color: var(--text-main);
  text-decoration: none;
  font-family: var(--font-mono);
  transition: all 0.15s;
}

.contact-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.card-bio-snippet {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.chip-tag {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--panel-border);
  color: var(--text-secondary);
  border-radius: 3px;
  padding: 1px 6px;
  font-size: 10px;
  font-family: var(--font-mono);
}

.card-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--panel-border);
  padding-top: 10px;
  margin-top: auto;
}

.card-links-count {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--accent);
  font-weight: 600;
}

.card-action-btns {
  display: flex;
  gap: 6px;
}

.btn-card-action {
  background: transparent;
  border: 1px solid var(--panel-border);
  color: var(--text-muted);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-card-action:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-card-edit {
  border-color: rgba(255, 154, 31, 0.4);
  color: var(--accent);
  background: rgba(255, 154, 31, 0.08);
}

.btn-card-edit:hover {
  background: rgba(255, 154, 31, 0.2);
  border-color: var(--accent);
  color: #fff;
}

.btn-inspector-edit {
  background: rgba(255, 154, 31, 0.15) !important;
  border-color: var(--accent) !important;
  color: var(--accent) !important;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.btn-inspector-edit:hover {
  background: var(--accent) !important;
  color: #070709 !important;
}

.inspector-edit-trigger-card {
  padding: 12px;
  text-align: center;
  border-color: rgba(255, 154, 31, 0.25);
  background: rgba(255, 154, 31, 0.03);
}

/* ── SLIDE-OVER PERSON INSPECTOR SIDEBAR ── */
.person-inspector-sidebar {
  width: 380px;
  background: rgba(14, 14, 14, 0.98);
  border-left: 1px solid var(--panel-border);
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(12px);
  animation: slide-in-right 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slide-in-right {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.sheet-grab-bar-wrap {
  display: none;
}

.inspector-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--panel-border);
  flex-shrink: 0;
}

.inspector-top-actions {
  display: flex;
  gap: 8px;
}

.btn-inspector-action {
  background: transparent;
  border: 1px solid var(--accent-dim);
  color: var(--accent);
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-inspector-action:hover {
  background: var(--accent-dim);
  color: var(--bg);
}

.btn-inspector-accent {
  background: var(--accent-subtle);
  border-color: rgba(255, 154, 31, 0.4);
}

.inspector-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.inspector-close-btn:hover {
  color: var(--accent);
}

.inspector-scroll-content {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.inspector-profile-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.inspector-avatar {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
}

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

.inspector-name {
  font-size: 17px;
  font-weight: 800;
  color: var(--text-main);
  margin: 0 0 6px 0;
  line-height: 1.2;
}

.inspector-badges-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.inspector-badge {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
  font-family: var(--font-mono);
}

.inspector-card {
  background: var(--bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.inspector-card-highlight {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
}

.inspector-card-sub {
  font-size: 11px;
  color: var(--text-secondary);
}

.inspector-section-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 2px;
}

.inspector-contact-details {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.inspector-contact-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-family: var(--font-mono);
}

.inspector-contact-row a {
  color: var(--accent-bright);
  text-decoration: none;
}

.inspector-contact-row a:hover {
  text-decoration: underline;
}

.cnt-icon {
  font-size: 12px;
}

.inspector-bio-paragraph {
  font-size: 12px;
  color: var(--text-main);
  line-height: 1.5;
  margin: 0;
}

.inspector-interests-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.interest-pill {
  background: rgba(255, 154, 31, 0.08);
  border: 1px solid rgba(255, 154, 31, 0.2);
  color: var(--accent-bright);
  border-radius: 12px;
  padding: 2px 9px;
  font-size: 11px;
}

.inspector-connections-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.connected-person-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
}

.connected-person-item:hover {
  background: rgba(255, 154, 31, 0.08);
  border-color: var(--accent);
}

.conn-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
}

.conn-rel-pill {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--accent);
  background: var(--accent-subtle);
  padding: 1px 6px;
  border-radius: 4px;
}

.conn-rel-pill.conn-enemy {
  color: #DC143C;
  background: rgba(220, 20, 60, 0.12);
  border: 1px solid rgba(220, 20, 60, 0.35);
}

.conn-rel-pill.conn-close-friend {
  color: #FFEA00;
  background: rgba(255, 234, 0, 0.15);
  border: 1px solid rgba(255, 234, 0, 0.45);
}

.conn-rel-pill.conn-family {
  color: #E0E0E0;
  background: rgba(220, 220, 220, 0.1);
  border: 1px solid rgba(220, 220, 220, 0.25);
}

.conn-rel-pill.conn-acquaintance {
  color: #A0A0A0;
  background: rgba(160, 160, 160, 0.1);
  border: 1px solid rgba(160, 160, 160, 0.25);
}

.conn-rel-pill.conn-lover {
  color: #FF3C78;
  background: rgba(255, 60, 120, 0.12);
  border: 1px solid rgba(255, 60, 120, 0.35);
}

.card-badge.badge-enemy {
  color: #DC143C;
  background: rgba(220, 20, 60, 0.12);
  border-color: rgba(220, 20, 60, 0.4);
}

.card-badge.badge-close-friend {
  color: #FFEA00;
  background: rgba(255, 234, 0, 0.15);
  border-color: rgba(255, 234, 0, 0.5);
}

.card-badge.badge-family {
  color: #E0E0E0;
  background: rgba(220, 220, 220, 0.1);
  border-color: rgba(220, 220, 220, 0.3);
}

.card-badge.badge-acquaintance {
  color: #A0A0A0;
  background: rgba(160, 160, 160, 0.1);
  border-color: rgba(160, 160, 160, 0.3);
}

.card-badge.badge-lover {
  color: #FF3C78;
  background: rgba(255, 60, 120, 0.12);
  border-color: rgba(255, 60, 120, 0.4);
}

.empty-hint {
  font-size: 11px;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

/* ── MODAL FORM FOR PERSON ADD/EDIT (THE WEB) ── */
.modal-box-large {
  max-width: 680px;
  width: 95vw;
}

.form-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--accent);
  text-transform: uppercase;
  font-family: var(--font-mono);
  margin-top: 6px;
  padding-bottom: 5px;
  border-bottom: 1px dashed rgba(255, 154, 31, 0.22);
}

.input-with-selector {
  display: flex;
  gap: 10px;
  width: 100%;
}

.input-with-selector input {
  flex: 1 1 0%;
  min-width: 0;
}

.input-with-selector select {
  width: 200px;
  flex-shrink: 0;
}

.conn-add-row {
  display: flex;
  gap: 10px;
  align-items: center;
  width: 100%;
}

.conn-add-row select.flex-2 {
  flex: 2 1 0%;
  min-width: 0;
}

.conn-add-row select.flex-1 {
  flex: 1 1 0%;
  min-width: 0;
}

.conn-add-row .btn-secondary {
  flex-shrink: 0;
  height: 38px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.conn-chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 42px;
  padding: 8px 12px;
  background: #08080C;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  margin-top: 6px;
  align-items: center;
}

.conn-chips-container:empty::before {
  content: 'No manual connections linked yet.';
  color: var(--text-dim);
  font-size: 11px;
  font-family: var(--font-mono);
  font-style: italic;
}

.conn-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 154, 31, 0.12);
  border: 1px solid rgba(255, 154, 31, 0.35);
  color: #FFA726;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11.5px;
  font-family: var(--font-mono);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.conn-chip:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: var(--error);
  color: #FF6B6B;
}

.chip-remove {
  font-size: 10px;
  opacity: 0.7;
}

.conn-chip:hover .chip-remove {
  opacity: 1;
}

.form-hint {
  font-size: 10.5px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  margin-top: 5px;
  display: block;
}

/* ── RESPONSIVENESS (MOBILE / TABLET) ── */
@media (max-width: 920px) {
  .net-topbar-center {
    max-width: 440px;
    margin: 0 10px;
  }
  .person-inspector-sidebar {
    width: 320px;
  }
}

@media (max-width: 640px) {
  .net-topbar-center {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 8px;
    flex: 1;
    min-width: 0;
  }
  .net-topbar-center .view-mode-btn span {
    display: none;
  }
  .net-topbar-center .net-search-wrap {
    flex: 1;
    min-width: 50px;
  }
  .view-mode-segmented {
    flex-shrink: 0;
  }
  .view-mode-btn {
    padding: 6px 8px;
  }
  .person-inspector-sidebar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    width: 100%;
    max-height: 46vh;
    border-left: none;
    border-top: 1px solid var(--panel-border);
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -10px 36px rgba(0, 0, 0, 0.9);
    animation: slide-in-up 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 100;
  }

  .person-inspector-sidebar.expanded {
    max-height: 82vh;
  }

  @keyframes slide-in-up {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }

  .sheet-grab-bar-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px 0 2px 0;
    cursor: pointer;
    touch-action: none;
  }

  .sheet-grab-bar {
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.25);
  }

  .inspector-header {
    padding: 6px 14px;
  }

  .inspector-scroll-content {
    padding: 10px 14px 24px 14px;
    gap: 8px;
  }

  .inspector-avatar {
    width: 36px;
    height: 36px;
    font-size: 13px;
  }

  .inspector-name {
    font-size: 15px;
    margin-bottom: 2px;
  }

  .inspector-card {
    padding: 10px 12px;
    gap: 4px;
  }

  .net-chart-view {
    padding: 12px 10px;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
  }

  .contacts-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 0;
    width: 100%;
  }
  .canvas-hud-panel {
    bottom: 8px;
    left: 8px;
    right: 8px;
    justify-content: space-between;
    font-size: 10px;
  }
  .hud-hint {
    display: none;
  }
  .input-with-selector {
    flex-direction: column;
    gap: 8px;
  }
  .input-with-selector select {
    width: 100%;
  }
  .conn-add-row {
    flex-direction: column;
    gap: 8px;
  }
  .conn-add-row select,
  .conn-add-row button {
    width: 100%;
  }
}

/* ══════════════════════════════════════════════════════════════════
   ── HATSTACK TINHORN // VAULT MEDIA TRACKING SYSTEM ──
   ══════════════════════════════════════════════════════════════════ */

:root {
  --th-bg: #060606;
  --th-bg-lighter: #0A0A0A;
  --th-panel: #1E1E1E;
  --th-panel-hover: #262626;
  --th-panel-border: #2A2A2A;
  --th-accent: #FF9A1F;
  --th-accent-dim: #CC7A19;
  --th-accent-bright: #FFB347;
  --th-accent-glow: rgba(255, 154, 31, 0.25);
  --th-text: #E0E0E0;
  --th-text-sec: #888888;
  --th-dim-text: #555555;
  --th-danger: #FF4444;
}

.tinhorn-vault-body {
  background: var(--th-bg);
  color: var(--th-text);
  font-family: var(--font-mono);
  margin: 0;
  padding: 0;
  height: 100vh;
  height: 100dvh;
  width: 100vw;
  overflow: hidden;
  overscroll-behavior: none;
}

.tinhorn-vault-root {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  background: var(--th-bg);
  overflow: hidden;
  position: relative;
}

.tinhorn-vault-main-wrap {
  display: flex;
  flex-direction: row;
  flex: 1;
  width: 100%;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

/* ── LEFT SIDEBAR (200px) ── */
.tinhorn-sidebar {
  width: 200px;
  flex-shrink: 0;
  background: var(--th-panel);
  border-right: 1px solid var(--th-panel-border);
  display: flex;
  flex-direction: column;
  padding: 20px 12px;
  height: 100%;
  box-sizing: border-box;
  z-index: 10;
}

.tinhorn-sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}

.tinhorn-menu-btn {
  background: transparent;
  border: none;
  color: var(--th-text-sec);
  cursor: pointer;
  padding: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.tinhorn-menu-btn:hover {
  background: var(--th-panel-hover);
  color: var(--th-accent);
}

.tinhorn-sidebar-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--th-accent);
  letter-spacing: 3px;
  font-family: var(--font-mono);
}

.tinhorn-sidebar-tabs {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tinhorn-tab {
  height: 44px;
  width: 100%;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 12.5px;
  font-family: var(--font-sans);
  font-weight: 600;
  text-align: left;
  padding-left: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-right: 12px;
  transition: all 0.15s ease;
  user-select: none;
  background: transparent;
  color: var(--th-text-sec);
}

.tinhorn-tab:hover {
  background: var(--th-panel-hover);
  color: var(--th-text);
}

.tinhorn-tab.active {
  background: var(--th-accent);
  color: var(--th-bg);
  font-weight: 700;
}

.tinhorn-sidebar-spacer {
  flex: 1;
}

.tinhorn-sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: auto;
}

.tinhorn-sync-btn {
  height: 36px;
  background: var(--th-panel);
  color: var(--th-accent);
  border: 1px solid var(--th-panel-border);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tinhorn-sync-btn:hover {
  background: var(--th-panel-hover);
  border-color: var(--th-accent-dim);
  color: var(--th-accent-bright);
}

.tinhorn-stats-lbl {
  font-size: 11px;
  font-weight: 700;
  color: var(--th-dim-text);
  letter-spacing: 1.5px;
  font-family: var(--font-mono);
  text-align: center;
  text-transform: uppercase;
}

/* ── MAIN CONTENT AREA ── */
.tinhorn-content-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--th-bg);
  min-height: 0;
  padding: 24px 30px;
  overflow: hidden;
  box-sizing: border-box;
}

.tinhorn-content-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-shrink: 0;
  gap: 16px;
}

.tinhorn-panel-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--th-accent);
  letter-spacing: 2px;
  margin: 0;
  font-family: var(--font-sans);
  text-transform: uppercase;
}

.tinhorn-header-controls {
  display: flex;
  align-items: center;
  gap: 14px;
}

.tinhorn-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--th-panel);
  border: 1px solid var(--th-panel-border);
  border-radius: 6px;
  padding: 0 10px;
  height: 38px;
  width: 190px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.tinhorn-search-wrap:focus-within {
  border-color: var(--th-accent);
  box-shadow: 0 0 10px var(--th-accent-glow);
}

.tinhorn-search-wrap input {
  background: transparent;
  border: none;
  color: var(--th-text);
  font-size: 12.5px;
  width: 100%;
  outline: none;
  font-family: var(--font-mono);
}

.tinhorn-search-wrap input::placeholder {
  color: var(--th-dim-text);
}

.tinhorn-clear-btn {
  background: transparent;
  border: none;
  color: var(--th-text-sec);
  font-size: 12px;
  cursor: pointer;
  padding: 2px;
  line-height: 1;
}

.tinhorn-add-btn {
  width: 120px;
  height: 40px;
  background: var(--th-accent);
  color: var(--th-bg);
  border: none;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, transform 0.1s ease;
}

.tinhorn-add-btn:hover {
  background: var(--th-accent-bright);
}

.tinhorn-add-btn:active {
  background: var(--th-accent-dim);
  transform: translateY(1px);
}

/* ── SCROLLABLE LIST OF 80px MEDIA CARDS ── */
.tinhorn-scroll-container {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  padding-right: 8px;
}

.tinhorn-cards-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.tinhorn-media-card {
  height: 80px;
  background: var(--th-panel);
  border: 1px solid var(--th-panel-border);
  border-radius: 8px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
}

.tinhorn-media-card:hover {
  background: var(--th-panel-hover);
  border-color: var(--th-accent);
  box-shadow: 0 0 12px var(--th-accent-glow);
}

.tinhorn-card-cover {
  width: 50px;
  height: 60px;
  background: var(--th-panel-border);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--th-text-sec);
  flex-shrink: 0;
  user-select: none;
  overflow: hidden;
}

.tinhorn-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
  display: block;
}

.tinhorn-card-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.tinhorn-card-text .vault-title {
  color: var(--th-text);
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.tinhorn-card-text .vault-sub {
  color: var(--th-text-sec);
  font-size: 12px;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--font-mono);
}

.tinhorn-card-remove-btn {
  width: 28px;
  height: 28px;
  background: var(--th-panel);
  color: var(--th-text);
  border: 1px solid rgba(255, 165, 0, 0.5);
  border-radius: 4px;
  font-size: 15pt;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s ease;
  line-height: 1;
}

.tinhorn-card-remove-btn:hover {
  background: rgba(255, 165, 0, 0.3);
  border-color: rgba(255, 165, 0, 0.8);
  color: #FFF;
}

.tinhorn-empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
}

.tinhorn-empty-text {
  font-size: 14px;
  color: var(--th-dim-text);
  font-family: var(--font-mono);
}

/* ── RIGHT SLIDING BIO SIDEBAR (350px) ── */
.tinhorn-bio-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 85;
}

.tinhorn-bio-sidebar {
  position: fixed;
  top: 60px;
  right: 0;
  bottom: 0;
  width: 350px;
  max-width: 90vw;
  height: calc(100vh - 60px);
  background: var(--th-panel);
  border-left: 1px solid var(--th-panel-border);
  display: flex;
  flex-direction: column;
  padding: 20px;
  box-sizing: border-box;
  z-index: 90;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.85);
  animation: slide-in-right 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.tinhorn-sheet-grab-bar {
  display: none;
}

.tinhorn-bio-top {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}

.tinhorn-bio-close {
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  color: var(--th-text-sec);
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.15s ease;
  line-height: 1;
}

.tinhorn-bio-close:hover {
  background: var(--th-panel-hover);
  color: var(--th-accent);
}

.tinhorn-bio-scrollable {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-bottom: 12px;
}

.tinhorn-bio-cover-wrap {
  margin-bottom: 14px;
}

.tinhorn-bio-cover {
  width: 200px;
  height: 280px;
  background: var(--th-panel-border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  color: var(--th-dim-text);
  user-select: none;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.tinhorn-bio-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}

.tinhorn-bio-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--th-text);
  margin: 0;
  line-height: 1.3;
}

.tinhorn-bio-subtitle {
  font-size: 13px;
  color: var(--th-accent);
  font-weight: 600;
  margin-top: 4px;
  font-family: var(--font-mono);
}

.tinhorn-bio-badge-wrap {
  margin: 12px 0 14px 0;
}

.tinhorn-bio-badge {
  background: var(--th-accent-dim);
  color: var(--th-bg);
  border-radius: 16px;
  padding: 6px 16px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-block;
}

.tinhorn-bio-status-bar {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.tinhorn-status-pill {
  background: var(--th-panel-hover);
  border: 1px solid var(--th-panel-border);
  color: var(--th-text-sec);
  border-radius: 4px;
  padding: 5px 9px;
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tinhorn-status-pill:hover {
  background: #333;
  color: var(--th-text);
}

.tinhorn-status-pill.active {
  background: rgba(255, 154, 31, 0.2);
  border-color: var(--th-accent);
  color: var(--th-accent);
}

.tinhorn-bio-about-label {
  font-size: 10px;
  font-weight: 800;
  color: var(--th-dim-text);
  letter-spacing: 2px;
  align-self: flex-start;
  margin-top: 6px;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.tinhorn-bio-text {
  font-size: 12.5px;
  color: var(--th-text-sec);
  line-height: 1.5;
  text-align: left;
  margin: 0;
  width: 100%;
}

.tinhorn-bio-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--th-panel-border);
}

.tinhorn-btn-danger {
  padding: 8px 16px;
  background: transparent;
  color: var(--th-danger);
  border: 1px solid rgba(255, 68, 68, 0.5);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tinhorn-btn-danger:hover {
  background: rgba(255, 68, 68, 0.15);
  border-color: var(--th-danger);
}

.tinhorn-btn-edit {
  padding: 8px 18px;
  background: var(--th-accent);
  color: var(--th-bg);
  border: none;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}

.tinhorn-btn-edit:hover {
  background: var(--th-accent-bright);
}

/* ── ADD ITEM DIALOG (TINHORN MODAL) ── */
.tinhorn-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 120;
  padding: 16px;
}

.tinhorn-dialog-box {
  background: var(--th-bg);
  border: 1px solid var(--th-panel-border);
  border-radius: 8px;
  width: 420px;
  max-width: 92vw;
  padding: 24px;
  box-sizing: border-box;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.9);
}

.tinhorn-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.tinhorn-dialog-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--th-accent);
  margin: 0;
  letter-spacing: 0.5px;
}

.tinhorn-dialog-close {
  background: transparent;
  border: none;
  color: var(--th-text-sec);
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
}

.tinhorn-dialog-close:hover {
  color: var(--th-accent);
}

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

.tinhorn-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tinhorn-form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--th-text);
}

.tinhorn-form-input,
.tinhorn-form-select,
.tinhorn-form-textarea {
  background: var(--th-panel);
  color: var(--th-text);
  border: 1px solid var(--th-panel-border);
  border-radius: 4px;
  padding: 9px 11px;
  font-size: 12.5px;
  font-family: var(--font-sans);
  outline: none;
  box-sizing: border-box;
  width: 100%;
  transition: border-color 0.15s ease;
}

.tinhorn-form-input:focus,
.tinhorn-form-select:focus,
.tinhorn-form-textarea:focus {
  border-color: var(--th-accent);
}

.tinhorn-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
}

.tinhorn-btn-cancel {
  width: 120px;
  height: 44px;
  background: var(--th-panel);
  color: var(--th-text);
  border: 1px solid var(--th-panel-border);
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tinhorn-btn-cancel:hover {
  background: var(--th-panel-hover);
  border-color: var(--th-accent-dim);
}

.tinhorn-btn-add {
  width: 120px;
  height: 44px;
  background: var(--th-accent);
  color: var(--th-bg);
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.15s ease;
}

.tinhorn-btn-add:hover {
  background: var(--th-accent-bright);
}

/* ── MOBILE RESPONSIVENESS ── */
@media (max-width: 768px) {
  .tinhorn-vault-body {
    height: 100dvh;
    min-height: 100dvh;
    overscroll-behavior: none;
  }

  .tinhorn-vault-root {
    flex-direction: column;
    height: 100dvh;
    max-height: 100dvh;
  }

  .tinhorn-vault-main-wrap {
    flex-direction: column;
    min-height: 0;
    flex: 1;
    overflow: hidden;
  }

  .tinhorn-sidebar {
    width: 100%;
    height: auto;
    flex-shrink: 0;
    border-right: none;
    border-bottom: 1px solid var(--th-panel-border);
    padding: 10px 14px;
  }

  .tinhorn-sidebar-header {
    margin-bottom: 8px;
  }

  .tinhorn-sidebar-tabs {
    flex-direction: row;
    overflow-x: auto;
    gap: 6px;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .tinhorn-sidebar-tabs::-webkit-scrollbar {
    display: none;
  }

  .tinhorn-tab {
    flex: none;
    width: auto;
    padding: 6px 14px;
    height: 36px;
  }

  .tinhorn-sidebar-spacer,
  .tinhorn-sidebar-footer {
    display: none;
  }

  .tinhorn-content-area {
    padding: 12px 14px 0 14px;
    flex: 1;
    min-height: 0;
    overflow: hidden;
  }

  .tinhorn-content-header {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-bottom: 8px;
    flex-shrink: 0;
  }

  .tinhorn-scroll-container {
    padding-right: 4px;
    overscroll-behavior-y: contain;
  }

  .tinhorn-cards-list {
    padding-bottom: calc(env(safe-area-inset-bottom, 24px) + 90px);
  }

  .tinhorn-header-controls {
    justify-content: space-between;
  }

  .tinhorn-search-wrap {
    flex: 1;
    width: auto;
  }

  .tinhorn-add-btn {
    width: 90px;
  }

  .tinhorn-bio-sidebar {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    max-height: 60vh;
    border-left: none;
    border-top: 1px solid var(--th-panel-border);
    border-radius: 16px 16px 0 0;
    animation: slide-in-up 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .tinhorn-sheet-grab-bar {
    display: flex;
    justify-content: center;
    padding: 4px 0 8px 0;
    cursor: pointer;
  }

  .tinhorn-sheet-grab-pill {
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.2);
  }
}


/* --------------------------------------------------------------------------
   HATSTACK TINHORN // PROJECTS PAGE STYLING
   -------------------------------------------------------------------------- */
.tinhorn-projects-body {
  margin: 0;
  padding: 0;
  background: var(--th-bg);
  color: var(--th-text);
  font-family: var(--font-mono);
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
}

.tinhorn-projects-root {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  width: 100vw;
  background: var(--th-bg);
  overflow: hidden;
}

.tinhorn-projects-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: var(--th-bg);
  border-bottom: 1px solid var(--th-panel-border);
  gap: 16px;
  flex-shrink: 0;
  z-index: 10;
}

.tinhorn-projects-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.tinhorn-projects-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--th-accent);
  margin: 0;
  font-family: var(--font-mono);
}

.tinhorn-projects-header-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tinhorn-btn-subtle {
  background: var(--th-panel);
  color: var(--th-text-sec);
  border: 1px solid var(--th-panel-border);
  border-radius: 4px;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.tinhorn-btn-subtle:hover {
  color: var(--th-accent);
  border-color: var(--th-accent-dim);
  background: var(--th-panel-hover);
}

.tinhorn-projects-main {
  flex: 1;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

.projects-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
}

.projects-grid-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 24px;
}

.projects-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
  max-width: 1400px;
  margin: 0 auto;
}

.tinhorn-project-card {
  height: 180px;
  background: var(--th-panel);
  border: 1px solid var(--th-panel-border);
  border-radius: 8px;
  padding: 16px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.tinhorn-project-card:hover {
  background: var(--th-panel-hover);
  border-color: var(--th-accent);
  box-shadow: 0 0 14px var(--th-accent-glow);
}

.project-card-icon {
  font-size: 28px;
  line-height: 1;
  margin-bottom: 8px;
  user-select: none;
}

.project-card-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--th-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.project-card-desc {
  font-size: 12px;
  color: var(--th-text-sec);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: auto;
}

.project-card-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.project-card-pbar-bg {
  flex: 1;
  height: 6px;
  background: var(--th-panel-border);
  border-radius: 3px;
  overflow: hidden;
}

.project-card-pbar-fill {
  height: 100%;
  background: var(--th-accent);
  border-radius: 3px;
  transition: width 0.25s ease;
}

.project-card-pct {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--th-accent);
  min-width: 32px;
  text-align: right;
}

.card-add-new {
  border: 2px dashed var(--th-panel-border);
  background: var(--th-panel);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.card-add-new:hover {
  border-color: var(--th-accent-dim);
  background: var(--th-panel-hover);
}

.card-add-plus {
  font-size: 32px;
  color: var(--th-dim-text);
  line-height: 1;
  margin-bottom: 6px;
}

.card-add-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--th-text-sec);
}

/* -- DETAIL VIEW -- */
.project-detail-container {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 30px 40px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

.project-detail-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.btn-detail-back {
  background: transparent;
  border: none;
  color: var(--th-text-sec);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  padding: 6px 0;
  transition: color 0.15s ease;
}

.btn-detail-back:hover {
  color: var(--th-accent);
}

.tinhorn-project-split {
  display: grid;
  grid-template-columns: 2fr 3fr;
  gap: 28px;
  align-items: start;
}

.tinhorn-project-left {
  background: var(--th-panel);
  border: 1px solid var(--th-panel-border);
  border-radius: 8px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.detail-header-row {
  display: flex;
  align-items: center;
  gap: 18px;
}

.detail-icon {
  font-size: 56px;
  line-height: 1;
  user-select: none;
}

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

.detail-name {
  font-size: 28px;
  font-weight: 800;
  color: var(--th-accent);
  margin: 0;
  line-height: 1.2;
}

.detail-desc {
  font-size: 14px;
  color: var(--th-text-sec);
  margin-top: 6px;
}

.detail-summary {
  font-size: 13.5px;
  color: var(--th-text);
  line-height: 1.6;
  white-space: pre-wrap;
}

.detail-progress-section {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 12px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.detail-progress-bar-bg {
  flex: 1;
  height: 10px;
  background: var(--th-panel-border);
  border-radius: 5px;
  overflow: hidden;
}

.detail-progress-bar-fill {
  height: 100%;
  background: var(--th-accent);
  border-radius: 5px;
  transition: width 0.25s ease;
}

.detail-pct {
  font-size: 16px;
  font-weight: 800;
  color: var(--th-accent);
  font-family: var(--font-mono);
  min-width: 44px;
  text-align: right;
}

.tinhorn-project-right {
  background: var(--th-panel);
  border: 1px solid var(--th-panel-border);
  border-radius: 8px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tasks-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tasks-panel-title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: var(--th-text-sec);
  text-transform: uppercase;
  font-family: var(--font-mono);
  margin: 0;
}

.inline-task-row {
  display: flex;
  gap: 10px;
}

.inline-task-row input {
  flex: 1;
  background: var(--th-bg);
  border: 1px solid var(--th-panel-border);
  border-radius: 4px;
  padding: 9px 12px;
  font-size: 12.5px;
  color: var(--th-text);
  outline: none;
}

.inline-task-row input:focus {
  border-color: var(--th-accent);
}

.btn-inline-add {
  background: var(--th-accent);
  color: var(--th-bg);
  border: none;
  border-radius: 4px;
  padding: 9px 16px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-inline-add:hover {
  background: var(--th-accent-bright);
}

.tasks-list-scroll {
  max-height: 480px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.tasks-checklist {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.task-checkbox-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.task-checkbox-row:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 154, 31, 0.2);
}

.task-check-input {
  width: 18px;
  height: 18px;
  accent-color: var(--th-accent);
  cursor: pointer;
}

.task-text {
  flex: 1;
  font-size: 13.5px;
  color: var(--th-text);
  line-height: 1.4;
}

.task-checkbox-row.done .task-text {
  text-decoration: line-through;
  color: var(--th-dim-text);
}

.task-delete-btn {
  background: transparent;
  border: none;
  color: var(--th-dim-text);
  font-size: 18px;
  cursor: pointer;
  opacity: 0;
  padding: 2px 6px;
  border-radius: 3px;
  transition: opacity 0.15s ease, color 0.15s ease;
}

.task-checkbox-row:hover .task-delete-btn {
  opacity: 1;
}

.task-delete-btn:hover {
  color: #ff4444;
}

.tasks-empty-hint {
  font-size: 13px;
  color: var(--th-dim-text);
  font-style: italic;
  padding: 16px 0;
  text-align: center;
}

/* -- MODALS (PROJECT & REMINDERS) -- */
.modal-project-box {
  max-width: 540px;
}

.modal-reminders-box {
  max-width: 600px;
}

.dialog-tasks-list {
  background: var(--th-bg);
  border: 1px solid var(--th-panel-border);
  border-radius: 4px;
  padding: 8px;
  max-height: 140px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}

.modal-task-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.02);
}

.modal-task-check {
  width: 15px;
  height: 15px;
  accent-color: var(--th-accent);
  cursor: pointer;
}

.modal-task-text {
  flex: 1;
  font-size: 12px;
  color: var(--th-text);
}

.modal-task-text.done {
  text-decoration: line-through;
  color: var(--th-dim-text);
}

.modal-task-remove-btn {
  background: transparent;
  border: none;
  color: var(--th-dim-text);
  font-size: 12px;
  cursor: pointer;
  padding: 0 4px;
}

.modal-task-remove-btn:hover {
  color: #ff4444;
}

.dialog-task-add-row {
  display: flex;
  gap: 8px;
}

.dialog-actions-spacer {
  flex: 1;
}

.reminders-dialog-body {
  padding: 18px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.reminders-dialog-desc {
  font-size: 12px;
  color: var(--th-text-sec);
  margin: 0;
}

.reminders-textarea {
  width: 100%;
  height: 280px;
  background: var(--th-bg);
  color: var(--th-text);
  border: 1px solid var(--th-panel-border);
  border-radius: 4px;
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.5;
  box-sizing: border-box;
  resize: vertical;
  outline: none;
}

.reminders-textarea:focus {
  border-color: var(--th-accent);
}

@media (max-width: 860px) {
  .tinhorn-projects-body {
    height: 100dvh;
    min-height: 100dvh;
    overscroll-behavior: none;
  }

  .tinhorn-projects-root {
    height: 100dvh;
    max-height: 100dvh;
  }

  .projects-grid-scroll {
    overscroll-behavior-y: contain;
    padding: 14px 14px 0 14px;
  }

  .projects-cards-grid {
    padding-bottom: calc(env(safe-area-inset-bottom, 24px) + 90px);
  }

  .tinhorn-project-split {
    grid-template-columns: 1fr;
    padding-bottom: calc(env(safe-area-inset-bottom, 24px) + 90px);
  }

  .project-detail-container {
    padding: 16px;
  }

  .tinhorn-projects-header {
    padding: 10px 14px;
  }

  .tinhorn-projects-header-controls {
    gap: 8px;
  }

  .tinhorn-search-wrap {
    width: 130px;
  }
}
