:root {
  --navy: #0c447c; --blue: #185fa5; --light: #e6f1fb; --line: #d9dde3; --text: #1f2328; --muted: #5f6670;
  --bg: #f4f6f9; --card: #ffffff; --ok-bg: #eaf3de; --ok: #27500a; --warn-bg: #fdecec; --warn: #8a1f1f;
  --note-bg: #faeeda; --note: #633806; --radius: 10px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif; }
a { color: var(--blue); }
h1 { font-size: 22px; margin: 0 0 4px; font-weight: 600; }
h2 { font-size: 16px; margin: 0 0 12px; font-weight: 600; color: var(--navy); }
.muted { color: var(--muted); margin: 0; }
.small { font-size: 13px; }

.topbar { background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; flex-wrap: wrap; }
.brand { color: #fff; text-decoration: none; font-weight: 700; letter-spacing: .5px; font-size: 17px; }
.brand span { font-weight: 400; color: #b5d4f4; letter-spacing: 0; font-size: 14px; margin-left: 6px; }
.topbar nav a { color: #fff; text-decoration: none; margin-left: 16px; font-size: 14px; }
.topbar nav a:hover { text-decoration: underline; }

.wrap { max-width: 760px; margin: 0 auto; padding: 20px 16px 96px; }
.page-head { margin: 8px 0 16px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; }
.panel.subtle { background: transparent; }
details.panel > summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
details.panel > summary::-webkit-details-marker { display: none; }
details.panel > summary h2 { margin: 0; }
details.panel > summary::after { content: "Edit"; color: var(--blue); font-size: 14px; }
details.panel[open] > summary { margin-bottom: 14px; }
details.panel[open] > summary::after { content: "Hide"; }

.notice { border-radius: var(--radius); padding: 10px 14px; margin-bottom: 14px; background: var(--note-bg); color: var(--note); }
.notice.ok { background: var(--ok-bg); color: var(--ok); }
.notice.warn { background: var(--warn-bg); color: var(--warn); }

.row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 14px; }
@media (max-width: 560px) { .row { grid-template-columns: minmax(0, 1fr); } }
.field { margin-bottom: 14px; }
.field label, .field .label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 5px; }
.opt { font-weight: 400; color: var(--muted); font-size: 12px; }
.pill { background: var(--note-bg); color: var(--note); font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; margin-left: 4px; }
input[type=text], input[type=tel], input[type=number], input[type=email], input:not([type]) {
  width: 100%; padding: 10px 12px; font: inherit; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--text);
}
input:focus { outline: 2px solid var(--blue); outline-offset: 1px; border-color: var(--blue); }
.has-error input { border-color: var(--warn); }
.error { color: var(--warn); font-size: 13px; margin: 4px 0 0; }
.hint { color: var(--muted); font-size: 13px; margin: 4px 0 0; }

.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label { border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; cursor: pointer; font-weight: 500; font-size: 14px; margin: 0; background: #fff; }
.seg input:checked + label { background: var(--navy); border-color: var(--navy); color: #fff; }
.seg input:focus-visible + label { outline: 2px solid var(--blue); outline-offset: 2px; }

.live { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; background: var(--light); border-radius: 8px; padding: 12px 14px; margin-top: 4px; }
.live span { color: var(--navy); font-size: 14px; }
.live strong { font-size: 22px; color: var(--navy); }
.live strong.na { font-size: 15px; color: var(--warn); }

.facts { margin: 0; padding-left: 18px; color: var(--muted); }
.facts li { margin: 2px 0; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 6px; }
.actions.sticky { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 30%); padding: 18px 0 12px; }
.primary, .secondary { display: inline-block; font: inherit; font-weight: 600; text-decoration: none; border-radius: 8px; padding: 11px 18px; cursor: pointer; }
.primary { background: var(--navy); color: #fff; border: 1px solid var(--navy); }
.primary:hover { background: #0a3864; }
.secondary { background: #fff; color: var(--navy); border: 1px solid var(--line); }
.secondary:hover { border-color: var(--navy); }

.dropzone { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 34px 16px; border: 2px dashed #b5c7db; border-radius: var(--radius); cursor: pointer; text-align: center; background: #fbfcfe; }
.dropzone.drag, .dropzone:hover { border-color: var(--blue); background: var(--light); }
.dropzone.has-file { border-style: solid; border-color: var(--navy); }
.dropzone input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.dz-icon { background: #e11e26; color: #fff; font-weight: 700; font-size: 12px; padding: 6px 8px; border-radius: 6px; margin-bottom: 6px; }
.dz-title { font-weight: 600; word-break: break-word; }
.dz-sub { color: var(--muted); font-size: 13px; }

.preview { width: 100%; height: 80vh; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
@media (max-width: 560px) { .preview { height: 60vh; } }
.summary { margin: 6px 0 0; font-weight: 600; color: var(--navy); }
.color-row { display: flex; align-items: center; gap: 12px; }
.color-row input[type=color] { width: 56px; height: 40px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; }
.color-row .hint { margin: 0; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; font-weight: 400; color: var(--blue); text-decoration: underline; cursor: pointer; }
