/* Context-only walkthrough. These selectors never restyle the application itself. */
#tdWalkthrough.td-context-guide[open] {
  --guide-accent:#b66c07;
  width:min(1100px,calc(100vw - 24px)); max-width:1100px;
  height:min(860px,calc(100dvh - 24px)); max-height:calc(100dvh - 24px);
  padding:16px; gap:10px; border-radius:22px;
}
html[data-theme="dark"] #tdWalkthrough.td-context-guide { --guide-accent:#ffc76d; }
#tdWalkthrough.td-context-guide,
#tdWalkthrough.td-context-guide :is(h2,h3,p,span,label,small,strong,b,input,select,button,a,div,section) {
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif!important;
}
#tdWalkthrough.td-context-guide .td-guide-top { min-height:34px; }
#tdWalkthrough.td-context-guide .td-guide-navigation { grid-template-columns:1fr 1fr; gap:12px; margin:0; }
#tdWalkthrough.td-context-guide .td-guide-navigation label { grid-template-columns:auto minmax(0,1fr); }
#tdWalkthrough.td-context-guide #tdGuideSearchResults { top:48px; z-index:6; }
#tdWalkthrough.td-context-guide #tdGuideSearchStatus { grid-column:1/-1; }
#tdGuideWorkspace { display:grid; grid-template-columns:minmax(0,1.8fr) minmax(230px,1fr); align-items:stretch; gap:26px; min-height:0; flex:1; position:relative; }
#tdGuideStage { min-width:0; min-height:0; display:flex; flex-direction:column; overflow:hidden; position:relative; border:1px solid var(--td-border); border-radius:17px; background:var(--td-surface); }
.td-scene-label { flex-shrink:0; padding:8px 12px; border-bottom:1px solid var(--td-border); color:var(--td-muted); background:var(--td-surface-raised); font:700 10px/1.3 system-ui; letter-spacing:.07em; }
#tdGuideViewport { flex:1; min-height:0; overflow:auto; scrollbar-width:thin; overscroll-behavior:contain; scroll-behavior:auto; }
#tdGuideScene { min-width:0; color:var(--td-ink); background:var(--td-surface); padding:12px; font:500 14px/1.45 system-ui,sans-serif; }
#tdGuideScene * { min-width:0; }
#tdGuideScene :is(span,strong,p,small) { overflow-wrap:anywhere; }
#tdGuideScene svg { display:block; width:24px; height:24px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; flex-shrink:0; }
#tdGuideRing { position:absolute; z-index:2; border:3px solid var(--guide-accent); border-radius:16px; pointer-events:none; box-shadow:0 0 0 3px #fff5,0 0 0 1200px #06223a0b; animation:tg-ring-in .28s ease-out; }
#tdGuideArrow { position:absolute; left:0; top:0; width:100%; height:100%; overflow:visible; pointer-events:none; z-index:3; color:var(--guide-accent); }
#tdGuideArrow path { stroke:currentColor; stroke-width:2.5; stroke-linecap:round; stroke-linejoin:round; }
#tdGuideCallout { align-self:center; position:relative; z-index:4; padding:20px; border:1px solid var(--guide-accent); border-radius:18px; background:var(--td-surface-raised); box-shadow:0 8px 24px #08263b0d; max-height:100%; overflow:auto; }
#tdWalkthrough.td-context-guide #tdGuideCaption { margin:0 0 8px; color:var(--td-muted); font:650 12px/1.4 system-ui; }
#tdWalkthrough.td-context-guide #tdGuideTitle { margin:0 0 8px; color:var(--td-ink); font:750 22px/1.25 system-ui; }
#tdWalkthrough.td-context-guide #tdGuideText { margin:0; font:450 15px/1.5 system-ui; color:var(--td-ink); }
#tdGuideAreaCount { display:block; margin-top:12px; color:var(--td-muted); font:500 12px/1.3 system-ui; }
#tdWalkthrough.td-context-guide .td-guide-footer { margin:0; padding:10px 0 0; }
#tdWalkthrough.td-context-guide .td-guide-progress { margin:0 0 8px; gap:10px; }
#tdWalkthrough.td-context-guide .td-guide-progress small { margin-left:auto; font:400 11px/1.3 system-ui; }
#tdWalkthrough.td-context-guide .td-guide-actions { grid-template-columns:minmax(0,1fr) 50px minmax(0,1fr); gap:10px; }
#tdWalkthrough.td-context-guide #tdGuidePlay { padding:8px; font-size:18px; }
#tdWalkthrough.td-context-guide #tdGuidePlay[aria-pressed="true"] { border-color:var(--guide-accent); background:var(--td-icon-fill); }
#tdGuideScene .tg-toolbar { display:flex; gap:6px; align-items:center; padding:0 0 12px; border-bottom:1px solid var(--td-border); margin-bottom:12px; }
#tdGuideScene :is(.tg-button,.tg-icon) { display:inline-flex; align-items:center; justify-content:center; text-align:center; gap:6px; min-height:42px; padding:9px 12px; border:1px solid var(--td-border); border-radius:11px; background:var(--td-surface-raised); color:var(--td-ink); font-weight:700; line-height:1.3; }
#tdGuideScene .tg-toolbar > :is(.tg-button,.tg-icon) { flex:0 0 40px; padding:8px; }
#tdGuideScene .tg-toolbar .tg-upload { flex:1; font-size:13px; white-space:nowrap; }
#tdGuideScene .tg-primary { background:linear-gradient(125deg,#079fce,#067eb5); color:white; border-color:#068dbb; }
#tdGuideScene .tg-content { display:grid; gap:12px; }
#tdGuideScene .tg-heading { margin:4px 0 12px; color:var(--td-ink); font:750 20px/1.3 system-ui; }
#tdGuideScene .tg-driver { display:grid; gap:6px; text-align:center; padding:16px 10px; margin:10px 0 18px; border:1px solid var(--td-border); border-radius:16px; background:var(--td-surface-raised); }
#tdGuideScene .tg-driver strong { font-size:20px; }
#tdGuideScene small { color:var(--td-muted); font-size:12px; }
#tdGuideScene .tg-row { display:flex; align-items:center; flex-wrap:wrap; gap:8px; margin:8px 0; }
#tdGuideScene .tg-row > * { flex:1; }
#tdGuideScene .tg-row > .tg-shortcuts { flex:0 1 auto; }
#tdGuideScene .tg-box { display:grid; gap:10px; padding:14px; margin:4px 0; border:1px solid var(--td-border); border-radius:16px; background:var(--td-surface-raised); }
#tdGuideScene .tg-box p { margin:0; }
#tdGuideScene .tg-box .tg-heading { margin:0 0 4px; }
#tdGuideScene .tg-pill { display:inline-flex; padding:6px 9px; border-radius:8px; background:var(--td-icon-fill); color:var(--td-ink); font-size:12px; }
#tdGuideScene .tg-field { display:grid; gap:6px; margin:4px 0; text-align:left; }
#tdGuideScene .tg-field > small { font-weight:700; }
#tdGuideScene .tg-field > span { display:flex; align-items:center; justify-content:space-between; gap:6px; padding:12px; min-height:44px; border:1px solid var(--td-border); border-radius:11px; background:var(--td-surface); }
#tdGuideScene em { font-style:normal; }
#tdGuideScene .tg-field em { margin-left:auto; }
#tdGuideScene .tg-menu { display:grid; gap:9px; padding:12px; border:1px solid var(--td-border); border-radius:15px; background:var(--td-surface-raised); }
#tdGuideScene .tg-menu-item { display:flex; align-items:center; gap:10px; min-height:48px; padding:12px; border:1px solid var(--td-border); border-radius:12px; background:var(--td-icon-fill); }
#tdGuideScene .tg-menu-item strong { flex:1; font-size:14px; }
#tdGuideScene .tg-menu-item em { color:#099aca; font-size:20px; }
#tdGuideScene .tg-menu-item small { width:24px; flex-shrink:0; font-variant-numeric:tabular-nums; }
#tdGuideScene .tg-rest img { width:24px; height:24px; }
html[data-theme="dark"] #tdGuideScene .tg-rest img { filter:invert(1); }
#tdGuideScene .tg-manual { color:#098dc1; font-size:20px; }
#tdGuideScene .tg-row:has(.tg-manual) { flex-wrap:nowrap; align-items:end; }
#tdGuideScene .tg-row > .tg-manual { flex:0 0 42px; }
#tdGuideScene .tg-row > .tg-rest { flex:0 0 58px; }
#tdGuideScene .tg-name { display:block; text-align:center; margin:10px 0; font-size:19px; }
#tdGuideScene .tg-shortcuts { display:flex; gap:5px; }
#tdGuideScene .tg-shortcuts > * { flex:1; }
#tdGuideScene .tg-danger { color:#d42142; border-color:#db7f91; background:#d3294110; }
html[data-theme="dark"] #tdGuideScene .tg-danger { color:#ffacb9; }
#tdGuideScene .tg-gauge { position:relative; min-width:100px; display:grid; justify-items:center; gap:4px; padding:14px 8px 20px; margin:12px 0; border:1px solid var(--td-border); border-radius:18px; background:var(--td-surface-raised); }
#tdGuideScene .tg-gauge svg { width:100%; height:105px; }
#tdGuideScene .tg-gauge path { stroke:var(--td-border); stroke-width:10; }
#tdGuideScene .tg-gauge path+path { stroke:#d990a4; }
#tdGuideScene .tg-gauge b { margin-top:-47px; font-size:24px; }
#tdGuideScene .tg-gauge small:last-child { margin-top:-10px; }
#tdGuideScene .tg-timeline { display:flex; align-items:center; gap:2px; min-height:110px; margin:10px 0; border-top:1px solid var(--td-border); border-bottom:1px solid var(--td-border); }
#tdGuideScene .tg-timeline i { flex:3; height:35px; background:#e79aa5; }
#tdGuideScene .tg-timeline i:nth-of-type(even) { flex:1; background:#7db6df; }
#tdGuideScene .tg-timeline span { font-size:10px; }
#tdGuideScene .tg-place { padding:12px; border-radius:10px; background:#67bdfa25; border-left:4px solid #56a9d5; }
#tdGuideScene .tg-border { padding:14px; background:#ddb82920; border:1px solid #bea343; border-left-width:4px; border-radius:16px; }
#tdGuideScene .tg-map { position:relative; height:220px; overflow:hidden; border:1px solid var(--td-border); border-radius:15px; background:repeating-linear-gradient(20deg,#85a48922 0 30px,#8badb82b 30px 55px); }
#tdGuideScene .tg-road { position:absolute; height:220px; width:70px; border-right:7px solid #168bc4; transform:rotate(35deg); left:43%; top:0; }
#tdGuideScene .tg-map-zoom { position:absolute; left:10px; top:10px; display:grid; z-index:1; }
#tdGuideScene .tg-map-full { position:absolute; right:10px; top:10px; z-index:1; }
#tdGuideScene .tg-map-pin { position:absolute; left:50%; top:46%; z-index:1; background:#068bb9; color:white; }
#tdGuideScene .tg-ask { display:flex; align-items:center; justify-content:center; gap:12px; padding:12px; }
#tdGuideScene .tg-ask img { width:62px; height:62px; border-radius:14px; }
#tdGuideScene .tg-question { justify-content:flex-start; text-align:left; min-height:52px; }
#tdGuideScene .tg-paper { width:120px; height:160px; padding:14px; margin:8px 0; background:#fff; border:1px solid #acb7bd; border-radius:5px; color:#253b47; box-shadow:0 2px 8px #0001; }
#tdGuideScene .tg-paper hr { border:0; border-top:1px solid #b4c0c9; margin:10px 0; }
#tdGuideScene .tg-paper div { font-size:12px; text-align:right; color:#386398; }
#tdGuideScene .tg-thumbnail { display:inline-grid; width:max-content; max-width:100%; padding:8px; border-radius:11px; background:var(--td-icon-fill); }
#tdGuideScene .tg-message { padding:12px; background:var(--td-icon-fill); border-radius:14px 14px 14px 3px; margin-right:20px!important; }
#tdGuideScene .tg-message-me { margin:6px 0 0 20px!important; background:#069ccc20; border-radius:14px 14px 3px 14px; }
#tdGuideScene .tg-clock { display:block; text-align:center; padding:20px 4px; font:700 clamp(24px,4vw,40px)/1.2 system-ui; font-variant-numeric:tabular-nums; }
#tdGuideScene .tg-settings-stack { display:grid; gap:8px; }
#tdGuideScene .tg-settings-row { display:block; padding:15px; border:1px solid var(--td-border); border-radius:12px; background:var(--td-surface-raised); }
@keyframes tg-ring-in { from { opacity:.3; transform:scale(1.05); } to { opacity:1; transform:scale(1); } }
@media(prefers-reduced-motion:no-preference) {
  #tdGuideRing { transition:left .18s ease,top .18s ease,width .18s ease,height .18s ease; }
}
@media(max-width:699px) {
  #tdWalkthrough.td-context-guide[open] { width:calc(100vw - 12px); height:calc(100dvh - 12px); max-height:calc(100dvh - 12px); padding:10px; gap:8px; border-radius:18px; }
  #tdWalkthrough.td-context-guide .td-guide-top { font-size:11px; }
  #tdWalkthrough.td-context-guide .td-guide-navigation { gap:8px; }
  #tdWalkthrough.td-context-guide .td-guide-navigation label { display:grid; grid-template-columns:1fr; gap:4px; font-size:11px; }
  #tdWalkthrough.td-context-guide .td-guide-navigation :is(input,select) { font-size:14px; height:40px; min-height:40px; }
  #tdWalkthrough.td-context-guide #tdGuideSearchResults { top:62px; }
  #tdGuideWorkspace { grid-template-columns:minmax(0,1fr); grid-template-rows:minmax(100px,1fr) auto; gap:22px; }
  #tdGuideCallout { align-self:stretch; padding:12px 14px; max-height:185px; }
  #tdWalkthrough.td-context-guide #tdGuideCaption { margin-bottom:5px; font-size:11px; }
  #tdWalkthrough.td-context-guide #tdGuideTitle { font-size:18px; margin-bottom:5px; }
  #tdWalkthrough.td-context-guide #tdGuideText { font-size:14px; line-height:1.4; }
  #tdGuideAreaCount { font-size:11px; margin-top:7px; }
  #tdWalkthrough.td-context-guide .td-guide-progress small { display:none; }
  #tdGuideScene { padding:10px; font-size:13px; }
  #tdGuideScene .tg-toolbar { gap:4px; }
  #tdGuideScene .tg-toolbar > :is(.tg-button,.tg-icon) { flex-basis:33px; padding:6px; min-height:38px; }
  #tdGuideScene .tg-toolbar .tg-upload { flex:1; font-size:12px; }
  #tdGuideScene .tg-toolbar svg { width:19px; height:19px; }
  #tdGuideScene .tg-heading { font-size:18px; }
}
@media(max-height:480px) and (min-width:700px) {
  #tdWalkthrough.td-context-guide[open] { padding:8px 12px; gap:5px; }
  #tdWalkthrough.td-context-guide .td-guide-top { min-height:24px; }
  #tdWalkthrough.td-context-guide .td-guide-top button { min-height:30px; }
  #tdWalkthrough.td-context-guide .td-guide-footer { padding-top:5px; }
  #tdGuideCallout { padding:12px; }
  #tdWalkthrough.td-context-guide #tdGuideTitle { font-size:18px; }
  #tdWalkthrough.td-context-guide #tdGuideText { font-size:13px; }
}
@media(prefers-reduced-motion:reduce) { #tdGuideRing { animation:none; } }
#tdGuideScene .tg-real-capture { position:relative; width:100%; min-width:0; margin-top:14px; }
#tdGuideScene .tg-real-capture > img { display:block; width:100%; height:auto; max-width:100%; border-radius:12px; }
#tdGuideScene .tg-real-anchor { position:absolute; display:block; margin:0; padding:0; background:transparent; border:0; pointer-events:none; }
#tdGuideScene .tg-manual-range { display:block; min-width:0; }
#tdGuideScene .tg-manual-range .tg-row { display:grid; grid-template-columns:20px repeat(2,minmax(0,1fr)) 58px; gap:5px; align-items:center; }
#tdGuideScene .tg-manual-range .tg-field { min-width:0; padding:7px 2px; text-align:center; }
#tdGuideScene .tg-manual-range .tg-field > span { font-size:11px; white-space:nowrap; }
#tdGuideScene .tg-manual-range .tg-field > strong { font-size:15px; }
#tdGuideScene .tg-manual-activity { align-items:end; }
#tdGuideScene .tg-manual-activity > .tg-button { flex:0 0 42px; padding:9px; }
#tdGuideScene .tg-duration { display:flex; align-items:center; justify-content:space-between; padding:8px 12px; margin:8px 0; border:1px solid var(--td-border); border-radius:10px; color:var(--td-ink); }
#tdGuideScene .tg-duration-buttons { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; margin:10px 0; }
#tdGuideScene .tg-duration-buttons > .tg-button { padding:8px 2px; font-size:13px; min-width:0; }
#tdGuideScene .tg-add-activity { position:relative; }
#tdGuideScene .tg-repeat-anchor { position:absolute; inset:0; }
