:root {
  color-scheme: light;
  color: #192548;
  background: #eff2fb;
  --ink: #26376d;
  --muted: #445475;
  --line: #cbd4ec;
  --panel: #fcfdff;
  font-family: "Avenir Next", Avenir, system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
a { color: var(--ink); text-underline-offset: 4px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: default; }
:focus-visible { outline: 3px solid #5270ce; outline-offset: 3px; }
header, footer { display: flex; align-items: center; gap: 16px; padding: 12px max(16px, calc((100% - 1100px)/2)); font-size: 14px; }
header { justify-content: space-between; background: var(--panel); border-bottom: 1px solid var(--line); }
.brand { display: flex; gap: 8px; align-items: center; text-decoration: none; font-weight: 750; }
.brand img { border-radius: 9px; }
main { width: min(calc(100% - 32px),1100px); margin: clamp(26px,5vw,60px) auto 22px; }
.intro { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 21px; }
h1 { font-size: clamp(38px,6vw,66px); line-height: 1.03; letter-spacing: -.054em; margin: 0; font-weight: 760; }
.intro p { margin: 10px 0 0; color: var(--muted); }
.toolbar, .row { background: var(--panel); border: 1px solid var(--line); border-radius: 11px; }
.toolbar { display: grid; grid-template-columns: minmax(0,1fr) 160px auto; align-items: start; gap: 14px; padding: 12px 14px; }
label { display: grid; gap: 4px; min-width: 0; font-size: 13px; font-weight: 680; }
input:not([type=file]), textarea, select { padding: 8px; width: 100%; min-width: 0; border: 1px solid #aebbdc; border-radius: 6px; background: white; color: #192548; font-size: 14px; font-weight: 500; }
textarea { resize: vertical; }
textarea:disabled { background: #edf0f8; }
small { font-size: 11px; font-weight: 500; color: var(--muted); }
.export { display: flex; gap: 12px; justify-content: space-between; align-items: center; padding-top: 18px; }
.export output, #status, .guidance, .characters { color: var(--muted); font-size: 13px; font-weight: 500; }
#status { margin: 7px 0; min-height: 19px; }
#status.error { color: #9f2b43; }
.primary, .outline, .subtle { border: 1px solid var(--ink); white-space: nowrap; padding: 8px 11px; border-radius: 7px; font-size: 13px; font-weight: 720; }
.primary { color: #fff; background: var(--ink); }
.outline { color: var(--ink); background: #f4f6ff; }
.subtle { color: var(--muted); border-color: var(--line); background: transparent; }
.rows { display: grid; gap: 9px; margin: 0 0 11px; padding: 0; list-style: none; }
.row { display: grid; grid-template-columns: 158px minmax(0,1fr) auto; align-items: stretch; gap: 14px; padding: 11px; }
.visual { position: relative; border-radius: 8px; min-height: 125px; display: grid; place-items: center; overflow: hidden; background: #e7edfb; }
.visual img { position: absolute; display: none; width: 100%; height: 100%; object-fit: cover; }
.visual img[src] { display: block; }
.pick { position: absolute; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 5px; background: #fff; color: var(--ink); padding: 7px; }
.pick:focus-within { outline: 3px solid #5270ce; }
.visual img[src] + .pick { bottom: 4px; left: 5px; }
.file { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.row-fields { display: grid; grid-template-columns: minmax(0,1fr) 145px; gap: 9px; }
.alt-field { margin-top: 7px; }
.alt-field span { display: flex; justify-content: space-between; }
.guidance { margin: 3px 0 0; }
.actions { display: flex; flex-direction: column; justify-content: center; gap: 6px; }
footer { flex-wrap: wrap; color: var(--muted); }
.info { max-width: 740px; line-height: 1.65; }
.info h1 { font-size: 41px; }
@media (max-width: 750px) {
  .row { grid-template-columns: 118px minmax(0,1fr); gap: 8px; }
  .actions { grid-column: 1/-1; flex-direction: row; justify-content: flex-start; }
  .toolbar { grid-template-columns: minmax(0,1fr) 130px; gap: 10px; }
  .export { grid-column: 1/-1; padding: 0; }
}
@media (max-width: 490px) {
  .row { grid-template-columns: minmax(0,1fr); }
  .visual { min-height: 120px; }
  .visual img { object-fit: contain; }
  .row-fields { grid-template-columns: minmax(0,1fr) 120px; }
}
