:root {
  --bg-black: #0e0e0e;
  --surface-graphite: #161616;
  --surface-elevated: #121212;
  --surface-card: #161616;
  --orange: #e3791d;
  --orange-hover: #f0892e;
  --orange-glow: rgba(227, 121, 29, 0.22);
  --orange-border: rgba(227, 121, 29, 0.45);
  --green: #004a2a;
  --green-bright: #10945c;
  --text-white: #f5f5f5;
  --text-soft: #b8b8b8;
  --text-steel: #707070;
  --border-neutral: rgba(245, 245, 245, 0.08);
  --border-line: rgba(245, 245, 245, 0.12);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --ease-main: cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-subtle: 0 2px 8px rgba(0, 0, 0, 0.28);
  --shadow-elevated: 0 6px 22px rgba(0, 0, 0, 0.48);
  --shadow-floating: 0 12px 42px rgba(0, 0, 0, 0.68);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background-color: var(--bg-black);
  background-image:
    radial-gradient(circle at 86% 6%, rgba(227, 121, 29, 0.08), transparent 28%),
    linear-gradient(135deg, rgba(0, 74, 42, 0.16), transparent 36%);
  color: var(--text-white);
  font-family: "Prompt", system-ui, -apple-system, sans-serif;
  line-height: 1.58;
  padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
}

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

code {
  font-family: "Sora", "Space Grotesk", monospace;
  font-size: 0.88em;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  background: rgba(245, 245, 245, 0.08);
  color: var(--orange);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.inline-ext-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 7px;
  margin: 0 2px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--orange-border);
  background: rgba(227, 121, 29, 0.12);
  color: #ffb878;
  font-family: "Sora", "Prompt", sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  text-decoration: none;
  vertical-align: baseline;
}

.inline-ext-link:hover {
  background: rgba(227, 121, 29, 0.24);
  color: var(--text-white);
}

.hidden {
  display: none !important;
}

/* TOPBAR */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(14, 14, 14, 0.94);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border-line);
}

.topbar-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

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

.logo-box {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  border: 1px solid var(--orange-border);
  background: #141414;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

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

.brand-titles {
  min-width: 0;
}

.brand-eyebrow {
  font-family: "Sora", sans-serif;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--orange);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.dot-sep {
  color: var(--text-steel);
}

.brand-titles h1 {
  margin: 2px 0 0;
  font-size: clamp(16px, 2vw, 21px);
  font-weight: 600;
  line-height: 1.25;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.sub-badge {
  font-family: "Sora", sans-serif;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-line);
  background: #1d1d1d;
  color: var(--text-soft);
  letter-spacing: 0.04em;
}

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

.conn-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-line);
  background: var(--surface-graphite);
  font-size: 12px;
  color: var(--text-soft);
  cursor: pointer;
}

.signal-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--orange);
  flex-shrink: 0;
}

.conn-pill.conn-live {
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(22, 22, 22, 0.95);
  color: #bbf7d0;
}

.conn-pill.conn-live .signal-dot {
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
}

.conn-pill.conn-staging {
  border-color: var(--orange-border);
  background: rgba(227, 121, 29, 0.1);
  color: #ffd8b5;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.25s var(--ease-main);
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.55;
  pointer-events: none;
}

.btn-sm {
  min-height: 34px;
  padding: 5px 12px;
  font-size: 13px;
}

.btn-primary {
  background: var(--orange);
  color: var(--text-white);
  border-color: var(--orange);
  font-weight: 600;
}

.btn-primary:hover {
  background: var(--orange-hover);
}

.btn-arrow {
  display: inline-block;
  transition: transform 0.25s var(--ease-main);
}

.btn:hover .btn-arrow {
  transform: translateX(4px);
}

.btn-secondary {
  background: transparent;
  color: var(--text-white);
  border: 1.5px solid var(--orange);
}

.btn-secondary:hover {
  background: rgba(227, 121, 29, 0.14);
}

.btn-ghost {
  background: #181818;
  color: var(--text-soft);
  border: 1px solid var(--border-line);
}

.btn-ghost:hover {
  color: var(--text-white);
  border-color: var(--orange-border);
}

/* MAIN LAYOUT */
.main-container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 20px 24px 48px;
}

/* CONNECTION ALERT BANNER */
.conn-banner {
  margin-bottom: 18px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--orange-border);
  background: #161616;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.conn-banner-content {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: 1 1 480px;
  min-width: 0;
}

.conn-banner-badge {
  font-family: "Sora", sans-serif;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  background: rgba(227, 121, 29, 0.18);
  color: var(--orange);
  border: 1px solid var(--orange-border);
  white-space: nowrap;
}

.conn-banner-text {
  min-width: 0;
}

.conn-banner-text strong {
  display: block;
  font-size: 14.5px;
  color: var(--text-white);
  margin-bottom: 4px;
}

.conn-banner-text p {
  margin: 0;
  font-size: 13px;
  color: var(--text-soft);
}

/* HERO SUMMARY & FOCUS */
.hero-summary {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr);
  gap: 18px;
  margin-bottom: 20px;
}

.focus-panel {
  padding: 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-line);
  background: var(--surface-card);
  box-shadow: var(--shadow-subtle);
  min-width: 0;
}

.focus-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.eyebrow {
  margin: 0 0 4px;
  font-family: "Sora", sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--orange);
  text-transform: uppercase;
}

.focus-head h2 {
  margin: 0;
  font-size: clamp(18px, 2.2vw, 22px);
  font-weight: 600;
}

.tech-timestamp {
  font-family: "Sora", sans-serif;
  font-size: 11.5px;
  color: var(--text-soft);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-neutral);
  background: #111111;
}

.focus-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.focus-mini-card {
  padding: 13px 15px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-line);
  border-left: 3px solid var(--orange);
  background: #111111;
  transition: all 0.25s var(--ease-main);
  cursor: pointer;
  min-width: 0;
  overflow: hidden;
}

.focus-mini-card:hover {
  transform: translateY(-2px);
  border-color: var(--orange-border);
}

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

.focus-mini-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-white);
  margin: 0 0 5px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.focus-mini-next {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-soft);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.kpi-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
}

.kpi-card {
  padding: 15px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-line);
  background: var(--surface-card);
  text-align: left;
  cursor: pointer;
  transition: all 0.25s var(--ease-main);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
}

.kpi-card:hover {
  transform: translateY(-2px);
  border-color: var(--orange-border);
}

.kpi-label {
  font-family: "Sora", sans-serif;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-soft);
  letter-spacing: 0.04em;
}

.kpi-val {
  font-family: "Sora", sans-serif;
  font-size: 30px;
  font-weight: 800;
  line-height: 1.1;
  margin: 6px 0 3px;
  color: var(--text-white);
}

.kpi-val.kpi-orange {
  color: var(--orange);
}

.kpi-val.kpi-green {
  color: #4ade80;
}

.kpi-sub {
  font-size: 12px;
  color: var(--text-steel);
}

/* VIEW SWITCHER TABS */
.view-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  padding: 7px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-line);
  background: var(--surface-card);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.view-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-soft);
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.22s var(--ease-main);
}

.view-tab:hover {
  color: var(--text-white);
  background: rgba(255, 255, 255, 0.04);
}

.view-tab.is-active {
  color: var(--text-white);
  border-color: var(--orange-border);
  background: rgba(227, 121, 29, 0.12);
}

.tab-idx {
  font-family: "Sora", sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: var(--orange);
}

.tab-count {
  font-family: "Sora", sans-serif;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-white);
}

.view-section {
  display: none;
}

.view-section.is-visible {
  display: block;
}

/* FILTER BAR */
.filter-bar {
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-line);
  background: var(--surface-card);
  margin-bottom: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.search-row-top {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
  max-width: 100%;
}

.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
}

.mobile-filter-toggle {
  display: none;
  flex-shrink: 0;
}

.search-icon {
  position: absolute;
  left: 14px;
  font-size: 18px;
  color: var(--text-steel);
  pointer-events: none;
}

.search-wrap input {
  width: 100%;
  height: 42px;
  padding: 0 38px 0 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-line);
  background: #101010;
  color: var(--text-white);
  font-size: 14.5px;
  min-width: 0;
}

.search-wrap input:focus {
  outline: none;
  border-color: var(--orange);
}

.btn-clear-search {
  position: absolute;
  right: 10px;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-soft);
  cursor: pointer;
}

.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
}

.filter-chip {
  padding: 6px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-line);
  background: #111111;
  color: var(--text-soft);
  font-size: 12.5px;
  max-width: 100%;
  white-space: normal;
  text-align: center;
  line-height: 1.3;
  cursor: pointer;
  transition: all 0.2s var(--ease-main);
}

.filter-chip:hover {
  color: var(--text-white);
  border-color: var(--orange-border);
}

.filter-chip.is-active {
  color: var(--text-white);
  border-color: var(--orange);
  background: rgba(227, 121, 29, 0.16);
  font-weight: 500;
}

.filter-selects-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.select-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.select-field span {
  font-family: "Sora", sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-soft);
  text-transform: uppercase;
}

.select-field select {
  width: 100%;
  height: 38px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-line);
  background: #101010;
  color: var(--text-white);
  font-size: 13px;
}

.select-field select:focus {
  outline: none;
  border-color: var(--orange);
}

/* TASK CARDS GRID — STRICT CONTAINMENT & NEUTRAL GRAPHITE BACKGROUND */
.tasks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr));
  gap: 16px;
}

.task-card {
  position: relative;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  padding: 18px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(245, 245, 245, 0.09);
  background: #161616;
  box-shadow: var(--shadow-subtle);
  transition: transform 0.25s var(--ease-main), border-color 0.25s var(--ease-main);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}

.task-card > div {
  min-width: 0;
  max-width: 100%;
}

.task-card:hover {
  transform: translateY(-2px);
  border-color: rgba(227, 121, 29, 0.35);
}

.task-card.card-muted {
  opacity: 0.72;
}

/* Card Header Badges */
.card-top-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.badge-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
  flex: 1 1 auto;
}

.tag {
  font-family: "Sora", sans-serif;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-line);
  background: #1f1f1f;
  color: var(--text-soft);
  letter-spacing: 0.02em;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Type Tags: Main vs Experiment vs Idea */
.tag-type-main {
  font-family: "Prompt", sans-serif;
  font-weight: 600;
  background: rgba(227, 121, 29, 0.14);
  border-color: rgba(227, 121, 29, 0.5);
  color: #ffb067;
}

.tag-type-exp {
  font-family: "Prompt", sans-serif;
  font-weight: 600;
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.45);
  color: #7dd3fc;
}

.tag-type-idea {
  font-family: "Prompt", sans-serif;
  font-weight: 600;
  background: rgba(250, 204, 21, 0.12);
  border-color: rgba(250, 204, 21, 0.45);
  color: #fde047;
}

.tag-category {
  color: var(--text-white);
  background: #222222;
  border-color: rgba(245, 245, 245, 0.18);
}

.tag-p0 {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.5);
  color: #fca5a5;
}

.tag-p1 {
  background: rgba(227, 121, 29, 0.12);
  border-color: rgba(227, 121, 29, 0.4);
  color: #f6ad6d;
}

.tag-p2 {
  background: #1e1e1e;
  color: var(--text-soft);
}

.status-badge {
  font-family: "Sora", sans-serif;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: #1f1f1f;
  border: 1px solid var(--border-line);
  color: var(--text-soft);
  white-space: nowrap;
}

.status-badge.status-DOING {
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.45);
  color: #6ee7b7;
}

.status-badge.status-TODO {
  background: #222222;
  border-color: rgba(245, 245, 245, 0.2);
  color: #d4d4d4;
}

.status-badge.status-WAITING {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.45);
  color: #fcd34d;
}

.status-badge.status-PAUSED {
  background: rgba(148, 163, 184, 0.14);
  border-color: rgba(148, 163, 184, 0.35);
  color: #cbd5e1;
}

.status-badge.status-CANCELLED,
.status-badge.status-DELETED {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.42);
  color: #fca5a5;
}

.status-badge.status-DONE {
  background: rgba(34, 197, 94, 0.16);
  border-color: rgba(34, 197, 94, 0.45);
  color: #86efac;
}

.btn-star {
  background: #111111;
  border: 1px solid var(--border-line);
  border-radius: var(--radius-sm);
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  font-size: 16px;
  cursor: pointer;
  color: var(--text-steel);
  transition: all 0.2s var(--ease-main);
  flex-shrink: 0;
}

.btn-star:hover {
  border-color: var(--orange);
  color: var(--orange);
}

.btn-star.is-starred {
  background: rgba(227, 121, 29, 0.16);
  border-color: var(--orange);
  color: #fbbf24;
}

.card-title {
  margin: 8px 0;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.38;
  color: var(--text-white);
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Progress & Next Action Boxes — Neutral Clean Surface & Overflow Safe */
.info-block {
  min-width: 0;
  max-width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-neutral);
  background: #111111;
  margin-bottom: 8px;
  overflow: hidden;
}

.info-block-next {
  border-left: 2px solid var(--orange);
  background: #111111;
}

.info-block-label {
  display: block;
  font-family: "Sora", sans-serif;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-soft);
  margin-bottom: 3px;
}

.info-block-next .info-block-label {
  color: var(--orange);
}

.info-block p {
  margin: 0;
  font-size: 13.5px;
  color: var(--text-white);
  white-space: pre-line;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Target Date Row */
.target-date-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-neutral);
  background: #111111;
  font-size: 12.5px;
  color: var(--text-soft);
}

.target-date-text {
  min-width: 0;
  flex: 1 1 auto;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.target-badge {
  font-family: "Sora", sans-serif;
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  background: #222222;
  color: var(--text-white);
  margin-right: 4px;
  white-space: nowrap;
}

/* Attributed Notes inside Card — Strictly Contained, Never Overflows */
.card-notes-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
  min-width: 0;
  max-width: 100%;
}

.note-bubble {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-neutral);
  background: #111111;
  font-size: 12.5px;
  color: var(--text-soft);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.note-author-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 3px;
  font-family: "Sora", sans-serif;
  font-size: 11px;
  font-weight: 700;
}

.role-woo .note-author-head {
  color: #c084fc;
}

.role-jin .note-author-head {
  color: #38bdf8;
}

.role-aek .note-author-head {
  color: var(--orange);
}

/* Card Footer Metadata & Balanced 2x2 Action Grid */
.card-footer {
  padding-top: 10px;
  border-top: 1px solid var(--border-neutral);
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.meta-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-steel);
  flex-wrap: wrap;
}

.author-tag {
  font-weight: 500;
  color: var(--text-soft);
}

.card-action-bar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.action-btn {
  min-width: 0;
  min-height: 36px;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-line);
  background: #111111;
  color: var(--text-soft);
  font-size: 12.5px;
  cursor: pointer;
  transition: all 0.2s var(--ease-main);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.action-btn-done.is-done {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.14);
  color: #a7f3d0;
}

@media (hover: hover) {
  .action-btn:hover {
    color: var(--text-white);
    border-color: var(--orange-border);
    background: #1c1c1c;
  }

  .action-btn-done:hover {
    border-color: #10b981;
    color: #a7f3d0;
  }

  .action-btn-danger:hover {
    border-color: #ef4444;
    color: #fecaca;
  }
}

/* Cancel Choice Options inside Modal */
.cancel-options-grid {
  display: grid;
  gap: 10px;
  margin: 12px 0;
}

.cancel-choice-btn {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-line);
  background: #101010;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s var(--ease-main);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.cancel-choice-btn:hover {
  border-color: var(--orange);
  background: #181818;
}

.cancel-choice-btn strong {
  font-size: 14px;
  color: var(--text-white);
}

.cancel-choice-btn small {
  font-size: 12.5px;
  color: var(--text-soft);
}

/* VIEW 02: WOO & JIN NOTES STREAM */
.section-header-bar {
  padding: 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-line);
  background: var(--surface-card);
  margin-bottom: 18px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.section-header-bar h3 {
  margin: 4px 0 6px;
  font-size: 20px;
}

.muted-text {
  margin: 0;
  color: var(--text-soft);
  font-size: 13.5px;
}

.author-filter-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.notes-two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.notes-column {
  min-width: 0;
}

.col-heading {
  margin: 0 0 12px;
  font-size: 15.5px;
  color: var(--text-white);
}

.notes-stream {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.stream-card {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-line);
  background: var(--surface-card);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.stream-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.stream-task-ref {
  font-weight: 600;
  color: var(--orange);
  font-size: 13.5px;
  overflow-wrap: anywhere;
}

/* SCHEMA & START_HERE TABLE */
.mapping-card {
  padding: 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-line);
  background: var(--surface-card);
  min-width: 0;
  overflow: hidden;
}

.mapping-card h4 {
  margin: 0 0 14px;
  font-size: 17px;
}

.table-responsive {
  overflow-x: auto;
}

.schema-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.schema-table th,
.schema-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-neutral);
  text-align: left;
  vertical-align: top;
}

.schema-table th {
  font-family: "Sora", sans-serif;
  font-size: 11.5px;
  color: var(--orange);
  text-transform: uppercase;
  background: #121212;
}

.start-here-list {
  display: grid;
  gap: 10px;
}

.start-here-item {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-neutral);
  background: #111111;
  overflow-wrap: anywhere;
}

.start-here-topic {
  font-weight: 600;
  color: var(--orange);
}

/* ARCHIVE LIST */
.archive-list {
  display: grid;
  gap: 10px;
}

.archive-row-card {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-line);
  background: var(--surface-card);
  display: grid;
  grid-template-columns: 130px minmax(0, 1.2fr) minmax(0, 1.5fr) 140px;
  gap: 12px;
  align-items: center;
  min-width: 0;
  overflow-wrap: anywhere;
}

/* MODALS */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  width: 100%;
  max-width: 100vw;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-x: hidden;
  overflow-y: auto;
}

.modal-panel {
  width: min(700px, 100%);
  max-width: 100%;
  max-height: 90vh;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 22px;
  border-radius: var(--radius-md);
  border: 1px solid var(--orange-border);
  background: #151515;
  box-shadow: var(--shadow-floating);
  box-sizing: border-box;
}

.modal-panel.modal-sm {
  width: min(500px, 100%);
  max-width: 100%;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-line);
  margin-bottom: 16px;
  min-width: 0;
}

.modal-header > div {
  min-width: 0;
  flex: 1 1 auto;
}

.modal-header h3 {
  margin: 2px 0 0;
  font-size: 18px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.modal-body-content {
  min-width: 0;
  max-width: 100%;
}

.btn-icon-close {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-line);
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  flex-shrink: 0;
}

.modal-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
  max-width: 100%;
}

.form-row {
  display: grid;
  gap: 12px;
}

.form-row.two-cols {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-row.three-cols {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.form-field > span {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-soft);
}

.form-field input[type="text"],
.form-field input[type="url"],
.form-field input[type="date"],
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-line);
  background: #0c0c0c;
  color: var(--text-white);
  font-size: 14px;
}

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

.date-combo {
  display: grid;
  grid-template-columns: 145px minmax(0, 1fr);
  gap: 8px;
}

.star-toggle-box {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 39px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-line);
  background: #0c0c0c;
  cursor: pointer;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--border-line);
}

.conn-steps {
  margin: 10px 0;
  padding-left: 20px;
  color: var(--text-soft);
  font-size: 13.5px;
  display: grid;
  gap: 8px;
}

/* TOAST */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100;
  display: grid;
  gap: 10px;
  max-width: min(380px, calc(100vw - 32px));
}

.toast {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--orange-border);
  background: #161616;
  color: var(--text-white);
  box-shadow: var(--shadow-elevated);
  font-size: 13.5px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.toast.toast-success {
  border-color: #10b981;
  background: #12211a;
}

.toast.toast-error {
  border-color: #ef4444;
  background: #241313;
  color: #fecaca;
}

/* MOBILE BOTTOM BAR */
.mobile-bottom-bar {
  display: none;
}

/* TABLET & MOBILE APP OPTIMIZATIONS */
@media (max-width: 1024px) {
  .hero-summary {
    grid-template-columns: 1fr;
  }
  .filter-selects-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .notes-two-col {
    grid-template-columns: 1fr;
  }
  .archive-row-card {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}

@media (max-width: 680px) {
  .main-container {
    padding: 12px 10px calc(92px + env(safe-area-inset-bottom, 0px));
    max-width: 100vw;
    overflow-x: hidden;
  }
  .topbar-inner {
    padding: 10px 12px;
    gap: 8px;
  }
  .brand-eyebrow {
    display: none;
  }
  .brand-titles h1 {
    font-size: 15.5px;
  }
  #linkOpenGoogleSheet,
  #btnOpenAddModal {
    display: none;
  }
  .focus-panel {
    padding: 13px;
  }
  .focus-cards-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .kpi-panel {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }
  .kpi-card {
    padding: 10px 6px;
    text-align: center;
    align-items: center;
  }
  .kpi-label {
    font-size: 9px;
  }
  .kpi-val {
    font-size: 20px;
    margin: 2px 0;
  }
  .kpi-sub {
    display: none;
  }
  .view-tabs {
    display: none;
  }
  .filter-bar {
    padding: 12px;
    gap: 10px;
    grid-template-columns: minmax(0, 1fr);
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
  }
  .mobile-filter-toggle {
    display: inline-flex;
    height: 42px;
    padding: 0 10px;
    font-size: 12.5px;
  }
  .pill-group {
    flex-wrap: wrap;
    overflow-x: hidden;
    gap: 6px;
    min-width: 0;
    max-width: 100%;
  }
  .filter-chip {
    padding: 6px 10px;
    font-size: 12px;
    flex: 0 1 auto;
    max-width: 100%;
  }
  .filter-selects-row {
    display: none;
    grid-template-columns: 1fr;
    gap: 8px;
    padding-top: 6px;
    border-top: 1px solid var(--border-neutral);
  }
  .filter-selects-row.is-open-mobile {
    display: grid;
  }
  .tasks-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .task-card {
    padding: 14px;
  }
  .form-row.two-cols,
  .form-row.three-cols,
  .date-combo,
  .start-here-item {
    grid-template-columns: 1fr;
  }
  .modal-backdrop {
    align-items: center;
    justify-content: center;
    padding: 10px;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }
  .modal-panel,
  .modal-panel.modal-sm {
    width: 100%;
    max-width: calc(100vw - 20px);
    max-height: 86vh;
    border-radius: 12px;
    padding: 16px 14px;
    overflow-x: hidden;
    box-sizing: border-box;
  }
  .modal-header h3 {
    font-size: 16px;
  }
  .modal-footer {
    flex-wrap: wrap;
  }
  .modal-footer .btn {
    flex: 1 1 auto;
    min-width: 0;
  }
  .form-field input[type="text"],
  .form-field input[type="url"],
  .form-field input[type="date"],
  .form-field select,
  .form-field textarea,
  .search-wrap input {
    font-size: 16px;
  }
  .toast-container {
    bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    right: 12px;
    left: 12px;
    max-width: none;
  }
  .mobile-bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background: rgba(14, 14, 14, 0.97);
    backdrop-filter: blur(18px);
    border-top: 1px solid var(--border-line);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
  }
  .mob-nav-btn {
    min-height: 46px;
    padding: 4px 2px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-soft);
    font-size: 10.5px;
    font-weight: 500;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    cursor: pointer;
  }
  .mob-nav-icon {
    font-size: 15px;
    line-height: 1;
  }
  .mob-nav-btn.is-active {
    border-color: var(--orange-border);
    color: var(--text-white);
    background: rgba(227, 121, 29, 0.14);
  }
  .mob-add-btn {
    background: var(--orange);
    border-color: var(--orange);
    color: var(--text-white);
    font-weight: 600;
  }
}
