/*
  Brand stylesheet: the one stylesheet for every page (web/templates/base.html).
  Direction "box office board" from the Drawcard design canvas. The product
  name comes from APP_NAME; nothing here depends on it.
*/

@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo-latin-wdth-normal.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/ibm-plex-mono-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

:root {
  --ink: #101114;
  --ink-2: #3a3e48;
  --muted: #5b6070;
  --paper: #edeef0;
  --card: #ffffff;
  --line: #e3e5e9;
  --line-strong: #c9ccd3;
  --accent: #c2410c;
  --accent-strong: #9a3412;
  --accent-tint: #fbf4f0;
  --range: #2b59c3;
  --danger: #b42318;
  --danger-tint: #fdf0ef;
  --success: #1e7b34;
  --success-tint: #eef7f0;
  --font-sans: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --radius: 6px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.45;
}

a {
  color: var(--accent-strong);
}
a:hover {
  color: #7c2d12;
}

:focus-visible {
  outline: 3px solid var(--range);
  outline-offset: 2px;
}

h1,
h2,
h3 {
  margin: 0;
  font-stretch: 80%;
  font-weight: 800;
  line-height: 1.1;
}
h1 {
  font-size: clamp(44px, 8vw, 80px);
  font-weight: 850;
  font-stretch: 72%;
  line-height: 0.95;
  letter-spacing: -0.02em;
}
h2 {
  font-size: 28px;
}
h3 {
  font-size: 22px;
}
p {
  margin: 0;
}

.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.mono {
  font-family: var(--font-mono);
}
.muted {
  color: var(--muted);
}
.lead {
  font-size: 20px;
  color: var(--ink-2);
  max-width: 640px;
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.num {
  font-family: var(--font-mono);
  text-align: right;
  white-space: nowrap;
}

/* Layout */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}
.page {
  padding-top: 28px;
  padding-bottom: 64px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 24px;
}
.page-head__title {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

/* Header and footer */

.site-header {
  background: var(--card);
  border-bottom: 1px solid #d5d8de;
}
.site-header .container {
  padding-top: 12px;
  padding-bottom: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}
.brand:hover {
  color: var(--ink);
}
.brand__name {
  font-size: 28px;
  font-weight: 850;
  font-stretch: 72%;
  letter-spacing: -0.01em;
}
.site-search {
  flex: 1 1 240px;
  display: flex;
}
.site-search input {
  width: 100%;
  min-width: 0;
  height: 44px;
  background: #f6f7f8;
}
.site-nav {
  display: flex;
  gap: 4px;
  font-weight: 600;
}
.site-nav a {
  color: var(--ink);
  text-decoration: none;
  padding: 10px 10px;
  border-radius: 4px;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] {
  background: var(--paper);
}
.account {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.account form {
  margin: 0;
}
.credits {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 4px;
  background: var(--ink);
  color: #fff;
  white-space: nowrap;
}
.role-tag {
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid var(--accent);
  color: var(--accent-strong);
}
.site-footer {
  border-top: 2px solid var(--ink);
  padding: 20px 0 40px;
  font-size: 14px;
  color: var(--muted);
}
.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
}

/* Breadcrumbs and tabs */

.breadcrumb ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 14px;
  color: var(--muted);
}
.breadcrumb li + li::before {
  content: "/";
  margin-right: 6px;
}
.breadcrumb a {
  color: var(--muted);
}
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tabs a {
  padding: 10px 14px;
  border-radius: 4px;
  background: var(--card);
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}
.tabs a[aria-current="page"] {
  background: var(--ink);
  color: #fff;
}

/* Cards and tiles */

.card {
  min-width: 0;
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.card__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px 16px;
}
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.tile {
  background: var(--card);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tile__label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.tile__value {
  font-family: var(--font-mono);
  font-size: 36px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.tile__note {
  font-size: 14px;
  color: var(--ink-2);
}
.step__num {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 600;
  color: var(--accent);
}
.price-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.price-list li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}
.price-list li:last-child {
  border-bottom: 0;
}
.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin: 0;
}
.facts dt {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.facts dd {
  margin: 2px 0 0;
  font-weight: 600;
}
.empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.empty strong {
  color: var(--ink);
  font-size: 18px;
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--radius);
  border: 1px solid var(--ink);
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover {
  background: var(--paper);
  color: var(--ink);
}
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: #fff;
}
.btn-dark {
  background: var(--ink);
  color: #fff;
}
.btn-dark:hover {
  background: #2a2c33;
  color: #fff;
}
.btn-danger {
  border-color: var(--danger);
  color: var(--danger);
}
.btn-danger:hover {
  background: var(--danger-tint);
  color: var(--danger);
}
.btn-sm {
  min-height: 36px;
  padding: 0 12px;
  font-size: 14px;
}
.btn[disabled] {
  cursor: not-allowed;
  border-color: var(--line-strong);
  background: var(--paper);
  color: var(--muted);
}
.cost {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.18);
}
.inline-form {
  display: inline;
  margin: 0;
}

/* Forms */

.form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field label,
.field-label {
  font-weight: 700;
}
.field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.hint {
  font-size: 14px;
  color: var(--muted);
}
input[type="text"],
input[type="search"],
input[type="url"],
input[type="number"],
input[type="email"],
select {
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--ink);
  font: inherit;
}
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}
.hero-search {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-width: 760px;
}
.hero-search input {
  flex: 1 1 280px;
  height: 56px;
  border: 2px solid var(--ink);
  font-size: 20px;
}
.hero-search .btn {
  min-height: 56px;
  padding: 0 28px;
  font-size: 18px;
}

/* Tables */

.table-wrap {
  position: relative;
  overflow-x: auto;
  min-width: 0;
  max-width: 100%;
}
.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}
.data th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 10px 8px;
  border-bottom: 2px solid var(--ink);
  white-space: nowrap;
}
.data td {
  padding: 12px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.data th.num {
  text-align: right;
}
.data a.row-title {
  color: var(--ink);
  font-weight: 700;
}
.data--wide {
  min-width: 640px;
}
.actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}
h2 a {
  color: inherit;
  text-decoration: none;
}
h2 a:hover {
  text-decoration: underline;
}

/* Tags and ticket signals */

.tag {
  display: inline-block;
  padding: 2px 8px;
  margin: 0 4px 4px 0;
  border-radius: 4px;
  background: var(--paper);
  font-size: 14px;
}
.signal {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid transparent;
}
.signal svg {
  flex: none;
}
.signal--sold {
  background: var(--ink);
  color: #fff;
}
.signal--sales {
  border-color: var(--accent);
  color: var(--accent-strong);
  background: var(--card);
}
.signal--unknown {
  border: 1px dashed #8a8f9c;
  color: var(--muted);
  background: var(--card);
}

/* Alerts */

.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  border-left: 0;
  background: var(--card);
  border: 1px solid var(--line-strong);
}
.alert-success {
  background: var(--success-tint);
  border-color: #b7dcc0;
  color: var(--success);
}
.alert-danger {
  background: var(--danger-tint);
  border-color: #f2c4bf;
  color: var(--danger);
}

/* Paid lookups (partials/lookup_button.html) */

.lookup {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}
.lookup__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.lookup-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--radius);
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.lookup-button:hover {
  background: var(--accent-strong);
}
.lookup-button[disabled] {
  cursor: wait;
  opacity: 0.7;
}
.lookup__note {
  font-size: 13px;
  color: var(--muted);
  max-width: 460px;
}
.lookup__warn {
  font-size: 14px;
  color: var(--danger);
}
.lookup-status {
  font-size: 14px;
}
.lookup-status[data-state="ok"] {
  color: var(--success);
}
.lookup-status[data-state="error"] {
  color: var(--danger);
}

/* Dialog (admin credit grants) */

dialog {
  border: 0;
  border-radius: 8px;
  padding: 28px;
  width: min(520px, calc(100% - 32px));
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}
dialog::backdrop {
  background: rgba(16, 17, 20, 0.55);
}

@media (max-width: 640px) {
  .container {
    padding-left: 16px;
    padding-right: 16px;
  }
  .page-head {
    align-items: flex-start;
  }
  .card {
    padding: 18px;
  }
}

/* New (#54): results only the signed-in user can see until the weekly batch. */
.tag--staged {
  background: var(--accent-tint);
  color: var(--accent-strong);
  font-family: var(--font-mono);
  font-size: 12px;
  white-space: nowrap;
}
.alert-staged {
  background: var(--accent-tint);
  border-color: var(--accent);
  color: var(--accent-strong);
}

/* New (#52): a long audience range wraps at its dash rather than overflowing. */
.tile__value {
  overflow-wrap: anywhere;
}
