/*
 * The Harness window, drawn on a web page.
 *
 * These tokens are the desktop app's own: the same ink, the same teal, the same hairline.
 * A page that copies a window and then paints it with a different palette is a picture of
 * a different product, so the palette is copied rather than approximated.
 */

:root {
  color-scheme: dark;
  --hz-bg: #0b1d26;
  --hz-bg-2: #102833;
  --hz-panel: #143039;
  --hz-panel-2: #193944;
  --hz-panel-3: #204550;
  --hz-line: #35505f;
  --hz-line-soft: #223643;
  --hz-text: #eef6fc;
  --hz-text-2: #cbdaea;
  --hz-dim: #a6bacd;
  --hz-dim-2: #90a5ba;
  --hz-accent: #6beaf6;
  --hz-accent-soft: rgb(107 234 246 / 14%);
  --hz-ok: #56e39f;
  --hz-bad: #ff8a8a;
  --hz-warn: #f3c969;
  --hz-radius: 10px;
  --hz-radius-sm: 7px;
  --hz-mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  --hz-t: 160ms cubic-bezier(0.2, 0.7, 0.3, 1);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body.hz-page {
  margin: 0;
  padding: 22px clamp(12px, 4vw, 40px) 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background:
    radial-gradient(120% 80% at 50% -10%, rgb(95 227 240 / 7%), transparent 60%),
    var(--hz-bg);
  color: var(--hz-text);
  font: 14px/1.55 -apple-system, "Segoe UI Variable Text", "Segoe UI", Inter, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

.hz-skip {
  position: absolute;
  left: 12px;
  top: -40px;
  padding: 8px 12px;
  border-radius: var(--hz-radius-sm);
  background: var(--hz-accent);
  color: #04212a;
  font-weight: 600;
  text-decoration: none;
  z-index: 30;
}
.hz-skip:focus { top: 12px; }

/* ------------------------------------------------------------------ page header */

.hz-intro {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  max-width: 1080px;
  width: 100%;
  margin: 0 auto;
}

.hz-intro__brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--hz-text);
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
}
.hz-intro__brand svg { width: 26px; height: 26px; }

.hz-intro__nav {
  margin-left: auto;
  display: flex;
  gap: 16px;
  font-size: 13px;
}
.hz-intro__nav a {
  color: var(--hz-dim);
  text-decoration: none;
  padding: 4px 0;
  border-bottom: 1px solid transparent;
  transition: color var(--hz-t), border-color var(--hz-t);
}
.hz-intro__nav a:hover,
.hz-intro__nav a:focus-visible { color: var(--hz-text); border-bottom-color: var(--hz-accent); }

.hz-lede {
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
  color: var(--hz-dim);
  font-size: 13.5px;
}
.hz-lede a { color: var(--hz-accent); text-decoration: none; border-bottom: 1px solid rgb(95 227 240 / 35%); }

/* ------------------------------------------------------------------ the window */

.hz-window {
  width: 100%;
  max-width: 1080px;
  height: min(78vh, 760px);
  min-height: 460px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--hz-line);
  border-radius: 14px;
  background: var(--hz-panel);
  box-shadow:
    0 1px 0 rgb(255 255 255 / 3%) inset,
    0 30px 70px -30px rgb(0 0 0 / 85%);
}

/* The title bar. Height, rule and gradient are the app's; the buttons are inert copies. */
.hz-chrome {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  flex: 0 0 auto;
  padding: 0 8px 0 14px;
  border-bottom: 1px solid var(--hz-line-soft);
  background: linear-gradient(180deg, rgb(20 48 57 / 60%), transparent), #102833;
  user-select: none;
}

.hz-chrome__mark {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--hz-accent);
  box-shadow: 0 0 0 3px rgb(95 227 240 / 12%);
}

.hz-chrome__name {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--hz-text-2);
}
.hz-chrome__tag {
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--hz-dim-2);
}
.hz-chrome__spacer { flex: 1 1 auto; }

.hz-winbtns { display: inline-flex; align-items: center; gap: 6px; }

.hz-winbtn {
  width: 32px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 1px solid rgb(233 241 249 / 12%);
  border-radius: var(--hz-radius-sm);
  background: rgb(22 36 52 / 55%);
  color: var(--hz-text-2);
  font-size: 13px;
  line-height: 1;
}
.hz-winbtn--min span { font-size: 15px; transform: translateY(-1px); }
.hz-winbtn--max span { font-size: 10px; }
.hz-winbtn--close span { font-size: 15px; }
/* Not a hover: these buttons are decorative here, and a control that looks clickable and
   is not is worse than one that plainly is not. */

/* ------------------------------------------------------------------ rows and dock */

.hz-row {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
}

.hz-dock {
  flex: 0 0 236px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-right: 1px solid var(--hz-line-soft);
  background: var(--hz-bg-2);
  transition: margin-left var(--hz-t), opacity var(--hz-t);
}
.hz-dock[data-closed="true"] {
  margin-left: -237px;
  opacity: 0;
  pointer-events: none;
}

.hz-dock__head {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--hz-dim-2);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.hz-dock__count {
  margin-left: auto;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--hz-panel-2);
  color: var(--hz-dim);
  font-family: var(--hz-mono);
  font-size: 10px;
  letter-spacing: 0;
}

.hz-newchat {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid rgb(95 227 240 / 30%);
  border-radius: var(--hz-radius-sm);
  background: var(--hz-accent-soft);
  color: var(--hz-accent);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--hz-t), border-color var(--hz-t);
}
.hz-newchat:hover { background: rgb(95 227 240 / 20%); border-color: rgb(95 227 240 / 55%); }

.hz-sessions {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--hz-line) transparent;
}

.hz-session {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-radius: var(--hz-radius-sm);
  background: transparent;
  color: var(--hz-text-2);
  font: inherit;
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
  transition: background var(--hz-t), border-color var(--hz-t), color var(--hz-t);
}
.hz-session:hover { background: var(--hz-panel-2); color: var(--hz-text); }
.hz-session[aria-current="true"] {
  background: var(--hz-panel-2);
  border-color: var(--hz-line);
  color: var(--hz-text);
}
.hz-session__dot {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--hz-dim-2);
}
.hz-session[data-status="ok"] .hz-session__dot { background: var(--hz-ok); }
.hz-session[data-status="running"] .hz-session__dot { background: var(--hz-accent); box-shadow: 0 0 0 3px rgb(95 227 240 / 16%); }
.hz-session[data-status="failed"] .hz-session__dot { background: var(--hz-bad); }
.hz-session__label {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.hz-dock__foot {
  margin: auto 0 0;
  color: var(--hz-dim-2);
  font-size: 11px;
  line-height: 1.5;
}

/* ------------------------------------------------------------------ main column */

.hz-main {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--hz-panel);
}

.hz-topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  padding: 9px 14px;
  border-bottom: 1px solid var(--hz-line-soft);
}

.hz-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: var(--hz-radius-sm);
  background: transparent;
  color: var(--hz-dim);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: background var(--hz-t), color var(--hz-t), border-color var(--hz-t);
}
.hz-icon:hover { background: var(--hz-panel-2); border-color: var(--hz-line); color: var(--hz-text); }
.hz-icon[aria-expanded="false"] { color: var(--hz-accent); }

.hz-tabs {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--hz-line);
  border-radius: 999px;
  background: var(--hz-bg-2);
}

.hz-tab {
  padding: 3px 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--hz-dim);
  font: inherit;
  font-size: 11.5px;
  cursor: pointer;
  transition: color var(--hz-t), background var(--hz-t), border-color var(--hz-t);
}
.hz-tab:hover { color: var(--hz-text); }
.hz-tab[aria-selected="true"] {
  color: var(--hz-accent);
  background: var(--hz-accent-soft);
  border-color: rgb(95 227 240 / 35%);
}

.hz-spacer { flex: 1 1 auto; }

.hz-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--hz-line);
  border-radius: 999px;
  background: var(--hz-bg-2);
  color: var(--hz-dim);
  font-size: 11.5px;
}
.hz-pill__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--hz-ok);
}

/* ------------------------------------------------------------------ transcript */

.hz-log {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 18px clamp(12px, 3vw, 28px) 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--hz-line) transparent;
}

.hz-hero {
  max-width: 660px;
  margin: min(6vh, 48px) auto 0;
  text-align: center;
}
.hz-hero__title {
  margin: 0 0 8px;
  font-size: clamp(21px, 3.2vw, 27px);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.hz-hero__sub {
  margin: 0 auto 22px;
  max-width: 460px;
  color: var(--hz-dim);
  font-size: 13px;
}

.hz-suggest {
  display: grid;
  gap: 2px;
  width: 100%;
  margin: 0 0 8px;
  padding: 10px 14px;
  border: 1px solid var(--hz-line);
  border-radius: var(--hz-radius);
  background: var(--hz-panel-2);
  color: var(--hz-text-2);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background var(--hz-t), border-color var(--hz-t), transform var(--hz-t);
}
.hz-suggest:hover {
  background: var(--hz-panel-3);
  border-color: var(--hz-dim-2);
  transform: translateY(-1px);
}
.hz-suggest__label { font-size: 12.5px; font-weight: 600; color: var(--hz-text); }
.hz-suggest__text { font-size: 12px; color: var(--hz-dim); }

.hz-turn { max-width: 700px; margin: 0 auto 16px; }

.hz-turn__who {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
  color: var(--hz-dim-2);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.hz-turn__who::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: var(--hz-line-soft);
}

.hz-turn__body {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 13.5px;
  line-height: 1.62;
  color: var(--hz-text);
}

.hz-turn--user .hz-turn__body {
  display: inline-block;
  padding: 8px 12px;
  border: 1px solid var(--hz-line);
  border-radius: var(--hz-radius);
  background: var(--hz-panel-2);
  font-size: 13px;
}

.hz-turn__meta {
  margin: 6px 0 0;
  color: var(--hz-dim-2);
  font-family: var(--hz-mono);
  font-size: 10.5px;
}

.hz-turn__note {
  margin: 8px 0 0;
  padding: 8px 10px;
  border: 1px solid rgb(243 201 105 / 35%);
  border-radius: var(--hz-radius-sm);
  background: rgb(243 201 105 / 8%);
  color: var(--hz-warn);
  font-size: 12px;
}

.hz-caret {
  display: inline-block;
  width: 7px;
  height: 1.05em;
  margin-left: 2px;
  vertical-align: -0.16em;
  background: var(--hz-accent);
  animation: hz-blink 1.1s steps(2, start) infinite;
}
@keyframes hz-blink { 50% { opacity: 0; } }

/* ------------------------------------------------------------------ task outline */

.hz-tree {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 14px clamp(12px, 3vw, 24px);
  scrollbar-width: thin;
  scrollbar-color: var(--hz-line) transparent;
}

.hz-tree__head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
}
.hz-tree__title { font-size: 12.5px; font-weight: 600; }
.hz-tree__counts { color: var(--hz-dim-2); font-size: 11.5px; }

.hz-outline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hz-row-task {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--hz-line);
  border-radius: var(--hz-radius-sm);
  background: var(--hz-panel-2);
  font-size: 12.5px;
  color: var(--hz-text-2);
}
.hz-row-task[data-depth="1"] { margin-left: 18px; }
.hz-row-task[data-depth="2"] { margin-left: 36px; }
.hz-row-task[data-depth="3"] { margin-left: 54px; }
.hz-row-task__dot {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--hz-dim-2);
}
.hz-row-task[data-status="running"] .hz-row-task__dot { background: var(--hz-accent); }
.hz-row-task[data-status="ok"] .hz-row-task__dot { background: var(--hz-ok); }
.hz-row-task[data-status="failed"] .hz-row-task__dot { background: var(--hz-bad); }
.hz-row-task__label {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.hz-row-task__meta {
  margin-left: auto;
  color: var(--hz-dim-2);
  font-family: var(--hz-mono);
  font-size: 10.5px;
}

.hz-tree__foot { margin: 12px 0 0; color: var(--hz-dim-2); font-size: 11.5px; }

/* ------------------------------------------------------------------ composer */

.hz-composer {
  flex: 0 0 auto;
  margin: 0 clamp(12px, 3vw, 24px) 14px;
  padding: 10px 12px 8px;
  border: 1px solid var(--hz-line);
  border-radius: 12px;
  background: var(--hz-bg-2);
  transition: border-color var(--hz-t), box-shadow var(--hz-t);
}
.hz-composer:focus-within {
  border-color: rgb(95 227 240 / 45%);
  box-shadow: 0 0 0 3px rgb(95 227 240 / 8%);
}

.hz-input {
  display: block;
  width: 100%;
  max-height: 148px;
  padding: 2px 2px 8px;
  border: 0;
  background: transparent;
  color: var(--hz-text);
  font: inherit;
  font-size: 13.5px;
  line-height: 1.55;
  resize: none;
  outline: none;
}
.hz-input::placeholder { color: var(--hz-dim-2); }

.hz-composer__foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--hz-line-soft);
}

.hz-count, .hz-hint {
  color: var(--hz-dim-2);
  font-family: var(--hz-mono);
  font-size: 10.5px;
}
.hz-hint { margin-left: auto; }

.hz-send {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid rgb(95 227 240 / 45%);
  border-radius: 50%;
  background: var(--hz-accent);
  color: #04212a;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: filter var(--hz-t), transform var(--hz-t);
}
.hz-send:hover { filter: brightness(1.08); }
.hz-send:active { transform: translateY(1px); }
.hz-send[data-busy="true"] { opacity: 0.55; cursor: progress; }

.hz-fine {
  margin: 8px 0 0;
  color: var(--hz-dim-2);
  font-size: 10.5px;
  line-height: 1.5;
}

/* ------------------------------------------------------------------ footer */

.hz-foot {
  max-width: 1080px;
  width: 100%;
  margin: 0 auto;
  color: var(--hz-dim-2);
  font-size: 12px;
  text-align: center;
}
.hz-foot a { color: var(--hz-dim); text-decoration: none; border-bottom: 1px solid transparent; }
.hz-foot a:hover { color: var(--hz-text); border-bottom-color: var(--hz-line); }

.hz-noscript { max-width: 1080px; margin: 0 auto; color: var(--hz-warn); font-size: 12.5px; }

:where(a, button, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--hz-accent);
  outline-offset: 2px;
}

/* ------------------------------------------------------------------ narrow */

@media (max-width: 820px) {
  body.hz-page { padding: 14px 10px 22px; }
  .hz-window { height: min(84vh, 700px); }
  .hz-dock {
    position: absolute;
    z-index: 12;
    top: 38px;
    bottom: 0;
    width: 236px;
    box-shadow: 18px 0 40px -20px rgb(0 0 0 / 80%);
  }
  .hz-row { position: relative; }
  .hz-hint { display: none; }
}

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