#tour-dialog {
  width: min(850px, calc(100% - 36px));
  max-width: none;
  max-height: calc(100dvh - 36px);
  margin: auto;
  padding: 0;
  border: 1px solid #c3d1c7;
  border-radius: 18px;
  background: #f8faf6;
  color: #183b34;
  box-shadow: 0 24px 90px #0a242d55;
}
#tour-dialog::backdrop { background: #112c36b8; }
#tour-dialog[open] { display: flex; flex-direction: column; }
#tour-dialog [hidden] { display: none !important; }
.tour-head {
  display: flex; align-items: center; gap: 18px; flex: 0 0 auto;
  padding: 22px 26px 18px; border-bottom: 1px solid #dae3da;
}
.tour-head-copy { min-width: 0; flex: 1; }
.tour-head .tour-eyebrow, .tour-task small, .tour-card-info small {
  margin: 0 0 4px; color: #526c60; font: 700 10px/1.4 'Segoe UI',sans-serif;
  letter-spacing: .09em; text-transform: uppercase;
}
#tour-title { margin: 0; color: #173e35; font: 500 clamp(24px, 3vw, 34px)/1.1 Georgia,serif; letter-spacing: -.03em; }
#tour-title:focus { outline: none; }
.tour-close, .tour-back, .tour-task button, .tour-fallback button {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 40px;
  padding: 8px 12px; border: 1px solid #c7d5cb; border-radius: 8px;
  background: #fff; color: #205746; font-weight: 650; font-size: 12px;
}
.tour-close b { font: 400 23px/16px sans-serif; }
.tour-close:hover, .tour-back:hover, .tour-task button:hover { background: #e5eee6; }
.tour-index { min-height: 0; overflow: auto; padding: 0 26px 25px; }
.tour-summary { display: flex; align-items: center; justify-content: space-between; gap: 28px; padding: 17px 0; }
.tour-summary p { margin: 0; max-width: 490px; font-size: 14px; line-height: 1.5; color: #466156; }
.tour-progress { display: grid; justify-items: end; gap: 6px; flex: none; }
.tour-count { font-size: 12px; font-weight: 700; }
.tour-marks { display: flex; gap: 4px; }
.tour-marks i { width: 18px; height: 4px; border-radius: 3px; background: #d4e1d7; }
.tour-marks i.stamped { background: #25745c; }
.tour-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.tour-card { display: grid; grid-template-columns: 1fr auto; align-items: center; text-align: left; overflow: hidden; position: relative; min-width: 0; border: 1px solid #d0dcd1; border-radius: 11px; background: #fff; color: #183b34; font-family: inherit; padding: 0; }
.tour-card:hover { border-color: #619579; box-shadow: 0 2px 9px #21433318; }
.tour-card-image { display: block; grid-column: 1 / -1; width: 100%; aspect-ratio: 2.65; overflow: hidden; background: #dae2da; }
.tour-card-image img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tour-card-info { display: grid; padding: 13px 15px; gap: 2px; min-width: 0; }
.tour-card-info small { display: block; margin: 0; font-size: 9px; }
.tour-card-info strong { font-size: 18px; line-height: 1.2; }
.tour-card-link { margin-right: 14px; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #e8f1e8; color: #1e5f48; font-size: 18px; }
#tour-dialog.tour-playing { width: min(1420px, calc(100% - 24px)); height: min(920px, calc(100dvh - 24px)); max-height: none; }
.tour-playing .tour-head { padding: 10px 16px; }
.tour-playing #tour-title { font-size: 24px; }
.tour-playing .tour-eyebrow { font-size: 9px; margin: 0 0 2px; }
.tour-view { min-height: 0; flex: 1 1 0; display: flex; flex-direction: column; }
.tour-task { display: flex; align-items: center; gap: 10px; padding: 9px 18px; background: #e8f1ea; border-bottom: 1px solid #ccdacf; }
.tour-task small { display: block; font-size: 9px; margin: 0 0 1px; }
.tour-task strong { display: block; font-size: 14px; line-height: 1.3; }
.tour-task button { margin-left: auto; min-height: 34px; font-size: 12px; }
.tour-seal { display: grid; flex-shrink: 0; place-items: center; border: 1px solid #7eab90; width: 32px; height: 32px; border-radius: 50%; font-size: 22px; color: #195a40; }
.tour-seal.checked { background: #27684e; border-color: #27684e; color: white; font-size: 16px; }
.tour-screen { flex: 1; min-height: 0; position: relative; background: #edf2eb; }
#tour-frame { display: block; width: 100%; height: 100%; border: 0; }
.tour-loading { position: absolute; inset: 0; display: grid; place-content: center; background: #edf2eb; color: #445f50; }
.tour-fallback { display: grid; place-items: center; align-content: center; height: 100%; overflow: auto; gap: 12px; padding: 16px; text-align: center; }
.tour-fallback img { width: min(100%,420px); max-height: 42vh; border-radius: 8px; object-fit: contain; }
.tour-fallback p { margin: 5px 0 12px; }
@media (min-width: 601px) {
  .tour-scanners .tour-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  #tour-dialog { width: calc(100% - 12px); max-height: calc(100dvh - 12px); border-radius: 12px; }
  .tour-head { padding: 15px; gap: 8px; }
  .tour-index { padding: 0 14px 15px; }
  .tour-summary { display: grid; gap: 8px; padding: 12px 0; }
  .tour-summary p { font-size: 12px; }
  .tour-progress { display: flex; align-items: center; justify-content: space-between; }
  .tour-cards { gap: 8px; }
  .tour-card-image { aspect-ratio: 1.6; }
  .tour-card-info { padding: 9px; }
  .tour-card-info small { font-size: 8px; letter-spacing: .03em; }
  .tour-card-info strong { font-size: 15px; }
  .tour-card-link { position: absolute; top: 6px; right: 6px; margin: 0; width: 22px; height: 22px; font-size: 14px; background: #f4f8f2ed; }
  #tour-dialog.tour-playing { inset: 0; width: 100%; height: 100dvh; border: 0; border-radius: 0; }
  .tour-playing .tour-head { padding: 7px 8px; }
  .tour-playing .tour-eyebrow { font-size: 8px; }
  .tour-playing #tour-title { font-size: 20px; }
  .tour-close, .tour-back { padding: 5px 8px; font-size: 10px; gap: 4px; }
  .tour-close > span { display: none; }
  .tour-close { min-width: 40px; }
  .tour-task { padding: 8px; gap: 8px; }
  .tour-task strong { font-size: 12px; }
  .tour-task button { font-size: 10px; padding: 4px 6px; }
  .tour-seal { width: 26px; height: 26px; font-size: 18px; }
}
@media (max-height: 450px) {
  #tour-dialog.tour-playing { width: 100%; height: 100dvh; border-radius: 0; }
  .tour-playing .tour-head, .tour-task { padding: 3px 10px; }
}
