/* Photo 3001 V12.1 Simple Workspace
 * Extends the V12 shell without changing the recovered V11.1 document engine.
 * Visual rules derive from the 3001 Brand Core experience contract:
 * bright canvas, thin rules before cards, one product action color, exact family identity.
 */

body.v121 {
  --v121-header-h: 64px;
  --v121-dock-w: 72px;
  --v121-dock-h: 66px;
  --v121-panel-w: 360px;
  --v121-safe-bottom: env(safe-area-inset-bottom, 0px);
  --v121-canvas: var(--3001-canvas, #fff);
  --v121-ink: var(--3001-ink, #101116);
  --v121-ink-soft: var(--3001-ink-soft, #2d3038);
  --v121-muted: var(--3001-muted, #686f7c);
  --v121-line: var(--3001-line, #dfe3e9);
  --v121-line-strong: var(--3001-line-strong, #cbd1da);
  --v121-surface: var(--3001-surface, #f5f6f8);
  --v121-surface-blue: var(--3001-surface-blue, #f3f6ff);
  --v121-accent: var(--3001-photo-accent, #1768e5);
  --v121-action: var(--3001-photo-action, #0d50bd);
  --v121-success: var(--3001-success, #08776f);
  --v121-warning: var(--3001-warning, #b84d00);
  overflow: hidden;
  background: var(--v121-surface);
}

body.v121 .v12-workflow,
body.v121 .mobile-toolbar,
body.v121 .sidebar,
body.v121 .workflow-bar,
body.v121 .v7-quick-dock,
body.v121 .v7-drawer-backdrop,
body.v121 #v10PreviewStrip,
body.v121 #v10Dock,
body.v121 .brand-layout-notice {
  display: none !important;
}

body.v121 :focus-visible {
  outline: var(--3001-focus-width, 3px) solid var(--3001-focus-ring, #1c52ca) !important;
  outline-offset: var(--3001-focus-offset, 3px) !important;
}

/* Header: exact family identity, compact document controls, one primary action. */
body.v121 .topbar {
  height: var(--v121-header-h) !important;
  min-height: var(--v121-header-h) !important;
  grid-template-columns: minmax(168px, auto) minmax(180px, 520px) minmax(0, 1fr) auto !important;
  gap: 14px !important;
  padding: 0 18px !important;
  border-bottom: 1px solid var(--v121-line) !important;
  background: var(--v121-canvas) !important;
}

body.v121 .brand-block {
  min-width: 0 !important;
}

.v121-identity {
  min-width: 0;
  display: inline-grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  color: var(--v121-ink);
  text-decoration: none;
}

.v121-identity img {
  width: 38px;
  height: 38px;
  display: block;
}

.v121-identity > span {
  min-width: 0;
  display: grid;
  gap: 2px;
  line-height: 1;
}

.v121-identity strong {
  overflow: hidden;
  color: var(--v121-ink);
  font-size: 15px;
  font-weight: 750;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.v121-identity small {
  color: var(--v121-muted);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

body.v121 .v12-document-name {
  min-width: 0;
  display: block;
  padding-left: 16px;
  border-left: 1px solid var(--v121-line-strong);
}

body.v121 #documentTitle {
  height: 38px;
  min-height: 38px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: var(--3001-radius-sm, 7px);
  background: transparent;
  color: var(--v121-ink);
  font-size: 14px;
  font-weight: 650;
}

body.v121 #documentTitle:hover,
body.v121 #documentTitle:focus {
  border-color: var(--v121-line-strong);
  background: var(--v121-surface);
}

body.v121 .v12-status-cluster {
  justify-content: flex-end;
}

body.v121 .v121-save-state {
  min-height: auto !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: var(--v121-muted) !important;
  font-size: 11px !important;
  font-weight: 600 !important;
}

body.v121 .v121-save-state::before {
  content: "";
  width: 6px;
  height: 6px;
  display: inline-block;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--v121-success);
}

body.v121 .top-actions {
  gap: 4px !important;
}

body.v121 .top-actions #newProjectButton,
body.v121 .top-actions #openProjectButton,
body.v121 .top-actions #saveProjectButton,
body.v121 .top-actions #v7DiagnosticsButton {
  display: none !important;
}

body.v121 .top-actions .icon-button,
.v121-header-button,
body.v121 .v121-products-button {
  width: 38px;
  min-width: 38px;
  height: 38px;
  min-height: 38px;
  display: grid !important;
  place-items: center;
  padding: 0 !important;
  border: 1px solid transparent !important;
  border-radius: var(--3001-radius-sm, 7px) !important;
  background: transparent !important;
  color: var(--v121-ink-soft) !important;
  box-shadow: none !important;
}

body.v121 .top-actions .icon-button:hover,
.v121-header-button:hover,
body.v121 .v121-products-button:hover {
  border-color: var(--v121-line) !important;
  background: var(--v121-surface) !important;
}

.v121-header-button {
  cursor: pointer;
}

.v121-header-button svg,
body.v121 .top-actions .icon-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body.v121 .v121-products-button {
  width: auto;
  min-width: 42px;
  grid-auto-flow: column;
  gap: 7px;
  padding: 0 9px !important;
  border-color: var(--v121-line) !important;
}

body.v121 .v121-products-button img {
  width: 22px;
  height: 22px;
}

body.v121 .v121-products-button svg {
  display: none;
}

body.v121 .v121-products-button span {
  color: var(--v121-ink-soft);
  font-size: 12px;
  font-weight: 700;
}

body.v121 #openExportButton {
  min-width: 86px;
  height: 40px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 15px !important;
  border: 1px solid var(--v121-action) !important;
  border-radius: var(--3001-radius-sm, 7px) !important;
  background: var(--v121-action) !important;
  color: #fff !important;
  font-size: 13px;
  font-weight: 750;
  box-shadow: none !important;
}

body.v121 #openExportButton:hover {
  filter: brightness(0.96);
}

body.v121 #openExportButton svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Document menu */
.v121-more {
  position: relative;
}

.v121-more-menu {
  position: absolute;
  z-index: 1020;
  top: calc(100% + 8px);
  right: 0;
  width: 260px;
  padding: 8px;
  border: 1px solid var(--v121-line-strong);
  border-radius: var(--3001-radius-md, 8px);
  background: var(--v121-canvas);
  box-shadow: var(--3001-shadow-quiet, 0 8px 30px rgba(25, 35, 52, 0.08));
}

.v121-more-menu[aria-hidden="true"] {
  display: none;
}

.v121-menu-section {
  display: grid;
}

.v121-menu-section > strong {
  padding: 8px 10px 5px;
  color: var(--v121-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.v121-menu-section button {
  min-height: 40px;
  padding: 8px 10px;
  border: 0;
  border-bottom: 1px solid var(--v121-line);
  background: transparent;
  color: var(--v121-ink-soft);
  font-size: 13px;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
}

.v121-menu-section button:hover {
  background: var(--v121-surface);
}

.v121-menu-note {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 8px;
  margin-top: 8px;
  padding: 10px;
  background: var(--v121-surface-blue);
  color: var(--v121-muted);
  font-size: 10.5px;
  line-height: 1.45;
}

.v121-menu-note svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--v121-success);
  stroke-width: 1.7;
}

/* Product family navigation: list and rules, not card wall. */
body.v121 .brand-product-menu {
  top: calc(var(--v121-header-h) - 1px) !important;
  right: 14px !important;
  width: 360px !important;
  max-height: calc(100dvh - var(--v121-header-h) - 14px);
  padding: 0 !important;
  overflow: auto;
  border: 1px solid var(--v121-line-strong) !important;
  border-radius: var(--3001-radius-md, 8px) !important;
  background: var(--v121-canvas) !important;
  box-shadow: var(--3001-shadow-quiet, 0 8px 30px rgba(25, 35, 52, 0.08)) !important;
}

body.v121 .brand-product-menu-head {
  min-height: 62px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--v121-line);
}

body.v121 .brand-product-menu-head strong {
  font-size: 14px;
  font-weight: 750;
}

body.v121 .brand-product-menu-head span {
  font-size: 10.5px;
}

.v121-product-list {
  display: grid;
  padding: 0 12px;
}

.v121-product-list a {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 4px;
  border-bottom: 1px solid var(--v121-line);
  color: var(--v121-ink-soft);
  text-decoration: none;
}

.v121-product-list a:last-child {
  border-bottom: 0;
}

.v121-product-list a:hover {
  color: var(--v121-action);
}

.v121-product-list a[aria-current="page"] {
  box-shadow: inset 3px 0 0 var(--v121-accent);
  color: var(--v121-action);
}

.v121-product-list a > span {
  min-width: 0;
  display: grid;
  gap: 2px;
  padding-left: 8px;
}

.v121-product-list strong {
  font-size: 13px;
  font-weight: 750;
}

.v121-product-list small {
  color: var(--v121-muted);
  font-size: 10.5px;
}

.v121-product-list b {
  color: var(--v121-muted);
  font-size: 12px;
}

body.v121 .brand-product-menu-foot {
  min-height: 48px;
  padding: 9px 14px;
  border-top: 1px solid var(--v121-line) !important;
  background: var(--v121-surface) !important;
  color: var(--v121-muted);
  font-size: 10px;
}

body.v121 .brand-product-menu-foot button {
  border: 0;
  background: transparent;
  color: var(--v121-action);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

/* Wide workbench */
body.v121 .app-shell {
  position: relative;
  width: 100% !important;
  max-width: none !important;
  height: calc(100dvh - var(--v121-header-h)) !important;
  min-height: 0 !important;
  display: grid !important;
  grid-template-columns: var(--v121-dock-w) minmax(0, 1fr) !important;
  margin: 0 !important;
  overflow: hidden !important;
  background: var(--v121-surface) !important;
}

.v121-dock {
  position: relative;
  z-index: 45;
  grid-column: 1;
  min-width: 0;
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 2px;
  padding: 10px 7px;
  border-right: 1px solid var(--v121-line);
  background: var(--v121-canvas);
}

.v121-dock button {
  position: relative;
  min-width: 0;
  height: 60px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  padding: 5px 2px;
  border: 0;
  border-radius: var(--3001-radius-sm, 7px);
  background: transparent;
  color: var(--v121-muted);
  font-size: 9.5px;
  font-weight: 700;
  cursor: pointer;
}

.v121-dock button:hover,
.v121-dock button.active {
  background: var(--v121-surface-blue);
  color: var(--v121-action);
}

.v121-dock button.primary {
  background: var(--v121-action);
  color: #fff;
}

.v121-dock button.primary:hover {
  background: var(--v121-action);
  filter: brightness(0.96);
}

.v121-dock svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.v121-dock b {
  position: absolute;
  top: 6px;
  right: 7px;
  min-width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  padding: 0 4px;
  border-radius: var(--3001-radius-status, 999px);
  background: var(--v121-ink);
  color: #fff;
  font-size: 8px;
  font-weight: 800;
}

body.v121 .workspace {
  position: relative;
  z-index: 1;
  grid-column: 2;
  width: 100% !important;
  min-width: 0 !important;
  height: 100% !important;
  display: grid !important;
  grid-template-rows: 48px minmax(0, 1fr) auto !important;
  background: var(--v121-surface) !important;
}

body.v121 .workspace-head {
  min-height: 48px !important;
  padding: 0 14px !important;
  border-bottom: 1px solid var(--v121-line) !important;
  background: var(--v121-canvas) !important;
}

body.v121 .workspace-head > div:first-child strong {
  font-size: 13px;
  font-weight: 750;
}

body.v121 .workspace-head > div:first-child span {
  color: var(--v121-muted);
  font-size: 10px;
}

.v121-format-button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--v121-line);
  border-radius: var(--3001-radius-sm, 7px);
  background: var(--v121-canvas);
  color: var(--v121-ink-soft);
  font-size: 10.5px;
  font-weight: 650;
  cursor: pointer;
}

.v121-format-button:hover {
  border-color: var(--v121-accent);
  color: var(--v121-action);
}

body.v121 .workspace-scroll {
  position: relative;
  min-width: 0;
  min-height: 0;
  padding: 22px 18px 104px !important;
  overflow: auto !important;
  overscroll-behavior: contain;
  background: var(--v121-surface) !important;
}

body.v121 .pages-stage {
  min-width: 0;
  min-height: 100%;
  justify-content: center !important;
  padding: 0 0 28px !important;
}

body.v121 .document-page {
  box-shadow: 0 12px 36px rgba(25, 35, 52, 0.1) !important;
}

/* Empty state: one decision, no setup wall. */
body.v121 .v12-empty-guide {
  position: absolute;
  z-index: 4;
  top: 50%;
  left: 50%;
  width: min(420px, calc(100% - 32px));
  margin: 0;
  padding: 24px;
  border: 1px solid var(--v121-line-strong);
  border-left: 0;
  border-radius: var(--3001-radius-md, 8px);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--3001-shadow-quiet, 0 8px 30px rgba(25, 35, 52, 0.08));
  transform: translate(-50%, -50%);
}

body.v121 .v12-empty-guide.show {
  display: grid;
  gap: 10px;
}

.v121-eyebrow {
  color: var(--v121-accent);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.08em;
}

body.v121 .v12-empty-guide strong {
  max-width: 360px;
  color: var(--v121-ink);
  font-size: 21px;
  font-weight: 750;
  line-height: 1.28;
  letter-spacing: -0.025em;
}

body.v121 .v12-empty-guide p {
  margin: 0;
  color: var(--v121-muted);
  font-size: 12px;
  line-height: 1.5;
}

.v121-empty-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-top: 6px;
}

.v121-empty-actions .v12-action-button.primary {
  min-height: 42px;
  padding: 0 16px;
  border-radius: var(--3001-radius-sm, 7px);
  background: var(--v121-action);
}

.v121-text-action {
  min-height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--v121-action);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

/* Photo strip remains useful on desktop; mobile uses the full-screen canvas. */
body.v121 .v12-filmstrip {
  min-height: 82px;
  border-top: 1px solid var(--v121-line);
  background: var(--v121-canvas);
}

body.v121 .v12-filmstrip-action {
  width: 78px;
  background: var(--v121-canvas);
}

body.v121 .v12-film-thumb {
  flex-basis: 70px;
  height: 60px;
  border-radius: var(--3001-radius-sm, 7px);
}

/* Overlay control panel: no permanent loss of canvas width. */
body.v121 .v12-control-column {
  position: absolute;
  z-index: 80;
  top: 0;
  bottom: 0;
  left: var(--v121-dock-w);
  width: min(var(--v121-panel-w), calc(100% - var(--v121-dock-w)));
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  border-right: 1px solid var(--v121-line-strong);
  background: var(--v121-canvas);
  box-shadow: 16px 0 40px rgba(25, 35, 52, 0.1);
  transform: translateX(calc(-100% - 16px));
  transition: transform var(--3001-motion-fast, 160ms) ease;
}

body.v121.v12-panel-open .v12-control-column,
body.v121.v10-photo-open .v12-control-column {
  transform: translateX(0);
}

.v121-panel-backdrop {
  position: absolute;
  z-index: 70;
  inset: 0 0 0 var(--v121-dock-w);
  display: block;
  border: 0;
  background: rgba(16, 17, 22, 0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--3001-motion-fast, 160ms) ease;
}

body.v121.v12-panel-open .v121-panel-backdrop,
body.v121.v10-photo-open .v121-panel-backdrop {
  opacity: 1;
  pointer-events: auto;
}

.v121-sheet-handle {
  display: none;
}

body.v121 .v12-control-head {
  min-height: 62px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--v121-line);
}

body.v121 .v12-control-head strong {
  font-size: 14px;
  font-weight: 750;
}

body.v121 .v12-control-head span {
  font-size: 10.5px;
}

body.v121 .v12-panel-close {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--v121-line);
  border-radius: var(--3001-radius-sm, 7px);
  background: var(--v121-canvas);
  color: var(--v121-ink-soft);
}

body.v121 .v12-panel-close svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

body.v121 .v12-document-subnav {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--v121-line);
}

body.v121 .v12-document-subnav .v121-title-tab {
  display: none;
}

body.v121 .v12-document-subnav button {
  min-height: 44px;
  border-right: 1px solid var(--v121-line);
  background: var(--v121-canvas);
  color: var(--v121-muted);
  font-size: 10px;
  font-weight: 700;
}

body.v121 .v12-document-subnav button.active {
  box-shadow: inset 0 -2px 0 var(--v121-accent);
  color: var(--v121-action);
}

body.v121 #v10Sheet,
body.v121 #v10PhotoSheet {
  position: static !important;
  width: 100% !important;
  max-width: none !important;
  height: 100% !important;
  min-height: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  transform: none !important;
}

body.v121 #v10Sheet > .v10-sheet-head,
body.v121 #v10PhotoSheet > .v10-sheet-head {
  display: none !important;
}

body.v121 #v10SheetBody,
body.v121 #v10PhotoSheet .v10-sheet-body {
  min-height: 0;
  padding: 14px !important;
  overflow-y: auto !important;
}

body.v121 .v12-product-footer {
  min-height: 56px;
  align-content: center;
  gap: 2px;
  padding: 10px 14px;
  border-top: 1px solid var(--v121-line);
  background: var(--v121-canvas);
  color: var(--v121-muted);
  font-size: 9.5px;
}

body.v121 .v12-product-footer a {
  color: var(--v121-action);
  font-weight: 650;
}

/* Essential-first form panel. */
body.v121 .v121-layout-panel .v10-quick-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

body.v121 .v121-layout-panel .v10-field > span {
  font-size: 9.5px;
  font-weight: 700;
}

body.v121 .v121-layout-panel .control {
  min-height: 40px;
  border-radius: var(--3001-radius-sm, 7px);
}

body.v121 .v121-layout-panel .v10-card-grid.layouts {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

body.v121 .v121-layout-panel .v10-card {
  min-height: 100px;
  padding: 10px;
  border-radius: var(--3001-radius-sm, 7px);
  box-shadow: none;
}

body.v121 .v121-layout-panel .v121-extra-layout {
  display: none;
}

body.v121 .v121-layout-panel.v121-show-all-layouts .v121-extra-layout {
  display: grid;
}

.v121-layout-toggle {
  width: 100%;
  min-height: 38px;
  margin-top: 8px;
  border: 1px solid var(--v121-line);
  border-radius: var(--3001-radius-sm, 7px);
  background: var(--v121-canvas);
  color: var(--v121-action);
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
}

body.v121 .v10-layout-status {
  margin-top: 10px;
  border-radius: var(--3001-radius-sm, 7px);
}

/* Photo panel: primary add/camera, advanced imports folded. */
body.v121 .v12-panel-stack {
  gap: 14px;
}

body.v121 .v12-panel-section {
  gap: 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--v121-line);
}

body.v121 .v12-panel-section:last-child {
  border-bottom: 0;
}

body.v121 .v12-panel-section > header {
  display: grid;
  gap: 2px;
}

body.v121 .v12-panel-section > header strong {
  font-size: 12.5px;
  font-weight: 750;
}

body.v121 .v12-panel-section > header span {
  color: var(--v121-muted);
  font-size: 10.5px;
}

body.v121 .v12-button-row {
  gap: 7px;
}

body.v121 .v12-action-button {
  min-height: 40px;
  border-radius: var(--3001-radius-sm, 7px);
  box-shadow: none;
}

body.v121 .v12-action-button.primary {
  background: var(--v121-action);
}

.v121-more-imports {
  border-top: 1px solid var(--v121-line);
  padding-top: 8px;
}

.v121-more-imports summary {
  cursor: pointer;
  color: var(--v121-action);
  font-size: 10.5px;
  font-weight: 700;
  list-style: none;
}

.v121-more-imports summary::-webkit-details-marker {
  display: none;
}

.v121-more-imports[open] summary {
  margin-bottom: 8px;
}

body.v121 .v12-photo-library {
  border-top: 1px solid var(--v121-line);
}

body.v121 .v12-photo-row {
  min-height: 62px;
  border-bottom: 1px solid var(--v121-line);
  border-radius: 0;
}

body.v121 .v12-photo-row.selected {
  background: var(--v121-surface-blue);
  box-shadow: inset 3px 0 0 var(--v121-accent);
}

/* Export: PDF first, review automatic, secondary formats collapsed. */
body.v121 dialog.modal::backdrop,
body.v121 dialog.brand-product-info::backdrop {
  background: rgba(16, 17, 22, 0.36);
  backdrop-filter: blur(2px);
}

body.v121 .export-modal .modal-card {
  width: min(760px, calc(100vw - 32px));
  max-height: min(760px, calc(100dvh - 32px));
  border: 1px solid var(--v121-line-strong);
  border-radius: var(--3001-radius-md, 8px) !important;
  box-shadow: 0 28px 80px rgba(24, 37, 61, 0.14);
}

body.v121 .export-modal .modal-header {
  min-height: 64px;
  border-bottom: 1px solid var(--v121-line);
}

body.v121 .v12-export-review {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--v121-line);
  border-radius: var(--3001-radius-sm, 7px);
  box-shadow: none;
}

body.v121 .export-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

body.v121 .v12-export-group {
  border: 1px solid var(--v121-line);
  border-radius: var(--3001-radius-sm, 7px);
  box-shadow: none;
}

body.v121 .v121-primary-output {
  grid-column: 1 / -1;
}

body.v121 .v121-primary-output .v12-export-options {
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
}

body.v121 .v121-primary-output [data-export="pdf"] {
  border-color: var(--v121-action);
  background: var(--v121-surface-blue);
}

.v121-other-outputs {
  grid-column: 1 / -1;
  border-top: 1px solid var(--v121-line);
}

.v121-other-outputs > summary {
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  color: var(--v121-action);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.v121-other-outputs > summary::-webkit-details-marker {
  display: none;
}

.v121-other-output-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding-top: 12px;
}

body.v121 .v12-pdf-continuation {
  border-radius: var(--3001-radius-sm, 7px);
  box-shadow: none;
}

/* Tablet */
@media (max-width: 1080px) {
  body.v121 {
    --v121-panel-w: 330px;
  }

  body.v121 .topbar {
    grid-template-columns: minmax(146px, auto) minmax(150px, 1fr) auto !important;
    gap: 8px !important;
  }

  body.v121 .v12-status-cluster {
    display: none !important;
  }

  body.v121 .top-actions #undoButton,
  body.v121 .top-actions #redoButton {
    display: none !important;
  }
}

/* Mobile: canvas owns the viewport; controls are a bottom sheet. */
@media (max-width: 760px) {
  body.v121 {
    --v121-header-h: 58px;
    --v121-dock-h: 64px;
    --v121-dock-w: 0px;
  }

  body.v121 .topbar {
    position: relative !important;
    height: var(--v121-header-h) !important;
    min-height: var(--v121-header-h) !important;
    grid-template-columns: auto minmax(0, 1fr) auto !important;
    gap: 6px !important;
    padding: 0 8px !important;
  }

  body.v121 .brand-block {
    max-width: 112px;
  }

  .v121-identity {
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 7px;
  }

  .v121-identity img {
    width: 32px;
    height: 32px;
  }

  .v121-identity strong {
    font-size: 11.5px;
  }

  .v121-identity small {
    font-size: 6.8px;
  }

  body.v121 .v12-document-name {
    padding-left: 0;
    border-left: 0;
  }

  body.v121 #documentTitle {
    height: 36px;
    min-height: 36px;
    padding: 0 8px;
    border-color: var(--v121-line);
    background: var(--v121-canvas);
    font-size: 11px;
  }

  body.v121 .top-actions {
    gap: 2px !important;
  }

  body.v121 .top-actions #undoButton,
  body.v121 .top-actions #redoButton,
  body.v121 .v12-status-cluster {
    display: none !important;
  }

  body.v121 .v121-products-button {
    width: 36px;
    min-width: 36px;
    height: 36px;
    min-height: 36px;
    padding: 0 !important;
  }

  body.v121 .v121-products-button img {
    width: 21px;
    height: 21px;
  }

  body.v121 .v121-products-button span {
    display: none;
  }

  .v121-header-button {
    width: 36px;
    min-width: 36px;
    height: 36px;
    min-height: 36px;
  }

  body.v121 #openExportButton {
    width: 36px;
    min-width: 36px;
    height: 36px;
    min-height: 36px;
    padding: 0 !important;
  }

  body.v121 #openExportButton span {
    display: none;
  }

  .v121-more-menu {
    position: fixed;
    top: calc(var(--v121-header-h) - 2px);
    right: 8px;
    width: min(280px, calc(100vw - 16px));
  }

  body.v121 .brand-product-menu {
    position: fixed !important;
    top: var(--v121-header-h) !important;
    right: 8px !important;
    left: 8px !important;
    width: auto !important;
    max-height: calc(100dvh - var(--v121-header-h) - 12px);
  }

  body.v121 .app-shell {
    height: calc(100dvh - var(--v121-header-h) - var(--v121-dock-h) - var(--v121-safe-bottom)) !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .v121-dock {
    position: fixed;
    z-index: 920;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: calc(var(--v121-dock-h) + var(--v121-safe-bottom));
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-content: stretch;
    gap: 0;
    padding: 0 0 var(--v121-safe-bottom);
    border-top: 1px solid var(--v121-line);
    border-right: 0;
    background: var(--v121-canvas);
    box-shadow: 0 -8px 24px rgba(25, 35, 52, 0.06);
  }

  .v121-dock button {
    width: 100%;
    height: var(--v121-dock-h);
    min-height: 0;
    gap: 2px;
    padding: 5px 2px;
    border-right: 1px solid var(--v121-line);
    border-radius: 0;
    font-size: 9px;
  }

  .v121-dock button:last-child {
    border-right: 0;
  }

  .v121-dock button.primary {
    background: transparent;
    color: var(--v121-action);
  }

  .v121-dock button.active {
    box-shadow: inset 0 3px 0 var(--v121-accent);
    background: var(--v121-surface-blue);
  }

  .v121-dock svg {
    width: 20px;
    height: 20px;
  }

  .v121-dock b {
    top: 5px;
    right: calc(50% - 23px);
  }

  body.v121 .workspace {
    grid-column: 1;
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100% !important;
    grid-template-rows: minmax(0, 1fr) !important;
  }

  body.v121 .workspace-head {
    display: none !important;
  }

  body.v121 .workspace-scroll {
    grid-row: 1;
    width: 100%;
    max-width: 100vw;
    padding: 8px 0 24px !important;
    overflow-x: auto !important;
    overflow-y: auto !important;
  }

  body.v121 .pages-stage {
    width: max-content;
    min-width: 100%;
    padding: 0 4px 20px !important;
  }

  body.v121 .document-page {
    box-shadow: 0 8px 24px rgba(25, 35, 52, 0.08) !important;
  }

  body.v121 .v12-filmstrip {
    display: none !important;
  }

  body.v121 .v12-empty-guide {
    position: absolute;
    top: 50%;
    left: 50%;
    width: calc(100% - 24px);
    padding: 20px 18px;
    transform: translate(-50%, -50%);
  }

  body.v121 .v12-empty-guide strong {
    font-size: 18px;
  }

  .v121-empty-actions {
    gap: 7px 10px;
  }

  .v121-empty-actions .v12-action-button.primary {
    flex: 1 0 100%;
  }

  body.v121 .v12-control-column {
    position: fixed;
    z-index: 900;
    top: auto;
    right: 0;
    bottom: calc(var(--v121-dock-h) + var(--v121-safe-bottom));
    left: 0;
    width: 100%;
    height: min(66dvh, 620px);
    max-height: calc(100dvh - var(--v121-header-h) - var(--v121-dock-h) - var(--v121-safe-bottom) + 1px);
    grid-template-rows: 18px auto auto minmax(0, 1fr) auto;
    border: 1px solid var(--v121-line-strong);
    border-bottom: 0;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -20px 56px rgba(24, 37, 61, 0.16);
    transform: translateY(calc(100% + 24px));
    transition: transform var(--3001-motion-fast, 160ms) ease;
  }

  body.v121.v12-panel-open .v12-control-column,
  body.v121.v10-photo-open .v12-control-column {
    transform: translateY(0);
  }

  .v121-sheet-handle {
    grid-row: 1;
    width: 42px;
    height: 4px;
    display: block;
    align-self: center;
    justify-self: center;
    border-radius: 999px;
    background: var(--v121-line-strong);
  }

  body.v121 .v12-control-head {
    grid-row: 2;
    min-height: 54px;
    padding: 8px 14px;
  }

  body.v121 .v12-document-subnav {
    grid-row: 3;
  }

  body.v121 .v12-panel-region {
    grid-row: 4;
    min-height: 0;
  }

  body.v121 .v12-product-footer {
    display: none;
  }

  .v121-panel-backdrop {
    position: fixed;
    z-index: 890;
    inset: var(--v121-header-h) 0 calc(var(--v121-dock-h) + var(--v121-safe-bottom)) 0;
    background: rgba(16, 17, 22, 0.24);
  }

  body.v121 #v10SheetBody,
  body.v121 #v10PhotoSheet .v10-sheet-body {
    padding: 12px 14px 18px !important;
  }

  body.v121 .v121-layout-panel .v10-card-grid.layouts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.v121 .v12-photo-row {
    min-height: 66px;
  }

  body.v121 .export-modal {
    width: 100%;
    max-width: none;
    margin: auto 0 0;
    padding: 0;
  }

  body.v121 .export-modal .modal-card {
    width: 100%;
    max-width: none;
    max-height: 90dvh;
    margin: 0;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 16px 16px 0 0 !important;
  }

  body.v121 .export-modal .modal-body {
    padding: 14px !important;
  }

  body.v121 .v12-export-review {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.v121 .export-grid,
  .v121-other-output-body {
    grid-template-columns: 1fr;
  }

  body.v121 .v121-primary-output .v12-export-options {
    grid-template-columns: 1fr;
  }

  body.v121 .v12-pdf-continuation {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 420px) {
  body.v121 .brand-block {
    max-width: 98px;
  }

  .v121-identity {
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 6px;
  }

  .v121-identity img {
    width: 30px;
    height: 30px;
  }

  .v121-identity strong {
    font-size: 10.5px;
  }

  body.v121 .v121-products-button,
  .v121-header-button,
  body.v121 #openExportButton {
    width: 34px;
    min-width: 34px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.v121 .v12-control-column,
  body.v121 .v121-panel-backdrop,
  .v121-more-menu {
    transition: none !important;
  }
}

@media print {
  body.v121 .v121-dock,
  body.v121 .v121-panel-backdrop,
  body.v121 .v121-more,
  body.v121 .brand-product-menu {
    display: none !important;
  }
}

/* Late corrections: keep hidden desktop drawer fully outside the rail and normalize save copy. */
body.v121 .v121-save-state {
  font-size: 0 !important;
}
body.v121 .v121-save-state::after {
  content: "자동 저장";
  font-size: 11px;
}
body.v121 .v121-save-state[data-state="saved"]::after,
body.v121 .v121-save-state.saved::after {
  content: "저장됨";
}
@media (min-width: 761px) {
  body.v121 .v12-control-column {
    transform: translateX(calc(-100% - var(--v121-dock-w) - 20px));
  }
}

/* Final simplification pass. */
body.v121 .pages-stage {
  align-items: center !important;
}
body.v121 .v121-layout-panel > .v10-action-row {
  display: none !important;
}
.v121-more-import-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
@media (min-width: 761px) {
  .v121-dock [data-v121-command="output"] {
    display: none;
  }
}
@media (max-width: 760px) {
  body.v121 #openExportButton {
    display: none !important;
  }
}
