:root {
  --bg: #f4f6f8;
  --bg-accent: #e8eef9;
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --border: #d1d9e2;
  --text: #132033;
  --text-muted: #4d6279;
  --primary: #1259db;
  --primary-strong: #0e48b0;
  --shadow-soft: 0 10px 30px rgba(18, 89, 219, 0.08);
}
* { box-sizing: border-box; }
html, body { width: 100%; overflow-x: hidden; }
body {
  margin: 0;
  color: var(--text);
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  background: radial-gradient(900px 400px at 8% -10%, var(--bg-accent), transparent 45%), var(--bg);
}
img { max-width: 100%; height: auto; }
.page { width: min(1360px, 100%); margin: 0 auto; padding: 28px 16px 56px; display: grid; gap: 12px; }
.hero { display: grid; gap: 8px; }
.eyebrow { margin: 0; text-transform: uppercase; letter-spacing: .12em; font-size: 11px; color: var(--text-muted); }
h1 { margin: 0; font-size: clamp(1.8rem, 4vw, 2.4rem); }
h2, h3 { margin: 0; }
.sub { margin: 0; color: var(--text-muted); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-soft); padding: 14px; display: grid; gap: 10px; }
p, li, .muted { overflow-wrap: anywhere; }
code { overflow-wrap: anywhere; word-break: break-word; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.row-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.main-nav { display: flex; align-items: center; gap: 8px; padding: 4px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-muted); flex-wrap: wrap; }
.nav-link { border: 1px solid transparent; border-radius: 10px; padding: 9px 12px; color: var(--text-muted); text-decoration: none; font-weight: 600; }
.nav-link:hover { background: #eef2f7; color: var(--text); }
.nav-link.is-active { background: #fff; color: var(--text); border-color: var(--border); }
button, .button-secondary, .file-btn { border: 1px solid transparent; border-radius: 10px; background: var(--primary); color: #fff; font-weight: 600; padding: 10px 14px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; min-height: 38px; }
button:hover, .button-secondary:hover, .file-btn:hover { background: var(--primary-strong); }
.button-secondary, .file-btn { background: var(--surface-muted); color: var(--text); border-color: var(--border); }
input { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; font-size: 14px; width: 100%; }
label { display: grid; gap: 6px; color: var(--text-muted); font-size: 13px; }
.inline-form { display: grid; grid-template-columns: minmax(0,1fr) minmax(240px,320px) auto; gap: 8px; align-items: end; }
.layout { display: grid; grid-template-columns: minmax(280px, 320px) minmax(0, 1fr); gap: 12px; align-items: start; }
.template-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; max-height: 72vh; overflow: auto; }
.template-list button { width: 100%; text-align: left; justify-content: flex-start; }
.template-list button.is-active { background: #edf3ff; border-color: #9eb8ef; }
.yaml-view { margin: 0; border: 1px solid var(--border); border-radius: 10px; background: #0f1726; color: #d8e2f2; padding: 12px; min-height: clamp(280px, 55vh, 70vh); overflow: auto; font-size: 12px; line-height: 1.45; font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace; }
.yaml-view .tok-key { color: #8ec6ff; }
.yaml-view .tok-var { color: #ffd166; font-weight: 600; }
.yaml-view .tok-fn { color: #79f2c0; font-weight: 600; }
.yaml-view .tok-number { color: #ff9d6e; }
.yaml-view .tok-bool { color: #c6a0ff; }
.yaml-view .tok-comment { color: #7f8ca6; font-style: italic; }
.kv { display: grid; gap: 8px; }
.kv li { border: 1px solid var(--border); border-radius: 8px; padding: 10px; background: var(--surface-muted); }
.muted { margin: 0; color: var(--text-muted); font-size: 13px; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.mini-card { border: 1px solid var(--border); border-radius: 10px; background: var(--surface-muted); padding: 10px; display: grid; gap: 6px; }
.file-btn input { display: none; }
.icon-pill { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 24px; padding: 0 8px; border: 1px solid var(--border); border-radius: 999px; background: #fff; font-size: 11px; }
@media (max-width: 1200px) {
  .layout { grid-template-columns: minmax(260px, 300px) minmax(0, 1fr); }
}
@media (max-width: 820px) {
  .page { padding: 22px 14px 42px; }
  .card { border-radius: 12px; }
  .row-actions { width: 100%; }
  .controls .row-actions button,
  .controls .row-actions .file-btn { flex: 1 1 100%; }
  .template-list { max-height: 36vh; }
  .yaml-view { min-height: 44vh; font-size: 11px; }
}
@media (max-width: 960px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .inline-form { grid-template-columns: minmax(0, 1fr); }
  .main-nav { gap: 6px; }
  .nav-link { flex: 1 1 calc(50% - 6px); text-align: center; }
  .row-actions button, .row-actions .file-btn { flex: 1 1 calc(50% - 6px); }
}
@media (max-width: 560px) {
  .page { padding: 18px 12px 36px; }
  .card { padding: 12px; }
  h1 { font-size: 1.6rem; line-height: 1.15; }
  .nav-link { flex-basis: 100%; }
  .row-actions button, .row-actions .file-btn { flex-basis: 100%; }
  .controls .row { gap: 6px; }
  .icon-pill { min-width: 24px; height: 22px; padding: 0 6px; }
}
