:root {
  --bg: #f3ecdd;
  --surface: #fffaf1;
  --text: #2a2620;
  --muted: #776f62;
  --line: #e2d8c4;
  --accent: #0f7b5f;
  --accent-ink: #ffffff;
  --sale: #c62f52;
  --radius: 14px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 16px; }
h2 { margin: 0; font-size: 18px; letter-spacing: -0.01em; }

/* App shell: fixed sidebar + main content */
.app { --sidebar-w: 232px; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 20; display: flex; flex-direction: column; gap: 20px; padding: 18px 14px; background: #ebe1cc; border-right: 1px solid var(--line); }
/* A column at least as tall as the screen, so the footer sits at the bottom even on short pages. */
.main { margin-left: var(--sidebar-w); min-width: 0; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.brand { display: flex; gap: 10px; align-items: center; padding: 0 6px; }
.brand-name { font-weight: 800; font-size: 18px; letter-spacing: -0.01em; }
.logo { width: 34px; height: 34px; flex: none; }
.brand-i { color: var(--accent); }
.nav { display: flex; flex-direction: column; gap: 2px; margin-bottom: auto; } /* pushes account, update time and collapse button to the bottom */
.nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; color: var(--text); text-decoration: none; font-weight: 500; }
.nav-item svg, .menu-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.nav-item:hover { background: rgb(255 255 255 / 0.5); }
.nav-item[aria-current="page"] { background: var(--surface); color: var(--accent); font-weight: 650; box-shadow: 0 1px 2px rgb(60 45 20 / 0.08); }
.nav-count { margin-left: auto; min-width: 20px; padding: 1px 7px; border-radius: 999px; background: #f6e3b4; color: #8a5a00; font-size: 12px; font-weight: 700; text-align: center; }
.nav-count[hidden] { display: none; }
/* Bottom of the sidebar: collapses it to an icon rail (desktop only). */
/* Icon only, padded like a nav item so its icon sits in the same column as the nav icons. */
.collapse-btn { align-self: flex-start; display: grid; place-items: center; margin-top: -8px; padding: 9px 10px; border: 0; border-radius: 10px; background: none; color: var(--muted); cursor: pointer; }
.collapse-btn:hover { background: rgb(255 255 255 / 0.5); color: var(--text); }
.collapse-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.2s ease; }

/* Collapsed sidebar (desktop only): an icon rail; labels become tooltips (titles set by app.js). */
@media (min-width: 1025px) {
  .sidebar, .main { transition: width 0.2s ease, margin-left 0.2s ease; }
  .app.sidebar-collapsed { --sidebar-w: 68px; }
  .sidebar-collapsed .sidebar { padding-left: 10px; padding-right: 10px; }
  .sidebar-collapsed .brand { justify-content: center; padding: 0; }
  .sidebar-collapsed .collapse-btn { align-self: center; }
  .sidebar-collapsed .avatar-btn { flex: none; padding: 2px; border-radius: 50%; }
  .sidebar-collapsed .account-text, .sidebar-collapsed .account-more { display: none; }
  .sidebar-collapsed .collapse-btn svg { transform: scaleX(-1); }
  .sidebar-collapsed .brand-name,
  .sidebar-collapsed .nav-item > span:not(.nav-count),
  .sidebar-collapsed .sidebar-foot { display: none; }
  .sidebar-collapsed .nav-item { position: relative; justify-content: center; padding: 10px 0; }
  .sidebar-collapsed .nav-count { position: absolute; top: 2px; right: 2px; min-width: 16px; padding: 0 4px; font-size: 10px; line-height: 16px; }
  .sidebar-collapsed .account { margin-top: auto; justify-content: center; padding-left: 0; padding-right: 0; }
  /* "Login" shrinks to a round person icon. */
  .sidebar-collapsed .login-btn { flex: none; width: 40px; height: 40px; padding: 0; font-size: 0; border-radius: 50%;
    background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21a8 8 0 0 1 16 0'/%3E%3C/svg%3E") no-repeat center / 20px; }
}
@media (max-width: 1024px) {
  .collapse-btn { display: none; }
}
.sidebar-foot { display: flex; align-items: center; margin: -14px 0 0; padding: 0 10px; color: var(--muted); font-size: 12px; }
.sidebar-foot::before { content: ''; flex: none; width: 7px; height: 7px; margin: 0 15.5px 0 5.5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px rgb(15 123 95 / 0.15); }
.sidebar-foot.busy::before { background: #d99a00; box-shadow: 0 0 0 3px rgb(217 154 0 / 0.2); animation: pulse 1.2s ease-in-out infinite; }
/* Account box under the "updated" note: Google sign-in button or the signed-in user. */
.account { display: flex; align-items: center; gap: 10px; padding: 12px 0 0; border-top: 1px solid var(--line); }
.account[hidden] { display: none; }
.google-btn { width: 100%; display: inline-flex; padding: 10px 16px; align-items: center; justify-content: center; gap: 10px; text-decoration: none; font-weight: 600; font-size: 14px; }
.google-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.google-btn:disabled:hover { border-color: var(--line); }
.g-logo { width: 18px; height: 18px; flex: none; }
.login-btn { flex: 1; font-weight: 600; background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.login-btn:hover { filter: brightness(1.08); }
.login-dialog { width: min(380px, calc(100% - 32px)); padding: 28px 24px 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); text-align: center; box-shadow: 0 16px 48px rgb(40 30 15 / 0.25); }
.login-dialog::backdrop { background: rgb(42 38 32 / 0.45); }
.login-dialog .logo { width: 44px; height: 44px; }
.login-dialog h2 { margin: 12px 0 4px; }
.login-dialog .sub { margin-bottom: 20px; }
.login-close-form { position: absolute; top: 8px; right: 8px; margin: 0; }
.login-close { width: 32px; height: 32px; border: 0; border-radius: 50%; background: none; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; }
.login-close:hover { background: var(--bg); color: var(--text); }
.login-note[hidden] { display: none; }
.login-note { margin: 12px 0 0; color: var(--muted); font-size: 12px; }
/* Signed in: just the avatar in the sidebar; it opens the profile dialog. */
/* Bottom of the sidebar follows the nav grid: icons/avatar/dot centered on the icon column,
   text starting where the nav labels start. */
.avatar-btn { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; padding: 6px; border: 0; border-radius: 10px; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.avatar-btn:hover, .avatar-btn:focus-visible { background: rgb(255 255 255 / 0.5); outline: none; }
.avatar-btn .avatar { flex: none; width: 26px; height: 26px; font-size: 12px; box-shadow: 0 0 0 2px var(--surface); }
.account-more { flex: none; width: 16px; height: 16px; margin-left: auto; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: 0.7; }
.avatar-btn:hover .account-more { opacity: 1; }
.account-text { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.account-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-name { font-weight: 600; font-size: 14px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; display: inline-grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 15px; line-height: 1; }
.profile-dialog .avatar { width: 72px; height: 72px; font-size: 28px; }
.profile-dialog h2 { margin: 12px 0 2px; overflow-wrap: anywhere; }
.profile-dialog .sub { margin-bottom: 18px; overflow-wrap: anywhere; }
.profile-facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; margin: 0 0 14px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); text-align: left; font-size: 14px; }
.profile-facts dt { color: var(--muted); }
.profile-facts dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.profile-facts .muted { color: var(--muted); }
.profile-facts small { display: block; color: var(--muted); font-size: 12px; }
.profile-actions { display: flex; flex-direction: column; gap: 8px; }
.profile-actions .btn { width: 100%; }
.scrim { display: none; }
.view[hidden] { display: none; }

.page-head { display: flex; align-items: center; gap: 12px; padding-top: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.page-title { flex: 1; min-width: 0; }
.menu-btn { display: none; border: 1px solid var(--line); background: var(--surface); color: var(--text); width: 38px; height: 38px; border-radius: 10px; place-items: center; cursor: pointer; }
h1 { margin: 0; font-size: 24px; letter-spacing: -0.02em; }
.sub { margin: 0; color: var(--muted); font-size: 13px; }
.btn { border: 1px solid var(--line); background: var(--surface); color: var(--text); padding: 8px 14px; border-radius: 999px; font: inherit; cursor: pointer; }
.btn:hover { border-color: var(--accent); }
.btn:disabled { opacity: 0.6; cursor: progress; }

/* Weekly brochures */
.brochures-wrap { padding-top: 20px; padding-bottom: 8px; }
.hint { margin: 4px 0 12px; color: var(--muted); font-size: 13px; }
.brochures { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.brochure { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--c); border-radius: var(--radius); color: inherit; text-decoration: none; transition: transform 0.12s, box-shadow 0.12s; }
.brochure:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgb(60 45 20 / 0.1); }
.brochure .bname { font-weight: 700; font-size: 16px; overflow-wrap: anywhere; }
.brochure .blogo { height: 30px; width: auto; max-width: min(160px, 100%); object-fit: contain; object-position: left center; margin-bottom: 4px; }
.brochure .bbranch { color: var(--muted); font-size: 13px; }
.brochure .bopen { margin-top: 4px; font-size: 13px; font-weight: 600; color: var(--c); }

/* Deal filters */
.filters { position: sticky; top: 0; z-index: 5; margin-top: 16px; background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(8px); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.deals-title { padding-top: 14px; }
.stores { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 0; }
.store { flex: none; display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.store .dot { width: 9px; height: 9px; border-radius: 50%; }
.store .tlogo { height: 20px; width: auto; max-width: 110px; object-fit: contain; }
.store[aria-pressed="true"] .tlogo { background: #fff; border-radius: 4px; padding: 1px 3px; }
.store .n { color: var(--muted); font-size: 13px; }
.store[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.store[aria-pressed="true"] .n { color: inherit; opacity: 0.7; }
.store .warn { color: var(--sale); font-size: 12px; }

.tools { display: flex; gap: 8px; padding-bottom: 12px; }
.tools input, .tools select { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; }
.tools input { flex: 1; min-width: 0; }
/* Own chevron with room around it; the native one sits flush against the right edge. */
.tools select { appearance: none; -webkit-appearance: none; padding-right: 38px; cursor: pointer; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23776f62' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center / 16px; }
.tools select:hover { border-color: var(--accent); }
.tools input:focus, .tools select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

.layout { display: grid; grid-template-columns: 240px 1fr; gap: 24px; padding-top: 18px; padding-bottom: 60px; }
.cats { position: sticky; top: 190px; align-self: start; display: flex; flex-direction: column; gap: 2px; max-height: calc(100vh - 210px); overflow-y: auto; }
.cat { display: flex; justify-content: space-between; gap: 8px; text-align: left; padding: 7px 10px; border-radius: 8px; border: 0; background: none; color: var(--text); font: inherit; cursor: pointer; }
.cat:hover { background: var(--surface); }
.cat .n { color: var(--muted); font-variant-numeric: tabular-nums; }
.cat[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.cat[aria-pressed="true"] .n { color: inherit; opacity: 0.8; }
.cat[disabled] { opacity: 0.35; cursor: default; }
.cat-row { display: flex; align-items: center; gap: 2px; }
.cat-row .cat { flex: 1; min-width: 0; }
.star { flex: none; width: 30px; height: 30px; border: 0; border-radius: 8px; background: none; color: var(--muted); font-size: 16px; line-height: 1; cursor: pointer; opacity: 0.45; }
.cat-row:hover .star, .star:focus-visible { opacity: 1; }
.star-spacer { flex: none; width: 30px; }
.star:hover { background: var(--surface); color: #c98a00; }
.star[aria-pressed="true"] { color: #d99a00; opacity: 1; }
.cats-head { margin: 0 0 2px; padding: 0 10px; font-size: 12px; font-weight: 700; color: #a77400; text-transform: uppercase; letter-spacing: 0.05em; }
.cats-sep { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; width: calc(100% - 8px); }

.count { margin: 0 0 12px; color: var(--muted); font-size: 13px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.card { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; color: inherit; text-decoration: none; transition: transform 0.12s, box-shadow 0.12s; }
.card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgb(60 45 20 / 0.1); }
.card .img { aspect-ratio: 1; background: #fff; display: grid; place-items: center; padding: 12px; }
.card img { max-width: 100%; max-height: 100%; object-fit: contain; }
.card .pct { position: absolute; top: 10px; left: 10px; background: var(--sale); color: #fff; font-weight: 700; font-size: 13px; padding: 3px 8px; border-radius: 999px; }
.card .src { position: absolute; top: 10px; right: 10px; font-size: 11px; font-weight: 700; color: #fff; padding: 3px 8px; border-radius: 999px; }
.card .body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card .brandname { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.03em; }
.card .name { font-size: 14px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .prices { margin-top: auto; display: flex; align-items: baseline; gap: 8px; padding-top: 6px; }
.card .price { font-size: 20px; font-weight: 800; color: var(--sale); letter-spacing: -0.01em; }
.card .old { color: var(--muted); text-decoration: line-through; font-size: 13px; }
.card .deal { font-size: 12px; font-weight: 600; color: var(--accent); }
.card .until { font-size: 12px; color: var(--muted); }
.empty { color: var(--muted); text-align: center; padding: 40px 0; }

/* Narrow screens: the sidebar becomes a slide-in drawer opened by the menu button. */
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.2s ease; box-shadow: 4px 0 24px rgb(60 45 20 / 0.15); }
  .app.menu-open .sidebar { transform: none; }
  .app.menu-open .scrim { display: block; position: fixed; inset: 0; z-index: 15; background: rgb(40 30 15 / 0.3); }
  .main { margin-left: 0; }
  .menu-btn { display: grid; }
}

@media (max-width: 760px) {
  h1 { font-size: 20px; }
  .page-head .sub { display: none; }
  .layout { grid-template-columns: 1fr; gap: 12px; }
  .cats { position: static; flex-direction: row; overflow-x: auto; max-height: none; padding-bottom: 4px; }
  .cat { flex: none; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
  .cat-row { flex: none; }
  .star-spacer { display: none; }
  .star { opacity: 1; }
  .cats-head { align-self: center; white-space: nowrap; padding: 0 4px; }
  .cats-sep { width: auto; height: 24px; margin: auto 4px; border-top: 0; border-left: 1px solid var(--line); }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card .price { font-size: 17px; }
  /* Brochures: one row of compact tiles that scrolls sideways, edge to edge, instead of tall cards
     that filled the first screen. The whole tile is the link; ↗ in the corner replaces the text. */
  .brochures { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 2px 16px 6px; scrollbar-width: none; }
  .brochures::-webkit-scrollbar { display: none; }
  .brochure { position: relative; flex: 0 0 148px; gap: 4px; padding: 10px 12px; border-left-width: 4px; scroll-snap-align: start; scroll-margin-left: 16px; }
  .brochure::after { content: '↗'; position: absolute; top: 8px; right: 10px; font-size: 13px; font-weight: 700; color: var(--c); }
  .brochure:hover { transform: none; }
  .brochure .blogo { height: 20px; max-width: calc(100% - 16px); margin-bottom: 0; }
  .brochure .bname { font-size: 14px; padding-right: 14px; }
  .brochure .bbranch { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .brochure .bopen { display: none; }
}

/* Dashboard */
.dash { padding-top: 20px; padding-bottom: 60px; display: flex; flex-direction: column; gap: 14px; }
.dash h2 { margin-top: 10px; }
.dash-banner { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 12px; font-size: 14px; }
.dash-banner.running { background: #e3efe8; color: #0d5e48; }
.dash-banner.bad { background: #f8e1e5; color: #9b1f3d; }
.pulse { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.25; transform: scale(0.7); } }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.tile { display: flex; flex-direction: column; gap: 2px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.tile .tlabel { color: var(--muted); font-size: 13px; }
.tile .tvalue { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; }
.tile .tvalue small { font-size: 16px; color: var(--muted); font-weight: 600; }
.tile .tnote { color: var(--muted); font-size: 12px; }
.tile.ok .tvalue { color: var(--accent); }
.tile.bad .tvalue { color: var(--sale); }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.dtable { width: 100%; border-collapse: collapse; font-size: 14px; }
.dtable th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.dtable td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.dtable tr:last-child td { border-bottom: 0; }
.dtable .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dtable .muted, .dash .muted { color: var(--muted); font-size: 12px; }
.dtable .err { color: var(--sale); font-size: 12px; margin-top: 4px; max-width: 320px; }
.svc { display: flex; flex-direction: column; gap: 2px; }
.svc img { height: 20px; width: auto; max-width: 120px; object-fit: contain; object-position: left center; }
.svc span { color: var(--muted); font-size: 12px; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill.ok { background: #dcefe5; color: #0d5e48; }
.pill.bad { background: #f8e1e5; color: #9b1f3d; }
.pill.run { background: #fdf0d2; color: #8a5a00; }
.pill.muted { background: #ece5d6; color: var(--muted); }

.dtable .seg-row td { vertical-align: middle; background: #f3ecdd; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; padding: 8px 14px; }
.btn-sm { padding: 4px 12px; font-size: 13px; }
.dtable .seg-row .btn { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--text); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; max-width: calc(100% - 32px); padding: 10px 16px; border-radius: 12px; background: var(--text); color: var(--bg); font-size: 14px; box-shadow: 0 8px 24px rgb(40 30 15 / 0.25); }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 12px; }
.pager .btn:disabled { cursor: default; }
.btn-icon { width: 30px; height: 30px; padding: 0; font-size: 18px; line-height: 1; display: inline-grid; place-items: center; }

/* Wolt offers near you (Food Promotions) */
.wolt { padding-top: 24px; padding-bottom: 8px; }
.wolt-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.wolt-head .hint { display: flex; align-items: center; gap: 8px; }
.wolt .grid { margin-top: 4px; }
.wolt-tools { padding: 12px 0 4px; max-width: 420px; }
.wolt-card .img { aspect-ratio: 16 / 9; padding: 0; overflow: hidden; background: #e9e1d0; }
.wolt-card .wolt-img img { width: 100%; height: 100%; max-width: none; max-height: none; object-fit: cover; }
.wolt-offers { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.wolt-offer { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.wolt-offer.discount { background: #f8e1e5; color: #9b1f3d; }
.wolt-offer.delivery { background: #dcefe5; color: #0d5e48; }
.wolt-meta { margin-top: auto; padding-top: 6px; }
.wolt-more { display: block; margin: 14px auto 0; }

/* Raw crawler errors (dashboard): owners only, collapsed under "Technical details". */
.err-details { margin-top: 4px; font-size: 12px; color: var(--muted); max-width: 320px; }
.err-details summary { cursor: pointer; }
.err-details code { display: block; margin-top: 4px; padding: 6px 8px; border-radius: 6px; background: var(--bg); font-size: 11px; overflow-wrap: anywhere; white-space: pre-wrap; }
html:not(.is-owner) .err-details { display: none; }

/* Refresh buttons are for owners only (html.is-owner, set by auth.js); the server enforces it too. */
html:not(.is-owner) .crawl-btn, html:not(.is-owner) [data-refresh-seg] { display: none; }

/* Favorites */
.favs-tools { padding-top: 12px; }
.favs { padding-top: 20px; padding-bottom: 60px; display: flex; flex-direction: column; gap: 32px; }
.fav-block { display: flex; flex-direction: column; gap: 12px; }
.fav-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.fav-head .n { color: var(--muted); font-size: 13px; }
.fav-head a { margin-left: auto; color: var(--accent); font-size: 13px; font-weight: 600; text-decoration: none; }
.fav-head a:hover { text-decoration: underline; }
.fav-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.fav-chip { display: flex; align-items: center; border: 1px solid #ecd6a0; background: #fdf5e1; border-radius: 999px; }
.fav-chip button { border: 0; background: none; font: inherit; color: var(--text); cursor: pointer; padding: 5px 4px 5px 12px; }
.fav-chip button:hover span:first-child { text-decoration: underline; }
.fav-chip .n { color: var(--muted); font-size: 13px; margin-left: 4px; }
.fav-chip .unstar { padding: 5px 10px 5px 6px; color: #d99a00; }
.fav-chip .unstar:hover { color: var(--sale); }
.fav-more { align-self: center; text-decoration: none; font-weight: 600; color: var(--accent); }
.fav-empty { padding: 48px 16px; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); }
.fav-empty strong { display: block; color: var(--text); font-size: 17px; margin-bottom: 6px; }
.fav-empty .links .btn { text-decoration: none; }
.fav-empty .links { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.seg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card .no-price { font-size: 13px; font-weight: 600; color: var(--muted); }

/* ── Follow your discount (public/expiry.js) ─────────────────────────────────────────────── */
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:disabled { filter: none; cursor: not-allowed; }
.follow { display: flex; flex-direction: column; gap: 16px; padding-top: 20px; padding-bottom: 40px; }
.follow-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.follow-card h2 { margin-bottom: 2px; }
.follow-login { max-width: 560px; }
.follow-head, .cal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cal-head { align-items: center; margin-bottom: 12px; }
.follow-pick { display: flex; gap: 8px; }
.follow-pick .btn { cursor: pointer; }
.follow-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.tray-empty { margin: 12px 0 0; color: var(--muted); font-size: 14px; }

.tray { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.tray-item { display: flex; flex-direction: column; gap: 4px; font-size: 13px; min-width: 0; }
.tray-thumb { position: relative; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: var(--bg); border: 2px solid var(--line); }
.tray-item.done .tray-thumb { border-color: var(--accent); }
.tray-item.failed .tray-thumb { border-color: var(--sale); }
.tray-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tray-item.checking .tray-thumb img { opacity: 0.55; }
.tray-x { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border: 0; border-radius: 50%; background: rgb(42 38 32 / 0.65); color: #fff; font-size: 17px; line-height: 1; cursor: pointer; }
.tray-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tray-status { color: var(--muted); display: flex; align-items: center; gap: 6px; }
.tray-status.ok { color: var(--accent); font-weight: 600; }
.tray-status.bad { color: var(--sale); }
.tray-fix { display: flex; gap: 6px; align-items: center; }
.tray-fix input { min-width: 0; flex: 1; font: inherit; font-size: 12px; padding: 3px 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); }
.spin { width: 12px; height: 12px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.cal-nav { display: flex; gap: 6px; align-items: center; }
/* Compact calendar on the left, Upcoming beside it; stacked on narrow screens. */
.follow-split { display: grid; grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); gap: 16px; align-items: start; }
.follow-split .cal-head h2 { font-size: 16px; }
.follow-split .cal-day { min-height: 0; aspect-ratio: 1; padding: 3px; gap: 2px; align-items: center; }
.follow-split .cal-num { font-size: 12px; }
.follow-split .cal-day .chip { width: 6px; height: 6px; padding: 0; border-radius: 50%; font-size: 0; display: inline-block; }
.follow-split .cal-day .chip.use_by { background: #c62f52; }
.follow-split .cal-day .chip.best_before { background: #d99a00; }
.follow-split .cal-day .chip.more { display: none; }
.cal-dots { display: flex; gap: 2px; flex-wrap: wrap; justify-content: center; }
@media (max-width: 900px) {
  .follow-split { grid-template-columns: minmax(0, 1fr); }
}
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-wd { color: var(--muted); font-size: 12px; font-weight: 600; text-align: center; padding-bottom: 2px; }
.cal-day { min-height: 82px; padding: 4px; border-radius: 8px; background: var(--bg); display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-day.other { opacity: 0.45; }
.cal-day.today { outline: 2px solid var(--accent); outline-offset: -2px; }
.cal-num { font-size: 12px; font-weight: 600; color: var(--muted); }
.cal-day.today .cal-num { color: var(--accent); }
.chip { display: block; padding: 1px 6px; border-radius: 6px; font-size: 11px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip.use_by { background: #f8e1e5; color: #9b1f3d; }
.chip.best_before { background: #fdf0d2; color: #8a5a00; }
.chip.more { background: none; color: var(--muted); padding: 0 6px; }
.cal-legend { display: flex; gap: 8px; margin: 10px 0 0; }
.cal-legend .chip { display: inline-block; }

.upcoming { list-style: none; margin: 0; padding: 0; }
.upcoming li { display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.upcoming li.past { opacity: 0.55; }
.upcoming li.soon .up-when b { color: var(--sale); }
/* Today = the product's last day, when stores usually discount it: highlight the whole row. */
.upcoming li.today { margin: 0 -10px; padding: 10px 10px 10px 7px; border-top-color: transparent; border-left: 3px solid var(--accent); border-radius: 10px; background: #e3f1ea; }
.upcoming li.today + li { border-top-color: transparent; }
.upcoming li.today .up-when b { color: var(--accent); }
.up-when { display: flex; flex-direction: column; font-size: 13px; }
.up-when span { color: var(--muted); font-size: 12px; }
.up-what { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.up-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
.up-loc { display: flex; align-items: center; gap: 4px; min-width: 0; padding-left: 6px; color: var(--muted); }
.up-loc svg { width: 14px; height: 14px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; }
.up-loc input { min-width: 0; flex: 1; font: inherit; font-size: 13px; padding: 2px 6px; border: 1px solid transparent; border-radius: 8px; background: none; color: var(--text); }
.up-loc input::placeholder { color: var(--muted); }
.up-loc input:hover, .up-loc input:focus { border-color: var(--line); background: var(--bg); outline: none; }
.up-what .chip { flex: none; }
.up-name { min-width: 0; flex: 1; font: inherit; font-weight: 600; padding: 4px 6px; border: 1px solid transparent; border-radius: 8px; background: none; color: var(--text); }
.up-name:hover, .up-name:focus { border-color: var(--line); background: var(--bg); outline: none; }
.up-tools { display: flex; gap: 6px; align-items: center; }
.up-tools input { font: inherit; font-size: 13px; padding: 3px 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); }

@media (max-width: 760px) {
  .follow-pick { width: 100%; }
  .follow-pick .btn { flex: 1; text-align: center; }
  .cal-day { min-height: 54px; }
  .cal-day .chip { font-size: 0; height: 6px; padding: 0; } /* phones: a coloured dot per product */
  .cal-day .chip.more { display: none; }
  .upcoming li { grid-template-columns: 1fr; gap: 6px; }
}

/* Footer (every page): one row of links and one line of small print. */
.site-footer { margin-top: auto; flex: none; padding: 14px 0 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.footer-inner { display: flex; flex-direction: column; gap: 6px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.site-footer a { color: var(--text); font-weight: 600; text-decoration: none; }
.site-footer a:hover { color: var(--accent); text-decoration: underline; }
.footer-note { margin: 0; width: 100%; line-height: 1.45; }
.main > .view:not([hidden]) { padding-bottom: 32px; }

.legal { max-width: 760px; margin: 0; padding-top: 12px; padding-bottom: 8px; line-height: 1.6; }
.legal h2 { margin: 28px 0 8px; font-size: 18px; }
.legal p, .legal ul { margin: 0 0 12px; }
.legal ul { padding-left: 20px; }
.legal li { margin-bottom: 8px; }
.legal a { color: var(--accent); }
.contact-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 12px; margin: 8px 0 16px; }
.contact-card { display: flex; gap: 12px; align-items: flex-start; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: inherit; text-decoration: none; transition: transform 0.12s, box-shadow 0.12s; }
.contact-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgb(60 45 20 / 0.1); }
.contact-card svg { flex: none; width: 26px; height: 26px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.contact-card span { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; font-size: 14px; }
.contact-card b { font-size: 15px; line-height: 26px; } /* = icon height, so the icon centres on the title line */

/* "Please check before you go": scraped offers can be wrong or out of date. */
.data-note { margin: 4px 0 12px; padding: 10px 14px; border: 1px solid #ecd9a8; border-left: 4px solid #d9a21b; border-radius: 10px; background: #fbf1d6; color: #5c4a1c; font-size: 13px; line-height: 1.45; }
.data-note b { color: #3f3210; }
