:root {
  --ink: #1f2733;
  --muted: #6b7684;
  --line: #e2e6eb;
  --brand: #1f6feb;
  --brand-dk: #1a5bc4;
  --bg: #f5f7fa;
  --card: #ffffff;
  --ok: #0f8a4a;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.wrap { max-width: 960px; margin: 0 auto; padding: 0 20px; }
.topbar { background: #12202f; color: #fff; padding: 16px 0; }
.topbar .wrap { display: flex; align-items: baseline; gap: 14px; }
.brand { font-weight: 700; font-size: 18px; letter-spacing: .2px; }
.tag { color: #9fb3c8; font-size: 13px; }
.lede { color: var(--muted); max-width: 760px; margin: 24px auto 12px; }

.beforeafter { background: #fff; border: 1px solid var(--line); border-radius: 10px; margin: 0 auto 22px; padding: 4px 16px; }
.beforeafter summary { cursor: pointer; font-weight: 600; padding: 10px 0; color: var(--brand); }
.ba-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; padding: 6px 0 16px; }
.ba-col h4 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.ba-col pre { background: #fbf3e6; border: 1px solid #ecdcbf; border-radius: 8px; padding: 12px; font-size: 12.5px; white-space: pre-wrap; margin: 0; }
table.mini { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.mini th { text-align: left; color: var(--muted); font-weight: 600; padding: 4px 10px 4px 0; width: 40%; }
table.mini td { padding: 4px 0; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 22px 24px; margin: 0 auto 24px; box-shadow: 0 1px 2px rgba(20,40,70,.04); }
.card h2 { margin: 0 0 18px; font-size: 17px; }
.count { color: var(--muted); font-weight: 400; font-size: 13px; margin-left: 6px; }

.field { margin-bottom: 16px; display: flex; flex-direction: column; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
label { font-weight: 600; font-size: 13.5px; margin-bottom: 6px; }
.req { color: #c1392b; }
input, select, textarea {
  font: inherit; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; color: var(--ink); width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(31,111,235,.12); }
input:disabled { background: #f0f2f5; color: var(--muted); }
.hint { color: var(--muted); font-size: 12px; margin-top: 4px; }
.err { color: #c1392b; font-size: 12.5px; margin-top: 4px; }

.hidden-select { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.combobox { position: relative; }
.combo-list { list-style: none; margin: 4px 0 0; padding: 4px; position: absolute; z-index: 20; left: 0; right: 0;
  background: #fff; border: 1px solid var(--line); border-radius: 8px; max-height: 240px; overflow: auto;
  box-shadow: 0 8px 24px rgba(20,40,70,.12); }
.combo-list li { padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: 14px; }
.combo-list li:hover, .combo-list li.active { background: #eef4ff; }
.combo-list li .grp { color: var(--muted); font-size: 12px; }
.combo-list li.no-match { color: var(--muted); cursor: default; }
.link-btn { background: none; border: none; color: var(--brand); cursor: pointer; padding: 6px 0 0; font-size: 13px; align-self: flex-start; }

button.primary { background: var(--brand); color: #fff; border: none; padding: 11px 20px; border-radius: 8px; font-weight: 600; cursor: pointer; font-size: 15px; }
button.primary:hover { background: var(--brand-dk); }

.flash { background: #e7f6ee; border: 1px solid #b6e3c9; color: var(--ok); padding: 10px 14px; border-radius: 8px; margin: 0 auto 18px; }

.table-scroll { overflow-x: auto; }
table.log { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.log th { text-align: left; color: var(--muted); font-weight: 600; border-bottom: 2px solid var(--line); padding: 8px 10px; white-space: nowrap; }
table.log td { border-bottom: 1px solid var(--line); padding: 9px 10px; vertical-align: top; }
.notecell { min-width: 220px; }
.empty { text-align: center; color: var(--muted); padding: 20px; }
.badge { background: #eef2f7; border: 1px solid var(--line); border-radius: 20px; padding: 2px 10px; font-size: 12px; white-space: nowrap; }
.foot { color: var(--muted); font-size: 12.5px; text-align: center; padding: 20px 0 40px; }

@media (max-width: 620px) { .ba-grid { grid-template-columns: 1fr; } }
