:root {
  font-family: var(--font-body);
  color: var(--color-accent-strong);
  background: var(--color-paper);
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  outline-offset: 4px;
}
button,
a {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
a {
  color: inherit;
}
button {
  border: 0;
  background: transparent;
  color: inherit;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-family: var(--font-display);
  font-size: clamp(36px, 4.8vw, 64px);
  line-height: 1.08;
  font-weight: 400;
  letter-spacing: -2px;
}
h2 {
  font-size: var(--text-lg);
  font-weight: 600;
  letter-spacing: -0.5px;
}
h3 {
  font-size: var(--text-lg);
  font-weight: 600;
}
.shell {
  max-width: 1320px;
  margin: auto;
  padding: 0 48px;
}
.header {
  height: 95px;
  display: flex;
  align-items: center;
  gap: 40px;
  border-bottom: 1px solid var(--line);
}
.brand {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  letter-spacing: -1px;
  display: flex;
  gap: 10px;
  align-items: center;
}
.brand-icon {
  display: inline-flex;
  border: 1.5px solid var(--green);
  width: 29px;
  height: 29px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-size: var(--text-xl);
  font-weight: 300;
}
.nav {
  display: flex;
  gap: 8px;
  margin: auto;
}
.nav button {
  padding: 12px 17px;
  border-radius: var(--radius-pill);
  color: var(--muted);
  font-size: var(--text-sm);
}
.nav button.active {
  background: var(--color-accent-soft);
  color: var(--green);
  font-weight: 600;
}
.avatar {
  background: var(--color-you-soft);
  border-radius: 50%;
  width: 37px;
  height: 37px;
  display: grid;
  place-items: center;
  font-size: var(--text-sm);
  font-weight: 650;
}
.account {
  display: flex;
  gap: 12px;
  align-items: center;
}
.text-button {
  font-size: var(--text-sm);
  color: var(--muted);
  text-decoration: underline;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: var(--text-2xs);
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 20px;
}
.hero {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  align-items: center;
  gap: 36px;
  padding: 52px 0 42px;
}
.hero p {
  color: var(--muted);
  max-width: 440px;
  line-height: 1.7;
  font-size: var(--text-base);
}
.hero h1 {
  margin-bottom: 20px;
}
.route-art {
  position: relative;
  min-height: 250px;
  background: var(--color-accent-soft);
  border-radius: 140px 18px 140px 18px;
  overflow: hidden;
  display: grid;
  place-items: center;
}
.route-art svg {
  width: 100%;
  height: 250px;
}
.route-label {
  position: absolute;
  bottom: 20px;
  right: 30px;
  font-size: var(--text-2xs);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--color-muted);
}
.primary {
  background: var(--green);
  color: var(--color-surface);
  padding: 13px 21px;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 600;
  min-height: 44px;
}
.secondary {
  border: 1px solid var(--line);
  background: var(--color-surface);
  padding: 11px 17px;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  min-height: 44px;
}
.danger {
  color: var(--color-danger);
}
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 25px 0;
}
.toolbar h2 {
  margin: 0;
}
.tabs {
  display: flex;
  gap: 8px;
}
.pill {
  padding: 9px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  background: transparent;
  min-height: 38px;
}
.pill.selected {
  background: var(--green);
  border-color: var(--green);
  color: var(--color-surface);
}
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.card {
  background: var(--color-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.city-art {
  height: 122px;
  background: var(--color-accent-soft);
  position: relative;
  overflow: hidden;
  padding: 23px;
}
.city-art:before {
  content: '';
  position: absolute;
  width: 130px;
  height: 130px;
  border: 1px solid var(--color-muted);
  border-radius: 50%;
  right: 25px;
  top: 20px;
  box-shadow:
    0 0 0 16px var(--color-line),
    0 0 0 17px var(--color-line-strong),
    0 0 0 40px var(--color-accent-soft),
    0 0 0 41px var(--color-line-strong);
}
.city-art:after {
  content: '↗';
  position: absolute;
  bottom: 11px;
  right: 31px;
  font-size: var(--text-4xl);
  color: var(--color-muted);
  font-family: var(--font-display);
}
.city-art.sand {
  background: var(--color-you-soft);
}
.city-art.sand:before {
  border-color: var(--color-line-strong);
  box-shadow:
    0 0 0 16px var(--color-you-soft),
    0 0 0 17px var(--color-line-strong),
    0 0 0 40px var(--color-you-soft),
    0 0 0 41px var(--color-line-strong);
}
.city-code {
  font-size: var(--text-xs);
  letter-spacing: 3px;
  font-weight: 700;
  position: relative;
  z-index: 1;
}
.card-body {
  padding: 22px;
}
.card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.card h3 {
  margin: 0 0 5px;
}
.muted {
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.6;
}
.badge {
  font-size: 10px;
  font-weight: 650;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  background: var(--color-accent-soft);
  color: var(--color-accent);
  white-space: nowrap;
}
.badge.tentative {
  background: var(--color-you-soft);
  color: var(--color-you);
}
.dates {
  font-size: var(--text-sm);
  margin: 22px 0 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--color-sunk);
  padding-top: 16px;
}
.visibility {
  font-size: var(--text-2xs);
  color: var(--muted);
}
.icon-btn {
  padding: 9px;
  font-size: var(--text-xs);
  min-height: 38px;
  border-radius: var(--radius-sm);
}
.icon-btn:hover {
  background: var(--color-paper);
}
.note {
  font-size: var(--text-sm);
  line-height: 1.6;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.empty {
  border: 1px dashed var(--color-line-strong);
  background: var(--color-paper);
  border-radius: var(--radius-md);
  padding: 55px 25px;
  text-align: center;
  grid-column: 1/-1;
}
.empty h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--text-2xl);
}
.empty p {
  max-width: 480px;
  margin: 0 auto 22px;
  color: var(--muted);
  line-height: 1.7;
}
.aside-note {
  margin: 30px 0;
  background: var(--color-accent-soft);
  border-radius: var(--radius-md);
  padding: 22px 25px;
  display: flex;
  gap: 17px;
  align-items: center;
}
.aside-note p {
  margin: 0;
  font-size: var(--text-sm);
  line-height: 1.7;
  color: var(--color-muted);
}
.aside-note b {
  color: var(--green);
}
.footer {
  padding: 30px 0;
  margin-top: 45px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 20px;
  font-size: var(--text-2xs);
  color: var(--muted);
}
.local-banner {
  background: var(--color-you-soft);
  text-align: center;
  font-size: var(--text-2xs);
  padding: 8px 16px;
  color: var(--color-muted);
}
.loading {
  padding: 60px;
  text-align: center;
}
.auth-layout {
  min-height: calc(100vh - 150px);
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 10%;
  align-items: center;
  padding: 40px 0;
}
.auth-copy h1 {
  font-size: clamp(40px, 5vw, 72px);
}
.auth-copy p {
  line-height: 1.8;
  color: var(--muted);
}
.auth-card {
  background: var(--color-surface);
  padding: 35px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  max-width: 430px;
  width: 100%;
}
.auth-card h2 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 400;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 18px;
}
.field label,
fieldset legend {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-ink-2);
}
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 12px 11px;
  border: 1px solid var(--color-accent-tint);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-accent-strong);
  min-height: 44px;
}
.field textarea {
  resize: vertical;
  min-height: 85px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.full {
  width: 100%;
}
.form-error {
  color: var(--color-danger);
  font-size: var(--text-sm);
  line-height: 1.5;
  min-height: 1px;
}
.auth-switch {
  margin: 22px 0 0;
  font-size: var(--text-xs);
  text-align: center;
}
.auth-switch button {
  text-decoration: underline;
  font-weight: 600;
}
dialog {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  max-width: 540px;
  width: calc(100% - 32px);
  padding: 30px;
  color: var(--color-accent-strong);
  max-height: 90vh;
  overflow: auto;
}
dialog::backdrop {
  background: color-mix(in srgb, var(--color-accent-strong) 40%, transparent);
  backdrop-filter: blur(3px);
}
.modal-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.modal-top h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--text-2xl);
  margin: 0;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}
.help {
  font-size: var(--text-2xs);
  color: var(--muted);
  line-height: 1.6;
  margin: 0 0 18px;
}
.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: var(--text-sm);
  line-height: 1.6;
  margin: 12px 0;
}
.check input {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: var(--green);
}
fieldset {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 20px;
}
.panel {
  padding: 25px;
  background: var(--color-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  margin: 20px 0;
}
.agent-row {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 15px;
  justify-content: space-between;
  align-items: center;
}
.agent-row:last-child {
  border: 0;
}
.agent-row p {
  margin: 4px 0;
}
.two-col {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 24px;
}
.audit {
  list-style: none;
  padding: 0;
  margin: 0;
}
.audit li {
  font-size: var(--text-xs);
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  line-height: 1.6;
}
.audit time {
  display: block;
  color: var(--muted);
  font-size: var(--text-2xs);
}
.token {
  font-family: var(--font-mono);
  overflow-wrap: anywhere;
  background: var(--color-paper);
  padding: 15px;
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
}
.overlap {
  display: flex;
  gap: 18px;
  align-items: center;
  padding: 25px;
}
.overlap-icon {
  background: var(--color-accent-soft);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: var(--text-xl);
  flex-shrink: 0;
}
.overlap h3 {
  font-size: var(--text-md);
  margin-bottom: 5px;
}
.overlap p {
  margin: 3px 0;
}
.demo-label {
  padding: 12px 18px;
  border: 1px solid var(--color-line-strong);
  background: var(--color-you-soft);
  border-radius: var(--radius-md);
  color: var(--color-muted);
  font-size: var(--text-xs);
  margin-bottom: 20px;
}
#toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  padding: 14px 22px;
  background: var(--color-accent-strong);
  color: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: 0 6px 25px color-mix(in srgb, var(--color-ink) 20%, transparent);
  font-size: var(--text-sm);
  z-index: 20;
  display: none;
  max-width: 90vw;
}
#toast.visible {
  display: block;
}
.statusline {
  font-size: var(--text-xs);
  color: var(--muted);
  margin: 20px 0;
}
.section-intro {
  padding: 45px 0 5px;
}
.section-intro h1 {
  font-size: var(--text-3xl);
  margin: 0 0 17px;
}
.section-intro p {
  color: var(--muted);
  line-height: 1.7;
  max-width: 630px;
}
.link-button {
  text-decoration: underline;
  font-size: var(--text-xs);
  color: var(--green);
  padding: 9px 0;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
@media (max-width: 900px) {
  .shell {
    padding: 0 24px;
  }
  .header {
    gap: 12px;
  }
  .nav button {
    padding: 10px;
  }
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .hero {
    gap: 20px;
  }
  .two-col {
    grid-template-columns: 1fr;
  }
  .auth-layout {
    gap: 35px;
  }
  .auth-card {
    padding: 25px;
  }
  .brand {
    font-size: var(--text-xl);
  }
}
@media (max-width: 620px) {
  .shell {
    padding: 0 18px;
  }
  .header {
    height: auto;
    padding: 19px 0 12px;
    flex-wrap: wrap;
    justify-content: space-between;
  }
  .brand {
    font-size: var(--text-xl);
  }
  .nav {
    order: 3;
    width: 100%;
    justify-content: center;
    margin: 5px 0 0;
  }
  .nav button {
    flex: 1;
  }
  .account {
    margin-left: auto;
  }
  .hero {
    display: block;
    padding: 35px 0 20px;
  }
  .hero h1 {
    font-size: var(--text-3xl);
  }
  .route-art {
    display: none;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .toolbar {
    flex-wrap: wrap;
    margin-top: 20px;
  }
  .tabs {
    width: 100%;
    overflow: auto;
  }
  .card-body {
    padding: 20px;
  }
  .city-art {
    height: 95px;
  }
  .auth-layout {
    grid-template-columns: 1fr;
    padding: 38px 0;
  }
  .auth-copy h1 {
    font-size: var(--text-3xl);
  }
  .auth-copy p {
    font-size: var(--text-sm);
  }
  .auth-card {
    max-width: 100%;
  }
  .form-row {
    gap: 10px;
  }
  .footer {
    flex-direction: column;
    gap: 8px;
  }
  .aside-note {
    align-items: flex-start;
    padding: 18px;
  }
  .panel {
    padding: 18px;
  }
  .agent-row {
    align-items: flex-start;
  }
  .section-intro h1 {
    font-size: var(--text-3xl);
  }
  dialog {
    padding: 23px;
  }
  .overlap {
    padding: 20px;
  }
  .local-banner {
    line-height: 1.5;
  }
  .hero p {
    font-size: var(--text-sm);
  }
  .avatar {
    display: none;
  }
}
@media (prefers-reduced-motion: no-preference) {
  button {
    transition:
      background 0.15s,
      transform 0.15s;
  }
  .primary:hover {
    background: var(--color-accent);
  }
  .card {
    animation: appear 0.25s ease-out;
  }
  @keyframes appear {
    from {
      opacity: 0;
      transform: translateY(5px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

.brand {
  text-decoration: none;
}
.route-label {
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 10px;
}
.auth-card > .help {
  margin-top: 22px;
}
.field {
  min-width: 0;
}

.home-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding: 22px 24px;
  background: var(--color-sunk);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  margin-bottom: 18px;
}
.home-strip .eyebrow {
  margin: 0 0 8px;
  font-size: 10px;
}
.home-strip h2 {
  margin: 0 0 6px;
  font-size: var(--text-lg);
}
.home-strip .help {
  margin: 0;
}
.home-strip .link-button {
  padding: 7px 0;
  min-height: 44px;
}
.presence-check {
  border-left: 1px solid var(--line);
  padding-left: 24px;
}
.presence-check label {
  display: block;
  font-size: var(--text-xs);
  font-weight: 600;
  margin-bottom: 8px;
}
.presence-check input {
  display: block;
  max-width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  background: var(--color-surface);
  border: 1px solid var(--color-line-strong);
  border-radius: var(--radius-sm);
  color: inherit;
}
.presence-check p {
  margin: 10px 0 0;
  font-size: var(--text-sm);
  line-height: 1.6;
}
.window-form {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  flex-wrap: wrap;
  padding: 20px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  margin: 20px 0;
}
.window-form .field {
  margin: 0;
  flex: 1;
  min-width: 160px;
}
.window-form .help,
.window-form .form-error {
  width: 100%;
  margin: 0;
}
.window-form .form-error:empty {
  display: none;
}
.badge.assumed {
  background: var(--color-sunk);
  color: var(--color-ink-2);
}
@media (max-width: 620px) {
  .home-strip {
    grid-template-columns: 1fr;
    padding: 18px;
    gap: 18px;
  }
  .presence-check {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 16px 0 0;
  }
  .presence-check input {
    width: 100%;
    font-size: var(--text-base);
  }
  .window-form {
    padding: 18px;
    gap: 12px;
  }
  .window-form .field {
    min-width: 100%;
  }
  .window-form button {
    width: 100%;
  }
}
/* Workspace: quiet surfaces, explicit state, one primary page action. */
:root {
  color: var(--color-ink);
  background: var(--color-paper);
}
:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 4px;
}
.skip-link {
  position: fixed;
  left: 16px;
  top: 12px;
  z-index: 50;
  background: var(--color-surface);
  padding: 14px;
  border: 2px solid var(--green);
  border-radius: var(--radius-sm);
  opacity: 0;
  pointer-events: none;
}
.skip-link:focus {
  opacity: 1;
  pointer-events: auto;
}
#main:focus {
  outline: none;
}
.shell {
  max-width: 1240px;
}
.header {
  height: 86px;
  gap: 28px;
}
.nav button {
  min-height: 44px;
  border-radius: var(--radius-sm);
}
.nav button.active {
  background: var(--color-accent-soft);
  box-shadow: inset 0 -2px var(--green);
}
.text-button,
.link-button,
.icon-btn,
.pill {
  min-height: 44px;
}
.icon-btn {
  min-width: 44px;
}
.text-button {
  padding: 8px;
}
.primary:hover {
  background: var(--color-accent-strong);
}
.secondary:hover {
  background: var(--color-paper);
}
.workspace-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 38px 0 26px;
}
.workspace-heading .eyebrow {
  margin-bottom: 10px;
  letter-spacing: 1.5px;
}
.workspace-heading h1,
.section-intro h1 {
  font-family: inherit;
  font-size: var(--text-3xl);
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -1.4px;
  margin: 0 0 10px;
}
.workspace-heading p {
  margin-bottom: 0;
  font-size: var(--text-sm);
}
.workspace-heading .primary {
  flex-shrink: 0;
}
.plan-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 0 0 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}
.plan-summary > div {
  padding: 19px 24px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.plan-summary > div:last-child {
  border-right: 0;
}
.plan-summary dt {
  font-size: var(--text-xs);
  color: var(--muted);
}
.plan-summary dd {
  margin: 0;
  font-size: var(--text-xl);
  line-height: 1.2;
  letter-spacing: -1px;
  font-weight: 550;
}
.toolbar {
  margin: 22px 0 16px;
}
.toolbar h2 {
  font-size: var(--text-md);
  letter-spacing: -0.25px;
}
.count {
  display: inline-grid;
  place-items: center;
  min-width: 25px;
  height: 25px;
  padding: 0 7px;
  margin-left: 7px;
  border-radius: var(--radius-sm);
  background: var(--color-accent-soft);
  font-size: var(--text-xs);
  color: var(--muted);
}
.tabs {
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--color-paper);
}
.pill {
  border: 0;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  padding: 9px 16px;
}
.pill.selected {
  background: var(--color-surface);
  color: var(--color-accent-strong);
  box-shadow: 0 1px 4px color-mix(in srgb, var(--color-ink) 10%, transparent);
}
.grid {
  gap: 18px;
}
.card {
  border-radius: var(--radius-md);
  box-shadow: 0 2px 5px color-mix(in srgb, var(--color-accent-strong) 2%, transparent);
}
.city-art {
  height: 64px;
  padding: 20px;
  background: var(--color-accent-soft);
}
.city-art:before {
  width: 100px;
  height: 100px;
  right: 25px;
  top: 12px;
}
.city-art:after {
  font-size: var(--text-3xl);
  bottom: -3px;
  right: 40px;
}
.city-code {
  font-size: var(--text-2xs);
  letter-spacing: 2px;
}
.card-body {
  padding: 22px;
}
.card h3 {
  font-size: var(--text-xl);
  letter-spacing: -0.5px;
}
.badge {
  font-size: var(--text-2xs);
  line-height: 1.5;
  border-radius: var(--radius-sm);
}
.badge.tentative {
  color: var(--color-you);
  background: var(--color-you-soft);
}
.badge.confirmed {
  color: var(--color-accent);
  background: var(--color-accent-soft);
}
.dates {
  font-size: var(--text-sm);
  line-height: 1.6;
  margin: 21px 0;
}
.card-footer {
  padding-top: 10px;
}
.visibility {
  font-size: var(--text-xs);
}
.aside-note {
  background: transparent;
  border: 1px solid var(--line);
  margin-top: 25px;
  padding: 17px 20px;
}
.aside-note p {
  color: var(--muted);
  font-size: var(--text-xs);
}
.aside-note b {
  color: var(--color-ink-2);
}
.footer {
  margin-top: 35px;
}
.section-intro {
  padding-top: 38px;
}
.section-intro .eyebrow {
  margin-bottom: 10px;
}
.section-intro p {
  font-size: var(--text-sm);
}
.help {
  font-size: var(--text-xs);
  line-height: 1.65;
}
.field label,
fieldset legend {
  font-size: var(--text-sm);
}
.field input,
.field select,
.field textarea {
  font-size: var(--text-base);
}
.modal-top h2 {
  font-family: inherit;
  font-size: var(--text-xl);
  font-weight: 600;
  letter-spacing: -0.7px;
}
.empty h3 {
  font-family: inherit;
  font-size: var(--text-lg);
  font-weight: 550;
  letter-spacing: -0.4px;
}
.empty {
  background: var(--color-paper);
  padding: 45px 25px;
}
.empty p {
  font-size: var(--text-sm);
}
.overlap h3 {
  font-size: var(--text-md);
}
.audit li {
  padding: 16px 0;
}
.form-error:not(:empty) {
  background: var(--color-danger-soft);
  border-left: 3px solid var(--color-danger);
  padding: 12px;
  border-radius: var(--radius-sm);
}
.loading {
  color: var(--muted);
}
@media (max-width: 900px) {
  .header {
    gap: 12px;
  }
  .nav {
    gap: 3px;
  }
  .shell {
    padding: 0 24px;
  }
}
@media (max-width: 620px) {
  .shell {
    padding: 0 18px;
  }
  .header {
    height: auto;
    padding: 16px 0 10px;
  }
  .nav {
    margin-top: 8px;
  }
  .nav button {
    font-size: var(--text-sm);
    padding: 10px 8px;
  }
  .workspace-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 20px;
    padding: 28px 0 22px;
  }
  .workspace-heading h1,
  .section-intro h1 {
    font-size: var(--text-2xl);
  }
  .workspace-heading .primary {
    width: 100%;
  }
  .workspace-heading .eyebrow {
    font-size: 10px;
  }
  .workspace-heading p {
    font-size: var(--text-sm);
    line-height: 1.6;
  }
  .plan-summary {
    margin-bottom: 24px;
  }
  .plan-summary > div {
    padding: 14px 12px;
    gap: 8px;
  }
  .plan-summary dt {
    font-size: var(--text-2xs);
  }
  .plan-summary dd {
    font-size: var(--text-xl);
  }
  .toolbar {
    margin: 20px 0 14px;
    gap: 12px;
  }
  .tabs {
    width: auto;
    max-width: 100%;
    margin-left: auto;
  }
  .pill {
    padding: 8px 12px;
  }
  .card-body {
    padding: 20px;
  }
  .city-art {
    height: 58px;
  }
  .aside-note {
    padding: 16px;
  }
  .footer {
    margin-top: 25px;
  }
  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .field select,
  .field input,
  .field textarea {
    font-size: var(--text-base);
  }
  .modal-actions {
    position: sticky;
    bottom: -23px;
    background: var(--color-surface);
    padding: 14px 0 4px;
    margin-top: 10px;
    border-top: 1px solid var(--line);
  }
  .modal-actions button {
    flex: 1;
  }
  .modal-top h2 {
    font-size: var(--text-xl);
  }
  .section-intro {
    padding-top: 28px;
  }
  .panel .toolbar {
    align-items: flex-start;
  }
  .local-banner {
    font-size: 10px;
  }
  .auth-card {
    padding: 24px;
  }
  .auth-copy h1 {
    font-size: var(--text-3xl);
  }
}

.friends-grid .agent-row {
  flex-wrap: wrap;
  overflow-wrap: anywhere;
}
.friends-grid .agent-row > div:last-child {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.friends-grid hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 28px 0;
}
.friends-grid #friend-name {
  margin-top: 20px;
}
/* Destination map and calendar */
.destination-search label {
  display: block;
  font-size: var(--text-xs);
  font-weight: 600;
  margin-bottom: 7px;
}
.destination-search input {
  margin-bottom: 6px;
}
.destination-search .help {
  margin-bottom: 4px;
}
.map-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 25px;
  background: var(--color-surface);
  margin: 25px 0 30px;
}
.map-panel .toolbar {
  margin-top: 0;
}
.map-panel .eyebrow {
  margin-bottom: 8px;
}
.map-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 0;
}
.map-controls .pill {
  background: var(--color-surface);
  min-width: 40px;
}
.destination-map {
  display: block;
  width: 100%;
  height: 340px;
  background: var(--color-paper);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  cursor: crosshair;
}
.map-land path {
  fill: var(--color-line);
  stroke: var(--color-line-strong);
  stroke-width: 0.35;
  vector-effect: non-scaling-stroke;
}
.map-states path {
  fill: var(--color-accent-tint);
  stroke: var(--color-line-strong);
  stroke-width: 0.65;
  vector-effect: non-scaling-stroke;
}
.map-point circle {
  fill: var(--color-accent);
  stroke: var(--color-surface);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}
.map-point .marker-halo {
  fill: var(--color-line-strong);
  stroke: none;
  opacity: 0.6;
}
.map-point.private-pin circle {
  fill: var(--color-you);
}
.map-point {
  cursor: pointer;
}
.map-point:focus circle {
  stroke: var(--color-you);
  stroke-width: 4;
}
.map-credit {
  margin-top: 10px;
}
.map-point-detail {
  font-size: var(--text-sm);
  min-height: 22px;
}
.map-people {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}
.map-people p {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  font-size: var(--text-sm);
}
.map-people span {
  display: block;
  color: var(--muted);
  line-height: 1.6;
  margin-top: 5px;
}
.private-pin-panel {
  border-top: 1px solid var(--line);
  padding-top: 18px;
}
.private-pin-panel summary {
  cursor: pointer;
  font-weight: 600;
  margin-bottom: 15px;
}
.private-pin-panel .agent-row {
  flex-wrap: wrap;
  overflow-wrap: anywhere;
}
.private-pin-panel .agent-row > div:last-child {
  display: flex;
  gap: 8px;
}
.pin-dialog {
  max-width: 820px;
}
.pin-dialog .destination-map {
  height: 260px;
}
.calendar-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 25px 0;
}
.calendar-toolbar .field {
  margin: 0;
}
.calendar-key {
  font-size: var(--text-xs);
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.place-dot,
.state-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-accent);
  display: inline-block;
}
.state-dot {
  background: var(--color-you);
  margin-left: 15px;
}
.calendar {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-surface);
}
.calendar-week,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}
.calendar-week {
  background: var(--color-accent-soft);
  text-align: center;
  padding: 12px 0;
  font-size: var(--text-xs);
  font-weight: 600;
}
.calendar-day {
  min-height: 112px;
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 10px;
  border: 0;
  border-top: 1px solid var(--line);
  border-right: 1px solid var(--line);
  border-radius: 0;
  min-width: 0;
}
.calendar-day:nth-child(7n) {
  border-right: 0;
}
.calendar-day.outside {
  background: var(--color-paper);
  opacity: 0.5;
}
.day-number {
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: 7px;
}
.day-event {
  font-size: var(--text-2xs);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: var(--color-accent-soft);
  color: var(--color-accent);
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  margin: 2px 0;
}
.day-event.state {
  background: var(--color-you-soft);
  color: var(--color-you);
}
.day-more {
  font-size: 10px;
  margin-top: 3px;
}
.mobile-count {
  display: none;
}
.calendar-day[aria-pressed='true'] {
  background: var(--color-paper);
  box-shadow: inset 0 0 0 2px var(--color-accent);
}
.calendar-day:hover:not(:disabled) {
  background: var(--color-paper);
}
.calendar-match {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 24px;
  background: var(--color-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  margin: 12px 0;
}
.calendar-match h3 {
  margin: 0 0 7px;
}
.calendar-match p {
  font-size: var(--text-sm);
  color: var(--muted);
  line-height: 1.6;
  margin: 5px 0;
}
.match-kind {
  background: var(--color-accent-soft);
  color: var(--color-accent);
  border-radius: var(--radius-lg);
  white-space: nowrap;
  padding: 7px 12px;
  font-size: var(--text-2xs);
}
.match-kind.state {
  background: var(--color-you-soft);
  color: var(--color-you);
}
.calendar-day:disabled {
  cursor: default;
}
@media (max-width: 620px) {
  .map-panel {
    padding: 16px;
  }
  .destination-map {
    height: 250px;
  }
  .map-panel .toolbar {
    align-items: flex-start;
  }
  .map-panel h2 {
    font-size: var(--text-lg);
  }
  .calendar-toolbar {
    gap: 8px;
  }
  .calendar-day {
    min-height: 66px;
    padding: 6px;
  }
  .day-event,
  .day-more {
    display: none;
  }
  .mobile-count {
    display: inline-block;
    background: var(--color-accent-soft);
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    padding: 3px;
    text-align: center;
  }
  .calendar-day.has-events .day-number {
    color: var(--color-accent);
  }
  .calendar-match {
    flex-direction: column;
    gap: 12px;
    padding: 18px;
  }
  .calendar-week {
    font-size: 10px;
  }
  .calendar-key {
    line-height: 1.6;
  }
  .pin-dialog .destination-map {
    height: 220px;
  }
}

.mobile-count.state {
  background: var(--color-you-soft);
  color: var(--color-you);
}

/* Elsewhere workspace system: neutral surfaces, purposeful green, stable navigation. */
:root {
  color: var(--ink);
  background: var(--canvas);
}
body {
  font-size: var(--text-sm);
  line-height: 1.5;
}
h1,
h2,
h3 {
  color: var(--ink);
}
.shell {
  max-width: 1440px;
  padding: 0 40px;
}
.brand {
  font-family: inherit;
  font-size: var(--text-xl);
  font-weight: 650;
  letter-spacing: -1.2px;
}
.brand-icon {
  background: var(--color-accent-tint);
  border: 0;
  border-radius: var(--radius-md);
  width: 32px;
  height: 32px;
  color: var(--color-accent-strong);
}
.header {
  height: 80px;
}
.nav button {
  font-weight: 550;
}
.nav button.active {
  background: var(--color-accent-soft);
  box-shadow: none;
}
.avatar {
  background: var(--color-accent-soft);
  border-radius: var(--radius-md);
}
.text-button {
  text-decoration: none;
}
.workspace-heading,
.section-intro {
  padding-top: 32px;
}
.workspace-heading h1,
.section-intro h1 {
  font-size: var(--text-2xl);
  letter-spacing: -1px;
}
.eyebrow {
  letter-spacing: 1.2px;
  font-size: 10px;
}
.workspace-heading .eyebrow {
  color: var(--green);
}
.primary {
  background: var(--color-ink);
  border: 1px solid var(--color-ink);
  box-shadow: 0 1px 2px color-mix(in srgb, var(--color-ink) 8%, transparent);
  border-radius: var(--radius-md);
}
.primary:hover {
  background: var(--color-ink-2);
}
.secondary {
  box-shadow: 0 1px 2px color-mix(in srgb, var(--color-ink) 3%, transparent);
  border-radius: var(--radius-md);
}
.secondary:hover {
  background: var(--color-paper);
}
.plan-summary {
  margin: 0 0 24px;
  border: 0;
  background: none;
  border-radius: 0;
  gap: 16px;
}
.plan-summary > div {
  background: var(--color-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px 22px;
}
.plan-summary > div:last-child {
  border-right: 1px solid var(--line);
}
.plan-summary dd {
  font-size: var(--text-2xl);
  font-weight: 550;
  font-variant-numeric: tabular-nums;
  letter-spacing: -1.4px;
}
.plan-summary > div:first-child {
  background: var(--color-accent-soft);
  border-color: var(--color-line);
}
.plan-summary dt {
  font-size: var(--text-sm);
}
.card,
.panel,
.map-panel,
.home-strip {
  border-radius: var(--radius-md);
  box-shadow: 0 1px 3px color-mix(in srgb, var(--color-ink) 2%, transparent);
}
.card {
  animation: none;
}
.city-art {
  height: 40px;
  padding: 12px 20px;
  background: var(--color-paper);
}
.city-art:before,
.city-art:after {
  display: none;
}
.city-art.sand {
  background: var(--color-paper);
}
.city-code {
  font-size: 10px;
  letter-spacing: 1.4px;
}
.card h3 {
  font-size: var(--text-lg);
}
.card-body {
  padding: 20px;
}
.dates {
  font-variant-numeric: tabular-nums;
}
.card-footer {
  gap: 8px;
}
.badge {
  border-radius: var(--radius-sm);
}
.empty {
  background: var(--color-surface);
  border: 1px solid var(--line);
  padding: 36px 24px;
}
.empty h3 {
  font-size: var(--text-lg);
}
.context-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 20px;
  align-items: start;
  margin-top: 28px;
}
.context-grid .map-panel {
  margin: 0;
  padding: 22px;
}
.context-grid .home-strip {
  display: flex;
  flex-direction: column;
  margin: 0;
  background: var(--color-surface);
  padding: 22px;
  gap: 22px;
}
.context-grid .presence-check {
  border-left: 0;
  border-top: 1px solid var(--line);
  padding: 20px 0 0;
}
.context-grid .presence-check input {
  width: 100%;
}
.context-grid .map-panel h2 {
  font-size: var(--text-lg);
}
.context-grid .map-panel .toolbar {
  gap: 12px;
}
.context-grid .destination-map {
  height: 280px;
}
.map-controls {
  gap: 4px;
}
.map-controls .pill {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: var(--text-2xs);
  padding: 8px 10px;
}
.map-credit {
  font-size: var(--text-2xs);
}
.map-explanation {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: var(--text-xs);
}
.map-explanation summary {
  cursor: pointer;
  color: var(--green);
  padding: 8px 0;
}
.map-explanation p {
  margin: 8px 0;
  line-height: 1.7;
}
.map-people p {
  margin-bottom: 12px;
}
.private-pin-panel summary {
  font-size: var(--text-sm);
}
.destination-map {
  background: var(--color-paper);
  border-color: var(--color-accent-soft);
}
.map-land path {
  fill: var(--color-accent-soft);
  stroke: var(--color-line-strong);
}
.map-states path {
  fill: var(--color-line);
  stroke: var(--color-line-strong);
}
.aside-note {
  background: transparent;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  padding: 18px 0;
}
.aside-note > span {
  display: none;
}
.footer {
  font-size: var(--text-2xs);
}
.local-banner {
  background: var(--color-sunk);
  color: var(--color-muted);
  font-size: var(--text-2xs);
}
.auth-layout {
  gap: 9%;
  min-height: calc(100vh - 170px);
}
.auth-copy h1 {
  font-family: inherit;
  font-size: clamp(42px, 4.7vw, 66px);
  font-weight: 550;
  letter-spacing: -3px;
  line-height: 1.06;
}
.auth-copy .eyebrow {
  color: var(--green);
}
.auth-copy > p:not(.eyebrow) {
  max-width: 420px;
}
.auth-card {
  padding: 36px;
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 40px color-mix(in srgb, var(--color-ink) 3%, transparent);
}
.auth-card h2 {
  font-family: inherit;
  font-size: var(--text-xl);
  font-weight: 600;
  letter-spacing: -0.8px;
}
.auth-card > a.primary {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  text-decoration: none;
}
.auth-card #google-login {
  background: var(--color-surface);
  color: var(--ink);
  border: 1px solid var(--color-line-strong);
  box-shadow: none;
}
.auth-card #google-login:hover {
  background: var(--color-paper);
}
.field input,
.field select,
.field textarea {
  border-color: var(--color-line-strong);
  color: var(--ink);
  border-radius: var(--radius-md);
}
.field input:hover,
.field select:hover {
  border-color: var(--color-line-strong);
}
.two-col {
  gap: 20px;
}
.panel {
  padding: 24px;
}
.panel h2 {
  font-size: var(--text-lg);
}
.panel hr {
  margin: 24px 0;
}
.friends-grid {
  align-items: start;
}
.friends-grid #create-invite {
  background: var(--color-surface);
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: none;
}
.friends-grid .agent-row {
  gap: 12px;
}
.friends-grid .agent-row > div:last-child {
  gap: 8px;
}
.calendar-week {
  background: var(--color-paper);
}
.calendar-day[aria-pressed='true'] {
  background: var(--color-accent-soft);
}
.calendar-match {
  box-shadow: 0 1px 3px color-mix(in srgb, var(--color-ink) 2%, transparent);
}
.form-error:not(:empty) {
  font-size: var(--text-sm);
}
.token {
  background: var(--color-paper);
}
@media (min-width: 1100px) {
  .shell:has(.nav) {
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr);
    column-gap: 40px;
    padding: 0 32px;
  }
  .shell:has(.nav) .header {
    position: sticky;
    top: 0;
    height: 100vh;
    align-self: start;
    grid-row: 1/3;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 30px 20px 28px 0;
    border-bottom: 0;
    border-right: 1px solid var(--line);
  }
  .shell:has(.nav) .brand {
    margin-bottom: 42px;
  }
  .shell:has(.nav) .nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
  }
  .shell:has(.nav) .nav button {
    text-align: left;
    padding: 12px 15px;
  }
  .shell:has(.nav) .nav button.active {
    background: var(--color-accent-soft);
    color: var(--color-accent);
  }
  .shell:has(.nav) .account {
    margin-top: auto;
    padding-top: 24px;
    flex-wrap: wrap;
  }
  .shell:has(.nav) #main {
    min-width: 0;
  }
  .shell:has(.nav) .footer {
    grid-column: 2;
    margin-top: 24px;
  }
}
@media (max-width: 1099px) {
  .context-grid {
    grid-template-columns: minmax(0, 1fr) 250px;
  }
  .shell {
    padding: 0 24px;
  }
  .header {
    gap: 16px;
  }
}
@media (max-width: 760px) {
  .context-grid {
    grid-template-columns: 1fr;
  }
  .context-grid .home-strip {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .context-grid .presence-check {
    border-top: 0;
    border-left: 1px solid var(--line);
    padding: 0 0 0 20px;
  }
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 620px) {
  .shell {
    padding: 0 18px;
  }
  .header {
    height: auto;
    padding: 18px 0 12px;
  }
  .brand {
    font-size: var(--text-xl);
  }
  .nav {
    width: 100%;
    gap: 2px;
  }
  .nav button {
    font-size: var(--text-xs);
    padding: 10px 7px;
    white-space: nowrap;
  }
  .workspace-heading,
  .section-intro {
    padding-top: 24px;
  }
  .workspace-heading h1,
  .section-intro h1 {
    font-size: var(--text-2xl);
  }
  .workspace-heading {
    gap: 16px;
  }
  .workspace-heading .primary {
    width: auto;
  }
  .plan-summary {
    gap: 8px;
    margin-bottom: 22px;
  }
  .plan-summary > div {
    padding: 13px 10px;
  }
  .plan-summary dt {
    font-size: 10px;
  }
  .plan-summary dd {
    font-size: var(--text-xl);
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .context-grid {
    margin-top: 24px;
    gap: 16px;
  }
  .context-grid .home-strip {
    display: flex;
  }
  .context-grid .presence-check {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 18px 0 0;
  }
  .context-grid .map-panel {
    padding: 16px;
  }
  .context-grid .destination-map {
    height: 230px;
  }
  .map-panel .toolbar {
    flex-wrap: wrap;
  }
  .map-controls .pill {
    font-size: var(--text-2xs);
    padding: 8px;
  }
  .auth-layout {
    padding: 32px 0;
    gap: 28px;
  }
  .auth-copy h1 {
    font-size: var(--text-3xl);
    letter-spacing: -1.8px;
  }
  .auth-card {
    padding: 24px;
  }
  .panel {
    padding: 20px;
  }
  .toolbar .tabs {
    margin-left: 0;
  }
  .section-intro p {
    font-size: var(--text-sm);
  }
  .footer {
    padding-bottom: 24px;
  }
  .calendar-day {
    min-height: 66px;
  }
}

/* Destination combobox and saved-plan feedback */
.destination-search {
  position: relative;
}
.destination-input {
  display: flex;
  gap: 10px;
  align-items: center;
}
.destination-input input {
  min-width: 0;
  flex: 1;
}
.destination-clear {
  flex-shrink: 0;
}
.destination-options {
  list-style: none;
  padding: 4px;
  margin: 6px 0 0;
  border: 1px solid var(--line, var(--color-line));
  border-radius: var(--radius-md);
  background: var(--color-surface);
  max-height: 220px;
  overflow: auto;
}
.destination-options[hidden] {
  display: none;
}
.destination-options [role='option'] {
  padding: 11px 12px;
  cursor: pointer;
  border-radius: var(--radius-sm);
}
.destination-options [role='option']:hover,
.destination-options [aria-selected='true'] {
  background: var(--color-accent-soft);
  color: var(--color-accent-strong);
}
.destination-search .help {
  margin-top: 6px;
}
.saved-plan {
  outline: 3px solid var(--color-focus);
  outline-offset: 4px;
}
.card-footer > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}
.card-footer {
  flex-wrap: wrap;
  gap: 8px;
}
/* Invitation decisions stay visible and comfortably tappable. */
.invitation-review {
  border: 2px solid var(--color-accent-tint);
  background: var(--color-paper);
  margin-top: 24px;
}
.invitation-review h2 {
  font-size: var(--text-xl);
}
.invitation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.invitation-actions button {
  min-height: 48px;
  min-width: 140px;
}
.invitation-signin {
  padding: 16px;
  background: var(--color-accent-soft);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
}
.legacy-invite {
  margin-top: 16px;
}
.legacy-invite summary {
  cursor: pointer;
  padding: 12px 0;
  color: var(--muted);
}
.connection-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
  padding: 22px 0;
}
.connection-row.needs-action {
  border-left: 3px solid var(--green);
  padding: 18px;
  background: var(--color-paper);
  border-radius: var(--radius-md);
  margin: 14px 0;
}
.connection-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px !important;
  width: 100%;
}
.connection-actions > button {
  min-height: 48px;
  min-width: 128px;
  flex: 1;
}
.connection-actions > button[data-block] {
  flex: 0 0 auto;
  min-width: 70px;
  background: transparent;
  border-color: transparent;
}
.connection-row .help {
  margin: 8px 0;
}
.connection-row [data-error]:empty {
  display: none;
}
button[hidden] {
  display: none !important;
}
@media (max-width: 620px) {
  .connection-actions > button {
    min-width: 110px;
  }
  .invitation-actions button {
    flex: 1;
  }
  .invitation-review {
    padding: 20px;
  }
}

.account-identity {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  font-size: var(--text-xs);
  overflow-wrap: anywhere;
}
.account-identity span,
.account-identity small {
  color: var(--muted);
  font-size: var(--text-2xs);
}
.account-email {
  overflow-wrap: anywhere;
}
.account {
  flex-wrap: wrap;
}
.connection-actions {
  gap: 12px;
}
.connection-row {
  align-items: stretch;
}
@media (min-width: 1100px) {
  .account-identity {
    width: 100%;
    order: 2;
  }
  .account #logout {
    order: 3;
  }
}
@media (max-width: 620px) {
  .account-identity {
    max-width: 190px;
  }
  .account {
    justify-content: flex-end;
  }
  .account-identity strong {
    font-size: var(--text-xs);
  }
  .header .account {
    max-width: 65%;
  }
}

/* People and provider lists keep active connections prominent. */
.friend-total {
  font-size: var(--text-xl);
  font-weight: 700;
  margin: 20px 0;
}
.friend-identity {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.friend-avatar,
.provider-icon {
  display: grid;
  place-items: center;
  background: var(--color-accent-soft);
  color: var(--color-accent-strong);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  flex-shrink: 0;
  font-weight: 700;
}
.friend-identity strong {
  font-size: var(--text-md);
}
.friends-empty {
  padding: 26px 0;
  color: var(--muted);
}
.provider-grid {
  display: grid;
  gap: 14px;
}
.provider-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px;
}
.provider-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.provider-heading h3 {
  margin: 0;
  font-size: var(--text-md);
}
.connection-state {
  margin-left: auto;
  font-size: var(--text-xs);
  color: var(--muted);
}
.connection-state.connected {
  color: var(--color-accent);
  font-weight: 700;
}
.provider-card summary {
  cursor: pointer;
  padding: 8px 0;
}
.provider-card .agent-row {
  align-items: flex-start;
}
textarea {
  width: 100%;
  font: inherit;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 10px;
  resize: vertical;
}
.overlap-readiness {
  padding: 18px 22px;
  background: var(--color-paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  margin: 20px 0;
}
.overlap-readiness p {
  margin: 8px 0;
}
.overlap-readiness a {
  color: var(--green);
  text-decoration: underline;
}

pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.provider-heading .connection-state {
  white-space: nowrap;
}
.panel > details > summary {
  font-size: var(--text-md);
  font-weight: 600;
  cursor: pointer;
}

/* Connections lead; collapsed history must not stretch into an empty column. */
.agents-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.agents-main {
  display: contents;
}
.agents-layout .panel {
  margin: 0;
  min-width: 0;
}
.agent-connections {
  grid-column: 1/-1;
}
.agent-connections .provider-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.agent-connections .toolbar {
  margin-top: 0;
}
.agent-connections > .help:last-child {
  margin: 16px 0 0;
}
.provider-card .agent-row {
  flex-wrap: wrap;
}
.provider-card .agent-row > div {
  min-width: 0;
  overflow-wrap: anywhere;
}
@media (max-width: 760px) {
  .agents-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .agent-connections .provider-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Uiverse-inspired interaction polish; original CSS, see docs/UI-SOURCES.md. */
:root {
  --raised-shadow:
    0 8px 24px color-mix(in srgb, var(--color-ink) 6%, transparent),
    0 2px 6px color-mix(in srgb, var(--color-ink) 3%, transparent);
}
:is(button, a, input, select, textarea, summary):focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
}
.field :is(input, select, textarea):focus,
.destination-input input:focus {
  border-color: var(--focus-ring);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-focus) 8%, transparent);
}
.destination-options {
  padding: 6px;
  box-shadow: var(--raised-shadow);
  scroll-padding: 6px;
}
.destination-options [role='option'] {
  border-left: 3px solid transparent;
  min-height: 44px;
  line-height: 1.5;
}
.destination-options [aria-selected='true'] {
  border-left-color: var(--green);
  background: var(--color-accent-soft);
  font-weight: 600;
}
.destination-options [role='option']:hover {
  background: var(--color-paper);
}
.destination-options [aria-selected='true']:hover {
  background: var(--color-accent-soft);
}
dialog {
  box-shadow:
    0 24px 80px color-mix(in srgb, var(--color-ink) 15%, transparent),
    0 4px 16px color-mix(in srgb, var(--color-ink) 8%, transparent);
}
.nav button.active {
  box-shadow: inset 3px 0 0 var(--green);
}
.tabs {
  padding: 4px;
  background: var(--color-sunk);
  border: 1px solid var(--color-accent-soft);
  border-radius: var(--radius-md);
  gap: 4px;
}
.tabs .pill {
  border-color: transparent;
  border-radius: var(--radius-md);
  min-height: 40px;
}
.tabs .pill.selected {
  background: var(--color-surface);
  color: var(--color-accent-strong);
  border-color: var(--color-line);
  box-shadow: 0 1px 4px color-mix(in srgb, var(--color-ink) 7%, transparent);
  font-weight: 650;
}
@media (hover: hover) and (pointer: fine) {
  .primary:not(:disabled):hover {
    box-shadow: 0 4px 10px color-mix(in srgb, var(--color-ink) 13%, transparent);
  }
  .secondary:not(:disabled):hover {
    border-color: var(--color-line-strong);
    box-shadow: 0 2px 6px color-mix(in srgb, var(--color-ink) 6%, transparent);
  }
  .nav button:not(.active):hover {
    background: var(--color-paper);
    color: var(--ink);
  }
}
@media (prefers-reduced-motion: no-preference) {
  :is(
    .primary,
    .secondary,
    .pill,
    .nav button,
    .field input,
    .field select,
    .field textarea,
    .destination-input input
  ) {
    transition:
      background-color 140ms ease,
      border-color 140ms ease,
      box-shadow 140ms ease,
      color 140ms ease;
  }
  :is(.primary, .secondary):not(:disabled):active {
    transform: translateY(1px);
  }
  dialog[open] {
    animation: dialog-arrive 160ms ease-out;
  }
  #toast.visible {
    animation: feedback-arrive 160ms ease-out;
  }
  @keyframes dialog-arrive {
    from {
      opacity: 0;
      translate: 0 6px;
    }
    to {
      opacity: 1;
      translate: 0 0;
    }
  }
  @keyframes feedback-arrive {
    from {
      opacity: 0;
      translate: 0 4px;
    }
    to {
      opacity: 1;
      translate: 0 0;
    }
  }
}
@media (max-width: 620px) {
  .tabs {
    flex-wrap: wrap;
  }
  .tabs .pill,
  .map-controls .pill,
  .icon-btn {
    min-height: 44px;
    min-width: 44px;
  }
  .nav button.active {
    box-shadow: inset 0 -2px 0 var(--green);
  }
}

/* Accepted friends read as a single compact contact list; controls expand on demand. */
.friend-list-panel .accepted-friend {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.accepted-friend .friend-identity {
  gap: 12px;
  overflow-wrap: anywhere;
}
.accepted-friend .friend-identity strong {
  font-size: var(--text-base);
}
.accepted-friend .friend-avatar {
  width: 40px;
  height: 40px;
  font-size: var(--text-sm);
}
.friend-manage {
  min-width: 0;
}
.friend-manage summary {
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  color: var(--muted);
  font-size: var(--text-sm);
  padding: 0 8px;
  border-radius: var(--radius-md);
}
.friend-manage summary:hover {
  background: var(--color-paper);
  color: var(--ink);
}
.friend-manage summary:focus-visible {
  outline: 3px solid var(--color-accent-tint);
  outline-offset: 2px;
}
.friend-manage[open] {
  grid-column: 1/-1;
}
.friend-manage[open] summary {
  justify-content: flex-start;
}
.friend-manage .connection-actions {
  padding: 4px 0;
}
.accepted-friend > [data-error] {
  grid-column: 1/-1;
  margin: 0;
}
.friend-manage .connection-actions > button {
  flex: 0 1 auto;
  min-height: 44px;
  min-width: 0;
}

.home-strip {
  grid-template-columns: 1fr;
}
.home-strip .help:empty {
  display: none;
}

/* ==========================================================================
   Design system v2 (2026-11). Final component layer.
   Everything here uses tokens.css only. When changing a component, edit it
   here rather than appending another override above.
   ========================================================================== */

body {
  background: var(--color-paper);
  color: var(--color-ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

/* Type: serif display for page and dialog titles, sans for everything else */
.workspace-heading h1,
.section-intro h1,
.auth-copy h1,
.modal-top h2,
.auth-card h2,
.empty h3,
.preview-summary h1,
.onboarding-preview-page h1 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.02em;
}
.workspace-heading h1,
.section-intro h1 {
  font-size: var(--text-3xl);
  line-height: 1.1;
}
.auth-copy h1 {
  font-size: clamp(var(--text-3xl), 5vw, 64px);
  line-height: 1.04;
  letter-spacing: -0.025em;
  font-weight: 400;
}
.modal-top h2,
.auth-card h2 {
  font-size: var(--text-2xl);
}
.empty h3 {
  font-size: var(--text-xl);
}
.eyebrow {
  color: var(--color-accent);
  letter-spacing: 0.12em;
  font-size: var(--text-2xs);
}

/* Brand */
.brand {
  font-family: var(--font-body);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--color-ink);
  text-decoration: none;
}

/* Buttons: one primary colour, one secondary style */
.primary {
  background: var(--color-accent);
  border: 1px solid var(--color-accent);
  color: var(--color-on-accent);
  border-radius: var(--radius-md);
  box-shadow: none;
}
.primary:not(:disabled):hover {
  background: var(--color-accent-strong);
  border-color: var(--color-accent-strong);
  box-shadow: none;
}
.secondary {
  background: var(--color-surface);
  border: 1px solid var(--color-line-strong);
  color: var(--color-ink);
  border-radius: var(--radius-md);
}
.secondary:not(:disabled):hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}
.icon-btn {
  color: var(--color-ink-2);
  border-radius: var(--radius-sm);
}
.icon-btn:hover {
  background: var(--color-sunk);
  color: var(--color-ink);
}
.icon-btn.danger {
  color: var(--color-danger);
}
.icon-btn.danger:hover {
  background: var(--color-danger-soft);
}

/* Navigation */
.shell:has(.nav) .nav button {
  color: var(--color-ink-2);
  border-radius: var(--radius-md);
}
.shell:has(.nav) .nav button:hover {
  background: var(--color-sunk);
}
.shell:has(.nav) .nav button.active {
  background: var(--color-accent-soft);
  color: var(--color-accent-strong);
  box-shadow: inset 3px 0 0 var(--color-accent);
}

/* Cards and panels share one surface style */
.card,
.panel,
.map-panel,
.auth-card,
dialog {
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
}
.card,
.auth-card,
dialog {
  box-shadow: var(--shadow-raised);
}

/* Page heading with the home city as a quiet line underneath */
.workspace-heading {
  align-items: flex-end;
}
.workspace-heading h1 {
  margin: 0 0 12px;
}
.workspace-heading .home-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  margin: 0;
  padding: 0;
  background: none;
  border: 0;
  font-size: var(--text-sm);
  color: var(--color-muted);
}
.workspace-heading .home-strip .eyebrow {
  margin: 0;
  color: var(--color-muted);
}
.workspace-heading .home-strip h2 {
  margin: 0;
  font-size: var(--text-base);
  font-weight: 600;
  letter-spacing: 0;
  color: var(--color-ink);
}
.workspace-heading .home-strip .help {
  margin: 0;
  font-size: var(--text-sm);
}
.workspace-heading .home-strip .help::before {
  content: '·';
  margin-right: 10px;
  color: var(--color-line-strong);
}
.workspace-heading .home-strip .link-button {
  padding: 0;
  min-height: 0;
  font-size: var(--text-sm);
}

/* Stay cards */
.stay-card {
  position: relative;
  animation: none;
  transition:
    box-shadow 160ms ease,
    transform 160ms ease;
}
.stay-card::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
  background: var(--color-line-strong);
  transition: background-color 160ms ease;
}
.stay-card.is-shared::before {
  background: var(--color-accent);
}
@media (hover: hover) {
  .stay-card:hover {
    box-shadow: var(--shadow-float);
  }
}
.stay-card .card-body {
  padding: 20px 22px 18px 26px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100%;
}
.stay-dates {
  margin: 0;
  font-size: var(--text-sm);
  font-weight: 650;
  color: var(--color-accent);
  font-variant-numeric: tabular-nums;
}
.stay-dates span {
  display: none;
}
.stay-card h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--text-xl);
  letter-spacing: -0.01em;
  margin: 0 0 2px;
}
.stay-inline-trigger {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 2px 6px;
  margin: -2px -6px;
  border-radius: var(--radius-sm);
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    background-color 140ms ease,
    color 140ms ease;
}
.stay-inline-trigger:hover {
  background: var(--color-sunk);
}
.stay-dates-btn:hover {
  background: var(--color-accent-soft);
  color: var(--color-accent-strong);
}
.stay-city-btn:hover {
  color: var(--color-accent-strong);
  text-decoration: underline;
  text-decoration-color: var(--color-accent-tint);
  text-underline-offset: 4px;
}
.stay-note {
  margin: 2px 0 0;
  font-size: var(--text-xs);
  color: var(--color-ink-2);
  line-height: 1.5;
}
.stay-note-btn {
  color: var(--color-ink-2);
}
.stay-card .card-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--color-line);
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.stay-card .card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-left: auto;
}
.badge {
  border-radius: var(--radius-pill);
  padding: 4px 10px;
  font-size: var(--text-2xs);
  background: var(--color-accent-soft);
  color: var(--color-accent-strong);
}
.badge.tentative {
  background: var(--color-you-soft);
  color: var(--color-you);
}
.badge-toggle {
  border: 1px solid var(--color-accent-tint);
  font-weight: 600;
  cursor: pointer;
  transition:
    background-color 140ms ease,
    border-color 140ms ease,
    transform 120ms ease;
}
.badge-toggle.tentative {
  border-color: color-mix(in srgb, var(--color-you) 30%, transparent);
}
.badge-toggle:hover:not(:disabled) {
  border-color: var(--color-accent);
}
.badge-toggle.tentative:hover:not(:disabled) {
  border-color: var(--color-you);
}
.visibility {
  font-size: var(--text-xs);
  color: var(--color-muted);
}
.visibility-toggle {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-line-strong);
  background: var(--color-surface);
  font-size: var(--text-xs);
  font-weight: 550;
  color: var(--color-ink-2);
  cursor: pointer;
  transition:
    background-color 140ms ease,
    border-color 140ms ease,
    color 140ms ease;
}
.visibility-toggle.is-shared {
  background: var(--color-accent-soft);
  border-color: var(--color-accent-tint);
  color: var(--color-accent-strong);
}
.visibility-toggle:hover:not(:disabled) {
  border-color: var(--color-accent);
  color: var(--color-accent-strong);
}

/* Empty states */
.empty {
  background: var(--color-surface);
  border: 1px dashed var(--color-line-strong);
  border-radius: var(--radius-lg);
  box-shadow: none;
  padding: 44px 24px;
}
.empty p {
  color: var(--color-muted);
  font-size: var(--text-base);
}

/* Map: the hero of the plans page */
.context-grid {
  grid-template-columns: 1fr;
  margin-top: 28px;
}
.context-grid .map-panel {
  padding: 24px;
}
.context-grid .map-panel h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--text-2xl);
  letter-spacing: -0.01em;
}
.destination-map,
.context-grid .destination-map {
  height: 340px;
  background: color-mix(in srgb, var(--color-accent-soft) 55%, var(--color-surface));
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
}
.map-land path {
  fill: var(--color-surface);
  stroke: var(--color-line-strong);
}
.map-states path {
  fill: var(--color-surface);
  stroke: var(--color-line);
  stroke-width: 1;
}
.map-point circle {
  fill: var(--color-accent);
  stroke: var(--color-surface);
  stroke-width: 2.5;
}
.map-point .marker-halo {
  fill: var(--color-accent);
  stroke: none;
  opacity: 0.18;
}
.map-point.self-point circle {
  fill: var(--color-you);
}
.map-point.self-point .marker-halo {
  fill: var(--color-you);
  opacity: 0.22;
}
.map-point text {
  fill: var(--color-ink);
  font-weight: 650;
  stroke: var(--color-surface);
  stroke-width: 0.25em;
  paint-order: stroke;
}

/* Timeline: date reads like a sentence, not a database value */
.map-timeline-heading output {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 400;
  color: var(--color-ink);
  font-variant-numeric: normal;
}

/* Crossing paths: each match is a small card */
.map-panel .map-coincidences h3 {
  font-size: var(--text-xs);
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-accent);
  margin: 0 0 10px;
}
#map-coincidence-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}
.map-panel .map-coincidence {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 12px;
  row-gap: 2px;
  align-items: center;
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--color-accent-tint);
  border-radius: var(--radius-md);
  background: var(--color-accent-soft);
}
.map-coincidence.is-state {
  background: var(--color-surface);
  border-color: var(--color-line);
}
.coincidence-avatar {
  grid-row: span 3;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-accent);
  color: var(--color-on-accent);
  font-size: var(--text-xs);
  font-weight: 700;
}
.map-coincidence.is-state .coincidence-avatar {
  background: var(--color-sunk);
  color: var(--color-ink-2);
}
.map-coincidence strong {
  font-size: var(--text-base);
}
.map-coincidence span:not(.coincidence-avatar) {
  font-size: var(--text-sm);
  color: var(--color-ink-2);
}
.map-coincidence span:last-child {
  color: var(--color-muted);
}
.map-empty {
  color: var(--color-muted);
  font-size: var(--text-sm);
  grid-column: 1 / -1;
}

/* Who is where today: compact rows */
.map-people {
  gap: 10px;
}
.map-people p {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}
.map-people .map-self {
  border-left: 4px solid var(--color-you);
  background: var(--color-you-soft);
  border-color: color-mix(in srgb, var(--color-you) 30%, transparent);
}

/* Landing */
.auth-layout {
  gap: 6%;
}
.auth-copy > p:not(.eyebrow) {
  font-size: var(--text-md);
  color: var(--color-ink-2);
  max-width: 460px;
  line-height: 1.6;
}
.crossing-art {
  margin: 28px 0 0;
  max-width: 460px;
}
.crossing-art svg {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-raised);
}
.crossing-art figcaption {
  margin-top: 10px;
  font-size: var(--text-sm);
  color: var(--color-muted);
}
.crossing-art text {
  font-family: var(--font-body);
}
/* Crossing art */
.ca-bg {
  fill: var(--color-accent-soft);
}
.ca-grid path {
  stroke: var(--color-surface);
  stroke-width: 1;
  opacity: 0.6;
}
.ca-river {
  fill: none;
  stroke: var(--color-accent-tint);
  stroke-width: 22;
  stroke-linecap: round;
  opacity: 0.6;
}
.ca-route {
  fill: none;
  stroke-width: 2.5;
  stroke-dasharray: 2 7;
  stroke-linecap: round;
}
.ca-you {
  stroke: var(--color-you);
}
.ca-friend {
  stroke: var(--color-accent);
}
.ca-dot-you {
  fill: var(--color-you);
}
.ca-dot-friend {
  fill: var(--color-accent);
}
.ca-pulse {
  fill: var(--color-surface);
  opacity: 0.7;
}
.ca-meet {
  fill: var(--color-surface);
  stroke: var(--color-accent);
  stroke-width: 2;
}
.ca-card {
  fill: var(--color-surface);
  stroke: var(--color-line);
}
.ca-title {
  fill: var(--color-ink);
  font-size: 15px;
  font-weight: 600;
}
.ca-sub {
  fill: var(--color-muted);
  font-size: 13px;
}
@media (prefers-reduced-motion: no-preference) {
  .ca-pulse {
    transform-origin: 236px 128px;
    animation: ca-pulse 2.8s ease-in-out infinite;
  }
  @keyframes ca-pulse {
    0%,
    100% {
      transform: scale(0.85);
      opacity: 0.5;
    }
    50% {
      transform: scale(1.15);
      opacity: 0.9;
    }
  }
}

/* Demo ending */
.preview-next {
  margin: 28px 0;
  padding: 24px;
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
}
.preview-next h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--text-xl);
  margin: 0 0 6px;
}
.preview-next p {
  color: var(--color-ink-2);
  margin: 0 0 4px;
}
.preview-next .crossing-art {
  margin-top: 16px;
  max-width: none;
}

/* Toast */
#toast {
  background: var(--color-ink);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-float);
}

@media (max-width: 760px) {
  .workspace-heading {
    align-items: stretch;
  }
  .workspace-heading h1,
  .section-intro h1 {
    font-size: var(--text-2xl);
  }
  .auth-copy h1 {
    font-size: var(--text-3xl);
  }
  .destination-map,
  .context-grid .destination-map {
    height: 280px;
  }
  .context-grid .map-panel {
    padding: 16px;
  }
  .crossing-art {
    margin-top: 20px;
  }
  .stay-card .card-actions {
    margin-left: 0;
  }
}

/* Disclosure summaries stay quiet wherever they appear */
main details > summary,
main .panel details > summary {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0;
  color: var(--color-ink-2);
}

/* Section pages borrow the onboarding language:
   small green eyebrow, serif title, one muted lead line, quiet extras. */
.section-intro {
  padding-bottom: 8px;
}
.section-intro .eyebrow {
  margin: 0 0 12px;
  font-size: var(--text-2xs);
  font-weight: 650;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-accent);
}
.section-intro h1 {
  margin: 0 0 12px;
}
.section-intro .section-lead {
  margin: 0;
  max-width: 560px;
  font-size: var(--text-base);
  line-height: 1.65;
  color: var(--color-muted);
}
.section-intro .account-meta {
  max-width: none;
  margin: 14px 0 0;
  font-size: var(--text-xs);
  line-height: 1.7;
  color: var(--color-muted);
}
.section-intro .account-meta strong {
  color: var(--color-ink-2);
  font-weight: 600;
}
.section-intro .account-meta .account-email {
  display: inline;
  margin: 0;
}
.section-intro .account-meta .account-email::before {
  content: '·';
  margin: 0 10px;
  color: var(--color-line-strong);
}
.intro-details {
  margin: 4px 0 24px;
  padding: 0;
  background: none;
  border: 0;
  box-shadow: none;
}
.section-intro .intro-details {
  margin: 14px 0 0;
}
.intro-details > summary {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  color: var(--color-accent);
  text-decoration: underline;
  text-decoration-color: var(--color-accent-tint);
  text-underline-offset: 4px;
  cursor: pointer;
}
.intro-details[open] {
  padding: 4px 0 4px 16px;
  border-left: 2px solid var(--color-accent-tint);
}
.intro-details p {
  max-width: 640px;
  margin: 8px 0;
  font-size: var(--text-sm);
  line-height: 1.65;
  color: var(--color-ink-2);
}

/* Panel titles are serif, like onboarding step titles */
main .panel h2,
main .card h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--text-xl);
  letter-spacing: -0.01em;
  line-height: 1.2;
}
main .panel h2.subsection-title {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--color-line);
  font-size: var(--text-lg);
}
main .panel p.help {
  line-height: 1.65;
}

/* Friends: count reads as a headline, empty state as a soft onboarding panel */
.friend-list-panel #friends-heading {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-2xs);
  font-weight: 650;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-accent);
}
.friend-list-panel .friend-total {
  margin: 8px 0 18px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--text-3xl);
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--color-ink);
}
.friends-empty {
  padding: 26px 24px;
  background: var(--color-accent-soft);
  border: 0;
  border-radius: 56px 56px var(--radius-md) var(--radius-md);
  text-align: left;
}
.friends-empty h3 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--text-xl);
  color: var(--color-accent-strong);
}
.friends-empty p {
  margin: 0;
  font-size: var(--text-sm);
  line-height: 1.65;
  color: var(--color-ink-2);
}

/* Overlap calendar: month navigation grouped on the left, jump controls on the right */
.calendar-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  margin: 8px 0 14px;
}
.calendar-nav,
.calendar-jump {
  display: flex;
  align-items: center;
  gap: 10px;
}
.calendar-nav h2 {
  margin: 0;
  min-width: 9em;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--text-2xl);
  letter-spacing: -0.01em;
}
.calendar-jump .field {
  margin: 0;
}
.calendar-jump input {
  min-height: 44px;
}
#agenda-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--text-xl);
  letter-spacing: -0.01em;
}
/* Georgia's old-style figures make "0" read as "o"; use lining figures in serif headings */
.friend-total,
.calendar-nav h2,
#agenda-title,
.section-intro h1,
.workspace-heading h1,
.map-timeline-heading output {
  font-variant-numeric: lining-nums;
}

/* ---- Map motion ----
   Markers fade in, glide when a person moves, and fade out when they leave.
   Leaving markers lose their .map-point class, so they are styled here. */
.map-point-leaving {
  pointer-events: none;
}
.map-point-leaving circle {
  fill: var(--color-accent);
  stroke: var(--color-surface);
  stroke-width: 2.5;
}
.map-point-leaving.leaving-self circle {
  fill: var(--color-you);
}
.map-point-leaving .marker-halo {
  opacity: 0.2;
  stroke: none;
}
.map-point-leaving text {
  fill: var(--color-ink);
  font-weight: 650;
  stroke: var(--color-surface);
  stroke-width: 0.25em;
  paint-order: stroke;
}
.map-point.is-meeting .marker-halo {
  fill: var(--color-accent);
}

/* ---- Map timeline: a custom track with your trips, crossings and today ---- */
.map-panel .timeline-track {
  position: relative;
  margin-top: 6px;
}
.map-panel .timeline-track input[type='range'] {
  position: relative;
  z-index: 1;
  margin: 0;
  background: transparent;
}
.map-panel .timeline-track input[type='range']::-webkit-slider-runnable-track {
  background: transparent;
}
.map-panel .timeline-track input[type='range']::-moz-range-track {
  background: transparent;
}
.timeline-marks {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 50%;
  height: 14px;
  transform: translateY(-50%);
  pointer-events: none;
}
.timeline-marks::before {
  content: '';
  position: absolute;
  left: -12px;
  right: -12px;
  top: 4px;
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--color-accent-soft);
  box-shadow: inset 0 0 0 1px var(--color-accent-tint);
}
.timeline-marks > span {
  position: absolute;
  border-radius: var(--radius-pill);
}
.timeline-trip {
  top: 4px;
  height: 6px;
  min-width: 6px;
  margin-left: -3px;
  padding-right: 6px;
  background: var(--color-you);
  opacity: 0.55;
}
.timeline-cross {
  top: 1px;
  height: 12px;
  min-width: 12px;
  margin-left: -6px;
  padding-right: 12px;
  background: var(--color-accent);
  box-shadow: 0 0 0 2px var(--color-surface);
}
.timeline-cross.is-state {
  background: var(--color-accent-tint);
}
.timeline-today-tick {
  top: -5px;
  height: 24px;
  width: 2px;
  margin-left: -1px;
  background: var(--color-ink-2);
  opacity: 0.35;
}
.timeline-months {
  position: relative;
  height: 16px;
  margin: 2px 12px 2px;
  font-size: var(--text-2xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-muted);
}
.timeline-months span {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
}
.timeline-months span::before {
  content: '';
  position: absolute;
  left: 50%;
  top: -6px;
  width: 1px;
  height: 4px;
  background: var(--color-line-strong);
}
.map-panel .map-timeline-heading {
  display: grid;
  grid-template-columns: 1fr auto auto auto 1fr;
  align-items: center;
  gap: 4px;
  margin: 0;
}
.map-panel .map-timeline-heading .timeline-next-crossing {
  grid-column: 1;
  justify-self: start;
}
.map-panel .map-timeline-heading #map-prev-day {
  grid-column: 2;
}
.map-panel .map-timeline-heading output {
  grid-column: 3;
  min-width: 11.5em;
  text-align: center;
}
.map-panel .map-timeline-heading #map-next-day {
  grid-column: 4;
}
.map-panel .map-timeline-heading .timeline-today {
  grid-column: 5;
  justify-self: end;
}
.map-panel .timeline-step {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border-radius: var(--radius-pill);
  font-size: var(--text-xl);
  line-height: 1;
  color: var(--color-accent);
}
.map-panel .timeline-next-crossing,
.map-panel .timeline-today {
  min-height: 44px;
  margin: 0;
  padding: 8px 4px;
  font-size: var(--text-sm);
  font-weight: 600;
  white-space: nowrap;
  color: var(--color-accent);
}

/* ---- Calendar: continuous match bars, today, gentle loading ---- */
#calendar-root .calendar,
#calendar-root #calendar-agenda {
  transition: opacity 180ms ease;
}
#calendar-root.is-loading .calendar,
#calendar-root.is-loading #calendar-agenda {
  opacity: 0.5;
}
.calendar-day {
  transition:
    background-color 180ms ease,
    box-shadow 180ms ease;
}
.calendar-day.is-today .day-number {
  display: inline-grid;
  place-items: center;
  align-self: flex-start;
  width: 26px;
  height: 26px;
  margin: -4px 0 3px -4px;
  border-radius: 50%;
  background: var(--color-you);
  color: var(--color-on-accent);
}
.calendar .day-event {
  height: 20px;
  line-height: 12px;
  margin: 2px 0;
  padding: 4px 8px;
  border-radius: 0;
  font-weight: 600;
  transform-origin: left center;
  transition: background-color 150ms ease;
}
.calendar .day-event.place {
  background: var(--color-accent-soft);
  color: var(--color-accent-strong);
}
.calendar .day-event:not(.run-start) {
  margin-left: -10px;
}
.calendar .day-event:not(.run-end) {
  margin-right: -11px;
}
.calendar .day-event.run-start {
  border-top-left-radius: var(--radius-pill);
  border-bottom-left-radius: var(--radius-pill);
}
.calendar .day-event.run-end {
  border-top-right-radius: var(--radius-pill);
  border-bottom-right-radius: var(--radius-pill);
}
.calendar .day-event.place.run-hover {
  background: var(--color-accent-tint);
}
.calendar .day-event.state.run-hover {
  background: color-mix(in srgb, var(--color-you) 28%, var(--color-surface));
}
.calendar .day-event-gap {
  display: block;
  height: 20px;
  margin: 2px 0;
}

/* ---- Motion (all of it respects reduced motion) ---- */
@media (prefers-reduced-motion: no-preference) {
  .map-point.is-entering {
    animation: fade-in 520ms ease-out both;
  }
  .map-point.is-entering .marker-dot {
    transform-box: fill-box;
    transform-origin: center;
    animation: marker-pop 560ms cubic-bezier(0.3, 1.5, 0.5, 1) both;
  }
  .map-point-leaving {
    animation: fade-out 340ms ease-in forwards;
  }
  .map-point.self-point .marker-halo {
    transform-box: fill-box;
    transform-origin: center;
    animation: halo-breathe 2.8s ease-in-out infinite;
  }
  .map-point.is-meeting .marker-halo {
    animation-duration: 1.6s;
  }
  #map-selected-date.roll-next {
    animation: roll-next 280ms cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  #map-selected-date.roll-prev {
    animation: roll-prev 280ms cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  #map-selected-date.roll-settle {
    animation: settle 420ms ease-out;
  }
  #map-coincidence-list > .map-coincidence,
  .map-people > :not(.map-self) {
    animation: rise-in 260ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  }
  #map-coincidence-list > .map-empty {
    animation: fade-in 180ms ease-out both;
  }
  #map-coincidence-list > .map-coincidence:nth-child(2),
  .map-people > :nth-child(3) {
    animation-delay: 40ms;
  }
  #map-coincidence-list > .map-coincidence:nth-child(3),
  .map-people > :nth-child(4) {
    animation-delay: 80ms;
  }
  #map-coincidence-list > .map-coincidence:nth-child(n + 4),
  .map-people > :nth-child(n + 5) {
    animation-delay: 120ms;
  }
  .timeline-cross {
    transition: transform 200ms ease;
  }
  .calendar.slide-next .calendar-grid {
    animation: from-right 400ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  }
  .calendar.slide-prev .calendar-grid {
    animation: from-left 400ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  }
  .calendar-title.slide-next {
    animation: title-next 400ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  }
  .calendar-title.slide-prev {
    animation: title-prev 400ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  }
  .calendar .day-event {
    animation: bar-grow 420ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
    animation-delay: 120ms;
  }
  .calendar-day:nth-child(7n + 2) .day-event {
    animation-delay: 160ms;
  }
  .calendar-day:nth-child(7n + 3) .day-event {
    animation-delay: 200ms;
  }
  .calendar-day:nth-child(7n + 4) .day-event {
    animation-delay: 240ms;
  }
  .calendar-day:nth-child(7n + 5) .day-event {
    animation-delay: 280ms;
  }
  .calendar-day:nth-child(7n + 6) .day-event {
    animation-delay: 320ms;
  }
  .calendar-day:nth-child(7n) .day-event {
    animation-delay: 360ms;
  }
  #calendar-agenda.agenda-in > * {
    animation: rise-in 380ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  }
  #calendar-agenda.agenda-in > :nth-child(2) {
    animation-delay: 60ms;
  }
  #calendar-agenda.agenda-in > :nth-child(n + 3) {
    animation-delay: 120ms;
  }
}
@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes fade-out {
  to {
    opacity: 0;
  }
}
@keyframes marker-pop {
  from {
    transform: scale(0.2);
  }
  70% {
    transform: scale(1.15);
  }
  to {
    transform: scale(1);
  }
}
@keyframes halo-breathe {
  0%,
  100% {
    transform: scale(0.8);
    opacity: 0.45;
  }
  50% {
    transform: scale(1.35);
    opacity: 0.12;
  }
}
@keyframes roll-next {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes roll-prev {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes settle {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.06);
  }
  100% {
    transform: scale(1);
  }
}
@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes from-right {
  from {
    opacity: 0;
    transform: translateX(32px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes from-left {
  from {
    opacity: 0;
    transform: translateX(-32px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes title-next {
  from {
    opacity: 0;
    transform: translateX(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes title-prev {
  from {
    opacity: 0;
    transform: translateX(-16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes bar-grow {
  from {
    transform: scaleX(0);
    opacity: 0.3;
  }
  to {
    transform: scaleX(1);
    opacity: 1;
  }
}

/* Agent access: the journal summary acts as the panel title */
.agent-journal .journal-details > summary {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--text-xl);
  color: var(--color-ink);
}
.agent-journal .journal-details > summary::marker {
  color: var(--color-accent);
  font-size: var(--text-sm);
}

@media (max-width: 760px) {
  .workspace-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
  }
  .workspace-actions .primary {
    flex: 1;
  }
  .header .account {
    gap: 4px 12px;
  }
  .header .account-identity small {
    display: none;
  }
  .friend-list-panel .friend-total {
    font-size: var(--text-2xl);
  }
  .calendar-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .calendar-nav {
    justify-content: space-between;
  }
  .calendar-nav h2 {
    min-width: 0;
    font-size: var(--text-xl);
  }
  .calendar-jump .field {
    flex: 1;
  }
  .calendar-jump input {
    width: 100%;
  }
  .calendar .day-event-gap {
    display: none;
  }
  .map-panel .map-timeline-heading .timeline-next-crossing {
    grid-row: 2;
    grid-column: 1 / -1;
    justify-self: start;
  }
  .map-panel .map-timeline-heading .timeline-today {
    grid-row: 2;
    grid-column: 1 / -1;
    justify-self: end;
  }
  .map-panel .map-timeline-heading output {
    min-width: 0;
  }
}
