/* LDT Brand Center: app chrome. Templates themselves are styled inline (render.js). */

:root {
  --navy: #1e3a8a;
  --navy-700: #182f72;
  --navy-50: #eef2fb;
  --gold: #c4a747;
  --gold-600: #a98e33;
  --gold-50: #faf6e8;
  --bg: #f4f5f8;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --line: #e4e7ec;
  --line-strong: #d0d5dd;
  --ink: #101828;
  --ink-2: #344054;
  --muted: #667085;
  --subtle: #98a2b3;
  --green: #12805c;
  --green-50: #e7f6ef;
  --red: #c4320a;
  --red-50: #fef3f2;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, 0.08), 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-md: 0 8px 20px -6px rgba(16, 24, 40, 0.14), 0 2px 6px -2px rgba(16, 24, 40, 0.06);
  --shadow-lg: 0 24px 48px -12px rgba(16, 24, 40, 0.22);
  --ring: 0 0 0 3px rgba(30, 58, 138, 0.2);
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --topbar: 60px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--navy); }
h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; letter-spacing: -0.01em; }
::selection { background: rgba(196, 167, 71, 0.3); }
:focus-visible { outline: none; box-shadow: var(--ring); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------------------------------------------------------------- boot */
.boot { min-height: 100vh; display: grid; place-content: center; gap: 14px; color: var(--muted); text-align: center; }
.boot-bar { width: 160px; height: 3px; border-radius: 3px; background: linear-gradient(90deg, var(--navy), var(--gold), var(--navy)); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* -------------------------------------------------------------- topbar */
.topbar {
  position: sticky; top: 0; z-index: 40;
  height: var(--topbar);
  background: var(--navy);
  color: #fff;
  box-shadow: inset 0 -2px 0 var(--gold);
}
.topbar-inner { height: 100%; max-width: 1440px; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; flex-shrink: 0; }
.brand img { height: 34px; width: auto; display: block; }
.brand-name { font-family: var(--font-display); font-weight: 600; font-size: 16px; letter-spacing: 0.01em; padding-left: 12px; border-left: 1px solid rgba(255, 255, 255, 0.22); }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a {
  color: rgba(255, 255, 255, 0.72); text-decoration: none; font-weight: 500;
  padding: 7px 12px; border-radius: 8px; display: inline-flex; align-items: center; gap: 8px;
  transition: color 0.15s, background-color 0.15s;
}
.nav a:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.nav a.on { color: #fff; background: rgba(255, 255, 255, 0.14); }
.nav .count { font-size: 11px; font-weight: 600; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--gold); color: var(--navy); display: inline-grid; place-content: center; }
.me {
  display: flex; align-items: center; gap: 10px; background: none; border: 0; color: #fff; cursor: pointer;
  padding: 5px 8px 5px 5px; border-radius: 22px; transition: background-color 0.15s;
}
.me:hover { background: rgba(255, 255, 255, 0.1); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--gold); color: var(--navy); font-weight: 700; font-size: 12px; display: grid; place-content: center; }
.avatar.anon { background: rgba(255, 255, 255, 0.16); color: #fff; }
.me-text { text-align: left; line-height: 1.15; }
.me-text small { display: block; color: rgba(255, 255, 255, 0.62); font-size: 11px; }

/* -------------------------------------------------------------- layout */
.page { max-width: 1280px; margin: 0 auto; padding: 36px 24px 72px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { font-size: 28px; font-weight: 650; }
.page-head p { margin: 6px 0 0; color: var(--muted); font-size: 15px; max-width: 640px; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold-600); margin-bottom: 6px; }
.row { display: flex; align-items: center; gap: 10px; }
.grow { flex: 1; }
.muted { color: var(--muted); }
.spacer { height: 16px; }

/* ------------------------------------------------------------- buttons */
.btn {
  --h: 38px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--h); padding: 0 14px; border-radius: 9px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink-2); font-weight: 600; font-size: 13.5px; cursor: pointer; white-space: nowrap;
  box-shadow: var(--shadow-xs); transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.05s, color 0.15s;
  text-decoration: none;
}
.btn:hover { background: var(--surface-2); border-color: #c0c6d0; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn-primary { background: var(--navy); border-color: var(--navy); color: #fff; box-shadow: 0 1px 2px rgba(30, 58, 138, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.08); }
.btn-primary:hover { background: var(--navy-700); border-color: var(--navy-700); }
.btn-gold { background: var(--gold); border-color: var(--gold); color: #fff; }
.btn-gold:hover { background: var(--gold-600); border-color: var(--gold-600); }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--ink-2); }
.btn-ghost:hover { background: rgba(16, 24, 40, 0.05); border-color: transparent; }
.btn-danger { color: var(--red); }
.btn-sm { --h: 32px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn-lg { --h: 44px; padding: 0 18px; font-size: 14.5px; }
.btn-icon { width: var(--h); padding: 0; }
.btn-block { width: 100%; }
.btn-split { display: inline-flex; }
.btn-split > .btn:first-child { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.btn-split > .btn:last-child { border-top-left-radius: 0; border-bottom-left-radius: 0; border-left-color: rgba(255, 255, 255, 0.25); padding: 0 9px; }

/* ------------------------------------------------------------ segmented */
.seg { display: inline-flex; padding: 3px; gap: 2px; background: #e9ecf1; border-radius: 10px; }
.seg button {
  border: 0; background: transparent; padding: 7px 14px; border-radius: 8px; font-weight: 600; font-size: 13.5px; color: var(--muted); cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px; transition: color 0.15s, background-color 0.15s, box-shadow 0.15s;
}
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--surface); color: var(--navy); box-shadow: var(--shadow-sm); }
.seg button svg { width: 16px; height: 16px; }
.seg.sm button { padding: 5px 10px; font-size: 12.5px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); border-radius: 999px; padding: 5px 12px; font-size: 12.5px; font-weight: 600; cursor: pointer;
  transition: all 0.15s;
}
.chip:hover { border-color: var(--navy); color: var(--navy); }
.chip.on { background: var(--navy-50); border-color: var(--navy); color: var(--navy); }

/* ---------------------------------------------------------------- cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-xs); }
.notice {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--radius); margin-bottom: 24px;
  background: linear-gradient(90deg, var(--gold-50), #fffdf6); border: 1px solid #eadfb8;
}
.notice .ic { width: 36px; height: 36px; border-radius: 10px; background: #fff; display: grid; place-content: center; color: var(--gold-600); box-shadow: var(--shadow-xs); flex-shrink: 0; }
.notice .ic svg { width: 18px; height: 18px; }
.notice b { display: block; }
.notice span { color: var(--muted); }

/* -------------------------------------------------------------- gallery */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 22px; }
.tcard { display: flex; flex-direction: column; overflow: hidden; transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s; }
.tcard:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--line-strong); }
.thumb { position: relative; height: 300px; overflow: hidden; background: var(--surface-2); border-bottom: 1px solid var(--line); cursor: pointer; }
.thumb::after { content: ""; position: absolute; inset: auto 0 0 0; height: 56px; background: linear-gradient(transparent, rgba(255, 255, 255, 0.92)); pointer-events: none; }
.thumb .hover {
  position: absolute; inset: 0; display: grid; place-content: center; background: rgba(16, 24, 40, 0.38); opacity: 0; transition: opacity 0.18s; z-index: 2;
}
.thumb:hover .hover, .thumb:focus-visible .hover { opacity: 1; }
.thumb .hover span { background: #fff; color: var(--ink); font-weight: 600; padding: 8px 14px; border-radius: 999px; box-shadow: var(--shadow-md); display: inline-flex; gap: 8px; align-items: center; }
.thumb .hover svg { width: 16px; height: 16px; }
.tcard-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 14px; flex: 1; }
.tcard-title { display: flex; align-items: center; gap: 10px; }
.tcard-title h3 { font-size: 16px; font-weight: 650; }
.swatch { display: inline-flex; border-radius: 4px; overflow: hidden; box-shadow: 0 0 0 1px rgba(16, 24, 40, 0.1); }
.swatch i { width: 10px; height: 14px; display: block; }
.tcard p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.tcard-actions { display: flex; gap: 8px; margin-top: auto; }
.tcard-actions .btn-primary { flex: 1; }

/* ------------------------------------------------------------ previewer */
.pv { position: relative; overflow: hidden; }
.pv iframe { border: 0; display: block; background: transparent; transform-origin: top left; }
.pv-scale { transform-origin: top left; }

/* -------------------------------------------------------------- recents */
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 40px 0 14px; }
.section-title h2 { font-size: 17px; font-weight: 650; }
.recents { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.recent { display: flex; gap: 12px; padding: 12px; align-items: center; cursor: pointer; text-align: left; transition: box-shadow 0.15s, border-color 0.15s; }
.recent:hover { box-shadow: var(--shadow-sm); border-color: var(--line-strong); }
.recent .mini { width: 52px; height: 52px; border-radius: 8px; overflow: hidden; flex-shrink: 0; border: 1px solid var(--line); background: var(--surface-2); position: relative; }
.recent b { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent small { color: var(--muted); }
.recent > div:last-child { min-width: 0; }

.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 40px; }
.how .card { padding: 18px; display: flex; gap: 14px; }
.how .n { width: 30px; height: 30px; border-radius: 50%; background: var(--navy-50); color: var(--navy); font-weight: 700; display: grid; place-content: center; flex-shrink: 0; }
.how b { display: block; margin-bottom: 2px; }
.how span { color: var(--muted); font-size: 13px; }

/* --------------------------------------------------------------- editor */
.ed-bar {
  position: sticky; top: var(--topbar); z-index: 30; background: rgba(255, 255, 255, 0.92); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.ed-bar-inner { max-width: 1600px; margin: 0 auto; padding: 10px 24px; display: flex; align-items: center; gap: 12px; }
.name-input {
  font-family: var(--font-display); font-size: 17px; font-weight: 650; border: 1px solid transparent; background: transparent; border-radius: 8px;
  padding: 5px 8px; min-width: 120px; max-width: 520px; width: 100%; color: var(--ink);
}
.name-input:hover { border-color: var(--line); }
.name-input:focus { border-color: var(--navy); box-shadow: var(--ring); outline: none; background: #fff; }
.save-state { font-size: 12.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.save-state i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); display: inline-block; }
.save-state.pending i { background: var(--gold); }
.ed { max-width: 1600px; margin: 0 auto; display: grid; grid-template-columns: minmax(380px, 440px) 1fr; gap: 0; align-items: start; }
.ed-form { padding: 20px 20px 80px 24px; display: flex; flex-direction: column; gap: 14px; }
.ed-preview { position: sticky; top: calc(var(--topbar) + 59px); height: calc(100vh - var(--topbar) - 59px); overflow: auto; padding: 20px 24px 40px; }
.pv-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 auto 14px; flex-wrap: wrap; }
.pv-hint { font-size: 12.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 8px; }
.pv-hint i { width: 10px; height: 10px; border-radius: 3px; background: #cbd5e1; display: inline-block; }
.pv-stage { border-radius: 14px; background: #e9ecf1; padding: 22px; box-shadow: inset 0 0 0 1px rgba(16, 24, 40, 0.04); }
.pv-paper { margin: 0 auto; background: #fff; border-radius: 6px; box-shadow: var(--shadow-md); overflow: hidden; }
.pv-mail-head { background: #fff; border-bottom: 1px solid var(--line); padding: 10px 14px; font-size: 12.5px; color: var(--muted); display: grid; grid-template-columns: 58px 1fr; row-gap: 4px; }
.pv-mail-head b { color: var(--ink-2); font-weight: 600; }
.pv-mail-head .s { color: var(--ink); font-weight: 600; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-xs); }
.panel > summary, .panel-head {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 14px 16px; font-weight: 650; font-size: 14px; user-select: none;
}
.panel > summary::-webkit-details-marker { display: none; }
.panel > summary .chev { margin-left: auto; color: var(--subtle); transition: transform 0.2s; width: 16px; height: 16px; }
.panel[open] > summary .chev { transform: rotate(180deg); }
.panel > summary .ic { width: 28px; height: 28px; border-radius: 8px; background: var(--navy-50); color: var(--navy); display: grid; place-content: center; }
.panel > summary .ic svg { width: 15px; height: 15px; }
.panel > summary small { font-weight: 500; color: var(--muted); font-size: 12px; }
.panel-body { padding: 2px 16px 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.panel-body > .full { grid-column: 1 / -1; }

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field > label, .label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
.field > label .opt { font-weight: 500; color: var(--subtle); }
.field .help { font-size: 12px; color: var(--muted); }
.input, .textarea, select.input {
  width: 100%; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; padding: 8px 10px; font-size: 13.5px; color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s; box-shadow: var(--shadow-xs);
}
.input::placeholder, .textarea::placeholder { color: #a6b0bf; }
.input:hover, .textarea:hover { border-color: #b9c0cb; }
.input:focus, .textarea:focus { border-color: var(--navy); box-shadow: var(--ring); outline: none; }
.textarea { resize: vertical; min-height: 60px; line-height: 1.45; }
.input-wrap { position: relative; display: flex; }
.input-wrap .input { padding-right: 70px; }
.input-wrap .in-btn { position: absolute; right: 4px; top: 4px; bottom: 4px; }
.flash { animation: flash 1.2s ease; }
@keyframes flash { 0%, 40% { box-shadow: 0 0 0 3px rgba(196, 167, 71, 0.55); border-color: var(--gold); } }

/* style picker */
.styles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.style-opt {
  min-width: 0;
  border: 1px solid var(--line-strong); background: #fff; border-radius: 9px; padding: 8px; cursor: pointer; text-align: left; display: flex; flex-direction: column; gap: 6px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.style-opt:hover { border-color: #aab3c0; }
.style-opt.on { border-color: var(--navy); box-shadow: var(--ring); }
.style-opt span { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.style-thumb { display: block; height: 62px; overflow: hidden; border-radius: 5px; border: 1px solid #eceef2; background: #f5f6f8; position: relative; }
.style-thumb iframe, .thumb iframe, .mini iframe { pointer-events: none; }
.style-name { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.style-thumb .new {
  position: absolute; top: 4px; right: 4px; z-index: 1; font-style: normal; font-size: 9.5px; font-weight: 700; letter-spacing: 0.02em;
  color: #fff; background: var(--gold-600); padding: 1px 5px; border-radius: 4px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}
.tcard-title .tag { margin-left: auto; }
.style-art { height: 34px; border-radius: 5px; overflow: hidden; display: flex; flex-direction: column; background: #f5f6f8; border: 1px solid #eceef2; }
.style-art .h { height: 16px; }
.style-art .a { height: 3px; }
.style-art .b { flex: 1; background: #fff; }

/* rich text */
.rich { border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; box-shadow: var(--shadow-xs); transition: border-color 0.15s, box-shadow 0.15s; }
.rich:focus-within { border-color: var(--navy); box-shadow: var(--ring); }
.rich-tools { display: flex; gap: 2px; padding: 4px; border-bottom: 1px solid var(--line); background: var(--surface-2); border-radius: 8px 8px 0 0; flex-wrap: wrap; }
.rich-tools button { width: 30px; height: 28px; border: 0; background: transparent; border-radius: 6px; display: grid; place-content: center; color: var(--ink-2); cursor: pointer; }
.rich-tools button:hover { background: #e9ecf1; }
.rich-tools button.on { background: var(--navy-50); color: var(--navy); }
.rich-tools button svg { width: 15px; height: 15px; }
.rich-tools .sep { width: 1px; background: var(--line); margin: 4px 3px; }
.rich-area {
  min-height: 110px; max-height: 420px; overflow: auto; padding: 10px 12px; font-family: Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.6; color: #374151; outline: none;
}
.rich-area p { margin: 0 0 10px; }
.rich-area p:last-child { margin-bottom: 0; }
.rich-area ul, .rich-area ol { margin: 0 0 10px; padding-left: 22px; }
.rich-area a { color: var(--navy); }
.rich-area.is-empty::before { content: attr(data-placeholder); color: #a6b0bf; pointer-events: none; position: absolute; white-space: pre-wrap; max-width: calc(100% - 50px); }
.rich-wrap { position: relative; }
.rich-link { display: flex; gap: 6px; padding: 6px; border-top: 1px solid var(--line); background: var(--surface-2); }

/* merge tokens */
.tokens { display: flex; flex-wrap: wrap; gap: 5px; }
.token {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 11.5px; padding: 2px 8px; border-radius: 6px; background: var(--navy-50); color: var(--navy);
  border: 1px solid #c9d4ef; cursor: pointer;
}
.token:hover { background: #dfe6f8; }

/* fuel rows */
.rows { display: flex; flex-direction: column; gap: 6px; }
.rows .r { display: grid; grid-template-columns: 1fr 1.2fr 30px; gap: 6px; align-items: center; }

/* toggle */
.toggle { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink-2); user-select: none; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle .t { width: 34px; height: 20px; border-radius: 10px; background: #cfd5de; position: relative; transition: background-color 0.18s; flex-shrink: 0; }
.toggle .t::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); transition: transform 0.18s; }
.toggle input:checked + .t { background: var(--navy); }
.toggle input:checked + .t::after { transform: translateX(14px); }
.toggle input:focus-visible + .t { box-shadow: var(--ring); }

.colors { display: flex; gap: 12px; }
.color { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 4px 8px 4px 4px; background: #fff; }
.color input[type="color"] { width: 28px; height: 28px; border: 0; padding: 0; background: none; cursor: pointer; }
.color input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.color input[type="color"]::-webkit-color-swatch { border: 1px solid rgba(0, 0, 0, 0.12); border-radius: 6px; }
.color code { font-size: 12px; color: var(--ink-2); }

/* --------------------------------------------------------------- drafts */
.drafts { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.dcard { overflow: hidden; display: flex; flex-direction: column; transition: box-shadow 0.2s, border-color 0.2s; }
.dcard:hover { box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.dcard .thumb { height: 190px; }
.dcard-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 10px; }
.dcard-body b { font-size: 14.5px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta { display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: 12.5px; flex-wrap: wrap; }
.tag { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--navy-50); color: var(--navy); }
.tag.gold { background: var(--gold-50); color: var(--gold-600); }
.search { position: relative; }
.search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--subtle); }
.search .input { padding-left: 34px; width: 260px; }
.empty { text-align: center; padding: 64px 24px; }
.empty .art { width: 72px; height: 72px; border-radius: 20px; background: var(--navy-50); color: var(--navy); display: grid; place-content: center; margin: 0 auto 16px; }
.empty .art svg { width: 32px; height: 32px; }
.empty h3 { font-size: 18px; }
.empty p { color: var(--muted); max-width: 420px; margin: 8px auto 20px; }

/* ----------------------------------------------------------------- bulk */
.steps { display: flex; gap: 0; margin: 0 0 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.step { flex: 1; display: flex; align-items: center; gap: 10px; padding: 12px 16px; color: var(--muted); font-weight: 600; font-size: 13px; border-right: 1px solid var(--line); background: none; border-top: 0; border-bottom: 0; border-left: 0; text-align: left; cursor: default; }
.step:last-child { border-right: 0; }
.step .n { width: 24px; height: 24px; border-radius: 50%; display: grid; place-content: center; background: #eef0f4; font-size: 12px; flex-shrink: 0; }
.step.on { color: var(--navy); background: var(--navy-50); }
.step.on .n { background: var(--navy); color: #fff; }
.step.done { color: var(--ink-2); cursor: pointer; }
.step.done .n { background: var(--green); color: #fff; }
.drop {
  border: 2px dashed var(--line-strong); border-radius: 16px; padding: 48px 24px; text-align: center; background: var(--surface); transition: border-color 0.15s, background-color 0.15s; cursor: pointer;
}
.drop.over, .drop:hover { border-color: var(--gold); background: var(--gold-50); }
.drop .art { width: 56px; height: 56px; border-radius: 16px; margin: 0 auto 14px; background: var(--navy-50); color: var(--navy); display: grid; place-content: center; }
.drop .art svg { width: 26px; height: 26px; }
.tbl-wrap { overflow: auto; max-height: 56vh; border-top: 1px solid var(--line); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { position: sticky; top: 0; background: var(--surface-2); text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; z-index: 1; }
.tbl td { padding: 9px 12px; border-bottom: 1px solid #f0f2f5; vertical-align: middle; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl tr:hover td { background: #fafbfc; }
.tbl tr.off td { opacity: 0.45; }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.badge.ok { background: var(--green-50); color: var(--green); }
.badge.warn { background: var(--gold-50); color: var(--gold-600); }
.badge.bad { background: var(--red-50); color: var(--red); }
.map { display: grid; grid-template-columns: 1fr 24px 1fr; gap: 10px 12px; align-items: center; padding: 16px; }
.map .col b { display: block; font-size: 13.5px; }
.map .col small { color: var(--muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 320px; }
.map svg { color: var(--subtle); width: 16px; height: 16px; }
.foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.progress { height: 8px; border-radius: 8px; background: #e9ecf1; overflow: hidden; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--navy), #3b5fc4); border-radius: 8px; transition: width 0.2s; }

/* ---------------------------------------------------------- menus/modal */
.menu-wrap { position: relative; }
.menu {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 250px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 60;
  animation: pop 0.14s ease-out;
}
.menu.up { top: auto; bottom: calc(100% + 6px); }
.menu button {
  width: 100%; display: flex; align-items: flex-start; gap: 10px; border: 0; background: none; padding: 8px 10px; border-radius: 8px; cursor: pointer; text-align: left; color: var(--ink-2);
}
.menu button:hover, .menu button:focus-visible { background: var(--surface-2); }
.menu button svg { width: 16px; height: 16px; margin-top: 2px; flex-shrink: 0; color: var(--muted); }
.menu button b { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.menu button small { color: var(--muted); font-size: 12px; }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 5px 4px; }
.menu .danger b, .menu .danger svg { color: var(--red); }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(0.98); } }

.scrim { position: fixed; inset: 0; background: rgba(16, 24, 40, 0.42); backdrop-filter: blur(2px); z-index: 80; display: grid; place-items: center; padding: 20px; animation: fade 0.15s ease-out; }
@keyframes fade { from { opacity: 0; } }
.modal { width: 100%; max-width: 520px; max-height: calc(100vh - 40px); overflow: auto; background: #fff; border-radius: 16px; box-shadow: var(--shadow-lg); animation: pop 0.18s ease-out; }
.modal.wide { max-width: 760px; }
.modal-head { display: flex; align-items: flex-start; gap: 12px; padding: 20px 22px 6px; }
.modal-head h2 { font-size: 18px; font-weight: 650; }
.modal-head p { margin: 4px 0 0; color: var(--muted); }
.modal-body { padding: 14px 22px 4px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 22px 20px; }
.modal .x { margin-left: auto; }
.steps-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; }
.steps-list li { display: flex; gap: 12px; }
.steps-list .n { width: 26px; height: 26px; border-radius: 50%; background: var(--navy-50); color: var(--navy); font-weight: 700; font-size: 12.5px; display: grid; place-content: center; flex-shrink: 0; }
.kbd { font-family: inherit; font-size: 11.5px; font-weight: 600; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--line-strong); border-bottom-width: 2px; background: #fff; color: var(--ink-2); }
.tip { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font-size: 13px; color: var(--ink-2); }
.tip b { color: var(--ink); }

/* --------------------------------------------------------------- toasts */
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 12px; background: #101828; color: #fff; padding: 11px 14px 11px 16px; border-radius: 12px; box-shadow: var(--shadow-lg);
  font-size: 13.5px; font-weight: 500; animation: toastIn 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.2); max-width: min(560px, calc(100vw - 32px));
}
.toast svg { width: 18px; height: 18px; flex-shrink: 0; }
.toast.ok svg { color: #6ee7b7; }
.toast.err svg { color: #fca5a5; }
.toast button { background: rgba(255, 255, 255, 0.12); color: #fff; border: 0; border-radius: 7px; padding: 4px 10px; font-weight: 600; cursor: pointer; }
.toast button:hover { background: rgba(255, 255, 255, 0.22); }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(0.98); } }

/* ----------------------------------------------------------- responsive */
@media (max-width: 1100px) {
  .ed { grid-template-columns: 1fr; }
  .ed-preview { position: static; height: auto; overflow: visible; padding-top: 0; }
  .ed-form { padding: 20px 24px; }
}
@media (max-width: 820px) {
  .topbar-inner { gap: 12px; padding: 0 14px; }
  .brand-name, .me-text { display: none; }
  .nav a { padding: 7px 9px; }
  .nav a { font-size: 0; gap: 0; padding: 8px 10px; }
  .nav a svg { width: 18px; height: 18px; }
  .nav .count { font-size: 11px; margin-left: 4px; }
  .notice { flex-wrap: wrap; }
  .notice .btn { width: 100%; }
  .ed-bar .lbl-long { display: none; }
  .page { padding: 24px 16px 56px; }
  .how { grid-template-columns: 1fr; }
  .grid { grid-template-columns: 1fr; }
  .ed-bar-inner { padding: 10px 14px; flex-wrap: wrap; }
  .panel-body { grid-template-columns: 1fr; }
  .search .input { width: 100%; }
  .steps .step span.l { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
