/* Admin > Operations > Engine. Its own file so two builders never edit the same stylesheet tail.
   Tokens only, from portal.css (both themes): --ink, --ink-2, --muted, --line, --canvas,
   --surface, --surface-2, --brand, --brand-soft, --brand-line, --brand-ink, --radius-card,
   --radius-control. Figures are tabular. */

.ea-root { display: grid; gap: 16px; min-width: 0; }
.ea-panel { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 22px 24px 24px; min-width: 0; }
.ea-table-slot { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; min-width: 0; }
.ea-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.ea-title { font-size: 16px; line-height: 1.4; margin: 0; }
.ea-head .badge { font-size: 12px; }
.badge.brand { background: var(--brand-soft); color: var(--brand-ink); border-color: var(--brand-line); }
.ea-note { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; max-width: 72ch; }
.ea-link { color: var(--brand-ink); text-decoration: underline; text-underline-offset: 3px; }

.ea-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 20px; margin: 0; }
.ea-fact { display: grid; gap: 2px; min-width: 0; }
.ea-fact dt { color: var(--muted); font-size: 12px; }
.ea-fact dd { margin: 0; color: var(--ink); font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }

.ea-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px 18px; align-items: start; }
.ea-field { display: grid; gap: 6px; min-width: 0; align-content: start; }
.ea-field[hidden] { display: none; }
.ea-field-label { font-size: 13px; font-weight: 600; color: var(--ink); }
.ea-field-hint { font-size: 12px; color: var(--muted); line-height: 1.5; }
.ea-select {
  width: 100%; min-height: 40px; padding: 8px 10px; font: inherit; font-size: 14px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-2, var(--line)); border-radius: var(--radius-control);
}
.ea-select:focus-visible { outline: 2px solid var(--focus, var(--brand)); outline-offset: 1px; }
.ea-select:disabled { color: var(--muted); background: var(--surface-2, var(--canvas)); }
.ea-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.ea-caution { margin: 0; color: var(--amber-ink, var(--ink)); font-size: 13px; line-height: 1.6; max-width: 72ch; }
.ea-caution:empty { display: none; }
.ea-panel > .inline-status { margin: 0; }
.ea-panel > .inline-status:empty { display: none; }
.ea-scope-panel { border-color: var(--brand-line); }
.ea-scope-panel .ea-field { max-width: 460px; }
.ea-scope-note { margin: 0; max-width: 76ch; color: var(--ink); font-size: 14px; line-height: 1.6; }
.ea-scope-panel > .button { justify-self: start; }

/* The cost table scrolls inside its panel at phone width; the page itself never does. */
.ea-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--radius-card); }
.ea-table { width: 100%; min-width: 640px; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 13px; }
.ea-table th, .ea-table td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.ea-table thead th { color: var(--muted); font-weight: 600; font-size: 12px; background: var(--surface-2, var(--canvas)); white-space: nowrap; }
.ea-table tbody tr:last-child th, .ea-table tbody tr:last-child td { border-bottom: 0; }
.ea-model { display: table-cell; font-weight: 600; color: var(--ink); white-space: nowrap; position: sticky; left: 0; background: var(--surface); }
.ea-model-head { position: sticky; left: 0; }
.ea-provider { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.ea-cell { display: table-cell; min-width: 96px; }
.ea-cell .badge { display: inline-block; margin-top: 4px; font-size: 11px; }
.ea-cell.selected { background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand-line); }
.ea-cost { display: grid; gap: 1px; }
.ea-cost strong { font-size: 14px; color: var(--ink); }
.ea-p90 { color: var(--muted); font-size: 12px; }
.ea-na { color: var(--muted); font-size: 12px; }

@media (max-width: 560px) {
  .ea-panel { padding: 18px 16px 20px; }
  .ea-grid { grid-template-columns: 1fr; }
  .ea-actions .button { flex: 1 1 100%; justify-content: center; }
}
