:root {
  --paper: #f8f3f2;
  --card: #fffdf9;
  --ink: #2b2622;
  --muted: #8a8077;
  --line: #e7dfd3;
  --accent: #c23e63;
  --accent-soft: #f8e1e7;
  --ok: #4f7a5a;
  --ok-soft: #e3eee5;
  --warn: #b7862d;
  --warn-soft: #f6ecd8;
  --connection: #5b7fa6;
  --sensual: #8a3d79;
  --sexual: #d9485f;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(43, 38, 34, .06), 0 4px 14px rgba(43, 38, 34, .05);
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1c0f17; --card: #28161f; --ink: #f1ebe3; --muted: #a39a90;
    --line: #3d2531; --accent: #e2506a; --accent-soft: #3b1d2a; --ok: #7fb18b;
    --ok-soft: #233128; --warn: #d8ab55; --warn-soft: #362d1c;
    --connection: #85a8cf; --sensual: #c07ab0; --sexual: #e2506a;
    --shadow: none;
  }
}
* { box-sizing: border-box; }
input[type=range], input[type=checkbox] { accent-color: var(--accent); }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
}
a { color: var(--accent); text-decoration: none; }
h1 { font-family: Georgia, "Times New Roman", serif; font-weight: 600; font-size: 1.6rem; margin: 0 0 .25rem; }
h2 { font-size: 1.05rem; margin: 1.6rem 0 .6rem; }
h3 { font-size: 1rem; margin: 0 0 .3rem; }
p { margin: .3rem 0 .8rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.wrap { max-width: 640px; margin: 0 auto; padding: 16px; }

/* header */
.top { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 4px; max-width: 640px; margin: 0 auto; }
.brand { font-family: Georgia, serif; font-size: 1.25rem; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.brand img { width: 28px; height: 28px; border-radius: 7px; }
.bell { position: relative; font-size: 1.2rem; color: var(--ink); background: none; border: 0; padding: 6px; cursor: pointer; }
.bell .dot { position: absolute; top: 2px; right: 0; background: var(--accent); color: #fff; font-size: .65rem; border-radius: 99px; padding: 0 5px; line-height: 16px; }

/* bottom nav */
nav.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; background: var(--card);
  border-top: 1px solid var(--line); display: flex; justify-content: space-around;
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); z-index: 10;
}
nav.tabs a { flex: 1; text-align: center; color: var(--muted); font-size: .7rem; padding: 4px 0; }
nav.tabs a span { display: block; font-size: 1.3rem; line-height: 1.4; }
nav.tabs a.on { color: var(--accent); }
nav.tabs a.plus span { background: var(--accent); color: #fff; width: 44px; height: 44px; line-height: 44px; border-radius: 50%; margin: -14px auto 0; font-size: 1.6rem; box-shadow: var(--shadow); }

/* cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin: 10px 0; box-shadow: var(--shadow); }
.card.link { display: flex; gap: 12px; align-items: center; color: var(--ink); }
.card.link .grow { flex: 1; min-width: 0; }
.card.link .title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-badge { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 1.3rem; background: var(--paper); flex-shrink: 0; }
.stripe-connection { border-left: 4px solid var(--connection); }
.stripe-sensual { border-left: 4px solid var(--sensual); }
.stripe-sexual { border-left: 4px solid var(--sexual); }

.pill { display: inline-block; font-size: .72rem; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: var(--paper); color: var(--muted); white-space: nowrap; }
.pill.accent { background: var(--accent-soft); color: var(--accent); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.cat-connection { color: var(--connection); }
.cat-sensual { color: var(--sensual); }
.cat-sexual { color: var(--sexual); }

/* forms */
label { display: block; font-weight: 600; font-size: .9rem; margin: 14px 0 6px; }
input[type=text], input[type=email], input[type=password], input[type=datetime-local],
input[type=number], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--card);
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px;
}
textarea { min-height: 88px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.btn {
  display: inline-block; font: inherit; font-weight: 600; border: 0; border-radius: 10px;
  padding: 11px 18px; background: var(--accent); color: #fff; cursor: pointer; text-align: center;
}
.btn.block { display: block; width: 100%; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.ok { background: var(--ok); }
.btn.small { padding: 6px 12px; font-size: .85rem; }
.btn.danger { background: #a3263f; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.row > * { flex: 1; }
form.inline { display: inline; }

/* segmented choice */
.choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.choices.two { grid-template-columns: repeat(2, 1fr); }
.choices.four { grid-template-columns: repeat(4, 1fr); }
.choices input { position: absolute; opacity: 0; pointer-events: none; }
.choices label { margin: 0; font-weight: 500; text-align: center; border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 10px 6px; cursor: pointer; font-size: .85rem; }
.choices label b { display: block; font-size: 1.3rem; }
.choices input:checked + label { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { font: inherit; font-size: .85rem; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 99px; padding: 5px 12px; cursor: pointer; }
.chips button.mutual { border-color: var(--ok); }
.chips button.on { background: var(--accent); border-color: var(--accent); color: #fff; }

.flash { background: var(--ink); color: var(--paper); border-radius: 10px; padding: 10px 14px; margin: 10px 0; font-size: .92rem; }
.empty { text-align: center; color: var(--muted); padding: 22px 10px; border: 1px dashed var(--line); border-radius: var(--radius); }

/* calendar */
.cal-head { display: flex; justify-content: space-between; align-items: center; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; margin-top: 10px; }
.cal .dow { text-align: center; font-size: .7rem; color: var(--muted); padding-bottom: 4px; }
.cal .day { min-height: 58px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 3px; font-size: .75rem; }
.cal .day.out { opacity: .4; }
.cal .day.today { border-color: var(--accent); }
.cal .day .n { color: var(--muted); }
.cal .day a { display: block; font-size: .95rem; line-height: 1.2; }

/* yes/no/maybe */
.rate { display: flex; align-items: center; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.rate .name { flex: 1; }
.ynm { display: flex; gap: 4px; }
.ynm input { position: absolute; opacity: 0; pointer-events: none; }
.ynm label { margin: 0; font-size: .8rem; font-weight: 600; border: 1px solid var(--line); border-radius: 8px; padding: 5px 9px; cursor: pointer; color: var(--muted); }
.ynm input[value=yes]:checked + label { background: var(--ok); color: #fff; border-color: var(--ok); }
.ynm input[value=maybe]:checked + label { background: var(--warn); color: #fff; border-color: var(--warn); }
.ynm input[value=no]:checked + label { background: var(--muted); color: #fff; border-color: var(--muted); }
.subtabs { display: flex; gap: 6px; margin: 12px 0; }
.subtabs a { flex: 1; text-align: center; padding: 8px; border-radius: 10px; border: 1px solid var(--line); color: var(--ink); font-weight: 600; font-size: .9rem; }
.subtabs a.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* stats */
.bars { display: flex; align-items: flex-end; gap: 4px; height: 140px; margin-top: 12px; }
.bars .col { flex: 1; display: flex; flex-direction: column-reverse; gap: 2px; height: 100%; position: relative; }
.bars .seg { border-radius: 3px; }
.bars .lbl { position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%); font-size: .6rem; color: var(--muted); white-space: nowrap; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 28px; font-size: .85rem; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; }
.balance { display: flex; height: 14px; border-radius: 99px; overflow: hidden; background: var(--line); margin: 10px 0; }
.big { font-size: 2rem; font-weight: 700; font-family: Georgia, serif; }

.quote { font-family: Georgia, serif; font-size: 1.05rem; border-left: 3px solid var(--accent); padding-left: 12px; margin: 8px 0; white-space: pre-wrap; }
.copy { display: flex; gap: 6px; }
.copy input { font-size: .8rem; }
details summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
.lock-screen { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.lock-screen .box { width: 100%; max-width: 380px; }
.logo-big { text-align: center; margin-bottom: 20px; }
.logo-big img { width: 72px; height: 72px; border-radius: 18px; }

/* welcome: icon picker */
.icon-pick label { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 6px; }
.icon-pick img { width: 64px; height: 64px; border-radius: 15px; }
.icon-pick span { font-weight: 600; }
.icon-pick small { font-size: .72rem; color: var(--muted); }
[hidden] { display: none !important; }
.reasons { display: grid; gap: 8px; margin-top: 10px; }
.reasons label { margin: 0; font-weight: 500; display: flex; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; background: var(--card); }
.reasons input { width: auto; accent-color: var(--accent); }
.quick { display: flex; gap: 8px; margin: -4px 0 12px; }
.quick > * { flex: 1; }
.promise { display: grid; grid-template-columns: repeat(4, 1fr); text-align: center; gap: 4px; margin-top: 8px; }
.promise b { display: block; font-size: 1.3rem; font-family: Georgia, serif; }
.promise span { font-size: .72rem; color: var(--muted); }
.rate-bar { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; margin: 8px 0 2px; }
.rate-bar i { display: block; height: 100%; background: var(--ok); }

/* our week */
.week-card h3 { margin: 0; }
.wk-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.wk-row:last-of-type { border-bottom: 0; }
.week-card > a.small { display: inline-block; margin-top: 6px; }
.spark-text { font-family: Georgia, serif; font-size: 1.02rem; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.spark-big { font-family: Georgia, serif; font-size: 1.35rem; line-height: 1.4; margin: 10px 0; white-space: pre-wrap; }
.stepper { display: flex; align-items: center; gap: 10px; }
.stepper button { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font-size: 1.2rem; cursor: pointer; }
.stepper input { width: 56px; text-align: center; }
.step-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); gap: 10px; }
.hist { display: flex; gap: 6px; margin-top: 8px; }
.hist span { flex: 1; text-align: center; padding: 6px 0; border-radius: 8px; font-size: .75rem; background: var(--paper); color: var(--muted); }
.hist span.ok { background: var(--ok-soft); color: var(--ok); font-weight: 600; }
.hist span.light { background: var(--line); }
.day-free { margin: 14px 0 6px; font-weight: 600; }
.slots { display: flex; flex-wrap: wrap; gap: 6px; }
.slots a { border: 1px solid var(--ok); color: var(--ok); background: var(--ok-soft); border-radius: 10px; padding: 7px 11px; font-size: .88rem; font-weight: 600; }
.conflict { font-size: .85rem; margin-top: 6px; }
.conflict.bad { color: var(--warn); }
.conflict.good { color: var(--ok); }
.wk-row .grow { flex: 1; min-width: 0; }
