/* Luma — light, quiet, and focused. */
:root {
  color-scheme: light;
  --bg: #edf3ef;
  --surface: #ffffffc9;
  --line: #b7cbbf;
  --control-line: #789584;
  --text: #182f25;
  --muted: #40594b;
  --accent: #176b4c;
  --accent-soft: #dceee2;
  --hover-surface: #edf6f0;
  --press-surface: #e1eee6;
  --focus-ring: #176b4c;
  --danger: #9f3c34;
  --motion-fast: 140ms;
  --motion-standard: 180ms;
  --motion-ease: cubic-bezier(.2,.7,.25,1);
  --sidebar-width: 204px;
  --page-gutter: 32px;
  font-family: Inter, "Segoe UI", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
}
* { box-sizing: border-box; }
html { cursor: default; scroll-padding-top: 88px; scrollbar-gutter: stable; }
body { margin: 0; min-width: 0; background: radial-gradient(ellipse at 18% 15%, #cce5d8aa, transparent 48%), radial-gradient(ellipse at 92% 75%, #d9dff3bb, transparent 50%), var(--bg); background-attachment: fixed; color: var(--text); font-size: 15px; line-height: 1.5; }
input:not([type=checkbox]):not([type=range]), textarea { cursor: text; }
button, input, textarea, select { font: inherit; }
button, a, label.upload-zone { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; color: inherit; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { outline-offset: 4px; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible, label.upload-zone:focus-visible, .canvas:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 4px;
}
[hidden] { display: none !important; }
.legal-gate { position: relative; z-index: 2; min-height: 100vh; min-height: 100dvh; display: grid; align-items: center; padding: 28px 20px; }
.legal-card { width: min(760px,100%); margin: auto; padding: 30px; border: 1px solid #a8c4b4; border-radius: 22px; background: #fcfefdf5; box-shadow: 0 18px 70px #25463218; backdrop-filter: blur(20px); }
.legal-heading { display: flex; justify-content: space-between; flex-wrap: wrap; align-items: center; gap: 8px 20px; color: #486454; font-size: 12px; }
.legal-brand { color: #1b573c; font-size: 24px; font-weight: 700; letter-spacing: -.5px; }
.legal-card h1 { margin: 18px 0 8px; font-size: clamp(23px,4vw,30px); letter-spacing: -.6px; color: #163e2a; }
.legal-card h1:focus { outline: none; }
.legal-intro { margin: 0 0 17px; color: #40584a; font-size: 14px; line-height: 1.8; }
.legal-highlights { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.legal-highlights span { padding: 6px 10px; border: 1px solid #c1d9ca; border-radius: 7px; background: #e9f4ed; color: #24563b; font-size: 12px; }
.legal-body { max-height: min(38vh,330px); max-height: min(38dvh,330px); overflow-y: auto; padding: 4px 18px 12px; border: 1px solid #c1d2c7; border-radius: 12px; background: #f7faf8; scrollbar-width: thin; scroll-padding: 12px; }
.legal-body section + section { border-top: 1px solid #d6e2db; padding-top: 4px; }
.legal-body h2 { margin: 15px 0 7px; font-size: 15px; color: #204d35; }
.legal-body p { margin: 8px 0 14px; font-size: 13px; line-height: 1.9; color: #344c3e; overflow-wrap: anywhere; }
.legal-important { padding: 12px; border-left: 3px solid #a16c2e; background: #fcf5e9; color: #61451f; border-radius: 4px; }
.legal-sources { margin-top: 17px; border-top: 1px solid #cbdcd0; padding-top: 12px; }
.legal-sources summary { min-height: 32px; cursor: pointer; font-size: 13px; color: #245e40; }
.legal-sources ul { padding-left: 18px; margin: 8px 0; }
.legal-sources li { margin: 12px 0; font-size: 12px; line-height: 1.8; }
.legal-sources a { text-decoration: underline; text-underline-offset: 3px; color: #185d3d; }
.legal-sources small { display: block; color: #506258; }
.legal-actions { margin-top: 20px; }
.legal-check { display: flex; gap: 10px; align-items: flex-start; min-height: 44px; font-size: 13px; line-height: 1.8; color: #233f2e; cursor: pointer; }
.legal-check input { flex: 0 0 auto; width: 19px; height: 19px; margin: 3px 0; accent-color: #176b4c; cursor: pointer; }
.legal-buttons { display: grid; grid-template-columns: 1fr 1.8fr; gap: 12px; margin-top: 12px; }
.legal-buttons button { min-height: 46px; margin: 0; }
.legal-buttons button:disabled { cursor: not-allowed; opacity: 1; background: #e1e9e4; border-color: #c2cfc7; color: #52665a; box-shadow: none; }
.legal-session-note { margin: 12px 0 0; font-size: 11px; line-height: 1.8; color: #52665a; }
.legal-status { margin: 12px 0 0; font-size: 13px; line-height: 1.8; color: #874b20; }
.legal-status:empty { display: none; }
.legal-return { min-height: 44px; margin-top: 18px; }
@media (max-width: 540px) {
 .legal-gate { padding: 16px 12px max(16px,env(safe-area-inset-bottom)); align-items: start; }
 .legal-card { padding: 20px 16px; border-radius: 17px; }
 .legal-heading { gap: 6px; font-size: 11px; }
 .legal-brand { font-size: 22px; }
 .legal-body { padding: 0 12px 8px; max-height: 40vh; max-height: 40dvh; }
 .legal-highlights { gap: 6px; }
 .legal-highlights span { padding: 5px 7px; font-size: 11px; }
 .legal-buttons { gap: 8px; grid-template-columns: 1fr 1.6fr; }
 .legal-buttons button { padding: 10px; font-size: 13px; }
}
button:disabled { cursor: wait; opacity: .55; }
.ambient {
  position: fixed; inset: 0; pointer-events: none;
  background: radial-gradient(420px circle at var(--mx,78%) var(--my,15%), #40b58947, transparent 72%);
}
.ambient::before {
  content: ""; position: absolute; width: 560px; height: 460px; right: 6%; top: 4%;
  background: radial-gradient(ellipse, #b5c5ec66, transparent 70%);
}
.cursor-halo { position: fixed; top: 0; left: 0; z-index: 20; width: 32px; height: 32px; border: 2px solid #176b4ccf; border-radius: 50%; background: #78caa51a; box-shadow: 0 0 0 5px #65b88e26, 0 0 28px #2c996a59; pointer-events: none; opacity: 0; transform: translate3d(var(--pointer-x,-100px),var(--pointer-y,-100px),0) translate(-50%,-50%); }
body.pointer-visible .cursor-halo { opacity: 1; }
.app-shell { position: relative; min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 204px; z-index: 5;
  display: flex; flex-direction: column; padding: 28px 16px 20px;
  border-right: 1px solid #aec6b8; background: #ffffffad; backdrop-filter: blur(26px) saturate(145%); box-shadow: 8px 0 30px #214b3505;
}
.brand { display: flex; align-items: center; gap: 9px; margin: 0 12px 40px; font-size: 30px; font-weight: 700; letter-spacing: -1.6px; }
.brand-symbol { color: var(--accent); font-size: 33px; line-height: 1; font-weight: 400; }
.brand-dot { color: var(--accent); margin-left: -7px; }
.nav-caption { font-size: 12px; color: var(--muted); margin: 0 13px 12px; letter-spacing: 1px; }
nav { display: grid; gap: 7px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; min-height: 44px;
  border: 1px solid transparent; border-radius: 10px; padding: 0 13px;
  background: transparent; color: var(--muted); text-align: left; font-size: 15px; font-weight: 600;
  transition: background var(--motion-standard), color var(--motion-standard), box-shadow var(--motion-standard);
}
.nav-item > span { width: 20px; text-align: center; font-size: 18px; }
.nav-item:hover:not(:disabled) { background: #eaf3ed; color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; box-shadow: inset 0 0 0 1px #aacdb9; }
.nav-item i { font-style: normal; font-size: 12px; margin-left: auto; color: var(--muted); }
.sidebar-bottom { margin-top: auto; padding-top: 30px; }
.account-card {
  display: flex; gap: 10px; align-items: center; width: 100%; margin-top: 18px;
  padding: 18px 6px 0; border: 0; border-top: 1px solid var(--line);
  background: transparent; text-align: left; font-size: 14px;
}
.workspace-avatar { display: grid; place-items: center; width: 33px; height: 33px; border-radius: 10px; background: #eaf2ec; color: var(--accent); flex-shrink: 0; }
.account-card small { display: block; margin-top: 5px; font-size: 12px; color: var(--muted); }
.account-card small b { font-weight: 500; }
.account-arrow { margin-left: auto; color: var(--muted); }
main { margin-left: var(--sidebar-width); padding: 0 var(--page-gutter); min-width: 0; }
main > .topbar, main > .view, main > .activity-strip, main > footer { width: 100%; max-width: 1240px; margin-left: auto; margin-right: auto; }
.topbar {
  height: 64px; display: flex; justify-content: space-between; align-items: center; gap: 15px;
  border: 0; background: transparent;
  position: sticky; top: 0; z-index: 4; isolation: isolate;
}
.breadcrumb { font-size: 14px; color: var(--muted); }
.breadcrumb span { color: var(--muted); margin: 0 11px; }
.breadcrumb strong { color: var(--muted); font-weight: 500; }
.top-actions { display: flex; align-items: center; gap: 18px; }
.demo-badge { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.demo-badge i, .file-dot { width: 5px; height: 5px; border-radius: 50%; background: #71a88a; }
.outline-button, .subtle-button {
  font-weight: 500;
  border: 1px solid var(--control-line); border-radius: 8px; padding: 10px 14px;
  background: #ffffffbd; color: var(--muted); font-size: 14px;
  transition: border-color .18s, background .18s, box-shadow .18s;
}
.outline-button:hover:not(:disabled), .subtle-button:hover:not(:disabled) { border-color: var(--accent); background: #fff; box-shadow: 0 3px 12px #34563f08; }
.subtle-button { padding: 8px 12px; }
.view { display: none; }
.view.active { display: block; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 25px 0 23px; }
h1 { font-size: 30px; font-weight: 700; letter-spacing: -.5px; margin: 0 0 9px; }
.page-heading p { font-size: 14px; line-height: 1.6; color: var(--muted); margin: 0; }
.editor-layout { display: grid; grid-template-columns: minmax(0,1fr) 400px; gap: 24px; align-items: start; }
.canvas-column { min-width: 0; }
.canvas-shell, .control-panel { background: var(--surface); border: 1px solid #abc5b7; border-radius: 18px; box-shadow: 0 12px 36px #244f3610, inset 0 1px 0 #ffffffed; backdrop-filter: blur(24px) saturate(140%); }
.canvas-shell { overflow: hidden; }
.canvas-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 48px; padding: 0 17px; border-bottom: 1px solid #dce8df; }
.canvas-file { display: flex; align-items: center; gap: 8px; font-size: 14px; min-width: 0; }
#canvas-name { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.micro-badge { display: inline-block; border: 1px solid #e8ede9; background: #f7faf8; color: var(--muted); border-radius: 5px; padding: 3px 6px; font-size: 12px; white-space: nowrap; }
.icon-button { border: 0; background: transparent; color: var(--muted); font-size: 21px; padding: 4px 5px; }
.canvas {
  position: relative; height: 445px; display: flex; justify-content: center; overflow: hidden; cursor: pointer;
  background: radial-gradient(circle, #95b3a78a 1px, transparent 1px) center / 20px 20px, linear-gradient(135deg,#f4faf5b8,#edf2f7a8);
}
.canvas:hover, .canvas.dragover { box-shadow: inset 0 0 0 2px var(--accent); }
.canvas:focus-visible { outline-offset: -4px; }
.canvas.dragover { background-color: var(--accent-soft); }
.canvas > img { width: 100%; height: 100%; object-fit: cover; }
.canvas.uploaded { background: repeating-conic-gradient(#f1f4f2 0% 25%, #f9fbfa 0% 50%) 50% / 20px 20px; }
.canvas.uploaded > img { object-fit: contain; }
.canvas.ratio-preview > img { max-width: 100%; width: auto; aspect-ratio: var(--ratio,1); object-fit: contain; }
.canvas-caption { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; pointer-events: none; gap: 13px; }
.empty-icon { position: relative; display: grid; place-items: center; width: 63px; height: 63px; margin-bottom: 7px; border: 1px solid #dce8df; border-radius: 17px; background: #fff; color: var(--accent); box-shadow: 0 8px 22px #4b765410; transform: rotate(-6deg); }
.empty-icon svg { width: 30px; height: 30px; transform: rotate(6deg); }
.canvas-caption h2 { margin: 2px 0 0; color: var(--text); font-size: 20px; font-weight: 600; }
.canvas-caption p { margin: 0; color: var(--muted); font-size: 14px; }
.canvas-watermark { position: absolute; right: 12px; bottom: 12px; border: 1px solid #ffffff66; border-radius: 5px; padding: 6px 8px; background: #fffffff2; backdrop-filter: blur(12px); font-size: 12px; color: var(--muted); }
.canvas-bottom { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 41px; padding: 8px 16px; color: var(--muted); font-size: 12px; }
.canvas-bottom > div { display: flex; align-items: center; gap: 10px; }
.canvas-divider { height: 10px; width: 1px; background: var(--line); }
.text-button { border: 0; padding: 0; background: transparent; color: var(--accent); font-size: 14px; font-weight: 500; }
.text-button:hover { color: var(--accent); }
.canvas-bottom button:disabled, .icon-button:disabled { cursor: default; opacity: .6; }
.control-panel { padding: 22px; }
.control-heading { padding-bottom: 17px; border-bottom: 1px solid #edf1ee; }
.control-heading h2 { font-size: 14px; margin: 0; font-weight: 600; }
.control-section { margin-top: 18px; }
.control-section label { font-size: 14px; font-weight: 600; color: var(--text); }
.label-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.label-line > span { font-size: 12px; color: var(--muted); }
textarea { width: 100%; min-height: 127px; resize: vertical; padding: 12px; border: 1px solid var(--control-line); border-radius: 9px; background: #ffffffdc; color: var(--text); font-size: 14px; line-height: 1.9; transition: border-color .2s, box-shadow .2s; }
input::placeholder, textarea::placeholder { color: #506859; opacity: 1; }
textarea:focus, input:focus { outline: 2px solid var(--accent); outline-offset: 2px; border-color: var(--accent); box-shadow: 0 0 0 3px #27785916; }
.prompt-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 7px; color: var(--muted); font-size: 12px; }
.prompt-chips { display: none; }
.upload-zone { display: flex; align-items: center; gap: 10px; padding: 15px 12px; border: 1px dashed var(--control-line); border-radius: 10px; background: #f7fbf8; color: var(--muted); cursor: pointer; font-size: 14px; transition: border-color .2s, background .2s, transform .2s; }
.upload-zone > span:first-child { color: var(--accent); font-size: 21px; }
.upload-zone > span:last-child { margin-left: auto; }
.upload-zone small { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; }
.upload-zone:hover, .upload-zone.dragover { border-color: var(--accent); background: #edf7f0; }
.retention-notice { display: flex; gap: 8px; margin-top: 12px; color: var(--muted); }
.retention-icon { font-size: 16px; color: var(--accent); line-height: 19px; }
.retention-notice p { margin: 0; font-size: 12px; line-height: 1.8; }
.retention-notice strong { color: var(--text); font-weight: 600; }
.retention-notice small { display: block; color: var(--muted); font-size: 12px; line-height: 1.8; }
.advanced-settings { border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: 0; margin-top: 17px; background: transparent; }
.advanced-settings > summary { padding: 14px 0 0; color: var(--muted); font-size: 14px; cursor: pointer; }
.advanced-settings > summary span { margin-left: 10px; font-size: 12px; color: var(--muted); }
.advanced-settings .control-section { margin-top: 16px; }
.output-line { display: flex; justify-content: space-between; align-items: center; }
select { border: 1px solid var(--control-line); border-radius: 6px; padding: 7px 9px; background: #fff; color: var(--text); font-size: 14px; }
.ratio-options { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 7px; }
.ratio-options button { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 10px 0 8px; border: 1px solid var(--control-line); border-radius: 7px; background: #fbfdfb; color: var(--muted); font-size: 14px; font-weight: 500; }
.ratio-options button[data-ratio="auto"] { grid-column: 1 / -1; flex-direction: row; justify-content: center; padding: 10px 8px; }
#ratio-status, #outpaint-ratio-status { margin: 9px 0 0; }
.ratio-options button.active { border-color: var(--accent); background: #edf6ef; color: var(--accent); }
.ratio-icon { width: 15px; height: 15px; border: 1px solid currentColor; border-radius: 2px; }
.ratio-icon.landscape { width: 20px; }
.ratio-icon.portrait { width: 11px; }
.ratio-icon.wide { width: 24px; height: 13px; margin: 1px 0; }
.mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 10px; }
.mode-button { border: 1px solid var(--control-line); border-radius: 7px; background: #fafcfb; color: var(--muted); padding: 9px 4px; font-size: 14px; font-weight: 500; }
.mode-button.active { border-color: var(--accent); background: #eff7f1; color: var(--accent); }
input[type=range] { width: 100%; accent-color: var(--accent); }
.field-note { color: var(--muted); font-size: 12px; line-height: 1.8; }
.generate-info { display: none; }
.generate-area { margin-top: 18px; }
.generate-button { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; min-height: 46px; padding: 10px 14px; border: 1px solid #277859; border-radius: 9px; background: var(--accent); color: #fff; font-size: 14px; font-weight: 600; box-shadow: 0 4px 11px #27785912; transition: transform .18s, box-shadow .18s, background .18s; }
.generate-button:disabled { opacity: 1; background: #dce5df; border-color: #a4b4a9; color: var(--muted); box-shadow: none; }
.generate-button:hover:not(:disabled) { background: #125e42; box-shadow: 0 5px 14px #27785924; }
.generate-button:active:not(:disabled) { transform: translateY(0); }
.generate-button > span:first-child { margin-right: auto; }
.generate-button > span:last-child { margin-left: auto; }
.generate-area > p { font-size: 12px; line-height: 1.7; color: var(--muted); margin: 9px 0; }
.responsible-label { font-size: 12px; color: var(--muted); }
.gallery-section { margin-top: 22px; }
.section-title { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.section-title h2 { font-size: 14px; font-weight: 500; margin: 0; }
.section-title > span { font-size: 12px; color: var(--muted); }
.gallery { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.gallery-card { min-width: 0; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: #fff; overflow: hidden; text-align: left; transition: transform .18s, box-shadow .18s, border-color .18s; }
.gallery-card:hover { border-color: #79a98c; box-shadow: 0 5px 16px #355b3d12; }
.gallery-card.active { border-color: var(--accent); }
.gallery-card img { width: 100%; height: 90px; display: block; object-fit: cover; }
.gallery-text { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px; }
.gallery-text b { font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gallery-text small { font-size: 12px; color: var(--muted); white-space: nowrap; }
footer { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 26px; padding: 15px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; letter-spacing: .5px; }
footer > span:last-child { margin-left: auto; }
.project-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 18px; align-content: start; min-height: 360px; }
.project-card { border: 1px solid var(--line); border-radius: 13px; background: #fff; overflow: hidden; transition: transform .2s, box-shadow .2s; }
.project-card:hover { border-color: #8caf99; box-shadow: 0 7px 22px #34563f14; }
.project-card img { width: 100%; height: 170px; object-fit: cover; }
.project-card > div { padding: 18px; }
.project-card h2 { font-size: 15px; font-weight: 500; margin: 0 0 10px; }
.project-card p { font-size: 14px; color: var(--muted); margin: 0 0 18px; }
.project-grid > .empty-state { grid-column: 1 / -1; }
.empty-state { padding: 72px 20px; text-align: center; border: 1px dashed #d9e4dc; border-radius: 14px; color: var(--muted); background: #ffffff88; }
.empty-state > span { font-size: 34px; color: var(--accent); }
.empty-state h2 { font-size: 17px; color: var(--text); font-weight: 500; }
.empty-state p { font-size: 14px; line-height: 1.9; }
.task-row { display: flex; align-items: center; gap: 18px; border: 1px solid var(--line); border-radius: 12px; background: #fff; margin-bottom: 12px; padding: 19px; }
.task-row > div:first-child { flex: 1; min-width: 0; }
.task-row h2 { font-size: 14px; font-weight: 500; margin: 0 0 8px; }
.task-row p { font-size: 14px; color: var(--muted); margin: 0; overflow-wrap: anywhere; }
.task-row .micro-badge { white-space: normal; }
.help-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 17px; align-content: start; }
.help-grid details { border: 1px solid var(--line); border-radius: 12px; background: #ffffffd9; padding: 22px; }
.help-grid summary { cursor: pointer; font-size: 14px; color: var(--text); }
.help-grid p { font-size: 14px; color: var(--muted); line-height: 1.9; }
.settings-list { border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 0 24px; }
.settings-list > label, .settings-list > div { display: flex; justify-content: space-between; align-items: center; gap: 20px; min-height: 105px; border-bottom: 1px solid var(--line); }
.settings-list > div:last-child { border: 0; }
.settings-list b { font-size: 14px; font-weight: 500; }
.settings-list small { display: block; color: var(--muted); font-size: 14px; line-height: 1.7; margin-top: 9px; }
input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--accent); }
dialog { width: min(460px,calc(100% - 32px)); padding: 30px; border: 1px solid #e3ebe5; border-radius: 18px; background: #fffffff2; backdrop-filter: blur(24px); color: var(--text); box-shadow: 0 25px 90px #25463226; }
dialog[open] { animation: dialog-enter var(--motion-standard) var(--motion-ease) both; }
dialog::backdrop { background: #28493633; backdrop-filter: blur(5px); }
dialog h2 { font-size: 23px; font-weight: 550; margin-top: 12px; }
.dialog-close { position: absolute; right: 13px; top: 10px; border: 0; padding: 4px 8px; background: transparent; color: var(--muted); font-size: 22px; }
.balance { display: flex; align-items: baseline; gap: 13px; padding: 18px 0 27px; }
.balance strong { color: var(--accent); font-size: 44px; font-weight: 500; }
.balance span { color: var(--muted); font-size: 14px; }
dialog label { display: block; color: var(--text); font-size: 14px; margin-bottom: 9px; }
dialog input:not([type=checkbox]) { min-width: 0; width: 100%; padding: 12px; border: 1px solid var(--control-line); border-radius: 8px; background: #fafcfb; color: var(--text); }
.activation-row { display: flex; gap: 10px; }
.activation-row button { width: 112px; flex-shrink: 0; }
#project-form > .generate-button { margin-top: 20px; }
#preview-modal { width: min(1000px,95vw); padding: 38px 20px 20px; }
#large-preview { width: 100%; height: 75vh; object-fit: contain; }
#toast { position: fixed; z-index: 30; left: 50%; bottom: 24px; transform: translate(-50%,12px); padding: 12px 18px; border: 1px solid #e1eae4; border-radius: 10px; background: #fff; color: #496c55; box-shadow: 0 8px 30px #25463216; font-size: 14px; opacity: 0; pointer-events: none; transition: .2s; max-width: 90vw; }
#toast.show { opacity: 1; transform: translate(-50%,0); }
body.no-motion .ambient, body.no-motion .cursor-halo { display: none; }
body.no-motion *, body.no-motion *::before, body.no-motion *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
@keyframes enter { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@media (min-width:1600px) { :root { --page-gutter: 48px; } .canvas { height: 480px; } }
@media (max-width:1250px) { :root { --sidebar-width: 182px; --page-gutter: 22px; } .sidebar { width: 182px; padding: 26px 12px 18px; } .editor-layout { grid-template-columns: minmax(0,1fr) 350px; gap: 17px; } .control-panel { padding: 18px; } .canvas { height: 360px; } .canvas-bottom { flex-wrap: wrap; } .project-grid { grid-template-columns: 1fr 1fr; } .gallery-text small { display: none; } }
@media (max-width:1050px) { .editor-layout { display: flex; flex-direction: column; } .control-panel { width: 100%; } .canvas-column { width: 100%; } .canvas { height: 300px; } .help-grid { grid-template-columns: 1fr; } }
@media (max-width:600px) {
  :root { --sidebar-width: 64px; --page-gutter: 14px; }
  .sidebar { width: 64px; padding: 21px 6px 14px; }
  .brand { font-size: 0; margin: 0 0 19px; justify-content: center; gap: 0; } .brand-symbol { font-size: 29px; } .brand-dot, .nav-caption, .nav-item i { display: none; }
  .sidebar nav { gap: 9px; } .nav-item { justify-content: center; font-size: 0; padding: 10px; min-height: 42px; gap: 0; } .nav-item > span { font-size: 20px; }
  .sidebar-bottom { padding-top: 14px; } .account-card { justify-content: center; padding: 15px 0 0; } .account-card > span:not(.workspace-avatar) { display: none; }
  .topbar { height: 57px; } .breadcrumb { font-size: 12px; } .breadcrumb span { margin: 0 5px; } .demo-badge { display: none; } .subtle-button { font-size: 14px; padding: 7px 9px; }
  .page-heading { padding: 23px 0 20px; gap: 13px; flex-wrap: wrap; align-items: flex-start; } h1 { font-size: 23px; } .page-heading p { font-size: 12px; } .page-heading .outline-button { font-size: 14px; padding: 8px 10px; }
  .control-panel { padding: 17px; border-radius: 13px; } .advanced-settings > summary span { display: block; margin: 6px 0 0; font-size: 12px; } .canvas { height: 245px; }
  .canvas-toolbar { padding: 0 10px; } #canvas-name { max-width: 110px; } .canvas-file { font-size: 12px; gap: 6px; } .canvas-caption h2 { font-size: 15px; }
  .canvas-bottom { gap: 9px; padding: 11px 12px; font-size: 12px; } .canvas-watermark { font-size: 12px; } .gallery { gap: 7px; } .gallery-card img { height: 72px; } .gallery-text { padding: 8px 6px; } .gallery-text b { font-size: 12px; }
  .project-grid { grid-template-columns: 1fr; } .task-row { flex-wrap: wrap; gap: 12px; } .task-row > div:first-child { flex-basis: 100%; }
  .settings-list { padding: 0 15px; } .settings-list small { font-size: 12px; } .settings-list > label { gap: 10px; } .activation-row { flex-direction: column; } .activation-row button { width: 100%; }
}
@media (prefers-reduced-motion:reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; } .ambient, .cursor-halo { display: none; } }

/* Optional purpose presets keep the user's description independent. */
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; border:0; }
.model-heading { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:12px; padding-bottom:15px; }
.model-heading label { font-size: 14px; font-weight: 600; color: var(--text); }
.model-heading select { flex:1; min-width:148px; font-size: 14px; border-radius:8px; padding:8px 10px; }
.style-section { margin-top:15px; }
.style-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:6px; }
.style-button { display:flex; align-items:center; justify-content:center; gap:5px; min-width:0; min-height:38px; padding:7px 0; border: 1px solid var(--control-line); border-radius:7px; background:#fff; color: var(--muted); font-size: 14px; font-weight:500; letter-spacing:-.15px; white-space:nowrap; transition:background .18s,border-color .18s,transform .18s; }
.style-button:hover:not(:disabled) { border-color:var(--accent); background:#f0f8f3; }
.style-button.active { border-color:var(--accent); background:#dceee2; color:#105c3e; box-shadow:inset 0 0 0 1px #176b4c; font-weight:600; }
.style-swatch { display:none; width:6px; height:6px; border-radius:50%; flex-shrink:0; background:#c8d2cb; }
.preset-category { grid-column:1/-1; font-size: 12px; color: var(--muted); padding-top:5px; }
.style-button.active .style-swatch { background:#4f9770; }
.style-note { margin:8px 0 0; color: var(--muted); font-size: 12px; line-height:1.6; min-height:15px; }
.control-panel textarea { min-height:102px; }
.control-panel .retention-notice { margin-top:10px; }
.control-panel .control-section { margin-top:16px; }
.settings-list > label:last-child { border-bottom:0; }
@media(max-width:600px) { .style-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }.style-button { justify-content:flex-start; padding:8px 10px; }.model-heading select { min-width:145px; } }

/* Outpainting preferences are separate from measured image similarity. */
.outpaint-panel { background:#f5faf7; border:1px solid #e0ece4; border-radius:9px; padding:12px; }
.outpaint-modes { display:grid; grid-template-columns:1fr 1fr; gap:7px; }
.outpaint-modes button { border: 1px solid var(--control-line); border-radius:7px; background:#fff; padding:9px 4px; color: var(--muted); font-size: 14px; font-weight:500; }
.outpaint-modes button.active { background:#e6f3ea; border-color:var(--accent); color:#277859; }
.similarity-heading { margin-top:15px; }
#similarity-value { color:#277859; font-size: 14px; font-weight:600; }
#similarity-slider { width:100%; margin:4px 0; accent-color:#277859; cursor:pointer; }
.outpaint-panel .field-note { margin:6px 0 0; font-size: 12px; line-height:1.6; }

/* Account and real generation results. */
.auth-tabs { display:flex; gap:8px; margin:18px 0; padding:4px; background:#edf4ef; border-radius:9px; }
.auth-tabs button { flex:1; border:0; border-radius:6px; background:transparent; padding:9px; color:var(--muted); }
.auth-tabs button.active { background:#fff; color:var(--accent); box-shadow:0 1px 5px #25463212; }
#auth-form label { margin-top:16px; }
#auth-submit { width:100%; margin-top:10px; }
#logout-account { margin-top:17px; }
.form-error { min-height:18px; color:#a62e2e; font-size: 14px; line-height:1.6; margin:10px 0; }
.task-result { display:flex; align-items:center; flex-wrap:wrap; gap:12px; margin-top:14px; }
.result-preview { width:140px; height:110px; border:1px solid var(--line); border-radius:9px; background:#f3f7f4; overflow:hidden; padding:0; }
.result-preview img { display:block; width:100%; height:100%; object-fit:contain; }
.task-result .field-note { flex-basis:100%; }
.task-status.review { color:#8b5c12; background:#fff4dc; border-color:#e5c884; }
.task-status.failed { color:#a33030; background:#fff0ee; border-color:#e7bab2; }
.task-status.succeeded { color:#26774e; background:#ebf6ef; }
.task-info p + p { margin-top:6px; }

/* Batch queue: one visible destination from submit to download. */
.activity-strip { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:13px 16px; margin:16px 0 0; border:1px solid #8cbba4; border-radius:10px; background:#edf7f1; color:#20593f; font-size: 14px; }
.text-button { border:0; padding:5px; color:var(--accent); background:transparent; font-weight:600; white-space:nowrap; }
.queue-connection { padding:11px 14px; background:#eef5f0; border:1px solid #c2d7c9; border-radius:9px; color:#325c44; font-size: 14px; line-height:1.7; }
.queue-connection.disconnected { color:#80500d; background:#fff6e5; border-color:#ddbd7b; }
.queue-summary { margin:14px 0; color:var(--muted); font-size: 14px; }
#submission-status { margin:16px 0; padding:18px; border:1px solid #7aa58c; border-radius:12px; background:#eff7f1; line-height:1.7; }
#submission-status p { margin:7px 0 12px; font-size: 14px; color:#375e47; }
.task-batch { margin:0 0 22px; padding:21px; background:#fff; border:1px solid var(--line); border-radius:14px; scroll-margin-top:20px; }
.task-batch.selected { border-color:#428968; box-shadow:0 0 0 2px #27785914; }
.batch-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom:16px; }
.batch-heading h2 { margin:0 0 7px; font-size:18px; font-weight:600; overflow-wrap:anywhere; }
.batch-heading p { margin:0; color:var(--muted); font-size: 14px; }
.current-batch-label { display:inline-block; margin-top:10px; padding:4px 8px; border-radius:5px; background:#e7f4ec; color:#226343; font-size: 12px; }
.batch-progress-label { text-align:right; flex-shrink:0; }
.batch-progress-label strong { display:block; color:#246346; font-size:26px; line-height:1.2; font-variant-numeric:tabular-nums; }
.batch-progress-label span { display:block; margin-top:6px; color:var(--muted); font-size: 14px; }
.task-batch progress { display:block; width:100%; height:7px; appearance:none; border:0; border-radius:8px; background:#e8eeea; overflow:hidden; }
.task-batch progress::-webkit-progress-bar { background:#e8eeea; }
.task-batch progress::-webkit-progress-value { background:#398965; border-radius:8px; transition:width var(--motion-standard) var(--motion-ease); }
.task-batch progress::-moz-progress-bar { background:#398965; }
.batch-summary { margin:11px 0 18px; color:var(--muted); font-size: 14px; line-height:1.8; }
.batch-attention { padding:10px 12px; background:#fff5df; border-radius:7px; color:#805512; font-size: 14px; line-height:1.6; }
.task-item { display:grid; grid-template-columns:86px minmax(0,1fr) auto; align-items:start; gap:18px; padding:19px 0; border-top:1px solid #dce5df; }
.task-item:last-child { padding-bottom:0; }
.task-source { width:86px; height:72px; border:1px solid #d0ddd4; border-radius:8px; overflow:hidden; background:#f2f6f3; display:flex; align-items:center; justify-content:center; }
.task-source img { width:100%; height:100%; object-fit:cover; }
.task-source span { padding:7px; font-size: 12px; color:#53665a; text-align:center; }
.task-detail h3 { margin:0 0 6px; font-size:14px; line-height:1.6; font-weight:600; overflow-wrap:anywhere; }
.task-meta { margin:0 0 9px; font-size: 14px; color:var(--muted); }
.task-detail .task-status { display:inline-block; font-size: 12px; padding:4px 8px; line-height:1.4; }
.task-note { max-width:640px; margin:9px 0 5px; color:#3e5447; font-size: 14px; line-height:1.8; }
.task-elapsed { margin:5px 0; color:#356b4f; font-size: 14px; font-variant-numeric:tabular-nums; }
.task-id { display:block; margin-top:7px; font-size: 12px; color:#627369; }
.task-actions { display:flex; flex-direction:column; align-items:flex-end; gap:9px; max-width:185px; }
.task-actions .outline-button { padding:8px 12px; font-size: 14px; text-align:center; }
.task-actions small { max-width:170px; color:var(--muted); font-size: 12px; line-height:1.7; text-align:right; }
.task-actions .result-preview { width:124px; height:86px; }
.running-label,.review-label { font-size: 14px; padding:7px 0; color:#277859; }
.running-label::before { content:''; display:inline-block; width:7px; height:7px; margin-right:7px; border-radius:50%; background:#388863; animation:queue-pulse 1.5s ease-in-out infinite; }
.review-label { color:#8b5c12; }
@keyframes queue-pulse { 50% { opacity:.35; } }
@media(max-width:700px) {
 .task-batch { padding:15px; }.task-item { grid-template-columns:62px minmax(0,1fr); gap:12px; }.task-source { width:62px; height:58px; }.task-actions { grid-column:2; align-items:flex-start; max-width:100%; flex-direction:row; flex-wrap:wrap; }.task-actions small { text-align:left; }.batch-heading h2 { font-size:16px; }.batch-progress-label strong { font-size:23px; }.activity-strip { align-items:flex-start; font-size: 14px; }
}

/* Image groups: clear ownership, small controls and persistent drafts. */
.group-toolbar { display:flex; align-items:center; flex-wrap:wrap; gap:12px 20px; padding:16px 18px; margin:0 0 20px; border:1px solid #cbdcd1; border-radius:12px; background:#f4f9f5; }
.group-picker { display:flex; align-items:center; gap:12px; min-width:0; }
.group-picker label { font-size: 14px; font-weight:600; white-space:nowrap; }
.group-picker select { width:min(260px,45vw); padding:9px 12px; border:1px solid #a6c2b1; border-radius:8px; color:var(--text); background:#fff; }
#group-save-status { color:var(--accent); font-size: 14px; }
#group-save-status.error { color:#a83b34; }
.group-tools { margin-left:auto; display:flex; flex-wrap:wrap; gap:14px; }
.group-toolbar > p { flex-basis:100%; margin:0; color:var(--muted); font-size: 12px; line-height:1.7; }
.danger-text { color:#a83b34; }
.image-actions { display:flex; align-items:center; flex-wrap:wrap; gap:10px; padding:10px 12px; margin-bottom:12px; background:#edf5ef; border:1px solid #cbdcd1; border-radius:9px; }
.image-actions span { margin-right:auto; font-size: 14px; }
.image-actions select { max-width:180px; padding:7px; background:#fff; color:var(--text); border:1px solid #afc7b8; border-radius:6px; }
.image-actions .outline-button { padding:6px 10px; font-size: 14px; }
.gallery-card.managed { position:relative; }
.gallery-card.checked { box-shadow:0 0 0 2px #277859; }
.gallery-open { width:100%; padding:0; border:0; color:var(--text); background:#fff; text-align:left; }
.gallery-check { position:absolute; top:7px; left:7px; display:flex; padding:4px; border-radius:5px; background:#fffffff2; }
.gallery-check input { margin:0; cursor:pointer; }
.gallery-controls { display:flex; align-items:center; justify-content:flex-end; gap:10px; border-top:1px solid var(--line); padding:7px 9px; }
.gallery-controls button { border:0; background:transparent; color:var(--muted); font-size: 14px; padding:2px 5px; }
.gallery-controls button:last-child { margin-left:auto; color:#a83b34; }
.expired-thumb { display:flex; align-items:center; justify-content:center; height:90px; color:#7a6350; background:#f5eee5; font-size: 14px; }
.expired-preview { position:absolute; inset:0; display:flex; flex-direction:column; justify-content:center; align-items:center; gap:12px; padding:24px; background:#f4f7f4; color:var(--text); text-align:center; }
.expired-preview span { color:var(--muted); font-size: 14px; line-height:1.8; }
.project-card .project-cover { width:100%; height:150px; display:flex; align-items:center; justify-content:center; background:linear-gradient(130deg,#e6f1e9,#f4f6ee); font-size:34px; color:#7fa68d; padding:0; }
.project-card .project-cover img { height:100%; width:100%; object-fit:cover; }
.project-card h2 { overflow-wrap:anywhere; font-weight:600; }
.project-card .project-info { display:flex; gap:10px; flex-wrap:wrap; margin-bottom:14px; font-size: 12px; color:var(--muted); }
.project-actions { display:flex; align-items:center; gap:13px; flex-wrap:wrap; }
.project-actions .outline-button { padding:8px 11px; font-size: 14px; }
.project-actions .text-button { font-size: 14px; }
.confirm-actions { display:flex; gap:10px; margin-top:22px; }
.confirm-actions .generate-button { width:auto; flex:1; }
button:disabled { cursor:not-allowed; }
select:disabled { opacity:1; color:#40594b; -webkit-text-fill-color:#40594b; background:#f1f6f2; cursor:not-allowed; }

@media(max-width:600px) { .group-toolbar { padding:12px; gap:12px; } .group-picker { width:100%; } .group-picker select { flex:1; width:0; } .group-tools { width:100%; margin:0; justify-content:space-between; gap:9px; } .image-actions { gap:8px; } .image-actions select { width:130px; } .gallery { grid-template-columns:repeat(2,minmax(0,1fr)); } .gallery-controls { gap:5px; } }


/* Shared surfaces and feedback keep the workspace calm while making every action legible. */
::selection { background: #cce6d7; color: #133e2b; }
:where(button, a, summary, .upload-zone, .canvas) { touch-action: manipulation; }
:is(button, a, summary, input, textarea, select, .canvas, label.upload-zone):focus-visible {
  outline: 2px solid var(--focus-ring); outline-offset: 3px;
}
:where(button, a, input, textarea, select) { -webkit-tap-highlight-color: transparent; }
:where(button, a) { border-radius: 7px; }
.sidebar { width: var(--sidebar-width); height: 100dvh; overflow-y: auto; scrollbar-width: thin; border-right-color: #b8cdc0; background: #ffffffa3; }
.brand { border-radius: 10px; }
.brand:hover { color: var(--accent); }
.nav-item:active:not(:disabled) { background: #dcece2; box-shadow: inset 0 0 0 1px #9bc0aa; }
.nav-item.active:hover:not(:disabled) { background: #d5eadd; }
.nav-item i { min-width: 20px; padding: 1px 5px; border-radius: 6px; background: #e9f1ec; font-variant-numeric: tabular-nums; }
.account-card { border-radius: 10px; padding-bottom: 8px; transition: background var(--motion-standard), box-shadow var(--motion-standard); }
.account-card:hover { background: #eaf3ed; }
.account-card:active { background: #e1eee6; }
.account-card:focus-visible { outline-offset: 2px; }
.workspace-avatar { border: 1px solid #c7ddcf; background: #e2efe7; }
.topbar::before {
  content: ''; position: fixed; left: var(--sidebar-width); right: 0; top: 0; height: 85px; z-index: -1;
  background: #edf3efc9; backdrop-filter: blur(20px) saturate(125%);
  mask-image: linear-gradient(#000 0 60%, transparent 100%); pointer-events: none;
}
.breadcrumb { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.breadcrumb strong { color: #294f3b; font-weight: 600; }
.top-actions { gap: 12px; flex-shrink: 0; }
#top-account { white-space: nowrap; }
.demo-badge { white-space: nowrap; }
.page-heading { padding-top: 28px; padding-bottom: 24px; }
.page-heading > div { min-width: 0; }
.page-heading p { max-width: 68ch; text-wrap: pretty; }
h1 { line-height: 1.25; letter-spacing: -.7px; }
.canvas-shell, .control-panel { border-color: #b6cec0; box-shadow: 0 10px 28px #244f3610, inset 0 1px 0 #fffffff2; }
.control-heading { border-bottom-color: #dce8df; }
.control-panel { min-width: 0; }
.canvas-toolbar > :last-child { flex-shrink: 0; }
.canvas { transition: box-shadow var(--motion-standard), background-color var(--motion-standard); }
.canvas:active { box-shadow: inset 0 0 0 3px #176b4c; }
.canvas.dragover { background-color: #dcefe3; box-shadow: inset 0 0 0 3px #277859; }
.canvas > img { display: block; }
.canvas-caption { padding: 22px; }
.canvas-caption p { max-width: 34ch; text-wrap: pretty; }
.canvas-bottom { border-top: 1px solid #e5ede7; }
.canvas-bottom > div { flex-wrap: wrap; }

.skip-link { position: fixed; left: calc(var(--sidebar-width) + var(--page-gutter)); top: 10px; z-index: 50; padding: 10px 14px; border: 1px solid #83ad93; background: #fff; color: #164f34; box-shadow: 0 4px 16px #244f3620; transform: translateY(-160%); transition: transform var(--motion-fast); }
.skip-link:focus { transform: none; }
#main-content:focus { outline: none; }
#prompt-count.limit-near { color: #9b5235; font-weight: 600; }

/* Controls share the same timing without moving away from the pointer. */
:is(.outline-button, .subtle-button, .icon-button, .text-button, .generate-button, .dialog-close,
  .style-button, .mode-button, .ratio-options button, .outpaint-modes button, .auth-tabs button,
  .gallery-open, .gallery-controls button, .code-visibility) {
  transition: background-color var(--motion-standard), border-color var(--motion-standard), color var(--motion-standard),
    box-shadow var(--motion-standard), opacity var(--motion-fast);
}
.outline-button, .subtle-button { min-height: 38px; line-height: 1.35; }
:is(.outline-button, .subtle-button):active:not(:disabled) { background: var(--press-surface); border-color: #4e8a68; box-shadow: inset 0 1px 3px #24583b15; }
.icon-button { display: inline-grid; place-items: center; min-width: 32px; min-height: 32px; line-height: 1; }
.icon-button:hover:not(:disabled) { color: var(--accent); background: #eaf3ed; }
.icon-button:active:not(:disabled) { background: #d8eadd; }
.text-button { min-height: 30px; border-radius: 6px; text-decoration-color: transparent; text-underline-offset: 4px; }
.text-button:hover:not(:disabled) { color: #10573c; background: #e4f0e8; text-decoration: underline; }
.text-button:active:not(:disabled) { background: #d8eadd; }
.text-button.danger-text { color: var(--danger); }
.text-button.danger-text:hover:not(:disabled) { color: #8c302a; background: #fae9e5; }
.text-button.danger-text:active:not(:disabled) { background: #f2d9d2; }
.generate-button:active:not(:disabled) { background: #0e5037; box-shadow: inset 0 2px 5px #082f332e; transform: none; }
:is(.ratio-options button, .mode-button, .outpaint-modes button):hover:not(:disabled):not(.active) { border-color: #4e936c; background: #eef7f1; color: #255e40; }
:is(.ratio-options button, .mode-button, .outpaint-modes button, .style-button):active:not(:disabled) { background: #dbeee2; box-shadow: inset 0 1px 3px #214c331a; }
:is(.ratio-options button, .mode-button, .outpaint-modes button).active { background: #e0f0e5; border-color: #287b53; color: #185b3b; box-shadow: inset 0 0 0 1px #287b5330; }
.style-button.active:hover:not(:disabled) { background: #d3e9dc; }
.style-button.active:active:not(:disabled) { background: #dbeee2; box-shadow: inset 0 1px 3px #214c331a; }
.style-grid > button { line-height: 1.4; }
.upload-zone:active { background: #dfede4; box-shadow: inset 0 0 0 1px #7daf90; }
.upload-zone:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px #27785918; }
.upload-zone > span:nth-child(2) { min-width: 0; overflow-wrap: anywhere; }

/* Forms remain readable in focus, validation, and server wait states. */
:where(input:not([type=checkbox]):not([type=range]), textarea, select) {
  min-height: 40px; transition: border-color var(--motion-standard), background-color var(--motion-standard), box-shadow var(--motion-standard);
}
:is(input:not([type=checkbox]):not([type=range]), textarea, select):hover:not(:disabled) { border-color: #497f60; }
:is(input:not([type=checkbox]):not([type=range]), textarea, select):focus {
  border-color: var(--accent); outline: 2px solid #176b4c; outline-offset: 2px; box-shadow: 0 0 0 4px #27785912;
}
:is(input, textarea, select).has-value, dialog input.has-value { background-color: #f8fcf9; }
:is(input, textarea, select).field-invalid, dialog input.field-invalid,
:is(input, textarea, select)[aria-invalid=true], dialog input[aria-invalid=true] { border-color: #b35045; background: #fff8f5; }
:is(input, textarea, select).field-invalid:focus, dialog input.field-invalid:focus,
:is(input, textarea, select)[aria-invalid=true]:focus, dialog input[aria-invalid=true]:focus { outline-color: #a3483d; box-shadow: 0 0 0 4px #b3504512; }
textarea { scrollbar-width: thin; scrollbar-color: #b0c9b9 transparent; }
textarea:disabled, input:disabled, dialog input:disabled { color: #53675b; background: #edf2ee; -webkit-text-fill-color: #53675b; cursor: not-allowed; }
select { max-width: 100%; cursor: pointer; }
select:disabled { border-color: #afc2b5; box-shadow: none; }
input[type=checkbox] { cursor: pointer; flex-shrink: 0; border-radius: 4px; transition: box-shadow var(--motion-fast); }
input[type=checkbox]:hover:not(:disabled) { box-shadow: 0 0 0 4px #27785914; }
input[type=checkbox]:disabled { cursor: not-allowed; opacity: .55; }
input[type=range] { appearance: none; height: 24px; border: 0; padding: 0; background: transparent; cursor: pointer; }
input[type=range]:focus { box-shadow: none; outline-offset: 3px; }
input[type=range]::-webkit-slider-runnable-track { height: 5px; border-radius: 5px; background: #c8ddcf; }
input[type=range]::-moz-range-track { height: 5px; border-radius: 5px; background: #c8ddcf; }
input[type=range]::-webkit-slider-thumb { appearance: none; width: 19px; height: 19px; margin-top: -7px; border: 3px solid #fff; border-radius: 50%; background: var(--accent); box-shadow: 0 1px 5px #244f3630; transition: box-shadow var(--motion-fast); }
input[type=range]::-moz-range-thumb { width: 13px; height: 13px; border: 3px solid #fff; border-radius: 50%; background: var(--accent); box-shadow: 0 1px 5px #244f3630; }
input[type=range]:hover:not(:disabled)::-webkit-slider-thumb { box-shadow: 0 0 0 4px #27785920; }
input[type=range]:hover:not(:disabled)::-moz-range-thumb { box-shadow: 0 0 0 4px #27785920; }
input[type=range]:active:not(:disabled)::-webkit-slider-thumb { background: #104d34; box-shadow: 0 0 0 5px #27785926; }
input[type=range]:active:not(:disabled)::-moz-range-thumb { background: #104d34; box-shadow: 0 0 0 5px #27785926; }
input[type=range]:disabled { cursor: not-allowed; opacity: .5; }
button:disabled, a[aria-disabled=true] { cursor: not-allowed; box-shadow: none; transform: none; }
button:disabled:hover { transform: none; }
:where(button, a).is-busy, button[aria-busy=true], button.is-busy:disabled, button[aria-busy=true]:disabled { cursor: progress; opacity: .72; box-shadow: inset 0 0 0 1px #ffffff5c; }
:where(.button-feedback) { position: relative; }
:is(button, a).button-feedback.button-feedback-active:not(:disabled) { box-shadow: inset 0 0 0 2px #4f9f6f5c, 0 0 0 3px #27785912; }
:where(button, a) > .button-feedback { position: absolute; inset: 0; pointer-events: none; border-radius: inherit; opacity: 0; background: #73b78e24; transition: opacity var(--motion-standard); }
:where(button, a).button-feedback-active > .button-feedback { opacity: 1; }
.form-error { overflow-wrap: anywhere; }
.form-error:not(:empty) { padding: 9px 11px; border: 1px solid #e6c0b7; border-radius: 8px; background: #fff3ee; color: #963f34; }

/* Image selection, organisation, and task controls use the same quiet emphasis. */
.gallery-card { transition: border-color var(--motion-standard), box-shadow var(--motion-standard); }
.gallery-card.active { border-color: #287b53; box-shadow: inset 0 0 0 1px #287b5340; }
.gallery-card:focus-within { border-color: #287b53; box-shadow: 0 0 0 2px #27785920; }
.gallery-card.checked { border-color: #287b53; box-shadow: 0 0 0 2px #277859; }
.gallery-open { display: block; border-radius: 0; }
.gallery-open:hover { background: #f4faf6; }
.gallery-open:active { background: #e2efe7; }
.gallery-open:focus-visible { outline-offset: -4px; }
.gallery-check { padding: 7px; box-shadow: 0 1px 5px #214b351a; }
.gallery-controls { gap: 6px; padding: 6px 7px; }
.gallery-controls button { min-width: 30px; min-height: 30px; border-radius: 6px; padding: 3px 6px; }
.gallery-controls button:hover:not(:disabled) { color: var(--accent); background: #e6f1ea; }
.gallery-controls button:active:not(:disabled) { background: #d9eadd; }
.gallery-controls button:last-child:hover:not(:disabled) { color: #8c302a; background: #fae9e5; }
.gallery-controls button:disabled { color: #6f8075; opacity: .42; }
.result-preview { transition: border-color var(--motion-standard), box-shadow var(--motion-standard); }
.result-preview:hover { border-color: var(--accent); box-shadow: 0 0 0 2px #27785918; }
.result-preview:active { box-shadow: inset 0 0 0 2px #277859; }
.project-card { transition: border-color var(--motion-standard), box-shadow var(--motion-standard); }
.project-card:focus-within { border-color: #287b53; box-shadow: 0 0 0 2px #27785920; }
.project-actions .outline-button { min-height: 36px; }
.group-picker { flex: 1 1 250px; }
.group-picker select { min-width: 0; }
.group-tools { gap: 9px; }
.image-actions { gap: 8px; }
.image-actions > span { min-width: 0; overflow-wrap: anywhere; }
.image-actions .outline-button { min-height: 34px; }
#group-save-status { min-height: 22px; font-size: 12px; }
#group-save-status.error { color: #9f3c34; }
.activity-strip > span { min-width: 0; overflow-wrap: anywhere; }
.activity-strip .text-button { flex-shrink: 0; }
.task-batch { scroll-margin-top: 88px; background: #ffffffd9; }
.task-item { transition: background-color var(--motion-standard); }
.task-item:hover { background: #f6faf7; }
.task-source img { display: block; }
.task-actions .outline-button { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; }
.task-actions a:active { background: #dfeee4; }
.task-id { overflow-wrap: anywhere; }
.task-meta, .batch-summary { font-variant-numeric: tabular-nums; }
.batch-heading > div:first-child { min-width: 0; }
.batch-attention { border: 1px solid #e5d3a9; }

/* Expandable help and preferences remain clear for pointer and keyboard use. */
.advanced-settings > summary { border-radius: 6px; transition: color var(--motion-standard), background-color var(--motion-standard); }
.advanced-settings > summary:hover { color: var(--accent); }
.advanced-settings[open] > summary { color: #245d40; font-weight: 600; }
.help-grid details { transition: border-color var(--motion-standard), background-color var(--motion-standard); }
.help-grid details:hover { border-color: #94b69f; }
.help-grid details[open] { border-color: #a7c7b3; background: #ffffffdf; }
.help-grid summary { line-height: 1.7; border-radius: 5px; }
.help-grid summary:hover { color: var(--accent); }
.help-grid summary::marker, .advanced-settings summary::marker { color: #54866a; }
.help-grid p:last-child { margin-bottom: 0; }
.settings-list > label { cursor: pointer; transition: background-color var(--motion-standard); }
.settings-list > label:hover { background: #f6faf7; }
.settings-list > label > span { min-width: 0; }
.settings-list select { flex-shrink: 0; }

/* Single-code access is intentionally compact: one field and one primary action. */
dialog { max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain; border-color: #bdd5c7; background: #fcfefcf5; scrollbar-width: thin; }
dialog h2 { line-height: 1.35; margin-bottom: 12px; }
.dialog-close { display: grid; place-items: center; min-width: 34px; min-height: 34px; border-radius: 9px; line-height: 1; }
.dialog-close:hover { color: #255e40; background: #e8f2ec; }
.dialog-close:active { background: #d8eadd; }
.access-intro { margin: 6px 0 20px; }
.access-intro p { margin: 9px 0 0; color: var(--muted); font-size: 14px; line-height: 1.8; }
.access-symbol { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 17px; border: 1px solid #bcd8c7; border-radius: 13px; background: #e4f2e9; color: #176b4c; font-size: 25px; }
.access-code-field { position: relative; min-width: 0; }
.access-code-field input { padding-right: 65px !important; }
#login-code { min-height: 47px; font-size: 14px; letter-spacing: .05em; }
#login-code::placeholder { letter-spacing: 0; }
.code-visibility { position: absolute; right: 6px; top: 6px; bottom: 6px; min-height: 34px; min-width: 48px; padding: 6px 8px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 12px; }
.code-visibility:hover:not(:disabled) { background: #e4efe8; color: var(--accent); }
.code-visibility:active:not(:disabled) { background: #d6e8dc; }
.code-visibility[aria-pressed=true] { color: #176b4c; background: #eaf3ed; }
.access-rules { display: grid; gap: 7px; padding: 15px 0 0; margin: 19px 0 0; border-top: 1px solid #d9e7de; color: var(--muted); font-size: 12px; line-height: 1.8; list-style: none; }
.access-rules > :is(li, p) { margin: 0; }
.account-summary { display: grid; gap: 9px; padding: 15px 16px; margin: 18px 0 14px; border: 1px solid #c4dbcd; border-radius: 11px; background: #edf6f0; }
.account-summary p { margin: 0; }
#account-space-id { overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.member-code-note { margin: 13px 0; color: var(--muted); font-size: 12px; line-height: 1.8; overflow-wrap: anywhere; }
.balance { padding: 12px 0 17px; }
.balance strong { font-variant-numeric: tabular-nums; line-height: 1.2; }
.activation-row { align-items: stretch; min-width: 0; }
.activation-row input { flex: 1; min-width: 0; }
.activation-row button { min-height: 44px; }
#auth-submit { min-height: 45px; }
#auth-error, #redeem-error { font-size: 12px; }
.auth-success .access-symbol { border-color: #6ca681; background: #d7eddf; color: #105a36; }
.auth-success { animation: status-flash var(--motion-standard) ease-out; }

/* Entry and close effects are explicit classes, so hidden views never affect layout. */
.view.view-entering { animation: view-enter var(--motion-standard) var(--motion-ease) both; }
dialog[open]::backdrop { animation: backdrop-enter var(--motion-standard) ease-out both; }
dialog.is-closing { animation: dialog-exit var(--motion-standard) ease-in both; pointer-events: none; }
dialog.is-closing::backdrop { animation: backdrop-exit var(--motion-standard) ease-in both; }
#large-preview { display: block; transition: opacity var(--motion-standard); }
#preview-modal.preview-loading::after, .canvas.preview-loading::after {
  content: '正在载入图片…'; position: absolute; inset: 50% 16px auto; padding: 12px; border-radius: 9px;
  background: #f0f7f2ee; color: #2a5c3f; font-size: 14px; text-align: center; pointer-events: none;
}
.preview-loading #large-preview, #large-preview.preview-loading, .canvas.preview-loading > img, .canvas > img.preview-loading { opacity: .35; }
.status-flash { animation: status-flash var(--motion-standard) ease-out; }
#toast { bottom: max(24px, env(safe-area-inset-bottom)); border-color: #b9d3c3; background: #fffffff2; backdrop-filter: blur(16px); color: #244f36; line-height: 1.7; text-align: center; transition: opacity var(--motion-standard), transform var(--motion-standard); }
@keyframes view-enter { from { opacity: .35; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes dialog-enter { from { opacity: 0; transform: translateY(6px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes dialog-exit { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(4px) scale(.99); } }
@keyframes backdrop-enter { from { opacity: 0; } to { opacity: 1; } }
@keyframes backdrop-exit { from { opacity: 1; } to { opacity: 0; } }
@keyframes status-flash { from { box-shadow: 0 0 0 3px #27785925; } to { box-shadow: 0 0 0 0 #27785900; } }

@media (max-width: 700px) {
  .batch-heading { gap: 10px; }
  .batch-progress-label span { font-size: 12px; }
  .activity-strip { flex-wrap: wrap; gap: 8px; }
  .task-actions .outline-button { min-height: 36px; }
}
@media (max-width: 600px) {
  .page-heading { padding-top: 22px; padding-bottom: 20px; }
  .topbar { gap: 8px; }
  .top-actions { gap: 6px; }
  #top-account { max-width: 142px; overflow: hidden; text-overflow: ellipsis; }
  .group-picker { flex-basis: 100%; }
  .settings-list > label { flex-wrap: wrap; padding: 17px 0; min-height: 96px; }
  .settings-list > label > span { flex: 1 1 145px; }
  .settings-list select { max-width: 100%; }
  dialog { padding: 26px 20px 22px; }
  .access-symbol { margin-bottom: 14px; }
  .confirm-actions { flex-wrap: wrap; }
}
@media (max-width: 400px) {
  .gallery { grid-template-columns: 1fr; }
  .canvas-toolbar { gap: 6px; }
  .canvas-file { gap: 4px; }
  #canvas-name { max-width: 90px; }
  .canvas-caption { padding: 16px; }
  .canvas-caption p { font-size: 12px; }
  .task-actions .result-preview { width: 100%; max-width: 150px; }
}

/* Keep the native cursor. Both motion preferences cover every late-added state and backdrop. */
.cursor-halo { pointer-events: none; }
html:has(body.no-motion), body.no-motion, body.no-motion *, body.no-motion *::before, body.no-motion *::after, body.no-motion dialog::backdrop {
  scroll-behavior: auto !important; transition: none !important; animation: none !important;
}
body.no-motion .ambient, body.no-motion .cursor-halo { display: none; }
@media (prefers-reduced-motion: reduce) {
  html, body, *, *::before, *::after, dialog::backdrop { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
  .ambient, .cursor-halo { display: none; }
}

/* Expansion is shown separately from the unchanged source image. */
.canvas.outpaint-canvas { background: repeating-conic-gradient(#cfddd4 0% 25%,#eef4f0 0% 50%) 50% / 24px 24px; }
.canvas.outpaint-canvas > img { width: 100%; height: 100%; max-width: 100%; aspect-ratio: auto; object-fit: contain; transform: scale(var(--outpaint-scale,.6667)); transition: transform .2s ease; }
.outpaint-canvas-label { position:absolute; top:12px; left:12px; right:12px; width:fit-content; padding:6px 10px; border:1px solid #a0bda9; border-radius:8px; background:#f8fcf9ed; color:#28513a; font-size:12px; pointer-events:none; }
.outpaint-amounts { display:flex; gap:6px; }
.outpaint-amounts button { flex:1; padding:9px 4px; font-size:12px; }
.canvas:has(>img.preview-loading)::after { content:'正在载入原图…'; position:absolute; left:50%; top:50%; transform:translate(-50%,-50%); color:#244d36; background:#f4faf6ed; border:1px solid #acc6b5; border-radius:9px; padding:10px 16px; pointer-events:none; }
@media(prefers-reduced-motion:reduce) { .canvas.outpaint-canvas > img { transition:none; } }

button.task-source { padding:0; cursor:zoom-in; }
button.task-source:hover { border-color:var(--accent, #237b61); }

/* Phones use the full canvas width and a labelled bottom navigation. */
@media (max-width: 760px), (max-width: 950px) and (max-height: 500px) {
  :root { --sidebar-width: 0px; --page-gutter: 16px; --mobile-nav-height: 70px; }
  html { scrollbar-gutter: auto; scroll-padding-bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom) + 16px); }
  body { background-attachment: scroll; }
  main { margin-left: 0; padding-left: max(var(--page-gutter), env(safe-area-inset-left)); padding-right: max(var(--page-gutter), env(safe-area-inset-right)); padding-bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom) + 20px); }
  .sidebar { position: relative; inset: auto; width: 100%; height: auto; overflow: visible; flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; padding: max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left)); border-right: 0; border-bottom: 1px solid var(--line); box-shadow: none; backdrop-filter: none; }
  .sidebar .brand { margin: 0; gap: 6px; font-size: 24px; letter-spacing: -1px; min-height: 44px; }
  .sidebar .brand-symbol { font-size: 26px; }
  .sidebar .brand-dot { display: inline; }
  .sidebar .nav-caption, .sidebar .account-card { display: none; }
  .sidebar > nav { position: fixed; inset: auto 0 0; z-index: 10; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 4px; padding: 7px max(10px, env(safe-area-inset-right)) calc(7px + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left)); border-top: 1px solid #aac5b5; background: #f9fdfaf5; backdrop-filter: blur(22px) saturate(140%); box-shadow: 0 -6px 24px #244f3610; }
  .sidebar > nav .nav-item { position: relative; min-width: 0; min-height: 56px; padding: 5px 2px; flex-direction: column; justify-content: center; gap: 3px; font-size: 12px; line-height: 1.4; white-space: nowrap; border-radius: 10px; }
  .sidebar > nav .nav-item > span { display: block; width: auto; font-size: 22px; line-height: 1.1; }
  .sidebar > nav .nav-item i { display: block; position: absolute; right: 9px; top: 3px; min-width: 17px; padding: 0 4px; font-size: 10px; background: #e0eee5; }
  .sidebar > nav .nav-item i:empty { display: none; }
  .sidebar-bottom { padding: 0; margin: 0; }
  .sidebar-bottom nav { display: flex; gap: 4px; }
  .sidebar-bottom .nav-item { display: flex; flex-direction: column; gap: 1px; min-width: 58px; min-height: 48px; padding: 3px 5px; font-size: 12px; line-height: 1.5; justify-content: center; }
  .sidebar-bottom .nav-item > span { width: auto; font-size: 18px; }
  .topbar { min-height: 60px; height: auto; padding: 8px 0; gap: 8px; }
  .topbar::before { left: 0; }
  .breadcrumb { font-size: 13px; }
  .breadcrumb span { margin: 0 5px; }
  .demo-badge { display: none; }
  #top-account { min-height: 44px; font-size: 13px; max-width: 155px; }
  .page-heading { padding: 19px 0; flex-wrap: wrap; gap: 12px; }
  h1 { font-size: 25px; line-height: 1.4; overflow-wrap: anywhere; }
  .page-heading p { font-size: 13px; line-height: 1.8; }
  .editor-layout { display: flex; flex-direction: column; gap: 18px; }
  body:has(.sidebar > nav [data-page="create"].active) .control-panel { order: -1; }
  body:has(.sidebar > nav [data-page="create"].active) #new-project { display: none; }
  .canvas-column, .control-panel { width: 100%; }
  .control-panel { padding: 18px; border-radius: 16px; }
  .canvas { height: clamp(220px, 62vw, 360px); }
  .canvas-toolbar { padding: 0 12px; }
  #canvas-name { max-width: min(44vw, 220px); }
  .canvas-caption h2 { font-size: 18px; }
  .canvas-caption p { font-size: 13px; }
  .canvas-bottom { gap: 6px; padding: 5px 12px; flex-wrap: wrap; }
  .canvas-bottom > div { gap: 8px; flex-wrap: wrap; }
  .style-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .style-button { justify-content: center; }
  .model-heading { align-items: center; }
  .model-heading select { flex: 1; width: 0; min-width: 160px; }
  input:not([type="checkbox"]):not([type="range"]), textarea, select, #login-code { min-height: 46px; font-size: 16px; }
  textarea { min-height: 130px; }
  button, .outline-button, .subtle-button, .text-button, .mode-button, .style-button, .image-actions .outline-button, .task-actions .outline-button, .project-actions .outline-button { min-height: 44px; }
  .text-button { padding: 8px 4px; }
  .generate-button { min-height: 50px; font-size: 16px; }
  .icon-button, .dialog-close { min-width: 44px; min-height: 44px; }
  .group-toolbar { padding: 14px; gap: 8px; }
  .group-picker { flex-basis: 100%; width: 100%; }
  .group-picker select { flex: 1; width: 0; min-width: 0; }
  .group-tools { width: 100%; margin-left: 0; justify-content: space-between; gap: 4px; }
  .image-actions { gap: 8px; }
  .image-actions select { flex: 1 1 130px; max-width: 100%; }
  .image-actions > label { display: flex; align-items: center; min-height: 44px; gap: 6px; }
  .gallery, .project-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .gallery-card img { height: 104px; }
  .gallery-check { min-width: 44px; min-height: 44px; align-items: center; justify-content: center; }
  .gallery-controls { padding: 4px; gap: 4px; }
  .gallery-controls button { min-width: 36px; min-height: 44px; padding: 4px; }
  .gallery-text b { font-size: 13px; }
  .help-grid { grid-template-columns: 1fr; }
  .help-grid details { padding: 16px; }
  .help-grid summary, .advanced-settings > summary { min-height: 44px; padding-top: 10px; padding-bottom: 10px; }
  .settings-list > label { flex-wrap: wrap; }
  dialog { width: min(460px, calc(100% - 24px)); max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); padding: 26px 20px max(22px, env(safe-area-inset-bottom)); scroll-padding: 20px; }
  .dialog-close { top: 8px; right: 8px; }
  .access-code-field input { padding-right: 72px !important; }
  .code-visibility { min-width: 56px; min-height: 44px; top: 2px; bottom: 2px; right: 2px; }
  .activation-row { flex-direction: column; }
  .activation-row button { width: 100%; }
  .task-batch { padding: 16px; scroll-margin-top: 74px; }
  .task-item { grid-template-columns: 62px minmax(0,1fr); gap: 12px; }
  .task-source { width: 62px; height: 62px; }
  .task-actions { grid-column: 1 / -1; flex-direction: row; align-items: center; flex-wrap: wrap; max-width: none; }
  .task-actions small { text-align: left; flex: 1 1 150px; max-width: none; }
  .task-actions .result-preview { width: 110px; height: 82px; }
  .batch-heading { flex-wrap: wrap; gap: 10px; }
  .batch-progress-label { display: flex; align-items: baseline; gap: 8px; text-align: left; }
  .batch-progress-label strong { font-size: 22px; }
  .batch-progress-label span { margin-top: 0; }
  .skip-link { left: 12px; }
  #toast { bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom) + 12px); max-width: calc(100% - 32px); }
}
@media (max-width: 420px) {
  .project-grid { grid-template-columns: 1fr; }
  .sidebar .brand { font-size: 22px; }
  .control-panel { padding: 16px; }
  .gallery-controls button { min-width: 44px; flex: 1; }
  .section-title { flex-wrap: wrap; }
  .outpaint-amounts { flex-wrap: wrap; }
  .outpaint-amounts button { flex: 1 1 72px; }
}
@media (hover: none) and (pointer: coarse) {
  .cursor-halo { display: none; }
}
@media (max-width: 360px) {
  .gallery { grid-template-columns: 1fr; }
  .gallery-card img { height: 144px; }
}

/* Compact inspiration library and the reserved custom-development advertisement. */
.top-actions { gap: 12px; }
.custom-ad { display: flex; align-items: center; gap: 9px; padding: 7px 12px; min-height: 44px; border: 1px solid #b6ccbf; border-radius: 11px; background: linear-gradient(110deg,#e4f2e9e8,#ffffffd9); color: #214c37; text-align: left; box-shadow: 0 2px 10px #244c3708; backdrop-filter: blur(12px); transition: background .2s, border-color .2s, transform .2s; }
.custom-ad:hover { border-color: #588969; background: #e4f2e9; transform: translateY(-1px); }
.custom-ad-icon { font-size: 20px; }
.custom-ad strong { display: block; font-size: 13px; font-weight: 650; line-height: 1.5; }
.custom-ad small { display: block; font-size: 11px; color: #476653; line-height: 1.5; }
.custom-ad-label { display: inline-block; margin: 8px 0 16px; padding: 5px 9px; border-radius: 6px; background: #e7f2eb; color: #295c40; font-size: 12px; }
.custom-ad-modal h2 { max-width: 300px; line-height: 1.5; font-size: 25px; color: #173e2b; }
.custom-ad-modal > p { margin: 14px 0; color: #475b50; font-size: 14px; line-height: 1.9; }
.custom-services { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0; }
.custom-services span { border: 1px solid #c9d8cf; border-radius: 8px; background: #f6faf7; padding: 8px 11px; font-size: 13px; color: #354e40; }
.custom-contact-slot { display: grid; gap: 8px; padding: 18px; border: 1px dashed #9bb8a5; border-radius: 12px; background: #f1f7f3; }
.custom-contact-slot > span { font-size: 12px; color: #476653; }
.custom-contact-slot strong { color: #244d36; font-size: 16px; }
.custom-contact-slot small { font-size: 12px; color: #52685a; }
.prompt-templates { margin: 0 0 18px; border: 1px solid #b9d0c2; border-radius: 10px; background: #f5faf7; }
.prompt-templates > summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px; min-height: 46px; cursor: pointer; color: #254e37; font-weight: 600; font-size: 14px; list-style: none; border-radius: 10px; }
.prompt-templates > summary::-webkit-details-marker { display: none; }
.prompt-templates > summary::after { content: '+'; font-size: 18px; font-weight: 400; }
.prompt-templates[open] > summary::after { content: '−'; }
.prompt-templates > summary small { margin-left: auto; font-size: 11px; font-weight: 500; color: #4b6656; }
.prompt-templates > summary:hover { background: #e8f3ec; }
.template-body { padding: 0 12px 12px; }
.template-intro { font-size: 12px; color: #506258; line-height: 1.8; margin: 0 0 10px; }
.template-categories { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.template-categories button { border: 1px solid #c6d5cc; background: #fff; color: #43594b; border-radius: 7px; padding: 6px 8px; font-size: 12px; min-height: 34px; transition: background .18s, border-color .18s; }
.template-categories button.active { background: #dceee2; border-color: #6d9d7e; color: #173f28; font-weight: 600; }
#template-search { width: 100%; min-width: 0; min-height: 38px; margin-bottom: 10px; font-size: 13px; padding: 8px 10px; background: #fff; border: 1px solid #bdcfc3; border-radius: 8px; }
.template-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
.template-card { min-width: 0; min-height: 69px; padding: 10px; border: 1px solid #c9d8ce; border-radius: 8px; background: #fff; text-align: left; color: #284331; transition: border-color .18s, background .18s, box-shadow .18s; }
.template-card strong { display: block; font-size: 13px; line-height: 1.6; }
.template-card small { display: block; margin-top: 4px; font-size: 11px; color: #52675a; line-height: 1.6; }
.template-card:hover { border-color: #6c9a7d; background: #f3f9f5; }
.template-card.active { border-color: #43825c; box-shadow: inset 0 0 0 1px #43825c; background: #e6f3eb; }
.template-card.active strong::after { content: ' ✓'; color: #2c6943; }
.template-more { width: 100%; border: 0; border-radius: 6px; background: transparent; padding: 10px 4px 4px; min-height: 38px; color: #2d6745; font-size: 12px; }
.template-more:hover { background: #e6f2ea; }
.template-feedback { margin: 9px 0 0; font-size: 11px; color: #506459; line-height: 1.8; }
.template-selection { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 8px; border-top: 1px solid #c9dccf; padding-top: 6px; color: #275c3b; font-size: 12px; }
.template-selection .text-button { margin-left: auto; font-size: 12px; }
.template-empty { grid-column: 1/-1; margin: 6px 0; color: #52675a; font-size: 12px; line-height: 1.8; }
@media (max-width: 1100px) and (min-width: 701px) {
  .custom-ad small, .top-actions .demo-badge { display: none; }
}
@media (max-width: 700px) {
  .topbar { flex-wrap: wrap; }
  .top-actions { gap: 8px; margin-left: auto; }
  .custom-ad { padding: 7px 9px; gap: 6px; }
  .custom-ad small, .custom-ad-icon { display: none; }
  .custom-ad strong { font-size: 12px; }
  .template-categories button, .template-more { min-height: 44px; }
  #template-search { min-height: 44px; font-size: 16px; }
  .template-card { min-height: 78px; }
  .template-card small { font-size: 12px; }
}
@media (max-width: 480px) {
  .topbar > .breadcrumb { display: none; }
  .top-actions { width: 100%; justify-content: space-between; }
}
