/* ===========================================================================
   SolutionsDataHub -- 画面イメージ v2 (hands-on tour), part 1/2: tabs, window,
   panels ① 質問する and ② SQLエディタ, the per-tab line above the window.
   Part 2 (datahub-tour-2.css): ③ API公開, ④ 権限, hotspots, motion, phone.
   Builds on datahub-ui.css (.dh-win, .dh-top, .dh-brand, .dh-ai, .dh-chip,
   .dh-sql). Shape language = hero film: window 14px, cards 12px, controls 10px.
   No JS: .dh-tour without .is-live = all 4 panels stacked, controls disabled.
   =========================================================================== */

.dh-tour { margin-top: clamp(24px, 3vw, 40px); }
.dh-tour-lead { display: flex; align-items: center; gap: 6px; margin: 0 0 14px; font-family: 'Noto Sans JP', sans-serif; font-size: 14px; color: var(--muted); }
.dh-tour-key { width: 10px; height: 10px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 2px var(--white); }
.dh-tour:not(.is-live) .dh-tour-lead { display: none; }

/* ---- tabs (outside the window, like SALES / CHATOPS) ------------------------ */
.dh-tour-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.dh-tour-tab { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 8px 12px; border: 1.5px solid var(--line-strong); border-radius: 12px; background: var(--white); font: 700 15px/1.3 'Zen Kaku Gothic New', 'Noto Sans JP', sans-serif; letter-spacing: 0.04em; color: var(--navy); cursor: pointer; transition: border-color var(--dur-3) var(--ease-soft), background-color var(--dur-3) var(--ease-soft), color var(--dur-3) var(--ease-soft); }
.dh-tour-tab svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.dh-tour-tab:hover { border-color: var(--blue); }
.dh-tour-tab.is-on { border-color: var(--navy); background: var(--navy); color: var(--white); }
.dh-tour button:focus-visible, .dh-tour-panel:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.dh-tour:not(.is-live) .dh-tour-tabs { display: none; }

/* ---- window + panels ---------------------------------------------------------- */
.dh-tour-win { margin-top: 14px; border-radius: 14px; box-shadow: 0 1px 2px rgba(16, 42, 67, 0.08), 0 28px 56px -32px rgba(16, 42, 67, 0.45); font-size: 13px; }
.dh-tour-win .dh-top { height: 42px; padding: 0 16px; }
.dh-tour-crumb { margin-left: auto; font-size: 13px; color: var(--dh-chrome-tx); }
.dh-tour-panel { padding: 22px 24px 26px; }
.dh-tour.is-live .dh-tour-panel { display: none; min-height: 420px; }
.dh-tour.is-live .dh-tour-panel.is-active { display: block; }
.dh-tour:not(.is-live) .dh-tour-panel + .dh-tour-panel { border-top: 1px solid var(--dh-hair); }
.dh-tour-h { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 13px; font-weight: 700; letter-spacing: 0.06em; color: var(--muted); }
.dh-tour button:disabled { cursor: default; }

/* ---- ① 質問する: pick a question -> sentence + chart ---------------------------- */
.dh-tour-qs { display: flex; flex-wrap: wrap; gap: 8px; }
.dh-tour-q { position: relative; padding: 9px 14px; border: 1.5px solid var(--dh-hair); border-radius: 10px; background: var(--white); font: 700 13.5px/1.5 'Noto Sans JP', sans-serif; color: var(--navy); cursor: pointer; transition: border-color var(--dur-3) var(--ease-soft), background-color var(--dur-3) var(--ease-soft); }
.dh-tour-q:not(:disabled):hover { border-color: var(--dh-acc); }
.dh-tour-q[aria-pressed="true"] { border-color: var(--dh-acc); background: var(--dh-tint); color: var(--dh-acc-ink); }
.dh-tour-out { margin-top: 18px; }
.dh-tour-say { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 14px; line-height: 1.7; color: var(--ink); }
.dh-tour-say b { font-size: 15px; color: var(--navy); }
.dh-tour-aim { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--dh-tint); color: var(--dh-acc-ink); }
.dh-tour-aim::before { content: ""; width: 14px; height: 14px; background: currentColor; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); }
.dh-tour-chart { margin-top: 14px; padding: 16px 20px 12px; border: 1px solid var(--dh-hair); border-radius: 12px; }
.dh-tour-ct { margin: 0 0 6px; font-size: 13px; font-weight: 700; color: var(--navy); }
.dh-tour-cols { position: relative; display: flex; align-items: stretch; gap: 4%; height: 210px; margin: 0; padding: 0 2%; list-style: none; }
.dh-tour-cols::after { content: ""; position: absolute; left: 0; right: 0; bottom: 26px; height: 1px; background: var(--dh-hair); }
.dh-tour-cols li { flex: 1 1 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; min-width: 0; }
.dh-tour-cols b { font-size: 12px; color: var(--navy); }
.dh-tour-cols i { width: min(64%, 56px); height: calc(var(--h) * 150px); margin-top: 4px; border-radius: 6px 6px 0 0; background: var(--blue-pale); transform-origin: center bottom; }
.dh-tour-cols .is-top i { background: var(--dh-acc); }
.dh-tour-cols span { height: 26px; line-height: 26px; color: var(--muted); white-space: nowrap; }
/* progress answer (今期の目標): one bar split by quarter, the running one paler */
.dh-tour-goal { display: grid; gap: 14px; padding: 18px 0 14px; }
.dh-tour-goal-n { display: flex; align-items: baseline; gap: 16px; margin: 0; font-family: 'Zen Kaku Gothic New', 'Noto Sans JP', sans-serif; font-size: 52px; font-weight: 900; line-height: 1; color: var(--navy); }
.dh-tour-goal-n small { margin-left: -12px; font-size: 20px; }
.dh-tour-goal-n span { padding: 4px 10px; border-radius: 8px; background: var(--amber); font-family: 'Noto Sans JP', sans-serif; font-size: 13px; font-weight: 700; line-height: 1.5; }
.dh-tour-track { position: relative; height: 22px; border-radius: 11px; background: var(--surface); overflow: hidden; }
.dh-tour-track i { position: absolute; top: 0; bottom: 0; left: calc(var(--x) * 100%); width: calc(var(--w) * 100%); background: var(--c); box-shadow: inset -2px 0 0 var(--white); transform-origin: left center; }
.dh-tour-qtr { display: flex; margin: 0; padding: 0; list-style: none; font-size: 13px; line-height: 1.5; color: var(--muted); }
.dh-tour-qtr li { flex: 0 0 calc(var(--w) * 100%); min-width: 0; padding-right: 8px; }
.dh-tour-qtr li::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 5px; border-radius: 2px; background: var(--c, var(--surface)); box-shadow: inset 0 0 0 1px rgba(16, 42, 67, 0.12); }
.dh-tour-qtr b { color: var(--navy); }
.dh-tour-goal-l { display: flex; justify-content: space-between; margin: 0; padding-top: 10px; border-top: 1px solid var(--dh-hair); font-size: 13px; color: var(--muted); }
.dh-tour-goal-l b { color: var(--navy); }

/* ---- ② SQLエディタ: run the AI review ------------------------------------------- */
.dh-tour-ed { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 20px; align-items: start; }
.dh-tour-file { display: flex; align-items: center; justify-content: space-between; margin: 0 0 8px; font-size: 12px; color: var(--muted); }
.dh-tour-ed .dh-sql { margin: 0; padding: 16px 18px; border-radius: 10px; font-size: 13px; line-height: 1.95; white-space: pre; overflow-x: auto; }
.dh-tour-run { display: flex; align-items: center; gap: 10px; margin: 12px 0 0; font-size: 13px; color: var(--muted); }
.dh-tour-btn { position: relative; margin-left: auto; padding: 9px 16px; border: 0; border-radius: 10px; background: var(--navy); font: 700 13px/1.4 'Noto Sans JP', sans-serif; color: var(--white); cursor: pointer; }
.dh-tour-btn:not(:disabled):hover { background: var(--navy-mid); }
.dh-tour-rev { padding: 16px 18px; border: 1px solid var(--dh-hair); border-radius: 12px; background: var(--dh-rail); }
.dh-tour-rev-h { display: flex; align-items: center; gap: 6px; margin: 0 0 10px; font-size: 12px; font-weight: 700; color: var(--dh-acc-ink); }
.dh-tour-rev-h::before { content: ""; width: 11px; height: 11px; background: currentColor; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); }
.dh-tour-rev-idle { margin: 0; font-size: 13px; line-height: 1.8; color: var(--muted); }
.dh-tour-checks { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.dh-tour-checks[hidden] { display: none; }
.dh-tour-checks li { display: grid; grid-template-columns: 22px minmax(0, 1fr); column-gap: 8px; }
/* the glyph is decoration (each line's text states the result): empty alt text keeps it out of the live-region announcement */
.dh-tour-checks li::before { content: "✓"; content: "✓" / ""; grid-row: 1 / 3; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #E2F3EA; font-size: 12px; font-weight: 700; color: #237A4C; }
.dh-tour-checks .is-tip::before { content: "!"; content: "!" / ""; background: #FDF1CC; color: #8A5A00; }
.dh-tour-checks b { font-size: 13px; color: var(--navy); }
.dh-tour-checks span { font-size: 13px; line-height: 1.7; color: var(--ink); }

/* ---- what this screen is (round 7, for non-tech visitors) --------------------------
   One plain line per tab between the tab bar and the window: 〈term〉は、〈metaphor〉です。
   + what it does. All 4 lines share one grid cell, so the tallest sets the height
   and the window never moves when the tab changes; the active panel's line shows.
   .dh-tour-hint = "press X to see Y" lines: only true once the controls work (JS). */
.dh-tour-about { display: grid; margin-top: 14px; }
.dh-tour-about-i { grid-area: 1 / 1; align-self: start; margin: 0; padding-left: 14px; border-left: 3px solid var(--dh-acc); font-family: 'Noto Sans JP', sans-serif; font-size: 15px; line-height: 1.8; color: var(--ink); visibility: hidden; word-break: auto-phrase; }
.dh-tour-about-i b { color: var(--navy); }
.dh-tour-about-i em { font-style: normal; font-weight: 700; color: var(--dh-acc-ink); }
.dh-tour:has(#dh-panel-1.is-active) [data-about="1"], .dh-tour:has(#dh-panel-2.is-active) [data-about="2"],
.dh-tour:has(#dh-panel-3.is-active) [data-about="3"], .dh-tour:has(#dh-panel-4.is-active) [data-about="4"] { visibility: visible; }
.dh-tour-swhint { margin: -2px 0 8px; font-size: 13px; line-height: 1.7; color: var(--muted); }
.dh-tour:not(.is-live) :is(.dh-tour-about, .dh-tour-hint) { display: none; }
