:root {
  --green: #509E2F; --green-dark: #3d7a24; --ink: #1d1d1b; --mid: #5c5f5c; --line: #dfe3dc; --bg: #f5f7f3; --card: #fff;
  --red: #c0392b; --amber: #c77700; --blue: #1f6fb2; --grey: #8a8f89;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
[hidden] { display: none !important; }
body { font-family: Mulish, -apple-system, "Segoe UI", Arial, sans-serif; color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.4; }
h1 { font-size: 20px; font-weight: 800; margin: 0; }
h2 { font-size: 16px; font-weight: 800; margin: 22px 0 8px; }
h3 { font-size: 14px; font-weight: 800; margin: 18px 0 6px; }
.top { display: flex; align-items: center; gap: 14px; padding: 10px 18px; background: var(--card); border-bottom: 3px solid var(--green); flex-wrap: wrap; }
.logo { height: 34px; }
.sources { margin-left: auto; display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--mid); }
.src { display: inline-flex; align-items: center; gap: 5px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--grey); display: inline-block; flex: none; }
.dot.ok { background: var(--green); } .dot.bad { background: var(--red); } .dot.warn { background: var(--amber); } .dot.blue { background: var(--blue); }
.btn { font: inherit; font-weight: 700; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; text-decoration: none; display: inline-block; }
.btn:hover { border-color: var(--green); }
.btn.primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn.primary:hover { background: var(--green-dark); }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.quiet { border-color: transparent; color: var(--mid); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.small { padding: 4px 10px; font-size: 13px; }
.tabs { display: flex; gap: 2px; padding: 0 12px; background: var(--card); border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { font: inherit; font-weight: 700; border: 0; background: none; padding: 12px 14px; cursor: pointer; color: var(--mid); border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--green); }
.badge { background: var(--red); color: #fff; border-radius: 10px; padding: 1px 7px; font-size: 12px; }
.badge:empty { display: none; }
main { padding: 16px 18px 80px; max-width: 1500px; margin: 0 auto; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; text-align: left; font: inherit; color: inherit; }
.tile:hover { border-color: var(--green); }
.tile b { display: block; font-size: 24px; font-weight: 800; }
.tile span { color: var(--mid); font-size: 13px; }
.tile small { display: block; color: var(--mid); font-size: 12px; margin-top: 2px; }
.tile.bad b { color: var(--red); }
.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
select, input, textarea { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); }
input[type=search] { flex: 1; min-width: 220px; }
.count { color: var(--mid); font-size: 13px; }
.tablewrap { background: var(--card); border: 1px solid var(--line); border-radius: 10px; overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--mid); background: #fafbf9; position: sticky; top: 0; }
table.grid tbody tr { cursor: pointer; }
table.grid tbody tr:hover { background: #f1f6ee; }
td small, .sub { color: var(--mid); font-size: 12px; display: block; }
.st { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; white-space: nowrap; }
.more { margin: 10px; }
.hint { color: var(--mid); }
.err { color: var(--red); font-weight: 700; }
.split { display: grid; grid-template-columns: minmax(280px, 420px) 1fr; gap: 14px; align-items: start; }
.list, .detail, .card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
.list { max-height: 75vh; overflow: auto; }
.item { display: block; width: 100%; text-align: left; font: inherit; color: inherit; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 9px 12px; cursor: pointer; }
.item:hover, .item.on { background: #f1f6ee; }
.item b { display: block; }
.detail { padding: 14px 16px; min-height: 200px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
.row { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; margin-bottom: 8px; }
.row.click { cursor: pointer; }
.row.click:hover { border-color: var(--green); }
.row.done { opacity: .55; }
.row .meta { color: var(--mid); font-size: 12px; }
.row .line { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; }
.tag { display: inline-block; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; border-radius: 6px; padding: 1px 6px; background: #e9efe5; color: var(--green-dark); margin-right: 6px; }
.tag.revisit { background: #fdf0d9; color: var(--amber); } .tag.tell_diageo { background: #e2eef8; color: var(--blue); }
.findform { display: grid; grid-template-columns: 1fr 140px 130px; gap: 8px; margin-bottom: 10px; }
.findform textarea { grid-column: 1 / -1; min-height: 60px; resize: vertical; }
.findform button { grid-column: 1 / -1; justify-self: start; }
.check { display: inline-flex; gap: 6px; align-items: center; color: var(--mid); margin-bottom: 8px; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100vw); background: var(--card); border-left: 1px solid var(--line); box-shadow: -8px 0 24px rgba(0,0,0,.12); padding: 16px 18px 40px; overflow-y: auto; z-index: 20; }
.drawer .x { float: right; font: inherit; font-weight: 700; border: 1px solid var(--line); background: var(--card); border-radius: 8px; padding: 4px 10px; cursor: pointer; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 4px 10px; margin: 10px 0; font-size: 14px; }
.kv dt { color: var(--mid); } .kv dd { margin: 0; overflow-wrap: anywhere; }
.acts { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.note { background: #fdf6e3; border: 1px solid #f0dfae; border-radius: 8px; padding: 8px 10px; font-size: 13px; margin: 8px 0; }
.shot { max-width: 100%; border: 1px solid var(--line); border-radius: 8px; margin-top: 8px; }
.hist { font-size: 13px; max-height: 320px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.hist div { padding: 5px 8px; border-bottom: 1px solid var(--line); }
.modal { position: fixed; inset: 0; background: rgba(20,24,20,.45); display: flex; align-items: center; justify-content: center; z-index: 40; padding: 16px; }
.modal[hidden], .drawer[hidden], .toast[hidden] { display: none; }
.box { background: var(--card); border-radius: 12px; padding: 18px 20px; width: min(520px, 100%); max-height: 90vh; overflow: auto; }
.box h3 { margin-top: 0; font-size: 17px; }
.actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 50; max-width: 92vw; }
.toast.bad { background: var(--red); }
.media { max-height: 300px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; margin-top: 8px; }
.media label { display: flex; gap: 8px; padding: 6px 8px; border-bottom: 1px solid var(--line); cursor: pointer; }
body.login { display: flex; min-height: 100vh; align-items: center; justify-content: center; }
.loginbox { background: var(--card); border: 1px solid var(--line); border-top: 4px solid var(--green); border-radius: 12px; padding: 26px; width: min(360px, 92vw); display: grid; gap: 10px; }
.loginbox img { height: 44px; justify-self: start; }
@media (max-width: 900px) {
  .split, .cols { grid-template-columns: 1fr; }
  .sources { margin-left: 0; width: 100%; order: 5; }
  table.grid thead { display: none; }
  table.grid tr { display: grid; grid-template-columns: 1fr 1fr; padding: 6px 4px; border-bottom: 1px solid var(--line); }
  table.grid td { border: 0; padding: 3px 8px; }
  table.grid td:nth-child(2) { grid-column: 1 / -1; grid-row: 1; font-weight: 700; }
  .findform { grid-template-columns: 1fr; }
}
