/* ============================================================================
   ESPA PROGRAMS — GLASS-EDITORIAL
   Black + lime (#CDFA8A) on near-black. Premium dark glassmorphism.
   Pure CSS, single <style> block. Inter via Google Fonts <link>.
   ============================================================================ */

/* ---------- 0. RESET ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { min-height: 100%; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
::selection { background: rgba(205,250,138,0.28); color: #fff; }

/* ---------- 1. TOKENS ---------- */
:root {
  /* Page + surfaces (step up in lightness) */
  --bg:            hsl(240 15% 3%);      /* #07070b deep near-black */
  --bg-2:          hsl(240 14% 4.5%);    /* gradient base partner   */
  --surface:       hsl(240 12% 7.5%);    /* ~#14141a card           */
  --surface-2:     hsl(240 12% 10%);     /* ~#1a1a22 raised         */
  --surface-3:     hsl(240 11% 13%);     /* hover / active raise     */
  --glass:         hsla(240 14% 9% / 0.55);
  --glass-strong:  hsla(240 16% 11% / 0.72);

  /* Borders — whisper thin */
  --line:          hsla(0 0% 100% / 0.07);
  --line-2:        hsla(0 0% 100% / 0.10);
  --line-strong:   hsla(0 0% 100% / 0.14);

  /* Brand — lime accent, used sparingly */
  --accent:        #CDFA8A;
  --accent-ink:    #0c1207;              /* text on lime fills       */
  --accent-soft:   hsla(86 92% 76% / 0.14);
  --accent-line:   hsla(86 92% 76% / 0.30);
  --accent-glow:   hsla(86 92% 76% / 0.20);

  /* Text */
  --text:          hsl(60 9% 96%);       /* near-white               */
  --text-2:        hsl(240 8% 72%);      /* secondary                */
  --text-3:        hsl(240 7% 52%);      /* muted / meta             */
  --text-faint:    hsl(240 7% 38%);

  /* Status hues */
  --warn:          #f5c462;   --warn-soft:  hsla(40 88% 67% / 0.14);  --warn-line: hsla(40 88% 67% / 0.30);
  --danger:        #ff8a8a;   --danger-soft:hsla(0 100% 77% / 0.13);  --danger-line:hsla(0 100% 77% / 0.30);
  --info:          #9ec4ff;   --info-soft:  hsla(217 100% 81% / 0.13); --info-line: hsla(217 100% 81% / 0.30);

  /* Radii */
  --r-xs: 8px;  --r-sm: 11px;  --r-md: 14px;  --r-lg: 18px;  --r-xl: 22px;  --r-pill: 999px;

  /* Shadows — soft + large */
  --shadow-sm:  0 1px 2px hsla(240 30% 2% / 0.4);
  --shadow-md:  0 12px 30px -12px hsla(240 40% 1% / 0.7);
  --shadow-lg:  0 30px 70px -28px hsla(240 50% 1% / 0.8);
  --shadow-glow: 0 0 0 1px var(--accent-line), 0 14px 40px -16px var(--accent-glow);

  /* Motion */
  --ease:     cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur:      .42s;
  --dur-fast: .2s;

  /* Layout */
  --maxw:        1320px;
  --gutter:      clamp(18px, 3.4vw, 44px);
  --island-w:    348px;
  --header-h:    62px;       /* floating pill height */
  --header-gap:  14px;       /* gap between viewport top and the pill */
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

/* ---------- 2. PAGE + GRADIENT MESH ---------- */
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  letter-spacing: -0.011em;
  font-feature-settings: "cv05" 1, "ss01" 1, "tnum" 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  position: relative;
  /* No overflow-x clamp on <body>: `hidden` (and `clip`, via viewport
     propagation) forces overflow-y to `auto`, making <body> a scroll container
     that breaks `position: sticky` on the .island sidebar. Horizontal overflow
     is prevented instead by the grid min-width:0 / max-width:100% guards plus
     the .filters row's own overflow-x. Verified: no document-level h-scroll at
     desktop (1440) or mobile (390). */
}

/* Green-tinted corner mesh — fixed, very low opacity */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(58vw 48vh at 8% -6%,  hsla(86 92% 70% / 0.10), transparent 60%),
    radial-gradient(52vw 46vh at 104% 4%, hsla(86 80% 64% / 0.07), transparent 58%),
    radial-gradient(60vw 60vh at 92% 108%, hsla(150 60% 50% / 0.06), transparent 62%),
    radial-gradient(46vw 40vh at -8% 96%, hsla(86 90% 66% / 0.05), transparent 60%);
}
/* Subtle vignette for depth */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(120vw 100vh at 50% -20%, transparent 55%, hsla(240 40% 1% / 0.55) 100%);
}
.app, .site-header { position: relative; z-index: 1; }

/* ---------- 3. HEADER / NAV ---------- */
/* Floating pill header (Panagiotis-brand style): a detached rounded bar that
   overlays the page; the page scrolls underneath it. */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  padding: var(--header-gap) var(--gutter) 0;
  pointer-events: none;           /* let clicks pass through the side gutters */
}
.site-header__inner {
  pointer-events: auto;
  max-width: var(--maxw);
  height: var(--header-h);
  margin: 0 auto;
  padding: 0 12px 0 20px;
  display: flex;
  align-items: center;
  gap: 22px;
  background: hsla(240 16% 8% / 0.48);
  backdrop-filter: blur(20px) saturate(165%);
  -webkit-backdrop-filter: blur(20px) saturate(165%);
  border: 1px solid var(--line-2);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-md), inset 0 1px 0 hsla(0 0% 100% / 0.06);
  transition: background var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease),
              max-width var(--dur) var(--ease);
}
/* Densify + darken once the page is scrolled (toggled in JS) */
.site-header.is-scrolled .site-header__inner {
  max-width: calc(var(--maxw) - 96px);
  background: hsla(240 18% 4% / 0.82);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-lg), inset 0 1px 0 hsla(0 0% 100% / 0.06);
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  flex-shrink: 0;
}
.brand__logo {
  width: 30px;
  height: 30px;
  color: var(--accent);             /* logo SVG uses currentColor */
  filter: drop-shadow(0 0 12px hsla(86 92% 70% / 0.35));
}
.brand__name {
  font-size: 1.02rem;
  font-weight: 680;
  letter-spacing: -0.02em;
  color: var(--text);
}
.brand__name b { color: var(--accent); font-weight: 680; }

/* Top nav: Προγράμματα / Matches / Προφίλ */
.nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
  padding: 0;
  background: transparent;
  border: none;
}
.nav__link {
  position: relative;
  padding: 8px 17px;
  font-size: 0.9rem;
  font-weight: 540;
  color: var(--text-3);
  border-radius: var(--r-pill);
  transition: color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
  white-space: nowrap;
}
.nav__link:hover { color: var(--text); background: hsla(0 0% 100% / 0.04); }
.nav__link.is-active {
  color: var(--accent-ink);
  background: var(--accent);
  font-weight: 600;
  box-shadow: 0 6px 18px -8px var(--accent-glow);
}

/* ---------- 4. APP SHELL / TWO-COLUMN GRID ---------- */
.app {
  max-width: var(--maxw);
  margin: 0 auto;
  /* top pad clears the fixed floating pill (gap + pill height) */
  padding: calc(var(--header-gap) + var(--header-h) + clamp(18px, 2.4vw, 34px)) var(--gutter) 96px;
}
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--island-w);
  gap: clamp(20px, 2.4vw, 34px);
  align-items: start;
}

/* Page heading (editorial, large) */
.page-head { margin-bottom: clamp(20px, 2.6vw, 32px); }
.page-head__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}
.page-head__eyebrow::before {
  content: "";
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
}
.page-head__title {
  font-size: clamp(1.9rem, 4.2vw, 3rem);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.035em;
  color: var(--text);
}
.page-head__sub {
  margin-top: 12px;
  max-width: 56ch;
  font-size: 1rem;
  color: var(--text-2);
}

/* ============================================================================
   5. ISLAND — sticky floating control deck (desktop right column)
   ============================================================================ */
.island {
  position: sticky;
  top: calc(var(--header-gap) + var(--header-h) + 16px);
  max-height: calc(100vh - var(--header-gap) - var(--header-h) - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px;
  background: var(--glass-strong);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  border: 1px solid var(--line-2);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg), inset 0 1px 0 hsla(0 0% 100% / 0.05);
  animation: rise var(--dur) var(--ease) both;
}
/* sheen along the top edge */
.island::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, hsla(0 0% 100% / 0.18), transparent);
  border-radius: inherit;
}
.island__section { display: flex; flex-direction: column; gap: 12px; }
.island__label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
}

/* slim scrollbars (island + program list) */
.island::-webkit-scrollbar { width: 8px; }
.island::-webkit-scrollbar-thumb {
  background: hsla(0 0% 100% / 0.1);
  border-radius: var(--r-pill);
  border: 2px solid transparent;
  background-clip: padding-box;
}
.island::-webkit-scrollbar-thumb:hover { background: hsla(0 0% 100% / 0.18); background-clip: padding-box; }
.island { scrollbar-width: thin; scrollbar-color: hsla(0 0% 100% / 0.12) transparent; }

/* ---- 5a. Brand stat block (counts) ---- */
.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.stat {
  padding: 14px 14px 13px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  transition: border-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.stat:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.stat__num {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.stat--accent .stat__num { color: var(--accent); }
.stat__label {
  margin-top: 7px;
  font-size: 0.74rem;
  color: var(--text-3);
  letter-spacing: 0.01em;
}

/* ---- 5b. Scrape actions (↻ Νέα / ⟳ Πλήρες / 🎯 Rematch) ---- */
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.actions .btn--block { grid-column: 1 / -1; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 15px;
  font-size: 0.88rem;
  font-weight: 560;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  color: var(--text);
  transition: transform var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
  white-space: nowrap;
}
.btn:hover { background: var(--surface-3); border-color: var(--line-strong); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.985); }
.btn .ico { font-size: 1em; line-height: 1; }

/* primary lime — used sparingly (rematch / main CTA) */
.btn--primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: transparent;
  font-weight: 640;
  box-shadow: 0 10px 26px -12px var(--accent-glow);
}
.btn--primary:hover {
  background: hsl(86 92% 80%);
  box-shadow: var(--shadow-glow), 0 14px 32px -12px var(--accent-glow);
}
.btn--ghost { background: hsla(0 0% 100% / 0.03); }
.btn--ghost:hover { background: hsla(0 0% 100% / 0.06); }
.btn--sm { padding: 8px 12px; font-size: 0.82rem; border-radius: var(--r-xs); }

/* spinning icon while a scrape runs (add .is-loading on the button) */
.btn.is-loading { pointer-events: none; opacity: 0.75; }
.btn.is-loading .ico { animation: spin 0.9s linear infinite; }

/* ---- 5c. Last-scrape status ---- */
.status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  font-size: 0.8rem;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}
.status__dot {
  width: 8px; height: 8px; border-radius: 50%;
  flex-shrink: 0;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
  position: relative;
}
.status__dot--live::after {
  content: "";
  position: absolute; inset: -3px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  animation: ping 1.8s var(--ease) infinite;
}
.status__dot--stale { background: var(--warn); box-shadow: 0 0 0 4px var(--warn-soft); }
.status time { color: var(--text-3); margin-left: auto; font-variant-numeric: tabular-nums; }

/* ---- 5d. Search ---- */
.search { position: relative; }
.search__icon {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  color: var(--text-3); font-size: 0.95rem; pointer-events: none;
}
.search__input {
  width: 100%;
  padding: 11px 14px 11px 38px;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.search__input::placeholder { color: var(--text-faint); }
.search__input:focus {
  outline: none;
  border-color: var(--accent-line);
  background: var(--surface-2);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ---- 5e. Category filter tabs ---- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filter {
  padding: 8px 13px;
  font-size: 0.84rem;
  font-weight: 520;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  transition: all var(--dur-fast) var(--ease);
  display: inline-flex; align-items: center; gap: 7px;
}
.filter:hover { color: var(--text); border-color: var(--line-strong); background: var(--surface-2); }
.filter.is-active {
  color: var(--accent-ink);
  background: var(--accent);
  border-color: transparent;
  font-weight: 600;
}
.filter__count {
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  padding: 1px 6px;
  border-radius: var(--r-pill);
  background: hsla(0 0% 100% / 0.08);
  color: var(--text-3);
}
.filter.is-active .filter__count { background: hsla(86 60% 20% / 0.45); color: var(--accent-ink); }

/* ============================================================================
   6. PROGRAM LIST + CARDS
   ============================================================================ */
.list { display: flex; flex-direction: column; gap: 16px; }
.list__meta {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 4px;
  font-size: 0.84rem; color: var(--text-3);
}
.list__count b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

/* Pagination */
.pager {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 6px; margin-top: 26px; padding-top: 22px;
  border-top: 1px solid var(--line);
}
.pager__btn {
  min-width: 38px; height: 38px; padding: 0 11px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.86rem; font-weight: 540; font-variant-numeric: tabular-nums;
  color: var(--text-2); background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-sm); transition: all var(--dur-fast) var(--ease);
}
.pager__btn:hover { color: var(--text); border-color: var(--line-strong); background: var(--surface-2); }
.pager__btn.is-active {
  color: var(--accent-ink); background: var(--accent); border-color: transparent; font-weight: 640;
}
.pager__btn--nav { font-size: 1.1rem; line-height: 1; }
.pager__btn.is-disabled { opacity: 0.35; pointer-events: none; }
.pager__gap { color: var(--text-faint); padding: 0 2px; }

.card {
  position: relative;
  padding: 22px 22px 18px;
  background: var(--glass);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  animation: rise var(--dur) var(--ease) both;
}
.card:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-lg);
}
/* faint lime edge-glow on hover, top-left */
.card::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(60% 80% at 0% 0%, hsla(86 92% 70% / 0.08), transparent 70%);
  transition: opacity var(--dur) var(--ease);
}
.card:hover::after { opacity: 1; }

/* card header: title + score badge top-right */
.card__head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 14px;
}
.card__title {
  font-size: 1.18rem;
  font-weight: 640;
  line-height: 1.28;
  letter-spacing: -0.02em;
  color: var(--text);
}
.card:hover .card__title { color: #fff; }

/* score badge */
.score {
  flex-shrink: 0;
  display: inline-flex; align-items: baseline; gap: 2px;
  padding: 7px 12px;
  border-radius: var(--r-pill);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--accent);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  box-shadow: inset 0 0 14px hsla(86 92% 70% / 0.06);
}
.score__val { font-size: 1.02rem; line-height: 1; }
.score__pct { font-size: 0.72rem; font-weight: 600; opacity: 0.7; }
.score--mid { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn); }
.score--low { background: hsla(0 0% 100% / 0.05); border-color: var(--line-2); color: var(--text-3); }

/* pills (νοικοκυριά / ληγμένο / αναμένεται / επιχορήγηση / δάνειο) */
.pills { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 16px; }
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px;
  font-size: 0.74rem;
  font-weight: 560;
  letter-spacing: 0.005em;
  border-radius: var(--r-pill);
  background: hsla(0 0% 100% / 0.05);
  border: 1px solid var(--line);
  color: var(--text-2);
}
.pill--household { background: var(--info-soft);   border-color: var(--info-line);   color: var(--info); }
.pill--grant     { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
.pill--loan      { background: var(--warn-soft);   border-color: var(--warn-line);   color: var(--warn); }
.pill--expired   { background: var(--danger-soft); border-color: var(--danger-line); color: var(--danger); }
.pill--upcoming  { background: hsla(270 70% 80% / 0.12); border-color: hsla(270 70% 80% / 0.28); color: #c9b3ff; }

/* meta grid: region / deadline / budget / funding% */
.card__meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 18px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.meta-item { display: flex; align-items: center; gap: 9px; min-width: 0; }
.meta-item__ico {
  flex-shrink: 0;
  font-size: 0.95rem;
  width: 22px; text-align: center;
  opacity: 0.85;
}
.meta-item__body { min-width: 0; }
.meta-item__label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  line-height: 1.2;
}
.meta-item__val {
  font-size: 0.9rem;
  font-weight: 560;
  color: var(--text);
  line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.meta-item--accent .meta-item__val { color: var(--accent); }

.card__desc {
  margin: 14px 0 18px;
  font-size: 0.92rem;
  color: var(--text-2);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* card footer: Άνοιγμα ↗ */
.card__foot { display: flex; align-items: center; justify-content: flex-end; }
.link-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 16px;
  font-size: 0.86rem;
  font-weight: 580;
  color: var(--text);
  background: hsla(0 0% 100% / 0.04);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  transition: all var(--dur-fast) var(--ease);
}
.link-btn .arr { transition: transform var(--dur-fast) var(--ease); color: var(--accent); }
.link-btn:hover {
  color: var(--accent-ink);
  background: var(--accent);
  border-color: transparent;
  box-shadow: 0 8px 20px -10px var(--accent-glow);
}
.link-btn:hover .arr { transform: translate(2px, -2px); color: var(--accent-ink); }

/* ============================================================================
   7. MATCHES PAGE — profile picker
   ============================================================================ */
.toolbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 16px;
  background: var(--glass);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  margin-bottom: 22px;
}
.toolbar__field { display: flex; flex-direction: column; gap: 6px; flex: 1 1 220px; min-width: 0; }
.toolbar__field .island__label { margin-bottom: 2px; }

/* select (profile picker, region, etc.) */
.select {
  position: relative;
  display: flex; align-items: center;
}
.select select {
  width: 100%;
  appearance: none; -webkit-appearance: none;
  padding: 11px 38px 11px 14px;
  font-size: 0.9rem;
  font-weight: 520;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.select select:focus {
  outline: none;
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.select option { background: var(--surface-2); color: var(--text); }
.select::after {
  content: "";
  position: absolute; right: 15px; top: 50%;
  width: 8px; height: 8px;
  border-right: 1.6px solid var(--text-3);
  border-bottom: 1.6px solid var(--text-3);
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
}

/* ============================================================================
   8. PROFILES PAGE — form + saved list
   ============================================================================ */
.panel {
  padding: clamp(20px, 2.4vw, 28px);
  background: var(--glass);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  border: 1px solid var(--line-2);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-md);
}
.panel__title {
  font-size: 1.2rem;
  font-weight: 640;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}
.panel__hint { font-size: 0.88rem; color: var(--text-3); margin-bottom: 22px; }

.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field--full { grid-column: 1 / -1; }
.field__label {
  font-size: 0.78rem;
  font-weight: 560;
  color: var(--text-2);
  letter-spacing: 0.005em;
}
.field__label .opt { color: var(--text-faint); font-weight: 440; }
.input, .textarea {
  width: 100%;
  padding: 11px 14px;
  font-size: 0.92rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.input::placeholder, .textarea::placeholder { color: var(--text-faint); }
.input:focus, .textarea:focus {
  outline: none;
  border-color: var(--accent-line);
  background: var(--surface-2);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.textarea { resize: vertical; min-height: 96px; line-height: 1.55; }
.form__actions {
  grid-column: 1 / -1;
  display: flex; gap: 10px; justify-content: flex-end;
  margin-top: 6px; padding-top: 18px;
  border-top: 1px solid var(--line);
}

/* saved profiles list */
.profiles { display: flex; flex-direction: column; gap: 12px; margin-top: 22px; }
.profile {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  transition: border-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
  animation: rise var(--dur) var(--ease) both;
}
.profile:hover { border-color: var(--line-strong); transform: translateY(-1px); background: var(--surface-2); }
.profile__avatar {
  flex-shrink: 0;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: var(--r-sm);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--accent);
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: -0.02em;
}
.profile__body { min-width: 0; flex: 1; }
.profile__name {
  font-size: 1rem; font-weight: 600; color: var(--text);
  letter-spacing: -0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.profile__sub {
  margin-top: 3px;
  font-size: 0.82rem; color: var(--text-3);
  display: flex; flex-wrap: wrap; gap: 4px 12px;
}
.profile__sub span { display: inline-flex; align-items: center; gap: 5px; }
.profile__actions { display: flex; gap: 6px; flex-shrink: 0; }

/* icon-only action buttons (edit / matches / delete) */
.icon-btn {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  font-size: 0.98rem;
  border-radius: var(--r-sm);
  background: hsla(0 0% 100% / 0.03);
  border: 1px solid var(--line);
  color: var(--text-2);
  transition: all var(--dur-fast) var(--ease);
}
.icon-btn:hover { background: var(--surface-3); border-color: var(--line-strong); color: var(--text); transform: translateY(-1px); }
.icon-btn--accent:hover { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
.icon-btn--danger:hover { background: var(--danger-soft); border-color: var(--danger-line); color: var(--danger); }

/* ============================================================================
   9. EMPTY STATE
   ============================================================================ */
.empty {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 12px;
  padding: 56px 28px;
  background: var(--glass);
  border: 1px dashed var(--line-2);
  border-radius: var(--r-lg);
  color: var(--text-3);
}
.empty__icon { font-size: 2rem; opacity: 0.55; }
.empty__title { font-size: 1.05rem; font-weight: 600; color: var(--text-2); }
.empty__text { font-size: 0.9rem; max-width: 40ch; }

/* ============================================================================
   10. MOBILE ISLAND TOGGLE (hidden on desktop)
   ============================================================================ */
.island__toggle { display: none; }
.mobile-island-bar { display: none; }

/* ============================================================================
   11. RESPONSIVE — island collapses to TOP on mobile (<900px)
   ============================================================================ */
@media (max-width: 1100px) {
  :root { --island-w: 312px; }
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  /* island moves to top, becomes static (not sticky), reflows horizontally */
  .island {
    order: -1;
    position: static;
    max-height: none;
    overflow: visible;
    gap: 14px;
    padding: 16px;
    border-radius: var(--r-lg);
  }
  /* stats: keep 2-up but allow 4 across on wider phones/tablets */
  .stats { grid-template-columns: repeat(2, 1fr); }

  /* filters become a horizontally-scrollable thumb row */
  .filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    margin: 0 -4px;
    padding-left: 4px; padding-right: 4px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .filters::-webkit-scrollbar { display: none; }
  .filter { flex: 0 0 auto; scroll-snap-align: start; }

  /* actions: 3 across (Νέα / Πλήρες / Rematch) */
  .actions { grid-template-columns: repeat(3, 1fr); }
  .actions .btn--block { grid-column: auto; }

  /* collapsible: hide secondary island sections behind a toggle to keep top lean */
  .island__toggle {
    display: flex; align-items: center; justify-content: space-between;
    width: 100%;
    padding: 4px 2px;
    font-size: 0.74rem; font-weight: 600;
    letter-spacing: 0.12em; text-transform: uppercase;
    color: var(--text-3);
  }
  .island__toggle .chev {
    width: 8px; height: 8px;
    border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor;
    transform: rotate(45deg);
    transition: transform var(--dur-fast) var(--ease);
  }
  .island.is-collapsed .island__toggle .chev { transform: rotate(-135deg); }
  .island.is-collapsed .island__collapsible { display: none; }
  .island__collapsible { display: flex; flex-direction: column; gap: 14px; }
}

@media (max-width: 720px) {
  .form { grid-template-columns: 1fr; }
  .card__meta { grid-template-columns: 1fr; gap: 10px; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar .btn { width: 100%; }
}

@media (max-width: 560px) {
  :root { --header-h: 52px; --header-gap: 10px; }
  /* keep the pill a single row: logo-only brand + compact nav on the right */
  .site-header { padding-left: 12px; padding-right: 12px; }
  .site-header__inner { padding: 0 8px 0 14px; gap: 10px; }
  .brand__name { display: none; }
  .brand__logo { width: 26px; height: 26px; }
  .nav { margin-left: auto; gap: 2px; }
  .nav__link { padding: 7px 11px; font-size: 0.82rem; }

  .card { padding: 18px 16px 16px; }
  .card__head { gap: 12px; }
  .card__title { font-size: 1.06rem; }
  .actions { grid-template-columns: 1fr 1fr; }      /* 2-up on tiny screens */
  .actions .btn--block { grid-column: 1 / -1; }
  .stats { grid-template-columns: 1fr 1fr; }
  .profile { flex-wrap: wrap; }
  .profile__actions { width: 100%; justify-content: flex-end; }
}

/* ============================================================================
   12. ANIMATIONS
   ============================================================================ */
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes ping {
  0%   { transform: scale(1);   opacity: 0.8; }
  80%, 100% { transform: scale(2.2); opacity: 0; }
}

/* stagger list cards (cosmetic; degrades gracefully) */
.list .card:nth-child(1) { animation-delay: .02s; }
.list .card:nth-child(2) { animation-delay: .06s; }
.list .card:nth-child(3) { animation-delay: .10s; }
.list .card:nth-child(4) { animation-delay: .14s; }
.list .card:nth-child(5) { animation-delay: .18s; }
.list .card:nth-child(n+6) { animation-delay: .22s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- MOBILE OVERFLOW FIX ---------- */
/* NOTE: no `overflow-x: hidden` on html/body — it makes them scroll containers
   (overflow-y computes to auto) and breaks the .island sticky sidebar. The
   min-width:0 / max-width:100% guards below are what actually prevent the grid
   from blowing out horizontally. Verified: 0 document h-scroll at 1440 & 390. */
html, body { max-width: 100%; }
.layout > * { min-width: 0; }            /* let grid children shrink, not min-content */
.card, .content, .island, .list, .toolbar, .panel { min-width: 0; max-width: 100%; }
.card__title { overflow-wrap: anywhere; }
@media (max-width: 900px){
  .layout { grid-template-columns: minmax(0, 1fr); }
}
