:root {
  --fog: #eef1ef;
  --paper: #fafbf7;
  --mineral: #334f5a;
  --mineral-soft: #71868d;
  --mist: #d6dfdd;
  --coral: #f26b55;
  --coral-soft: #ffc1a8;
  --moss: #597761;
  --night: #192a31;
  --line: rgba(51, 79, 90, 0.12);
  --shadow: 0 22px 60px rgba(25, 42, 49, 0.07);
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  background: var(--fog);
  color: var(--mineral);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  background: var(--fog);
}

body {
  min-height: 100vh;
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(242, 107, 85, 0.35);
  outline-offset: 3px;
}

.app-shell {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  min-height: 100vh;
  overflow: hidden;
}

.rail {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  height: 100vh;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 24px 10px 18px;
  border-right: 1px solid var(--line);
  background: rgba(238, 241, 239, 0.92);
  backdrop-filter: blur(18px);
}

.brand-button,
.profile-dot,
.nav-item,
.time-anchor,
.text-button,
.modal-close {
  border: 0;
  cursor: pointer;
  background: transparent;
}

.brand-button {
  width: 42px;
  height: 42px;
  padding: 0;
  overflow: hidden;
  border-radius: 14px;
  box-shadow: 0 8px 18px rgba(242, 107, 85, 0.18);
}

.brand-button img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rail-nav {
  display: flex;
  width: 100%;
  flex: 1;
  flex-direction: column;
  gap: 7px;
}

.nav-item {
  display: flex;
  min-height: 58px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-radius: 17px;
  color: var(--mineral-soft);
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.nav-item span {
  font-size: 21px;
  line-height: 1;
}

.nav-item small {
  font-size: 10px;
  font-weight: 650;
}

.nav-item:hover {
  color: var(--mineral);
  transform: translateY(-1px);
}

.nav-item.is-active {
  background: rgba(250, 251, 247, 0.92);
  color: var(--mineral);
  box-shadow: 0 8px 24px rgba(25, 42, 49, 0.05);
}

.profile-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(89, 119, 97, 0.13);
  color: var(--moss);
  font-size: 12px;
  font-weight: 700;
}

.workspace {
  display: grid;
  min-width: 0;
  min-height: 100vh;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 30px 42px 0;
}

.eyebrow {
  margin: 0;
  color: var(--mineral-soft);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.soft-copy {
  margin: 6px 0 0;
  color: var(--mineral-soft);
  font-size: 13px;
}

.local-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(89, 119, 97, 0.1);
  color: var(--moss);
  font-size: 11px;
  font-weight: 650;
}

main {
  display: grid;
  min-height: 0;
  padding: 20px 42px 28px;
}

.intention-screen {
  display: grid;
  width: min(760px, 100%);
  align-self: center;
  justify-self: center;
  gap: 22px;
  text-align: center;
}

.compass {
  position: relative;
  display: grid;
  width: 132px;
  height: 132px;
  place-items: center;
  justify-self: center;
  border: 1px solid rgba(51, 79, 90, 0.13);
  border-radius: 50%;
}

.compass::before {
  position: absolute;
  width: 110px;
  height: 110px;
  border: 5px solid transparent;
  border-top-color: var(--coral);
  border-right-color: #a6574c;
  border-radius: 50%;
  content: "";
  transform: rotate(-25deg);
}

.compass-core {
  display: grid;
  width: 76px;
  height: 76px;
  place-items: center;
  border-radius: 50%;
  background: rgba(242, 107, 85, 0.11);
  color: var(--coral);
  font-size: 32px;
}

.compass-dot {
  position: absolute;
  top: 5px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--coral);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.hero-copy h1 {
  margin-bottom: 8px;
  color: var(--mineral);
  font-size: clamp(27px, 3.4vw, 40px);
  font-weight: 570;
  letter-spacing: -0.035em;
}

.hero-copy p {
  margin: 0;
  color: var(--mineral-soft);
  font-size: 14px;
}

.flow-panel {
  padding: 19px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(250, 251, 247, 0.9);
  box-shadow: var(--shadow);
  text-align: left;
}

.intention-field {
  display: flex;
  align-items: center;
  gap: 10px;
}

.intention-field input {
  width: 100%;
  min-width: 0;
  padding: 13px 2px;
  border: 0;
  background: transparent;
  color: var(--mineral);
  font-size: 17px;
}

.intention-field input::placeholder,
textarea::placeholder {
  color: #91a0a4;
}

.intention-field input:focus {
  outline: 0;
}

.voice-button {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--fog);
  color: var(--mineral-soft);
  cursor: pointer;
}

.voice-button.is-listening {
  background: rgba(242, 107, 85, 0.12);
  color: var(--coral);
}

.panel-footer,
.screen-header,
.agent-actions,
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-footer {
  padding-top: 13px;
  border-top: 1px solid var(--line);
}

.fine-print {
  margin: 0;
  color: var(--mineral-soft);
  font-size: 10px;
  line-height: 1.5;
}

.button {
  min-height: 38px;
  padding: 9px 17px;
  border: 0;
  border-radius: 999px;
  background: rgba(214, 223, 221, 0.7);
  color: var(--mineral);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.button:hover:not(:disabled) {
  filter: brightness(0.97);
}

.button.primary {
  background: var(--mineral);
  color: white;
}

.button.coral {
  background: var(--coral);
  color: white;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.duration-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 16px 0;
}

.duration-option {
  padding: 14px 8px;
  border: 0;
  border-radius: 14px;
  background: rgba(214, 223, 221, 0.45);
  color: var(--mineral);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
}

.duration-option.is-selected {
  background: var(--mineral);
  color: white;
}

.invited-parts,
.agents-grid,
.privacy-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.mini-part,
.agent-card,
.privacy-card {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(238, 241, 239, 0.55);
}

.mini-part strong,
.agent-card h3,
.privacy-card h3 {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
}

.mini-part span,
.agent-card p,
.privacy-card p {
  color: var(--mineral-soft);
  font-size: 11px;
  line-height: 1.45;
}

.active-intention {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.active-intention .eyebrow {
  margin-bottom: 7px;
}

.active-intention strong {
  font-size: 17px;
}

.screen {
  width: min(1080px, 100%);
  margin: 0 auto;
  align-self: start;
}

.screen-header {
  align-items: flex-end;
  margin-bottom: 22px;
}

.screen-header h1 {
  margin: 6px 0 0;
  font-size: clamp(25px, 3vw, 34px);
  font-weight: 580;
  letter-spacing: -0.025em;
}

.agents-grid {
  grid-template-columns: repeat(3, minmax(220px, 1fr));
}

.agent-card {
  padding: 19px;
  background: rgba(250, 251, 247, 0.92);
  box-shadow: 0 14px 36px rgba(25, 42, 49, 0.045);
}

.agent-card.is-expired {
  opacity: 0.58;
}

.agent-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
}

.agent-icon,
.privacy-icon {
  display: grid;
  width: 43px;
  height: 43px;
  place-items: center;
  border-radius: 50%;
  background: rgba(242, 107, 85, 0.11);
  color: var(--coral);
  font-size: 19px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(89, 119, 97, 0.1);
  color: var(--moss);
  font-size: 9px;
  font-weight: 750;
}

.status-pill::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.status-pill.handed-off {
  background: rgba(242, 107, 85, 0.1);
  color: var(--coral);
}

.status-pill.released,
.status-pill.expired {
  background: rgba(113, 134, 141, 0.1);
  color: var(--mineral-soft);
}

.agent-card h3 {
  margin: 0 0 5px;
  font-size: 19px;
}

.agent-card p {
  min-height: 33px;
  margin-bottom: 18px;
}

.agent-actions {
  min-height: 40px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.expiry {
  color: var(--mineral-soft);
  font-size: 10px;
}

.agent-action-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.release-button {
  padding: 6px;
  border: 0;
  background: transparent;
  color: var(--mineral-soft);
  cursor: pointer;
  font-size: 10px;
  font-weight: 650;
}

.empty-state,
.reflection-landing {
  display: grid;
  min-height: 360px;
  place-items: center;
  align-content: center;
  gap: 10px;
  text-align: center;
}

.empty-state .empty-icon,
.reflection-landing .empty-icon {
  display: grid;
  width: 86px;
  height: 86px;
  place-items: center;
  border-radius: 50%;
  background: rgba(242, 107, 85, 0.1);
  color: var(--coral);
  font-size: 31px;
}

.empty-state h2,
.reflection-landing h2 {
  margin: 8px 0 0;
}

.empty-state p,
.reflection-landing p {
  margin-bottom: 12px;
  color: var(--mineral-soft);
  font-size: 13px;
}

.timeline-list {
  max-width: 820px;
}

.timeline-row {
  display: grid;
  grid-template-columns: 15px minmax(0, 1fr);
  gap: 15px;
}

.timeline-node {
  position: relative;
}

.timeline-node::before {
  position: absolute;
  top: 5px;
  left: 4px;
  width: 9px;
  height: 9px;
  border: 3px solid var(--fog);
  border-radius: 50%;
  background: var(--coral);
  content: "";
}

.timeline-node::after {
  position: absolute;
  top: 17px;
  bottom: 0;
  left: 8px;
  width: 1px;
  background: var(--mist);
  content: "";
}

.timeline-row:last-child .timeline-node::after {
  display: none;
}

.timeline-content {
  padding-bottom: 25px;
}

.timeline-content header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.timeline-content strong {
  font-size: 13px;
}

.timeline-content time,
.timeline-content p {
  color: var(--mineral-soft);
  font-size: 10px;
}

.timeline-content p {
  margin: 6px 0 0;
}

.privacy-grid {
  margin-bottom: 16px;
}

.privacy-card {
  min-height: 170px;
  padding: 20px;
  background: rgba(250, 251, 247, 0.92);
}

.privacy-card h3 {
  margin-top: 16px;
  font-size: 15px;
}

.privacy-note {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(250, 251, 247, 0.92);
}

.privacy-note strong {
  display: block;
  margin-bottom: 8px;
}

.privacy-note p {
  margin: 0;
  color: var(--mineral-soft);
  font-size: 12px;
  line-height: 1.55;
}

.day-strip {
  min-width: 0;
  padding: 12px 42px 16px;
  border-top: 1px solid var(--line);
  background: rgba(250, 251, 247, 0.64);
}

.timeline-track {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 64px;
  align-items: center;
  gap: 10px;
}

.time-anchor {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--mineral-soft);
}

.time-anchor span {
  color: var(--coral);
  font-size: 17px;
}

.time-anchor small {
  font-size: 9px;
  font-weight: 700;
}

.time-anchor.evening span {
  color: var(--mineral);
}

.track-line {
  position: relative;
  height: 3px;
  overflow: visible;
  border-radius: 99px;
  background: var(--mist);
}

.track-progress {
  width: 58%;
  height: 3px;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--coral), var(--mineral));
}

.markers {
  position: absolute;
  inset: 0;
}

.marker {
  position: absolute;
  top: 50%;
  width: 9px;
  height: 9px;
  border: 2px solid var(--paper);
  border-radius: 50%;
  background: var(--coral);
  transform: translate(-50%, -50%);
}

.strip-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 74px 0;
  color: var(--mineral-soft);
  font-size: 10px;
  font-weight: 600;
}

.text-button {
  padding: 4px;
  color: var(--coral);
  font-size: 10px;
  font-weight: 750;
}

.modal-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(25, 42, 49, 0.32);
  backdrop-filter: blur(12px);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal {
  position: relative;
  width: min(460px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 28px;
  border-radius: 25px;
  background: var(--paper);
  box-shadow: 0 32px 90px rgba(25, 42, 49, 0.2);
}

.reflection-modal {
  width: min(620px, 100%);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 17px;
  color: var(--mineral-soft);
  font-size: 25px;
}

.modal-icon {
  display: grid;
  width: 44px;
  height: 44px;
  margin-bottom: 17px;
  place-items: center;
  border-radius: 50%;
  background: rgba(242, 107, 85, 0.11);
  color: var(--coral);
  font-size: 21px;
}

.modal h2 {
  margin: 7px 34px 9px 0;
  font-size: 25px;
  font-weight: 580;
  letter-spacing: -0.025em;
}

.modal-copy {
  color: var(--mineral-soft);
  font-size: 13px;
  line-height: 1.5;
}

.choice-list {
  display: grid;
  gap: 9px;
  margin: 20px 0;
}

.choice-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px;
  border: 0;
  border-radius: 14px;
  background: rgba(214, 223, 221, 0.42);
  color: var(--mineral);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

blockquote {
  margin: 20px 0;
  padding: 17px;
  border: 0;
  border-radius: 17px;
  background: rgba(242, 107, 85, 0.08);
  color: var(--mineral);
  font-family: ui-serif, Georgia, serif;
  font-size: 18px;
}

.reflection-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}

.reflection-stat {
  padding: 11px;
  border-radius: 13px;
  background: rgba(214, 223, 221, 0.35);
}

.reflection-stat strong {
  display: block;
  color: var(--coral);
  font-size: 21px;
}

.reflection-stat span {
  color: var(--mineral-soft);
  font-size: 9px;
}

.field-label,
.reflection-choices legend {
  display: block;
  margin-bottom: 8px;
  color: var(--mineral-soft);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

textarea {
  width: 100%;
  margin-bottom: 19px;
  padding: 12px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--fog);
  color: var(--mineral);
  font-size: 12px;
}

.reflection-choices {
  display: grid;
  gap: 8px;
  margin: 0 0 18px;
  padding: 0;
  border: 0;
}

.reflection-choices label {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px;
  border-radius: 11px;
  cursor: pointer;
  color: var(--mineral);
  font-size: 11px;
}

.reflection-choices label:has(input:checked) {
  background: rgba(242, 107, 85, 0.07);
}

input[type="radio"] {
  accent-color: var(--coral);
}

.toast {
  position: fixed;
  z-index: 200;
  right: 22px;
  bottom: 22px;
  max-width: 320px;
  padding: 11px 14px;
  border-radius: 13px;
  background: var(--night);
  color: white;
  box-shadow: var(--shadow);
  font-size: 11px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 820px) {
  .app-shell {
    display: block;
    overflow: visible;
  }

  .rail {
    position: fixed;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    height: 68px;
    flex-direction: row;
    gap: 6px;
    padding: 7px 10px;
    border-top: 1px solid var(--line);
    border-right: 0;
  }

  .brand-button,
  .profile-dot {
    display: none;
  }

  .rail-nav {
    display: grid;
    flex: 1;
    grid-template-columns: repeat(5, 1fr);
    gap: 3px;
  }

  .nav-item {
    min-height: 52px;
  }

  .workspace {
    min-height: calc(100vh - 68px);
    padding-bottom: 68px;
  }

  .topbar {
    padding: 20px 20px 0;
  }

  main {
    padding: 22px 20px 28px;
  }

  .agents-grid {
    grid-template-columns: 1fr;
  }

  .privacy-grid {
    grid-template-columns: 1fr;
  }

  .day-strip {
    padding-right: 20px;
    padding-left: 20px;
  }

  .strip-caption {
    padding-right: 4px;
    padding-left: 4px;
  }
}

@media (max-width: 560px) {
  .topbar {
    align-items: center;
  }

  .soft-copy,
  .local-badge span {
    display: none;
  }

  .local-badge {
    max-width: 142px;
    padding: 7px 9px;
    font-size: 9px;
  }

  main {
    min-height: 590px;
  }

  .compass {
    width: 112px;
    height: 112px;
  }

  .compass::before {
    width: 92px;
    height: 92px;
  }

  .compass-core {
    width: 64px;
    height: 64px;
  }

  .panel-footer,
  .active-intention,
  .screen-header {
    align-items: stretch;
    flex-direction: column;
  }

  .panel-footer .button,
  .active-intention .button,
  .screen-header .button {
    width: 100%;
  }

  .invited-parts {
    grid-template-columns: 1fr;
  }

  .reflection-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .modal-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .modal-footer .button {
    width: 100%;
  }

  .day-strip {
    position: relative;
  }

  .strip-caption #latest-event {
    max-width: 60%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

