/* Admin console chrome. Same palette, but plainer than the public site — this
   is a working surface, not a page to look at. */

.form label {
  display: block;
  margin-bottom: 14px;
}

.form label > span {
  display: block;
  font-family: 'Caveat', cursive;
  font-weight: 700;
  font-size: 23px;
  margin-bottom: 3px;
}

.form label > span em {
  font-family: 'Patrick Hand', cursive;
  font-style: normal;
  font-size: 15px;
  color: var(--muted);
  margin-left: 6px;
}

.form input,
.form select {
  width: 100%;
  font-family: 'Patrick Hand', cursive;
  font-size: 18px;
  color: var(--ink);
  background: var(--field-bg);
  border: 2px solid var(--field-border);
  border-radius: 8px;
  padding: 9px 12px;
}

.form input:focus,
.form select:focus {
  outline: 3px solid var(--focus);
  border-color: var(--green);
}

.form input:invalid:not(:placeholder-shown) {
  border-color: var(--red);
}

.form .grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 0 18px;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 6px;
}

/* Status text, not chart colour — see --ink-danger in themes.css. */
.form-msg { font-size: 18px; }
.form-msg.ok { color: var(--ink-success); }
.form-msg.err { color: var(--ink-danger); }

.fineprint {
  color: var(--muted);
  font-size: 16px;
  margin: 12px 0 0;
}

.fineprint code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 14px;
  background: var(--code-bg);
  padding: 1px 5px;
  border-radius: 4px;
}

/* --- banner rows ----------------------------------------------------------- */

.row-card {
  border: 3px var(--border-style) var(--edge);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 14px 18px;
  margin-bottom: 14px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.row-card.is-active { border-color: var(--green); }
.row-card.is-paused { border-color: var(--purple); }
.row-card.is-archived { opacity: .6; }

.row-card .main { flex: 1; min-width: 220px; }

.row-card .title {
  font-family: 'Caveat', cursive;
  font-weight: 700;
  font-size: 27px;
  line-height: 1.15;
}

.row-card .meta {
  font-size: 16px;
  color: var(--muted);
  margin-top: 2px;
}

.row-card .dest {
  font-size: 15px;
  color: var(--key-ink);
  word-break: break-all;
  margin-top: 3px;
}

.row-card .clicks {
  flex: none;
  text-align: center;
  min-width: 76px;
}

.row-card .clicks b {
  display: block;
  font-family: 'Permanent Marker', cursive;
  font-size: 26px;
  color: var(--green);
}

.row-card .clicks span {
  font-size: 14px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.row-actions .btn {
  font-size: 19px;
  padding: 2px 12px;
}

.btn.danger { border-color: var(--red); color: var(--red); }

.pill {
  font-family: 'Patrick Hand', cursive;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: .07em;
  border: 2px solid var(--edge);
  border-radius: 999px;
  padding: 1px 9px;
  color: var(--muted);
  white-space: nowrap;
}

.pill-active { border-color: var(--green); color: var(--green); }
.pill-draft { border-color: var(--note-cap-rule); color: var(--note-cap-ink); }
.pill-paused { border-color: var(--purple); color: var(--purple); }
.pill-promo { border-color: var(--blue); color: var(--blue); }
.pill-donor { border-color: var(--green); color: var(--green); }
.pill-marketing { border-color: var(--purple); color: var(--purple); }

.group-head {
  font-family: 'Permanent Marker', cursive;
  font-size: 22px;
  color: var(--ink);
  margin: 22px 0 10px;
}

/* --- theme picker ----------------------------------------------------------
   Each tile carries its own `data-theme`, which is the same attribute the
   document element carries. themes.css scopes its blocks with a plain
   `[data-theme=…]` rather than `:root[data-theme=…]` precisely so a tile can
   render in its own theme: the custom properties cascade into it, and the
   preview is the real stylesheet rather than a hand-painted approximation. */

.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.theme-tile {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0;
  border: 3px solid var(--edge);
  border-radius: 12px;
  background: transparent;
  overflow: hidden;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: transform .12s ease, border-color .12s ease;
}

.theme-tile:hover { transform: translateY(-2px); }
.theme-tile:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.theme-tile[aria-checked='true'] { border-color: var(--green); }
.theme-tile[aria-checked='true'] .sw-label { background: var(--surface-up); }

/* The mini page. `background: var(--body-bg)` is what makes the tile pick up
   the theme's paper, because --body-bg is only ever applied to <body>. */
.theme-swatch {
  /* A span by default, and an inline box only paints its background behind the
     line boxes — which left the theme's paper showing behind the title and
     nowhere else. */
  display: block;
  background: var(--body-bg);
  padding: 12px 12px 14px;
  min-height: 104px;
}

.theme-swatch .sw-title {
  display: block;
  font-family: 'Permanent Marker', cursive;
  font-size: 19px;
  line-height: 1;
  color: var(--title-ink);
  text-shadow: var(--title-shadow);
  background: var(--title-fill);
  -webkit-background-clip: var(--title-clip);
  background-clip: var(--title-clip);
  display: inline-block;
}

.theme-swatch .sw-head {
  display: table;
  font-family: 'Caveat', cursive;
  font-weight: 700;
  font-size: 17px;
  color: var(--heading-ink);
  background: var(--heading-hi);
  border-radius: var(--heading-hi-radius);
  padding: 0 8px;
  margin: 7px 0 8px;
  transform: rotate(var(--heading-hi-tilt));
}

.theme-swatch .sw-rows { display: flex; gap: 6px; }

.theme-swatch .sw-card {
  flex: 1;
  height: 30px;
  border: var(--border-width) var(--border-style) var(--panel-border);
  border-radius: calc(var(--radius-md) / 2);
  box-shadow: var(--shadow-card);
}

.theme-swatch .sw-card.up { background: var(--surface-up); border-color: var(--green); }
.theme-swatch .sw-card.down { background: var(--surface-down); border-color: var(--red); }

/* The label sits outside the swatch, in the admin page's own theme, so the
   name stays readable whatever the tile is showing. */
.theme-tile .sw-label {
  display: block;
  padding: 8px 11px 10px;
  background: var(--surface);
  border-top: 2px solid var(--edge);
}

.theme-tile .sw-name {
  display: block;
  font-family: 'Caveat', cursive;
  font-weight: 700;
  font-size: 22px;
  line-height: 1.1;
  color: var(--ink);
}

.theme-tile .sw-note {
  display: block;
  font-size: 15px;
  color: var(--muted);
  line-height: 1.25;
  margin-top: 2px;
}

.theme-tile .sw-live {
  display: inline-block;
  font-family: 'Patrick Hand', cursive;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--green);
  border: 2px solid var(--green);
  border-radius: 999px;
  padding: 0 8px;
  margin-top: 3px;
}

.theme-tile .sw-live[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) {
  .theme-tile:hover { transform: none; }
}
