/* Automaton app UI kit 2.1.0 - https://github.com/rzvdaniel/automaton-apps/tree/main/design/automaton-app-ui
   Copied into each app as ui/app.css. Do not edit a copy: change the kit and copy it again. */

/* Two looks.
   Default ("app"): neutral colours and system fonts, accent from --accent. For tools, productivity and anything people build.
   <html data-look="system">: the Automaton Studio look. Only for official apps that run the server (Server Console, backups, monitors).
   Light and dark follow the visitor's system; data-theme="light|dark" on <html> forces one. */

:root {
  color-scheme: light dark;
  --accent: #2f5bd3;
  --ink: #17181c;
  --orange: var(--accent);
  --orange-ink: color-mix(in srgb, var(--accent) 80%, black);
  --orange-soft: color-mix(in srgb, var(--accent) 12%, white);
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f8f9fa;
  --text: #1b1d22;
  --muted: #5d626c;
  --border: #e1e3e8;
  /* Status (Studio Home): normal is quiet ink, attention and failure are the same orange, red is only --danger. */
  --ok: #55565e;
  --bar: #17181c;
  --warn: #b84a08;
  --critical: #b84a08;
  --danger: #b42318;
  --neutral: #5d626c;
  --focus: var(--accent);
  --rail: #1b1d22;
  --rail-text: #f2f3f5;
  --rail-muted: #a3a7b1;
  --shadow: 0 1px 2px rgb(23 24 28 / 5%);
  --radius: 12px;
  --display: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

:root[data-look="system"] {
  --accent: #f26a1b;
  --orange-ink: #a23d05;
  --orange-soft: #ffe6d6;
  --bg: #f3f2ee;
  --surface: #fdfdfb;
  --surface-2: #f7f6f2;
  --text: #17181c;
  --muted: #55565e;
  --border: #e2e0da;
  --neutral: #55565e;
  --rail: #17181c;
  --rail-text: #f1f0eb;
  --rail-muted: #a9aab1;
  --shadow: none;
  --radius: 16px;
  --display: "Bricolage Grotesque", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111317;
    --surface: #191b20;
    --surface-2: #1f2127;
    --text: #ececf0;
    --muted: #a3a7b1;
    --border: #2c2f36;
    --ok: #a3a7b1;
    --bar: #ececf0;
    --warn: #ff9a5c;
    --critical: #ff9a5c;
    --danger: #ff7262;
    --neutral: #a3a7b1;
    --orange-ink: color-mix(in srgb, var(--accent) 65%, white);
    --orange-soft: color-mix(in srgb, var(--accent) 18%, black);
    --rail: #0b0c0e;
    --shadow: none;
  }
  :root[data-look="system"]:not([data-theme="light"]) { --bg: #101114; --surface: #18191d; --surface-2: #1e2025; --border: #2c2e35; --orange-ink: #ff9a5c; --orange-soft: #3a2416; }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111317;
  --surface: #191b20;
  --surface-2: #1f2127;
  --text: #ececf0;
  --muted: #a3a7b1;
  --border: #2c2f36;
  --ok: #a3a7b1;
  --bar: #ececf0;
  --warn: #ff9a5c;
  --critical: #ff9a5c;
  --danger: #ff7262;
  --neutral: #a3a7b1;
  --orange-ink: color-mix(in srgb, var(--accent) 65%, white);
  --orange-soft: color-mix(in srgb, var(--accent) 18%, black);
  --rail: #0b0c0e;
  --shadow: none;
}
:root[data-look="system"][data-theme="dark"] { --bg: #101114; --surface: #18191d; --surface-2: #1e2025; --border: #2c2e35; --orange-ink: #ff9a5c; --orange-soft: #3a2416; }
:root[data-theme="light"] { color-scheme: light; }

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

html { -webkit-text-size-adjust: 100%; }

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

[hidden] { display: none !important; }

h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--display); }

a { color: var(--orange-ink); text-underline-offset: 2px; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }

.a-mono { font-family: var(--mono); font-size: 0.92em; }
.a-muted { color: var(--muted); }
.a-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Page and header */

.a-page { max-width: 1280px; margin: 0 auto; padding: 20px 16px 48px; }

.a-header { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 4px 0 22px; }
.a-brand { display: block; flex: none; width: 32px; height: 32px; }
.a-brand rect { fill: #f26a1b; }
.a-brand path { fill: none; stroke: #17181c; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.a-header__brand { display: flex; gap: 12px; align-items: center; min-width: 0; }
.a-header__text { flex: 1 1 200px; min-width: 0; }
.a-header__title { font-family: var(--display); font-size: 22px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; }
.a-header__sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.a-header__actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Cards and grids */

.a-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items: start; }
.a-grid--wide { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.a-stack { display: grid; gap: 16px; }

.a-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px 18px 16px; min-width: 0;
}
.a-card__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.a-card__title { font: 700 17px/1.3 var(--display); color: var(--text); }
.a-card__foot { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; }

/* Status pills */

.a-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 8px; border-radius: 999px;
  font: 500 12px/1.5 var(--mono); white-space: nowrap;
  color: var(--neutral); border: 1px solid color-mix(in srgb, currentColor 45%, transparent); background: transparent;
}
.a-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.a-pill--ok { color: var(--ok); }
.a-pill--warning { color: var(--warn); background: color-mix(in srgb, var(--warn) 9%, transparent); }
.a-pill--critical { color: var(--critical); background: color-mix(in srgb, var(--critical) 8%, transparent); }
.a-pill--critical { font-weight: 600; }
.a-pill--running { color: var(--warn); background: transparent; }
.a-pill--running::before { background: transparent; border: 1.5px solid currentColor; }
.a-pill--large { font-size: 14px; padding: 5px 14px 5px 11px; }

/* Stat tiles and key/value rows */

.a-stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.a-stat { min-width: 0; }
.a-stat__label { color: var(--muted); font-size: 12px; }
.a-stat__value { font-family: var(--display); font-size: 28px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.a-stat__value small { font-size: 14px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.a-stat__hint { color: var(--muted); font-size: 12px; margin-top: 2px; }
.a-stat--ok .a-stat__value { color: var(--ok); }
.a-stat--warning .a-stat__value { color: var(--warn); }
.a-stat--critical .a-stat__value { color: var(--critical); }

.a-kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; }
.a-kv dt { color: var(--muted); }
.a-kv dd { margin: 0; text-align: right; min-width: 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }

/* Meter (use for a percentage of something) */

.a-meter { height: 8px; border-radius: 999px; background: color-mix(in srgb, var(--neutral) 18%, transparent); overflow: hidden; }
.a-meter > span { display: block; height: 100%; width: var(--value, 0%); border-radius: inherit; background: var(--bar); transition: width 0.4s ease; }
.a-meter--warning > span { background: var(--warn); }
.a-meter--critical > span { background: var(--critical); }

.a-metric { display: grid; gap: 6px; padding: 12px 0; border-top: 1px solid var(--border); }
.a-metric:first-child { border-top: 0; padding-top: 0; }
.a-metric__row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.a-metric__name { font-weight: 600; }
.a-metric__value { font-variant-numeric: tabular-nums; }
.a-metric__spark { display: flex; align-items: center; gap: 10px; }
.a-metric__spark .a-spark { flex: 1; }

/* Sparkline: build with AutomatonUI.sparkline() */

.a-spark { display: block; width: 100%; height: 34px; color: var(--ok); overflow: visible; }
.a-spark--warning { color: var(--warn); }
.a-spark--critical { color: var(--critical); }
.a-spark__line { fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.a-spark__area { fill: currentColor; opacity: 0.12; stroke: none; }
.a-spark__empty { stroke: var(--border); stroke-width: 1; stroke-dasharray: 3 4; vector-effect: non-scaling-stroke; }

/* Tables */

.a-table-wrap { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
.a-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.a-table th { text-align: left; color: var(--muted); font-size: 12px; font-weight: 600; padding: 0 12px 8px 0; white-space: nowrap; }
.a-table td { padding: 10px 12px 10px 0; border-top: 1px solid var(--border); vertical-align: middle; }
.a-table th:last-child, .a-table td:last-child { padding-right: 0; text-align: right; }
.a-table .a-num { text-align: right; font-variant-numeric: tabular-nums; }

/* Buttons and forms */

.a-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 36px; padding: 0 14px;
  border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font: 600 14px/1 var(--font); cursor: pointer; text-decoration: none;
}
.a-btn:hover { background: var(--surface-2); }
.a-btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text, #fff); }
:root[data-look="system"] .a-btn--primary { color: #17181c; }
.a-btn--primary:hover { background: color-mix(in srgb, var(--accent) 88%, white); }

.a-btn--danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); }
.a-btn--icon { width: 36px; padding: 0; }
.a-btn[disabled] { opacity: 0.55; cursor: not-allowed; }

.a-form { display: grid; gap: 12px; }
.a-field { display: grid; gap: 6px; }
.a-label { font-size: 13px; font-weight: 600; }
.a-hint { font-size: 12px; color: var(--muted); }
.a-input {
  min-height: 40px; width: 100%; padding: 0 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font: 15px var(--font);
}
.a-input:focus { outline: 2px solid var(--focus); outline-offset: 1px; }

/* Empty and waiting states */

.a-empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.a-empty__title { color: var(--text); font-size: 17px; font-weight: 650; margin-bottom: 6px; }

.a-waiting {
  display: grid; gap: 14px; padding: 22px; border-radius: var(--radius); background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--orange) 45%, var(--border)); box-shadow: var(--shadow);
  background-image: linear-gradient(135deg, color-mix(in srgb, var(--orange) 9%, transparent), transparent 55%);
}
.a-waiting__title { font-size: 18px; font-weight: 650; }
.a-steps { margin: 0; padding-left: 22px; display: grid; gap: 6px; }
.a-steps li::marker { color: var(--orange-ink); font-weight: 700; }

.a-note { padding: 10px 12px; border-radius: 10px; font-size: 13px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); }
.a-note--warning { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, var(--border)); background: color-mix(in srgb, var(--warn) 9%, var(--surface)); }
.a-note--critical { color: var(--critical); border-color: color-mix(in srgb, var(--critical) 40%, var(--border)); background: color-mix(in srgb, var(--critical) 8%, var(--surface)); }

.a-list { list-style: none; margin: 0; padding: 0; display: grid; }
.a-list > li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); min-width: 0; }
.a-list > li:first-child { border-top: 0; padding-top: 0; }
.a-list > li > :first-child { min-width: 0; overflow-wrap: anywhere; }

.a-footer { margin-top: 28px; text-align: center; color: var(--muted); font-size: 12px; }

/* Top bar (optional): the dark Studio rail above a-page */

.a-topbar { background: var(--rail); color: var(--rail-text); padding: 0 16px; }
.a-topbar__inner { max-width: 1280px; margin: 0 auto; min-height: 64px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.a-topbar .a-header__title { font-size: 18px; font-weight: 600; color: #fff; white-space: nowrap; }
.a-topbar .a-header__sub { color: var(--rail-muted); }
.a-topbar .a-btn { background: transparent; color: var(--rail-text); border-color: rgb(255 255 255 / 18%); }

/* Columns of cards with no holes: cards of any height flow top to bottom, then into the next column */

.a-columns { columns: 3 340px; column-gap: 16px; }
.a-columns > * { break-inside: avoid; margin-bottom: 16px; }

/* Page-level banner: what needs the reader now, above everything else */

.a-banner { display: grid; gap: 6px; padding: 14px 18px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); margin-bottom: 16px; }
.a-banner__title { font: 700 16px/1.3 var(--display); }
.a-banner ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.a-banner--warning { border-color: color-mix(in srgb, var(--warn) 40%, var(--border)); background: color-mix(in srgb, var(--warn) 7%, var(--surface)); }
.a-banner--critical { border-color: color-mix(in srgb, var(--critical) 40%, var(--border)); background: color-mix(in srgb, var(--critical) 6%, var(--surface)); }

/* Phone width */

@media (max-width: 640px) {
  .a-page { padding: 14px 12px 40px; }
  .a-grid, .a-grid--wide { grid-template-columns: 1fr; }
  .a-header__actions { width: 100%; justify-content: space-between; }
  .a-card { padding: 16px 14px 14px; }
  .a-stat__value { font-size: 23px; }
}

@media (prefers-reduced-motion: reduce) {
  .a-meter > span { transition: none; }
}
