:root {
  color-scheme: light;
  --ink: #102238;
  --muted: #526578;
  --line: #dce4ec;
  --paper: #f2f5f9;
  --blue: #1260c8;
  --cyan: #0b827d;
  --red: #b7323c;
  --radius: 18px;
  font:
    16px/1.5 -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
}
a {
  color: var(--blue);
  text-decoration: none;
}
button,
input,
textarea {
  font: inherit;
}
button,
a,
input,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
  min-height: 48px;
  border: 0;
  border-radius: 12px;
  padding: 12px 18px;
  background: var(--blue);
  color: white;
  font-weight: 650;
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid #38b5dd;
  outline-offset: 3px;
}
button.quiet {
  background: transparent;
  color: var(--muted);
  padding: 10px;
}
.top {
  background: var(--ink);
  color: white;
  padding: 18px max(20px, env(safe-area-inset-right)) 18px
    max(20px, env(safe-area-inset-left));
  padding-top: max(18px, env(safe-area-inset-top));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.top .quiet {
  color: #d2e0ef;
}
.brand {
  display: flex;
  gap: 11px;
  align-items: center;
  color: inherit;
  font-weight: 700;
  font-size: 1.12rem;
}
.brand-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  background: #197782;
  border-radius: 12px;
  color: #fff;
  font-size: 1.35rem;
}
.brand small {
  display: block;
  font-size: 0.78rem;
  font-weight: 400;
  color: #b7c9db;
  letter-spacing: 0.02em;
}
main {
  max-width: 850px;
  margin: 0 auto;
  padding: 24px 20px calc(110px + env(safe-area-inset-bottom));
  min-height: 75vh;
}
h1 {
  font-size: 1.8rem;
  line-height: 1.2;
  letter-spacing: -0.035em;
  margin: 0 0 10px;
}
h2 {
  font-size: 1.18rem;
  margin: 26px 0 12px;
}
h3 {
  font-size: 1.06rem;
  margin: 0 0 7px;
}
p {
  margin: 8px 0 14px;
}
.muted,
.hint {
  color: var(--muted);
}
.hint {
  font-size: 0.88rem;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--cyan);
  margin: 0 0 10px;
}
.card {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin: 12px 0;
  overflow-wrap: anywhere;
}
.compose {
  border-top: 3px solid var(--cyan);
  box-shadow: 0 5px 20px #17345608;
}
.compose label {
  font-size: 1.1rem;
  font-weight: 650;
}
.compose textarea {
  min-height: 142px;
  resize: vertical;
}
.compose .submit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
}
.submit-row .hint {
  max-width: 330px;
  margin: 0;
}
label {
  display: block;
  font-weight: 600;
  margin: 16px 0 7px;
}
input,
textarea {
  width: 100%;
  border: 1px solid #afbfce;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  padding: 13px;
  min-height: 48px;
}
input[type="number"] {
  width: 100px;
}
input:focus,
textarea:focus {
  border-color: var(--blue);
}
.row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.badge {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  background: #eaf0f6;
  color: #456079;
}
.badge.running,
.badge.queued {
  background: #e8f0fd;
  color: #165bac;
}
.badge.completed,
.badge.healthy,
.badge.ok {
  background: #e0f4ed;
  color: #0c654b;
}
.badge.failed,
.badge.unhealthy {
  background: #fbe8e8;
  color: #9d2633;
}
.badge.waiting_approval {
  background: #fff3d5;
  color: #80510c;
}
.goal-link {
  display: block;
  color: var(--ink);
}
.goal-link .title {
  display: block;
  font-size: 1.07rem;
  font-weight: 650;
  margin: 11px 0 5px;
}
.meta {
  font-size: 0.83rem;
  color: var(--muted);
}
.empty {
  border: 1px dashed #b5c5d3;
  background: transparent;
  color: var(--muted);
  border-radius: 14px;
  padding: 22px;
  margin: 12px 0;
}
.strip {
  background: #e1f0ed;
  color: #185e54;
  border: 1px solid #c1ded7;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.88rem;
}
.strip.warn {
  background: #fff2dc;
  color: #875c0b;
  border-color: #ead4aa;
}
.strip.error {
  background: #fbe8e8;
  color: #8c2333;
  border-color: #efbdc4;
}
.bottom {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-around;
  gap: 3px;
  background: #fff;
  border-top: 1px solid var(--line);
  padding: 8px max(6px, env(safe-area-inset-right))
    calc(8px + env(safe-area-inset-bottom));
  z-index: 10;
}
.bottom a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  min-width: 64px;
  padding: 4px 7px;
  border-radius: 12px;
  color: var(--muted);
  font-size: 0.75rem;
  gap: 2px;
}
.bottom a span {
  font-size: 1.35rem;
  line-height: 1.1;
}
.bottom a.active {
  color: var(--blue);
  background: #edf3fd;
  font-weight: 650;
}
[hidden] {
  display: none !important;
}
.auth {
  max-width: 480px;
  margin: 20px auto;
}
.auth h1 {
  font-size: 1.7rem;
}
.auth button[type="submit"] {
  width: 100%;
  margin-top: 22px;
}
.auth .card {
  padding: 24px;
}
.otp {
  font-size: 1.6rem;
  letter-spacing: 0.35em;
  font-variant-numeric: tabular-nums;
}
.qr {
  width: min(240px, 100%);
  display: block;
  margin: 18px auto;
}
.secret {
  display: block;
  font:
    1rem/1.8 ui-monospace,
    monospace;
  word-break: break-all;
  padding: 12px;
  background: #eef3f7;
  border-radius: 10px;
}
.back {
  display: inline-block;
  padding: 8px 0;
  margin-bottom: 14px;
  min-height: 44px;
}
.instruction {
  white-space: pre-wrap;
}
.facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 16px;
}
.fact small {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}
.fact strong {
  font-size: 1rem;
}
.org {
  counter-increment: orgs;
}
.results {
  counter-reset: orgs;
}
.org h3:before {
  content: counter(orgs, decimal-leading-zero) " ";
  color: var(--cyan);
  font-variant-numeric: tabular-nums;
}
.contacts {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 14px 0;
}
.contacts a {
  padding: 8px 11px;
  background: #edf3f9;
  border-radius: 9px;
  min-height: 44px;
  font-size: 0.92rem;
}
.sources {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  font-size: 0.83rem;
}
.sources a {
  display: block;
  min-height: 30px;
  overflow-wrap: anywhere;
}
.list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.list li {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font:
    0.85rem/1.5 ui-monospace,
    monospace;
  color: var(--muted);
}
details summary {
  cursor: pointer;
  padding: 10px 0;
  min-height: 44px;
  font-size: 0.9rem;
  color: var(--muted);
}
#notice {
  position: fixed;
  bottom: calc(90px + env(safe-area-inset-bottom));
  left: 20px;
  right: 20px;
  margin: auto;
  max-width: 650px;
  padding: 14px 18px;
  background: var(--ink);
  color: #fff;
  border-radius: 12px;
  box-shadow: 0 6px 28px #0003;
  z-index: 20;
}
.loading {
  padding: 30px 0;
  color: var(--muted);
}
.auth-error {
  color: var(--red);
  font-size: 0.94rem;
  min-height: 24px;
}
.install {
  font-size: 0.88rem;
  color: var(--muted);
  margin-top: 24px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}
.help-link {
  display: inline-block;
  min-height: 44px;
  padding: 10px 0;
}
.pending {
  border-left: 3px solid var(--blue);
}
@media (min-width: 760px) {
  main {
    padding-top: 32px;
  }
  .top {
    padding-left: max(24px, calc((100vw - 850px) / 2));
    padding-right: max(24px, calc((100vw - 850px) / 2));
  }
  .bottom {
    justify-content: center;
    gap: 36px;
  }
  .bottom a {
    min-width: 115px;
    font-size: 0.88rem;
  }
  .facts {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 380px) {
  main {
    padding-left: 14px;
    padding-right: 14px;
  }
  .card {
    padding: 16px;
  }
  .compose .submit-row {
    display: block;
  }
  .submit-row button {
    width: 100%;
    margin-top: 14px;
  }
  .bottom a {
    font-size: 0.72rem;
    padding: 4px;
  }
  .brand {
    font-size: 1rem;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .card {
    animation: appear 0.18s ease-out;
  }
  @keyframes appear {
    from {
      opacity: 0.6;
      transform: translateY(3px);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }
}
:root {
  --mobile-controls-version: 2;
}
@media (max-width: 600px) {
  .compose .submit-row {
    display: block;
  }
  .submit-row button {
    width: 100%;
    margin-top: 14px;
    white-space: nowrap;
  }
  .submit-row .hint {
    max-width: none;
  }
  .compose textarea {
    min-height: 136px;
  }
  .bottom a {
    font-size: 0.875rem;
    min-width: 0;
    flex: 1;
    padding: 4px 2px;
  }
  .bottom a span {
    font-size: 1.3rem;
  }
}
.contacts span:not(.hint) {
  padding: 8px 11px;
  background: #edf3f9;
  border-radius: 9px;
  font-size: 0.92rem;
}
