:root {
  color-scheme: light;
  --page: #f6f6f2;
  --paper: #fffefa;
  --ink: #242722;
  --muted: #5d625a;
  --line: #d9dcd3;
  --accent: #ac3d1b;
  --accent-pale: #f9eadd;
  font-family: "Segoe UI", Roboto, system-ui, sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--page); font-size: 14px; }
button, input, select, textarea { font: inherit; color: inherit; }
button, select, summary, label.switch { cursor: pointer; }
button { background: none; border: 0; }
button:disabled { cursor: default; opacity: .45; }
button:focus-visible, select:focus-visible, textarea:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 3px solid #126a81; outline-offset: 3px;
}
[hidden] { display: none !important; }
svg.ico { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.65; flex: 0 0 auto; }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.mast { background: var(--paper); border-bottom: 1px solid var(--line); }
.mast-inner, main { max-width: 1552px; margin: 0 auto; padding-inline: clamp(20px, 4vw, 72px); }
.mast-inner { min-height: 66px; display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 9px; letter-spacing: -.055em; font-size: 22px; font-weight: 700; }
.brand .sunmark { color: var(--accent); width: 27px; height: 27px; }
.brand .studio { font-weight: 410; margin-left: -4px; color: var(--muted); }
.head-tools, .quiet, .subtle, .file-meta, .model, .thumb-label { display: inline-flex; align-items: center; gap: 8px; }
.head-tools { gap: 18px; }
.model { font-size: 12px; font-weight: 530; color: var(--muted); }
.model .ico { width: 15px; height: 15px; }
.head-tools .quiet { border-left: 1px solid var(--line); border-radius: 0; padding-left: 18px; }
.quiet, .subtle { min-height: 38px; font-weight: 550; padding: 6px 9px; border-radius: 6px; }
.quiet:hover, .subtle:hover { background: #f0f0e9; }
main { padding-bottom: 28px; }
.page-title { display: flex; align-items: baseline; gap: 14px; margin: clamp(22px, 3.2vh, 38px) 0 20px; }
h1 { margin: 0; font-size: clamp(31px, 3.1vw, 45px); line-height: 1.06; font-weight: 610; letter-spacing: -.063em; }
.preview-tag { color: var(--muted); font-size: 12px; }
.bench { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 354px); background: var(--paper); overflow: clip; border: 1px solid #cdd0c7; border-radius: 14px; }
.canvas { min-width: 0; display: grid; grid-template-rows: auto minmax(300px, 1fr) auto; }
.canvas-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 15px; border-bottom: 1px solid var(--line); }
.seg { display: flex; align-items: center; background: #eeefe8; padding: 3px; border-radius: 7px; gap: 2px; }
.seg button { color: var(--muted); border: 1px solid transparent; border-radius: 5px; min-height: 30px; padding: 2px 12px; line-height: 1.2; font-size: 12px; font-weight: 570; }
.seg button[aria-pressed="true"] { color: var(--ink); background: var(--paper); border-color: #d9dcd2; box-shadow: 0 1px 2px #272a2115; }
.seg button:not(:disabled):hover { color: var(--ink); }
.subtle { font-size: 12px; }
.subtle .ico { width: 16px; height: 16px; }
.stage { min-width: 0; position: relative; display: grid; place-items: center; padding: clamp(16px, 2.8vh, 38px); background-color: #e9eae3; background-image: radial-gradient(#a2a79760 .85px, transparent .85px); background-size: 13px 13px; }
.stage.dragging { outline: 3px solid var(--accent); outline-offset: -4px; }
.stage img { display: block; width: auto; height: auto; object-fit: contain; max-width: 100%; max-height: clamp(360px, calc(100dvh - 270px), 780px); box-shadow: 0 2px 7px #30302422, 0 12px 30px #27291e10; }
.file-bar { min-height: 51px; min-width: 0; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; padding: 8px 18px; border-top: 1px solid var(--line); }
.file-meta { font-size: 12px; min-width: 0; }
.file-meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta .ico { height: 15px; width: 15px; color: var(--muted); }
.dim { font: 11px/1.3 "IBM Plex Mono", Consolas, monospace; color: var(--muted); font-variant-numeric: tabular-nums; }
.edit { border-left: 1px solid var(--line); padding: 23px 23px 18px; min-width: 0; }
.edit h2 { margin: 0; font-size: 19px; line-height: 1.2; letter-spacing: -.038em; font-weight: 620; }
.prompt-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.field, .switch-text strong, .advanced summary { font-size: 13px; font-weight: 610; letter-spacing: -.012em; }
.block { display: block; margin-top: 15px; }
textarea, select, input[type="password"], input[type="number"] { border: 1px solid #c9cdc2; border-radius: 7px; background: #fff; width: 100%; }
textarea { min-height: 75px; display: block; resize: vertical; padding: 11px 12px; font-size: 13px; line-height: 1.55; margin-top: 7px; }
.starters { display: flex; flex-wrap: wrap; gap: 4px 5px; margin-top: 7px; }
.starters button { border: 1px solid var(--line); background: #f8f8f3; border-radius: 5px; font-size: 11px; min-height: 27px; padding: 2px 7px; color: #4d5348; }
.starters button:hover { border-color: #929889; }
.references { font-size: 12px; min-height: 29px; display: inline-flex; align-items: center; gap: 6px; padding-inline: 0; color: var(--muted); }
.references .ico { width: 15px; height: 15px; }
.switch { display: flex; align-items: center; gap: 12px; justify-content: space-between; position: relative; min-height: 42px; }
.switch-text { display: grid; gap: 3px; }
.secondary, .note { color: var(--muted); font-size: 12px; line-height: 1.45; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.track { width: 33px; height: 20px; background: #787d74; padding: 3px; display: flex; align-items: center; border-radius: 99px; flex: 0 0 auto; }
.track::after { content: ""; display: block; width: 14px; height: 14px; border-radius: 50%; background: white; box-shadow: 0 1px 3px #0002; }
.switch input:checked + .track { background: var(--ink); }
.switch input:checked + .track::after { transform: translateX(13px); }
.switch input:focus-visible + .track { outline: 3px solid #126a81; outline-offset: 3px; }
.compose { margin: 9px 0 15px; }
.output { border-top: 1px solid var(--line); padding-top: 16px; }
.output-heading, .resolved { display: flex; justify-content: space-between; align-items: center; gap: 7px; }
.output-heading h3 { font-size: 16px; font-weight: 625; letter-spacing: -.035em; margin: 0; }
.caption { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 11px; }
.caption .ico { width: 13px; height: 13px; }
.sizes { margin-top: 6px; }
.sizes button { flex: 1; padding-inline: 4px; }
.resolved { margin-top: 6px; font: 11px/1.45 "IBM Plex Mono", Consolas, monospace; color: var(--muted); }
select, input[type="number"], input[type="password"] { min-height: 35px; padding: 6px 9px; font-size: 13px; margin-top: 6px; }
select { padding-right: 26px; }
.advanced { margin: 10px 0 12px; }
.advanced summary { list-style: none; display: flex; align-items: center; justify-content: space-between; min-height: 34px; color: #50554c; font-size: 12px; }
.advanced summary::-webkit-details-marker { display: none; }
.advanced summary .ico { width: 15px; height: 15px; }
.advanced[open] summary .ico { transform: rotate(180deg); }
.advanced-body { padding: 0 0 12px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.advanced .block { margin-top: 9px; }
.primary { background: var(--accent); color: #fffdf7; border: 1px solid var(--accent); border-radius: 7px; min-height: 44px; padding: 9px 16px; font-weight: 625; display: inline-flex; align-items: center; justify-content: center; gap: 9px; }
.primary:hover { background: #963619; }
#generate { width: 100%; }
.after-action { min-height: 22px; margin-top: 7px; display: flex; justify-content: center; align-items: center; gap: 5px; color: var(--muted); font-size: 11px; }
.after-action .ico { width: 13px; height: 13px; }
.notice { margin: 10px 0 0; line-height: 1.5; font-size: 12px; color: #79401f; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
dialog { width: min(440px, calc(100% - 28px)); padding: 23px; border: 1px solid var(--line); border-radius: 13px; background: var(--paper); color: var(--ink); box-shadow: 0 20px 90px #161e1b33; }
dialog::backdrop { background: #1c251e69; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; }
.dialog-head h2 { font-size: 23px; letter-spacing: -.045em; margin: 0; }
fieldset { min-width: 0; border: 0; margin: 0; padding: 0; }
.empty { text-align: center; padding: 18px; }
.empty-icon { width: 61px; height: 61px; margin: 0 auto 16px; display: grid; place-items: center; border: 1px solid #c2c7b9; border-radius: 13px; color: #67715f; background: #f3f3ec; }
.empty-icon .ico { width: 31px; height: 31px; stroke-width: 1.3; }
.empty h2 { font-size: clamp(21px, 2.4vw, 29px); font-weight: 580; letter-spacing: -.045em; margin: 0; }
.empty p { color: var(--muted); font-size: 13px; margin: 7px 0 18px; }
.empty small { display: block; font-size: 11px; color: #585e51; margin: 11px 0 0; }
.choose { min-height: 38px; padding: 8px 15px; border-radius: 6px; border: 1px solid #31372d; background: #30362e; color: #fffefa; font-weight: 550; }
.choose:hover { background: #20241f; }
.file-actions, .dialog-footer, .key-actions { display: flex; align-items: center; gap: 8px; }
a.subtle { color: var(--ink); text-decoration: none; }
a.subtle:focus-visible { outline: 3px solid #126a81; outline-offset: 2px; }
.key-actions { justify-content: flex-start; flex-wrap: wrap; }
.dialog-footer { margin-top: 18px; justify-content: space-between; }
.dialog-footer .primary { margin-top: 0; float: none; }
.reference-list { display: grid; gap: 6px; margin-top: 10px; max-height: 175px; overflow: auto; }
.reference-row { display: grid; grid-template-columns: 34px minmax(0,1fr) 34px; gap: 9px; align-items: center; background: #f3f3ec; border: 1px solid var(--line); border-radius: 6px; padding: 4px 5px; }
.reference-row img { width: 34px; height: 34px; object-fit: contain; background: #e8e9e1; border-radius: 3px; }
.reference-row span { min-width: 0; }
.reference-row strong, .reference-row small { display: block; font-size: 11px; line-height: 1.4; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.reference-row small { color: var(--muted); font-size: 10px; }
.reference-row button { border-radius: 4px; min-height: 34px; font-size: 18px; }
.reference-row button:hover { background: #e6e6dc; }
.text-button { font-size: 11px; color: var(--muted); padding: 2px; }
.text-button:hover { text-decoration: underline; }
.setup-key { display: block; margin: 6px auto 0; font-size: 12px; color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.notice[data-tone="ok"] { color: #35583a; }
.notice[data-tone="progress"] { color: var(--muted); }
.signin-main { min-height: calc(100dvh - 70px); display: grid; place-content: center; }
.signin { width: min(362px, calc(100vw - 38px)); background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 30px; }
.signin h1 { font-size: 30px; margin-bottom: 22px; }
.signin .primary { width: 100%; margin-top: 17px; }
.signin input { min-height: 42px; }
.signin .notice:empty { display: none; }
.canvas:has(.empty:not([hidden])) .stage { min-height: 394px; }
dialog p { line-height: 1.5; }
dialog .switch { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 13px; }
dialog .primary { margin-top: 18px; float: right; }
@media (min-width: 1450px) { .bench { grid-template-columns: minmax(0, 1fr) 382px; } .edit { padding-inline: 28px; } }
@media (max-width: 920px) and (min-width: 761px) { .mast-inner, main { padding-inline: 18px; } .bench { grid-template-columns: minmax(0, 1fr) 314px; } .edit { padding-inline: 16px; } }
@media (max-width: 760px) {
  .mast-inner, main { padding-inline: 16px; } .mast-inner { min-height: 58px; } .head-tools { gap: 0; } .model { display: none; } .head-tools .quiet { border: none; padding-left: 9px; }
  .bench { grid-template-columns: minmax(0, 1fr); } .edit { border-left: 0; border-top: 1px solid var(--line); padding: 20px; }
  .page-title { margin: 22px 0 15px; } .canvas { grid-template-rows: auto auto auto; } .stage { padding: 16px; }
  .stage img { max-height: min(45dvh, 430px); max-width: 100%; } .canvas-bar { padding: 5px 9px; }
  .file-bar { min-height: 46px; padding: 6px 11px; } .brand { font-size: 20px; }
  .seg button, .starters button, .quiet, .subtle, .references, select, .advanced summary { min-height: 44px; }
  .starters { gap: 5px; } .switch { min-height: 48px; } .stage { min-height: 185px; } .model-mobile { display: inline; }
}
@media (max-width: 390px) { .preview-tag { font-size: 11px; } .canvas-bar { gap: 4px; } .seg button { padding-inline: 8px; } .sizes button { padding-inline: 3px; } .edit { padding-inline: 14px; } }
@media (max-width: 760px) {
  .canvas:has(.empty:not([hidden])) .stage { min-height: 242px; }
  .choose, .setup-key, .text-button, .reference-row button { min-height: 44px; }
  .reference-row { grid-template-columns: 34px minmax(0,1fr) 44px; }
}
