/* 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:0 1 auto; justify-content:flex-end; min-width:0; gap:10px; }
.contact-filters { display:flex; flex-wrap:wrap; gap:6px 18px; }
.contact-filter { position:relative; display:inline-flex; align-items:center; gap:7px; min-height:42px; color:var(--muted); font-size:13px; font-weight:700; white-space:nowrap; cursor:pointer; }
.contact-filter>input { position:absolute; inset:0; width:100%; height:100%; min-height:0; margin:0; padding:0; opacity:0; cursor:pointer; }
.contact-filter-dot { display:grid; place-items:center; width:16px; height:16px; flex-shrink:0; border:1px solid var(--muted); border-radius:50%; transition:border-color 180ms; }
.contact-filter-dot::after { content:''; width:8px; height:8px; border-radius:50%; background:var(--accent); transform:scale(0); transition:transform 180ms; }
.contact-filter:has(input:checked) { color:var(--ink); }
.contact-filter input:checked+.contact-filter-dot { border-color:var(--accent); }
.contact-filter input:checked+.contact-filter-dot::after { transform:scale(1); }
.contact-search { position:relative; display:block; flex:0 1 auto; width:44px; min-width:44px; height:44px; border:1px solid var(--line); border-radius:9px; background:var(--surface-raised); color:var(--muted); overflow:hidden; transition:width 240ms var(--ui-motion-ease); }
.contact-search>.icon { position:absolute; top:13px; left:13px; width:17px; height:17px; pointer-events:none; }
.contact-search input { position:relative; display:block; width:100%; min-width:0; min-height:42px; height:42px; margin:0; padding:0; border:0; background:transparent; color:transparent; font-size:13px; cursor:pointer; }
.contact-search input::placeholder { color:transparent; }
.contact-search input::-webkit-search-cancel-button { display:none; }
.contact-search:focus-within { width:240px; }
.contact-search:focus-within input { padding:0 12px 0 39px; color:var(--ink); cursor:text; }
.contact-search:focus-within input::placeholder { color:var(--muted); }
.contact-search:focus-within input::-webkit-search-cancel-button { display:block; cursor:pointer; }
.contact-search.has-query>.icon { color:var(--accent); }
.inventory-toolbar:has(.contact-query) { flex-wrap:wrap; }
.contact-query { display:flex; align-items:center; gap:8px; max-width:100%; min-height:40px; padding:6px 12px; border:1px solid var(--line); border-radius:20px; color:var(--ink); background:var(--surface-raised); font-size:12px; }
.contact-query>.icon { width:14px; height:14px; flex-shrink:0; }
.contact-query>span:not(.contact-query-clear) { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.contact-query-clear { margin-left:auto; color:var(--accent); white-space:nowrap; }
.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(--ink); 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) {
  .contact-filters { gap:4px 13px; justify-content:space-between; }
  .contact-filter { font-size:11px; gap:5px; }
  .contact-search:focus-within { width:220px; }
  .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 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; } }
