:root {
  color-scheme: light;
  --ink: #203b30;
  --muted: #718078;
  --deep: #183e32;
  --green: #1e4a39;
  --green-light: #e6eee4;
  --oat: #f5f2e9;
  --paper: #fffdf6;
  --line: #e8e2d5;
  --terracotta: #e6b894;
  --serif: Georgia, "Times New Roman", serif;
  font-family: "Avenir Next", "Trebuchet MS", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--oat); font-size: 14px; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid #7b9b77;
  outline-offset: 2px;
}

svg { flex: 0 0 auto; }
.app-shell { min-height: 100vh; background: var(--oat); }
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 5; display: flex; flex-direction: column;
  width: 248px; padding: 32px 20px; color: #f8f5eb; background: var(--deep);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 12px 44px; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; color: var(--deep); background: var(--terracotta); border-radius: 11px 11px 11px 3px; }
.brand-name { display: block; font: 600 20px var(--serif); letter-spacing: -.04em; }
.brand-kicker { display: block; margin-top: 2px; opacity: .63; font-size: 10px; letter-spacing: .17em; text-transform: uppercase; }
.nav-label { margin: 0 0 10px; padding: 0 13px; color: #a6b8a8; font-size: 10px; letter-spacing: .17em; text-transform: uppercase; }
.side-nav { display: grid; gap: 6px; }
.nav-link { display: flex; align-items: center; gap: 12px; padding: 12px 13px; color: #d0dbd0; font-size: 14px; font-weight: 500; text-decoration: none; border-radius: 10px; transition: background .18s, color .18s; }
.nav-link:hover, .nav-link.active { color: #fffdf4; background: #2a5144; }
.nav-link.active { box-shadow: inset 3px 0 var(--terracotta); }
.nav-dot { width: 7px; height: 7px; margin-left: auto; background: var(--terracotta); border-radius: 50%; }
.side-note { margin-top: auto; padding: 16px 14px; color: #c4d0c3; font-size: 12px; line-height: 1.6; border-top: 1px solid rgba(255,255,255,.14); }
.side-note strong { display: block; margin-bottom: 5px; color: #f1cfb3; font: 500 16px var(--serif); }

.main-area { min-height: 100vh; margin-left: 248px; }
.topbar { display: flex; align-items: center; justify-content: flex-end; height: 66px; padding: 0 clamp(22px,5vw,72px); color: #637068; font-size: 12px; border-bottom: 1px solid #e9e4d7; }
.topbar-date { display: flex; align-items: center; gap: 9px; }
.logout-form { display: inline-flex; margin: 0; }
.logout-button, .topbar-home { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 34px; padding: 7px 10px; color: #637068; background: transparent; border: 1px solid transparent; border-radius: 8px; font-size: 12px; text-decoration: none; cursor: pointer; }
.logout-button:hover, .topbar-home:hover { color: #294638; background: #ebe7dc; }
.page { max-width: 1120px; margin: 0 auto; padding: 48px clamp(22px,5vw,72px) 80px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 34px; }
.eyebrow { margin: 0 0 10px; color: #6c8173; font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.page-title { margin: 0; color: #1c3b30; font: 500 clamp(34px,4vw,48px)/1.06 var(--serif); letter-spacing: -.04em; }
.page-subtitle { max-width: 560px; margin: 12px 0 0; color: #6f7b72; font-size: 14px; line-height: 1.65; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 42px; padding: 10px 16px; color: #fffdf4; background: var(--green); border: 1px solid transparent; border-radius: 9px; font-size: 13px; font-weight: 700; text-decoration: none; cursor: pointer; transition: background .18s, transform .18s; }
.btn:hover { background: #2c624b; transform: translateY(-1px); }
.btn.secondary { color: #294638; background: #ebe7dc; border-color: #e1dccf; }
.btn.secondary:hover { background: #e3ddce; }
.btn.ghost { color: #52645a; background: transparent; border-color: #ded9cc; }
.btn.ghost:hover { background: #eeeade; }
.btn.small { min-height: 34px; padding: 7px 11px; font-size: 12px; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 8px 26px rgba(45,57,42,.035); }
.plan-hero { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 25px; margin-bottom: 27px; padding: 27px 30px; background: var(--green-light); border: 1px solid #d5e2d2; border-radius: 14px; }
.plan-hero::after { position: absolute; top: -128px; right: 14%; width: 210px; height: 210px; border: 1px solid rgba(54,91,67,.16); border-radius: 50%; box-shadow: 0 0 0 20px rgba(54,91,67,.035), 0 0 0 43px rgba(54,91,67,.025); content: ""; pointer-events: none; }
.week-date { display: flex; align-items: center; gap: 10px; color: #43634c; font-size: 12px; font-weight: 700; letter-spacing: .04em; }
.week-title { margin: 7px 0 0; color: #214632; font: 500 26px var(--serif); }
.progress-copy { margin-top: 4px; color: #56715b; font-size: 12px; }
.shopping-progress { display: flex; align-items: center; gap: 11px; width: min(230px,36%); color: #44644c; font-size: 12px; }
.progress-track { overflow: hidden; flex: 1; height: 7px; background: rgba(43,78,54,.13); border-radius: 20px; }
.progress-fill { height: 100%; background: #387455; border-radius: inherit; transition: width .3s; }
.list-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 17px 21px; border-bottom: 1px solid #eee9dd; }
.section-title { margin: 0; color: #254533; font: 500 20px var(--serif); }
.muted { color: #788178; font-size: 12px; }
.item-groups { padding: 4px 21px 15px; }
.item-group { margin: 0; }
.category-heading { display: flex; align-items: center; gap: 10px; padding: 19px 0 8px; color: #657768; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.category-heading::after { flex: 1; height: 1px; background: #eee9dd; content: ""; }
.group-count { order: 1; color: #a1a99f; font-weight: 500; }
.grocery-row { display: grid; grid-template-columns: 28px minmax(0,1fr) auto auto; align-items: center; gap: 10px; min-height: 55px; border-bottom: 1px solid #f0ece2; }
.grocery-row:last-child { border-bottom: 0; }
.toggle-form { display: contents; }
.check-button { display: grid; place-items: center; width: 24px; height: 24px; color: #fff; background: transparent; border: 1.5px solid #bbc7b7; border-radius: 7px; cursor: pointer; }
.check-button.checked { background: #387455; border-color: #387455; }
.grocery-name { color: #314337; font-size: 14px; }
.grocery-name.checked { color: #99a097; text-decoration: line-through; }
.quantity-value { min-width: 38px; color: #5c685e; font-size: 12px; text-align: center; white-space: nowrap; }
.row-actions { display: flex; align-items: center; gap: 2px; opacity: .78; }
.grocery-row:hover .row-actions, .category-row:hover .row-actions, .catalog-product:hover .row-actions { opacity: 1; }
.icon-button { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; color: #728076; background: transparent; border: 0; border-radius: 8px; cursor: pointer; }
.icon-button:hover { color: #294638; background: #eeeade; }
.add-row { display: flex; gap: 9px; padding: 4px 21px 22px; }
.finish-list-form { display: flex; justify-content: flex-end; margin-top: 16px; }
.quick-add { margin-top: 16px; padding: 18px; background: #eeeadf; border: 1px solid #e4decf; border-radius: 12px; }
.quick-add-form { display: grid; grid-template-columns: minmax(180px,2fr) minmax(130px,1fr) minmax(130px,1fr) 85px auto; align-items: end; gap: 12px; }
.quick-add-form label, .catalog-add-form label, .category-add-form label, .popover-form label { display: grid; gap: 6px; color: #657168; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.quick-add-name { min-width: 0; }
.input, input, select { width: 100%; min-height: 42px; padding: 10px 11px; color: #283c30; background: #fffef9; border: 1px solid #ded9cd; border-radius: 8px; outline: none; font-size: 14px; }
input:focus, select:focus { border-color: #688a6d; box-shadow: 0 0 0 3px rgba(81,124,88,.12); }

.empty-state { padding: 52px 24px; text-align: center; }
.large-empty { display: grid; min-height: 320px; place-content: center; }
.empty-mark { display: grid; place-items: center; width: 54px; height: 54px; margin: 0 auto 18px; color: #396246; background: #e9eee3; border-radius: 18px 18px 18px 5px; }
.empty-state h2 { margin: 0; color: #284635; font: 500 22px var(--serif); }
.empty-state p { max-width: 380px; margin: 9px auto 20px; color: #788178; font-size: 13px; line-height: 1.6; }
.compact-empty { padding: 38px 20px 24px; }
.catalog-empty { padding: 38px 10px; }
.toast-message { margin: -16px 0 20px; padding: 12px 15px; color: #294638; background: #e5efe3; border: 1px solid #d1e0d0; border-radius: 9px; font-size: 13px; }

.catalog-layout { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(270px,.8fr); align-items: start; gap: 22px; }
.catalog-panel { padding: 0 21px 20px; }
.catalog-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 4px; padding: 20px 0 14px; border-bottom: 1px solid #eee9dd; }
.catalog-product { position: relative; display: grid; grid-template-columns: minmax(0,1fr) auto auto; align-items: center; gap: 8px; padding: 13px 0; border-bottom: 1px solid #f0ece2; }
.product-name, .product-category { display: block; }
.product-name { color: #34473a; font-size: 14px; font-weight: 600; }
.product-category { margin-top: 4px; color: #889087; font-size: 12px; }
.category-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid #f0ece2; }
.category-name { display: flex; align-items: center; }
.category-color { display: inline-block; width: 9px; height: 9px; margin-right: 10px; background: #a4b99b; border-radius: 50%; }
.catalog-add-form, .category-add-form { display: grid; gap: 13px; margin-top: 23px; padding-top: 19px; border-top: 1px solid #eee9dd; }
.catalog-add-form h3 { margin: 0; color: #294636; font: 500 18px var(--serif); }
.form-inline { display: grid; grid-template-columns: minmax(0,1fr) 95px; gap: 10px; }
.category-add-form { grid-template-columns: minmax(0,1fr) auto; align-items: end; }
.edit-details { position: relative; }
.edit-details > summary { list-style: none; cursor: pointer; }
.edit-details > summary::-webkit-details-marker { display: none; }
.popover-form { position: absolute; z-index: 8; top: calc(100% + 4px); right: 0; display: grid; gap: 11px; width: 260px; padding: 15px; background: var(--paper); border: 1px solid var(--line); border-radius: 11px; box-shadow: 0 10px 35px rgba(34,51,38,.15); }
.popover-form label { letter-spacing: .03em; }
.popover-form input, .popover-form select { min-height: 36px; padding: 7px 9px; font-size: 13px; }

.history-card { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 18px; margin-bottom: 12px; padding: 22px 24px; }
.history-heading { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.history-title { margin: 0; color: #294636; font: 500 21px var(--serif); }
.history-meta { margin-top: 6px; color: #81877f; font-size: 12px; }
.history-preview { margin-top: 14px; color: #58675b; font-size: 13px; line-height: 1.55; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px; color: #777264; background: #eee9dd; border-radius: 99px; font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.history-actions { display: flex; justify-content: flex-end; align-items: center; gap: 6px; flex-wrap: wrap; }
.mobile-nav { display: none; }

@media (max-width: 980px) {
  .catalog-layout { grid-template-columns: 1fr; }
  .quick-add-form { grid-template-columns: minmax(170px,2fr) minmax(130px,1fr) 75px auto; }
  .quick-add-form label:nth-of-type(3) { display: none; }
}

@media (max-width: 700px) {
  .sidebar { display: none; }
  .main-area { margin-left: 0; }
  .topbar { height: 52px; padding: 0 19px; }
  .topbar { gap: 6px; }
  .topbar-date { margin-right: auto; font-size: 11px; }
  .topbar-home { padding: 6px 8px; font-size: 11px; }
  .logout-button { padding: 6px 8px; font-size: 11px; }
  .page { padding: 34px 18px 104px; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 17px; margin-bottom: 26px; }
  .page-heading > form, .page-heading > form .btn { width: 100%; }
  .page-title { font-size: 38px; }
  .plan-hero { align-items: flex-start; flex-direction: column; gap: 17px; padding: 22px 20px; }
  .shopping-progress { width: 100%; }
  .list-toolbar { align-items: flex-start; padding: 15px 16px; }
  .item-groups { padding: 4px 16px 12px; }
  .grocery-row { grid-template-columns: 28px minmax(0,1fr) auto; gap: 8px; min-height: 58px; }
  .grocery-row > .row-actions { grid-column: 2 / -1; display: none; }
  .shopping-panel .grocery-row { grid-template-columns: 30px minmax(0,1fr) auto; min-height: 66px; }
  .shopping-panel .check-button { width: 27px; height: 27px; }
  .quick-add { padding: 15px; }
  .quick-add-form { grid-template-columns: minmax(0,1fr) 80px; }
  .quick-add-form label:nth-of-type(3) { display: grid; grid-column: 1 / -1; }
  .quick-add-form .quick-add-name { grid-column: 1 / -1; }
  .quick-add-form > .btn { grid-column: 1 / -1; width: 100%; }
  .finish-list-form { justify-content: stretch; }
  .finish-list-form .btn { width: 100%; }
  .catalog-layout { gap: 14px; }
  .catalog-panel { padding: 0 15px 17px; }
  .history-card { grid-template-columns: 1fr; gap: 13px; padding: 19px; }
  .history-actions { justify-content: flex-start; }
  .history-actions form:first-child, .history-actions form:first-child .btn { width: 100%; }
  .mobile-nav { position: fixed; inset: auto 0 0; z-index: 10; display: grid; grid-template-columns: repeat(4,1fr); gap: 3px; padding: 7px 8px calc(7px + env(safe-area-inset-bottom)); background: var(--deep); box-shadow: 0 -7px 25px rgba(24,62,50,.13); }
  .mobile-nav-link { display: flex; align-items: center; flex-direction: column; gap: 4px; padding: 8px 2px; color: #d0dbd0; font-size: 10px; text-decoration: none; border-radius: 8px; }
  .mobile-nav-link.active { color: #fffdf4; background: #2a5144; box-shadow: inset 0 2px var(--terracotta); }
}

/* Personal dashboard and PIN gate */
.dashboard-body, .login-body { min-height: 100vh; background: var(--oat); }
.dashboard-shell { min-height: 100vh; }
.dashboard-header { display: flex; align-items: center; justify-content: space-between; min-height: 82px; padding: 14px clamp(20px,6vw,88px); background: var(--paper); border-bottom: 1px solid var(--line); }
.dashboard-brand { display: inline-flex; align-items: center; gap: 12px; color: var(--deep); text-decoration: none; }
.dashboard-brand-mark { display: grid; place-items: center; width: 40px; height: 40px; color: var(--deep); background: var(--terracotta); border-radius: 13px 13px 13px 4px; }
.dashboard-brand strong, .dashboard-brand small { display: block; }
.dashboard-brand strong { font: 600 20px var(--serif); letter-spacing: -.035em; }
.dashboard-brand small { margin-top: 3px; color: #79847a; font-size: 9px; letter-spacing: .14em; }
.dashboard-header-actions { display: flex; align-items: center; gap: 14px; }
.dashboard-date { display: inline-flex; align-items: center; gap: 8px; color: #657168; font-size: 12px; }
.dashboard-content { width: min(1120px,100%); margin: 0 auto; padding: 54px clamp(20px,6vw,88px) 44px; }
.dashboard-welcome { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; min-height: 202px; padding: 32px 36px; background: var(--green-light); border: 1px solid #d5e2d2; border-radius: 17px; }
.dashboard-welcome h1 { margin: 0; color: #1e3c30; font: 500 clamp(35px,5vw,52px)/1.05 var(--serif); letter-spacing: -.045em; }
.dashboard-welcome > div:first-child > p:last-child { margin: 12px 0 0; color: #637268; font-size: 14px; }
.welcome-decoration { position: absolute; top: 50%; right: 10%; display: grid; place-items: center; width: 86px; height: 86px; color: #54765c; background: rgba(255,253,246,.46); border: 1px solid rgba(64,103,72,.16); border-radius: 27px 27px 27px 7px; transform: translateY(-50%) rotate(7deg); }
.dashboard-overview { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 15px; margin: 18px 0 44px; }
.overview-card { display: flex; align-items: center; gap: 13px; min-height: 82px; padding: 16px 17px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
.overview-icon { display: grid; place-items: center; width: 42px; height: 42px; color: #41684a; background: #e9eee3; border-radius: 12px 12px 12px 4px; }
.overview-card > div { display: grid; gap: 4px; }
.overview-label { color: #7c867c; font-size: 11px; }
.overview-card strong { color: #284635; font: 500 17px var(--serif); }
.overview-link { display: grid; place-items: center; width: 33px; height: 33px; margin-left: auto; color: #587061; background: #f2f0e8; border-radius: 50%; }
.overview-link:hover { background: #e5eadf; }
.dashboard-section { margin-top: 37px; }
.dashboard-section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 17px; }
.dashboard-section-heading .eyebrow { margin-bottom: 6px; }
.dashboard-section-heading h2 { margin: 0; color: #254533; font: 500 26px var(--serif); letter-spacing: -.02em; }
.section-note { color: #7c867c; font-size: 12px; }
.app-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.app-card { display: flex; flex-direction: column; min-height: 221px; padding: 20px; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 13px; text-decoration: none; box-shadow: 0 8px 26px rgba(45,57,42,.025); transition: border-color .18s, transform .18s, box-shadow .18s; }
.app-card:hover { border-color: #b8cbb7; box-shadow: 0 12px 30px rgba(45,57,42,.075); transform: translateY(-2px); }
.app-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.app-icon { display: grid; place-items: center; width: 45px; height: 45px; color: #355e43; background: #e9eee3; border-radius: 14px 14px 14px 5px; }
.status-badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px; color: #607063; background: #f0eee6; border-radius: 99px; font-size: 10px; font-weight: 700; }
.status-badge i { width: 7px; height: 7px; background: #8d968b; border-radius: 50%; }
.status-badge.online { color: #34714c; background: #e7f0e6; }
.status-badge.online i { background: #4c9a64; }
.status-badge.offline { color: #944d3e; background: #f7e9e2; }
.status-badge.offline i { background: #c76b58; }
.status-badge.unknown { color: #73756d; background: #f0eee6; }
.app-card h3 { margin: 17px 0 0; color: #284635; font: 500 20px var(--serif); }
.app-card p { min-height: 38px; margin: 6px 0 17px; color: #758077; font-size: 12px; line-height: 1.55; }
.app-card-open { display: inline-flex; align-items: center; gap: 6px; margin-top: auto; color: #3c6748; font-size: 12px; font-weight: 700; }
.app-empty { padding: 22px; color: #778177; background: var(--paper); border: 1px dashed #d8d4c8; border-radius: 12px; font-size: 13px; }
.info-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 13px; }
.info-card { display: flex; align-items: flex-start; gap: 13px; padding: 18px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
.info-card-icon { display: grid; place-items: center; width: 36px; height: 36px; color: #41684a; background: #e9eee3; border-radius: 11px 11px 11px 4px; }
.info-card h3 { margin: 1px 0 6px; color: #294636; font: 500 17px var(--serif); }
.info-card p { margin: 0; color: #778177; font-size: 12px; line-height: 1.6; }
.info-card a { display: inline-flex; align-items: center; gap: 4px; margin-top: 11px; color: #3c6748; font-size: 12px; font-weight: 700; text-decoration: none; }
.weather-card { position: relative; display: grid; grid-template-columns: minmax(0,1fr) minmax(300px,.9fr); align-items: center; gap: 28px; padding: 23px 25px 34px; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; }
.weather-main { display: flex; align-items: flex-start; gap: 16px; }
.weather-icon { display: grid; place-items: center; flex: 0 0 48px; width: 48px; height: 48px; color: #41684a; background: #e9eee3; border-radius: 15px 15px 15px 5px; }
.weather-current { position: relative; min-height: 106px; }
.weather-current .eyebrow { margin: 0 0 5px; color: #7c867c; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.weather-current h2 { margin: 0; color: #294636; font: 500 20px var(--serif); }
.weather-condition { margin: 4px 0 0; color: #778177; font-size: 12px; }
.weather-temperature { position: absolute; top: 0; right: 0; color: #294636; font: 500 38px/1 var(--serif); letter-spacing: -.05em; }
.weather-temperature span { font-size: 25px; vertical-align: top; }
.weather-details { margin: 12px 0 0; color: #778177; font-size: 11px; }
.weather-error { margin: 10px 0 0; color: #944d3e; font-size: 12px; line-height: 1.5; }
.weather-forecast { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.weather-day { display: grid; gap: 7px; min-width: 0; padding: 12px 10px; background: #f7f6f0; border-radius: 10px; }
.weather-day > span { color: #536557; font-size: 11px; font-weight: 700; }
.weather-day small { overflow: hidden; color: #858c81; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.weather-day strong { color: #294636; font-size: 13px; }
.weather-day strong span { margin-left: 5px; color: #90968b; font-weight: 500; }
.weather-updated { position: absolute; right: 25px; bottom: 11px; margin: 0; color: #9a9d94; font-size: 9px; }
.dashboard-footer { margin-top: 46px; padding-top: 18px; color: #8b9086; border-top: 1px solid #e6e1d5; font-size: 11px; }
.dashboard-footer code { color: #526b58; }

.login-body { display: grid; place-items: center; padding: 20px; }
.login-card { width: min(100%,420px); padding: 38px; text-align: center; background: var(--paper); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 15px 45px rgba(45,57,42,.07); }
.login-mark { display: grid; place-items: center; width: 56px; height: 56px; margin: 0 auto 23px; color: #315c41; background: #e9eee3; border-radius: 18px 18px 18px 5px; }
.login-card .eyebrow { margin-bottom: 8px; }
.login-card h1 { margin: 0; color: #214632; font: 500 32px var(--serif); letter-spacing: -.035em; }
.login-intro { margin: 9px 0 23px; color: #768177; font-size: 13px; }
.login-form { display: grid; gap: 10px; text-align: left; }
.login-form label { color: #647168; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.login-form input { min-height: 48px; font-size: 19px; letter-spacing: .22em; text-align: center; }
.login-form .btn { width: 100%; margin-top: 4px; }
.login-error, .login-setup-note { margin: 0 0 16px; padding: 11px 12px; color: #8d493e; background: #f8eae4; border: 1px solid #efd5ca; border-radius: 9px; font-size: 12px; line-height: 1.5; text-align: left; }
.login-setup-note { color: #5b665e; background: #f1efe7; border-color: #e4dfd2; }
.login-setup-note code { color: #315c41; }
.login-session-note { margin: 18px 0 0; color: #92958d; font-size: 11px; }
.visually-hidden { position: absolute !important; overflow: hidden !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }

@media (max-width: 900px) {
  .app-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 700px) {
  .dashboard-header { min-height: 69px; padding: 11px 17px; }
  .dashboard-brand strong { font-size: 18px; }
  .dashboard-brand small { font-size: 8px; }
  .dashboard-brand-mark { width: 36px; height: 36px; }
  .dashboard-header-actions { gap: 4px; }
  .dashboard-date { display: none; }
  .dashboard-content { padding: 28px 17px 36px; }
  .dashboard-welcome { min-height: 172px; padding: 25px 22px; }
  .dashboard-welcome > div:first-child > p:last-child { max-width: 250px; font-size: 13px; line-height: 1.5; }
  .welcome-decoration { top: auto; right: 17px; bottom: 16px; width: 47px; height: 47px; transform: rotate(7deg); }
  .dashboard-overview { grid-template-columns: 1fr; gap: 9px; margin: 12px 0 35px; }
  .overview-card { min-height: 72px; }
  .dashboard-section { margin-top: 30px; }
  .dashboard-section-heading h2 { font-size: 24px; }
  .section-note { max-width: 130px; font-size: 10px; text-align: right; }
  .app-grid { grid-template-columns: 1fr; gap: 10px; }
  .app-card { min-height: 190px; padding: 17px; }
  .app-card p { min-height: 0; }
  .info-grid { grid-template-columns: 1fr; }
  .weather-card { grid-template-columns: 1fr; gap: 16px; padding: 18px 17px 34px; }
  .weather-current { min-height: 104px; }
  .weather-temperature { right: 0; }
  .weather-forecast { gap: 6px; }
  .weather-day { padding: 10px 8px; }
  .weather-day small { font-size: 9px; }
  .weather-updated { right: 17px; }
  .login-card { padding: 32px 23px; }
}

@media (max-width: 390px) {
  .page { padding-right: 14px; padding-left: 14px; }
  .grocery-name { font-size: 13px; }
  .category-add-form { grid-template-columns: 1fr; }
  .category-add-form .btn { width: 100%; }
  .history-actions form:first-child .btn { white-space: normal; }
}

/* Jens' private, reorderable start page */
.dashboard-content { width: min(1160px,100%); padding-top: 46px; }
.tile-grid {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  align-items: stretch;
  gap: 15px;
}
.dashboard-tile {
  position: relative;
  min-width: 0;
  min-height: 166px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 13px;
  box-shadow: 0 7px 22px rgba(45,57,42,.035);
  transition: border-color .18s, transform .18s, box-shadow .18s, opacity .18s;
}
.dashboard-tile:hover { border-color: #b8cbb7; box-shadow: 0 11px 28px rgba(45,57,42,.075); transform: translateY(-2px); }
.dashboard-tile.is-dragging { opacity: .42; transform: scale(.985); }
.dashboard-tile.is-drop-target { border-color: #709273; }
.tile-app-link {
  display: flex;
  min-height: 164px;
  flex-direction: column;
  align-items: flex-start;
  padding: 19px 19px 16px;
  color: var(--ink);
  text-decoration: none;
}
.tile-app-link:focus-visible { border-radius: 13px; }
.tile-heading { display: flex; width: 100%; align-items: center; gap: 12px; }
.tile-icon {
  display: grid;
  flex: 0 0 41px;
  place-items: center;
  width: 41px;
  height: 41px;
  color: #355e43;
  background: #e9eee3;
  border-radius: 13px 13px 13px 5px;
}
.tile-name { margin: 0; color: #284635; font: 500 18px/1.2 var(--serif); }
.tile-description { margin: 14px 0 0; color: #758077; font-size: 12px; line-height: 1.55; }
.tile-open { display: inline-flex; align-items: center; gap: 5px; margin-top: auto; padding-top: 14px; color: #3c6748; font-size: 11px; font-weight: 700; }
.tile-status { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; color: #607063; font-size: 10px; white-space: nowrap; }
.tile-status i { width: 7px; height: 7px; background: #8d968b; border-radius: 50%; }
.tile-status.online i { background: #4c9a64; }
.tile-status.offline i { background: #c76b58; }
.tile-controls { position: absolute; top: 8px; right: 8px; z-index: 2; display: flex; gap: 2px; opacity: 0; transition: opacity .16s; }
.dashboard-tile:hover .tile-controls, .dashboard-tile:focus-within .tile-controls { opacity: 1; }
.tile-move {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  color: #607063;
  background: rgba(255,253,246,.94);
  border: 1px solid #e8e2d5;
  border-radius: 8px;
  cursor: pointer;
}
.tile-move:hover:not(:disabled) { color: #294638; background: #e9eee3; }
.tile-move:disabled { opacity: .35; cursor: not-allowed; }
.tile-drag-handle { position: absolute; top: 16px; right: 48px; display: grid; place-items: center; width: 24px; height: 24px; color: #9aa397; cursor: grab; touch-action: none; }
.tile-drag-handle:active { cursor: grabbing; }
.weather-tile { min-height: 166px; padding: 16px; background: #eef2e9; border-color: #dbe4d6; }
.weather-tile .tile-heading { padding-right: 54px; }
.weather-tile .tile-icon { flex-basis: 37px; width: 37px; height: 37px; }
.weather-tile .tile-name { font-size: 16px; }
.weather-tile .tile-description { margin-top: 11px; }
.weather-tile .weather-compact-current { display: flex; align-items: baseline; gap: 8px; margin-top: 10px; color: #617366; font-size: 11px; }
.weather-compact-current strong { color: #294636; font: 500 26px/1 var(--serif); letter-spacing: -.04em; }
.weather-compact-current span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.weather-tile .weather-forecast { gap: 5px; margin-top: 12px; }
.weather-tile .weather-day { gap: 4px; padding: 8px 7px; background: rgba(255,253,246,.62); }
.weather-tile .weather-day > span { font-size: 10px; }
.weather-tile .weather-day small { font-size: 9px; }
.weather-tile .weather-day strong { font-size: 11px; }
.weather-tile .weather-updated { position: static; margin-top: 9px; font-size: 9px; }
.weather-config-note { margin: 13px 0 0; color: #637268; font-size: 11px; line-height: 1.5; }
.school-menu-tile { min-height: 0; padding: 16px; }
.school-menu-tile .tile-heading { padding-right: 54px; }
.school-menu-tile .tile-icon { flex-basis: 37px; width: 37px; height: 37px; }
.school-menu-tile .tile-name { font-size: 16px; }
.school-menu-week { margin: 13px 0 7px; color: #718073; font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.school-menu-today { min-height: 64px; padding: 12px; background: #f5f6ef; border-radius: 10px; }
.school-menu-today-label { color: #45604b; font-size: 10px; font-weight: 700; }
.school-menu-today-dish { margin: 6px 0 0; color: #354b3b; font-size: 13px; line-height: 1.45; }
.school-menu-no-today { margin: 4px 0; color: #68766b; font-size: 12px; line-height: 1.45; }
.school-menu-days { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.school-menu-days li { display: grid; gap: 3px; padding: 8px 0; border-top: 1px solid #eeeae0; }
.school-menu-day-label { display: flex; justify-content: space-between; gap: 8px; color: #45604b; font-size: 10px; font-weight: 700; }
.school-menu-day-label time { color: #92998f; font-size: 9px; font-weight: 500; }
.school-menu-dish { color: #636e64; font-size: 11px; line-height: 1.4; overflow-wrap: anywhere; }
.school-menu-updated { margin: 8px 0 0; color: #899087; font-size: 9px; }
.school-menu-open, .school-menu-source { display: inline-flex; align-items: center; gap: 5px; margin-top: 10px; padding: 0; color: #3c6748; background: none; border: 0; font: inherit; font-size: 10px; font-weight: 700; text-decoration: none; cursor: pointer; }
.school-menu-source:hover { text-decoration: underline; }
.school-menu-open:hover { text-decoration: underline; }
.school-menu-open:focus-visible, .school-menu-close:focus-visible { outline: 3px solid #719777; outline-offset: 3px; border-radius: 4px; }
.school-menu-dialog { width: min(540px, calc(100% - 28px)); max-width: 540px; max-height: min(82dvh, 720px); margin: auto; padding: 0; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 17px; box-shadow: 0 24px 80px rgba(22,38,27,.22); }
.school-menu-dialog::backdrop { background: rgba(20,34,25,.48); backdrop-filter: blur(3px); }
.school-menu-dialog-content { max-height: min(82dvh, 720px); overflow-y: auto; padding: 24px; }
.school-menu-dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.school-menu-dialog-heading .school-menu-week { margin: 0 0 7px; }
.school-menu-dialog-heading h2 { margin: 0; color: #284635; font: 500 22px/1.2 var(--serif); }
.school-menu-close { display: grid; flex: 0 0 36px; place-items: center; width: 36px; height: 36px; padding: 0; color: #45604b; background: #eef2e9; border: 0; border-radius: 10px; font-size: 25px; line-height: 1; cursor: pointer; }
.school-menu-dialog .school-menu-days { margin-top: 18px; }
.school-menu-dialog .school-menu-days li { padding: 12px 0; }
.school-menu-dialog .school-menu-day-label { font-size: 12px; }
.school-menu-dialog .school-menu-day-label time { font-size: 10px; }
.school-menu-dialog .school-menu-dish { font-size: 13px; }
.ekuriren-news-tile { min-height: 0; padding: 16px; }
.ekuriren-news-tile .tile-heading { padding-right: 54px; }
.ekuriren-news-tile .tile-icon { flex-basis: 37px; width: 37px; height: 37px; }
.ekuriren-news-tile .tile-name { font-size: 16px; }
.ekuriren-news-list { display: grid; gap: 0; margin: 14px 0 0; padding: 0; list-style: none; }
.ekuriren-news-list li { padding: 10px 0; border-top: 1px solid #eeeae0; }
.ekuriren-news-meta { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 4px; color: #899087; font-size: 9px; }
.ekuriren-news-meta span { overflow: hidden; color: #52715a; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.ekuriren-news-headline { display: -webkit-box; overflow: hidden; color: #354b3b; font-size: 12px; font-weight: 600; line-height: 1.4; text-decoration: none; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.ekuriren-news-headline:hover { color: #2f6b45; text-decoration: underline; }
.ekuriren-news-updated { margin: 8px 0 0; color: #899087; font-size: 9px; }
.ekuriren-news-all { display: inline-flex; align-items: center; gap: 5px; margin-top: 10px; color: #3c6748; font-size: 10px; font-weight: 700; text-decoration: none; }
.ekuriren-news-all:hover { text-decoration: underline; }
.tile-status-message { min-height: 22px; margin: 18px 0 0; color: #637268; font-size: 12px; }
.tile-status-message[data-state="error"] { color: #944d3e; }
.dashboard-footer { margin-top: 30px; }

@media (max-width: 900px) {
  .tile-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 700px) {
  .dashboard-content { padding: 28px 17px 36px; }
  .tile-grid { grid-template-columns: 1fr; gap: 10px; }
  .dashboard-tile, .weather-tile, .school-menu-tile, .ekuriren-news-tile { min-height: 0; }
  .tile-app-link { min-height: 132px; padding: 17px; }
  .tile-controls { opacity: 1; }
  .tile-drag-handle { right: 48px; }
  .weather-tile { padding: 15px; }
  .weather-tile .weather-forecast { max-width: 100%; }
  .school-menu-dialog-content { padding: 20px; }
  .tile-status-message { margin-top: 13px; }
}
