:root {
  --paper: #f5f2ea; --card: #fbfaf6; --ink: #1d1b18; --soft: #6f6a60; --line: #dcd6c8;
  --accent: #2c5a4c; --accent-ink: #f5f2ea; --warn: #9a3b2a; --ok: #2c5a4c; --wait: #8a6a1f;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: ui-sans-serif, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--paper); color: var(--ink); font: 15px/1.5 var(--sans); }
h1, h2, h3, .brand { font-family: var(--serif); font-weight: 500; letter-spacing: -0.01em; margin: 0; }
h1 { font-size: 30px; } h2 { font-size: 24px; margin-bottom: 4px; } h3 { font-size: 17px; margin: 0 0 10px; }
a { color: var(--accent); }
.quiet { color: var(--soft); } .small { font-size: 13px; } .error { color: var(--warn); min-height: 1.2em; }
[hidden] { display: none !important; }

#login { height: 100%; display: grid; place-items: center; }
#login form { width: 300px; display: grid; gap: 12px; text-align: center; }

#shell { display: grid; grid-template-columns: 190px 1fr; min-height: 100%; }
nav { border-right: 1px solid var(--line); padding: 28px 18px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh; }
.brand { font-size: 22px; margin: 0 8px 14px; }
#brand-pick { margin-bottom: 18px; font-size: 13px; padding: 6px 8px; }
.group { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--soft); margin: 18px 0 2px; display: flex; justify-content: space-between; }
.group:first-of-type { margin-top: 0; }
select.inline { width: auto; padding: 6px 8px; font-size: 13px; }
nav a { color: var(--soft); text-decoration: none; padding: 7px 8px; border-radius: 4px; }
nav a:hover { color: var(--ink); }
nav a.on { color: var(--ink); background: #e9e4d6; }
main { padding: 34px 44px 80px; max-width: 1060px; width: 100%; }
.head { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 24px; border-bottom: 1px solid var(--line); padding-bottom: 14px; }

input, textarea, select, button { font: inherit; color: inherit; }
input[type=text], input[type=password], input[type=datetime-local], input[type=time], textarea, select {
  width: 100%; background: var(--card); border: 1px solid var(--line); border-radius: 4px; padding: 9px 11px; outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
textarea { resize: vertical; min-height: 96px; }
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--soft); margin-bottom: 5px; }
button { cursor: pointer; background: none; border: 1px solid var(--line); border-radius: 4px; padding: 7px 13px; }
button:hover { border-color: var(--ink); }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); padding: 10px 20px; }
button.primary:hover { filter: brightness(1.1); }
button.link { border: 0; padding: 0; color: var(--accent); text-decoration: underline; }
button.danger:hover { border-color: var(--warn); color: var(--warn); }
button:disabled { opacity: .45; cursor: default; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 18px; margin-bottom: 14px; }
.note { border-left: 2px solid var(--wait); padding: 2px 0 2px 12px; color: var(--soft); font-size: 13px; margin: 12px 0; }

.tag { display: inline-block; font-size: 11px; letter-spacing: .06em; border: 1px solid var(--ink); border-radius: 3px; padding: 0 5px; line-height: 17px; font-weight: 600; }
.status { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; }
.status.published { color: var(--ok); } .status.failed { color: var(--warn); } .status.scheduled, .status.publishing { color: var(--wait); }

.drop { border: 1px dashed #b9b2a0; border-radius: 6px; padding: 26px; text-align: center; color: var(--soft); cursor: pointer; margin-bottom: 14px; }
.drop.over { border-color: var(--accent); color: var(--ink); }
.preview { max-width: 100%; max-height: 320px; border-radius: 6px; display: block; margin: 0 auto 8px; background: #000; }
.pick { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.pick:last-child { border: 0; }
.pick input[type=checkbox] { margin-top: 5px; accent-color: var(--accent); }
.pick .body { flex: 1; }
.pick textarea { margin-top: 8px; min-height: 70px; font-size: 14px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.seg button { border: 0; border-radius: 0; padding: 7px 14px; border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--ink); color: var(--paper); }

.cal { display: grid; grid-template-columns: repeat(7, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.cal > div { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); min-height: 86px; padding: 5px 6px; font-size: 12px; }
.cal .dow { min-height: 0; text-transform: uppercase; letter-spacing: .08em; color: var(--soft); font-size: 11px; padding: 6px; }
.cal .out { background: #efebe0; color: #a8a190; }
.cal .today .num { background: var(--ink); color: var(--paper); border-radius: 9px; padding: 0 6px; }
.chip { display: block; margin-top: 3px; padding: 1px 4px; border-left: 2px solid var(--wait); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip.published { border-color: var(--ok); } .chip.failed { border-color: var(--warn); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--soft); font-weight: 500; }
th.sort { cursor: pointer; } th.sort.on { color: var(--ink); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.totals { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border: 1px solid var(--line); border-radius: 6px; margin-bottom: 22px; background: var(--card); }
.totals div { padding: 16px 18px; border-right: 1px solid var(--line); }
.totals div:last-child { border: 0; }
.totals b { display: block; font: 500 28px var(--serif); }
.clip { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.list button.item { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 10px 6px; }
.list button.item.on { background: #e9e4d6; }
.comment { padding: 12px 0; border-bottom: 1px solid var(--line); }
.comment .row { margin-top: 8px; flex-wrap: nowrap; }
.empty { color: var(--soft); padding: 28px 0; }
#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 10px 18px; border-radius: 4px; max-width: 80vw; z-index: 9; }
#toast.bad { background: var(--warn); }
code { background: #e9e4d6; padding: 1px 5px; border-radius: 3px; font-size: 12.5px; word-break: break-all; }

@media (max-width: 820px) {
  #shell { grid-template-columns: 1fr; }
  nav { position: static; height: auto; flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); padding: 12px; }
  .brand { width: 100%; margin: 0 8px 6px; }
  main { padding: 22px 16px 60px; }
  .grid2 { grid-template-columns: 1fr; gap: 18px; }
  .totals { grid-template-columns: 1fr 1fr; }
  .cal > div { min-height: 60px; }
}
