@import url('https://cdn.jsdelivr.net/npm/@fontsource/cascadia-code/index.css');
@import url('https://cdn.jsdelivr.net/npm/@fontsource/cascadia-code/500.css');
@import url('https://cdn.jsdelivr.net/npm/@fontsource/cascadia-code/600.css');
@import url('https://cdn.jsdelivr.net/npm/@fontsource/cascadia-code/700.css');
@import url('https://fonts.googleapis.com/css2?family=Play:wght@400;700&display=swap');

@font-face {
  font-family: 'VT220';
  src: url('/fonts/Glass_TTY_VT220.ttf') format('truetype'),
       url('https://cdn.jsdelivr.net/gh/svofski/glasstty@master/Glass_TTY_VT220.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'VT220';
  src: url('/fonts/Glass_TTY_VT220.ttf') format('truetype'),
       url('https://cdn.jsdelivr.net/gh/svofski/glasstty@master/Glass_TTY_VT220.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ==========================================================================
   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(222, 89, 19, 0.35);

  --accent: #DE5913;
  --accent-hover: #F16F24;
  --accent-dim: #BA490C;
  --accent-subtle: rgba(222, 89, 19, 0.12);
  --accent-glow: rgba(222, 89, 19, 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-header: 'VT220', monospace;
  --font-title: 'VT220', monospace;
  --font-mono: 'Cascadia Code', monospace;
  --font-sans: 'Play', sans-serif;
  --font-display: 'Play', sans-serif;
  --font-main: 'Cascadia Code', monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

/* Universal Base: Cascadia Code terminal font for all body text, inputs, buttons, tables, cards, lists */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  font-family: 'Cascadia Code', monospace;
}

html, body, button, input, select, textarea, optgroup, option, pre, code, kbd, samp, p, span, a, div, label, table, th, td, ul, ol, li, small, strong, em, b, i {
  font-family: 'Cascadia Code', monospace;
}

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;
}

/* ── RETRO TERMINAL HEADERS & TITLES (VT220) ── */
h1, h2, h3, h4, h5, h6,
.home-title,
.home-tag,
.card-title,
.agenda-card-title,
.agenda-date-title,
.agenda-empty-title,
.terminal-title,
.terminal-badge,
.nav-item-title,
.nav-drawer-brand,
.nav-section-title,
.top-bar,
.net-top-bar,
.vault-top-bar,
.projects-top-bar,
.health-top-bar,
.top-bar button,
.top-bar input,
.top-bar a,
.brand-main,
.btn-topbar,
.btn-topbar span,
#syncText,
.view-mode-btn,
.view-mode-btn span,
.net-search-wrap input,
#projectsSearchInput,
.card-badge,
.modal-title,
.section-title,
.form-section-title,
.tinhorn-sidebar-title,
.tinhorn-panel-title,
.hover-title,
.inspector-title-wrap h2,
.modal-header h3,
.month-title-wrap h1 {
  font-family: 'VT220', monospace !important;
  letter-spacing: 0.5px;
}

/* ── 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 Code', monospace;
}

.terminal-frame {
  width: 100%;
  max-width: 380px;
  background: #0E0F14;
  border: 1px solid rgba(222, 89, 19, 0.24);
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55), 0 0 1px rgba(222, 89, 19, 0.2);
}

.terminal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.terminal-title,
.terminal-badge,
.terminal-prompt-symbol {
  font-family: 'VT220', monospace !important;
}

.terminal-form,
.terminal-input-wrap,
.terminal-lead-char,
.terminal-checkbox-wrap,
.terminal-submit-btn,
.terminal-error {
  font-family: 'Cascadia Code', monospace !important;
}

#passphrase,
.terminal-input-wrap input,
.terminal-input {
  font-family: 'Play', sans-serif !important;
  font-size: 15px;
  letter-spacing: 0.5px;
}

.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(222, 89, 19, 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: 'Play', sans-serif !important;
  font-size: 15px;
  letter-spacing: 0.5px;
  caret-color: var(--accent);
}

.terminal-input-wrap input::placeholder {
  font-family: 'Play', sans-serif !important;
  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;
  line-height: 1.45;
  word-break: break-word;
}

/* ── 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;
}

/* Health OS: Unconstrained responsive height and full scrolling across all access points */
body.health-body,
html:has(.health-body) {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  height: auto !important;
  min-height: 100dvh;
}

body.health-body .app-container,
.app-container.health-app-container,
.health-app-container {
  height: auto !important;
  min-height: 100dvh !important;
  max-height: none !important;
  overflow-y: visible !important;
  overflow-x: hidden !important;
}

.top-bar,
.net-top-bar,
.vault-top-bar,
.projects-top-bar,
.health-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: 1000;
  box-sizing: border-box;
  flex-shrink: 0;
  width: 100%;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  cursor: pointer;
  position: relative;
  z-index: 10;
  transition: opacity 0.15s ease, transform 0.15s ease;
  line-height: 0;
}

.brand-link:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.brand-link:hover .brand-logo-img,
.drawer-brand-link:hover .nav-drawer-logo-img {
  filter: drop-shadow(0 0 10px rgba(222, 89, 19, 0.55));
}

.brand-link:active,
.drawer-brand-link:active {
  transform: translateY(0);
}

.brand-logo-img,
.nav-drawer-logo-img {
  height: 28px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 2px 6px rgba(222, 89, 19, 0.2));
  transition: filter 0.15s ease;
}

.drawer-brand-link {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  text-decoration: none;
  line-height: 0;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.drawer-brand-link:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.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: 'VT220', monospace !important;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: 1.5px;
  line-height: 1;
}

.brand-pill,
.top-bar .brand-pill {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--panel-border);
  color: var(--text-muted);
  font-family: 'Cascadia Code', monospace !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: 'Play', sans-serif !important;
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: 1.2px;
  font-variant-numeric: tabular-nums;
  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: 'VT220', monospace !important;
  font-size: 13px;
  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: none;
  width: 100%;
  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-important { background: #FF3B30; }
.dot-class { background: #3D9BFF; }
.dot-meeting { background: #FFA500; }
.dot-work { background: #FF9100; }
.dot-poker { background: #E040FB; }
.dot-holiday { background: #FFD700; }

/* 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));
}

/* Prevent text highlighting/selection on buttons and interactive elements */
button,
.btn-topbar,
.btn-nav-seg,
.filter-chip,
.modal-close,
.view-mode-btn,
.day-cell,
.allday-chip,
.brand,
.topbar-center,
.live-clock-pill,
.category-filter-bar,
.weekday-grid {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

button:focus,
button:active,
.btn-topbar:focus,
.btn-topbar:active,
.btn-nav-seg:focus,
.btn-nav-seg:active,
.filter-chip:focus,
.filter-chip:active {
  outline: none;
  box-shadow: none;
  -webkit-tap-highlight-color: transparent;
}

.day-cell {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  padding: 5px 6px 6px 6px;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  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.22);
}

.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: rgba(255, 154, 31, 0.6) !important;
  opacity: 1 !important;
  filter: brightness(1) !important;
}

.day-cell.today .day-number {
  background: var(--accent);
  color: #08080A;
  border-radius: 3px;
  padding: 1px 5px;
  font-weight: 800;
}

/* Past Days: Faded slightly with retro-cyberpunk 'X' overlay */
.day-cell.is-past {
  opacity: 0.52;
  filter: grayscale(0.2) brightness(0.76);
  position: relative;
  transition: opacity 0.2s ease, filter 0.2s ease;
}

.day-cell.is-past::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 6;
  background-image: 
    linear-gradient(to top right, transparent calc(50% - 1.5px), rgba(142, 142, 152, 0.35) calc(50% - 1px), rgba(160, 160, 175, 0.65) 50%, rgba(142, 142, 152, 0.35) calc(50% + 1px), transparent calc(50% + 1.5px)),
    linear-gradient(to bottom right, transparent calc(50% - 1.5px), rgba(142, 142, 152, 0.35) calc(50% - 1px), rgba(160, 160, 175, 0.65) 50%, rgba(142, 142, 152, 0.35) calc(50% + 1px), transparent calc(50% + 1.5px));
  opacity: 0.75;
  transition: opacity 0.2s ease;
}

.day-cell.is-past:hover {
  opacity: 0.95 !important;
  filter: grayscale(0) brightness(1.05) !important;
  z-index: 5;
}

.day-cell.is-past:hover::after {
  opacity: 0.25;
}

.day-cell.is-past.selected {
  opacity: 1 !important;
  filter: grayscale(0) brightness(1.0) !important;
}

.day-cell.is-past.selected::after {
  opacity: 0.25;
}

/* Future Days: Days-Ahead Progressive Fading System (more days in advance = more faded dark) */
.day-cell.is-future {
  opacity: var(--future-opacity, 0.85);
  filter: brightness(var(--future-brightness, 0.85));
  transition: opacity 0.2s ease, filter 0.2s ease, background 0.15s, border-color 0.15s;
}

.day-cell.is-future:hover {
  opacity: 1 !important;
  filter: brightness(1.1) !important;
  z-index: 5;
}

.day-cell.is-future.selected {
  opacity: 1 !important;
  filter: brightness(1.05) !important;
}

.day-cell.dimmed {
  opacity: 0.25;
}

.day-header-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 3px;
  flex-shrink: 0;
  line-height: 1;
}

.day-number {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-main);
  font-family: var(--font-mono);
}

/* ── 4-QUADRANT DAY SUMMARY GRID (2x2) ── */
.day-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 3px;
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  box-sizing: border-box;
}

.dsg-square {
  border-radius: 0px !important;
  padding: 2px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-sizing: border-box;
  overflow: hidden;
  min-height: 0;
  border: 1px solid transparent;
  transition: transform 0.1s ease, filter 0.12s ease;
}

.day-cell:hover .dsg-square {
  filter: brightness(1.12);
}

.dsg-label {
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  font-family: var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  line-height: 1.1;
  text-align: center;
  margin-bottom: 1px;
}

.dsg-val {
  font-size: 23px;
  font-weight: 800;
  font-family: var(--font-mono);
  line-height: 1;
  text-align: center;
}

.dsg-val-muted {
  color: var(--text-dim) !important;
  opacity: 0.45;
}

/* Top-Left: Important Items (Red tag color) */
.dsg-important {
  background: rgba(255, 59, 48, 0.12);
  border-color: rgba(255, 59, 48, 0.32);
}
.dsg-important .dsg-label {
  color: #FFA49F;
}
.dsg-important .dsg-val {
  color: #FF3B30;
  text-shadow: 0 0 10px rgba(255, 59, 48, 0.3);
}

/* Top-Right: Class Hours (Blue class color) */
.dsg-class {
  background: rgba(61, 155, 255, 0.12);
  border-color: rgba(61, 155, 255, 0.32);
}
.dsg-class .dsg-label {
  color: #93C5FD;
}
.dsg-class .dsg-val {
  color: #3D9BFF;
  text-shadow: 0 0 10px rgba(61, 155, 255, 0.3);
}

/* Bottom-Left: Meetings (Amber meeting color) */
.dsg-meeting {
  background: rgba(255, 165, 0, 0.12);
  border-color: rgba(255, 165, 0, 0.32);
}
.dsg-meeting .dsg-label {
  color: #FCD34D;
}
.dsg-meeting .dsg-val {
  color: #FFA500;
  text-shadow: 0 0 10px rgba(255, 165, 0, 0.3);
}

/* Bottom-Right: Divvied for other categories */
.dsg-other {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
}
.dsg-other .dsg-label {
  color: var(--text-muted);
}
.dsg-other .dsg-val {
  color: var(--text-main);
}

.dsg-square.dsg-multi-sub {
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  padding: 2px 3px;
  gap: 2px;
}

.dsg-sub-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 1px 3px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 0px !important;
  box-sizing: border-box;
}

.dsg-sub-label {
  font-size: 7.5px;
  font-weight: 700;
  font-family: var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
}

.dsg-sub-count {
  font-size: 11.5px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-main);
}

/* ── SHARP EDGES: ZERO ROUNDED CORNERS ACROSS CALENDAR PAGE ── */
.calendar-page-body,
.calendar-page-body * {
  border-radius: 0px !important;
}

.pill-important { border-left-color: #FF3B30; }
.pill-work { border-left-color: #FF9100; }
.pill-meeting { border-left-color: #FFA500; }
.pill-class { border-left-color: #3D9BFF; }
.pill-poker { border-left-color: #E040FB; }
.pill-social { border-left-color: #00E676; }
.pill-holiday { border-left-color: #FFD700; }

/* ── RECURRENCE SELECTOR CONTROLS IN EVENT MODAL ── */
.recurrence-days-group {
  background: rgba(222, 89, 19, 0.06);
  border: 1px solid rgba(222, 89, 19, 0.28);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 2px;
  margin-bottom: 2px;
  box-sizing: border-box;
}

.recurrence-days-group.hidden {
  display: none !important;
}

.recurrence-days-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.recurrence-days-header .sub-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--accent);
  font-family: var(--font-sans);
}

.recurrence-presets {
  display: flex;
  gap: 4px;
}

.btn-sub-preset {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 700;
  border-radius: 3px;
  padding: 2px 7px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: var(--font-mono);
}

.btn-sub-preset:hover {
  border-color: var(--accent);
  color: var(--accent-hover);
  background: var(--accent-subtle);
}

.recurrence-days-pills {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
}

.day-check-label {
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.day-check-label input {
  display: none;
}

.day-check-label span {
  display: block;
  width: 100%;
  text-align: center;
  padding: 5px 0;
  font-size: 10.5px;
  font-weight: 700;
  font-family: var(--font-sans);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 4px;
  color: var(--text-muted);
  transition: all 0.15s ease;
}

.day-check-label input:checked + span {
  background: var(--accent);
  color: #08080A;
  font-weight: 800;
  border-color: var(--accent-hover);
  box-shadow: 0 0 8px rgba(222, 89, 19, 0.4);
}

.day-check-label:hover span {
  border-color: var(--accent-dim);
  color: var(--text-main);
}

/* ── YEARLY RECURRENCE & CUSTOM TAG CONTROLS ── */
.yearly-recurrence-hint {
  font-size: 11px;
  color: #FFD700;
  background: rgba(255, 215, 0, 0.08);
  border: 1px solid rgba(255, 215, 0, 0.25);
  padding: 7px 10px;
  margin-top: 6px;
  letter-spacing: 0.3px;
  font-family: var(--font-mono);
}

.new-tag-input-row {
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.2);
  padding: 8px 10px;
  margin-top: 4px;
}

.quick-tag-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}

.quick-tag-pill {
  font-size: 10px;
  font-family: var(--font-mono);
  padding: 3px 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-dim);
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
}

.quick-tag-pill:hover {
  background: rgba(222, 89, 19, 0.15);
  border-color: var(--accent);
  color: var(--text-main);
}

.quick-tag-pill.active {
  background: rgba(222, 89, 19, 0.25);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 700;
}

.calendar-tag-pill {
  display: inline-block;
  font-size: 9px;
  padding: 1px 5px;
  background: rgba(255, 255, 255, 0.08);
  color: #E2E8F0;
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-family: var(--font-mono);
  letter-spacing: 0.3px;
  margin-right: 4px;
}

.dvec-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.allday-tags {
  display: inline-flex;
  gap: 3px;
  margin-left: 6px;
}

/* ── 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(222, 89, 19, 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(222, 89, 19, 0.1);
  border: 1px solid rgba(222, 89, 19, 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;
}

.directive-card .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;
}

.directive-card .btn-card-action.btn-edit:hover {
  color: var(--accent-hover);
  background: rgba(222, 89, 19, 0.12);
}

.directive-card .btn-card-action.action-delete {
  font-size: 11px;
  color: var(--text-dim);
}

.directive-card .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(222, 89, 19, 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(222, 89, 19, 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(222, 89, 19, 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(222, 89, 19, 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='%23DE5913' 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; }

/* ── GOOGLE CALENDAR STYLE DAY VIEW TIMELINE MODAL (6 AM - 12 AM) ── */
.day-view-modal-box {
  max-width: 1040px;
  width: 95vw;
  height: min(92vh, 900px);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  background: #0D0E13;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.95), 0 0 40px rgba(222, 89, 19, 0.1);
}

.day-view-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 22px;
  border-bottom: 1px solid var(--panel-border);
  background: #111218;
  flex-shrink: 0;
  gap: 14px;
}

.day-view-title-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.day-view-title-col .sub-lead {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--accent);
  text-transform: uppercase;
  font-family: var(--font-mono);
}

.day-view-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.6px;
  color: var(--text-main);
  font-family: var(--font-mono);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.day-view-status-badge {
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: 0.5px;
  padding: 3px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--panel-border);
  white-space: nowrap;
}

.day-view-status-badge.status-today {
  color: var(--accent);
  background: var(--accent-subtle);
  border-color: rgba(222, 89, 19, 0.35);
}

.day-view-status-badge.status-past {
  color: #71717A;
}

.day-view-status-badge.status-upcoming {
  color: #38BDF8;
  background: rgba(56, 189, 248, 0.1);
  border-color: rgba(56, 189, 248, 0.25);
}

.day-view-nav-group {
  display: inline-flex;
  background: var(--bg-core);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  padding: 2px;
  gap: 2px;
  align-items: center;
}

.day-view-nav-group .btn-nav-seg {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono);
  padding: 5px 10px;
  border-radius: 3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.day-view-nav-group .btn-nav-seg:hover {
  background: var(--panel-hover);
  color: var(--text-main);
}

.day-view-nav-group .btn-seg-today {
  letter-spacing: 0.5px;
}

.day-view-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* All-Day Bar */
.day-view-allday-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 18px;
  border-bottom: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.02);
  flex-shrink: 0;
}

.allday-label {
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-muted);
  letter-spacing: 0.8px;
  min-width: 60px;
}

.day-view-allday-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
}

.allday-chip {
  background: var(--panel);
  border: 1px solid;
  border-radius: 4px;
  padding: 3px 9px;
  font-size: 10.5px;
  font-weight: 700;
  font-family: var(--font-mono);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}

.allday-chip:hover {
  filter: brightness(1.2);
  transform: translateY(-1px);
}

.allday-chip.done {
  opacity: 0.5;
  text-decoration: line-through;
}

/* Timeline Vertical Scroll Area */
.day-view-scroll-wrap {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.day-view-scroll-wrap::-webkit-scrollbar {
  width: 6px;
}
.day-view-scroll-wrap::-webkit-scrollbar-track {
  background: #0B0B0F;
}
.day-view-scroll-wrap::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}
.day-view-scroll-wrap::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

.day-view-timeline-container {
  display: flex;
  position: relative;
  min-height: 1008px;
  height: 1008px;
  background: #0B0B0F;
}

/* Hour Labels Column (6 AM to 12 AM Midnight) */
.day-view-time-col {
  width: 72px;
  flex-shrink: 0;
  border-right: 1px solid var(--panel-border);
  background: rgba(0, 0, 0, 0.2);
  user-select: none;
}

.timeline-hour-label {
  height: 56px;
  font-size: 10.5px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-dim);
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  padding-right: 10px;
  transform: translateY(-7px);
  box-sizing: border-box;
}

/* Interactive Canvas */
.day-view-canvas {
  flex: 1;
  position: relative;
  min-height: 1008px;
  height: 1008px;
}

.day-view-hour-slots {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  pointer-events: none;
}

.day-view-hour-slot {
  height: 56px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  box-sizing: border-box;
  position: relative;
  pointer-events: auto;
  cursor: pointer;
  transition: background 0.12s ease;
}

.day-view-hour-slot::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.025);
  pointer-events: none;
}

.day-view-hour-slot:hover {
  background: rgba(255, 255, 255, 0.025);
}

.day-view-events-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* Sleek Extending Google Calendar-style Event Rectangles */
.day-view-event-card {
  position: absolute;
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  pointer-events: auto;
  box-sizing: border-box;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 3px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  z-index: 10;
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.day-view-event-card:hover {
  transform: translateY(-1px);
  z-index: 25;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
  filter: brightness(1.1);
}

.day-view-event-card.done {
  opacity: 0.5;
}

.day-view-event-card.done .dvec-title {
  text-decoration: line-through;
  color: var(--text-muted);
}

.dvec-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  line-height: 1;
}

.dvec-time {
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: 0.3px;
  opacity: 0.95;
  white-space: nowrap;
}

.dvec-icon {
  font-size: 11px;
  line-height: 1;
}

.dvec-title {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #FFFFFF;
}

.dvec-notes {
  font-size: 10px;
  opacity: 0.75;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-sans);
}

/* Category Palettes for Event Rectangles */
.day-view-event-card.card-work {
  background: rgba(61, 155, 255, 0.18);
  border-color: rgba(61, 155, 255, 0.45);
  border-left: 3.5px solid #3D9BFF;
  color: #BFDBFE;
}
.day-view-event-card.card-meeting {
  background: rgba(222, 89, 19, 0.18);
  border-color: rgba(222, 89, 19, 0.45);
  border-left: 3.5px solid #DE5913;
  color: #FED7AA;
}
.day-view-event-card.card-class {
  background: rgba(168, 85, 247, 0.18);
  border-color: rgba(168, 85, 247, 0.45);
  border-left: 3.5px solid #A855F7;
  color: #E9D5FF;
}
.day-view-event-card.card-exam,
.day-view-event-card.card-exams,
.day-view-event-card.card-test {
  background: rgba(255, 59, 48, 0.18);
  border-color: rgba(255, 59, 48, 0.45);
  border-left: 3.5px solid #FF3B30;
  color: #FECACA;
}
.day-view-event-card.card-poker {
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(245, 158, 11, 0.45);
  border-left: 3.5px solid #F59E0B;
  color: #FDE68A;
}
.day-view-event-card.card-social {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.45);
  border-left: 3.5px solid #10B981;
  color: #A7F3D0;
}
.day-view-event-card.card-holiday {
  background: rgba(244, 63, 94, 0.18);
  border-color: rgba(244, 63, 94, 0.45);
  border-left: 3.5px solid #F43F5E;
  color: #FECDD3;
}
.day-view-event-card.card-routine {
  background: rgba(148, 163, 184, 0.18);
  border-color: rgba(148, 163, 184, 0.45);
  border-left: 3.5px solid #94A3B8;
  color: #E2E8F0;
}

/* Current Time Indicator Line */
.day-view-now-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: #FF3B30;
  z-index: 20;
  pointer-events: none;
  box-shadow: 0 0 6px rgba(255, 59, 48, 0.6);
}

.now-line-dot {
  position: absolute;
  left: -4px;
  top: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #FF3B30;
  box-shadow: 0 0 8px rgba(255, 59, 48, 0.8);
}

/* Inspector Timeline button styling */
.btn-outline-timeline {
  background: rgba(222, 89, 19, 0.08);
  border: 1px solid rgba(222, 89, 19, 0.35);
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-mono);
  padding: 4px 9px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-outline-timeline:hover {
  background: var(--accent);
  color: #08080A;
  border-color: var(--accent);
}

/* ── LAPTOP VIEWPORT OPTIMIZATIONS (HEIGHT <= 850px) ── */
@media (max-height: 850px) {
  .matrix-pane {
    padding: 10px 14px;
  }
  .matrix-nav-bar {
    margin-bottom: 8px;
    gap: 10px;
  }
  .month-title-wrap h1 {
    font-size: 17px;
  }
  .weekday-grid {
    padding: 6px 0;
    font-size: 9.5px;
  }
  .calendar-grid {
    padding-top: 4px;
    gap: 4px;
  }
  .day-cell {
    padding: 4px 6px;
  }
  .day-number {
    font-size: 11px;
  }
  .event-pill {
    font-size: 9px;
    padding: 1px 4px;
  }
  .inspector-pane {
    width: 320px;
  }
  .day-view-modal-box {
    max-height: 94vh;
    height: 94vh;
  }
}

/* ── 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(222, 89, 19, 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(222, 89, 19, 0.06);
  border-color: rgba(222, 89, 19, 0.25);
  color: var(--text-main);
}

.nav-item.active {
  background: rgba(222, 89, 19, 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(222, 89, 19, 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);
}

/* ==========================================================================
   STANDARDIZED TOPBAR & NAVIGATION DRAWER SHELL
   Uniform styling, corners, logo dimensions and brand pills across all 6 pages
   ========================================================================== */

/* 1. Universal Topbar Container Standardization */
.top-bar,
.net-top-bar,
.vault-top-bar,
.projects-top-bar,
.health-top-bar,
.home-page-body .top-bar,
.app-container .top-bar {
  background: rgba(14, 14, 18, 0.95) !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  border-bottom: 1px solid var(--panel-border) !important;
  height: 60px !important;
  min-height: 60px !important;
  max-height: 60px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 0 24px !important;
  box-sizing: border-box !important;
  border-radius: 0px !important;
  width: 100% !important;
  flex-shrink: 0 !important;
  margin: 0 !important;
  position: relative !important;
}

/* 1b. Standardized Topbar Structural Sections */
.brand,
.top-bar .brand,
.net-top-bar .brand,
.vault-top-bar .brand,
.projects-top-bar .brand,
.health-top-bar .brand {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  height: 34px !important;
  flex-shrink: 0 !important;
}

.brand-link,
.top-bar .brand-link {
  display: inline-flex !important;
  align-items: center !important;
  height: 28px !important;
  line-height: 0 !important;
  flex-shrink: 0 !important;
}

.header-actions,
.top-bar .header-actions,
.net-top-bar .header-actions,
.vault-top-bar .header-actions,
.projects-top-bar .header-actions,
.health-top-bar .header-actions {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  height: 34px !important;
  flex-shrink: 0 !important;
}

.topbar-center,
.top-bar .topbar-center,
.vault-top-bar .topbar-center,
.health-top-bar .topbar-center {
  position: absolute !important;
  left: 50% !important;
  top: 50% !important;
  transform: translate(-50%, -50%) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 34px !important;
  z-index: 10 !important;
  pointer-events: auto !important;
}

.net-topbar-center,
.projects-top-bar .net-topbar-center,
.net-top-bar .net-topbar-center {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  height: 34px !important;
  flex: 1 !important;
  min-width: 0 !important;
  max-width: 680px !important;
  margin: 0 16px !important;
}

@media (max-width: 1180px) {
  .net-topbar-center .view-mode-btn span {
    display: none !important;
  }
  .net-topbar-center .view-mode-btn {
    padding: 0 8px !important;
  }
}

/* 2. Standardized Hatstack Logo across Topbar and Drawer */
.brand-logo-img,
.nav-drawer-logo-img,
.top-bar .brand-logo-img,
.nav-drawer .nav-drawer-logo-img {
  height: 28px !important;
  max-height: 28px !important;
  width: auto !important;
  max-width: 140px !important;
  object-fit: contain !important;
  display: block !important;
  filter: drop-shadow(0 2px 6px rgba(222, 89, 19, 0.2)) !important;
  transition: filter 0.15s ease !important;
}

/* 3. Standardized Brand Name Pill */
.brand-pill,
.top-bar .brand-pill,
.projects-top-bar .brand-pill,
.health-top-bar .brand-pill,
.net-top-bar .brand-pill,
.vault-top-bar .brand-pill {
  font-family: 'Cascadia Code', monospace !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  letter-spacing: 1px !important;
  padding: 3px 8px !important;
  height: 22px !important;
  display: inline-flex !important;
  align-items: center !important;
  box-sizing: border-box !important;
  border-radius: 0px !important;
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid var(--panel-border) !important;
  color: var(--text-muted) !important;
  text-transform: uppercase !important;
  line-height: 1 !important;
}

/* 4. Standardized Live Clock Pill */
.live-clock-pill,
.top-bar .live-clock-pill,
.vault-top-bar .live-clock-pill,
.health-top-bar .live-clock-pill {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  background: var(--bg-core) !important;
  border: 1px solid var(--panel-border) !important;
  padding: 0 12px !important;
  border-radius: 0px !important;
  height: 34px !important;
  min-height: 34px !important;
  max-height: 34px !important;
  box-sizing: border-box !important;
}

.live-dot,
.top-bar .live-dot,
.vault-top-bar .live-dot,
.health-top-bar .live-dot {
  width: 7px !important;
  height: 7px !important;
  background: var(--user-teal) !important;
  border-radius: 50% !important;
  box-shadow: 0 0 8px var(--user-teal) !important;
}

.clock-time,
.top-bar .clock-time,
.vault-top-bar .clock-time,
.health-top-bar .clock-time {
  font-family: 'Play', sans-serif !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  letter-spacing: 1.2px !important;
  font-variant-numeric: tabular-nums !important;
  line-height: 1 !important;
  color: var(--text-main) !important;
}

/* 5. Standardized Topbar Buttons */
.btn-topbar,
.top-bar .btn-topbar,
.net-top-bar .btn-topbar,
.vault-top-bar .btn-topbar,
.projects-top-bar .btn-topbar,
.health-top-bar .btn-topbar,
.top-bar .menu-btn,
.top-bar #logoutBtn {
  border-radius: 0px !important;
  height: 34px !important;
  min-height: 34px !important;
  max-height: 34px !important;
  font-family: 'VT220', monospace !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  letter-spacing: 0.5px !important;
  padding: 0 12px !important;
  box-sizing: border-box !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 34px !important;
}

.btn-topbar.btn-icon,
.top-bar .btn-icon,
.top-bar .menu-btn,
.top-bar #logoutBtn {
  width: 34px !important;
  min-width: 34px !important;
  max-width: 34px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* 6. Standardized Search Input Wrap in Topbar */
.net-search-wrap,
.projects-top-bar .net-search-wrap,
.net-top-bar .net-search-wrap {
  border-radius: 0px !important;
  height: 34px !important;
  min-height: 34px !important;
  max-height: 34px !important;
  box-sizing: border-box !important;
  align-items: center !important;
}

/* 7. Standardized Topbar View Mode Controls */
.view-mode-segmented {
  border-radius: 0px !important;
  height: 34px !important;
  min-height: 34px !important;
  max-height: 34px !important;
  padding: 2px !important;
  box-sizing: border-box !important;
  align-items: center !important;
}

.view-mode-btn {
  border-radius: 0px !important;
  height: 28px !important;
  min-height: 28px !important;
  max-height: 28px !important;
  line-height: 28px !important;
  padding: 0 10px !important;
  font-size: 13px !important;
}

/* 8. Standardized Navigation Drawer Shell & Items across All Pages */
.nav-drawer,
.nav-drawer *,
.nav-drawer *::before,
.nav-drawer *::after {
  border-radius: 0px !important;
}

.nav-drawer .status-indicator-dot {
  border-radius: 50% !important;
}

.nav-item,
.nav-drawer .nav-item {
  border-radius: 0px !important;
}

.nav-item-icon,
.nav-drawer .nav-item-icon {
  border-radius: 0px !important;
}

.nav-close-btn,
.nav-drawer .nav-close-btn,
.nav-logout-btn,
.nav-drawer .nav-logout-btn {
  border-radius: 0px !important;
}

/* ── HOMEPAGE: SHARP EDGES (ZERO ROUNDED CORNERS) & PLAY FONT ── */
.home-page-body,
.home-page-body *,
.home-page-body *::before,
.home-page-body *::after,
body:has(.home-main-container),
body:has(.home-main-container) *,
body:has(.home-main-container) *::before,
body:has(.home-main-container) *::after {
  border-radius: 0px !important;
  font-family: 'Play', sans-serif !important;
}

/* ── HOMEPAGE STYLES & FULL SCROLLING SUPPORT ── */
.home-page-body,
body:has(.home-main-container) {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  height: auto !important;
  min-height: 100dvh;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: auto;
  background-color: #030304;
  background-image: none !important;
  position: relative;
}

/* ── HOMEPAGE ANIMATED AMBIENT CANVAS (ALMOST-BLACK DEEP DRIFT + ANGLED TACTICAL PATTERN) ── */
.home-page-body::before,
body:has(.home-main-container)::before {
  content: "" !important;
  position: fixed !important;
  top: -50% !important;
  left: -50% !important;
  width: 200% !important;
  height: 200% !important;
  z-index: -2 !important;
  pointer-events: none !important;
  background: radial-gradient(ellipse 70% 60% at 20% 20%, #0d0d12 0%, #060608 45%, #020203 85%),
              radial-gradient(ellipse 60% 50% at 80% 70%, #0a0a0f 0%, #050507 45%, #010102 85%),
              linear-gradient(140deg, #020203 0%, #08080b 50%, #010102 100%) !important;
  background-size: 130% 130% !important;
  animation: hatstackDeepDrift 32s ease-in-out infinite alternate !important;
  will-change: transform;
}

@keyframes hatstackDeepDrift {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(-3%, -2%, 0) scale(1.03); }
  100% { transform: translate3d(2%, 3%, 0) scale(1.01); }
}

.home-page-body::after,
body:has(.home-main-container)::after {
  content: "" !important;
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: -1 !important;
  pointer-events: none !important;
  background-image: 
    repeating-linear-gradient(
      125deg,
      rgba(255, 255, 255, 0.035) 0px,
      rgba(255, 255, 255, 0.035) 1px,
      transparent 1px,
      transparent 28px,
      rgba(255, 255, 255, 0.015) 28px,
      rgba(255, 255, 255, 0.015) 29px,
      transparent 29px,
      transparent 56px
    ),
    repeating-linear-gradient(
      35deg,
      rgba(255, 255, 255, 0.018) 0px,
      rgba(255, 255, 255, 0.018) 1px,
      transparent 1px,
      transparent 56px
    ) !important;
  background-size: 80px 80px, 80px 80px !important;
  background-position: 0 0, 0 0 !important;
  animation: hatstackAngledRoll 36s linear infinite !important;
  will-change: background-position;
}

@keyframes hatstackAngledRoll {
  0% { background-position: 0 0, 0 0; }
  100% { background-position: 480px 480px, -480px 480px; }
}

@media (prefers-reduced-motion: reduce) {
  .home-page-body::before,
  body:has(.home-main-container)::before,
  .home-page-body::after,
  body:has(.home-main-container)::after {
    animation: none !important;
  }
}

.home-page-body .app-container,
.app-container:has(.home-main-container) {
  height: auto !important;
  min-height: 100dvh;
  max-height: none !important;
  overflow-y: visible !important;
  overflow-x: hidden !important;
  background: transparent;
}

.home-page-body .top-bar,
.app-container:has(.home-main-container) .top-bar {
  position: sticky;
  top: 0;
  z-index: 100;
}

.home-main-container {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: calc(100dvh - 60px);
  padding: 24px 20px 48px;
  max-width: 100%;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
  overflow: visible;
  position: relative;
}

/* ── MODERN MINIMALIST APP LAUNCHER (LINEAR / VERCEL STYLE) ── */
.launcher-container {
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 0 16px;
  box-sizing: border-box;
}

.launcher-banner-frame {
  width: 100%;
  height: 180px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #DE5913;
  background: #060608;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(222, 89, 19, 0.15);
  position: relative;
}

.launcher-banner-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 46%;
  display: block;
}

.launcher-cards-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  align-items: flex-start;
}

.app-hover-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 20px 12px;
  min-height: 112px;
  background: rgba(14, 14, 18, 0.85);
  border: 1px solid #DE5913;
  border-radius: 8px;
  text-decoration: none;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), inset 0 0 10px rgba(222, 89, 19, 0.05);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  cursor: pointer;
  box-sizing: border-box;
}

.app-hover-card:hover,
.app-hover-card:focus-visible {
  transform: scale(1.08) translateY(-6px);
  background: rgba(22, 22, 28, 0.98);
  border-color: var(--accent-hover);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.8), 0 0 24px rgba(222, 89, 19, 0.45);
  z-index: 20;
  outline: none;
}

.app-hover-icon {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  background: rgba(222, 89, 19, 0.1);
  border: 1px solid rgba(222, 89, 19, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  margin-bottom: 12px;
  transition: all 0.25s ease;
  flex-shrink: 0;
}

.app-hover-card:hover .app-hover-icon,
.app-hover-card:focus-visible .app-hover-icon {
  background: rgba(222, 89, 19, 0.2);
  border-color: var(--accent-hover);
  color: var(--accent-hover);
  transform: scale(1.06);
}

.app-hover-icon svg {
  width: 22px;
  height: 22px;
}

.app-hover-title {
  font-family: 'Play', sans-serif !important;
  font-size: 14px;
  font-weight: 700;
  color: #f3f3f5;
  letter-spacing: 0.5px;
  transition: color 0.2s ease;
  white-space: nowrap;
}

.app-hover-card:hover .app-hover-title,
.app-hover-card:focus-visible .app-hover-title {
  color: var(--accent-hover);
}

.app-hover-subtext {
  font-family: 'Play', sans-serif !important;
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.35;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  margin-top: 0;
  transform: translateY(-4px);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.app-hover-card:hover .app-hover-subtext,
.app-hover-card:focus-visible .app-hover-subtext {
  max-height: 60px;
  opacity: 1;
  margin-top: 8px;
  transform: translateY(0);
}

@media (max-width: 820px) {
  .launcher-container {
    padding: 0 12px;
    gap: 16px;
  }
  .launcher-banner-frame {
    height: 130px;
  }
  .launcher-cards-row {
    grid-template-columns: repeat(2, 1fr);
  }
  .launcher-cards-row a:last-child {
    grid-column: 1 / -1;
    max-width: 50%;
    margin: 0 auto;
    width: 100%;
  }
}

@media (max-width: 540px) {
  .launcher-cards-row {
    grid-template-columns: 1fr;
  }
  .launcher-cards-row a:last-child {
    max-width: 100%;
  }
  .app-hover-card {
    flex-direction: row;
    align-items: center;
    text-align: left;
    padding: 14px 18px;
    min-height: 68px;
    gap: 14px;
  }
  .app-hover-icon {
    margin-bottom: 0;
  }
  .app-hover-card-inner {
    flex: 1;
    min-width: 0;
  }
}

/* ── PROFESSIONAL ENTERPRISE BOTTOM BANNER (ASHER & CO. ENTERPRISES) ── */
.enterprise-footer {
  width: 100%;
  background: rgba(6, 7, 10, 0.96);
  border-top: 1px solid rgba(222, 89, 19, 0.25);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  position: relative;
  z-index: 40;
  border-radius: 0px !important;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.5);
  padding: 16px 0 14px;
}

.enterprise-footer-inner {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0 24px;
  box-sizing: border-box;
}

.enterprise-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 5px;
  width: 100%;
}

.enterprise-brand-title {
  font-family: var(--font-mono) !important;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.enterprise-corp-meta {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  line-height: 1.4;
}

.enterprise-contact-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.5px;
  color: #7D818F;
}

.contact-entry {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.contact-sep {
  color: var(--text-dim);
  opacity: 0.45;
  font-size: 9px;
}

.footer-icon {
  flex-shrink: 0;
  color: var(--accent);
  width: 11px;
  height: 11px;
}

.enterprise-sys-id code {
  color: var(--accent);
  background: rgba(222, 89, 19, 0.12);
  border: 1px solid rgba(222, 89, 19, 0.25);
  padding: 1px 5px;
  border-radius: 0px !important;
  font-size: 9px;
}

.enterprise-disclaimer {
  font-family: var(--font-mono);
  font-size: 8.5px;
  color: #4A4D59;
  line-height: 1.45;
  letter-spacing: 0.3px;
  max-width: 960px;
  margin-top: 2px;
}

@media (max-width: 640px) {
  .enterprise-footer {
    padding: 14px 0 12px;
  }

  .enterprise-footer-inner {
    padding: 0 16px;
  }

  .enterprise-contact-line {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .contact-sep {
    display: none;
  }
}

.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,
  .health-top-bar,
  .home-page-body .top-bar,
  .app-container .top-bar {
    padding: 0 16px !important;
  }

  .home-main-container {
    padding: 20px 24px calc(env(safe-area-inset-bottom, 16px) + 16px);
  }

  .home-banner-frame {
    max-width: calc(100vw - 48px);
    margin: 0;
  }

  .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,
  .health-top-bar,
  .home-page-body .top-bar,
  .app-container .top-bar {
    padding: 0 12px !important;
    height: 54px !important;
    min-height: 54px !important;
    max-height: 54px !important;
    flex-wrap: nowrap !important;
  }

  .brand,
  .top-bar .brand,
  .net-top-bar .brand,
  .vault-top-bar .brand,
  .projects-top-bar .brand,
  .health-top-bar .brand {
    gap: 8px !important;
    height: 30px !important;
  }

  .header-actions,
  .top-bar .header-actions,
  .net-top-bar .header-actions,
  .vault-top-bar .header-actions,
  .projects-top-bar .header-actions,
  .health-top-bar .header-actions {
    gap: 6px !important;
    height: 30px !important;
  }

  .btn-topbar,
  .top-bar .btn-topbar,
  .net-top-bar .btn-topbar,
  .vault-top-bar .btn-topbar,
  .projects-top-bar .btn-topbar,
  .health-top-bar .btn-topbar,
  .top-bar .menu-btn,
  .top-bar #logoutBtn {
    height: 30px !important;
    min-height: 30px !important;
    max-height: 30px !important;
    line-height: 30px !important;
    padding: 0 8px !important;
  }

  .btn-topbar.btn-icon,
  .top-bar .btn-icon,
  .top-bar .menu-btn,
  .top-bar #logoutBtn {
    width: 30px !important;
    min-width: 30px !important;
    max-width: 30px !important;
    padding: 0 !important;
  }

  .live-clock-pill,
  .top-bar .live-clock-pill,
  .vault-top-bar .live-clock-pill,
  .health-top-bar .live-clock-pill {
    display: none !important;
  }

  .brand-logo-img,
  .nav-drawer-logo-img,
  .top-bar .brand-logo-img,
  .nav-drawer .nav-drawer-logo-img {
    height: 24px !important;
    max-height: 24px !important;
    max-width: 110px !important;
  }

  .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: 16px 14px calc(env(safe-area-inset-bottom, 16px) + 12px);
    min-height: calc(100dvh - 54px);
  }

  .home-hero {
    margin-bottom: 12px;
  }

  .home-banner-frame {
    max-width: calc(100vw - 28px);
    margin: 0;
  }

  .home-dock-section {
    margin-bottom: 18px;
  }

  .home-dock-bar {
    gap: 14px;
    padding: 4px 6px;
  }

  .dock-btn {
    width: 68px;
    height: 68px;
  }

  .dock-btn-icon svg {
    width: 50px;
    height: 50px;
  }

  .dock-item:first-child .dock-foldout-card::after {
    left: 34px;
  }

  .dock-item:last-child .dock-foldout-card::after {
    right: 34px;
  }

  .dock-foldout-card {
    width: 190px;
    padding: 10px 12px;
  }

  .foldout-title {
    font-size: 14px;
  }

  .foldout-desc {
    font-size: 11px;
  }

  .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(222, 89, 19, 0.05);
}

.horizon-day-card.active {
  border-color: var(--accent);
  background: var(--accent-subtle);
  box-shadow: 0 0 12px rgba(222, 89, 19, 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(222, 89, 19, 0.3);
  color: var(--accent-hover);
}


/* ══════════════════════════════════════════════════════════════════ */
/* ── HATSTACK THE WEB // NET CANVAS & CONTACTS CHART STYLES ────── */
/* ══════════════════════════════════════════════════════════════════ */

/* ── SHARP EDGES: ZERO ROUNDED CORNERS ACROSS THE WEB (NET) PAGE ── */
.net-page-body,
.net-page-body *,
.net-page-body *::before,
.net-page-body *::after {
  border-radius: 0px !important;
}

.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: 0px !important;
  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: 14px;
  padding: 6px 8px;
  outline: none;
  font-family: 'VT220', monospace !important;
  letter-spacing: 0.5px;
}

.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: 0px !important;
  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: 0px !important;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: 'VT220', monospace !important;
  letter-spacing: 0.5px;
}

.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: 0px !important;
  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: 0px !important;
  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;
}

.filter-chip-divider {
  width: 1px;
  height: 16px;
  background: var(--panel-border, rgba(255, 255, 255, 0.15));
  margin: 0 4px;
  flex-shrink: 0;
}

/* 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: 0px !important;
  padding: 10px 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8), 0 0 12px rgba(222, 89, 19, 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: 0px !important;
  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: 0px !important;
  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: 0px !important;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.15s ease;
  cursor: pointer;
}

.contact-person-card:hover {
  border-color: rgba(222, 89, 19, 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(222, 89, 19, 0.2);
}

.card-top-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.card-avatar {
  width: 44px;
  height: 44px;
  border-radius: 0px !important;
  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: 0px !important;
  font-weight: 600;
  font-family: var(--font-mono);
}

.badge-rel {
  background: var(--accent-subtle);
  color: var(--accent-hover);
  border: 1px solid rgba(222, 89, 19, 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: 0px !important;
  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: 0px !important;
  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;
  gap: 8px;
}

.card-links-count {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.3px;
}

.card-action-btns {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.contact-person-card .btn-card-action,
.btn-card-action {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  padding: 4px 9px;
  border-radius: 0px !important;
  font-size: 10.5px;
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  line-height: 1.2;
  white-space: nowrap;
  user-select: none;
  width: auto !important;
  height: auto !important;
  min-height: 24px;
  box-sizing: border-box;
}

.contact-person-card .btn-card-action:hover,
.btn-card-action:hover {
  border-color: var(--accent);
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.contact-person-card .btn-card-action svg,
.btn-card-action svg {
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}

.btn-card-edit {
  border-color: rgba(241, 111, 36, 0.35) !important;
  color: #fb923c !important;
  background: rgba(241, 111, 36, 0.08) !important;
}

.btn-card-edit:hover {
  background: rgba(241, 111, 36, 0.22) !important;
  border-color: #f97316 !important;
  color: #ffffff !important;
  box-shadow: 0 0 8px rgba(241, 111, 36, 0.35);
}

.btn-inspect {
  border-color: rgba(0, 229, 255, 0.3) !important;
  color: #38bdf8 !important;
  background: rgba(0, 229, 255, 0.08) !important;
}

.btn-inspect:hover {
  background: rgba(0, 229, 255, 0.22) !important;
  border-color: #00e5ff !important;
  color: #ffffff !important;
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.35);
}

.btn-graph {
  border-color: rgba(168, 85, 247, 0.3) !important;
  color: #c084fc !important;
  background: rgba(168, 85, 247, 0.08) !important;
}

.btn-graph:hover {
  background: rgba(168, 85, 247, 0.22) !important;
  border-color: #a855f7 !important;
  color: #ffffff !important;
  box-shadow: 0 0 8px rgba(168, 85, 247, 0.35);
}

.btn-inspector-edit {
  background: rgba(222, 89, 19, 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(222, 89, 19, 0.25);
  background: rgba(222, 89, 19, 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: 0px !important;
  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(222, 89, 19, 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: 0px !important;
  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: 0px !important;
  font-weight: 600;
  font-family: var(--font-mono);
}

.inspector-card {
  background: var(--bg);
  border: 1px solid var(--panel-border);
  border-radius: 0px !important;
  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(222, 89, 19, 0.08);
  border: 1px solid rgba(222, 89, 19, 0.2);
  color: var(--accent-bright);
  border-radius: 0px !important;
  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: 0px !important;
  cursor: pointer;
  transition: all 0.15s;
}

.connected-person-item:hover {
  background: rgba(222, 89, 19, 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: 0px !important;
}

.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(222, 89, 19, 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: 0px !important;
  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(222, 89, 19, 0.12);
  border: 1px solid rgba(222, 89, 19, 0.35);
  color: #FFA726;
  padding: 4px 10px;
  border-radius: 0px !important;
  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: 0px !important;
    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: 0px !important;
    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;
}

.vault-top-bar,
.vault-top-bar * {
  border-radius: 0px !important;
}

.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;
}

/* ── MIX-AND-MATCH GENRE FILTER DROPDOWN ── */
.tinhorn-genre-wrap {
  position: relative;
  display: flex;
  align-items: center;
  height: 38px;
  width: 175px;
  box-sizing: border-box;
}

.tinhorn-genre-btn {
  width: 100%;
  height: 100%;
  background: var(--th-panel);
  border: 1px solid var(--th-panel-border);
  border-radius: 0px !important;
  color: var(--th-text);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 0 26px 0 10px;
  outline: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-transform: uppercase;
  transition: border-color 0.15s, box-shadow 0.15s;
  position: relative;
}

.tinhorn-genre-wrap:focus-within .tinhorn-genre-btn,
.tinhorn-genre-btn:hover,
.tinhorn-genre-btn.is-active {
  border-color: var(--th-accent);
  box-shadow: 0 0 10px var(--th-accent-glow);
}

.genre-btn-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  text-align: left;
}

.genre-badge-count {
  background: var(--accent);
  color: #000;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 5px;
  margin-left: 4px;
  margin-right: 14px;
  border-radius: 0px !important;
  line-height: 1.2;
}

.tinhorn-genre-popover {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  width: 250px;
  max-height: 320px;
  background: #0E0F14;
  border: 1px solid var(--accent);
  border-radius: 0px !important;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.85), 0 0 16px rgba(222, 89, 19, 0.2);
  z-index: 200;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: fadeIn 0.15s ease-out;
}

.genre-popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(222, 89, 19, 0.1);
  border-bottom: 1px solid rgba(222, 89, 19, 0.25);
}

.genre-popover-title {
  font-family: 'Play', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 1px;
}

.genre-clear-all-btn {
  background: transparent;
  border: 1px solid rgba(222, 89, 19, 0.4);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 6px;
  cursor: pointer;
  border-radius: 0px !important;
  transition: all 0.15s;
}

.genre-clear-all-btn:hover {
  background: var(--accent);
  color: #000;
}

.genre-items-grid {
  padding: 8px 10px;
  overflow-y: auto;
  max-height: 260px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.genre-pill-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0px !important;
  color: var(--th-text-sec);
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
  user-select: none;
  transition: all 0.12s ease;
}

.genre-pill-option:hover {
  background: rgba(222, 89, 19, 0.12);
  border-color: rgba(222, 89, 19, 0.4);
  color: #FFF;
}

.genre-pill-option.selected {
  background: rgba(222, 89, 19, 0.22);
  border-color: var(--accent);
  color: var(--accent-hover);
  font-weight: 700;
}

.genre-opt-checkbox {
  width: 12px;
  height: 12px;
  border: 1px solid rgba(222, 89, 19, 0.5);
  margin-right: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  line-height: 1;
  color: #000;
  background: transparent;
  flex-shrink: 0;
  border-radius: 0px !important;
}

.genre-pill-option.selected .genre-opt-checkbox {
  background: var(--accent);
  border-color: var(--accent);
}

.genre-opt-label {
  flex: 1;
  text-transform: uppercase;
}

.genre-opt-count {
  font-size: 10px;
  opacity: 0.6;
}

.tinhorn-organize-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--th-panel);
  border: 1px solid var(--th-panel-border);
  border-radius: 0px !important;
  height: 38px;
  width: 175px;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.tinhorn-organize-wrap:focus-within,
.tinhorn-organize-wrap:hover {
  border-color: var(--th-accent);
  box-shadow: 0 0 10px var(--th-accent-glow);
}

.tinhorn-organize-select {
  width: 100%;
  height: 100%;
  background: transparent;
  border: none;
  color: var(--th-text);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 0 26px 0 10px;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  text-transform: uppercase;
}

.tinhorn-organize-select option,
.tinhorn-organize-select optgroup {
  background: #111116;
  color: #E0E0E8;
  font-family: var(--font-mono);
  font-size: 11.5px;
  padding: 6px 10px;
}

.tinhorn-organize-arrow {
  position: absolute;
  right: 10px;
  pointer-events: none;
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.bio-genre-badge {
  background: rgba(222, 89, 19, 0.15) !important;
  color: var(--accent) !important;
  border-color: rgba(222, 89, 19, 0.4) !important;
}

.watchlist-poster-meta-line {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 3px;
}

.watchlist-poster-genre {
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 5px;
  border: 1px solid rgba(222, 89, 19, 0.4);
  background: rgba(222, 89, 19, 0.12);
  color: var(--accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 95px;
}

.spine-tooltip-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 3px;
}

.spine-tooltip-genre {
  font-family: var(--font-mono);
  font-size: 7.5px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 4px;
  border: 1px solid rgba(222, 89, 19, 0.4);
  background: rgba(222, 89, 19, 0.12);
  color: var(--accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 90px;
}

.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);
}

/* ── POSTER GRID STYLE (3-COLUMNS, SCROLLABLE) ── */
.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: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
  padding-bottom: calc(env(safe-area-inset-bottom, 24px) + 50px);
}

.watchlist-poster-tile {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  background: #111115;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0px !important;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.75), 0 1px 3px rgba(0, 0, 0, 0.45);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
  user-select: none;
  display: flex;
}

/* Square tiles for Albums (1:1 aspect ratio) */
.watchlist-poster-tile.poster-square,
.tinhorn-cards-list.category-albums .watchlist-poster-tile {
  aspect-ratio: 1 / 1;
}

.watchlist-poster-tile.poster-square .watchlist-poster-overlay,
.tinhorn-cards-list.category-albums .watchlist-poster-overlay {
  padding: 10px 8px;
}

.watchlist-poster-tile:hover {
  border-color: var(--accent);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.9), 0 0 18px rgba(222, 89, 19, 0.3);
  transform: translateY(-2px);
}

.watchlist-poster-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #0D0D11;
  overflow: hidden;
}

/* Subtle realistic tactile texture: fine cardstock/film grain + print sheen + edge vignette */
.watchlist-poster-media::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background-image:
    url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='posterGrain'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23posterGrain)' opacity='0.09'/%3E%3C/svg%3E"),
    linear-gradient(135deg, rgba(255, 255, 255, 0.09) 0%, rgba(255, 255, 255, 0.02) 28%, transparent 55%, rgba(0, 0, 0, 0.32) 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, transparent 40%, rgba(0, 0, 0, 0.22) 100%);
  background-repeat: repeat, no-repeat, no-repeat;
  background-size: 140px 140px, 100% 100%, 100% 100%;
  mix-blend-mode: overlay;
  opacity: 0.92;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), inset 0 0 24px rgba(0, 0, 0, 0.4);
}

.watchlist-poster-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), filter 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.watchlist-poster-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px;
  box-sizing: border-box;
  background: #121217;
  text-align: center;
  gap: 8px;
}

.watchlist-poster-fallback .fallback-icon {
  font-size: 32px;
  opacity: 0.6;
}

.watchlist-poster-fallback .fallback-name {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  color: #C0C0C8;
  line-height: 1.3;
}

/* Hover overlay & smooth tint */
.watchlist-poster-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  background: linear-gradient(180deg, rgba(8, 8, 10, 0.25) 0%, rgba(8, 8, 10, 0.94) 100%);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 12px 10px;
  box-sizing: border-box;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.watchlist-poster-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  transform: translateY(6px);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.watchlist-poster-tile:hover .watchlist-poster-img {
  filter: brightness(0.38) contrast(1.08);
  transform: scale(1.04);
}

.watchlist-poster-tile:hover .watchlist-poster-overlay {
  opacity: 1;
}

.watchlist-poster-tile:hover .watchlist-poster-info {
  transform: translateY(0);
}

.watchlist-poster-title {
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 700;
  color: #FFFFFF;
  line-height: 1.25;
  letter-spacing: 0.2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);
}

.watchlist-poster-subtitle {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.watchlist-poster-status {
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 2px 5px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.08);
  color: #D1D5DB;
  align-self: flex-start;
  margin-top: 2px;
}

.watchlist-poster-status.status-completed {
  color: #10B981;
  border-color: rgba(16, 185, 129, 0.5);
  background: rgba(16, 185, 129, 0.15);
}

.watchlist-poster-status.status-progress {
  color: #F59E0B;
  border-color: rgba(245, 158, 11, 0.5);
  background: rgba(245, 158, 11, 0.15);
}

.watchlist-poster-status.status-plan {
  color: #60A5FA;
  border-color: rgba(96, 165, 250, 0.5);
  background: rgba(96, 165, 250, 0.15);
}

/* Legacy fallback card support */
.tinhorn-media-card {
  height: 80px;
  background: var(--th-panel);
  border: 1px solid var(--th-panel-border);
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  box-sizing: border-box;
}

.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: 0px;
  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-cover.is-square {
  width: 220px;
  height: 220px;
  aspect-ratio: 1 / 1;
}

.tinhorn-bio-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0px;
  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-genre-text {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin: 8px 0 16px 0;
  display: block;
  line-height: 1.4;
}

.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(222, 89, 19, 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 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding-bottom: calc(env(safe-area-inset-bottom, 24px) + 90px);
  }

  .tinhorn-cards-list.category-books {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 10px 4px 100px 4px;
  }

  .bookshelf-books-row {
    padding: 0 8px;
    min-height: 215px;
  }

  .tinhorn-header-controls {
    justify-content: space-between;
  }

  .tinhorn-search-wrap,
  .tinhorn-genre-wrap,
  .tinhorn-organize-wrap {
    flex: 1 1 120px;
    width: auto;
    min-width: 0;
  }

  .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: 0px;
    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
   -------------------------------------------------------------------------- */

/* ── PROJECTS PAGE: SHARP TOPBAR ELEMENTS (ZERO ROUNDED CORNERS) ── */
.projects-top-bar,
.projects-top-bar *,
.projects-top-bar *::before,
.projects-top-bar *::after {
  border-radius: 0px !important;
}

/* ── PROJECTS PAGE: PLAY FONT FOR PROJECT HEADERS & TITLES ── */
.tinhorn-projects-body .project-card-name,
.tinhorn-projects-body .detail-name,
.tinhorn-projects-body .tinhorn-projects-title,
.tinhorn-projects-body .tasks-panel-title,
.tinhorn-projects-body .tinhorn-dialog-title,
.tinhorn-projects-body .card-add-label {
  font-family: 'Play', sans-serif !important;
}

.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: 700;
  letter-spacing: 1.5px;
  color: var(--th-accent);
  margin: 0;
  font-family: 'Play', sans-serif !important;
}

.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-family: 'Play', sans-serif !important;
  font-size: 16px;
  font-weight: 700;
  color: var(--th-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
  letter-spacing: 0.3px;
}

.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-family: 'Play', sans-serif !important;
  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-family: 'Play', sans-serif !important;
  font-size: 28px;
  font-weight: 700;
  color: var(--th-accent);
  margin: 0;
  line-height: 1.2;
  letter-spacing: 0.5px;
}

.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: 700;
  letter-spacing: 1.2px;
  color: var(--th-text-sec);
  text-transform: uppercase;
  font-family: 'Play', sans-serif !important;
  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(222, 89, 19, 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) -- */
.modal-project-box {
  max-width: 540px;
}

.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;
}

@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;
  }
}

/* ==========================================================================
   VINTAGE NOIR DOSSIER PROFILE PICTURES & FILM GRAIN ENGINE
   ========================================================================== */

/* Universal Noir Film Filter - No duplicate CSS contrast multiplication on baked images */
.noir-filter {
  filter: none !important;
  -webkit-filter: none !important;
}

/* Slide-Over Dossier Photo Mugshot Frame */
.dossier-photo-frame {
  width: 78px;
  height: 92px;
  border-radius: 4px;
  background: #090a0d;
  border: 2px solid #22252c;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 4px 14px rgba(0, 0, 0, 0.85);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.dossier-photo-frame:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
}

.dossier-photo-frame .dossier-photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Film Grain Texture & Vignette Overlay */
.dossier-photo-frame::after,
.dossier-modal-photo-box::after,
.card-avatar-photo::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  background-image: 
    radial-gradient(circle at center, transparent 35%, rgba(0, 0, 0, 0.65) 100%),
    url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.22'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
  border-radius: inherit;
}

.dossier-photo-tag {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(5, 6, 8, 0.88);
  color: #8e95a5;
  font-size: 8px;
  font-family: var(--font-mono);
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.6px;
  padding: 2px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 2;
  pointer-events: none;
}

/* Fallback avatar inside photo frame */
.dossier-photo-frame .inspector-avatar {
  width: 100%;
  height: 100%;
  border-radius: 0;
  border: none;
  font-size: 24px;
}

/* Contacts Directory Card Avatar with Noir Photo */
.card-avatar.card-avatar-photo {
  border-radius: 0px !important;
  overflow: hidden;
  position: relative;
  background: #080808;
  padding: 0;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.card-avatar-photo .card-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Modal Dossier Photo Upload Row & Controls */
.dossier-photo-uploader-row {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(15, 17, 23, 0.6);
  border: 1px solid var(--panel-border);
  border-radius: 0px !important;
  padding: 12px 14px;
  margin-bottom: 12px;
}

@media (max-width: 600px) {
  .dossier-photo-uploader-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

.dossier-modal-photo-preview-wrap {
  flex-shrink: 0;
}

.dossier-modal-photo-box {
  width: 78px;
  height: 92px;
  border-radius: 0px !important;
  background: #090a0d;
  border: 2px solid #2d313d;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 4px 12px rgba(0, 0, 0, 0.7);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.dossier-modal-photo-box:hover {
  border-color: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.35);
}

.dossier-modal-photo-box.drag-over {
  border-color: #00e5ff !important;
  box-shadow: 0 0 22px rgba(0, 229, 255, 0.8), inset 0 0 14px rgba(0, 229, 255, 0.35) !important;
  transform: scale(1.05);
}

.dossier-modal-photo-box.drag-over .dossier-photo-status-badge {
  background: #00e5ff !important;
  color: #030406 !important;
  font-weight: 800 !important;
}

.dossier-modal-photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.dossier-modal-fallback-initials {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  color: #717888;
}

.dossier-photo-status-badge {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(8, 10, 14, 0.9);
  color: #8e95a5;
  font-size: 7.5px;
  font-family: var(--font-mono);
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.5px;
  padding: 2px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 2;
  pointer-events: none;
}

.dossier-photo-status-badge.has-photo {
  color: #38bdf8;
  border-top-color: rgba(56, 189, 248, 0.3);
}

.dossier-modal-photo-controls {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dossier-modal-photo-controls label {
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--accent);
  letter-spacing: 0.5px;
  margin: 0;
}

.dossier-photo-buttons-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-upload-photo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 0px !important;
}

.btn-clear-photo {
  background: rgba(220, 38, 38, 0.12);
  color: #f87171;
  border: 1px solid rgba(220, 38, 38, 0.35);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 0px !important;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-clear-photo:hover {
  background: rgba(220, 38, 38, 0.25);
  border-color: #f87171;
}

.photo-url-input-wrap {
  display: flex;
  gap: 6px;
}

.photo-url-input {
  flex: 1;
  min-width: 0;
  font-size: 11px;
  padding: 5px 8px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--panel-border);
  border-radius: 0px !important;
  color: #f1f5f9;
  font-family: var(--font-mono);
}

.btn-apply-url {
  background: #1e293b;
  color: #cbd5e1;
  border: 1px solid var(--panel-border);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 0px !important;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-apply-url:hover {
  background: #334155;
  color: #ffffff;
  border-color: var(--accent);
}

.photo-hint-text {
  font-size: 10px;
  color: var(--text-dim);
  line-height: 1.35;
}

.btn-framing-photo {
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 0px !important;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-framing-photo:hover {
  background: rgba(56, 189, 248, 0.25);
  border-color: #38bdf8;
}

/* Photo Framing & Crop Dialog */
.modal-box-framing {
  max-width: 440px;
  width: 92%;
  background: #080a0f;
  border: 1px solid #1e2433;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.85);
}

.framing-modal-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.framing-hint-bar {
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 0px !important;
  padding: 7px 10px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: #93c5fd;
  text-align: center;
}

.framing-stage-container {
  position: relative;
  width: 360px;
  height: 360px;
  max-width: 100%;
  margin: 0 auto;
  border-radius: 0px !important;
  overflow: hidden;
  background: #030406;
  border: 1px solid #1a202c;
  cursor: grab;
  user-select: none;
  touch-action: none;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8);
}

.framing-stage-container.dragging {
  cursor: grabbing;
}

.framing-stage-container.drag-over {
  border-color: #00e5ff !important;
  box-shadow: 0 0 24px rgba(0, 229, 255, 0.7), inset 0 0 24px rgba(0, 229, 255, 0.25) !important;
}

#framingCanvas {
  display: block;
  width: 360px;
  height: 360px;
  max-width: 100%;
}

.framing-controls-bar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(15, 18, 26, 0.85);
  border: 1px solid #1e2433;
  border-radius: 0px !important;
  padding: 10px 14px;
}

.framing-zoom-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.framing-zoom-label {
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: #94a3b8;
  letter-spacing: 0.5px;
}

.framing-slider {
  flex: 1;
  accent-color: var(--accent);
  cursor: pointer;
}

.btn-framing-tool {
  background: #151a24;
  border: 1px solid #283248;
  color: #cbd5e1;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  border-radius: 0px !important;
  padding: 4px 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-framing-tool:hover {
  background: #202838;
  color: #ffffff;
  border-color: var(--accent);
}

.framing-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.framing-toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 11px;
  font-family: var(--font-mono);
  color: #94a3b8;
}

.framing-toggle-label input[type="checkbox"] {
  accent-color: var(--accent);
  cursor: pointer;
}

.framing-val-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 0px !important;
  padding: 2px 6px;
  min-width: 44px;
  text-align: center;
  box-sizing: border-box;
}



