/* JobOS Console. Tokens and type follow the jobos.tech landing site (site.css). */

@font-face {
  font-family: 'Mona Sans';
  src: url('fonts/mona-sans.woff2') format('woff2');
  font-weight: 200 900;
  font-stretch: 75% 125%;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('fonts/jetbrains-mono.woff2') format('woff2');
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --night: #12212a;
  --night-2: #182a35;
  --night-3: #203543;
  --abyss: #0c171d;
  --ink: #17252e;
  --paper: #f5f2ea;
  --paper-2: #ebe7dc;
  --lime: #c8f36f;
  --olive: #4f6d22;
  --muted: #53666e;
  --faint: #9eafb6;
  --soft: #c5d1cf;
  --line-dark: #2a3d48;
  --amber: #f1b54c;
  --coral: #ff9a85;
  --font: 'Mona Sans', 'Helvetica Neue', Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --ease: cubic-bezier(.16, .84, .3, 1);
  --gutter: clamp(16px, 5vw, 56px);
  --header: 64px;
  --sidebar: 252px;
  --radius: 18px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--night);
  color: var(--paper);
  font: 400 16px/1.55 var(--font);
  letter-spacing: -.003em;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { display: block; }
h1, h2, h3 { margin: 0; font-weight: 720; font-stretch: 105%; letter-spacing: -.03em; line-height: 1.12; }
h1 { font-size: clamp(28px, 4.4vw, 40px); }
h2 { font-size: 20px; letter-spacing: -.02em; }
h3 { font-size: 15.5px; font-weight: 680; letter-spacing: -.01em; }
p, dl { margin: 0; }
code, .mono { font-family: var(--mono); font-size: .92em; }
[hidden] { display: none !important; }
h1:focus { outline: none; }

:focus-visible { outline: 3px solid var(--lime); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 60; padding: 10px 16px; border-radius: 10px; background: var(--lime); color: var(--ink); font-weight: 650; text-decoration: none; }
.skip:focus { top: 12px; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 var(--gutter); }

/* Header */
/* The header is exactly --header tall, its border included, so that the sidebar and the
   Time Machine's frame, sized from --header, fit the window. */
.site-header { position: sticky; top: 0; z-index: 40; height: var(--header); background: rgba(14, 26, 33, .92); border-bottom: 1px solid rgba(245, 242, 234, .08); -webkit-backdrop-filter: saturate(150%) blur(14px); backdrop-filter: saturate(150%) blur(14px); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 100%; padding: 0 clamp(16px, 2.4vw, 28px); }
.wordmark { display: inline-flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 760; font-stretch: 110%; letter-spacing: -.045em; text-decoration: none; }
.wordmark b { color: var(--lime); font-weight: inherit; }
.wordmark .product { padding-left: 10px; border-left: 1px solid var(--line-dark); font: 600 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--soft); }
.account { display: flex; align-items: center; gap: 12px; min-width: 0; }
.account-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 28ch; color: var(--soft); font-size: 14px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 46px; padding: 11px 20px; border: 1px solid transparent; border-radius: 999px; background: none; color: inherit; font: inherit; font-size: 15px; font-weight: 620; line-height: 1.1; text-decoration: none; cursor: pointer; transition: background-color .25s, border-color .25s, color .25s, transform .2s var(--ease); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn[aria-disabled="true"] { cursor: not-allowed; opacity: .55; }
.btn-lime { background: var(--lime); color: var(--ink); }
.btn-lime:hover:not([disabled]) { background: #d9fb92; }
.btn-ghost { color: var(--paper); border-color: rgba(245, 242, 234, .26); }
.btn-ghost:hover:not([disabled]) { border-color: rgba(245, 242, 234, .5); background: rgba(245, 242, 234, .05); }
.btn-small { min-height: 36px; padding: 7px 14px; font-size: 14px; }
.btn-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

/* Text */
.eyebrow { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font: 600 12px/1.2 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--lime); }
.lead { margin-top: 10px; color: var(--soft); font-size: 16.5px; max-width: 62ch; }
.fine { font-size: 14px; color: var(--faint); max-width: 72ch; }
.fine code { color: var(--soft); overflow-wrap: anywhere; }
.muted { color: var(--faint); }
.meta { margin-top: 10px; font: 500 13px/1.4 var(--mono); color: var(--faint); }
.meta span { white-space: nowrap; }
.desc { margin-top: 10px; color: var(--soft); max-width: 70ch; white-space: pre-line; }
.loading { padding: 48px 0; color: var(--faint); }

/* Forms */
.form { display: grid; gap: 16px; margin-top: 22px; }
.field { display: grid; gap: 7px; }
.field label, .label { font-size: 14px; font-weight: 600; color: var(--soft); }
input, textarea { width: 100%; min-height: 46px; padding: 11px 14px; border: 1px solid var(--line-dark); border-radius: 12px; background: var(--abyss); color: var(--paper); font: inherit; font-size: 16px; transition: border-color .2s; }
textarea { min-height: 88px; resize: vertical; line-height: 1.45; }
input:hover, textarea:hover { border-color: #3b5564; }
input:focus-visible, textarea:focus-visible { outline: 3px solid var(--lime); outline-offset: 1px; border-color: transparent; }
input.mono { font-family: var(--mono); font-size: 15px; }
.hint { font-size: 13px; color: var(--faint); }
.form-error { padding: 10px 14px; border-radius: 12px; background: rgba(255, 154, 133, .1); border: 1px solid rgba(255, 154, 133, .35); color: var(--coral); font-size: 14px; }

/* Sign-in */
.auth { display: grid; place-items: start center; padding: clamp(28px, 8vw, 88px) var(--gutter) 64px; }
.auth:focus { outline: none; }
.auth-card { width: 100%; max-width: 460px; }
.auth-card h1 { font-size: clamp(30px, 6vw, 44px); }
.segmented { display: inline-flex; margin-top: 26px; padding: 4px; border: 1px solid var(--line-dark); border-radius: 999px; background: var(--abyss); }
.segmented button { min-height: 38px; padding: 8px 16px; border: 0; border-radius: 999px; background: none; color: var(--soft); font: inherit; font-size: 14px; font-weight: 620; cursor: pointer; transition: background-color .25s, color .25s; }
.segmented button[aria-selected="true"] { background: var(--night-3); color: var(--paper); }

/* The dashboard: navigation on the left, the page on the right */
.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: calc(100vh - var(--header)); }
.sidebar { position: sticky; top: var(--header); align-self: start; height: calc(100vh - var(--header)); overflow-y: auto; padding: 22px 14px 32px; border-right: 1px solid var(--line-dark); background: rgba(12, 23, 29, .45); }
.sidebar a { text-decoration: none; }
.sidebar ul { margin: 0; padding: 0; list-style: none; }
.side-head { display: block; margin: 0 0 8px; padding: 6px 12px; border-radius: 8px; font: 600 12px/1.2 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--faint); transition: color .2s; }
.side-head:hover, .side-head[aria-current="page"] { color: var(--lime); }
.side-jobs { display: grid; gap: 2px; }
.side-job { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 8px 12px; border-radius: 10px; color: var(--soft); font-size: 15px; font-weight: 650; letter-spacing: -.01em; transition: background-color .2s, color .2s; }
.side-job:hover { background: rgba(245, 242, 234, .05); color: var(--paper); }
.side-jobs > li.open > .side-job { color: var(--paper); }
.side-job-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-pages { display: grid; gap: 2px; margin: 2px 0 10px 16px; padding-left: 10px; border-left: 1px solid var(--line-dark); }
.side-pages a { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 36px; padding: 7px 10px; border-radius: 8px; color: var(--soft); font-size: 14.5px; font-weight: 600; transition: background-color .2s, color .2s; }
.side-pages a:hover { background: rgba(245, 242, 234, .05); color: var(--paper); }
.side-pages a[aria-current="page"] { background: var(--night-3); color: var(--paper); box-shadow: inset 2px 0 0 var(--lime); }
.side-new { display: flex; align-items: center; gap: 10px; margin-top: 14px; min-height: 40px; padding: 8px 12px; border: 1px dashed var(--line-dark); border-radius: 10px; color: var(--soft); font-size: 14.5px; font-weight: 620; transition: border-color .2s, color .2s; }
.side-new::before { content: '+'; display: grid; place-items: center; width: 18px; font: 600 17px/1 var(--mono); color: var(--lime); }
.side-new:hover, .side-new[aria-current="page"] { border-color: rgba(200, 243, 111, .5); color: var(--paper); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.ok { background: var(--lime); }
.dot.wait { background: var(--amber); animation: pulse 1.6s ease-in-out infinite; }
.dot.bad { background: var(--coral); }

.content { min-width: 0; padding: 30px clamp(16px, 3.4vw, 48px) 72px; }
.content:focus { outline: none; }
.page { max-width: 1120px; animation: enter .35s var(--ease) both; }
.page-wide { max-width: none; }
.page-head { margin-bottom: 26px; }
.page-head.split { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; }

/* Cards */
.card { padding: clamp(18px, 2.6vw, 26px); border: 1px solid var(--line-dark); border-radius: var(--radius); background: var(--night-2); }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; margin-bottom: 14px; }
.card-lead { color: var(--soft); max-width: 68ch; }
.card > * + * { margin-top: 14px; }
.card > .card-head + * { margin-top: 0; }
.page-grid { display: grid; gap: 16px; align-items: start; }
@media (min-width: 1180px) { .page-grid { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); } }
.status-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); align-items: stretch; }
.status-card { display: flex; flex-direction: column; }
.status-card > .btn-row { margin-top: auto; padding-top: 18px; }
/* The same label column in every card, so the values line up across cards; a long label
   wraps rather than pushing its value onto two lines. */
.status-card .kv { grid-template-columns: 42% minmax(0, 1fr); }

/* The next step on a job's overview */
.next { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin-bottom: 18px; padding: 16px 20px; border: 1px solid rgba(200, 243, 111, .32); border-radius: var(--radius); background: rgba(200, 243, 111, .06); }
.next .eyebrow { margin-bottom: 6px; }
.next-text { color: var(--paper); font-weight: 560; }
.next.bad { border-color: rgba(255, 154, 133, .4); background: rgba(255, 154, 133, .07); }
.next.bad .eyebrow { color: var(--coral); }

/* All jobs */
.job-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.job-card { display: grid; align-content: start; gap: 12px; padding: 20px 22px; border: 1px solid var(--line-dark); border-radius: var(--radius); background: var(--night-2); text-decoration: none; transition: border-color .25s, background-color .25s; }
.job-card:hover { border-color: #3b5564; background: #1b2f3b; }
.job-card-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.job-card .name { font-size: 18px; font-weight: 700; letter-spacing: -.02em; }
.job-card .slug { font: 500 13px/1.3 var(--mono); color: var(--faint); }
.job-card .desc { margin: 0; font-size: 14.5px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.job-form { max-width: 720px; margin-top: 0; }
.empty { padding: 26px; border: 1px dashed var(--line-dark); border-radius: var(--radius); color: var(--faint); }

/* Status chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 7px; min-height: 28px; padding: 3px 11px 3px 9px; border: 1px solid var(--line-dark); border-radius: 99px; background: rgba(12, 23, 29, .6); font-size: 13px; font-weight: 600; color: var(--soft); white-space: nowrap; }
.chip::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.chip b { font-weight: 600; color: var(--faint); }
.chip.ok::before { background: var(--lime); }
.chip.ok { color: var(--paper); }
.chip.wait::before { background: var(--amber); animation: pulse 1.6s ease-in-out infinite; }
.chip.bad::before { background: var(--coral); }
.chip.bad { color: var(--coral); }

/* Details inside cards */
.stack { display: grid; gap: 14px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 10px 18px; align-items: center; }
.kv dt { font-size: 14px; color: var(--faint); }
.kv dd { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.secret { font-family: var(--mono); font-size: 15px; letter-spacing: .02em; overflow-wrap: anywhere; }
.options { display: grid; gap: 0; }
.option { display: grid; gap: 10px; padding: 16px 0; border-top: 1px solid var(--line-dark); }
.option:first-child { padding-top: 0; border-top: 0; }
.option:last-child { padding-bottom: 0; }
.option.unavailable h3 { color: var(--faint); }
.inline-form { display: flex; flex-wrap: wrap; gap: 10px; }
.inline-form input { flex: 1 1 240px; }
.device-code { display: inline-block; padding: 10px 16px; border-radius: 12px; background: var(--abyss); border: 1px solid var(--line-dark); font: 650 clamp(20px, 5vw, 26px)/1.1 var(--mono); letter-spacing: .12em; color: var(--lime); }
.command { margin: 0; padding: 14px 16px; border-radius: 12px; background: var(--abyss); border: 1px solid var(--line-dark); font: 500 13.5px/1.55 var(--mono); color: var(--paper); overflow-wrap: anywhere; white-space: pre-wrap; }
.state-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; color: var(--soft); font-size: 14.5px; }
.page > .state-line, .page > .error-line { margin-bottom: 18px; }
.error-line { color: var(--coral); font-size: 14px; }

/* The Time Machine, in a frame below the page's heading. On wide screens the page fills the
   window and only the frame scrolls. */
.page-wide .page-head { align-items: center; margin-bottom: 14px; }
.page-wide .page-head h1 { font-size: clamp(24px, 3vw, 30px); }
.page-wide .page-head .eyebrow { margin-bottom: 0; }
.page-wide .page-head .eyebrow + h1:not(.sr-only) { margin-top: 6px; }
.tm-holder { border: 1px solid var(--line-dark); border-radius: 14px; overflow: hidden; background: var(--night); }
.tm-frame { display: block; width: 100%; height: max(460px, calc(100vh - var(--header) - 230px)); border: 0; }
@media (min-width: 861px) {
  .content.fit { display: flex; flex-direction: column; height: calc(100vh - var(--header)); padding-top: 22px; padding-bottom: 20px; }
  .content.fit > .page:not([hidden]) { flex: 1; display: flex; flex-direction: column; min-height: 0; }
  .content.fit .tm-holder { flex: 1; min-height: 0; }
  .content.fit .tm-frame { height: 100%; }
}

@keyframes enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* Narrow screens: the navigation becomes a bar under the header: "Jobs / <job>" on one line
   and the open job's pages on the next. Other jobs are on the Jobs page. */
@media (max-width: 860px) {
  .shell { display: block; }
  .sidebar { position: sticky; top: var(--header); z-index: 30; display: flex; flex-wrap: wrap; align-items: center; gap: 0 2px; height: auto; padding: 4px 12px 6px; overflow: visible; border-right: 0; border-bottom: 1px solid var(--line-dark); background: rgba(18, 33, 42, .97); }
  .side-head { flex: none; margin: 0; padding: 8px 6px 8px 8px; }
  .sidebar:has(li.open) .side-head::after { content: '/'; margin-left: 10px; color: var(--muted); }
  .side-jobs, .side-jobs > li.open { display: contents; }
  .side-jobs > li:not(.open) { display: none; }
  .side-job { flex: 0 1 auto; min-width: 0; min-height: 36px; padding: 6px 8px; }
  .side-pages { flex: 1 0 100%; display: flex; gap: 2px; margin: 0; padding: 0; border-left: 0; overflow-x: auto; scrollbar-width: none; }
  .side-pages::-webkit-scrollbar { display: none; }
  .side-pages li { flex: none; }
  .side-pages a { white-space: nowrap; min-height: 36px; padding: 6px 10px; }
  .side-pages a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--lime); }
  .side-pages a .dot { display: none; }
  .side-new { display: none; }
  .content { padding-top: 24px; }
}
@media (max-width: 560px) {
  .wordmark .product { display: none; }
  .account-email { max-width: 16ch; font-size: 13px; }
  .kv, .status-card .kv { grid-template-columns: 1fr; gap: 4px; }
  .kv dd { margin-bottom: 8px; }
}
@media (max-width: 380px) {
  .account-email { display: none; }
  .btn { padding-left: 16px; padding-right: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
