/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  min-height: 100vh;
}

/* ===== NAV ===== */
.knav-center-label {
  flex: 1;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}
.view-tabs {
  display: flex;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
}
.btn-mode {
  cursor: pointer;
  padding: 6px 14px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  transition: var(--t);
  white-space: nowrap;
}
.btn-mode:hover { color: var(--text); background: var(--surface2); }
.btn-mode.active { background: var(--surface3); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,0.4); }

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

/* ===== ARCHITECTURE ===== */
.arch-shell { max-width: 820px; margin: 0 auto; padding: 32px 24px 64px; display: flex; flex-direction: column; gap: 0; }
.arch-desc { font-size: 13px; color: var(--text-dim); line-height: 1.7; margin-bottom: 24px; }
.arch-desc strong { color: var(--text); }

.security-banner { display: flex; align-items: flex-start; gap: 14px; background: rgba(240,192,64,0.06); border: 1px solid rgba(240,192,64,0.3); border-radius: var(--radius-lg); padding: 16px 20px; margin-bottom: 20px; }
.sec-icon { font-size: 22px; flex-shrink: 0; margin-top: 2px; }
.sec-content { flex: 1; }
.sec-title { font-size: 14px; font-weight: 700; color: var(--gold); margin-bottom: 8px; }
.sec-badge { font-size: 10px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; background: rgba(240,192,64,0.15); color: var(--gold); border-radius: 999px; padding: 2px 8px; margin-left: 8px; vertical-align: middle; }
.sec-items { display: flex; flex-wrap: wrap; gap: 6px; }
.sec-item { font-size: 11px; padding: 3px 10px; background: rgba(240,192,64,0.08); border: 1px solid rgba(240,192,64,0.2); border-radius: 999px; color: var(--text-dim); }

.layer { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: border-color var(--t); }
.layer:hover { border-color: var(--border-glow); }
.layer.open { border-color: var(--border-glow); }
.layer-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; cursor: pointer; user-select: none; transition: background var(--t); }
.layer-header:hover { background: rgba(255,255,255,0.03); }
.layer-left { display: flex; align-items: center; gap: 12px; }
.layer-num { width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; font-family: var(--font-mono); background: var(--surface3); border: 1px solid var(--border); color: var(--text-dim); flex-shrink: 0; }
.layer-title { font-size: 14px; font-weight: 700; }
.layer-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.layer-chevron { font-size: 20px; color: var(--muted); transition: transform var(--t); line-height: 1; }
.layer.open .layer-chevron { transform: rotate(90deg); }
.layer-body { display: none; padding: 0 18px 16px; border-top: 1px solid var(--border); }
.layer.open .layer-body { display: block; padding-top: 14px; }

.layer-gateway .layer-num { background: rgba(78,158,255,0.15); border-color: rgba(78,158,255,0.3); color: var(--blue); }
.layer-policy  .layer-num { background: rgba(240,192,64,0.15); border-color: rgba(240,192,64,0.3); color: var(--gold); }
.layer-secrets .layer-num { background: rgba(240,192,64,0.15); border-color: rgba(240,192,64,0.3); color: var(--gold); }
.layer-agent   .layer-num { background: rgba(155,114,255,0.15); border-color: rgba(155,114,255,0.3); color: var(--purple); }
.layer-n8n     .layer-num { background: rgba(52,211,153,0.15); border-color: rgba(52,211,153,0.3); color: var(--green); }
.layer-temporal .layer-num { background: rgba(52,211,153,0.15); border-color: rgba(52,211,153,0.3); color: var(--green); }
.layer-systems .layer-num { background: rgba(45,212,192,0.15); border-color: rgba(45,212,192,0.3); color: var(--cyan); }

.layer-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.layer-half { margin-bottom: 0 !important; }

.channel-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.ch-card { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; text-align: center; transition: var(--t); }
.ch-card:hover { border-color: var(--border-glow); }
.ch-icon { font-size: 22px; margin-bottom: 6px; }
.ch-name { font-size: 12px; font-weight: 600; margin-bottom: 4px; }
.ch-desc { font-size: 10px; color: var(--muted); line-height: 1.4; }

.feature-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.feature-card { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; }
.feat-icon { font-size: 18px; margin-bottom: 6px; }
.feat-title { font-size: 12px; font-weight: 600; margin-bottom: 4px; }
.feat-desc { font-size: 11px; color: var(--muted); line-height: 1.5; }

.detail-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.detail-list li { font-size: 12px; color: var(--text-dim); line-height: 1.5; padding-left: 16px; position: relative; }
.detail-list li::before { content: '·'; position: absolute; left: 4px; color: var(--muted); }

.systems-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.sys-tag { font-size: 12px; padding: 5px 12px; background: var(--surface2); border: 1px solid var(--border); border-radius: 999px; color: var(--text-dim); }
.tip-box { font-size: 12px; color: var(--text-dim); background: rgba(78,158,255,0.06); border: 1px solid rgba(78,158,255,0.2); border-radius: var(--radius-sm); padding: 10px 12px; line-height: 1.55; margin-top: 10px; }
.tip-box strong { color: var(--text); }

.connector { display: flex; align-items: center; gap: 10px; padding: 6px 0; justify-content: center; }
.connector-line { width: 2px; height: 28px; background: linear-gradient(180deg, var(--border), var(--border-glow)); border-radius: 1px; }
.connector-label { font-size: 10px; color: var(--muted); font-family: var(--font-mono); background: var(--surface2); border: 1px solid var(--border); padding: 2px 8px; border-radius: 4px; }

/* ===== DEPLOYMENT ===== */
.deploy-shell { max-width: 900px; margin: 0 auto; padding: 32px 24px 64px; }
.view-title { font-size: 24px; font-weight: 800; letter-spacing: -0.03em; margin-bottom: 10px; }
.view-desc { font-size: 13px; color: var(--text-dim); line-height: 1.7; margin-bottom: 28px; }
.section-title { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.hw-banner { display: flex; align-items: flex-start; gap: 14px; background: rgba(52,211,153,0.06); border: 1px solid rgba(52,211,153,0.25); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 28px; }
.hw-icon { font-size: 22px; flex-shrink: 0; margin-top: 2px; }
.hw-title { font-size: 14px; font-weight: 700; color: var(--green); margin-bottom: 5px; }
.hw-detail { font-size: 12px; color: var(--text-dim); line-height: 1.6; }
.container-list { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.ct-row { display: grid; grid-template-columns: 160px 1fr 1fr; gap: 0; padding: 10px 16px; border-bottom: 1px solid var(--border); font-size: 12px; transition: background var(--t); }
.ct-row:last-child { border-bottom: none; }
.ct-row:hover:not(.header) { background: rgba(255,255,255,0.02); }
.ct-row.header { background: var(--surface2); font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.ct-name { color: var(--text); }
.ct-name.mono { font-family: var(--font-mono); color: var(--cyan); }
.ct-role { color: var(--text-dim); padding: 0 12px; }
.ct-notes { color: var(--muted); }
.cost-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.cost-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; transition: var(--t); }
.cost-card:hover { border-color: var(--border-glow); }
.cost-icon { font-size: 22px; margin-bottom: 8px; }
.cost-title { font-size: 13px; font-weight: 700; margin-bottom: 5px; }
.cost-desc { font-size: 12px; color: var(--muted); line-height: 1.55; }

/* ===== CHECKLIST ===== */
.checklist-shell { max-width: 720px; margin: 0 auto; padding: 32px 24px 64px; }
.cl-progress { height: 4px; background: var(--surface2); border-radius: 999px; overflow: hidden; margin-bottom: 8px; }
.cl-bar { height: 100%; background: linear-gradient(90deg, var(--cyan), var(--green)); border-radius: 999px; transition: width 0.4s cubic-bezier(0.4,0,0.2,1); width: 0%; }
.cl-count { font-size: 12px; color: var(--muted); margin-bottom: 24px; }
.checklist-groups { display: flex; flex-direction: column; gap: 20px; }
.cl-group { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.cl-group-title { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding: 12px 16px 10px; border-bottom: 1px solid var(--border); background: var(--surface2); }
.cl-items { display: flex; flex-direction: column; }
.cl-item { display: flex; align-items: flex-start; gap: 10px; padding: 11px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background var(--t); }
.cl-item:last-child { border-bottom: none; }
.cl-item:hover { background: rgba(255,255,255,0.025); }
.cl-item.done { opacity: 0.6; }
.cl-check { width: 18px; height: 18px; border-radius: 5px; border: 2px solid var(--border); flex-shrink: 0; margin-top: 1px; display: flex; align-items: center; justify-content: center; font-size: 11px; transition: var(--t); background: var(--surface2); }
.cl-item.done .cl-check { background: rgba(52,211,153,0.15); border-color: var(--green); color: var(--green); }
.cl-text { font-size: 13px; color: var(--text-dim); line-height: 1.5; flex: 1; }
.cl-item.done .cl-text { text-decoration: line-through; color: var(--muted); }

/* ===== MOBILE ===== */
@media (max-width: 768px) {
  .knav { flex-wrap: wrap; height: auto; padding: 8px 12px; gap: 8px; }
  .view-tabs { order: 3; }
  .knav-center-label { display: none; }
  .layer-row { grid-template-columns: 1fr; }
  .channel-grid, .feature-row { grid-template-columns: 1fr 1fr; }
  .ct-row { grid-template-columns: 1fr; }
  .ct-role, .ct-notes { padding: 0; margin-top: 2px; }
  .cost-grid { grid-template-columns: 1fr; }
}
