/* Chronoscope — static chrome styling. Per-item computed styles are set inline by app.js. */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: #05060c;
  color: #e8edf7;
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

@keyframes slideIn { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { transform: scale(0.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(150,170,210,0.25); border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }
input::placeholder, textarea::placeholder { color: rgba(180,195,225,0.35); }

.root {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 600px;
  overflow: hidden;
  background: #05060c;
  user-select: none;
  --sidebar: 276px;
  --header: 64px;
  --ruler: 28px;
  --accent: #8ea0ff;
  --panel-bg: rgba(9,12,22,0.85);
  --panel-border: rgba(150,170,210,0.16);
  --blur: blur(16px);
}

#cv { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }

.ruler {
  position: absolute; left: var(--sidebar); top: var(--header); right: 0;
  height: var(--ruler);
  background: rgba(6,8,16,0.55);
  border-bottom: 1px solid rgba(150,170,210,0.12);
  z-index: 7;
}

.lanescroll {
  position: absolute; left: var(--sidebar); top: calc(var(--header) + var(--ruler)); right: 0; bottom: 0;
  overflow-y: auto; overflow-x: hidden; z-index: 10;
}
.lanecontent { position: relative; width: 100%; min-height: 100%; }

/* header */
.header {
  position: absolute; top: 0; left: 0; right: 0; height: var(--header);
  z-index: 50; background: var(--panel-bg); backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--panel-border);
  display: flex; align-items: center; gap: 20px;
  padding: 0 20px 0 calc(var(--sidebar) + 20px);
}
.brand { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.wordmark { font-size: 15px; font-weight: 700; letter-spacing: 0.04em; white-space: nowrap; }
.eraname { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--accent); text-transform: uppercase; letter-spacing: 0.12em; white-space: nowrap; }
.searchwrap { position: relative; flex: 1; max-width: 380px; margin: 0 auto; }
.search {
  width: 100%; background: rgba(12,16,28,0.7); border: 1px solid rgba(150,170,210,0.18);
  border-radius: 8px; padding: 8px 12px; color: #e8edf7;
  font-family: 'IBM Plex Mono', monospace; font-size: 12px; outline: none;
}
.results {
  position: absolute; top: 40px; left: 0; right: 0;
  background: rgba(10,13,24,0.97); backdrop-filter: blur(12px);
  border: 1px solid rgba(150,170,210,0.2); border-radius: 10px; overflow: hidden;
  box-shadow: 0 18px 50px rgba(0,0,0,0.6); z-index: 60; animation: fadeIn 0.12s ease;
}
.results .res { padding: 9px 13px; cursor: pointer; border-bottom: 1px solid rgba(150,170,210,0.08); display: flex; align-items: center; gap: 10px; }
.results .res:hover { background: rgba(150,170,210,0.1); }
.results .res:last-child { border-bottom: none; }
.results .res .rdot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.results .res .rtitle { font-size: 12.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.results .res .rsub { font-family: 'IBM Plex Mono', monospace; font-size: 10px; color: rgba(180,195,225,0.55); }
.results .empty { padding: 12px; font-size: 12px; color: rgba(180,195,225,0.5); text-align: center; }
.readouts { display: flex; align-items: center; gap: 18px; font-family: 'IBM Plex Mono', monospace; white-space: nowrap; }
.readouts .ro-k { font-size: 9px; color: rgba(180,195,225,0.5); text-transform: uppercase; letter-spacing: 0.1em; }
.readouts .ro-v { font-size: 13px; font-weight: 600; }
.readouts .ro-box { text-align: right; }
.readouts .ro-box.div { border-left: 1px solid rgba(150,170,210,0.15); padding-left: 18px; }
.lang {
  flex: none; background: rgba(12,16,28,0.7); border: 1px solid rgba(150,170,210,0.22);
  border-radius: 8px; padding: 6px 8px; color: #e8edf7; font-family: 'IBM Plex Mono', monospace;
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em; cursor: pointer; outline: none;
}
.lang option { background: #0c1120; color: #e8edf7; }
.hamburger {
  flex: none; width: 34px; height: 34px; border-radius: 8px; border: 1px solid rgba(150,170,210,0.22);
  background: rgba(12,16,28,0.6); color: #e8edf7; font-size: 16px; line-height: 1; cursor: pointer;
  display: none; align-items: center; justify-content: center;
}

/* sidebar */
.sidebar {
  position: absolute; top: 0; left: 0; bottom: 0; width: var(--sidebar);
  z-index: 52; background: var(--panel-bg); backdrop-filter: var(--blur);
  border-right: 1px solid var(--panel-border);
  display: flex; flex-direction: column;
  transition: transform 0.28s cubic-bezier(0.2,0.8,0.2,1);
}
.side-h { padding: 16px 16px 10px; border-bottom: 1px solid rgba(150,170,210,0.12); }
.side-h span { font-size: 10px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(180,195,225,0.55); }
.tllist { flex: 1; overflow-y: auto; padding: 8px; }
.tllist .tlrow { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 9px; cursor: pointer; margin-bottom: 2px; transition: background 0.12s; }
.tllist .tlrow:hover { background: rgba(150,170,210,0.06); }
.tllist .tlrow .sw { width: 11px; height: 11px; border-radius: 3px; flex: none; }
.tllist .tlrow .tl-main { flex: 1; min-width: 0; }
.tllist .tlrow .tl-name { font-size: 12.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tllist .tlrow .tl-meta { font-family: 'IBM Plex Mono', monospace; font-size: 9.5px; color: rgba(180,195,225,0.45); }
.tllist .tlrow .tl-check { width: 16px; text-align: center; font-size: 12px; flex: none; }
.side-f { padding: 12px; border-top: 1px solid rgba(150,170,210,0.12); }
.addbtn { width: 100%; background: rgba(150,170,210,0.1); border: 1px solid rgba(150,170,210,0.22); color: #e8edf7; border-radius: 8px; padding: 9px; font-family: 'IBM Plex Sans', sans-serif; font-size: 12px; font-weight: 500; cursor: pointer; }
.addbtn:hover { background: rgba(150,170,210,0.18); }
.scrim { position: absolute; inset: 0; z-index: 60; background: rgba(4,5,10,0.5); backdrop-filter: blur(2px); animation: fadeIn 0.2s ease; }

/* jump bar */
.jumpbar {
  position: absolute; left: calc(var(--sidebar) + 16px); bottom: 16px; z-index: 40;
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  max-width: calc(100% - var(--sidebar) - 200px);
}
.jumpbar .jlabel { font-family: 'IBM Plex Mono', monospace; font-size: 9px; color: rgba(180,195,225,0.5); text-transform: uppercase; letter-spacing: 0.12em; margin-right: 4px; white-space: nowrap; }
.jumpbar button {
  border: 1px solid rgba(150,170,210,0.2); background: rgba(12,16,28,0.55); color: rgba(210,220,240,0.85);
  border-radius: 7px; padding: 6px 11px; font-family: 'IBM Plex Mono', monospace; font-size: 11px;
  cursor: pointer; white-space: nowrap; transition: all 0.12s;
}
.jumpbar button.active { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 18%, transparent); color: #fff; }
.jumpbar button:hover { border-color: var(--accent); }

/* scale indicator */
.scaleind {
  position: absolute; right: 18px; bottom: 16px; z-index: 41;
  display: flex; flex-direction: column; align-items: flex-end; gap: 4px;
  pointer-events: none; text-shadow: 0 1px 4px rgba(0,0,0,0.85);
}
.scalelabel { font-family: 'IBM Plex Mono', monospace; font-size: 11px; font-weight: 600; color: rgba(230,238,255,0.72); letter-spacing: 0.04em; }
.scalebar { height: 7px; border-left: 2px solid rgba(230,238,255,0.72); border-right: 2px solid rgba(230,238,255,0.72); border-bottom: 2px solid rgba(230,238,255,0.72); box-sizing: border-box; }

/* hint */
.hint {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: 78px; z-index: 30;
  background: rgba(10,13,24,0.8); backdrop-filter: blur(8px); border: 1px solid rgba(150,170,210,0.18);
  border-radius: 20px; padding: 7px 16px; font-family: 'IBM Plex Mono', monospace; font-size: 11px;
  color: rgba(200,212,236,0.85); display: flex; gap: 14px; animation: fadeIn 0.4s ease; white-space: nowrap;
}

/* detail + modal (built by JS) */
.detail-backdrop { position: absolute; inset: 0; z-index: 58; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(4,5,10,0.34); backdrop-filter: blur(0.5px); animation: fadeIn 0.15s ease; }
.detail-card { width: 360px; max-width: 92%; max-height: 82%; overflow-y: auto; background: rgba(10,13,24,0.97); backdrop-filter: blur(16px); border-radius: 14px; box-shadow: 0 30px 80px rgba(0,0,0,0.7); animation: popIn 0.24s cubic-bezier(0.2,0.9,0.2,1); }
.detail-accent { height: 4px; border-radius: 14px 14px 0 0; }
.detail-body { padding: 18px; }
.detail-body .d-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.detail-body .d-kind { font-family: 'IBM Plex Mono', monospace; font-size: 10px; text-transform: uppercase; letter-spacing: 0.12em; }
.detail-body .d-close { cursor: pointer; color: rgba(180,195,225,0.6); font-size: 18px; line-height: 1; padding: 2px 6px; }
.detail-body .d-close:hover { color: #fff; }
.detail-body .d-title { font-size: 19px; font-weight: 700; line-height: 1.2; margin-bottom: 4px; }
.detail-body .d-time { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: rgba(200,212,236,0.7); margin-bottom: 2px; }
.detail-body .d-tl { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: rgba(180,195,225,0.5); margin-bottom: 14px; }
.detail-body .d-desc { font-size: 13px; line-height: 1.6; color: rgba(220,228,244,0.88); margin: 0 0 16px; }
.detail-body .d-actions { display: flex; gap: 8px; }
.detail-body .d-zoom { flex: 1; border: none; color: #06080f; border-radius: 8px; padding: 9px; font-family: 'IBM Plex Sans', sans-serif; font-size: 12px; font-weight: 600; cursor: pointer; }
.detail-body .d-link { flex: 1; text-align: center; background: rgba(150,170,210,0.12); border: 1px solid rgba(150,170,210,0.22); color: #e8edf7; border-radius: 8px; padding: 9px; font-family: 'IBM Plex Sans', sans-serif; font-size: 12px; font-weight: 500; cursor: pointer; text-decoration: none; }

.modal-backdrop { position: absolute; inset: 0; z-index: 80; background: rgba(4,5,10,0.6); backdrop-filter: blur(1px); display: flex; align-items: center; justify-content: center; animation: fadeIn 0.15s ease; }
.modal-card { width: 440px; max-width: 92%; max-height: 88%; overflow-y: auto; background: #0c1120; border: 1px solid rgba(150,170,210,0.22); border-radius: 16px; box-shadow: 0 30px 80px rgba(0,0,0,0.7); }
.modal-tabs { display: flex; border-bottom: 1px solid rgba(150,170,210,0.14); }
.modal-tabs .tab { padding: 14px 18px; cursor: pointer; font-size: 12.5px; font-weight: 500; color: rgba(180,195,225,0.55); border-bottom: 2px solid transparent; }
.modal-tabs .tab.on { color: #fff; }
.modal-tabs .x { margin-left: auto; padding: 14px 18px; cursor: pointer; color: rgba(180,195,225,0.6); font-size: 18px; }
.modal-tabs .x:hover { color: #fff; }
.modal-body { padding: 20px; }
.modal-body label { display: block; font-size: 11px; color: rgba(180,195,225,0.6); margin-bottom: 6px; }
.modal-body .fin { width: 100%; background: rgba(8,11,20,0.8); border: 1px solid rgba(150,170,210,0.2); border-radius: 8px; padding: 9px 11px; color: #e8edf7; font-family: 'IBM Plex Sans', sans-serif; font-size: 13px; outline: none; }
.modal-body textarea.fin { resize: vertical; min-height: 48px; }
.modal-body .swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.modal-body .swatch { width: 30px; height: 30px; border-radius: 8px; cursor: pointer; border: 2px solid transparent; }
.modal-body .go { margin-top: 20px; width: 100%; border: none; color: #06080f; border-radius: 8px; padding: 11px; font-weight: 600; font-size: 13px; cursor: pointer; font-family: 'IBM Plex Sans', sans-serif; }
.modal-body .row2 { display: flex; gap: 12px; margin-top: 14px; }
.modal-body .typebtns { display: flex; gap: 8px; margin: 16px 0; }
.modal-body .typebtn { flex: 1; text-align: center; padding: 8px; border-radius: 7px; cursor: pointer; font-size: 12px; border: 1px solid rgba(150,170,210,0.2); color: rgba(200,212,236,0.7); }
.modal-body .yearhelp { font-size: 10px; color: rgba(180,195,225,0.4); margin-top: 6px; font-family: 'IBM Plex Mono', monospace; }
.modal-body .checkline { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-size: 12px; cursor: pointer; color: rgba(220,228,244,0.85); }
.modal-body .empty-tab { text-align: center; padding: 24px 12px; }
.modal-body .empty-tab .msg { font-size: 13px; color: rgba(220,228,244,0.8); margin-bottom: 14px; }

/* compact */
.root.compact { --sidebar: 0px; --header: 46px; }
.root.compact .hamburger { display: flex; }
.root.compact .wordmark { display: none; }
.root.compact .readouts { display: none; }
.root.compact .header { gap: 10px; padding: 0 12px; }
.root.compact .sidebar { width: 260px; z-index: 62; background: rgba(7,10,18,0.97); box-shadow: 0 0 60px rgba(0,0,0,0.6); transform: translateX(-100%); }
.root.compact .sidebar.open { transform: translateX(0); }
.root.compact .jumpbar { left: 10px; bottom: 10px; flex-wrap: nowrap; overflow-x: auto; max-width: calc(100% - 130px); padding-bottom: 2px; }
.root.compact .scaleind { right: 12px; bottom: 10px; }
.root.compact .scalelabel { font-size: 9.5px; }
.root.compact .scalebar { height: 6px; }
