
  /* Layout: φιλική αρχική με κάρτες-συνόψεις, κάτω μπάρα πλοήγησης (Αρχική, Νέα, Τιμές, Καθημερινά, Εγώ) και υπο-καρτέλες ανά ομάδα */
  :root {
    --bg: #eef3f6;
    --surface: #ffffff;
    --fg: #172531;
    --muted: #586a76;
    --line: #d9e2e8;
    --accent: #1f7a8c;
    --accent-soft: #dcf0f3;
    --accent-fg: #ffffff;
    --mark: #8f4a0a;
    --mark-bg: #fbeed7;
    --good: #1c6b3a;
    --good-bg: #dff1e5;
    --danger: #a62a2a;
    --danger-bg: #fbe3e3;
    --font-body: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-display: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --shadow: 0 1px 2px rgba(23,37,49,.06), 0 4px 14px rgba(23,37,49,.05);
  }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      --bg: #0d151b;
      --surface: #16212a;
      --fg: #e7eef3;
      --muted: #94a6b2;
      --line: #263541;
      --accent: #6cc3d5;
      --accent-soft: #17323a;
      --accent-fg: #062730;
      --mark: #f1b560;
      --mark-bg: #2d2412;
      --good: #7fd09a;
      --good-bg: #16301f;
      --danger: #ee8b8b;
      --danger-bg: #381a1a;
      color-scheme: dark;
    }
  }
  :root[data-theme="dark"] {
    --bg: #0d151b;
    --surface: #16212a;
    --fg: #e7eef3;
    --muted: #94a6b2;
    --line: #263541;
    --accent: #6cc3d5;
    --accent-soft: #17323a;
    --accent-fg: #062730;
    --mark: #f1b560;
    --mark-bg: #2d2412;
    --good: #7fd09a;
    --good-bg: #16301f;
    --danger: #ee8b8b;
    --danger-bg: #381a1a;
    color-scheme: dark;
  }

  html { font-size: calc(16px * var(--tz, 1)); }
  * { box-sizing: border-box; }
  body {
    background: var(--bg);
    color: var(--fg);
    font-family: var(--font-body);
    font-size: calc(16px * var(--tz, 1));
    line-height: 1.55;
    padding-block: 22px 110px;
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
  }
  .wrap { max-width: 860px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }
  h1, h2, h3 { margin: 0; text-wrap: balance; }
  h1 { font-family: var(--font-display); font-size: 1.75rem; line-height: 1.2; font-weight: 700; letter-spacing: -0.02em; }
  h2 { font-family: var(--font-display); font-size: 1.1rem; line-height: 1.3; font-weight: 700; letter-spacing: -0.01em; }
  h3 { font-size: 1.02rem; font-weight: 600; line-height: 1.35; }
  p { margin: 0; }
  a { color: inherit; }
  button, input, select, textarea { font: inherit; color: inherit; }
  :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

  header { display: flex; flex-direction: column; gap: 2px; }
  #subtitle { color: var(--muted); font-size: 0.95rem; }
  #note { position: sticky; top: 0; z-index: 30; background: var(--mark-bg); color: var(--mark); border-radius: 12px; padding: 12px 14px; font-size: 0.9rem; }

  .route { display: flex; flex-direction: column; gap: 18px; }
  .stamp { color: var(--muted); font-size: 0.875rem; font-variant-numeric: tabular-nums; }

  /* Υπο-καρτέλες */
  .pills { display: flex; flex-wrap: wrap; gap: 8px; }
  .pill {
    background: var(--surface); border: 1px solid var(--line); border-radius: 999px; white-space: nowrap;
    padding: 8px 16px; cursor: pointer; font-weight: 500; font-size: 0.92rem;
  }
  .pill[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }

  /* Κάτω πλοήγηση */
  .bottomnav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    background: var(--surface); border-top: 1px solid var(--line);
    padding-top: 6px;
    padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
    padding-left: max(8px, env(safe-area-inset-left, 0px));
    padding-right: max(8px, env(safe-area-inset-right, 0px));
  }
  .bottomnav .in { max-width: 860px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
  .nb {
    background: none; border: 0; border-radius: 14px; padding: 7px 2px; cursor: pointer; color: var(--muted);
    display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 0.72rem; font-weight: 600; min-width: 0;
  }
  .nb svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .nb[aria-selected="true"] { color: var(--accent); background: var(--accent-soft); }

  /* Κάρτες αρχικής */
  .tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
  @media (min-width: 640px) { .tiles { grid-template-columns: repeat(4, 1fr); } }
  .tile {
    background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 14px;
    text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 4px; min-width: 0; min-height: 112px;
    box-shadow: var(--shadow); transition: transform .12s ease, border-color .12s ease;
  }
  .tile:active { transform: scale(.98); }
  .tile.dim { min-height: 0; background: transparent; box-shadow: none; border-style: dashed; }
  .tile.dim .v { font-size: 1.1rem; color: var(--muted); }
  .tile.hero { grid-column: 1 / -1; min-height: 0; flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; }
  .tile.hero .v { white-space: nowrap; font-size: 2rem; font-weight: 700; letter-spacing: -0.02em; }
  .tile.hero .l { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  .qa { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .qa .btn { align-self: stretch; text-align: center; display: flex; align-items: center; justify-content: center; min-height: 46px; background: var(--surface); box-shadow: var(--shadow); font-size: .8rem; line-height: 1.2; padding: 8px 4px; overflow-wrap: break-word; hyphens: auto; min-width: 0; }
  .qa .btn.main { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
  .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .tile:hover { border-color: var(--accent); }
  .hrow { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
  .hrow .htxt { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
  .iconbtn { flex: 0 0 44px; width: 44px; height: 44px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--accent); display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: var(--shadow); }
  .iconbtn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .sfield { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; text-align: left; box-shadow: var(--shadow); }
  .sfield span { min-width: 0; overflow-wrap: anywhere; }
  .fab { position: fixed; z-index: 25; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(84px + env(safe-area-inset-bottom, 0px)); width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-fg); font-size: 2rem; line-height: 1; cursor: pointer; box-shadow: 0 6px 18px rgba(0, 0, 0, .28); }
  .sheet { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .45); display: flex; align-items: flex-end; justify-content: center; }
  .sheet-in { background: var(--surface); color: var(--fg); width: 100%; max-width: 560px; max-height: 90vh; overflow: auto; border-radius: 20px 20px 0 0; padding-top: 18px; padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px)); padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); display: flex; flex-direction: column; gap: 12px; }
  .sheet-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
  .sheet-form { display: flex; flex-direction: column; gap: 10px; }
  .sheet-form label { display: flex; flex-direction: column; gap: 4px; font-size: .9rem; color: var(--muted); }
  a.sres { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; min-height: 48px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); text-decoration: none; overflow-wrap: anywhere; }
  a.sres .t { font-weight: 600; }
  a.sres .s { color: var(--muted); font-size: .85rem; }
  .today li { display: flex; flex-wrap: wrap; align-items: center; gap: 0 8px; border-top: 1px solid var(--line); }
  .today li:first-child { border-top: 0; }
  .today li a { flex: 1 1 200px; border-top: 0; }
  .today li .btnrow { padding: 0 0 10px 34px; }
  .tile { min-height: 92px; }
  .pills { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .pills::-webkit-scrollbar { display: none; }
  .pill { flex: 0 0 auto; }
  details.help.fold { padding: 2px 16px; }
  details.help.fold > summary { padding: 13px 0; min-height: 44px; }
  details.help.fold form.add, details.help.fold form.profile { gap: 12px; }
  .route > h2 { font-size: 1.02rem; margin-top: 4px; }
  .today { border-left: 5px solid var(--accent); }
  .today h2 { font-size: 1.05rem; }
  .today ul, .chg ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
  .today li a { display: flex; gap: 10px; align-items: flex-start; text-decoration: none; color: var(--fg); min-height: 44px; padding: 8px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
  .today li:first-child a { border-top: 0; }
  .today .ic { flex: 0 0 24px; text-align: center; color: var(--accent); font-weight: 700; }
  .today li.warn .ic, .today li.warn b { color: var(--mark); }
  .chg li { padding: 6px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
  .chg li:first-child { border-top: 0; }
  .mini3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .mini3 .stat { padding: 10px; }
  .mini3 .stat .v { font-size: 1.05rem; }
  .trend.mini svg { height: 52px; }
  .sbtn { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 10px 12px; text-align: left; background: var(--surface); color: var(--fg); border: 1px solid var(--line); border-radius: 14px; cursor: pointer; font-size: 1rem; }
  .sbtn .bx { flex: 0 0 26px; height: 26px; border: 2px solid var(--accent); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--accent-fg); font-weight: 700; }
  .sbtn[aria-pressed="true"] { opacity: .6; }
  .sbtn[aria-pressed="true"] .bx { background: var(--accent); }
  .sbtn[aria-pressed="true"] .t { text-decoration: line-through; }
  .sbtn .t { flex: 1; min-width: 0; overflow-wrap: anywhere; }
  .sbtn .p { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
  .rowx { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
  .rowx input[type="text"], .rowx input[type="date"] { flex: 1 1 120px; width: auto; }
  ul.rows > li.wrapx { flex-wrap: wrap; }
  .tile .k { color: var(--muted); font-size: 0.8rem; font-weight: 600; }
  .tile .v { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em; font-size: 1.5rem; line-height: 1.15; font-variant-numeric: tabular-nums; overflow-wrap: break-word; }
  .tile .s { color: var(--muted); font-size: 0.82rem; overflow-wrap: anywhere; }
  .tile.alert { border-color: var(--mark); }

  .banner { background: var(--mark-bg); color: var(--mark); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
  .banner b { font-weight: 700; }

  .chips { display: flex; flex-wrap: wrap; gap: 8px; }
  .chip {
    background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
    padding: 7px 14px; cursor: pointer; font-size: 0.9rem;
  }
  .chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
  .chip .n { opacity: 0.7; font-variant-numeric: tabular-nums; margin-left: 4px; }

  .section { display: flex; flex-direction: column; gap: 10px; }
  .section > h2 { padding-top: 6px; }
  .section.top > h2 { color: var(--mark); }

  .item {
    background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
    padding: 15px; display: flex; flex-direction: column; gap: 6px; min-width: 0;
  }
  .item .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 0.82rem; color: var(--muted); }
  .badge { white-space: nowrap; flex-shrink: 0; background: var(--mark-bg); color: var(--mark); border-radius: 6px; padding: 1px 9px; font-weight: 700; font-size: 0.72rem; letter-spacing: 0.03em; }
  .badge.new { background: var(--accent); color: var(--accent-fg); }
  .badge.good { background: var(--good-bg); color: var(--good); }
  .badge.bad { background: var(--danger-bg); color: var(--danger); }
  .item h3 a { text-decoration: none; overflow-wrap: anywhere; }
  .item h3 a:hover { text-decoration: underline; }
  .item .sum { overflow-wrap: anywhere; }
  .item .why { color: var(--muted); font-size: 0.9rem; overflow-wrap: anywhere; }
  .item .why b { color: var(--fg); font-weight: 600; }
  .item.read { opacity: 0.62; }

  .panel {
    background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow);
    padding: 18px; display: flex; flex-direction: column; gap: 12px; min-width: 0;
  }
  .panel p.hint { color: var(--muted); font-size: 0.9rem; }
  .panel.brief { border-left: 5px solid var(--accent); }
  .newshome { border-left: 6px solid var(--accent); display: flex; flex-direction: column; gap: 12px; }
  .newshome .nh-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
  .newshome h2 { font-size: 1.3rem; margin: 0; }
  .newshome h3.nh-sub { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; margin: 0; color: var(--muted, inherit); }
  .newshome ul.nh-brief { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
  .newshome ul.nh-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
  .newshome ul.nh-list li { padding: 12px 0; border-top: 1px solid var(--line, rgba(128,128,128,.25)); display: flex; flex-direction: column; gap: 4px; }
  .newshome ul.nh-list li.read a { opacity: .6; }
  .newshome ul.nh-list a { font-weight: 650; font-size: 1.02rem; line-height: 1.35; display: block; padding: 2px 0; }
  label.dismiss { display: inline-flex !important; flex-direction: row !important; width: fit-content !important; align-self: flex-start; align-items: center; gap: 8px; min-height: 36px; padding: 4px 10px; margin-top: 6px; font-size: .8rem; color: var(--muted, #5b6b78); border: 1px solid var(--border, #d5dee5); border-radius: 999px; cursor: pointer; width: auto; }
  label.dismiss input { width: 16px !important; height: 16px !important; min-height: 0 !important; padding: 0 !important; flex: 0 0 auto; margin: 0; accent-color: var(--accent); }
  .newshome .nh-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: .85rem; }
  .panel.brief h2 { font-size: 1.05rem; }
  .panel.brief ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
  textarea.cmd { width: 100%; resize: none; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px; min-height: 76px; }
  details.help { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 4px 18px; }
  details.help summary { cursor: pointer; padding: 12px 0; font-weight: 600; }
  details.help .body { display: flex; flex-direction: column; gap: 12px; padding-bottom: 16px; }

  .btn { background: var(--accent); color: var(--accent-fg); border: 0; border-radius: 12px; padding: 11px 18px; font-weight: 600; cursor: pointer; align-self: flex-start; }
  .btn.quiet { background: none; color: var(--accent); border: 1px solid var(--line); }
  .btn.danger { color: var(--danger); }
  .btn.small { padding: 8px 12px; font-size: 0.85rem; min-height: 38px; }
  select { min-height: 42px; }
  .btn:disabled { opacity: 0.5; cursor: default; }
  a.btn { text-decoration: none; display: inline-block; }
  .btnrow { display: flex; flex-wrap: wrap; gap: 8px; }

  form.add { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  form.add .full { grid-column: 1 / -1; }
  form.profile { display: flex; flex-direction: column; }
  label { display: flex; flex-direction: column; gap: 4px; font-size: 0.82rem; color: var(--muted); min-width: 0; }
  input[type="text"], input[type="url"], input[type="search"], input[type="date"], select {
    background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; width: 100%; min-width: 0;
  }
  @media (max-width: 480px) { form.add { grid-template-columns: 1fr; } }

  ul.rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
  ul.rows > li {
    background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
    padding: 13px 15px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  }
  ul.rows .info { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
  ul.rows .name { font-weight: 600; overflow-wrap: anywhere; }
  ul.rows .sub { color: var(--muted); font-size: 0.85rem; overflow-wrap: anywhere; }
  ul.rows .tag { font-size: 0.78rem; color: var(--accent); }
  ul.rows li.done .name { text-decoration: line-through; color: var(--muted); }

  .stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
  .stat { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 15px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  .stat .k { color: var(--muted); font-size: 0.82rem; }
  .stat .v { font-family: var(--font-display); font-weight: 700; font-size: 1.7rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
  .stat .s { color: var(--muted); font-size: 0.82rem; overflow-wrap: anywhere; }

  .tablewrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
  table { border-collapse: collapse; width: 100%; min-width: 640px; font-variant-numeric: tabular-nums; }
  th, td { text-align: left; padding: 11px 13px; border-bottom: 1px solid var(--line); vertical-align: top; }
  th { font-size: 0.74rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
  tr:last-child td { border-bottom: 0; }
  td.num, th.num { text-align: right; white-space: nowrap; }
  td.low { color: var(--good); font-weight: 700; }
  td.stale { color: var(--muted); }
  td:first-child { min-width: 170px; }
  td .addr { color: var(--muted); font-size: 0.82rem; }

  .trend svg { width: 100%; height: 84px; display: block; }
  .trend .line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
  .trend .dot { fill: var(--accent); }

  .wnow { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
  .wnow .big { font-family: var(--font-display); font-weight: 700; font-size: 3rem; line-height: 1; font-variant-numeric: tabular-nums; }
  .wday { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); }
  .wday:last-child { border-bottom: 0; }
  .wday .d { font-weight: 600; }
  .wday .c { color: var(--muted); font-size: 0.85rem; }
  .wday .t { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
  .wday .r { color: var(--accent); font-size: 0.85rem; font-variant-numeric: tabular-nums; min-width: 3ch; text-align: right; }

  .best { background: var(--good-bg); color: var(--good); border-radius: 12px; padding: 11px 13px; font-weight: 600; overflow-wrap: anywhere; }
  .req ul, .basket ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; font-size: 0.9rem; }

  .empty { color: var(--muted); padding: 12px 4px; }
  .empty b { color: var(--fg); }
