.visually-hidden:not(.shopping-error) {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.quick-entry {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}
.quick-entry input, .quick-entry button { min-height: 46px; }
.quick-entry button { gap: 5px; }
.quick-entry button .glyph { width: 17px; }
.quick-task { max-width: 50rem; }
.quick-task details, .catalog-panel details { margin-top: 0; }
.task-list { max-width: 50rem; margin-top: 16px; }
.task-row { display: flex; align-items: center; gap: 12px; }
.task-copy { flex: 1; min-width: 0; }
.task-copy h2 { margin: 0 0 5px; }
.task-copy p { display: flex; flex-wrap: wrap; column-gap: 12px; font-size: .9rem; }
.task-copy .urgent { color: #9b342c; }
.check-square .glyph { width: 15px; height: 15px; color: #487b63; }

.shopping-layout { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(255px, 1fr); align-items: start; gap: 16px; }
.catalog-filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 15px 0; }
.catalog-filters .chip { min-height: 36px; }
.catalog-filters [aria-pressed=true] { color: white; background: var(--green); }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; margin-top: 12px; }
.product-card {
    position: relative;
    display: grid;
    grid-template-rows: 1fr auto;
    justify-items: center;
    align-items: center;
    gap: 4px;
    width: 100%;
    height: 102px;
    padding: 11px 6px 9px;
    background: #f2f6ef;
    border: 1px solid #e0e8dd;
    color: var(--deep);
    border-radius: 12px;
    font-size: .86rem;
    overflow-wrap: anywhere;
}
.product-card > span:nth-child(2) { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.product-card.product-in-list { background: #e3f0e6; border-color: #bdd1c1; }
.product-in-list .product-action { background: #fff8f4; color: #853d3e; }
.product-icon { font: 1.95rem/1.15 "Apple Color Emoji", "Segoe UI Emoji", sans-serif; }
.product-action {
    position: absolute;
    right: 5px;
    top: 5px;
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    background: #dcebe0;
    border-radius: 50%;
}
.product-action .glyph { width: 13px; height: 13px; }
.shopping-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 6px; border-top: 1px solid var(--line); align-items: start; }
.shopping-row:has(details[open]) { grid-template-columns: minmax(0, 1fr) auto; }
.shopping-row details[open] { grid-column: 1 / -1; }
.shopping-row details[open] summary { width: 44px; margin-left: auto; }
.shopping-check {
    width: 100%;
    justify-content: flex-start;
    gap: 9px;
    text-align: left;
    padding: 6px 0;
    min-height: 48px;
    background: transparent;
    color: var(--ink);
}
.shopping-check .check-square { display: grid; place-items: center; flex: 0 0 auto; }
.shopping-check small { display: block; margin-top: 2px; }
.shopping-row details { margin: 0; padding: 0; border: 0; }
.shopping-row details summary { list-style: none; display: grid; place-items: center; min-width: 42px; min-height: 44px; border-radius: 9px; font-size: 1.45rem; }
.shopping-row details summary::-webkit-details-marker { display: none; }
.shopping-row details summary:hover { background: var(--pale); }
.shopping-error { color: #912e36; font-size: .92rem; margin-top: 8px; }

.wall-app, .home-dashboard {
    --panel-tint: #f8faf6;
    --panel-hover: #f0f4ee;
    --panel-accent: #365748;
    --panel-outline: #d3dfd3;
}
.wall-app {
    color: var(--ink);
    background: var(--paper);
    min-height: 100dvh;
}
.wall-app .workspace { min-height: 100dvh; }
.wall-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: max(8px, env(safe-area-inset-top)) clamp(12px, 2vw, 28px) 8px;
    border-bottom: 1px solid var(--line);
    background: var(--white);
    position: sticky;
    top: 0;
    z-index: 3;
}
.wall-brand, .wall-nav, .wall-actions { display: flex; align-items: center; gap: 5px; }
.wall-brand, .wall-nav a, .wall-actions a, .wall-actions button {
    color: var(--muted);
    text-decoration: none;
    padding: 7px 10px;
    min-height: 43px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border-radius: 9px;
    background: transparent;
    border: 0;
    font-size: .9rem;
    font-weight: 670;
}
.wall-brand { color: var(--deep); font-size: 1.07rem; letter-spacing: -.035em; }
.wall-nav a.active, .wall-actions button[aria-pressed=true], .wall-nav a:hover, .wall-actions button:hover {
    background: var(--pale);
    color: var(--green);
}
.wall-brand .glyph, .wall-actions .glyph { width: 18px; height: 18px; }
.wall-content { max-width: 1900px; padding: clamp(10px, 1.7vw, 23px); }
.wall-grid {
    display: grid;
    grid-template-columns: minmax(190px, 1fr) minmax(330px, 2.15fr) minmax(230px, 1.2fr);
    gap: clamp(9px, 1.35vw, 18px);
    align-items: start;
}
.wall-stack { display: grid; gap: clamp(9px, 1.25vw, 16px); min-width: 0; }
.wall-panel {
    min-width: 0;
    padding: clamp(11px, 1.4vw, 17px);
    border: 1px solid var(--line);
    border-radius: 15px;
    background: var(--white);
}
.wall-time, .home-dashboard .home-hero {
    background: linear-gradient(130deg, #edf4e9, #f9fbf6);
    border: 1px solid var(--panel-outline);
    color: var(--deep);
}
.wall-time p { color: var(--muted); text-transform: capitalize; font-size: .9rem; }
.wall-clock {
    display: block;
    font-size: clamp(2.6rem, 5vw, 5.2rem);
    font-weight: 650;
    letter-spacing: -.075em;
    font-variant-numeric: tabular-nums;
    line-height: .98;
    margin-bottom: 8px;
}
.wall-heading { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; }
.wall-heading h2 { font-size: 1.02rem; margin-right: auto; }
.wall-heading.major h2 { font-size: 1.3rem; }
.wall-heading.major { margin-bottom: 0; min-height: 28px; }
.wall-heading > .glyph { width: 18px; height: 18px; color: var(--panel-accent); }
.wall-heading a { font-size: .82rem; color: var(--panel-accent); text-decoration: none; flex: 0 0 auto; padding-block: 8px; }
.wall-heading a:hover { text-decoration: underline; }
.wall-muted { color: var(--muted); font-size: .86rem; }
.wall-weather-current { display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; margin-bottom: 7px; }
.wall-weather-current strong { font-size: clamp(1.55rem, 2.4vw, 2.35rem); letter-spacing: -.055em; }
.forecast-row {
    display: grid;
    grid-template-columns: 2.5rem 1.35rem minmax(0, 1fr) max-content;
    gap: 4px;
    align-items: center;
    min-height: 25px;
    font-size: .79rem;
    font-variant-numeric: tabular-nums;
}
.forecast-day { white-space: nowrap; text-decoration: none; }
.forecast-icon { text-align: center; }
.forecast-row > :last-child { text-align: right; white-space: nowrap; }
.forecast-track { position: relative; height: 5px; background: #e8eee6; border-radius: 99px; overflow: hidden; }
.forecast-track i { position: absolute; top: 0; height: 100%; border-radius: inherit; background: #8caf95; }
.wall-gallery .photo-frame { margin: 0; background: var(--panel-tint); border-radius: 9px; }
.wall-gallery .photo-frame img { aspect-ratio: 4 / 3; height: auto; object-fit: contain; }
.wall-gallery .photo-next { bottom: 6px; right: 6px; min-width: 41px; min-height: 42px; background: #fffffff0; color: var(--deep); }
.device-rooms, .device-grid {
    display: grid;
    align-items: start;
    gap: 10px;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 188px), 1fr));
}
.device-rooms { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 14px; }
.device-room { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 14px; }
.device-room h2 { font-size: 1.05rem; margin: 0 0 8px; }
.device {
    padding: 8px 10px;
    background: var(--white);
    border-radius: 12px;
    box-shadow: none;
    display: grid;
    gap: 4px;
    align-items: center;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(46px, auto) 44px;
    height: 112px;
}
.device[data-state=on], .device[data-pulse=accepted] { background: #e3f2e1; border-color: #86ab8c; }
.device[data-pulse=pending] { background: #f6f0de; border-color: #d5bc79; }
.device .card-head { margin: 0; gap: 7px; min-width: 0; }
.device .card-head > div { min-width: 0; }
.device .tile-icon { width: 31px; height: 31px; border-radius: 8px; }
.device .tile-icon .glyph { width: 17px; height: 17px; }
.device[data-state=on] .tile-icon { background: #f7e5aa; color: #73521c; }
.device[data-pulse=accepted] .tile-icon { background: #c6e3cb; }
.device h3 { font-size: .92rem; }
.device .card-head h3, .device-status { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.device-status { color: var(--muted); font-size: .77rem; margin-top: 2px; line-height: 1.25; }
.device-tap { position: relative; grid-template-rows: 1fr; }
.device-tap .device-actions { position: absolute; inset: 0; }
.device .device-tap-target { position: absolute; inset: 0; width: 100%; padding: 0; border: 0; border-radius: inherit; background: transparent; }
.device-tap:has(.device-tap-target:hover:not(:disabled)) { box-shadow: inset 0 0 0 1px #8eaa9b; }
.device-tap .device-actions { border-radius: inherit; }
.cover-slider, .cover-buttons { width: 100%; display: grid; gap: 5px; align-items: center; }
.cover-buttons { grid-template-columns: repeat(3, 1fr); }
.cover-slider { grid-template-columns: minmax(0, 1fr) 2.5rem auto; }
.cover-slider input {
    margin: 0;
    padding: 0;
    min-height: 44px;
    border: 0;
    background: transparent;
    accent-color: var(--green);
    cursor: pointer;
}
.cover-slider span { color: var(--muted); text-align: right; font-size: .78rem; font-variant-numeric: tabular-nums; }
.device button:not(.device-tap-target) {
    color: var(--green);
    background: var(--pale);
    border: 1px solid var(--line);
    padding: 4px 8px;
    min-height: 44px;
    font-size: .79rem;
}
.cover-slider button { min-width: 44px; }
.device-actions { gap: 4px; flex-wrap: nowrap; }
.device-actions[aria-busy=true] :is(button, input[type=range]) { opacity: .6; pointer-events: none; }
.device-dialog {
    width: min(440px, calc(100% - 24px));
    max-height: calc(100dvh - 24px);
    overflow: auto;
    padding: 14px;
    color: var(--ink);
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 14px;
}
.device-dialog::backdrop { background: #202b2770; }
.device video { display: block; width: 100%; margin-top: 6px; border-radius: 8px; background: #101613; }
.device-placement small { display: block; margin-top: 6px; }
.integration-settings { padding: 13px; background: var(--pale); border-radius: 12px; margin-bottom: 16px; }
.shortcut-page { max-width: 480px; margin: 8vh auto; padding: 14px; }
.shortcut-page video { width: 100%; border-radius: 10px; }
.shortcut-settings { margin-top: 13px; }
.settings-shortcuts ~ .split :target { scroll-margin-top: 12px; }

@media (max-width: 970px) {
    .wall-grid { grid-template-columns: minmax(155px, .95fr) minmax(245px, 1.75fr) minmax(170px, 1fr); }
    .forecast-row { grid-template-columns: 2.25rem 1.25rem minmax(0, 1fr) max-content; }
}
@media (max-width: 760px) {
    .shopping-layout { grid-template-columns: 1fr; }
    .product-grid { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); max-height: 280px; overflow: auto; padding: 3px; }
    .catalog-filters { flex-wrap: nowrap; overflow: auto; padding: 3px; }
    .catalog-filters button { white-space: nowrap; }
    .wall-grid { grid-template-columns: minmax(165px, .85fr) minmax(225px, 1.35fr); }
    .wall-agenda { grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
    .wall-bar { flex-wrap: wrap; }
    .wall-nav { order: 3; width: 100%; justify-content: space-between; }
    .wall-nav a { flex: 1; justify-content: center; padding-inline: 4px; }
    .wall-actions a, .wall-actions button { padding-inline: 5px; }
}
@media (max-width: 455px) {
    .wall-grid { grid-template-columns: minmax(0, 1fr); }
    .wall-agenda { grid-template-columns: minmax(0, 1fr); }
    .wall-gallery .photo-frame img { height: 180px; }
    .quick-entry button .glyph { display: none; }
}

.widget-card { align-self: start; min-width: 0; container-type: inline-size; }
.widget-heading {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 9px;
    row-gap: 4px;
    margin-bottom: 12px;
}
.widget-heading h2 { font-size: clamp(1rem, 1.45vw, 1.22rem); overflow-wrap: normal; }
.widget-heading .count { display: inline-flex; padding: 1px 6px; margin-left: 2px; font-size: .75rem; }
.widget-heading a { font-size: .79rem; color: var(--panel-accent); text-decoration: none; text-align: right; }
.widget-heading a:hover { text-decoration: underline; }
@container (max-width: 205px) {
    .widget-heading { grid-template-columns: auto minmax(0, 1fr); }
    .widget-heading a { grid-column: 2; text-align: left; }
}
.widget-card .tile-icon { width: 34px; height: 34px; border-radius: 9px; }
.widget-card .tile-icon .glyph { width: 18px; height: 18px; }
.widget-add { margin-bottom: 10px; }
.widget-add input { background: var(--panel-tint); border-color: var(--panel-outline); }
.widget-add button {
    width: 44px;
    padding: 0;
    background: var(--pale);
    border: 1px solid var(--panel-outline);
    color: var(--panel-accent);
}
.widget-add button .glyph { display: block; }
.widget-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    min-height: 54px;
    border-top: 1px solid var(--line);
}
.widget-row > form { margin: 0; min-width: 0; }
.widget-row .widget-check {
    display: flex;
    justify-content: flex-start;
    gap: 9px;
    text-align: left;
    min-height: 54px;
    width: 100%;
    padding: 7px 6px;
    background: transparent;
    color: var(--ink);
    font-weight: 600;
}
.widget-item-copy { min-width: 0; overflow-wrap: anywhere; }
.widget-item-copy strong, .widget-item-copy small { display: block; }
.widget-item-copy small { margin-top: 3px; font-weight: 450; }
.widget-item-icon { flex-shrink: 0; line-height: 1; }
.widget-check > .glyph { width: 19px; height: 19px; color: var(--panel-accent); }
.widget-check:hover, .widget-remove:hover { background: var(--panel-hover, var(--pale)); filter: none; }
.widget-remove { min-width: 44px; min-height: 44px; padding: 0; background: transparent; color: var(--muted); }
.widget-remove .glyph { width: 15px; height: 15px; }
.widget-empty { color: var(--muted); font-size: .9rem; }
.widget-check .widget-urgent { color: #91362b; }
.dashboard-feedback, .wall-feedback {
    position: fixed;
    bottom: max(14px, env(safe-area-inset-bottom));
    right: clamp(12px, 2vw, 28px);
    z-index: 6;
    max-width: min(36rem, calc(100vw - 24px));
    padding: 10px 15px;
    border-radius: 9px;
    background: #23473a;
    color: #f4faf5;
    box-shadow: 0 3px 16px #14282135;
}
.dashboard-feedback:empty, .wall-feedback:empty { display: none; }
.settings-shortcuts { margin-bottom: 18px; }
.settings-shortcuts a { text-decoration: none; min-height: 36px; display: inline-flex; align-items: center; }
.setup-steps { display: grid; gap: 7px; padding-inline-start: 1.4rem; }
.attachment-list { margin: 0; padding-left: 1.2em; }
#email-hospital { scroll-margin-top: 12px; }
#email-hospital .line > a { min-width: 0; overflow-wrap: anywhere; }
#email-hospital .line > label { flex-shrink: 0; }

.home-dashboard .dashboard-grid { align-items: start; }
.home-dashboard { display: flex; flex-direction: column; gap: 18px; }
.home-dashboard .dashboard-grid { margin-top: 0; }
.home-dashboard .home-hero { order: -1; }
.home-dashboard .home-hero {
    align-items: center;
    padding: clamp(17px, 2.4vw, 34px);
    border-radius: 17px;
}
.home-hero h1 { font-size: clamp(2.1rem, 3.6vw, 3.35rem); margin: 6px 0 0; }
.home-hero .eyebrow, .home-hero .weather small { color: var(--muted); }
.home-hero .weather { background: var(--white); border-color: var(--line); }
@media (max-width: 760px) {
    .dashboard-feedback { bottom: calc(67px + env(safe-area-inset-bottom)); }
    .home-dashboard .home-hero { align-items: flex-start; order: 1; }
    .home-devices .device-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 148px), 1fr)); }
    .home-devices .device { height: 100px; grid-template-rows: minmax(34px, auto) 44px; }
    .home-devices .device-tap { grid-template-rows: 1fr; }
}

.catalog-trigger {
    width: 100%;
    justify-content: flex-start;
    gap: 8px;
    margin-bottom: 10px;
    background: var(--pale);
    border-color: var(--panel-outline);
    color: var(--panel-accent);
}
.catalog-trigger .glyph { width: 17px; height: 17px; }
.catalog-dialog {
    width: min(760px, calc(100% - 28px));
    max-height: min(88dvh, 760px);
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 17px;
    background: var(--white);
    color: var(--ink);
    box-shadow: 0 18px 54px #172a2440;
    overflow: auto;
    overscroll-behavior: contain;
}
.catalog-dialog::backdrop { background: #182b2370; }
.catalog-dialog-header {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px clamp(14px, 2.5vw, 24px);
    border-bottom: 1px solid var(--line);
    background: var(--white);
}
.catalog-dialog-header button { min-width: 44px; min-height: 44px; padding: 0; }
.catalog-dialog .catalog-panel { padding: 16px clamp(14px, 2.5vw, 24px) 24px; }
.catalog-dialog .quick-entry button { background: var(--pale); color: var(--green); border-color: var(--line); }
.catalog-dialog .product-grid { max-height: none; overflow: visible; }
.catalog-dialog [data-shopping-status]:not(:empty) {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip-path: none;
    white-space: normal;
    margin-top: 10px;
    font-size: .9rem;
}

.mail-coverage-form { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; margin: 0 0 8px; }
.mail-coverage-form label { min-width: min(100%, 185px); }
