@font-face {
  font-family: "Nunito";
  src: url("fonts/Nunito-wght.ttf") format("truetype");
  font-weight: 200 1000;
  font-style: normal;
  font-display: swap;
}

:root {
  --black: #0b0f14;
  --black-2: #151b22;
  --ink: #1a222b;
  --muted: #5d6b78;
  --faint: #8a97a4;
  --line: #e2e8ee;
  --line-2: #cfd8e1;
  --blue: #2f6fed;
  --blue-2: #1f58c9;
  --blue-soft: #eaf1ff;
  --green: #1fa971;
  --green-2: #168a5b;
  --green-soft: #e8f7f0;
  --paper: #f3f6f1;
  --card: #fffdf8;
  --danger: #d64545;
  --warn: #c48a12;
  --shell: #eef6ee;
  --gold: #e8b84a;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 12px 32px rgba(11, 15, 20, 0.08);
  --shadow-sm: 0 4px 14px rgba(11, 15, 20, 0.06);
  --font: "Nunito", "Segoe UI Variable Text", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { scroll-behavior: smooth; }

@keyframes drift-stripes {
  from { transform: translateX(0); }
  to { transform: translateX(-48px); }
}
@keyframes drift-hex {
  from { transform: translate(0, 0); }
  to { transform: translate(-48px, -84px); }
}
@media (prefers-reduced-motion: reduce) {
  .shell::before, .hero::before, .pulse-dot { animation: none; }
}
body {
  background:
    radial-gradient(circle at 12px 12px, rgba(31, 169, 113, 0.07) 1.5px, transparent 2px) 0 0 / 28px 28px,
    linear-gradient(180deg, #eaf6ee 0%, var(--paper) 220px);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.55;
  min-height: 100vh;
}

a { color: var(--blue); }
button, input, select, textarea { font: inherit; color: inherit; }

.shell {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 10px 20px;
  background: rgba(11, 15, 20, 0.94);
  backdrop-filter: blur(12px);
  color: #f4f6f8;
  border-bottom: 4px solid var(--green);
  box-shadow: 0 8px 24px rgba(11, 15, 20, 0.18);
  overflow: visible;
}
.shell > * { position: relative; z-index: 1; }
.shell::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  opacity: 0.35;
  background: repeating-linear-gradient(
    -22deg,
    rgba(255, 255, 255, 0.045) 0 1px,
    transparent 1px 14px
  );
  animation: drift-stripes 90s linear infinite;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #f4f6f8;
  flex-shrink: 0;
}
.brand img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}
.brand strong {
  display: block;
  font-size: 18px;
  letter-spacing: 0.02em;
  font-weight: 800;
}
.brand small {
  display: block;
  color: var(--faint);
  letter-spacing: 0.01em;
  font-size: 11px;
  font-weight: 600;
}
.shell nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-left: auto;
  justify-content: flex-end;
}
.shell nav a {
  color: #c5d0da;
  text-decoration: none;
  padding: 8px 13px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 999px;
}
.shell nav a:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }
.shell nav a.active {
  color: #fff;
  background: var(--blue);
}
.nav-drop { position: relative; display: flex; align-items: stretch; z-index: 80; }
.nav-drop-btn {
  background: transparent;
  color: #c5d0da;
  border: 0;
  padding: 8px 10px 8px 13px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  border-radius: 999px 0 0 999px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.nav-drop-caret {
  background: transparent;
  color: #c5d0da;
  border: 0;
  padding: 8px 12px 8px 6px;
  font: inherit;
  font-size: 12px;
  border-radius: 0 999px 999px 0;
  cursor: pointer;
}
.nav-drop-btn:hover, .nav-drop-caret:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }
.nav-drop.open .nav-drop-btn,
.nav-drop.open .nav-drop-caret,
.nav-drop.active .nav-drop-btn,
.nav-drop.active .nav-drop-caret {
  color: #fff;
  background: var(--blue);
}
.nav-drop-menu {
  display: none;
  position: absolute;
  top: 112%;
  left: 0;
  min-width: 210px;
  background: #151b22;
  border: 1px solid #2a3540;
  border-radius: 12px;
  padding: 6px;
  z-index: 70;
  box-shadow: var(--shadow);
}
.nav-drop.open .nav-drop-menu { display: block; }
.shell nav .nav-drop-menu a {
  display: block;
  padding: 10px 12px;
  color: #f4f6f8;
  border-radius: 8px;
  letter-spacing: 0;
}
.shell nav .nav-drop-menu a:hover { background: rgba(47, 111, 237, 0.4); color: #fff; }
.shell .search {
  flex: 1;
  max-width: 420px;
  position: relative;
}
.shell .search input {
  width: 100%;
  background: var(--black-2);
  color: #f4f6f8;
  border: 1px solid #2a3540;
  padding: 9px 14px;
  border-radius: 999px;
}
.shell .search input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.25);
}
.view-as {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #c5d0da;
  font-size: 13px;
  font-weight: 700;
}
.view-as span { white-space: nowrap; }
.view-as select {
  background: var(--black-2);
  color: #f4f6f8;
  border: 1px solid #2a3540;
  border-radius: 999px;
  padding: 7px 12px;
  min-width: 180px;
}
.view-as select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.25);
}
.preview-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--blue-soft);
  border: 1px solid #c8d8f8;
  border-radius: var(--radius);
  padding: 12px 16px;
  margin: 0 0 18px;
  color: var(--ink);
  font-weight: 700;
}
.preview-banner span { flex: 1; min-width: 220px; }

#who {
  font-size: 13px;
  font-weight: 700;
  color: #8cb4ff;
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#save-state {
  font-size: 13px;
  font-weight: 700;
  color: var(--faint);
  min-width: 72px;
  text-align: right;
}
#save-state.ok { color: var(--green); }
#save-state.busy { color: #8cb4ff; }

.results {
  position: absolute;
  left: 0; right: 0; top: 118%;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-height: 360px;
  overflow: auto;
  display: none;
}
.results.open { display: block; }
.results a, .results .empty {
  display: block;
  padding: 10px 14px;
  text-decoration: none;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}
.results a:last-child { border-bottom: none; }
.results a:hover { background: var(--blue-soft); }
.results small { color: var(--muted); display: block; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 28px 20px 80px; position: relative; z-index: 1; }

.hero {
  background:
    radial-gradient(900px 280px at 90% -20%, rgba(47, 111, 237, 0.38), transparent 55%),
    radial-gradient(700px 240px at 8% 120%, rgba(31, 169, 113, 0.32), transparent 50%),
    radial-gradient(400px 160px at 50% 0%, rgba(232, 184, 74, 0.18), transparent 60%),
    var(--black);
  color: #f4f6f8;
  padding: 44px 20px 52px;
  border-bottom: 6px solid var(--green);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -30%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.4;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='56' height='98' viewBox='0 0 24 42'><path fill='none' stroke='rgba(255,255,255,0.08)' stroke-width='0.45' d='M12 1.2l10.4 6v12L12 25.2 1.6 19.2V7.2zM12 25.2v12'/></svg>");
  background-size: 56px 98px;
  animation: drift-hex 120s linear infinite;
}
.hero::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -6px;
  z-index: 2;
  height: 6px;
  background: linear-gradient(90deg, var(--green) 0 40%, var(--blue) 40% 70%, var(--gold) 70% 100%);
}
.hero-inner { max-width: 1120px; margin: 0 auto; position: relative; z-index: 1; }
.hero .kicker {
  color: var(--green);
  letter-spacing: 0.02em;
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 8px;
}
.hero h1 {
  margin: 0;
  font-size: clamp(32px, 5vw, 52px);
  letter-spacing: -0.03em;
  font-weight: 800;
  line-height: 1.1;
}
.hero p { max-width: 62ch; color: #c5d0da; margin: 12px 0 0; font-size: 17px; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin: 0;
  position: relative;
  z-index: 1;
}
.card {
  background: var(--card);
  border: 1px solid #d7e4d8;
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  padding: 22px;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
  isolation: isolate;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 7px;
  background: linear-gradient(180deg, var(--green), var(--blue));
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(11, 15, 20, 0.12);
}
.card .k { color: var(--blue); font-size: 13px; font-weight: 700; }
.card h2 {
  margin: 8px 0 6px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
  line-height: 1.2;
}
.card p { color: var(--muted); flex: 1; margin: 0 0 12px; overflow-wrap: anywhere; }
.card .btn-row { margin-top: auto; }
.stat { font-size: 13px; color: var(--muted); margin-top: 4px; font-weight: 600; }

.desk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  margin: 0 0 8px;
  position: relative;
  z-index: 1;
}
.desk-card,
a.desk-card, button.desk-card {
  background: var(--card);
  border: 1px solid #d7e4d8;
  overflow: hidden;
  border-radius: var(--radius);
  padding: 20px 22px 18px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  min-height: 168px;
  box-shadow: var(--shadow);
  cursor: pointer;
  text-align: left;
  font: inherit;
  width: 100%;
  position: relative;
  z-index: 1;
  isolation: isolate;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
a.desk-card:hover, button.desk-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(11, 15, 20, 0.12);
  border-color: #c8d8f8;
}
div.desk-card { cursor: default; }
.desk-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--green), var(--blue) 55%, var(--gold));
}
.desk-card .k { color: var(--green-2); font-weight: 700; font-size: 13px; }
.desk-card h2 {
  margin: 6px 0 8px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
  line-height: 1.2;
}
.desk-card p { color: var(--muted); margin: 0; flex: 1; font-size: 15px; overflow-wrap: anywhere; }
.stat.low { color: var(--danger); font-weight: 700; }
.stat.ok { color: var(--green-2); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--black);
  color: #f4f6f8;
  border: 1px solid var(--black);
  padding: 10px 16px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  border-radius: 999px;
}
.btn:hover { background: var(--black-2); }
.btn.blue { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.blue:hover { background: var(--blue-2); }
.btn.green { background: var(--green); border-color: var(--green); color: #fff; }
.btn.green:hover { background: var(--green-2); }
.btn.ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-2);
}
.btn.ghost:hover { background: var(--shell); }
.btn.ghost.on-dark {
  color: #f4f6f8;
  border-color: #3a4652;
}
.btn.ghost.on-dark:hover { background: rgba(255, 255, 255, 0.08); }
.btn.ghost.danger {
  color: var(--danger);
  border-color: rgba(214, 69, 69, 0.45);
}
.btn.ghost.danger:hover { background: rgba(214, 69, 69, 0.08); }
.btn.ghost.danger.on-dark {
  color: #f3b4b4;
  border-color: rgba(214, 69, 69, 0.45);
}
.btn.ghost.danger.on-dark:hover { background: rgba(214, 69, 69, 0.12); }
.btn.small { padding: 6px 12px; font-size: 11px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

.block { margin: 36px 0; }
.wrap > .block:first-child { margin-top: 8px; }
.block h2 {
  display: block;
  margin: 0 0 10px;
  padding-bottom: 8px;
  border-bottom: 4px solid var(--green);
  box-shadow: inset 0 -7px 0 var(--blue-soft);
  font-size: 24px;
  letter-spacing: -0.02em;
}
.kicker {
  letter-spacing: 0.01em;
  color: var(--green-2);
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 4px;
}
.hint { color: var(--muted); margin: 0 0 14px; font-size: 15px; }
.callout {
  background: var(--blue-soft);
  border-left: 4px solid var(--blue);
  padding: 14px 16px;
  margin: 12px 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.callout.warn { background: #fff6e8; border-left-color: var(--warn); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.fact {
  background: var(--card);
  border: 1px solid #d7e4d8;
  padding: 16px 18px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border-left: 5px solid var(--green);
}
.fact h3 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  background: var(--green-soft);
  border: 1px solid #bfe8d0;
  padding: 4px 10px;
  font-size: 13px;
  border-radius: 999px;
  color: var(--green-2);
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.chip-on {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}
.suggest { position: relative; }
.suggest-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin: 0 0 8px;
}
.suggest-chips.hidden { display: none; }
.suggest-chips .chip {
  cursor: pointer;
  font: inherit;
  line-height: 1.3;
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
}
.suggest-field {
  position: relative;
  width: 260px;
  max-width: 100%;
}
.field .suggest-input,
.suggest-input {
  width: 100%;
  max-width: 100%;
}
.suggest-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  background: #fff;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  z-index: 40;
  max-height: 220px;
  overflow: auto;
  box-shadow: var(--shadow);
  padding: 4px;
}
.suggest-menu button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: none;
  padding: 8px 10px;
  cursor: pointer;
  border-radius: 8px;
  font: inherit;
  font-weight: 700;
}
.suggest-menu button:hover { background: var(--green-soft); color: var(--green-2); }
.suggest-menu button span { display: block; color: var(--muted); font-size: 12px; font-weight: 600; }
.suggest-empty { padding: 8px 10px; color: var(--muted); font-size: 14px; }
.it-card {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 0 0 10px;
  box-shadow: var(--shadow-sm);
}
.it-card strong { display: block; font-size: 18px; overflow-wrap: anywhere; }
.it-card-meta { display: block; color: var(--muted); font-size: 14px; margin-top: 2px; }
.it-card-tools { margin-top: 12px; }

.bldg-index { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.bldg-tile-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.bldg-tile {
  background:
    linear-gradient(135deg, rgba(31, 169, 113, 0.18), transparent 42%),
    var(--black);
  color: #f4f6f8;
  padding: 16px;
  text-decoration: none;
  display: block;
  border-radius: var(--radius);
  flex: 1;
  border: 1px solid #1f3d32;
}
.bldg-tile:hover { background: var(--black-2); }
.bldg-tile strong { display: block; font-size: 24px; }
.bldg-tile span { color: #5ddeb0; font-size: 13px; }

.bldg-head {
  background:
    linear-gradient(90deg, rgba(31, 169, 113, 0.22), transparent 40%),
    var(--black);
  color: #f4f6f8;
  padding: 16px 18px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-top: 22px;
  border-radius: var(--radius) var(--radius) 0 0;
}
.bldg-head h3 { margin: 0; font-weight: 800; }
.bldg-head p { margin: 4px 0 0; color: #c5d0da; }

.unit-sheet, .panel {
  background: var(--card);
  border: 1px solid var(--line);
  margin: 12px 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.unit-head, .panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--shell);
}
.unit-id { font-size: 24px; font-weight: 800; letter-spacing: 0.04em; }
.unit-body, .panel-body { padding: 16px 18px 18px; }

.meta-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}

.field { margin-bottom: 4px; }
.field label {
  display: block;
  font-size: 13px;
  color: var(--ink);
  margin-bottom: 6px;
  font-weight: 700;
}
.field input, .field textarea, .field select,
.app-table input, .app-table select,
.admin-table input, .admin-table select {
  width: 100%;
  border: 1px solid var(--line-2);
  background: var(--shell);
  padding: 9px 11px;
  color: var(--ink);
  border-radius: var(--radius-sm);
}
.field textarea {
  min-height: 120px;
  resize: vertical;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
}
.field input:focus, .field textarea:focus, .field select:focus,
.app-table input:focus, .app-table select:focus,
.admin-table input:focus, .admin-table select:focus {
  outline: none;
  border-color: var(--blue);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.15);
}
.field select, .admin-table select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%),
    linear-gradient(to right, var(--shell), var(--shell));
  background-position:
    calc(100% - 18px) calc(50% - 3px),
    calc(100% - 12px) calc(50% - 3px),
    0 0;
  background-size: 6px 6px, 6px 6px, 100% 100%;
  background-repeat: no-repeat;
  padding-right: 32px;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  margin: 0 0 16px;
}
.choice {
  text-align: left;
  background: var(--shell);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: pointer;
  color: var(--ink);
  width: 100%;
}
.choice:hover { border-color: var(--blue); }
.choice.selected {
  background: var(--blue-soft);
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.12);
}
.choice strong { display: block; font-size: 15px; margin-bottom: 4px; }
.choice span { display: block; color: var(--muted); font-size: 13px; line-height: 1.35; }

.file-drop {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 92px;
  border: 1.5px dashed var(--line-2);
  border-radius: var(--radius);
  background: var(--shell);
  color: var(--muted);
  cursor: pointer;
  padding: 16px;
  text-align: center;
}
.file-drop:hover { border-color: var(--blue); color: var(--ink); background: var(--blue-soft); }
.file-drop input { display: none; }

.app-table, .shop-table, .admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.app-table th, .shop-table th, .admin-table th {
  text-align: left;
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
  border-bottom: 1px solid var(--line-2);
  padding: 8px 10px 8px 0;
}
.app-table td, .shop-table td, .admin-table td {
  border-bottom: 1px solid var(--line);
  padding: 8px 10px 8px 0;
  vertical-align: middle;
}
.app-table tr:hover td, .shop-table tbody tr:hover td, .admin-table tbody tr:hover td {
  background: rgba(47, 111, 237, 0.03);
}
.qty-cell {
  font-weight: 800;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  width: 64px;
  color: var(--black);
}
.row-low { background: #fff8e8; }
.row-low .qty-cell { color: var(--warn); }
.row-out { background: #fdeeee; }
.row-out .qty-cell { color: var(--danger); }
.muted { color: var(--muted); font-size: 12px; }
.photo-thumb {
  width: 54px;
  height: 54px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 6px;
}

.history { margin-top: 14px; }
.history li { margin: 6px 0; font-size: 13px; color: var(--muted); }
.history strong { color: var(--ink); }

.add-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  align-items: end;
}
.table-scroll {
  width: 100%;
  overflow-x: auto;
}
.admin-table td:last-child {
  white-space: normal;
}
.admin-table td:last-child .btn {
  margin: 2px 4px 2px 0;
}
.admin-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(11, 15, 20, 0.55);
  z-index: 80;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px calc(72px + env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.modal {
  background: var(--card);
  width: min(560px, 100%);
  max-height: calc(100vh - 48px - 72px);
  max-height: calc(100dvh - 48px - 72px);
  display: flex;
  flex-direction: column;
  padding: 22px 22px 0;
  box-shadow: var(--shadow);
  border-radius: 16px;
  border-top: 6px solid var(--green);
  overflow: hidden;
}
.modal h3 { margin: 0 0 14px; flex-shrink: 0; }
.modal-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
}
.modal-actions {
  flex-shrink: 0;
  margin: 0 -22px 0;
  padding: 12px 22px 18px;
  border-top: 1px solid var(--line);
  background: var(--card);
  position: sticky;
  bottom: 0;
}
.check-card { width: min(440px, 100%); }
.check-kicker {
  color: var(--green-2);
  font-weight: 800;
  font-size: 13px;
  margin-bottom: 6px;
}
.check-card h3 { font-size: 26px; letter-spacing: -0.03em; }
.check-facts {
  display: grid;
  gap: 8px;
  margin: 16px 0;
  background: var(--green-soft);
  border: 1px solid #bfe8d0;
  border-radius: 12px;
  padding: 12px 14px;
}
.check-fact {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 15px;
}
.check-fact span { color: var(--muted); font-weight: 700; }
.check-fact strong { font-size: 18px; }
.check-warn {
  background: #fff6e8;
  border-left: 4px solid var(--gold);
  padding: 10px 12px;
  border-radius: 0 10px 10px 0;
  color: var(--ink);
  font-size: 14px;
}
.hidden { display: none !important; }

.bill-board {
  background: var(--black);
  color: #f4f6f8;
  border-radius: var(--radius);
  padding: 28px 28px 26px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: end;
  margin: 0 0 8px;
}
.bill-board .k { color: #5ddeb0; font-weight: 700; font-size: 14px; }
.bill-board h2 { margin: 8px 0 10px; font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.bill-board p { margin: 0; color: #c5d0da; max-width: 52ch; font-size: 15px; }
.bill-figure { text-align: right; }
.bill-dollars {
  font-size: clamp(40px, 6vw, 64px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.bill-dollars.due { color: #ffd56a; }
.bill-dollars.ok { color: #5ddeb0; }
.bill-caption {
  margin-top: 8px;
  color: #8a97a4;
  font-size: 13px;
  font-weight: 700;
}
.site-bills { display: flex; flex-direction: column; gap: 10px; }
.site-bill {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  box-shadow: var(--shadow-sm);
}
.site-bill strong { display: block; font-size: 18px; overflow-wrap: anywhere; }
.site-bill span { display: block; color: var(--muted); font-size: 14px; margin-top: 2px; }
.site-bill .amt {
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.site-bill.total {
  background: var(--blue-soft);
  border-color: #c8d8f8;
}
.inv-list { display: flex; flex-direction: column; gap: 10px; }
.inv-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  box-shadow: var(--shadow-sm);
}
.inv-card strong { display: block; font-size: 16px; }
.inv-card span { display: block; color: var(--muted); font-size: 14px; margin-top: 2px; }
.inv-right { text-align: right; }
.inv-card .amt {
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.chip-status {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}
.chip-status.ok { background: var(--green-soft); color: var(--green-2); }
.chip-status.due { background: #fff6e8; color: var(--warn); }
.chip-status.paused { background: var(--blue-soft); color: var(--blue-2); }

.dash-trackers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 12px;
  margin: 0 0 16px;
}
.dash-stat {
  background: var(--card);
  border: 1px solid #d7e4d8;
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}
.dash-stat .k {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.dash-stat .n {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-top: 4px;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.dash-stat .sub {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
  font-weight: 600;
}
.dash-stat.live .n { color: var(--green-2); }
.dash-stat.warn .n { color: var(--warn); }
.dash-stat.hot .n { color: var(--danger); }
.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  display: inline-block;
  box-shadow: 0 0 0 0 rgba(31, 169, 113, 0.55);
  animation: pulse-dot 1.8s ease-out infinite;
}
@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 rgba(31, 169, 113, 0.5); }
  100% { box-shadow: 0 0 0 8px rgba(31, 169, 113, 0); }
}
.dash-charts {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 14px;
  margin: 0 0 16px;
}
.dash-panel {
  background: var(--card);
  border: 1px solid #d7e4d8;
  border-radius: var(--radius);
  padding: 16px 18px 18px;
  box-shadow: var(--shadow-sm);
}
.dash-panel h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
}
.dash-panel .hint { margin: 4px 0 0; }
.chart-cols {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 168px;
  margin-top: 14px;
}
.chart-col {
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}
.chart-bars {
  width: 100%;
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
}
.chart-bar {
  width: 11px;
  min-height: 3px;
  border-radius: 4px 4px 0 0;
  background: var(--green);
}
.chart-bar.ghost {
  background: #d4e3d8;
}
.chart-col em {
  font-style: normal;
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
}
.chart-legend {
  display: flex;
  gap: 14px;
  margin-top: 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.chart-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 6px;
  vertical-align: -1px;
}
.chart-legend .on { background: var(--green); }
.chart-legend .off { background: #d4e3d8; }
.share-row {
  display: grid;
  grid-template-columns: minmax(72px, 34%) 1fr auto;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
}
.share-row strong {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.share-track {
  height: 10px;
  background: var(--shell);
  border-radius: 999px;
  overflow: hidden;
}
.share-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--green), var(--blue));
  min-width: 4px;
}
.share-row .amt {
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.dash-live {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dash-live-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.dash-live-row:last-child { border-bottom: 0; }
.dash-live-row strong { display: block; font-size: 14px; }
.dash-live-row span { color: var(--muted); font-size: 13px; }
.co-row {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: grid;
  grid-template-columns: 1.4fr 0.9fr 0.9fr auto;
  gap: 10px 16px;
  align-items: center;
  box-shadow: var(--shadow-sm);
  margin-bottom: 10px;
}
.co-row.on {
  border-color: #bfe8d0;
  box-shadow: 0 0 0 2px rgba(31, 169, 113, 0.12);
}
.co-row strong { display: block; font-size: 16px; }
.co-row .meta { color: var(--muted); font-size: 13px; margin-top: 2px; }
.co-row .amt { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; }
.co-row .amt .btn { margin-top: 6px; }
.plan-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.plan-box {
  background: var(--shell);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}
.plan-box h3 {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 800;
}
.plan-box .field { margin-bottom: 10px; }
.plan-help {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
.inv-hist {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.inv-hist .kicker { margin-bottom: 8px; }
.inv-hist-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.inv-hist-row:last-child { border-bottom: 0; }
.inv-hist-row span { display: block; color: var(--muted); font-size: 13px; }
.phone-url {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 10px 0 0;
  overflow-wrap: anywhere;
  user-select: all;
}
.lib-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}
.lib-folder {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  min-height: 148px;
}
.lib-tab {
  width: 46px;
  height: 12px;
  margin-left: 12px;
  background: var(--gold);
  border-radius: 6px 6px 0 0;
}
.lib-body {
  flex: 1;
  background:
    linear-gradient(180deg, #fff8e4, var(--card) 48%);
  border: 1px solid #ead7a0;
  border-radius: 0 14px 14px 14px;
  padding: 16px 16px 14px;
  box-shadow: var(--shadow-sm);
}
.lib-folder:hover .lib-body {
  border-color: var(--green);
  box-shadow: 0 10px 22px rgba(11, 15, 20, 0.1);
}
.lib-body strong {
  display: block;
  font-size: 18px;
  overflow-wrap: anywhere;
}
.lib-body span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.lib-setup-folder {
  margin: 16px 0 0;
  padding: 14px 0 4px;
  border-top: 1px solid var(--line);
}
.lib-setup-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.lib-setup-head h3 { margin: 0; font-size: 16px; }
.nav-toggle {
  display: none;
  margin-left: auto;
  background: rgba(255, 255, 255, 0.08);
  color: #f4f6f8;
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

footer.site-foot {
  border-top: 4px solid var(--green);
  padding: 24px 20px 32px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  background: linear-gradient(180deg, rgba(31, 169, 113, 0.06), transparent 70%);
}

/* Public opening page — kept off the in-app chrome */
body.open-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #eef3ef;
}
.open-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 22px;
  background: rgba(11, 15, 20, 0.96);
  color: #f4f6f8;
  border-bottom: 3px solid var(--green);
}
.open-bar .brand small { color: #9aa8b5; }
.open-hero {
  background:
    radial-gradient(900px 320px at 88% -10%, rgba(47, 111, 237, 0.42), transparent 58%),
    radial-gradient(640px 260px at 6% 110%, rgba(31, 169, 113, 0.34), transparent 52%),
    var(--black);
  color: #f4f6f8;
  padding: 72px 24px 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.open-hero::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--green) 0 42%, var(--blue) 42% 72%, var(--gold) 72% 100%);
}
.open-hero-short { padding: 44px 24px 48px; text-align: left; }
.open-hero-short .open-hero-inner { margin: 0 auto; max-width: 720px; }
.open-hero-inner { max-width: 760px; margin: 0 auto; position: relative; z-index: 1; }
.open-mark {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  margin: 0 auto 18px;
  display: block;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}
.open-wordmark {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.22em;
  color: #fff;
}
.open-latin {
  margin: 6px 0 0;
  color: var(--green);
  font-weight: 700;
  font-size: 15px;
}
.open-hero h1 {
  margin: 22px 0 0;
  font-size: clamp(34px, 6vw, 58px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.08;
  color: #fff;
}
.open-lead {
  margin: 18px auto 0;
  max-width: 42ch;
  color: #c5d0da;
  font-size: 18px;
  line-height: 1.5;
}
.open-hero-short .open-lead { margin-left: 0; }
.open-cta {
  margin-top: 28px;
  min-width: 220px;
  min-height: 48px;
  font-size: 16px;
}
.open-main {
  flex: 1;
  width: min(1040px, calc(100% - 32px));
  margin: -28px auto 0;
  position: relative;
  z-index: 2;
  padding-bottom: 48px;
}
.open-points {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.open-points article {
  background: #fffdf8;
  border: 1px solid #d7e4d8;
  border-radius: 16px;
  padding: 22px 22px 24px;
  box-shadow: 0 12px 32px rgba(11, 15, 20, 0.08);
}
.open-points .k {
  margin: 0;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.open-points h2 {
  margin: 8px 0 10px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.open-points p { margin: 0; color: var(--muted); }
.open-close {
  margin-top: 28px;
  background: var(--black);
  color: #f4f6f8;
  border-radius: 16px;
  padding: 36px 28px;
  text-align: center;
}
.open-close h2 {
  margin: 0;
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 800;
  letter-spacing: -0.02em;
}
.open-close p {
  margin: 10px auto 22px;
  max-width: 46ch;
  color: #c5d0da;
}
.open-prose {
  margin-top: 0;
  background: #fffdf8;
  border: 1px solid #d7e4d8;
  border-radius: 16px;
  padding: 8px 28px 28px;
  box-shadow: 0 12px 32px rgba(11, 15, 20, 0.06);
}
.open-prose section { padding: 20px 0; border-bottom: 1px solid var(--line); }
.open-prose section:last-child { border-bottom: 0; }
.open-prose h2 { margin: 0 0 8px; font-size: 20px; font-weight: 800; }
.open-prose p { margin: 0; color: var(--muted); max-width: 68ch; }
.open-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 18px;
  padding: 22px 20px calc(28px + env(safe-area-inset-bottom, 0));
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.open-foot a { color: var(--blue); text-decoration: none; font-weight: 700; }
.open-foot a:hover { text-decoration: underline; }
@media (max-width: 800px) {
  .open-points { grid-template-columns: 1fr; }
  .open-hero { padding: 48px 18px 64px; }
  .open-hero h1 { font-size: 32px; }
  .open-main { width: calc(100% - 24px); margin-top: -20px; }
  .open-close { padding: 28px 20px; }
  .open-prose { padding: 4px 18px 20px; }
}

@media (max-width: 900px) {
  .cards, .desk-grid, .grid-2, .meta-grid, .add-form, .admin-row, .bill-board, .site-bill, .inv-card, .dash-charts, .plan-grid, .co-row { grid-template-columns: 1fr; }
  .bill-figure, .inv-right { text-align: left; }
  .shell { flex-wrap: wrap; }
  .shell nav { margin-left: 0; width: 100%; }
  .shell .search { max-width: none; width: 100%; order: 3; }
}
@media (max-width: 720px) {
  body { padding-bottom: env(safe-area-inset-bottom, 0); }
  .shell {
    padding: 10px 14px calc(10px + env(safe-area-inset-top, 0));
    overflow: visible;
  }
  .nav-toggle { display: inline-flex; }
  .shell nav {
    display: none;
    order: 8;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 8px 0 10px;
  }
  .shell nav.open { display: flex; }
  .shell nav a, .nav-drop-btn, .nav-drop-caret {
    padding: 12px 14px;
    min-height: 44px;
    border-radius: 12px;
  }
  .nav-drop { width: 100%; }
  .nav-drop-menu {
    position: static;
    box-shadow: none;
    border: 0;
  }
  .btn, .btn.small { min-height: 44px; padding-left: 14px; padding-right: 14px; }
  .field input, .field textarea, .field select { min-height: 44px; font-size: 16px; }
  .hero { padding: 28px 16px 36px; }
  .hero h1 { font-size: 28px; }
  .wrap { padding: 18px 14px 72px; }
  .bill-dollars { font-size: 40px; }
  .view-as { width: 100%; }
  #who { max-width: none; }
}

@media print {
  @page { size: letter; margin: 0.5in; }
  .shell, .no-print, .btn, .btn-row, .add-form, footer { display: none !important; }
  .wrap { max-width: none; padding: 0; }
  .hero { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .unit-sheet { page-break-before: always; break-before: page; border: 1px solid #222; }
  .bldg-head { -webkit-print-color-adjust: exact; print-color-adjust: exact; page-break-before: always; }
  body.printing-unit .block, body.printing-unit .bldg-head { display: none; }
  body.printing-unit .unit-sheet { display: none; }
  body.printing-unit .unit-sheet.print-me { display: block; page-break-before: auto; }
  body.printing-building .unit-sheet { display: none; }
  body.printing-building .unit-sheet.print-me { display: block; }
  body.printing-shop .hero, body.printing-shop .block { display: none !important; }
  body.printing-shop #shop-block { display: block !important; }
}
