/* Shared presentation and adapters for the retained page templates.
   Canonical color/type/motion values live in styles.css :root. */
@font-face{font-family:"Juzi Pixel Display";src:url('./assets/fonts/juzi-pixel-display.woff2') format('woff2');font-style:normal;font-weight:400;font-display:swap}
:root,body,.pd-shell,.taro_page{
 --pd-primary:var(--primary);--pd-brand:var(--primary);--pd-accent:var(--primary);
 --pd-primary-strong:var(--ink);--pd-brand-strong:var(--ink);--pd-brand-soft:var(--studio-soft);
 --pd-accent-soft:var(--studio-soft);--pd-gradient-from:var(--primary);--pd-gradient-to:var(--primary);
 --pd-text-primary:var(--ink);--pd-text-secondary:var(--muted);--pd-text-tertiary:var(--muted);--pd-text-placeholder:var(--muted);
 --pd-border:var(--line);--pd-bg-page:var(--bg);--pd-bg-page-top:var(--bg);--pd-bg-card:var(--surface);--pd-bg-muted:var(--studio-soft);
 --pd-stage-paper:var(--surface);--pd-stage-ink:var(--ink);--pd-stage-primary:var(--primary);--pd-stage-accent:var(--primary);--pd-stage-tape:var(--studio-soft);
 --pd-radius-control:var(--radius-sm);--pd-radius-card:var(--radius);--pd-shadow-card:var(--shadow);--pd-shadow-card-sm:var(--shadow);
 --pd-font-tiny:12px;--pd-font-caption:13px;--pd-font-small:14px;--pd-font-body:15px;--pd-font-subtitle:16px;--pd-font-heading:24px;
 --pd-control-height-sm:40px;--pd-control-height-md:var(--control-height);--pd-btn-radius:var(--action-radius);
}
html,body{font-family:var(--font);color:var(--ink)}
body{background:var(--bg);font-size:15px;line-height:1.6}
body>main{scrollbar-width:thin;scrollbar-color:var(--scroll-thumb) var(--bg);scroll-behavior:auto}
@media(min-width:1000px), (hover:hover) and (pointer:fine){
 #app-shell:not([hidden]) + #main{scrollbar-gutter:stable}
}
body>main::-webkit-scrollbar{display:block;width:7px;height:7px}
*,*::before,*::after{box-sizing:border-box}
*{scrollbar-color:var(--scroll-thumb) var(--bg)}
*::-webkit-scrollbar-thumb{background:var(--scroll-thumb)}
*::-webkit-scrollbar-track{background:var(--bg)}
.taro_page,.pd-shell{font-family:var(--font);color:var(--ink)}
button,input,select,textarea{font-family:var(--font)}
button,a,[role=button]{-webkit-tap-highlight-color:transparent}
button:focus-visible,a:focus-visible,[role=button]:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible{outline:3px solid var(--focus);outline-offset:4px}
button:disabled,[aria-disabled=true]{cursor:not-allowed}
.pixel-heading{font-family:var(--font-display);font-weight:400;font-synthesis:none;line-height:1.25;letter-spacing:0}
.btn{background:var(--primary);color:var(--surface);border:1px solid transparent;border-radius:var(--action-radius);min-height:46px;padding:10px 22px;font-size:15px;font-weight:650;line-height:1.5;box-shadow:none;transition:background-color var(--motion-fast),color var(--motion-fast),transform var(--motion-fast) var(--ease-out),box-shadow var(--motion-fast)}
.btn:where(:not(:disabled,[aria-disabled=true])):hover{background:var(--primary-hover);box-shadow:0 4px 12px #9b396a15}
.btn:active{transform:scale(.975);box-shadow:none}
.btn.secondary{color:var(--ink);background:var(--surface);border-color:var(--line);box-shadow:none;font-weight:600}
.btn.secondary:where(:not(:disabled,[aria-disabled=true])):hover{background:var(--studio-soft);border-color:var(--studio-line);box-shadow:none}
.btn.small{min-height:40px;font-size:13px;padding:8px 15px}
@media(max-width:760px),(pointer:coarse){.btn.small{min-height:var(--control-height)}}
.btn.danger{background:var(--surface);color:var(--danger);border-color:var(--line)}
.btn.danger:where(:not(:disabled,[aria-disabled=true])):hover{background:var(--studio-soft);box-shadow:none}
.btn:disabled{transform:none;box-shadow:none;opacity:.45}
.plain-link{display:inline-flex;align-items:center;justify-content:center;gap:8px;color:var(--primary);font:600 14px/1.5 var(--font);min-height:44px;padding:8px 0;border:0;background:transparent;text-decoration:none;cursor:pointer}
.plain-link:hover{text-decoration:underline;text-underline-offset:5px}
.plain-link svg{width:17px;height:17px}
.panel,.flow-options,.flow-preview,.work-card{border-color:var(--line);border-radius:var(--radius);box-shadow:none}
.round-back,.pd-navbar__back,.pd-navbar__action,.bead-header .bead-icon{min-width:44px;min-height:44px;border:1px solid var(--line);background:var(--surface);color:var(--ink);border-radius:50%;box-shadow:none;transition:background-color var(--motion-fast),transform var(--motion-fast)}
.round-back:hover,.pd-navbar__back:hover,.pd-navbar__action:hover{background:var(--studio-soft)}
.round-back:active,.pd-navbar__back:active{transform:scale(.95)}
.replica-navbar,.pd-navbar{background:var(--bg);box-shadow:none;border-color:var(--line);font-family:var(--font)}
.pd-navbar__title,.replica-navbar h1{font-family:var(--font);font-weight:750;font-size:18px;color:var(--ink)}
.pd-navbar__subtitle{color:var(--muted);font-size:13px}
.check input,input[type=checkbox],input[type=radio]{accent-color:var(--primary)}
.text-input,select{border-color:var(--line);border-radius:var(--radius-sm)}
.range{accent-color:var(--primary)}
.replica-tabs{background:var(--studio-soft);border-radius:var(--radius-sm)}
.replica-tabs button.active,.replica-tabs button.selected{background:var(--surface);color:var(--primary);border-color:var(--studio-line);box-shadow:var(--shadow)}
.toast{font:500 14px/1.6 var(--font);border-radius:999px;box-shadow:0 10px 30px #563e4f1c;max-width:min(480px,calc(100vw - 32px));padding:12px 22px}
.skip-link{font:600 14px/1.5 var(--font);border-radius:10px}

/* Task dialogs share an accessible native dialog, with touch-sized actions. */
dialog{font:15px/1.65 var(--font);padding:28px;border:1px solid var(--line);border-radius:28px;color:var(--ink);background:var(--surface);max-height:calc(100dvh - 40px);box-shadow:0 24px 90px #563e4f26;overflow:auto}
dialog[open]{animation:dialog-in var(--motion-page) var(--ease-out) both}
dialog::backdrop{background:#46323d55;backdrop-filter:blur(3px)}
dialog[open]::backdrop{animation:backdrop-in var(--motion-page) ease both}
dialog h2,#dialog-title{font-size:22px;font-weight:750;line-height:1.4;margin:0 0 16px}
dialog p{font-size:14px;line-height:1.75;color:var(--muted)}
.dialog-actions{gap:10px;margin-top:24px}
.dialog-actions .btn{min-height:44px}
.field-error{color:var(--danger);font-size:14px;line-height:1.6;margin:8px 0 12px}
dialog .field-error{color:var(--danger)}
[aria-invalid=true]{border-color:var(--danger)!important}
.utility-page{max-width:1040px;margin:0 auto;padding:24px}
.task-header{display:flex;align-items:center;gap:16px;margin-bottom:24px}
.task-header h1{font:750 var(--task-title-size)/1.3 var(--font);color:var(--ink);margin:0}
.task-header .task-back{position:static;display:inline-grid;place-items:center;flex:none;width:var(--control-height);height:var(--control-height);padding:0;border:1px solid var(--line);border-radius:50%;background:var(--surface);color:var(--ink);box-shadow:none}
.task-header .task-back svg{width:20px;height:20px}
.task-header .task-back:hover{background:var(--studio-soft);border-color:var(--studio-line)}
@media(max-width:800px){.task-header{gap:12px;margin-bottom:18px}}
.utility-card{display:grid;grid-template-columns:minmax(0,1fr) minmax(200px,.65fr);gap:40px;padding:32px;border:1px solid var(--line);border-radius:var(--radius);background:var(--surface)}
.utility-card h2{font-size:22px;margin:0 0 12px}
.utility-card p{color:var(--muted);margin:0 0 20px;line-height:1.8}
.utility-card .field-label{font-size:15px;margin:24px 0 8px}
.utility-card .text-input{min-height:var(--control-height);font-size:16px}
.utility-card .field-hint{font-size:13px;margin:8px 0 24px}
.utility-card .field-error{color:var(--danger)}
.qr-example{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;padding:20px;background:var(--studio-soft);border-radius:20px;align-self:start}
.qr-example canvas{width:min(100%,220px);height:auto;image-rendering:pixelated}
.qr-example figcaption{color:var(--muted);font-size:13px}
.account-overview{grid-template-columns:1fr 1fr}
.account-overview .plain-link{display:inline-flex;margin-left:16px}
.wf-shell-outer.text-pattern-shell{--text-pattern-line:var(--line);--text-pattern-line-strong:var(--studio-line);--text-pattern-active:var(--studio-soft);background:var(--bg)}
/* The retained NutUI template marks these four declarations important. Keep
   this adapter scoped to its action; never recolor pattern/palette content. */
.text-pattern-shell .text-pattern-action.pd-btn{background:var(--primary)!important;color:var(--surface)!important;border:1px solid transparent!important;border-radius:999px;font-size:15px;font-weight:650;box-shadow:none!important}
.text-pattern-shell .text-pattern-action.pd-btn:hover{background:var(--primary-hover)!important}
.text-pattern-shell .text-pattern-action.pd-btn:active{transform:scale(.98)}
.text-pattern-shell .text-pattern-action.pd-btn *{color:inherit!important}
.text-pattern-page .text-pattern-preview__board{width:100%!important;height:100%!important;aspect-ratio:auto!important;min-width:0;min-height:0}
.text-pattern-page .text-pattern-preview__image,.text-pattern-page .text-pattern-preview__image img{display:block;width:100%;height:100%;object-fit:contain;image-rendering:pixelated}
.text-pattern-page .text-pattern-scenario{min-height:44px;line-height:44px}
.text-pattern-page .text-pattern-scenario.is-active{background:var(--studio-soft);color:var(--primary);box-shadow:inset 0 0 0 1px var(--studio-line)}
.text-pattern-page .text-pattern-scenario__label,.text-pattern-page .text-pattern-label{font-size:14px;font-weight:650}
.text-pattern-page .text-pattern-stats,.text-pattern-page .text-pattern-overflow{font-size:13px;line-height:1.65;color:var(--muted)}
.text-pattern-page .text-pattern-overflow{background:var(--studio-soft);border-color:var(--line);font-weight:400}
.text-pattern-page .text-pattern-input{font-family:var(--font)}
.text-pattern-page .text-pattern-input:focus-within{outline:2px solid var(--focus);outline-offset:2px}
.board-split__kind--active{background:var(--studio-soft);color:var(--primary)}
@media(max-width:600px){.utility-page{padding:18px}.utility-card,.account-overview{grid-template-columns:1fr;padding:22px;gap:24px}.utility-card h2{font-size:20px}.qr-example{padding:16px}.qr-example canvas{width:150px}.qr-link__confirm{width:100%}}
.mode-option{background:var(--studio-soft);border-color:var(--line)}
.mode-option small{color:var(--muted)}
.bead-palette-dialog{max-height:52dvh}
.bead-palette-dialog h3{font-size:14px;margin:18px 0 12px}
.bead-palette-dialog button{min-height:52px;font-size:13px;border-radius:12px}

/* The new app shell: generous gallery rhythm, quiet controls, pixel headings. */
.juzi-home.pd-home,.juzi-home{max-width:1232px;width:100%;min-height:100%;display:flex;flex-direction:column;align-items:stretch;gap:0;padding:0 24px 24px;margin:0 auto;background:transparent;font:15px/1.6 var(--font);color:var(--ink)}
.juzi-app-header,.juzi-page-heading,.juzi-footer{width:100%;align-self:stretch}
:root{--app-header-height:88px}
#app-shell{position:relative;height:var(--app-header-height);background:var(--surface);border-bottom:1px solid var(--line)}
#app-shell:not([hidden]) + #main{height:calc(100dvh - var(--app-header-height));min-height:0}
.juzi-app-header{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:24px;max-width:1232px;height:100%;margin-inline:auto;padding-inline:24px}
.juzi-home:is(.juzi-works,.juzi-help,.community-page-new,.juzi-earn){padding-top:38px}
.juzi-brand{display:inline-flex;align-items:center;gap:12px;flex-shrink:0}
.juzi-brand .juzi-mark{width:42px;height:42px}
.juzi-brand .pd-home__name{font:750 18px/1.4 var(--font);color:var(--ink);white-space:nowrap;letter-spacing:0}
.juzi-app-header .juzi-navigation{position:static;inset:auto;display:flex;justify-content:center;align-items:center;gap:4px;border:1px solid var(--line);padding:5px;margin:0;background:var(--surface);border-radius:999px;box-shadow:none;width:auto;max-width:none;min-height:0;height:auto;z-index:10;flex:none;transform:none}
.juzi-app-header .juzi-navigation .juzi-nav-link{display:flex;align-items:center;justify-content:center;flex:0 0 112px;flex-direction:row;gap:8px;min-width:0;min-height:44px;width:112px;height:auto;margin:0;padding:8px 10px;border:0;border-radius:999px;background:transparent;color:var(--muted);font:600 14px/1.4 var(--font);text-decoration:none;transition:background-color var(--motion-fast),color var(--motion-fast)}
.juzi-app-header .juzi-navigation .juzi-nav-link svg{display:block;flex:none;width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.juzi-navigation #juzi-nav-profile span{min-width:0;max-width:min(100%,8em);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.juzi-app-header .juzi-navigation .juzi-nav-link[aria-current=page]{color:var(--primary);background:var(--studio-soft)}
.juzi-app-header .juzi-navigation .juzi-nav-link:hover{color:var(--primary);background:var(--studio-soft)}
.juzi-import{padding:9px 17px;font-size:14px;min-height:44px}
#works-records[hidden]{display:none}
#works-records{margin:16px 0}
.juzi-header-tools{display:flex;align-items:center;justify-content:flex-end;gap:8px;min-width:0}
.juzi-help-link{display:grid;place-items:center;width:44px;height:44px;flex-shrink:0;border-radius:50%;color:var(--muted)}
.juzi-help-link svg{width:21px;height:21px}
.juzi-help-link:hover,.juzi-help-link[aria-current=page]{background:var(--studio-soft);color:var(--primary)}
.juzi-page-heading{display:flex;align-items:center;justify-content:space-between;gap:24px;margin-bottom:30px}
.juzi-page-heading h1{font-size:48px;margin:0 0 10px;line-height:1.25}
.juzi-page-heading p,.juzi-home .pd-home__usage-line{font:400 15px/1.7 var(--font);color:var(--muted);margin:0;white-space:normal}
.juzi-home .pd-home__header-action{position:static;display:inline-flex;width:auto;min-height:44px;height:auto;box-shadow:none;background:var(--surface);border-color:var(--line);border-radius:999px;padding:10px 20px;gap:10px}
.juzi-home .pd-home__header-action-text{font:600 14px/1.5 var(--font);color:var(--ink)}
.juzi-home .juzi-create-card{position:relative;display:grid;grid-template-columns:.9fr 1.1fr;align-items:center;gap:36px;width:100%;min-height:270px;margin:0 0 34px;padding:30px 36px;overflow:hidden;border:1px solid var(--line);border-radius:28px;background:var(--surface);box-shadow:none}
.juzi-eyebrow{display:block;color:var(--primary);font-size:13px;font-weight:600;margin-bottom:8px}
.juzi-create-copy{position:relative;z-index:1}
.juzi-home .studio-upload__feature-title{display:block;font:750 28px/1.4 var(--font);margin:0 0 10px;color:var(--ink)}
.juzi-create-copy p{max-width:340px;color:var(--muted);font-size:15px;line-height:1.8;margin:0 0 20px}
.juzi-create-button{min-width:148px}
.juzi-file-note{display:block;font-size:12px;color:var(--muted);margin-top:12px}
.home-demo{--demo-image-height:210px;--demo-fade:250ms;position:relative;min-width:0;align-self:stretch;background:var(--studio-soft);border-radius:22px;padding:18px;overflow:hidden}
.home-demo-top{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:18px}
.home-demo-tabs{display:flex;gap:2px;padding:4px;background:var(--surface);border:1px solid var(--line);border-radius:999px}
.home-demo-tabs button{border:0;border-radius:999px;min-height:40px;min-width:60px;padding:8px 14px;background:transparent;color:var(--muted);font:600 14px/1.4 var(--font);transition:background-color var(--motion-fast),color var(--motion-fast)}
.home-demo-tabs button[aria-selected=true]{background:var(--primary);color:var(--surface)}
.home-demo-tabs button:hover:not([aria-selected=true]){background:var(--studio-soft);color:var(--primary)}
.home-demo-tabs button:active{transform:scale(.97)}
.home-demo-toggle{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:8px 5px;border:0;background:transparent;color:var(--muted);font:500 12px/1.5 var(--font);border-radius:10px}
.home-demo-toggle:hover{background:var(--surface);color:var(--primary)}
.home-demo-toggle:active{color:var(--primary-hover)}
.home-demo-stage{display:grid;touch-action:pan-y;user-select:none;-webkit-user-select:none}
.home-demo-panel{grid-area:1/1;min-width:0;opacity:0;pointer-events:none;transition:opacity var(--demo-fade) var(--ease-out)}
.home-demo-panel[data-active=true]{opacity:1;pointer-events:auto;z-index:1}
.home-demo-comparison{display:grid;grid-template-columns:minmax(0,1fr) 24px minmax(0,1fr);gap:10px;align-items:center}
.home-demo-figure{min-width:0;margin:0;text-align:center}
.home-demo-media{height:var(--demo-image-height);display:grid;place-items:center;background:var(--surface);border-radius:14px;overflow:hidden}
.home-demo-picture{display:block;width:100%;height:100%;max-height:var(--demo-image-height);stroke:none;overflow:hidden;pointer-events:none}
.home-demo-figure figcaption{font:500 13px/1.5 var(--font);color:var(--muted);margin-top:10px}
.home-demo-arrow{display:grid;place-items:center;color:var(--primary);align-self:center;margin-top:-28px}
.home-demo-arrow svg{width:22px;height:22px;stroke-width:1.5}
.home-demo-caption{min-height:42px;margin:16px 0 0;text-align:center;font:400 13px/1.6 var(--font);color:var(--ink);display:flex;align-items:center;justify-content:center}
.home-demo-fallback{display:none;color:var(--muted);font:13px/1.6 var(--font);padding:12px;text-align:center}
.home-demo-media[data-failed=true] .home-demo-picture{display:none}
.home-demo-media[data-failed=true] .home-demo-fallback{display:block}
.home-demo[data-reduced-motion=true] .home-demo-panel{transition:none}
.juzi-recent.workspace-works-panel,.juzi-recent{display:block;border:0;border-radius:0;padding:0;margin:0;background:transparent;min-height:0;box-shadow:none}
.juzi-section-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:44px;margin-bottom:16px}
.juzi-section-heading h2{display:flex;align-items:center;gap:10px;font:700 20px/1.5 var(--font);margin:0}
.juzi-count{display:inline-grid;place-items:center;min-width:27px;height:27px;padding:0 8px;border-radius:999px;background:var(--studio-soft);color:var(--primary);font:600 12px/1 var(--font)}
.juzi-local-note{font-size:13px;color:var(--muted)}
.juzi-home .juzi-empty{display:flex;align-items:center;justify-content:center;flex-direction:column;gap:0;min-height:240px;border:1px dashed var(--studio-line);border-radius:24px;padding:28px;text-align:center;background:var(--surface);font-family:var(--font)}
.juzi-home .plain-link{margin:0}
.juzi-empty-art{display:grid;place-items:center;width:54px;height:54px;margin-bottom:14px;border-radius:18px;background:var(--studio-soft);color:var(--primary)}
.juzi-empty-art svg{width:28px;height:28px;stroke-width:1.3}
.juzi-empty h3{font-size:18px;font-weight:650;margin:0 0 7px}
.juzi-empty p{font-size:14px;color:var(--muted);margin:0 0 4px}
.juzi-footer{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:28px 0 12px;margin-top:auto;color:var(--muted);font-size:12px}
.juzi-footer a{text-decoration:underline;text-underline-offset:4px;flex-shrink:0;min-height:44px;display:inline-flex;align-items:center}
.juzi-home .work-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:22px;margin:0}
.juzi-home .work-card{border:1px solid var(--line);border-radius:var(--radius);background:var(--surface);overflow:hidden;transition:box-shadow var(--motion-fast),border-color var(--motion-fast)}
.juzi-home .work-card:hover{border-color:var(--studio-line);box-shadow:0 6px 20px #563e4f09}
.juzi-home .work-open{font-family:var(--font);color:var(--ink)}
.juzi-home .work-open:focus-visible{outline-offset:-4px}
.work-thumbnail{display:grid;grid-template:minmax(0,1fr)/minmax(0,1fr);place-items:center;aspect-ratio:1;padding:16px;color:var(--muted);overflow:hidden}
.juzi-home .work-thumbnail img{width:100%;height:100%;padding:0;background:transparent;object-fit:contain}
.work-thumbnail svg{width:24px;height:24px}
.card-thumbnail{background:var(--studio-soft)}
.card-thumbnail [data-card-image]{opacity:0;transition:opacity .2s ease}
.card-thumbnail [data-image-ready]{opacity:1}
.card-thumbnail [data-image-cached]{transition:none}
@media(prefers-reduced-motion:reduce){.card-thumbnail [data-card-image]{transition:none}}
.juzi-home .work-info{border-top:1px solid var(--line);padding:14px 16px 8px;background:var(--surface)}
.juzi-home .work-info strong{font-size:15px;font-weight:650;line-height:1.5}
.juzi-home .work-info small{font:12px/1.7 var(--font);color:var(--muted)}
.juzi-home .work-actions{padding:0 12px 12px;justify-content:space-between}
.juzi-home .work-actions .btn{font-size:12px;min-height:44px;padding:6px 12px;background:transparent;border-color:transparent;color:var(--primary)}
.juzi-works .work-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:2px 6px}
.juzi-works .work-actions .btn{min-width:0;padding-inline:4px}
.juzi-works .work-actions [data-open]{background:var(--studio-soft);color:var(--primary)}
.juzi-works .work-actions [data-follow-work]{border-color:var(--line);color:var(--ink)}
.juzi-works .work-actions :is([data-open],[data-follow-work]):hover{background:var(--studio-soft);border-color:var(--studio-line)}
.juzi-home .work-actions [data-delete]{color:var(--muted)}
.juzi-home .work-actions [data-delete]:hover{color:var(--danger);background:#fff0f3}
.juzi-help-list{background:var(--surface);border:1px solid var(--line);border-radius:24px;overflow:hidden}
.juzi-help-list details{padding:0 24px;border-bottom:1px solid var(--line)}
.juzi-help-list details:last-child{border-bottom:0}
.juzi-help-list summary{display:flex;align-items:center;justify-content:space-between;gap:16px;list-style:none;cursor:pointer;font-size:16px;font-weight:650;padding:21px 0}
.juzi-help-list summary::-webkit-details-marker{display:none}
.juzi-help-list summary span{font-size:22px;font-weight:400;color:var(--primary);transition:transform var(--motion-fast)}
.juzi-help-list details[open] summary span{transform:rotate(45deg)}
.juzi-help-list p{padding:0 30px 22px 0;max-width:850px;color:var(--muted);font-size:15px;line-height:1.9}
.juzi-help-foot{display:flex;gap:24px;align-items:center;margin:26px 0}

/* Preview settings and results follow the same tone as the workspace. */
/* Approved creation layout; data and uploads keep their existing owners. */
.juzi-home.juzi-create-home .juzi-page-heading h1{font-size:42px}
.juzi-home.juzi-create-home .pd-home__header-action{border:0;background:transparent;padding-right:0}
.juzi-resume{display:flex;align-items:center;gap:18px;padding:20px 24px;margin:0 0 30px;border:1px solid var(--line);border-radius:var(--radius);background:var(--surface)}
.juzi-resume-preview{width:66px;height:66px;flex:0 0 66px;border-radius:14px;background:var(--bg);overflow:hidden;display:grid;place-items:center}
.juzi-resume-preview img,.juzi-resume-preview canvas{width:100%;height:100%;object-fit:contain;image-rendering:pixelated}
.juzi-resume-copy{flex:1;min-width:0}.juzi-resume-label{color:var(--muted);font-size:12px}
.juzi-resume-copy h2{font:650 17px/1.5 var(--font);margin:3px 0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.juzi-resume-copy p{font-size:12px;color:var(--muted);margin:0}
.juzi-resume>.btn{flex-shrink:0;font-size:14px;min-height:44px}
.juzi-create-options{display:grid;grid-template-columns:minmax(0,2.15fr) minmax(250px,1fr);gap:20px;margin-bottom:32px}
.juzi-create-tools{display:flex;flex-wrap:wrap;gap:10px;margin:0 0 32px}
.juzi-create-tools .btn{min-height:44px}
.juzi-home.juzi-create-home .juzi-create-card{grid-template-columns:minmax(180px,.85fr) minmax(0,1.15fr);gap:20px;min-height:292px;margin:0;padding:24px;border-radius:var(--radius)}
.juzi-create-symbol{display:grid;place-items:center;width:44px;height:44px;border-radius:14px;background:var(--studio-soft);color:var(--primary);margin-bottom:14px}
.juzi-create-symbol svg{width:23px;height:23px}
.juzi-home.juzi-create-home .studio-upload__feature-title{font-size:24px}
.juzi-home.juzi-create-home .juzi-create-copy p{font-size:14px;line-height:1.7;margin-bottom:20px}
.juzi-home.juzi-create-home .home-demo{--demo-image-height:160px;display:flex;flex-direction:column;justify-content:center;align-self:stretch;padding:14px;background:var(--bg);border-radius:18px}
.juzi-home.juzi-create-home .home-demo-top{order:2;flex-wrap:wrap;justify-content:center;margin:10px 0 0;gap:0 8px}
.juzi-home.juzi-create-home .home-demo-tabs button{min-width:44px;min-height:44px;padding:8px 10px;font-size:12px}
.juzi-home.juzi-create-home .home-demo-toggle{font-size:11px;min-height:44px}
.juzi-home.juzi-create-home .home-demo-comparison{grid-template-columns:minmax(0,1fr) 18px minmax(0,1fr);gap:7px}
.juzi-home.juzi-create-home .home-demo-arrow svg{width:18px;height:18px}
.juzi-home.juzi-create-home .home-demo-figure figcaption{font-size:12px;margin-top:6px}
.juzi-home.juzi-create-home .home-demo-caption{font-size:12px;line-height:1.5;min-height:36px;margin-top:10px}
.juzi-home.juzi-create-home .chart-home-card--compact{display:flex;flex-direction:column;flex-wrap:nowrap;align-items:flex-start;justify-content:center;gap:0;padding:24px;margin:0;min-width:0;border:1px solid var(--line);border-radius:var(--radius);background:var(--surface)}
.juzi-home.juzi-create-home .chart-home-card--compact .chart-home-copy{flex:0 0 auto;width:100%;min-width:0}
.juzi-home.juzi-create-home .chart-home-card--compact .chart-home-symbol{width:44px;height:44px;border-radius:14px;margin-bottom:14px;flex:0 0 44px}
.juzi-home.juzi-create-home .chart-home-card--compact .chart-home-symbol svg{width:23px;height:23px}
.juzi-home.juzi-create-home .chart-home-card--compact h2{font:650 24px/1.4 var(--font);margin:0 0 10px}
.juzi-home.juzi-create-home .chart-home-card--compact p{font-size:14px;line-height:1.7;color:var(--muted);margin:0 0 20px}
.juzi-home.juzi-create-home .chart-home-card--compact .chart-home-actions{display:flex;align-items:flex-start;flex-direction:column;gap:8px;min-width:0;max-width:100%;margin-left:0}
.juzi-home.juzi-create-home .chart-home-card--compact .chart-home-actions .btn{min-height:44px;font-size:14px;padding:10px 18px}
.juzi-home.juzi-create-home .chart-home-card--compact .plain-link{min-height:44px;font-size:13px;padding:8px 0}
@media(max-width:1100px) and (min-width:761px){
 .juzi-home.juzi-create-home .juzi-create-card{grid-template-columns:1fr;padding:24px}
 .juzi-home.juzi-create-home .home-demo{--demo-image-height:150px}
 .juzi-home.juzi-create-home .home-demo-top{flex-wrap:nowrap}
 .juzi-home.juzi-create-home .juzi-create-copy p{max-width:none}
 .juzi-home.juzi-create-home .juzi-create-card .juzi-file-note br{display:none}
 .juzi-home.juzi-create-home .chart-home-card--compact{justify-content:flex-start}
}
@media(max-width:760px){
 .juzi-home.juzi-create-home .juzi-page-heading h1{font-size:32px}
 .juzi-home.juzi-create-home .juzi-page-heading{align-items:flex-end}
 .juzi-home.juzi-create-home .pd-home__header-action{padding-left:0;font-size:12px}
 .juzi-resume{display:grid;grid-template-columns:54px minmax(0,1fr);gap:12px;padding:18px;margin-bottom:26px}
 .juzi-resume-preview{width:54px;height:54px}.juzi-resume-copy h2{font-size:15px}
 .juzi-resume>.btn{grid-column:1/-1;justify-self:stretch}
 .juzi-create-options{grid-template-columns:minmax(0,1fr);gap:16px;margin-bottom:26px}
 .juzi-home.juzi-create-home .juzi-create-card{grid-template-columns:minmax(0,1fr);gap:22px;padding:22px 18px;margin:0;min-height:0}
 .juzi-home.juzi-create-home .juzi-create-card .juzi-file-note br{display:none}
 .juzi-home.juzi-create-home .juzi-create-copy p{margin-bottom:16px;max-width:none}
 .juzi-home.juzi-create-home .home-demo{--demo-image-height:clamp(140px,42vw,200px);padding:14px}
 .juzi-home.juzi-create-home .home-demo-top{justify-content:space-between;margin-top:10px}
 .juzi-home.juzi-create-home .chart-home-card--compact{padding:22px 18px}
 .juzi-home.juzi-create-home .chart-home-card--compact h2{font-size:22px}
 .juzi-home.juzi-create-home .chart-home-card--compact .chart-home-actions{flex-direction:row;align-items:center;flex-wrap:wrap;gap:8px 16px}
 .juzi-home.juzi-create-home .juzi-new-heading h2{font-size:18px}
 .juzi-header-tools{gap:4px}.juzi-header-tools .juzi-import{min-height:44px;width:44px;padding:10px;min-width:44px}
 .juzi-header-tools .juzi-import span{display:none}
 .juzi-header-tools .juzi-import svg{width:20px;height:20px}
}
@media(max-width:360px){
 .juzi-home.juzi-create-home .juzi-page-heading{align-items:flex-start;flex-direction:column;gap:2px}
 .juzi-home.juzi-create-home .home-demo-top{justify-content:center;flex-wrap:wrap}
 .juzi-home.juzi-create-home .home-demo-tabs button{padding:8px 12px}
}

.photo-preview-header h2{font-size:22px;line-height:1.4;color:var(--ink)}
.photo-preview-dialog .btn{font-size:14px;min-height:44px;border-radius:999px}
.photo-preview-choice{border-radius:16px;padding:14px 11px}
.photo-preview-choice:has(input:checked){border-color:var(--primary);background:var(--studio-soft)}
.photo-preview-choice strong{font-size:14px}
.photo-preview-choice small{font-size:12px;line-height:1.7}
.photo-preview-choice input,.photo-preview-background input{accent-color:var(--primary);width:18px;height:18px}
.photo-preview-options legend{font-size:16px}
.photo-preview-options legend span,.photo-preview-help{font-size:13px}
.photo-preview-disclosure{font-size:12px;line-height:1.7}
.photo-preview-background{min-height:44px}
.photo-preview-card{border-radius:20px}
.photo-preview-source img,.photo-preview-media{background:var(--bg);border-radius:14px}
.photo-preview-footer{border-top-color:var(--line)}
.photo-preview-actions{align-items:center}
.photo-preview-actions #ai-original{margin-right:auto}

/* Export and the board-selection branch retain their file behavior. */
.export-direction button[aria-pressed=true]{background:var(--studio-soft);border-color:var(--primary);color:var(--primary)}
.export-zoom button{border-radius:999px;min-height:40px}
.export-preview-stage{background:var(--bg)}
.studio-export-page .plain-link{font-size:13px;color:var(--primary)}
.export-download-card,.export-preview-card{border-radius:24px;box-shadow:none}
.board-split__size-btn--active,.board-split__direction-btn--active{background:var(--studio-soft);color:var(--primary);border-color:var(--primary)}
.board-split button{font-family:var(--font)}

@keyframes dialog-in{from{opacity:0;transform:translateY(12px) scale(.985)}to{opacity:1;transform:translateY(0) scale(1)}}
@keyframes backdrop-in{from{opacity:0}to{opacity:1}}
@keyframes sheet-in{from{opacity:0;transform:translateY(24px)}to{opacity:1;transform:translateY(0)}}
@media(max-width:999px){
 :root{--app-header-height:72px}
 #app-shell:not([hidden]) + #main{scroll-padding-bottom:calc(110px + env(safe-area-inset-bottom,0px))}
 .juzi-home .work-actions .btn{scroll-margin-bottom:calc(100px + env(safe-area-inset-bottom,0px))}
 .juzi-home.pd-home,.juzi-home{padding:0 22px 100px}
 .juzi-app-header{display:flex;justify-content:space-between;gap:16px;padding-inline:22px}
 .juzi-home:is(.juzi-works,.juzi-help,.community-page-new,.juzi-earn){padding-top:28px}
 .juzi-app-header .juzi-navigation{position:fixed;inset:auto 0 0;width:100%;gap:4px;padding:5px 6px calc(6px + env(safe-area-inset-bottom,0px));border:0;border-top:1px solid var(--line);border-radius:0}
 .juzi-app-header .juzi-navigation .juzi-nav-link{position:relative;isolation:isolate;flex:1 1 0;flex-direction:column;gap:4px;max-width:150px;min-height:52px;padding:6px 4px 3px;font-size:12px;line-height:1.4;border-radius:10px}
 .juzi-app-header .juzi-navigation .juzi-nav-link svg{width:21px;height:21px}
 .juzi-app-header .juzi-navigation .juzi-nav-link:is([aria-current=page],:hover){background:transparent}
 .juzi-app-header .juzi-navigation .juzi-nav-link[aria-current=page]::before{content:"";position:absolute;top:4px;left:50%;z-index:-1;width:45px;height:25px;transform:translateX(-50%);border-radius:999px;background:var(--studio-soft)}
 .juzi-page-heading h1{font-size:36px}
 .juzi-page-heading{margin-bottom:24px}
 .juzi-home .juzi-create-card{padding:26px;gap:20px;min-height:240px;margin-bottom:28px}
 .juzi-home .work-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
 .juzi-home .studio-upload__feature-title{font-size:24px}
 .juzi-create-copy p{font-size:14px}
}
@media(max-width:800px){
 .juzi-home .juzi-create-card{grid-template-columns:1fr;gap:24px}
 .juzi-create-copy p{max-width:none}
}
@media(max-width:600px){
 .juzi-home.pd-home,.juzi-home{padding:0 18px 100px}
 .juzi-app-header{padding-inline:18px}
 .juzi-home:is(.juzi-works,.juzi-help,.community-page-new,.juzi-earn){padding-top:26px}
 .juzi-brand{gap:8px}.juzi-brand .juzi-mark{width:36px;height:36px}.juzi-brand .pd-home__name{font-size:16px}
 .juzi-import{font-size:13px;padding:8px 13px;min-height:42px}.juzi-import svg{width:17px;height:17px}
 .juzi-page-heading{gap:8px;align-items:center;margin-bottom:22px}
 .juzi-page-heading h1{font-size:36px;line-height:1.2;margin-bottom:9px}
 .juzi-page-heading p,.juzi-home .pd-home__usage-line{font-size:13px;max-width:230px;line-height:1.65}
 .juzi-home .pd-home__header-action{padding:8px 12px;gap:4px;min-height:44px;flex-shrink:0}.juzi-home .pd-home__header-action-text{font-size:12px}.pd-home__header-action svg{width:15px;height:15px}
 .juzi-home .juzi-create-card{grid-template-columns:1fr;gap:24px;padding:22px 18px;border-radius:24px;min-height:234px;margin-bottom:26px}
 .juzi-eyebrow{font-size:11px;margin-bottom:7px}
 .juzi-home .studio-upload__feature-title{font-size:23px;white-space:nowrap;margin-bottom:8px}
 .juzi-create-copy p{font-size:14px;line-height:1.7;margin-bottom:16px;max-width:none}
 .juzi-create-button{min-width:125px;min-height:44px;font-size:14px;padding:9px 16px}
 .juzi-file-note{font-size:11px;line-height:1.6;max-width:none;margin-top:10px}
 .home-demo{--demo-image-height:clamp(140px,44vw,172px);padding:14px;border-radius:18px}
 .home-demo-top{gap:6px;margin-bottom:14px}.home-demo-tabs{padding:3px;gap:0}.home-demo-tabs button{min-width:48px;min-height:40px;padding:8px 10px;font-size:13px}
 .home-demo-toggle{font-size:11px;padding:6px 3px}.home-demo-comparison{grid-template-columns:minmax(0,1fr) 18px minmax(0,1fr);gap:7px}.home-demo-arrow svg{width:18px;height:18px}
 .home-demo-media{border-radius:10px}.home-demo-figure figcaption{font-size:12px;margin-top:8px}.home-demo-caption{font-size:12px;min-height:38px;margin-top:10px}
 .juzi-section-heading h2{font-size:18px}.juzi-section-heading{margin-bottom:12px;gap:8px}.juzi-local-note{font-size:11px}
 .juzi-home .juzi-empty{min-height:230px;padding:24px 18px;border-radius:24px}.juzi-empty p{font-size:13px;line-height:1.8;max-width:230px}
 .juzi-home .work-grid{gap:12px}.juzi-home .work-card{border-radius:var(--radius-sm)}.work-thumbnail{padding:8px}.juzi-home .work-info{padding:12px 12px 4px}.juzi-home .work-info strong{font-size:14px}.juzi-home .work-info small{font-size:11px}
 .juzi-home .work-actions{padding:0 6px 8px;gap:0}.juzi-home .work-actions .btn{padding:7px 6px;min-height:44px;font-size:12px}
 .juzi-footer{font-size:11px;line-height:1.7;gap:8px;align-items:flex-start;padding:22px 0 0}.juzi-footer a{min-height:44px}
 .juzi-works .juzi-page-heading>.btn,.juzi-help .juzi-page-heading>.btn{font-size:13px;padding:10px 13px;flex-shrink:0}
 .juzi-help-list details{padding:0 18px}.juzi-help-list summary{font-size:15px;padding:18px 0}.juzi-help-list p{font-size:14px;padding:0 0 20px}.juzi-help-foot{gap:18px}
 dialog{width:calc(100vw - 24px);max-height:calc(100dvh - 24px);padding:24px 20px;border-radius:24px}
 dialog h2,#dialog-title{font-size:20px}
 .photo-preview-dialog[open]{position:fixed;inset:auto 0 0;margin:0;width:100%;max-width:100%;max-height:calc(100dvh - 24px);border-radius:28px 28px 0 0;animation:sheet-in var(--motion-page) var(--ease-out) both}
 .photo-preview-header{padding:22px 20px 16px;gap:12px}.photo-preview-header h2{font-size:20px;line-height:1.45;margin:0}.photo-preview-header p{font-size:13px;margin-top:7px}
 .photo-preview-body{padding:18px 20px}.photo-preview-setup{grid-template-columns:64px minmax(0,1fr);gap:12px}.photo-preview-source img{height:88px}.photo-preview-source figcaption{font-size:11px}
 .photo-preview-styles{gap:8px}.photo-preview-choice{padding:12px 9px;border-radius:14px;gap:6px}.photo-preview-choice strong{font-size:13px}.photo-preview-choice small{font-size:11px;line-height:1.7}
 .photo-preview-options legend{font-size:15px}.photo-preview-options legend span{font-size:12px;white-space:nowrap;margin-left:4px}
 .photo-preview-help{font-size:12px}.photo-preview-background{font-size:14px;margin-top:12px}
 .photo-preview-footer{padding:14px 20px calc(18px + env(safe-area-inset-bottom,0px))}.photo-preview-disclosure{font-size:11px;line-height:1.65}
 .photo-preview-actions{display:flex;gap:8px;flex-wrap:wrap}.photo-preview-actions .btn{font-size:13px;padding:10px 13px;min-height:44px}.photo-preview-actions #ai-generate-previews{flex:1}.photo-preview-actions #ai-original{margin-right:0}
 #modal:has(.bead-palette-dialog)[open]{position:fixed;inset:auto 0 0;margin:0;width:100%;max-width:100%;border-radius:28px 28px 0 0;padding:24px 20px calc(20px + env(safe-area-inset-bottom,0px));animation:sheet-in var(--motion-page) var(--ease-out) both}
 .bead-palette-dialog{max-height:55dvh}.bead-palette-dialog .bead-palette-grid{grid-template-columns:repeat(5,minmax(0,1fr));gap:9px}.bead-palette-dialog button{min-height:54px}
}
@media(max-height:480px){
 .photo-preview-dialog[open]{inset:8px 0;margin:auto;height:calc(100dvh - 16px);max-height:calc(100dvh - 16px);border-radius:18px}
 .photo-preview-header{padding:8px 14px;gap:12px}.photo-preview-header h2{font-size:17px;line-height:1.4;margin:0}.photo-preview-header p{font-size:12px;line-height:1.5;margin-top:3px}
 .photo-preview-body{flex:1;padding:12px 14px;min-height:0}
 .photo-preview-footer{padding:8px 14px}.photo-preview-submit-note{font-size:11px;margin-bottom:5px}
 .photo-preview-media{height:clamp(104px,34dvh,144px)}
 .photo-preview-notices{margin-top:12px;padding-top:12px}
}
@media(prefers-reduced-motion:reduce){dialog[open],dialog[open]::backdrop,.photo-preview-dialog[open],#modal:has(.bead-palette-dialog)[open]{animation:none}*,*::before,*::after{scroll-behavior:auto!important;transition:none!important}}
@media(forced-colors:active){*{scrollbar-color:auto}.btn,.juzi-navigation .juzi-nav-link[aria-current=page]{border:1px solid ButtonText}}
.juzi-home .work-actions{flex-wrap:wrap}
@media(max-width:600px){.juzi-home .work-actions{display:grid;grid-template-columns:1fr 1fr}.juzi-works .work-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:2px 6px}
.juzi-works .work-actions .btn{min-width:0;padding-inline:4px}
.juzi-works .work-actions [data-open]{background:var(--studio-soft);color:var(--primary)}
.juzi-works .work-actions [data-follow-work]{border-color:var(--line);color:var(--ink)}
.juzi-home .work-actions [data-delete]{grid-column:2}.juzi-home .work-actions .btn{min-width:0;padding-inline:3px;font-size:12px}}

/* Compact catalog controls shared by saved works and the public library. */
.pattern-search-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px}
.pattern-search-row input,.pattern-search-row select{
 width:100%;min-width:0;min-height:44px;padding:7px 12px;border:1px solid var(--line);
 border-radius:var(--radius-sm);background:var(--surface);color:var(--ink);font:14px/1.4 var(--font);
}
.pattern-search-row select{width:auto;padding-inline-end:8px}
.pattern-filter-row{display:flex;align-items:center;gap:4px;min-width:0;overflow-x:auto;scrollbar-width:none}
.pattern-filter-row::-webkit-scrollbar{display:none}
.pattern-filter-label{flex:none;padding-inline-end:4px;color:var(--muted);font-size:12px;white-space:nowrap}
.pattern-filter{
 position:relative;isolation:isolate;display:inline-flex;align-items:center;justify-content:center;flex:none;
 min-width:44px;min-height:44px;padding:4px 9px;border:0;border-radius:9px;
 color:var(--muted);background:transparent;font:600 13px/1.4 var(--font);white-space:nowrap;
}
.pattern-filter[aria-pressed=true]{color:var(--primary)}
.pattern-filter[aria-pressed=true]::before{
 content:"";position:absolute;inset:9px 0;z-index:-1;border:1px solid var(--studio-line);
 border-radius:999px;background:var(--studio-soft);pointer-events:none
}
.pattern-filter:focus-visible{outline-offset:-3px}
.pattern-sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}

.juzi-home.juzi-works{padding-top:14px}
.works-heading.juzi-page-heading{margin:0 0 8px;align-items:center}
.works-heading h1{margin:0}
.works-heading-tools{display:flex;align-items:center;gap:6px}
.works-heading-tools .btn{min-height:44px;white-space:nowrap;padding:5px 10px;font-size:13px}
#work-sync svg{width:18px;height:18px;flex:none}
#work-sync:is([data-sync-state=conflict],[data-sync-state=failed]){color:var(--danger)}
.works-sync-alert{
 margin:0 0 8px;padding:6px 9px;border-radius:var(--radius-sm);color:var(--danger);
 background:var(--studio-soft);font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis
}
.works-filters{display:grid;gap:3px;margin-bottom:10px}
.juzi-works .work-grid{grid-template-columns:repeat(auto-fill,minmax(min(100%,164px),1fr));gap:14px}
.juzi-works .works-card{position:relative;overflow:visible;min-width:0}
.works-card .work-open{overflow:hidden;border-radius:inherit}
.works-card .work-thumbnail{aspect-ratio:4/3;padding:8px}
.works-card .work-info{display:grid;gap:1px;padding:6px 9px 7px;min-width:0}
.works-card .work-info strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:1.45}
.works-card .work-info small{margin:0;font-variant-numeric:tabular-nums;line-height:1.45}
.works-bead-badge{
 position:absolute;top:7px;left:7px;padding:2px 7px;border-radius:999px;border:1px solid var(--line);
 color:var(--muted);background:var(--surface);font:650 11px/1.4 var(--font)
}
.works-bead-badge[data-completed=true]{color:var(--primary);border-color:var(--studio-line);background:var(--studio-soft)}
.works-card-menu summary{
 position:absolute;top:0;right:0;z-index:1;display:grid;place-items:center;list-style:none;
 width:44px;height:44px;cursor:pointer;color:var(--ink)
}
.works-card-menu summary::-webkit-details-marker{display:none}
.works-card-menu summary span{
 display:grid;place-items:center;background:var(--surface);border:1px solid var(--line);border-radius:50%;
 width:27px;height:27px;font:700 19px/1 var(--font)
}
.works-card-menu[open] summary,.works-card-options{z-index:5}
.works-card-options{
 position:absolute;top:43px;right:2px;width:min(172px,calc(100% - 4px));padding:4px;
 background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-sm);box-shadow:var(--shadow)
}
.works-card-menu:not([open]) .works-card-options{display:none}
.works-card-options button{
 display:block;width:100%;min-height:44px;padding:5px 9px;text-align:left;color:var(--ink);
 border:0;border-radius:8px;background:transparent;font:600 13px/1.4 var(--font)
}
.works-card-options button:hover,.works-card-options button:focus-visible{background:var(--studio-soft)}
.works-card-options button[data-delete]{color:var(--danger)}
@media(max-width:680px){
 .juzi-home.juzi-works{padding-top:10px}
 .works-heading.juzi-page-heading h1{font-size:26px}
 .juzi-works .work-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
 .works-card .work-info{padding:6px 8px}
 .works-filters .pattern-filter{padding-inline:7px}
}
@media(min-width:480px) and (max-width:680px){
 .juzi-works .work-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
}

.dialog-form-fields{display:flex;flex-direction:column;gap:16px;min-width:0}
.dialog-form-fields>p{margin:0}
@media(max-width:760px),(max-height:580px){
 #modal[data-dialog-form][open]{
  position:fixed;display:flex;inset-inline:0;
  inset-block:calc(var(--dialog-viewport-top,0px) + 8px) calc(var(--dialog-viewport-bottom,0px) + 8px);
  width:min(440px,calc(100vw - 24px));max-height:calc(var(--dialog-viewport-height,100dvh) - 16px);
  margin:auto;padding:0;overflow:hidden
 }
 #modal[data-dialog-form]>#dialog-content{display:flex;width:100%;min-height:0}
 #modal[data-dialog-form] .community-form{width:100%;min-height:0;gap:0}
 #modal[data-dialog-form] :is(input,textarea,select){font-size:16px}
 #modal[data-dialog-form] .community-form>#dialog-title{flex:none;margin:0;padding:14px 16px 8px;font-size:20px}
 #modal[data-dialog-form] .dialog-form-fields{
  flex:1 1 auto;min-height:0;gap:12px;padding:4px 16px 12px;
  overflow-y:auto;overscroll-behavior:contain;scroll-padding-block:8px
 }
 .dialog-form-fields>*{flex:none}
 .dialog-form-fields>.community-inline-error{padding:8px 12px}
 #modal[data-dialog-form] .community-form>.dialog-actions{
  flex:none;margin:0;padding:10px 16px calc(12px + env(safe-area-inset-bottom,0px));
  border-top:1px solid var(--line);background:var(--surface)
 }
 #modal[data-dialog-viewport-compact] .community-form>#dialog-title{padding-block:6px 4px;font-size:17px}
 #modal[data-dialog-viewport-compact] .community-form>.dialog-actions{padding-block:4px max(6px,env(safe-area-inset-bottom,0px))}
 #modal[data-dialog-viewport-compact][open]{overflow-y:auto}
}
