  @import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Syne:wght@600;700;800&family=Inter:wght@300;400;500&display=swap');

  :root {
    --black: #080807;
    --surface: #0f0e0c;
    --surface2: #161410;
    --off-white: #f0ede8;
    --sand: #c9b99a;
    --amber: #c17d3c;
    --amber-dim: rgba(193,125,60,0.1);
    --amber-glow: rgba(193,125,60,0.06);
    --green: #4a9e6e;
    --green-dim: rgba(74,158,110,0.1);
    --blue: #4a7ab5;
    --red: #c0504a;
    --muted: #6b6560;
    --line: rgba(201,185,154,0.1);
    --line2: rgba(201,185,154,0.06);
  }

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

  body {
    background: var(--black);
    color: var(--off-white);
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    font-size: 13px;
    min-height: 100vh;
    overflow-x: hidden;
  }

  /* ── TOP BAR ── */
  .topbar {
    height: 48px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 20px;
    position: sticky;
    top: 0;
    background: var(--black);
    z-index: 300;
  }

  .topbar-logo {
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.2em;
    color: var(--amber);
    text-transform: uppercase;
    white-space: nowrap;
  }

  .topbar-tabs {
    display: flex;
    gap: 0;
    flex: 1;
    overflow-x: auto;
  }

  .topbar-tab {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--muted);
    font-family: 'DM Mono', monospace;
    font-size: 9px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 0 14px;
    height: 48px;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
  }

  .topbar-tab:hover { color: var(--sand); }
  .topbar-tab.active { color: var(--amber); border-bottom-color: var(--amber); }

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

  .topbar-time {
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    color: var(--muted);
    letter-spacing: 0.1em;
  }

  .days-badge {
    font-family: 'DM Mono', monospace;
    font-size: 9px;
    color: var(--amber);
    border: 1px solid rgba(193,125,60,0.4);
    padding: 3px 8px;
    border-radius: 2px;
    letter-spacing: 0.1em;
    white-space: nowrap;
  }

  .storage-status {
    display: none;
    font-family: 'DM Mono', monospace;
    font-size: 9px;
    color: var(--red);
    border: 1px solid rgba(192,80,74,0.4);
    padding: 3px 8px;
    border-radius: 2px;
    letter-spacing: 0.1em;
    white-space: nowrap;
  }
  .storage-status.show { display: inline-block; }

  /* ── VIEWS ── */
  .view { display: none; }
  .view.active { display: block; }

  /* ── GRID LAYOUT ── */
  .grid {
    display: grid;
    gap: 1px;
    background: var(--line2);
    min-height: calc(100vh - 48px);
  }

  .grid-home {
    grid-template-columns: 260px 1fr 280px;
    grid-template-rows: auto auto 1fr;
  }

  .panel {
    background: var(--black);
    padding: 18px 20px;
    overflow: hidden;
  }

  .panel-label {
    font-family: 'DM Mono', monospace;
    font-size: 8px;
    letter-spacing: 0.2em;
    color: var(--muted);
    text-transform: uppercase;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
  }

  .panel-label span { color: var(--amber); }

  /* ── SLIDER INPUT (shared: Journal emotion/energy) ── */
  .score-slider {
    width: 100%;
    -webkit-appearance: none;
    height: 2px;
    background: var(--line);
    outline: none;
    border-radius: 1px;
  }

  .score-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--amber);
    cursor: pointer;
    border: 2px solid var(--black);
  }

  /* ── JARVIS PANEL ── */
  .jarvis-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .jarvis-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 2px;
    padding: 12px 14px;
    position: relative;
  }

  .jarvis-card.urgent { border-left: 2px solid var(--red); }
  .jarvis-card.opportunity { border-left: 2px solid var(--amber); }
  .jarvis-card.content { border-left: 2px solid var(--green); }
  .jarvis-card.social { border-left: 2px solid var(--blue); }

  .jarvis-card-type {
    font-family: 'DM Mono', monospace;
    font-size: 7px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 5px;
  }

  .jarvis-card.urgent .jarvis-card-type { color: var(--red); }
  .jarvis-card.opportunity .jarvis-card-type { color: var(--amber); }
  .jarvis-card.content .jarvis-card-type { color: var(--green); }
  .jarvis-card.social .jarvis-card-type { color: var(--blue); }

  .jarvis-card-text {
    font-size: 12px;
    line-height: 1.6;
    color: var(--off-white);
  }

  .jarvis-card-date {
    font-family: 'DM Mono', monospace;
    font-size: 8px;
    color: var(--muted);
    margin-top: 6px;
  }

  .jarvis-refresh {
    background: none;
    border: 1px solid var(--line);
    color: var(--muted);
    font-family: 'DM Mono', monospace;
    font-size: 8px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 6px 12px;
    cursor: pointer;
    transition: all 0.15s;
    border-radius: 2px;
    width: 100%;
    margin-top: 10px;
  }

  .jarvis-refresh:hover { border-color: var(--amber); color: var(--amber); }

  /* ── CALENDAR ── */
  .cal-events {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .cal-event {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 8px 10px;
    background: var(--surface);
    border-radius: 2px;
    border-left: 2px solid var(--line);
  }

  .cal-event.priority { border-left-color: var(--amber); }
  .cal-event.mission { border-left-color: var(--green); }
  .cal-event.health { border-left-color: var(--red); }

  .cal-event-date {
    font-family: 'DM Mono', monospace;
    font-size: 9px;
    color: var(--muted);
    white-space: nowrap;
    padding-top: 1px;
    min-width: 60px;
  }

  .cal-event-title {
    font-size: 12px;
    line-height: 1.4;
  }

  /* ── TIMELINE ── */
  .timeline-wrap {
    padding: 8px 0;
  }

  .tl-track {
    position: relative;
    height: 4px;
    background: var(--line);
    border-radius: 2px;
    margin: 20px 0 32px;
  }

  .tl-progress {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--amber), rgba(193,125,60,0.3));
    border-radius: 2px;
    transition: width 1s ease;
  }

  .tl-now {
    position: absolute;
    top: -6px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--amber);
    border: 3px solid var(--black);
    transform: translateX(-50%);
    box-shadow: 0 0 12px rgba(193,125,60,0.5);
  }

  .tl-milestones {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .tl-milestone {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 8px 12px;
    background: var(--surface);
    border-radius: 2px;
  }

  .tl-milestone.passed { opacity: 0.4; }
  .tl-milestone.next { background: var(--amber-dim); border: 1px solid rgba(193,125,60,0.2); }

  .tl-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--muted);
    flex-shrink: 0;
  }

  .tl-milestone.next .tl-dot { background: var(--amber); }
  .tl-milestone.passed .tl-dot { background: var(--green); }

  .tl-ms-date {
    font-family: 'DM Mono', monospace;
    font-size: 9px;
    color: var(--muted);
    min-width: 70px;
  }

  .tl-ms-title { font-size: 12px; }
  .tl-ms-days {
    margin-left: auto;
    font-family: 'DM Mono', monospace;
    font-size: 9px;
    color: var(--amber);
  }

  /* ── SPORT TRACKER ── */
  .sport-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 16px;
  }

  .sport-stat {
    background: var(--surface);
    border: 1px solid var(--line);
    padding: 12px;
    border-radius: 2px;
    text-align: center;
  }

  .sport-stat-val {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: 24px;
    color: var(--amber);
    display: block;
    margin-bottom: 3px;
  }

  .sport-stat-label {
    font-family: 'DM Mono', monospace;
    font-size: 8px;
    color: var(--muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }

  .week-dots {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
  }

  .week-dot {
    flex: 1;
    height: 32px;
    border-radius: 2px;
    background: var(--surface);
    border: 1px solid var(--line);
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
  }

  .week-dot:hover { border-color: var(--amber); }
  .week-dot.done { background: var(--green-dim); border-color: var(--green); }
  .week-dot.today { border-color: var(--amber); }

  .week-dot-day {
    font-family: 'DM Mono', monospace;
    font-size: 7px;
    color: var(--muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }

  .week-dot-icon { font-size: 10px; }

  /* ── NETWORK ── */
  .network-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .network-contact {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 2px;
    padding: 10px 12px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
  }

  .network-status {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 4px;
  }

  .network-status.warm { background: var(--amber); }
  .network-status.active { background: var(--green); }
  .network-status.cold { background: var(--muted); }

  .network-name {
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 3px;
  }

  .network-role {
    font-family: 'DM Mono', monospace;
    font-size: 8px;
    color: var(--muted);
    letter-spacing: 0.1em;
    margin-bottom: 4px;
    text-transform: uppercase;
  }

  .network-action {
    font-size: 11px;
    color: var(--sand);
    font-style: italic;
  }

  .network-add {
    background: none;
    border: 1px dashed var(--line);
    color: var(--muted);
    font-family: 'DM Mono', monospace;
    font-size: 9px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 8px;
    cursor: pointer;
    transition: all 0.15s;
    border-radius: 2px;
    width: 100%;
    margin-top: 6px;
  }

  .network-add:hover { border-color: var(--amber); color: var(--amber); }

  /* ── CONTENT PIPELINE ── */
  .pipeline-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .pipeline-item {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 8px 10px;
    background: var(--surface);
    border-radius: 2px;
  }

  .pipeline-sig {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
  }

  .pipeline-sig.live { background: var(--green); }
  .pipeline-sig.ready { background: var(--amber); }
  .pipeline-sig.draft { background: var(--muted); }

  .pipeline-title {
    font-size: 12px;
    flex: 1;
  }

  .pipeline-status {
    font-family: 'DM Mono', monospace;
    font-size: 8px;
    color: var(--muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }

  /* ── JOURNAL HISTORY ── */
  .journal-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .journal-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px;
    background: var(--surface);
    border-radius: 2px;
  }

  .journal-item-meta {
    display: flex;
    justify-content: space-between;
    font-family: 'DM Mono', monospace;
    font-size: 8px;
    color: var(--muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }

  .journal-item-text {
    font-size: 12px;
  }

  /* ── TODOS ── */
  .todo-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .todo-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 8px 10px;
    background: var(--surface);
    border-radius: 2px;
    cursor: pointer;
    transition: opacity 0.2s;
  }

  .todo-item.done { opacity: 0.4; text-decoration: line-through; }

  .todo-check {
    width: 14px;
    height: 14px;
    border: 1px solid var(--line);
    border-radius: 2px;
    flex-shrink: 0;
    margin-top: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    color: var(--green);
    transition: all 0.15s;
  }

  .todo-item:hover .todo-check { border-color: var(--amber); }
  .todo-item.done .todo-check { background: var(--green-dim); border-color: var(--green); }

  .todo-text { font-size: 12px; line-height: 1.5; flex: 1; }

  .todo-cat {
    font-family: 'DM Mono', monospace;
    font-size: 7px;
    color: var(--muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    white-space: nowrap;
    padding-top: 2px;
  }

  .todo-add-row {
    display: flex;
    gap: 6px;
    margin-top: 8px;
  }

  .todo-add-input {
    flex: 1;
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--off-white);
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    padding: 7px 10px;
    border-radius: 2px;
    outline: none;
    transition: border-color 0.15s;
  }

  .todo-add-input:focus { border-color: var(--amber); }
  .todo-add-input::placeholder { color: var(--muted); }

  .todo-add-btn {
    background: var(--amber);
    border: none;
    color: var(--black);
    font-family: 'DM Mono', monospace;
    font-size: 9px;
    letter-spacing: 0.1em;
    padding: 7px 12px;
    border-radius: 2px;
    cursor: pointer;
    transition: opacity 0.15s;
  }

  .todo-add-btn:hover { opacity: 0.85; }

  /* Network capture has more fields than the base .todo-add-row was sized
     for (4 inputs + button) — reflow it into a 2-column grid instead of a
     single row, scoped to this instance only so Todos/Journal are unaffected. */
  #networkCapture .todo-add-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }

  #networkCapture .todo-add-input {
    min-width: 0;
  }

  #networkCapture .todo-add-btn {
    grid-column: 1 / -1;
  }

  /* ── WEATHER WIDGET ── */
  .weather-widget {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 2px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 14px;
  }

  .weather-icon { font-size: 28px; }

  .weather-main {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: 24px;
    color: var(--off-white);
  }

  .weather-desc {
    font-family: 'DM Mono', monospace;
    font-size: 9px;
    color: var(--muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }

  .weather-loc {
    margin-left: auto;
    text-align: right;
  }

  .weather-city {
    font-family: 'DM Mono', monospace;
    font-size: 9px;
    color: var(--sand);
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }

  .weather-suggestion {
    font-family: 'DM Mono', monospace;
    font-size: 9px;
    color: var(--amber);
    letter-spacing: 0.1em;
    margin-top: 4px;
  }

  /* ── BUROCRACY ── */
  .buro-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .buro-item {
    display: flex;
    gap: 10px;
    padding: 8px 10px;
    background: var(--surface);
    border-radius: 2px;
    align-items: center;
    cursor: pointer;
  }

  .buro-item.done { opacity: 0.45; }

  .buro-check {
    width: 14px;
    height: 14px;
    border: 1px solid var(--line);
    border-radius: 2px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    color: var(--green);
  }

  .buro-item.done .buro-check { background: var(--green-dim); border-color: var(--green); }

  .buro-text { font-size: 12px; flex: 1; }

  .buro-deadline {
    font-family: 'DM Mono', monospace;
    font-size: 8px;
    color: var(--red);
    letter-spacing: 0.08em;
    white-space: nowrap;
  }

  .buro-deadline.ok { color: var(--green); }
  .buro-deadline.soon { color: var(--amber); }

  /* ── TOAST ── */
  .toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(60px);
    background: var(--amber);
    color: var(--black);
    font-family: 'DM Mono', monospace;
    font-size: 9px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    padding: 8px 16px;
    border-radius: 2px;
    transition: transform 0.3s;
    z-index: 999;
    white-space: nowrap;
  }

  .toast.show { transform: translateX(-50%) translateY(0); }

  /* ── SPAN HELPERS ── */
  .span-2 { grid-column: span 2; }
  .span-3 { grid-column: span 3; }

  /* ── CORE DIRECTIVE MODAL ── */
  .directive-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 400;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
  }

  .directive-overlay.open { display: flex; }

  .directive-window {
    background: var(--black);
    border: 1px solid rgba(193,125,60,0.3);
    border-radius: 3px;
    width: min(860px, 92vw);
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 60px rgba(193,125,60,0.08), 0 0 0 1px rgba(193,125,60,0.1);
    overflow: hidden;
  }

  .directive-titlebar {
    height: 40px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    padding: 0 16px;
    justify-content: space-between;
    flex-shrink: 0;
    background: var(--surface);
  }

  .directive-titlebar-label {
    font-family: 'DM Mono', monospace;
    font-size: 9px;
    letter-spacing: 0.2em;
    color: var(--amber);
    text-transform: uppercase;
  }

  .directive-close {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 16px;
    padding: 4px 8px;
    transition: color 0.15s;
    line-height: 1;
  }

  .directive-close:hover { color: var(--off-white); }

  .directive-body {
    overflow-y: auto;
    padding: 28px 32px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    flex: 1;
  }

  .directive-section {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 2px;
    padding: 16px 18px;
  }

  .directive-section.full { grid-column: span 2; }

  .directive-section-title {
    font-family: 'DM Mono', monospace;
    font-size: 8px;
    letter-spacing: 0.2em;
    color: var(--amber);
    text-transform: uppercase;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
  }

  .directive-text {
    font-size: 12px;
    line-height: 1.75;
    color: rgba(240,237,232,0.75);
  }

  .directive-text strong {
    color: var(--off-white);
    font-weight: 500;
  }

  .directive-pill-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
  }

  .directive-pill {
    font-family: 'DM Mono', monospace;
    font-size: 8px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 2px;
    border: 1px solid var(--line);
    color: var(--sand);
  }

  .directive-pill.green { border-color: rgba(74,158,110,0.4); color: #4a9e6e; }
  .directive-pill.red { border-color: rgba(192,80,74,0.4); color: #c0504a; }
  .directive-pill.amber { border-color: rgba(193,125,60,0.4); color: var(--amber); }

  .directive-question {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: 16px;
    color: var(--amber);
    line-height: 1.4;
    margin-bottom: 8px;
  }

  .directive-weight-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
  }

  .directive-weight-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
  }

  .directive-weight-label {
    font-family: 'DM Mono', monospace;
    font-size: 9px;
    color: var(--sand);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    min-width: 100px;
  }

  .directive-weight-bar {
    flex: 1;
    height: 2px;
    background: var(--line);
    border-radius: 1px;
    overflow: hidden;
  }

  .directive-weight-fill {
    height: 100%;
    background: var(--amber);
    border-radius: 1px;
  }

  .directive-weight-val {
    font-family: 'DM Mono', monospace;
    font-size: 9px;
    color: var(--amber);
    min-width: 32px;
    text-align: right;
  }

  /* ── DECISION ENGINE ──────────────────────────────── */

  .de-layout {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 1px;
    background: var(--line2);
    min-height: calc(100vh - 48px);
  }

  .de-panel { background: var(--black); padding: 24px 22px; overflow-y: auto; }

  /* Capture Form */
  .de-form-title {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: 18px;
    margin-bottom: 4px;
    letter-spacing: -0.01em;
  }

  .de-form-sub {
    font-family: 'DM Mono', monospace;
    font-size: 8px;
    color: var(--muted);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 20px;
  }

  .de-field { margin-bottom: 16px; }

  .de-field-label {
    font-family: 'DM Mono', monospace;
    font-size: 8px;
    color: var(--muted);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 6px;
    display: block;
  }

  .de-textarea {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--off-white);
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    font-size: 13px;
    line-height: 1.65;
    padding: 10px 12px;
    border-radius: 2px;
    resize: none;
    outline: none;
    transition: border-color 0.15s;
    min-height: 60px;
  }

  .de-textarea:focus { border-color: var(--amber); }
  .de-textarea::placeholder { color: var(--muted); font-style: italic; }

  /* Chip selectors */
  .de-chips { display: flex; gap: 6px; flex-wrap: wrap; }

  .de-chip {
    background: none;
    border: 1px solid var(--line);
    color: var(--muted);
    font-family: 'DM Mono', monospace;
    font-size: 8px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 5px 10px;
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.15s;
  }

  .de-chip:hover { border-color: var(--sand); color: var(--sand); }
  .de-chip.sel-level  { border-color: var(--amber); color: var(--amber); background: var(--amber-dim); }
  .de-chip.sel-domain { border-color: var(--steel); color: #8a9aaa; background: rgba(58,74,92,0.2); }

  /* Mission relevance */
  .de-relevance {
    background: var(--amber-dim);
    border: 1px solid rgba(193,125,60,0.2);
    border-radius: 2px;
    padding: 10px 12px;
    margin-bottom: 16px;
  }

  .de-relevance-label {
    font-family: 'DM Mono', monospace;
    font-size: 8px;
    color: var(--amber);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 6px;
    display: block;
  }

  .de-relevance textarea {
    width: 100%;
    background: none;
    border: none;
    border-bottom: 1px solid rgba(193,125,60,0.2);
    color: var(--off-white);
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    font-size: 12px;
    padding: 4px 0;
    outline: none;
    resize: none;
    min-height: 40px;
    line-height: 1.6;
  }

  .de-relevance textarea::placeholder { color: rgba(193,125,60,0.4); font-style: italic; }

  /* Context snapshot */
  .de-context-snap {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 2px;
    padding: 10px 12px;
    margin-bottom: 16px;
    display: flex;
    gap: 16px;
  }

  .de-context-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
  }

  .de-context-label {
    font-family: 'DM Mono', monospace;
    font-size: 7px;
    color: var(--muted);
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }

  .de-context-val {
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    color: var(--amber);
  }

  /* Enrichment toggle */
  .de-enrich-toggle {
    background: none;
    border: 1px dashed var(--line);
    color: var(--muted);
    font-family: 'DM Mono', monospace;
    font-size: 8px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 7px 12px;
    border-radius: 2px;
    cursor: pointer;
    width: 100%;
    margin-bottom: 12px;
    transition: all 0.15s;
    text-align: left;
  }

  .de-enrich-toggle:hover { border-color: var(--amber); color: var(--amber); }

  .de-enrich-fields { display: none; margin-bottom: 12px; }
  .de-enrich-fields.open { display: block; }

  .de-slider-wrap { margin-bottom: 12px; }

  .de-slider {
    width: 100%;
    -webkit-appearance: none;
    height: 2px;
    background: var(--line);
    outline: none;
    border-radius: 1px;
    margin-top: 6px;
  }

  .de-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--amber);
    cursor: pointer;
    border: 2px solid var(--black);
  }

  .de-slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 4px;
  }

  .de-slider-labels span {
    font-family: 'DM Mono', monospace;
    font-size: 7px;
    color: var(--muted);
    letter-spacing: 0.1em;
  }

  /* Save button */
  .de-save-btn {
    width: 100%;
    background: var(--amber);
    border: none;
    color: var(--black);
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    padding: 12px;
    border-radius: 2px;
    cursor: pointer;
    transition: opacity 0.15s;
    font-weight: 500;
  }

  .de-save-btn:hover { opacity: 0.85; }

  /* Log panel */
  .de-log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
  }

  .de-log-title {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: 16px;
  }

  .de-log-count {
    font-family: 'DM Mono', monospace;
    font-size: 9px;
    color: var(--muted);
    letter-spacing: 0.1em;
  }

  /* Review card */
  .de-review-card {
    background: rgba(192,80,74,0.08);
    border: 1px solid rgba(192,80,74,0.3);
    border-radius: 2px;
    padding: 14px 16px;
    margin-bottom: 10px;
  }

  .de-review-badge {
    font-family: 'DM Mono', monospace;
    font-size: 8px;
    color: var(--red);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 6px;
  }

  .de-review-title {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 4px;
  }

  .de-review-meta {
    font-family: 'DM Mono', monospace;
    font-size: 8px;
    color: var(--muted);
    margin-bottom: 10px;
  }

  .de-review-btn {
    background: none;
    border: 1px solid var(--red);
    color: var(--red);
    font-family: 'DM Mono', monospace;
    font-size: 8px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 5px 10px;
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.15s;
  }

  .de-review-btn:hover { background: rgba(192,80,74,0.1); }

  /* Calibration section */
  .de-calibration-title {
    font-family: 'DM Mono', monospace;
    font-size: 8px;
    color: var(--muted);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-bottom: 8px;
  }

  .de-calibration-list {
    margin-bottom: 20px;
  }

  .de-calibration-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid var(--line);
    font-family: 'DM Mono', monospace;
    font-size: 9px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }

  .de-calibration-item:last-child { border-bottom: none; }

  .de-calibration-domain { color: var(--muted); }

  .de-calibration-status.contradicted   { color: var(--red); }
  .de-calibration-status.uncontradicted { color: var(--green); }
  .de-calibration-status.undetermined   { color: var(--muted); }

  /* Decision entry card */
  .de-entry {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 2px;
    padding: 14px 16px;
    margin-bottom: 8px;
    position: relative;
  }

  .de-entry.strategic { border-left: 2px solid var(--amber); }
  .de-entry.life      { border-left: 2px solid #7c5cbf; }

  .de-entry-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 6px;
    gap: 8px;
  }

  .de-entry-title { font-size: 13px; font-weight: 500; line-height: 1.4; flex: 1; }

  .de-entry-tags { display: flex; gap: 4px; flex-wrap: wrap; flex-shrink: 0; }

  .de-entry-tag {
    font-family: 'DM Mono', monospace;
    font-size: 7px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 2px 5px;
    border-radius: 1px;
    border: 1px solid var(--line);
    color: var(--muted);
  }

  .de-entry-tag.strategic { border-color: rgba(193,125,60,0.4); color: var(--amber); }
  .de-entry-tag.life      { border-color: rgba(124,92,191,0.4); color: #7c5cbf; }

  .de-entry-why {
    font-size: 11px;
    color: var(--muted);
    font-style: italic;
    line-height: 1.55;
    margin-bottom: 6px;
  }

  .de-entry-relevance {
    font-size: 11px;
    color: rgba(193,125,60,0.7);
    font-style: italic;
    margin-bottom: 8px;
  }

  .de-entry-footer {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
  }

  .de-entry-date {
    font-family: 'DM Mono', monospace;
    font-size: 8px;
    color: var(--muted);
    letter-spacing: 0.08em;
  }

  .de-entry-review-due {
    font-family: 'DM Mono', monospace;
    font-size: 8px;
    letter-spacing: 0.08em;
  }

  .de-entry-review-due.pending  { color: var(--sand); }
  .de-entry-review-due.overdue  { color: var(--red); }
  .de-entry-review-due.complete { color: var(--green); }

  .de-entry-outcome {
    font-family: 'DM Mono', monospace;
    font-size: 8px;
    padding: 2px 6px;
    border-radius: 1px;
  }

  .de-entry-outcome.correct  { background: var(--green-dim); color: var(--green); }
  .de-entry-outcome.partial  { background: rgba(193,125,60,0.12); color: var(--amber); }
  .de-entry-outcome.wrong    { background: rgba(192,80,74,0.1); color: var(--red); }

  .de-entry-del {
    position: absolute;
    top: 10px; right: 10px;
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.15s;
    padding: 2px 5px;
  }

  .de-entry:hover .de-entry-del { opacity: 1; }
  .de-entry-del:hover { color: var(--red); }

  /* Review modal */
  .de-review-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 500;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
  }

  .de-review-overlay.open { display: flex; }

  .de-review-window {
    background: var(--black);
    border: 1px solid var(--line);
    border-radius: 3px;
    width: min(520px, 90vw);
    padding: 28px 28px 24px;
    box-shadow: 0 0 40px rgba(0,0,0,0.5);
  }

  .de-review-window-title {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 4px;
  }

  .de-review-window-sub {
    font-family: 'DM Mono', monospace;
    font-size: 8px;
    color: var(--muted);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 20px;
  }

  .de-review-q {
    font-family: 'DM Mono', monospace;
    font-size: 8px;
    color: var(--muted);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 6px;
    display: block;
  }

  .de-outcome-btns {
    display: flex;
    gap: 8px;
    margin: 16px 0 20px;
  }

  .de-outcome-btn {
    flex: 1;
    background: none;
    border: 1px solid var(--line);
    color: var(--muted);
    font-family: 'DM Mono', monospace;
    font-size: 9px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 8px;
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.15s;
  }

  .de-outcome-btn[data-val="correct"]:hover,
  .de-outcome-btn[data-val="correct"].sel { border-color: var(--green); color: var(--green); background: var(--green-dim); }
  .de-outcome-btn[data-val="partial"]:hover,
  .de-outcome-btn[data-val="partial"].sel { border-color: var(--amber); color: var(--amber); background: var(--amber-dim); }
  .de-outcome-btn[data-val="wrong"]:hover,
  .de-outcome-btn[data-val="wrong"].sel   { border-color: var(--red); color: var(--red); background: rgba(192,80,74,0.1); }

  .de-review-submit {
    width: 100%;
    background: var(--amber);
    border: none;
    color: var(--black);
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    padding: 11px;
    border-radius: 2px;
    cursor: pointer;
    font-weight: 500;
    transition: opacity 0.15s;
    margin-top: 8px;
  }

  .de-review-submit:hover { opacity: 0.85; }

  @media (max-width: 700px) {
    .de-layout { grid-template-columns: 1fr; }
  }

  /* Core Directive button in topbar */
  .topbar-directive-btn {
    background: none;
    border: 1px solid rgba(193,125,60,0.3);
    color: var(--amber);
    font-family: 'DM Mono', monospace;
    font-size: 9px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 4px 10px;
    cursor: pointer;
    border-radius: 2px;
    transition: all 0.15s;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .topbar-directive-btn:hover {
    background: var(--amber-dim);
    border-color: var(--amber);
  }

  @media (max-width: 900px) {
    .grid-home { grid-template-columns: 1fr; }
    .span-2, .span-3 { grid-column: span 1; }
    .directive-body { grid-template-columns: 1fr; }
    .directive-section.full { grid-column: span 1; }
  }
