@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/fonts/plus-jakarta-sans-latin.woff2') format('woff2');
}
:root {
  color-scheme: light;
  --bg: #f5f7f7;
  --bg-2: #fff;
  --bg-3: #edf2f1;
  --line: #dce3e1;
  --input-line: #859590;
  --text: #20332e;
  --muted: #596b65;
  --amber: #0d6b55;
  --blue: #0d6b55;
  --indigo: #557b71;
  --teal: #0d6b55;
  --danger: #b53629;
  --ok: #0d6b55;
  --shadow: 0 12px 40px #20332e18;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 14px;
}
* { box-sizing: border-box; }
html { scroll-padding: 24px; }
html, body { margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); min-height: 100vh; padding-bottom: 88px; }
img, svg, video { max-width: 100%; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: middle; }
button, input, select, textarea, summary { font: inherit; color: inherit; }
button, .linkish, summary { touch-action: manipulation; cursor: pointer; }
button, .linkish {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px;
  min-height: 44px; padding: 10px 14px; font-weight: 600; text-decoration: none;
  transition: background 160ms, border-color 160ms, color 160ms;
}
button:hover, .linkish:hover { background: var(--bg-3); border-color: var(--input-line); }
button:active, .linkish:active { background: #dce8e3; }
button:disabled { opacity: .42; cursor: default; }
button.primary, a.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
button.primary:hover, a.primary:hover { background: #08513f; }
input, select, textarea { background: var(--bg-2); border: 1px solid var(--input-line); border-radius: 8px; min-height: 44px; padding: 10px 12px; width: 100%; min-width: 0; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
textarea { resize: vertical; }
label { display: grid; gap: 8px; font-size: 13px; font-weight: 600; color: var(--text); }
label span, .hint, .foot, .eyebrow { color: var(--muted); }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1, h2, h3 { font-weight: 700; letter-spacing: -.04em; text-wrap: balance; }
h1 { margin: 0; font-size: 20px; }
h2 { margin: 0; font-size: 32px; }
h3 { margin: 24px 0 12px; font-size: 18px; }
p { line-height: 1.65; }
code { background: var(--bg-3); padding: 2px 5px; border-radius: 4px; }
a { color: var(--teal); }
.skip { position: absolute; left: 16px; top: -80px; background: var(--bg-2); color: var(--text); padding: 12px; z-index: 80; }
.skip:focus { top: 8px; }
.top { display: flex; justify-content: space-between; gap: 24px; align-items: center; min-height: 88px; padding: 16px 32px; background: var(--bg-2); border-bottom: 1px solid var(--line); }
.brand { display: flex; gap: 12px; align-items: center; }
.brand-mark { background: var(--teal); color: #fff; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; }
.brand-mark .icon { width: 24px; height: 24px; }
.eyebrow { margin: 0 0 4px; letter-spacing: .16em; text-transform: uppercase; font-size: 10px; font-weight: 700; }
.top-meta { display: flex; align-items: center; gap: 24px; }
.top-meta p { margin: 0; color: var(--muted); font-size: 13px; }
#lib-count::before { content: ''; display: inline-block; width: 6px; height: 6px; background: var(--teal); border-radius: 50%; margin-right: 8px; }
.library-menu { position: relative; }
.library-menu summary { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; font-weight: 600; background: var(--bg-2); list-style: none; }
summary::-webkit-details-marker { display: none; }
.top-actions { position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; width: 200px; padding: 8px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.top-actions button { width: 100%; margin-bottom: 4px; }
[data-action='clear-library'], [data-action='prompt-del'] { color: var(--danger); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row > input, .row > select { width: auto; max-width: 100%; }
.row > input { flex: 1 1 160px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 160px; }
.stack { display: grid; gap: 12px; }
.tabs { position: fixed; left: 0; top: 88px; bottom: 0; width: 224px; padding: 32px 20px; display: flex; flex-direction: column; gap: 8px; border-right: 1px solid var(--line); background: var(--bg-2); overflow-y: auto; }
.nav-label { margin: 0 12px 16px; color: var(--muted); text-transform: uppercase; font-size: 10px; font-weight: 700; letter-spacing: .15em; }
.tabs button { justify-content: flex-start; gap: 12px; background: transparent; border-color: transparent; padding: 12px; font-weight: 500; color: var(--muted); }
.tabs button:hover { background: var(--bg-3); color: var(--text); }
.tabs button[aria-current='page'] { background: #e1efe8; color: var(--teal); font-weight: 700; }
.tabs button[data-view='settings'] { margin-top: 24px; }
.tabs button[data-view='install'] { margin-top: 8px; border-top-color: var(--line); border-radius: 0; }
.nav-note { margin: auto 12px 0; padding-top: 32px; line-height: 1.6; font-size: 15px; font-weight: 600; }
.nav-note span { display: block; margin-top: 12px; color: var(--muted); font-size: 10px; font-weight: 400; }
.banner, main, .foot { margin-left: 264px; margin-right: 40px; max-width: 1440px; }
.banner { margin-top: 24px; display: flex; align-items: flex-start; gap: 16px; justify-content: space-between; padding: 12px 16px; border: 1px solid #c8ded3; background: #edf6f0; border-radius: 10px; }
.sample-note { flex: 1; }
.sample-note summary { display: flex; gap: 8px; align-items: center; font-size: 13px; min-height: 24px; font-weight: 600; list-style: none; }
.sample-note summary .icon { margin-left: auto; width: 16px; height: 16px; }
.sample-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); flex: none; }
.sample-caption { font-weight: 400; color: var(--muted); }
.sample-note p { font-size: 13px; margin: 12px 0 0; max-width: 80ch; }
.banner button { min-height: 24px; padding: 0 2px; border: 0; background: transparent; font-size: 12px; color: var(--teal); text-decoration: underline; }
main { padding-top: 32px; }
.panel-head { display: flex; justify-content: space-between; gap: 20px; align-items: center; flex-wrap: wrap; margin-bottom: 24px; }
.panel-head .hint { margin: 8px 0 0; max-width: 85ch; }
.section-eyebrow { color: var(--teal); margin-bottom: 8px; }
.searchbar { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(480px, 1fr); gap: 16px; padding: 20px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; }
.filter-fields { display: grid; grid-template-columns: 132px minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.search-filters summary { display: flex; justify-content: space-between; align-items: center; min-height: 44px; font-size: 13px; font-weight: 600; list-style: none; }
.search-filters[open] summary { margin-bottom: 16px; }
@media (min-width: 768px) { .search-filters[open] summary { display: none; } }
.search-input { position: relative; display: flex; align-items: center; }
.search-input > .icon { position: absolute; left: 12px; pointer-events: none; color: var(--muted); }
#q { padding-left: 40px; padding-right: 88px; }
kbd { position: absolute; right: 10px; font-family: inherit; font-size: 10px; font-weight: 500; color: var(--muted); padding: 3px 5px; border: 1px solid var(--line); border-radius: 4px; pointer-events: none; }
.pager-line { display: flex; gap: 16px; justify-content: space-between; align-items: center; flex-wrap: wrap; margin: 24px 0 16px; }
.pager-line p { margin: 0; font-weight: 600; }
.pager { display: flex; gap: 8px; align-items: center; }
.pager button { padding: 8px 12px; min-height: 36px; font-size: 12px; }
.pager span { color: var(--muted); font-size: 12px; padding: 0 4px; font-variant-numeric: tabular-nums; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
.card { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; min-width: 0; transition: border-color 160ms; }
.card:hover { border-color: var(--input-line); }
.card.is-selected { outline: 2px solid var(--blue); }
.card-open { display: flex; flex-direction: column; align-items: stretch; gap: 0; text-align: left; background: transparent; border: 0; border-radius: 0; padding: 0; width: 100%; font-weight: 500; }
.card-open:hover { background: transparent; }
.art { display: grid; place-items: center; aspect-ratio: 16 / 9; position: relative; background: hsl(var(--hue) 18% 91%); color: #536e61; width: 100%; border-bottom: 1px solid var(--line); }
.art-preview { display: grid; justify-items: center; gap: 8px; }
.art-preview .icon { width: 36px; height: 36px; stroke-width: 1.2; }
.art-preview span { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; font-weight: 500; }
.kind, .art-id { position: absolute; font-size: 10px; }
.kind { left: 12px; top: 12px; text-transform: uppercase; letter-spacing: .08em; border-radius: 4px; padding: 4px 6px; background: #fff; color: var(--text); }
.art-id { right: 12px; bottom: 10px; font-family: ui-monospace, monospace; color: #52695d; }
.prompt { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; padding: 16px 16px 0; height: 82px; line-height: 1.6; overflow-wrap: anywhere; font-size: 14px; }
.card-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 12px 16px 16px; margin-top: auto; }
.card-row button { font-size: 11px; padding: 7px 9px; min-height: 32px; }
.card-row .textlink { flex: 1; font-size: 11px; font-weight: 600; text-decoration: none; }
.card-row .textlink:hover { text-decoration: underline; }
.card-row .hint { font-size: 11px; width: 100%; }
.textlink { color: var(--teal); }
.check { display: flex; gap: 8px; align-items: center; padding: 8px 12px; min-height: 44px; }
.check input, .checkline input { width: 20px; height: 20px; min-height: 0; accent-color: var(--teal); flex: none; }
.tag-layout { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 24px; margin-top: 24px; }
.sidebar { display: flex; flex-direction: column; gap: 8px; }
.sidebar button { justify-content: flex-start; text-align: left; }
.sidebar button[aria-current='true'] { border-color: var(--teal); color: var(--teal); background: #e1efe8; }
.log, .preview { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 20px; white-space: pre-wrap; overflow-wrap: anywhere; min-height: 100px; line-height: 1.65; }
.prompt-list { display: grid; gap: 12px; margin-top: 24px; }
.prompt-item { display: flex; gap: 8px; align-items: stretch; min-width: 0; }
.prompt-use { flex: 1; min-width: 0; text-align: left; justify-content: flex-start; align-items: flex-start; padding: 16px; line-height: 1.6; }
.prompt-use > span { overflow-wrap: anywhere; min-width: 0; }
.badge { flex: none; background: #e1efe8; color: var(--teal); border-radius: 4px; padding: 2px 8px; font-size: 11px; }
.settings { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; max-width: 900px; }
.settings .wide, .settings .row, #filename-preview { grid-column: 1 / -1; }
label > span { font-weight: 400; line-height: 1.6; }
.steps { padding-left: 24px; max-width: 80ch; }
.steps li { margin: 16px 0; line-height: 1.7; padding-left: 8px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; }
.stat { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 24px; }
.stat b { display: block; font-size: 32px; font-variant-numeric: tabular-nums; color: var(--teal); margin-bottom: 8px; }
.chart { display: flex; align-items: flex-end; gap: 8px; height: 160px; margin-top: 16px; }
.bar-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.bar { width: 100%; max-width: 40px; background: var(--teal); border-radius: 4px 4px 0 0; }
.bar-lbl { font-size: 10px; color: var(--muted); max-width: 100%; overflow-wrap: anywhere; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { background: var(--bg-2); border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px; font-size: 13px; overflow-wrap: anywhere; }
.chip b { color: var(--teal); margin-left: 8px; }
dialog { color: var(--text); }
dialog::backdrop { background: #182c25a6; }
.detail, .modal { position: fixed; inset: 0; margin: 0; border: 0; width: 100%; height: 100%; max-width: none; max-height: none; }
.detail { background: var(--bg); overflow: auto; padding: 32px 24px 48px; }
.detail-card { width: min(760px, 100%); margin: 0 auto; }
.detail-art { display: flex; align-items: flex-end; min-height: 280px; border-radius: 16px; margin: 24px 0; padding: 32px; background: hsl(var(--hue) 18% 91%); }
.detail-prompt { margin: 0; max-width: 36rem; font-size: 28px; line-height: 1.5; }
.modal { background: transparent; display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal-box { width: min(560px, 100%); max-height: calc(100dvh - 48px); overflow: auto; background: var(--bg-2); border: 1px solid var(--line); border-radius: 16px; padding: 28px; box-shadow: var(--shadow); }
.modal-box h2 { font-size: 24px; margin-bottom: 16px; }
.modal-box > label, .modal-box > .row, .modal-box > .stack { margin-top: 16px; }
.checkline { display: flex; gap: 8px; align-items: center; color: var(--text); min-height: 44px; }
.checklist { display: grid; gap: 8px; margin: 16px 0; }
table { width: 100%; border-collapse: collapse; }
td { border-bottom: 1px solid var(--line); padding: 8px 4px; overflow-wrap: anywhere; }
td:last-child { text-align: right; color: var(--muted); }
.errors { color: var(--danger); }
.dock { position: fixed; right: 24px; bottom: max(20px, env(safe-area-inset-bottom)); z-index: 30; display: flex; flex-direction: column-reverse; align-items: flex-end; gap: 8px; }
.dock > button { pointer-events: auto; box-shadow: var(--shadow); }
#dock-toggle { background: var(--text); color: #fff; border-color: var(--text); }
.dock:not(.expanded) > button:not(#dock-toggle) { display: none; }
.dock.style-classic #dock-dash, .dock.style-classic #dock-dl, .dock.style-classic #dock-tags, .dock.style-classic #dock-prompts { background: var(--teal); color: #fff; border-color: var(--teal); }
.dock.style-light > button { background: var(--bg-2); color: var(--text); border-color: var(--line); box-shadow: none; }
.dock.style-compact { flex-direction: row-reverse; align-items: center; gap: 8px; }
.dock.style-compact > button { width: 44px; height: 44px; padding: 0; border-radius: 50%; }
.dock.style-compact .dock-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
body.is-detail .dock { display: none; }
.runbar { position: fixed; left: 240px; bottom: 20px; z-index: 35; width: min(420px, calc(100% - 450px)); background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; box-shadow: var(--shadow); display: flex; gap: 8px; align-items: center; }
.runbar p { margin: 0; flex: 1; font-size: 13px; overflow-wrap: anywhere; }
#toasts { position: fixed; left: 240px; bottom: 96px; z-index: 36; display: flex; flex-direction: column; gap: 8px; width: min(340px, calc(100% - 32px)); pointer-events: none; }
.toast { background: var(--bg-2); border: 1px solid var(--line); border-left: 3px solid var(--blue); border-radius: 10px; padding: 12px 16px; box-shadow: var(--shadow); opacity: 0; transform: translateY(6px); }
.toast.show { opacity: 1; transform: none; transition: opacity 180ms, transform 180ms; }
.toast.success { border-left-color: var(--ok); }
.toast.error { border-left-color: var(--danger); }
.foot { padding: 32px 0 16px; font-size: 11px; }
.empty-copy { color: var(--muted); }
.empty-state { padding: 48px 24px; background: var(--bg-2); border: 1px dashed var(--input-line); border-radius: 12px; text-align: center; }
.empty-state > .icon { color: var(--teal); width: 32px; height: 32px; }
.empty-state h3 { margin-top: 16px; }
.empty-state .row { justify-content: center; margin-top: 24px; }
.prompt-list > .empty-copy, .grid > .empty-copy { padding: 24px; background: var(--bg-2); border: 1px dashed var(--input-line); border-radius: 12px; grid-column: 1 / -1; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; }
[hidden], dialog:not([open]) { display: none !important; }
@media (min-width: 1800px) { .banner, main, .foot { margin-left: auto; margin-right: auto; } }
@media (max-width: 1200px) {
  .tabs { width: 192px; padding: 24px 16px; }
  .banner, main, .foot { margin-left: 220px; margin-right: 28px; }
  .searchbar { grid-template-columns: minmax(0, 1fr); }
  .runbar, #toasts { left: 208px; }
  kbd { display: none; }
  #q { padding-right: 12px; }
}
@media (max-width: 767px) {
  :root { font-size: 16px; }
  .top { padding: 16px 20px; display: block; }
  .brand { gap: 10px; }
  .brand-mark { width: 36px; height: 36px; }
  h1 { font-size: 18px; }
  h2 { font-size: 27px; }
  .top-meta { justify-content: space-between; margin-top: 8px; gap: 8px; }
  .top-meta p { font-size: 11px; }
  .library-menu summary { font-size: 12px; padding: 8px 10px; }
  .tabs { position: static; width: 100%; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 8px 16px; gap: 8px; border-right: 0; border-bottom: 1px solid var(--line); }
  .tabs button { padding: 8px 4px; min-height: 44px; justify-content: center; gap: 6px; font-size: 11px; }
  .tabs .icon { width: 15px; height: 15px; }
  .tabs button[data-view='settings'], .tabs button[data-view='install'] { margin: 0; border: 0; border-radius: 8px; }
  .nav-label, .nav-note { display: none; }
  .banner, main, .foot { margin-left: 20px; margin-right: 20px; }
  .banner { margin-top: 20px; padding: 6px 12px; gap: 10px; align-items: center; }
  .banner button { min-width: 44px; min-height: 44px; }
  .sample-note summary { min-height: 44px; font-size: 11px; flex-wrap: wrap; gap: 6px; }
  .sample-caption { display: none; }
  .sample-note p { font-size: 14px; }
  main { padding-top: 20px; }
  .panel-head { gap: 16px; margin-bottom: 20px; }
  .panel-head .hint { font-size: 13px; }
  .section-eyebrow { display: none; }
  .search-actions { width: 100%; }
  .search-actions button { font-size: 12px; padding: 10px 12px; }
  .search-actions #export-search { flex: 1; }
  .searchbar { padding: 12px; gap: 8px; grid-template-columns: minmax(0, 1fr); }
  .filter-fields { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px 12px; }
  .searchbar .search-field { grid-column: 1 / -1; }
  .searchbar label[for='sort'] { grid-column: 1 / -1; }
  input, select, textarea { font-size: 16px; }
  input[type='date'] { padding: 10px 6px; font-size: 14px; }
  .pager-line { gap: 12px; margin-top: 16px; }
  .pager { width: 100%; justify-content: space-between; }
  .pager button { min-height: 44px; min-width: 44px; }
  .grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .card-open { flex-direction: row; align-items: stretch; }
  .art { width: 104px; aspect-ratio: 1 / 1; flex: none; border-bottom: 0; border-right: 1px solid var(--line); }
  .art-preview .icon { width: 28px; height: 28px; }
  .art-preview span { display: none; }
  .kind { top: 8px; left: 8px; font-size: 9px; }
  .art-id { bottom: 8px; right: 8px; font-size: 9px; }
  .prompt { font-size: 14px; height: auto; min-height: 104px; padding: 12px; -webkit-line-clamp: 4; }
  .card-row { padding-top: 16px; }
  .card-row button, .card-row .textlink { font-size: 12px; min-height: 44px; }
  .card-row .textlink { display: flex; align-items: center; }
  .tag-layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { flex-direction: row; flex-wrap: wrap; }
  .sidebar button { font-size: 13px; }
  .settings { grid-template-columns: minmax(0, 1fr); }
  .prompt-use { flex-wrap: wrap; }
  .modal { padding: 16px; }
  .modal-box { padding: 20px; max-height: calc(100dvh - 32px); }
  .modal-box .row > button { flex: 1 1 auto; }
  .dock { right: 16px; }
  .dock > button { width: 44px; height: 44px; padding: 0; border-radius: 50%; }
  .dock .dock-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .runbar { left: 16px; width: calc(100% - 88px); }
  #toasts { left: 16px; }
  .detail-prompt { font-size: 24px; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { padding: 16px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
