/* App tour page: a tour rail beside a working mock of the Swift shell. Tokens come from styles.css. */
.demo-page { font-size: 15px; }
.dbar { display: flex; align-items: center; gap: 18px; height: 68px; }
.dbar-title { font-weight: 600; }
.dbar-actions { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.dbar .btn { height: 42px; }
@media (max-width: 760px) { .dbar-title .muted, .dbar .link { display: none; } }

.tour { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 28px; align-items: start; padding-bottom: 60px; }
.rail { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 18px; }
.rail-title { font-size: 34px; font-weight: 500; letter-spacing: -0.03em; line-height: 1.05; }
.rail-sub { color: var(--muted); font-size: 16px; }
.stops { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; counter-reset: stop; }
.stops button { width: 100%; text-align: left; font: inherit; font-size: 15px; font-weight: 500; height: 40px; padding: 0 14px; border: 0; border-radius: var(--pill); background: transparent; color: var(--muted); cursor: pointer; display: flex; align-items: center; gap: 10px; transition: background-color var(--t-hover) ease, color var(--t-hover) ease; }
.stops button::before { counter-increment: stop; content: counter(stop); width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 600; background: var(--surface-3); color: var(--text); }
.stops button.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.stops button.is-active::before { background: var(--accent); color: #fff; }
.stops button.is-done::before { background: var(--good-weak); color: var(--good); }
.step-card { background: var(--surface); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; }
.step-count { color: var(--muted); font-size: 14px; font-weight: 600; }
.step-card h2 { font-size: 22px; letter-spacing: -0.02em; font-weight: 600; }
.step-card p:not(.step-count) { font-size: 16px; line-height: 1.45; }
.step-nav { display: flex; gap: 8px; margin-top: 8px; }
.step-nav .btn { flex: 1; height: 44px; }

/* ---- the app shell ---- */
.app { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 760px; background: var(--bg); border: 1px solid var(--line-strong); border-radius: 22px; box-shadow: var(--shadow-lg); overflow: hidden; position: relative; }
.dtabs { display: none; }
.sidebar { padding: 20px 12px; display: flex; flex-direction: column; gap: 18px; background: var(--surface-2); border-right: 1px solid var(--line); }
.sb-brand { display: flex; align-items: center; gap: 10px; padding: 0 6px; }
.sb-brand .brand-mark { border-radius: 99px; width: 36px; height: 36px; font-size: 12px; }
.sb-name { font-weight: 600; font-size: 14px; line-height: 1.2; }
.sb-sub { font-size: 12.5px; color: var(--muted); }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 12px; font-weight: 600; color: var(--faint); padding: 0 14px 6px; }
.nav-link { display: flex; align-items: center; gap: 12px; height: 38px; padding: 0 14px; border-radius: var(--pill); color: var(--muted); font: inherit; font-size: 14px; font-weight: 500; border: 1px solid transparent; background: transparent; cursor: pointer; text-align: left; width: 100%; }
.nav-link svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.nav-link:hover { color: var(--text); background: var(--glass); }
.nav-link.is-active { color: var(--text); background: var(--surface); border-color: var(--glass-line); box-shadow: var(--shadow); }
.nav-link.is-active svg { color: var(--accent); }
.nav-count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; display: grid; place-items: center; background: var(--accent); color: #fff; font-size: 11.5px; font-weight: 600; }
.sb-foot { margin-top: auto; display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-md); background: var(--glass-strong); border: 1px solid var(--glass-line); font-size: 12.5px; }
.sb-foot b { display: block; }
.dot { width: 8px; height: 8px; margin-top: 5px; border-radius: 99px; background: var(--good); flex: none; box-shadow: 0 0 10px var(--good); }
.dot.you { background: var(--accent); box-shadow: 0 0 10px var(--accent); }

.main { padding: 22px 26px 40px; min-width: 0; }
.screen { display: none; flex-direction: column; gap: 16px; }
.screen.is-active { display: flex; animation: screen-in 240ms var(--ease-out); }
@keyframes screen-in { from { opacity: 0; transform: translateY(6px); } }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.page-head h2 { font-size: 26px; letter-spacing: -0.025em; font-weight: 600; }
.page-head p { color: var(--muted); font-size: 14px; margin-top: 2px; }
.back { background: none; border: 0; padding: 0; font: inherit; font-size: 13px; color: var(--muted); cursor: pointer; margin-bottom: 4px; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpis.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi { padding: 18px 18px 16px; display: flex; flex-direction: column; min-height: 132px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.kpi.hero { background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 18%, var(--surface)), var(--surface) 60%); border-color: color-mix(in srgb, var(--accent) 28%, var(--line)); }
.kpi-label { font-size: 14px; font-weight: 500; }
.kpi-value { margin-top: auto; padding-top: 14px; font-size: 30px; line-height: 1.1; font-weight: 400; letter-spacing: -0.03em; }
.kpi-sub { color: var(--muted); font-size: 13px; margin-top: 6px; }
.kpi-sub.good { color: var(--good); }

.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.card-pad { padding: 18px 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px 6px; }
.card-head b { font-size: 16px; }
.card-head p { color: var(--muted); font-size: 13px; margin-top: 2px; }
.card-body { padding: 10px 20px 18px; display: flex; flex-direction: column; gap: 10px; }
.list { display: flex; flex-direction: column; padding: 6px 8px 8px; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; width: 100%; text-align: left; font: inherit; color: inherit; background: transparent; border: 0; }
button.list-item { cursor: pointer; }
button.list-item:hover { background: var(--surface-2); }
.list-title { font-weight: 600; font-size: 14.5px; }
.list-sub { color: var(--muted); font-size: 13px; margin-top: 1px; }
.num { font-variant-numeric: tabular-nums; font-size: 14px; min-width: 56px; }
.grow { flex: 1; min-width: 0; }
.pill-tag.live { background: var(--accent-weak); color: var(--accent-ink); }
.pill-tag.warn { background: var(--warn-weak); color: var(--warn); }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.small { font-size: 13px; }

.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs button { font: inherit; font-size: 13.5px; font-weight: 600; height: 34px; padding: 0 12px; border-radius: var(--pill); border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.tabs button.is-active { background: var(--surface); color: var(--text); border-color: var(--glass-line); box-shadow: var(--shadow); }
.tabs .count { font-size: 12px; color: var(--muted); font-weight: 500; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 620px; }
th { text-align: left; font-weight: 600; font-size: 12.5px; color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--line); }
td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td .avatar { width: 28px; height: 28px; font-size: 12px; display: inline-grid; vertical-align: middle; margin-right: 10px; }
.r { text-align: right; }
tr.is-link { cursor: pointer; }
tr.is-link:hover td { background: var(--surface-2); }
table.plain { min-width: 0; margin-top: 8px; }
table.plain td { padding: 8px 0; }

/* lead */
.lead { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(240px, 0.8fr); gap: 14px; align-items: start; }
.thread-card { display: flex; flex-direction: column; }
.who { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); font-size: 14px; }
.who .btn { margin-left: auto; }
.inbox-thread { padding: 16px 18px; gap: 8px; }
.composer { display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--line); }
.composer input { flex: 1; min-width: 0; height: 38px; padding: 0 14px; border-radius: var(--pill); border: 1px solid var(--line-strong); background: var(--bg); font: inherit; font-size: 14px; color: var(--text); }
.composer input:focus { outline: none; border-color: var(--accent); }
.details { display: flex; flex-direction: column; gap: 12px; }
.kv { margin: 10px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 500; }
.seq { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.seq li::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 10px; background: var(--surface-3); }
.seq li.done::before { background: var(--good); } .seq li.off { color: var(--muted); }

/* jobs */
.wave-track { display: flex; flex-direction: column; gap: 6px; margin: 6px 0 4px; }
.wave-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--surface-2); font-size: 14px; }
.wave-row .grow { display: flex; flex-direction: column; }
.wave-row .muted { font-size: 12.5px; }
.wave-row.is-accepted { background: var(--good-weak); }

/* calendar */
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.legend .k { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.k.assigned { background: var(--accent); } .k.open { background: var(--warn); } .k.done { background: var(--good); }
.cal { display: grid; grid-template-columns: 52px repeat(6, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.cal-head { padding: 10px 6px; text-align: center; font-size: 12.5px; color: var(--muted); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; gap: 2px; }
.cal-head b { font-size: 18px; font-weight: 500; color: var(--text); width: 30px; height: 30px; display: grid; place-items: center; border-radius: 99px; }
.cal-head.today b { background: var(--accent); color: #fff; }
.cal-hour { font-size: 11.5px; color: var(--faint); padding: 4px 6px 0; text-align: right; height: 56px; border-right: 1px solid var(--line); }
.cal-cell { height: 56px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); position: relative; background: none; padding: 0; cursor: pointer; }
.cal-cell:nth-child(7n) { border-right: 0; }
.cal-cell:hover { background: var(--accent-weak); }
.cal-cell.is-busy { cursor: default; } .cal-cell.is-busy:hover { background: none; }
.ev { position: absolute; left: 3px; right: 3px; top: 2px; border-radius: 8px; padding: 6px 8px; font-size: 12px; line-height: 1.25; color: #fff; background: var(--accent); z-index: 1; overflow: hidden; }
.ev b { display: block; font-size: 12.5px; }
.ev.open { background: var(--warn); } .ev.done { background: var(--good); } .ev.new { background: var(--text); color: var(--bg); animation: screen-in 240ms var(--ease-out); }

/* crew */
.crew-wrap { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 18px; align-items: start; }
.crew-phone { background: var(--surface); border: 1px solid var(--line-strong); border-radius: 30px; padding: 16px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow-lg); }
.crew-top { display: flex; align-items: center; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line); font-size: 13px; }
.crew-top b { display: block; } .crew-top .pill-tag { margin-left: auto; }
.crew-job { display: flex; flex-direction: column; gap: 2px; }
.crew-list { display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.crew-list label { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); cursor: pointer; }
.crew-list input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.crew-list label:has(input:checked) { color: var(--muted); text-decoration: line-through; }
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.ph { aspect-ratio: 1; border-radius: 12px; display: grid; place-items: center; font-size: 12.5px; font-weight: 600; background: var(--surface-3); color: var(--text); }
.ph.done { background: linear-gradient(145deg, #e9e2d6, #cfc6b8); color: #3b342b; }
.ph.add { border: 1px dashed var(--line-strong); background: transparent; color: var(--muted); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; display: flex; flex-direction: column; gap: 4px; align-items: center; justify-content: center; }
.ph.add svg { fill: none; stroke: currentColor; stroke-width: 2; }
.crew-side { align-self: start; }

/* marketing */
.spendcap { display: flex; flex-direction: column; gap: 6px; padding: 12px 0; border-top: 1px solid var(--line); }
.spendcap-head { display: flex; justify-content: space-between; font-size: 14px; }
.spendcap input[type=range] { width: 100%; accent-color: var(--accent); margin: 4px 0; }
.spendcap .meter { height: 8px; }

/* tour spotlight */
[data-spot].is-spot { outline: 3px solid var(--accent); outline-offset: 6px; border-radius: 16px; animation: spot 1.2s var(--ease-out) 2; }
@keyframes spot { 0% { outline-offset: 14px; outline-color: transparent; } 100% { outline-offset: 6px; } }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; background: var(--btn-bg); color: var(--btn-fg); padding: 12px 18px; border-radius: var(--pill); font-size: 14px; font-weight: 500; box-shadow: var(--shadow-lg); z-index: 30; transition: transform var(--t-ui) var(--ease-out), opacity var(--t-ui) ease; pointer-events: none; max-width: calc(100% - 32px); }
.toast.is-on { transform: translate(-50%, 0); opacity: 1; }

@media (max-width: 1100px) {
  .tour { grid-template-columns: 1fr; }
  .rail { position: static; }
  .stops { display: none; }
  .step-card { position: sticky; bottom: 12px; z-index: 5; order: 2; }
  .app { order: 1; }
  .rail { gap: 10px; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; min-height: 0; }
  .sidebar { display: none; }
  .dtabs { display: flex; gap: 4px; overflow-x: auto; padding: 10px 12px 0; scrollbar-width: none; }
  .dtabs button { font: inherit; font-size: 13.5px; font-weight: 600; height: 34px; padding: 0 12px; border-radius: var(--pill); border: 1px solid transparent; background: transparent; color: var(--muted); white-space: nowrap; cursor: pointer; }
  .dtabs button.is-active { background: var(--surface); color: var(--text); border-color: var(--glass-line); box-shadow: var(--shadow); }
  .main { padding: 14px 12px 24px; }
  .kpis, .kpis.three, .two, .lead, .crew-wrap { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi { min-height: 110px; }
  .kpi-value { font-size: 26px; }
  .cal { grid-template-columns: 40px repeat(6, minmax(0, 1fr)); }
  .ev { font-size: 10.5px; padding: 4px 5px; } .ev b { font-size: 11px; }
  .crew-phone { border-radius: 22px; }
  .rail-title { font-size: 28px; }
}
