.button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 12px 18px; border: 1px solid transparent; border-radius: 13px; background: var(--sage); color: white; font-size: 13px; font-weight: 600; transition: background var(--motion-fast), transform var(--motion-fast); }
.button:not(:disabled):active { transform: scale(.98); }
.button:not(:disabled):hover { background: var(--sage-dark); }
.button:disabled { opacity: .5; }
.button-secondary { background: var(--surface); color: var(--sage-dark); border-color: #d1d9c8; }
.button-secondary:not(:disabled):hover { background: var(--sage-soft); }
.text-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 6px 0; background: none; color: var(--sage-dark); font-size: 11px; font-weight: 550; }
.text-button svg { width: 14px; height: 14px; }
.icon-button { display: grid; width: 44px; height: 44px; flex-shrink: 0; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); }
.icon-button svg { width: 18px; height: 18px; }
.icon-button:disabled { opacity: .35; }
.page-section { margin-top: 25px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 35px; margin-bottom: 12px; }
.section-heading h2 { font-size: 18px; }
.section-heading > span { color: var(--muted); font: 8px/1.5 var(--mono); letter-spacing: .7px; }
.all-good { display: flex; align-items: center; gap: 7px; padding: 1px 0 14px; font-size: 11px; color: var(--muted); }
.all-good svg { width: 14px; height: 14px; color: var(--sage); }
.attention { padding: 12px; margin-bottom: 16px; border: 1px solid #e5d9d3; border-radius: 14px; background: #f7efea; }
.attention h2 { margin-bottom: 5px; font-size: 12px; color: #834a3f; }
.attention button { display: flex; width: 100%; min-height: 44px; align-items: center; gap: 8px; padding: 7px 0; background: none; text-align: left; color: #834a3f; font-size: 11px; }
.attention button > span { flex: 1; }
.attention svg { width: 15px; height: 15px; }
.home-hero { position: relative; display: block; width: 100%; height: 210px; overflow: hidden; border-radius: 20px; background: #dde3d5; text-align: left; color: white; }
.home-hero > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-shade { position: absolute; inset: 0; background: linear-gradient(0deg,#202c2280,#202c2229); }
.home-hero-copy { position: absolute; left: 19px; top: 22px; }
.home-hero-copy small { display: block; font: 7px/1.5 var(--mono); letter-spacing: 1.1px; }
.home-hero-copy strong { display: block; margin-top: 10px; font-size: 24px; font-weight: 550; line-height: 1.16; letter-spacing: -.9px; }
.environment-pills { position: absolute; left: 17px; right: 17px; bottom: 16px; display: flex; gap: 10px; }
.environment-pills > span { display: flex; min-height: 42px; align-items: center; gap: 7px; padding: 9px 12px; border: 1px solid #ffffff55; border-radius: 12px; background: #fcfdf4eb; color: #354a2b; }
.environment-pills strong { font-size: 16px; font-weight: 600; }
.environment-pills small { font-size: 9px; }
.environment-pills svg { width: 15px; height: 15px; }
.quick-scenes { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; }
.scene-quick { display: flex; min-height: 83px; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 14px 11px 12px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); color: var(--sage-dark); text-align: left; }
.scene-quick span { font-size: 10px; font-weight: 600; white-space: nowrap; }
.scene-quick svg { width: 22px; height: 22px; }
.scene-quick:active { background: var(--sage-soft); }
.device-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 11px; }
.device-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface); }
.device-card.is-on { background: var(--sage-soft); border-color: #d5dfca; }
.device-card.is-offline { background: #f0f1ed; color: #687061; }
.device-open { display: flex; width: 100%; min-height: 133px; flex-direction: column; align-items: flex-start; padding: 14px 14px 3px; background: none; text-align: left; }
.device-symbol { display: grid; width: 32px; height: 32px; margin-bottom: 10px; place-items: center; border-radius: 10px; background: var(--stone); color: #65725d; }
.device-card.is-on .device-symbol { background: #d6e1ca; color: var(--sage-dark); }
.device-symbol svg { width: 19px; height: 19px; }
.device-name { font-size: 12px; font-weight: 650; line-height: 1.4; }
.device-room { margin-top: 2px; font-size: 9px; color: var(--muted); }
.device-status { margin-top: 7px; font-size: 10px; color: #4c5e44; line-height: 1.4; }
.is-offline .device-status { color: #6b7265; }
.device-quick { display: flex; min-height: 51px; align-items: center; justify-content: space-between; gap: 6px; padding: 1px 12px 8px; }
.device-detail-arrow { color: #6e7c64; font-size: 17px; }
.quick-pill { display: flex; min-height: 44px; align-items: center; gap: 8px; padding: 4px 0; background: none; color: var(--sage-dark); font-size: 10px; }
.quick-pill svg { width: 13px; height: 13px; }
.quick-pill:disabled { color: var(--muted); }
.inline-device-error { display: block; width: calc(100% - 20px); min-height: 44px; margin: 0 10px 9px; padding: 6px; border-radius: 8px; background: var(--brick-soft); color: var(--brick); text-align: left; font-size: 9px; }
.device-countdown { margin: 0 12px 12px; color: var(--sage-dark); font-size: 9px; }
.device-countdown small { display: block; color: var(--muted); font-size: 8px; }
.room-list { display: flex; flex-direction: column; gap: 13px; }
.room-card { position: relative; display: block; width: 100%; height: 142px; padding: 0; overflow: hidden; border-radius: 18px; text-align: left; background: var(--stone); }
.room-card > img { width: 100%; height: 100%; object-fit: cover; }
.room-card-overlay { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 18px; color: white; background: linear-gradient(0deg,#1b2a1fc9,transparent 80%); }
.room-card strong { display: block; font-size: 18px; letter-spacing: -.6px; }
.room-card small { display: block; margin-top: 4px; color: #f0f4eb; font-size: 10px; }
.large .room-card { height: 166px; }
.room-detail-hero { position: relative; height: 188px; overflow: hidden; border-radius: 19px; margin-top: 8px; }
.room-detail-hero img { width: 100%; height: 100%; object-fit: cover; }
.room-detail-hero > span { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; padding: 19px; color: white; background: linear-gradient(0deg,#1b2a1fc9,transparent 80%); }
.room-detail-hero p { font-size: 10px; margin-bottom: 7px; }
.room-detail-hero h1 { font-size: 27px; }
.room-overview { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 16px 0 22px; color: var(--muted); font-size: 9px; }
.list-card, .automation-card { border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface); }
.scene-list { display: flex; flex-direction: column; gap: 15px; }
.list-card-main { display: flex; width: 100%; align-items: center; gap: 12px; min-height: 76px; padding: 17px; background: none; text-align: left; }
.list-card-main > span:nth-child(2) { min-width: 0; flex: 1; }
.list-card-main strong { display: block; font-size: 14px; }
.list-card-main small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.list-card-main > svg { width: 15px; height: 15px; color: #75826b; }
.list-icon { display: grid; width: 39px; height: 39px; flex-shrink: 0; place-items: center; border-radius: 12px; background: var(--sage-soft); color: var(--sage-dark); }
.scene-list-card > p { padding: 0 18px 9px; color: var(--muted); font-size: 11px; }
.scene-run-link { display: flex; width: 100%; min-height: 45px; align-items: center; justify-content: center; gap: 7px; border-top: 1px solid var(--line); background: none; color: var(--sage-dark); font-size: 11px; font-weight: 600; }
.scene-run-link svg { width: 14px; height: 14px; }
.entity-intro { padding: 20px 0 26px; text-align: center; }
.entity-intro > span { display: inline-grid; width: 64px; height: 64px; place-items: center; border-radius: 21px; background: var(--sage-soft); color: var(--sage-dark); }
.entity-intro > span svg { width: 31px; height: 31px; }
.entity-intro h1 { margin-top: 21px; font-size: 29px; }
.entity-intro p { margin-top: 10px; color: var(--muted); font-size: 12px; }
.entity-intro > small { display: block; margin-top: 12px; color: var(--muted); font-size: 10px; }
.entity-intro.left { text-align: left; }
.target-list { margin-top: 13px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); overflow: hidden; }
.target-list button { display: flex; width: 100%; min-height: 73px; align-items: center; justify-content: space-between; gap: 12px; padding: 15px; border-bottom: 1px solid var(--line); background: none; text-align: left; }
.target-list button:last-child { border-bottom: 0; }
.target-list strong { display: block; font-size: 12px; }
.target-list small { display: block; margin-top: 5px; font-size: 10px; color: var(--muted); }
.target-list svg { width: 15px; height: 15px; }
.list-link { display: flex; align-items: center; width: 100%; gap: 10px; min-height: 52px; padding: 12px 0; background: none; font-size: 12px; color: var(--sage-dark); }
.list-link svg:last-child { margin-left: auto; width: 15px; }
.automation-list { display: flex; flex-direction: column; gap: 13px; }
.automation-card { padding: 17px; }
.automation-card > div { display: flex; align-items: center; justify-content: space-between; }
.automation-open { position: relative; display: block; width: 100%; padding: 19px 18px 0 0; background: none; text-align: left; }
.automation-open strong { display: block; font-size: 16px; letter-spacing: -.4px; }
.automation-open p { margin-top: 7px; color: var(--muted); font-size: 11px; }
.automation-open small { display: block; margin-top: 14px; color: var(--muted); font-size: 9px; }
.automation-open > svg { position: absolute; right: 0; top: 21px; width: 17px; height: 17px; }
.rule-block { margin-bottom: 12px; padding: 17px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.rule-block .eyebrow { margin-bottom: 10px; color: var(--sage-dark); }
.rule-block strong, .rule-block > p:not(.eyebrow) { font-size: 12px; line-height: 1.8; }
.action-summary { display: flex; align-items: flex-start; gap: 10px; margin-top: 10px; font-size: 11px; }
.action-summary > span { color: var(--sage); font: 10px/1.5 var(--mono); }
.test-actions > p { margin: 8px 0 17px; color: var(--muted); font-size: 10px; line-height: 1.7; }
.history-row { display: flex; width: 100%; min-height: 75px; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); background: none; text-align: left; }
.history-row > span:nth-child(2) { flex: 1; min-width: 0; }
.history-row strong { display: block; font-size: 12px; }
.history-row small { display: block; margin-top: 4px; font-size: 10px; color: var(--muted); }
.history-row time { color: var(--muted); font: 9px/1.5 var(--mono); }
.history-row > svg:last-child { width: 15px; }
.failed, .partial { color: var(--brick) !important; }
.list-icon.failed, .list-icon.partial { background: var(--brick-soft); }
.result-dot { width: 7px; height: 7px; flex-shrink: 0; border-radius: 50%; background: #839176; }
.result-dot.failed, .result-dot.partial { background: var(--brick); }
.empty-state { padding: 34px 15px; text-align: center; }
.empty-state > svg { width: 30px; height: 30px; margin-bottom: 16px; color: #849578; }
.empty-state h3 { font-size: 16px; }
.empty-state p { max-width: 260px; margin: 12px auto 20px; color: var(--muted); font-size: 12px; line-height: 1.8; }
.danger-link { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 0; background: none; color: var(--brick); font-size: 11px; }
.danger-link svg { width: 15px; height: 15px; }
.toast { position: absolute; z-index: 100; left: 18px; right: 18px; bottom: 88px; padding: 13px 16px; border-radius: 13px; background: #2c3e25; color: white; font-size: 11px; line-height: 1.6; text-align: center; box-shadow: 0 4px 15px #26302614; }
.confirm-dialog { position: fixed; inset: 0; width: min(330px,calc(100% - 40px)); margin: auto; padding: 25px; border: 1px solid var(--line); border-radius: 22px; color: var(--ink); background: var(--page); }
.confirm-dialog h2 { font-size: 22px; letter-spacing: -.7px; }
.confirm-dialog p { margin-top: 13px; color: var(--muted); font-size: 12px; line-height: 1.8; }
.confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 24px; }
.confirm-actions .button { font-size: 11px; padding-inline: 8px; }
