/* Platform tour: an Olmi window for each part of the clinic (sidebar | Olmi | the page) that plays
   one real moment as it comes into view (platform-tour.js). The list beside each window follows
   the moment, and whatever Olmi is touching is ringed on the page, so the key parts stand out. */

.pt-intro, .pt { width: calc(100% - 100px); max-width: 1400px; margin-inline: auto; }
#intake, #programs-tour, #handoffs-tour, #inventory-tour { scroll-margin-top: 96px; }

/* ---------------------------------------------------------------- lead-in */

.pt-intro { display: grid; grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr); gap: 64px; padding: 150px 0 0; }
.pt-intro-label { margin: 12px 0 0; font-size: 13px; color: var(--text-muted); }
.pt-intro h2 { max-width: 640px; margin: 0 0 22px; font-size: clamp(32px, 3.4vw, 48px); font-weight: 400; line-height: 1.08; letter-spacing: -.05em; color: var(--text-strong); }
.pt-intro p:not(.pt-intro-label) { max-width: 560px; margin: 0; font-size: 17px; line-height: 1.65; color: var(--text-muted); }

/* ---------------------------------------------------------------- one part of the clinic */

.pt { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); align-items: center; gap: clamp(36px, 4.6vw, 76px); padding-top: 130px; }
.pt-copy { display: grid; align-content: start; gap: 20px; }
.pt-copy h2 { margin: 0; font-size: clamp(30px, 2.7vw, 40px); font-weight: 400; line-height: 1.06; letter-spacing: -.05em; color: var(--text-strong); }
.pt-lead { margin: 0; font-size: 16px; line-height: 1.6; color: var(--text-muted); text-wrap: pretty; }
.pt-beats { display: grid; margin: 6px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.pt-beats li { display: grid; grid-template-columns: 32px minmax(0, 1fr); align-items: baseline; padding: 12px 0; border-bottom: 1px solid var(--line); }
.pt-beats li > span { font: 500 11px/1 var(--font-mono); letter-spacing: .08em; color: var(--moss-500); transition: color 400ms ease; }
.pt-beats p { margin: 0; font-size: 14px; line-height: 1.45; color: var(--text-subtle); transition: color 400ms ease; }
.pt-beats strong { font-weight: 500; color: var(--text-muted); transition: color 400ms ease; }
.pt-beats li.is-marked > span { color: var(--olive-600); }
.pt-beats li.is-marked p { color: var(--text-muted); }
.pt-beats li.is-marked strong { color: var(--text-strong); }
.pt-note { margin: 0; font-size: 13px; line-height: 1.6; color: var(--text-subtle); }

/* ---------------------------------------------------------------- the window */

.pt-window { position: relative; min-width: 0; margin: 0; }
.pt-shell { display: grid; grid-template-columns: 164px 280px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); height: 600px; overflow: hidden; border: 1px solid #e3e7dc; border-radius: 18px; background: #fff; box-shadow: 0 50px 90px -42px #2a372038, 0 2px 6px #2a37200a; font-size: 12.5px; line-height: 1.4; color: #262f20; text-align: left; }
.pt-shell .icon { width: 15px; height: 15px; }
.pt-shell > * { min-height: 0; }
.pt-controls { position: absolute; top: 9px; right: 12px; z-index: 2; display: flex; gap: 2px; }
.pt-control { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 9px; background: transparent; color: #7a8470; cursor: pointer; transition: background-color 180ms ease, color 180ms ease; }
.pt-control:hover { background: #f1f3ec; color: #2b3424; }
.pt-control:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 1px; }
.pt-control .icon { width: 15px; height: 15px; }
.pt-control .pt-play, .pt.is-paused .pt-control .pt-pause { display: none; }
.pt.is-paused .pt-control .pt-play { display: block; }

/* Sidebar */
.pt-side { display: flex; flex-direction: column; padding: 16px 10px 10px; border-right: 1px solid #eef0e9; background: #fafbf7; }
.pt-ws { display: flex; align-items: center; justify-content: space-between; margin: 0 4px 12px; font-size: 13.5px; font-weight: 500; letter-spacing: -.02em; }
.pt-ws .icon { width: 13px; height: 13px; color: #8a937f; }
.pt-search { display: flex; align-items: center; gap: 7px; white-space: nowrap; margin: 0 0 8px; padding: 7px 8px; border: 1px solid #eceee7; border-radius: 9px; background: #fff; font-size: 11px; color: #8a937f; }
.pt-search .icon { width: 13px; height: 13px; }
.pt-search kbd { margin-left: auto; font: 500 9.5px var(--font-mono); color: #a3aa98; }
.pt-group { margin: 12px 8px 4px; font-size: 10.5px; color: #9aa190; }
.pt-nav { display: flex; align-items: center; gap: 9px; padding: 7px 8px; border-radius: 8px; color: #4b5642; }
.pt-nav .icon { color: #7a8470; }
.pt-nav b { margin-left: auto; font-size: 10.5px; font-weight: 500; color: #8a937f; }
.pt-nav.is-active { background: #eef1e7; color: #1f281a; font-weight: 500; }
.pt-nav.is-active .icon { color: #45562b; }
.pt-me { display: flex; align-items: center; gap: 9px; margin-top: auto; padding: 8px; }
.pt-me strong { display: block; font-size: 12px; font-weight: 500; }
.pt-me small { font-size: 10.5px; color: #8a937f; }
.pt-face { display: grid; flex-shrink: 0; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #e6ebdc; font-size: 9.5px; font-weight: 600; color: #57694b; }

/* Olmi, beside the page */
.pt-olmi { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; min-width: 0; border-right: 1px solid #eef0e9; }
.pt-olmi-head { display: flex; align-items: center; justify-content: space-between; height: 50px; margin: 0; padding: 0 16px; border-bottom: 1px solid #eef0e9; font-size: 13px; font-weight: 500; }
.pt-olmi-head span { display: inline-flex; align-items: center; gap: 8px; }
.pt-olmi-head img { width: 20px; height: 20px; object-fit: contain; }
.pt-olmi-head small { font-size: 11px; font-weight: 400; color: #9aa190; }
.pt-olmi-body { display: flex; flex-direction: column; gap: 14px; min-height: 0; padding: 16px; overflow: hidden; }
.pt-context { display: flex; align-items: center; gap: 7px; margin: 0; font-size: 11.5px; color: #7a8470; }
.pt-context .icon { width: 14px; height: 14px; }
.pt-ask { margin: 0; padding: 12px 14px; border-radius: 12px; background: #f3f5ef; font-size: 13px; line-height: 1.5; color: #2b3424; }
.pt-who { margin: 0 0 9px; font-size: 12.5px; font-weight: 600; }
.pt-checks { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.pt-checks li { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; color: #4b5642; }
.pt-checks .icon { width: 14px; height: 14px; margin-top: 1px; color: #6f815a; stroke-width: 2; }
.pt-reason { margin: 12px 0 0; font-size: 12.5px; line-height: 1.5; color: #2b3424; }
.pt-proposal { padding-top: 14px; border-top: 1px solid #eef0e9; }
.pt-proposal-title { margin: 0 0 8px; font-size: 11px; color: #9aa190; }
.pt-proposal dl { display: grid; gap: 7px; margin: 0 0 14px; }
.pt-proposal dl > div { display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 10px; font-size: 12px; }
.pt-proposal dt { color: #8a937f; }
.pt-proposal dd { margin: 0; text-align: right; color: #262f20; }
.pt-decide { display: grid; }
.pt-decide > * { grid-area: 1 / 1; }
.pt-actions { display: flex; gap: 8px; margin: 0; }
.pt-btn { display: inline-flex; align-items: center; height: 32px; padding: 0 14px; border: 1px solid #e3e7dc; border-radius: 9px; background: #fff; font-size: 12px; font-weight: 500; color: #2b3424; }
.pt-btn-dark { border-color: #1f2a1a; background: #1f2a1a; color: #f6f8f1; }
.pt-receipt { display: flex; align-items: center; gap: 8px; height: 32px; margin: 0; padding: 0 12px; border-radius: 9px; background: #eef2e6; font-size: 12px; font-weight: 500; color: #3a4a2c; }
.pt-receipt .icon { width: 14px; height: 14px; stroke-width: 2.2; }
.pt-receipt span { margin-left: auto; font-weight: 400; color: #6f815a; text-decoration: underline; text-underline-offset: 2px; }
.pt-composer { display: flex; align-items: center; justify-content: space-between; margin: 12px; padding: 9px 9px 9px 13px; border: 1px solid #e8ebe3; border-radius: 12px; font-size: 12px; color: #9aa190; }
.pt-composer i { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; background: #eef1e7; color: #6f815a; }
.pt-composer .icon { width: 13px; height: 13px; }

/* The page */
.pt-page { display: grid; grid-template-rows: 50px minmax(0, 1fr); min-width: 0; }
.pt-bar { display: flex; align-items: center; gap: 8px; margin: 0; padding: 0 92px 0 22px; border-bottom: 1px solid #eef0e9; font-size: 12.5px; font-weight: 500; }
.pt-crumb { overflow: hidden; font-weight: 400; white-space: nowrap; text-overflow: ellipsis; color: #9aa190; }
.pt-crumb::before { content: '/'; margin-right: 8px; color: #c9cfc0; }
.pt-page-body { display: flex; flex-direction: column; gap: 14px; min-height: 0; padding: 20px 22px; overflow: hidden; }
.pt-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.pt-title h3 { margin: 0; font-size: 21px; font-weight: 400; letter-spacing: -.035em; color: #1f281a; }
.pt-title p { margin: 5px 0 0; font-size: 12px; color: #8a937f; }
.pt-tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px 2px 3px; border-radius: 999px; background: #eef2e6; font-size: 9.5px; font-style: normal; font-weight: 500; color: #45562b; }
.pt-tag img { width: 13px; height: 13px; object-fit: contain; }

/* Intake */
.pt-chips { display: flex; flex-wrap: wrap; gap: 5px; width: fit-content; margin: -3px; padding: 3px; border-radius: 11px; }
.pt-chips span { padding: 5px 9px; border: 1px solid #eceee7; border-radius: 8px; font-size: 11px; color: #5d6953; }
.pt-chips span.is-on { border-color: #1f2a1a; background: #1f2a1a; color: #f6f8f1; }
.pt-queue { display: grid; margin: 0; padding: 0; list-style: none; border-top: 1px solid #f0f2ec; }
.pt-row { position: relative; isolation: isolate; display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 5px 8px; border-bottom: 1px solid #f0f2ec; }
.pt-row-bg { position: absolute; inset: 3px 0; z-index: -1; border-radius: 9px; background: #f3f6ec; }
.pt-ico { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: #f3f5ef; color: #657741; }
.pt-ico .icon { width: 14px; height: 14px; }
.pt-row-text { min-width: 0; }
.pt-row-text strong, .pt-row-text small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pt-row-text strong { font-size: 12.5px; font-weight: 500; line-height: 1.3; }
.pt-row-text small { font-size: 11px; line-height: 1.3; color: #8a937f; }
.pt-row-end { display: flex; align-items: center; gap: 8px; }
.pt-row time { font: 400 10.5px var(--font-mono); color: #9aa190; }
.pt-done { padding: 2px 7px; border-radius: 6px; background: #e7edda; font-size: 10px; font-style: normal; font-weight: 500; color: #45562b; }
.pt-detail { padding: 12px 14px; border: 1px solid #eceee7; border-radius: 12px; background: #fcfdf9; }
.pt-detail-head { display: flex; align-items: center; justify-content: space-between; margin: 0 0 10px; font-size: 11.5px; color: #5d6953; }
.pt-detail-head > span:first-child { display: inline-flex; align-items: center; gap: 6px; }
.pt-detail-head .icon { width: 13px; height: 13px; }
.pt-detail-head b { padding: 3px 8px; border-radius: 999px; background: #e7edda; font: 500 9.5px/1.2 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: #45562b; }
.pt-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 0; }
.pt-fields > div { padding: 6px 9px; border: 1px solid #f0f2ec; border-radius: 9px; background: #fff; line-height: 1.25; }
.pt-fields dt { font-size: 10px; color: #8a937f; }
.pt-fields dd { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 1px 0 0; font-size: 12px; font-weight: 500; }
.pt-fields em { display: inline-flex; align-items: center; gap: 3px; padding: 1px 6px 1px 3px; border-radius: 999px; background: #e7edda; font-size: 9.5px; font-style: normal; color: #45562b; }
.pt-fields em .icon { width: 10px; height: 10px; stroke-width: 2.4; }
.pt-synced { display: flex; gap: 4px; margin: -2px; padding: 2px; border-radius: 9px; }
.pt-synced > span { display: inline-flex; align-items: center; gap: 4px; padding: 3px 7px; border-radius: 7px; background: #eef2e6; font-size: 10.5px; font-weight: 500; color: #3a4a2c; }
.pt-synced .icon { width: 11px; height: 11px; stroke-width: 2.4; }

/* Programs */
.pt-routine { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; align-items: start; }
.pt-day { display: flex; flex-direction: column; padding: 10px; border: 1px solid #eceee7; border-radius: 12px; background: #fcfdf9; }
.pt-day > * + * { margin-top: 6px; }
.pt-day-head { display: flex; align-items: center; gap: 6px; margin: 0 0 2px; font-size: 12px; font-weight: 500; }
.pt-day-head .icon { width: 14px; height: 14px; color: #8a937f; }
.pt-day-head span { margin-left: auto; font: 500 9.5px var(--font-mono); color: #9aa190; }
.pt-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border: 1px solid #eef0e9; border-radius: 9px; background: #fff; font-size: 12px; }
.pt-item b { font-weight: 500; }
.pt-mark { width: 16px; height: 16px; object-fit: contain; }
.pt-item small { font-size: 10.5px; color: #9aa190; }
.pt-item > span { display: inline-flex; align-items: center; gap: 6px; }
.pt-slot { display: grid; grid-template-rows: 1fr; }
.pt-slot > * { min-height: 0; overflow: hidden; }
.pt-next { display: grid; gap: 6px; }
.pt-next-row { display: grid; grid-template-columns: 15px minmax(0, 1fr) auto; align-items: center; gap: 9px; margin: 0; padding: 10px 12px; border: 1px solid #eceee7; border-radius: 10px; color: #5d6953; }
.pt-next-row b { font-weight: 500; color: #262f20; }
.pt-swap { display: grid; justify-items: end; }
.pt-swap-start { justify-items: start; }
.pt-swap > * { grid-area: 1 / 1; }

/* Handoffs */
.pt-views { display: flex; gap: 4px; margin: 0; }
.pt-views span { padding: 5px 10px; border-radius: 8px; font-size: 11.5px; color: #7a8470; }
.pt-views .is-on { background: #eef1e7; font-weight: 500; color: #1f281a; }
.pt-board { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; align-items: start; }
.pt-lane { display: flex; flex-direction: column; padding: 10px; border-radius: 12px; background: #f6f7f2; }
.pt-lane > * + * { margin-top: 8px; }
.pt-lane-head { margin: 0; font-size: 11.5px; font-weight: 500; color: #5d6953; }
.pt-lane-head b { margin-left: 4px; font-weight: 400; color: #9aa190; }
.pt-card { padding: 10px 11px; border: 1px solid #eceee7; border-radius: 10px; background: #fff; }
.pt-card-head { margin: 0; }
.pt-card-head strong, .pt-card strong { display: block; font-size: 12.5px; font-weight: 500; }
.pt-card-head small, .pt-card small { font-size: 10.5px; color: #8a937f; }
.pt-lines { display: grid; gap: 5px; margin: 9px 0 0; padding: 0; list-style: none; }
.pt-lines li { display: grid; grid-template-columns: 13px minmax(0, 1fr) auto; align-items: center; gap: 7px; font-size: 11.5px; color: #4b5642; }
.pt-lines b { font-size: 11px; font-weight: 400; color: #8a937f; }
.pt-lines .icon { width: 12px; height: 12px; }
.pt-lines .is-done .icon { color: #6f815a; stroke-width: 2.2; }
.pt-wait { width: 10px; height: 10px; border: 1.5px dashed #a1a996; border-radius: 50%; }
.pt-owner { display: flex; align-items: center; gap: 7px; margin-top: 9px; padding-top: 8px; border-top: 1px solid #f0f2ec; font-size: 11px; color: #3a4a2c; }
.pt-owner .pt-face { width: 20px; height: 20px; font-size: 8px; }
.pt-foot-line { margin: 0; font-size: 11.5px; color: #8a937f; }

/* Inventory */
.pt-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; overflow: hidden; border: 1px solid #eceee7; border-radius: 12px; }
.pt-kpis > div { padding: 10px 12px; border-left: 1px solid #eceee7; }
.pt-kpis > div:first-child { border-left: 0; }
.pt-kpis dt { font-size: 10.5px; color: #8a937f; }
.pt-kpis dd { margin: 4px 0 0; font-size: 18px; letter-spacing: -.03em; }
.pt-table { display: grid; margin: 0; padding: 0; list-style: none; border-top: 1px solid #f0f2ec; }
.pt-tr { position: relative; display: grid; grid-template-columns: minmax(0, 2.3fr) repeat(3, minmax(0, .6fr)); align-items: center; gap: 8px; padding: 9px 8px; border-bottom: 1px solid #f0f2ec; font-size: 12px; }
.pt-tr > :not(:first-child) { justify-self: end; font-variant-numeric: tabular-nums; }
.pt-th { padding-block: 7px; font-size: 10.5px; color: #9aa190; }
.pt-tr b { overflow: hidden; font-weight: 500; white-space: nowrap; text-overflow: ellipsis; }
.pt-tr > :first-child { display: flex; align-items: center; gap: 6px; min-width: 0; }
.pt-low { padding: 1px 6px; border-radius: 6px; background: #f5ebe1; font-size: 9.5px; font-weight: 500; color: #8a4b2b; }

/* ---------------------------------------------------------------- the moment */

/* Ready for playing: what hasn't happened yet waits, invisible, in its own place. Nothing moves
   the layout except an item that changes columns, which makes room smoothly. */
.pt[data-tour-ready] [data-show] { transition: opacity 500ms var(--ease-glide) calc(var(--d, 0) * 240ms), translate 650ms var(--ease-glide) calc(var(--d, 0) * 240ms); }
.pt[data-tour-ready] [data-show]:not(.is-shown) { opacity: 0; translate: 0 6px; }
.pt[data-tour-ready] [data-hide] { transition: opacity 380ms ease; }
.pt[data-tour-ready] [data-hide].is-gone { opacity: 0; pointer-events: none; }
.pt[data-tour-ready] .pt-slot[data-show], .pt[data-tour-ready] .pt-slot[data-hide] { translate: none; transition: grid-template-rows 650ms var(--ease-glide) 120ms, opacity 450ms ease 120ms, margin-top 650ms var(--ease-glide) 120ms; }
.pt[data-tour-ready] .pt-slot[data-show]:not(.is-shown), .pt[data-tour-ready] .pt-slot[data-hide].is-gone { grid-template-rows: 0fr; margin-top: 0; opacity: 0; }
.pt:not([data-tour-ready]) [data-hide] { display: none !important; }
.pt.is-resetting, .pt.is-resetting * { transition: none !important; }

/* What Olmi is working on is ringed where it is. */
.pt-shell [data-mark] { transition: box-shadow 450ms ease, background-color 450ms ease; }
.pt-shell .is-marked { box-shadow: inset 0 0 0 1.5px #b1c28c, 0 0 0 4px #edf2e1; }
.pt-shell .pt-btn.is-marked { animation: pt-ask 1.8s ease-in-out infinite; }
@keyframes pt-ask { 0%, 100% { box-shadow: 0 0 0 0 #536533; } 50% { box-shadow: 0 0 0 5px #53653322; } }

/* ---------------------------------------------------------------- smaller screens */

@media (max-width: 1180px) {
  .pt { grid-template-columns: 1fr; gap: 40px; }
  .pt-copy { max-width: 640px; }
  .pt-intro { grid-template-columns: 1fr; gap: 18px; }
}

@media (max-width: 1080px) {
  .pt-intro, .pt { width: calc(100% - 64px); }
}

@media (max-width: 900px) {
  .pt-shell { grid-template-columns: 270px minmax(0, 1fr); }
  .pt-side { display: none; }
}

@media (max-width: 640px) {
  .pt-intro, .pt { width: calc(100% - 40px); }
  .pt-intro { padding-top: 96px; }
  .pt { padding-top: 90px; gap: 28px; }
  .pt-shell { grid-template-columns: 1fr; grid-template-rows: auto auto; height: auto; border-radius: 16px; }
  .pt-page { order: -1; grid-template-rows: 46px auto; border-bottom: 1px solid #eef0e9; }
  .pt-page-body { padding: 16px; }
  .pt-olmi { border-right: 0; }
  .pt-olmi-head { height: 46px; }
  .pt-composer { display: none; }
  .pt-bar { padding-right: 84px; padding-left: 16px; }
  .pt-chips span:nth-child(n+5), .pt-queue li:nth-child(n+5) { display: none; }
  .pt-title > div, .pt-fields > div:nth-child(n+3) { display: none; }
  .pt-title:not(:has(.pt-views)) { display: none; }
  .pt-detail-head { flex-wrap: wrap; row-gap: 8px; }
  .pt-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pt-kpis > div:nth-child(3) { border-left: 0; }
  .pt-kpis > div:nth-child(n+3) { border-top: 1px solid #eceee7; }
  .pt-tr { grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, .6fr)); }
}

@media (prefers-reduced-motion: reduce) {
  .pt, .pt * { transition: none !important; animation: none !important; }
}
