/* =========================================================
   桌签打印 · 界面样式
   屏幕端深色预览台 + 浅色参数面板；打印端只保留纸面
   ========================================================= */

:root {
  --ink: #202b2b;
  --ink-2: #31403f;
  --muted: #687773;
  --muted-2: #8a9792;
  --line: #e3ddd2;
  --line-strong: #d0c7b9;
  --bg: #f3efe7;
  --panel: #fffdf9;
  --primary: #1f615a;
  --primary-hover: #174d47;
  --primary-soft: #e7f2ee;
  --primary-soft-2: #d7e9e4;
  --gold: #a8793f;
  --gold-soft: #f7efe2;
  --danger: #a84943;
  --danger-soft: #f9ece9;
  --success: #2f7d63;
  --stage: #1c2a29;
  --stage-2: #101b1a;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(40, 47, 42, .05), 0 2px 8px rgba(40, 47, 42, .04);
  --shadow-md: 0 14px 34px rgba(37, 43, 38, .13);
  --shadow-paper: 0 2px 5px rgba(0, 0, 0, .18), 0 26px 80px rgba(0, 0, 0, .42);
  --font: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", "Source Han Sans SC", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}
body.modal-open { overflow: hidden; }

button, input, select, textarea { font: inherit; }
button { color: inherit; }
svg { display: block; }
[hidden] { display: none !important; }

::selection { background: #cfe3f5; color: var(--ink); }

/* ---------------- app frame ---------------- */
.app-shell {
  height: 100dvh;
  min-height: 480px;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.app-header {
  flex: 0 0 76px;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 26px;
  background: linear-gradient(180deg, #fffdf9 0%, #fbf7ef 100%);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 4px 18px rgba(36, 44, 39, .05);
  position: relative;
  z-index: 5;
}
.app-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), #4f8f84 45%, var(--gold) 100%);
  opacity: .55;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  background: linear-gradient(145deg, #2c6d64, #164b46);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 20px rgba(31, 97, 90, .24);
  flex: 0 0 auto;
}
.brand-mark svg { width: 38px; height: 38px; }

.brand-text { min-width: 0; }
.brand-text h1 {
  font-size: 23px;
  line-height: 1.15;
  margin: 0;
  letter-spacing: .055em;
  font-weight: 750;
}
.brand-text p {
  margin: 4px 0 0;
  font-size: 12.5px;
  line-height: 1.2;
  color: var(--muted);
  letter-spacing: .08em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.server-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
  background: #fbfcfd;
}
.server-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #a6b0bb;
  box-shadow: 0 0 0 3px rgba(166, 176, 187, .12);
}
.server-badge.is-online { color: var(--success); border-color: #d2e8dd; background: #f5fbf8; }
.server-badge.is-online .dot { background: var(--success); box-shadow: 0 0 0 3px rgba(47, 125, 93, .13); }
.server-badge.is-error { color: var(--danger); border-color: #f0d8d5; background: #fdf8f7; }
.server-badge.is-error .dot { background: var(--danger); }

/* ---------------- workspace ---------------- */
.workspace {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.58fr) minmax(390px, .92fr);
}

/* ---------------- preview ---------------- */
.preview-pane {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(900px 500px at 48% 36%, #2b333e 0%, var(--stage) 45%, var(--stage-2) 100%);
  color: #eef3f8;
  position: relative;
}

.preview-toolbar {
  flex: 0 0 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .075);
  background: rgba(20, 24, 30, .28);
  backdrop-filter: blur(10px);
  position: relative;
  z-index: 2;
}

.segmented {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  background: rgba(255, 255, 255, .065);
  border: 1px solid rgba(255, 255, 255, .075);
  border-radius: 9px;
  gap: 2px;
}
.segmented-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: #aeb9c5;
  font-size: 12.5px;
  line-height: 1;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .16s ease, color .16s ease;
}
.segmented-btn:hover { color: #eaf0f6; }
.segmented-btn.is-active {
  background: rgba(255, 255, 255, .13);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06);
}

.page-nav {
  display: flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
}
.icon-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: #aab5c1;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover:not(:disabled) { background: rgba(255, 255, 255, .09); color: #fff; }
.icon-btn:disabled { opacity: .26; cursor: default; }

.page-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #aeb9c5;
  font-size: 12px;
  padding: 0 6px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.page-indicator input {
  width: 38px;
  height: 27px;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .06);
  color: #fff;
  text-align: center;
  border-radius: 6px;
  outline: none;
  font-size: 12.5px;
  padding: 0 2px;
}
.page-indicator input:focus { border-color: rgba(255, 255, 255, .36); background: rgba(255, 255, 255, .1); }
.page-indicator input:disabled { color: #7c8794; }
.page-indicator b { color: #e7edf4; font-weight: 600; }

.zoom-readout {
  color: #7f8c9a;
  font-size: 11px;
  letter-spacing: .02em;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.zoom-control {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex: 0 0 auto;
  color: #aeb9c5;
  font-size: 11px;
}
.zoom-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: #aeb9c5;
  width: 25px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
}
.zoom-btn:hover { background: rgba(255,255,255,.09); color: #fff; }
.zoom-input {
  width: 42px;
  height: 27px;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .06);
  color: #fff;
  text-align: center;
  border-radius: 6px;
  outline: none;
  font-size: 12px;
  padding: 0 2px;
  font-variant-numeric: tabular-nums;
}
.zoom-input:focus { border-color: rgba(255,255,255,.36); }
.zoom-unit { margin-right: 2px; }
.zoom-fit {
  appearance: none;
  border: 1px solid rgba(255,255,255,.13);
  background: rgba(255,255,255,.06);
  color: #c4ced8;
  height: 27px;
  padding: 0 7px;
  border-radius: 6px;
  font-size: 10.5px;
  cursor: pointer;
  margin-left: 2px;
}
.zoom-fit:hover { background: rgba(255,255,255,.12); color: #fff; }
.preview-stage.is-custom-zoom {
  display: block;
  overflow: auto;
  padding: 30px;
}
.preview-stage.is-custom-zoom .paper-shell { margin: 0 auto; }

.preview-stage {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 26px;
}
.stage-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .5;
  background-image:
    linear-gradient(rgba(255, 255, 255, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .025) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(ellipse at center, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 20%, transparent 78%);
}
.paper-shell {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  z-index: 1;
  transition: width .18s ease, height .18s ease;
}
#paperHost {
  transform-origin: top left;
  transition: transform .2s ease;
  will-change: transform;
  flex: 0 0 auto;
}
.paper-shell.is-folded {
  width: 100% !important;
  height: 100% !important;
  display: block !important;
}
.stage-caption {
  position: absolute;
  left: 50%;
  bottom: 9px;
  transform: translateX(-50%);
  z-index: 2;
  font-size: 10.5px;
  color: rgba(228, 237, 246, .72);
  letter-spacing: .03em;
  white-space: nowrap;
  pointer-events: none;
  max-width: 92%;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 4px 9px;
  border-radius: 5px;
  background: rgba(19, 24, 31, .68);
  backdrop-filter: blur(4px);
}

/* paper */
.paper {
  position: relative;
  background: #fff;
  color: #111;
  box-shadow: var(--shadow-paper);
  overflow: hidden;
  flex: 0 0 auto;
  border-radius: 1px;
  container-type: inline-size;
}
.paper.is-empty { box-shadow: 0 2px 4px rgba(0, 0, 0, .15), 0 22px 60px rgba(0, 0, 0, .32); }

.dc-panel {
  position: absolute;
  overflow: hidden;
  z-index: 1;
}
.dc-panel.is-base {
  background:
    repeating-linear-gradient(-45deg, rgba(0, 0, 0, .018) 0 6px, transparent 6px 12px);
}
.dc-panel-inner {
  position: absolute;
  inset: 0;
}
.dc-panel-inner.is-rotated { transform: rotate(180deg); }

.dc-card {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: var(--pad-y) var(--pad-x);
  overflow: hidden;
  color: var(--name-color, #111);
}
.dc-header {
  flex: 0 0 auto;
  text-align: center;
  font-size: var(--header-size, 13pt);
  line-height: 1.2;
  letter-spacing: .08em;
  color: #303030;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 1.8mm;
  font-weight: 500;
}
.dc-main {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  transform: translate(var(--name-dx, 0), var(--name-dy, 0));
}
.dc-name {
  display: inline-block;
  flex: 0 0 auto;
  font-family: var(--name-font);
  font-size: var(--name-size, 140pt);
  font-weight: var(--name-weight, 700);
  font-style: var(--name-style, normal);
  line-height: 1.06;
  letter-spacing: .02em;
  white-space: nowrap;
  max-width: none;
  transform: scaleX(var(--name-sx, 1));
  transform-origin: center center;
  color: var(--name-color, #111);
}
.dc-sub {
  flex: 0 0 auto;
  text-align: center;
  font-size: var(--sub-size, 12pt);
  line-height: 1.25;
  color: #3b3b3b;
  margin-top: 1.4mm;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: .04em;
  max-width: 100%;
}
.dc-seat {
  position: absolute;
  top: calc(var(--pad-y) - 1mm);
  right: var(--pad-x);
  font-size: 9pt;
  line-height: 1.2;
  color: #4a4a4a;
  letter-spacing: .05em;
  font-weight: 500;
}
.dc-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4mm;
  color: #c2c9d0;
}
.dc-placeholder .ph-name {
  font-family: var(--font);
  font-size: 92pt;
  line-height: 1;
  font-weight: 700;
  letter-spacing: .08em;
  color: #e5e9ee;
}
.dc-placeholder .ph-tip {
  font-family: var(--font);
  font-size: 10pt;
  letter-spacing: .18em;
  color: #c0c8d1;
}

.fold-line {
  position: absolute;
  pointer-events: none;
  z-index: 3;
  opacity: .9;
}
.fold-line::before {
  content: "";
  position: absolute;
  inset: 0;
  border-top: 1px dashed rgba(90, 104, 120, .68);
}
.fold-line.is-horizontal { height: 0; }
.fold-line.is-vertical { width: 0; }
.fold-line.is-vertical::before {
  border-top: 0;
  border-left: 1px dashed rgba(90, 104, 120, .68);
}
.fold-pill {
  position: absolute;
  z-index: 4;
  top: 0;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, .9);
  border: 1px solid rgba(120, 132, 145, .28);
  border-radius: 99px;
  color: #7a8794;
  font-family: var(--font);
  font-size: 7px;
  line-height: 1;
  padding: 3px 6px;
  letter-spacing: .04em;
  white-space: nowrap;
  pointer-events: none;
}
.fold-pill.is-vertical {
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) rotate(90deg);
}

.panel-tag {
  position: absolute;
  z-index: 4;
  top: 4px;
  left: 6px;
  font-family: var(--font);
  font-size: 6.5px;
  line-height: 1;
  color: #9aa5b0;
  background: rgba(255, 255, 255, .82);
  border: 1px solid rgba(130, 142, 155, .22);
  border-radius: 3px;
  padding: 2px 4px;
  letter-spacing: .02em;
  pointer-events: none;
}
.panel-tag.is-base { color: #a8b1ba; }

.crop-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
  color: #9aa5b0;
  opacity: .85;
}
.crop-layer.is-off { display: none; }
.flat-outline {
  position: absolute;
  z-index: 2;
  border: 1px dashed rgba(120, 132, 145, .34);
  pointer-events: none;
}

/* folded mock-up */
.fold-mockup {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  perspective: 1200px;
}
.fold-mockup-card {
  position: relative;
  transform: rotateX(7deg) rotateY(-8deg);
  transform-style: preserve-3d;
  box-shadow: 0 30px 60px rgba(0, 0, 0, .5), 0 8px 18px rgba(0, 0, 0, .28);
  background: #fff;
  border-radius: 1.5px;
  overflow: hidden;
}
.fold-mockup-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(112deg, rgba(255, 255, 255, .35), transparent 32%, rgba(0, 0, 0, .02) 78%);
}
.fold-mockup-floor {
  width: 68%;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(0, 0, 0, .48), transparent 70%);
  filter: blur(3px);
}
.fold-mockup-label {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  color: rgba(220, 231, 241, .5);
  font-size: 10.5px;
  letter-spacing: .04em;
  white-space: nowrap;
}
.folded-scene {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  display: grid;
  place-items: center;
  padding: 20px;
}
.folded-paper-shell { transform-origin: center center; }

/* preview footer */
.preview-footer {
  flex: 0 0 auto;
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  background: #fbfcfd;
  color: var(--ink);
  border-top: 1px solid rgba(0, 0, 0, .12);
  position: relative;
  z-index: 3;
}
.preview-meta {
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.5;
}
.preview-meta .meta-strong { color: var(--ink-2); font-weight: 600; }
.preview-meta .meta-sep {
  width: 1px;
  height: 12px;
  background: var(--line-strong);
  margin: 0 2px;
}
.preview-meta .warn { color: var(--danger); font-weight: 600; }
.footer-settings {
  flex: 0 0 auto;
  font-size: 10.5px;
  color: #66798a;
  text-decoration-color: rgba(102, 121, 138, .3);
}
.footer-settings:hover { color: var(--primary); }
.print-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.settings-section.is-flash {
  animation: section-flash 1.3s ease;
}
@keyframes section-flash {
  0%, 100% { box-shadow: var(--shadow-sm); }
  25% { box-shadow: 0 0 0 3px rgba(31, 77, 122, .18), var(--shadow-sm); }
}

/* ---------------- buttons / inputs ---------------- */
.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 8px;
  height: 36px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 12.5px;
  line-height: 1;
  font-weight: 500;
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease, transform .08s ease;
  white-space: nowrap;
  text-decoration: none;
}
.btn svg { width: 17px; height: 17px; flex: 0 0 auto; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 2px 5px rgba(31, 77, 122, .18);
}
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-outline {
  background: #fff;
  border-color: var(--line-strong);
  color: var(--ink-2);
}
.btn-outline:hover:not(:disabled) { border-color: #aebbc8; background: #f9fafb; }
.btn-soft {
  background: var(--primary-soft);
  border-color: transparent;
  color: var(--primary);
}
.btn-soft:hover:not(:disabled) { background: var(--primary-soft-2); }
.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}
.btn-ghost:hover:not(:disabled) { background: #f0f3f6; color: var(--ink-2); }
.btn-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}
.btn-danger:hover:not(:disabled) { background: #9d342d; border-color: #9d342d; }
.btn-sm { height: 32px; padding: 0 11px; font-size: 12px; border-radius: 7px; }
.btn-icon { width: 36px; padding: 0; flex: 0 0 auto; }
.btn-count {
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .18);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
}
.btn-primary:disabled .btn-count { background: rgba(255, 255, 255, .12); }

.text-btn {
  appearance: none;
  background: none;
  border: 0;
  padding: 2px;
  color: var(--primary);
  font-size: 11.5px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(31, 77, 122, .3);
  white-space: nowrap;
}
.text-btn:hover { text-decoration-color: currentColor; }
.text-btn.danger { color: var(--danger); text-decoration-color: rgba(179, 64, 56, .26); }

.select, .input {
  width: 100%;
  height: 36px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
  border-radius: 8px;
  padding: 0 11px;
  font-size: 12.5px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.select {
  appearance: none;
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%2368737f' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  cursor: pointer;
}
.input:hover, .select:hover { border-color: #b5c1cd; }
.input:focus, .select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(31, 77, 122, .11);
}
.input::placeholder { color: #a7b1bc; }
.input-size { text-align: center; padding: 0 4px; font-variant-numeric: tabular-nums; }
.select-with-btn { display: flex; gap: 8px; }
.select-with-btn .select { flex: 1 1 auto; min-width: 0; }

.range {
  appearance: none;
  width: 100%;
  height: 22px;
  background: transparent;
  cursor: pointer;
}
.range::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 99px;
  background: linear-gradient(to right, var(--primary) 0 var(--range-pct, 55%), #dbe2e9 var(--range-pct, 55%) 100%);
}
.range::-moz-range-track { height: 4px; border-radius: 99px; background: #dbe2e9; }
.range::-moz-range-progress { height: 4px; border-radius: 99px; background: var(--primary); }
.range::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--primary);
  box-shadow: 0 1px 4px rgba(23, 33, 43, .25);
  margin-top: -6px;
}
.range::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--primary);
  box-shadow: 0 1px 4px rgba(23, 33, 43, .25);
}

/* ---------------- settings ---------------- */
.settings-pane {
  min-width: 0;
  min-height: 0;
  background: #f3f5f8;
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}
.settings-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-gutter: stable;
}
.settings-scroll::-webkit-scrollbar { width: 9px; }
.settings-scroll::-webkit-scrollbar-track { background: transparent; }
.settings-scroll::-webkit-scrollbar-thumb {
  background: #cbd4de;
  border-radius: 99px;
  border: 3px solid #f3f5f8;
}
.settings-scroll::-webkit-scrollbar-thumb:hover { background: #b5c1cd; }

.settings-section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  flex: 0 0 auto;
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 11px;
}
.section-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.section-title h2 {
  margin: 0;
  font-size: 14px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: .03em;
  color: var(--ink);
}
.step {
  width: 23px;
  height: 23px;
  border-radius: 7px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 9.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: .01em;
  font-variant-numeric: tabular-nums;
}
.pill {
  display: inline-flex;
  align-items: center;
  height: 23px;
  padding: 0 8px;
  border-radius: 99px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.pill-quiet { background: #f1f4f7; color: var(--muted); font-weight: 500; }

.roster-empty {
  border: 1px dashed #c9d3dd;
  background: #fbfcfd;
  border-radius: 11px;
  padding: 18px 14px 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
}
.empty-icon { width: 38px; height: 38px; color: #8ba0b3; }
.empty-icon svg { width: 38px; height: 38px; }
.roster-empty p { margin: 0; font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.empty-hint { font-size: 10px; color: #9ba6b1; }

.roster-toolbar { display: flex; align-items: center; gap: 6px; margin-bottom: 9px; }
.roster-toolbar .danger { margin-left: auto; }

.roster-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 160px;
  overflow-y: auto;
  overscroll-behavior: contain;
  margin: 0 -4px;
  padding: 2px 4px;
}
.roster-list::-webkit-scrollbar { width: 6px; }
.roster-list::-webkit-scrollbar-thumb { background: #d2dae2; border-radius: 99px; }
.roster-item {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  min-height: 33px;
  padding: 3px 5px 3px 4px;
  border-radius: 7px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease;
  user-select: none;
}
.roster-item:hover { background: #f5f7fa; }
.roster-item.is-active {
  background: var(--primary-soft);
  border-color: #c9ddeb;
}
.roster-num {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: #f1f4f7;
  color: #8894a1;
  font-size: 9.5px;
  display: grid;
  place-items: center;
  font-variant-numeric: tabular-nums;
}
.roster-item.is-active .roster-num { background: var(--primary); color: #fff; }
.roster-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-2);
}
.roster-meta {
  margin-left: 5px;
  font-size: 10px;
  font-weight: 400;
  color: var(--muted-2);
}
.roster-del {
  appearance: none;
  border: 0;
  background: transparent;
  width: 25px;
  height: 25px;
  border-radius: 5px;
  color: #a7b1bc;
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity .12s ease, background .12s ease, color .12s ease;
}
.roster-item:hover .roster-del, .roster-item.is-active .roster-del { opacity: 1; }
.roster-del:hover { background: var(--danger-soft); color: var(--danger); }
.roster-del svg { width: 14px; height: 14px; }
.roster-tip {
  margin-top: 8px;
  font-size: 10px;
  color: #94a0ac;
  line-height: 1.5;
}

/* mode cards */
.mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-bottom: 10px;
}
.mode-card {
  appearance: none;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 9px;
  padding: 9px 9px 8px;
  cursor: pointer;
  text-align: left;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 8px;
  row-gap: 1px;
  align-items: center;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
  min-height: 58px;
}
.mode-card:hover { border-color: #b6c6d4; background: #fbfcfd; }
.mode-card.is-active {
  border-color: var(--primary);
  background: #f7fbfe;
  box-shadow: inset 0 0 0 1px var(--primary);
}
.mode-name {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-2);
  line-height: 1.3;
  align-self: end;
}
.mode-sub {
  font-size: 9px;
  color: var(--muted-2);
  line-height: 1.3;
  align-self: start;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mode-mini {
  grid-row: 1 / span 2;
  width: 46px;
  height: 38px;
  position: relative;
  border: 1px solid #b6c2ce;
  border-radius: 2px;
  background: #fff;
  flex: 0 0 auto;
  color: #94a1ae;
  overflow: hidden;
}
.mode-card.is-active .mode-mini { border-color: #6e93b3; }
.mini-face {
  position: absolute;
  left: 0;
  right: 0;
  height: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mini-face::after {
  content: "";
  width: 14px;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
  box-shadow: 0 4px 0 currentColor;
  opacity: .7;
}
.mini-face.top { top: 0; transform: rotate(180deg); border-bottom: 1px dashed #c5ced7; }
.mini-face.bottom { bottom: 0; }
.mini-face.top::after { opacity: .38; }
.mode-mini[data-mini="trifold"] .mini-face { height: 33.33%; }
.mode-mini[data-mini="trifold"] .mini-face.top { top: 0; border-bottom: 1px dashed #c5ced7; }
.mode-mini[data-mini="trifold"] .mini-face.mid { top: 33.33%; border-bottom: 1px dashed #c5ced7; }
.mode-mini[data-mini="trifold"] .mini-face.base { top: 66.66%; background: repeating-linear-gradient(-45deg, #eef2f5 0 3px, #fff 3px 6px); }
.mode-mini[data-mini="company-tent"] .mini-face.top,
.mode-mini[data-mini="company-tent-long"] .mini-face.top { height: 38%; }
.mode-mini[data-mini="company-tent"] .mini-face.bottom,
.mode-mini[data-mini="company-tent-long"] .mini-face.bottom { height: 38%; }
.mode-mini[data-mini="company-tent"] .mini-band,
.mode-mini[data-mini="company-tent-long"] .mini-band {
  position: absolute;
  left: 0;
  right: 0;
  top: 38%;
  height: 24%;
  background: #f4e8ec;
  border-top: 1px dashed #c5aab4;
  border-bottom: 1px dashed #c5aab4;
}
.mode-mini[data-mini="flat"] { background: #fbfcfd; }.mode-mini[data-mini="flat"] .mini-card {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 31px;
  height: 20px;
  border: 1px solid #9fadb9;
  border-radius: 1px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mode-mini[data-mini="flat"] .mini-card::after {
  content: "";
  width: 12px;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
  box-shadow: 0 4px 0 currentColor;
  opacity: .55;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field-label {
  font-size: 10.5px;
  color: var(--muted);
  line-height: 1.2;
  letter-spacing: .02em;
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.field-label em { font-style: normal; color: #a1abb6; font-size: 9.5px; }
.field-label-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.field-note { font-size: 9.5px; color: #94a0ac; text-align: right; }
.inline-hint {
  margin: 8px 0 0;
  font-size: 10px;
  line-height: 1.55;
  color: #8c98a4;
}
.local-print-strip {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  background: linear-gradient(145deg, #f6fbfe, #eef6fc);
  border: 1px solid #d5e3ef;
  border-radius: 11px;
  box-shadow: var(--shadow-sm);
}
.local-print-strip-copy {
  min-width: 0;
  flex: 1 1 auto;
}
.local-print-strip-copy b {
  display: block;
  color: var(--ink-2);
  font-size: 11.5px;
  line-height: 1.3;
}
.local-print-strip-copy span {
  display: block;
  margin-top: 1px;
  color: #7d8b99;
  font-size: 9px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.local-print-strip-actions {
  display: flex;
  gap: 5px;
  flex: 0 0 auto;
}
.local-print-strip-actions .btn {
  height: 29px;
  padding: 0 8px;
  font-size: 10.5px;
  border-radius: 6px;
}
.warning-hint {
  margin: 8px 0 0;
  border: 1px solid #f0d9bf;
  background: #fdf8f0;
  color: #9a6323;
  border-radius: 7px;
  padding: 7px 9px;
  font-size: 10px;
  line-height: 1.55;
}

/* typography controls */
.text-grid { grid-template-columns: 1.18fr .82fr; align-items: end; }
.size-input-row {
  display: grid;
  grid-template-columns: 27px minmax(0, 1fr) auto 27px;
  gap: 4px;
  align-items: center;
}
.size-input-row .input-size { height: 32px; font-size: 12px; }
.size-unit { font-size: 9.5px; color: #98a3ae; padding: 0 1px; }
.range-solo { margin-top: 7px; }
.range-solo .range { height: 18px; }
.range-meta { min-height: 13px; display: flex; justify-content: flex-end; gap: 8px; }
.range-meta .field-note { font-size: 9px; color: #98a3ae; line-height: 1.3; }
.meeting-title-input { margin-top: 8px; }
.range-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 58px 28px;
  gap: 6px;
  align-items: center;
}
.step-btn {
  appearance: none;
  width: 28px;
  height: 32px;
  border: 1px solid var(--line);
  background: #fbfcfd;
  border-radius: 7px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: border-color .12s ease, background .12s ease, color .12s ease;
}
.step-btn:hover { border-color: #b8c5d2; background: #f3f6f9; color: var(--ink-2); }
.style-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 9px;
  flex-wrap: wrap;
}
.style-btn {
  appearance: none;
  height: 32px;
  min-width: 48px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink-2);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 10px;
  transition: border-color .12s ease, background .12s ease, color .12s ease;
}
.style-btn b { font-family: Georgia, "Times New Roman", serif; font-size: 15px; line-height: 1; }
.style-btn i { font-family: Georgia, "Times New Roman", serif; font-size: 15px; line-height: 1; }
.style-btn:hover { border-color: #b8c5d2; }
.style-btn[aria-pressed="true"] {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}
.switch-inline {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  font-size: 10px;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}
.switch-inline + .switch-inline { margin-left: 2px; }
.fit-mode-hint {
  margin-top: 7px;
  color: #8793a0;
  font-size: 9px;
  line-height: 1.45;
}

.switch {
  position: relative;
  display: inline-flex;
  width: 34px;
  height: 20px;
  flex: 0 0 auto;
  cursor: pointer;
}
.switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
  z-index: 2;
}
.switch-track {
  width: 34px;
  height: 20px;
  border-radius: 99px;
  background: #ccd5de;
  position: relative;
  transition: background .16s ease;
  pointer-events: none;
}
.switch-track::after {
  content: "";
  position: absolute;
  left: 2px;
  top: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(23, 33, 43, .24);
  transition: transform .16s ease;
}
.switch input:checked + .switch-track { background: var(--primary); }
.switch input:checked + .switch-track::after { transform: translateX(14px); }
.switch input:focus-visible + .switch-track { box-shadow: 0 0 0 3px rgba(31, 77, 122, .16); }
.switch input:disabled + .switch-track { background: #e0e6ec; }
.switch input:disabled + .switch-track::after { opacity: .7; }

.sub-options {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 13px;
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid #eef1f4;
}
.check-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  color: var(--muted);
  cursor: pointer;
  min-height: 22px;
}
.check-line input {
  appearance: none;
  width: 14px;
  height: 14px;
  border: 1px solid #b8c4d0;
  border-radius: 4px;
  background: #fff;
  margin: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: 0 0 auto;
}
.check-line input:checked {
  background: var(--primary);
  border-color: var(--primary);
}
.check-line input:checked::after {
  content: "";
  width: 7px;
  height: 4px;
  border-left: 1.5px solid #fff;
  border-bottom: 1.5px solid #fff;
  transform: rotate(-45deg) translate(0, -1px);
}
.check-line input:focus-visible { outline: 3px solid rgba(31, 77, 122, .13); }
.header-option {
  margin-top: 11px;
  padding-top: 10px;
  border-top: 1px solid #eef1f4;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toggle-list {
  display: flex;
  flex-direction: column;
  margin-top: 8px;
  border-top: 1px solid #eef1f4;
}
.toggle-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px solid #f1f4f7;
  cursor: pointer;
}
.toggle-line:last-child { border-bottom: 0; padding-bottom: 2px; }
.toggle-line b { display: block; font-size: 11px; font-weight: 500; color: var(--ink-2); line-height: 1.35; }
.toggle-line small { display: block; font-size: 9.5px; color: #98a3ae; line-height: 1.4; margin-top: 1px; }
.settings-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #eef1f4;
}
.save-state { font-size: 9.5px; color: #9aa5b0; }

/* ---------------- modal ---------------- */
#modalRoot:empty { display: none; }
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(14, 21, 29, .56);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  animation: overlay-in .16s ease both;
}
.modal {
  width: min(620px, 100%);
  max-height: min(88vh, 860px);
  background: #fff;
  border-radius: 15px;
  box-shadow: 0 26px 80px rgba(0, 0, 0, .3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modal-in .18s cubic-bezier(.2, .8, .2, 1) both;
}
.modal.modal-wide { width: min(900px, 100%); }
.modal.modal-sm { width: min(440px, 100%); }
.modal-head {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 17px 20px 14px;
  border-bottom: 1px solid #edf1f4;
}
.modal-title h2 { margin: 0; font-size: 16px; line-height: 1.3; font-weight: 700; letter-spacing: .02em; }
.modal-title p { margin: 4px 0 0; font-size: 11px; line-height: 1.5; color: var(--muted); }
.modal-close {
  appearance: none;
  border: 0;
  background: #f4f6f8;
  color: var(--muted);
  width: 30px;
  height: 30px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: 0 0 auto;
  transition: background .12s ease, color .12s ease;
}
.modal-close:hover { background: #e9edf1; color: var(--ink); }
.modal-close svg { width: 16px; height: 16px; }
.modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 20px;
}
.modal-foot {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 13px 20px;
  border-top: 1px solid #edf1f4;
  background: #fbfcfd;
}
.modal-foot .foot-left { margin-right: auto; font-size: 10px; color: #95a0ab; }
.modal-foot .btn { height: 36px; }

/* import modal */
.import-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(260px, .85fr);
  gap: 16px;
}
.import-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.import-label { font-size: 11px; font-weight: 600; color: var(--ink-2); }
.import-textarea {
  width: 100%;
  min-height: 260px;
  resize: vertical;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  padding: 11px 12px;
  font-family: var(--font);
  font-size: 12px;
  line-height: 1.75;
  color: var(--ink);
  background: #fdfefe;
  outline: none;
  tab-size: 8;
}
.import-textarea::placeholder { color: #aab4be; line-height: 1.75; }
.import-help {
  margin-top: 7px;
  font-size: 10px;
  color: #949faa;
  line-height: 1.55;
}
.import-help code {
  background: #f2f5f8;
  border: 1px solid #e4e9ee;
  border-radius: 4px;
  padding: 1px 4px;
  font-family: Consolas, monospace;
  font-size: 9.5px;
  color: #5a6875;
}
.dropzone {
  border: 1px dashed #c4d0db;
  border-radius: 10px;
  background: #fafcfd;
  padding: 14px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}
.dropzone:hover, .dropzone.is-drag { border-color: var(--primary); background: var(--primary-soft); }
.dropzone svg { width: 26px; height: 26px; color: #91a1b1; }
.dropzone b { font-size: 11px; font-weight: 600; color: var(--ink-2); }
.dropzone span { font-size: 9.5px; color: #98a3ae; }
.file-status {
  display: none;
  margin-top: 6px;
  font-size: 10px;
  color: var(--primary);
  word-break: break-all;
}
.file-status.is-visible { display: block; }
.import-summary {
  margin-top: 12px;
  border-top: 1px solid #eef1f4;
  padding-top: 10px;
}
.import-summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 10.5px;
  color: var(--muted);
  margin-bottom: 7px;
}
.import-summary-head b { color: var(--primary); font-size: 12px; }
.import-preview-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 160px;
  overflow-y: auto;
  font-size: 10.5px;
}
.import-preview-row {
  display: flex;
  gap: 6px;
  align-items: baseline;
  padding: 3px 0;
  border-bottom: 1px dotted #eef1f4;
  color: var(--ink-2);
}
.import-preview-row .idx { color: #a4aeb9; width: 18px; flex: 0 0 auto; text-align: right; font-variant-numeric: tabular-nums; }
.import-preview-row .nm { font-weight: 600; }
.import-preview-row .mt { color: #98a3ae; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.import-more { padding: 5px 0 0 24px; color: #a0abb6; font-size: 9.5px; }
.import-empty { color: #a1abb5; font-size: 10px; padding: 10px 0; text-align: center; }
.import-options {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 12px;
  border-top: 1px solid #eef1f4;
}
.radio-line { display: inline-flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--muted); cursor: pointer; }
.radio-line input { accent-color: var(--primary); margin: 0; }
.import-error {
  margin-top: 8px;
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid #f2d6d3;
  border-radius: 7px;
  padding: 8px 10px;
  font-size: 10.5px;
  line-height: 1.5;
}

/* preflight */
.preflight-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: #e9edf1;
  border: 1px solid #e9edf1;
  border-radius: 10px;
  overflow: hidden;
}
.pf-cell { background: #fff; padding: 9px 11px; min-width: 0; }
.pf-cell .k { display: block; font-size: 9.5px; color: #98a3ae; margin-bottom: 2px; }
.pf-cell .v { display: block; font-size: 12px; color: var(--ink-2); font-weight: 600; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-cell .v small { font-weight: 400; color: var(--muted); font-size: 10px; }
.preflight-printer {
  margin-top: 12px;
  border: 1px solid #d8e5f0;
  background: #f4f9fd;
  border-radius: 9px;
  padding: 10px 12px;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: #33546f;
  font-size: 10.5px;
  line-height: 1.55;
}
.preflight-printer svg { width: 17px; height: 17px; flex: 0 0 auto; margin-top: 1px; color: #4f7898; }
.preflight-printer b { color: var(--primary); }
.checklist { margin: 13px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.checklist li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 10.5px;
  line-height: 1.55;
  color: #5f6c79;
}
.checklist li::before {
  content: "";
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  margin-top: 1px;
  border-radius: 50%;
  background: #eaf1f7 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath d='M2 5.2 4.1 7.1 8 2.8' fill='none' stroke='%231f4d7a' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/10px no-repeat;
}
.checklist li b { color: var(--ink-2); font-weight: 600; }
.preflight-skip {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 13px;
  font-size: 10px;
  color: var(--muted);
  cursor: pointer;
}
.preflight-skip input { accent-color: var(--primary); margin: 0; }

/* help */
.help-section { margin-bottom: 18px; }
.help-section:last-child { margin-bottom: 0; }
.help-section h3 {
  margin: 0 0 7px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 7px;
}
.help-section h3 span {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.help-section p, .help-section li { font-size: 11px; line-height: 1.75; color: #5d6a77; margin: 0; }
.help-section ul { margin: 0; padding-left: 17px; }
.help-section li { margin: 2px 0; }
.help-section kbd {
  display: inline-block;
  background: #f3f5f8;
  border: 1px solid #dfe5eb;
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 0 4px;
  font-family: Consolas, monospace;
  font-size: 9.5px;
  color: #4d5a67;
  line-height: 1.5;
}
.help-callout {
  background: #f8fafc;
  border-left: 3px solid var(--primary);
  border-radius: 0 7px 7px 0;
  padding: 9px 11px;
  margin-top: 8px;
  font-size: 10.5px;
  line-height: 1.65;
  color: #5b6875;
}

/* toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 12px);
  z-index: 200;
  background: rgba(22, 30, 39, .94);
  color: #fff;
  padding: 9px 15px;
  border-radius: 8px;
  font-size: 11.5px;
  line-height: 1.4;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .22);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  max-width: calc(100vw - 32px);
  text-align: center;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.toast.is-error { background: rgba(148, 45, 39, .96); }
.toast.is-success { background: rgba(37, 105, 77, .96); }

/* ---------------- theme refresh ---------------- */
.app-header {
  background: linear-gradient(180deg, #fffdf9 0%, #fbf7ef 100%);
}
.brand-mark {
  color: #fff;
  background: linear-gradient(145deg, #2c6d64, #164b46);
  border-color: transparent;
}
.settings-pane { background: #f7f2ea; }
.settings-scroll {
  padding: 0 14px 14px;
  scrollbar-gutter: stable;
}
.settings-scroll::-webkit-scrollbar-thumb {
  background: #d3c9bb;
  border-color: #f7f2ea;
}
.settings-scroll::-webkit-scrollbar-thumb:hover { background: #bfb3a2; }
.settings-section {
  background: var(--panel);
  border-color: #e5ded2;
}
.preview-pane {
  background:
    radial-gradient(900px 500px at 48% 36%, #2a3b39 0%, var(--stage) 46%, var(--stage-2) 100%);
}
.preview-toolbar {
  background: rgba(15, 26, 25, .30);
  border-bottom-color: rgba(255, 255, 255, .08);
}
.segmented-btn.is-active {
  background: #fbf8f2;
  color: var(--primary);
}
.mode-card.is-active {
  border-color: var(--primary);
  background: linear-gradient(160deg, #f2f9f6, #e7f2ee);
  box-shadow: 0 0 0 2px rgba(31, 97, 90, .10);
}
.mode-card.is-active .mode-mini { border-color: #79a69e; }
.local-print-strip {
  position: sticky;
  top: 0;
  z-index: 40;
  margin: 0 -14px;
  padding: 12px 14px;
  border: 0;
  border-bottom: 1px solid #ded5c7;
  border-radius: 0;
  background: rgba(255, 253, 249, .98);
  box-shadow: 0 8px 18px rgba(32, 43, 43, .08);
  backdrop-filter: blur(10px);
}
.local-print-strip-copy b { color: var(--primary); }
.local-print-strip-actions { gap: 6px; }
.print-btn {
  border: 1px solid transparent;
  color: #fff !important;
  box-shadow: 0 2px 5px rgba(30, 43, 40, .13);
}
.print-btn-current { background: #2f7d75 !important; border-color: #2f7d75 !important; }
.print-btn-current:hover { background: #266a63 !important; }
.print-btn-range { background: #b17c3c !important; border-color: #b17c3c !important; }
.print-btn-range:hover { background: #996a31 !important; }
.print-btn-all { background: #1b4e49 !important; border-color: #1b4e49 !important; }
.print-btn-all:hover { background: #143f3b !important; }
.print-btn:disabled {
  opacity: .45;
  box-shadow: none;
}
.app-footer {
  flex: 0 0 38px;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 22px;
  border-top: 1px solid var(--line);
  background: rgba(255, 253, 249, .97);
  color: var(--muted);
  font-size: 11px;
}
.footer-legal {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}
.footer-legal a {
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}
.footer-legal a:hover { color: var(--primary); }
.miit-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  padding: 3px 6px;
  flex: 0 0 auto;
  border-radius: 3px;
  background: #1b5c9b;
  overflow: hidden;
}
.miit-mark img {
  display: block;
  height: 16px;
  width: auto;
}
.beian-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 21px;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 2px;
}
.beian-mark img {
  display: block;
  height: 21px;
  width: auto;
}
.footer-sep { color: #b9b0a3; }
.footer-product {
  color: #9a9286;
  white-space: nowrap;
}

/* ---------------- auth gate ---------------- */
body.auth-lock .app-shell { visibility: hidden; }
.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(900px 600px at 50% 30%, #29423f 0%, #182b29 48%, #0e1d1c 100%);
}
.auth-gate[hidden] { display: none; }
.auth-shell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-height: calc(100dvh - 40px);
}
.auth-legal {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, .58);
  font-size: 11px;
}
.auth-legal a {
  color: rgba(255, 255, 255, .58);
  text-decoration: none;
  white-space: nowrap;
}
.auth-legal a:hover { color: rgba(255, 255, 255, .9); }
.auth-legal .beian-mark { height: 18px; border-radius: 2px; }
.auth-legal .beian-mark img { height: 18px; }
.auth-card {
  width: min(432px, calc(100vw - 32px));
  max-height: calc(100dvh - 100px);
  overflow-y: auto;
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 18px;
  background: #fffdf9;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .35);
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}
.auth-mark {
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid #d5e5e0;
}
.auth-mark svg { width: 38px; height: 38px; }
.auth-brand h1 { margin: 0; font-size: 21px; letter-spacing: .04em; color: var(--ink); }
.auth-brand p { margin: 3px 0 0; font-size: 12px; color: var(--muted); }
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  margin-bottom: 18px;
  border-radius: 9px;
  background: #f2ede4;
}
.auth-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 7px;
  padding: 8px 6px;
  font-size: 13px;
  cursor: pointer;
}
.auth-tab.is-active {
  background: #fffdf9;
  color: var(--primary);
  box-shadow: 0 1px 4px rgba(38, 48, 43, .08);
  font-weight: 700;
}
.auth-form { display: flex; flex-direction: column; gap: 11px; }
.auth-field { display: flex; flex-direction: column; gap: 5px; }
.auth-field span { font-size: 12px; color: var(--ink-2); font-weight: 600; }
.auth-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}
.auth-field input {
  height: 42px;
  width: 100%;
  border: 1px solid #dcd4c8;
  border-radius: 8px;
  background: #fffefa;
  color: var(--ink);
  padding: 0 11px;
  outline: none;
  font-size: 14px;
}
.auth-field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(31, 97, 90, .11);
}
.auth-submit { height: 42px; margin-top: 4px; font-size: 14px; }
.auth-error {
  padding: 8px 10px;
  border: 1px solid #efd1cc;
  border-radius: 7px;
  background: #fdf3f1;
  color: #9f403a;
  font-size: 12px;
  line-height: 1.45;
}
.auth-switch { margin: 2px 0 0; text-align: center; color: var(--muted); font-size: 12px; }
.auth-switch button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  padding: 0;
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.auth-note {
  margin: 18px 0 0;
  padding-top: 13px;
  border-top: 1px solid #eee7dc;
  color: #998f82;
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
}
.auth-status { text-align: center; padding: 8px 0 2px; }
.auth-status-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 24px;
  font-weight: 700;
}
.auth-status h2 { margin: 0 0 7px; font-size: 19px; color: var(--ink); }
.auth-status p { margin: 0 0 18px; color: var(--muted); font-size: 13px; line-height: 1.6; }

/* ---------------- header user ---------------- */
.header-actions { display: flex; align-items: center; gap: 8px; min-width: 0; }
.admin-users-btn { position: relative; white-space: nowrap; }
.pending-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: 99px;
  background: #b17c3c;
  color: #fff;
  font-size: 10px;
  line-height: 1;
}
.user-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  max-width: 190px;
  padding: 4px 9px 4px 5px;
  border: 1px solid #ddd5c8;
  border-radius: 99px;
  background: #fffdf9;
  cursor: pointer;
  color: var(--ink-2);
}
.user-chip:hover { border-color: #b9c9c3; background: #f7fbf8; }
.user-avatar {
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.user-chip-text { display: flex; flex-direction: column; min-width: 0; text-align: left; }
.user-chip-text b {
  max-width: 118px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  line-height: 1.2;
}
.user-chip-text small { color: var(--muted-2); font-size: 10px; line-height: 1.3; }

/* ---------------- admin users ---------------- */
.admin-user-list { display: flex; flex-direction: column; gap: 8px; }
.admin-user-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid #e5ded2;
  border-radius: 8px;
  background: #fffdf9;
}
.admin-user-main { flex: 1 1 auto; min-width: 0; }
.admin-user-main b { display: block; font-size: 13px; color: var(--ink-2); }
.admin-user-main > span { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.admin-user-contact { color: #8a8175 !important; }
.admin-user-main .status-pill {
  display: inline-flex;
  width: auto;
  margin: 0 2px;
  padding: 2px 6px;
  vertical-align: 1px;
  white-space: nowrap;
}
.admin-user-actions { display: flex; gap: 5px; flex: 0 0 auto; }
.admin-user-actions .btn { height: 29px; font-size: 11px; padding: 0 8px; }
.status-pill {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 99px;
  font-size: 10px;
  background: #f1ede6;
  color: #81776a;
}
.status-pill.pending { background: #f8edda; color: #946326; }
.status-pill.approved { background: #e7f2ee; color: #286450; }
.status-pill.rejected { background: #faeae7; color: #9c4941; }
.status-pill.disabled { background: #eeeae4; color: #857b6e; }
.admin-empty { padding: 24px 8px; text-align: center; color: var(--muted); font-size: 12px; }
.audit-list {
  display: flex;
  flex-direction: column;
  max-height: 56vh;
  overflow-y: auto;
  border: 1px solid #e5ded2;
  border-radius: 9px;
}
.audit-row {
  display: flex;
  gap: 10px;
  padding: 9px 10px;
  border-bottom: 1px solid #f0eae1;
}
.audit-row:last-child { border-bottom: 0; }
.audit-row time {
  flex: 0 0 145px;
  color: #988e81;
  font-size: 10.5px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}
.audit-main { min-width: 0; flex: 1 1 auto; }
.audit-main b { font-size: 12.5px; color: var(--ink-2); }
.audit-main span { color: var(--muted-2); font-size: 10.5px; }
.audit-action { margin-top: 2px; color: #5f6d68; font-size: 11px; line-height: 1.45; }
.account-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  margin-bottom: 12px;
  border: 1px solid #e5ded2;
  border-radius: 9px;
  background: #fbf8f2;
}
.account-summary .user-avatar { width: 34px; height: 34px; font-size: 14px; }
.account-summary b { display: block; font-size: 14px; color: var(--ink-2); }
.account-summary span { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.account-form .field-grid { grid-template-columns: 1fr 1fr 1fr; }
.account-form .auth-error { margin-top: 9px; }
.account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #eee7dc;
}
.account-actions .btn { font-size: 12px; }

/* ---------------- readability + layout refinements ---------------- */
.workspace {
  grid-template-columns: minmax(0, 1.05fr) minmax(540px, .95fr);
}
.settings-pane { font-size: 15px; }
.settings-pane .section-title h2 { font-size: 16.5px; }
.settings-pane .field-label { font-size: 13px; }
.settings-pane .field-label em { font-size: 11px; }
.settings-pane .select,
.settings-pane .input {
  height: 42px;
  font-size: 14.5px;
}
.settings-pane .inline-hint,
.settings-pane .warning-hint { font-size: 12.5px; }
.settings-pane .mode-name { font-size: 13.5px; }
.settings-pane .mode-sub { font-size: 10.5px; }
.settings-pane .roster-empty p { font-size: 13.5px; }
.settings-pane .empty-hint { font-size: 11.5px; }
.settings-pane .roster-name { font-size: 14.5px; }
.settings-pane .roster-meta { font-size: 11.5px; }
.settings-pane .roster-tip { font-size: 11.5px; }
.settings-pane .section-title .step { font-size: 10.5px; }
.settings-pane .pill { font-size: 12px; }
.settings-pane .field-note { font-size: 11px; }
.settings-pane .fit-mode-hint { font-size: 11.5px; }
.settings-pane .check-line { font-size: 12.5px; }
.settings-pane .style-btn { font-size: 12px; height: 35px; }
.settings-pane .toggle-line b { font-size: 13px; }
.settings-pane .toggle-line small { font-size: 11px; }
.settings-pane .save-state { font-size: 11.5px; }
.settings-pane .btn { font-size: 13px; }
.settings-pane .btn-sm { font-size: 12.5px; }

.layout-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid #eef1f4;
}
.align-tools {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid #e3e9ef;
  border-radius: 9px;
  background: #fafcfd;
}
.align-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.align-head b { font-size: 12px; color: var(--ink-2); }
.align-tools .field-grid { gap: 7px 9px; }
.align-tools .align-check { grid-column: 1 / -1; margin-top: 2px; }
.align-tools .input:disabled { background: #f1f4f7; color: #9aa5b0; }
.align-tools .field-label { font-size: 10.5px; }
.align-tools .input { height: 34px; font-size: 12.5px; }
.align-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
}
.align-foot .text-btn { font-size: 10.5px; }

.center-guide {
  position: absolute;
  z-index: 5;
  top: 0;
  width: 0;
  border-left: 1px dashed rgba(196, 74, 54, .75);
  pointer-events: none;
}
.center-guide.is-editable { pointer-events: auto; cursor: col-resize; }
.center-guide::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -6px;
  width: 12px;
}
.center-guide .guide-label {
  position: absolute;
  top: 8px;
  left: 5px;
  white-space: nowrap;
  background: rgba(255, 255, 255, .94);
  border: 1px solid rgba(196, 74, 54, .35);
  border-radius: 3px;
  color: #a54236;
  font-family: var(--font);
  font-size: 6.5px;
  line-height: 1;
  padding: 3px 5px;
}
.fold-line.is-editable { pointer-events: auto; cursor: row-resize; }
.fold-line.is-editable::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -6px;
  height: 12px;
}
.fold-pill.is-editable {
  background: #fff7f2;
  border-color: rgba(196, 74, 54, .38);
  color: #a54236;
  font-size: 7px;
}
.name-edit-box {
  position: absolute;
  z-index: 6;
  border: 1px dashed rgba(31, 77, 122, .7);
  background: rgba(31, 77, 122, .035);
  cursor: move;
  box-sizing: border-box;
}
.name-edit-box .name-box-label {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, .9);
  color: #3b6a93;
  border: 1px solid rgba(31, 77, 122, .25);
  border-radius: 3px;
  font-family: var(--font);
  font-size: 6.5px;
  line-height: 1;
  padding: 3px 5px;
  white-space: nowrap;
  pointer-events: none;
}
body.is-dragging, body.is-dragging * { cursor: grabbing !important; user-select: none !important; }

.company-band-preview {
  position: absolute;
  left: 0;
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3%;
  padding: 0 3%;
  background: #fff7f9;
  border-top: 1px dashed #d8b8c3;
  border-bottom: 1px dashed #d8b8c3;
  color: #9b6d7c;
  font-family: var(--font);
  font-size: 7px;
  line-height: 1.15;
  letter-spacing: .02em;
  pointer-events: none;
  overflow: hidden;
}
.company-band-preview .cb-side {
  flex: 0 0 17%;
  text-align: center;
  border: 1px dashed #dcc3cb;
  border-radius: 2px;
  padding: 2px 1px;
  font-size: 6px;
}
.company-band-preview .cb-side.is-right { border-style: solid; border-color: transparent; }
.company-band-preview .cb-center {
  flex: 1 1 auto;
  text-align: center;
  font-size: 8px;
  color: #7c5261;
}
.company-band-preview .cb-center small {
  display: block;
  margin-top: 2px;
  font-size: 5.5px;
  color: #b08b97;
  letter-spacing: 0;
}
.company-band-note { margin: 7px 0 0; }
.name-window-tools { margin-top: 8px; }
.settings-global-foot {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 5px 4px;
  border-top: 1px solid #e3e9ef;
}
.local-print-strip-copy b { font-size: 14px; }
.local-print-strip-copy span { font-size: 11px; }
.local-print-strip-actions .btn {
  height: 33px;
  font-size: 12.5px;
  padding: 0 9px;
}
.local-range-btn { padding: 0 7px; }
.footer-range-btn {
  height: 36px;
  padding: 0 9px;
  color: var(--muted);
  font-size: 12px;
}

/* Dialogs are intentionally larger than the dense settings panel */
.modal { width: min(760px, 100%); }
.modal.modal-wide { width: min(1000px, 100%); }
.modal.modal-sm { width: min(540px, 100%); }
.modal-title h2 { font-size: 20px; }
.modal-title p { font-size: 13.5px; }
.modal-body { font-size: 14px; }
.modal-body .field-label { font-size: 13px; }
.modal-body .inline-hint { font-size: 12.5px; }
.import-label { font-size: 13.5px; }
.import-textarea { font-size: 14.5px; }
.import-help { font-size: 12px; }
.import-help code { font-size: 11px; }
.import-summary-head { font-size: 12.5px; }
.import-preview-row { font-size: 12.5px; }
.import-empty { font-size: 12px; }
.radio-line { font-size: 12.5px; }
.checklist li { font-size: 12.5px; }
.preflight-printer { font-size: 12.5px; }
.pf-cell .k { font-size: 11px; }
.pf-cell .v { font-size: 14px; }
.pf-cell .v small { font-size: 11.5px; }
.help-section h3 { font-size: 15px; }
.help-section p,
.help-section li { font-size: 13.5px; }
.help-callout { font-size: 12.5px; }
.preflight-skip { font-size: 12px; }
.modal-foot .foot-left { font-size: 11px; }
.modal .btn { font-size: 13.5px; }
.range-print-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: end;
}
.range-print-dash {
  color: var(--muted-2);
  padding-bottom: 11px;
  font-size: 15px;
}

/* ---------------- print ---------------- */
.print-area { display: none; }

@media print {
  html, body {
    width: auto !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    background: #fff !important;
    margin: 0 !important;
    padding: 0 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  body { overflow: visible !important; }
  .app-shell, .toast, #modalRoot, .print-area .panel-tag, .print-area .fold-pill,
  .print-area .flat-outline, .print-area .dc-placeholder { display: none !important; }
  .print-area { display: block !important; }
  .print-area .sheet {
    display: block;
    position: relative;
    overflow: hidden;
    background: #fff;
    break-inside: avoid;
    page-break-inside: avoid;
    margin: 0;
    padding: 0;
    box-shadow: none;
    border-radius: 0;
  }
  .print-area .sheet:not(:last-child) {
    break-after: page;
    page-break-after: always;
  }
  .print-area.current-only .sheet:not(.is-current) { display: none !important; }
  .print-area .paper { box-shadow: none !important; border-radius: 0 !important; overflow: hidden !important; }
  .print-area .fold-line { opacity: 1 !important; }
  .print-area .fold-line:not(.print-on) { display: none !important; }
  .print-area .crop-layer:not(.print-on) { display: none !important; }
  .print-area .crop-layer { color: #000 !important; opacity: 1 !important; }
  .print-area .fold-line::before { border-color: #b8b8b8 !important; }
  .print-area .dc-card, .print-area .dc-name, .print-area .dc-sub, .print-area .dc-header,
  .print-area .dc-seat { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------------- responsive ---------------- */
@media (max-width: 1240px) {
  .workspace { grid-template-columns: minmax(0, 1.4fr) minmax(370px, .95fr); }
  .settings-scroll { padding: 13px; gap: 10px; }
  .settings-section { padding: 14px; }
  .preview-toolbar { padding: 0 14px; }
  .preview-footer { padding: 10px 14px; }
}

@media (max-width: 1050px) {
  body { overflow: auto; }
  .app-shell { height: auto; min-height: 100dvh; }
  .workspace {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }
  .preview-pane {
    height: 64vh;
    min-height: 470px;
    flex: 0 0 auto;
  }
  .settings-pane {
    border-left: 0;
    border-top: 1px solid var(--line);
    flex: 0 0 auto;
  }
  .settings-scroll {
    overflow: visible;
    padding: 14px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
    gap: 12px;
  }
  .settings-section { padding: 16px; }
  .settings-section:first-child,
  .settings-section:nth-child(2) { grid-column: span 1; }
  .preview-stage { padding: 20px; }
}

@media (max-width: 760px) {
  .app-header { height: 58px; flex-basis: 58px; padding: 0 14px; }
  .brand-mark { width: 36px; height: 36px; border-radius: 10px; }
  .brand-mark svg { width: 28px; height: 28px; }
  .brand-text h1 { font-size: 16px; }
  .brand-text p { display: none; }
  .server-badge { display: none; }
  .btn-ghost.btn-sm { padding: 0 8px; }
  .preview-toolbar {
    height: auto;
    min-height: 52px;
    flex-wrap: wrap;
    gap: 7px;
    padding: 8px 10px;
  }
  .segmented { order: 1; }
  .zoom-readout { order: 2; margin-left: auto; }
  .page-nav { order: 3; width: 100%; justify-content: center; }
  .preview-pane { height: 60vh; min-height: 420px; }
  .preview-stage { padding: 14px; }
  .preview-footer {
    flex-wrap: wrap;
    gap: 9px;
    padding: 10px;
  }
  .preview-meta { width: 100%; font-size: 10.5px; }
  .print-actions { width: 100%; }
  .print-actions .btn { flex: 1 1 0; }
  .settings-scroll { display: flex; flex-direction: column; padding: 10px; gap: 10px; align-items: stretch; }
  .settings-section { padding: 14px; border-radius: 12px; }
  .mode-grid { gap: 6px; }
  .mode-card { grid-template-columns: 40px minmax(0, 1fr); padding: 8px; }
  .mode-mini { width: 40px; height: 34px; }
  .range-row { grid-template-columns: 26px minmax(0, 1fr) 52px 26px; }
  .modal-overlay { padding: 10px; align-items: flex-end; }
  .modal { max-height: 92dvh; border-radius: 15px 15px 10px 10px; }
  .modal-head { padding: 14px 16px 12px; }
  .modal-body { padding: 14px 16px; }
  .modal-foot { padding: 11px 16px; }
  .import-grid { grid-template-columns: 1fr; gap: 13px; }
  .import-textarea { min-height: 190px; }
  .preflight-summary { grid-template-columns: 1fr 1fr; }
  .toast { bottom: 16px; }
}

@media (max-width: 420px) {
  .mode-grid { grid-template-columns: 1fr; }
  .mode-card { grid-template-columns: 46px minmax(0, 1fr); }
  .field-grid { grid-template-columns: 1fr; }
  .preview-pane { height: 56vh; min-height: 390px; }
  .preview-toolbar .segmented-btn { padding: 7px 9px; }
  .page-indicator { font-size: 11px; }
  .preview-meta .meta-sep { display: none; }
}

@media (max-height: 700px) and (min-width: 1051px) {
  .app-header { flex-basis: 56px; height: 56px; }
  .preview-toolbar { flex-basis: 50px; height: 50px; }
  .preview-footer { min-height: 58px; padding-top: 8px; padding-bottom: 8px; }
  .settings-scroll { padding: 11px; gap: 9px; }
  .settings-section { padding: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

@keyframes overlay-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: none; } }
