:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f4f5f7;
  color: #17181b;
  letter-spacing: 0;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: #f4f5f7; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.login-view { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-panel { width: min(100%, 390px); }
.brand, .section-title > span, .topbar span { color: #686b73; font-size: 13px; font-weight: 700; text-transform: uppercase; }
.login-panel h1 { margin: 8px 0 4px; font-size: 48px; line-height: 1; }
.login-panel > p { margin: 0 0 32px; color: #686b73; }
form { display: grid; gap: 16px; }
label { font-weight: 700; }
input[type="email"], input[type="password"], textarea {
  width: 100%; margin-top: 8px; border: 1px solid #d7d9de; border-radius: 8px;
  background: #fff; color: #17181b; padding: 14px; outline: none;
}
input:focus, textarea:focus { border-color: #17181b; box-shadow: 0 0 0 3px rgba(23, 24, 27, .09); }
.primary { min-height: 48px; border: 0; border-radius: 8px; background: #17181b; color: #fff; font-weight: 800; padding: 0 20px; }
.primary:disabled { opacity: .55; }
.error, .test-status, .save-status { min-height: 20px; margin: 0; color: #bf2431; font-size: 14px; }

.app-shell { width: min(100%, 760px); margin: 0 auto; padding: env(safe-area-inset-top) 20px calc(40px + env(safe-area-inset-bottom)); }
.topbar { min-height: 92px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #dfe1e5; }
.topbar h1 { margin: 2px 0 0; font-size: 32px; }
.quiet, .icon-button { border: 1px solid #d7d9de; background: #fff; color: #17181b; }
.quiet { border-radius: 8px; padding: 10px 12px; font-weight: 700; }
.icon-button { width: 42px; height: 42px; border-radius: 50%; font-size: 24px; }

.status-strip { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: center; padding: 22px 0; border-bottom: 1px solid #dfe1e5; }
.status-strip div { display: grid; gap: 4px; }
.status-strip span { color: #686b73; font-size: 13px; }
.status-strip strong { font-size: 18px; }
.status-strip .ready { color: #167247; }
.status-strip .warning { color: #bf2431; }

.section { padding: 34px 0; border-bottom: 1px solid #dfe1e5; }
.section-title { margin-bottom: 18px; }
.section-title h2 { margin: 4px 0 0; font-size: 24px; }
.settings-list { background: #fff; border: 1px solid #dfe1e5; border-radius: 8px; overflow: hidden; }
.setting-row { display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 14px; min-height: 78px; padding: 13px 16px; }
.setting-row + .setting-row { border-top: 1px solid #e7e8eb; }
.setting-row > span:nth-child(2) { display: grid; gap: 4px; }
.setting-row small { color: #686b73; font-weight: 500; line-height: 1.25; }
.setting-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 7px; color: #fff; font-weight: 900; }
.setting-icon.garage { background: #bf2431; }
.setting-icon.energy { background: #167247; }
.setting-icon.shop { background: #6b45c4; }

input[role="switch"] { appearance: none; width: 50px; height: 30px; margin: 0; border-radius: 15px; background: #c7cad0; padding: 3px; transition: background .18s ease; }
input[role="switch"]::before { content: ""; display: block; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .18s ease; }
input[role="switch"]:checked { background: #17181b; }
input[role="switch"]:checked::before { transform: translateX(20px); }
input[role="switch"]:disabled { opacity: .55; }
.save-status { margin-top: 12px; color: #686b73; }

textarea { resize: vertical; min-height: 100px; font-weight: 600; line-height: 1.45; }
.composer-footer { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.composer-footer span { color: #686b73; font-size: 13px; }
.test-status { color: #167247; margin-top: 12px; }
.toast { position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 10; background: #17181b; color: #fff; border-radius: 8px; padding: 12px 16px; font-weight: 700; white-space: nowrap; box-shadow: 0 8px 30px rgba(0,0,0,.2); }

@media (max-width: 480px) {
  .app-shell { padding-left: 16px; padding-right: 16px; }
  .status-strip { grid-template-columns: 1fr 1fr auto; gap: 8px; }
  .setting-row { grid-template-columns: 38px minmax(0, 1fr) auto; gap: 10px; padding: 12px; }
  .setting-icon { width: 34px; height: 34px; }
  .setting-row strong { font-size: 15px; }
  .setting-row small { font-size: 12px; }
}
