/* Talvemo 5.13 — UI-only Edit / Customize workspaces.
   Does not affect the public gallery, checkout or exported document styles. */
#app-shell [hidden] { display:none!important; }
.topbar { justify-content:space-between; }
.topbar .brand { width:auto; flex:none; }
.builder-mode-switch { position:absolute; left:50%; transform:translateX(-50%); display:flex; width:298px; padding:5px; gap:4px; border-radius:13px; background:#eff4f0; border:1px solid #e1e9e3; }
.builder-mode-switch button { flex:1; min-width:0; min-height:42px; border:0; border-radius:9px; background:transparent; color:#4a6359; font-family:inherit;line-height:1.4; font-size:16px; font-weight:600; padding:9px 20px; cursor:pointer; transition:background .16s,color .16s,box-shadow .16s; }
.builder-mode-switch button[aria-selected="true"] { color:#174f49; background:white; box-shadow:0 2px 5px #22443714,0 0 0 1px #dde7df; }
.builder-mode-switch button:hover { color:#173d33; }
.builder-mode-switch button:focus-visible,.customize-tabs button:focus-visible { outline:2px solid #24645e; outline-offset:2px; }
.builder-save-warning { position:fixed; z-index:100; top:calc(var(--topbar) + 12px); left:50%; transform:translateX(-50%); width:min(710px,calc(100vw - 28px)); padding:14px 18px; border-radius:10px; border:1px solid #cbae91; background:#fff8ec; color:#5d3d21; box-shadow:0 8px 30px #1e372025; display:flex; align-items:center; gap:12px; font-size:14px; line-height:1.5; }
.builder-save-warning>svg { flex:none; }
.builder-save-warning .text-button { flex:none; color:#653a18; }
.mobile-edit-navigation { display:none; }
.sidebar-bottom { margin-top:auto; padding-top:26px; }
.sidebar-bottom .builder-examples { border-top:1px solid #dbe5de; }
.example-drawer { margin:0 0 20px; border:1px solid #dce6dd; border-radius:9px; background:#f6f9f5; }
.example-drawer>summary { display:flex; align-items:center; gap:10px; padding:11px 14px; cursor:pointer; font-size:13px; font-weight:600; color:#25554a; list-style:none; }
.example-drawer>summary::-webkit-details-marker { display:none; }
.example-drawer>summary>span { font-size:12px; font-weight:400; color:#51695f; margin-left:auto; }
.example-drawer>summary::after { content:''; width:6px; height:6px; border-right:1.5px solid currentColor; border-bottom:1.5px solid currentColor; transform:rotate(45deg); margin:0 3px 4px 7px; }
.example-drawer[open]>summary::after { transform:rotate(225deg); margin-top:4px; }
#builder-examples-inline-slot { margin:0; max-width:none; }
#builder-examples-inline-slot .builder-examples { margin:0; padding:0 16px 14px; border:0; border-radius:0; background:transparent; }
#builder-examples-inline-slot .builder-examples-heading { display:none; }
#builder-examples-inline-slot .builder-example-slide { padding:3px 10px; }
#builder-examples-inline-slot .builder-example-slide h4 { min-height:0; margin:3px 0; font-size:16px; }
#builder-examples-inline-slot .builder-example-description { display:none; }
#builder-examples-inline-slot .builder-example-note { margin:5px 0 0; }
#builder-examples-inline-slot .builder-example-note br { display:none; }
#builder-examples-inline-slot .builder-example-use { max-width:250px; margin:8px auto 0; }
/* Customize has no editing sidebar. Its controls and preview have independent scroll. */
[data-builder-mode="customize"] .workspace { left:0; display:grid; grid-template-rows:minmax(0,1fr); }
[data-builder-mode="customize"] .editor-pane { grid-column:1; grid-row:1; border-right:0; width:100%; }
[data-builder-mode="customize"] .preview-pane { grid-column:2; grid-row:1; }
[data-builder-mode="customize"] .editor-scroll { padding:28px clamp(24px,2.7vw,44px) 28px; }
[data-builder-mode="customize"] .step-heading { margin-bottom:20px; }
[data-builder-mode="customize"] .step-heading h1 { font-size:32px; line-height:1.18; margin-top:12px; }
[data-builder-mode="customize"] .step-heading p { font-size:15px; line-height:1.6; max-width:590px; }
[data-builder-mode="customize"] .step-kicker { font-size:10px; }
[data-builder-mode="customize"] .heading-tag { font-size:10px; }
[data-builder-mode="customize"] .editor-footer { padding:14px clamp(24px,2.7vw,44px); height:80px; min-height:80px; }
[data-builder-mode="customize"] .editor-footer .button { font-size:15px; }
.customize-tabs { display:flex; gap:5px; border-bottom:1px solid #dbe5de; margin:0 0 23px; background:white; position:sticky; top:-28px; z-index:5; padding-top:5px; }
.customize-tabs button { flex:1; padding:15px 6px 14px; min-height:50px; border:0; border-bottom:3px solid transparent; margin-bottom:-1px; background:transparent; color:#51685e; font-family:inherit; font-size:14px; font-weight:550; white-space:nowrap; cursor:pointer; }
.customize-tabs button[aria-selected="true"] { color:#1c574e; border-bottom-color:#24645e; font-weight:650; }
.customize-tabs button:hover { color:#173d33; background:#f8faf7; }
[data-builder-mode="customize"] .collection-intro { font-size:12px; gap:8px; flex-wrap:wrap; margin-bottom:14px; }
[data-builder-mode="customize"] .template-filters { gap:7px; margin-bottom:14px; }
[data-builder-mode="customize"] .template-filter { font-size:12px; padding:8px 11px; min-height:38px; }
[data-builder-mode="customize"] .template-color-help { font-size:12px; margin-bottom:16px; }
[data-builder-mode="customize"] #form-content .template-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:22px 18px; }
[data-builder-mode="customize"] .template-meta h3 { font-size:18px; }
[data-builder-mode="customize"] .template-meta>div>span { font-size:11px; }
.customize-section-title { display:flex; align-items:flex-start; gap:14px; margin:6px 0 26px; }
.customize-section-title>svg { color:#24645e; margin-top:5px; flex-shrink:0; }
.customize-section-title h2 { margin:0 0 8px; font-size:23px; font-weight:650; color:#1a3329; letter-spacing:-.45px; }
.customize-section-title p { margin:0; font-size:15px; line-height:1.65; color:#4b6256; }
.customize-settings-panel .settings-grid { margin-bottom:24px; }
.customize-settings-panel .field>label { font-size:15px; }
.customize-settings-panel .info-box { margin-top:27px; font-size:14px; line-height:1.65; }
.customize-order-title { font-size:17px; margin:30px 0 15px; }
[data-builder-mode="customize"] .parsing-note { font-size:12px; line-height:1.6; margin-top:26px; }
[data-builder-mode="customize"] .gallery-note { font-size:12px; }
[data-builder-mode="customize"] .selected-template-note { margin-top:25px; }
@media(min-width:1400px) {
  [data-builder-mode="customize"] #form-content .template-grid { grid-template-columns:repeat(3,minmax(0,1fr)); gap:26px 17px; }
  [data-builder-mode="customize"] .template-meta { padding-inline:10px; }
}
@media(min-width:1900px) {
  [data-builder-mode="customize"] .editor-scroll { padding-inline:max(44px,calc((100vw * .57 - 1040px)/2)); }
}
@media(min-width:881px) and (max-width:1050px) {
  [data-builder-mode="customize"] .editor-scroll { padding-inline:23px; }
  [data-builder-mode="customize"] .editor-footer { padding-inline:23px; }
}
@media(max-width:880px) {
  :root { --topbar:118px; }
  .topbar { display:flex; align-items:flex-start; padding:10px 18px; gap:12px; }
  .topbar .brand { margin-top:3px; font-size:26px; gap:8px; }
  .topbar .brand-mark { transform:scale(.8); transform-origin:left center; width:24px; }
  .builder-mode-switch { top:60px; width:min(350px,calc(100% - 36px)); padding:4px; border-radius:11px; }
  .builder-mode-switch button { min-height:38px; padding:7px 14px; font-size:14px; border-radius:8px; }
  .mobile-edit-navigation { display:flex; align-items:center; justify-content:space-between; margin:0 0 20px; }
  .mobile-edit-navigation .button { padding:8px 0; min-height:36px; font-size:14px; }
  .mobile-edit-navigation>span { font-size:12px; color:#51695f; }
  [data-builder-mode="customize"] .mobile-edit-navigation { display:none; }
  [data-builder-mode="edit"] .editor-scroll { padding-top:14px; }
  .sidebar.open { top:var(--topbar); }
  .builder-save-warning { font-size:12px; padding:12px; align-items:flex-start; flex-wrap:wrap; gap:8px; }
  .builder-save-warning>span { flex:1; }
  [data-builder-mode="customize"] .workspace { left:0; display:grid; grid-template-columns:minmax(0,1fr); grid-template-rows:clamp(180px,28dvh,245px) minmax(0,1fr); }
  [data-builder-mode="customize"] .preview-pane { display:flex; grid-column:1; grid-row:1; overflow:hidden; padding:10px 16px 8px; border:0; }
  [data-builder-mode="customize"] .preview-top { position:absolute; top:12px; right:14px; width:auto; z-index:2; }
  [data-builder-mode="customize"] .preview-top>div { display:none; }
  [data-builder-mode="customize"] #expand-button { width:38px; height:38px; background:#fffffff2; border:1px solid #dce7df; box-shadow:0 2px 5px #19342a0a; }
  [data-builder-mode="customize"] .preview-label { position:absolute; left:16px; top:13px; z-index:1; display:flex; flex-direction:column; align-items:flex-start; gap:3px; max-width:85px; font-size:10px; line-height:1.4; margin:0; }
  [data-builder-mode="customize"] .preview-label #preview-template { font-size:11px; font-weight:600; color:#254f44; }
  [data-builder-mode="customize"] .preview-label .dot-separator { display:none; }
  [data-builder-mode="customize"] #preview-updating { font-size:9px; }
  [data-builder-mode="customize"] .preview-sheet-container { max-width:calc((clamp(180px,28dvh,245px) - 26px) * .706); margin:0; }
  [data-builder-mode="customize"] .preview-sheet { box-shadow:0 3px 7px #2d584716; }
  [data-builder-mode="customize"] .preview-toolbar { position:absolute; bottom:8px; right:10px; width:auto; margin:0; padding:0; }
  [data-builder-mode="customize"] .page-navigation { gap:0; }
  [data-builder-mode="customize"] .page-navigation .icon-button { width:27px; height:36px; }
  [data-builder-mode="customize"] .page-navigation span { font-size:11px; min-width:32px; }
  [data-builder-mode="customize"] #refresh-button { display:none; }
  [data-builder-mode="customize"] .preview-error { position:absolute; inset:auto 10px 10px; z-index:3; font-size:12px; padding:10px; background:#fff5eb; }
  [data-builder-mode="customize"] .mobile-close-preview { display:none; }
  [data-builder-mode="customize"] .editor-pane { grid-column:1; grid-row:2; border:0; border-top:1px solid #ccdcd0; border-radius:18px 18px 0 0; box-shadow:0 -4px 16px #2a443909; position:relative; z-index:3; }
  [data-builder-mode="customize"] .editor-scroll { padding:0 16px 20px; overscroll-behavior-y:contain; }
  [data-builder-mode="customize"] .step-heading { display:none; }
  [data-builder-mode="customize"] .example-drawer { margin:14px 0 0; }
  [data-builder-mode="customize"] .customize-tabs { position:sticky; top:0; margin:0 0 14px; padding-top:0; z-index:6; }
  [data-builder-mode="customize"] .customize-tabs button { font-size:13px; padding:15px 4px 12px; min-height:48px; }
  [data-builder-mode="customize"] .collection-intro { display:none; }
  [data-builder-mode="customize"] .template-filters { display:flex; flex-wrap:nowrap; gap:6px; overflow:auto; scrollbar-width:none; margin-bottom:14px; padding:1px 0 4px; }
  [data-builder-mode="customize"] .template-filter { flex:none; padding:7px 11px; font-size:11px; min-height:34px; }
  [data-builder-mode="customize"] .template-color-help { display:none; }
  [data-builder-mode="customize"] .ats-builder-note { font-size:11px; padding:9px 10px; line-height:1.45; }
  /* A native, touch-first template rail. Swatch rails keep their own gestures. */
  [data-builder-mode="customize"] #form-content .template-grid { --card-width:228px; display:flex; gap:14px; overflow-x:auto; overscroll-behavior-inline:contain; scroll-snap-type:x mandatory; scrollbar-width:thin; padding:5px max(16px,calc((100% - var(--card-width))/2)) 12px; margin-inline:-16px; scroll-padding-inline:16px; }
  [data-builder-mode="customize"] .template-option { flex:0 0 var(--card-width); scroll-snap-align:center; }
  [data-builder-mode="customize"] .template-option .template-image-wrap { height:157px!important; aspect-ratio:auto; padding:7px!important; }
  [data-builder-mode="customize"] .template-option .template-image-wrap img { object-position:center; }
  [data-builder-mode="customize"] .template-option .template-meta { padding:8px 11px 3px; min-height:48px; }
  [data-builder-mode="customize"] .template-meta h3 { font-size:16px; }
  [data-builder-mode="customize"] .template-meta>div>span { font-size:10px; }
  [data-builder-mode="customize"] .template-meta .ats-template-badge { display:inline-flex; font-size:9px; padding:2px 5px; margin-top:4px; }
  [data-builder-mode="customize"] .template-option>.variant-picker { padding:0 2px 4px; margin-top:3px; }
  [data-builder-mode="customize"] .variant-caption { font-size:10px; padding-inline:10px; margin-bottom:1px; }
  [data-builder-mode="customize"] .selected-template-note { margin:16px 0 12px; padding:12px; }
  [data-builder-mode="customize"] .selected-template-note strong { font-size:15px; }
  [data-builder-mode="customize"] .selected-template-note p { font-size:12px; }
  [data-builder-mode="customize"] .selected-template-note small { display:none; }
  [data-builder-mode="customize"] .gallery-note,[data-builder-mode="customize"] .parsing-note { font-size:11px; }
  [data-builder-mode="customize"] .customize-section-title { margin:6px 0 20px; gap:10px; }
  [data-builder-mode="customize"] .customize-section-title h2 { font-size:20px; }
  [data-builder-mode="customize"] .customize-section-title p { font-size:14px; }
  [data-builder-mode="customize"] .editor-footer { height:auto; min-height:67px; padding:10px 16px max(10px,env(safe-area-inset-bottom)); gap:8px; }
  [data-builder-mode="customize"] .editor-footer .button { font-size:13px; min-height:42px; }
  [data-builder-mode="customize"] .editor-footer .button-quiet { padding:7px 0; gap:6px; }
  [data-builder-mode="customize"] .editor-footer .button-primary { min-width:0; padding:10px 13px; gap:7px; }
}
@media(max-width:360px) {
  .topbar { padding-inline:14px; }
  .topbar .brand { font-size:24px; }
  [data-builder-mode="customize"] .preview-label { max-width:67px; font-size:9px; left:10px; }
  [data-builder-mode="customize"] .preview-label #preview-template { font-size:10px; }
  [data-builder-mode="customize"] .page-navigation .icon-button { width:22px; }
  [data-builder-mode="customize"] .editor-footer .button { font-size:12px; }
  [data-builder-mode="customize"] .editor-footer .button-primary { padding-inline:10px; }
  [data-builder-mode="customize"] .example-drawer>summary>span { font-size:10px; }
}
@media(prefers-reduced-motion:reduce) { .builder-mode-switch button { transition:none; } }

/* Keep the first row of choices within easy reach rather than behind long copy. */
.heading-tag:empty { display:none; }
[data-builder-mode="customize"] .collection-intro { display:none; }
[data-builder-mode="customize"] .step-heading { margin-bottom:16px; }
[data-builder-mode="customize"] .step-heading h1 { margin-bottom:10px; }
[data-builder-mode="customize"] .example-drawer { margin-bottom:12px; }
@media(min-width:1400px) {
  [data-builder-mode="customize"] .template-option .template-image-wrap { height:232px!important; aspect-ratio:auto; }
  [data-builder-mode="customize"] .template-option .template-image-wrap img { object-position:center; }
}
@media(max-width:880px) {
  [data-builder-mode="customize"] #customize-panel-templates { display:flex; flex-direction:column; }
  [data-builder-mode="customize"] .template-filters { order:1; }
  [data-builder-mode="customize"] #form-content .template-grid { order:2; }
  [data-builder-mode="customize"] .ats-builder-note { order:3; margin-top:12px; }
  [data-builder-mode="customize"] .selected-template-note { order:4; }
  [data-builder-mode="customize"] .gallery-note { order:5; }
  [data-builder-mode="customize"] .example-drawer { margin:20px 0 0; }
}

/* Desktop preview shortcut. It is a sibling of the sheet, so image refreshes
   cannot remove it and there are no nested interactive elements. Touch users on
   wide screens get a persistent button; keyboard focus reveals it too. */
.preview-customize-button {
  position:absolute; z-index:2; top:50%; left:50%;
  transform:translate(-50%,-50%); min-height:48px; padding:12px 24px;
  font-size:16px; border-radius:10px; border:1px solid #ffffffd9;
  box-shadow:0 6px 24px #173e3433,0 0 0 4px #ffffffc9;
  opacity:0; pointer-events:none; transition:opacity .16s,background .16s;
}
.preview-customize-button:active:not(:disabled) { transform:translate(-50%,-50%); }
@media(min-width:881px) {
  .preview-sheet-container:hover>.preview-customize-button,
  .preview-sheet-container:focus-within>.preview-customize-button {
    opacity:1; pointer-events:auto;
  }
  .preview-customize-button:focus-visible { outline:3px solid #174f49; outline-offset:5px; }
}
@media(min-width:881px) and (hover:none) {
  .preview-customize-button { opacity:1; pointer-events:auto; }
}
@media(max-width:880px) { .preview-customize-button { display:none; } }
@media(prefers-reduced-motion:reduce) { .preview-customize-button { transition:none; } }

/* Expanded preview stays independent from the small Customize preview.
   In particular, no mobile workspace rules constrain this dialog's pages. */
#preview-sheet[role="button"] { cursor:zoom-in; }
#preview-sheet[role="button"]:focus-visible { outline:3px solid #24645e; outline-offset:5px; }
.large-preview[open] { display:flex; flex-direction:column; width:min(940px,calc(100vw - 32px)); max-width:940px; max-height:calc(100dvh - 40px); overflow:hidden; }
.large-preview .modal-header { flex:none; min-height:72px; padding:16px 24px; }
.large-preview .modal-header h2 { font-size:22px; }
.large-preview .modal-header .icon-button { width:44px; height:44px; flex:none; }
.large-preview .modal-content { display:flex; flex-direction:column; min-height:0; max-height:none; overflow:hidden; padding:0; }
.expanded-preview-toolbar { display:flex; flex:none; align-items:center; justify-content:space-between; gap:12px; padding:10px 24px; border-bottom:1px solid #d5e2d9; }
.expanded-preview-toolbar p { margin:0; color:#385a4d; font-size:13px; }
.expanded-preview-toolbar .text-button { font-size:14px; min-height:36px; padding:5px 0 5px 12px; white-space:nowrap; }
.expanded-preview-pages { overflow:auto; overscroll-behavior:contain; padding:22px 24px 12px; min-height:0; scrollbar-width:thin; }
.expanded-preview-pages:focus-visible { outline:2px solid #24645e; outline-offset:-3px; }
.expanded-preview-page { width:100%; max-width:720px; margin:0 auto 18px; }
.large-preview .expanded-preview-page img { width:100%; height:auto; display:block; max-width:none; margin:0; background:white; }
.expanded-preview-page figcaption { font-size:12px; line-height:1.4; margin:10px 0 0; color:#3e5e50; }
.preview-zoomed .expanded-preview-page { width:900px; max-width:none; }
.expanded-preview-loading { display:flex; min-height:220px; align-items:center; justify-content:center; gap:14px; padding:30px; font-size:16px; color:#254e42; }
.expanded-preview-image-error { min-height:130px; padding:32px; background:#fff8ed; color:#624921; }
@media(max-width:880px) {
  .large-preview[open] { width:100%; max-width:100vw; height:100dvh; max-height:100dvh; margin:0; border:0; border-radius:0; }
  .large-preview .modal-header { padding:calc(10px + env(safe-area-inset-top)) 16px 10px; min-height:65px; }
  .large-preview .modal-header h2 { font-size:20px; }
  .large-preview .modal-content { flex:1; }
  .expanded-preview-toolbar { padding:6px 16px; }
  .expanded-preview-toolbar p { font-size:12px; }
  .expanded-preview-toolbar p span { display:none; }
  .expanded-preview-pages { flex:1; padding:16px 10px calc(12px + env(safe-area-inset-bottom)); touch-action:pan-x pan-y pinch-zoom; }
  .preview-zoomed .expanded-preview-page { width:max(680px,170%); }
  .expanded-preview-loading { flex:1; }
}

/* A shared desktop preview rail. --sidebar keeps its responsive value even
   while hidden in Customize, so both workspaces use exactly the same right
   column. Shared padding and sheet limits also prevent the document zoom from
   changing when the mode, Customize tab or form scroll position changes. */
@media(min-width:881px) {
  #app-shell {
    --builder-preview-width:calc((100vw - var(--sidebar)) / 2.14);
    --builder-preview-sheet-width:min(560px,max(120px,calc((100dvh - 265px) * .707)));
  }
  #app-shell .workspace { grid-template-columns:minmax(0,1fr) var(--builder-preview-width); }
  #app-shell .preview-pane { padding:28px clamp(20px,2.1vw,42px) 18px; border:0; border-left:1px solid #dfe8e1; background:#edf2ef; }
  #app-shell .preview-sheet-container { width:100%; max-width:var(--builder-preview-sheet-width); flex:none; margin:0; }
  #app-shell .preview-top { max-width:none; }
  #app-shell .preview-label { margin:9px 0 19px; }
  #app-shell .preview-toolbar { width:100%; max-width:var(--builder-preview-sheet-width); margin-top:auto; padding-top:17px; }
}
#refresh-button { gap:7px; }
#refresh-button svg { width:16px; height:16px; flex:none; }
