:root {
  --pink: #E8C9C5;
  --pink-light: #ECDCD9;
  --ink: #000;
  --paper: #fff;
  --muted: #5c5c5c;
  --line: #ddd;
  --danger: #b00020;
  --ok: #1b6e3a;
  font-family: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: #f4f1f0; color: var(--ink); }
body { display: flex; flex-direction: column; }
button, input, select { font: inherit; }
.bar { background: var(--paper); border-bottom: 1px solid var(--line); position: relative; z-index: 2; }
.bar-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; flex-wrap: wrap; }
.brand { font-size: 15px; white-space: nowrap; }
.field { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.field select { max-width: 260px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); color: var(--ink); }
.address { display: flex; gap: 6px; flex: 1 1 320px; min-width: 220px; }
.address input { flex: 1; padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px; min-width: 0; }
.btn { padding: 7px 14px; border: 1px solid var(--ink); border-radius: 6px; background: var(--paper); color: var(--ink); cursor: pointer; white-space: nowrap; }
.btn:disabled { opacity: .4; cursor: default; }
.btn.primary { background: var(--ink); color: var(--paper); }
.btn.ghost { border-color: var(--line); }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn.danger { border-color: var(--danger); color: var(--danger); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.seg-btn { border: 0; background: var(--paper); padding: 7px 10px; cursor: pointer; }
.seg-btn + .seg-btn { border-left: 1px solid var(--line); }
.seg-btn.active { background: var(--pink); }
.spacer { flex: 1; }
.notice { padding: 6px 12px; font-size: 13px; background: var(--pink-light); border-top: 1px solid var(--line); }
.notice.live { background: var(--ink); color: var(--paper); }
.stage { flex: 1; display: flex; min-height: 0; position: relative; }
.frame-wrap { flex: 1; display: flex; justify-content: center; overflow: auto; position: relative; padding: 0; }
.frame-wrap.phone { padding: 16px 0; }
iframe#page { border: 0; width: 100%; height: 100%; background: var(--paper); display: block; }
.frame-wrap.phone iframe#page { width: 390px; height: calc(100% - 0px); box-shadow: 0 0 0 1px var(--line); border-radius: 12px; }
.loading { position: absolute; inset: 0; z-index: 3; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,.75); font-size: 15px; }
.empty { position: absolute; inset: 0; overflow: auto; background: var(--paper); padding: 24px 16px; z-index: 1; }
.picker { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.picker-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.picker h1 { font-size: 22px; margin: 0; }
.picker h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 8px 0 4px; }
.picker input[type=search] { padding: 9px 12px; border: 1px solid var(--line); border-radius: 6px; font-size: 15px; width: 100%; }
.picker .hint { color: var(--muted); font-size: 13px; margin: 0; }
.page-list, .found { display: flex; flex-direction: column; }
.pick { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: none; padding: 9px 4px; cursor: pointer; color: var(--ink); width: 100%; }
.pick:hover, .pick:focus-visible { background: var(--pink-light); outline: none; }
.pick .path { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.pick .tag { font-size: 11px; background: var(--pink); border-radius: 4px; padding: 1px 6px; margin-left: 6px; }
.pick mark { background: var(--pink); color: inherit; }
.pick.off { cursor: default; color: var(--muted); }
.pick.off:hover { background: none; }
.panel { width: 360px; max-width: 100%; background: var(--paper); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.panel-body { padding: 12px; overflow: auto; display: flex; flex-direction: column; gap: 12px; }
.panel-body img.preview { width: 100%; max-height: 220px; object-fit: contain; background: #f4f1f0; border-radius: 6px; }
.panel-body label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.panel-body input[type=text] { padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); }
.panel-body .check { flex-direction: row; align-items: center; gap: 8px; color: var(--ink); }
.panel-body .hint { font-size: 13px; color: var(--muted); margin: 0; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.grid button { border: 2px solid transparent; padding: 0; background: #f4f1f0; border-radius: 6px; cursor: pointer; aspect-ratio: 1; overflow: hidden; }
.grid button:hover, .grid button:focus { border-color: var(--ink); }
.grid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.log-item { border-bottom: 1px solid var(--line); padding-bottom: 10px; font-size: 13px; display: flex; flex-direction: column; gap: 4px; }
.log-item .when { color: var(--muted); }
.log-item del { color: var(--danger); }
.log-item ins { color: var(--ok); text-decoration: none; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 8px; font-size: 14px; max-width: 90vw; z-index: 10; }
.toast.error { background: var(--danger); }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.35); display: flex; align-items: center; justify-content: center; z-index: 20; padding: 16px; }
.modal-box { background: var(--paper); border-radius: 10px; padding: 18px; max-width: 420px; width: 100%; }
.modal-box p { margin: 0 0 16px; font-size: 15px; line-height: 1.4; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
@media (max-width: 760px) {
  .panel { position: absolute; z-index: 2; inset: auto 0 0 0; width: 100%; max-height: 70%; border-left: 0; border-top: 1px solid var(--line); }
  .frame-wrap.phone iframe#page { width: 100%; border-radius: 0; }
}
