/* Energy Dispatch Jobs
   Palette from the ED logo: forest green monkey, the yellow bulb as the one accent.
   The bulb colour is reserved for one meaning: a deadline that is close. */

:root {
  --forest: #064e3b;
  --deep: #032b21;
  --bulb: #f5c33b;
  --bulb-soft: #fdf1c7;
  --sage: #eef6f1;
  --paper: #ffffff;
  --ink: #10241d;
  --muted: #56695f;
  --line: #d5e3dc;
  --link: #064e3b;
  --focus: #0d9488;
  --radius-s: 6px;
  --radius-m: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #062a21; --sage: #04211a; --ink: #e6f1eb; --muted: #9db4aa; --line: #174a3a;
    --link: #8fdcb8; --bulb-soft: #4a3d10; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #062a21; --sage: #04211a; --ink: #e6f1eb; --muted: #9db4aa; --line: #174a3a;
  --link: #8fdcb8; --bulb-soft: #4a3d10; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--sage); color: var(--ink);
  font: 400 16px/1.55 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-feature-settings: "tnum" 1, "cv11" 1;
}
a { color: var(--link); text-underline-offset: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* --- masthead ------------------------------------------------------------ */
.masthead { background: var(--deep); color: #e6f1eb; }
.masthead .wrap { display: flex; align-items: center; gap: 12px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.brand img { width: 40px; height: 40px; border-radius: 50%; }
.brand b { font-weight: 800; letter-spacing: -0.01em; font-size: 1.05rem; }
.brand span { color: #9db4aa; font-weight: 500; }
.masthead nav { margin-left: auto; display: flex; gap: 4px; }
.masthead nav a, .masthead nav button {
  color: #e6f1eb; text-decoration: none; font-family: inherit; font-size: 0.92rem; font-weight: 500; line-height: 1; padding: 10px 12px; border-radius: var(--radius-s);
  background: none; border: 0; cursor: pointer;
}
.masthead nav a:hover, .masthead nav button:hover { background: rgba(255,255,255,0.08); }
.masthead nav .count { color: var(--bulb); font-weight: 700; }

/* --- the sentence: the one bold element ---------------------------------- */
.ask { background: var(--deep); color: #e6f1eb; padding: 28px 0 40px; }
.ask h1 {
  margin: 0; font-weight: 750; letter-spacing: -0.025em; line-height: 1.25;
  font-size: clamp(1.6rem, 1.1rem + 2.4vw, 2.75rem); max-width: 30ch;
}
.ask select {
  font: inherit; color: var(--bulb); background-color: transparent; border: 0; cursor: pointer;
  border-bottom: 3px solid rgba(245,195,59,0.45); padding: 0 1.1em 0 0; margin: 0 0.05em;
  appearance: none; -webkit-appearance: none; border-radius: 0; max-width: 100%;
  background-image: linear-gradient(45deg, transparent 50%, #f5c33b 50%), linear-gradient(135deg, #f5c33b 50%, transparent 50%);
  background-position: calc(100% - 0.55em) 58%, calc(100% - 0.3em) 58%; background-size: 0.25em 0.25em; background-repeat: no-repeat;
}
.ask select:hover { border-bottom-color: var(--bulb); }
.ask select option { color: #10241d; background: #fff; font-size: 1rem; }
.ask .search { margin-top: 22px; display: flex; gap: 8px; max-width: 640px; }
.ask input[type=search] {
  flex: 1; font-family: inherit; font-size: 1rem; padding: 12px 14px; border-radius: var(--radius-s);
  border: 1px solid #1d5a47; background: #052219; color: #e6f1eb;
}
.ask input::placeholder { color: #86a399; }
.ask .summary { margin: 14px 0 0; color: #9db4aa; font-size: 0.95rem; }
.ask .summary b { color: #e6f1eb; }

/* --- toolbar ------------------------------------------------------------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 18px 0 10px; }
.toolbar .result { font-weight: 650; margin-right: auto; }
.toolbar label { color: var(--muted); font-size: 0.9rem; display: flex; gap: 6px; align-items: center; }
.toolbar select, .more select {
  font-family: inherit; font-size: 0.9rem; font-weight: 500; color: var(--ink); background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius-s); padding: 7px 8px;
}
.btn {
  font-family: inherit; font-size: 0.92rem; font-weight: 600; line-height: 1.1; border-radius: var(--radius-s); padding: 10px 14px; cursor: pointer;
  border: 1px solid var(--line); background: var(--paper); color: var(--ink); text-decoration: none; display: inline-flex; gap: 6px; align-items: center;
}
.btn:hover { border-color: var(--forest); }
.btn.primary { background: var(--forest); border-color: var(--forest); color: #fff; }
.btn.primary:hover { background: #0a6a50; }
.btn.apply { background: var(--bulb); border-color: var(--bulb); color: #2a2104; font-size: 1rem; padding: 13px 18px; }
.btn.apply:hover { background: #ffd35a; }

.more { display: none; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px 14px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 14px; margin-bottom: 10px; }
.more.open { display: grid; }
.more label { display: grid; gap: 4px; font-size: 0.85rem; color: var(--muted); }
.more .check { display: flex; gap: 8px; align-items: center; color: var(--ink); font-size: 0.92rem; }
.more .reset { align-self: end; }

/* --- the list: a dispatch log, rows not cards ---------------------------- */
.list { list-style: none; margin: 0 0 40px; padding: 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden; }
.row { display: grid; grid-template-columns: 76px 1fr auto; gap: 14px; padding: 14px 16px; border-top: 1px solid var(--line); align-items: start; }
.row:first-child { border-top: 0; }
.row:hover { background: color-mix(in srgb, var(--sage) 60%, var(--paper)); }
.when { text-align: center; border-radius: var(--radius-s); padding: 6px 4px; line-height: 1.1; }
.when b { display: block; font-size: 1.45rem; font-weight: 750; letter-spacing: -0.02em; }
.when small { font-size: 0.72rem; color: var(--muted); }
.when.soon { background: var(--bulb-soft); }
.when.soon b { color: #8a6400; }
:root[data-theme="dark"] .when.soon b { color: var(--bulb); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .when.soon b { color: var(--bulb); } }
.when.rolling b { font-size: 0.95rem; font-weight: 650; padding: 6px 0 2px; color: var(--muted); }
.row h2 { margin: 0; font-size: 1.04rem; font-weight: 650; line-height: 1.35; }
.row h2 a { color: var(--ink); text-decoration: none; }
.row h2 a:hover { text-decoration: underline; }
.row .who { margin: 2px 0 6px; color: var(--muted); font-size: 0.93rem; }
.row .who strong { color: var(--ink); font-weight: 550; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 0.78rem; font-weight: 550; padding: 2px 8px; border-radius: 999px; background: var(--sage); color: var(--muted); border: 1px solid var(--line); }
.tag.sector { background: transparent; color: var(--link); border-color: currentColor; }
.tag.net { background: var(--forest); color: #fff; border-color: var(--forest); }
.tag.pay { color: var(--ink); }
.tag.ok { color: #116149; }
.tag.warn { color: #8a4b00; }
:root[data-theme="dark"] .tag.ok, :root[data-theme="dark"] .tag.warn { color: var(--ink); }
.save { background: none; border: 0; cursor: pointer; padding: 6px; border-radius: var(--radius-s); color: var(--muted); font-size: 1.25rem; line-height: 1; }
.save[aria-pressed="true"] { color: #c79600; }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.morebtn { display: flex; justify-content: center; margin: -24px 0 40px; }

/* --- detail drawer and job page ------------------------------------------ */
.drawer { position: fixed; inset: 0; display: none; z-index: 20; }
.drawer.open { display: block; }
.drawer .scrim { position: absolute; inset: 0; background: rgba(3,20,15,0.45); }
.drawer .panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(720px, 100%); background: var(--paper); overflow-y: auto; box-shadow: -8px 0 30px rgba(0,0,0,0.18); }
@media (prefers-reduced-motion: no-preference) { .drawer.open .panel { animation: slidein 180ms ease-out; } @keyframes slidein { from { transform: translateX(24px); opacity: .6; } } }
.drawer .close { position: sticky; top: 0; display: flex; justify-content: flex-end; padding: 10px; background: var(--paper); }
.job { padding: 4px 24px 40px; }
.job h1 { font-size: clamp(1.4rem, 1.2rem + 1vw, 1.9rem); line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 6px; }
.job .who { color: var(--muted); margin: 0 0 16px; }
.job .who strong { color: var(--ink); }
.glance { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px 18px; padding: 16px; border-radius: var(--radius-m); background: var(--sage); margin: 16px 0 22px; }
.glance div { font-size: 0.92rem; }
.glance dt { color: var(--muted); font-size: 0.8rem; }
.glance dd { margin: 2px 0 0; font-weight: 550; }
.glance dl { margin: 0; }
.job h2 { font-size: 1.05rem; margin: 26px 0 8px; }
.job p, .job li { max-width: 68ch; }
.job ul { padding-left: 1.2em; margin: 0; }
.job li { margin: 4px 0; }
.job .note { color: var(--muted); font-size: 0.88rem; margin-top: 28px; border-top: 1px solid var(--line); padding-top: 14px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.page { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-m); margin: 24px auto 48px; max-width: 820px; padding-top: 16px; }
.back { display: inline-block; margin: 20px 0 0; }

footer.site { color: var(--muted); font-size: 0.88rem; padding: 0 0 40px; }
footer.site p { max-width: 70ch; }

@media (max-width: 640px) {
  .row { grid-template-columns: 58px 1fr auto; gap: 10px; padding: 12px; }
  .when b { font-size: 1.15rem; }
  .masthead nav a.hide-s { display: none; }
  .job { padding: 4px 16px 32px; }
  .ask .search { flex-direction: column; }
}
