/* ==========================================================================
   Pico — the full app window

   A calm two-column shell: a narrow sidebar of sections, and one content
   column with a generous measure. Quiet chrome, one accent, real hierarchy
   from type and space rather than borders everywhere.
   ========================================================================== */

.app {
  display: grid;
  grid-template-columns: 232px 1fr;
  height: 100vh;
  overflow: hidden;
  background: var(--ink-0);
}

/* ==========================================================================
   Sidebar
   ========================================================================== */
.side {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 14px 10px;
  gap: 2px;
  background: color-mix(in oklab, var(--ink-1) 70%, transparent);
  border-right: 1px solid var(--glass-border);
}

.side__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 16px;
}
.side__brand .pet { --pet-size: 30px; flex: none; }
.side__brand-name {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -.015em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side__nav { display: flex; flex-direction: column; gap: 1px; }

.navlink {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-mid);
  font: inherit;
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
  transition: background .14s, color .14s;
}
.navlink:hover { background: color-mix(in oklab, #ffffff 5%, transparent); color: var(--text-hi); }
.navlink[aria-current="page"] {
  background: color-mix(in oklab, #ffffff 8%, transparent);
  color: var(--text-hi);
  font-weight: 550;
}
.navlink svg { width: 17px; height: 17px; flex: none; opacity: .85; }

.navlink__badge {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--ink-0);
  font-size: 10.5px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.side__foot { margin-top: auto; padding: 8px; }

.side__status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--text-dim);
}
.side__status i {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ink-5);
  flex: none;
}
[data-conn="connected"] .side__status i { background: #4ade80; box-shadow: 0 0 8px rgba(74,222,128,.5); }
[data-conn="connecting"] .side__status i,
[data-conn="reconnecting"] .side__status i { background: #fbbf24; }

/* ==========================================================================
   Main column
   ========================================================================== */
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.main__head {
  flex: none;
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 26px 34px 18px;
}
.main__title {
  margin: 0;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -.025em;
}
.main__sub {
  font-size: 12.5px;
  color: var(--text-dim);
}

.main__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 34px 34px;
}
.main__body::-webkit-scrollbar { width: 10px; }
.main__body::-webkit-scrollbar-thumb {
  background: color-mix(in oklab, var(--ink-5) 75%, transparent);
  border-radius: 99px;
  border: 3px solid transparent;
  background-clip: padding-box;
}

.measure { max-width: 640px; }

/* ==========================================================================
   Cards
   ========================================================================== */
/* A card earns a border only when elevation carries meaning. These group
   related rows, so they get surface and space and nothing else. */
.panel {
  padding: 20px 22px;
  border-radius: 16px;
  background: color-mix(in oklab, var(--ink-2) 62%, transparent);
  margin-bottom: 10px;
}
.panel--raised {
  background: color-mix(in oklab, var(--ink-2) 85%, transparent);
  box-shadow: var(--shadow-lift);
}
.panel:last-child { margin-bottom: 0; }

.panel__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}
.panel__title { font-size: 14px; font-weight: 600; letter-spacing: -.01em; }
.panel__sub { font-size: 12.5px; color: var(--text-mid); line-height: 1.5; }
.panel__actions { margin-left: auto; display: flex; gap: 8px; }

.row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid color-mix(in oklab, #ffffff 6%, transparent);
}
.row:last-child { border-bottom: 0; padding-bottom: 0; }
.row:first-child { padding-top: 0; }
.row__main { flex: 1; min-width: 0; }
.row__title { font-size: 13.5px; font-weight: 550; }
.row__sub { font-size: 12px; color: var(--text-dim); margin-top: 2px; line-height: 1.45; }
.row__action { flex: none; }

/* Cursor identity swatch. Defined here rather than borrowed from notch.css,
   which this window does not load. */
.swatch {
  flex: none;
  width: 26px; height: 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  color: #05060a;
}

/* ==========================================================================
   Updates
   ========================================================================== */
.update {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px;
  border-radius: 18px;
  background: color-mix(in oklab, var(--ink-2) 85%, transparent);
  box-shadow: var(--shadow-lift);
}
/* Fixed colour, not --accent: the accent tracks the agent's phase and is
   slate while idle, which made an actionable card look inert. */
.update[data-state="available"] {
  --update-accent: #38bdf8;
  border-color: color-mix(in oklab, var(--update-accent) 48%, transparent);
  background: color-mix(in oklab, var(--update-accent) 10%, transparent);
}
.update[data-state="available"] .update__icon {
  background: color-mix(in oklab, var(--update-accent) 20%, transparent);
  color: var(--update-accent);
}

.update__icon {
  flex: none;
  width: 42px; height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: color-mix(in oklab, #ffffff 7%, transparent);
  color: var(--text-mid);
}
.update__icon svg { width: 20px; height: 20px; }

.update__main { flex: 1; min-width: 0; }
.update__title { font-size: 14px; font-weight: 600; letter-spacing: -.01em; }
.update__sub { font-size: 12.5px; color: var(--text-mid); margin-top: 3px; }

.progress {
  margin-top: 10px;
  height: 4px;
  border-radius: 99px;
  background: color-mix(in oklab, var(--ink-5) 70%, transparent);
  overflow: hidden;
}
.progress i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--accent);
  transition: width .25s var(--ease-out);
}

.build {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-dim);
}

/* ==========================================================================
   Chat
   ========================================================================== */
.chat {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}
.chat__scroll { flex: 1; min-height: 0; overflow-y: auto; padding-bottom: 16px; }
.chat__list { display: flex; flex-direction: column; gap: 14px; max-width: 640px; }

.bubble {
  max-width: 84%;
  padding: 11px 15px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  animation: row-in .26s var(--ease-out) both;
}
.bubble--you {
  align-self: flex-end;
  background: var(--accent);
  color: var(--ink-0);
  border-bottom-right-radius: 6px;
  font-weight: 500;
}
.bubble--pico {
  align-self: flex-start;
  background: color-mix(in oklab, #ffffff 6%, transparent);
  border-bottom-left-radius: 6px;
}
.bubble--event {
  align-self: center;
  background: none;
  color: var(--text-dim);
  font-size: 11.5px;
  padding: 0;
}

/* A reply that has been asked for but has not started arriving. Three dots
   rather than a spinner: it says "writing", not "loading". */
.bubble__typing { display: inline-flex; gap: 4px; align-items: center; padding: 2px 0; }
.bubble__typing i {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--text-dim);
  animation: bubble-dot 1.15s ease-in-out infinite;
}
.bubble__typing i:nth-child(2) { animation-delay: .16s; }
.bubble__typing i:nth-child(3) { animation-delay: .32s; }

@keyframes bubble-dot {
  0%, 60%, 100% { opacity: .3; transform: translateY(0); }
  30%           { opacity: 1;  transform: translateY(-3px); }
}
@media (prefers-reduced-motion: reduce) {
  .bubble__typing i { animation: none; opacity: .6; }
}

.composer2 {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 640px;
  padding: 0 14px;
  height: 50px;
  border-radius: 14px;
  background: color-mix(in oklab, #ffffff 5%, transparent);
  border: 1px solid var(--glass-border);
  transition: border-color .16s, box-shadow .16s;
}
.composer2:focus-within {
  border-color: color-mix(in oklab, var(--accent) 55%, transparent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.composer2 input {
  flex: 1; min-width: 0;
  border: 0; background: none; outline: none;
  color: var(--text-hi);
  font: inherit; font-size: 14.5px;
}
.composer2 input::placeholder { color: var(--text-dim); }

/* The app does not load notch.css, so it needs its own send control rather
   than borrowing that one's class. */
.composer2__send {
  flex: none;
  width: 34px; height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: var(--ink-0);
  cursor: pointer;
  transition: opacity .16s, transform .14s var(--ease-spring), background .3s;
}
.composer2__send:disabled { opacity: .28; cursor: not-allowed; }
.composer2__send:not(:disabled):hover { background: color-mix(in oklab, var(--accent) 88%, white); }
.composer2__send:not(:disabled):active { transform: scale(.92); }
.composer2__send svg { width: 16px; height: 16px; }

/* What will happen to what you type, shown where you type it. */
.composer2__mode {
  flex: none;
  border: 0;
  border-radius: 9px;
  padding: 5px 11px;
  font: inherit;
  font-size: 12px;
  font-weight: 550;
  cursor: pointer;
  color: var(--text-mid);
  background: color-mix(in oklab, #ffffff 8%, transparent);
  transition: color .16s, background .16s;
}
.composer2__mode:hover { color: var(--text-hi); background: color-mix(in oklab, #ffffff 15%, transparent); }
.composer2__mode[data-mode="chat"]  { color: #7dd3fc; background: color-mix(in oklab, #38bdf8 18%, transparent); }
.composer2__mode[data-mode="agent"] { color: #86efac; background: color-mix(in oklab, #4ade80 18%, transparent); }

/* ==========================================================================
   Screen map

   Your display, to scale, with Pico's pointer on it. Windows has one system
   cursor, so there is one dot — the value is being able to follow it without
   staring at the whole desktop.
   ========================================================================== */
.screenmap {
  position: relative;
  margin-top: 14px;
  width: 100%;
  aspect-ratio: 1 / var(--ratio, 0.5625);
  border-radius: 12px;
  background:
    linear-gradient(168deg, color-mix(in oklab, var(--accent) 7%, var(--ink-1)), var(--ink-0));
  border: 1px solid var(--glass-border);
  overflow: hidden;
}

/* A taskbar line, so the map reads as a screen rather than a rectangle. */
.screenmap::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 4.2%;
  background: color-mix(in oklab, #ffffff 6%, transparent);
  border-top: 1px solid color-mix(in oklab, #ffffff 7%, transparent);
}

.screenmap__dot {
  position: absolute;
  width: 10px; height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in oklab, var(--ink-0) 70%, transparent);
  opacity: 0;
  transition: opacity .3s var(--ease-out);
  z-index: 2;
}

/* The halo lags a fraction behind the dot, which reads as direction. */
.screenmap__trail {
  position: absolute;
  width: 30px; height: 30px;
  margin: -15px 0 0 -15px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in oklab, var(--accent) 45%, transparent), transparent 70%);
  opacity: 0;
  transition: left .18s linear, top .18s linear, opacity .4s var(--ease-out);
  z-index: 1;
}

.screenmap[data-live="true"] .screenmap__dot,
.screenmap[data-live="true"] .screenmap__trail { opacity: 1; }

.screenmap__coords {
  position: absolute;
  right: 9px; top: 8px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-dim);
  z-index: 3;
}

/* ==========================================================================
   Empty state
   ========================================================================== */
.empty {
  padding: 44px 0;
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
}

@media (max-width: 780px) {
  .app { grid-template-columns: 64px 1fr; }
  .side__brand-name, .navlink span:not(.navlink__badge), .side__status span { display: none; }
  .navlink { justify-content: center; }
  .main__head, .main__body { padding-inline: 20px; }
}


/* ==========================================================================
   Loading, empty and error states
   ========================================================================== */
.skeleton {
  border-radius: 8px;
  background:
    linear-gradient(90deg,
      color-mix(in oklab, #ffffff 4%, transparent) 0%,
      color-mix(in oklab, #ffffff 9%, transparent) 50%,
      color-mix(in oklab, #ffffff 4%, transparent) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}
@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

.skeleton-rows { display: grid; gap: 12px; }
.skeleton-rows .skeleton { height: 14px; }

.state {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 56px 24px;
  text-align: center;
}
.state__pet { opacity: .5; }
.state__pet .pet { --pet-size: 72px; }
.state__title { font-size: 14.5px; font-weight: 550; color: var(--text-mid); }
.state__sub { font-size: 12.5px; color: var(--text-dim); max-width: 34ch; line-height: 1.55; text-wrap: pretty; }
.state__action { margin-top: 6px; }

.notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  background: color-mix(in oklab, #f87171 10%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in oklab, #f87171 28%, transparent);
  font-size: 12.5px;
  line-height: 1.5;
  color: #ffd6d6;
}
.notice__title { font-weight: 600; color: #ffe6e6; }

@media (prefers-reduced-motion: reduce) {
  .skeleton { animation: none; }
}

/* ==========================================================================
   Build chip — what you are running, and whether there is something newer.
   Sits in the sidebar so neither fact requires opening a section.
   ========================================================================== */
.buildchip {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 9px;
  margin-bottom: 6px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-mid);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background .16s, color .16s;
}
.buildchip:hover { background: color-mix(in oklab, #ffffff 6%, transparent); }

.buildchip__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 26px; height: 26px;
  border-radius: 8px;
  background: color-mix(in oklab, #ffffff 6%, transparent);
  color: var(--text-lo);
  transition: background .2s, color .2s;
}
.buildchip__icon svg { width: 15px; height: 15px; }

.buildchip__text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.buildchip__label {
  font-size: 11.5px;
  font-weight: 550;
  color: var(--text-mid);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.buildchip__sha {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
}

/* An update waiting is the one state worth colour. */
.buildchip[data-state="available"] {
  background: color-mix(in oklab, #38bdf8 12%, transparent);
}
.buildchip[data-state="available"] .buildchip__icon {
  background: color-mix(in oklab, #38bdf8 22%, transparent);
  color: #7dd3fc;
}
.buildchip[data-state="available"] .buildchip__label { color: #bae6fd; }
.buildchip[data-state="available"] .buildchip__icon svg {
  animation: nudge-down 2.4s var(--ease-in-out) infinite;
}
@keyframes nudge-down {
  0%, 72%, 100% { transform: translateY(0); }
  82%           { transform: translateY(2px); }
}

.buildchip[data-state="checking"] .buildchip__icon { color: var(--text-mid); }
.buildchip[data-state="checking"] .buildchip__icon svg { animation: pulse-soft 1.4s var(--ease-in-out) infinite; }
@keyframes pulse-soft { 50% { opacity: .4; } }

.buildchip[data-state="error"] .buildchip__icon { color: #f9a8a8; background: color-mix(in oklab, #f87171 16%, transparent); }

@media (max-width: 780px) {
  .buildchip__text { display: none; }
  .buildchip { justify-content: center; padding: 8px 0; }
}

@media (prefers-reduced-motion: reduce) {
  .buildchip__icon svg { animation: none !important; }
}

/* Release notes, trimmed to the lines that say something */
.notes { display: grid; gap: 7px; margin-top: 10px; }
.notes__line {
  position: relative;
  padding-left: 16px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-mid);
  text-wrap: pretty;
}
.notes__line::before {
  content: "";
  position: absolute;
  left: 3px; top: 8px;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--text-dim);
}

/* ==========================================================================
   First run
   ========================================================================== */
.setup {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--ink-0);
  background-image: linear-gradient(168deg, #17243c 0%, #0d1526 46%, #080c16 100%);
  animation: panel-in .4s var(--ease-out) both;
}
.setup.is-done { animation: panel-out .4s var(--ease-in-out) both; }

.setup__card {
  width: min(420px, 100%);
  text-align: center;
}

.setup__pet { margin-bottom: 18px; }
.setup__pet .pet { margin-inline: auto; }

.setup__title {
  margin: 0;
  font-size: 27px;
  font-weight: 600;
  letter-spacing: -.03em;
}

.setup__lede {
  margin: 12px auto 0;
  max-width: 34ch;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-mid);
  text-wrap: pretty;
}

.setup__step {
  margin-top: 30px;
  padding: 22px;
  border-radius: 18px;
  background: color-mix(in oklab, #ffffff 5%, transparent);
  text-align: left;
}

.setup__steplabel {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.setup__stephelp {
  margin: 8px 0 14px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-mid);
  text-wrap: pretty;
}

.setup__row {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 46px;
  padding: 0 6px 0 14px;
  border-radius: 12px;
  background: color-mix(in oklab, var(--ink-0) 60%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in oklab, #ffffff 9%, transparent);
  transition: box-shadow .16s;
}
.setup__row:focus-within {
  box-shadow: inset 0 0 0 1px color-mix(in oklab, #38bdf8 60%, transparent),
              0 0 0 3px color-mix(in oklab, #38bdf8 16%, transparent);
}

.setup__input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  outline: none;
  color: var(--text-hi);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: .02em;
}
.setup__input::placeholder { color: var(--text-dim); font-family: var(--font); letter-spacing: 0; }

.setup__reveal {
  flex: none;
  height: 32px;
  padding: 0 11px;
  border: 0;
  border-radius: 8px;
  background: color-mix(in oklab, #ffffff 7%, transparent);
  color: var(--text-mid);
  font: inherit;
  font-size: 11.5px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.setup__reveal:hover { background: color-mix(in oklab, #ffffff 12%, transparent); color: var(--text-hi); }

.setup__error {
  margin: 10px 0 0;
  min-height: 16px;
  font-size: 12px;
  line-height: 1.45;
  color: #ffb4b4;
}

.setup__go { width: 100%; height: 44px; margin-top: 6px; border-radius: 12px; font-size: 14px; }

.setup__link {
  display: block;
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-dim);
  text-decoration: none;
  text-align: center;
}
.setup__link:hover { color: var(--text-mid); text-decoration: underline; }

.setup__foot {
  margin: 22px auto 0;
  max-width: 38ch;
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--text-dim);
  text-wrap: pretty;
}

/* ==========================================================================
   Hosted preview ribbon
   ========================================================================== */
.demo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 34px -4px;
  padding: 10px 14px;
  border-radius: 11px;
  background: color-mix(in oklab, #38bdf8 10%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in oklab, #38bdf8 26%, transparent);
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text-mid);
}
.demo__dot {
  flex: none;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 8px rgba(56, 189, 248, .55);
}
.demo__cta {
  flex: none;
  margin-left: auto;
  padding: 5px 11px;
  border-radius: 8px;
  background: #38bdf8;
  color: #05070d;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}
.demo__cta:hover { background: color-mix(in oklab, #38bdf8 88%, white); }

.buildchip[data-state="preview"] { color: var(--text-dim); }

@media (max-width: 780px) { .demo { margin-inline: 20px; } }
