:root {
  --bg: #f6f3ee;
  --card: #ffffff;
  --text: #1d2b2a;
  --muted: #5a6b6a;

  --green-900: #2f5b4f;
  --green-800: #356658;
  --green-100: #e7efea;

  --line: rgba(0, 0, 0, 0.06);

  --radius-lg: 3px;
  --radius-md: 3px;

  --shadow-soft: 0 8px 18px rgba(0, 0, 0, 0.05);
  --shadow: 0 10px 24px rgba(0, 0, 0, 0.06);

  /* Icon stroke colour — change to #000 to go monochrome */
  --pref-icon-color: #2b8a6e;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: radial-gradient(
      circle at 15% 0%,
      rgba(47, 91, 79, 0.14),
      transparent 44%
    ),
    radial-gradient(circle at 90% 15%, rgba(47, 91, 79, 0.1), transparent 42%),
    var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  line-height: 1.4;
}

.container {
  width: min(980px, calc(100% - 40px));
  margin: 0 auto;
}

/* Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 14px 0 12px;
  background: rgba(246, 243, 238, 0.7);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.app-header .container {
  display: grid;
  gap: 10px;
  justify-items: center;
}

.brand-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 3px;
  background: var(--green-900);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-soft);
}

.brand-icon svg {
  width: 20px;
  height: 20px;
}

.brand-text {
  display: grid;
  gap: 2px;
}

.brand-title {
  font-weight: 800;
  letter-spacing: -0.2px;
  font-family: ui-serif, Georgia, "Times New Roman", Times, serif;
  font-size: 20px;
}

.brand-subtitle {
  font-size: 12px;
  color: var(--muted);
}

.top-nav {
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 8px 10px;
  display: inline-flex;
  gap: 10px;
  box-shadow: var(--shadow-soft);
}

.nav-btn {
  border: 0;
  background: transparent;
  width: 44px;
  height: 34px;
  border-radius: 2px;
  display: grid;
  place-items: center;
  color: var(--green-900);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.06s ease;
}

.nav-btn--active {
  background: rgba(47, 91, 79, 0.14);
  border: 0;
}

.nav-btn--active:hover {
  background: rgba(47, 91, 79, 0.18);
}

.nav-btn:hover {
  background: rgba(47, 91, 79, 0.08);
}

.nav-btn:active {
  transform: translateY(1px);
}

.nav-btn svg {
  width: 18px;
  height: 18px;
}

/* Page */
.page {
  padding: 18px 0 44px;
}

h1 {
  margin: 18px 0 6px;
  font-family: ui-serif, Georgia, "Times New Roman", Times, serif;
  font-size: 34px;
  letter-spacing: -0.4px;
}

.page-subtitle {
  margin: 0 0 14px;
  color: var(--muted);
  max-width: 520px;
}

/* Partner invite banner styles live in shell.css */
.partner-invite-banner {
  margin-top: 14px;
}

.actions-row {
  margin: 10px 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.partner-pref-info {
  flex: 1 1 0;
  min-width: 0;
  padding: 9px 12px;
  border-radius: 3px;
  background: rgba(47, 91, 79, 0.06);
  border: 1px solid rgba(47, 91, 79, 0.14);
  font-size: 12px;
  color: var(--green-900, #2f5b4f);
  line-height: 1.4;
}

.partner-pref-info[hidden] {
  display: none;
}

/* Buttons */
.btn {
  border: 0;
  cursor: pointer;
  border-radius: 2px;
  padding: 11px 14px;
  font-weight: 750;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform 0.06s ease, box-shadow 0.18s ease, opacity 0.18s ease, background 0.18s ease;
  user-select: none;
  min-height: 44px;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--green-900);
  color: #fff;
  box-shadow: var(--shadow-soft);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.7);
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.9);
}

.btn-icon {
  font-size: 15px;
  color: var(--green-900);
}

/* Cards */
.cards {
  display: grid;
  gap: 14px;
}

.card {
  position: relative;
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(0, 0, 0, 0.03);
  padding: 16px;
  transition: background 0.2s ease, opacity 0.2s ease, filter 0.2s ease, box-shadow 0.25s ease;
}

.card--has-toggle {
  padding-right: 16px;
}

.card--disabled {
  background: #ecebe8;
  opacity: 1;
  filter: grayscale(0.18);
}

.card--disabled .pref-icon {
  background: rgba(47, 91, 79, 0.42);
}

.card--disabled .pref-icon--image {
  background: rgba(255, 255, 255, 0.72);
}

.card--disabled .pref-icon--image .pref-icon-img {
  opacity: 0.58;
  filter: saturate(0.72) grayscale(0.12);
}

.card--disabled .pref-title,
.card--disabled .pref-desc,
.card--disabled .importance-head,
.card--disabled .value-badge,
.card--disabled .price-label,
.card--disabled .notes-label {
  color: #7b8582;
}

.card--disabled .distance-input,
.card--disabled .price-input,
.card--disabled .price-select,
.card--disabled .notes-input {
  background: rgba(0, 0, 0, 0.04);
  color: #7b8582;
}

.card--disabled input[type="range"] {
  opacity: 0.35;
  pointer-events: none;
}

.card-top {
  display: grid;
  grid-template-columns: 46px 46px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.card--has-toggle .card-top {
  padding-right: 72px;
}

.pref-rank {
  width: 46px;
  height: 46px;
  border-radius: 3px;
  background: rgba(47, 91, 79, 0.12);
  color: var(--green-900);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.pref-rank--off {
  background: rgba(0, 0, 0, 0.06);
  color: #7b8582;
}

.pref-icon {
  width: 46px;
  height: 46px;
  border-radius: 3px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.pref-icon--svg {
  background: rgba(43, 138, 110, 0.09);
  border: 1px solid rgba(43, 138, 110, 0.16);
  color: var(--pref-icon-color);
}

.pref-icon--image {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(47, 91, 79, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}

.pref-icon svg {
  width: 22px;
  height: 22px;
}

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

.pref-title {
  margin: 0;
  font-family: ui-serif, Georgia, "Times New Roman", Times, serif;
  font-size: 18px;
  letter-spacing: -0.2px;
}

.pref-desc {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.distance-block,
.price-block {
  margin-top: 14px;
}

.notes-field {
  margin-top: 14px;
  display: grid;
  gap: 6px;
}

.notes-label {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}

.notes-input {
  width: 100%;
  min-height: 84px;
  resize: vertical;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 2px;
  padding: 12px 12px;
  font: inherit;
  font-size: 14px;
  line-height: 1.4;
  color: var(--text);
  background: #fff;
}

.notes-input:focus {
  outline: none;
  border-color: rgba(47, 91, 79, 0.55);
  box-shadow: 0 0 0 4px rgba(47, 91, 79, 0.12);
}

/* Delete */
.pref-delete {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 2px;
  border: 0;
  background: rgba(0, 0, 0, 0.05);
  color: var(--muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 16px;
  font-weight: 800;
  transition: background 0.15s ease, transform 0.06s ease, opacity 0.15s ease;
  z-index: 3;
}

.pref-delete:hover {
  background: rgba(0, 0, 0, 0.09);
  opacity: 0.95;
}

.pref-delete:active {
  transform: translateY(1px);
}

/* Toggle */
.pref-switch {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 58px;
  height: 34px;
  display: inline-block;
  z-index: 4;
}

.pref-switch-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.pref-switch-slider {
  position: absolute;
  inset: 0;
  cursor: pointer;
  background: #cfd5d2;
  border-radius: 999px;
  transition: 0.25s ease;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.pref-switch-slider::before {
  content: "";
  position: absolute;
  height: 28px;
  width: 28px;
  left: 3px;
  top: 3px;
  background: #ffffff;
  border-radius: 50%;
  transition: 0.25s ease;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.22);
}

.pref-switch-input:checked + .pref-switch-slider {
  background: var(--green-900);
}

.pref-switch-input:checked + .pref-switch-slider::before {
  transform: translateX(24px);
}

.pref-switch-input:focus + .pref-switch-slider {
  box-shadow:
    0 0 0 3px rgba(47, 91, 79, 0.16),
    inset 0 0 0 1px rgba(0, 0, 0, 0.05);
}

/* Importance */
.importance-row {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.importance-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.value-badge {
  font-weight: 800;
  color: var(--green-800);
}

.value-badge.critical {
  color: #d97706;
}

.value-badge--off {
  color: #8b9493;
}

.range-wrap {
  display: grid;
  gap: 6px;
  width: 100%;
}

.value-badge.high {
  color: var(--green-800);
}

.value-badge.low {
  color: #778b85;
}

.importance-choice-group {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}

.importance-choice {
  min-height: 38px;
  border-radius: 2px;
  border: 1px solid rgba(47, 91, 79, 0.12);
  background: rgba(255, 255, 255, 0.8);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.importance-choice:hover {
  background: rgba(47, 91, 79, 0.08);
  color: var(--green-900);
}

.importance-choice.is-active {
  background: var(--green-900);
  color: #ffffff;
  border-color: rgba(47, 91, 79, 0.2);
  box-shadow: var(--shadow-soft);
}

.importance-choice:disabled {
  cursor: default;
  background: rgba(0, 0, 0, 0.04);
  color: #8b9493;
  box-shadow: none;
}

/* Price */
.price-block {
  display: grid;
  gap: 10px;
}

.price-field {
  display: grid;
  gap: 6px;
}

.price-label {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}

.price-input,
.price-select {
  width: 100%;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 2px;
  padding: 12px 12px;
  font-size: 14px;
  outline: none;
  background: #fff;
}

.price-input:focus,
.price-select:focus {
  border-color: rgba(47, 91, 79, 0.55);
  box-shadow: 0 0 0 4px rgba(47, 91, 79, 0.12);
}

/* Inputs */
.distance-input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 2px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  font-size: 15px;
  overflow-x: auto;
  white-space: nowrap;
  margin-top: 10px;
}

.label {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}

input[type="text"] {
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 2px;
  padding: 12px 12px;
  font-size: 14px;
  outline: none;
}

input[type="text"]:focus,
.distance-input:focus {
  border-color: rgba(47, 91, 79, 0.55);
  box-shadow: 0 0 0 4px rgba(47, 91, 79, 0.12);
}

/* Add custom */
.add-custom {
  width: 100%;
  margin-top: 14px;
  border-radius: 3px;
  padding: 16px;
  background: transparent;
  border: 2px dashed rgba(47, 91, 79, 0.25);
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, transform 0.06s ease;
}

.add-custom:hover {
  background: rgba(47, 91, 79, 0.06);
}

.add-custom:active {
  transform: translateY(1px);
}

.plus {
  font-size: 18px;
  color: var(--green-900);
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: grid;
  place-items: center;
  padding: 18px;
  z-index: 50;
}

.modal {
  width: min(520px, 100%);
  background: #fff;
  border-radius: 3px;
  box-shadow: var(--shadow);
  padding: 14px;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.modal-title {
  font-weight: 900;
  font-size: 16px;
}

.icon-close {
  border: 0;
  background: rgba(0, 0, 0, 0.04);
  width: 36px;
  height: 36px;
  border-radius: 2px;
  cursor: pointer;
}

.field {
  display: grid;
  gap: 6px;
  margin: 10px 0;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
}

.modal-actions--split {
  justify-content: space-between;
}

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

.modal--summary {
  width: min(560px, 100%);
  max-height: min(86vh, 760px);
  display: flex;
  flex-direction: column;
}

.summary-copy {
  margin: 0 0 12px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.4;
}

.summary-list {
  display: grid;
  gap: 8px;
  max-height: min(44vh, 360px);
  overflow: auto;
  padding-right: 4px;
  overscroll-behavior: contain;
}

.summary-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 2px;
  background: rgba(47, 91, 79, 0.06);
  border: 1px solid rgba(47, 91, 79, 0.08);
}

.summary-item-left {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.summary-rank {
  width: 28px;
  height: 28px;
  border-radius: 2px;
  background: rgba(47, 91, 79, 0.12);
  color: var(--green-900);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 900;
  flex: 0 0 auto;
}

.summary-text {
  min-width: 0;
  display: flex;
  align-items: center;
  min-height: 28px;
}

.summary-title {
  min-width: 0;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
}

.summary-score {
  color: var(--green-900);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

/* Next button */
.next-nav {
  margin-top: 16px;
  display: grid;
  justify-items: center;
  gap: 8px;
}

.next-inline {
  width: 54px;
  height: 54px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(47, 91, 79, 0.12);
  border: 1px solid rgba(47, 91, 79, 0.28);
  color: var(--green-900);
  text-decoration: none;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.06s ease, box-shadow 0.15s ease;
}

.next-inline:hover {
  background: rgba(47, 91, 79, 0.18);
  box-shadow: var(--shadow);
}

.next-inline:active {
  transform: translateY(1px);
}

.next-inline svg {
  width: 22px;
  height: 22px;
  stroke: var(--green-900);
  stroke-width: 2.4;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.next-caption {
  margin: 0;
  text-align: center;
  color: var(--muted);
  max-width: 88px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.25;
  text-transform: lowercase;
}

@media (min-width: 960px) {
  .container {
    width: min(1180px, calc(100% - 48px));
  }
}

@media (max-width: 959px) {
  .card-top {
    grid-template-columns: 46px 46px minmax(0, 1fr);
    gap: 10px;
  }

  .pref-rank {
    width: 46px;
    height: 46px;
    font-size: 12px;
  }

  .modal-actions--split {
    flex-direction: column-reverse;
  }

  .summary-item {
    align-items: center;
    gap: 10px;
  }

  .summary-item-left {
    align-items: center;
  }

  .summary-score {
    font-size: 12px;
  }

  .summary-list {
    max-height: min(42vh, 320px);
  }
}
