/* Lookout. Calm by default: warm paper, near-black ink, one highlighter yellow for what needs you. */

:root {
  --bg: #FBF8F1;
  --text: #23211E;
  --sub: #4A453E;
  --muted: #6A645A;
  --ink: #23211E;
  --on-ink: #FFFFFF;
  --card: #FFFFFF;
  --code: #F4F0E6;
  --cabin: #FFFFFF;
  --rule: #E6E0D3;
  --bar-up: #D6CFC0;
  --bar-flaky: #F5B800;
  --link: #1F5FAD;
  --link-hover: #123E75;
  --mark: #FFE066;
  --lamp: #FFD43B;
  --bad-line: #FFF4C2;
  --flaky-tile: #FFE066;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #161513;
  --text: #F3EFE6;
  --sub: #CFC8BB;
  --muted: #A39C90;
  --ink: #E9E3D6;
  --on-ink: #161513;
  --card: #211F1C;
  --code: #2C2925;
  --cabin: #211F1C;
  --rule: #34302B;
  --bar-up: #57524A;
  --link: #8DB8F0;
  --link-hover: #B9D3F5;
  --bad-line: #3A3218;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: Figtree, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.5;
}
a { color: var(--link); }
a:hover { color: var(--link-hover); }
code, pre, .mono { font-family: var(--mono); }
code { font-size: 0.9em; overflow-wrap: anywhere; }
mark { background: var(--mark); color: #23211E; padding: 0 3px; }
:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }
[hidden] { display: none !important; }
.grow { flex: 1 1 24px; }
.muted { color: var(--muted); }
.strong { font-weight: 800; }

/* ---- layout ---- */
.wrap { width: 100%; max-width: 880px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.wrap-wide { max-width: 1040px; }
.page { padding-top: 56px; padding-bottom: 40px; flex: 1 0 auto; }
.narrow { width: 100%; max-width: 560px; margin: 0 auto; padding: 96px 24px 40px; flex: 1 0 auto; }

/* ---- header ---- */
.top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding-top: 28px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 900; font-size: 22px; letter-spacing: -0.02em; }
.brand:hover { color: var(--text); }
.nav { display: flex; gap: 20px; font-weight: 700; font-size: 16px; }
.nav a { color: var(--muted); text-decoration: none; padding: 10px 0 4px; border-bottom: 3px solid transparent; }
.nav a[aria-current="page"] { color: var(--text); border-bottom-color: var(--lamp); }
.signout { margin: 0; }

.tower .ink-fill { fill: var(--ink); }
.tower .ink-stroke { stroke: var(--ink); }
.tower .cabin { fill: var(--cabin); }
.tower .lamp, .treeline .lamp { fill: var(--lamp); }
.treeline .ink-fill { fill: var(--ink); }
.treeline .ink-stroke { stroke: var(--ink); }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 46px; padding: 0 20px; border-radius: 999px;
  background: var(--ink); color: var(--on-ink); border: 2px solid var(--ink);
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
}
.btn:hover { color: var(--on-ink); filter: brightness(1.15); }
.btn-outline { background: transparent; color: var(--text); }
.btn-outline:hover { color: var(--text); background: var(--code); filter: none; }
.btn-big { width: 100%; min-height: 56px; font-size: 18px; font-weight: 800; box-shadow: 4px 4px 0 var(--lamp); }
.btn[disabled] { opacity: .6; cursor: progress; }
.pill-btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px;
  border: 2px solid var(--ink); border-radius: 999px; background: transparent; color: var(--text);
  font: inherit; font-size: 15px; font-weight: 700; cursor: pointer;
}
.link-btn { border: 0; background: none; padding: 8px 0; color: var(--muted); font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: var(--text); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---- handing off to Ranger: its forest green and hat, so it's clear you're leaving to act ---- */
.btn-ranger { background: #2D5A3D; border-color: #2D5A3D; color: #FFFFFF; font-weight: 800; padding-left: 12px; box-shadow: 0 4px 0 #1E3F2A; }
.btn-ranger:hover { color: #FFFFFF; filter: brightness(1.1); }
.row-actions { display: inline-flex; align-items: center; gap: 14px; }
.ranger-pill { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px 0 8px; border-radius: 999px; background: #2D5A3D; color: #FFFFFF; font-weight: 800; font-size: 15px; text-decoration: none; }
.ranger-pill:hover { color: #FFFFFF; filter: brightness(1.1); }
.ranger-note { display: flex; gap: 16px; align-items: flex-start; padding: 20px 22px; border-radius: 16px; background: #F4EFE3; border: 2px solid #2D5A3D; color: #1F2A22; }
.ranger-note svg { flex: none; }
.ranger-note .rh-fill { fill: #2D5A3D; } .ranger-note .rh-pinch { stroke: #F4EFE3; } .ranger-note .rh-band { stroke: #6B4426; }
.ranger-note p { margin: 0; font-size: 16px; color: #4B4F44; }
.ranger-note .ranger-note-title { margin-bottom: 4px; font-family: "Bricolage Grotesque", Figtree, sans-serif; font-weight: 800; font-size: 21px; letter-spacing: -0.01em; color: #1F2A22; }
:root[data-theme="dark"] .ranger-note { background: #1B231D; border-color: #5C9B71; color: #EFEADF; }
:root[data-theme="dark"] .ranger-note p { color: #C9C4B5; }
:root[data-theme="dark"] .ranger-note .ranger-note-title { color: #EFEADF; }
:root[data-theme="dark"] .ranger-note .rh-fill { fill: #7DB08C; } :root[data-theme="dark"] .ranger-note .rh-pinch { stroke: #1B231D; }

.when-light, .when-dark { display: inline-flex; align-items: center; gap: 8px; }
:root[data-theme="dark"] .when-light, :root:not([data-theme="dark"]) .when-dark { display: none; }

/* ---- type ---- */
.eyebrow-line { margin: 0 0 8px; color: var(--muted); font-size: 16px; }
.eyebrow-line strong { color: var(--text); }
.kicker { margin: 28px 0 6px; font-weight: 800; font-size: 15px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.headline { margin: 0 0 16px; font-size: clamp(36px, 7vw, 52px); line-height: 1.05; letter-spacing: -0.035em; font-weight: 900; overflow-wrap: anywhere; }
.lede { margin: 0 0 40px; font-size: 20px; color: var(--sub); max-width: 680px; }
.story { margin: 0 0 28px; font-size: 21px; max-width: 720px; }
.big { margin: 0 0 14px; font-size: 18px; }
.sub { margin: 0 0 14px; font-size: 16px; color: var(--sub); }
.fine { margin-top: 40px; font-size: 15px; color: var(--muted); }
.label { margin: 0; font-size: 14px; text-transform: uppercase; letter-spacing: .1em; font-weight: 800; color: var(--muted); }
.h2 { margin: 0 0 14px; font-size: 28px; font-weight: 900; letter-spacing: -0.02em; }
.back { display: inline-block; font-weight: 700; font-size: 16px; text-decoration: none; margin-bottom: 20px; }
.title-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
.title-row .headline { margin-bottom: 8px; }
.meta { margin: 0 0 28px; color: var(--muted); font-size: 16px; }
.meta strong, .meta code { color: var(--text); }
.notice { margin: -16px 0 32px; padding: 12px 16px; border-radius: 10px; background: var(--code); color: var(--sub); font-size: 16px; }
.code { margin: 0 0 22px; padding: 14px 16px; background: var(--code); border-radius: 10px; font-size: 14px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); }

.section { margin-bottom: 56px; }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 20px; margin-bottom: 16px; }

/* ---- badges ---- */
.badge { font-weight: 800; font-size: 15px; padding: 1px 10px; border-radius: 6px; border: 2px solid var(--ink); white-space: nowrap; }
.badge-down { background: var(--ink); color: var(--on-ink); }
.badge-flaky { background: var(--flaky-tile); border-color: var(--flaky-tile); color: #23211E; }
.badge-up, .badge-asleep, .badge-starting { border-color: var(--rule); color: var(--sub); }

/* ---- at a glance ---- */
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; font-size: 14px; color: var(--sub); }
.legend li { display: flex; align-items: center; gap: 6px; }
.legend .bar { width: 6px; flex: none; }
.glance { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.tile {
  display: flex; flex-direction: column; gap: 10px; height: 100%;
  padding: 14px 16px 12px; border-radius: 12px; border: 2px solid var(--rule);
  background: var(--card); color: var(--text); text-decoration: none;
}
.tile:hover { color: inherit; border-color: var(--ink); }
.tile-down { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.tile-down:hover { color: var(--on-ink); }
.tile-flaky { background: var(--flaky-tile); border-color: var(--flaky-tile); color: #23211E; }
.tile-flaky:hover { color: #23211E; border-color: #23211E; }
.tile-limping { border-color: var(--ink); }
.tile-asleep { opacity: .75; }
.tile-top { display: flex; align-items: center; gap: 8px; }
.tile-word { font-weight: 800; font-size: 15px; }
.tile-ns { margin-left: auto; font-size: 13px; opacity: .85; }
.tile-name { font-weight: 800; font-size: 19px; letter-spacing: -0.01em; line-height: 1.2; overflow-wrap: anywhere; }
.tile-note { font-size: 14px; line-height: 1.35; opacity: .9; }
.strip { margin-top: auto; display: flex; align-items: flex-end; gap: 2px; height: 20px; padding: 5px 6px; border-radius: 6px; background: var(--bg); box-sizing: content-box; }
.strip .bar { flex: 1 1 0; }
.bar { display: inline-block; border-radius: 1px; }
.bar-up { height: 6px; background: var(--bar-up); }
.bar-flaky { height: 12px; background: var(--bar-flaky); }
.bar-down { height: 18px; background: var(--ink); }
.bar-none { height: 3px; background: var(--bar-up); opacity: .45; }
.legend .bar-none { height: 3px; }
.tile-down .strip .bar-down { background: var(--text); }

/* ---- smoke spotted ---- */
.card { background: var(--card); border: 2px solid var(--ink); border-radius: 14px; padding: 26px 28px; margin-bottom: 16px; box-shadow: 4px 4px 0 var(--ink); }
.card-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 8px; }
.card-head h3 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.card-head h3 a { color: var(--text); }
.card-head .badge { margin-left: auto; }
.card .muted { font-size: 15px; }

/* ---- app page ---- */
.timeline { list-style: none; margin: 0; padding: 0 0 0 22px; border-left: 3px solid var(--ink); }
.timeline li { position: relative; padding: 0 0 22px 18px; }
.timeline .dot { position: absolute; left: -33px; top: 6px; width: 15px; height: 15px; border-radius: 50%; background: var(--card); border: 3px solid var(--ink); }
.timeline .warn .dot { background: var(--lamp); }
.timeline .when { font-size: 15px; color: var(--muted); font-weight: 700; }
.timeline .what { font-size: 18px; }
.timeline .raw { font-size: 14px; color: var(--muted); font-family: var(--mono); overflow-wrap: anywhere; }

.rows { list-style: none; margin: 0; padding: 0; }
.rows li { border-top: 1px solid var(--rule); padding: 14px 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; }
.row-name { flex: 1 1 280px; font-size: 15px; font-weight: 500; overflow-wrap: anywhere; }
.row-line { flex: 1 1 240px; color: var(--sub); }
.picker li { padding: 0; }
.picker a { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; width: 100%; padding: 14px 0; color: var(--text); text-decoration: none; }
.picker a:hover .row-name { text-decoration: underline; }
.picker .row-name { flex: 0 1 220px; font-size: 17px; }

.facts { margin: 0; display: grid; grid-template-columns: minmax(110px, 180px) 1fr; font-size: 16px; }
.facts dt, .facts dd { margin: 0; padding: 10px 0; border-top: 1px solid var(--rule); }
.facts dt { color: var(--muted); }

/* ---- logs ---- */
.controls { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; margin-bottom: 18px; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 14px; font-weight: 700; color: var(--sub); flex: 1 1 180px; min-width: 0; }
.field select, .field input {
  min-height: 46px; padding: 0 14px; border: 2px solid var(--ink); border-radius: 10px;
  background: var(--card); color: var(--text); font: inherit; font-size: 16px; font-weight: 400; width: 100%;
}
.field select { font-family: var(--mono); font-size: 15px; }
.seg { display: inline-flex; border: 2px solid var(--ink); border-radius: 999px; overflow: hidden; }
.seg button { min-height: 44px; padding: 0 18px; border: 0; background: var(--card); color: var(--text); font: inherit; font-size: 16px; font-weight: 700; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); }
.follow { min-height: 48px; font-size: 16px; padding: 0 18px; gap: 10px; }
.switch { width: 34px; height: 20px; border-radius: 999px; border: 2px solid var(--ink); display: inline-flex; padding: 1px; justify-content: flex-start; background: var(--card); }
.switch span { width: 14px; height: 14px; border-radius: 50%; background: var(--ink); }
.follow[aria-pressed="true"] .switch { background: var(--lamp); justify-content: flex-end; }

.logbox { background: var(--card); border: 2px solid var(--ink); border-radius: 14px; box-shadow: 4px 4px 0 var(--ink); overflow: hidden; }
.logbox-head, .logbox-status { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 18px; font-size: 15px; color: var(--sub); }
.logbox-head { border-bottom: 2px solid var(--ink); }
.logbox-head .link-btn { color: var(--link); padding: 4px 0; }
.logbox-status { border-bottom: 1px solid var(--rule); justify-content: flex-start; flex-wrap: nowrap; }
/* The height is set by logs.js so the whole box fits on screen; this is the fallback. */
.logbox-scroll { position: relative; height: 60vh; min-height: 320px; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; }
.loglines { list-style: none; margin: 0; padding: 8px 0; font-family: var(--mono); font-size: 14px; line-height: 1.6; }
.loglines li { display: grid; grid-template-columns: 96px 52px minmax(0, 1fr); column-gap: 16px; padding: 2px 18px; }
.loglines .t { color: var(--muted); }
.loglines .m { min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.loglines .bad { background: var(--bad-line); font-weight: 600; }
.loglines .hit .m { text-decoration: underline wavy var(--bar-flaky); text-underline-offset: 4px; }
.loglines.only-trouble li:not(.bad), .loglines li.filtered { display: none; }
.lamp-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--lamp); border: 2px solid var(--ink); flex: none; }
.lamp-dot.off { background: transparent; }
.logs-page { padding-top: 32px; }
.logs-page .back { margin-bottom: 12px; }
.logs-page .headline { font-size: clamp(32px, 5vw, 42px); margin-bottom: 8px; }
.logs-page .lede { margin-bottom: 20px; font-size: 18px; }
.after-log { margin-top: 20px; font-size: 15px; color: var(--muted); }

/* ---- sign in ---- */
.narrow .lede { margin-bottom: 32px; font-size: 19px; }
.narrow .notice { margin: 0 0 20px; }
.alert { padding: 16px 20px; border-radius: 12px; background: var(--bad-line); border: 2px solid var(--ink); margin-bottom: 16px; }
.alert p { margin: 0; }
.alert p + p { margin-top: 4px; color: var(--sub); font-size: 16px; }
.waiting { min-height: 56px; border: 2px dashed var(--ink); border-radius: 999px; display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 700; font-size: 18px; }
.steps { margin: 0 0 32px; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; }
.steps li { display: flex; gap: 14px; align-items: baseline; }
.step { flex: none; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--ink); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; }

/* ---- footer ---- */
.foot { margin-top: 24px; padding-top: 20px; border-top: 2px solid var(--ink); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size: 15px; color: var(--muted); }
.treeline { margin-top: auto; padding-top: 40px; }
.treeline svg { display: block; width: 100%; max-width: 880px; height: 56px; margin: 0 auto; }
.treeline .ground { height: 12px; background: var(--ink); }

@media (max-width: 560px) {
  body { font-size: 16px; }
  .page { padding-top: 36px; }
  .narrow { padding-top: 56px; }
  .card { padding: 20px; }
  .card-head .badge { margin-left: 0; }
  .lede, .story { font-size: 18px; }
  .glance { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile { padding: 12px; gap: 8px; }
  .tile-name { font-size: 17px; }
  .tile-ns { display: none; }
  .seg, .follow { width: 100%; }
  .seg button { flex: 1 1 0; }
  .follow { justify-content: center; }
  .facts { grid-template-columns: 1fr; }
  .loglines { font-size: 13px; }
  .loglines li { grid-template-columns: auto minmax(0, 1fr); column-gap: 10px; padding: 4px 14px; }
  .loglines .m { grid-column: 1 / -1; }
  .facts dd { border-top: 0; padding-top: 0; }
}

@media (prefers-reduced-motion: no-preference) {
  .tile, .btn { transition: border-color .15s, filter .15s, background-color .15s; }
}
