/* The panel, in the app's colours: ink, linen, juniper and ember from the design handoff (§15).
   Dark and light both, from the system, because Dino opens this on a phone as often as a laptop. */

:root {
  --ink-900: #0a0c0e;
  --ink-800: #14171a;
  --ink-700: #1c2024;
  --ink-600: #23272b;
  --linen: #fbf8f2;
  --linen-dim: #e4dfd4;
  --juniper: #5dcdbf;
  --juniper-deep: #018d87;
  --ember: #f68c53;

  --page: var(--ink-900);
  --card: var(--ink-800);
  --field: var(--ink-700);
  --line: rgba(251, 248, 242, 0.1);
  --line-strong: rgba(251, 248, 242, 0.2);
  --text: var(--linen);
  --muted: rgba(251, 248, 242, 0.58);
  --accent: var(--juniper);
  --accent-ink: var(--ink-900);
  --mark: var(--linen);
  --warn: var(--ember);
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}

@media (prefers-color-scheme: light) {
  :root {
    --page: var(--linen);
    --card: #ffffff;
    --field: #f4f1ea;
    --line: rgba(10, 12, 14, 0.12);
    --line-strong: rgba(10, 12, 14, 0.24);
    --text: #16191c;
    --muted: rgba(22, 25, 28, 0.6);
    --accent: var(--juniper-deep);
    --accent-ink: #ffffff;
    --mark: #22262a;
    --warn: #c4561f;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font: 15px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 820px;
  margin: 0 auto;
  padding: 22px 18px 80px;
}

/* The bar */

.bar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--page) 92%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  padding: 14px 18px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 820px;
  margin: 0 auto;
}

.mark {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
}

h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 650;
  letter-spacing: 0.2px;
}

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

.tabs {
  display: flex;
  gap: 4px;
  max-width: 820px;
  margin: 12px auto 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  appearance: none;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  padding: 9px 12px;
  white-space: nowrap;
  cursor: pointer;
}

.tab:hover {
  color: var(--text);
}

.tab[aria-current="true"] {
  color: var(--text);
  border-bottom-color: var(--accent);
}

/* Cards */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 14px;
}

.card > h2 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 650;
}

.card > h2 + .muted {
  margin-top: 0;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

/* The figure tiles */

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin: 0 0 14px;
}

.tile {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
}

.tile .n {
  font-size: 26px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.4px;
}

.tile .k {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

/* Tables and bars */

table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

th,
td {
  text-align: left;
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}

th {
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

td.n,
th.n {
  text-align: right;
  width: 5.5em;
}

tr:last-child td {
  border-bottom: 0;
}

.bar-cell {
  width: 45%;
}

.meter {
  height: 8px;
  border-radius: 4px;
  background: var(--accent);
  min-width: 2px;
}

/* Forms */

label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  margin: 14px 0 5px;
}

input,
textarea {
  width: 100%;
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  padding: 10px 12px;
}

input:focus,
textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}

textarea {
  resize: vertical;
  min-height: 64px;
}

.mono {
  font-family: var(--mono);
  font-size: 13px;
}

.row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.row > * {
  flex: 1 1 180px;
}

.count {
  float: right;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

.count.over {
  color: var(--warn);
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

button {
  appearance: none;
  border: 0;
  border-radius: 11px;
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  padding: 10px 16px;
  cursor: pointer;
}

button:disabled {
  opacity: 0.45;
  cursor: default;
}

.primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line-strong);
}

.quiet {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 7px 12px;
  font-size: 13px;
}

.warn {
  background: transparent;
  color: var(--warn);
  border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent);
}

/* The news list */

.item {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px 15px;
  margin-bottom: 10px;
  background: var(--card);
}

.item h3 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 650;
}

.item .meta {
  color: var(--muted);
  font-size: 12px;
  margin: 3px 0 0;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.item p.body {
  margin: 8px 0 0;
  font-size: 13.5px;
  color: var(--text);
}

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 20px;
  padding: 2px 9px;
  font-size: 11px;
  font-weight: 650;
  background: color-mix(in srgb, var(--text) 10%, transparent);
  color: var(--muted);
}

.pill.sent {
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  color: var(--text);
}

.pill.partial {
  background: color-mix(in srgb, var(--warn) 22%, transparent);
  color: var(--text);
}

/* The toast, and the dialog */

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 40;
  max-width: min(560px, calc(100vw - 32px));
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 11px 15px;
  font-size: 13.5px;
  box-shadow: 0 14px 34px -18px rgba(0, 0, 0, 0.8);
}

.toast.bad {
  border-color: color-mix(in srgb, var(--warn) 55%, transparent);
  color: var(--warn);
}

dialog {
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: var(--card);
  color: var(--text);
  padding: 20px;
  max-width: min(440px, calc(100vw - 32px));
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.55);
}

dialog h2 {
  margin: 0 0 8px;
  font-size: 16px;
}

.spinner {
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: -2px;
  margin-right: 6px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation-duration: 2.4s;
  }
}
