/* Pack page: mode switcher, Steps (Wizard A) and Chat (Wizard B). Tokens come from style.css. */
.pack-page { padding-top: 28px; padding-bottom: 48px; display: flex; flex-direction: column; gap: 16px; }
.pack-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.pack-head > div:first-child { display: flex; flex-direction: column; gap: 6px; }
.pack-h1 { font-size: 40px; }
.mode-switch { display: flex; gap: 6px; padding: 4px; background: var(--card); border: 1.5px solid var(--ink); border-radius: 8px; }
.mode-switch button { display: flex; flex-direction: column; align-items: flex-start; gap: 0; border: 0; background: transparent; border-radius: 5px; padding: 8px 14px; min-height: 44px; font: 600 15px var(--sans); color: var(--ink); cursor: pointer; text-align: left; }
.mode-switch button small { font: 400 12px var(--sans); color: var(--sub); }
.mode-switch button[aria-selected="true"] { background: var(--brand); color: #fff; }
.mode-switch button[aria-selected="true"] small { color: #DCD8FA; }
.repeat-banner { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; background: var(--tint); border: 1.5px solid var(--brand); border-radius: 6px; padding: 12px 16px; font-size: 15px; }
.save-note { margin-top: 4px; }
#part4-home .part { margin-top: 0; }
.mode-panel .parts { padding-top: 0; padding-bottom: 20px; }

/* ---------- Steps ---------- */
.steps-layout { display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-start; }
.rail { list-style: none; margin: 0; padding: 0; flex: 0 0 200px; display: flex; flex-direction: column; gap: 4px; }
.rail button { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px; border: 1.5px solid transparent; border-radius: 6px; background: none; font: 15px var(--sans); color: var(--sub); cursor: pointer; text-align: left; min-height: 44px; }
.rail .dot { flex: none; width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid #B9B0E8; display: grid; place-items: center; font-size: 13px; }
.rail button.done .dot { background: #E4E0FA; border-color: #E4E0FA; color: var(--brand); }
.rail button.now { background: var(--card); border-color: var(--ink); color: var(--ink); font-weight: 600; }
.rail button.now .dot { background: var(--brand); border-color: var(--brand); color: #fff; }
.step-card { flex: 1 1 480px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.step-kicker { font: 13px var(--mono); color: var(--brand); letter-spacing: 0.06em; }
.step-card h2 { margin: 0; font: 600 34px/1.1 var(--serif); letter-spacing: -0.02em; }
.step-body { display: flex; flex-direction: column; gap: 14px; }
.sf { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--sub); }
.sf > span { font-weight: 500; color: var(--ink); }
.sf input, .sf textarea { border: 1.5px solid var(--line); border-radius: 6px; padding: 10px 12px; font: 16px var(--sans); color: var(--ink); background: var(--card); min-height: 44px; width: 100%; }
.sf input.mono { font-family: var(--mono); font-size: 15px; }
.sf input:focus, .sf textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--tint); }
.sf small { font-size: 13px; color: var(--sub); }
.sf .cur-other { margin-top: 6px; max-width: 160px; }
.sgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.sgrid .sf.wide { grid-column: 1 / -1; }
.more > summary { cursor: pointer; color: var(--brand); font-size: 14px; padding: 4px 0 10px; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile { display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: left; background: var(--card); border: 1.5px solid var(--line); border-radius: 6px; padding: 12px 14px; min-height: 60px; font: 15px var(--sans); color: var(--ink); cursor: pointer; }
.tile span:first-child { display: flex; flex-direction: column; }
.tile small { font-size: 13px; color: var(--sub); }
.tile .code { font: 13px var(--mono); color: var(--sub); }
.tile.on { border: 2px solid var(--brand); box-shadow: 0 0 0 3px var(--tint); }
.tile.on .code { color: var(--brand); }
.tile.other { border-style: dashed; border-color: var(--brand-soft); flex-direction: column; align-items: flex-start; justify-content: center; gap: 0; color: #3A2FA6; }
.becomes { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 10px 14px; font-size: 14px; color: var(--sub); }
.becomes b { color: var(--ink); }
.inv-card { border: 1.5px solid var(--ink); border-radius: 6px; background: var(--card); padding: 14px 16px; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.inv-card legend { font: 13px var(--mono); padding: 0 6px; display: flex; gap: 12px; align-items: center; }
.tick { display: flex; gap: 10px; align-items: center; font-size: 14px; color: var(--ink); min-height: 44px; }
.tick input { width: 18px; height: 18px; }
.step-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; }
.why { flex: 0 0 240px; background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 14px 16px; }
.why span { font: 12px var(--mono); color: var(--sub); letter-spacing: 0.06em; }
.why p { margin: 6px 0 0; font-size: 14px; line-height: 1.55; }

/* ---------- Chat ---------- */
.chat-layout { display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-start; }
.chat-col { flex: 1 1 460px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.chat-log { display: flex; flex-direction: column; gap: 10px; }
.bub { max-width: 82%; padding: 10px 14px; font-size: 15px; line-height: 1.5; }
.bub.bot { align-self: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: 4px 14px 14px 14px; }
.bub.bot.ask { border: 1.5px solid var(--brand); }
.bub.bot small { display: block; font-size: 13px; color: var(--sub); margin-top: 4px; }
.bub.me { align-self: flex-end; background: var(--brand); color: #fff; border-radius: 14px 4px 14px 14px; }
.chat-input { display: flex; gap: 8px; background: var(--card); border: 1.5px solid var(--ink); border-radius: 8px; padding: 6px 6px 6px 14px; align-items: center; margin-top: 4px; }
.chat-input input { flex-grow: 1; border: 0; font: 17px var(--sans); color: var(--ink); min-height: 40px; background: transparent; min-width: 0; }
.chat-input input.mono { font-family: var(--mono); }
.chat-input input:focus { outline: none; }
.chat-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--sub); }
#chat-part4 { align-self: stretch; margin-top: 8px; }
.live { flex: 0 1 440px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.live-head { display: flex; justify-content: space-between; font: 12px var(--mono); color: var(--sub); letter-spacing: 0.06em; }
.live-sheet { background: #fff; border: 1px solid var(--line); box-shadow: 0 18px 40px -26px rgba(26,27,58,0.45); padding: 20px; }
.live-title { font: 20px var(--serif); margin-bottom: 12px; }
.live-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); border-top: 1px solid var(--ink); border-left: 1px solid var(--ink); font-size: 13px; }
.live-grid span { padding: 7px 8px; border-right: 1px solid var(--ink); border-bottom: 1px solid var(--ink); overflow-wrap: anywhere; }
.live-grid .l { color: var(--sub); }
.live-grid .v { font-weight: 600; }
.live-grid .empty { color: #9A97B5; font-weight: 400; }
.live-grid .on { background: var(--tint); color: var(--brand-dark); font-weight: 600; }
.live-note { margin: 12px 0 0; font-size: 13px; color: var(--sub); }

@media (max-width: 900px) {
  .why { flex-basis: 100%; }
  .live { flex-basis: 100%; }
}
@media (max-width: 720px) {
  .pack-h1 { font-size: 32px; }
  .mode-switch { width: 100%; }
  .mode-switch button { flex: 1 1 0; padding: 8px 10px; }
  .mode-switch button small { display: none; }
  .rail { flex-basis: 100%; flex-direction: row; overflow-x: auto; }
  .rail button { white-space: nowrap; padding: 8px; }
  .tiles, .sgrid { grid-template-columns: 1fr; }
  .step-card h2 { font-size: 27px; }
  .bub { max-width: 92%; }
}
