body {
    --page-content-width: 100%;
    --page-gutter: 32px;
    margin: 0;
    min-height: 100%;
    background: #202124;
    color: white;
    font-family: Arial, Helvetica, sans-serif;
    overflow-x: hidden;
}

body:has(main.form-page),
body:has(main .hub-grid) {
    --page-content-width: 900px;
}

body:has(main .home-grid),
body:has(main .status-grid) {
    --page-content-width: 980px;
}

body:has(main .status-history-card) {
    --page-content-width: 1038px;
}

html {
    min-height: 100%;
    overflow-x: hidden;
}

html.sleep-active,
html.sleep-active body {
    overflow: hidden;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-block: 24px;
    padding-inline: max(
        var(--page-gutter),
        calc((100% - var(--page-content-width)) / 2)
    );
    border-bottom: 1px solid #3a3b3c;
}

.logo {
    font-size: 32px;
    font-weight: bold;
}

.header-brand {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    min-width: 0;
}

.header-right {
    display: flex;
    gap: 20px;
    align-items: center;
}

.clock {
    font-size: 22px;
    color: #ffffff;
}

.version {
    color: #ffd54f;
    font-size: 18px;
}

.dashboard {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    padding: 32px;
}

.home-page,
.hub-page {
    padding: 32px;
}

.home-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    max-width: 980px;
    margin: 0 auto;
}

.home-tile,
.home-tile:visited {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    overflow: hidden;
    box-sizing: border-box;
    min-height: 7.5rem;
    padding: 1.5rem 1.4rem 1.5rem 1.7rem;
    border: 1px solid #3a3b3c;
    border-radius: 14px;
    background:
        radial-gradient(circle at 100% 0, rgba(255, 213, 79, 0.07), transparent 42%),
        #2b2c2f;
    color: #ffffff;
    text-decoration: none;
    transition: border-color 140ms ease, background-color 140ms ease, transform 140ms ease;
}

.home-tile::before {
    content: "";
    position: absolute;
    top: 1.35rem;
    bottom: 1.35rem;
    left: 0;
    width: 0.22rem;
    border-radius: 0 999px 999px 0;
    background: #ffd54f;
}

.home-tile::after {
    content: "→";
    display: grid;
    width: 2.35rem;
    height: 2.35rem;
    place-items: center;
    border: 1px solid rgba(255, 213, 79, 0.28);
    border-radius: 50%;
    color: #ffd54f;
    font-size: 1.15rem;
    transition: border-color 140ms ease, background-color 140ms ease, transform 140ms ease;
}

.hub-card,
.hub-card:visited {
    display: grid;
    gap: 0.65rem;
    box-sizing: border-box;
    min-height: 10rem;
    padding: 1.4rem;
    border: 1px solid #3a3b3c;
    border-radius: 14px;
    background: #2b2c2f;
    color: #ffffff;
    text-decoration: none;
}

.home-tile:hover,
.home-tile:focus {
    border-color: rgba(255, 213, 79, 0.72);
    background-color: #303136;
    outline: none;
    transform: translateY(-2px);
}

.home-tile:hover::after,
.home-tile:focus::after {
    border-color: rgba(255, 213, 79, 0.72);
    background: rgba(255, 213, 79, 0.1);
    transform: translateX(0.15rem);
}

.hub-card:hover,
.hub-card:focus {
    border-color: rgba(255, 213, 79, 0.7);
    background: #303136;
    outline: none;
}

.home-tile strong,
.hub-card strong {
    font-size: 1.65rem;
}

.hub-card span {
    color: #cfcfcf;
    line-height: 1.35;
}

.home-secondary-link {
    max-width: 980px;
    margin: 1.2rem auto 0;
}

.home-secondary-link a,
.home-secondary-link a:visited {
    color: #ffd54f;
}

.hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(14rem, 100%), 1fr));
    gap: 1rem;
    width: 100%;
    max-width: 900px;
    min-width: 0;
    margin: 0 auto;
}

.hub-muted {
    color: #cfcfcf;
}

.quick-reading-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
    gap: 1rem;
    max-width: 900px;
    margin: 1rem auto 0;
}

.quick-reading-card h2 {
    margin-bottom: 1rem;
}

.quick-reading-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
}

.quick-reading-fields label {
    display: grid;
    gap: 0.35rem;
    color: #cfcfcf;
}

.quick-reading-fields input,
.quick-reading-fields textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 0.6rem;
    border: 1px solid #3a3b3c;
    border-radius: 6px;
}

.quick-reading-notes {
    grid-column: 1 / -1;
}

.card {
    background: #2b2c2f;
    border: 1px solid #3a3b3c;
    border-radius: 18px;
    padding: 28px;
    min-height: 130px;
    min-width: 0;
}

.card h2 {
    margin-top: 0;
    font-size: 28px;
}

.energy-chart-card {
    min-height: 340px;
}

.chart-wrapper {
    position: relative;
    height: 240px;
    width: 100%;
}

.chart-wrapper canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

.current-price {
    font-size: 24px;
    font-weight: bold;
    color: #ffd54f;
    margin-bottom: 12px;
}

.energy-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.stat-label {
    font-size: 14px;
    color: #cfcfcf;
    text-transform: uppercase;
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
    color: #ffd54f;
    margin-top: 6px;
}

.stat-time {
    font-size: 14px;
    color: #ffd54f;
    margin-top: 4px;
}

.stat-value.low,
.stat-time.low {
    color: #7cb342;
}

.stat-value.high,
.stat-time.high {
    color: #f44336;
}

/* Sleep screen */

.sleep-screen {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: #000;
    color: #f4ead7;
    display: none;
    align-items: center;
    justify-content: center;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    touch-action: manipulation;
    user-select: none;
    overflow: hidden;
}

.sleep-screen.active {
    display: flex;
}

.sleep-content {
    text-align: center;
    transform: translateY(-2vh);
}

.sleep-clock {
    font-size: clamp(6rem, 19vw, 13rem);
    font-weight: 200;
    letter-spacing: 0.04em;
    line-height: 1;
    color: #f7f2e8;
    text-shadow: 0 0 18px rgba(255, 255, 255, 0.08);
}

.sleep-date {
    margin-top: 1rem;
    font-size: clamp(1.8rem, 5vw, 3.8rem);
    font-weight: 300;
    color: #cfc7b7;
}

.sun-events {
    margin-top: 3rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4rem;
}

.sun-event {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    min-width: 260px;
    text-align: left;
}

.sun-event.secondary {
    opacity: 0.75;
}

.sun-icon {
    font-size: 3.4rem;
}

.sun-label {
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #f6bd60;
}

.sun-name {
    margin-top: 0.25rem;
    font-size: 2rem;
    font-weight: 300;
    color: #f4ead7;
}

.sun-time {
    margin-top: 0.2rem;
    font-size: 3rem;
    font-weight: 300;
    color: #f4ead7;
}

.sun-divider {
    width: 1px;
    height: 90px;
    background: rgba(255, 255, 255, 0.18);
}

.wake-hint {
    margin-top: 3rem;
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.25);
    letter-spacing: 0.05em;
}

/* Small screens */

@media (max-width: 500px) {
    .dashboard {
        grid-template-columns: 1fr;
    }

    .logo {
        font-size: 24px;
    }

    .sun-events {
        flex-direction: column;
        gap: 1.8rem;
    }

    .sun-divider {
        width: 160px;
        height: 1px;
    }
}

.price-usage-result {
    margin-top: 24px;
    padding: 24px;
    border-radius: 16px;
    background: rgba(255, 213, 79, 0.08);
    border: 1px solid rgba(255, 213, 79, 0.25);
    font-size: 28px;
    font-weight: bold;
    color: #ffd54f;
}

.price-usage-saving {
    margin-top: 12px;
    font-size: 18px;
    font-weight: normal;
    color: #cfcfcf;
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.header-navigation {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.header-navigation .button-link,
.header-navigation .button-link:visited {
    flex: 0 0 6.4rem;
    width: 6.4rem;
}

.button-link,
.button-link:visited {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.4rem;
    box-sizing: border-box;
    padding: 0.65rem 0.9rem;
    border: 1px solid rgba(255, 213, 79, 0.45);
    border-radius: 6px;
    background: rgba(255, 213, 79, 0.12);
    color: #ffd54f;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    font: inherit;
}

.button-link:hover,
.button-link:focus {
    background: rgba(255, 213, 79, 0.2);
    border-color: rgba(255, 213, 79, 0.75);
    outline: none;
}

.compact-button,
.compact-button:visited {
    min-height: 2rem;
    padding: 0.45rem 0.65rem;
    font-size: 0.85rem;
}

.charging-months {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.75rem;
}

.charging-month-row {
    display: grid;
    grid-template-columns: minmax(8rem, 1.2fr) repeat(2, minmax(7rem, 1fr));
    align-items: start;
    gap: 1rem;
    padding: 0.75rem 0;
    border-top: 1px solid #3a3b3c;
}

.charging-month {
    color: #ffffff;
    font-weight: 700;
}

.charging-kwh {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.charging-kwh,
.charging-cost,
.charging-sessions {
    font-variant-numeric: tabular-nums;
}

@media (max-width: 500px) {
    .charging-month-row {
        grid-template-columns: 1fr;
    }
}

.form-page {
    padding: 32px;
    max-width: 900px;
    margin: 0 auto;
}

.simple-form input,
.simple-form textarea,
.simple-form select {
    width: min(100%, 24rem);
    box-sizing: border-box;
    padding: 0.6rem;
    border: 1px solid #3a3b3c;
    border-radius: 6px;
}

.simple-form input[type="checkbox"] {
    width: auto;
    padding: 0;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.45rem;
}

.simple-form button {
    padding: 0.7rem 1rem;
}

.inline-form {
    display: inline;
}

.inline-form button {
    padding: 0.35rem 0.6rem;
}

.status-message,
.error-message {
    padding: 0.85rem 1rem;
    border-radius: 6px;
}

.status-feedback {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    width: 100%;
    max-width: 980px;
    box-sizing: border-box;
    margin: 1rem auto 0;
    padding: 0.75rem 1rem;
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: 0.9rem;
}

.status-feedback[hidden] {
    display: none;
}

.status-feedback.is-error {
    background: rgba(244, 67, 54, 0.1);
    border-color: rgba(244, 67, 54, 0.32);
    color: #ffb0aa;
}

.status-feedback.is-success {
    background: rgba(124, 179, 66, 0.1);
    border-color: rgba(124, 179, 66, 0.32);
    color: #c8e89d;
}

.status-feedback-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.45rem;
    height: 1.45rem;
    flex: 0 0 auto;
    border: 1px solid currentColor;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 800;
}

.status-message {
    background: rgba(124, 179, 66, 0.16);
    border: 1px solid rgba(124, 179, 66, 0.45);
    color: #b7e17a;
}

.error-message {
    background: rgba(244, 67, 54, 0.14);
    border: 1px solid rgba(244, 67, 54, 0.45);
    color: #ff9c95;
}

.section-header-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.section-header-row h2 {
    margin-bottom: 0;
}

.charging-add-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
    gap: 1rem;
    align-items: end;
}

.charging-add-form label {
    display: grid;
    gap: 0.35rem;
    color: #cfcfcf;
}

.charging-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.inline-edit-form {
    margin: 0;
}

.inline-edit-form input,
.charging-history-table input {
    width: 5.8rem;
    box-sizing: border-box;
    padding: 0.35rem 0.45rem;
    border: 1px solid #3a3b3c;
    border-radius: 6px;
}

.charging-history-table {
    min-width: 42rem;
    margin-top: 1rem;
    color: #9fa1a5;
    font-size: 0.78rem;
    font-weight: 400;
    font-variant-numeric: tabular-nums;
}

.data-table.charging-history-table th,
.data-table.charging-history-table td {
    padding: 0.55rem 0.65rem;
    color: inherit;
    font: inherit;
    font-variant-numeric: inherit;
}

.data-table.charging-history-table th {
    border-bottom-color: #3a3b3c;
}

.charging-actions button {
    min-height: 1.7rem;
    padding: 0.25rem 0.55rem;
    border: 1px solid #484a4e;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
    color: #bfc1c5;
    font: inherit;
    line-height: 1;
    cursor: pointer;
}

.charging-actions button:hover,
.charging-actions button:focus-visible {
    border-color: rgba(255, 213, 79, 0.65);
    background: rgba(255, 213, 79, 0.12);
    color: #d8d8d8;
    outline: none;
}

.date-picker-form {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: end;
}

.date-picker-form label {
    display: grid;
    gap: 0.35rem;
    color: #cfcfcf;
}

.consumption-day-table {
    margin-top: 1.25rem;
}

.freezer-note-field {
    display: block;
    width: 100%;
    box-sizing: border-box;
    min-height: 2.4rem;
    padding: 0.45rem 0.55rem;
    border: 1px solid #3a3b3c;
    border-radius: 6px;
    resize: vertical;
    background: #202124;
    color: #ffffff;
}

.freezer-list {
    display: grid;
    gap: 0.55rem;
    margin-top: 1rem;
}

.view-toggle {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin: 1rem 0;
}

.button-link.active-view {
    background: rgba(255, 213, 79, 0.26);
    border-color: rgba(255, 213, 79, 0.85);
}

.freezer-item-row {
    display: grid;
    grid-template-columns: 4.5rem minmax(0, 1fr) auto;
    gap: 0.85rem;
    align-items: center;
    padding: 0.75rem;
    border: 1px solid #3a3b3c;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.025);
}

.freezer-number {
    color: #ffd54f;
    font-size: 1.35rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.freezer-item-main {
    min-width: 0;
}

.freezer-item-header {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 0.8rem;
    align-items: baseline;
    margin-bottom: 0.45rem;
}

.freezer-item-name {
    font-size: 1.05rem;
}

.freezer-item-meta {
    color: #cfcfcf;
    font-size: 0.9rem;
}

.freezer-note-row {
    max-width: 42rem;
}

.freezer-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.45rem;
}

.freezer-group-list {
    display: grid;
    gap: 0.65rem;
    margin-top: 1rem;
}

.freezer-group {
    border: 1px solid #3a3b3c;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.025);
    overflow: hidden;
}

.freezer-group summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1rem;
    cursor: pointer;
    list-style: none;
}

.freezer-group summary::-webkit-details-marker {
    display: none;
}

.freezer-group summary::before {
    content: "›";
    color: #ffd54f;
    font-size: 1.35rem;
    line-height: 1;
    transform: rotate(0deg);
    transition: transform 120ms ease;
}

.freezer-group[open] summary::before {
    transform: rotate(90deg);
}

.freezer-group-name {
    flex: 1;
    font-size: 1.05rem;
    font-weight: 700;
}

.freezer-group-count {
    color: #cfcfcf;
    font-size: 0.9rem;
}

.freezer-group-items {
    display: grid;
    gap: 0.45rem;
    padding: 0 0.75rem 0.75rem;
}

.freezer-package-row {
    display: grid;
    grid-template-columns: 4.5rem minmax(0, 1fr) auto;
    gap: 0.85rem;
    align-items: center;
    padding: 0.65rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.fridge-page {
    display: grid;
    gap: 24px;
}

.fridge-add-form {
    display: grid;
    grid-template-columns: max-content minmax(12rem, 1fr) max-content auto;
    gap: 1rem;
    align-items: end;
}

.fridge-add-form label {
    display: grid;
    gap: 0.35rem;
    color: #cfcfcf;
}

.fridge-add-form input {
    box-sizing: border-box;
    width: 100%;
}

.fridge-add-form input[type="date"] {
    width: 10.5rem;
}

.form-error {
    color: #ff9c95;
}

.fridge-list {
    display: grid;
    gap: 0.65rem;
    margin-top: 1rem;
}

.fridge-item {
    display: grid;
    grid-template-columns: minmax(9rem, 1fr) minmax(20rem, 2fr) auto;
    gap: 1rem;
    align-items: center;
    padding: 0.85rem;
    border: 1px solid #3a3b3c;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.025);
}

.fridge-item-expired {
    border-color: #b83b36;
    background: rgba(184, 59, 54, 0.2);
    color: #ff9c95;
}

.fridge-item-name {
    font-size: 1.05rem;
    font-weight: 700;
}

.fridge-item-dates {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr));
    gap: 0.75rem;
    margin: 0;
}

.fridge-item-dates dt {
    color: #aeb0b4;
    font-size: 0.78rem;
}

.fridge-item-dates dd {
    margin: 0.15rem 0 0;
    font-variant-numeric: tabular-nums;
}

.fridge-item-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
}

.fridge-item-actions form {
    margin: 0;
}

.fridge-open-form {
    display: grid;
    gap: 1rem;
    max-width: 28rem;
    margin-top: 1rem;
}

.fridge-open-form label {
    display: grid;
    gap: 0.35rem;
    color: #cfcfcf;
}

.fridge-open-form input {
    box-sizing: border-box;
    width: 7rem;
}

.shelf-life-standards-page {
    max-width: 58rem;
}

.shelf-life-standard-list {
    display: grid;
    gap: 0.55rem;
    margin-top: 1rem;
}

.shelf-life-standard-item {
    display: grid;
    grid-template-columns: minmax(9rem, 1fr) auto auto;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem;
    border: 1px solid #3a3b3c;
    border-radius: 0.55rem;
    background: rgba(255, 255, 255, 0.025);
}

.shelf-life-standard-edit,
.shelf-life-standard-edit label {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0;
}

.shelf-life-standard-item form {
    margin: 0;
}

.shelf-life-standard-edit input {
    box-sizing: border-box;
    width: 4.5rem;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 800px) {
    .fridge-add-form,
    .fridge-item,
    .fridge-item-dates {
        grid-template-columns: 1fr;
    }

    .fridge-item-actions {
        justify-content: stretch;
    }

    .fridge-item-actions form,
    .fridge-item-actions button {
        flex: 1 1 0;
        width: 100%;
    }

    .shelf-life-standard-item {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .shelf-life-standard-item > strong {
        grid-column: 1 / -1;
    }
}

.recipe-groups {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}

.recipe-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0;
}

.recipe-category-color-0 {
    --recipe-category-color: #72b7ff;
    --recipe-category-background: rgba(114, 183, 255, 0.12);
}

.recipe-category-color-1 {
    --recipe-category-color: #b7e17a;
    --recipe-category-background: rgba(183, 225, 122, 0.12);
}

.recipe-category-color-2 {
    --recipe-category-color: #ffd54f;
    --recipe-category-background: rgba(255, 213, 79, 0.12);
}

.recipe-category-color-3 {
    --recipe-category-color: #ff9c95;
    --recipe-category-background: rgba(255, 156, 149, 0.12);
}

.recipe-category-color-4 {
    --recipe-category-color: #c7a7ff;
    --recipe-category-background: rgba(199, 167, 255, 0.12);
}

.recipe-category-color-5 {
    --recipe-category-color: #ffbf69;
    --recipe-category-background: rgba(255, 191, 105, 0.12);
}

.recipe-category-color-6 {
    --recipe-category-color: #73daca;
    --recipe-category-background: rgba(115, 218, 202, 0.12);
}

.recipe-category-color-7 {
    --recipe-category-color: #f78fb3;
    --recipe-category-background: rgba(247, 143, 179, 0.12);
}

.recipe-filter,
.recipe-filter:visited {
    border-color: color-mix(in srgb, var(--recipe-category-color) 55%, transparent);
    background: var(--recipe-category-background);
    color: var(--recipe-category-color);
}

.recipe-filter:hover,
.recipe-filter:focus-visible,
.recipe-filter.active-view {
    border-color: var(--recipe-category-color);
    background: color-mix(in srgb, var(--recipe-category-color) 22%, transparent);
    color: #ffffff;
}

.recipe-group {
    overflow: hidden;
    border: 1px solid #3a3b3c;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.025);
}

.recipe-group-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.8rem 1rem;
    border-left: 0.3rem solid var(--recipe-category-color);
    background: var(--recipe-category-background);
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.recipe-group-heading::-webkit-details-marker {
    display: none;
}

.recipe-group[open] > .recipe-group-heading {
    border-bottom: 1px solid #3a3b3c;
}

.recipe-group-title {
    margin: 0;
    font-size: 1.17rem;
}

.recipe-group-meta {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--recipe-category-color);
    font-variant-numeric: tabular-nums;
}

.recipe-group-chevron {
    font-size: 1.6rem;
    line-height: 1;
    transition: transform 140ms ease;
}

.recipe-group[open] .recipe-group-chevron {
    transform: rotate(90deg);
}

.recipe-list {
    display: grid;
}

.recipe-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1rem;
}

.recipe-row + .recipe-row {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.recipe-content {
    min-width: 0;
}

.recipe-content strong {
    font-size: 1.05rem;
}

.recipe-content p {
    margin: 0.35rem 0 0;
    color: #cfcfcf;
    white-space: pre-line;
}

.recipe-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
}

.recipe-action-button,
.recipe-action-button:visited,
.recipe-delete-form {
    flex: 0 0 8.5rem;
    width: 8.5rem;
}

.recipe-action-button,
.recipe-action-button:visited {
    min-height: 2.4rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #3a3b3c;
    text-align: left;
}

.heating-chart-section {
    margin: 1.5rem 0 2rem;
}

.heating-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.heating-chart-section h3 {
    margin-bottom: 0.25rem;
    font-size: 1.4rem;
}

.chart-subtitle,
.chart-explanation {
    color: #cfcfcf;
}

.heating-chart-wrapper {
    height: 320px;
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
    gap: 1rem;
    max-width: 980px;
    margin: 0 auto;
}

.status-page-links {
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
    max-width: 980px;
    margin: 0 auto 1rem;
}

.status-page-links .button-link {
    box-sizing: border-box;
    width: 7.5rem;
    text-align: center;
}

.motion-rule-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
    padding: 0.9rem 0.7rem 0;
    border-top: 1px solid #3a3b3c;
}

.motion-rule-panel form {
    margin: 0;
}

.motion-rule-toggle {
    min-width: 6.8rem;
    font: inherit;
}

.camera-card {
    overflow: hidden;
}

.camera-recordings-card {
    overflow: hidden;
}

.camera-frame {
    display: grid;
    place-items: center;
    overflow: hidden;
    min-height: 18rem;
    margin-top: 1rem;
    border: 1px solid #3a3b3c;
    border-radius: 14px;
    background: #171819;
}

.camera-frame img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
}

.camera-error {
    padding: 2rem;
    color: #ff9c95;
    text-align: center;
}

.camera-note {
    margin: 0.8rem 0 0;
    text-align: center;
}

.recording-player-shell {
    margin-top: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #3a3b3c;
}

.recording-player-heading,
.recording-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.recording-player-shell video {
    display: block;
    width: 100%;
    max-height: 36rem;
    margin-top: 0.8rem;
    border-radius: 12px;
    background: #000;
}

.recording-list {
    margin-top: 0.6rem;
}

.recording-row {
    padding: 0.8rem 0;
    border-bottom: 1px solid #3a3b3c;
}

.recording-row:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.recording-row > div {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

@media (max-width: 620px) {
    .camera-frame {
        min-height: 12rem;
        margin-right: -0.35rem;
        margin-left: -0.35rem;
    }

    .recording-row {
        align-items: flex-start;
    }

    .status-page-links .button-link {
        flex: 1;
        width: auto;
        min-width: 0;
    }

}

.presence-control {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
    max-width: 980px;
    margin: 0 auto 1rem;
    padding: 0.8rem 1rem;
    border: 1px solid #3a3b3c;
    border-radius: 14px;
    background: #292a2c;
}

.presence-control-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.presence-registration-row {
    padding-top: 0.8rem;
    border-top: 1px solid #3a3b3c;
}

.presence-registration-button {
    width: 11.5rem;
}

.presence-registration-button:disabled {
    cursor: default;
    opacity: 0.42;
}

.registration-on {
    color: #b7e17a;
}

.registration-off {
    color: #ff9c95;
}

.presence-summary {
    display: flex;
    align-items: baseline;
    gap: 0.55rem;
}

.presence-source {
    color: #9fa1a5;
    font-size: 0.78rem;
}

.presence-actions {
    display: flex;
    gap: 0.55rem;
}

.presence-actions form {
    margin: 0;
}

.presence-button {
    width: 7.5rem;
}

.presence-button.is-away {
    border-color: rgba(255, 156, 149, 0.65);
}

.presence-button.is-home {
    border-color: rgba(183, 225, 122, 0.65);
}

.rules-page-card,
.action-log-card {
    display: grid;
    gap: 1rem;
}

.rules-page-header {
    min-height: 1.8rem;
    justify-content: flex-end;
}

.status-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.camera-status-name {
    display: grid;
    gap: 0.15rem;
}

.camera-status-name .hub-muted {
    font-size: 0.78rem;
}

.geofencing-card {
    grid-column: 1 / -1;
}

.action-log-card {
    grid-column: 1 / -1;
}

.action-log-list {
    display: grid;
    grid-template-columns: repeat(6, max-content);
    width: max-content;
}

.action-log-table {
    overflow-x: auto;
}

.action-log-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.action-log-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.45rem;
}

.action-log-toolbar-actions .button-link {
    min-height: 1.7rem;
    padding: 0.3rem 0.65rem;
    font-size: 0.78rem;
}

.action-log-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.action-log-filters button {
    --log-filter-color: #d8d8d8;
    --log-filter-border: rgba(216, 216, 216, 0.55);
    --log-filter-background: rgba(216, 216, 216, 0.12);
    min-height: 1.7rem;
    padding: 0.25rem 0.55rem;
    border: 1px solid #484a4e;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
    color: #9fa1a5;
    font: inherit;
    font-size: 0.78rem;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    cursor: pointer;
}

.action-log-filters button[data-log-filter="all"],
.action-log-filters button[data-log-filter="schedule"] {
    --log-filter-color: #e0b84f;
    --log-filter-border: rgba(224, 184, 79, 0.65);
    --log-filter-background: rgba(224, 184, 79, 0.15);
}

.action-log-filters button[data-log-filter="geofence"] {
    --log-filter-color: #72b7ff;
    --log-filter-border: rgba(114, 183, 255, 0.65);
    --log-filter-background: rgba(114, 183, 255, 0.15);
}

.action-log-filters button[data-log-filter="manual"] {
    --log-filter-color: #b7e17a;
    --log-filter-border: rgba(183, 225, 122, 0.6);
    --log-filter-background: rgba(183, 225, 122, 0.13);
}

.action-log-filters button[data-log-filter="device_status"] {
    --log-filter-color: #d8d8d8;
    --log-filter-border: rgba(216, 216, 216, 0.55);
    --log-filter-background: rgba(216, 216, 216, 0.1);
}

.action-log-filters button[data-log-filter="system"] {
    --log-filter-color: #ffbf69;
    --log-filter-border: rgba(255, 191, 105, 0.65);
    --log-filter-background: rgba(255, 191, 105, 0.15);
}

.action-log-filters button[data-log-filter="postkasse"] {
    --log-filter-color: #ff6b64;
    --log-filter-border: rgba(255, 107, 100, 0.7);
    --log-filter-background: rgba(255, 107, 100, 0.16);
}

.action-log-filters button[data-log-filter="camera"] {
    --log-filter-color: #c99a32;
    --log-filter-border: rgba(201, 154, 50, 0.7);
    --log-filter-background: rgba(201, 154, 50, 0.16);
}

.action-log-filters button:hover,
.action-log-filters button:focus-visible {
    border-color: var(--log-filter-border);
    color: var(--log-filter-color);
    outline: none;
}

.action-log-filters button.is-active {
    border-color: var(--log-filter-border);
    background: var(--log-filter-background);
    color: var(--log-filter-color);
}

.action-log-row[hidden],
.action-log-filter-empty[hidden] {
    display: none;
}

.action-log-head,
.action-log-row {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: subgrid;
    align-items: center;
    column-gap: 0.25rem;
    padding: 0.55rem 0.2rem;
    border-top: 1px solid #3a3b3c;
    color: #9fa1a5;
    font-size: 0.78rem;
    font-weight: 400;
    font-variant-numeric: tabular-nums;
}

.action-log-head {
    border-top: 0;
    color: #9fa1a5;
}

.action-log-row time {
    color: inherit;
}

.action-log-description {
    font-weight: inherit;
}

.action-log-row.is-tænd {
    color: #b7e17a;
}

.action-log-row.is-sluk {
    color: #ff9c95;
}

.action-log-description.is-online {
    color: #b7e17a;
}

.action-log-description.is-offline {
    color: #ffbf69;
}

.action-log-row.is-ankomst,
.action-log-row.is-afgang {
    color: #72b7ff;
}

.action-log-row.is-startet,
.action-log-row.is-lukker-ned {
    color: #ffbf69;
}

.action-log-row.is-postkasse {
    color: #ff6b64;
}

.action-log-row.is-kamera {
    color: #c99a32;
}

.action-log-result {
    color: inherit;
}

.action-log-row.is-error .action-log-result,
.action-log-row.is-error small {
    color: inherit;
}

.action-log-row.is-error {
    border: 1px solid rgba(255, 92, 92, 0.75);
    border-left: 0.3rem solid #ff5c5c;
    border-radius: 0.35rem;
    background: rgba(184, 59, 54, 0.22);
    box-shadow: inset 0 0 0 1px rgba(255, 92, 92, 0.12);
}

.action-log-row small {
    grid-column: 3 / -1;
    font: inherit;
}

.geofencing-rule-list {
    display: grid;
}

.geofencing-rule-head,
.geofencing-rule-row {
    display: grid;
    grid-template-columns: minmax(11rem, 1.4fr) repeat(3, minmax(7.5rem, 1fr));
    align-items: center;
    gap: 1rem;
}

.geofencing-rule-head {
    padding: 0 0.75rem 0.55rem;
    color: #9fa1a5;
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.geofencing-rule-row {
    padding: 0.75rem;
    border-top: 1px solid #3a3b3c;
}

.geofencing-device {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.geofencing-device > div {
    display: grid;
    gap: 0.12rem;
}

.geofencing-device > div span {
    color: #9fa1a5;
    font-size: 0.78rem;
}

.geofencing-device-dot {
    width: 1.3rem;
    height: 1.3rem;
    flex: 0 0 auto;
    border: 2px solid rgba(255, 255, 255, 0.62);
    border-radius: 50%;
    background: var(--device-color, #ffffff);
    box-shadow: 0 0 8px color-mix(in srgb, var(--device-color, #ffffff) 45%, transparent);
}

.geofencing-device-dot.is-plug {
    border-color: rgba(255, 213, 79, 0.75);
    background: rgba(255, 213, 79, 0.18);
    box-shadow: none;
}

.geofencing-device-dot.is-camera {
    border-color: rgba(201, 154, 50, 0.85);
    background: #c99a32;
    box-shadow: 0 0 0.55rem rgba(201, 154, 50, 0.35);
}

.geofencing-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 6.8rem;
    padding: 0.38rem 0.7rem;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
}

.geofencing-action::-webkit-details-marker {
    display: none;
}

.geofencing-action-menu {
    position: relative;
    display: inline-block;
}

.geofencing-action-menu > form {
    position: absolute;
    top: calc(100% + 0.45rem);
    left: 0;
    z-index: 12;
    display: grid;
    width: 12.5rem;
    gap: 0.65rem;
    box-sizing: border-box;
    padding: 0.75rem;
    border: 1px solid #57595d;
    border-radius: 12px;
    background: #242528;
    box-shadow: 0 14px 35px rgba(0, 0, 0, 0.5);
}

.geofencing-action-menu.is-schedule > form {
    right: 0;
    left: auto;
}

.geofencing-action-menu > form > span,
.geofencing-action-menu label span {
    color: #c7c9cc;
    font-size: 0.76rem;
    font-weight: 700;
}

.geofencing-action-menu label {
    display: grid;
    gap: 0.35rem;
}

.geofencing-action-menu input[type="time"] {
    width: 100%;
    box-sizing: border-box;
    padding: 0.5rem 0.6rem;
    border: 1px solid #55575b;
    border-radius: 8px;
    background: #191a1c;
    color: #ffffff;
    color-scheme: dark;
    font: inherit;
}

.geofencing-action-choices {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.35rem;
}

.geofencing-action-choices button {
    padding: 0.42rem 0.3rem;
    border: 1px solid #55575b;
    border-radius: 8px;
    background: #303135;
    color: #ffffff;
    font: inherit;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
}

.geofencing-action-choices button.is-on {
    border-color: rgba(124, 179, 66, 0.6);
    color: #b7e17a;
}

.geofencing-action-choices button.is-off {
    border-color: rgba(244, 67, 54, 0.55);
    color: #ff9c95;
}

.geofencing-action.is-on {
    border-color: rgba(124, 179, 66, 0.55);
    background: rgba(124, 179, 66, 0.2);
    color: #b7e17a;
}

.geofencing-action.is-off {
    border-color: rgba(244, 67, 54, 0.5);
    background: rgba(244, 67, 54, 0.17);
    color: #ff9c95;
}

.geofencing-action.is-none {
    border-color: #4a4b4d;
    background: rgba(255, 255, 255, 0.04);
    color: #aeb0b3;
}

@media (max-width: 700px) {
    .action-log-toolbar {
        align-items: flex-start;
        flex-direction: column-reverse;
    }

    .geofencing-rule-head {
        display: none;
    }

    .geofencing-rule-row {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }

    .geofencing-device {
        grid-column: 1 / -1;
    }

    .geofencing-rule-cell::before {
        display: block;
        margin-bottom: 0.35rem;
        color: #9fa1a5;
        content: attr(data-label);
        font-size: 0.7rem;
        font-weight: 700;
    }

    .geofencing-action {
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    .geofencing-action-menu {
        display: block;
    }

    .geofencing-action-menu > form,
    .geofencing-action-menu.is-schedule > form {
        right: auto;
        left: 0;
    }
}

.status-history-card {
    max-width: 980px;
    margin: 0 auto;
}

.history-range-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.climate-sensor-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #3a3b3c;
}

.climate-sensor-button,
.climate-sensor-button:visited {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.4rem;
    padding: 0.5rem 0.9rem;
    border: 1px solid #4a4b4d;
    border-radius: 0.55rem;
    background: rgba(255, 255, 255, 0.035);
    color: #cfcfcf;
    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: none;
}

.climate-sensor-button:hover,
.climate-sensor-button:focus-visible,
.climate-sensor-button.is-active {
    border-color: rgba(255, 213, 79, 0.75);
    background: rgba(255, 213, 79, 0.16);
    color: #ffd54f;
    outline: none;
}

.history-range-button,
.history-range-button:visited {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2rem;
    box-sizing: border-box;
    padding: 0.4rem 0.7rem;
    border: 1px solid rgba(255, 213, 79, 0.35);
    border-radius: 999px;
    background: rgba(255, 213, 79, 0.08);
    color: #d8d8d8;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
}

.history-range-button:hover,
.history-range-button:focus-visible,
.history-range-button.is-active {
    border-color: rgba(255, 213, 79, 0.75);
    background: rgba(255, 213, 79, 0.2);
    color: #ffd54f;
    outline: none;
}

.climate-extremes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.climate-extreme-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 0.85rem;
    padding: 0.8rem 1rem;
    border: 1px solid #3a3b3c;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.025);
}

.climate-extreme-card.temperature strong {
    color: #f6bd60;
}

.climate-extreme-card.humidity strong {
    color: #60a5fa;
}

.climate-extreme-card span {
    color: #e3e3e3;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 620px) {
    .climate-extremes {
        grid-template-columns: 1fr;
    }

    .climate-extreme-card {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .climate-extreme-card strong {
        grid-column: 1 / -1;
    }
}

.status-card-header,
.status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.status-card-header h2 {
    margin: 0;
}

.status-card-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.6rem;
}

.status-card-header-actions form {
    margin: 0;
}

.status-values {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.pi-temperature {
    display: grid;
    gap: 0.25rem;
}

.pi-temperature small {
    color: #9fa1a5;
    font-size: 0.75rem;
}

.pi-status-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #3a3b3c;
}

.pi-status-grid > div {
    display: grid;
    gap: 0.2rem;
    min-width: 0;
}

.pi-status-grid small {
    color: #9fa1a5;
    font-size: 0.75rem;
}

.diskstation-status-card .pi-status-grid strong {
    overflow-wrap: anywhere;
}

.status-pill.warning {
    color: #ffd43b;
    background: rgba(255, 212, 59, 0.15);
}

.status-list {
    display: grid;
    gap: 0.75rem;
}

.status-row {
    padding: 0.75rem 0;
    border-top: 1px solid #3a3b3c;
}

.status-row div {
    display: grid;
    gap: 0.25rem;
    min-width: 0;
}

.status-row span {
    color: #cfcfcf;
}

.plug-control {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
}

.plug-control form {
    margin: 0;
}

.hue-light-name {
    display: flex !important;
    flex-direction: row;
    align-items: center;
    gap: 0.65rem !important;
}

.hue-color-button {
    display: inline-block;
    width: 1.55rem;
    height: 1.55rem;
    padding: 0;
    flex: 0 0 auto;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-radius: 999px;
    background: #777;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.06);
    cursor: pointer;
}

.hue-color-button.has-color {
    background: var(--hue-color);
    box-shadow: 0 0 10px color-mix(in srgb, var(--hue-color) 65%, transparent);
}

.hue-color-button:hover,
.hue-color-button:focus-visible {
    border-color: #ffffff;
    outline: none;
    transform: scale(1.08);
}

.hue-color-button:disabled,
.hue-color-button.is-disabled {
    cursor: not-allowed;
    opacity: 0.72;
    transform: none;
}

.hue-appearance-dialog {
    width: min(90vw, 24rem);
    padding: 0;
    border: 1px solid #4a4b4d;
    border-radius: 16px;
    background: #292a2d;
    color: #ffffff;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
}

.hue-appearance-dialog::backdrop {
    background: rgba(0, 0, 0, 0.68);
    backdrop-filter: blur(2px);
}

.hue-appearance-dialog form {
    display: grid;
    gap: 1.2rem;
    padding: 1.25rem;
}

.hue-dialog-header,
.hue-dialog-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.hue-dialog-header h3 {
    margin: 0.15rem 0 0;
}

.hue-dialog-close {
    width: 2.2rem;
    height: 2.2rem;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    font-size: 1.4rem;
    cursor: pointer;
}

.hue-brightness-field {
    display: grid;
    gap: 0.55rem;
    font-weight: 700;
}

.hue-color-preview {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.75rem;
    border: 1px solid #45474b;
    border-radius: 12px;
    background: #222326;
}

.hue-color-preview-dot {
    width: 3rem;
    height: 3rem;
    flex: 0 0 auto;
    border: 2px solid rgba(255, 255, 255, 0.75);
    border-radius: 50%;
    background: var(--preview-color);
    box-shadow: 0 0 18px color-mix(in srgb, var(--preview-color) 55%, transparent);
}

.hue-color-preview strong {
    display: block;
    margin-top: 0.1rem;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.hue-color-presets {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.65rem;
}

.hue-color-preset {
    display: grid;
    place-items: center;
    aspect-ratio: 1;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    cursor: pointer;
}

.hue-color-preset span {
    width: 1.8rem;
    height: 1.8rem;
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: 50%;
    background: var(--preset-color);
    box-shadow: 0 0 10px color-mix(in srgb, var(--preset-color) 45%, transparent);
}

.hue-color-preset:hover,
.hue-color-preset:focus-visible,
.hue-color-preset.is-selected {
    border-color: #ffd54f;
    outline: none;
    background: rgba(255, 213, 79, 0.12);
}

.hue-custom-picker {
    border: 1px solid #45474b;
    border-radius: 12px;
    background: #222326;
    overflow: hidden;
}

.hue-custom-picker summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 0.9rem;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
}

.hue-custom-picker summary::-webkit-details-marker {
    display: none;
}

.hue-custom-picker-swatch {
    width: 2.3rem;
    height: 2.3rem;
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    background: var(--custom-color);
    box-shadow: 0 0 10px color-mix(in srgb, var(--custom-color) 50%, transparent);
}

.hue-picker-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem;
    margin: 0 0.8rem 0.8rem;
    padding: 0.25rem;
    border-radius: 999px;
    background: #17181a;
}

.hue-picker-tabs button {
    padding: 0.45rem 0.6rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #bfc1c4;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
}

.hue-picker-tabs button.is-active {
    background: #4b4d51;
    color: #ffffff;
}

.hue-picker-surface {
    position: relative;
    width: min(16rem, calc(100% - 1.6rem));
    aspect-ratio: 1;
    margin: 0 auto;
    border: 2px solid rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    cursor: crosshair;
    touch-action: none;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

.hue-picker-surface.is-color {
    background:
        radial-gradient(circle at center, #ffffff 0%, rgba(255, 255, 255, 0.96) 8%, rgba(255, 255, 255, 0) 70%),
        conic-gradient(#ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000);
}

.hue-picker-surface.is-white {
    background: linear-gradient(to bottom, #ffad4d 0%, #ffe49d 25%, #fff7df 50%, #ffffff 68%, #c8eaff 100%);
}

.hue-picker-thumb {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 1;
    width: 1.25rem;
    height: 1.25rem;
    border: 3px solid #ffffff;
    border-radius: 50%;
    background: rgba(20, 20, 20, 0.72);
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.65);
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.hue-picker-hint {
    margin: 0;
    padding: 0.65rem 0.8rem 0.8rem;
    color: #9fa1a5;
    font-size: 0.78rem;
    text-align: center;
}

.hue-dimmable-note {
    margin: 0;
    padding: 0.8rem 0.9rem;
    border: 1px solid #45474b;
    border-radius: 10px;
    background: #222326;
    color: #c7c9cc;
}

.hue-brightness-field input[type="range"] {
    width: 100%;
    accent-color: #ffd54f;
}

.hue-dialog-actions {
    justify-content: flex-end;
}

.plug-state-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 6.5rem;
    min-height: 2.25rem;
    box-sizing: border-box;
    padding: 0.45rem 0.75rem;
    border: 1px solid transparent;
    border-radius: 999px;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.15;
    cursor: pointer;
    transition: filter 120ms ease, transform 120ms ease, border-color 120ms ease;
}

.plug-state-button.is-on {
    background: rgba(124, 179, 66, 0.22);
    border-color: rgba(124, 179, 66, 0.55);
    color: #b7e17a;
}

.plug-state-button.is-off {
    background: rgba(244, 67, 54, 0.18);
    border-color: rgba(244, 67, 54, 0.5);
    color: #ff9c95;
}

.plug-state-button.is-unavailable {
    background: rgba(255, 213, 79, 0.12);
    border-color: rgba(255, 213, 79, 0.35);
    color: #ffd54f;
    cursor: not-allowed;
    opacity: 1;
}

.plug-state-button:not(:disabled):hover,
.plug-state-button:not(:disabled):focus-visible {
    filter: brightness(1.18);
    border-color: currentColor;
    outline: none;
}

.plug-state-button:not(:disabled):active {
    transform: translateY(1px);
}

.status-address {
    font-size: 0.82rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.status-sensor-name {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.climate-sensor-list {
    display: grid;
    gap: 1rem;
}

.climate-sensor-summary + .climate-sensor-summary {
    padding-top: 1rem;
    border-top: 1px solid #3a3b3c;
}

.climate-sensor-heading {
    margin-bottom: 0.75rem;
}

.climate-details-action {
    display: flex;
    justify-content: flex-end;
    padding-top: 1rem;
    border-top: 1px solid #3a3b3c;
}

.status-dot {
    display: inline-block;
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 999px;
    flex: 0 0 auto;
}

.status-dot.online {
    background: #7cb342;
    box-shadow: 0 0 0 3px rgba(124, 179, 66, 0.16);
}

.status-dot.offline {
    background: #f44336;
    box-shadow: 0 0 0 3px rgba(244, 67, 54, 0.14);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 4.5rem;
    max-width: 9rem;
    padding: 0.35rem 0.55rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    text-align: center;
    white-space: normal;
    line-height: 1.15;
    overflow-wrap: anywhere;
    flex-shrink: 0;
}

.status-pill.online {
    background: rgba(124, 179, 66, 0.18);
    color: #b7e17a;
}

.status-pill.offline {
    background: rgba(255, 213, 79, 0.12);
    color: #ffd54f;
}

/* Mobile app layout */

.vehicle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.vehicle-latest-charge {
    margin-top: 1.25rem;
}

.vehicle-latest-charge h3 {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.vehicle-charge-row,
.vehicle-meta {
    color: #cfcfcf;
    line-height: 1.45;
}

.car-status-card {
    display: grid;
    gap: 1.5rem;
}

.actions-card {
    display: grid;
    gap: 0.75rem;
}

.actions-card > .status-message,
.actions-card > .error-message {
    margin: 0 0 0.25rem;
}

.action-section {
    border: 1px solid #3a3b3c;
    border-radius: 14px;
    background: #252629;
}

.action-section > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem 1.25rem;
    cursor: pointer;
    list-style: none;
}

.action-section > summary::-webkit-details-marker {
    display: none;
}

.action-section > summary::after {
    content: "+";
    color: #ffd54f;
    font-size: 1.35rem;
    line-height: 1;
}

.action-section[open] > summary::after {
    content: "−";
}

.action-section > summary > span:first-child {
    display: grid;
    gap: 0.2rem;
}

.action-section > summary strong {
    font-size: 1.15rem;
}

.action-section > summary small,
.action-section-state {
    color: #9fa1a5;
    font-size: 0.82rem;
}

.action-section-content {
    padding: 0 1.25rem 1.25rem;
    border-top: 1px solid #3a3b3c;
}

.action-reading-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
    padding-top: 1.25rem;
}

.action-form-panel {
    min-width: 0;
}

.action-form-panel h3,
.action-subheading h3 {
    margin: 0 0 1rem;
}

.action-section-content > .charging-add-form {
    padding-top: 1.25rem;
}

.action-subheading {
    margin-top: 1.5rem;
}

.action-section-content > .presence-control {
    margin: 1.25rem 0 0;
}

.notification-settings {
    display: grid;
    justify-items: start;
    gap: 1rem;
    padding-top: 1.25rem;
}

.notification-settings p {
    margin: 0;
    color: #cfcfcf;
    line-height: 1.5;
}

.notification-settings code {
    color: #ffd54f;
}

.car-overview-card {
    display: grid;
    gap: 2rem;
}

.car-overview-status {
    display: grid;
    gap: 1.5rem;
}

.car-charging-section {
    display: grid;
    gap: 1rem;
    padding-top: 2rem;
    border-top: 1px solid #3a3b3c;
}

.car-charging-section h3 {
    margin: 0.5rem 0 0;
    font-size: 1.05rem;
}

.charging-history-scroll {
    max-width: 100%;
    overflow-x: auto;
}

.car-status-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.car-status-updates {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #3a3b3c;
    color: #9fa1a5;
    font-size: 0.82rem;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 760px) {
    .action-reading-grid {
        grid-template-columns: 1fr;
    }

    .action-section > summary {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .action-section > summary .status-pill {
        order: 2;
    }

    .car-status-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .presence-control,
    .presence-control-row,
    .presence-summary {
        align-items: stretch;
        flex-direction: column;
    }

    .presence-actions,
    .presence-actions form,
    .presence-button {
        width: 100%;
    }

    .presence-actions form {
        display: flex;
    }

    .presence-registration-button {
        width: 100%;
    }

    body {
        --page-gutter: 0.9rem;
        --safe-area-top: env(safe-area-inset-top, 0px);
        --safe-area-bottom: env(safe-area-inset-bottom, 0px);
        box-sizing: border-box;
        min-height: 100dvh;
        padding-block-start: var(--safe-area-top);
        padding-block-end: var(--safe-area-bottom);
    }

    body::before,
    body::after {
        position: fixed;
        z-index: 11;
        right: 0;
        left: 0;
        display: block;
        background: #202124;
        content: "";
        pointer-events: none;
    }

    body::before {
        top: 0;
        height: var(--safe-area-top);
    }

    body::after {
        bottom: 0;
        height: var(--safe-area-bottom);
    }

    body:has(main.form-page) {
        --page-gutter: 1rem;
    }

    body {
        background: #202124;
        -webkit-text-size-adjust: 100%;
    }

    header {
        position: sticky;
        top: 0;
        z-index: 10;
        padding-block: 0.9rem;
        background: #202124;
        backdrop-filter: none;
    }

    body > main {
        min-width: 0;
        overflow-x: hidden;
    }

    .logo {
        font-size: 1.15rem;
        line-height: 1.2;
    }

    .header-right {
        gap: 0.55rem;
    }

    .clock {
        font-size: 1rem;
    }

    .version {
        font-size: 0.8rem;
    }

    .dashboard {
        display: flex;
        flex-direction: column;
        gap: 0.9rem;
        padding: 0.9rem;
    }

    .dashboard > .card {
        flex: 0 0 auto;
    }

    .home-page,
    .hub-page {
        padding: 0.9rem;
    }

    .home-grid {
        grid-template-columns: 1fr;
        gap: 0.9rem;
    }

    .home-tile,
    .hub-card {
        min-height: 6rem;
        padding: 1rem;
        border-radius: 12px;
    }

    .home-tile {
        padding-left: 1.35rem;
    }

    .home-tile::before {
        top: 1rem;
        bottom: 1rem;
    }

    .home-tile strong,
    .hub-card strong {
        font-size: 1.35rem;
    }

    .quick-reading-grid {
        grid-template-columns: 1fr;
    }

    .card {
        border-radius: 12px;
        padding: 1rem;
        min-height: 0;
    }

    .card h2 {
        margin-bottom: 0.9rem;
        font-size: 1.25rem;
        line-height: 1.2;
    }

    .energy-chart-card {
        min-height: 0;
    }

    .energy-stats,
    .vehicle-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.85rem;
    }

    .stat-label {
        font-size: 0.68rem;
        line-height: 1.25;
    }

    .stat-value {
        font-size: 1.1rem;
        line-height: 1.2;
        overflow-wrap: anywhere;
    }

    .stat-time {
        font-size: 0.75rem;
    }

    .chart-wrapper {
        height: 180px;
    }

    .price-usage-result {
        margin-top: 1rem;
        padding: 1rem;
        border-radius: 10px;
        font-size: 1.25rem;
    }

    .price-usage-saving {
        font-size: 0.95rem;
    }

    .button-row {
        gap: 0.55rem;
    }

    .button-link,
    .button-link:visited {
        flex: 1 1 9rem;
        min-height: 2.75rem;
        padding: 0.75rem 0.8rem;
        font-size: 0.95rem;
    }

    .charging-month-row {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }

    .charging-month {
        grid-column: 1 / -1;
    }

    .form-page {
        padding: 1rem;
    }

    .data-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .freezer-item-row {
        grid-template-columns: 3.8rem minmax(0, 1fr);
        align-items: start;
    }

    .freezer-package-row {
        grid-template-columns: 3.8rem minmax(0, 1fr);
        align-items: start;
    }

    .freezer-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }

    .recipe-row {
        grid-template-columns: 1fr;
    }

    .recipe-actions {
        width: 100%;
        justify-content: flex-start;
        flex-direction: column;
    }

    .recipe-action-button,
    .recipe-action-button:visited,
    .recipe-delete-form {
        flex-basis: auto;
        width: 100%;
    }

    .heating-chart-wrapper {
        height: 220px;
    }
}

.login-header {
    justify-content: flex-start;
}

.login-page {
    width: min(100% - 2rem, 28rem);
    margin: 4rem auto 0;
}

.login-card h1 {
    margin: 0 0 0.45rem;
}

.login-card > p {
    margin: 0 0 1.4rem;
    color: var(--muted, #b9c0ca);
}

.login-form {
    display: grid;
    gap: 0.65rem;
}

.login-form label {
    font-size: 0.9rem;
}

.login-form input[type="text"],
.login-form input[type="password"] {
    width: 100%;
    box-sizing: border-box;
    padding: 0.8rem 0.9rem;
    border: 1px solid #50545a;
    border-radius: 0.55rem;
    background: #1d1f22;
    color: #fff;
    font: inherit;
}

.login-form input:focus {
    outline: 2px solid #ffd21f;
    outline-offset: 1px;
    border-color: #ffd21f;
}

.login-form button {
    margin-top: 0.65rem;
    padding: 0.8rem 1rem;
    border: 1px solid #a88600;
    border-radius: 0.55rem;
    background: #3b351e;
    color: #ffd21f;
    font: inherit;
    cursor: pointer;
}

.login-error {
    margin-bottom: 1rem;
    padding: 0.75rem 0.85rem;
    border: 1px solid #a43c3c;
    border-radius: 0.55rem;
    background: #4b2424;
    color: #ffb0a8;
}

.login-success {
    margin-bottom: 1rem;
    padding: 0.75rem 0.85rem;
    border: 1px solid #587638;
    border-radius: 0.55rem;
    background: #2e4024;
    color: #c7f18f;
}

@media (max-width: 430px) {
    header {
        align-items: flex-start;
        gap: 0.4rem;
    }

    .header-right {
        flex-direction: column;
        align-items: flex-end;
        gap: 0.15rem;
    }

    .dashboard {
        padding: 0.65rem;
        gap: 0.65rem;
    }

    .card {
        padding: 0.85rem;
    }

    .energy-stats,
    .vehicle-grid {
        grid-template-columns: 1fr;
    }

    .chart-wrapper {
        height: 160px;
    }

    .charging-month-row {
        grid-template-columns: 1fr;
    }

    .quick-reading-fields {
        grid-template-columns: 1fr;
    }

    .freezer-item-row {
        grid-template-columns: 1fr;
        gap: 0.6rem;
    }

    .freezer-package-row {
        grid-template-columns: 1fr;
        gap: 0.6rem;
    }

    .freezer-group summary {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .freezer-number {
        font-size: 1.15rem;
    }

    .sleep-content {
        width: min(100% - 2rem, 28rem);
    }

    .sun-event {
        min-width: 0;
        width: 100%;
        justify-content: center;
    }

    .sun-icon {
        font-size: 2.4rem;
    }

    .sun-name {
        font-size: 1.35rem;
    }

    .sun-time {
        font-size: 2rem;
    }
}

/* Shopping list and recipe import */
.shopping-list-page,
.recipe-shopping-page {
    max-width: 72rem;
}

.shopping-add-form,
.recipe-servings-form {
    display: flex;
    align-items: end;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.shopping-add-form label,
.recipe-servings-form label {
    display: grid;
    gap: 0.35rem;
    flex: 1 1 13rem;
}

.shopping-add-form input,
.shopping-add-form select,
.recipe-servings-form input,
.ingredient-category-question select {
    box-sizing: border-box;
    height: 2.25rem;
    min-height: 2.25rem;
    padding: 0.35rem 0.65rem;
    border: 1px solid #4a4b4e;
    border-radius: 0.55rem;
    background: #1f2022;
    color: #fff;
}

.shopping-add-form .button-link {
    min-height: 2.25rem;
    padding: 0.35rem 0.7rem;
}

.shopping-groups {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}

.shopping-group {
    padding: 0;
    overflow: hidden;
}

.shopping-group-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid #3a3b3c;
}

.shopping-group-heading h2 {
    margin: 0;
}

.shopping-items {
    display: grid;
}

.shopping-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    justify-content: space-between;
    padding: 0.8rem 1rem;
}

.shopping-item + .shopping-item {
    border-top: 1px solid #343538;
}

.shopping-check-form {
    flex: 1;
}

.shopping-check-form label,
.recipe-ingredient-row > label:first-child {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.shopping-check-form input,
.recipe-ingredient-row input {
    width: 1.35rem;
    height: 1.35rem;
    accent-color: #ffd54f;
}

.shopping-item-text {
    display: flex;
    align-items: baseline;
    gap: 0.65rem;
}

.shopping-item-text small,
.recipe-ingredient-row small {
    color: #b9bbbe;
}

.shopping-item.is-checked .shopping-item-text {
    opacity: 0.55;
    text-decoration: line-through;
}

.shopping-clear-form {
    display: flex;
    justify-content: flex-end;
    margin-top: 1rem;
}

.app-confirm-dialog {
    width: min(22rem, calc(100vw - 2rem));
    padding: 0;
    overflow: hidden;
    border: 1px solid #4a4b4e;
    border-radius: 0.75rem;
    background: #2b2c2f;
    color: #fff;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.5);
}

.app-confirm-dialog::backdrop {
    background: rgba(0, 0, 0, 0.68);
}

.app-confirm-dialog h2 {
    margin: 0;
    padding: 0.9rem 1rem 0.3rem;
    font-size: 1rem;
}

.app-confirm-dialog p {
    margin: 0;
    padding: 0.5rem 1rem 1rem;
    color: #f2f2f2;
    font-size: 0.9rem;
}

.app-confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid #3a3b3c;
    background: rgba(0, 0, 0, 0.08);
}

.shopping-empty {
    margin-top: 1rem;
    text-align: center;
}

.fridge-transfer-page {
    max-width: 58rem;
}

.fridge-transfer-list {
    display: grid;
    gap: 0.6rem;
    margin-top: 1rem;
}

.fridge-transfer-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem;
    border: 1px solid #3a3b3c;
    border-radius: 0.65rem;
    background: rgba(255, 255, 255, 0.02);
}

.fridge-transfer-choice {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.fridge-transfer-choice input {
    width: 1.35rem;
    height: 1.35rem;
    flex: 0 0 auto;
    accent-color: #ffd54f;
}

.fridge-transfer-choice > span {
    display: grid;
    gap: 0.2rem;
}

.fridge-transfer-choice small {
    color: #b9bbbe;
}

.fridge-transfer-days {
    display: grid;
    gap: 0.25rem;
    color: #b9bbbe;
    font-size: 0.78rem;
}

.fridge-transfer-day-input {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.fridge-transfer-day-input input {
    box-sizing: border-box;
    width: 4.5rem;
    height: 2.25rem;
    padding: 0.35rem 0.5rem;
    border: 1px solid #4a4b4e;
    border-radius: 0.55rem;
    background: #1f2022;
    color: #fff;
}

.fridge-transfer-actions {
    margin-top: 1rem;
}

.fridge-transfer-primary {
    margin-left: auto;
}

.shopping-add-card {
    margin-top: 1rem;
}

.recipe-servings-form {
    margin: 1rem 0;
}

.recipe-servings-form label {
    flex: 0 1 10rem;
}

.recipe-ingredient-list {
    display: grid;
    gap: 0.5rem;
    margin: 1rem 0;
}

.recipe-ingredient-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem;
    border: 1px solid #3a3b3c;
    border-radius: 0.65rem;
}

.recipe-ingredient-row > label:first-child > span {
    display: flex;
    gap: 0.65rem;
    flex-wrap: wrap;
    align-items: baseline;
}

.recipe-ingredient-row em {
    color: #b9bbbe;
    font-size: 0.86rem;
}

.recipe-ingredient-row.needs-category {
    border-color: #d6a94b;
    background: rgba(214, 169, 75, 0.08);
}

.ingredient-category-question {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    color: #f0cf84;
    font-size: 0.88rem;
}

.recipe-shopping-actions {
    margin-top: 1rem;
}

@media (max-width: 760px) {
    .shopping-add-form > *,
    .shopping-add-form button {
        width: 100%;
    }

    .recipe-ingredient-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .ingredient-category-question {
        align-items: stretch;
        flex-direction: column;
    }

    .shopping-list-page {
        font-size: 0.88rem;
    }

    .shopping-list-page .shopping-add-card,
    .shopping-list-page .shopping-group {
        padding: 0.8rem;
    }

    .shopping-list-page .shopping-group {
        padding: 0;
    }

    .shopping-group-heading {
        padding: 0.55rem 0.75rem;
    }

    .shopping-group-heading h2 {
        font-size: 1rem;
    }

    .shopping-item {
        min-height: 2.75rem;
        padding: 0.48rem 0.7rem;
    }

    .shopping-item-text strong {
        font-size: 0.88rem;
        line-height: 1.2;
    }

    .shopping-item-text small {
        font-size: 0.72rem;
    }

    .shopping-item .compact-button {
        min-height: 2.25rem;
        padding: 0.35rem 0.55rem;
        font-size: 0.75rem;
    }

    .fridge-transfer-item {
        grid-template-columns: minmax(0, 1fr);
        gap: 0.65rem;
    }

    .fridge-transfer-days {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
    }

    .fridge-transfer-actions > * {
        width: 100%;
    }

    .fridge-transfer-primary {
        margin-left: 0;
    }
}

/* Grocery receipts */

.grocery-page,
.grocery-review-page,
.grocery-analysis-page,
.grocery-receipts-page {
    display: grid;
    gap: 1rem;
    min-width: 0;
}

.grocery-pending-card,
.grocery-approved-card {
    width: min(900px, 100%);
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    margin-top: 0;
    margin-right: auto;
    margin-left: auto;
}

.grocery-receipt-list {
    display: grid;
    gap: 0.55rem;
}

.grocery-receipt-entry {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.65rem;
    align-items: stretch;
}

.grocery-receipt-entry form {
    display: flex;
}

.grocery-delete-receipt {
    min-width: 7.5rem;
    height: 100%;
    margin: 0;
}

.grocery-receipt-row,
.grocery-receipt-row:visited {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 0.95rem;
    border: 1px solid #3d3e41;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.025);
    color: #f4f4f4;
    text-decoration: none;
}

.grocery-receipt-row:hover,
.grocery-receipt-row:focus-visible {
    border-color: rgba(255, 213, 79, 0.55);
    outline: none;
}

.grocery-receipt-row > span:first-child {
    display: grid;
    gap: 0.25rem;
    min-width: 0;
}

.grocery-receipt-row small {
    color: #aeb0b4;
}

.grocery-status-completed {
    border-color: rgba(129, 199, 132, 0.5);
    background: rgba(129, 199, 132, 0.11);
    color: #a9e4ac;
}

.grocery-status-failed {
    border-color: rgba(255, 152, 0, 0.55);
    background: rgba(255, 152, 0, 0.12);
    color: #ffc56d;
}

.grocery-status-approved {
    border-color: rgba(129, 199, 132, 0.5);
    background: rgba(129, 199, 132, 0.11);
    color: #a9e4ac;
}

.grocery-status-pending {
    border-color: rgba(255, 213, 79, 0.5);
    background: rgba(255, 213, 79, 0.1);
    color: #ffe184;
}

.grocery-receipt-summary {
    display: flex;
    gap: 0.7rem;
    align-items: center;
    justify-content: flex-end;
}

.grocery-upload-card {
    width: min(680px, 100%);
    box-sizing: border-box;
}

.grocery-upload-form {
    display: grid;
    gap: 1rem;
}

.grocery-file-picker {
    display: grid;
    gap: 0.65rem;
    padding: 1rem;
    border: 1px solid rgba(255, 213, 79, 0.45);
    border-radius: 12px;
    background: rgba(255, 213, 79, 0.055);
}

.grocery-file-picker > strong {
    color: #f4f4f4;
    font-weight: 700;
}

.grocery-gallery-control {
    position: relative;
    display: flex;
    gap: 0.75rem;
    align-items: center;
    width: 100%;
    min-height: 3.25rem;
    box-sizing: border-box;
    padding: 0.45rem;
    border: 1px solid #55575b;
    border-radius: 8px;
    background: #202124;
    color: #d9d9d9;
    font: inherit;
    cursor: pointer;
    overflow: hidden;
}

.grocery-gallery-button {
    flex: 0 0 auto;
    min-height: 2.35rem;
    box-sizing: border-box;
    padding: 0.45rem 0.8rem;
    border: 1px solid rgba(255, 213, 79, 0.65);
    border-radius: 6px;
    background: rgba(255, 213, 79, 0.12);
    color: #ffd54f;
    font-weight: 700;
}

.grocery-gallery-selection {
    min-width: 0;
    overflow: hidden;
    color: #c5c6c8;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.grocery-file-input {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0.01;
    cursor: pointer;
}

.grocery-file-picker span {
    color: #b9b9b9;
    font-size: 0.84rem;
}

.grocery-image-preview,
.grocery-scan-strip {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
}

.grocery-image-preview > div,
.grocery-scan-strip a {
    display: grid;
    gap: 0.35rem;
    min-width: 0;
    color: #d9d9d9;
    font-size: 0.78rem;
    text-decoration: none;
}

.grocery-image-preview img,
.grocery-scan-strip img {
    width: 100%;
    height: 10rem;
    object-fit: cover;
    border: 1px solid #45464a;
    border-radius: 8px;
    background: #18191b;
}

.grocery-pdf-preview,
.grocery-scan-strip .grocery-pdf-file > strong {
    display: grid;
    place-items: center;
    width: 100%;
    height: 10rem;
    box-sizing: border-box;
    border: 1px solid rgba(255, 213, 79, 0.55);
    border-radius: 8px;
    background: rgba(255, 213, 79, 0.08);
    color: #ffd54f;
    font-size: 1.35rem;
}

.grocery-submit-button {
    justify-self: start;
}

.grocery-analysis-notice {
    margin: 0;
    padding: 0.8rem 1rem;
    border: 1px solid;
    border-radius: 8px;
}

.grocery-review-form {
    display: grid;
    gap: 1.25rem;
}

.grocery-receipt-meta {
    display: grid;
    grid-template-columns: max-content minmax(12rem, 24rem);
    gap: 0.8rem;
}

.grocery-receipt-meta label,
.grocery-item-row label {
    display: grid;
    gap: 0.35rem;
    color: #bfc0c2;
    font-size: 0.8rem;
}

.grocery-receipt-meta input,
.grocery-item-row input,
.grocery-item-row select {
    width: 100%;
    min-height: 2.35rem;
    box-sizing: border-box;
    padding: 0.45rem 0.55rem;
    border: 1px solid #4a4b4e;
    border-radius: 6px;
    background: #202124;
    color: #fff;
    font: inherit;
    color-scheme: dark;
}

.grocery-items-heading,
.grocery-review-footer {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
}

.grocery-items-heading h3,
.grocery-review-footer p {
    margin: 0;
}

.grocery-item-list {
    display: grid;
    gap: 0.65rem;
}

.grocery-item-row {
    display: grid;
    grid-template-columns: minmax(11rem, 1.7fr) 5rem minmax(10rem, 1fr) 8.5rem auto;
    gap: 0.65rem;
    align-items: end;
    padding: 0.75rem;
    border: 1px solid #3e3f42;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.022);
}

.grocery-money-input {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.35rem;
}

.grocery-remove-item {
    min-height: 2.35rem;
}

.grocery-review-footer {
    padding-top: 1rem;
    border-top: 1px solid #3a3b3c;
}

.grocery-review-footer strong {
    margin-left: 0.35rem;
    color: #ffd54f;
    font-size: 1.15rem;
}

.grocery-analysis-heading {
    align-items: end;
}

.grocery-period-form {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.grocery-analysis-total {
    display: grid;
    gap: 0.25rem;
    margin: 1rem 0 1.25rem;
    padding: 1rem;
    border-left: 3px solid #ffd54f;
    border-radius: 0 9px 9px 0;
    background: rgba(255, 213, 79, 0.07);
}

.grocery-analysis-total span {
    color: #aeb0b4;
    font-size: 0.8rem;
}

.grocery-analysis-total strong {
    font-size: 1.65rem;
}

.grocery-category-bars {
    display: grid;
    gap: 0.65rem;
}

.grocery-category-row {
    display: grid;
    grid-template-columns: minmax(10rem, 1fr) minmax(12rem, 1.4fr);
    gap: 1rem;
    align-items: center;
    padding: 0.75rem 0;
    border-top: 1px solid #38393c;
}

.grocery-category-row > div {
    display: grid;
    gap: 0.25rem;
}

.grocery-category-row span {
    color: #aeb0b4;
    font-size: 0.78rem;
}

.grocery-category-value {
    text-align: right;
}

.grocery-category-track {
    display: block;
    width: 100%;
    height: 0.38rem;
    overflow: hidden;
    border-radius: 999px;
    background: #414246;
}

.grocery-category-track > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: #ffd54f;
}

@media (max-width: 820px) {
    .grocery-item-row {
        grid-template-columns: minmax(0, 1fr) 5.5rem;
    }

    .grocery-item-name,
    .grocery-item-category {
        grid-column: 1 / -1;
    }

    .grocery-item-total {
        grid-column: 1;
    }

    .grocery-remove-item {
        grid-column: 2;
    }
}

@media (max-width: 600px) {
    .grocery-receipt-entry {
        grid-template-columns: 1fr;
    }

    .grocery-delete-receipt {
        width: 100%;
        min-height: 2.75rem;
    }

    .grocery-receipt-meta,
    .grocery-category-row {
        grid-template-columns: 1fr;
    }

    .grocery-receipt-meta label,
    .grocery-period-form,
    .grocery-period-form label,
    .grocery-period-form input,
    .grocery-period-form button {
        width: 100%;
    }

    .grocery-analysis-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .grocery-category-value {
        text-align: left;
    }

    .grocery-receipt-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .grocery-receipt-summary {
        width: 100%;
        justify-content: space-between;
    }

    .grocery-gallery-control {
        align-items: stretch;
        flex-direction: column;
    }

    .grocery-gallery-button {
        display: grid;
        place-items: center;
        width: 100%;
    }

    .grocery-gallery-selection {
        padding: 0.2rem 0.35rem;
        text-align: center;
    }
}

/* Consumption day embedded in the electricity dashboard */

.consumption-day-dashboard-card {
    grid-column: 1 / -1;
}

.consumption-day-heading {
    align-items: end;
    margin-bottom: 1.5rem;
}

.consumption-day-heading h2,
.consumption-day-content h3 {
    margin: 0;
}

.consumption-day-content {
    display: grid;
    gap: 1.25rem;
    min-width: 0;
    padding-top: 1.5rem;
    border-top: 1px solid #3a3b3c;
}

.consumption-day-chart-wrapper {
    min-width: 0;
}

.consumption-day-dashboard-card .consumption-day-table {
    min-width: 36rem;
}

@media (max-width: 760px) {
    .consumption-day-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .consumption-day-heading .date-picker-form,
    .consumption-day-heading .date-picker-form label,
    .consumption-day-heading .date-picker-form input,
    .consumption-day-heading .date-picker-form button {
        width: 100%;
    }
}

/* Unified subpages */

.hub-card,
.hub-card:visited {
    position: relative;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto 1fr;
    align-items: start;
    min-height: 8.5rem;
    padding-left: 1.65rem;
    background:
        radial-gradient(circle at 100% 0, rgba(255, 213, 79, 0.06), transparent 45%),
        #2b2c2f;
}

.hub-card::before {
    position: absolute;
    top: 1.2rem;
    bottom: 1.2rem;
    left: 0;
    width: 0.2rem;
    border-radius: 0 999px 999px 0;
    background: #ffd54f;
    content: "";
}

.hub-card::after {
    grid-column: 2;
    grid-row: 1 / 3;
    align-self: center;
    color: #ffd54f;
    content: "→";
    font-size: 1.25rem;
}

.hub-card strong,
.hub-card span {
    grid-column: 1;
}

.page-section-heading {
    margin-bottom: 1.15rem;
}

.page-section-heading h2,
.section-header-row .section-summary {
    margin: 0;
}

.section-summary {
    margin: 0.3rem 0 0;
    color: #9fa1a5;
    font-size: 0.85rem;
    line-height: 1.4;
}

.simple-form input,
.simple-form textarea,
.simple-form select,
.fridge-add-form input,
.date-picker-form input,
.quick-reading-fields input,
.quick-reading-fields textarea {
    border-color: #4a4b4e;
    background: #202124;
    color: #ffffff;
    color-scheme: dark;
    font: inherit;
}

.simple-form input:focus,
.simple-form textarea:focus,
.simple-form select:focus,
.fridge-add-form input:focus,
.date-picker-form input:focus,
.quick-reading-fields input:focus,
.quick-reading-fields textarea:focus {
    border-color: #ffd54f;
    outline: 2px solid rgba(255, 213, 79, 0.18);
    outline-offset: 1px;
}

.secondary-button,
.danger-button {
    min-height: 2rem;
    box-sizing: border-box;
    padding: 0.42rem 0.7rem;
    border: 1px solid #55575b;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.035);
    color: #d8d8d8;
    font: inherit;
    cursor: pointer;
}

.danger-button,
.button-link.danger-button {
    border-color: rgba(244, 67, 54, 0.45);
    background: rgba(244, 67, 54, 0.1);
    color: #ff9c95;
}

.secondary-button:hover,
.secondary-button:focus-visible {
    border-color: rgba(255, 213, 79, 0.65);
    color: #ffd54f;
    outline: none;
}

.danger-button:hover,
.danger-button:focus-visible,
.button-link.danger-button:hover,
.button-link.danger-button:focus-visible {
    border-color: rgba(244, 67, 54, 0.8);
    background: rgba(244, 67, 54, 0.18);
    outline: none;
}

.history-page-card {
    display: grid;
    gap: 0;
}

.history-page-card > *,
.history-table-section,
.data-table-scroll,
.heating-chart-section {
    min-width: 0;
}

.heating-overview {
    margin-top: 0.25rem;
}

.heating-overview > div {
    padding: 0.9rem;
    border: 1px solid #3a3b3c;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.025);
}

.history-table-section {
    margin-top: 0.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #3a3b3c;
}

.history-table-section h3 {
    margin: 0 0 0.75rem;
}

.data-table-scroll {
    max-width: 100%;
    overflow-x: auto;
}

.history-table-section .data-table {
    min-width: 48rem;
}

.reading-actions {
    width: 1%;
    white-space: nowrap;
    text-align: right;
}

.action-section > summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
}

.action-section > summary::after {
    grid-column: 3;
}

.action-section > summary > .action-section-state,
.action-section > summary > .status-pill {
    grid-column: 2;
    text-align: right;
}

@media (max-width: 760px) {
    .grocery-page .hub-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .grocery-page > * {
        min-width: 0;
    }

    .hub-card,
    .hub-card:visited {
        min-height: 6.5rem;
        padding-left: 1.4rem;
    }

    .section-header-row.page-section-heading {
        align-items: flex-start;
    }

    .action-section > summary {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .action-section > summary::after {
        grid-column: 2;
        grid-row: 1;
    }

    .action-section > summary > .action-section-state,
    .action-section > summary > .status-pill {
        grid-column: 1 / -1;
        grid-row: 2;
        justify-self: start;
        text-align: left;
    }

    .fridge-add-form label,
    .fridge-add-form button {
        width: 100%;
    }

    .fridge-add-form input[type="date"] {
        width: 100%;
    }
}

@media (max-width: 430px) {
    .page-section-heading > .button-link,
    .page-section-heading > a.button-link {
        flex-basis: 100%;
    }

    .heating-overview {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.65rem;
    }

    .heating-overview > div {
        padding: 0.75rem;
    }

    .heating-overview > div:first-child,
    .heating-overview > div:last-child {
        grid-column: 1 / -1;
    }

    .freezer-actions .inline-form {
        flex: 1 1 8rem;
    }

    .freezer-actions button {
        width: 100%;
    }
}

/*
 * Dense mobile layout for operational pages.
 * Consumption pages deliberately do not opt in to compact-mobile-page.
 */
@media (max-width: 760px) {
    .compact-mobile-page {
        font-size: 0.9rem;
    }

    .compact-mobile-page.form-page,
    .compact-mobile-page.hub-page {
        gap: 0.7rem;
        padding: 0.75rem;
    }

    .compact-mobile-page .card {
        padding: 0.8rem;
    }

    .compact-mobile-page .card h2 {
        margin-bottom: 0.6rem;
        font-size: 1.1rem;
    }

    .compact-mobile-page .section-header-row {
        gap: 0.55rem;
        margin-bottom: 0.65rem;
    }

    .compact-mobile-page .section-summary,
    .compact-mobile-page .hub-muted {
        font-size: 0.78rem;
    }

    .compact-mobile-page .button-row {
        gap: 0.4rem;
    }

    .compact-mobile-page .button-link,
    .compact-mobile-page .button-link:visited,
    .compact-mobile-page .secondary-button,
    .compact-mobile-page .danger-button {
        flex: 0 1 auto;
        min-height: 2.25rem;
        padding: 0.45rem 0.65rem;
        font-size: 0.84rem;
        line-height: 1.1;
    }

    .compact-mobile-page .compact-button,
    .compact-mobile-page .compact-button:visited {
        min-height: 2rem;
        padding: 0.35rem 0.55rem;
        font-size: 0.78rem;
    }

    .compact-mobile-page .status-grid,
    .compact-mobile-page .hub-grid,
    .compact-mobile-page .recipe-groups,
    .compact-mobile-page .shopping-groups {
        gap: 0.65rem;
    }

    .compact-mobile-page .status-card {
        gap: 0.65rem;
    }

    .compact-mobile-page .status-page-links {
        gap: 0.35rem;
        margin-bottom: 0.65rem;
    }

    .compact-mobile-page .status-page-links .button-link {
        min-height: 2.15rem;
        padding-inline: 0.45rem;
        font-size: 0.78rem;
    }

    .actions-page .action-section > summary {
        gap: 0.45rem;
        padding: 0.75rem 0.85rem;
    }

    .actions-page .action-section > summary strong {
        font-size: 1rem;
    }

    .actions-page .action-section > summary small,
    .actions-page .action-section-state {
        font-size: 0.74rem;
    }

    .actions-page .action-section-content {
        padding: 0 0.85rem 0.85rem;
    }

    .actions-page .action-reading-grid,
    .actions-page .notification-settings {
        gap: 0.75rem;
        padding-top: 0.85rem;
    }

    .actions-page .action-section-content > .presence-control {
        margin-top: 0.85rem;
    }

    .actions-page .presence-control {
        gap: 0.65rem;
        padding: 0.65rem 0.75rem;
    }

    .actions-page .presence-registration-row {
        padding-top: 0.65rem;
    }

    .recipes-card .recipe-group-heading {
        padding: 0.7rem 0.8rem;
    }

    .recipes-card .recipe-row {
        gap: 0.55rem;
        padding: 0.65rem 0.7rem;
    }

    .recipes-card .recipe-content strong {
        font-size: 0.95rem;
    }

    .recipes-card .recipe-content p {
        margin-top: 0.2rem;
        font-size: 0.78rem;
    }

    .recipes-card .recipe-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.35rem;
    }

    .recipes-card .recipe-action-button,
    .recipes-card .recipe-action-button:visited,
    .recipes-card .recipe-delete-form {
        width: 100%;
    }

    .recipes-card .recipe-action-button,
    .recipes-card .recipe-action-button:visited {
        min-height: 2rem;
    }

    .fridge-page .fridge-item {
        gap: 0.55rem;
        padding: 0.7rem;
    }

    .fridge-page .fridge-item-dates {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.4rem;
        font-size: 0.76rem;
    }

    .fridge-page .fridge-item-actions {
        gap: 0.4rem;
    }

    .compact-mobile-page .freezer-item-row,
    .compact-mobile-page .freezer-package-row {
        gap: 0.55rem;
        padding: 0.7rem;
    }

    .compact-mobile-page .freezer-actions {
        gap: 0.4rem;
    }

    .compact-mobile-page .freezer-note-field {
        min-height: 2.5rem;
        padding: 0.45rem 0.55rem;
    }

    .compact-mobile-page .shopping-clear-form,
    .compact-mobile-page .shopping-add-card,
    .compact-mobile-page .recipe-shopping-actions,
    .compact-mobile-page .fridge-transfer-actions {
        margin-top: 0.65rem;
    }
}
