/* Accord Post — Landing */

/* Gate */
.gate {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: #f6f5f2;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity .4s, visibility .4s;
}
.gate-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.gate-box {
  text-align: center;
  max-width: 320px;
  width: 100%;
  padding: 0 20px;
}
.gate-title {
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.gate-sub {
  font-family: var(--font);
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}
.gate-input {
  width: 100%;
  padding: 10px 14px;
  font-family: var(--mono);
  font-size: 15px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: #fff;
  color: var(--text-primary);
  outline: none;
  box-sizing: border-box;
  transition: border-color .2s;
}
.gate-input:focus {
  border-color: var(--accent);
}
.gate-btn {
  width: 100%;
  margin-top: 12px;
  padding: 10px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--r);
  cursor: pointer;
  transition: background .2s;
}
.gate-btn:hover {
  background: var(--accent-hover);
}
.gate-error {
  margin-top: 12px;
  font-family: var(--font);
  font-size: 13px;
  color: var(--red);
  min-height: 18px;
}

:root {
  --bg: #f6f5f2;
  --bg-white: #fff;
  --surface-1: rgba(0, 55, 140, 0.03);
  --surface-2: rgba(0, 55, 140, 0.05);
  --surface-3: rgba(0, 55, 140, 0.08);
  --surface-4: rgba(0, 55, 140, 0.12);
  --border: rgba(0, 0, 0, 0.08);
  --border-hover: rgba(0, 0, 0, 0.15);
  --border-active: rgba(0, 0, 0, 0.22);
  --text-primary: #1a1a1f;
  --text-body: #3d3d44;
  --text-secondary: #6b6b73;
  --text-tertiary: #9b9ba3;
  --text-quaternary: #c4c4ca;
  --accent: #0055b8;
  --accent-hover: #004499;
  --accent-light: rgba(0, 85, 184, 0.06);
  --accent-surface: rgba(0, 85, 184, 0.04);
  --brand-red: #e1251b;
  --green: #1a8d3e;
  --yellow: #a67c00;
  --red: #d42b1e;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', 'Menlo', monospace;
  --r-sm: 4px;
  --r: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-pill: 100px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.08), 0 4px 8px rgba(0,0,0,0.04);
}

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

html, body {
  height: 100%;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-body);
  overflow: hidden;
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection { background: rgba(0, 85, 184, 0.15); color: var(--text-primary); }

/* =========== MOBILE =========== */
#mobile-banner {
  display: none;
  position: fixed; inset: 0;
  background: var(--bg); z-index: 9999;
  align-items: center; justify-content: center; text-align: center;
}
.mobile-inner h1 {
  font-size: 22px; font-weight: 600;
  letter-spacing: -0.03em; margin-bottom: 8px;
  color: var(--text-primary);
}
.mobile-inner p { color: var(--text-secondary); font-size: 14px; }
@media (max-width: 1199px) {
  #mobile-banner { display: flex; }
  #desktop, #boot-screen { display: none !important; }
}

/* =========== BOOT =========== */
#boot-screen {
  position: fixed; inset: 0;
  background: var(--bg); z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.3s ease;
}
#boot-screen.fade-out { opacity: 0; pointer-events: none; }

.boot-terminal {
  font-family: var(--mono); font-size: 12px;
  color: var(--text-tertiary); max-width: 440px; padding: 2rem;
  line-height: 2;
}
.boot-line { opacity: 0; transition: opacity 0.2s ease; }
.boot-line.visible { opacity: 1; }
.boot-company { color: var(--accent); font-style: italic; font-weight: 500; }
.boot-cursor { opacity: 0; animation: blink 1s step-end infinite; color: var(--text-tertiary); }
.boot-cursor.visible { opacity: 1; }
@keyframes blink { 50% { opacity: 0; } }

/* =========== DESKTOP =========== */
#desktop {
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 100vh; width: 100vw;
  background: var(--bg);
}
#desktop.hidden { display: none; }

/* =========== NAV =========== */
#topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  height: 52px;
  border-bottom: 1px solid var(--border);
  background: rgba(246, 245, 242, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: relative;
  z-index: 10;
}

.topbar-brand { display: flex; align-items: center; flex-shrink: 0; }
.brand-logo {
  height: 24px; width: auto; display: block;
  opacity: 0.9;
}

.tabs { display: flex; align-items: center; gap: 2px; }
.tab {
  font-family: var(--font); font-size: 13px; font-weight: 500;
  color: var(--text-secondary);
  background: none; border: none;
  padding: 0 14px; height: 52px;
  cursor: pointer;
  white-space: nowrap; position: relative;
  display: flex; align-items: center;
  transition: color 0.2s ease;
}
.tab:hover { color: var(--text-primary); }
.tab.active { color: var(--accent); }
.tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 14px; right: 14px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px 2px 0 0;
}
.tab.has-update::before {
  content: '';
  position: absolute; top: 12px; right: 6px;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--brand-red);
}
.tab:disabled, .tab.disabled { color: var(--text-quaternary); cursor: default; }
.topbar-right { display: none; }

/* =========== CONTENT =========== */
#content-area { overflow: hidden; position: relative; }

.tab-panel {
  display: none; position: absolute; inset: 0; overflow-y: auto;
}
.tab-panel.active { display: flex; flex-direction: column; }

#panel-dialog .panel-center {
  flex: 1; overflow-y: auto; padding-bottom: 8px;
}
#panel-dialog .panel-center::-webkit-scrollbar { width: 0; }
#panel-dialog { overflow: hidden; }
.tab-panel::-webkit-scrollbar { width: 0; }

.panel-center {
  width: 100%;
  margin: 0 auto;
  padding: 32px 40px;
}
.panel-narrow { max-width: 640px; }
.panel-wide { max-width: 1040px; }

/* =========== CHAT =========== */
#chat-messages {
  display: flex; flex-direction: column; gap: 2px;
}

.msg {
  max-width: 100%;
  font-size: 14.5px; line-height: 1.7;
  animation: fadeIn 0.15s ease;
  padding: 5px 0;
  color: var(--text-body);
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(2px); }
  to { opacity: 1; transform: translateY(0); }
}

.msg.brain { color: var(--text-body); }
.msg.user {
  color: var(--text-primary);
  padding: 12px 16px;
  margin: 6px 0;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
}
.msg.system {
  color: var(--text-quaternary);
  font-family: var(--mono); font-size: 11px;
  text-align: center; letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 20px 0 4px;
}

.msg em { color: var(--red); font-style: italic; font-weight: 400; }
.msg strong { font-weight: 600; color: var(--text-primary); }
.msg .dim { color: var(--text-secondary); }
.msg .text-red { color: var(--red); font-style: italic; font-weight: 400; }
.msg .highlight-green { color: var(--green); font-weight: 600; }

.msg ul { margin: 4px 0; padding-left: 0; list-style: none; }
.msg ul li {
  margin-bottom: 2px; position: relative; padding-left: 14px;
}
.msg ul li::before {
  content: '\2014';
  position: absolute; left: 0; top: 0;
  color: var(--text-tertiary);
  font-size: 12px;
}

.msg table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  margin: 8px 0; font-size: 13px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--r-md); overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.msg th, .msg td {
  padding: 8px 14px; text-align: left;
  border-bottom: 1px solid var(--border);
}
.msg th {
  font-weight: 500; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-tertiary);
  background: var(--surface-1);
}
.msg tr:last-child td { border-bottom: none; }

.typing-cursor {
  display: inline-block; width: 2px; height: 1em;
  background: var(--accent); margin-left: 1px;
  animation: blink 0.8s step-end infinite; vertical-align: text-bottom;
}

/* =========== INPUT BAR =========== */
#input-bar {
  position: sticky; bottom: 0;
  background: linear-gradient(to bottom, transparent, var(--bg) 40%);
  padding: 8px 0 16px;
  pointer-events: none;
}
#input-bar-inner {
  max-width: 640px; margin: 0 auto;
  padding: 0 40px; pointer-events: auto;
}

#input-placeholder {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-white);
  color: var(--text-quaternary); font-size: 13px;
  box-shadow: var(--shadow-sm);
}
#input-placeholder.hidden { display: none; }
#input-arrow {
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent);
  border-radius: 50%; font-size: 11px;
  color: #fff;
}

/* =========== CHOICES =========== */
#chat-choices {
  display: flex; flex-direction: column; gap: 6px;
  margin-bottom: 6px;
}
#chat-choices.hidden { display: none; }

.choice-btn {
  display: block; width: 100%;
  padding: 11px 16px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text-primary);
  font-size: 14px; font-weight: 400;
  font-family: var(--font);
  cursor: pointer; text-align: left;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.choice-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.choice-btn:active {
  background: var(--accent-hover);
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

/* =========== PROJECT =========== */
#project-timeline { display: flex; flex-direction: column; }
#project-empty.hidden { display: none; }

.step {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  animation: fadeIn 0.15s ease;
}
.step:last-child { border-bottom: none; }
.step-num {
  font-family: var(--mono); font-size: 12px; font-weight: 600;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r); flex-shrink: 0;
  margin-top: 1px;
}
.step.pending .step-num { color: var(--text-quaternary); background: var(--surface-1); }
.step.planned .step-num { color: var(--text-secondary); background: var(--surface-2); }
.step.draft .step-num { color: var(--text-quaternary); background: var(--surface-1); }
.step.active .step-num { color: #fff; background: var(--accent); box-shadow: 0 2px 8px rgba(0,85,184,0.3); }
.step.done .step-num { color: #fff; background: var(--green); }
.step-content { min-width: 0; flex: 1; }
.step-name { font-weight: 500; font-size: 14px; line-height: 1.4; color: var(--text-body); }
.step.active .step-name { color: var(--text-primary); font-weight: 600; }
.step.draft .step-name { color: var(--text-tertiary); }
.step-meta {
  font-size: 12px; color: var(--text-tertiary);
  margin-top: 2px; font-family: var(--mono);
}
.step-detail { font-size: 12px; color: var(--text-secondary); margin-top: 3px; }

/* =========== TEAM =========== */
#team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
}

.team-card {
  background: var(--bg-white);
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.team-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.team-card.status-problem {
  border-color: rgba(212, 43, 30, 0.2);
  background: rgba(212, 43, 30, 0.02);
}
.team-card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 2px;
}
.team-card-name {
  font-weight: 600; font-size: 14px; color: var(--text-primary);
  letter-spacing: -0.01em;
}
.team-card-dot {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
}
.team-card-dot.free { background: var(--green); }
.team-card-dot.busy { background: var(--yellow); }
.team-card-dot.problem { background: var(--red); }
.team-card-role {
  font-size: 12px; color: var(--text-tertiary);
  margin-bottom: 12px;
}
.team-card-task { font-size: 13px; margin-bottom: 12px; color: var(--text-secondary); }
.team-card-task span { color: var(--text-body); font-style: italic; }
.team-card-load {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; color: var(--text-tertiary);
  font-family: var(--mono); font-variant-numeric: tabular-nums;
}
.team-card-bar {
  flex: 1; height: 3px; background: var(--surface-2);
  border-radius: 2px; overflow: hidden;
}
.team-card-bar-fill {
  height: 100%; border-radius: 2px;
  transition: width 0.4s ease;
}

/* =========== TABLES =========== */
.panel-heading {
  font-size: 16px; font-weight: 600;
  letter-spacing: -0.025em;
  margin-bottom: 12px;
  color: var(--text-primary);
}
.panel-subheading {
  font-size: 11px; font-weight: 600;
  margin: 36px 0 10px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.data-table-wrap {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.data-table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  font-size: 13px;
}
.data-table th, .data-table td {
  padding: 11px 16px; text-align: left;
}
.data-table thead th {
  font-weight: 600; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-tertiary);
  background: var(--surface-1);
  border-bottom: 1px solid var(--border);
}
.data-table tbody tr + tr td {
  border-top: 1px solid var(--border);
}
.data-table thead + tbody tr:first-child td {
  border-top: none;
}
.data-table tr:hover td { background: var(--accent-surface); }
.data-table td { color: var(--text-secondary); }
.data-table td:first-child { color: var(--text-body); font-weight: 500; }

.load-cell {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; color: var(--text-secondary);
  font-family: var(--mono); font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.load-bar {
  display: inline-block; width: 56px; min-width: 56px; height: 4px;
  background: var(--surface-2);
  border-radius: 2px; position: relative; overflow: hidden;
  flex-shrink: 0;
}
.load-bar::after {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: var(--load); border-radius: 2px;
  background: var(--accent);
  transition: width 0.3s ease;
}

/* =========== FINANCE =========== */
.finance-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}
.finance-card {
  background: var(--bg-white);
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.finance-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-tertiary); margin-bottom: 6px; font-weight: 600;
}
.finance-value {
  font-size: 28px; font-weight: 600;
  letter-spacing: -0.03em; margin-bottom: 6px;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}
.finance-spent { color: var(--text-secondary); }
.finance-green { color: var(--green); }
.finance-sub { font-size: 11px; color: var(--text-tertiary); line-height: 1.4; }

/* =========== EMPTY =========== */
.empty-state {
  text-align: center; padding: 80px 20px;
}
.empty-icon {
  font-size: 28px; font-weight: 300;
  display: block; margin-bottom: 12px; color: var(--text-quaternary);
}
.empty-state p { font-size: 14px; color: var(--text-tertiary); }
.empty-state.hidden { display: none; }

/* =========== STATUS BAR =========== */
#team-panel {
  border-top: 1px solid var(--border);
  padding: 8px 28px;
  display: flex; align-items: center; overflow-x: auto;
  background: rgba(246, 245, 242, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
#team-panel::-webkit-scrollbar { height: 0; }

#team-members { display: flex; gap: 24px; flex: 1; }

.member { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.member-avatar { display: none; }
.member-info { display: flex; align-items: center; gap: 6px; }
.member-name {
  font-size: 12px; font-weight: 500;
  display: flex; align-items: center; gap: 5px; white-space: nowrap;
  color: var(--text-secondary);
}
.member-status-dot {
  width: 5px; height: 5px; border-radius: 50%; flex-shrink: 0;
}
.member-status-dot.free { background: var(--green); }
.member-status-dot.busy { background: var(--yellow); }
.member-status-dot.problem { background: var(--red); }
.member-task {
  font-size: 11px; color: var(--text-tertiary);
  white-space: nowrap; max-width: 130px;
  overflow: hidden; text-overflow: ellipsis;
}
.member-load { display: none; }

/* =========== NOTIFICATIONS =========== */
#notifications {
  position: fixed; top: 60px; right: 24px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 100; pointer-events: none;
}
.notification {
  padding: 12px 16px;
  font-size: 13px; font-weight: 500;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  animation: notifIn 0.2s cubic-bezier(0.4, 0, 0.2, 1), notifOut 0.2s ease 4s forwards;
  pointer-events: auto; max-width: 320px;
  box-shadow: var(--shadow-lg);
}
.notification.success { border-left: 3px solid var(--green); color: var(--green); }
.notification.error { border-left: 3px solid var(--red); color: var(--red); }
.notification::before { display: none; }
@keyframes notifIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes notifOut { to { opacity: 0; transform: translateY(-4px); } }

/* =========== RESULTS =========== */
.results-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 28px;
  margin: 8px 0;
  box-shadow: var(--shadow-sm);
}
.results-title {
  font-weight: 600; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.06em;
  margin-bottom: 16px; text-align: center;
  color: var(--text-tertiary);
}
.results-grid { display: flex; flex-direction: column; margin-bottom: 16px; }
.result-item {
  font-size: 14px; padding: 9px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}
.result-item:last-child { border-bottom: none; }
.result-item span { color: var(--text-body); font-weight: 500; }
.results-highlight {
  text-align: center; font-size: 28px; font-weight: 600;
  color: var(--accent); padding: 16px 0 6px;
  border-top: 1px solid var(--border);
  letter-spacing: -0.03em;
}
.results-compare {
  text-align: center; font-size: 12px;
  color: var(--text-tertiary);
  font-family: var(--mono);
}

/* =========== CTA =========== */
.cta-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 36px; text-align: center;
  box-shadow: var(--shadow-md);
}
.cta-title {
  font-size: 22px; font-weight: 600;
  margin-bottom: 8px; letter-spacing: -0.03em;
  color: var(--text-primary);
}
.cta-card p { margin-bottom: 6px; font-size: 14px; color: var(--text-secondary); line-height: 1.6; }
.cta-buttons { display: flex; gap: 8px; justify-content: center; margin-top: 20px; }
.cta-btn {
  display: inline-block; padding: 10px 24px;
  background: var(--accent); color: #fff;
  font-weight: 600; font-size: 14px; text-decoration: none;
  border-radius: var(--r-pill);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0,85,184,0.25);
}
.cta-btn:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 16px rgba(0,85,184,0.35);
  transform: translateY(-1px);
}
.cta-btn:active { transform: translateY(0); }
