/* Shared screen styling only: print sheets keep each studio's original sizing. */
@media screen {
  :root {
    color-scheme: light;
    --page: #f6f7f0;
    --panel: #fff;
    --panel-raised: #eef3eb;
    --text: #173f39;
    --ink: #173f39;
    --muted: #637970;
    --line: #dce5dc;
    --blue: #245e4d;
    --blue-hover: #194b3d;
    --blue-dark: #194b3d;
    --pale-blue: #e9f2e5;
    --green: #245e4d;
    --danger: #a63737;
    --red: #a63737;
    --shadow: 0 4px 18px rgb(31 64 49 / 5%);
  }
  body, .app-shell { color: var(--ink); background: var(--page); }
  body { font-family: 'DM Sans', 'Segoe UI', sans-serif; }
  .topbar { background: #fff; border-color: var(--line); box-shadow: none; }
  .brand, .brand-copy strong, .card-heading h2, .panel-heading h2,
  .pdf-file-name, .file-name, .file-details strong, .stats strong { color: var(--ink); }
  .brand-mark, .brand-mark-image { background: transparent; box-shadow: none; }
  .brand small, .brand-copy small, .back-link, .field, .pdf-field,
  .intro-copy, .pdf-intro p, .hint, .stats, .file-count, .pdf-count,
  .pdf-file-size, .pdf-preview-status, .pdf-mode-note, .pdf-status,
  .pdf-privacy, .validation-message, .export-hint, .file-details small { color: var(--muted); }
  .eyebrow, .pdf-intro .eyebrow, .drop-icon, .pdf-drop-icon { color: var(--blue); }
  .card, .panel, .pdf-panel, .preview-card { background: #fff; border-color: var(--line); box-shadow: var(--shadow); border-radius: 12px; }
  .menu-toggle, .app-menu { background: #fff; border-color: var(--line); color: var(--ink); }
  .menu-toggle span { background: var(--ink); }
  .menu-link { color: var(--ink); border-color: var(--line); }
  .menu-link:hover, .menu-link[aria-current='page'] { background: #edf3e9; color: var(--ink); }
  .upload-zone, .dropzone, .pdf-dropzone { background: #f2f6ed; border-color: #a9c3ad; color: var(--ink); border-radius: 10px; }
  .upload-zone:hover, .dropzone:hover, .pdf-dropzone:hover { background: #e8f1e1; border-color: var(--blue); }
  .upload-zone > span:last-child, .dropzone span:last-child, .pdf-dropzone span { color: var(--muted); }
  .photo-meta, .file-card, .pdf-file { background: #f8faf5; border-color: var(--line); }
  .field > input, .field > select, .field input, .field select,
  .input-with-unit, .number-control, .input-with-unit input,
  .target-row input, .target-row select, .pdf-field select { color: var(--ink); background: #fff; border-color: #c8d6ca; }
  button { accent-color: var(--blue); }
  .primary-button { background: var(--blue); color: #fff; border-color: var(--blue); }
  .primary-button:hover:not(:disabled) { background: var(--blue-hover); }
  .secondary-button, .quiet-button, .icon-button, .lock-button,
  .alignment-button, .mobile-add-photos, .pdf-orientation button,
  .pdf-file-actions button, .pdf-clear-button, .download-button {
    background: #eef3e9; color: var(--ink); border-color: #cbdacb;
  }
  .secondary-button:hover:not(:disabled), .quiet-button:hover:not(:disabled),
  .icon-button:hover:not(:disabled) { background: #e1edd9; border-color: #a9c3ad; }
  .pdf-orientation button[aria-pressed='true'], .lock-button[aria-pressed='true'],
  .mobile-studio-nav button[aria-pressed='true'] { color: #fff; background: var(--blue); border-color: var(--blue); }
  .mobile-studio-nav { background: #fff; border-color: var(--line); }
  .mobile-studio-nav button { color: var(--muted); border-radius: 8px; }
  .privacy-pill { color: var(--blue); background: #edf4e6; border-color: #c8ddbf; }
  .preview-stage { background-color: #e8ede5; border-color: var(--line); }
  .remove-button, .pdf-file-actions .pdf-remove { color: #a63737; background: #fff1ef; border-color: #ebcdca; }
  .pdf-status.is-error { color: #a63737; }
  .pdf-status.is-success { color: #245e4d; }
  .pdf-progress { accent-color: var(--blue); }
  .setting-label, .quality-output, .format-hint, .privacy-note,
  .offline-note, .progress-line, .global-status, .file-status,
  .empty-preview small, .alignment-tools, .placement-tools,
  .border-setting, .print-note { color: var(--muted); }
  body:not(.dashboard-page) .menu-toggle,
  body:not(.dashboard-page) .app-menu,
  body:not(.dashboard-page) .mobile-studio-nav { background: #fff; color: var(--ink); border-color: var(--line); }
  body:not(.dashboard-page) .menu-toggle span { background: var(--ink); }
  body:not(.dashboard-page) .mobile-studio-nav button { color: var(--muted); }
  body:not(.dashboard-page) .mobile-studio-nav button[aria-pressed='true'] { background: var(--blue); color: #fff; }
  body:not(.dashboard-page) .mobile-add-photos { background: #e9f2e5; color: var(--ink); border-color: #c8d6ca; }
  .summary-grid > div { background: #f2f6ed; color: var(--ink); border-color: var(--line); }
  .summary-grid strong, .summary-grid span, .empty-preview,
  .empty-preview p, .empty-preview strong { color: var(--muted); }
  .button.button-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
  .button.button-secondary { background: #edf3e7; border-color: #cadac6; color: var(--ink); }
  .button:disabled, .primary-button:disabled { opacity: .45; }
  body[data-mobile-view='settings'] .settings-panel,
  body[data-mobile-view='settings'] .settings-card { background: #fffffff5; border-color: #b5cdb5; }
}

@media screen and (max-width: 720px) {
  .topbar { padding-inline: 10px; }
  .brand { gap: 7px; font-size: 12px; }
  .brand small, .brand-copy small { font-size: 10px; }
  .brand-mark, .brand-mark-image { width: 40px; flex-basis: 40px; }
  .brand > img { width: 40px; height: 32px; }
  .header-actions { gap: 8px; }
  .back-link { font-size: 11px; }
  .pdf-page, body:has(.files-panel) > main { width: calc(100% - 20px); padding: 16px 0 24px; }
  .intro, .pdf-intro { margin-bottom: 12px; gap: 10px; }
  .intro { flex-wrap: wrap; }
  .intro h1, .pdf-intro h1 { font-size: 25px; margin-bottom: 6px; }
  .intro-copy, .pdf-intro p { font-size: 12px; line-height: 1.5; }
  .privacy-pill { padding: 5px 9px; }
  .layout, .pdf-workspace { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .layout > .settings-panel { order: initial; }
  .files-panel, .pdf-panel { padding: 12px; }
  .dropzone, .pdf-dropzone { min-height: 108px; padding: 12px; gap: 5px; }
  .panel-heading, .pdf-panel-heading { margin-bottom: 10px; }
  .field input, .field select, .target-row input, .target-row select,
  .pdf-field select { font-size: 16px; min-height: 36px; }
  .settings-grid, .pdf-options { gap: 9px; }
  .file-card { padding: 9px; gap: 9px; }
  .pdf-actions { margin-top: 12px; gap: 7px; }
  .wrap { padding-inline: 12px; }
  .bar { padding: 12px; gap: 8px; }
  .bar .brand { font-size: 13px; }
  .home-grid { gap: 20px; padding-block: 24px; }
  .home-grid h1 { font-size: clamp(32px, 9vw, 44px); }
  .tool { padding: 16px; }
  .section-heading { margin-bottom: 14px; }
  dialog { max-width: calc(100vw - 20px); padding: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0s !important; }
}

.local-printer-dialog {
  --print-ink: #162e28;
  --print-accent: #0f513e;
  --print-line: #d8e0da;
  width: min(1060px, calc(100vw - 40px));
  max-height: calc(100dvh - 40px);
  box-sizing: border-box;
  padding: 0;
  border: 1px solid var(--print-line);
  border-radius: 24px;
  background: #f9faf7;
  color: var(--print-ink);
  box-shadow: 0 28px 88px rgb(12 27 22 / 32%);
}
.local-printer-dialog::backdrop {
  background: rgb(14 30 24 / 62%);
  backdrop-filter: blur(4px);
}
.local-printer-dialog [hidden] { display: none !important; }
.local-printer-dialog .local-printer-header {
  padding: 23px 28px 21px;
  border-bottom: 1px solid var(--print-line);
  background: #fff;
}
.local-printer-dialog .local-printer-header h2 {
  margin: 0;
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 740;
  letter-spacing: -.035em;
  line-height: 1.1;
}
.local-printer-dialog .local-printer-header p {
  margin: 7px 0 0;
  color: #52675e;
  font-size: 14px;
  overflow-wrap: anywhere;
}
.local-printer-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(235px, 290px);
  gap: 20px;
  padding: 20px;
}
.local-printer-preview {
  min-width: 0;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 14px;
  padding: 20px;
  border: 1px solid #dbe3dd;
  border-radius: 16px;
  background: radial-gradient(ellipse at top, #eef3ed, #dce5de);
}
.local-printer-paper { display: grid; min-height: 130px; place-items: center; }
.local-printer-paper img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(54dvh, 650px);
  object-fit: contain;
  background: white;
  box-shadow: 0 12px 28px rgb(25 48 38 / 16%), 0 0 0 1px rgb(25 48 38 / 7%);
}
.local-printer-preview nav {
  display: flex;
  min-height: 36px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 13px;
  font-weight: 650;
}
.local-printer-settings {
  align-content: start;
  display: grid;
  gap: 16px;
  padding: 19px;
  border: 1px solid var(--print-line);
  border-radius: 16px;
  background: #fff;
}
.local-printer-dialog .local-printer-settings label {
  display: grid;
  gap: 8px;
  margin: 0;
  font-size: 13px;
  font-weight: 700;
}
.local-printer-dialog .local-printer-settings select {
  width: 100%;
  min-height: 44px;
  padding: 0 11px;
  border: 1px solid #c7d4cb;
  border-radius: 9px;
  background: #f7faf7;
  color: var(--print-ink);
  font: inherit;
}
.local-printer-spec {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 0;
  padding: 13px 0;
  border-block: 1px solid #e6ebe7;
  font-size: 13px;
}
.local-printer-spec dt { color: #52675e; }
.local-printer-spec dd { margin: 0; font-weight: 700; text-align: right; }
.local-printer-dialog .local-printer-settings [role="status"] {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
}
.local-printer-actions { display: grid; gap: 8px; }
.local-printer-dialog button {
  box-sizing: border-box;
  min-height: 36px;
  margin: 0;
  padding: 7px 12px;
  border: 1px solid #c9d6cd;
  border-radius: 9px;
  background: #fff;
  color: var(--print-ink);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}
.local-printer-dialog button:hover:enabled { background: #edf3ee; }
.local-printer-dialog .local-printer-primary {
  min-height: 46px;
  border-color: var(--print-accent);
  background: var(--print-accent);
  color: #fff;
  font-size: 15px;
  box-shadow: 0 4px 10px rgb(15 81 62 / 16%);
}
.local-printer-dialog .local-printer-primary:hover:enabled { background: #0a4232; }
.local-printer-dialog .local-printer-secondary { min-height: 42px; }
.local-printer-dialog .local-printer-cancel { border-color: transparent; color: #52675e; }
.local-printer-dialog button:disabled { opacity: .48; cursor: default; }
.local-printer-dialog :is(button, select):focus-visible { outline: 2px solid #427b63; outline-offset: 3px; }
@media (max-width: 650px) {
  .local-printer-dialog { width: calc(100vw - 24px); max-height: calc(100dvh - 24px); border-radius: 18px; }
  .local-printer-dialog .local-printer-header { padding: 17px 16px; }
  .local-printer-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 12px; }
  .local-printer-preview, .local-printer-settings { padding: 13px; }
  .local-printer-paper img { max-height: 37dvh; }
}
