/* Admin shell. This stylesheet is loaded only on the tools admin page. */
.tool-workspace:has(> .workspace-main > form) {
  --admin-ink: #241b18;
  --admin-muted: #695d57;
  --admin-line: #e8ded6;
  --admin-paper: #fffcf8;
  background: #f8f3ed;
  min-height: 100svh;
  color: var(--admin-ink);
  font-family: "DM Sans", system-ui, sans-serif;
}
.tool-workspace:has(> .workspace-main > form) > :is(.turbo-header, .workspace-footer) { display: none; }
.tool-workspace .admin-topbar {
  min-height: 66px;
  padding: 10px max(20px, calc((100% - 1300px) / 2));
  background: #211917;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.tool-workspace .admin-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 750;
  color: #fff;
  text-decoration: none;
}
.admin-mark {
  display: inline-grid;
  place-items: center;
  background: #f9774c;
  color: #271812;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font: 800 14px/1 "Bricolage Grotesque", system-ui, sans-serif;
}
.admin-controls { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-controls[hidden] { display: none; }
.tool-workspace .admin-controls button {
  background: #362a26;
  border: 1px solid #675048;
  border-radius: 8px;
  color: #fff4ec;
  padding: 8px 11px;
  font-size: 13px;
}
.tool-workspace > .workspace-main:has(> form) {
  width: min(100%, 1370px);
  max-width: none;
  padding: 0 clamp(18px, 3vw, 35px) 54px;
}
.tool-workspace .workspace-main > .workspace-hero {
  max-width: none;
  padding: 32px 0 20px;
}
.tool-workspace .workspace-main > .workspace-hero > h1 {
  margin: 0;
  font-size: clamp(32px, 4vw, 52px);
  color: var(--admin-ink);
  letter-spacing: -.052em;
}
.tool-workspace .workspace-main > .workspace-hero > :is(.workspace-eyebrow, p) { display: none; }
.tool-workspace .workspace-main > form.workspace-panel {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 14px;
  max-width: 625px;
}
.tool-workspace .workspace-main > form.workspace-panel label { flex: 1 1 210px; margin: 0; }
.tool-workspace .workspace-main > form.workspace-panel input { width: 100%; min-height: 46px; border-radius: 8px; }
.tool-workspace .workspace-main > form.workspace-panel button {
  min-height: 46px;
  background: #a63419;
  border: 0;
  border-radius: 8px;
  color: white;
  padding: 10px 18px;
}
.tool-workspace .workspace-main .workspace-panel {
  padding: clamp(14px, 2.25vw, 24px);
  background: var(--admin-paper);
  border: 1px solid var(--admin-line);
  border-radius: 14px;
}
.tool-workspace .workspace-main .workspace-layout { margin-top: 20px; }
.tool-workspace .workspace-main[data-admin-enhanced]:not([data-admin-state="ready"]) > :is(.workspace-layout, section.workspace-panel) { display: none; }
.tool-workspace .workspace-main[data-admin-state="ready"] > form.workspace-panel { display: none; }
@media (max-width: 650px) {
  .tool-workspace .workspace-main .workspace-layout { grid-template-columns: minmax(0, 1fr); gap: 10px; }
}

/* Dashboard shadow root. */
:host {
  display: block;
  min-width: 0;
  margin-bottom: 22px;
  color: #241b18;
  font: 14px/1.5 "DM Sans", system-ui, sans-serif;
}
:host([hidden]) { display: none; }
.dashboard *, .dashboard *::before { box-sizing: border-box; }
.dashboard h2, .dashboard h3, .dashboard p { margin: 0; }
.dashboard h2, .dashboard h3, .metric strong { font-family: "Bricolage Grotesque", "DM Sans", system-ui, sans-serif; }
.dashboard .muted { color: #695d57; }
.dashboard .toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-bottom: 18px;
}
.dashboard .filters { display: flex; gap: 4px; flex-wrap: wrap; padding: 4px; border: 1px solid #e8ded6; background: #efe7df; border-radius: 10px; }
.dashboard button {
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #58483f;
  padding: 5px 10px;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}
.dashboard button[aria-pressed="true"] { background: #fffcf8; color: #712b19; border-color: #e7d3c7; }
.dashboard button:focus-visible, .dashboard .scroll:focus-visible { outline: 2px solid #a63419; outline-offset: 2px; }
.dashboard .count { margin-left: 5px; font-variant-numeric: tabular-nums; }
.dashboard .cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.dashboard .metric {
  padding: clamp(12px, 2vw, 19px);
  min-height: 112px;
  border: 1px solid #e8ded6;
  border-radius: 13px;
  background: #fffcf8;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.dashboard .metric strong { font-size: clamp(29px, 3.6vw, 43px); line-height: 1; letter-spacing: -.06em; }
.dashboard .metric span { font-weight: 650; }
.dashboard .metric:first-child { background: #2c211d; border-color: #2c211d; color: #fff3ea; }
.dashboard .metric:first-child strong { color: #ff9777; }
.dashboard .grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
.dashboard .box { min-width: 0; padding: clamp(14px, 2vw, 22px); background: #fffcf8; border: 1px solid #e8ded6; border-radius: 14px; }
.dashboard .box h2 { font-size: 21px; line-height: 1.2; letter-spacing: -.035em; margin-bottom: 12px; }
.dashboard .box h3 { font-size: 15px; }
.dashboard .scroll { overflow-x: auto; }
.dashboard table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.dashboard :is(th, td) { padding: 9px 7px; text-align: right; white-space: nowrap; border-bottom: 1px solid #eee4da; }
.dashboard tr:last-child > :is(th, td) { border-bottom-width: 0; }
.dashboard thead th { color: #695d57; font-size: 12px; font-weight: 650; border-bottom: 1px solid #e8ded6 !important; }
.dashboard :is(th, td):first-child { text-align: left; padding-left: 0; white-space: normal; min-width: 117px; }
.dashboard th[scope="row"] { font-weight: 650; }
.dashboard .geo { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 12px; }
.dashboard .geo-label, .dashboard .source-row { display: flex; justify-content: space-between; gap: 12px; }
.dashboard .geo-track { margin-top: 5px; display: flex; background: #f0e8df; border-radius: 4px; overflow: hidden; height: 7px; }
.dashboard .geo-fill { background: #b84123; }
.dashboard .sources { border-top: 1px solid #e8ded6; margin-top: 18px; padding-top: 14px; }
.dashboard .source-row { margin-top: 5px; }
.dashboard .empty { padding: 12px 0; color: #695d57; }
.dashboard details { margin-top: 14px; color: #695d57; padding: 0 2px; }
.dashboard details summary { cursor: pointer; }
.dashboard details p { margin-top: 4px; }
@media (max-width: 1010px) {
  .dashboard .grid { grid-template-columns: minmax(0, 1fr) minmax(235px, .75fr); }
}
@media (max-width: 730px) {
  .dashboard .grid { grid-template-columns: minmax(0, 1fr); }
  .dashboard .countries { grid-row: 1; }
  .dashboard .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard .metric { min-height: 90px; }
}
