/* Kairo design tokens + styles (our own; Geist font, OFL). Light, fast, phone-first. */
@font-face {
  font-family: "Geist";
  src: url("/static/geist-regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Geist";
  src: url("/static/geist-bold.woff2") format("woff2");
  font-weight: 600 700;
  font-display: swap;
}

:root {
  --k-bg: #f7f7f5;
  --k-surface: #ffffff;
  --k-sunken: #f1f1ee;
  --k-ink: #15161a;
  --k-ink-2: #3c4049;
  --k-muted: #646a75;
  --k-line: #e3e4e8;
  --k-line-2: #d3d5db;
  --k-accent: #3d47d9;
  --k-accent-ink: #ffffff;
  --k-accent-soft: #eceefd;
  --k-good: #17784a;
  --k-good-soft: #e6f4ec;
  --k-warn: #96590a;
  --k-warn-soft: #fbf0de;
  --k-bad: #b4322a;
  --k-bad-soft: #fbe9e7;
  --k-radius: 10px;
  --k-radius-sm: 7px;
  --k-shadow:
    0 1px 2px rgba(20, 22, 30, 0.05), 0 4px 16px rgba(20, 22, 30, 0.05);
  --k-shadow-lg: 0 12px 48px rgba(20, 22, 30, 0.18);
  --k-font:
    "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    sans-serif;
  --k-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--k-bg);
  color: var(--k-ink);
  font: 15px/1.5 var(--k-font);
}
a {
  color: var(--k-accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
h1,
h2,
h3 {
  line-height: 1.2;
  margin: 0 0 0.5rem;
  letter-spacing: -0.01em;
}
h1 {
  font-size: 1.6rem;
}
h2 {
  font-size: 1.2rem;
}
h3 {
  font-size: 1rem;
}
p {
  margin: 0 0 0.75rem;
}
.muted {
  color: var(--k-muted);
}
.small {
  font-size: 0.85rem;
}
[hidden] {
  display: none !important;
}
:focus-visible {
  outline: 2px solid var(--k-accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* buttons + inputs */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 40px;
  padding: 0 16px;
  border-radius: var(--k-radius-sm);
  border: 1px solid var(--k-line-2);
  background: var(--k-surface);
  color: var(--k-ink);
  font: 600 0.95rem var(--k-font);
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover {
  background: var(--k-sunken);
  text-decoration: none;
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.btn-primary {
  background: var(--k-accent);
  border-color: var(--k-accent);
  color: var(--k-accent-ink);
}
.btn-primary:hover {
  background: #2f39c4;
}
.btn-danger {
  background: var(--k-bad);
  border-color: var(--k-bad);
  color: #fff;
}
.btn-danger:hover {
  background: #9a2a23;
}
.btn-ghost {
  border-color: transparent;
  background: transparent;
}
.btn-lg {
  min-height: 48px;
  padding: 0 22px;
  font-size: 1rem;
}
input[type="text"],
input[type="search"],
input[type="date"],
select {
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--k-line-2);
  border-radius: var(--k-radius-sm);
  background: var(--k-surface);
  color: var(--k-ink);
  font: 400 0.95rem var(--k-font);
  width: 100%;
}
label.check {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  cursor: pointer;
}
label.check input {
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  accent-color: var(--k-accent);
  flex: none;
}

/* layout */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(247, 247, 245, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--k-line);
}
.topbar-in {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--k-ink);
}
.brand:hover {
  text-decoration: none;
}
.logo {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: linear-gradient(135deg, #3d47d9, #7a5cf0);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}
.nav {
  display: flex;
  gap: 4px;
  margin-left: auto;
}
.nav a {
  padding: 6px 10px;
  border-radius: 6px;
  color: var(--k-ink-2);
  font-weight: 600;
  font-size: 0.92rem;
}
.nav a:hover {
  background: var(--k-sunken);
  text-decoration: none;
}
.nav a[aria-current="page"] {
  background: var(--k-accent-soft);
  color: var(--k-accent);
}
.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px 16px 64px;
}
.narrow {
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}
.card {
  background: var(--k-surface);
  border: 1px solid var(--k-line);
  border-radius: var(--k-radius);
  box-shadow: var(--k-shadow);
  padding: 20px;
}
.stack > * + * {
  margin-top: 16px;
}
.row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.spacer {
  flex: 1;
}

/* home */
.hero {
  min-height: calc(100vh - 56px);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 48px 16px;
}
.hero h1 {
  font-size: clamp(2rem, 6vw, 3.2rem);
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}
.hero p {
  font-size: 1.1rem;
  color: var(--k-muted);
  max-width: 520px;
  margin: 0 auto 28px;
}
.notice {
  max-width: 520px;
  margin: 0 auto 20px;
  padding: 10px 14px;
  border-radius: var(--k-radius-sm);
  background: var(--k-warn-soft);
  color: var(--k-warn);
}
.foot {
  text-align: center;
  color: var(--k-muted);
  font-size: 0.85rem;
  padding: 0 16px 32px;
}

/* consent + setup */
.lists {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.lists ul {
  margin: 0.25rem 0 0;
  padding-left: 1.1rem;
}
.box-good {
  background: var(--k-good-soft);
  border-radius: var(--k-radius-sm);
  padding: 12px 14px;
}
.box-bad {
  background: var(--k-bad-soft);
  border-radius: var(--k-radius-sm);
  padding: 12px 14px;
}
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
}
.step {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 12px;
  padding: 16px 0;
  border-top: 1px solid var(--k-line);
}
.step:first-child {
  border-top: 0;
}
.tick {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--k-line-2);
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--k-muted);
  background: var(--k-surface);
  cursor: pointer;
  font-size: 0.9rem;
}
.step.done .tick {
  background: var(--k-good);
  border-color: var(--k-good);
  color: #fff;
}
.step.done h3 {
  color: var(--k-muted);
}
.urlbox {
  display: flex;
  gap: 8px;
  margin: 8px 0;
}
.urlbox code {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  white-space: nowrap;
  padding: 9px 10px;
  background: var(--k-sunken);
  border: 1px solid var(--k-line);
  border-radius: var(--k-radius-sm);
  font: 0.88rem var(--k-mono);
}
.progress {
  height: 6px;
  background: var(--k-sunken);
  border-radius: 99px;
  overflow: hidden;
}
.progress > i {
  display: block;
  height: 100%;
  background: var(--k-good);
  transition: width 0.3s;
}
.empty {
  text-align: center;
  padding: 56px 20px;
}

/* today */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.stat {
  background: var(--k-surface);
  border: 1px solid var(--k-line);
  border-radius: var(--k-radius);
  padding: 16px;
}
.stat b {
  display: block;
  font-size: 1.9rem;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.stat span {
  color: var(--k-muted);
  font-size: 0.88rem;
}
.actions {
  list-style: none;
  margin: 0;
  padding: 0;
}
.actions li {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 4px;
  border-top: 1px solid var(--k-line);
  cursor: pointer;
}
.actions li:first-child {
  border-top: 0;
}
.actions li:hover {
  background: var(--k-sunken);
}
.actions .what {
  font-weight: 600;
}

/* chips */
.chip {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  border-radius: 99px;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--k-sunken);
  color: var(--k-ink-2);
  white-space: nowrap;
}
.v-apply {
  background: var(--k-good-soft);
  color: var(--k-good);
}
.v-maybe {
  background: var(--k-warn-soft);
  color: var(--k-warn);
}
.v-skip {
  background: var(--k-bad-soft);
  color: var(--k-bad);
}
.s-offer,
.s-interview {
  background: var(--k-accent-soft);
  color: var(--k-accent);
}
.fit {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

/* jobs table */
.filters {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--k-surface);
  border: 1px solid var(--k-line);
  border-radius: var(--k-radius);
  overflow: hidden;
}
.table th,
.table td {
  text-align: left;
  padding: 11px 12px;
  border-top: 1px solid var(--k-line);
  vertical-align: middle;
}
.table th {
  border-top: 0;
  font-size: 0.8rem;
  color: var(--k-muted);
  font-weight: 600;
  background: var(--k-sunken);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.table tbody tr {
  cursor: pointer;
}
.table tbody tr:hover {
  background: #fafaf8;
}
.table .co {
  font-weight: 600;
}
.count {
  color: var(--k-muted);
  font-size: 0.88rem;
  margin: 0 0 8px;
}

/* side panel */
.scrim {
  position: fixed;
  inset: 0;
  background: rgba(20, 22, 30, 0.32);
  z-index: 30;
}
.panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(560px, 100%);
  background: var(--k-surface);
  z-index: 31;
  box-shadow: var(--k-shadow-lg);
  display: flex;
  flex-direction: column;
}
.panel-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--k-line);
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.panel-body {
  padding: 16px 20px 40px;
  overflow-y: auto;
  flex: 1;
}
.panel section {
  padding: 14px 0;
  border-top: 1px solid var(--k-line);
}
.panel section:first-child {
  border-top: 0;
}
.kv {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 6px 12px;
  font-size: 0.92rem;
}
.kv dt {
  color: var(--k-muted);
}
.kv dd {
  margin: 0;
}
.statusform {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
}
.history {
  list-style: none;
  margin: 0;
  padding: 0;
}
.history li {
  display: flex;
  gap: 10px;
  padding: 6px 0;
  font-size: 0.92rem;
}
.history time {
  color: var(--k-muted);
  font-variant-numeric: tabular-nums;
  min-width: 92px;
}
.jd {
  white-space: pre-wrap;
  font-size: 0.9rem;
  color: var(--k-ink-2);
  max-height: 320px;
  overflow: hidden;
  position: relative;
}
.jd.open {
  max-height: none;
}
.flags {
  margin: 0;
  padding-left: 1.1rem;
}

/* dialog + toast */
dialog {
  border: 0;
  border-radius: var(--k-radius);
  padding: 0;
  box-shadow: var(--k-shadow-lg);
  width: min(440px, calc(100% - 32px));
}
dialog::backdrop {
  background: rgba(20, 22, 30, 0.4);
}
.dlg {
  padding: 20px;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: var(--k-ink);
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  z-index: 50;
  font-size: 0.92rem;
  max-width: calc(100% - 32px);
}

/* phone */
@media (max-width: 760px) {
  .wrap {
    padding-top: 16px;
  }
  .topbar-in {
    gap: 8px;
  }
  .nav a {
    padding: 6px 8px;
    font-size: 0.88rem;
  }
  .brand span.name {
    display: none;
  }
  .lists {
    grid-template-columns: 1fr;
  }
  .stats {
    grid-template-columns: 1fr 1fr;
  }
  .filters {
    grid-template-columns: 1fr 1fr;
  }
  .filters .search {
    grid-column: 1 / -1;
  }
  .table thead {
    display: none;
  }
  .table,
  .table tbody,
  .table tr,
  .table td {
    display: block;
    width: 100%;
  }
  .table tr {
    padding: 12px 14px;
    border-top: 1px solid var(--k-line);
  }
  .table tr:first-child {
    border-top: 0;
  }
  .table td {
    border: 0;
    padding: 2px 0;
  }
  .table td.hide-sm {
    display: none;
  }
  .table td.inline {
    display: inline-block;
    width: auto;
    margin-right: 8px;
  }
  .statusform {
    grid-template-columns: 1fr 1fr;
  }
  .statusform .btn {
    grid-column: 1 / -1;
  }
  .kv {
    grid-template-columns: 110px 1fr;
  }
}
#hint { margin-top: 14px; }
