/* eneraque.app shared styles, from the Eneraque Brand Style Guide 2026 v7.
   Primary: Dark Blue #263746 (50%), Light Blue #4FB2CE (25%), Green #AFBC21 (25%).
   Secondary: Mid Blue #2E4C66, Blue #1381B0, Dark Green #73A808.
   Headings: Poppins. Body: Frutiger in print; Segoe UI / system sans on screen. */

:root {
  color-scheme: light;
  --navy: #263746; --navy-2: #2E4C66; --sky: #4FB2CE; --blue: #1381B0; --lime: #AFBC21; --green: #73A808;
  --surface: #F3F5F7; --panel: #FFFFFF; --line: #DCE2E8; --grid: #EAEEF2;
  --text: #1F2D3A; --text-2: #485868; --text-3: #667685;
  --ink: #263746;
  --accent: #263746; --on-accent: #FFFFFF;
  --link: #11709A;
  --series-1: #1381B0; --series-1-soft: #4FB2CE40;
  --good: #4C7A05; --warn: #9A5B00; --bad: #B4232C;
  --chip: #EDF1F4; --sel: #E6F3F8;
  --focus: #1381B0;
  --shadow: 0 1px 2px #26374614, 0 6px 20px #2637460F;
  --head: "Poppins", "Segoe UI", system-ui, sans-serif;
  --body: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --surface: #131D26; --panel: #1B2733; --line: #2C3D4D; --grid: #243443;
    --text: #EAF0F4; --text-2: #BFCBD5; --text-3: #8FA0AE;
    --ink: #F2F6F8;
    --accent: #4FB2CE; --on-accent: #0F1A22;
    --link: #6CC3DB;
    --series-1: #4FB2CE; --series-1-soft: #4FB2CE33;
    --good: #A9C33A; --warn: #E3A945; --bad: #F0767A;
    --chip: #243443; --sel: #1F3646;
    --focus: #6CC3DB;
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --surface: #131D26; --panel: #1B2733; --line: #2C3D4D; --grid: #243443;
  --text: #EAF0F4; --text-2: #BFCBD5; --text-3: #8FA0AE;
  --ink: #F2F6F8;
  --accent: #4FB2CE; --on-accent: #0F1A22;
  --link: #6CC3DB;
  --series-1: #4FB2CE; --series-1-soft: #4FB2CE33;
  --good: #A9C33A; --warn: #E3A945; --bad: #F0767A;
  --chip: #243443; --sel: #1F3646;
  --focus: #6CC3DB;
  --shadow: none;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--surface); color: var(--text); font: 15px/1.5 var(--body); }
h1, h2, h3 { font-family: var(--head); color: var(--ink); letter-spacing: -0.01em; }
h1 { font-weight: 600; font-size: clamp(22px, 4vw, 28px); line-height: 1.2; margin: 0 0 6px; }
h2 { font-weight: 600; font-size: 18px; margin: 0 0 6px; }
h3 { font-weight: 600; font-size: 15px; margin: 0 0 4px; }
a { color: var(--link); }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
* { scrollbar-width: none; }
*::-webkit-scrollbar { display: none; }

/* Top bar: navy band, as on the letterhead and data sheet header. */
.topbar { background: linear-gradient(110deg, #263746 0%, #263746 55%, #2E4C66 100%); color: #fff; }
.topbar .in { max-width: 1280px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 12px; min-height: 60px; }
.topbar .home { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; min-height: 44px; }
.topbar .home img { height: 34px; width: auto; display: block; }
.topbar .place { font: 500 16px var(--head); color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .sep { width: 1px; height: 24px; background: #ffffff40; }
.topbar .spacer { flex: 1; }
.topbar .who { position: relative; }
.topbar .who > button { min-height: 40px; padding: 0 12px; border: 1px solid #ffffff40; border-radius: 999px; background: transparent; color: #fff; cursor: pointer; max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 30px #0003; padding: 6px; z-index: 30; }
.menu[hidden] { display: none; }
.menu a, .menu button { display: block; width: 100%; text-align: left; padding: 10px 12px; min-height: 40px; border: 0; background: none; border-radius: 6px; color: var(--text); text-decoration: none; cursor: pointer; }
.menu a:hover, .menu button:hover { background: var(--chip); }
.menu .meta { padding: 8px 12px; color: var(--text-3); font-size: 13px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.accentbar { height: 4px; background: linear-gradient(90deg, #4FB2CE 0%, #4FB2CE 50%, #AFBC21 50%, #AFBC21 100%); }

.wrap { max-width: 1280px; margin: 0 auto; padding: 22px 16px 56px; }
.narrow { max-width: 860px; }
.lead { color: var(--text-2); margin: 0 0 18px; }
.muted { color: var(--text-3); }
.small { font-size: 13px; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px; box-shadow: var(--shadow); min-width: 0; }
.panel + .panel { margin-top: 14px; }
.stack > * + * { margin-top: 14px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
@media (max-width: 860px) { .grid2 { grid-template-columns: 1fr; } }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--text); cursor: pointer; text-decoration: none; font-weight: 500; }
.btn:hover { border-color: var(--text-3); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.go { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.danger { color: var(--bad); }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.linkbtn { border: 0; background: none; color: var(--link); cursor: pointer; padding: 6px 0; text-decoration: underline; }

label.f { display: block; font-size: 13px; color: var(--text-2); font-weight: 500; margin-bottom: 4px; }
.field { margin-bottom: 12px; min-width: 0; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search], input[type=tel], select, textarea {
  width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--text);
}
textarea { min-height: 120px; line-height: 1.5; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: transparent; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0 12px; }
.check { display: flex; gap: 10px; align-items: flex-start; min-height: 40px; padding: 6px 0; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--blue); }

.chip { display: inline-block; padding: 2px 8px; border-radius: 6px; background: var(--chip); font-size: 12px; font-weight: 600; color: var(--text-2); }
.chip.good { color: var(--good); } .chip.warn { color: var(--warn); } .chip.bad { color: var(--bad); } .chip.blue { color: var(--link); }

table.t { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
table.t th, table.t td { padding: 10px; border-bottom: 1px solid var(--grid); text-align: left; vertical-align: top; }
table.t th { color: var(--text-3); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
table.t td.num, table.t th.num { text-align: right; }
.tbl { overflow-x: auto; }

.list { list-style: none; margin: 0; padding: 0; }
.list > li { border-bottom: 1px solid var(--grid); }
.list > li > a, .list > li > button { display: block; width: 100%; text-align: left; padding: 12px 4px; min-height: 48px; color: inherit; text-decoration: none; border: 0; background: none; cursor: pointer; }
.list > li > a:hover, .list > li > button:hover { background: var(--sel); }
.list .t1 { font-weight: 600; color: var(--ink); }
.list .t2 { color: var(--text-3); font-size: 13px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button { min-height: 44px; padding: 0 14px; border: 0; background: none; color: var(--text-2); cursor: pointer; border-bottom: 3px solid transparent; white-space: nowrap; font-weight: 500; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--sky); }

.notice { padding: 12px 14px; border-radius: 10px; background: var(--sel); border-left: 4px solid var(--sky); }
.notice.warn { background: var(--chip); border-left-color: var(--warn); }
.notice.bad { background: var(--chip); border-left-color: var(--bad); }

dialog { border: 1px solid var(--line); border-radius: 14px; padding: 0; background: var(--panel); color: var(--text); width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); }
dialog::backdrop { background: #0f1a2299; }
dialog .dh { padding: 16px 18px 0; } dialog .db { padding: 12px 18px; overflow: auto; } dialog .df { padding: 12px 18px 18px; display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

#toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 50; padding: 12px 16px; border-radius: 10px; background: var(--navy); color: #fff; box-shadow: 0 8px 24px #0004; max-width: calc(100vw - 32px); display: none; }
#toast.bad { background: #8E1B22; }

.spinner { width: 18px; height: 18px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.8s linear infinite; display: inline-block; vertical-align: -3px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }

.empty { color: var(--text-3); padding: 18px 4px; }
.hide { display: none !important; }
@media print { .topbar, .accentbar, .noprint { display: none !important; } body { background: #fff; } .panel { box-shadow: none; } }

/* Install-as-app banner (phones only). */
#installBar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; align-items: center; gap: 12px; padding: 12px max(16px, env(safe-area-inset-right, 0px)) calc(12px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); background: var(--panel); color: var(--text); border-top: 3px solid var(--sky); box-shadow: 0 -6px 24px #0002; }
#installBar img { border-radius: 9px; flex: none; border: 1px solid var(--line); }
#installBar .ib-text { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 14px; line-height: 1.35; }
#installBar .ib-text span { color: var(--text-2); }
#installBar .ib-btns { display: flex; flex-direction: column; gap: 6px; flex: none; }

/* Available add-on panel and first-visit guides. */
.addon { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; padding: 14px 16px; border: 1px dashed var(--line); border-radius: 12px; background: var(--panel); }
.addon > div { flex: 1 1 260px; min-width: 0; }
.addon p { margin: 4px 0 0; color: var(--text-2); font-size: 14px; }
.addon.compact { padding: 10px 12px; } .addon.compact p { font-size: 13px; }
.guide { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; padding: 14px 16px; border-left: 4px solid var(--sky); background: var(--sel); border-radius: 0 10px 10px 0; }
.guide ul { margin: 6px 0 0; padding-left: 18px; color: var(--text-2); font-size: 14px; } .guide li { margin-bottom: 3px; }
.helpbtn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid #ffffff40; background: transparent; color: #fff; font-weight: 600; cursor: pointer; }
