@import url("/static/fonts/fonts.css");

/* Tokens -------------------------------------------------------------
   Election-ink violet is the app's own colour. Party colours never touch
   the chrome (any party can use this app); they appear as a small swatch
   and inside the banners themselves. Marigold marks focus and "you are here". */
:root {
  --ink: #1e1830;
  --ink-2: #2b2342;
  --violet: #3b2a6b;
  --violet-2: #56428f;
  --violet-wash: #efecf6;
  --marigold: #e9a23b;
  --paper: #f5f4f7;
  --surface: #ffffff;
  --line: #e2dfe8;
  --line-2: #cfcad9;
  --text: #221d2e;
  --muted: #6e6880;
  --ok: #1f7a4d;
  --ok-wash: #e4f3ea;
  --warn: #8f5b00;
  --warn-wash: #fdf1dc;
  --err: #b3261e;
  --err-wash: #fbe6e4;

  --display: "Eczar", Georgia, serif;
  --sans: "Mukta", system-ui, -apple-system, "Segoe UI", sans-serif;

  --r-sm: 6px;
  --r: 10px;
  --r-lg: 16px;
  --side: 248px;
  --tabbar: 64px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 400 16px/1.55 var(--sans);
  color: var(--text);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
a { color: var(--violet-2); text-underline-offset: 3px; }
a:hover { color: var(--violet); }
:focus-visible { outline: 3px solid var(--marigold); outline-offset: 2px; border-radius: 4px; }
::selection { background: #f6dcae; }

h1, h2, h3 { font-family: var(--display); font-weight: 600; color: var(--ink); margin: 0; }
h1 { font-size: 30px; line-height: 1.15; letter-spacing: -0.01em; }
h2 { font-size: 21px; line-height: 1.25; }
h3 { font-size: 17px; line-height: 1.3; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.nowrap { white-space: nowrap; }
.hide { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* App shell ------------------------------------------------------------ */
.shell { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; background: linear-gradient(to right, var(--ink) var(--side), transparent var(--side)); }
.side {
  background: var(--ink);
  color: #d9d4e6;
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  padding: 20px 14px 16px;
  overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: #3a3152 transparent;
}
.side::-webkit-scrollbar { width: 6px; }
.side::-webkit-scrollbar-thumb { background: #3a3152; border-radius: 3px; }
.brand { font-family: var(--display); font-weight: 700; font-size: 26px; color: #fff; padding: 0 10px; line-height: 1; text-decoration: none; }
.brand:hover { color: #fff; }
.brand small { display: block; font-family: var(--sans); font-weight: 500; font-size: 13px; color: #9c94b3; margin-top: 6px; letter-spacing: 0.01em; }

.ws {
  margin: 18px 0 14px; padding: 12px; border-radius: var(--r);
  background: var(--ink-2); display: grid; grid-template-columns: 40px 1fr; gap: 10px; align-items: center;
}
.ws .face { width: 40px; height: 40px; border-radius: 50%; background: #3a3152 center/cover no-repeat; display: grid; place-items: center; font-family: var(--display); color: #fff; font-size: 18px; overflow: hidden; }
.ws .face img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.ws b { display: block; color: #fff; font-weight: 600; font-size: 15px; line-height: 1.25; }
.party-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #b8b0cc; }
.swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 10px; border-radius: var(--r-sm);
  color: #cfc9dd; flex: none; text-decoration: none; font-weight: 500; font-size: 15px; position: relative;
}
.nav a svg { width: 20px; height: 20px; flex: none; opacity: .8; }
.nav a:hover { background: var(--ink-2); color: #fff; }
.nav a.on { background: var(--ink-2); color: #fff; }
.nav a.on::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--marigold); }
.nav-label { font-size: 13px; color: #8a829f; padding: 14px 10px 6px; }
.side-foot { margin-top: auto; padding: 12px 10px 0; flex: none; border-top: 1px solid #2f2745; font-size: 14px; color: #9c94b3; }
.side-foot a { color: #cfc9dd; }
.side-foot form { display: inline; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: #cfc9dd; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

.main { min-width: 0; }
.acting {
  background: var(--marigold); color: var(--ink);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 32px; font-size: 15px;
}
.acting form { margin: 0; }
.acting button { background: var(--ink); color: #fff; border: 0; border-radius: var(--r-sm); padding: 4px 12px; font: 500 14px var(--sans); cursor: pointer; }
.page { max-width: 1080px; padding: 36px 32px 64px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head p { margin: 6px 0 0; color: var(--muted); }
.crumb { display: inline-block; margin-bottom: 8px; font-size: 14px; color: var(--muted); text-decoration: none; }
.crumb:hover { color: var(--violet); }

.topbar, .tabbar { display: none; }

/* Surfaces -------------------------------------------------------------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px; }
.panel + .panel { margin-top: 16px; }
.panel h2 { margin-bottom: 4px; }
.panel .lede { color: var(--muted); margin-bottom: 18px; }
.section { margin-top: 36px; }
.section > h2 { margin-bottom: 12px; }

/* Buttons ---------------------------------------------------------------- */
.btn, button.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px; border-radius: var(--r);
  font: 600 15px/1 var(--sans); text-decoration: none; cursor: pointer;
  background: var(--violet); color: #fff; border: 1px solid var(--violet);
  transition: background .15s;
}
.btn:hover { background: var(--violet-2); border-color: var(--violet-2); color: #fff; }
.btn svg { width: 18px; height: 18px; }
.btn.quiet { background: var(--surface); color: var(--violet); border-color: var(--line-2); }
.btn.quiet:hover { background: var(--violet-wash); border-color: var(--violet-2); }
.btn.danger { background: var(--surface); color: var(--err); border-color: #e8b9b5; }
.btn.danger:hover { background: var(--err-wash); }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: 14px; border-radius: var(--r-sm); }
.btn.big { min-height: 52px; padding: 0 26px; font-size: 16px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 24px; }
.actions .spacer { flex: 1; }

/* Forms ------------------------------------------------------------------ */
.field { margin-bottom: 18px; }
.field > label, .label { display: block; font-weight: 600; font-size: 15px; margin-bottom: 6px; color: var(--ink); }
.field .hint { font-size: 14px; color: var(--muted); margin-top: 6px; }
.opt { font-weight: 400; color: var(--muted); }
input[type=text], input[type=password], input[type=tel], input[type=search], select, textarea {
  resize: vertical;
  width: 100%; min-height: 46px; padding: 10px 12px;
  border: 1px solid var(--line-2); border-radius: var(--r); background: var(--surface);
  font: 400 16px/1.3 var(--sans); color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--violet-2); box-shadow: 0 0 0 3px #e3dcf4; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%236e6880' stroke-width='1.8'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; }
input[type=color] { width: 54px; height: 46px; padding: 4px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--surface); cursor: pointer; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.cols-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 18px; }
fieldset { border: 0; padding: 0; margin: 0; }
.form-section { padding: 24px 0; border-top: 1px solid var(--line); }
.form-section:first-child { padding-top: 0; border-top: 0; }
.form-section > h2 { margin-bottom: 4px; }
.form-section > .lede { color: var(--muted); margin-bottom: 18px; }

/* Segmented choice (radio buttons that look like a switch) */
.choice { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 0; border: 1px solid var(--line-2); border-radius: var(--r); padding: 3px; background: var(--paper); }
.choice label { position: relative; margin: 0; }
.choice input { position: absolute; opacity: 0; inset: 0; }
.choice span { display: block; text-align: center; padding: 9px 10px; border-radius: 7px; font-weight: 500; font-size: 15px; color: var(--muted); cursor: pointer; line-height: 1.3; }
.choice input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(30,24,48,.12), 0 0 0 1px var(--line); }
.choice input:focus-visible + span { outline: 3px solid var(--marigold); }

/* Option cards for longer radio choices */
.options { display: grid; gap: 10px; }
.option { display: grid; grid-template-columns: 22px 1fr; gap: 12px; align-items: start; padding: 14px 16px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--surface); cursor: pointer; }
.option input { margin: 3px 0 0; width: 18px; height: 18px; accent-color: var(--violet); }
.option b { display: block; font-weight: 600; }
.option small { display: block; color: var(--muted); font-size: 14px; line-height: 1.4; }
.option:has(input:checked) { border-color: var(--violet-2); background: var(--violet-wash); }
.option:has(input:disabled) { opacity: .55; cursor: not-allowed; }

.check { display: flex; gap: 12px; align-items: flex-start; font-weight: 500; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--violet); flex: none; }

/* Photo picker */
label.picker { position: relative; display: grid; grid-template-columns: 112px 1fr; gap: 16px; align-items: center; padding: 14px; border: 1.5px dashed var(--line-2); border-radius: var(--r); background: var(--surface); cursor: pointer; }
.picker:hover { border-color: var(--violet-2); }
.picker input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.picker .thumb { width: 112px; height: 112px; border-radius: var(--r-sm); background: var(--paper); display: grid; place-items: center; overflow: hidden; }
.picker .thumb svg { width: 34px; height: 34px; color: var(--muted); }
.picker .thumb img { width: 100%; height: 100%; object-fit: cover; }
.picker b { display: block; color: var(--violet); }
.picker small { color: var(--muted); font-size: 14px; display: block; line-height: 1.4; }
label.picker.wide { grid-template-columns: 1fr; }
.picker.wide .thumb { width: 100%; height: auto; aspect-ratio: 1184/1280; max-height: 240px; }
.picker.wide .thumb img { object-fit: contain; }

/* Notices ---------------------------------------------------------------- */
.notice { padding: 12px 16px; border-radius: var(--r); margin-bottom: 20px; font-size: 15px; border: 1px solid; }
.notice.ok { background: var(--ok-wash); border-color: #bfe1cc; color: #145236; }
.notice.err { background: var(--err-wash); border-color: #f0c3bf; color: #8a1d17; }
.notice.warn { background: var(--warn-wash); border-color: #f1d6a6; color: #6b4400; }
.notice a { color: inherit; font-weight: 600; }

/* Status words with a dot */
.status { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 500; white-space: nowrap; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.status.ready, .status.done, .status.sent { color: var(--ok); }
.status.ready::before, .status.done::before, .status.sent::before { background: var(--ok); }
.status.pending, .status.running, .status.queued { color: var(--warn); }
.status.pending::before, .status.running::before, .status.queued::before { background: var(--marigold); animation: pulse 1.4s ease-in-out infinite; }
.status.failed { color: var(--err); }
.status.failed::before { background: var(--err); }
.status.off { color: var(--muted); }
@keyframes pulse { 50% { opacity: .35; } }

/* Lists -------------------------------------------------------------------- */
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.row { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 18px; border-top: 1px solid var(--line); text-decoration: none; color: inherit; }
.row:first-child { border-top: 0; }
a.row:hover { background: #faf9fc; }
.row .who b { display: block; font-weight: 600; color: var(--ink); line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .who span { display: block; font-size: 14px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .end { display: flex; align-items: center; gap: 14px; }
.avatar { width: 52px; height: 52px; border-radius: 50%; background: var(--violet-wash); display: grid; place-items: center; overflow: hidden; font-family: var(--display); font-weight: 600; color: var(--violet); font-size: 20px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.cutout { background-color: #f1eff5; background-image: linear-gradient(45deg, #e6e3ec 25%, transparent 25%, transparent 75%, #e6e3ec 75%), linear-gradient(45deg, #e6e3ec 25%, transparent 25%, transparent 75%, #e6e3ec 75%); background-size: 14px 14px; background-position: 0 0, 7px 7px; }
.avatar.cutout img { object-fit: contain; object-position: bottom; }
.empty { padding: 40px 24px; text-align: center; color: var(--muted); }
.empty h3 { color: var(--ink); margin-bottom: 6px; }
.empty .btn { margin-top: 14px; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar input[type=search] { flex: 2 1 220px; }
.toolbar select { flex: 1 1 160px; width: auto; }

.pager { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 16px; }
.pager a, .pager span { min-width: 38px; height: 38px; display: grid; place-items: center; border-radius: var(--r-sm); border: 1px solid var(--line-2); text-decoration: none; background: var(--surface); }
.pager span { background: var(--violet); color: #fff; border-color: var(--violet); }

.shared { color: var(--violet-2); font-weight: 500; font-style: normal; }
fieldset:disabled input { background: var(--paper); color: var(--text); border-color: var(--line); }

.picklist { max-height: 320px; overflow: auto; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--surface); }
.pick { display: grid; grid-template-columns: 20px 1fr; gap: 12px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--line); cursor: pointer; }
.pick:first-child { border-top: 0; }
.pick[hidden], .row[hidden] { display: none; }
.pick input { width: 18px; height: 18px; margin: 0; accent-color: var(--violet); }
.pick b { display: block; font-weight: 600; line-height: 1.3; }
.pick small { display: block; color: var(--muted); font-size: 14px; }
.pick:has(input:checked) { background: var(--violet-wash); }

.social-app { border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin-bottom: 12px; background: var(--surface); }
.social-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.social-head h3 { margin: 0; }
.pick-accounts { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: start; margin-top: 14px; }
.pick-accounts .label { margin: 10px 0 0; }
.multi { position: relative; }
.multi summary { list-style: none; cursor: pointer; min-height: 40px; padding: 8px 36px 8px 12px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%236e6880' stroke-width='1.8'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 12px center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.multi summary::-webkit-details-marker { display: none; }
.multi[open] summary { border-color: var(--violet-2); box-shadow: 0 0 0 3px #e3dcf4; }
.multi .menu { position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 6px); max-height: 320px; overflow: auto; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r); box-shadow: 0 12px 28px rgba(30,24,48,.14); }
.help { font-size: 14px; color: var(--muted); background: var(--paper); border-radius: var(--r-sm); padding: 10px 12px; margin-bottom: 8px; }
.add-app > summary { list-style: none; cursor: pointer; }
.add-app > summary::-webkit-details-marker { display: none; }
@media (max-width: 600px) { .pick-accounts { grid-template-columns: 1fr; } .pick-accounts .label { margin: 0; } [style*="max-width:50%"] { max-width: none !important; } }

.drop { position: relative; display: block; padding: 22px; border: 1.5px dashed var(--line-2); border-radius: var(--r); background: var(--surface); text-align: center; cursor: pointer; }
.drop:hover { border-color: var(--violet-2); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop b { display: block; color: var(--violet); }
.drop small { color: var(--muted); font-size: 14px; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin-top: 12px; }
.thumbs figure { margin: 0; }
.thumbs img, .thumbs video { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--r-sm); background: var(--line); display: block; }
.thumbs figcaption { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 4px; }
.preview .frame video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { font-size: 14px; padding: 2px 10px; border-radius: 99px; background: var(--violet-wash); color: var(--violet); }
.chip.over { background: var(--err-wash); color: var(--err); text-decoration: line-through; }

.cfilters { margin-bottom: 16px; }
.cfilters input[type=search] { width: 100%; }
.filterbox > summary { list-style: none; margin-top: 10px; }
.filterbox > summary::-webkit-details-marker { display: none; }
@media (min-width: 901px) { .filterbox > summary { display: none; } }
.area-strip { margin-bottom: 14px; }
.areas { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.area { display: inline-flex; align-items: baseline; gap: 8px; padding: 6px 12px; border: 1px solid var(--line-2); border-radius: 99px; background: var(--surface); text-decoration: none; color: var(--text); font-size: 14px; }
.area:hover { border-color: var(--violet-2); }
.area span { color: var(--muted); font-variant-numeric: tabular-nums; }
.crow { grid-template-columns: 22px minmax(0, 1fr) auto; }
.crow input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--violet); }
.bulkbar { position: sticky; bottom: 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 14px; margin-top: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); font-size: 14px; z-index: 4; }
@media (max-width: 900px) { .bulkbar { bottom: calc(var(--tabbar) + 6px); } }

.sheet-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
table.sheet { border-collapse: collapse; width: 100%; min-width: 860px; font-size: 15px; }
.sheet th { text-align: left; font-weight: 600; font-size: 13px; color: var(--muted); padding: 10px 8px; border-bottom: 1px solid var(--line); background: var(--paper); position: sticky; top: 0; }
.sheet td { padding: 4px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.sheet td:first-child { padding: 12px 6px 0 12px; width: 32px; }
.sheet input[type=text] { min-height: 36px; padding: 6px 8px; border-color: transparent; background: transparent; border-radius: var(--r-sm); }
.sheet input[type=text]:hover { border-color: var(--line-2); }
.sheet input[type=text]:focus { background: var(--surface); }
.sheet small { display: block; font-size: 12px; padding: 0 8px 6px; color: var(--muted); }
.sheet tr.warnrow { background: #fffaf0; }
.sheet tr.off td:not(:first-child) { opacity: .4; }
.sheet input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--violet); }

.slots { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 8px; }
.slots li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); }
.slots li img { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; background: var(--paper); }
.slots li span { flex: 1; font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slots .btn.sm { min-height: 30px; padding: 0 9px; }
.lib { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
.lib figure { margin: 0; }
.lib-img { aspect-ratio: 1; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); display: grid; place-items: center; background: var(--paper); }
.lib-img img { width: 100%; height: 100%; object-fit: cover; }
.lib-img.cutout img { object-fit: contain; padding: 8px; }
.lib figcaption { margin-top: 6px; font-size: 14px; }
.lib figcaption b { display: block; }
.lib figcaption span { color: var(--muted); font-size: 13px; }
.slot-row { display: flex; gap: 10px; flex-wrap: wrap; }
.slot-row select { flex: 1 1 220px; width: auto; }
.header-sides { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.header-thumbs { display: flex; gap: 6px; flex-wrap: wrap; min-height: 56px; align-items: center; }
.header-thumbs img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: var(--paper); }
@media (max-width: 600px) { .header-sides { grid-template-columns: 1fr; } }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.swatches label { position: relative; cursor: pointer; }
.swatches input[type=radio] { position: absolute; opacity: 0; }
.swatches span { display: block; width: 40px; height: 40px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }
.swatches input:checked + span { outline: 3px solid var(--violet-2); outline-offset: 2px; }
.swatches input:focus-visible + span { outline: 3px solid var(--marigold); outline-offset: 2px; }
.swatch-own input[type=color] { width: 44px; height: 44px; border-radius: 50%; padding: 3px; }
.ai-help { padding: 14px; border-radius: var(--r); background: var(--violet-wash); margin: 8px 0 16px; }
.connect-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 4px 0 18px; }
.connect-row form { margin: 0; }
.btn.connect-meta { background: #1f4fa8; border-color: #1f4fa8; }
.btn.connect-meta:hover { background: #2a5fc4; border-color: #2a5fc4; }
.btn.connect-x { background: #16141c; border-color: #16141c; }
.btn.connect[disabled] { background: var(--line-2); border-color: var(--line-2); color: var(--muted); opacity: 1; }
.btn.connect-x:hover { background: #2c2935; border-color: #2c2935; }
.linklike { color: var(--violet-2); font-weight: 500; font-size: 15px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; margin-top: 6px; }

/* Dashboard ---------------------------------------------------------------- */
.today { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 28px; align-items: center; background: var(--ink); color: #e9e5f2; border-radius: var(--r-lg); padding: 32px; overflow: hidden; }
.today h2 { color: #fff; font-size: 26px; margin-bottom: 8px; }
.today p { color: #bdb5d1; max-width: 46ch; }
.today .btn { background: var(--marigold); border-color: var(--marigold); color: var(--ink); }
.today .btn:hover { background: #f1b65e; border-color: #f1b65e; }
.today .last { text-decoration: none; justify-self: end; width: min(240px, 100%); }
.today .last img { display: block; width: 100%; border-radius: var(--r); box-shadow: 0 12px 32px rgba(0,0,0,.35); transform: rotate(2deg); }
.today .last span { display: block; font-size: 13px; color: #9c94b3; margin-top: 12px; text-align: right; }
.figures { display: flex; gap: 40px; flex-wrap: wrap; margin: 28px 0 0; padding: 0; list-style: none; }
.figures li { display: flex; flex-direction: column; }
.figures b { font-family: var(--display); font-size: 34px; font-weight: 600; line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
.figures span { font-size: 14px; color: var(--muted); margin-top: 6px; }
.figures a { text-decoration: none; }

/* Banners ------------------------------------------------------------------ */
.compose { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
.preview { position: sticky; top: 24px; }
.preview .frame { aspect-ratio: 1184/1280; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; text-align: center; color: var(--muted); font-size: 14px; padding: 0; }
.preview .frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.preview .frame .ph { padding: 24px; }
.preview .frame.loading { animation: pulse 1.4s ease-in-out infinite; }
.preview .cap { font-size: 14px; color: var(--muted); margin-top: 10px; }
.count-line { font-size: 15px; margin: 4px 0 0; }
.count-line b { font-family: var(--display); font-size: 22px; color: var(--ink); font-weight: 600; }

.progress { height: 8px; background: var(--violet-wash); border-radius: 99px; overflow: hidden; margin: 14px 0 8px; }
.progress i { display: block; height: 100%; background: var(--violet); border-radius: 99px; transition: width .4s; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.tile { display: block; text-decoration: none; color: inherit; }
.tile img { display: block; width: 100%; aspect-ratio: 1184/1280; object-fit: cover; border-radius: var(--r); background: var(--line); }
.tile .cap { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-top: 8px; }
.tile .cap b { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .cap a { font-size: 14px; flex: none; }
.tile .tag { font-size: 13px; color: var(--violet); font-weight: 600; }
.log { background: var(--ink); color: #d6d0e4; border-radius: var(--r); padding: 14px 16px; font: 13px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; max-height: 260px; overflow: auto; }
details summary { cursor: pointer; color: var(--violet-2); font-weight: 500; }

.runs .row { grid-template-columns: 56px minmax(0, 1fr) auto; }
.runs .mini { width: 56px; aspect-ratio: 1184/1280; border-radius: var(--r-sm); object-fit: cover; background: var(--violet-wash); display: block; }

/* Member photo review */
.review { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.review figure { margin: 0; }
.review .img { aspect-ratio: 4/5; border-radius: var(--r); overflow: hidden; display: grid; place-items: center; border: 1px solid var(--line); background: var(--paper); position: relative; }
.review .img img { width: 100%; height: 100%; object-fit: contain; }
.review figcaption { font-size: 14px; color: var(--muted); margin-top: 8px; }
.review .working { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(245,244,247,.82); font-weight: 500; color: var(--warn); text-align: center; padding: 16px; }
.photo-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.photo-actions form { margin: 0; }

/* Admin --------------------------------------------------------------------- */
.party-chip { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; color: var(--text); }
.party-chip .swatch { box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }
.cred { background: var(--ink); color: #fff; border-radius: var(--r-lg); padding: 28px; max-width: 560px; }
.cred dl { display: grid; grid-template-columns: max-content 1fr; gap: 10px 20px; margin: 18px 0 0; font-size: 17px; }
.cred dt { color: #9c94b3; }
.cred dd { margin: 0; font-weight: 600; word-break: break-all; }
.cred .pw { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 20px; color: var(--marigold); letter-spacing: .02em; }
.leader-card { display: grid; grid-template-columns: 72px 1fr; gap: 14px; align-items: center; padding: 12px; border-radius: var(--r); background: var(--paper); margin-bottom: 16px; }
.leader-card .avatar { width: 72px; height: 72px; }
.danger-zone { margin-top: 32px; padding: 20px 24px; border: 1px solid #f0c3bf; border-radius: var(--r-lg); background: var(--surface); }
.danger-zone h2 { color: var(--err); margin-bottom: 6px; }
.danger-zone form { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.danger-zone input { max-width: 320px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 24px; font-size: 15px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
code { font: 14px ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--violet-wash); padding: 1px 6px; border-radius: 4px; }

/* Login ------------------------------------------------------------------ */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(360px, 1fr); }
.auth-art { background: var(--ink); color: #fff; padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-art .word { font-family: var(--display); font-weight: 700; font-size: clamp(64px, 9vw, 132px); line-height: .95; letter-spacing: -0.02em; margin: auto 0; position: relative; }
.auth-art .word::after { content: ""; display: block; width: .55em; height: .12em; margin-top: .28em; background: var(--marigold); border-radius: 0 .06em .06em 0; transform-origin: left; animation: stroke .9s .2s cubic-bezier(.2,.7,.2,1) both; }
.auth-art p { color: #b8b0cc; font-size: 18px; max-width: 34ch; margin: 0; }
.auth-art .name { font-weight: 600; color: #fff; font-size: 15px; letter-spacing: .01em; }
@keyframes stroke { from { transform: scaleX(0); } }
.auth-form { display: grid; place-items: center; padding: 40px 24px; background: var(--paper); }
.auth-form .box { width: 100%; max-width: 380px; }
.auth-form h1 { margin-bottom: 6px; }
.auth-form .lede { color: var(--muted); margin-bottom: 26px; }
.auth-form .btn { width: 100%; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 64px; }
.pw-wrap button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--violet-2); font: 600 14px var(--sans); cursor: pointer; padding: 8px; }
.error-page { max-width: 520px; padding: 80px 24px; margin: auto; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Tablet & phone ------------------------------------------------------------ */
@media (max-width: 900px) {
  .shell { display: block; background: none; }
  .side { display: none; }
  .topbar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    background: var(--ink); color: #fff; padding: 12px 16px; position: sticky; top: 0; z-index: 20;
  }
  .topbar .brand { font-size: 22px; padding: 0; }
  .topbar .who { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #cfc9dd; min-width: 0; }
  .topbar.acting-on .who { display: none; }
  .topbar .who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46vw; }
  .tabbar {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    height: calc(var(--tabbar) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: var(--surface); border-top: 1px solid var(--line);
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 12px; font-weight: 500; color: var(--muted); text-decoration: none; position: relative; }
  .tabbar a svg { width: 22px; height: 22px; }
  .tabbar a.on { color: var(--violet); }
  .tabbar a.on::before { content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--marigold); }
  .tabbar a.make svg { width: 44px; height: 44px; padding: 10px; border-radius: 50%; background: var(--violet); color: #fff; margin-top: -18px; box-shadow: 0 4px 12px rgba(59,42,107,.35); }
  .tabbar a.make.on::before { display: none; }
  .acting { padding: 8px 16px; font-size: 14px; }
  .actions.stick { position: sticky; bottom: calc(var(--tabbar) + env(safe-area-inset-bottom) + 8px); z-index: 5;
    background: var(--surface); margin: 20px -6px 0; padding: 10px; border-radius: var(--r); box-shadow: 0 6px 24px rgba(30,24,48,.18); }
  .actions.stick .btn { flex: 1 1 0; }
  .tile .cap { flex-wrap: wrap; }
  .page { padding: 22px 16px calc(var(--tabbar) + 40px); }
  h1 { font-size: 26px; }
  .compose { grid-template-columns: 1fr; }
  .preview { position: static; }
  .preview .frame { max-width: 360px; }
  .today { grid-template-columns: 1fr; padding: 24px; }
  .today .last { justify-self: start; width: 160px; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { padding: 28px 24px 32px; min-height: 0; }
  .auth-art .word { font-size: 64px; margin: 28px 0 12px; }
  .auth-art p { font-size: 16px; }
  .auth-form { place-items: start center; padding-top: 32px; }
}
@media (max-width: 600px) {
  .cols, .cols-3 { grid-template-columns: 1fr; }
  .panel { padding: 18px; border-radius: var(--r); }
  .row { padding: 12px 14px; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; }
  .avatar { width: 44px; height: 44px; font-size: 17px; }
  .row .end .hide-sm { display: none; }
  .figures { gap: 24px; }
  .figures b { font-size: 28px; }
  .review { grid-template-columns: 1fr 1fr; gap: 10px; }
  label.picker { grid-template-columns: 88px 1fr; }
  .picker .thumb { width: 88px; height: 88px; }
  .actions .btn { flex: 1 1 auto; }
  .gallery { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .choice { grid-auto-flow: row; }
  .choice.pair { grid-auto-flow: column; } /* two short options stay side by side */
}

/* Text with a colour circle at its end (Make banners → design text) */
.ink-field { position: relative; }
.ink-field > input, .ink-field > textarea { width: 100%; padding-right: 84px; }
.ink-field > textarea { resize: vertical; min-height: 92px; line-height: 1.45; }
.ink { position: absolute; right: 8px; top: 8px; display: flex; align-items: center; gap: 2px; }
.ink-field > input + .ink { top: 50%; transform: translateY(-50%); }
.ink label { position: relative; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; overflow: hidden;
  background: conic-gradient(#e53935, #f9a825, #43a047, #1e88e5, #8e24aa, #e53935); box-shadow: inset 0 0 0 2px #fff, 0 0 0 1px var(--line, #d8d3e4); }
.ink label::after { content: "A"; position: absolute; inset: 0; display: grid; place-items: center; font: 700 14px/1 var(--sans, sans-serif); color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.55); pointer-events: none; }
.ink input[type=color] { position: absolute; inset: -6px; width: calc(100% + 12px); height: calc(100% + 12px); opacity: 0; cursor: pointer; border: 0; padding: 0; }
.ink.set label { background: var(--ink-c, transparent); }
.ink-reset { width: 28px; height: 28px; border: 0; background: none; color: var(--muted, #6b6480); font-size: 20px; line-height: 1; cursor: pointer; border-radius: 50%; }
.ink-reset:hover { background: rgba(0,0,0,.06); }
.ink label:focus-within { outline: 2px solid var(--violet, #3b2a6b); outline-offset: 2px; }

/* Logo beside the app name */
.brand { display: flex; align-items: center; gap: 12px; }
.brand .mark { width: 44px; height: 44px; border-radius: 12px; flex: none; box-shadow: 0 0 0 1px rgba(255,255,255,.12); }
.topbar .brand { gap: 10px; }
.topbar .brand .mark { width: 32px; height: 32px; border-radius: 9px; }
.auth-art .logo { width: 88px; height: 88px; border-radius: 22px; box-shadow: 0 0 0 1px rgba(255,255,255,.14); }
.auth-art .word { font-size: clamp(56px, 7vw, 112px); margin-bottom: 0; }
.auth-art .name { font-family: var(--display); font-size: 22px; font-weight: 600; color: var(--marigold); margin: 14px 0 6px; }
@media (max-width: 760px) {
  .auth-art .logo { width: 64px; height: 64px; border-radius: 16px; }
  .auth-art .word { font-size: 52px; }
}

/* Public policy pages */
.legal { min-height: 100vh; background: var(--paper); }
.legal-head { background: var(--ink); padding: 16px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.legal-head .brand { font-size: 22px; padding: 0; }
.legal-head .brand .mark { width: 36px; height: 36px; border-radius: 10px; }
.legal-head nav { display: flex; gap: 18px; }
.legal-head nav a { color: #c9c2dc; text-decoration: none; font-weight: 500; }
.legal-head nav a[aria-current=page], .legal-head nav a:hover { color: #fff; text-decoration: underline; text-underline-offset: 4px; }
.prose { max-width: 68ch; margin: 0 auto; padding: 40px 24px 24px; font-size: 17px; line-height: 1.65; color: var(--ink); }
.prose h1 { font-family: var(--display); font-size: 38px; line-height: 1.1; margin: 0 0 8px; }
.prose h2 { font-family: var(--display); font-size: 22px; margin: 34px 0 8px; }
.prose ul { padding-left: 22px; } .prose li { margin: 6px 0; }
.legal-foot { max-width: 68ch; margin: 0 auto; padding: 8px 24px 40px; }
.legal-links { display: flex; gap: 16px; }
