:root {
  --bg: #f4f5f7; --card: #fff; --text: #1d2330; --muted: #677085; --line: #e1e4ea;
  --primary: #2357d9; --danger: #c0392b; --ok: #1e8449; --warn: #b9770e;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.45; }
header.top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: .75rem 1.25rem; background: var(--card); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; color: var(--text); text-decoration: none; font-size: 1.1rem; }
nav { display: flex; gap: 1.25rem; align-items: center; flex-wrap: wrap; }
nav a { color: var(--text); text-decoration: none; }
main { max-width: 1180px; margin: 0 auto; padding: 1rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.25rem; margin-bottom: 1rem; }
.card.narrow { max-width: 420px; margin: 3rem auto; }
h1 { font-size: 1.5rem; margin: .2rem 0 .6rem; }
h2 { font-size: 1.15rem; margin: .2rem 0 .8rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mono { font-family: ui-monospace, monospace; }
.big { font-size: 1.2rem; }
.row { display: flex; gap: .75rem; align-items: center; }
.row.wrap { flex-wrap: wrap; align-items: flex-end; }
.row.between { justify-content: space-between; flex-wrap: wrap; }
label { display: flex; flex-direction: column; gap: .25rem; margin-bottom: .6rem; font-weight: 500; }
label.radio { flex-direction: row; align-items: center; font-weight: 400; }
input[type=text], input[type=password], select, textarea { font: inherit; padding: .5rem .6rem; border: 1px solid var(--line);
  border-radius: 6px; background: #fff; min-width: 12rem; }
textarea { width: 100%; resize: vertical; }
button, .btn { font: inherit; padding: .45rem .8rem; border-radius: 6px; border: 1px solid var(--line); background: #fff;
  color: var(--text); cursor: pointer; text-decoration: none; display: inline-block; font-size: .9rem; }
button.primary { background: var(--primary); border-color: var(--primary); color: #fff; padding: .55rem 1.1rem; }
button:disabled { opacity: .5; cursor: not-allowed; }
button.link { border: 0; background: none; padding: 0; color: var(--primary); }
.danger { color: var(--danger); }
.btn.danger { border-color: #e8b4ae; }
form.inline { display: inline; margin: 0; }
.flash { padding: .6rem .9rem; border-radius: 6px; margin-bottom: .75rem; background: #e8f6ee; border: 1px solid #b7e1c7; }
.flash.error { background: #fdecea; border-color: #f2b8b0; }
.flash.warn { background: #fef5e7; border-color: #f5d29a; }
table.list { width: 100%; border-collapse: collapse; font-size: .95rem; }
table.list th, table.list td { text-align: left; padding: .45rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.status-done { color: var(--ok); } .status-failed { color: var(--danger); } .status-running, .status-queued { color: var(--warn); }
.grid { display: grid; gap: .75rem; }
.grid.photos { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); margin-bottom: .75rem; }
.grid.gallery { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); align-items: start; }
figure { margin: 0; }
.thumb img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; display: block; }
.thumb figcaption { font-size: .8rem; color: var(--muted); display: flex; justify-content: space-between; padding-top: .2rem; }
.card-img { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fafbfc; }
.card-img img { width: 100%; display: block; max-height: 360px; object-fit: contain; background: #eceef2; }
.card-img figcaption { padding: .6rem; }
.actions { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .5rem; }
.prompt { margin-top: .2rem; color: var(--muted); }
.estimate { margin: .6rem 0; padding: .6rem .8rem; background: #eef3ff; border: 1px solid #cddbff; border-radius: 6px; }
.upload { flex-wrap: wrap; margin-bottom: .5rem; }
.tips ul { margin: .4rem 0; padding-left: 1.2rem; }
@media (max-width: 640px) {
  main { padding: .5rem; }
  .card { padding: .8rem; }
  input[type=text], select { min-width: 0; width: 100%; }
  .row { flex-wrap: wrap; }
}
