/* ===== styles.css ===== */
:root {
  color-scheme: light;
  --bg: #eef2f7;
  --panel: rgba(255, 255, 255, 0.96);
  --panel-solid: #ffffff;
  --ink: #152033;
  --muted: #66758a;
  --line: #dce3ec;
  --line-strong: #c6d0dc;
  --primary: #1768e5;
  --primary-dark: #0d50bd;
  --primary-soft: #e9f2ff;
  --danger: #d33b45;
  --danger-soft: #fff0f1;
  --success: #16845b;
  --shadow: 0 14px 34px rgba(23, 38, 62, 0.12);
  --shadow-soft: 0 8px 24px rgba(23, 38, 62, 0.08);
  --topbar-h: 64px;
  --sidebar-w: 340px;
  --inspector-w: 326px;
  --radius: 14px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: Pretendard, "Noto Sans KR", "Malgun Gothic", Apple SD Gothic Neo, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 0%, rgba(90, 162, 255, 0.12), transparent 31rem),
    linear-gradient(180deg, #f4f7fb 0%, #eaf0f6 100%);
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(23, 104, 229, 0.22);
  outline-offset: 2px;
}

svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hidden {
  display: none !important;
}

.visually-hidden {
  position: fixed !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.topbar {
  position: relative;
  z-index: 50;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 18px;
  color: #f8fbff;
  background: linear-gradient(135deg, #0a1220 0%, #111f35 58%, #102c52 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 30px rgba(3, 15, 31, 0.18);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 250px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(145deg, #2a8aff, #145fd1);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.26), 0 7px 18px rgba(21, 103, 223, 0.3);
}

.brand-mark svg {
  width: 24px;
  height: 24px;
}

.brand-block strong,
.brand-block span {
  display: block;
}

.brand-block strong {
  font-size: 15px;
  letter-spacing: 0.08em;
}

.brand-block span {
  margin-top: 2px;
  color: #9fb0c8;
  font-size: 11px;
}

.privacy-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border: 1px solid rgba(107, 230, 184, 0.28);
  border-radius: 999px;
  color: #bff6df;
  background: rgba(18, 142, 98, 0.12);
  font-size: 12px;
  white-space: nowrap;
}

.privacy-pill svg {
  width: 16px;
  height: 16px;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  margin-left: auto;
}

.toolbar-divider {
  width: 1px;
  height: 24px;
  margin: 0 4px;
  background: rgba(255, 255, 255, 0.15);
}

.icon-button,
.ghost-button,
.primary-button,
.secondary-button,
.text-button,
.icon-text-button,
.export-option,
.asset-upload {
  border: 0;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.icon-button:disabled,
.ghost-button:disabled,
.primary-button:disabled,
.secondary-button:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.icon-button {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: #4b5d74;
  background: #fff;
}

.icon-button svg {
  width: 19px;
  height: 19px;
}

.topbar .icon-button {
  color: #dbe7f6;
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
}

.icon-button:not(:disabled):hover,
.topbar .icon-button:not(:disabled):hover {
  color: var(--primary);
  border-color: rgba(23, 104, 229, 0.35);
  background: var(--primary-soft);
}

.topbar .icon-button:not(:disabled):hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
}

.ghost-button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: #dbe7f6;
  background: rgba(255, 255, 255, 0.06);
  font-size: 12px;
  font-weight: 650;
}

.ghost-button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
}

.primary-button,
.secondary-button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 720;
}

.primary-button {
  color: #fff;
  background: linear-gradient(135deg, #2478ed, #1059ce);
  box-shadow: 0 7px 18px rgba(23, 104, 229, 0.2);
}

.primary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(23, 104, 229, 0.28);
}

.primary-button svg {
  width: 17px;
  height: 17px;
}

.secondary-button {
  color: #33445b;
  border: 1px solid var(--line-strong);
  background: #fff;
}

.secondary-button:hover {
  color: var(--primary);
  border-color: rgba(23, 104, 229, 0.42);
  background: #f7faff;
}

.secondary-button.danger {
  color: var(--danger);
  border-color: #efc3c7;
}

.secondary-button.danger:hover {
  background: var(--danger-soft);
}

.secondary-button.full-width {
  width: 100%;
}

.secondary-button.large,
.primary-button.large {
  min-height: 48px;
  padding: 0 22px;
  border-radius: 12px;
  font-size: 14px;
}

.primary-button.danger-fill {
  background: linear-gradient(135deg, #df4d57, #bd2631);
  box-shadow: none;
}

.text-button {
  padding: 4px 0;
  color: var(--primary);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
}

.text-button:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

.danger-text {
  color: var(--danger);
}

.app-shell {
  height: calc(100vh - var(--topbar-h));
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--inspector-w);
  overflow: hidden;
}

.sidebar,
.inspector {
  position: relative;
  z-index: 20;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  backdrop-filter: blur(18px);
}

.sidebar {
  border-right: 1px solid var(--line);
  box-shadow: 5px 0 24px rgba(38, 55, 80, 0.04);
}

.inspector {
  border-left: 1px solid var(--line);
  box-shadow: -5px 0 24px rgba(38, 55, 80, 0.04);
}

.aside-header {
  min-height: 67px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 17px;
  border-bottom: 1px solid var(--line);
}

.aside-header strong,
.aside-header span {
  display: block;
}

.aside-header strong {
  font-size: 15px;
}

.aside-header span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.mobile-close {
  display: none;
}

.panel-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.panel-tabs button {
  min-height: 34px;
  padding: 0 5px;
  border: 0;
  border-radius: 8px;
  color: #6f7d90;
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.panel-tabs button.active {
  color: var(--primary);
  background: #fff;
  box-shadow: 0 2px 8px rgba(29, 49, 79, 0.08);
}

.aside-scroll,
.inspector-content {
  min-height: 0;
  flex: 1;
  overflow: auto;
  overscroll-behavior: contain;
}

.aside-scroll {
  padding: 2px 15px 24px;
}

.settings-panel {
  display: none;
}

.settings-panel.active {
  display: block;
}

.setting-group {
  padding: 18px 0;
  border-bottom: 1px solid #e8edf3;
}

.setting-group.compact {
  padding: 15px 0;
}

.setting-group:last-child {
  border-bottom: 0;
}

.setting-group h2,
.inspector-section h2 {
  margin: 0 0 12px;
  font-size: 13px;
  letter-spacing: -0.01em;
}

.setting-group h3 {
  margin: 14px 0 9px;
  color: #495b72;
  font-size: 12px;
}

.group-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.group-title-row h2,
.group-title-row h3 {
  margin: 0;
}

.group-title-row.subhead {
  margin-top: 16px;
}

.top-gap {
  margin-top: 14px;
}

.field-label {
  display: block;
  margin: 10px 0 6px;
  color: #586a80;
  font-size: 11px;
  font-weight: 700;
}

.control {
  width: 100%;
  min-height: 40px;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  color: var(--ink);
  background: #fff;
  font-size: 13px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(23, 104, 229, 0.1);
  outline: 0;
}

.control.textarea,
textarea.control {
  min-height: 72px;
  resize: vertical;
  line-height: 1.5;
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.template-choice {
  min-height: 75px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: #45566d;
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.template-choice:hover {
  border-color: #a9c7f3;
  background: #f8fbff;
}

.template-choice.active {
  color: var(--primary-dark);
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: 0 0 0 2px rgba(23, 104, 229, 0.08);
}

.template-choice .template-icon {
  width: 38px;
  height: 46px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 5px;
  opacity: 0.75;
}

.template-choice .template-icon svg {
  width: 29px;
  height: 34px;
}

.template-choice strong,
.template-choice small {
  display: block;
}

.template-choice strong {
  font-size: 12px;
}

.template-choice small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.3;
}

.segmented {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f3f6f9;
}

.segmented + .segmented {
  margin-top: 8px;
}

.segmented.two {
  grid-template-columns: repeat(2, 1fr);
  grid-auto-flow: initial;
}

.segmented.wrap {
  display: flex;
  flex-wrap: wrap;
}

.segmented.wrap button {
  min-width: 42px;
  flex: 1;
}

.segmented button {
  min-height: 32px;
  padding: 0 8px;
  border: 0;
  border-radius: 7px;
  color: #637289;
  background: transparent;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.segmented button.active {
  color: var(--primary);
  background: #fff;
  box-shadow: 0 2px 7px rgba(22, 42, 68, 0.1);
}

.custom-paper-fields {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.custom-paper-fields label {
  color: var(--muted);
  font-size: 10px;
}

.custom-paper-fields .control {
  margin-top: 5px;
}

.field-list {
  display: grid;
  gap: 7px;
}

.field-row {
  display: grid;
  grid-template-columns: 24px 72px minmax(0, 1fr) 27px;
  align-items: center;
  gap: 6px;
}

.field-row.header-field-row {
  grid-template-columns: 24px 62px minmax(0, 1fr);
}

.field-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

.field-row .mini-control {
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: #34455c;
  background: #fff;
  font-size: 11px;
}

.field-row .field-name {
  overflow: hidden;
  color: #53647a;
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field-row .remove-field {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 7px;
  color: #94a0af;
  background: transparent;
  cursor: pointer;
}

.field-row .remove-field:hover {
  color: var(--danger);
  background: var(--danger-soft);
}

.field-row .remove-field svg {
  width: 15px;
  height: 15px;
}

.count-buttons {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
}

.count-buttons button {
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: #52637a;
  background: #fff;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.count-buttons button.active {
  color: #fff;
  border-color: var(--primary);
  background: var(--primary);
}

.layout-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.layout-choice {
  min-height: 70px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: #66758a;
  background: #fff;
  cursor: pointer;
}

.layout-choice:hover {
  border-color: #abc8f2;
}

.layout-choice.active {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-soft);
}

.layout-mini {
  width: 48px;
  height: 36px;
  display: grid;
  gap: 2px;
  padding: 3px;
  border: 1px solid currentColor;
  border-radius: 3px;
}

.layout-mini i {
  border: 1px solid currentColor;
  border-radius: 1px;
  opacity: 0.8;
}

.layout-choice span {
  font-size: 10px;
  font-weight: 700;
}

.range-field {
  display: block;
  margin: 12px 0 0;
}

.range-field > span {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  color: #5c6e84;
  font-size: 11px;
  font-weight: 650;
}

.range-field output {
  color: var(--primary);
  font-weight: 750;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
}

.drop-zone {
  min-height: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 14px;
  padding: 16px;
  border: 1.5px dashed #aabbd0;
  border-radius: 13px;
  color: #52647a;
  background: linear-gradient(145deg, #f8fbff, #f2f6fb);
  text-align: center;
  cursor: pointer;
}

.drop-zone:hover,
.drop-zone.drag-over {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-soft);
}

.drop-zone svg {
  width: 44px;
  height: 44px;
  margin-bottom: 3px;
}

.drop-zone strong {
  font-size: 13px;
}

.drop-zone span {
  color: var(--muted);
  font-size: 10px;
}

.button-row {
  display: flex;
  gap: 7px;
  margin-top: 10px;
}

.button-row > * {
  min-width: 0;
  flex: 1;
}

.button-row.two {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
}

.button-row.three {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.button-row.four {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.button-row.right {
  justify-content: flex-end;
}

.button-row.right > * {
  flex: 0 0 auto;
}

.button-row.centered {
  justify-content: center;
}

.button-row.centered > * {
  flex: 0 0 auto;
}

.toggle-row {
  position: relative;
  min-height: 39px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #52637a;
  font-size: 12px;
  cursor: pointer;
}

.toggle-row input {
  position: absolute;
  opacity: 0;
}

.toggle-row i {
  position: relative;
  width: 38px;
  height: 22px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #c8d1dc;
  transition: background 150ms ease;
}

.toggle-row i::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  content: "";
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(22, 35, 55, 0.18);
  transition: transform 150ms ease;
}

.toggle-row input:checked + i {
  background: var(--primary);
}

.toggle-row input:checked + i::after {
  transform: translateX(16px);
}

.toggle-row.grow {
  flex: 1;
}

.count-badge {
  display: inline-flex;
  min-width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  margin-left: 5px;
  border-radius: 999px;
  color: var(--primary);
  background: var(--primary-soft);
  font-size: 10px;
}

.photo-list {
  display: grid;
  gap: 7px;
  margin-top: 9px;
}

.photo-list-item {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 31px;
  align-items: center;
  gap: 9px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: grab;
}

.photo-list-item:hover {
  border-color: #b7c7da;
}

.photo-list-item.selected {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.photo-list-item.dragging {
  opacity: 0.45;
}

.photo-list-thumb {
  width: 52px;
  height: 43px;
  overflow: hidden;
  border-radius: 6px;
  background: #dde4ed;
}

.photo-list-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-list-info {
  min-width: 0;
}

.photo-list-info strong,
.photo-list-info span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.photo-list-info strong {
  font-size: 11px;
}

.photo-list-info span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.photo-list-drag {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  color: #9aa6b4;
}

.photo-list-drag svg {
  width: 16px;
  height: 16px;
}

.asset-upload-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.asset-upload {
  min-height: 116px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 5px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: #5b6b7f;
  background: #fff;
}

.asset-upload:hover {
  color: var(--primary);
  border-color: #a9c7f3;
  background: #f8fbff;
}

.asset-preview {
  width: 52px;
  height: 46px;
  display: grid;
  place-items: center;
  overflow: hidden;
  margin-bottom: 3px;
  border: 1px dashed #b9c5d3;
  border-radius: 7px;
  color: #8794a4;
  background: #f5f7fa;
  font-size: 10px;
  font-weight: 800;
}

.asset-preview.signature {
  font-family: cursive;
  font-size: 14px;
}

.asset-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.asset-upload strong {
  font-size: 10px;
}

.asset-upload small {
  color: #8794a4;
  font-size: 8px;
}

.qr-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}

.qr-preview {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #9aa6b4;
  font-size: 10px;
}

.qr-preview img,
.qr-preview canvas {
  width: 54px !important;
  height: 54px !important;
}

.aside-footer {
  padding: 11px 15px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.aside-footer .secondary-button {
  width: 100%;
}

.workspace {
  min-width: 0;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(45deg, rgba(129, 151, 181, 0.045) 25%, transparent 25%, transparent 75%, rgba(129, 151, 181, 0.045) 75%),
    linear-gradient(45deg, rgba(129, 151, 181, 0.045) 25%, transparent 25%, transparent 75%, rgba(129, 151, 181, 0.045) 75%),
    #e9eef5;
  background-position: 0 0, 12px 12px;
  background-size: 24px 24px;
}

.workspace-head {
  position: relative;
  z-index: 5;
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 15px;
  border-bottom: 1px solid rgba(163, 177, 195, 0.55);
  background: rgba(246, 249, 252, 0.91);
  backdrop-filter: blur(15px);
}

.workspace-head strong,
.workspace-head span {
  display: block;
}

.workspace-head strong {
  font-size: 13px;
}

.workspace-head span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.workspace-tools {
  display: flex;
  align-items: center;
  gap: 7px;
}

.workspace-tools input[type="range"] {
  width: 110px;
}

.workspace-tools output {
  width: 42px;
  color: #54657a;
  font-size: 11px;
  text-align: center;
}

.compact-button {
  min-height: 34px;
  padding: 0 10px;
  font-size: 11px;
}

.workspace-scroll {
  min-height: 0;
  flex: 1;
  overflow: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
}

.empty-workspace {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
}

.empty-visual {
  width: 130px;
  height: 130px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  border: 1px solid rgba(23, 104, 229, 0.16);
  border-radius: 34px;
  color: var(--primary);
  background: rgba(255, 255, 255, 0.75);
  box-shadow: var(--shadow-soft);
}

.empty-visual svg {
  width: 82px;
  height: 82px;
}

.empty-workspace h1 {
  margin: 0;
  font-size: clamp(20px, 2.1vw, 28px);
  letter-spacing: -0.035em;
}

.empty-workspace p {
  max-width: 560px;
  margin: 11px 0 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.privacy-note {
  margin-top: 15px;
  color: var(--success);
  font-size: 11px;
}

.pages-stage {
  min-width: max-content;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 36px;
  padding: 38px 44px 70px;
}

.page-shell {
  position: relative;
  flex: 0 0 auto;
}

.paper-page {
  position: absolute;
  top: 0;
  left: 0;
  overflow: hidden;
  color: #111827;
  background: #fff;
  box-shadow: 0 18px 48px rgba(32, 44, 62, 0.22), 0 2px 6px rgba(32, 44, 62, 0.12);
  transform-origin: top left;
  user-select: none;
}

.report-header {
  position: absolute;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #1c2737;
}

.report-header.no-assets {
  grid-template-columns: 1fr;
}

.report-logo {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  overflow: hidden;
}

.report-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.report-title-area {
  min-width: 0;
  text-align: center;
}

.report-title-area h1 {
  overflow: hidden;
  margin: 0;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 7px;
  border-top: 1px solid #9ca3af;
  border-left: 1px solid #9ca3af;
}

.report-meta-item {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  border-right: 1px solid #9ca3af;
  border-bottom: 1px solid #9ca3af;
}

.report-meta-item b,
.report-meta-item span {
  min-width: 0;
  display: flex;
  align-items: center;
  padding: 3px 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-meta-item b {
  justify-content: center;
  border-right: 1px solid #c7ccd4;
  background: #f2f4f6;
  font-weight: 700;
}

.report-qr {
  display: grid;
  place-items: center;
  overflow: hidden;
}

.report-qr img,
.report-qr canvas {
  width: 100% !important;
  height: 100% !important;
}

.report-grid {
  position: absolute;
  display: grid;
}

.photo-slot {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: grid;
  overflow: hidden;
  border: 1px solid transparent;
  background: #fff;
  transition: outline-color 120ms ease, box-shadow 120ms ease;
}

.photo-slot.with-border {
  border-color: #596474;
}

.photo-slot.rounded {
  border-radius: var(--slot-radius, 0px);
}

.photo-slot.selected {
  z-index: 2;
  outline: 3px solid var(--primary);
  outline-offset: 2px;
  box-shadow: 0 0 0 6px rgba(23, 104, 229, 0.12);
}

.photo-slot.drag-target {
  outline: 3px dashed var(--primary);
  outline-offset: -4px;
  background: var(--primary-soft);
}

.slot-image {
  position: relative;
  min-height: 0;
  overflow: hidden;
  background: #e9edf2;
  cursor: grab;
  touch-action: none;
}

.slot-image:active {
  cursor: grabbing;
}

.slot-image img.photo-content {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  transform-origin: center;
}

.slot-image img.fit-cover {
  object-fit: cover;
}

.slot-image img.fit-contain {
  object-fit: contain;
  background: #f3f4f6;
}

.slot-role-badge {
  position: absolute;
  z-index: 3;
  top: 6px;
  left: 6px;
  padding: 3px 7px;
  border-radius: 3px;
  color: #fff;
  background: rgba(13, 27, 47, 0.78);
  font-weight: 750;
  letter-spacing: 0.02em;
  backdrop-filter: blur(5px);
}

.slot-photo-tools {
  position: absolute;
  z-index: 4;
  top: 5px;
  right: 5px;
  display: flex;
  gap: 3px;
  opacity: 0;
  transition: opacity 120ms ease;
}

.photo-slot:hover .slot-photo-tools,
.photo-slot.selected .slot-photo-tools {
  opacity: 1;
}

.slot-photo-tools button {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 6px;
  color: #fff;
  background: rgba(13, 27, 47, 0.72);
  backdrop-filter: blur(5px);
  cursor: pointer;
}

.slot-photo-tools button:hover {
  background: var(--primary);
}

.slot-photo-tools svg {
  width: 15px;
  height: 15px;
}

.slot-empty {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1.5px dashed #aab4c0;
  color: #8995a5;
  background: #f8fafc;
  cursor: pointer;
}

.slot-empty:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-soft);
}

.slot-empty svg {
  width: 27px;
  height: 27px;
}

.slot-empty strong {
  font-weight: 700;
}

.slot-empty span {
  opacity: 0.8;
}

.caption-box {
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-top: 1px solid #6b7280;
  background: #fff;
}

.caption-row {
  min-height: 0;
  display: grid;
  grid-template-columns: 24% minmax(0, 1fr);
  flex: 1;
  border-bottom: 1px solid #c7ccd4;
}

.caption-row:last-child {
  border-bottom: 0;
}

.caption-row b,
.caption-row span {
  min-width: 0;
  display: flex;
  align-items: center;
  padding: 2px 5px;
  overflow: hidden;
  line-height: 1.25;
}

.caption-row b {
  justify-content: center;
  border-right: 1px solid #c7ccd4;
  background: #f1f3f5;
  font-weight: 700;
  white-space: nowrap;
}

.caption-row span {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.report-footer {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid #525d6b;
  color: #485362;
}

.report-footer-contact {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-footer-sign {
  display: flex;
  align-items: center;
  gap: 8px;
}

.report-footer-sign img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.page-number {
  flex: 0 0 auto;
  font-weight: 650;
}

.page-label {
  position: absolute;
  right: -48px;
  top: 0;
  color: #5f6f82;
  font-size: 11px;
  font-weight: 700;
  writing-mode: vertical-rl;
}

.inspector-empty {
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 30px;
  color: #7e8b9b;
  text-align: center;
}

.inspector-empty svg {
  width: 58px;
  height: 58px;
  margin-bottom: 5px;
}

.inspector-empty strong {
  color: #536277;
  font-size: 13px;
}

.inspector-empty span {
  font-size: 10px;
  line-height: 1.5;
}

.inspector-content {
  padding: 15px 15px 28px;
}

.selected-photo-preview {
  position: relative;
  height: 175px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #e8edf3;
  cursor: grab;
  touch-action: none;
}

.selected-photo-preview:active {
  cursor: grabbing;
}

.selected-photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.selected-file-meta {
  margin: 10px 1px 13px;
}

.selected-file-meta strong,
.selected-file-meta span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-file-meta strong {
  font-size: 12px;
}

.selected-file-meta span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

.inspector-section {
  padding: 18px 0;
  border-bottom: 1px solid #e7ecf2;
}

.inspector-section:last-child {
  border-bottom: 0;
}

.icon-text-button {
  min-height: 43px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: #5b6b7f;
  background: #fff;
  font-size: 9px;
  font-weight: 700;
}

.icon-text-button:hover {
  color: var(--primary);
  border-color: #abc8f2;
  background: #f8fbff;
}

.icon-text-button svg {
  width: 18px;
  height: 18px;
}

.icon-button.wide {
  width: auto;
  min-width: 0;
}

.micro-copy {
  margin: 11px 0 0;
  color: #8794a4;
  font-size: 9px;
  line-height: 1.5;
}

.caption-editor {
  display: grid;
  gap: 9px;
}

.caption-editor label {
  display: block;
  color: #5a6b80;
  font-size: 10px;
  font-weight: 700;
}

.caption-editor textarea,
.caption-editor input {
  width: 100%;
  margin-top: 5px;
}

.meta-list {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 7px 9px;
  margin: 0;
  font-size: 10px;
}

.meta-list dt {
  color: #8794a4;
}

.meta-list dd {
  min-width: 0;
  margin: 0;
  color: #4b5c72;
  overflow-wrap: anywhere;
}

.mobile-toolbar {
  display: none;
}

.modal {
  max-width: none;
  max-height: none;
  padding: 0;
  border: 0;
  border-radius: 16px;
  color: var(--ink);
  background: transparent;
  box-shadow: var(--shadow);
}

.modal::backdrop {
  background: rgba(9, 18, 31, 0.58);
  backdrop-filter: blur(5px);
}

.modal-card {
  width: min(720px, calc(100vw - 28px));
  max-height: min(86vh, 850px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 16px;
  background: #fff;
}

.modal-header {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.modal-header strong,
.modal-header span {
  display: block;
}

.modal-header strong {
  font-size: 17px;
}

.modal-header span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.modal-body {
  min-height: 0;
  overflow: auto;
  padding: 18px;
}

.export-summary {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid #cfe0f8;
  border-radius: 11px;
  background: #f3f8ff;
  font-size: 12px;
}

.export-summary strong {
  color: var(--primary);
}

.quality-box {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
}

.quality-box h2 {
  margin: 0;
  font-size: 12px;
}

.quality-box output {
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
}

.quality-box input {
  margin-top: 12px;
}

.quality-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 3px;
  color: #97a2b0;
  font-size: 9px;
}


.caption-sheet-box {
  border: 1px solid #d8e5f5;
  background: linear-gradient(145deg, #f8fbff, #f2f7fd);
}

.mini-badge {
  padding: 3px 7px;
  border: 1px solid #c8d9ee;
  border-radius: 999px;
  color: #426585;
  background: #fff;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .02em;
}

.office-format-note {
  margin: 12px 2px 0;
  padding: 10px 12px;
  border-left: 3px solid #abc5e5;
  border-radius: 0 8px 8px 0;
  color: #66778a;
  background: #f6f9fc;
  font-size: 10px;
  line-height: 1.55;
}

.export-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.export-option {
  min-height: 126px;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-content: center;
  column-gap: 13px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: #465970;
  background: #fff;
  text-align: left;
}

.export-option:hover {
  color: var(--primary);
  border-color: #a8c8f4;
  background: #f8fbff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.export-option.featured {
  border-color: #a9c8f4;
  background: linear-gradient(145deg, #f4f9ff, #edf5ff);
}

.export-option svg {
  grid-row: 1 / 3;
  width: 48px;
  height: 48px;
}

.export-option strong {
  align-self: end;
  font-size: 15px;
}


.experimental-tag {
  display: inline-block;
  margin-left: 4px;
  padding: 2px 5px;
  border: 1px solid #e5bb71;
  border-radius: 999px;
  color: #8b5b10;
  background: #fff8e9;
  font-size: 8px;
  vertical-align: 2px;
}

.export-option span {
  align-self: start;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.export-progress {
  margin-top: 16px;
  padding: 13px;
  border-radius: 10px;
  background: #f4f7fa;
}

.progress-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #dce4ed;
}

.progress-track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2d83f1, #155ed3);
  transition: width 180ms ease;
}

.export-progress strong {
  display: block;
  margin-top: 8px;
  color: #5e6e82;
  font-size: 10px;
}

.signature-card {
  width: min(780px, calc(100vw - 28px));
}

#signatureCanvas {
  width: 100%;
  height: 260px;
  display: block;
  border: 1px dashed #aab7c6;
  border-radius: 10px;
  background:
    linear-gradient(#fff, #fff) padding-box,
    repeating-linear-gradient(0deg, transparent, transparent 34px, #eef1f5 35px) border-box;
  touch-action: none;
}

.template-card {
  width: min(620px, calc(100vw - 28px));
}

.saved-template-list {
  display: grid;
  gap: 8px;
}

.saved-template-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.saved-template-item strong,
.saved-template-item span {
  display: block;
}

.saved-template-item strong {
  font-size: 12px;
}

.saved-template-item span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.saved-template-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.saved-template-empty {
  padding: 38px 20px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

.small-card {
  width: min(430px, calc(100vw - 28px));
}

.confirm-modal .modal-body {
  padding: 27px 24px 22px;
  text-align: center;
}

.confirm-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  margin: 0 auto 13px;
  border-radius: 50%;
  color: var(--danger);
  background: var(--danger-soft);
}

.confirm-icon svg {
  width: 28px;
  height: 28px;
}

.confirm-modal h2 {
  margin: 0;
  font-size: 17px;
}

.confirm-modal p {
  margin: 9px 0 20px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.toast-stack {
  position: fixed;
  z-index: 200;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 8px;
  pointer-events: none;
}

.toast {
  min-width: 260px;
  max-width: min(420px, calc(100vw - 36px));
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 11px;
  color: #f7fbff;
  background: rgba(17, 31, 52, 0.96);
  box-shadow: 0 12px 30px rgba(9, 19, 34, 0.25);
  animation: toast-in 180ms ease both;
}

.toast.success {
  background: rgba(15, 113, 77, 0.96);
}

.toast.error {
  background: rgba(167, 37, 47, 0.96);
}

.toast svg {
  width: 19px;
  height: 19px;
}

.toast strong,
.toast span {
  display: block;
}

.toast strong {
  font-size: 12px;
}

.toast span {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 10px;
  line-height: 1.45;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1360px) {
  :root {
    --sidebar-w: 310px;
    --inspector-w: 296px;
  }

  .brand-block {
    min-width: 210px;
  }

  .ghost-button {
    padding: 0 9px;
  }
}

@media (max-width: 1120px) {
  :root {
    --inspector-w: 0px;
  }

  .app-shell {
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  }

  .inspector {
    position: fixed;
    z-index: 80;
    top: var(--topbar-h);
    right: 0;
    bottom: 0;
    width: min(360px, 90vw);
    transform: translateX(102%);
    transition: transform 180ms ease;
  }

  .inspector.mobile-open {
    transform: translateX(0);
  }

  .mobile-close {
    display: inline-grid;
  }

  .topbar .ghost-button {
    display: none;
  }
}

@media (max-width: 780px) {
  :root {
    --topbar-h: 58px;
    --sidebar-w: 0px;
  }

  body {
    padding-bottom: calc(58px + var(--safe-bottom));
  }

  .topbar {
    height: var(--topbar-h);
    padding: 0 11px;
    gap: 9px;
  }

  .brand-block {
    min-width: 0;
    flex: 1;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .brand-block strong {
    font-size: 13px;
  }

  .brand-block span,
  .privacy-pill,
  .topbar .icon-button,
  .toolbar-divider {
    display: none;
  }

  .top-actions {
    margin-left: 0;
  }

  .top-actions .primary-button {
    min-height: 38px;
    padding: 0 11px;
    font-size: 11px;
  }

  .app-shell {
    height: calc(100vh - var(--topbar-h) - 58px - var(--safe-bottom));
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar,
  .inspector {
    position: fixed;
    z-index: 90;
    top: var(--topbar-h);
    bottom: calc(58px + var(--safe-bottom));
    width: min(360px, 92vw);
    box-shadow: 12px 0 42px rgba(13, 27, 47, 0.22);
    transition: transform 180ms ease;
  }

  .sidebar {
    left: 0;
    transform: translateX(-102%);
  }

  .inspector {
    right: 0;
    transform: translateX(102%);
  }

  .sidebar.mobile-open,
  .inspector.mobile-open {
    transform: translateX(0);
  }

  .mobile-toolbar {
    position: fixed;
    z-index: 100;
    right: 0;
    bottom: 0;
    left: 0;
    height: calc(58px + var(--safe-bottom));
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding: 5px 6px var(--safe-bottom);
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(18px);
    box-shadow: 0 -8px 24px rgba(24, 39, 62, 0.08);
  }

  .mobile-toolbar button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border: 0;
    border-radius: 9px;
    color: #596a80;
    background: transparent;
    font-size: 9px;
    font-weight: 700;
  }

  .mobile-toolbar button:active {
    color: var(--primary);
    background: var(--primary-soft);
  }

  .mobile-toolbar svg {
    width: 21px;
    height: 21px;
  }

  .workspace-head {
    min-height: 48px;
    padding: 7px 10px;
  }

  .workspace-head > div:first-child {
    min-width: 0;
  }

  .workspace-head strong,
  .workspace-head span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .workspace-tools .icon-button,
  .workspace-tools input,
  .workspace-tools output {
    display: none;
  }

  .compact-button {
    min-height: 34px;
  }

  .pages-stage {
    gap: 25px;
    padding: 22px 18px 54px;
  }

  .page-label {
    display: none;
  }

  .empty-workspace {
    padding: 25px 18px;
  }

  .empty-visual {
    width: 100px;
    height: 100px;
    border-radius: 26px;
  }

  .empty-visual svg {
    width: 64px;
    height: 64px;
  }

  .empty-workspace h1 {
    font-size: 20px;
  }

  .empty-workspace p {
    font-size: 12px;
  }

  .slot-photo-tools {
    opacity: 1;
  }

  .toast-stack {
    right: 10px;
    bottom: calc(68px + var(--safe-bottom));
    left: 10px;
  }

  .toast {
    width: 100%;
    min-width: 0;
    max-width: none;
  }

  .modal-card {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 24px);
    border-radius: 14px;
  }

  .export-grid {
    grid-template-columns: 1fr;
  }

  .export-option {
    min-height: 96px;
  }

  #signatureCanvas {
    height: 210px;
  }
}

@media print {
  html,
  body {
    width: auto;
    height: auto;
    overflow: visible;
    background: #fff !important;
  }

  .topbar,
  .mobile-toolbar,
  .sidebar,
  .inspector,
  .workspace-head,
  .empty-workspace,
  .toast-stack,
  .modal {
    display: none !important;
  }

  .app-shell,
  .workspace,
  .workspace-scroll,
  .pages-stage {
    display: block !important;
    width: auto !important;
    height: auto !important;
    overflow: visible !important;
    padding: 0 !important;
    margin: 0 !important;
    background: #fff !important;
  }

  .page-shell {
    width: var(--print-page-width) !important;
    height: var(--print-page-height) !important;
    margin: 0 !important;
    page-break-after: always;
    break-after: page;
  }

  .page-shell:last-child {
    page-break-after: auto;
    break-after: auto;
  }

  .paper-page {
    width: var(--print-page-width) !important;
    height: var(--print-page-height) !important;
    box-shadow: none !important;
    transform: none !important;
  }

  .photo-slot.selected {
    outline: 0 !important;
    box-shadow: none !important;
  }

  .slot-photo-tools,
  .page-label {
    display: none !important;
  }
}


/* Runtime progress overlay */
.busy-overlay {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(5, 10, 18, 0.58);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 160ms ease, visibility 160ms ease;
}

.busy-overlay.show {
  opacity: 1;
  visibility: visible;
}

.busy-card {
  width: min(360px, calc(100vw - 32px));
  display: grid;
  justify-items: center;
  gap: 11px;
  padding: 26px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background: #101927;
  color: #f8fafc;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
  text-align: center;
}

.busy-card small { color: #a9b6c8; }

.busy-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(255, 255, 255, 0.18);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: busy-spin 800ms linear infinite;
}

.busy-track {
  width: 100%;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.busy-track i {
  display: block;
  width: 3%;
  height: 100%;
  border-radius: inherit;
  background: #ffffff;
  transition: width 120ms ease;
}

@keyframes busy-spin { to { transform: rotate(360deg); } }

.asset-clear-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 8px 0 10px;
}

.asset-clear-row .text-button {
  min-height: 38px;
  padding-inline: 5px;
  font-size: 12px;
}

/* Canvas-based printing is isolated from the editor DOM so browser layout
   differences do not shift the final report. */
.print-image-root { display: none; }

@media print {
  body > .app-shell,
  body > .topbar,
  body > .mobile-toolbar,
  body > .toast-stack,
  body > .modal,
  body > #busyOverlay {
    display: none !important;
  }

  body > .print-image-root {
    display: block !important;
    width: var(--print-width);
  }

  body > .print-image-root img {
    display: block;
    width: var(--print-width);
    height: var(--print-height);
    margin: 0;
    object-fit: fill;
    page-break-after: always;
    break-after: page;
  }

  body > .print-image-root img:last-child {
    page-break-after: auto;
    break-after: auto;
  }
}


/* PHOTO3001 UX V2: predictable scrolling and preset-first layout selection */
.setting-help {
  margin: -3px 0 13px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.quick-layout-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.quick-layout-choice {
  min-height: 94px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: #31445c;
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.quick-layout-choice:hover {
  border-color: rgba(23, 104, 229, 0.42);
  background: #f8fbff;
  transform: translateY(-1px);
}

.quick-layout-choice.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: 0 0 0 2px rgba(23, 104, 229, 0.09);
}

.quick-layout-mini {
  width: 48px;
  height: 61px;
  flex: 0 0 auto;
  display: grid;
  gap: 3px;
  padding: 5px;
  border: 1px solid #b8c4d2;
  border-radius: 5px;
  background: #fff;
  box-shadow: 0 3px 8px rgba(23, 38, 62, 0.08);
}

.quick-layout-mini i {
  display: block;
  min-width: 0;
  min-height: 0;
  border-radius: 2px;
  background: #d8e6f8;
  box-shadow: inset 0 0 0 1px rgba(23, 104, 229, 0.12);
}

.quick-layout-copy {
  min-width: 0;
}

.quick-layout-copy strong,
.quick-layout-copy small {
  display: block;
}

.quick-layout-copy strong {
  margin-bottom: 4px;
  color: #24364d;
  font-size: 12px;
}

.quick-layout-copy small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.caption-line-simple {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.advanced-settings {
  margin: 14px 0 26px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(248, 250, 252, 0.85);
  overflow: hidden;
}

.advanced-settings > summary {
  min-height: 58px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  padding: 10px 14px;
  color: #34475f;
  background: #fff;
  cursor: pointer;
  list-style: none;
}

.advanced-settings > summary::-webkit-details-marker {
  display: none;
}

.advanced-settings > summary::after {
  content: "+";
  position: absolute;
  right: 16px;
  color: var(--primary);
  font-size: 20px;
  font-weight: 500;
}

.advanced-settings[open] > summary::after {
  content: "−";
}

.advanced-settings > summary {
  position: relative;
}

.advanced-settings > summary span {
  font-size: 12px;
  font-weight: 750;
}

.advanced-settings > summary small {
  color: var(--muted);
  font-size: 10px;
}

.advanced-settings-body {
  padding: 0 14px;
  border-top: 1px solid var(--line);
}

/* Desktop: body and center preview use normal document scrolling.
   Side panels use one predictable scrollbar each instead of nested scroll areas. */
html,
body {
  min-height: 100%;
  height: auto;
  overflow-x: hidden;
  overflow-y: auto;
}

.topbar {
  position: sticky;
  top: 0;
}

.app-shell {
  min-height: calc(100dvh - var(--topbar-h));
  height: auto;
  overflow: visible;
  align-items: start;
}

.workspace {
  min-height: calc(100dvh - var(--topbar-h));
}

.workspace-scroll {
  min-height: calc(100dvh - var(--topbar-h) - 54px);
  overflow: visible;
}

@media (min-width: 1121px) {
  .sidebar,
  .inspector {
    position: sticky;
    top: var(--topbar-h);
    align-self: start;
    width: auto;
    height: calc(100dvh - var(--topbar-h));
    max-height: calc(100dvh - var(--topbar-h));
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: auto;
    scrollbar-gutter: stable;
  }

  .aside-scroll,
  .inspector-content {
    min-height: auto;
    flex: 0 0 auto;
    overflow: visible;
  }

  .aside-header {
    position: sticky;
    top: 0;
    z-index: 5;
    background: rgba(255, 255, 255, 0.98);
  }

  .panel-tabs {
    position: sticky;
    top: 67px;
    z-index: 4;
  }
}

@media (min-width: 781px) and (max-width: 1120px) {
  .sidebar {
    position: sticky;
    top: var(--topbar-h);
    align-self: start;
    height: calc(100dvh - var(--topbar-h));
    max-height: calc(100dvh - var(--topbar-h));
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-gutter: stable;
  }

  .sidebar .aside-scroll {
    min-height: auto;
    flex: 0 0 auto;
    overflow: visible;
  }

  .inspector {
    overflow: hidden;
  }

  .inspector-content {
    min-height: 0;
    flex: 1;
    overflow-y: auto;
  }
}

@media (max-width: 780px) {
  html,
  body {
    width: 100%;
    height: 100%;
    min-height: 100%;
    overflow: hidden;
  }

  .topbar {
    position: relative;
    top: auto;
  }

  .app-shell {
    height: calc(100dvh - var(--topbar-h) - 58px - var(--safe-bottom));
    min-height: 0;
    overflow: hidden;
  }

  .workspace {
    min-height: 0;
  }

  .workspace-scroll {
    min-height: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  .sidebar,
  .inspector {
    overflow: hidden;
  }

  .aside-scroll,
  .inspector-content {
    min-height: 0;
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .quick-layout-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 430px) {
  .quick-layout-grid {
    grid-template-columns: 1fr;
  }

  .quick-layout-choice {
    min-height: 78px;
  }

  .quick-layout-mini {
    width: 42px;
    height: 52px;
  }
}

/* ================================================================
   PHOTO3001 V6
   - Browser-level vertical scrolling on desktop and the main mobile view
   - Preset-first quick builder
   - Free row/column editing remains available only under advanced settings
   ================================================================ */

.brand-title-row {
  display: flex;
  align-items: center;
  gap: 7px;
}

.version-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 27px;
  height: 18px;
  padding: 0 6px;
  border: 1px solid rgba(133, 190, 255, 0.32);
  border-radius: 999px;
  color: #bcd8ff;
  background: rgba(43, 128, 244, 0.16);
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.panel-tabs button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.panel-tabs button b {
  width: 17px;
  height: 17px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: #7d8ca0;
  background: #edf1f6;
  font-size: 9px;
}

.panel-tabs button.active b {
  color: #fff;
  background: var(--primary);
}

.eyebrow {
  display: block;
  margin-bottom: 5px;
  color: var(--primary);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.quick-builder {
  margin: 14px 0 18px;
  padding: 15px;
  border: 1px solid #cdddf4;
  border-radius: 17px;
  background:
    radial-gradient(circle at 100% 0%, rgba(43, 126, 239, 0.12), transparent 16rem),
    linear-gradient(180deg, #ffffff, #f7faff);
  box-shadow: 0 12px 28px rgba(31, 80, 144, 0.09);
}

.quick-builder-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 13px;
  border-bottom: 1px solid #e2eaf4;
}

.quick-builder-head h2,
.layout-guide-card h2 {
  margin: 0;
  color: #20334c;
  font-size: 15px;
  line-height: 1.35;
  letter-spacing: -0.025em;
}

.quick-builder-head p,
.layout-guide-card p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.quick-builder-status {
  flex: 0 0 auto;
  padding: 5px 8px;
  border: 1px solid #b9d5fb;
  border-radius: 999px;
  color: #145fc9;
  background: #edf5ff;
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}

.quick-title-field {
  display: block;
  padding: 14px 0 13px;
  border-bottom: 1px solid #e5ecf5;
}

.quick-title-field > span {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
}

.quick-title-field b {
  color: #263950;
  font-size: 12px;
}

.quick-title-field small {
  color: var(--muted);
  font-size: 9px;
}

.quick-step {
  padding: 14px 0;
  border-bottom: 1px solid #e5ecf5;
}

.quick-step-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 10px;
}

.quick-step-head > div {
  min-width: 0;
}

.quick-step-head strong,
.quick-step-head small {
  display: block;
}

.quick-step-head strong {
  color: #263950;
  font-size: 12px;
}

.quick-step-head small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
}

.step-number {
  width: 23px;
  height: 23px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: #fff;
  background: linear-gradient(145deg, #2b80ef, #135ccf);
  box-shadow: 0 5px 11px rgba(23, 104, 229, 0.2);
  font-size: 10px;
  font-weight: 850;
}

.quick-two-column {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.quick-segmented {
  margin-top: 0;
}

.quick-layout-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.quick-layout-choice {
  min-height: 76px;
  padding: 9px;
  gap: 8px;
}

.quick-layout-mini {
  width: 38px;
  height: 49px;
  padding: 4px;
  gap: 2px;
}

.quick-layout-copy strong {
  margin-bottom: 2px;
  font-size: 11px;
}

.quick-layout-copy small {
  font-size: 9px;
}

.caption-line-simple {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.caption-line-simple button {
  min-width: 0;
  padding-right: 3px;
  padding-left: 3px;
  font-size: 10px;
}

.quick-builder-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 13px 0 10px;
  padding: 10px 11px;
  border: 1px solid #d5e4f8;
  border-radius: 10px;
  background: #f1f7ff;
}

.quick-builder-summary span {
  color: #65778e;
  font-size: 9px;
  font-weight: 700;
}

.quick-builder-summary strong {
  color: #155bbf;
  font-size: 10px;
  text-align: right;
}

.quick-builder-actions {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 8px;
}

.quick-builder-actions .large {
  min-height: 44px;
  padding: 0 12px;
  font-size: 12px;
}

.document-details,
.advanced-settings {
  margin: 0 0 22px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  overflow: hidden;
}

.document-details > summary,
.advanced-settings > summary {
  position: relative;
  min-height: 61px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  padding: 11px 42px 11px 14px;
  color: #34475f;
  background: #fff;
  cursor: pointer;
  list-style: none;
}

.document-details > summary::-webkit-details-marker,
.advanced-settings > summary::-webkit-details-marker {
  display: none;
}

.document-details > summary::after,
.advanced-settings > summary::after {
  content: "+";
  position: absolute;
  top: 50%;
  right: 15px;
  color: var(--primary);
  font-size: 20px;
  font-weight: 500;
  transform: translateY(-50%);
}

.document-details[open] > summary::after,
.advanced-settings[open] > summary::after {
  content: "−";
}

.document-details > summary span,
.advanced-settings > summary span {
  font-size: 12px;
  font-weight: 750;
}

.document-details > summary small,
.advanced-settings > summary small {
  color: var(--muted);
  font-size: 10px;
}

.document-details-body,
.advanced-settings-body {
  padding: 0 14px;
  border-top: 1px solid var(--line);
  background: #fbfcfe;
}

.layout-guide-card {
  margin: 16px 0 14px;
  padding: 15px;
  border: 1px solid #d7e4f4;
  border-radius: 14px;
  background: linear-gradient(145deg, #fff, #f6f9fd);
}

/* One vertical scroll model on desktop: the browser window scrolls.
   The preview may scroll horizontally for a wide A3 page, but never traps
   vertical wheel/touch scrolling inside a nested area. */
html,
body {
  width: 100%;
  height: auto !important;
  min-height: 100%;
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

body {
  min-height: 100dvh;
}

.topbar {
  position: sticky !important;
  top: 0;
}

.app-shell {
  height: auto !important;
  min-height: calc(100dvh - var(--topbar-h));
  align-items: stretch;
  overflow: visible !important;
}

.sidebar,
.inspector {
  position: relative !important;
  top: auto !important;
  bottom: auto !important;
  align-self: stretch;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

.aside-scroll,
.inspector-content {
  min-height: 0;
  flex: 0 0 auto;
  overflow: visible !important;
  overscroll-behavior: auto;
}

.workspace {
  min-height: calc(100dvh - var(--topbar-h));
}

.workspace-head {
  position: sticky;
  top: var(--topbar-h);
  z-index: 30;
}

.workspace-scroll {
  min-height: calc(100dvh - var(--topbar-h) - 54px);
  flex: 0 0 auto;
  overflow-x: auto !important;
  overflow-y: visible !important;
  overscroll-behavior: auto;
  touch-action: pan-x pan-y;
}

.empty-workspace {
  min-height: calc(100dvh - var(--topbar-h) - 54px);
}

.pages-stage {
  min-width: 0;
  width: 100%;
}

@media (min-width: 1121px) {
  .sidebar,
  .inspector {
    position: relative !important;
    top: auto !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }

  .aside-header,
  .panel-tabs {
    position: relative;
    top: auto;
  }
}

@media (min-width: 781px) and (max-width: 1120px) {
  .sidebar {
    position: relative !important;
    top: auto !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }

  .inspector {
    position: fixed !important;
    z-index: 80;
    top: var(--topbar-h) !important;
    right: 0;
    bottom: 0 !important;
    width: min(360px, 90vw);
    height: calc(100dvh - var(--topbar-h)) !important;
    max-height: calc(100dvh - var(--topbar-h)) !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    transform: translateX(102%);
  }

  .inspector.mobile-open {
    transform: translateX(0);
  }

  .inspector-content {
    overflow: visible !important;
  }
}

@media (max-width: 780px) {
  html,
  body {
    width: 100%;
    height: auto !important;
    min-height: 100%;
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }

  body {
    padding-bottom: calc(66px + var(--safe-bottom));
  }

  .topbar {
    position: sticky !important;
    top: 0;
  }

  .app-shell {
    height: auto !important;
    min-height: calc(100dvh - var(--topbar-h));
    overflow: visible !important;
  }

  .workspace,
  .workspace-scroll {
    min-height: calc(100dvh - var(--topbar-h) - 48px);
    height: auto !important;
    overflow-y: visible !important;
  }

  .workspace-head {
    top: var(--topbar-h);
  }

  .sidebar,
  .inspector {
    position: fixed !important;
    z-index: 90;
    top: var(--topbar-h) !important;
    bottom: calc(58px + var(--safe-bottom)) !important;
    width: min(380px, 94vw);
    height: auto !important;
    max-height: none !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
  }

  .aside-scroll,
  .inspector-content {
    overflow: visible !important;
  }

  .aside-header {
    position: sticky;
    top: 0;
    z-index: 8;
    background: rgba(255, 255, 255, 0.99);
  }

  .panel-tabs {
    position: sticky;
    top: 67px;
    z-index: 7;
  }

  .quick-builder {
    margin-top: 10px;
  }

  .quick-layout-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .caption-line-simple {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-width: 430px) {
  .quick-builder {
    padding: 13px;
  }

  .quick-builder-head {
    display: block;
  }

  .quick-builder-status {
    display: inline-flex;
    margin-top: 8px;
  }

  .quick-two-column {
    grid-template-columns: 1fr;
  }

  .quick-layout-grid {
    grid-template-columns: 1fr 1fr;
  }

  .quick-layout-choice {
    min-height: 70px;
  }

  .quick-layout-mini {
    width: 34px;
    height: 44px;
  }

  .quick-layout-copy small {
    display: none;
  }

  .quick-builder-actions {
    grid-template-columns: 1fr;
  }
}

@media print {
  .quick-builder,
  .document-details,
  .layout-guide-card,
  .version-badge {
    display: none !important;
  }
}

/* ================================================================
   PHOTO3001 V6 — preset-first workflow and predictable scrolling
   ================================================================ */

.quick-start-banner {
  margin: 14px 0 2px;
  padding: 16px;
  border: 1px solid rgba(23, 104, 229, 0.2);
  border-radius: 15px;
  background: linear-gradient(145deg, #f8fbff, #edf5ff);
  box-shadow: 0 8px 22px rgba(23, 104, 229, 0.07);
}

.quick-start-banner span,
.quick-start-banner strong,
.quick-start-banner p {
  display: block;
}

.quick-start-banner span {
  margin-bottom: 6px;
  color: var(--primary);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.quick-start-banner strong {
  color: #1a2c45;
  font-size: 14px;
  line-height: 1.45;
}

.quick-start-banner p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.quick-import-card {
  margin: 18px 0 24px;
  padding: 16px;
  border: 1px solid rgba(23, 104, 229, 0.22);
  border-radius: 15px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.quick-import-card > div:first-child span,
.quick-import-card > div:first-child strong,
.quick-import-card > div:first-child p {
  display: block;
}

.quick-import-card > div:first-child span {
  color: var(--success);
  font-size: 10px;
  font-weight: 800;
}

.quick-import-card > div:first-child strong {
  margin-top: 4px;
  color: #1c2c43;
  font-size: 15px;
}

.quick-import-card > div:first-child p {
  margin: 6px 0 12px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.quick-import-card > small {
  display: block;
  margin-top: 10px;
  color: var(--success);
  font-size: 9px;
  text-align: center;
}

.workflow-bar {
  position: sticky;
  top: calc(var(--topbar-h) + 54px);
  z-index: 16;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(163, 177, 195, 0.55);
  background: rgba(238, 244, 250, 0.96);
  backdrop-filter: blur(16px);
  box-shadow: 0 7px 16px rgba(39, 57, 82, 0.06);
}

.workflow-step {
  min-width: 0;
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #627188;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.workflow-step:hover {
  border-color: rgba(23, 104, 229, 0.18);
  background: rgba(255, 255, 255, 0.86);
  color: #244467;
  transform: translateY(-1px);
}

.workflow-step > span {
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid #c9d5e3;
  border-radius: 50%;
  background: #fff;
  font-size: 11px;
  font-weight: 800;
}

.workflow-step > div {
  min-width: 0;
}

.workflow-step small,
.workflow-step strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workflow-step small {
  margin-bottom: 2px;
  color: #8290a2;
  font-size: 9px;
}

.workflow-step strong {
  color: #31445d;
  font-size: 10px;
}

.workflow-step.completed > span {
  border-color: rgba(22, 132, 91, 0.3);
  color: var(--success);
  background: #ecfbf4;
}

.workflow-step.export.ready {
  border-color: rgba(23, 104, 229, 0.22);
  color: var(--primary);
  background: #fff;
}

.workflow-step.export.ready > span {
  border-color: var(--primary);
  color: #fff;
  background: var(--primary);
}

/* Desktop uses the browser's normal vertical scrollbar. Side panels retain
   one independent scrollbar each, eliminating nested scrolling. */
@media (min-width: 781px) {
  html,
  body {
    min-height: 100%;
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .topbar {
    position: sticky;
    top: 0;
  }

  .app-shell {
    min-height: calc(100dvh - var(--topbar-h));
    height: auto;
    overflow: visible;
    align-items: start;
  }

  .workspace {
    min-height: calc(100dvh - var(--topbar-h));
    height: auto;
    overflow: visible;
  }

  .workspace-head {
    position: sticky;
    top: var(--topbar-h);
    z-index: 17;
  }

  .workspace-scroll {
    min-height: calc(100dvh - var(--topbar-h) - 120px);
    height: auto;
    flex: 0 0 auto;
    overflow: visible;
    overscroll-behavior: auto;
  }

  .empty-workspace {
    min-height: calc(100dvh - var(--topbar-h) - 120px);
  }

  .pages-stage {
    min-width: 0;
    width: 100%;
  }

  .sidebar,
  .inspector {
    position: sticky;
    top: var(--topbar-h);
    align-self: start;
    height: calc(100dvh - var(--topbar-h));
    max-height: calc(100dvh - var(--topbar-h));
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-gutter: stable;
  }

  .aside-scroll,
  .inspector-content {
    min-height: auto;
    flex: 0 0 auto;
    overflow: visible;
  }
}

@media (max-width: 1120px) and (min-width: 781px) {
  .workflow-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workflow-step {
    min-height: 46px;
  }
}

@media (max-width: 780px) {
  .workflow-bar {
    position: relative;
    top: auto;
    grid-template-columns: repeat(4, minmax(112px, 1fr));
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }

  .workflow-bar::-webkit-scrollbar {
    display: none;
  }

  .workflow-step {
    min-height: 48px;
  }

  .quick-start-banner {
    margin-top: 10px;
  }

  .quick-layout-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 430px) {
  .quick-layout-grid {
    grid-template-columns: 1fr;
  }

  .quick-import-card .button-row.two {
    grid-template-columns: 1fr;
  }
}


/* PHOTO3001 V6 final scroll contract: vertical scrolling belongs to the page. */
@media (min-width: 781px) {
  .workspace-scroll {
    overflow: visible !important;
  }

  .pages-stage {
    min-width: 0 !important;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
  }
}

@media (max-width: 780px) {
  .workspace-scroll {
    overflow: visible !important;
  }

  .pages-stage {
    min-width: 0 !important;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
  }
}

/* V6 compact setting tabs */
.panel-tabs button {
  white-space: nowrap;
}

/* ===== v7.css ===== */
/* ================================================================
   PHOTO3001 V7 UI
   One-page scrolling + preset-first quick dock + overlay drawers.
   This file is loaded last and intentionally owns the layout contract.
   ================================================================ */

:root {
  --v7-drawer-width: min(390px, 94vw);
  --v7-top-offset: var(--topbar-h);
}

body[data-photo3001-version="v7"] {
  min-height: 100%;
  height: auto !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

body[data-photo3001-version="v7"] .topbar {
  position: sticky !important;
  top: 0;
  z-index: 100;
}

.v7-runtime-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(255, 196, 72, 0.34);
  border-radius: 999px;
  color: #ffe7a5;
  background: rgba(255, 174, 32, 0.12);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.v7-runtime-pill.production {
  color: #c8f7df;
  border-color: rgba(72, 220, 151, 0.35);
  background: rgba(22, 132, 91, 0.14);
}

body[data-photo3001-version="v7"] .app-shell {
  display: block !important;
  width: 100%;
  min-height: calc(100dvh - var(--topbar-h));
  height: auto !important;
  overflow: visible !important;
}

body[data-photo3001-version="v7"] .workspace {
  width: 100%;
  min-width: 0;
  min-height: calc(100dvh - var(--topbar-h));
  height: auto !important;
  overflow: visible !important;
}

body[data-photo3001-version="v7"] .workspace-head {
  position: sticky !important;
  top: var(--topbar-h);
  z-index: 36;
  min-height: 54px;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(14px);
}

body[data-photo3001-version="v7"] .workflow-bar {
  display: none !important;
}

body[data-photo3001-version="v7"] .workspace-scroll {
  width: 100%;
  min-height: calc(100dvh - var(--topbar-h) - 54px);
  height: auto !important;
  overflow: visible !important;
  overscroll-behavior: auto;
  touch-action: pan-x pan-y;
}

body[data-photo3001-version="v7"] .pages-stage {
  width: 100%;
  min-width: 0 !important;
  overflow-x: auto !important;
  overflow-y: visible !important;
  padding: 28px 24px 70px;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

body[data-photo3001-version="v7"] .empty-workspace {
  min-height: calc(100dvh - var(--topbar-h) - 250px);
  padding: 54px 24px 90px;
}

/* Both side panels are explicit drawers in V7. No hidden nested desktop
   scrolling remains in the page preview. */
body[data-photo3001-version="v7"] .sidebar,
body[data-photo3001-version="v7"] .inspector {
  position: fixed !important;
  z-index: 120;
  top: var(--v7-top-offset) !important;
  bottom: 0 !important;
  width: var(--v7-drawer-width) !important;
  min-width: 0 !important;
  height: auto !important;
  max-height: none !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  background: rgba(255, 255, 255, 0.99);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

body[data-photo3001-version="v7"] .sidebar {
  left: 0;
  right: auto;
  transform: translateX(-104%) !important;
  border-right: 1px solid var(--line);
  box-shadow: 18px 0 48px rgba(20, 35, 58, 0.2);
}

body[data-photo3001-version="v7"] .inspector {
  right: 0;
  left: auto;
  transform: translateX(104%) !important;
  border-left: 1px solid var(--line);
  box-shadow: -18px 0 48px rgba(20, 35, 58, 0.2);
}

body[data-photo3001-version="v7"] .sidebar.mobile-open,
body[data-photo3001-version="v7"] .inspector.mobile-open {
  transform: translateX(0) !important;
}

body[data-photo3001-version="v7"] .sidebar .aside-scroll,
body[data-photo3001-version="v7"] .inspector .inspector-content {
  min-height: auto !important;
  flex: 0 0 auto !important;
  overflow: visible !important;
}

body[data-photo3001-version="v7"] .sidebar .aside-header,
body[data-photo3001-version="v7"] .inspector .aside-header {
  position: sticky;
  top: 0;
  z-index: 8;
  background: rgba(255, 255, 255, 0.99);
}

body[data-photo3001-version="v7"] .panel-tabs {
  position: sticky;
  top: 67px;
  z-index: 7;
}

body[data-photo3001-version="v7"] .mobile-close {
  display: inline-grid !important;
}

.v7-drawer-backdrop {
  position: fixed;
  z-index: 110;
  inset: var(--topbar-h) 0 0;
  display: block;
  padding: 0;
  border: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  background: rgba(7, 17, 31, 0.42);
  backdrop-filter: blur(2px);
  transition: opacity 160ms ease, visibility 160ms ease;
}

.v7-drawer-backdrop.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

body.v7-drawer-open {
  overflow: hidden !important;
}

.v7-quick-dock {
  position: relative;
  z-index: 25;
  margin: 14px auto 0;
  width: min(1380px, calc(100% - 28px));
  padding: 15px;
  border: 1px solid rgba(23, 104, 229, 0.18);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 30px rgba(25, 48, 78, 0.09);
}

.v7-dock-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
}

.v7-dock-heading > div:first-child {
  min-width: 0;
}

.v7-dock-heading span,
.v7-dock-heading strong,
.v7-dock-heading small {
  display: block;
}

.v7-dock-heading span {
  margin-bottom: 3px;
  color: var(--primary);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.v7-dock-heading strong {
  color: #192b43;
  font-size: 15px;
}

.v7-dock-heading small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.v7-dock-drawer-actions {
  display: flex;
  gap: 7px;
  flex: 0 0 auto;
}

.v7-quick-controls {
  display: grid;
  grid-template-columns: minmax(145px, 1.15fr) minmax(95px, .65fr) minmax(95px, .65fr) minmax(145px, 1fr) minmax(105px, .7fr) minmax(115px, .75fr) minmax(130px, .85fr);
  gap: 8px;
  align-items: end;
}

.v7-quick-control {
  min-width: 0;
}

.v7-quick-control > span {
  display: block;
  margin: 0 0 5px 2px;
  color: #53647b;
  font-size: 10px;
  font-weight: 750;
}

.v7-quick-control .control {
  width: 100%;
  min-height: 42px;
  background: #fbfdff;
}

.v7-main-action {
  width: 100%;
  min-height: 42px;
}

.v7-dock-status {
  min-height: 31px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding: 7px 10px;
  border-radius: 10px;
  color: #53647b;
  background: #f5f8fc;
  font-size: 10px;
}

.v7-dock-status span + span {
  padding-left: 12px;
  border-left: 1px solid var(--line);
}

.v7-dock-status .text-button {
  margin-left: auto;
  white-space: nowrap;
}

.v7-diagnostics-modal .modal-card {
  width: min(680px, calc(100vw - 24px));
}

.v7-diagnostic-summary {
  margin-bottom: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: #34465e;
  background: #f7f9fc;
  font-size: 12px;
  font-weight: 750;
}

.v7-diagnostic-summary.pass {
  color: #0d6d49;
  border-color: rgba(22, 132, 91, .25);
  background: #edfaf4;
}

.v7-diagnostic-summary.fail {
  color: #a72a34;
  border-color: rgba(211, 59, 69, .25);
  background: #fff2f3;
}

.v7-diagnostic-output {
  max-height: 360px;
  margin: 0 0 14px;
  padding: 14px;
  overflow: auto;
  border: 1px solid #d4dce7;
  border-radius: 10px;
  color: #1f3148;
  background: #f8fafc;
  font: 11px/1.55 Consolas, "Courier New", monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

#v7SelfTestResult {
  display: none !important;
}

@media (max-width: 1180px) {
  .v7-quick-controls {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .v7-main-action {
    min-height: 44px;
  }
}

@media (max-width: 900px) {
  .v7-runtime-pill,
  .privacy-pill {
    display: none;
  }

  .v7-quick-controls {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .v7-dock-heading {
    display: block;
  }

  .v7-dock-drawer-actions {
    margin-top: 10px;
  }
}

@media (max-width: 780px) {
  body[data-photo3001-version="v7"] {
    padding-bottom: calc(66px + var(--safe-bottom));
  }

  body[data-photo3001-version="v7"] .workspace-head {
    top: var(--topbar-h);
  }

  body[data-photo3001-version="v7"] .pages-stage {
    padding: 20px 10px 70px;
  }

  body[data-photo3001-version="v7"] .sidebar,
  body[data-photo3001-version="v7"] .inspector {
    bottom: calc(58px + var(--safe-bottom)) !important;
  }

  .v7-drawer-backdrop {
    bottom: calc(58px + var(--safe-bottom));
  }

  .v7-quick-dock {
    width: calc(100% - 16px);
    margin-top: 8px;
    padding: 12px;
    border-radius: 13px;
  }

  .v7-dock-heading small {
    display: none;
  }

  .v7-dock-drawer-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .v7-quick-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .v7-main-action {
    min-height: 46px;
  }

  .v7-dock-status {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .v7-dock-status span + span {
    padding-left: 0;
    border-left: 0;
  }

  .v7-dock-status .text-button {
    width: 100%;
    margin-left: 0;
    text-align: left;
  }
}

@media (max-width: 480px) {
  .v7-quick-controls {
    grid-template-columns: 1fr;
  }

  .v7-dock-drawer-actions {
    grid-template-columns: 1fr;
  }

  .v7-dock-heading strong {
    font-size: 14px;
  }
}

@media print {
  .v7-quick-dock,
  .v7-drawer-backdrop,
  .v7-runtime-pill,
  .v7-diagnostics-modal {
    display: none !important;
  }
}


/* V7.2 RC1 helpers */
.v7-sample-action {
  border-style: dashed;
  color: #31557f;
  background: #f8fbff;
}

.v7-sample-action:hover {
  border-color: rgba(23, 104, 229, 0.42);
  color: var(--primary);
  background: #eef5ff;
}

body[data-photo3001-version="v7"] .toast-stack {
  pointer-events: none;
}

@media (max-width: 780px) {
  .v7-empty-actions {
    grid-template-columns: 1fr;
  }

  body[data-photo3001-version="v7"] .toast-stack {
    left: 10px;
    right: 10px;
    bottom: calc(70px + var(--safe-bottom));
  }
}

/* ===== v73.css ===== */
/* PHOTO3001 V7.3 local RC1 */
:root { --v73-safe-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
body[data-photo3001-release="v7.3-local-rc1"] .version-badge { color:#d6f7e6; border-color:rgba(72,220,151,.34); background:rgba(22,132,91,.18); }
body[data-photo3001-release="v7.3-local-rc1"] .v7-quick-controls { grid-template-columns:minmax(130px,1.1fr) minmax(82px,.6fr) minmax(82px,.6fr) minmax(130px,1fr) minmax(90px,.65fr) minmax(120px,.8fr) minmax(108px,.72fr) minmax(120px,.82fr) minmax(122px,.82fr); }
.margin-preset-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
.margin-preset-grid button { min-width:0; display:flex; flex-direction:column; align-items:flex-start; gap:3px; padding:11px; border:1px solid var(--line); border-radius:10px; color:#30445f; background:#fff; text-align:left; cursor:pointer; }
.margin-preset-grid button:hover,.margin-preset-grid button.active { border-color:rgba(23,104,229,.5); color:var(--primary); background:var(--primary-soft); box-shadow:inset 0 0 0 1px rgba(23,104,229,.14); }
.margin-preset-grid strong{font-size:12px}.margin-preset-grid span,.margin-preset-grid small{font-size:10px;line-height:1.45}.margin-preset-grid small{color:var(--muted)}
.v73-safety-status{color:#176047;font-weight:750}.v73-safety-status.adjusted{padding:3px 7px;border-radius:999px;color:#8a4f00;background:#fff3d9}
body[data-photo3001-release="v7.3-local-rc1"] .photo-slot.selected { z-index:1; outline:0!important; outline-offset:0!important; box-shadow:inset 0 0 0 3px var(--primary)!important; }
body[data-photo3001-release="v7.3-local-rc1"] .photo-slot.selected::after { content:"선택됨"; position:absolute; z-index:7; left:6px; bottom:6px; padding:3px 7px; border-radius:999px; color:#fff; background:rgba(23,104,229,.88); font-size:9px; font-weight:800; pointer-events:none; }
body[data-photo3001-release="v7.3-local-rc1"] .slot-photo-tools { display:none!important; }
body[data-photo3001-release="v7.3-local-rc1"] .caption-row span { display:block; align-content:center; text-overflow:ellipsis; }
body[data-photo3001-release="v7.3-local-rc1"] .report-grid { isolation:isolate; }
body[data-photo3001-release="v7.3-local-rc1"] .photo-slot { contain:layout paint; }
@media(max-width:1180px){body[data-photo3001-release="v7.3-local-rc1"] .v7-quick-controls{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:780px){body[data-photo3001-release="v7.3-local-rc1"]{padding-bottom:var(--v73-safe-bottom)!important}body[data-photo3001-release="v7.3-local-rc1"] .pages-stage{padding-bottom:116px!important}body[data-photo3001-release="v7.3-local-rc1"] .v7-quick-controls{grid-template-columns:repeat(2,minmax(0,1fr))}body[data-photo3001-release="v7.3-local-rc1"] .photo-slot.selected::after{display:none}.margin-preset-grid{grid-template-columns:1fr}}
@media(max-width:480px){body[data-photo3001-release="v7.3-local-rc1"] .v7-quick-controls{grid-template-columns:1fr}}
@media print{body[data-photo3001-release="v7.3-local-rc1"] .photo-slot.selected::after{display:none!important}}

/* ===== v74.css ===== */

.header-layout-toolbar{display:grid;grid-template-columns:minmax(0,1fr) minmax(112px,148px) auto;gap:10px;align-items:end;margin:10px 0 12px}
.header-layout-toolbar .field-label{margin:0}
.header-field-actions{display:flex;gap:8px;flex-wrap:wrap}
.header-field-editor{display:grid;gap:10px}
.header-field-card{padding:12px;border:1px solid rgba(74,95,128,.16);border-radius:16px;background:linear-gradient(180deg,#fff,#f7f9fc)}
.header-field-main{display:grid;grid-template-columns:1fr 1.2fr;gap:10px}
.header-field-main label{display:grid;gap:6px;font-size:12px;color:#51617a}
.header-field-tools{display:flex;gap:8px;align-items:center;justify-content:flex-end;flex-wrap:wrap;margin-top:10px}
.header-field-toggle{display:inline-flex;align-items:center;gap:6px;font-size:13px;color:#2f4360}
.layout-health-panel{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-bottom:12px}
.layout-health-card{border-radius:16px;padding:12px 14px;border:1px solid rgba(64,88,122,.12);background:#f7f9fc;display:grid;gap:4px}
.layout-health-card strong{font-size:14px;color:#233752}
.layout-health-card span{font-size:12px;color:#64748b;line-height:1.45}
.layout-health-card.ok{background:rgba(34,197,94,.08);border-color:rgba(34,197,94,.22)}
.layout-health-card.warn{background:rgba(245,158,11,.10);border-color:rgba(245,158,11,.26)}
.layout-health-card.info{background:rgba(59,130,246,.08);border-color:rgba(59,130,246,.18)}
.report-meta-grid{display:grid;gap:0;border-top:1px solid #aab3c0;border-left:1px solid #aab3c0}
.report-meta-item{min-width:0;display:grid;grid-template-columns:minmax(42px,auto) 1fr;border-right:1px solid #aab3c0;border-bottom:1px solid #aab3c0;background:#fff}
.report-meta-item b,.report-meta-item span{padding:3px 5px;min-height:22px;display:flex;align-items:center}
.report-meta-item b{background:#f5f6f7;justify-content:center;white-space:nowrap}
.report-meta-item span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.v74-structure-chip{display:inline-flex;align-items:center;gap:6px;padding:5px 10px;border-radius:999px;background:#eef3ff;color:#2851a3;font-size:12px;font-weight:700}
@media (max-width: 780px){.header-layout-toolbar{grid-template-columns:1fr}.header-field-main{grid-template-columns:1fr}.layout-health-panel{grid-template-columns:1fr}}

/* ===== v75.css ===== */
.v75-table-quick-control{min-width:178px}
.v75-table-preset-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(150px,190px);gap:10px;align-items:end;margin:10px 0 12px}
.v75-table-preset-row>.field-label{grid-column:1/-1;margin:0}
.compact-toggle{min-height:42px;margin:0}
.v75-interactive-block{cursor:pointer;transition:box-shadow .18s ease,outline-color .18s ease,transform .18s ease}
.v75-interactive-block:hover{box-shadow:0 0 0 2px rgba(47,124,246,.26) inset}
.report-meta-grid.v75-selected{z-index:4;box-shadow:0 0 0 3px #2877f0 inset,0 0 0 2px rgba(255,255,255,.92);background:#fff}
.report-meta-grid.v75-selected::after{content:"기본정보 표 선택됨";position:absolute;right:4px;top:-22px;padding:3px 8px;border-radius:999px;background:#1467d9;color:#fff;font-size:10px;font-weight:800;white-space:nowrap;box-shadow:0 4px 12px rgba(20,103,217,.26)}
.report-meta-item.v75-cell-selected{box-shadow:0 0 0 2px #e49a16 inset;background:#fffaf0}
.report-title-area.v75-selected,.report-footer.v75-selected{box-shadow:0 0 0 3px #2877f0 inset;border-radius:4px}
.header-table-inspector{padding:14px;overflow:auto}
.v75-selection-banner{display:flex;gap:12px;align-items:center;padding:14px;border-radius:18px;background:linear-gradient(135deg,#eaf3ff,#f7fbff);border:1px solid rgba(40,119,240,.18);margin-bottom:12px}
.v75-selection-banner .v75-selection-icon{display:grid;place-items:center;width:42px;height:42px;border-radius:14px;background:#2877f0;color:#fff;font-size:24px}
.v75-selection-banner div{display:grid;gap:3px}.v75-selection-banner strong{font-size:14px;color:#17395f}.v75-selection-banner small{font-size:12px;color:#63748a}
.v75-inspector-field-list{display:grid;gap:10px}
.v75-inspector-field{border:1px solid rgba(76,96,126,.16);border-radius:16px;background:#fff;padding:11px;display:grid;gap:9px}
.v75-inspector-field.selected{border-color:#e49a16;box-shadow:0 0 0 2px rgba(228,154,22,.16)}
.v75-inspector-field-main{display:grid;grid-template-columns:1fr 1.2fr;gap:8px}.v75-inspector-field-main label{display:grid;gap:5px;font-size:11px;color:#627189}
.v75-inspector-field-tools{display:flex;gap:7px;align-items:center;justify-content:flex-end}
.v75-table-empty-card{padding:18px;border:1px dashed #9fb0c5;border-radius:18px;text-align:center;color:#60748d;background:#f8fbff}
.v75-table-empty-card strong{display:block;color:#274766;margin-bottom:5px}
body.v75-block-selected .photo-slot:not(.selected){opacity:.96}
@media (max-width:780px){
  .v75-table-preset-row{grid-template-columns:1fr}
  .v75-table-preset-row>.field-label{grid-column:auto}
  .v75-inspector-field-main{grid-template-columns:1fr}
  .report-meta-grid.v75-selected::after{top:-19px;font-size:8px}
  .header-table-inspector{padding-bottom:calc(100px + env(safe-area-inset-bottom))}
}

#photoInspector.v75-opening{pointer-events:none}

/* ===== v8.css ===== */
:root {
  --v8-blue: #155fd5;
  --v8-blue-soft: #eef5ff;
  --v8-ink: #17253a;
  --v8-line: #d9e1eb;
  --v8-safe: #087a58;
  --v8-warning: #b66a00;
}

.v8-autosave-pill {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  background: rgba(255,255,255,.07);
  color: #dbe8fa;
  font-size: 12px;
  white-space: nowrap;
}
.v8-autosave-pill[data-state="saved"] { color: #baf5d9; background: rgba(22,163,74,.15); }
.v8-autosave-pill[data-state="warning"] { color: #ffe0a3; background: rgba(245,158,11,.14); }
.v8-autosave-pill[data-state="dirty"], .v8-autosave-pill[data-state="working"] { color: #d8e7ff; background: rgba(37,99,235,.18); }

.v8-restore-banner {
  position: sticky;
  top: 62px;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  max-width: 1180px;
  margin: 12px auto 0;
  padding: 14px 18px;
  border: 1px solid #bfd3f2;
  border-radius: 18px;
  background: rgba(242,247,255,.97);
  box-shadow: 0 10px 30px rgba(35,70,120,.12);
}
.v8-restore-banner > div:first-child { display: grid; gap: 3px; }
.v8-restore-banner strong { color: #193b70; }
.v8-restore-banner span { color: #5c6d84; font-size: 13px; }

.v8-studio { display: grid; gap: 18px; }
.v8-studio-head {
  display: grid;
  gap: 6px;
  padding: 18px;
  border-radius: 20px;
  color: white;
  background: linear-gradient(135deg,#0d4cb2,#1d78ed);
  box-shadow: 0 12px 28px rgba(22,91,194,.2);
}
.v8-studio-head span { font-size: 11px; letter-spacing: .12em; font-weight: 800; opacity: .8; }
.v8-studio-head strong { font-size: 20px; }
.v8-studio-head p { margin: 0; line-height: 1.55; font-size: 13px; opacity: .88; }
.v8-picker-section { display: grid; gap: 10px; }
.v8-card-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.v8-choice-card, .v8-paper-card {
  min-width: 0;
  min-height: 116px;
  display: grid;
  align-content: start;
  justify-items: stretch;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--v8-line);
  border-radius: 16px;
  background: #fff;
  color: var(--v8-ink);
  text-align: left;
  transition: border-color .16s, box-shadow .16s, transform .16s;
}
.v8-choice-card:hover, .v8-paper-card:hover { border-color: #94b9f0; transform: translateY(-1px); }
.v8-choice-card.active, .v8-paper-card.active {
  border-color: var(--v8-blue);
  box-shadow: 0 0 0 2px rgba(21,95,213,.13), 0 8px 20px rgba(21,95,213,.12);
  background: linear-gradient(180deg,#fff,#f5f9ff);
}
.v8-choice-card strong, .v8-paper-card strong { font-size: 14px; line-height: 1.3; }
.v8-choice-card small, .v8-paper-card small { color: #68788f; font-size: 11px; line-height: 1.4; }
.v8-doc-icon {
  width: 38px; height: 38px; display: grid; place-items: center;
  border-radius: 12px; background: var(--v8-blue-soft); color: var(--v8-blue); font-size: 20px; font-weight: 800;
}
.v8-paper-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.v8-paper-card { min-height: 98px; grid-template-columns: 48px 1fr; align-items: center; align-content: center; }
.v8-paper-card strong, .v8-paper-card small { grid-column: 2; }
.v8-paper-sheet { grid-row: 1 / span 2; width: 36px; height: 50px; border: 2px solid #56708f; background:#fff; box-shadow: inset 0 8px #edf2f8; }
.v8-paper-sheet.landscape { width: 48px; height: 34px; }

.v8-header-preview { height: 56px; display: grid; gap: 2px; padding: 5px; border: 1px solid #9aa7b6; background:#fff; }
.v8-header-preview-row { display:flex; gap:2px; min-height:0; }
.v8-header-preview-row b { min-width:0; display:grid; place-items:center; border:1px solid #c8d0da; background:#f3f5f8; font-size:7px; font-style:normal; overflow:hidden; }
.v8-empty-preview { display:grid; place-items:center; min-height:48px; border:1px dashed #aab6c4; color:#78869a; font-size:11px; }
.v8-layout-preview { height:62px; display:grid; gap:3px; padding:4px; background:#eef2f6; border:1px solid #aab5c2; }
.v8-layout-preview i { min-width:0; min-height:0; background:#fff; border:1px solid #8f9eaf; }
.v8-caption-preview { min-height:58px; display:grid; align-content:center; gap:2px; padding:4px; border:1px solid #aab5c2; background:#fff; }
.v8-caption-preview i { display:grid; grid-template-columns:32% 1fr; min-height:14px; border:1px solid #c2cad3; }
.v8-caption-preview b { display:grid; place-items:center; background:#f0f2f5; font-size:7px; }
.v8-caption-preview span { background:#fff; }
.v8-final-action { display:grid; grid-template-columns:1fr 1fr; gap:10px; padding:14px; border-radius:18px; background:#f5f8fc; border:1px solid #dce4ee; }
.v8-final-action small { grid-column:1/-1; text-align:center; color:#47735f; }

.report-meta-logo { display:grid!important; place-items:center; background:#fff!important; overflow:hidden; }
.report-meta-logo img { width:100%; height:100%; object-fit:contain; padding:5px; }
.report-meta-logo span { font-size:9px; color:#7b8796; }
[data-layout-health="warning"] .v73-safety-status { color: var(--v8-warning); }

.v8-interactive-block, .v75-interactive-block { cursor:pointer; transition: box-shadow .16s, background .16s; }
.v8-interactive-block:hover, .v75-interactive-block:hover { box-shadow: inset 0 0 0 2px rgba(21,95,213,.42); }
.paper-page [data-interactive-block]::after { pointer-events:none; }

.export-progress { gap:10px; }
#cancelExportButton { justify-self:end; }

@media (max-width: 1180px) {
  .v8-autosave-pill { display:none; }
}
@media (max-width: 780px) {
  .v8-restore-banner { top:0; margin:0; border-radius:0 0 18px 18px; flex-direction:column; align-items:stretch; }
  .v8-card-grid { grid-template-columns:1fr 1fr; }
  .v8-choice-card { min-height:108px; }
  .v8-paper-grid { grid-template-columns:1fr 1fr; }
  .v8-final-action { position:sticky; bottom:78px; z-index:4; box-shadow:0 -8px 22px rgba(31,53,82,.10); }
}
@media (max-width: 430px) {
  .v8-card-grid.header-templates, .v8-card-grid.photo-layouts, .v8-card-grid.caption-templates { grid-template-columns:1fr; }
}

/* V8 final workflow: hide superseded quick controls while retaining advanced tabs. */
[data-panel="document"] > .v8-legacy-hidden { display: none !important; }

.v8-system-banner {
  position: fixed;
  z-index: 2000;
  top: max(12px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  width: min(720px, calc(100vw - 24px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid #efb3b3;
  border-radius: 16px;
  background: #fff7f7;
  box-shadow: 0 16px 44px rgba(78, 22, 22, .2);
  color: #742626;
}
.v8-system-banner > div:first-child { display: grid; gap: 3px; min-width: 0; }
.v8-system-banner strong { font-size: 14px; }
.v8-system-banner small { line-height: 1.45; color: #8d5151; }

.v8-studio .group-title-row { align-items: center; }
.v8-card-grid.document-types { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.v8-card-grid.header-templates,
.v8-card-grid.photo-layouts,
.v8-card-grid.caption-templates { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.v8-choice-card.template-preview-card { min-height: 146px; }
.v8-choice-card > strong { align-self: end; }
.v8-choice-card > small { min-height: 31px; }
.v8-choice-card:focus-visible,
.v8-paper-card:focus-visible,
[data-interactive-block]:focus-visible {
  outline: 3px solid rgba(37, 99, 235, .48);
  outline-offset: 2px;
}

.v8-caption-field-card {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 10px;
  padding: 12px;
  border: 1px solid #dce4ee;
  border-radius: 14px;
  background: linear-gradient(180deg, #fff, #f8fafc);
}
.v8-caption-field-main { display: grid; grid-template-columns: 1fr minmax(112px, .7fr); gap: 10px; }
.v8-caption-field-main label,
.v8-caption-options { display: grid; gap: 5px; color: #52647b; font-size: 12px; }
.v8-caption-field-tools { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 7px; }
.v8-caption-options.hidden { display: none !important; }

.v8-caption-inspector { overflow: auto; }
.v8-caption-preview-row {
  min-height: 28px;
  display: grid;
  grid-template-columns: minmax(70px, 32%) 1fr;
  border: 1px solid #cdd5df;
  border-bottom: 0;
  background: #fff;
}
.v8-caption-preview-row:last-child { border-bottom: 1px solid #cdd5df; }
.v8-caption-preview-row b,
.v8-caption-preview-row span { display: flex; align-items: center; min-width: 0; padding: 5px 7px; font-size: 11px; }
.v8-caption-preview-row b { justify-content: center; background: #f1f4f7; border-right: 1px solid #cdd5df; }
.v8-caption-preview-row span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.v8-selected { box-shadow: inset 0 0 0 2px #1769df !important; }

.v8-interactive-block { position: absolute; }
.report-grid.v8-interactive-block { display: grid; }
.caption-box.v8-interactive-block { position: relative; }
.v8-interactive-block::before,
.v75-interactive-block::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  opacity: 0;
  box-shadow: inset 0 0 0 2px rgba(29, 112, 226, .65);
  transition: opacity .14s;
}
.v8-interactive-block:hover::before,
.v8-interactive-block:focus-visible::before,
.v75-interactive-block:hover::before,
.v75-interactive-block:focus-visible::before { opacity: 1; }

.v8-header-preview {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-rows: minmax(11px, auto);
  gap: 2px;
}
.v8-header-preview-row { display: contents; }
.v8-header-preview-row b { min-width: 0; padding: 1px; }
.v8-layout-preview i { display: grid; place-items: center; color: #6a7b90; font-style: normal; font-size: 8px; }
.v8-caption-preview { overflow: hidden; }

.report-meta-grid { overflow: hidden; }
.report-meta-item { min-width: 0; min-height: 0; }
.report-meta-item b,
.report-meta-item span { overflow: hidden; text-overflow: ellipsis; }
.report-meta-item span { white-space: nowrap; }
.report-meta-logo { border-right: 1px solid #aab3c0; border-bottom: 1px solid #aab3c0; }

.export-progress { display: grid; grid-template-columns: 1fr auto; align-items: center; }
.export-progress > div:first-child,
.export-progress > .progress-track { grid-column: 1 / -1; }
#cancelExportButton { min-height: 36px; }

/* Desktop work area: keep the preview readable and allow page-level scrolling. */
body[data-photo3001-version="v8"] .workspace-scroll { overflow: visible; }
body[data-photo3001-version="v8"] .pages-stage { padding-bottom: 70px; }

@media (max-width: 780px) {
  .v8-studio { gap: 16px; }
  .v8-studio-head { border-radius: 16px; padding: 16px; }
  .v8-card-grid.document-types,
  .v8-card-grid.header-templates,
  .v8-card-grid.photo-layouts,
  .v8-card-grid.caption-templates { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .v8-choice-card { min-height: 112px; padding: 11px; }
  .v8-choice-card.template-preview-card { min-height: 142px; }
  .v8-paper-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .v8-final-action { bottom: calc(74px + env(safe-area-inset-bottom)); }
  .v8-system-banner { flex-direction: column; align-items: stretch; }
  .v8-system-banner .button-row { width: 100%; }
  .v8-caption-field-main { grid-template-columns: 1fr; }
  body[data-photo3001-version="v8"] .pages-stage { padding-bottom: calc(145px + env(safe-area-inset-bottom)); }
}

@media (max-width: 430px) {
  .v8-card-grid.document-types { grid-template-columns: 1fr 1fr; }
  .v8-card-grid.header-templates,
  .v8-card-grid.photo-layouts,
  .v8-card-grid.caption-templates { grid-template-columns: 1fr; }
  .v8-paper-grid { grid-template-columns: 1fr 1fr; }
  .v8-choice-card.template-preview-card { min-height: 136px; }
}

@media print {
  .v8-system-banner,
  .v8-restore-banner,
  .v8-autosave-pill { display: none !important; }
  [data-interactive-block]::before { display: none !important; }
}


/* V8 final integration */
.v8-legacy-hidden{display:none!important}
.v8-system-banner{position:fixed;left:50%;top:76px;z-index:2000;width:min(680px,calc(100vw - 28px));transform:translateX(-50%);display:flex;align-items:center;justify-content:space-between;gap:16px;padding:16px 18px;border:1px solid #e6a6a6;border-radius:18px;background:#fff7f7;box-shadow:0 16px 44px rgba(90,28,28,.18);color:#612828}
.v8-system-banner>div:first-child{display:grid;gap:4px}.v8-system-banner strong{font-size:14px}.v8-system-banner small{line-height:1.45;color:#855050}
.v8-caption-inspector{display:grid;gap:12px;padding:14px;overflow:auto}
.v8-selection-banner{display:flex;gap:12px;align-items:center;padding:14px;border-radius:18px;background:linear-gradient(135deg,#eaf3ff,#f8fbff);border:1px solid rgba(40,119,240,.18)}
.v8-selection-banner>span{display:grid;place-items:center;width:42px;height:42px;border-radius:14px;background:var(--v8-blue);color:#fff;font-size:24px;font-weight:800}.v8-selection-banner>div{display:grid;gap:3px}.v8-selection-banner strong{color:#17395f;font-size:14px}.v8-selection-banner small{color:#63748a;font-size:12px}
.v8-caption-preview{display:grid;gap:3px;margin-top:10px}.v8-caption-preview-row{display:grid;grid-template-columns:minmax(72px,30%) 1fr;min-height:34px;border:1px solid #b8c2ce}.v8-caption-preview-row b,.v8-caption-preview-row span{display:flex;align-items:center;padding:6px 8px}.v8-caption-preview-row b{justify-content:center;background:#f2f4f7}.v8-caption-preview-row span{background:#fff;color:#5d6a7b}
.v8-selected{box-shadow:inset 0 0 0 3px var(--v8-blue)!important}
.v8-caption-field-card{display:grid!important;gap:9px!important;padding:11px!important;border:1px solid rgba(76,96,126,.16)!important;border-radius:16px!important;background:#fff!important}.v8-caption-field-main{display:grid;grid-template-columns:1fr 1fr;gap:8px}.v8-caption-field-main label,.v8-caption-options{display:grid;gap:5px;font-size:11px;color:#627189}.v8-caption-field-tools{display:flex;align-items:center;justify-content:flex-end;gap:7px}
body[data-layout-health="warning"] .v8-final-action{border-color:#e8b25d;background:#fff9ef}
@media (max-width:780px){.v8-system-banner{top:10px;flex-direction:column;align-items:stretch}.v8-caption-inspector{padding-bottom:calc(105px + env(safe-area-inset-bottom))}.v8-caption-field-main{grid-template-columns:1fr}}
body[data-photo3001-version="v8"] [data-panel="document"] > .quick-start-banner,
body[data-photo3001-version="v8"] [data-panel="document"] > .setting-group,
body[data-photo3001-version="v8"] [data-panel="document"] > .quick-import-card { display: none !important; }
.report-meta-grid.v75-selected { overflow: visible; }

/* Drawer stacking: backdrop must stay behind interactive side panels. */
@media (max-width:1120px){
  body[data-photo3001-version="v8"] .sidebar,
  body[data-photo3001-version="v8"] .inspector{z-index:130}
  body[data-photo3001-version="v8"] .v7-drawer-backdrop{z-index:120}
}

/* Mobile touch targets: controls remain comfortably tappable at 200% text zoom. */
@media (max-width: 780px) {
  .topbar .primary-button,
  .mobile-close,
  .panel-tabs button,
  .v8-picker-section .text-button,
  .workspace-tools button,
  .v7-dock-status .text-button,
  #v8EditHeaderValues,
  #v8EditCaptionFields,
  #fitWorkspaceButton,
  #v7ResetQuickButton {
    min-height: 44px;
  }
  .mobile-close { min-width: 44px; }
  #v8EditHeaderValues,
  #v8EditCaptionFields,
  #v7ResetQuickButton { padding: 10px 12px; }
}

@media (max-width: 780px) {
  .workflow-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow-x: visible;
    gap: 6px;
  }
  .workflow-step { min-width: 0; }
}

/* ===== v10.css ===== */
:root{--v10-dock-h:76px;--v10-sheet-h:min(46dvh,540px);--v10-bg:#eef3f8;--v10-surface:rgba(255,255,255,.98);--v10-line:rgba(80,103,137,.17);--v10-blue:#1769df;--v10-ink:#17263a;--v10-muted:#65748a;--v10-shadow:0 22px 64px rgba(22,39,64,.25)}
body[data-photo3001-ui="v10"]{min-height:100dvh;padding-bottom:calc(var(--v10-dock-h) + env(safe-area-inset-bottom) + 20px);background:linear-gradient(180deg,#eef3f8,#f7f9fc 42%,#edf2f7)}
body[data-photo3001-ui="v10"] .topbar{position:sticky;top:0;z-index:190;min-height:54px;padding:8px 13px;background:rgba(8,20,37,.97);backdrop-filter:blur(16px)}
body[data-photo3001-ui="v10"] .brand-block>div:last-child>span,body[data-photo3001-ui="v10"] .privacy-pill,body[data-photo3001-ui="v10"] .v7-runtime-pill,body[data-photo3001-ui="v10"] .toolbar-divider,body[data-photo3001-ui="v10"] .top-actions .ghost-button{display:none!important}
body[data-photo3001-ui="v10"] .top-actions{margin-left:auto;gap:5px}body[data-photo3001-ui="v10"] .top-actions .primary-button{display:inline-flex!important;min-height:38px;padding:0 13px}body[data-photo3001-ui="v10"] .v8-autosave-pill{margin-left:auto}
body[data-photo3001-ui="v10"] .mobile-toolbar,body[data-photo3001-ui="v10"] .sidebar,body[data-photo3001-ui="v10"] .workflow-bar,body[data-photo3001-ui="v10"] .v7-quick-dock,body[data-photo3001-ui="v10"] .workspace-head,body[data-photo3001-ui="v10"] .v7-drawer-backdrop{display:none!important}
body[data-photo3001-ui="v10"] .app-shell{display:block!important;width:100%;max-width:none;min-height:auto}body[data-photo3001-ui="v10"] .workspace{width:min(100%,1440px);max-width:none;margin:0 auto;padding:10px 8px calc(var(--v10-dock-h) + 40px)}body[data-photo3001-ui="v10"] .workspace-scroll{overflow:visible!important;min-height:0;padding:8px 0 30px}body[data-photo3001-ui="v10"] .pages-stage{justify-content:center;padding-bottom:90px!important}body[data-photo3001-ui="v10"].v10-sheet-open .pages-stage,body[data-photo3001-ui="v10"].v10-photo-open .pages-stage{padding-bottom:calc(var(--v10-sheet-h) + var(--v10-dock-h) + 70px)!important}
.v10-preview-strip{position:sticky;top:54px;z-index:180;display:flex;align-items:center;gap:7px;width:100%;padding:7px max(9px,calc((100vw - 1420px)/2));overflow-x:auto;scrollbar-width:none;border-bottom:1px solid rgba(72,93,122,.12);background:rgba(249,251,253,.95);backdrop-filter:blur(14px);box-shadow:0 6px 22px rgba(30,49,73,.08)}.v10-preview-strip::-webkit-scrollbar{display:none}
.v10-status-chip{flex:0 0 auto;min-width:118px;min-height:42px;display:grid;align-content:center;gap:1px;padding:5px 11px;border:1px solid rgba(93,112,139,.18);border-radius:13px;background:#fff;color:var(--v10-ink);text-align:left}.v10-status-chip small{font-size:10px;color:#7b899c}.v10-status-chip strong{max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px}.v10-health{flex:0 0 auto;display:inline-flex;align-items:center;min-height:34px;padding:0 11px;border-radius:999px;border:1px solid #b7e7d2;background:#e6f7ef;color:#0b6b4e;font-size:11px;font-weight:800}.v10-health[data-state="adjusted"]{border-color:#f0d095;background:#fff3d9;color:#8a5600}.v10-health[data-state="warning"]{border-color:#efbbbb;background:#fff0f0;color:#982f2f}
.v10-strip-action{flex:0 0 auto;min-height:38px;display:inline-flex;align-items:center;gap:5px;padding:0 11px;border:1px solid #d4deea;border-radius:12px;background:#fff;color:#2e4665;font-weight:800}.v10-strip-action svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:2}.v10-strip-action.primary{border-color:#1769df;background:#1769df;color:#fff}
.v10-dock{position:fixed;z-index:450;left:50%;bottom:max(8px,env(safe-area-inset-bottom));transform:translateX(-50%);width:min(720px,calc(100vw - 18px));min-height:68px;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:4px;padding:6px;border:1px solid rgba(255,255,255,.24);border-radius:23px;background:rgba(12,25,43,.95);box-shadow:0 16px 48px rgba(6,14,27,.34);backdrop-filter:blur(18px)}
.v10-dock button{position:relative;min-width:0;min-height:54px;display:grid;place-items:center;align-content:center;gap:2px;border:0;border-radius:16px;background:transparent;color:#b1bfd1}.v10-dock svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.v10-dock span{font-size:10.5px;font-weight:800}.v10-dock i{position:absolute;bottom:4px;width:18px;height:3px;border-radius:99px;background:transparent}.v10-dock button.active{color:#fff;background:rgba(61,128,231,.28)}.v10-dock button.active i{background:#79b0ff}
.v10-sheet,.v10-photo-sheet{position:fixed;z-index:430;left:50%;bottom:calc(var(--v10-dock-h) + max(17px,env(safe-area-inset-bottom)));width:min(980px,calc(100vw - 30px));max-height:var(--v10-sheet-h);display:grid;grid-template-rows:auto minmax(0,1fr);border:1px solid var(--v10-line);border-radius:24px;background:var(--v10-surface);box-shadow:var(--v10-shadow);backdrop-filter:blur(20px);transform:translate(-50%,calc(100% + 110px));opacity:0;visibility:hidden;transition:transform .22s ease,opacity .18s ease,visibility .22s;overflow:hidden}.v10-sheet.open,.v10-photo-sheet.open{transform:translate(-50%,0);opacity:1;visibility:visible}
.v10-sheet-head{min-height:62px;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 12px 9px 17px;border-bottom:1px solid rgba(90,108,134,.12)}.v10-sheet-head>div{min-width:0;display:grid;gap:2px}.v10-sheet-head strong{font-size:16px;color:var(--v10-ink)}.v10-sheet-head span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;color:var(--v10-muted)}.v10-close{width:44px;height:44px;display:grid;place-items:center;border:0;border-radius:14px;background:#eef2f7;color:#43556d}.v10-close svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:2}
.v10-sheet-body,.v10-photo-body{min-height:0;overflow:auto;overscroll-behavior:contain;padding:14px 16px 24px}.v10-photo-body .inspector{position:static!important;inset:auto!important;width:100%!important;max-width:none!important;height:auto!important;min-height:0!important;display:block!important;transform:none!important;opacity:1!important;visibility:visible!important;border:0!important;box-shadow:none!important;background:transparent!important}.v10-photo-body .aside-header{display:none!important}.v10-photo-body .inspector-content{overflow:visible!important;padding:0 0 18px!important}
.v10-panel-grid{display:grid;grid-template-columns:1fr;gap:12px}.v10-panel-grid.two{grid-template-columns:repeat(2,minmax(0,1fr))}.v10-panel-grid .span-2{grid-column:1/-1}.v10-field{display:grid;gap:6px;min-width:0}.v10-field>span,.v10-range>span{font-size:12px;font-weight:800;color:#4f6077}.v10-field .control,.v10-panel-grid .control{min-height:44px}.v10-color{width:100%;height:44px;padding:4px;border:1px solid #d5deea;border-radius:12px;background:#fff}.v10-range{display:grid;gap:9px}.v10-range>span{display:flex;justify-content:space-between;gap:10px}.v10-range output{font-weight:900;color:#1769df}.v10-range input{width:100%}
.v10-toggle-row,.v10-action-row,.v10-quick-row{display:flex;align-items:center;gap:9px;flex-wrap:wrap}.v10-quick-row{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));margin-bottom:12px}.v10-choice-toggle{min-height:42px;padding:0 15px;border:1px solid #d4deea;border-radius:12px;background:#fff;color:#455a75;font-weight:800}.v10-choice-toggle.active{border-color:#1769df;background:#eaf3ff;color:#155dbf}.v10-fixed-note{padding:8px 11px;border-radius:999px;background:#f0f4f8;color:#607087;font-size:12px;font-weight:700}.v10-switch{display:inline-flex;align-items:center;gap:8px;min-height:40px;color:#40536c;font-size:12px;font-weight:800}.v10-switch.compact{min-height:auto}.v10-switch-stack{display:grid;gap:5px}
.v10-tip{display:flex;align-items:flex-start;gap:9px;margin-top:13px;padding:12px 14px;border:1px solid #cfe0f6;border-radius:16px;background:linear-gradient(135deg,#edf5ff,#fbfdff)}.v10-tip strong{flex:0 0 auto;color:#1769df}.v10-tip span{color:#5f7189;font-size:12px;line-height:1.5}
.v10-layout-status{display:flex;justify-content:space-between;gap:10px;margin:10px 0;padding:10px 13px;border-radius:14px;background:#e9f7ef;color:#0c6a4c}.v10-layout-status.adjusted{background:#fff3d9;color:#8a5600}.v10-layout-status span{font-size:12px}
.v10-card-grid{display:grid;gap:9px}.v10-card-grid.layouts{grid-template-columns:repeat(auto-fill,minmax(145px,1fr));max-height:250px;overflow:auto;padding:2px}.v10-card-grid.templates{grid-template-columns:repeat(auto-fill,minmax(150px,1fr));max-height:210px;overflow:auto;padding:2px}.v10-card{min-width:0;min-height:112px;display:grid;align-content:start;gap:5px;padding:11px;border:1px solid #d7e0eb;border-radius:16px;background:#fff;color:#263b57;text-align:left}.v10-card.active{border-color:#1769df;box-shadow:0 0 0 2px rgba(23,105,223,.12);background:#f7fbff}.v10-card strong{font-size:13px}.v10-card small{color:#748297;line-height:1.35}.v10-layout-mini{width:100%;height:45px;display:grid;gap:2px;padding:4px;border-radius:9px;background:#eef3f8}.v10-layout-mini i{display:block;border-radius:3px;background:#a9c9f3}.v10-template-icon{width:35px;height:35px;display:grid;place-items:center;border-radius:10px;background:#eaf3ff;color:#1769df;font-size:20px}
.v10-section-head{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:10px}.v10-section-head>span{font-size:11px;color:#718096}.v10-details{margin-top:12px;border:1px solid #dbe3ed;border-radius:16px;background:#fff;overflow:hidden}.v10-details summary{cursor:pointer;padding:12px 14px;font-weight:900;color:#334b68;background:#f8fafc}.v10-details[open] summary{border-bottom:1px solid #e3e8ef}.v10-details>div,.v10-details>.v10-panel-grid,.v10-details>.v10-field-list{padding:13px}
.v10-field-list{display:grid;gap:8px}.v10-field-editor{display:grid;grid-template-columns:auto minmax(120px,1fr) auto;align-items:center;gap:8px;padding:8px;border:1px solid #e0e6ee;border-radius:13px;background:#fbfcfe}.v10-order-buttons{display:flex;gap:4px}.v10-order-buttons button{width:34px;height:34px;display:grid;place-items:center;border:1px solid #d8e0ea;border-radius:9px;background:#fff;color:#53677f}.v10-order-buttons button:last-child{color:#b33d3d}.v10-order-buttons svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2}
.v10-asset-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;margin:13px 0}.v10-asset-grid button{min-height:88px;display:grid;place-items:center;align-content:center;gap:5px;border:1px solid #d6e0eb;border-radius:16px;background:#fff;color:#334b68}.v10-asset-grid button span{width:42px;height:34px;display:grid;place-items:center;border-radius:9px;background:#eef3f8;font-size:12px}.v10-project-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;margin-top:13px}.v10-project-actions button{min-height:46px}
.v10-inline-editor{position:fixed;z-index:9000;display:grid;gap:9px;padding:12px;border:1px solid #9abce9;border-radius:16px;background:rgba(255,255,255,.99);box-shadow:0 18px 55px rgba(15,35,62,.30)}.v10-inline-head{display:flex;justify-content:space-between;gap:10px}.v10-inline-head strong{color:#173b68}.v10-inline-head span{font-size:11px;color:#6f7e92}.v10-inline-editor .control{min-height:46px;font-size:16px}.v10-inline-actions{display:flex;justify-content:flex-end;gap:8px}.v10-inline-actions button{min-height:38px;padding:0 13px;border:1px solid #d5deea;border-radius:10px;background:#fff;color:#4c6079;font-weight:800}.v10-inline-actions button.primary{border-color:#1769df;background:#1769df;color:#fff}.v10-inline-source{box-shadow:inset 0 0 0 3px #1769df!important;background-color:rgba(23,105,223,.08)!important}.v10-inline-editor.mobile{left:8px!important;right:8px!important;bottom:calc(var(--v10-dock-h) + 12px + env(safe-area-inset-bottom))!important;top:auto!important;width:auto!important}
body[data-photo3001-ui="v10"] [data-v10-inline]{cursor:text}body[data-photo3001-ui="v10"] [data-v10-inline]:hover{box-shadow:inset 0 0 0 2px rgba(23,105,223,.55)}body[data-photo3001-ui="v10"] .report-title-area h1{text-align:center!important}
@media(max-width:780px){:root{--v10-dock-h:72px;--v10-sheet-h:min(54dvh,590px)}body[data-photo3001-ui="v10"] .topbar{top:0;min-height:52px;padding:7px 9px}body[data-photo3001-ui="v10"] .brand-title-row strong{font-size:14px}body[data-photo3001-ui="v10"] .version-badge{font-size:9px}body[data-photo3001-ui="v10"] .top-actions .icon-button{display:none!important}body[data-photo3001-ui="v10"] .top-actions .primary-button{min-width:42px;padding:0;font-size:0}body[data-photo3001-ui="v10"] .top-actions .primary-button svg{margin:0}body[data-photo3001-ui="v10"] .workspace{padding:6px 3px calc(var(--v10-dock-h) + 24px)}.v10-preview-strip{top:52px;padding:6px 7px}.v10-status-chip{min-width:102px;min-height:38px;padding:4px 8px}.v10-status-chip strong{max-width:125px;font-size:11px}.v10-strip-action span{display:none}.v10-strip-action{width:38px;padding:0;justify-content:center}.v10-dock{width:calc(100vw - 10px);bottom:max(4px,env(safe-area-inset-bottom));padding:5px;border-radius:20px}.v10-dock button{min-height:55px;border-radius:15px}.v10-dock span{font-size:9.5px}.v10-sheet,.v10-photo-sheet{left:0;right:0;bottom:calc(var(--v10-dock-h) + max(8px,env(safe-area-inset-bottom)));width:100%;max-height:var(--v10-sheet-h);border-radius:22px 22px 0 0;transform:translateY(calc(100% + 110px))}.v10-sheet.open,.v10-photo-sheet.open{transform:translateY(0)}.v10-sheet-head{min-height:58px;padding:9px 10px 8px 14px}.v10-sheet-head strong{font-size:15px}.v10-sheet-head span{max-width:76vw;font-size:11px}.v10-sheet-body,.v10-photo-body{padding:11px 11px calc(19px + env(safe-area-inset-bottom))}.v10-panel-grid.two,.v10-quick-row{grid-template-columns:1fr}.v10-card-grid.layouts{grid-template-columns:repeat(2,minmax(0,1fr));max-height:260px}.v10-card-grid.templates{display:flex;overflow-x:auto;max-height:none}.v10-card-grid.templates .v10-card{flex:0 0 min(180px,72vw)}.v10-field-editor{grid-template-columns:auto minmax(0,1fr)}.v10-order-buttons{grid-column:1/-1;justify-content:flex-end}.v10-asset-grid{grid-template-columns:repeat(3,1fr)}.v10-project-actions{grid-template-columns:1fr}}
@media(max-width:420px){.v10-status-chip{min-width:96px}.v10-card-grid.layouts{grid-template-columns:repeat(2,minmax(0,1fr))}.v10-card{min-height:105px;padding:9px}.v10-dock svg{width:20px;height:20px}}
@media print{.v10-preview-strip,.v10-dock,.v10-sheet,.v10-photo-sheet,.v10-inline-editor{display:none!important}body[data-photo3001-ui="v10"]{padding:0;background:#fff}}

/* ===== v11.css ===== */

body[data-photo3001-version="v11"] .empty-workspace{display:none!important}
body[data-photo3001-version="v11"] .pages-stage{display:flex!important}
.v11-free-grid{display:grid;overflow:hidden;border-top:1px solid #7d8794;border-left:1px solid #7d8794;background:#fff}
.v11-grid-cell{min-width:0;min-height:0;display:flex;align-items:center;justify-content:center;padding:3px 5px;overflow:hidden;text-align:center;white-space:pre-wrap;word-break:break-word;border-right:1px solid #7d8794;border-bottom:1px solid #7d8794;line-height:1.25;cursor:text}
.v11-grid-cell.is-empty{color:#8795a8;background:#f7f9fb}
.v11-grid-cell.shared{font-weight:700}
.v11-placeholder{opacity:.72;font-size:.88em;pointer-events:none}
.v11-dimension-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-bottom:12px}
.v11-stepper{display:grid;grid-template-columns:1fr 42px 48px 42px;align-items:center;gap:6px;padding:12px;border:1px solid #d7e0eb;border-radius:16px;background:#fff}
.v11-stepper>span{grid-column:1/-1;font-size:12px;font-weight:900;color:#445a74}
.v11-stepper button{height:40px;border:1px solid #d0dbe8;border-radius:11px;background:#f7f9fc;color:#24548e;font-size:22px;font-weight:800}
.v11-stepper output{height:40px;display:grid;place-items:center;border-radius:11px;background:#eaf3ff;color:#145bbd;font-size:17px;font-weight:900}
.v11-stepper input{width:100%;height:40px;border:1px solid #d0dbe8;border-radius:11px;text-align:center;font-weight:800}
.v11-grid-summary{display:flex;justify-content:space-between;align-items:center;gap:10px;margin:10px 0 12px;padding:11px 13px;border-radius:14px;background:#eef6ff;color:#1c5da7}
.v11-grid-summary span{font-size:12px;color:#61748e}
.v11-cell-mode-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:8px;padding:12px}
.v11-cell-mode-list label{display:grid;gap:5px;font-size:12px;font-weight:800;color:#52647b}
.v11-header-grid .v11-grid-cell:hover,.v11-caption-grid .v11-grid-cell:hover{box-shadow:inset 0 0 0 2px rgba(23,105,223,.55)}
@media(max-width:780px){.v11-dimension-grid{grid-template-columns:1fr}.v11-stepper{grid-template-columns:1fr 44px 52px 44px}.v11-grid-summary{align-items:flex-start;flex-direction:column}}
@media print{.v11-placeholder{visibility:hidden}}

/* ===== brand-3001.css ===== */
:root{
  --brand-950:#061225;--brand-900:#0a1b34;--brand-800:#102b4f;--brand-700:#164d87;
  --brand-600:#1769df;--brand-500:#2785f5;--brand-100:#eaf3ff;--brand-50:#f5f9ff;
  --brand-ink:#13243a;--brand-muted:#63748a;--brand-line:rgba(70,98,137,.17);
}
#brandBootScreen{position:fixed;inset:0;z-index:20000;display:grid;place-items:center;background:linear-gradient(145deg,var(--brand-950),var(--brand-800));color:#fff;transition:opacity .22s,visibility .22s}
#brandBootScreen.done{opacity:0;visibility:hidden}.brand-boot-inner{display:grid;justify-items:center;gap:14px}.brand-boot-mark{width:72px;height:72px;display:grid;place-items:center;border-radius:22px;background:#fff;color:var(--brand-900);font-size:19px;font-weight:950;letter-spacing:-.06em}.brand-boot-inner strong{font-size:24px}.brand-boot-inner span{color:#b9cae0}
body[data-photo3001-ui="v10"] .topbar{gap:10px;background:linear-gradient(135deg,var(--brand-950),var(--brand-900) 58%,var(--brand-800));border-bottom-color:rgba(255,255,255,.12)}
.brand-block.brand-hierarchy{min-width:0;gap:10px}.master-brand-link{display:flex;align-items:center;gap:8px;color:#fff;text-decoration:none}.master-brand-symbol{width:39px;height:39px;display:grid;place-items:center;border-radius:12px;background:#fff;color:var(--brand-900);font-weight:950;font-size:12px;letter-spacing:-.06em;box-shadow:0 8px 22px rgba(0,0,0,.2)}.master-brand-name{font-size:14px;font-weight:900;letter-spacing:.05em}.brand-hierarchy-divider{width:1px;height:30px;background:rgba(255,255,255,.18)}.product-brand{display:grid;gap:1px}.product-brand strong{font-size:16px;letter-spacing:.09em}.product-brand span{margin:0!important;color:#aebed2!important;font-size:10.5px!important}.official-product-badge{display:inline-flex;align-items:center;gap:5px;padding:6px 9px;border:1px solid rgba(119,188,255,.24);border-radius:999px;background:rgba(39,133,245,.14);color:#cfe7ff;font-size:10px;font-weight:850;white-space:nowrap}.brand-product-button{min-height:38px;display:inline-flex;align-items:center;gap:7px;padding:0 12px;border:1px solid rgba(255,255,255,.16);border-radius:12px;background:rgba(255,255,255,.07);color:#f4f8fd;font-weight:800}.brand-product-button svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.8}
.brand-product-menu{position:fixed;z-index:10000;top:62px;right:12px;width:min(360px,calc(100vw - 20px));padding:10px;border:1px solid rgba(79,104,139,.18);border-radius:20px;background:rgba(255,255,255,.99);box-shadow:0 22px 70px rgba(5,17,35,.28);opacity:0;visibility:hidden;transform:translateY(-8px);transition:.18s}.brand-product-menu.open{opacity:1;visibility:visible;transform:none}.brand-product-menu-head{display:flex;align-items:center;justify-content:space-between;padding:6px 7px 10px}.brand-product-menu-head div{display:grid;gap:2px}.brand-product-menu-head strong{color:var(--brand-ink)}.brand-product-menu-head span{font-size:11px;color:var(--brand-muted)}.brand-product-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.brand-product-card{min-height:78px;display:grid;align-content:center;gap:3px;padding:11px;border:1px solid var(--brand-line);border-radius:15px;background:#fff;color:var(--brand-ink);text-decoration:none}.brand-product-card:hover{border-color:#8fbef7;background:var(--brand-50)}.brand-product-card.current{border-color:var(--brand-600);background:var(--brand-100)}.brand-product-card strong{font-size:13px}.brand-product-card small{font-size:11px;color:var(--brand-muted)}.brand-product-menu-foot{display:flex;gap:8px;margin-top:9px}.brand-product-menu-foot>*{flex:1;min-height:40px;display:grid;place-items:center;border:1px solid var(--brand-line);border-radius:12px;background:#f7f9fc;color:#344b67;text-decoration:none;font-weight:800;font-size:12px}
.brand-product-info::backdrop{background:rgba(2,10,22,.58);backdrop-filter:blur(4px)}.brand-product-info{width:min(560px,calc(100vw - 24px));border:0;border-radius:24px;padding:0;box-shadow:0 28px 90px rgba(0,0,0,.35)}.brand-info-card{overflow:hidden;background:#fff}.brand-info-hero{padding:24px;background:linear-gradient(135deg,var(--brand-950),var(--brand-800));color:#fff}.brand-info-hero span{color:#b9cce2;font-size:11px;font-weight:800;letter-spacing:.12em}.brand-info-hero h2{margin:6px 0 4px;font-size:28px}.brand-info-hero p{margin:0;color:#d6e2ef}.brand-info-body{padding:20px;display:grid;gap:14px}.brand-trust-list{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.brand-trust-list div{padding:12px;border:1px solid var(--brand-line);border-radius:14px;background:#f8fafc}.brand-trust-list strong{display:block;font-size:12px;color:var(--brand-ink)}.brand-trust-list span{font-size:10.5px;color:var(--brand-muted)}.brand-info-meta{font-size:12px;color:var(--brand-muted);line-height:1.7}.brand-info-actions{display:flex;gap:8px}.brand-info-actions>*{flex:1}.brand-panel-links{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:13px}.brand-panel-links a{text-decoration:none;display:flex;align-items:center;justify-content:center}
.product-attribution{margin-left:5px;color:#75849a;font-style:normal;font-size:.88em}.brand-layout-notice{position:sticky;top:105px;z-index:175;display:flex;align-items:center;justify-content:center;gap:8px;padding:7px 10px;border-bottom:1px solid #f0c97a;background:#fff5d9;color:#7a4c00;font-size:11px}.brand-layout-notice.hidden{display:none}.v11-grid-cell.has-text-overflow{box-shadow:inset 0 0 0 2px #f0a12b}.v11-grid-cell.has-text-overflow::after{content:'…';position:absolute;right:3px;bottom:1px;color:#a96400;font-weight:900}.v11-grid-cell{position:relative;overflow-wrap:anywhere;hyphens:auto}
@media(max-width:780px){body[data-photo3001-ui="v10"] .topbar{padding:6px 8px}.master-brand-name,.official-product-badge,.privacy-pill,.v8-autosave-pill{display:none!important}.brand-hierarchy-divider{height:26px}.product-brand strong{font-size:14px}.product-brand span{font-size:9px!important}.brand-product-button{width:40px;padding:0;justify-content:center;font-size:0}.brand-product-menu{top:56px;right:5px}.brand-trust-list{grid-template-columns:1fr}.brand-layout-notice{top:96px;align-items:flex-start}.brand-info-actions{flex-direction:column}}
@media print{#brandBootScreen,.brand-product-menu,.brand-layout-notice,.brand-product-info{display:none!important}}
