:root {
  --navy: #06090B;
  --navy-2: #0F1E1F;
  --panel: #0D1618;
  --line: #1E3333;
  --text: #eef2fa;
  --muted: #8EADA8;
  --gold: #2EF2C9;
  --gold-dark: #14B898;
  --green: #7CFF6B;
  --red: #ff6b6b;
  --radius: 14px;
  color-scheme: dark;
}
/* Light option. Dark is the default; the ☀/🌙 button in the header switches and remembers. */
:root[data-theme="light"] {
  --navy: #F3F6F6;
  --navy-2: #E6EEED;
  --panel: #FFFFFF;
  --line: #CFDDDB;
  --text: #0C1B1A;
  --muted: #4F6966;
  --gold: #0B9E82;
  --gold-dark: #08806A;
  --green: #1E9E3A;
  --red: #D23B3B;
  color-scheme: light;
}
:root[data-theme="light"] .btn.gold { color: #FFFFFF; }
:root[data-theme="light"] .btn.green { color: #FFFFFF; border-color: #17812F; }
:root[data-theme="light"] .chip.on { color: #FFFFFF; }
:root[data-theme="light"] .chip.bchip.on { color: var(--text); }
:root[data-theme="light"] .scope .code { color: #FFFFFF; }
.themeBtn { min-width: 40px; }
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--navy); color: var(--text);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
body { min-height: 100dvh; padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--gold); }
.wrap { max-width: 560px; margin: 0 auto; padding: 16px; }
.wide { max-width: 1100px; }
header.bar { display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  background: linear-gradient(180deg, var(--navy-2), var(--navy)); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10; }
header.bar img { width: 32px; height: 32px; border-radius: 8px; }
header.bar .title { font-weight: 700; letter-spacing: .3px; }
header.bar .title small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
header.bar .spacer { flex: 1; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.card h2 { margin: 0 0 10px; font-size: 17px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px;
  padding: 14px 18px; font-weight: 700; cursor: pointer; background: var(--navy-2); border: 1px solid var(--line); }
.btn.block { width: 100%; }
.btn.gold { background: var(--gold); color: #03211B; border-color: var(--gold-dark); }
.btn.green { background: var(--green); color: #00240f; border-color: #4FD63F; }
.btn.red { background: transparent; color: var(--red); border-color: var(--red); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 8px 12px; font-size: 14px; border-radius: 10px; }
.btn:disabled { opacity: .5; cursor: default; }
label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
input[type=text], input[type=search], input[type=password], input[type=tel], input[type=number], input[type=date], select, textarea {
  width: 100%; padding: 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--navy); }
textarea { min-height: 70px; }
.row { display: flex; gap: 10px; align-items: center; }
.row > * { flex: 1; min-width: 0; }
.status { text-align: center; padding: 22px 16px; }
.status .big { font-size: 26px; font-weight: 800; margin: 4px 0; }
.status .timer { font-size: 44px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: 1px; }
.status.on { border-color: var(--green); box-shadow: 0 0 0 1px var(--green) inset, 0 0 30px rgba(124,255,107,.12); }
.status.on .big { color: var(--green); }
.pill { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 12px; border: 1px solid var(--line); color: var(--muted); }
.pill.green { color: var(--green); border-color: var(--green); }
.pill.gold { color: var(--gold); border-color: var(--gold); }
.pill.red { color: var(--red); border-color: var(--red); }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 12px 0; border-top: 1px solid var(--line); display: flex; gap: 10px; align-items: center; }
.list li:first-child { border-top: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .name { font-weight: 600; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 8px 12px; border-radius: 99px; border: 1px solid var(--line); background: transparent; cursor: pointer; font-size: 14px; }
.chip.on { background: var(--gold); color: #03211B; border-color: var(--gold); font-weight: 700; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
.grid .ph { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--navy-2); }
.grid .ph img, .grid .ph video { width: 100%; height: 100%; object-fit: cover; display: block; }
.grid .ph .tag { position: absolute; left: 6px; bottom: 6px; font-size: 11px; background: rgba(6,9,11,.8); padding: 2px 6px; border-radius: 6px; }
.grid .ph .star { position: absolute; right: 6px; top: 6px; font-size: 14px; }
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--navy-2); border: 1px solid var(--gold); padding: 10px 16px; border-radius: 12px; z-index: 50;
  max-width: 90vw; box-shadow: 0 8px 30px rgba(0,0,0,.4); }
.hidden { display: none !important; }
.switch { display: flex; align-items: center; gap: 10px; margin-top: 10px; color: var(--text); font-size: 15px; }
.switch input { width: 22px; height: 22px; accent-color: var(--green); }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.tabs button { background: none; border: 0; padding: 8px 12px; border-radius: 10px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.tabs button.on { background: var(--navy-2); color: var(--text); font-weight: 700; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; }
tr.flag td { background: rgba(255,107,107,.08); }
.scroll-x { overflow-x: auto; }
#map { height: 300px; border-radius: 12px; margin-top: 10px; }
.two { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 900px) { .two { grid-template-columns: 1fr 1fr; } }
.queue { color: var(--gold); font-size: 13px; }
.langs { display: flex; gap: 4px; }
.chip.sm { padding: 4px 9px; font-size: 12px; }
.msgs { display: flex; flex-direction: column; gap: 8px; max-height: 360px; overflow-y: auto; }
.msg { max-width: 85%; padding: 9px 12px; border-radius: 14px; background: var(--navy-2); border: 1px solid var(--line); align-self: flex-start; }
.msg.mine { align-self: flex-end; background: rgba(46,242,201,.14); border-color: var(--gold-dark); }
.msg .meta { font-size: 11px; color: var(--muted); margin-top: 3px; }
.msg .orig { font-size: 13px; color: var(--muted); margin-top: 4px; font-style: italic; }
.msg button.link { background: none; border: 0; color: var(--gold); padding: 0; font-size: 11px; cursor: pointer; }
.gantt { display: grid; min-width: 760px; font-size: 12px; }
.gantt .hd { color: var(--muted); text-align: center; padding: 4px 0; border-bottom: 1px solid var(--line); }
.gantt .hd.wk { color: var(--text); font-weight: 700; text-align: left; padding-left: 4px; }
.gantt .hd.today { color: var(--gold); font-weight: 700; }
.gantt .lbl { padding: 8px 8px 8px 0; border-bottom: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gantt .lbl small { display: block; color: var(--muted); }
.gantt .cell { border-bottom: 1px solid var(--line); border-left: 1px solid rgba(30,51,51,.4); }
.gantt .cell.wkend { background: rgba(255,255,255,.02); }
.gantt .bar { --bc: #8EADA8; margin: 8px 0; border-radius: 8px; background: color-mix(in srgb, var(--bc) 22%, transparent); border: 1px solid var(--bc);
  padding: 2px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); align-self: center; }
.upcoming li .when { font-variant-numeric: tabular-nums; color: var(--gold); font-weight: 700; min-width: 92px; }
.card.reminder { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; font-weight: 600; }

/* plans */
h3.sub { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 12px 0 6px; }
.scope .srow { display: flex; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.scope .srow:first-of-type { border-top: 0; }
.scope .code { flex: 0 0 auto; min-width: 58px; text-align: center; font-weight: 700; font-size: 13px; padding: 4px 6px;
  border-radius: 8px; background: var(--gold); color: #03211B; align-self: flex-start; }
.scope .where { margin-top: 3px; font-weight: 600; }
.docs .doc { display: flex; align-items: center; gap: 10px; padding: 10px; margin-top: 6px; border: 1px solid var(--line);
  border-radius: 10px; color: inherit; text-decoration: none; }
.docs .doc .ic { font-size: 22px; }
.docs .doc .go { margin-left: auto; color: var(--gold); white-space: nowrap; }
.scopeEd input { padding: 6px 8px; font-size: 13px; }
.scopeEd td { padding: 3px 4px; }
.scope .code.none { background: transparent; color: var(--muted); border: 1px solid var(--line); }

/* banners */
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.chip.bchip .dot { background: var(--bc); }
.chip.bchip.on { background: color-mix(in srgb, var(--bc) 20%, transparent); color: var(--text); border-color: var(--bc); }
.chip.bchip:not(.on) { opacity: .5; }
#bList li { display: flex; gap: 10px; align-items: center; }
#bList input[type=color] { width: 44px; height: 36px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: none; }

/* travel */
.card.fuel { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset, 0 0 24px rgba(46,242,201,.12); }
.tcompare td, .tcompare th { white-space: nowrap; }
.tcompare tr.best td { background: rgba(46,242,201,.08); }
.tcompare tr.small td { opacity: .55; }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.kv .v { font-size: 22px; font-weight: 700; }

/* warehouse */
.wthumb { flex: 0 0 52px; width: 52px; height: 52px; border-radius: 8px; object-fit: cover; background: var(--navy-2); }
.wthumb.none { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12px; letter-spacing: -2px; }
.wrows .wname { margin-top: 4px; padding: 6px 8px; font-size: 14px; }
.wrows .wqty { flex: 0 0 70px; width: 70px; text-align: center; font-size: 18px; font-weight: 700; }
.wedit { display: block !important; }
.wbig { width: 100%; max-height: 260px; object-fit: contain; border-radius: 10px; background: var(--navy-2); }

/* install plan */
.iplan .sumline { display: flex; gap: 16px; flex-wrap: wrap; }
.iplan .sumline b { display: block; font-size: 18px; }
.iplan details.step { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-top: 8px; }
.iplan details.step[open] { border-color: var(--gold-dark); }
.iplan details.step.done { opacity: .6; }
.iplan details.step summary { cursor: pointer; list-style: none; display: flex; gap: 10px; align-items: center; }
.iplan details.step summary::-webkit-details-marker { display: none; }
.iplan .sname { font-weight: 700; }
.iplan .area { color: var(--gold); font-size: 13px; font-weight: 700; }
.iplan ol { margin: 8px 0; padding-left: 20px; }
.iplan ol li { margin: 4px 0; }
.iplan .chk { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; }
.iplan .chk input { width: 22px; height: 22px; flex: 0 0 22px; accent-color: var(--green); }
.iplan .wait { margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: rgba(245,184,46,.10); border: 1px solid rgba(245,184,46,.35); font-size: 14px; }
.iplan .warn { color: #F5B82E; font-size: 14px; margin: 6px 0; }
.iplan .day { padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.iplan .day b { display: inline-block; min-width: 92px; }
.iplan .mat { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
:root[data-theme="light"] .iplan .warn { color: #9A6A00; }
.ipEd td { vertical-align: top; }
.ipEd input[type=text] { min-width: 140px; }
.ipEd select { min-width: 170px; }
.ipDays td { vertical-align: top; white-space: normal !important; }
.iplan details.allsteps > summary { cursor: pointer; list-style: none; margin-top: 12px; }
