/* Layout and component shell. Tokens and motion patterns are kept in separate local files. */
*{box-sizing:border-box}
html{min-width:320px;background:#f5f5f7;color-scheme:light;scroll-behavior:smooth}
body{margin:0;min-height:100vh;min-height:100dvh;display:flex;flex-direction:column;background:var(--ft-color-surface-page);color:var(--ft-color-text-body);font:400 14px/1.6 var(--ft-font-family)}
button,input,select{font:inherit}
button,a,input,select{touch-action:manipulation}
button{cursor:pointer}
a{color:var(--ft-color-action-primary);text-decoration:none}
button,input,select{border-radius:var(--ft-radius-input)}
button{transition:background-color 180ms ease,color 180ms ease,border-color 180ms ease,box-shadow 180ms ease,transform 120ms ease}
button:disabled{cursor:not-allowed}
[hidden]{display:none!important}
h1,h2,h3,p{margin:0}
h1,h2,h3{color:var(--ft-color-text-heading)}
.sr-only,.skip-link:not(:focus){position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
.skip-link:focus{position:fixed;z-index:10;top:8px;left:16px;padding:10px 16px;background:#fff;border-radius:8px}
.site-header{background:#fff;border-bottom:1px solid var(--ft-color-surface-divider)}
.header-inner{max-width:var(--ft-layout-container-including-padding);min-height:64px;margin:auto;display:flex;align-items:center;gap:32px;padding:10px 42px}
.brand{display:inline-flex;align-items:center;gap:8px;white-space:nowrap;flex:0 0 auto;border-radius:6px;color:#111;font-size:16px;font-weight:750;letter-spacing:-.35px}
.brand img{width:30px;height:30px;object-fit:contain}
.tool-nav{display:flex;align-items:center;gap:24px;margin-right:auto}
.tool-nav a{position:relative;min-height:44px;display:inline-flex;align-items:center;white-space:nowrap;color:var(--ft-color-text-secondary);font-size:16px;font-weight:400;border-radius:4px;transition:color 180ms ease}
.tool-nav a[aria-current=page]{color:var(--ft-color-action-primary);font-weight:700}
.tool-nav a::after{content:"";position:absolute;left:50%;bottom:3px;width:20px;height:2px;border-radius:99px;background:currentColor;opacity:0;transform:translateX(-50%) scaleX(.6);transition:opacity 180ms ease,transform 180ms ease}
.tool-nav a[aria-current=page]::after{opacity:1;transform:translateX(-50%) scaleX(1)}
.header-actions{display:flex;align-items:center;gap:18px;margin-left:auto}
.language-switch{display:flex;align-items:center;gap:0;width:120px;height:36px;padding:3px;border:1px solid #cfe5ff;border-radius:999px;background:#eaf3ff}
.language-switch button{flex:1;height:28px;min-width:0;border:0;padding:0 8px;border-radius:999px;color:#2871c9;background:transparent;font-size:14px;font-weight:400;position:relative}
.language-switch button::before{content:"";position:absolute;inset:-8px 0}
.language-switch button[aria-pressed=true]{background:#3479df;color:#fff;box-shadow:0 1px 3px #1863b429}
.author-link{display:flex;align-items:center;gap:7px;min-height:44px;color:var(--ft-color-text-secondary);font-size:14px;white-space:nowrap;border-radius:6px}
.brand{min-height:44px}
.author-avatar{position:relative;width:24px;height:24px;flex:0 0 24px;border-radius:50%;overflow:hidden;background:#eaf3ff}
.author-avatar img{position:absolute;width:215.24%;height:auto;max-width:none;left:-9.5268%;top:-9.5268%}
.page-shell{width:100%;max-width:var(--ft-layout-container-including-padding);margin:0 auto;padding:32px 42px 40px;flex:1;outline:none}
.page-heading{display:flex;align-items:center;gap:12px 16px;flex-wrap:wrap;margin-bottom:16px}
.page-heading h1{font-size:26px;line-height:32px;letter-spacing:-.5px;font-weight:700}
.help-button{min-height:32px;padding:6px 12px;border:1px solid #e0e2e7;border-radius:8px;background:#e9ebef;color:#626975;font-size:12px;font-weight:400;line-height:18px}
.example-badge{padding:3px 8px;background:var(--ft-color-surface-blue-soft);color:var(--ft-color-semantic-info);font-size:11px;border-radius:6px;white-space:nowrap}
.demo-toolbar{display:flex;align-items:center;gap:8px 12px;flex-wrap:wrap;margin-bottom:16px;color:var(--ft-color-text-secondary);font-size:12px}
.demo-toolbar label{font-weight:600;color:var(--ft-color-text-heading)}
.demo-toolbar select{min-height:36px;padding:6px 30px 6px 10px;max-width:100%;background:#fff;border:1px solid var(--ft-color-field-border);color:var(--ft-color-text-body)}
.demo-toolbar p{flex:1;min-width:220px}
.tool-workspace{display:grid;grid-template-columns:minmax(0,7fr) minmax(300px,3fr);gap:16px;align-items:start}
.tool-card{min-width:0;padding:24px;border:1px solid #e8e8ed;border-radius:22px;background:#fff;box-shadow:var(--ft-shadow-card)}
.card-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:18px}
.card-heading h2{font-size:16px;line-height:24px;font-weight:650}
.state-badge,.format-chip{display:inline-flex;align-items:center;min-height:24px;padding:3px 9px;border-radius:99px;line-height:18px;font-size:11px;white-space:nowrap}
.state-badge{background:#f5f5f7;color:var(--ft-color-text-secondary)}
.state-badge[data-state=ready],.state-badge[data-state=processing],.format-chip{color:var(--ft-color-semantic-info);background:var(--ft-color-semantic-info-surface)}
.state-badge[data-state=success]{color:var(--ft-color-semantic-success);background:var(--ft-color-semantic-success-surface)}
.state-badge[data-state=error]{color:var(--ft-color-semantic-error);background:var(--ft-color-semantic-error-surface)}
.format-chip{font-weight:650;font-size:11px;letter-spacing:.2px}
.preview-stage{height:440px;position:relative;display:grid;place-items:center;border:1px solid var(--ft-color-surface-blue-line);border-radius:16px;background:var(--ft-color-surface-blue-soft);overflow:hidden;transition:background-color 180ms ease,border-color 180ms ease}
.preview-stage.is-dragging{background:#deedff;border-color:var(--ft-color-action-primary);box-shadow:inset 0 0 0 1px var(--ft-color-action-primary)}
.empty-content{width:100%;padding:24px;text-align:center}
.empty-art{width:120px;height:90px;margin:0 auto 16px;display:block;object-fit:contain}
.empty-content h3{font-size:16px;line-height:24px;font-weight:600;margin-bottom:8px}
.empty-content p{font-size:12px;line-height:20px;color:var(--ft-color-text-secondary)}
.empty-content .button{margin-top:24px;min-width:160px}
.button{display:inline-flex;justify-content:center;align-items:center;gap:6px;min-height:44px;max-width:100%;border:1px solid transparent;padding:10px 16px;border-radius:8px;font-size:14px;font-weight:500;line-height:22px;text-align:center}
.primary{background:var(--ft-color-action-primary);color:#fff;box-shadow:0 7px 18px rgba(0,113,227,.12)}
.primary:active:not(:disabled):not([aria-busy=true]){background:var(--ft-color-action-pressed);transform:translateY(1px);box-shadow:none}
.secondary{background:#eef0f3;color:#626975;border-color:#e0e2e7}
.replace{background:var(--ft-color-action-replace);color:#fff;padding-inline:12px;font-size:12px;white-space:nowrap}
.replace:active:not(:disabled){background:var(--ft-color-action-replace-pressed);transform:translateY(1px)}
.button:disabled{background:var(--ft-color-disabled-surface);color:var(--ft-color-disabled-text);border-color:var(--ft-color-disabled-border);box-shadow:none;transform:none;opacity:1}
.loaded-content{width:100%;height:100%;padding:24px;display:grid;place-items:center}
.loaded-content>img{max-width:100%;max-height:100%;width:auto;height:auto;display:block;object-fit:contain;border-radius:8px}
.page-shell:not([data-state=empty]) .preview-stage{height:auto;min-height:280px}
.page-shell:not([data-state=empty]) .loaded-content{height:auto;min-height:280px}
.page-shell:not([data-state=empty]) .loaded-content>img{max-height:min(70svh,640px)}
.preview-placeholder{width:min(100%,360px);min-height:230px;position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;text-align:center;color:var(--ft-color-semantic-info);border:1px dashed #8ab9eb;border-radius:16px;background:rgba(255,255,255,.72);padding:20px}
.preview-placeholder strong{font-size:15px;font-weight:600}
.preview-placeholder>span:last-child{font-size:12px;color:var(--ft-color-text-secondary)}
.placeholder-art{display:block;width:160px;height:90px;margin-bottom:8px;object-fit:contain}
.source-bar{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-top:16px;padding-top:16px;border-top:1px solid var(--ft-color-surface-divider)}
.source-copy{min-width:0}
.source-copy strong{display:block;max-width:100%;overflow-wrap:anywhere;font-size:12px;font-weight:600;color:var(--ft-color-text-body)}
.source-copy span{font-size:11px;line-height:18px;color:var(--ft-color-text-muted)}
.processing-overlay{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:20px;text-align:center;background:rgba(234,243,255,.94)}
.processing-overlay strong{font-size:16px;color:var(--ft-color-text-heading);font-weight:600}
.processing-overlay>span:not(.ft-spinner){font-size:12px;color:var(--ft-color-text-secondary)}
.processing-overlay .button{margin-top:10px}
.processing-overlay .ft-spinner{margin-bottom:4px}
.privacy-note{display:flex;align-items:center;justify-content:center;gap:7px;margin-top:20px;font-size:11px;line-height:18px;color:var(--ft-color-text-muted);text-align:center}
.privacy-note>span:first-child{width:6px;height:6px;flex:0 0 6px;border-radius:50%;background:#52aa88}
.inline-notice{margin-top:16px;padding:12px 14px;border-radius:10px;font-size:12px;line-height:20px;overflow-wrap:anywhere}
.error-notice{background:var(--ft-color-semantic-error-surface);color:var(--ft-color-semantic-error)}
.field-group{margin-bottom:20px}
.parameter-block{margin-top:20px;margin-bottom:0;padding-top:20px;border-top:1px solid var(--ft-color-surface-divider)}
.parameter-block input{max-width:360px}
.field-group label{display:block;font-size:12px;line-height:18px;font-weight:600;color:var(--ft-color-text-heading);margin-bottom:8px}
.field-group input{display:block;width:100%;min-height:44px;padding:10px 12px;background:#fff;border:1px solid var(--ft-color-field-border);color:var(--ft-color-text-body);font-size:14px;line-height:22px}
.field-group input:disabled{background:var(--ft-color-disabled-surface);color:var(--ft-color-disabled-text);border-color:var(--ft-color-disabled-border)}
.field-hint{margin-top:8px;font-size:12px;line-height:20px;color:var(--ft-color-text-secondary)}
.output-result{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;min-height:190px;margin-bottom:20px;padding:16px;border:1px dashed #d1d7e0;border-radius:12px;background:#fafbfd;text-align:center}
.result-art{display:block;width:120px;height:90px;object-fit:contain}
.result-skeleton{width:100%;max-width:240px;display:grid;gap:10px;margin-bottom:8px}
.result-skeleton .ft-skeleton{width:100%;height:84px}
.result-skeleton .ft-skeleton-line:last-child{width:65%}
.output-result strong{font-size:13px;font-weight:600;color:var(--ft-color-text-secondary);overflow-wrap:anywhere}
.output-result>span{font-size:12px;line-height:20px;color:var(--ft-color-text-muted)}
.output-result .button{display:none;width:100%;margin-top:8px;font-size:12px;line-height:18px}
[data-state=success] .output-result{border-style:solid;border-color:#d0e8dd;background:#f6fcf9}
[data-state=success] .output-result .button{display:flex}
.generate-button{width:100%}
.action-hint{font-size:11px;line-height:18px;color:var(--ft-color-text-secondary);text-align:center;margin-top:10px}
.site-footer{border-top:1px solid var(--ft-color-surface-divider);background:#fff;padding:4px 42px;color:var(--ft-color-text-muted);font-size:12px}
.site-footer>div{max-width:1356px;margin:auto;min-height:40px;display:flex;align-items:center;gap:12px 24px;flex-wrap:wrap}
.site-footer>div>span:nth-child(2){margin-right:auto}
.site-footer a{min-height:40px;display:inline-flex;align-items:center;color:var(--ft-color-text-muted);border-radius:4px}
.help-dialog{width:min(480px,calc(100vw - 32px));max-height:calc(100dvh - 32px);margin:auto;padding:24px;border:0;border-radius:20px;background:#fff;color:var(--ft-color-text-body);box-shadow:var(--ft-shadow-dialog);overflow:auto;overscroll-behavior:contain}
.dialog-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:18px}
.dialog-heading h2{font-size:20px;line-height:28px}
.dialog-heading .button{flex:0 0 auto;font-size:12px;padding-inline:12px}
.help-dialog p{font-size:14px;line-height:24px;margin-top:16px}
.help-dialog .field-hint{font-size:12px;line-height:20px}
.dialog-note{background:#f5f6f8;padding:12px 14px;border-radius:10px;color:var(--ft-color-text-secondary)}
@media(hover:hover) and (pointer:fine){
 .tool-nav a:hover,.author-link:hover,.site-footer a:hover{color:var(--ft-color-action-primary)}
 .help-button:hover,.secondary:hover{background:#eaf3ff;border-color:#cfe5ff;color:var(--ft-color-action-primary)}
 .replace:hover:not(:disabled){background:var(--ft-color-action-replace-hover)}
 .language-switch button:not([aria-pressed=true]):hover{background:#dcecff}
 .field-group input:hover:not(:focus):not(:disabled):not([aria-invalid=true]),.demo-toolbar select:hover:not(:focus):not(:disabled){border-color:var(--ft-color-field-hover)}
}
/* Component hover styles end here; keep focus precedence explicit. */
.ft-ui :where(input:not([type=file]),select):focus{border-color:var(--ft-color-field-focus);outline:none;box-shadow:0 0 0 2px rgba(0,113,227,.08)}
.ft-ui :where(input:not([type=file]),select):focus-visible{outline:2px solid var(--ft-color-field-focus);outline-offset:2px;box-shadow:none}
html[data-input-modality=pointer] .ft-ui :where(input:not([type=file]),select):focus{outline:none;box-shadow:0 0 0 2px rgba(0,113,227,.08)}
.ft-ui input[aria-invalid=true],.ft-ui input[aria-invalid=true]:focus{border-color:var(--ft-color-field-error);box-shadow:none}
@media(max-width:1100px){.header-inner{gap:24px;padding-inline:24px}.page-shell{padding-inline:24px}.header-actions{gap:12px}.site-footer{padding-inline:24px}}
@media(max-width:900px){
 .header-inner{flex-wrap:wrap;gap:0 20px;padding-block:8px}
 .tool-nav{order:3;width:100%;gap:24px;margin-top:4px}
 .header-actions{margin-left:auto}
 .tool-workspace{grid-template-columns:minmax(0,1fr)}
 .output-card{width:100%}
 .preview-stage{height:400px}
 .output-result{min-height:150px}
}
@media(max-width:540px){
 .header-inner{display:grid;grid-template-columns:minmax(0,1fr) 100px 44px;gap:4px 8px;padding:8px 16px}
 .brand{grid-row:1;grid-column:1;font-size:15px;gap:6px;letter-spacing:-.5px}
 .brand img{width:26px;height:26px}
 .header-actions{display:contents}
 .language-switch{grid-row:1;grid-column:2;width:100px;height:36px}
 .author-link{grid-row:1;grid-column:3;justify-content:center;width:44px;height:44px}
 .author-label{position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
 .tool-nav{grid-row:2;grid-column:1/-1;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:0}
 .tool-nav a{justify-content:center;font-size:16px}
 .page-shell{padding:24px 16px}
 .page-heading{gap:8px;margin-bottom:14px}
 .page-heading h1{font-size:22px;line-height:28px;letter-spacing:0}
 .help-button{min-height:44px;padding:10px 12px}
 .demo-toolbar{gap:8px;margin-bottom:16px}
 .demo-toolbar select{min-height:44px;font-size:16px}
 .demo-toolbar p{flex-basis:100%;min-width:0}
 .tool-card{padding:16px;border-radius:18px}
 .tool-workspace{gap:14px}
 .card-heading{margin-bottom:14px;gap:8px}
 .preview-stage{height:320px;height:clamp(280px,48svh,360px)}
 .empty-content{padding:20px 12px}
 .empty-content h3{font-size:15px}
 .empty-art,.result-art{width:96px;height:72px}
 .placeholder-art{width:128px;height:72px}
 .loaded-content{padding:16px}
 .preview-placeholder{min-height:210px;padding:12px}
 .source-bar{gap:12px}
 .field-group input{font-size:16px;line-height:24px}
 .output-result{min-height:160px}
 .site-footer{padding:4px 16px}
 .site-footer>div{gap:0 16px;display:grid;grid-template-columns:1fr auto}
 .site-footer>div>span:nth-child(2){grid-column:1/-1;grid-row:2;line-height:28px}
 .site-footer a{grid-column:2;grid-row:1;min-height:44px}
 .help-dialog{padding:20px;max-height:calc(100dvh - 24px)}
 .dialog-heading{gap:12px;margin-bottom:12px}
 .dialog-heading h2{font-size:18px;line-height:26px}
}
@media(max-width:350px){.header-inner{column-gap:4px}.brand{font-size:14px;gap:4px}.brand img{width:24px;height:24px}.example-badge{font-size:10px}}
@media(pointer:coarse){.help-button{min-height:44px}.demo-toolbar select{min-height:44px;font-size:16px}}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}.ft-ui *, .ft-ui *::before,.ft-ui *::after{animation:none!important;transition:none!important}}
@media(forced-colors:active){.button,.preview-stage,.tool-card,.example-badge,.state-badge,.format-chip{border:1px solid CanvasText}.ft-ui :is(button,a,input,select,[tabindex]):focus-visible{outline:2px solid Highlight!important;outline-offset:2px;box-shadow:none!important}}
