/* The Economic Time Machine */
.tm-eras { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.tm-eracard { position: relative; text-align: left; border: 1px solid var(--line); background: var(--surface-strong); border-radius: 18px; padding: 16px 16px 14px; display: grid; gap: 4px; transition: transform .15s, border-color .15s, box-shadow .15s; overflow: hidden; }
.tm-eracard:hover { transform: translateY(-2px); border-color: var(--accent-soft-2); box-shadow: var(--shadow-sm); }
.tm-eracard.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft-2), var(--shadow-sm); }
.tm-eracard .tm-icon { position: absolute; right: 12px; top: 10px; font-size: 30px; opacity: .9; }
.tm-year { font: 800 30px/1 var(--display); letter-spacing: -.03em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tm-eracard b { font: 700 15px var(--display); color: var(--ink); }
.tm-tag { font-size: 12.5px; color: var(--ink-3); line-height: 1.4; }

.tm-era { padding: 24px; }
.tm-grid { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.25fr); gap: 28px; }
.tm-place { font-size: 12px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .08em; }
.tm-h { font: 800 26px/1.15 var(--display); letter-spacing: -.02em; margin: 4px 0 4px; }
.tm-story { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; position: relative; }
.tm-story li { display: grid; grid-template-columns: 92px 1fr; gap: 10px; font-size: 14px; color: var(--ink-2); position: relative; }
.tm-when { font-weight: 700; color: var(--ink); font-size: 13px; }
.tm-q { margin: 20px 0 12px; padding: 14px 16px; border-radius: 14px; background: var(--accent-soft); border: 1px solid var(--accent-soft-2); }
.tm-qlabel { font-size: 11px; font-weight: 800; color: var(--accent-ink); text-transform: uppercase; letter-spacing: .08em; }
.tm-q p { margin: 6px 0 0; font: 600 15.5px/1.45 var(--display); color: var(--ink); }
.tm-choices { display: grid; gap: 8px; }
.tm-choice { display: flex; gap: 12px; align-items: flex-start; text-align: left; border: 1.5px solid var(--line); background: var(--surface-2); border-radius: 14px; padding: 12px 14px; transition: all .15s; }
.tm-choice:hover { border-color: var(--c); background: var(--surface-strong); }
.tm-choice.on { border-color: var(--c); background: var(--surface-strong); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 18%, transparent); }
.tm-choice b { display: block; font-size: 14.5px; color: var(--ink); }
.tm-choice span span { display: block; font-size: 12.5px; color: var(--ink-3); margin-top: 2px; line-height: 1.4; }
.tm-radio { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--c); flex-shrink: 0; margin-top: 2px; display: grid; place-items: center; }
.tm-choice.on .tm-radio::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.tm-hist { display: inline-block; margin-top: 6px; font-style: normal; font-size: 11.5px; font-weight: 700; color: var(--ink-2); background: var(--surface-strong); border: 1px solid var(--line); padding: 2px 8px; border-radius: 999px; }

.tm-right { min-width: 0; }
.tm-empty { height: 100%; min-height: 320px; display: grid; place-content: center; text-align: center; gap: 12px; color: var(--ink-3); border: 2px dashed var(--line-2); border-radius: 18px; padding: 24px; }
.tm-empty p { max-width: 320px; margin: 0 auto; }
.tm-empty-ic { font-size: 54px; filter: grayscale(.2); }
.tm-spin { width: 44px; height: 44px; margin: 0 auto; border-radius: 50%; border: 4px solid var(--accent-soft-2); border-top-color: var(--accent); animation: tmspin .8s linear infinite; }
@keyframes tmspin { to { transform: rotate(360deg); } }
.tm-chart-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.tm-ch-title { font: 800 17px var(--display); }
.tm-ch-sub { font-size: 12.5px; color: var(--ink-3); }
.tm-chart { margin-top: 8px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 16px; padding: 8px 6px 2px; }
.tm-svg { width: 100%; height: auto; display: block; }
.tm-grid-l { stroke: var(--line); }
.tm-ax { font: 500 10.5px var(--font); fill: var(--ink-3); }
.tm-mark { stroke: var(--ink-3); stroke-dasharray: 3 4; opacity: .55; }
.tm-mark-t { font: 600 10px var(--font); fill: var(--ink-3); }
.tm-dec { fill: var(--accent); opacity: .5; }
.tm-line { fill: none; stroke-width: 2; stroke-opacity: .45; stroke-dasharray: 5 4; stroke-linejoin: round; }
.tm-line.me { stroke-width: 3.4; stroke-opacity: 1; stroke-dasharray: none; stroke-dashoffset: 0; animation: tmdraw 1.1s ease-out; }
@keyframes tmdraw { from { stroke-dasharray: 2000; stroke-dashoffset: 2000; } to { stroke-dasharray: 2000; stroke-dashoffset: 0; } }
.tm-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--ink-3); margin: 8px 2px 0; }
.tm-legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: 3px; }
.tm-legend .me { color: var(--ink); font-weight: 700; }
.tm-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.tm-stat { background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; display: grid; gap: 2px; }
.tm-stat span:first-child { font-size: 11.5px; color: var(--ink-3); font-weight: 600; }
.tm-stat b { font: 800 20px var(--display); letter-spacing: -.02em; }
.tm-stat .tm-good, .tm-stat .tm-bad, .tm-stat .tm-same { font-size: 11.5px; font-weight: 700; }
.tm-good { color: var(--good); } .tm-bad { color: var(--bad); } .tm-same { color: var(--ink-3); }
.tm-verdict { margin-top: 12px; padding: 12px 14px; border-radius: 14px; background: var(--accent-soft); border: 1px solid var(--accent-soft-2); color: var(--ink-2); font-size: 14px; }
.tm-verdict b { color: var(--ink); }
.tm-real { margin-top: 12px; border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; background: var(--surface-2); }
.tm-real summary { cursor: pointer; font-weight: 700; }
.tm-real p { color: var(--ink-2); font-size: 13.5px; margin: 8px 0 0; line-height: 1.55; }
.tm-lesson { padding-top: 8px; border-top: 1px dashed var(--line-2); }
.tm-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

@media (max-width: 1000px) {
  .tm-eras { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tm-grid { grid-template-columns: 1fr; }
  .tm-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .tm-era { padding: 16px; }
  .tm-eracard { padding: 12px; }
  .tm-year { font-size: 24px; }
  .tm-tag { display: none; }
  .tm-story li { grid-template-columns: 1fr; gap: 0; }
}
@media (prefers-reduced-motion: reduce) { .tm-line.me { animation: none; } }
