/* assets/css/styles.css
   Guild.AI design system — light editorial bento.
   Warm off-white canvas, white cards with hard ink borders, one green accent. */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #f5f4f0;
  --surface:   #ffffff;
  --ink:       #111111;
  --ink-2:     #555555;
  --ink-3:     #777777;
  --ink-4:     #999999;
  --line:      #111111;
  --line-soft: #e2dfd8;
  --accent:    #22c55e;
  --accent-bg: rgba(34, 197, 94, 0.12);
  --danger:    #b91c1c;
  --danger-bg: #fef2f2;
  --danger-bd: #fecaca;
  --dark:      #111111;
  --dark-2:    #1a1a1a;
  --radius:    14px;
  --radius-sm: 10px;
  --radius-lg: 18px;
  --font:      'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono:      'JetBrains Mono', ui-monospace, 'SF Mono', monospace;
}

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100dvh;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea { font-family: inherit; color: inherit; font-size: 14px; }
textarea { resize: none; }
img, svg { display: block; max-width: 100%; }
ul, ol { list-style: none; }

/* ---------- App shell ---------- */

.app { max-width: 1200px; margin: 0 auto; padding: 16px; }

/* ---------- Topbar ---------- */

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 12px;
}

.brand-mark {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  background-image: url('../icons/logo.svg');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.top-links { display: flex; gap: 24px; align-items: center; }
.top-links a {
  font-size: 13.5px; font-weight: 500;
  letter-spacing: -0.01em; transition: opacity 0.15s;
}
.top-links a:hover { opacity: 0.6; }

.top-cta {
  background: var(--ink); color: #fff;
  padding: 8px 16px; border-radius: 8px; font-size: 13px;
}
.top-cta:hover { opacity: 0.85; }

@media (max-width: 640px) {
  .top-links a:not(.top-cta) { display: none; }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500;
  letter-spacing: -0.005em;
  transition: background 0.15s, opacity 0.15s, transform 0.1s;
  border: 1px solid transparent;
  white-space: nowrap;
  line-height: 1;
}
.btn:active { transform: translateY(1px); }

.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #333; }

.btn-light { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-light:hover { background: #f0efec; }

.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-block { width: 100%; }

/* ---------- Cards ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  position: relative;
  overflow: hidden;
}
.card-dark { background: var(--dark); color: #fff; border-color: var(--dark); }
.card-flush { padding: 0; }

/* ---------- Mono labels ---------- */

.kicker, .tag {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--ink-2);
  display: flex; align-items: center; gap: 10px;
}
.tag { text-transform: uppercase; margin-bottom: 20px; letter-spacing: 0.06em; }

/* ---------- Status dot ---------- */

.dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
  flex-shrink: 0;
}
.dot-pulse { animation: dot-pulse 1.6s ease-in-out infinite; }

/* ---------- Chip ---------- */

.chip {
  display: inline-flex; align-items: center;
  font-family: var(--mono); font-size: 11px;
  padding: 6px 10px; border-radius: 8px;
  background: var(--bg); border: 1px solid var(--line-soft);
  color: #333;
}
.chip-on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---------- Forms ---------- */

.field {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line);
  outline: none;
  transition: box-shadow 0.15s, border-color 0.15s;
}
.field::placeholder { color: var(--ink-3); }
.field:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.08); }
.field:disabled { opacity: 0.6; cursor: not-allowed; background: #fafaf7; }

.label {
  display: block; font-size: 12.5px; font-weight: 500;
  margin-bottom: 6px; color: var(--ink-2);
}
.hint { font-size: 11.5px; color: var(--ink-3); margin-top: 6px; }

/* ---------- Alerts ---------- */

.alert {
  padding: 10px 14px; border-radius: var(--radius-sm);
  font-size: 13px; line-height: 1.45;
}
.alert-error { background: var(--danger-bg); border: 1px solid var(--danger-bd); color: var(--danger); }
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d; }

/* ---------- Utilities ---------- */

.hidden { display: none !important; }

/* Panels (used by team.html tabs) */
.panel { display: none; }
.panel.is-active { display: block; }
.panel.is-active.panel-flex { display: flex; flex-direction: column; }

/* Scrollbar (subtle, matches warm canvas) */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: #d6d2c9; border-radius: 999px;
  border: 2px solid transparent; background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover { background: #b8b4aa; background-clip: content-box; }
/* ============================================================
   Spec renderer
   ============================================================ */

.spec-h2 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.035em;
  color: var(--ink);
  margin: 0 0 20px;
}

.spec-h3 {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin: 36px 0 14px;
  padding-top: 28px;
  border-top: 1px solid var(--line-soft);
}
.spec-h3:first-child { border-top: none; padding-top: 0; margin-top: 0; }

.spec-h4 {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  margin: 24px 0 10px;
}

.spec-h5 {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  margin: 20px 0 8px;
}

.spec-p {
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink-2);
  margin: 12px 0;
}

.spec-ul, .spec-ol {
  margin: 12px 0;
  padding-left: 22px;
}
.spec-ul { list-style: disc; }
.spec-ol { list-style: decimal; }

.spec-li {
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink-2);
  margin: 4px 0;
  padding-left: 4px;
}
.spec-li::marker { color: var(--ink-3); }

.spec-strong { color: var(--ink); font-weight: 600; }
.spec-em     { color: var(--ink-2); font-style: italic; }

.spec-code-inline {
  font-family: var(--mono);
  font-size: 12.5px;
  background: var(--bg);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  padding: 1px 6px;
  color: #7c3aed;
}

.spec-pre {
  margin: 16px 0;
  padding: 20px 22px;
  background: var(--ink);
  color: #e2e8f0;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.65;
}
.spec-pre code { color: inherit; }

.spec-quote {
  margin: 16px 0;
  padding: 8px 16px;
  border-left: 3px solid var(--ink);
  color: var(--ink-2);
  font-style: italic;
  font-size: 14px;
  line-height: 1.65;
}

.spec-empty {
  text-align: center;
  padding: 60px 24px;
  border: 1px dashed var(--line-soft);
  border-radius: var(--radius);
  background: var(--bg);
}
.spec-empty .dot { display: inline-block; margin-bottom: 14px; }
.spec-empty-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
}
.spec-empty-sub {
  font-size: 12.5px;
  color: var(--ink-3);
  margin: 8px auto 0;
  max-width: 420px;
  line-height: 1.6;
}

/* ============================================================
   Kanban board
   ============================================================ */

.kanban-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  height: 100%;
  min-height: 0;
}
@media (max-width: 900px) {
  .kanban-grid { grid-template-columns: 1fr; height: auto; }
}

.kanban-column {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.kanban-column.is-drag-over {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
}

.kanban-column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface);
}

.kanban-column-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.kanban-counter {
  font-family: var(--mono);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--bg);
  color: var(--ink-3);
  border: 1px solid var(--line-soft);
}

.kanban-column-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kanban-card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 12px;
  cursor: grab;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.kanban-card:hover {
  border-color: var(--line);
  box-shadow: 0 2px 10px rgba(17, 17, 17, 0.06);
}
.kanban-card:active { cursor: grabbing; }
.kanban-card.is-dragging { opacity: 0.4; }

.kanban-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.kanban-card-title {
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--ink);
  letter-spacing: -0.005em;
}

.kanban-badge {
  flex-shrink: 0;
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border-radius: 5px;
  border: 1px solid var(--line-soft);
  color: var(--ink-3);
  background: var(--bg);
}
.kanban-badge--frontend { color: #4338ca; background: #eef2ff; border-color: #c7d2fe; }
.kanban-badge--backend  { color: #15803d; background: #f0fdf4; border-color: #bbf7d0; }
.kanban-badge--designer { color: #a21caf; background: #fdf4ff; border-color: #f5dce0; }

.kanban-card-desc {
  font-size: 12px;
  line-height: 1.55;
  color: var(--ink-3);
  margin-top: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.kanban-card-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
}

.kanban-avatar {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  background: var(--ink);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 9px;
  font-weight: 600;
  flex-shrink: 0;
}

.kanban-owner {
  font-size: 11px;
  color: var(--ink-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* ============================================================
   Code editor
   ============================================================ */

.editor-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  height: 100%;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.editor-sidebar {
  border-right: 1px solid var(--line-soft);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.editor-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
}
.editor-sidebar-title {
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
}
.editor-icon-btn {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 5px;
  border: 1px solid var(--line-soft);
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  line-height: 1;
  transition: background 0.15s;
}
.editor-icon-btn:hover { background: #f0efec; }

.editor-tree {
  flex: 1;
  overflow-y: auto;
  padding: 6px;
  font-size: 12.5px;
}
.editor-tree-empty {
  padding: 12px;
  color: var(--ink-3);
  font-style: italic;
}
.editor-tree-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--ink-2);
  transition: background 0.12s, color 0.12s;
  overflow: hidden;
}
.editor-tree-item:hover { background: var(--surface); color: var(--ink); }
.editor-tree-item.is-active { background: var(--ink); color: #fff; }
.editor-tree-item.is-locked { opacity: 0.55; }
.editor-tree-icon { flex-shrink: 0; font-size: 11px; }
.editor-tree-name {
  font-family: var(--mono);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editor-main {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}

.editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--bg);
}
.editor-path {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.editor-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.editor-status {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
}
.editor-status.is-dirty { color: #d97706; }
.editor-status.is-locked { color: #b91c1c; }

.editor-canvas {
  flex: 1;
  min-height: 0;
}

.editor-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--ink-3);
  gap: 6px;
}
.editor-empty .muted { font-size: 12px; color: var(--ink-4, #b8b4aa); }

@media (max-width: 900px) {
  .editor-shell { grid-template-columns: 1fr; }
  .editor-sidebar { max-height: 160px; border-right: none; border-bottom: 1px solid var(--line-soft); }
}
/* ============================================================
   Kanban board — SortableJS driven
   ============================================================ */

.kanban-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  height: 100%;
  min-height: 0;
}
@media (max-width: 900px) {
  .kanban-grid { grid-template-columns: 1fr; height: auto; }
}

.kanban-column {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.kanban-column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface);
}

.kanban-column-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.kanban-counter {
  font-family: var(--mono);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--bg);
  color: var(--ink-3);
  border: 1px solid var(--line-soft);
}

.kanban-column-body {
  flex: 1;
  min-height: 60px;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kanban-card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 12px;
  cursor: grab;
  transition: border-color 0.15s, box-shadow 0.15s;
  user-select: none;
}
.kanban-card:hover {
  border-color: var(--line);
  box-shadow: 0 2px 10px rgba(17, 17, 17, 0.06);
}
.kanban-card:active { cursor: grabbing; }

.kanban-ghost {
  opacity: 0.35;
  background: var(--accent-bg);
  border: 1px dashed var(--accent) !important;
}
.kanban-chosen { cursor: grabbing; }
.kanban-drag  { opacity: 0.9; transform: rotate(1deg); }

.kanban-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.kanban-card-title {
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--ink);
  letter-spacing: -0.005em;
}
.kanban-badge {
  flex-shrink: 0;
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border-radius: 5px;
  border: 1px solid var(--line-soft);
  color: var(--ink-3);
  background: var(--bg);
}
.kanban-badge--frontend { color: #4338ca; background: #eef2ff; border-color: #c7d2fe; }
.kanban-badge--backend  { color: #15803d; background: #f0fdf4; border-color: #bbf7d0; }
.kanban-badge--designer { color: #a21caf; background: #fdf4ff; border-color: #f5dce0; }

.kanban-card-desc {
  font-size: 12px;
  line-height: 1.55;
  color: var(--ink-3);
  margin-top: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.kanban-card-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
}
.kanban-avatar {
  width: 22px; height: 22px;
  border-radius: 5px;
  background: var(--ink);
  color: #fff;
  display: grid; place-items: center;
  font-size: 9px; font-weight: 600;
  flex-shrink: 0;
}
.kanban-owner {
  font-size: 11px;
  color: var(--ink-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============================================================
   Editor
   ============================================================ */

.editor-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  height: 100%;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.editor-sidebar {
  border-right: 1px solid var(--line-soft);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.editor-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
}
.editor-sidebar-title {
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
}
.editor-sidebar-actions { display: flex; gap: 4px; }

.editor-icon-btn {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 5px;
  border: 1px solid var(--line-soft);
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  line-height: 1;
  transition: background 0.15s;
}
.editor-icon-btn:hover { background: #f0efec; }

.editor-tree {
  flex: 1;
  overflow-y: auto;
  padding: 6px 4px;
  font-size: 12.5px;
  user-select: none;
}

.editor-tree-node { display: block; }

.editor-tree-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 5px;
  cursor: pointer;
  color: var(--ink-2);
  transition: background 0.12s, color 0.12s;
  overflow: hidden;
  white-space: nowrap;
}
.editor-tree-row:hover { background: var(--surface); color: var(--ink); }
.editor-tree-row.is-active { background: var(--ink); color: #fff; }
.editor-tree-row.is-locked { opacity: 0.55; }
.editor-tree-row.is-folder { font-weight: 500; }

.editor-tree-chevron {
  display: inline-block;
  width: 10px;
  font-size: 9px;
  color: var(--ink-3);
  transition: transform 0.15s;
  flex-shrink: 0;
  text-align: center;
}
.editor-tree-row.is-expanded .editor-tree-chevron { transform: rotate(90deg); }
.editor-tree-icon { flex-shrink: 0; font-size: 12px; line-height: 1; }
.editor-tree-label {
  font-family: var(--mono);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.editor-tree-children { padding-left: 12px; }
.editor-tree-children.is-collapsed { display: none; }
.editor-tree-empty {
  padding: 12px;
  color: var(--ink-3);
  font-size: 12px;
  font-style: italic;
}

.editor-main {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}
.editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--bg);
}
.editor-path {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.editor-actions { display: flex; align-items: center; gap: 8px; }
.editor-status {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
}
.editor-status.is-dirty { color: #d97706; }
.editor-status.is-locked { color: #b91c1c; }

.editor-canvas { flex: 1; min-height: 0; }

.editor-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--ink-3);
  gap: 6px;
}
.editor-empty .muted { font-size: 12px; color: #b8b4aa; }

@media (max-width: 900px) {
  .editor-shell { grid-template-columns: 1fr; }
  .editor-sidebar { max-height: 160px; border-right: none; border-bottom: 1px solid var(--line-soft); }
}

/* ============================================================
   Modal
   ============================================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(17, 17, 17, 0.35);
  backdrop-filter: blur(3px);
  display: grid;
  place-items: center;
  padding: 16px;
  animation: fade-up 180ms ease both;
}

.modal-dialog {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: 0 20px 50px -12px rgba(17, 17, 17, 0.25);
}

.modal-title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 14px;
}

.modal-label {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  margin-bottom: 6px;
}

.modal-dialog .field { margin-bottom: 18px; }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ============================================================
   Context menu (editor right-click)
   ============================================================ */

.editor-context-menu {
  position: fixed;
  z-index: 200;
  min-width: 180px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(17, 17, 17, 0.14), 0 2px 6px rgba(17, 17, 17, 0.06);
  font-size: 12.5px;
}
.editor-context-menu button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 10px;
  border-radius: 5px;
  color: var(--ink-2);
  text-align: left;
  transition: background 0.1s, color 0.1s;
}
.editor-context-menu button:hover { background: var(--bg); color: var(--ink); }
.editor-context-menu button.danger { color: var(--danger); }
.editor-context-menu button.danger:hover { background: var(--danger-bg); }
.editor-context-menu-sep {
  height: 1px;
  background: var(--line-soft);
  margin: 4px 2px;
}
/* ============================================================
   MVP progress widget
   ============================================================ */

.mvp-widget {
  padding: 12px 12px 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--bg);
}

.mvp-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}

.mvp-label {
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
}

.mvp-percent {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.mvp-bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.08);
  overflow: hidden;
  margin-bottom: 8px;
}

.mvp-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--ink);
  border-radius: 999px;
  transition: width 500ms cubic-bezier(0.2, 0.7, 0.2, 1), background 300ms ease;
}
.mvp-bar-fill.is-mid  { background: #f59e0b; }
.mvp-bar-fill.is-high { background: var(--accent); }

.mvp-meta {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-3);
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* ============================================================
   Personal AI chat
   ============================================================ */

.personal-msg {
  display: flex;
  gap: 12px;
  width: 100%;
  animation: fade-up 300ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.personal-msg--user { flex-direction: row-reverse; }

.personal-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}
.personal-avatar--ai {
  background: var(--accent-bg);
  color: #15803d;
  border: 1px solid rgba(34, 197, 94, 0.4);
}
.personal-avatar--me {
  background: var(--ink);
  color: #fff;
}

.personal-msg-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: 78%;
}
.personal-msg--user .personal-msg-body { align-items: flex-end; }

.personal-msg-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-3);
  margin-bottom: 4px;
}
.personal-time { opacity: 0.7; }

.personal-bubble {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.55;
  word-wrap: break-word;
  white-space: pre-wrap;
}
.personal-bubble--ai {
  background: var(--bg);
  border: 1px solid var(--line-soft);
  color: var(--ink);
  border-top-left-radius: 3px;
}
.personal-bubble--me {
  background: var(--ink);
  color: #fff;
  border-top-right-radius: 3px;
}

.personal-thinking {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 14px;
}
.personal-thinking .thinking-dot {
  background: var(--accent);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  animation: thinking-pulse 1.2s ease-in-out infinite;
}
.personal-thinking .thinking-dot:nth-child(2) { animation-delay: 0.2s; }
.personal-thinking .thinking-dot:nth-child(3) { animation-delay: 0.4s; }

.personal-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  color: var(--ink-3);
}
.personal-empty-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 6px;
}
.personal-empty-sub {
  font-size: 12.5px;
  color: var(--ink-3);
  line-height: 1.6;
  max-width: 400px;
}
.personal-empty-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 20px;
  justify-content: center;
}
.personal-empty-suggestion {
  font-size: 12.5px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.personal-empty-suggestion:hover {
  background: var(--bg);
  border-color: var(--line);
  color: var(--ink);
}
/* ============================================================
   Resume modal
   ============================================================ */

.resume-dialog {
  max-width: 640px;
  max-height: 86dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.resume-body {
  flex: 1;
  min-height: 200px;
  overflow-y: auto;
  padding: 4px 2px;
}

.resume-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 4px;
}
.resume-loading .thinking-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: thinking-pulse 1.2s ease-in-out infinite;
}
.resume-loading .thinking-dot:nth-child(2) { animation-delay: 0.2s; }
.resume-loading .thinking-dot:nth-child(3) { animation-delay: 0.4s; }

.resume-error {
  padding: 40px 20px;
  text-align: center;
  color: var(--danger);
  font-size: 13.5px;
}

.resume-card {
  padding: 4px 2px;
}

.resume-headline {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin-bottom: 2px;
}

.resume-duration {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-3);
  margin-bottom: 16px;
}

.resume-summary {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-2);
  margin-bottom: 16px;
}

.resume-bullets {
  margin: 0 0 18px;
  padding-left: 20px;
  list-style: disc;
}
.resume-bullets li {
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--ink-2);
  margin: 4px 0;
}
.resume-bullets li::marker { color: var(--ink-3); }

.resume-stack-label {
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  margin-bottom: 8px;
}
.resume-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.resume-chip {
  font-family: var(--mono);
  font-size: 11.5px;
  padding: 4px 9px;
  border-radius: 6px;
  background: var(--bg);
  border: 1px solid var(--line-soft);
  color: var(--ink-2);
}
/* ============================================================
   Modal (used by auth, editor, resume)
   ============================================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(17, 17, 17, 0.35);
  backdrop-filter: blur(3px);
  display: grid;
  place-items: center;
  padding: 16px;
  animation: fade-up 180ms ease both;
}

.modal-dialog {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: 0 20px 50px -12px rgba(17, 17, 17, 0.25);
}

.modal-title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 14px;
}

.modal-label {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  margin-bottom: 6px;
}

.modal-dialog .field { margin-bottom: 18px; }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.alert {
  padding: 10px 14px; border-radius: var(--radius-sm);
  font-size: 13px; line-height: 1.45;
}
.alert-error { background: var(--danger-bg); border: 1px solid var(--danger-bd); color: var(--danger); }
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d; }
/* ============================================================
   Tab badges
   ============================================================ */

.tab-btn { position: relative; }

.tab-badge {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.tab-badge.hidden { display: none; }

.tab-btn.is-active .tab-badge {
  background: #fff;
  color: var(--ink);
}
/* ============================================================
   Chip (public pages)
   ============================================================ */

.chip {
  display: inline-flex; align-items: center;
  font-family: var(--mono); font-size: 11.5px;
  padding: 5px 10px; border-radius: 7px;
  background: var(--bg); border: 1px solid var(--line-soft);
  color: var(--ink-2);
}
