/* Keep the four numbered stages visually connected. */
.stage-steps { gap: 6px 9px; flex-wrap: nowrap; }
.stage-steps li { white-space: nowrap; }
.stage-steps li:not(:last-child)::after { content: '−'; margin-left: 3px; color: var(--muted); opacity: .6; font-weight: 400; }

/* The same compact toolbar is used in the phonebook and relationship view. */
.contacts-modal .inventory-toolbar, .step-1 .inventory-toolbar { flex-direction: row; align-items: center; justify-content: space-between; gap: 14px; }
.contacts-modal .inventory-controls, .step-1 .inventory-controls { display: flex; flex: 1; max-width: 560px; min-width: 0; gap: 10px; }
.inventory-controls .search-field { flex: 1; min-width: 100px; }
.contact-sort { position: relative; flex-shrink: 0; }
.sort-trigger { position: relative; display: flex; align-items: center; justify-content: center; gap: 9px; min-height: 44px; padding: 10px 13px; background: var(--surface-raised); color: var(--ink); border: 1px solid var(--line); border-radius: 9px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.sort-trigger .icon { width: 17px; height: 17px; }
.sort-trigger .sort-chevron { width: 12px; transform: rotate(90deg); }
.sort-dismiss { position: fixed; inset: 0; width: 100%; height: 100%; border: 0; background: transparent; cursor: default; z-index: 3; }
.sort-options { position: absolute; z-index: 4; right: 0; top: calc(100% + 8px); width: max-content; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); box-shadow: 0 12px 35px #0003; }
.sort-option { display: grid; grid-template-columns: 2.5em 60px; align-items: center; gap: 10px; padding: 5px 8px; color: var(--ink); font-size: 13px; font-weight: 800; }
.sort-switch { position: relative; display: grid; grid-template-columns: 1fr 1fr; align-items: center; height: 30px; border-radius: 99px; background: var(--surface-raised); box-shadow: inset 0 0 0 1px var(--line); transition: background-color 180ms; }
.sort-switch.is-selected { background: var(--accent); box-shadow: none; }
.sort-switch-thumb { position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fffaf5; box-shadow: 0 2px 4px #0002; opacity: 0; transform: translateX(0); transition: transform 180ms ease, opacity 120ms; }
.sort-switch.is-selected .sort-switch-thumb { opacity: 1; }
.sort-switch.is-descending .sort-switch-thumb { transform: translateX(30px); }
.sort-direction { position: relative; display: grid; place-items: center; width: 30px; height: 40px; margin: -5px 0; cursor: pointer; }
.sort-direction input { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; min-height: 0; margin: 0; padding: 0; border: 0; opacity: 0; cursor: pointer; }
.sort-direction>span { display: grid; place-items: center; width: 24px; height: 24px; color: var(--muted); transition: color 120ms; }
.sort-direction .icon { width: 16px; height: 16px; stroke-width: 2; }
.sort-switch.is-selected .sort-direction>span { color: var(--bg); }
.sort-switch .sort-direction input:checked+span { color: #b54565; }
.sort-direction input:checked+span .icon { stroke-width: 3; }
.sort-direction:hover>span { color: var(--accent); }

/* Used activities stay visible but cannot be charged again this week. */
.growth-grid .growth-card.is-complete:disabled { opacity: .72; filter: none; }
.growth-card.is-complete>img { filter: saturate(.35) brightness(.7); }
.growth-completed { position: absolute; top: 12px; right: 12px; z-index: 2; display: inline-flex; align-items: center; gap: 5px; border: 1px solid #ffffff50; border-radius: 20px; padding: 6px 10px; color: white; background: #292937de; font-size: 12px; font-weight: 800; }
.growth-completed .icon { width: 14px; height: 14px; color: #cce5af; }

.game-header .progress-status dd>strong { color: var(--accent); font-weight: inherit; }
.game-header .progress-status .progress-charm dd>strong { color: var(--mint); }
.stage-steps .done>span .icon { stroke-width: 3; }

@media(max-width:820px) {
  .contacts-modal .inventory-toolbar, .step-1 .inventory-toolbar { flex-direction: column; align-items: stretch; }
  .contacts-modal .inventory-controls, .step-1 .inventory-controls { max-width: none; }
  .contacts-modal:has(.sort-options) { min-height: min(480px,calc(100dvh - 24px)); }
}
@media(max-width:600px) {
  .stage-steps { gap: 4px; }
  .stage-steps li { gap: 3px; font-size: 9px; }
  .stage-steps li:not(:last-child)::after { margin-left: 1px; }
  .sort-trigger { min-height: 42px; padding: 8px 10px; gap: 6px; font-size: 11px; }
}
@media(max-width:360px) {
  .stage-steps { gap: 3px; }
  .stage-steps li { font-size: 8px; gap: 2px; }
  .stage-steps li>span { width: 13px; height: 13px; font-size: 8px; }
  .sort-trigger { padding: 8px; gap: 4px; }
  .sort-trigger .icon { width: 14px; }
  .sort-trigger .sort-chevron { width: 10px; }
}

/* The notice remains inside the game, with the shared sticky back control. */
.title-version button { border: 0; padding: 0; background: none; color: inherit; font: inherit; letter-spacing: 0; cursor: pointer; }
.title-version button:hover { text-decoration: underline; }
.licenses-modal { width: min(800px,100%); max-width: 800px; padding-top: 0; }
.license-content h2 { font-size: clamp(24px,4vw,30px); margin-top: 8px; }
.license-content h3 { font-size: 18px; margin: 28px 0 10px; }
.license-content p { font-size: 13px; line-height: 1.8; color: var(--muted); }
.license-notice { margin: 10px 0; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-raised); }
.license-notice summary { padding: 14px; cursor: pointer; font-size: 13px; font-weight: 700; }
.license-notice pre { margin: 0; padding: 4px 14px 18px; white-space: pre-wrap; overflow-wrap: anywhere; font: 12px/1.7 ui-monospace,monospace; color: var(--muted); }
.license-notice>p { padding: 0 14px 14px; }
.license-content { padding: 0 28px 28px; }
@media(max-width:540px) { .license-content { padding: 0 20px 20px; } }
