:root {
  --ink: #111d1b;
  --muted: #667673;
  --line: #d8e4e0;
  --panel: #ffffff;
  --bg: #f6f8f7;
  --brand: #00656b;
  --brand-dark: #003f43;
  --brand-2: #e9a83a;
  --danger: #ad3b3b;
  --ok: #287a52;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--bg); line-height: 1.45; overflow-x: hidden; }
a { color: var(--brand); text-decoration: none; }
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 20px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.94); backdrop-filter: blur(12px); box-shadow: 0 8px 24px rgba(17,29,27,.05); }
.brand { font-weight: 800; color: var(--ink); }
.top nav { display: flex; align-items: center; gap: 12px; font-size: 14px; }
main { width: min(1120px, calc(100% - 32px)); margin: 22px auto 48px; }
h1 { font-size: clamp(30px, 6vw, 58px); line-height: 1.02; margin: 0 0 12px; letter-spacing: 0; }
h2 { font-size: 22px; margin: 0 0 14px; }
h3 { margin: 0 0 8px; font-size: 18px; }
p { margin: 0 0 12px; }
.hero, .equipment-head, .admin-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 34px 0 24px; border-bottom: 1px solid var(--line); }
.hero { display: block; max-width: 820px; border-bottom: 0; }
.hero p, .equipment-head p, .admin-head p { color: var(--muted); font-size: 18px; max-width: 720px; }
.safe { padding: 12px 14px; border-left: 4px solid var(--brand); background: #eaf4f2; color: var(--ink) !important; }
.button, button { min-height: 46px; border: 1px solid var(--line); border-radius: 12px; padding: 11px 16px; background: #fff; color: var(--ink); font: inherit; font-weight: 750; cursor: pointer; }
.button.primary, button.primary { border-color: var(--brand); background: var(--brand); color: #fff; }
.button.ghost { background: #eef7f6; border-color: #c7ddda; color: var(--brand-dark); }
.list, .cards, .grid, .admin-grid, .metrics { display: grid; gap: 14px; }
.list { margin-top: 24px; }
.row, article, .auth, .card, .public-card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px; box-shadow: 0 12px 30px rgba(17,29,27,.06); }
.row { display: flex; flex-direction: column; gap: 4px; }
.row span, small, dt { color: var(--muted); }
.grid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 20px 0; }
.cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tag { display: inline-flex; margin-bottom: 12px; border-radius: 999px; padding: 4px 9px; font-size: 12px; font-weight: 800; text-transform: uppercase; }
.tag.public { background: #dff3ea; color: var(--ok); }
.tag.technician { background: #fff1cf; color: #7b5412; }
.tag.office { background: #f5dede; color: var(--danger); }
dl { display: grid; grid-template-columns: 120px 1fr; gap: 8px 12px; margin: 0; }
dd { margin: 0; }
form { display: grid; gap: 14px; }
.auth { max-width: 460px; margin: 40px auto; }
label { display: grid; gap: 6px; font-weight: 700; }
input, textarea, select { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 11px 12px; background: #fff; color: var(--ink); font: inherit; }
textarea { resize: vertical; }
fieldset { border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 16px; display: grid; gap: 12px; }
legend { font-weight: 800; padding: 0 8px; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.check input { width: auto; }
.permission-box { border: 1px dashed #a9bbb6; border-radius: 8px; padding: 14px; background: #f8fbfa; }
.flash { width: min(1120px, calc(100% - 32px)); margin: 14px auto; border: 1px solid var(--brand-2); border-radius: 8px; background: #fff7e5; padding: 12px 14px; }
.metrics { grid-template-columns: repeat(3, 1fr); margin: 18px 0; }
.metrics div { padding: 18px; background: #0f3436; color: #fff; border-radius: 16px; }
.metrics strong { display: block; font-size: 34px; }
.metrics span { color: #c8ddda; }
.admin-grid { grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr); margin: 18px 0; align-items: start; }
.admin-grid > article { min-width: 0; }
.admin-row { grid-template-columns: minmax(0, 1fr) minmax(118px, 150px) minmax(118px, 150px) auto; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.admin-row:first-of-type { border-top: 0; }
.admin-row button { min-height: 38px; padding: 8px 10px; }
.job-form { margin-bottom: 40px; }

.tech-page main { max-width: 980px; padding-bottom: 92px; }
.tech-shell { display: grid; gap: 12px; }
.equipment-hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 18px; padding: 18px; border-radius: 24px; background: linear-gradient(135deg, #023f43, #066f73); color: #fff; box-shadow: 0 18px 42px rgba(0,63,67,.24); overflow: hidden; }
.equipment-hero h1 { color: #fff; font-size: clamp(34px, 8vw, 56px); }
.equipment-hero p { color: #d9eeee; }
.status-line { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; color: #e6fbf8; font-weight: 800; font-size: 13px; }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: #36d486; box-shadow: 0 0 0 6px rgba(54,212,134,.16); }
.demo-chip, .mock-badge { border: 1px solid rgba(255,255,255,.34); border-radius: 999px; padding: 5px 9px; background: rgba(255,255,255,.14); font-size: 12px; font-weight: 800; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.equipment-visual { position: relative; min-height: 220px; border-radius: 20px; background: linear-gradient(160deg, #d8e2df, #8ea19d); overflow: hidden; box-shadow: inset 0 0 0 1px rgba(255,255,255,.35); }
.boiler-box { position: absolute; left: 24%; bottom: 22px; width: 42%; height: 64%; border-radius: 14px; background: linear-gradient(180deg, #2d3838, #111918); color: #fff; display: grid; place-items: center; text-align: center; box-shadow: 0 18px 28px rgba(0,0,0,.25); }
.boiler-box span { font-size: 13px; color: #c7d3d0; }
.boiler-box strong { font-size: 22px; }
.pipe { position: absolute; background: #d5dcda; box-shadow: inset 0 0 0 2px rgba(0,0,0,.08); }
.pipe-a { width: 18px; height: 100%; left: 14%; top: 0; }
.pipe-b { width: 100%; height: 16px; left: 0; top: 34%; }
.gauge { position: absolute; right: 18px; top: 18px; width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; color: #083d40; font-weight: 900; background: #fff; border: 8px solid #e9a83a; }
.summary-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.summary-strip div { border-radius: 16px; background: #fff; border: 1px solid var(--line); padding: 14px; }
.summary-strip span { display: block; color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.summary-strip strong { display: block; margin-top: 4px; font-size: 15px; }
.voice-panel { margin: 18px 0; border: 1px solid #bcd9d5; border-radius: 24px; padding: 18px; background: linear-gradient(180deg, #ffffff, #f0f8f7); box-shadow: 0 18px 42px rgba(0,101,107,.12); }
.voice-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.voice-top p { color: var(--muted); }
.mock-badge { background: #fff7e4; border-color: #f0d398; color: #7b5412; white-space: nowrap; }
.voice-stage { display: grid; grid-template-columns: 148px 1fr; gap: 16px; align-items: center; margin: 14px 0; }
.voice-button { width: 138px; height: 138px; border-radius: 50%; display: grid; place-items: center; align-content: center; gap: 6px; border: 10px solid #d9efec; background: radial-gradient(circle at 35% 25%, #23a5a3, var(--brand)); color: #fff; box-shadow: 0 16px 28px rgba(0,101,107,.28); }
.voice-button.listening { animation: pulse 1.2s infinite; background: radial-gradient(circle at 35% 25%, #39d39b, #00736e); }
.voice-button.thinking { background: radial-gradient(circle at 35% 25%, #f2c15c, #b46d13); }
.mic-icon { width: 34px; height: 48px; border-radius: 18px; border: 4px solid currentColor; position: relative; }
.mic-icon:after { content: ""; position: absolute; left: 50%; bottom: -16px; width: 34px; height: 20px; border-bottom: 4px solid currentColor; border-left: 4px solid currentColor; border-right: 4px solid currentColor; border-radius: 0 0 20px 20px; transform: translateX(-50%); }
.voice-state span { display: block; font-size: 22px; font-weight: 900; }
.voice-state small { color: var(--muted); }
.assistant-chat { display: grid; gap: 10px; max-height: 420px; overflow: auto; padding: 4px; }
.chat-row { border-radius: 16px; padding: 12px; }
.chat-row.user { margin-left: 18%; background: #e9f3f1; }
.chat-row.assistant { margin-right: 8%; background: #fff; border: 1px solid var(--line); }
.chat-row strong { display: flex; gap: 8px; align-items: center; font-size: 13px; text-transform: uppercase; letter-spacing: .02em; }
.chat-row strong span { color: #7b5412; text-transform: none; }
.source-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.source-pills span, .source-pills a { border: 1px solid #c9d9d6; border-radius: 999px; padding: 5px 8px; background: #f6faf9; font-size: 12px; color: var(--brand-dark); font-weight: 750; }
.source-pills a { border-color: #8ebfba; background: #eaf7f5; text-decoration: none; }
.assistant-actions { display: grid; gap: 8px; margin: 10px 0; }
.source-action { display: grid; gap: 3px; border: 1px solid #7eb8b2; border-radius: 14px; padding: 12px; background: linear-gradient(180deg, #eefbf9, #ffffff); color: var(--brand-dark); box-shadow: 0 8px 18px rgba(0,101,107,.1); }
.source-action strong { display: block; font-size: 15px; text-transform: none; letter-spacing: 0; }
.source-action small { color: var(--muted); }
.assistant-fallback { margin-top: 12px; grid-template-columns: 1fr auto; align-items: end; }
.tech-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 16px 0; }
.reading-row { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); align-items: center; }
.reading-row em { border-radius: 999px; padding: 4px 8px; background: #e5f5ed; color: #287a52; font-size: 12px; font-style: normal; font-weight: 800; }
.reading-row em.warn, .reading-row em.active { background: #fff1cf; color: #7b5412; }
.timeline-item { display: grid; grid-template-columns: 18px 1fr; gap: 10px; padding: 8px 0; }
.timeline-item > span { width: 12px; height: 12px; border-radius: 50%; background: var(--brand); margin-top: 5px; box-shadow: 0 0 0 5px #e5f3f1; }
.follow-card { padding: 12px; border-radius: 14px; background: #fff7e8; border: 1px solid #efd19b; }
.empty { color: var(--muted); font-style: italic; }
.offline-panel { margin: 16px 0; border-radius: 18px; border: 1px solid var(--line); background: #fff; padding: 16px; box-shadow: 0 12px 30px rgba(17,29,27,.06); }
.offline-form { grid-template-columns: 1fr auto; align-items: end; }
.bottom-nav { position: fixed; left: 50%; bottom: 12px; transform: translateX(-50%); width: min(520px, calc(100% - 24px)); display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; padding: 8px; border-radius: 22px; background: rgba(255,255,255,.95); border: 1px solid var(--line); box-shadow: 0 18px 42px rgba(17,29,27,.18); z-index: 20; backdrop-filter: blur(16px); }
.bottom-nav a { text-align: center; color: var(--muted); font-weight: 800; font-size: 12px; padding: 10px 4px; border-radius: 14px; }
.bottom-nav a.active { color: #fff; background: var(--brand); }
.source-cards .card { min-height: 170px; }
@keyframes pulse { 0%,100% { transform: scale(1); box-shadow: 0 16px 28px rgba(0,101,107,.28); } 50% { transform: scale(1.04); box-shadow: 0 18px 42px rgba(0,101,107,.42); } }

.admin main { width: min(1440px, calc(100% - 40px)); }
.admin .top { background: #083b3f; color: #fff; border-bottom: 0; }
.admin .brand, .admin .top a { color: #fff; }
.ops-console { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 18px; }
.ops-sidebar { position: sticky; top: 78px; height: calc(100vh - 96px); display: grid; align-content: start; gap: 8px; padding: 18px; border-radius: 22px; background: linear-gradient(180deg, #053f43, #052d30); color: #fff; box-shadow: 0 18px 42px rgba(0,63,67,.18); }
.ops-sidebar strong { font-size: 20px; margin-bottom: 10px; }
.ops-sidebar a, .ops-sidebar span { color: #d7eeeb; padding: 11px 12px; border-radius: 12px; font-weight: 800; }
.ops-sidebar a.active { background: rgba(255,255,255,.12); color: #fff; }
.ops-sidebar span { margin-top: 22px; color: #9fc6c2; font-size: 13px; }
.ops-main { min-width: 0; }
.admin-head { align-items: center; border: 0; padding: 8px 0 18px; }
.admin-head h1 { font-size: 38px; }
.ops-date { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 10px 14px; color: var(--muted); font-weight: 800; }
.admin-grid > article { box-shadow: 0 12px 30px rgba(17,29,27,.06); }
.admin-row { background: #fff; border-radius: 12px; padding: 12px; margin-bottom: 8px; border: 1px solid var(--line); }
.admin-row span { min-width: 0; }
.admin-row select { min-width: 0; }
.person-row { grid-template-columns: 1fr; }
.person-row select, .person-row button { width: 100%; }
.visibility-row { grid-template-columns: minmax(0, 1fr) minmax(128px, 180px) 140px; }
.upload-form { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.upload-form label:nth-last-child(2), .upload-form button { grid-column: 1 / -1; }
.search-form { gap: 10px; }
.search-hit { border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin-top: 8px; background: #f8fbfa; }
.search-hit strong { display: block; }
.search-hit small { color: var(--muted); }
.search-hit p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.ops-card { border-radius: 18px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.section-head h2 { margin: 0; }
.section-head span { color: var(--muted); font-size: 13px; font-weight: 800; }
.priority-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #e05543; margin-right: 8px; }
.asset-row { border-top: 1px solid var(--line); padding-top: 12px; }

@media (max-width: 760px) {
  .top { padding: 12px 14px; }
  .top nav span { display: none; }
  main { width: min(100% - 24px, 520px); margin-top: 12px; }
  .hero, .equipment-head, .admin-head { display: grid; align-items: start; padding-top: 18px; }
  .grid, .cards, .admin-grid, .metrics { grid-template-columns: 1fr; }
  .button, button { width: 100%; text-align: center; }
  dl { grid-template-columns: 1fr; }
  .admin-row { grid-template-columns: 1fr; gap: 8px; }
  .equipment-head p, .hero p { font-size: 16px; }
  .equipment-hero { grid-template-columns: 1fr; padding: 16px; border-radius: 22px; }
  .equipment-visual { min-height: 190px; }
  .summary-strip, .tech-grid { grid-template-columns: 1fr; }
  .voice-top { display: grid; }
  .voice-stage { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .assistant-fallback { grid-template-columns: 1fr; }
  .offline-form, .upload-form { grid-template-columns: 1fr; }
  .chat-row.user, .chat-row.assistant { margin-left: 0; margin-right: 0; }
  .source-cards { grid-template-columns: 1fr; }
  .mock-badge { justify-self: start; white-space: normal; }
  .ops-console { grid-template-columns: 1fr; }
  .ops-sidebar { position: static; height: auto; grid-template-columns: repeat(2, 1fr); }
  .ops-sidebar strong, .ops-sidebar span { grid-column: 1 / -1; }
  .ops-date { justify-self: start; border-radius: 14px; }
}
