/* Content engine dashboard. One stylesheet, no framework. */
/* Salessy's own colours: white, with its light green. One look, day or night:
   the first version followed the computer's dark mode and came out near-black. */
:root {
  color-scheme: light;
  --bg: #f3faea;
  --surface: #ffffff;
  --ink: #14210e;
  --muted: #5a6b50;
  --line: #d9ebc6;
  --green: #8fd65c;          /* Salessy light green: fills, badges, the active tab */
  --accent: #8fd65c;
  --accent-ink: #14210e;     /* dark text on the light green */
  --link: #2f6b1f;           /* the darker brand green, for text that must be readable */
  --soft: #e4f5d3;
  --warn: #8a5a00;
  --warn-bg: #fff4d6;
  --radius: 12px;
  --gap: 16px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
a { color: var(--link); text-underline-offset: 2px; }
h1 { font-size: 26px; margin: 8px 0 16px; letter-spacing: -0.01em; }
h2 { font-size: 18px; margin: 0 0 8px; line-height: 1.3; }
h3 { font-size: 15px; margin: 0 0 8px; }
p { margin: 0 0 10px; }
.section { margin: 32px 0 12px; font-size: 14px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.small { font-size: 13px; }
.muted { color: var(--muted); }
.lede { max-width: 70ch; color: var(--muted); margin-bottom: 20px; }
.empty { padding: 40px 16px; text-align: center; color: var(--muted); }
.label { display: block; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin-bottom: 2px; }
.warn { color: var(--warn); }
p.warn, p.notice { background: var(--warn-bg); padding: 8px 12px; border-radius: 8px; }
p.notice { background: var(--soft); color: var(--ink); }

.bar {
  position: sticky; top: 0; z-index: 5; background: var(--surface);
  border-bottom: 2px solid var(--green);
  display: flex; align-items: center; gap: 20px; padding: 0 16px;
}
.brand { font-weight: 700; color: var(--ink); text-decoration: none; padding: 14px 0; white-space: nowrap; }
nav { display: flex; gap: 2px; overflow-x: auto; }
nav a {
  padding: 14px 10px; color: var(--muted); text-decoration: none; white-space: nowrap;
  border-bottom: 2px solid transparent; font-size: 15px;
}
nav a.on { color: var(--ink); border-bottom-color: var(--green); border-bottom-width: 3px; font-weight: 600; }
nav b {
  display: inline-block; margin-left: 6px; min-width: 20px; padding: 0 6px; border-radius: 10px;
  background: var(--accent); color: var(--accent-ink); font-size: 12px; text-align: center;
}
main { max-width: 1120px; margin: 0 auto; padding: 16px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: var(--gap); }
.grid { display: grid; gap: var(--gap); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid .card { margin-bottom: 0; }
.grid + .grid, .grid + .section { margin-top: var(--gap); }
.big { font-size: 22px; font-weight: 600; }
.stat b { font-size: 20px; margin-right: 4px; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.tag { font-size: 12px; padding: 2px 8px; border-radius: 10px; background: var(--soft); color: var(--ink); white-space: nowrap; }
.tag.strong { background: var(--accent); color: var(--accent-ink); }

.draft { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 20px; align-items: start; }
.draft.slim { grid-template-columns: minmax(0, 220px) minmax(0, 1fr); }
@media (max-width: 760px) { .draft, .draft.slim { grid-template-columns: 1fr; } }
.visual img { width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--line); display: block; }
.visual.none { border: 1px dashed var(--line); border-radius: 8px; padding: 28px 12px; text-align: center; color: var(--muted); font-size: 13px; }
.steps { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 8px; font-size: 13px; color: var(--muted); }
.steps button { min-width: 44px; min-height: 36px; }

.editor { display: flex; gap: 12px; align-items: flex-start; background: var(--bg); border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; }
.score { text-align: center; min-width: 52px; }
.score b { display: block; font-size: 22px; line-height: 1.1; }
.score span { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.score.ok b { color: var(--link); }
.score.low b { color: var(--warn); }
.editor p { margin-bottom: 4px; }

textarea, input[type=text], input[type=password], input[type=date], select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--ink); font: inherit;
}
textarea { resize: vertical; line-height: 1.45; }
input[type=file] { width: 100%; margin-bottom: 8px; font: inherit; color: var(--muted); }
form > * + * { margin-top: 8px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row input[type=date] { width: auto; }
.row input[type=text] { flex: 1; min-width: 180px; }
button {
  font: inherit; padding: 9px 14px; min-height: 40px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
}
button.primary { background: var(--green); border-color: #7cc74a; color: var(--accent-ink); font-weight: 700; }
button.primary:hover { background: #7cc74a; }
button.quiet:hover, .steps button:hover { background: var(--soft); }
button.link { border: 0; background: none; padding: 0; min-height: 0; color: var(--muted); text-decoration: underline; font-size: 13px; }
details > summary { cursor: pointer; color: var(--muted); padding: 8px 0; }
details[open] > summary { margin-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips label { cursor: pointer; }
.chips input { position: absolute; opacity: 0; }
.chips span { display: inline-block; padding: 7px 12px; border: 1px solid var(--line); border-radius: 18px; font-size: 14px; }
.chips input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chips input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.captiontext { white-space: pre-wrap; overflow-wrap: anywhere; }

.filters { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.filters select { width: auto; }
.row-post { padding: 0; }
.row-post > summary { display: flex; gap: 10px; align-items: center; padding: 12px 16px; color: var(--ink); list-style: none; }
.row-post > summary::-webkit-details-marker { display: none; }
.row-post .idea { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-post .nums { display: flex; gap: 10px; color: var(--muted); font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.row-post > .draft { padding: 0 16px 16px; }
@media (max-width: 760px) {
  .row-post > summary { flex-wrap: wrap; }
  .row-post .idea { flex-basis: 100%; white-space: normal; order: 3; }
}
.when { color: var(--muted); font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.status { font-size: 12px; padding: 2px 8px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); white-space: nowrap; }
.s-posted, .t-live { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.s-approved, .t-partly { background: var(--soft); }
.s-rejected { color: var(--muted); text-decoration: line-through; }

.ask h2 { margin: 0; }
.askhead { display: flex; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.ask.done { opacity: 0.8; }
.given { list-style: none; padding: 0; margin: 12px 0 0; border-top: 1px solid var(--line); }
.given li { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; overflow-wrap: anywhere; }
.given li form { margin-left: auto; }
.asks-short { padding-left: 18px; margin: 8px 0; }
.asks-short li { margin-bottom: 4px; }
ul.plain { padding-left: 18px; margin: 4px 0 0; }
.log { list-style: none; padding: 0; margin: 8px 0 0; max-height: 420px; overflow-y: auto; }
.log li { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; overflow-wrap: anywhere; }
.log li:last-child { border-bottom: 0; }

.tablewrap { padding: 0; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: 0; }

body.login { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
body.login .card { width: 100%; max-width: 340px; }

.visual video{width:100%;max-height:70vh;border-radius:8px;border:1px solid var(--line);background:#000;display:block}
.given li form + form{margin-left:0}
ol.plain{padding-left:20px;margin:4px 0 8px}
