* { box-sizing: border-box; }
html, body { margin: 0; background: #d9dcdf; font-family: Poppins, system-ui, sans-serif; }
#stage { width: 100%; max-width: 1920px; margin: 0 auto; }
#stage svg { display: block; width: 100%; height: auto; background: #fff; }
#stage svg *, #overlay svg * { pointer-events: none; }
#stage svg .hot, #overlay svg .hot { pointer-events: all; }
.hot { fill: transparent; cursor: pointer; }
.widget-link:hover, .widget-link:focus-visible {
  fill: rgba(20, 118, 123, .06);
  stroke: #14767b;
  stroke-width: 2;
  outline: none;
}
.hot.dead { cursor: not-allowed; }
body.flash .hot, body.show-hot .hot { fill: rgba(31, 145, 255, .18); stroke: rgba(31, 145, 255, .8); stroke-width: 2; }
body.show-hot .hot.dead, body.flash .hot.dead { fill: rgba(150, 150, 150, .15); stroke: rgba(150, 150, 150, .6); }

#overlay { position: fixed; inset: 0; background: rgba(0,0,0,.35); display: flex; align-items: flex-start; justify-content: center; overflow: auto; z-index: 20; }
#overlay[hidden] { display: none; }
#overlay .sheet { width: min(100%, 1920px); }

#menuBtn { position: fixed; left: 10px; bottom: 10px; z-index: 40; width: 40px; height: 40px; border-radius: 50%;
  border: 0; background: #14767b; color: #fff; font-size: 18px; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.3); opacity: .55; }
#menuBtn:hover { opacity: 1; }
#menu { position: fixed; left: 0; top: 0; bottom: 0; width: 340px; max-width: 90vw; background: #fff; z-index: 30;
  box-shadow: 2px 0 16px rgba(0,0,0,.2); display: flex; flex-direction: column; }
#menu[hidden] { display: none; }
#menu header { padding: 14px; border-bottom: 1px solid #eee; display: grid; gap: 8px; }
#menu input#filter { padding: 8px 10px; border: 1px solid #ccc; border-radius: 6px; font: inherit; }
#menu .toggle { font-size: 13px; color: #444; }
#screenList { list-style: none; margin: 0; padding: 6px 0 70px; overflow: auto; font-size: 13px; }
#screenList a { display: block; padding: 6px 14px; color: #222; text-decoration: none; }
#screenList a:hover { background: #eef7f7; }
#screenList a.current { background: #14767b; color: #fff; }
#screenList .num { display: inline-block; width: 34px; color: #999; }
#screenList a.current .num { color: #cde; }

#menu .datalink { display: block; padding: 8px 10px; border-radius: 6px; background: #eef7f7; color: #14767b; text-decoration: none; font-weight: 600; font-size: 14px; }

/* data tables page */
body.data-mode { background: #f4f6f7; }
body.data-mode #stage { max-width: none; }
.datapage { display: grid; grid-template-columns: 240px 1fr; grid-template-rows: auto 1fr; min-height: 100vh; font-size: 13px; color: #222; }
.datapage header { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 14px 20px; background: #fff; border-bottom: 1px solid #e3e6e8; }
.datapage h1 { font-size: 20px; margin: 0; color: #14767b; }
.datapage .back { color: #14767b; text-decoration: none; font-weight: 600; }
.datapage .hint { color: #666; flex: 1 1 300px; }
.datapage button { font: inherit; padding: 7px 12px; border-radius: 6px; border: 1px solid #14767b; background: #14767b; color: #fff; cursor: pointer; }
.datapage button#reset { background: #fff; color: #14767b; }
.datapage button:disabled { opacity: .45; cursor: default; }
.datapage nav { background: #fff; border-right: 1px solid #e3e6e8; padding: 10px 0; }
.datapage nav a { display: flex; justify-content: space-between; padding: 8px 18px; color: #333; text-decoration: none; }
.datapage nav a small { color: #999; }
.datapage nav a.on { background: #14767b; color: #fff; }
.datapage nav a.on small { color: #cde; }
.datapage section { padding: 16px 20px; overflow: auto; }
.datapage table { border-collapse: collapse; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.datapage th { position: sticky; top: 0; background: #e6f2f2; color: #14767b; text-align: left; padding: 8px; font-weight: 600; white-space: nowrap; }
.datapage td { border-top: 1px solid #eef0f1; padding: 3px 4px; vertical-align: top; }
.datapage td select { min-width: 160px; }
.datapage td input, .datapage td select, .datapage td textarea { font: inherit; border: 1px solid transparent; background: transparent; padding: 4px 5px; min-width: 90px; width: 100%; border-radius: 4px; }
.datapage td textarea { min-width: 220px; min-height: 48px; }
.datapage td input:hover, .datapage td select:hover, .datapage td textarea:hover { border-color: #cfd8da; }
.datapage td input:focus, .datapage td textarea:focus { border-color: #14767b; background: #fff; outline: none; }
.datapage td.edited { background: #fff6d6; }
.datapage td.used { white-space: nowrap; padding: 7px 8px; color: #14767b; }
.datapage td.used details a { display: block; color: #14767b; padding: 2px 0; }
.datapage td.used .none { color: #bbb; }
@media (max-width: 700px) { .datapage { grid-template-columns: 1fr; } .datapage nav { display: flex; overflow: auto; border-right: 0; } .datapage nav a { white-space: nowrap; } }

#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #222; color: #fff;
  padding: 10px 16px; border-radius: 6px; font-size: 14px; z-index: 50; }
#toast[hidden] { display: none; }
