:root { --accent: #1f3a5f; --accent-text: #fff; --text: #1f2937; --muted: #6b7280; --border: #e5e7eb; --bg: #f7f7f8; --ok: #15803d; --err: #b91c1c; --warn: #b45309; --radius: 8px; }
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; color: var(--text); background: var(--bg); }
body.centered { display: grid; place-items: center; min-height: 100vh; padding: 1rem; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem 1.25rem; background: #fff; border-bottom: 1px solid var(--border); }
.brand { font-weight: 700; color: var(--text); text-decoration: none; font-size: 1.1rem; }
.top nav { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.top nav a { color: var(--muted); text-decoration: none; }
.top nav a:hover { color: var(--text); }
.page { max-width: 1100px; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; }
h1 { font-size: 1.6rem; margin: 0 0 1rem; }
h2 { font-size: 1.2rem; margin: 1.5rem 0 .75rem; }
.card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }
.card.narrow { max-width: 420px; width: 100%; }
label { display: block; margin: .75rem 0; font-weight: 600; }
label input, label select, label textarea { display: block; width: 100%; margin-top: .3rem; padding: .55rem .7rem; font: inherit; border: 1px solid var(--border); border-radius: 6px; }
label textarea { min-height: 6rem; }
button, .btn { display: inline-block; padding: .6rem 1rem; font: inherit; font-weight: 600; border: 1px solid var(--border); border-radius: 6px; background: #fff; color: var(--text); cursor: pointer; text-decoration: none; }
button.primary, .btn.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
button.big, .btn.big { font-size: 1.15rem; padding: .9rem 1.4rem; }
button.danger { color: var(--err); border-color: var(--err); }
button.link { background: none; border: none; padding: 0; color: var(--muted); font-weight: 400; cursor: pointer; }
form.inline { display: inline; }
.flash { padding: .75rem 1rem; border-radius: 6px; margin-bottom: 1rem; }
.flash.ok { background: #ecfdf5; color: var(--ok); }
.flash.error { background: #fef2f2; color: var(--err); }
.flash.warn { background: #fffbeb; color: var(--warn); }
table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
th, td { text-align: left; padding: .65rem .8rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: .85rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
tr:last-child td { border-bottom: none; }
.muted { color: var(--muted); }
.dot { display: inline-block; width: .7rem; height: .7rem; border-radius: 50%; background: var(--muted); margin-right: .4rem; vertical-align: middle; }
.dot.ok { background: var(--ok); } .dot.bad { background: var(--err); } .dot.warn { background: var(--warn); }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.progress { height: .8rem; background: var(--border); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--accent); width: 0; transition: width .3s; }
.log { background: #111827; color: #e5e7eb; font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; padding: 1rem; border-radius: var(--radius); max-height: 24rem; overflow: auto; white-space: pre-wrap; }
.tag { display: inline-block; padding: .1rem .5rem; border-radius: 999px; font-size: .8rem; background: var(--bg); border: 1px solid var(--border); }
.tag.add { color: var(--ok); } .tag.update { color: var(--warn); } .tag.remove { color: var(--err); }
.thumb { width: 48px; height: 64px; object-fit: cover; border: 1px solid var(--border); border-radius: 4px; background: var(--bg); }
.dropzone { border: 2px dashed var(--border); border-radius: var(--radius); padding: 2rem; text-align: center; background: #fff; }
.dropzone.over { border-color: var(--accent); }
details summary { cursor: pointer; }
@media (max-width: 640px) {
  .page { padding: 1rem; }
  table:not([data-reorder]) th:nth-child(n+4), table:not([data-reorder]) td:nth-child(n+4) { display: none; }
  .hide-sm { display: none; }
  /* Manage guides: the row buttons must stay reachable, so each guide becomes picture + title with its buttons on a line below. */
  table[data-reorder] thead, table[data-reorder] td:nth-child(3), table[data-reorder] td:nth-child(4) { display: none; }
  table[data-reorder] tbody tr { display: flex; flex-wrap: wrap; align-items: center; border-bottom: 1px solid var(--border); }
  table[data-reorder] tbody tr:last-child { border-bottom: none; }
  table[data-reorder] td { border-bottom: none; }
  table[data-reorder] td.actions { flex: 1 0 100%; padding-top: 0; }
}
