/* ---------------------------------------------------------------------------
   Cron Manager — canon dev/ops surface, craft bar: GitHub Actions + Sentry.
   Status first, config second. Both themes are first-class: the job runs at
   17:50 and gets checked the next morning, sometimes at a desk, sometimes on a
   phone in daylight.
--------------------------------------------------------------------------- */

:root {
  color-scheme: dark;

  --bg:            #0c0e13;
  --surface:       #12151c;
  --surface-2:     #171b24;
  --surface-3:     #1d222d;
  --line:          #232833;
  --line-strong:   #313848;

  --ink:           #e8ecf3;
  --ink-2:         #a3adbd;
  --ink-3:         #808b9c;

  --accent:        #5b95ff;   /* ตัวอักษร ลิงก์ เส้นโฟกัส บนพื้นเข้ม */
  --accent-solid:  #2f6fe0;   /* พื้นปุ่ม — ขาวบนสีนี้ผ่าน AA (4.6:1) */
  --accent-ink:    #ffffff;
  --accent-weak:   #1a2740;
  --accent-line:   #2f4a7a;

  --ok:            #3fbf72;
  --ok-weak:       #10281a;
  --ok-line:       #1d4a30;

  --bad:           #ff6152;
  --bad-weak:      #2c1310;
  --bad-line:      #5c2620;

  --warn:          #e0a52e;
  --warn-weak:     #2a2010;
  --warn-line:     #57431a;

  --idle:          #5c6675;
  --idle-weak:     #1a1e27;

  --shadow-1: 0 1px 2px rgb(0 0 0 / .45);
  --shadow-2: 0 8px 24px -6px rgb(0 0 0 / .6), 0 2px 6px -2px rgb(0 0 0 / .4);
  --shadow-3: 0 24px 64px -12px rgb(0 0 0 / .7), 0 6px 16px -6px rgb(0 0 0 / .5);

  --r-sm: 5px;
  --r-md: 8px;
  --r-lg: 12px;

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans Thai",
          "IBM Plex Sans Thai", "Leelawadee UI", "Thonburi", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, "Cascadia Mono",
          Consolas, monospace;

  --ease: cubic-bezier(.16, 1, .3, 1);
  --shell: 1180px;
}

:root[data-theme="light"] {
  color-scheme: light;

  --bg:            #f6f7f9;
  --surface:       #ffffff;
  --surface-2:     #f4f6f8;
  --surface-3:     #eaeef3;
  --line:          #e2e6ec;
  --line-strong:   #c9d1dc;

  --ink:           #111721;
  --ink-2:         #4d5768;
  --ink-3:         #6b7482;

  --accent:        #1f6feb;
  --accent-solid:  #1a63d8;
  --accent-ink:    #ffffff;
  --accent-weak:   #e8f0fe;
  --accent-line:   #b6cffb;

  --ok:            #197f43;
  --ok-weak:       #e6f6ec;
  --ok-line:       #a8ddbc;

  --bad:           #c8341f;
  --bad-weak:      #fdecea;
  --bad-line:      #f4b8ae;

  --warn:          #9a6700;
  --warn-weak:     #fdf3d9;
  --warn-line:     #ecd08a;

  --idle:          #8b95a3;
  --idle-weak:     #eef1f5;

  --shadow-1: 0 1px 2px rgb(16 24 40 / .06);
  --shadow-2: 0 8px 20px -6px rgb(16 24 40 / .12), 0 2px 5px -2px rgb(16 24 40 / .08);
  --shadow-3: 0 24px 56px -12px rgb(16 24 40 / .18), 0 6px 14px -6px rgb(16 24 40 / .1);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg:            #f6f7f9;
    --surface:       #ffffff;
    --surface-2:     #f4f6f8;
    --surface-3:     #eaeef3;
    --line:          #e2e6ec;
    --line-strong:   #c9d1dc;
    --ink:           #111721;
    --ink-2:         #4d5768;
    --ink-3:         #6b7482;
    --accent:        #1f6feb;
    --accent-solid:  #1a63d8;
    --accent-ink:    #ffffff;
    --accent-weak:   #e8f0fe;
    --accent-line:   #b6cffb;
    --ok:            #197f43;
    --ok-weak:       #e6f6ec;
    --ok-line:       #a8ddbc;
    --bad:           #c8341f;
    --bad-weak:      #fdecea;
    --bad-line:      #f4b8ae;
    --warn:          #9a6700;
    --warn-weak:     #fdf3d9;
    --warn-line:     #ecd08a;
    --idle:          #8b95a3;
    --idle-weak:     #eef1f5;
    --shadow-1: 0 1px 2px rgb(16 24 40 / .06);
    --shadow-2: 0 8px 20px -6px rgb(16 24 40 / .12), 0 2px 5px -2px rgb(16 24 40 / .08);
    --shadow-3: 0 24px 56px -12px rgb(16 24 40 / .18), 0 6px 14px -6px rgb(16 24 40 / .1);
  }
}

/* --- base ---------------------------------------------------------------- */

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

/* attribute `hidden` ต้องชนะกฎ display ของ author เสมอ ไม่งั้น panel ที่ซ่อนจะโผล่ทับ */
[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* browser surfaces belong to the design too */
::selection { background: var(--accent-solid); color: var(--accent-ink); }
:root { accent-color: var(--accent); caret-color: var(--accent); }
* { scrollbar-color: var(--line-strong) transparent; scrollbar-width: thin; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border: 3px solid var(--bg);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover { background: var(--ink-3); }

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

h1, h2, h3, p, figure { margin: 0; }
a { color: var(--accent); text-underline-offset: 3px; }

.mono, .num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

.icon { width: 16px; height: 16px; flex: none; display: block; }
.icon-lg { width: 20px; height: 20px; }

/* --- buttons ------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font: inherit;
  font-weight: 500;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  padding: 6px 11px;
  min-height: 32px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .13s var(--ease), border-color .13s var(--ease), color .13s var(--ease);
}
.btn:hover:not(:disabled) { background: var(--surface-3); border-color: var(--ink-3); }
.btn:active:not(:disabled) { transform: translateY(.5px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary {
  background: var(--accent-solid);
  border-color: transparent;
  color: var(--accent-ink);
}
.btn-primary:hover:not(:disabled) { background: color-mix(in srgb, var(--accent-solid) 86%, #000); border-color: transparent; }

.btn-danger { color: var(--bad); border-color: var(--bad-line); background: var(--bad-weak); }
.btn-danger:hover:not(:disabled) { background: color-mix(in srgb, var(--bad-weak) 70%, var(--bad) 12%); border-color: var(--bad); }

.btn-quiet { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-quiet:hover:not(:disabled) { background: var(--surface-2); border-color: var(--line); color: var(--ink); }

.btn-sm { min-height: 28px; padding: 4px 9px; font-size: 13px; }
.btn-icon { padding: 0; width: 32px; min-height: 32px; }
.btn-icon.btn-sm { width: 28px; min-height: 28px; }

.btn[aria-busy="true"] .icon { animation: spin 900ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --- login --------------------------------------------------------------- */

.gate {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.gate-card {
  width: min(384px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  padding: 28px;
}
.gate-mark { display: flex; align-items: center; gap: 9px; color: var(--accent); margin-bottom: 18px; }
.gate-mark span { color: var(--ink); font-weight: 600; font-size: 15px; letter-spacing: -.01em; }
.gate h1 { font-size: 19px; letter-spacing: -.02em; margin-bottom: 4px; }
.gate p { color: var(--ink-2); font-size: 13px; margin-bottom: 20px; }

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-in {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 20px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand { display: flex; align-items: center; gap: 9px; color: var(--accent); }
.brand b { color: var(--ink); font-weight: 600; font-size: 14.5px; letter-spacing: -.01em; }
.host {
  color: var(--ink-3);
  font-size: 12.5px;
  padding-left: 12px;
  margin-left: 2px;
  border-left: 1px solid var(--line);
}
.grow { flex: 1 1 auto; min-width: 0; }
.clock {
  color: var(--ink-2);
  font-size: 12.5px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.clock .tz {
  color: var(--ink-3);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 1px 8px;
  font-size: 11.5px;
}

.tabs {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  gap: 2px;
  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(--ink-2);
  font: inherit;
  padding: 11px 12px 9px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  transition: color .13s var(--ease), border-color .13s var(--ease);
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 500; }
.tab .count {
  font-size: 11.5px;
  color: var(--ink-3);
  background: var(--surface-2);
  border-radius: 99px;
  padding: 0 6px;
  line-height: 17px;
}

.shell { max-width: var(--shell); margin: 0 auto; padding: 22px 20px 80px; }

/* --- status band --------------------------------------------------------- */

.band {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  padding: 14px 16px;
  margin-bottom: 22px;
}
.band-icon { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 99px; flex: none; margin-top: 1px; }
.band-body { min-width: 0; flex: 1 1 auto; }
.band h2 { font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.band p { color: var(--ink-2); font-size: 13px; margin-top: 2px; }
.band-actions { display: flex; gap: 8px; flex: none; }

.band.is-ok    { border-color: var(--ok-line);   background: color-mix(in srgb, var(--ok-weak) 60%, var(--surface)); }
.band.is-ok    .band-icon { background: var(--ok-weak); color: var(--ok); }
.band.is-bad   { border-color: var(--bad-line);  background: color-mix(in srgb, var(--bad-weak) 60%, var(--surface)); }
.band.is-bad   .band-icon { background: var(--bad-weak); color: var(--bad); }
.band.is-warn  { border-color: var(--warn-line); background: color-mix(in srgb, var(--warn-weak) 60%, var(--surface)); }
.band.is-warn  .band-icon { background: var(--warn-weak); color: var(--warn); }
.band.is-idle  .band-icon { background: var(--idle-weak); color: var(--ink-3); }

/* --- section head -------------------------------------------------------- */

.sec-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.sec-head h2 { font-size: 13px; font-weight: 600; color: var(--ink-2); letter-spacing: .01em; }
.sec-head .meta { color: var(--ink-3); font-size: 12.5px; }

/* --- panel / list -------------------------------------------------------- */

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}
.panel + .panel { margin-top: 18px; }
.panel-head {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.panel-head h2 { font-size: 14px; font-weight: 600; letter-spacing: -.01em; }
.panel-head p { color: var(--ink-2); font-size: 12.5px; }
.panel-body { padding: 16px; }

/* --- job row ------------------------------------------------------------- */

.job {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  gap: 4px 12px;
  padding: 14px 16px;
  position: relative;
}
.job + .job { border-top: 1px solid var(--line); }
.job:hover { background: var(--surface-2); }
.job.is-off { background: var(--surface-2); }
.job.is-off .job-name { color: var(--ink-2); }

.job-state { grid-column: 1; grid-row: 1; margin-top: 2px; }
.job-main { grid-column: 2; grid-row: 1; min-width: 0; }
.job-tools { grid-column: 3; grid-row: 1 / span 3; display: flex; align-items: flex-start; gap: 6px; }

.job-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.job-name {
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -.01em;
  background: none;
  border: 0;
  padding: 0;
  color: var(--ink);
  font-family: inherit;
  cursor: pointer;
  text-align: left;
}
.job-name:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

.job-sched { color: var(--ink-2); font-size: 13px; margin-top: 1px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.job-sched .cron { color: var(--ink-3); font-size: 12px; }
.job-url {
  color: var(--ink-3);
  font-size: 12px;
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.job-foot {
  grid-column: 2; grid-row: 2;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-top: 9px;
}
.job-last { color: var(--ink-2); font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
.job-alerts { grid-column: 2 / -1; grid-row: 3; display: flex; gap: 8px; flex-wrap: wrap; margin-top: 9px; }

/* run history strip — each cell is one real run, not decoration */
.strip { display: flex; gap: 3px; align-items: flex-end; }
.strip-cell {
  width: 9px; height: 22px;
  border-radius: 2px;
  border: 0; padding: 0;
  background: var(--idle-weak);
  cursor: default;
  position: relative;
  transition: transform .15s var(--ease), background .15s var(--ease);
}
.strip-cell[data-run] { cursor: pointer; }
.strip-cell[data-run]:hover { transform: scaleY(1.18); }
/* ความสูงต่างกันทำให้แยกออกโดยไม่ต้องพึ่งสี */
.strip-cell.is-ok  { background: var(--ok);  height: 15px; }
.strip-cell.is-bad { background: var(--bad); height: 24px; }
.strip-cell.is-empty { background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.strip-cell.is-fresh { animation: pop .5s var(--ease); }
@keyframes pop { from { transform: scaleY(.2); opacity: .3; } to { transform: scaleY(1); opacity: 1; } }

/* --- status pieces ------------------------------------------------------- */

.dot-ok   { color: var(--ok); }
.dot-bad  { color: var(--bad); }
.dot-warn { color: var(--warn); }
.dot-idle { color: var(--ink-3); }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  line-height: 1.5;
  padding: 2px 8px;
  border-radius: 99px;
  border: 1px solid var(--line);
  color: var(--ink-2);
  background: var(--surface-2);
  white-space: nowrap;
}
.tag-ok   { color: var(--ok);   border-color: var(--ok-line);   background: var(--ok-weak); }
.tag-bad  { color: var(--bad);  border-color: var(--bad-line);  background: var(--bad-weak); }
.tag-warn { color: var(--warn); border-color: var(--warn-line); background: var(--warn-weak); }
.tag-method { font-family: var(--mono); font-size: 11px; letter-spacing: .02em; }

/* --- table --------------------------------------------------------------- */

.table-wrap { overflow-x: auto; }
table.runs { width: 100%; border-collapse: collapse; font-size: 13px; }
table.runs th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink-3);
  letter-spacing: .03em;
  text-transform: uppercase;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  white-space: nowrap;
  position: sticky;
  top: 0;
}
table.runs td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
table.runs tr:last-child td { border-bottom: 0; }
table.runs tbody tr { cursor: pointer; }
table.runs tbody tr:hover td { background: var(--surface-2); }
table.runs td.job-cell { white-space: normal; min-width: 180px; font-weight: 500; }

/* --- empty --------------------------------------------------------------- */

.empty {
  display: grid;
  place-items: center;
  gap: 10px;
  text-align: center;
  padding: 52px 20px;
  color: var(--ink-3);
}
.empty-mark {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink-3);
}
.empty h3 { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.empty p { font-size: 13px; max-width: 42ch; }

/* --- forms --------------------------------------------------------------- */

.field { display: block; margin-bottom: 16px; }
.field > .label { display: block; font-size: 12.5px; font-weight: 500; color: var(--ink-2); margin-bottom: 5px; }
.field .hint { font-size: 12px; color: var(--ink-3); margin-top: 6px; }
.field .hint.is-bad { color: var(--bad); }

input[type="text"], input[type="password"], input[type="number"], select, textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  padding: 7px 11px;
  min-height: 34px;
  transition: border-color .13s var(--ease), background .13s var(--ease);
}
input::placeholder, textarea::placeholder { color: var(--ink-3); }
input:hover, select:hover, textarea:hover { border-color: var(--ink-3); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--accent-weak);
}
textarea { min-height: 92px; resize: vertical; font-family: var(--mono); font-size: 12.5px; line-height: 1.6; }
input.mono, select.mono { font-family: var(--mono); font-size: 12.5px; }
select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 30px;
}

.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1 1 160px; min-width: 0; }

.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track {
  width: 36px; height: 20px; border-radius: 99px;
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  position: relative;
  transition: background .16s var(--ease), border-color .16s var(--ease);
  flex: none;
}
.switch .track::after {
  content: "";
  position: absolute; inset: 2px auto 2px 2px;
  width: 14px; border-radius: 99px;
  background: var(--ink-3);
  transition: transform .18s var(--ease), background .18s var(--ease);
}
.switch input:checked + .track { background: var(--accent-solid); border-color: transparent; }
.switch input:checked + .track::after { transform: translateX(16px); background: #fff; }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch .switch-label { font-size: 13px; color: var(--ink); }

.hdr-row { display: grid; grid-template-columns: minmax(120px, 30%) minmax(0, 1fr) 32px; gap: 8px; margin-bottom: 8px; }

/* --- drawer -------------------------------------------------------------- */

.scrim {
  position: fixed; inset: 0; z-index: 40;
  background: rgb(4 6 10 / .55);
  backdrop-filter: blur(2px);
  animation: fade .18s var(--ease);
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.drawer {
  position: fixed;
  z-index: 41;
  top: 0; right: 0; bottom: 0;
  width: min(620px, 100%);
  background: var(--surface);
  box-shadow: var(--shadow-3);
  display: flex;
  flex-direction: column;
  animation: slide-in .28s var(--ease);
}
@keyframes slide-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }

.drawer-head {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.drawer-head h2 { font-size: 16px; font-weight: 600; letter-spacing: -.015em; }
.drawer-head p { color: var(--ink-2); font-size: 12.5px; margin-top: 2px; }
.drawer-body { padding: 18px; overflow-y: auto; flex: 1 1 auto; overscroll-behavior: contain; }
.drawer-foot {
  padding: 13px 18px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  background: var(--surface-2);
}

/* --- run detail ---------------------------------------------------------- */

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  margin-bottom: 16px;
}
.fact { background: var(--surface); padding: 10px 12px; }
.fact dt { font-size: 11.5px; color: var(--ink-3); margin-bottom: 2px; }
.fact dd { margin: 0; font-size: 14px; font-weight: 600; letter-spacing: -.01em; display: flex; align-items: center; gap: 6px; }

.callout {
  display: flex;
  gap: 10px;
  padding: 11px 13px;
  border-radius: var(--r-md);
  border: 1px solid var(--bad-line);
  background: var(--bad-weak);
  color: var(--bad);
  font-size: 13px;
  margin-bottom: 16px;
}
.callout.is-warn { border-color: var(--warn-line); background: var(--warn-weak); color: var(--warn); }
.callout .icon { margin-top: 2px; }
.callout b { display: block; margin-bottom: 1px; }
.callout span { color: var(--ink-2); }

.code-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--ink-3);
  margin-bottom: 6px;
}
pre.code {
  margin: 0;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px 13px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 46vh;
  overflow: auto;
  color: var(--ink-2);
}
pre.code .k { color: var(--accent); }
pre.code .s { color: var(--ok); }
pre.code .n { color: var(--warn); }

.kv { font-family: var(--mono); font-size: 12px; color: var(--ink-2); word-break: break-all; }

/* --- toast --------------------------------------------------------------- */

#toast-slot {
  position: fixed;
  left: 50%; bottom: 22px;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
  width: min(440px, calc(100vw - 32px));
}
.toast {
  display: flex; align-items: flex-start; gap: 9px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-1);
  padding: 10px 13px;
  font-size: 13px;
  width: 100%;
  animation: toast-in .32s var(--ease);
}
.toast.is-ok  { border-color: var(--ok-line); }
.toast.is-bad { border-color: var(--bad-line); }
.toast.is-out { animation: toast-out .2s var(--ease) forwards; }
.toast .icon { margin-top: 2px; }
@keyframes toast-in { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toast-out { to { transform: translateY(6px); opacity: 0; } }

/* --- responsive ---------------------------------------------------------- */

@media (max-width: 720px) {
  .topbar-in { height: 52px; padding: 0 14px; gap: 8px; }
  .host, .clock .now { display: none; }
  .tabs { padding: 0 14px; }
  .shell { padding: 16px 14px 72px; }

  .band { flex-wrap: wrap; }
  .band-body { flex: 1 1 0; }
  .band-actions { width: 100%; }
  .band-actions .btn { flex: 1; }

  .job { grid-template-columns: 20px minmax(0, 1fr); padding: 13px 14px; }
  .job-tools { grid-column: 1 / -1; grid-row: 4; margin-top: 11px; justify-content: flex-start; }
  .job-foot { grid-column: 1 / -1; }
  .job-alerts { grid-column: 1 / -1; }

  .drawer { top: auto; width: 100%; max-height: 92dvh; border-radius: var(--r-lg) var(--r-lg) 0 0; animation: slide-up .3s var(--ease); }
  @keyframes slide-up { from { transform: translateY(28px); opacity: 0; } to { transform: none; opacity: 1; } }
  .facts { grid-template-columns: repeat(2, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
