/* IDRA admin portal - IDRA palette (the app's asset catalog: Primary / ModernGray /
   Success / Error / Warning), soft three-column dashboard: navigation, work area,
   overview panel. */

:root {
  color-scheme: light;
  --primary-50: #f0fbff;
  --primary-100: #def2fa;
  --primary-200: #c6e4f1;
  --primary-300: #8cbcd1;
  --primary-400: #3e8aac;
  --primary-500: #166e8f;
  --primary-600: #005473;
  --primary-700: #003b59;
  --primary-800: #00243f;
  --gray-200: #e3e8ef;
  --gray-300: #cdd5df;
  --gray-400: #9aa4b2;
  --gray-500: #697586;
  --gray-600: #4b5565;
  --gray-700: #364152;
  --gray-900: #121926;
  --success-50: #ecfdf3;
  --success-700: #027a48;
  --error-50: #fef3f2;
  --error-200: #fecdca;
  --error-600: #d92d20;
  --warning-100: #fef0c7;
  --warning-600: #dc6803;

  --canvas: #e9f3f8;
  --work: #f3f8fb;
  --shadow-soft: 0 18px 50px rgba(0, 59, 89, 0.10);
  --shadow-lift: 0 10px 28px rgba(0, 59, 89, 0.12);
  --shadow-button: 0 8px 18px rgba(0, 84, 115, 0.28);

  --font: "Manrope", system-ui, sans-serif;
  --step--1: 0.8125rem;
  --step-0: 0.9375rem;
  --step-1: 1.125rem;
  --step-2: 1.5rem;
  --step-3: 2rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flow-root; /* keeps the frame's margin inside the body (no collapse, no extra scroll) */
  color: var(--gray-900);
  font: 500 var(--step-0) / 1.5 var(--font);
  background:
    radial-gradient(circle at 12% 8%, rgba(198, 228, 241, 0.75) 0 22rem, transparent 22.1rem),
    radial-gradient(circle at 92% 96%, rgba(222, 242, 250, 0.9) 0 28rem, transparent 28.1rem),
    var(--canvas);
}

h1, h2, h3 { margin: 0; line-height: 1.2; font-weight: 700; color: var(--gray-900); }
h2 { font-size: var(--step-2); }
h3 { font-size: var(--step-1); }
p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--primary-300); outline-offset: 2px; border-radius: 8px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.icon { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ------------------------------------------------------------------ sign-in */

.signin { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem; }
.signin-card {
  width: min(28rem, 100%);
  background: #fff;
  border-radius: 28px;
  box-shadow: var(--shadow-soft);
  padding: 2.75rem 2.5rem;
  display: grid;
  gap: 1.1rem;
  justify-items: start;
}
.signin-emblem { width: 8.25rem; height: auto; margin-bottom: 0.5rem; }
.signin h1 { font-size: var(--step-3); }
.signin p { color: var(--gray-500); }
.fineprint { font-size: var(--step--1); }

/* ------------------------------------------------------------------ shell */

/* One screen: the frame is exactly the window's height; only the work area (and,
   if needed, the panel) scrolls inside it. Sign out stays visible at the bottom. */
.shell {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr) 19rem;
  grid-template-rows: minmax(0, 1fr);
  max-width: 88rem;
  height: calc(100vh - 5rem);
  height: calc(100dvh - 5rem);
  margin: 2.5rem auto;
  background: #fff;
  border-radius: 28px;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

/* sidebar */
.sidebar { display: flex; flex-direction: column; gap: 2rem; padding: 2.25rem 1.5rem 1.5rem; min-height: 0; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 0.75rem; padding: 0 0.5rem; }
.brand img { width: 2.75rem; height: auto; }
.brand-text { display: grid; line-height: 1.15; }
.brand-text strong { font-size: var(--step-1); font-weight: 800; color: var(--primary-600); letter-spacing: 0.02em; }
.brand-text span { font-size: var(--step--1); color: var(--gray-500); }

.nav { display: grid; gap: 0.15rem; }
.nav-group { font-size: var(--step--1); color: var(--gray-400); padding: 1rem 0.75rem 0.4rem; }
.nav-group:first-child { padding-top: 0; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  font: 600 var(--step-0) / 1 var(--font);
  color: var(--gray-600);
  background: none;
  border: 0;
  border-radius: 12px;
  padding: 0.7rem 0.75rem;
  cursor: pointer;
  text-align: left;
}
.nav-item:hover { color: var(--primary-600); background: var(--primary-50); }
.nav-item[aria-current="page"] { color: var(--primary-600); background: var(--primary-100); }

.me { margin-top: auto; display: flex; align-items: center; gap: 0.65rem; padding: 0.5rem; }
.avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--primary-100);
  color: var(--primary-600);
  font-weight: 700;
  font-size: var(--step--1);
}
.me-text { display: grid; min-width: 0; line-height: 1.25; }
.me-text span:first-child { font-weight: 700; font-size: var(--step--1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-role { color: var(--gray-400); font-size: 0.75rem; }
.icon-button {
  margin-left: auto;
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: var(--gray-500);
  cursor: pointer;
}
.icon-button:hover { background: var(--error-50); color: var(--error-600); }

/* work area */
.main { background: var(--work); padding: 2.25rem clamp(1rem, 3vw, 2.5rem) 2.5rem; min-width: 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.view { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.75rem; }
.view-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.block { display: grid; gap: 1rem; min-width: 0; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem 1rem; flex-wrap: wrap; }
.section-head .filter-pills { flex: 0 1 auto; }
.section-title { font-size: var(--step-1); }
.lede { color: var(--gray-500); max-width: 68ch; margin-top: -0.75rem; }
.empty { color: var(--gray-500); padding: 1.5rem 0.25rem; }

/* company cards (folder shape) */
.company-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 1.25rem; }
.company-card {
  position: relative;
  display: grid;
  gap: 1.75rem;
  margin-top: 0.85rem;
  padding: 1.25rem 1.35rem 1.35rem;
  background: #fff;
  border: 0;
  border-radius: 0 18px 18px 18px;
  box-shadow: var(--shadow-lift);
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.company-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: -0.85rem;
  width: 45%;
  height: 1.2rem;
  background: inherit;
  border-radius: 14px 14px 0 0;
}
.company-card:hover { transform: translateY(-2px); }
.company-card .card-meta { font-size: var(--step--1); color: var(--gray-500); }
.company-card .card-name { font-weight: 700; font-size: var(--step-1); overflow-wrap: anywhere; }
.company-card .card-top { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.company-card.featured { background: var(--primary-600); color: #fff; box-shadow: var(--shadow-button); }
.company-card.featured .card-meta { color: var(--primary-200); }
.company-card.featured .airbase { background: rgba(255, 255, 255, 0.16); color: #fff; }
.company-card.new {
  background: transparent;
  box-shadow: none;
  border: 2px dashed var(--primary-300);
  border-radius: 18px;
  color: var(--primary-600);
  place-content: center;
  justify-items: center;
  gap: 0.4rem;
  min-height: 8.5rem;
  font-weight: 700;
}
.company-card.new::before { display: none; }

/* rows (the reference's file list) */
.rows { display: grid; gap: 0.35rem; }
.row {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1.5fr) 6rem 6.5rem 7rem auto;
  align-items: center;
  gap: 1rem;
  padding: 0.7rem 1rem;
  border-radius: 14px;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
.row:hover, .row:focus-within { background: #fff; box-shadow: var(--shadow-lift); }
.row.companies { grid-template-columns: minmax(0, 1.6fr) 7rem 6rem 5rem minmax(0, 1fr) auto; }
.row.audit { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.3fr); align-items: start; }
.row.admins { grid-template-columns: minmax(0, 2fr) 7rem minmax(0, 1fr) auto; }
.row-head { color: var(--gray-400); font-size: var(--step--1); padding-top: 0; padding-bottom: 0.25rem; }
.row-head:hover { background: none; box-shadow: none; }
.who { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
.who .avatar { width: 2.25rem; height: 2.25rem; }
.who-text { display: grid; min-width: 0; line-height: 1.3; }
.who-text strong { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-text span { color: var(--gray-500); font-size: var(--step--1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell.actions { overflow: visible; }
/* main line + quieter second line; one line each, cut with an ellipsis (full text on hover) */
.stack { display: grid; gap: 0.15rem; }
.stack .line { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stack .line.strong { font-weight: 700; }
.stack .line.sub { color: var(--gray-500); font-size: var(--step--1); }
.stack .line.muted { color: var(--gray-400); }
.muted { color: var(--gray-500); }
.small { font-size: var(--step--1); }
.nowrap { white-space: nowrap; }
.actions { justify-self: end; }

.airbase {
  display: inline-block;
  font-weight: 800;
  font-size: var(--step--1);
  letter-spacing: 0.06em;
  color: var(--primary-600);
  background: var(--primary-100);
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
}
.airbase.none { color: var(--error-600); background: var(--error-50); }

.status { display: inline-block; font-size: var(--step--1); font-weight: 700; padding: 0.2rem 0.65rem; border-radius: 999px; }
.status.on { color: var(--success-700); background: var(--success-50); }
.status.off { color: var(--error-600); background: var(--error-50); }
.status.pending { color: var(--warning-600); background: var(--warning-100); }

/* ------------------------------------------------------------------ overview panel */

.panel { display: flex; flex-direction: column; gap: 1.5rem; padding: 2.25rem 1.75rem 1.75rem; min-height: 0; overflow-y: auto; }
.search { position: relative; display: block; }
.search input {
  border-radius: 999px;
  background: var(--work);
  border-color: transparent;
  padding: 0.7rem 3.25rem 0.7rem 1.25rem;
  font-size: var(--step--1);
}
.search-button {
  position: absolute;
  right: 0.3rem;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 2.3rem;
  height: 2.3rem;
  border-radius: 50%;
  background: var(--primary-600);
  color: #fff;
  box-shadow: var(--shadow-button);
}
.search-button .icon { width: 1.05rem; height: 1.05rem; }
.panel-title { font-size: var(--step-1); }
.stats { display: grid; gap: 0.85rem; }
.stat {
  display: grid;
  grid-template-columns: 1fr auto 4.5rem;
  align-items: center;
  gap: 0.75rem;
  background: var(--work);
  border-radius: 18px;
  padding: 0.85rem 1.1rem;
}
.stat-label { font-weight: 700; font-size: var(--step--1); line-height: 1.3; }
.stat-unit { color: var(--gray-500); font-size: var(--step--1); line-height: 1.3; }
.ring {
  --value: 0;
  position: relative;
  display: grid;
  place-items: center;
  width: 3.6rem;
  height: 3.6rem;
  border-radius: 50%;
  background: conic-gradient(var(--primary-500) calc(var(--value) * 1%), var(--primary-100) 0);
  font-weight: 800;
  color: var(--primary-600);
}
.ring::before { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--work); }
.ring span { position: relative; }

.panel-cta {
  margin-top: auto;
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 0.5rem;
  padding: 1.75rem 1rem 0.5rem;
}
.panel-cta img { width: 8.25rem; height: auto; margin-bottom: 0.75rem; }
.panel-cta p { color: var(--gray-500); font-size: var(--step--1); max-width: 22ch; margin-bottom: 0.75rem; }

/* ------------------------------------------------------------------ controls */

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font: 700 var(--step--1) / 1 var(--font);
  letter-spacing: 0.02em;
  border-radius: 999px;
  border: 1px solid var(--gray-300);
  background: #fff;
  color: var(--gray-700);
  padding: 0.75rem 1.3rem;
  cursor: pointer;
  white-space: nowrap;
}
.button .icon { width: 1rem; height: 1rem; stroke-width: 2.2; }
.button:hover { border-color: var(--primary-400); color: var(--primary-600); }
.button.primary { background: var(--primary-600); border-color: var(--primary-600); color: #fff; box-shadow: var(--shadow-button); }
.button.primary:hover { background: var(--primary-700); border-color: var(--primary-700); color: #fff; }
.button.ghost { background: transparent; }
.button.quiet { border-color: transparent; background: transparent; color: var(--gray-500); box-shadow: none; }
.button.quiet:hover { color: var(--gray-900); }
.button.danger { color: var(--error-600); border-color: var(--error-200); }
.button.danger:hover { background: var(--error-600); border-color: var(--error-600); color: #fff; }
.button:disabled { opacity: 0.5; cursor: not-allowed; }

/* company filter: pills instead of the browser's unstyleable dropdown */
.filter-pills { display: flex; gap: 0.5rem; overflow-x: auto; scrollbar-width: none; padding: 0.25rem; margin: -0.25rem; max-width: 100%; }
.filter-pills::-webkit-scrollbar { display: none; }
.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex: none;
  font: 700 var(--step--1) / 1 var(--font);
  color: var(--gray-600);
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 999px;
  padding: 0.45rem 0.5rem 0.45rem 0.95rem;
  cursor: pointer;
}
.filter-pill:hover { color: var(--primary-600); border-color: var(--primary-300); }
.filter-pill[aria-pressed="true"] { color: #fff; background: var(--primary-600); border-color: var(--primary-600); }
.filter-count {
  min-width: 1.5rem;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  background: var(--primary-50);
  color: var(--primary-600);
  font-size: 0.75rem;
  text-align: center;
}
.filter-pill[aria-pressed="true"] .filter-count { background: rgba(255, 255, 255, 0.18); color: #fff; }
.company-card.selected { outline: 3px solid var(--primary-300); outline-offset: 3px; }

.field { display: grid; gap: 0.35rem; font-weight: 600; font-size: var(--step--1); color: var(--gray-700); }
.field small { font-weight: 500; color: var(--gray-500); }
input, select {
  font: 500 var(--step-0) / 1.3 var(--font);
  color: var(--gray-900);
  background: #fff;
  border: 1px solid var(--gray-300);
  border-radius: 12px;
  padding: 0.65rem 0.85rem;
  width: 100%;
  min-width: 0;
}
input:focus, select:focus { border-color: var(--primary-400); outline: 3px solid var(--primary-100); }
input:user-invalid { border-color: var(--error-600); }
.form-error { color: var(--error-600); font-weight: 600; font-size: var(--step--1); }

/* ------------------------------------------------------------------ dialogs */

dialog {
  border: 0;
  border-radius: 24px;
  padding: 0;
  width: min(36rem, calc(100vw - 2rem));
  color: var(--gray-900);
  box-shadow: 0 30px 80px rgba(0, 36, 63, 0.30);
}
dialog::backdrop { background: rgba(0, 36, 63, 0.40); }
dialog form { display: grid; gap: 1rem; padding: 1.75rem; }
.dialog-meta { color: var(--gray-500); display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 0.5rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

#dialog-manage { width: min(46rem, calc(100vw - 2rem)); }
.manage-row {
  display: grid;
  grid-template-columns: 1fr minmax(16rem, 1.15fr);
  gap: 1rem;
  align-items: center;
  padding: 0.95rem 0;
  border-top: 1px solid var(--gray-200);
}
.manage-row p { color: var(--gray-500); font-size: var(--step--1); }
.manage-row.danger strong { color: var(--error-600); }
.manage-control { display: flex; gap: 0.5rem; }

.credentials { display: grid; grid-template-columns: auto 1fr; gap: 0.6rem 1rem; margin: 0; background: var(--primary-50); border-radius: 14px; padding: 1rem 1.25rem; }
.credentials dt { color: var(--gray-500); }
.credentials dd { margin: 0; font-weight: 700; word-break: break-all; }
.secret { font-size: var(--step-1); letter-spacing: 0.02em; color: var(--primary-700); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%);
  background: var(--primary-800);
  color: #fff;
  padding: 0.8rem 1.25rem;
  border-radius: 999px;
  max-width: calc(100vw - 2rem);
  box-shadow: var(--shadow-soft);
  z-index: 20;
  font-weight: 600;
}
.toast.error { background: var(--error-600); }

/* ------------------------------------------------------------------ smaller screens */

@media (max-height: 56rem) {
  .shell { margin: 1.25rem auto; height: calc(100vh - 2.5rem); height: calc(100dvh - 2.5rem); }
  .sidebar, .main, .panel { padding-top: 1.5rem; }
  .stats { gap: 0.6rem; }
  .stat { padding: 0.6rem 1rem; }
  .ring { width: 3.1rem; height: 3.1rem; }
  .panel-cta img { display: none; }
  .panel-cta { padding-top: 0.5rem; }
}

@media (max-width: 82rem) {
  .shell { grid-template-columns: 14rem minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); margin: 1.25rem; height: calc(100vh - 2.5rem); height: calc(100dvh - 2.5rem); }
  .sidebar { grid-row: 1 / span 2; }
  .panel { grid-column: 2; grid-row: 1; padding: 1.5rem clamp(1rem, 3vw, 2.5rem) 0; background: var(--work); display: grid; grid-template-columns: minmax(0, 1fr); overflow: visible; }
  .main { grid-column: 2; grid-row: 2; padding-top: 1.25rem; }
  .stats { grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); }
  .panel-title, .panel-cta { display: none; }
  .search input, .stat { background: #fff; }
  .stat { box-shadow: var(--shadow-lift); }
}

@media (max-width: 52rem) {
  /* phones: a normal scrolling page (Sign out sits in the top bar) */
  .shell { display: block; margin: 0; border-radius: 0; box-shadow: none; height: auto; min-height: 100vh; }
  .main, .sidebar, .panel { overflow: visible; }
  .sidebar { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem; padding: 1rem; border-bottom: 1px solid var(--gray-200); }
  .nav { display: flex; flex-wrap: wrap; gap: 0.25rem; order: 3; width: 100%; }
  .nav-group { display: none; }
  .nav-item { width: auto; padding: 0.55rem 0.75rem; }
  .me { margin: 0 0 0 auto; padding: 0; }
  .me-text { display: none; }
  .panel { padding: 1rem 1rem 0; }
  .main { padding: 1rem; }
  .row, .row.companies, .row.audit, .row.admins { grid-template-columns: minmax(0, 1fr) auto; gap: 0.35rem 0.75rem; background: #fff; }
  .row > .cell:not(:first-child):not(.actions) { grid-column: 1; }
  .row .actions { grid-column: 2; grid-row: 1; }
  .row-head { display: none; }
  .grid-2, .manage-row { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  .company-card:hover { transform: none; }
}

/* ------------------------------------------------------------------ v2: dialogs, selects, airbases, activity */

/* Dropdowns drawn by the portal, not the browser (chevron is a data: SVG - CSP img-src allows data:). */
select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23005473' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1.1rem;
  cursor: pointer;
}
textarea {
  font: 500 var(--step-0) / 1.45 var(--font);
  color: var(--gray-900);
  background: #fff;
  border: 1px solid var(--gray-300);
  border-radius: 12px;
  padding: 0.65rem 0.85rem;
  width: 100%;
  resize: vertical;
}
textarea:focus { border-color: var(--primary-400); outline: 3px solid var(--primary-100); }
input[readonly] { background: var(--work); color: var(--gray-500); }

dialog { max-height: calc(100dvh - 2rem); overflow-y: auto; overscroll-behavior: contain; }
dialog.wide { width: min(52rem, calc(100vw - 2rem)); }
.manage-head { display: flex; align-items: flex-start; gap: 1rem; }
.manage-who { flex: 1; min-width: 0; display: grid; gap: 0.35rem; }
.manage-who h3 { font-size: var(--step-2); }
.avatar.large { width: 3.25rem; height: 3.25rem; font-size: var(--step-0); }
.dot { width: 4px; height: 4px; border-radius: 50%; background: var(--gray-300); display: inline-block; }
.unit-chip { font-size: var(--step--1); font-weight: 700; color: var(--gray-600); background: var(--work); border-radius: 999px; padding: 0.2rem 0.65rem; }
.close-button {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: 0;
  background: var(--work);
  color: var(--gray-600);
  cursor: pointer;
}
.close-button:hover { background: var(--primary-100); color: var(--primary-600); }
.manage-head .status { margin-top: 0.4rem; }

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.tile { display: grid; gap: 0.7rem; align-content: start; background: var(--work); border-radius: 18px; padding: 1.25rem; }
.tile h4 { margin: 0; font-size: var(--step-0); font-weight: 700; }
.tile > p { color: var(--gray-500); font-size: var(--step--1); margin-top: -0.4rem; }
.tile .button { justify-self: start; }
.tile-divider { height: 1px; background: var(--gray-200); margin: 0.35rem 0; }

.danger-zone { border: 1px solid var(--error-200); border-radius: 18px; padding: 0.35rem 1.25rem; }
.danger-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.85rem 0; flex-wrap: wrap; }
.danger-row + .danger-row { border-top: 1px solid var(--error-50); }
.danger-row strong { color: var(--error-600); }
.danger-row p { color: var(--gray-500); font-size: var(--step--1); }
.danger-row .manage-control { flex: 0 1 22rem; }

.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.span-2 { grid-column: span 2; }
.corners { border: 0; margin: 0; padding: 1rem; background: var(--work); border-radius: 18px; min-width: 0; }
.corners legend { float: left; width: 100%; padding: 0; margin-bottom: 0.75rem; font-weight: 700; font-size: var(--step--1); color: var(--gray-700); }
.corners-grid { clear: both; display: grid; grid-template-columns: 1fr 1fr; gap: 0.85rem 1rem; }

.row.airbases { grid-template-columns: minmax(0, 2.2fr) minmax(0, 2fr) 5rem 6rem auto; }
.row.airbases .who strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row.activity { grid-template-columns: 11rem minmax(0, 1fr) minmax(0, 2.2fr); align-items: start; }
.source { display: inline-block; font-size: 0.75rem; font-weight: 700; border-radius: 999px; padding: 0.1rem 0.55rem; }
.source.trials { color: var(--primary-600); background: var(--primary-100); }
.source.internal { color: var(--warning-600); background: var(--warning-100); }
.event { display: inline-block; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.04em; border-radius: 6px; padding: 0.05rem 0.4rem; vertical-align: 1px; }
.event.upload { color: var(--success-700); background: var(--success-50); }
.event.edit { color: var(--gray-700); background: var(--gray-200); }

@media (max-width: 52rem) {
  .tiles, .grid-3, .corners-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .row.airbases, .row.activity { grid-template-columns: minmax(0, 1fr) auto; }
}
