/* Laravel Architect — static single-page styles */

:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --link: #1d4ed8;
  --success: #047857;
  --warn: #b45309;
  --error: #dc2626;
  --brand: #ef3b2d;
  --header-h: 52px;
  --sidebar-w: 250px;
}

[data-theme="dark"] {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-2: #0b1220;
  --border: #334155;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --primary: #60a5fa;
  --primary-hover: #93c5fd;
  --link: #93c5fd;
  --success: #34d399;
  --warn: #fbbf24;
  --error: #f87171;
  --brand: #f87171;
}

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

html { color-scheme: light; }
html[data-theme="dark"] { color-scheme: dark; }

html, body {
  margin: 0;
  height: 100%;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
}

/* Header */
.header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 0.75rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  flex-wrap: wrap;
}
.header__brand { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
.header__title { font-size: 1rem; font-weight: 700; margin: 0; white-space: nowrap; }
.header__badge {
  font-size: 0.6rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--brand); border: 1px solid color-mix(in srgb, var(--brand) 45%, var(--border));
  border-radius: 999px; padding: 0.05rem 0.4rem; margin-left: 0.1rem;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  flex: 1;
  align-items: center;
  justify-content: flex-end;
}

.export-menu { position: relative; }
.export-menu__pop {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 50;
  min-width: 200px; padding: 0.45rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 12px 32px rgba(0,0,0,0.14);
}
.export-menu__group { display: flex; align-items: center; gap: 0.35rem; padding: 0.25rem 0.15rem; }
.export-menu__group + .export-menu__group { border-top: 1px solid var(--border); margin-top: 0.25rem; padding-top: 0.45rem; }
.export-menu__label { flex: 1; font-size: 0.72rem; font-weight: 600; color: var(--muted); }
.export-menu__item {
  font-size: 0.72rem; font-weight: 600; padding: 0.2rem 0.55rem;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface-2); color: var(--text); cursor: pointer;
}
.export-menu__item:hover { border-color: var(--primary); color: var(--primary); }

/* Buttons */
.btn {
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s, border-color 0.15s;
}
.btn:hover { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, var(--surface)); }
.btn--primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn--primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn--ghost { background: transparent; }
.btn--sm { padding: 0.2rem 0.5rem; font-size: 0.72rem; }
.btn--brand { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn--brand:hover { background: color-mix(in srgb, var(--brand) 85%, #000); border-color: transparent; }

.btn--icon { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.35rem 0.55rem; }
.btn--icon .btn__icon { display: inline-flex; width: 16px; height: 16px; flex-shrink: 0; }
.btn--icon .btn__icon svg { width: 16px; height: 16px; }
.btn--icon .btn__label { font-size: 0.8rem; }

.btn-icon {
  background: none;
  border: 1px solid transparent;
  cursor: pointer;
  color: var(--muted);
  padding: 0.3rem 0.45rem;
  border-radius: 6px;
  display: inline-flex;
}
.btn-icon:hover { color: var(--primary); background: color-mix(in srgb, var(--primary) 8%, transparent); }
.btn-icon svg { width: 16px; height: 16px; display: block; }

.select, .input {
  padding: 0.35rem 0.55rem;
  font-size: 0.8rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
}
.select { cursor: pointer; }

/* Workspace */
.workspace {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* Sidebar (left) */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.project-meta {
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.project-meta__name {
  font-size: 0.9rem; font-weight: 700; margin: 0 0 0.35rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.project-meta__row { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.pill {
  font-size: 0.66rem; font-weight: 600;
  padding: 0.1rem 0.45rem; border-radius: 999px;
  background: var(--surface-2); color: var(--muted);
  border: 1px solid var(--border);
}
.pill--brand { color: var(--brand); border-color: color-mix(in srgb, var(--brand) 40%, var(--border)); }

.sidebar__head {
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted); padding: 0.75rem 0.85rem 0.35rem;
}
.type-list { overflow: auto; padding: 0 0.5rem 0.5rem; flex: 1; }

.type-item {
  display: flex; align-items: center; gap: 0.55rem;
  width: 100%; text-align: left;
  padding: 0.4rem 0.5rem;
  border: 1px solid transparent;
  border-radius: 8px;
  background: none; color: var(--text);
  cursor: pointer; font-size: 0.82rem;
}
.type-item:hover { background: var(--surface-2); }
.type-item.is-active {
  background: color-mix(in srgb, var(--primary) 12%, var(--surface));
  border-color: color-mix(in srgb, var(--primary) 40%, var(--border));
  font-weight: 600;
}
.type-item__dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; background: var(--tc, var(--primary)); }
.type-item__icon { width: 16px; height: 16px; color: var(--tc, var(--muted)); flex-shrink: 0; }
.type-item__icon svg { width: 16px; height: 16px; display: block; }
.type-item__label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.type-item__count {
  font-size: 0.7rem; font-variant-numeric: tabular-nums; color: var(--muted);
  background: var(--surface-2); border-radius: 999px; padding: 0.02rem 0.4rem; min-width: 1.5rem; text-align: center;
}

/* Canvas (right) */
.canvas {
  display: flex; flex-direction: column;
  flex: 1; min-width: 0; min-height: 0;
}

.canvas__toolbar {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0; flex-wrap: wrap;
}
.search-wrap { position: relative; flex: 1; min-width: 180px; max-width: 420px; }
.search-wrap .input { width: 100%; padding-left: 2rem; }
.search-wrap .search-icon {
  position: absolute; left: 0.55rem; top: 50%; transform: translateY(-50%);
  width: 15px; height: 15px; color: var(--muted); pointer-events: none;
}
.search-wrap .search-icon svg { width: 15px; height: 15px; display: block; }
.canvas__toolbar-info { font-size: 0.75rem; color: var(--muted); margin-left: auto; }

.canvas__scroll { flex: 1; min-height: 0; overflow: auto; padding: 1rem; }

/* View toggle (Diagram / Cards) */
.view-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.view-toggle .btn { border: 0; border-radius: 0; background: var(--surface); }
.view-toggle .btn + .btn { border-left: 1px solid var(--border); }
.view-toggle .btn.is-active { background: color-mix(in srgb, var(--primary) 14%, var(--surface)); color: var(--primary); font-weight: 600; }

/* Canvas content area holds either cards or diagram */
.canvas__content { position: relative; flex: 1; min-height: 0; }
.cards-view { position: absolute; inset: 0; overflow: auto; padding: 1rem; }
.graph-view { position: absolute; inset: 0; display: flex; min-height: 0; }
.graph-view[hidden], .cards-view[hidden] { display: none; }

/* Diagram: side panel */
.graph-side {
  width: 258px; flex-shrink: 0; border-right: 1px solid var(--border);
  background: var(--surface); overflow: auto; display: flex; flex-direction: column;
}
.graph-side.is-collapsed { width: 0; border-right: 0; overflow: hidden; }
.graph-side__sec { padding: 0.7rem 0.85rem; border-bottom: 1px solid var(--border); }
.graph-side__title {
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted); margin: 0 0 0.5rem;
}

.graph-legend { display: flex; flex-direction: column; gap: 0.3rem; }
.leg { display: flex; align-items: center; gap: 0.45rem; font-size: 0.74rem; color: var(--muted); }
.leg__line { width: 16px; height: 3px; border-radius: 2px; flex-shrink: 0; }

.graph-filters { display: flex; flex-direction: column; gap: 0.15rem; }
.gfilter { display: flex; align-items: center; gap: 0.45rem; font-size: 0.78rem; cursor: pointer; padding: 0.15rem 0; }
.gfilter input { accent-color: var(--primary); }
.gfilter__dot { width: 9px; height: 9px; border-radius: 3px; flex-shrink: 0; }
.gfilter__dot--line { width: 14px; height: 2px; border-radius: 2px; background: var(--muted); }
.gfilter__n { margin-left: auto; font-size: 0.68rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.gfilter--sub { padding-bottom: 0.45rem; margin-bottom: 0.45rem; border-bottom: 1px dashed var(--border); }
.gfilter--column { flex-direction: column; align-items: stretch; gap: 0.3rem; cursor: default; }
.input--mini { padding: 0.26rem 0.45rem; font-size: 0.72rem; }

.graph-edge-detail { font-size: 0.74rem; color: var(--muted); line-height: 1.4; }
.edge-detail__head { font-weight: 700; color: var(--text); margin-bottom: 0.25rem; }
.edge-detail__row { margin-bottom: 0.25rem; }
.edge-detail__muted { color: var(--muted); font-size: 0.7rem; }
.edge-detail__clear { margin-top: 0.3rem; padding: 0.2rem 0.45rem; font-size: 0.68rem; }

/* Insights */
.insights__summary { display: flex; gap: 0.35rem; flex-wrap: wrap; margin-bottom: 0.6rem; }
.ins-pill { font-size: 0.66rem; font-weight: 700; padding: 0.1rem 0.45rem; border-radius: 999px; }
.ins-pill--err { color: var(--error); background: color-mix(in srgb, var(--error) 14%, transparent); }
.ins-pill--warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 16%, transparent); }
.ins-pill--info { color: var(--muted); background: var(--surface-2); }
.ins-reset {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.08rem 0.42rem;
  cursor: pointer;
}
.ins-reset:hover { border-color: var(--primary); color: var(--primary); }
.ins-prof { margin-left: auto; display: inline-flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.ins-prof__btn {
  border: 0; background: var(--surface); color: var(--muted);
  font-size: 0.64rem; font-weight: 700; padding: 0.12rem 0.45rem; cursor: pointer;
}
.ins-prof__btn + .ins-prof__btn { border-left: 1px solid var(--border); }
.ins-prof__btn.is-active { color: #fff; background: var(--primary); }
.insights__list { display: flex; flex-direction: column; gap: 0.35rem; }
.insights__ok { display: flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; color: var(--success); }
.insights__ok svg { width: 18px; height: 18px; }
.ins-item {
  display: flex; align-items: flex-start; gap: 0.45rem; text-align: left; flex-wrap: wrap;
  padding: 0.4rem 0.5rem; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text); cursor: pointer; font-size: 0.75rem; line-height: 1.35;
}
.ins-item:hover { border-color: var(--primary); }
.ins-item__ic { width: 15px; height: 15px; flex-shrink: 0; margin-top: 1px; }
.ins-item__ic svg { width: 15px; height: 15px; display: block; }
.ins-item__tx { flex: 1 1 220px; min-width: 0; }
.ins-item__meta {
  display: inline-flex; align-items: center; gap: 0.35rem;
  margin-left: auto; flex-shrink: 0;
}
.ins-conf {
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  border-radius: 999px;
  padding: 0.08rem 0.34rem;
}
.ins-conf--high { color: var(--error); background: color-mix(in srgb, var(--error) 12%, transparent); }
.ins-conf--medium { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.ins-conf--low { color: var(--muted); background: var(--surface-2); }
.ins-ignore {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.08rem 0.34rem;
}
.ins-copy {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.08rem 0.34rem;
}
.ins-copy:hover { color: var(--primary); border-color: var(--primary); }
.ins-ignore:hover { color: var(--primary); border-color: var(--primary); }
.ins-item--error .ins-item__ic { color: var(--error); }
.ins-item--warn .ins-item__ic { color: var(--warn); }
.ins-item--info .ins-item__ic { color: var(--muted); }
@media (max-width: 520px) {
  .ins-item__meta {
    width: 100%;
    margin-left: 1.6rem;
    justify-content: flex-end;
    flex-wrap: wrap;
  }
}

/* Diagram: stage */
.graph-stage-wrap {
  flex: 1; min-width: 0; position: relative; overflow: hidden;
  background-color: var(--surface-2);
  background-image:
    radial-gradient(circle, color-mix(in srgb, var(--border) 70%, transparent) 1px, transparent 1px);
  background-size: 22px 22px;
}
.graph-svg { width: 100%; height: 100%; cursor: grab; display: block; }
.graph-svg.is-grabbing { cursor: grabbing; }

.graph-controls {
  position: absolute; right: 0.75rem; bottom: 0.75rem;
  display: flex; flex-direction: column; gap: 0.35rem; z-index: 5;
}
.graph-controls .btn-icon {
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0,0,0,0.12); color: var(--text);
}
.graph-controls .btn-icon:hover { color: var(--primary); border-color: var(--primary); }

.graph-hint {
  position: absolute; left: 0.75rem; top: 0.75rem; z-index: 5;
  font-size: 0.72rem; color: var(--muted);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border: 1px solid var(--border); border-radius: 8px; padding: 0.3rem 0.55rem;
  pointer-events: none;
}

/* SVG nodes & edges */
.gnode { cursor: grab; }
.gnode:active { cursor: grabbing; }
.gnode__bg { fill: var(--surface); stroke-width: 1.5; transition: opacity 0.15s; }
.gnode__stripe { opacity: 0.9; }
.gnode__title { fill: var(--text); font-size: 12.5px; font-weight: 700; font-family: system-ui, sans-serif; }
.gnode__title--on { fill: #fff; }
.gnode__sub { fill: var(--muted); font-size: 10.5px; font-family: ui-monospace, Menlo, monospace; }
.gnode__sub--on { fill: rgba(255, 255, 255, 0.88); }
.gnode__field { fill: var(--muted); font-size: 11px; font-family: ui-monospace, Menlo, monospace; }
.gnode__method { font-size: 10px; font-weight: 800; font-family: ui-monospace, Menlo, monospace; }
.gnode:hover .gnode__bg { stroke-width: 2.2; }
.gnode.is-sel .gnode__bg { stroke-width: 2.6; filter: drop-shadow(0 3px 8px rgba(0,0,0,0.18)); }
.gnode.is-dim { opacity: 0.16; }

.gedge { fill: none; stroke-width: 1.5; opacity: 0.55; transition: opacity 0.15s; }
.gedge--rel { stroke-width: 1.7; opacity: 0.75; }
.gedge--use { stroke-dasharray: 4 4; opacity: 0.85; }
.gedge.is-hi { opacity: 1; stroke-width: 2.4; }
.gedge.is-dim { opacity: 0.05; }
.gedge-hit { fill: none; stroke: transparent; stroke-width: 14; }

/* Crow's-foot markers */
.co-line { fill: none; stroke: #2563eb; stroke-width: 1.7; }
.co-circle { fill: var(--surface); stroke: #2563eb; stroke-width: 1.7; }

/* Relationship detail tip */
.graph-tip {
  position: absolute; z-index: 8; max-width: 300px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 12px 30px rgba(0,0,0,0.25);
  padding: 0.6rem 0.7rem; font-size: 0.78rem;
}
.graph-tip[hidden] { display: none; }
.graph-edge-tip {
  position: absolute; z-index: 9; max-width: 340px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; box-shadow: 0 10px 24px rgba(0,0,0,0.22);
  padding: 0.35rem 0.5rem; font-size: 0.72rem; line-height: 1.35;
  pointer-events: none;
}
.graph-edge-tip[hidden] { display: none; }
.edge-tip__via { color: var(--muted); }
.tip-head { display: flex; align-items: center; gap: 0.4rem; margin-bottom: 0.4rem; }
.tip-card { color: var(--primary); font-weight: 700; font-family: ui-monospace, Menlo, monospace; letter-spacing: -1px; }
.tip-close { margin-left: auto; background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0; display: inline-flex; }
.tip-close svg { width: 15px; height: 15px; }
.tip-sentence { color: var(--muted); line-height: 1.4; margin-bottom: 0.45rem; }
.tip-rels { display: flex; flex-direction: column; gap: 0.25rem; }
.tip-rel { line-height: 1.35; }
.tip-rel__t { font-size: 0.62rem; font-weight: 700; color: #fff; background: var(--primary); border-radius: 5px; padding: 0.05rem 0.35rem; }
.tip-rel code { font-family: ui-monospace, Menlo, monospace; font-size: 0.72rem; }

/* Legend notation */
.leg__sym { display: inline-flex; width: 22px; justify-content: center; font-family: ui-monospace, Menlo, monospace; color: var(--primary); font-weight: 700; }
.leg-note { margin-top: 0.5rem; padding-top: 0.5rem; border-top: 1px dashed var(--border); display: flex; flex-direction: column; gap: 0.3rem; }

/* Overview stats */
.overview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}
.stat {
  border: 1px solid var(--border);
  border-left: 3px solid var(--sc, var(--primary));
  border-radius: 10px;
  padding: 0.6rem 0.7rem;
  background: var(--surface);
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
}
.stat:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0,0,0,0.08); }
.stat__num { font-size: 1.4rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.stat__label { font-size: 0.72rem; color: var(--muted); margin-top: 0.2rem; }

/* Groups + cards */
.group { margin-bottom: 1.5rem; }
.group__head {
  display: flex; align-items: center; gap: 0.5rem;
  margin: 0 0 0.6rem;
}
.group__icon { width: 18px; height: 18px; color: var(--gc, var(--primary)); }
.group__icon svg { width: 18px; height: 18px; display: block; }
.group__title { font-size: 0.95rem; font-weight: 700; margin: 0; }
.group__count { font-size: 0.72rem; color: var(--muted); }
.group__line { flex: 1; height: 1px; background: var(--border); }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.75rem;
}

.card {
  position: relative;
  border: 1px solid var(--border);
  border-top: 3px solid var(--cc, var(--primary));
  border-radius: 12px;
  background: var(--surface);
  padding: 0.7rem 0.8rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: transform 0.12s, box-shadow 0.12s, border-color 0.12s;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0,0,0,0.1); }
.card__exports {
  position: absolute; top: 0.45rem; right: 0.45rem;
  display: none; gap: 0.25rem; z-index: 2;
}
.card:hover .card__exports { display: flex; }
.card-export {
  font-size: 0.62rem; font-weight: 700; letter-spacing: 0.03em;
  padding: 0.12rem 0.38rem; border-radius: 5px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--muted); cursor: pointer;
}
.card-export:hover { border-color: var(--cc, var(--primary)); color: var(--cc, var(--primary)); }
.card.is-highlight {
  border-color: var(--cc, var(--primary));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--cc, var(--primary)) 45%, transparent);
}

.card__head { display: flex; align-items: center; gap: 0.5rem; }
.card__icon { width: 20px; height: 20px; color: var(--cc, var(--primary)); flex-shrink: 0; }
.card__icon svg { width: 20px; height: 20px; display: block; }
.card__name {
  font-size: 0.88rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.card__badge {
  margin-left: auto; font-size: 0.6rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  padding: 0.08rem 0.4rem; border-radius: 999px;
  background: color-mix(in srgb, var(--cc, var(--primary)) 14%, transparent);
  color: var(--cc, var(--primary));
}
.card__sub { font-size: 0.72rem; color: var(--muted); font-family: ui-monospace, Menlo, monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card__meta { font-size: 0.72rem; color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.chip {
  font-size: 0.68rem; font-weight: 500;
  padding: 0.1rem 0.45rem; border-radius: 6px;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border);
}
.chip--rel { cursor: pointer; }
.chip--rel:hover { border-color: var(--primary); color: var(--primary); }
.chip--muted { color: var(--muted); }
.chip--more { background: transparent; color: var(--muted); }

.method-badge {
  font-size: 0.62rem; font-weight: 800; letter-spacing: 0.03em;
  padding: 0.08rem 0.4rem; border-radius: 5px; color: #fff;
}
.m-GET { background: #059669; } .m-POST { background: #2563eb; }
.m-PUT, .m-PATCH { background: #b45309; } .m-DELETE { background: #dc2626; }
.m-ANY, .m-OPTIONS, .m-HEAD { background: #64748b; }

/* Empty / import state */
.empty {
  max-width: 640px;
  margin: 2rem auto;
  text-align: center;
}
.empty__title { font-size: 1.4rem; font-weight: 800; margin: 0 0 0.5rem; }
.empty__text { color: var(--muted); line-height: 1.6; margin: 0 0 1.25rem; }
.dropzone {
  border: 2px dashed var(--border);
  border-radius: 16px;
  padding: 2.25rem 1.5rem;
  background: var(--surface);
  transition: border-color 0.15s, background 0.15s;
}
.dropzone.is-drag {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 8%, var(--surface));
}
.dropzone__icon { width: 42px; height: 42px; margin: 0 auto 0.6rem; color: var(--primary); }
.dropzone__icon svg { width: 42px; height: 42px; display: block; }
.dropzone__actions { display: flex; gap: 0.5rem; justify-content: center; flex-wrap: wrap; margin-top: 0.5rem; }

.cli-box {
  text-align: left;
  margin: 1.5rem auto 0;
  max-width: 640px;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.cli-box__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--border);
  font-size: 0.78rem; font-weight: 600;
}
.cli-box__body {
  margin: 0; padding: 0.85rem 0.95rem;
  background: var(--surface-2); color: var(--text);
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.78rem; line-height: 1.7;
  overflow: auto;
}
.cli-box__body .tok-cmd { color: var(--primary); font-weight: 600; }
.cli-box__body .tok-comment { color: var(--muted); }

/* Detail modal */
.modal { position: fixed; inset: 0; z-index: 400; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.modal[hidden] { display: none; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(2, 6, 23, 0.55); backdrop-filter: blur(2px); }
.modal__dialog {
  position: relative; z-index: 1;
  width: min(680px, 96vw); max-height: 92dvh;
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: 0 24px 70px rgba(0,0,0,0.4); overflow: hidden;
}
.modal__head { display: flex; align-items: center; gap: 0.6rem; padding: 0.85rem 1.1rem; border-bottom: 1px solid var(--border); }
.modal__head-icon { width: 22px; height: 22px; color: var(--cc, var(--primary)); flex-shrink: 0; }
.modal__head-icon svg { width: 22px; height: 22px; display: block; }
.modal__title { margin: 0; font-size: 1.05rem; flex: 1; overflow: hidden; text-overflow: ellipsis; }
.modal__body { padding: 1rem 1.1rem; overflow: auto; }
.modal__foot {
  display: flex; align-items: center; gap: 0.45rem;
  padding: 0.65rem 1.1rem; border-top: 1px solid var(--border);
}
.modal__foot-label { font-size: 0.78rem; font-weight: 600; color: var(--muted); margin-right: auto; }

.detail-row { margin-bottom: 1rem; }
.detail-row:last-child { margin-bottom: 0; }
.detail-row__label { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin-bottom: 0.35rem; }
.detail-row__value { font-size: 0.85rem; }
.detail-row__value code, .mono { font-family: ui-monospace, Menlo, monospace; font-size: 0.8rem; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 0.25rem 0.75rem; font-size: 0.82rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-family: ui-monospace, Menlo, monospace; }

.col-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.col-table th, .col-table td { text-align: left; padding: 0.3rem 0.5rem; border-bottom: 1px solid var(--border); }
.col-table th { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.col-table td.mono { font-family: ui-monospace, Menlo, monospace; }

.rel-list { display: flex; flex-direction: column; gap: 0.35rem; }
.rel-item {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.35rem 0.5rem; border: 1px solid var(--border); border-radius: 8px;
  cursor: pointer; font-size: 0.8rem;
}
.rel-item:hover { border-color: var(--primary); }
.rel-item__type { font-size: 0.64rem; font-weight: 700; color: #fff; background: var(--primary); border-radius: 5px; padding: 0.08rem 0.4rem; }
.rel-item__arrow { color: var(--muted); }
.rel-item__target { font-weight: 600; }

/* Footer */
.footer {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 0.5rem; padding: 0.55rem 0.75rem;
  border-top: 1px solid var(--border); background: var(--surface);
  font-size: 0.75rem; color: var(--muted); flex-shrink: 0;
}
.footer__links { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.footer a { color: var(--link); }

/* Toast */
.toast {
  position: fixed; bottom: 1.25rem; left: 50%;
  transform: translateX(-50%) translateY(120%);
  z-index: 500; padding: 0.6rem 1rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  transition: transform 0.25s ease; max-width: min(90vw, 360px);
  text-align: center; font-size: 0.85rem;
}
.toast--show { transform: translateX(-50%) translateY(0); }

/* Cookie banner */
.cookie-banner { position: fixed; bottom: 0; left: 0; right: 0; z-index: 300; padding: 1rem; transform: translateY(100%); transition: transform 0.3s ease; }
.cookie-banner--show { transform: translateY(0); }
.cookie-banner[hidden] { display: none; }
.cookie-banner__panel {
  max-width: 960px; margin: 0 auto;
  display: flex; flex-wrap: wrap; gap: 1rem; align-items: center;
  padding: 1rem 1.25rem; background: var(--surface);
  border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 -4px 24px rgba(0,0,0,0.12);
}
.cookie-banner__title { margin: 0 0 0.35rem; font-size: 1rem; }
.cookie-banner__text { margin: 0; font-size: 0.82rem; color: var(--muted); line-height: 1.45; }
.cookie-banner__text a { color: var(--link); }
.cookie-banner__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-left: auto; }

/* Legal pages */
.legal-page { max-width: 720px; margin: 0 auto; padding: 2rem 1rem 3rem; line-height: 1.6; }
.legal-page h1 { margin-top: 0; }
.legal-page a { color: var(--link); }

/* Responsive */
@media (max-width: 820px) {
  .sidebar { position: absolute; z-index: 50; height: 100%; box-shadow: 4px 0 24px rgba(0,0,0,0.2); transform: translateX(-100%); transition: transform 0.2s; }
  .sidebar.is-open { transform: translateX(0); }
  .canvas { width: 100%; }
}
@media (min-width: 821px) { .btn--menu { display: none; } }
