:root{
  --accent:#2f4f7a;
  --accent-dark:#24405f;
  --ink:#161c24;
  --muted:#697180;
  --line:#e2e6ec;
  --bg:#f3f5f8;
  --danger:#b3261e;
  --ok:#1c7a44;
  --radius:10px;
}
*{box-sizing:border-box}
html,body{margin:0}
body{
  background:var(--bg);
  color:var(--ink);
  font:15px/1.55 -apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Arial,sans-serif;
  -webkit-font-smoothing:antialiased;
}
a{color:var(--accent)}

/* ---------- chrome ---------- */
.topbar{
  background:var(--accent);
  color:#fff;
  padding:16px 26px;
  display:flex;
  align-items:center;
  gap:16px;
  flex-wrap:wrap;
}
.topbar h1{margin:0;font-size:17px;font-weight:600;letter-spacing:.2px}
.topbar .sub{font-size:13.5px;opacity:.82}
.topbar .spacer{flex:1}
.topbar a,.topbar button.linkish{
  color:#fff;font-size:13.5px;text-decoration:none;opacity:.9;
  background:none;border:0;cursor:pointer;font-family:inherit;padding:0;
}
.topbar a:hover,.topbar button.linkish:hover{opacity:1;text-decoration:underline}

.page{max-width:1400px;padding:24px 26px 60px}
.cols{display:flex;flex-wrap:wrap;gap:24px;align-items:flex-start}
/* column sizing lives here rather than inline, so the phone breakpoint can
   drop the min-width — a 340px minimum is wider than a small phone and forces
   the whole page to scroll sideways */
.col-form{flex:0 0 400px;max-width:100%}
.col-form.wide{flex:0 0 460px}
.col-preview{flex:1 1 620px;min-width:340px}

.card{
  background:#fff;
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:22px 24px;
}
.card + .card{margin-top:20px}

/* Keep the preview in view while working down the long brand form.
   Three things this depends on:
   - .cols must stay align-items:flex-start, or the column stretches to full
     height and never sticks;
   - it only does anything when the other column is the taller one, which is
     why it is on the admin editor and not the staff builder;
   - max-height keeps a tall preview scrolling inside itself instead of
     having its bottom clipped off-screen.
   Off below the breakpoint: once the columns stack, a pinned preview would
   sit on top of the fields being edited. */
@media (min-width:1024px){
  .sticky-col{
    position:sticky;
    top:24px;
    max-height:calc(100vh - 48px);
    overflow-y:auto;
  }
}

h2.section{
  margin:0 0 16px;
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:1.1px;
  color:var(--muted);
  font-weight:700;
}
h3{margin:0 0 10px;font-size:15px}

/* ---------- forms ---------- */
label{display:block;margin:0 0 14px}
label > span.lbl{display:block;font-size:13px;font-weight:600;margin-bottom:5px}
label small{font-weight:400;color:var(--muted)}
input[type=text],input[type=password],input[type=number],select,textarea{
  width:100%;
  padding:9px 11px;
  border:1px solid #ccd3dd;
  border-radius:6px;
  font:14px/1.4 inherit;
  color:var(--ink);
  background:#fff;
}
textarea{resize:vertical;min-height:64px}
input:focus,select:focus,textarea:focus{
  outline:2px solid rgba(47,79,122,.32);
  outline-offset:1px;
  border-color:var(--accent);
}
input[type=color]{
  width:44px;height:34px;padding:2px;border:1px solid #ccd3dd;
  border-radius:6px;background:#fff;cursor:pointer;vertical-align:middle;
}
.row{display:flex;gap:10px;flex-wrap:wrap}
.row > *{flex:1;min-width:120px}
.check{display:flex;align-items:flex-start;gap:9px;margin:0 0 10px;font-size:13.5px}
.check input{margin-top:3px;flex:none}
.hint{font-size:12.5px;color:var(--muted);margin:-6px 0 14px}

button{
  font:600 14px/1 inherit;
  padding:11px 16px;
  border-radius:6px;
  border:1px solid var(--accent);
  background:var(--accent);
  color:#fff;
  cursor:pointer;
}
button:hover{background:var(--accent-dark);border-color:var(--accent-dark)}
button.ghost{background:#fff;color:var(--accent)}
button.ghost:hover{background:#eef2f7}
button.danger{background:#fff;color:var(--danger);border-color:#e3c4c1}
button.danger:hover{background:#fdf3f2}
button.small{padding:7px 11px;font-size:13px}
button:disabled{opacity:.55;cursor:not-allowed}
.actions{display:flex;flex-wrap:wrap;gap:10px}

.note{margin-top:12px;font-size:12.5px;color:var(--muted);min-height:18px}
.note.ok{color:var(--ok);font-weight:600}
.note.err{color:var(--danger);font-weight:600}

.warn{
  background:#fff8e8;border:1px solid #f0dcae;border-radius:8px;
  padding:12px 14px;font-size:13px;margin-bottom:18px;
}
.warn strong{color:#8a6100}

/* ---------- repeaters (offices, links) ---------- */
.repeat{border:1px solid var(--line);border-radius:8px;padding:14px 14px 2px;margin-bottom:12px;background:#fbfcfe}
.repeat .head{display:flex;align-items:center;gap:10px;margin-bottom:10px}
.repeat .head strong{font-size:13px;flex:1}

/* ---------- preview ---------- */
.preview-frame{
  border:1px solid var(--line);
  border-radius:8px;
  padding:26px;
  background:#fff;
  overflow-x:auto;
}
textarea.code{
  height:240px;margin-top:14px;
  font:12px/1.5 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  background:#fbfcfe;
}

/* ---------- lists ---------- */
table.list{width:100%;border-collapse:collapse}
table.list th{
  text-align:left;font-size:11.5px;text-transform:uppercase;letter-spacing:.8px;
  color:var(--muted);padding:0 10px 8px 0;font-weight:700;
}
table.list td{padding:12px 10px 12px 0;border-top:1px solid var(--line);vertical-align:middle}
table.list td.name{font-weight:600}
table.list img.thumb{max-width:120px;max-height:34px;display:block}
code.url{
  font:12.5px/1.4 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  background:#f1f4f8;padding:3px 6px;border-radius:4px;color:var(--ink);
  word-break:break-all;
}

.tabs{display:flex;gap:6px;margin-bottom:12px;flex-wrap:wrap}
.tabs button{background:#eef2f7;color:var(--accent);border-color:#eef2f7;font-size:13px;padding:8px 13px}
.tabs button[aria-pressed=true]{background:var(--accent);color:#fff;border-color:var(--accent)}

ol.steps{margin:10px 0 0;padding-left:20px;font-size:13.5px}
ol.steps li{margin-bottom:7px}

.empty{padding:34px 10px;text-align:center;color:var(--muted);font-size:14px}
[hidden]{display:none !important}

/* ---------- phones ---------- */
@media (max-width:640px){
  .col-form,.col-form.wide,.col-preview{flex:1 1 100%;min-width:0}
  .topbar{padding:14px 16px;gap:4px}
  .topbar h1{font-size:16px}
  .topbar .sub{font-size:12.5px}
  .page{padding:16px 12px 40px}
  .cols{gap:16px}
  .card{padding:16px 14px;border-radius:8px}
  /* every pixel here is width the preview can use */
  .preview-frame{padding:12px}
  .actions button{flex:1 1 auto}
  .repeat{padding:12px 12px 2px}
  /* the brand list is a wide table; let it scroll rather than squash */
  .card:has(> table.list){overflow-x:auto}
  table.list td,table.list th{white-space:nowrap}
  table.list td.name{white-space:normal;min-width:140px}
}
