/* The Senate's arts. Same chrome as the atlas: archive tokens, hairlines, two inks. */

.tech-body { overflow: hidden; height: 100vh; height: 100dvh; display: flex; flex-direction: column; }
.tech-body .site-header { flex: 0 0 auto; background: var(--paper); }
.tech-crumb { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.tech-link { font-family: var(--mono); font-size: 12px; color: var(--blue); text-decoration: none; border-bottom: 1px solid var(--rule); }

.tech { position: relative; flex: 1 1 auto; min-height: 0; }
.tech-canvas { position: absolute; inset: 0; overflow: hidden; background: var(--paper); cursor: grab; touch-action: none; }
.tech-canvas.is-dragging { cursor: grabbing; }
.tech-canvas svg { width: 100%; height: 100%; display: block; }

/* --- the sheet ------------------------------------------------------------------ */
.tt-rule { stroke: var(--rule); stroke-width: 1; }
.tt-year { font-family: var(--serif); font-size: 22px; font-weight: 600; fill: var(--ink); }
.tt-year-reign { font-family: var(--mono); font-size: 11px; fill: var(--muted); }
.tt-branch { font-family: var(--mono); font-size: 11px; fill: var(--muted); }
.tt-branch-zh { font-family: var(--serif); font-size: 12px; fill: var(--muted); }
.tt-year.is-now { fill: var(--vermilion); }
.tt-column-now { fill: var(--vermilion); opacity: 0.045; }

/* --- edges -------------------------------------------------------------------- */
.tt-edge { fill: none; stroke: var(--ink); stroke-width: 1; opacity: 0.45; }
.tt-edge.is-later { opacity: 0.18; stroke-dasharray: 2 3; }
.tt-edge.is-lit { stroke: var(--vermilion); opacity: 0.95; stroke-width: 1.4; }
.tt-edge.is-dim { opacity: 0.08; }

/* --- nodes -------------------------------------------------------------------- */
.tt-node { cursor: pointer; }
.tt-node rect { fill: var(--panel); stroke: var(--ink); stroke-width: 1; }
.tt-node .tt-name { font-family: var(--mono); font-size: 11px; fill: var(--ink); }
.tt-node .tt-zh { font-family: var(--serif); font-size: 11px; fill: var(--muted); }
.tt-node .tt-icon { fill: none; stroke: var(--ink); stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.tt-node.is-later rect { stroke: var(--rule); stroke-dasharray: 3 2; fill: transparent; }
.tt-node.is-later .tt-name, .tt-node.is-later .tt-zh { fill: var(--muted); opacity: 0.7; }
.tt-node.is-later .tt-icon { stroke: var(--muted); opacity: 0.6; }
.tt-node.is-now rect { stroke: var(--vermilion); stroke-width: 1.5; }
.tt-node.is-now .tt-icon { stroke: var(--vermilion); }
.tt-node.is-now .tt-name { fill: var(--vermilion); }
.tt-node.is-lit rect { stroke: var(--vermilion); }
.tt-node.is-lit .tt-icon { stroke: var(--vermilion); }
.tt-node.is-dim { opacity: 0.3; }
.tt-node.is-selected rect { stroke-width: 2; stroke: var(--vermilion); }
.tt-node:focus { outline: none; }
.tt-node:focus-visible rect { stroke: var(--blue); stroke-width: 2; }

/* --- panel ------------------------------------------------------------------ */
.tech-panel {
  position: absolute; top: 16px; left: 16px; width: 300px; max-height: calc(100% - 32px); overflow-y: auto;
  background: var(--panel); border: 1px solid var(--rule); border-radius: 3px; padding: 14px 16px 12px;
  font-family: var(--mono); font-size: 12px; line-height: 1.5; color: var(--ink); box-shadow: var(--overlay-shadow);
}
.tech-panel section + section { border-top: 1px solid var(--rule); margin-top: 12px; padding-top: 10px; }
.tech-label { display: block; color: var(--muted); font-size: 11px; margin-bottom: 4px; }
.tech-year-head { display: flex; align-items: baseline; gap: 10px; }
.tech-year-value { font-family: var(--serif); font-size: 30px; font-weight: 600; line-height: 1; color: var(--vermilion); }
.tech-year-reign { color: var(--muted); font-size: 11px; }
.tech-slider { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; margin: 6px 0 0; cursor: ew-resize; }
.tech-slider:focus { outline: none; }
.tech-slider::-webkit-slider-runnable-track { height: 1px; background: var(--ink); }
.tech-slider::-moz-range-track { height: 1px; background: var(--ink); }
.tech-slider::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 10px; height: 18px; margin-top: -9px; background: var(--vermilion); border: 1px solid var(--ink); border-radius: 2px; }
.tech-slider::-moz-range-thumb { width: 8px; height: 16px; background: var(--vermilion); border: 1px solid var(--ink); border-radius: 2px; }
.tech-slider:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--blue); outline-offset: 2px; }
.tech-ticks { display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; margin: 0 2px; }
.tech-summary { font-family: var(--serif); font-size: 14px; line-height: 1.5; margin: 10px 0 0; min-height: 3em; }

.tech-buttons { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.tech-buttons button, .tech-panel-toggle, .tech-slip-close {
  font-family: var(--mono); font-size: 12px; background: transparent; color: var(--ink);
  border: 1px solid var(--rule); border-radius: 3px; padding: 3px 9px; cursor: pointer;
}
.tech-buttons button:hover, .tech-panel-toggle:hover { border-color: var(--ink); }
.tech-key { list-style: none; margin: 0; padding: 0; }
.tech-key li { display: flex; align-items: center; gap: 8px; margin: 3px 0; }
.tk { display: inline-block; width: 22px; height: 12px; box-sizing: border-box; border: 1px solid var(--ink); background: var(--panel); }
.tk-now { border-color: var(--vermilion); border-width: 1.5px; }
.tk-later { border: 1px dashed var(--rule); background: transparent; }
.tech-note { font-family: var(--mono); font-size: 11px; line-height: 1.45; color: var(--muted); margin: 12px 0 0; }
.tech-panel-toggle { position: absolute; top: 16px; left: 16px; display: none; background: var(--panel); }

/* --- slip ------------------------------------------------------------------- */
.tech-slip {
  position: absolute; top: 16px; right: 16px; width: 300px; background: var(--panel);
  border: 1px solid var(--rule); border-radius: 3px; padding: 14px 16px; box-shadow: var(--overlay-shadow);
}
.tech-slip-close { position: absolute; top: 8px; right: 8px; padding: 0 6px; line-height: 1.4; }
.tech-slip-kind { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.tech-slip-name { font-family: var(--serif); font-size: 20px; font-weight: 600; margin: 2px 24px 0 0; line-height: 1.25; }
.tech-slip-zh { font-family: var(--serif); font-size: 15px; color: var(--muted); margin-top: 2px; }
.tech-slip-note { font-family: var(--serif); font-size: 14px; line-height: 1.5; margin: 8px 0 0; }
.tech-slip-pre { font-family: var(--mono); font-size: 11px; color: var(--muted); margin-top: 8px; border-top: 1px solid var(--rule); padding-top: 6px; }
.tech-slip-pre b { font-weight: 500; color: var(--ink); }
.tech-slip-ref { font-family: var(--mono); font-size: 11px; color: var(--blue); margin-top: 4px; }

@media (max-width: 768px) {
  .tech-panel { top: auto; bottom: 0; left: 0; right: 0; width: auto; max-height: 55%; border-radius: 3px 3px 0 0; border-bottom: 0; }
  .tech-panel.is-collapsed { display: none; }
  .tech-panel-toggle { display: block; }
  .tech-slip { top: 12px; left: 12px; right: 12px; width: auto; }
  .tech-crumb, .tech-note { display: none; }
}
.tech-slip-ref a { color: var(--blue); text-decoration: none; border-bottom: 1px solid var(--rule); }
.tech-slip-ref a:hover { border-color: var(--blue); }
