:root {
  color-scheme: light;
  --brand: #101d32;
  --brand-line: #31415d;
  --brand-accent: #7eb0ff;
  --ink: #142033;
  --muted: #637087;
  --line: #dce3ed;
  --surface: #ffffff;
  --canvas: #f5f7fa;
  --safe: #13865b;
  --attention: #b85c00;
  --critical: #a33737;
  --energy: #c6562b;
  --water: #197889;
  --power: #9a7000;
  --green: #287a5e;
  --partner: #626780;
  --radius: 16px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { scrollbar-width: none; }
html::-webkit-scrollbar { display: none; }
body { margin: 0; min-width: 320px; background: var(--canvas); color: var(--ink); }
button { font: inherit; }
.app { min-height: 100dvh; padding-bottom: 74px; }
.app-header { position: sticky; z-index: 20; top: 0; display: flex; align-items: center; min-height: 70px; gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--brand-line); background: var(--brand); color: white; }
.brand { display: flex; min-width: 0; flex: 1; align-items: center; gap: 11px; border: 0; background: transparent; color: white; text-align: left; cursor: pointer; }
.brand-logo { width: 50px; height: 50px; flex: 0 0 50px; object-fit: contain; }
.brand strong { display: block; font-size: 17px; letter-spacing: .085em; line-height: 1.05; }
.brand small { display: block; margin-top: 4px; color: #a8b9d3; font-size: 10px; letter-spacing: .035em; }
.icon-button { width: 42px; height: 42px; flex: 0 0 42px; border: 1px solid #40526d; border-radius: 12px; background: #182943; color: white; font-size: 22px; cursor: pointer; }
.hidden { display: none !important; }
main { width: min(100%, 1080px); margin: 0 auto; }
.context { padding: 19px 18px 12px; background: var(--surface); }
.eyebrow { margin: 0 0 5px; color: #46617f; font-size: 11px; font-weight: 750; letter-spacing: .055em; }
h1 { margin: 0; font-size: clamp(24px, 6.3vw, 38px); line-height: 1.12; letter-spacing: -.025em; }
#pageDescription { max-width: 720px; margin: 7px 0 0; color: var(--muted); font-size: 14px; line-height: 1.42; }
.status-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 11px; }
.chip { padding: 6px 9px; border-radius: 9px; background: #edf2f7; color: #44536a; font-size: 11px; font-weight: 700; }
.chip.good { background: #e8f5ef; color: #176747; }
.chip.warn { background: #fff1d6; color: #875900; }
.crumbs { display: flex; gap: 5px; overflow: hidden; padding: 9px 18px 8px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.crumbs button { overflow: hidden; padding: 0; border: 0; background: transparent; color: inherit; text-overflow: ellipsis; cursor: pointer; }
.crumbs button:not(:last-child)::after { content: " /"; color: #9ba9ba; }
.screen { padding: 10px 12px 20px; }
.route-home .context, .route-home .crumbs { display: none; }
.route-home .screen { padding-top: 14px; }
.identity-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; padding: 11px 13px; border: 1px solid var(--brand-line); border-radius: 13px; background: var(--brand); color: white; }
.identity-summary span { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.identity-summary strong { flex: 0 0 auto; color: #bcd3f3; font-size: 11px; }
.section-title { margin: 1px 5px 10px; font-size: 14px; font-weight: 750; }
.domain-list, .object-list, .action-grid, .metric-grid, .equipment-list, .scenario-list { display: grid; gap: 9px; }
.domain-card, .object-card, .action-card { width: 100%; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); text-align: left; box-shadow: 0 2px 8px rgba(20,32,51,.04); cursor: pointer; }
.domain-card { display: grid; grid-template-columns: 56px minmax(0,1fr) auto; align-items: center; gap: 12px; min-height: 76px; padding: 9px 13px; }
.domain-icon { display: grid; width: 54px; height: 54px; place-items: center; border-radius: 13px; background: var(--brand); overflow: hidden; }
.domain-icon img { width: 54px; height: 54px; object-fit: contain; }
.domain-icon.placeholder { border: 1px solid #40526d; color: white; font-size: 24px; }
.domain-card strong, .object-card strong { display: block; font-size: 17px; line-height: 1.2; }
.domain-card p, .object-card p { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.32; }
.chevron { color: #8290a3; font-size: 23px; }
.domain-card.reserved { background: #f8f9fb; }
.object-card { padding: 16px; }
.object-status { display: flex; align-items: center; gap: 7px; margin-top: 10px; color: #44536a; font-size: 12px; }
.state-dot { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: #8794a6; }
.state-dot.good { background: var(--safe); }
.action-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
.action-card { display: flex; min-height: 70px; align-items: center; gap: 10px; padding: 11px 12px; }
.action-card span { width: 29px; flex: 0 0 29px; text-align: center; font-size: 21px; }
.action-card strong { font-size: 13px; line-height: 1.25; }
.panel { margin-bottom: 10px; padding: 15px; border: 1px solid var(--line); border-radius: var(--radius); background: white; }
.panel h2 { margin: 0 0 8px; font-size: 16px; }
.panel p { margin: 6px 0; color: #44536a; font-size: 13px; line-height: 1.46; }
.metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); margin-bottom: 10px; }
.metric { min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.metric label { display: block; min-height: 30px; color: var(--muted); font-size: 12px; line-height: 1.28; }
.metric strong { display: block; overflow: hidden; margin-top: 5px; font-size: 22px; letter-spacing: -.025em; text-overflow: ellipsis; white-space: nowrap; }
.metric small { margin-left: 3px; color: var(--muted); font-size: 11px; }
.quality { color: var(--safe) !important; font-weight: 700; }
.attention { color: var(--attention) !important; font-weight: 700; }
.inline-action { width: 100%; margin-top: 10px; padding: 12px 14px; border: 1px solid #b6c6da; border-radius: 12px; background: #eef3f9; color: #1d3859; text-align: left; font-weight: 700; cursor: pointer; }
.equipment-group { margin-bottom: 17px; }
.equipment-group > h2 { margin: 0 5px 8px; color: #44536a; font-size: 13px; }
.equipment-list { gap: 7px; }
.equipment-row { padding: 13px 14px; border: 1px solid var(--line); border-radius: 13px; background: white; }
.equipment-row header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.equipment-row h3 { margin: 0; font-size: 14px; line-height: 1.3; }
.equipment-row p { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.38; }
.equipment-row em { flex: 0 0 auto; color: var(--safe); font-size: 10px; font-style: normal; font-weight: 750; }
.parameter-summary { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.parameter-summary strong { font-size: 25px; }
.parameter-group { margin-bottom: 16px; }
.parameter-group h2 { margin: 0 5px 7px; color: #44536a; font-size: 13px; }
.parameter-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px; padding: 12px 13px; border: 1px solid var(--line); border-bottom: 0; background: white; }
.parameter-row:first-of-type { border-radius: 13px 13px 0 0; }
.parameter-row:last-of-type { border-bottom: 1px solid var(--line); border-radius: 0 0 13px 13px; }
.parameter-row span { font-size: 12px; line-height: 1.35; }
.parameter-row strong { text-align: right; font-size: 12px; }
.parameter-row small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.empty-state { padding: 24px 18px; border: 1px dashed #bdc7d5; border-radius: var(--radius); background: white; text-align: center; }
.empty-state strong { display: block; margin-bottom: 7px; font-size: 17px; }
.empty-state p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.scenario-current { border-left: 4px solid var(--energy); }
.scenario-list button { padding: 12px 13px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); text-align: left; font-size: 12px; }
.scenario-list button.selected { border-color: #d8a28d; background: #fff7f3; font-weight: 750; }
.scenario-list button:not(:disabled) { cursor: pointer; }
.scenario-list button:disabled { color: #8794a6; }
.scenario-error { margin: 5px 3px 0; color: var(--critical); font-size: 11px; }
.service-note { margin: 0 12px 18px; padding: 12px 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; line-height: 1.42; }
.service-note strong { display: block; margin-bottom: 3px; color: #44536a; }
.preview-note { background: #fff9e8; border: 1px solid #ead9a6; border-radius: 12px; color: #755815; }
.app-footer { position: fixed; z-index: 30; inset: auto 0 0; display: grid; grid-template-columns: repeat(3,1fr); min-height: 66px; padding: 5px max(8px,env(safe-area-inset-right)) max(5px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left)); border-top: 1px solid var(--line); background: rgba(255,255,255,.98); }
.app-footer button, .app-footer div { display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 2px; border: 0; background: transparent; color: #44536a; font-size: 10px; font-weight: 700; }
.app-footer span { font-size: 19px; }
.app-footer button:disabled { color: #a9b3c1; }
@media (min-width: 700px) {
  .app-header { padding-inline: max(22px,calc((100vw - 1080px)/2)); }
  .screen, .service-note { margin-inline: 18px; }
  .domain-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .action-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .metric-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .equipment-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 359px) {
  .brand small { display: none; }
  .brand-logo { width: 46px; height: 46px; flex-basis: 46px; }
  .domain-card { grid-template-columns: 52px minmax(0,1fr) auto; padding-inline: 10px; }
  .domain-icon, .domain-icon img { width: 50px; height: 50px; }
  .action-card { padding-inline: 9px; }
}
