/* Pip: a playful, always-light theme inspired by a cheerful messenger bird. */
:root {
  color-scheme: light;
  --sky: #3aa5d8;
  --sky-dark: #2385b8;
  --sky-soft: #dff1fb;
  --bg: #eef8fd;
  --navy: #17435a;
  --ink: #17435a;
  --muted: #557587;
  --sun: #ffe27a;
  --sun-soft: #fff6cf;
  --orange: #f59e2b;
  --orange-dark: #db8212;
  --green: #2f9e63;
  --green-soft: #ddf5e7;
  --red: #d9534f;
  --red-soft: #fde6e4;
  --pink: #ff9aa8;
  --white: #ffffff;
  --line: 2.5px solid var(--navy);
  --shadow: 5px 5px 0 var(--navy);
  --shadow-sm: 3px 3px 0 var(--navy);
  --radius: 20px;
  --radius-sm: 12px;
  --font-head: "Baloo 2", "Nunito", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  line-height: 1.45;
}
/* soft clouds */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(ellipse 160px 60px at 8% 14%, #fff 60%, transparent 62%),
    radial-gradient(ellipse 110px 46px at 14% 10%, #fff 60%, transparent 62%),
    radial-gradient(ellipse 200px 70px at 88% 26%, #fff 60%, transparent 62%),
    radial-gradient(ellipse 120px 50px at 82% 22%, #fff 60%, transparent 62%),
    radial-gradient(ellipse 180px 60px at 70% 92%, #fff 60%, transparent 62%),
    radial-gradient(ellipse 140px 50px at 20% 80%, #ffffffb0 60%, transparent 62%),
    linear-gradient(180deg, #dff1fb 0%, var(--bg) 45%, #f7fcff 100%);
}

h1, h2, h3 { font-family: var(--font-head); line-height: 1.1; margin: 0; }
h1 { font-size: clamp(28px, 4vw, 40px); font-weight: 800; }
h2 { font-size: 24px; font-weight: 800; }
h3 { font-size: 18px; font-weight: 700; }
a { color: var(--sky-dark); font-weight: 700; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }

/* ── Layout ─────────────────────────────────────────── */
.topbar {
  display: flex; align-items: center; gap: 16px;
  max-width: 1200px; margin: 0 auto; padding: 14px 16px;
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--navy); }
.brand-name { font-family: var(--font-head); font-weight: 800; font-size: 30px; letter-spacing: -0.5px; }
.brand-tag { font-size: 12px; color: var(--muted); font-weight: 700; margin-top: -6px; }
.topbar nav { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 8px 16px 64px; }
.grid { display: grid; gap: 22px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.cards { display: grid; gap: 22px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.stack > * + * { margin-top: 14px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.spacer { flex: 1; }
.section-title { display: flex; align-items: center; gap: 10px; margin: 34px 0 14px; }

/* ── Card ───────────────────────────────────────────── */
.card {
  background: var(--white);
  border: var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  position: relative;
}
.card-sun { background: var(--sun-soft); }
.card-sky { background: var(--sky-soft); }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2 { font-size: 22px; }

/* ── Buttons ────────────────────────────────────────── */
.btn {
  --b: var(--sky);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 800 15px/1 var(--font-body);
  color: var(--white);
  background: var(--b);
  border: var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  padding: 11px 16px;
  min-height: 44px;
  cursor: pointer;
  text-decoration: none;
  transition: transform .08s ease, box-shadow .08s ease, filter .15s;
}
.btn:hover { filter: brightness(1.05); transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--navy); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--navy); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 3px solid var(--orange); outline-offset: 2px;
}
.btn-orange { --b: var(--orange); }
.btn-white { --b: var(--white); color: var(--navy); }
.btn-green { --b: var(--green); }
.btn-red { --b: var(--red); }
.btn-ghost { background: transparent; box-shadow: none; border-color: transparent; color: var(--navy); }
.btn-ghost:hover { background: var(--sky-soft); box-shadow: none; transform: none; }
.btn-sm { min-height: 34px; padding: 7px 11px; font-size: 13px; border-width: 2px; box-shadow: 2px 2px 0 var(--navy); }
.btn-big { font-size: 17px; padding: 14px 22px; min-height: 52px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }
.inline { display: inline; margin: 0; }

/* ── Forms ──────────────────────────────────────────── */
label { display: block; font-weight: 800; font-size: 14px; margin-bottom: 6px; }
.hint { font-weight: 600; color: var(--muted); font-size: 13px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=time],
input[type=url], input[type=search], textarea, select {
  width: 100%;
  font: 600 15px var(--font-body);
  color: var(--ink);
  background: var(--white);
  border: 2px solid var(--navy);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  min-height: 44px;
}
textarea { min-height: 130px; resize: vertical; font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
.field { margin-bottom: 14px; }
.fields-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 700; font-size: 14px; }
.check input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--sky-dark); }
.dropzone {
  border: 3px dashed var(--sky); border-radius: var(--radius); background: var(--sky-soft);
  padding: 22px; text-align: center; cursor: pointer; transition: background .15s;
}
.dropzone:hover, .dropzone.drag { background: #cbe9f8; }
.dropzone input { display: none; }
.dropzone .filename { margin-top: 8px; font-weight: 800; }

/* ── Chips / badges ─────────────────────────────────── */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 800; font-size: 12.5px;
  padding: 4px 10px; border-radius: 999px;
  border: 2px solid var(--navy);
  background: var(--white); color: var(--navy);
  white-space: nowrap;
}
.chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.chip-queued { background: var(--sky-soft); }
.chip-sent { background: var(--sun); }
.chip-accepted { background: var(--green-soft); color: #1d6b42; }
.chip-connected { background: #ece6ff; color: #4b3a8f; }
.chip-skipped { background: #eef1f3; color: #5a6b75; }
.chip-failed { background: #ffe6cc; color: #9a5300; }
.chip-ok { background: var(--green-soft); color: #1d6b42; }
.chip-warn { background: #ffe6cc; color: #9a5300; }
.chip-bad { background: var(--red-soft); color: #a33a36; }
.chip-idle { background: #eef1f3; color: #5a6b75; }

/* ── Flash ──────────────────────────────────────────── */
.flash {
  display: flex; gap: 12px; align-items: center;
  border: var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-sm);
  background: var(--green-soft); padding: 12px 16px; font-weight: 700; margin-bottom: 20px;
  animation: pop .35s ease;
}
.flash-error { background: var(--red-soft); }
@keyframes pop { from { transform: scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }

/* ── Dashboard ──────────────────────────────────────── */
.hero { display: flex; align-items: center; gap: 22px; margin: 10px 0 26px; flex-wrap: wrap; }
.hero .pip { flex: none; filter: drop-shadow(0 6px 0 #17435a22); }
.hero-text { flex: 1; min-width: 240px; }
.hero-text p { font-size: 17px; margin-top: 6px; color: var(--muted); font-weight: 700; }
.bubbles { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); margin-bottom: 10px; }
.bubble { padding: 16px 18px; }
.bubble .num { font-family: var(--font-head); font-weight: 800; font-size: 34px; line-height: 1; }
.bubble .lbl { font-weight: 800; font-size: 13px; color: var(--muted); margin-top: 6px; }
.bubble .num small { font-size: 18px; color: var(--muted); }

.acct { display: flex; flex-direction: column; gap: 14px; transition: transform .15s; }
.acct:hover { transform: translateY(-3px) rotate(-.4deg); }
.acct-top { display: flex; gap: 12px; align-items: center; }
.acct-top .pip { flex: none; }
.acct-name { font-family: var(--font-head); font-weight: 800; font-size: 22px; line-height: 1.05; }
.acct-name a { color: var(--navy); text-decoration: none; }
.acct-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.acct-stats div { background: var(--bg); border: 2px solid var(--navy); border-radius: 12px; padding: 8px 4px; }
.acct-stats b { display: block; font-family: var(--font-head); font-size: 22px; line-height: 1; }
.acct-stats span { font-size: 11.5px; font-weight: 800; color: var(--muted); }
.acct-next { font-weight: 800; font-size: 14px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.add-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  min-height: 250px; border-style: dashed; background: #ffffffaa; box-shadow: none; text-decoration: none;
  color: var(--navy);
}
.add-card:hover { background: var(--white); box-shadow: var(--shadow); }
.add-card .plus {
  width: 64px; height: 64px; border-radius: 50%; background: var(--sun); border: var(--line);
  display: grid; place-items: center; font: 800 38px/1 var(--font-head); box-shadow: var(--shadow-sm);
}

.attention { display: flex; gap: 16px; align-items: center; background: #fff1de; margin-bottom: 22px; flex-wrap: wrap; }

/* Today's progress: Pip flies along a dotted line. */
.flight { position: relative; height: 40px; margin-top: 4px; }
.flight-track { position: absolute; left: 0; right: 0; top: 26px; border-top: 3px dashed #9ccfe8; }
.flight-done { position: absolute; left: 0; top: 24px; height: 7px; background: var(--sky); border: 2px solid var(--navy); border-radius: 99px; }
.flight-bird { position: absolute; top: -2px; transform: translateX(-50%); transition: left .6s cubic-bezier(.3,1.4,.6,1); }
.flight-label { display: flex; justify-content: space-between; font-size: 12.5px; font-weight: 800; color: var(--muted); }

/* ── Account page ───────────────────────────────────── */
.acct-hero { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.acct-hero .pip { flex: none; }
.acct-hero-main { flex: 1; min-width: 240px; }
.acct-hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.period { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.period > div { border: 2px solid var(--navy); border-radius: 14px; padding: 12px; background: var(--bg); }
.period h3 { font-size: 15px; color: var(--muted); margin-bottom: 8px; }
.period .big { font-family: var(--font-head); font-weight: 800; font-size: 26px; line-height: 1; }
.period .rate { margin-top: 6px; font-weight: 800; font-size: 13px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; }
.kv dt { font-weight: 800; color: var(--muted); }
.kv dd { margin: 0; font-weight: 700; }

.chart { width: 100%; height: auto; }
.legend { display: flex; gap: 16px; font-size: 13px; font-weight: 800; }
.legend span::before { content: ""; display: inline-block; width: 12px; height: 12px; border: 2px solid var(--navy); border-radius: 4px; margin-right: 6px; vertical-align: -2px; background: var(--c); }

.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.tab {
  font: 800 14px var(--font-body); color: var(--navy); background: var(--white);
  border: 2px solid var(--navy); border-radius: 999px; padding: 8px 14px; cursor: pointer; min-height: 40px;
}
.tab[aria-selected=true] { background: var(--sun); box-shadow: 2px 2px 0 var(--navy); }
.tabpanel[hidden] { display: none; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filters .chip { text-decoration: none; cursor: pointer; font-size: 13px; padding: 6px 12px; }
.filters .chip.active { box-shadow: 2px 2px 0 var(--navy); outline: 2px solid var(--navy); }
.search { display: flex; gap: 8px; margin-left: auto; min-width: 240px; flex: 1; max-width: 360px; }

.table-wrap { overflow-x: auto; border: 2px solid var(--navy); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1.5px solid #d6e9f3; vertical-align: middle; }
th { background: var(--sky-soft); font-weight: 800; font-size: 12.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
tbody tr:hover { background: #f6fbfe; }
tbody tr:last-child td { border-bottom: none; }
td .note { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
.person { font-weight: 800; color: var(--navy); text-decoration: none; }
.person:hover { text-decoration: underline; }
.pager { display: flex; gap: 8px; justify-content: center; align-items: center; margin-top: 14px; font-weight: 800; }

.runs { list-style: none; margin: 0; padding: 0; }
.runs li { border-bottom: 1.5px solid #d6e9f3; padding: 10px 0; }
.runs li:last-child { border-bottom: none; }
.runs details summary { cursor: pointer; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; list-style: none; }
.runs details summary::-webkit-details-marker { display: none; }
.runs pre { white-space: pre-wrap; background: var(--bg); border: 2px solid var(--navy); border-radius: 10px; padding: 10px; font-size: 12px; max-height: 320px; overflow: auto; }

.empty { text-align: center; padding: 26px 10px; }
.empty .pip { margin: 0 auto 6px; display: block; }

.danger { border-color: var(--red); box-shadow: 5px 5px 0 var(--red); }

/* ── Browser (VNC) page ─────────────────────────────── */
.screen {
  position: relative; background: #0f2c3b; border: var(--line); border-radius: 16px; overflow: hidden;
  aspect-ratio: 1366 / 900; width: 100%;
}
.screen-msg {
  position: absolute; inset: 0; display: flex; flex-direction: column; gap: 12px;
  align-items: center; justify-content: center; color: #fff; text-align: center; padding: 20px; font-weight: 800;
  background: radial-gradient(circle at 50% 40%, #2c6e8f, #0f2c3b);
}
.steps { margin: 0; padding-left: 22px; font-weight: 700; }
.steps li { margin-bottom: 8px; }

/* ── Login ──────────────────────────────────────────── */
.login { max-width: 420px; margin: 7vh auto 0; padding: 0 16px; }
.login .pip { display: block; margin: 0 auto -16px; position: relative; z-index: 1; }

/* ── Mascot motion ──────────────────────────────────── */
.pip--flying, .pip--celebrate { animation: flap 1.8s ease-in-out infinite; }
.pip--happy { animation: bob 3s ease-in-out infinite; }
.pip--confused .pip-question { animation: wiggle 1.2s ease-in-out infinite; transform-origin: 176px 30px; }
.pip-zzz { animation: float 2.4s ease-in-out infinite; }
@keyframes flap { 0%,100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-7px) rotate(2deg); } }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes wiggle { 0%,100% { transform: rotate(-10deg); } 50% { transform: rotate(10deg); } }
@keyframes float { 0%,100% { transform: translateY(0); opacity: 1; } 50% { transform: translateY(-5px); opacity: .6; } }

.confetti-piece { position: fixed; top: -12px; width: 10px; height: 14px; border-radius: 3px; z-index: 50; pointer-events: none; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(105vh) rotate(720deg); } }
.fly-envelope { position: fixed; z-index: 60; font-size: 34px; pointer-events: none; animation: flyaway 1.3s ease-in forwards; }
@keyframes flyaway { 0% { transform: translate(0,0) scale(1); opacity: 1; } 100% { transform: translate(60vw,-70vh) scale(.4) rotate(25deg); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media (max-width: 640px) {
  .fields-2, .period { grid-template-columns: 1fr; }
  .brand-tag { display: none; }
  .card { padding: 16px; }
  .search { max-width: none; margin-left: 0; }
  .hero { gap: 12px; }
}
