﻿/* ================================================================
   FITTY CLOCK — style.css
   Egyszerű, flexbox-alapú layout. Érthetőség az elsődleges szempont.

   OLDALSZERKEZET (desktop):
     .page          → flex oszlop, teljes viewport magasság
       .top-info    → fejléc (saját mérete)
       .main-layout → 3 oszlop egymás mellett (flex sor, maradék hely)
         .manage-panel  → bal oszlop (flex oszlop)
         .list-panel    → középső oszlop (flex oszlop)
         .timer-panel   → jobb oszlop (flex oszlop)
       .footer-bar  → lábléc (saját mérete)

   BREAKPOINTOK:
     >= 981px         → desktop: 3 oszlop
     981–1280px       → kis desktop: sűrűbb térközök
     861–980px        → tablet: 2 oszlop (rács)
     <= 980px érintős → mobil: 1 oszlop, görgethető
     <= 640px         → kis képernyő: tömörítés
   ================================================================ */


/* ─── 1. CSS VÁLTOZÓK ─── */
:root {
  --bg: #f2f6fb;
  --bg-soft: #e8f1fb;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --surface-strong: #ffffff;
  --line: #d6e0ec;
  --text: #1e293b;
  --muted: #64748b;
  --primary: #0284c7;
  --primary-2: #0369a1;
  --danger: #dc2626;
  --danger-2: #b91c1c;
  --shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
  --timer-ink: #0f172a;
  --timer-soft: #475569;
  --timer-panel: rgba(255, 255, 255, 0.78);
  --font-body: "Inter", "Segoe UI", sans-serif;
  --font-heading: "Inter", "Segoe UI", sans-serif;
}


/* ─── 2. RESET ─── */
*, *::before, *::after {
  box-sizing: border-box;
}

/* Az oldal sosem scrollozható desktop nézetben */
html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-body);
  color: var(--text);
  background:
    radial-gradient(circle at 10% 8%, var(--bg-soft), transparent 30%),
    radial-gradient(circle at 85% 90%, color-mix(in srgb, var(--bg-soft) 50%, transparent), transparent 35%),
    var(--bg);
}

body {
  min-height: 100dvh;
}

/* Gombok, inputok örököljék a szülő betűtípusát */
button, input, select, textarea {
  font: inherit;
  color: inherit;
}


/* ─── 3. OLDALSZERKEZET (.page) ─── */

/* Fő tároló: függőleges flex, teljes viewport */
.page {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 12px;
  gap: 10px;
  position: relative;
  overflow: hidden;
}

/* Fejléc és lábléc: saját méretük van, nem nyúlnak */
.top-info {
  flex-shrink: 0;
  /* padding: 3px 10px; */
  padding: 12px 10px;
  transition: transform 0.24s ease, opacity 0.24s ease;
}

.top-info.flyer-hidden {
  transform: translateY(-120%);
  opacity: 0;
  pointer-events: none;
}

/* Fő tartalom: kitölti a fejléc és lábléc között maradó helyet */
.main-layout {
  flex: 1;
  min-height: 0;       /* nélküle a flex nem tud összenyomódni */
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 0.3fr) minmax(0, 0.7fr);
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas:
    "list manage"
    "list timer";
  gap: 10px;
}

/* Lábléc: vizuálisan 3 részre osztva, egy sorban */
/* Footer: 3 oszlopos layout, elemek egymás alá folyhatnak az oszlopokon belül */
.footer-bar {
  flex-shrink: 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  /* display: grid; */
  /* grid-template-columns: auto 1fr auto;  bal+jobb auto méret, közép flex */
  display: flex;
  justify-content: space-between;
  align-items: center;
  /* gap: 4px 8px; */
  gap: 2px 6px;
  /* padding: 3px 10px; */
  padding: 5px 10px;
  /* font-size: 0.62rem; */
  font-size: 0.66rem;
  overflow: visible;
}

/* Footer csoport: mindhárom oszlop közös stílusa */
/* flex row, wrappolhat 2. sorba, de 3. sorba ne kerüljön semmi */
.footer-group {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  align-content: center;
  /* justify-content: space-around; */
  justify-content: center;
  /* gap: 2px 5px; */
  gap: 1px 3px;
  width: 100%;
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  max-height: 2.45em;  /* max 2 sor */
  justify-self: center;
  text-align: center;
}

/* Bal csoport */
.footer-group-tools {
  /* justify-content: space-around; */
  justify-content: center;
  flex: 1.2 1 0;
  overflow: visible;
}

/* Közép csoport: checkboxok */
.footer-group-settings {
  /* justify-content: space-around; */
  justify-content: center;
  flex: 1.6 1 0;
}

/* Jobb csoport */
.footer-group-links {
  /* justify-content: space-around; */
  justify-content: center;
  flex: 1 1 0;
}

/* Az egyes sorok a csoportokon belül vízszintesek — már nem kell külön felülírás */
/* .footer-group-tools > *,
.footer-group-links > * {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
} */


/* ─── 4. KÁRTYA ─── */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}


/* ─── 5. FEJLÉC TARTALMA ─── */
.top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  /* gap: 10px; */
  gap: 10px;
  flex-wrap: nowrap;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.header-brand:hover, .header-brand:focus-visible {
  color: inherit;
  text-decoration: none;
}

.header-logo {
  width: 270px;
  height: auto;
  border-radius: none;
  flex-shrink: 0;
}

.brand-title {
  margin: 0;
  display: none;
  font-family: "Luckiest Guy", cursive;
  font-size: clamp(0.85rem, 1.4vw, 1.05rem);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.brand-subtitle {
  margin: 0;
  font-weight: 400;
  color: var(--muted);
  white-space: nowrap;
}

.header-right-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  justify-content: flex-end;
  flex-shrink: 0;
}

.mobile-friendly-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--muted);
  padding: 2px 6px;
  font-size: 0.62rem;
  font-weight: 700;
  white-space: nowrap;
}

.mobile-friendly-chip img {
  width: 10px;
  height: 10px;
}

.mobile-friendly-chip img {
  width: 14px;
  height: 14px;
}

.seo-line {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}


/* ─── 6. TÉMAVÁLASZTÓ ─── */
.theme-picker-wrap {
  position: relative;
}

/* Mobil legördülő: alapesetben rejtett */
.theme-select-mobile {
  display: none;
}

/* Témakapcsoló gomb a láblécben */
.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--text);
  /* padding: 2px 7px; */
  padding: 2px 6px;
  /* font-size: 0.68rem; */
  font-size: 0.66rem;
  font-weight: 700;
  cursor: pointer;
  max-width: 160px;
}

#themeToggleLabel {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.theme-toggle-btn img {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

/* Legördülő téma menü */
.theme-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 200px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow);
  z-index: 60;
}

/* A láblécben a téma menü felfelé nyílik */
.footer-theme-picker .theme-menu {
  top: auto;
  bottom: calc(100% + 8px);
}

.theme-option {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: var(--surface-strong);
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.theme-option.is-active {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 10%, var(--surface-strong));
}


/* ─── 7. NYELVVÁLASZTÓ ─── */
.language-panel {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.86rem;
}

.lang-label {
  color: var(--muted);
  font-weight: 700;
}

.lang-select-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 6px;
  background: var(--surface-strong);
}

.lang-flag {
  width: 13px;
  height: 13px;
  border-radius: 999px;
}

.lang-select {
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 0.62rem;
  font-weight: 700;
  outline: none;
}


/* ─── 8. GOMBOK ─── */

/* Körvonalazott gomb (alapértelmezett) */
.btn-outline, .footer-btn {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--text);
  /* padding: 1px 6px; */
  padding: 1px 6px;
  /* font-size: 0.62rem; */
  font-size: 0.64rem;
  font-weight: 700;
  cursor: pointer;
}

/* How to use gomb a fejlécben: kisebb */
.how-to-btn {
  padding: 3px 8px;
  font-size: 0.72rem;
}

.mobile-help-row {
  display: none;
}

.mobile-help-btn {
  min-width: 140px;
  justify-content: center;
}

/* Elsődleges és veszélyes gombok */
.btn-primary {
  border: 0;
  border-radius: 999px;
  padding: 9px 14px;
  font-weight: 700;
  cursor: pointer;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
}

.btn-danger {
  border: 0;
  border-radius: 999px;
  padding: 9px 14px;
  font-weight: 700;
  cursor: pointer;
  background: linear-gradient(135deg, var(--danger), var(--danger-2));
  color: #fff;
}

.btn-delete {
  border: 0;
  border-radius: 999px;
  padding: 9px 14px;
  font-weight: 700;
  cursor: pointer;
  background: color-mix(in srgb, var(--danger) 14%, var(--surface-strong));
  color: var(--danger-2);
}

/* Átmeneti animáció minden interaktív elemen */
.btn-outline, .btn-primary, .btn-danger, .footer-btn,
.tool-icon-btn, .theme-toggle-btn, .theme-option,
.share-app-btn, .mobile-fab-btn, .quick-btn, .icon-btn {
  transition: transform 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

/* Hover effekt */
.btn-outline:not(:disabled):hover,
.btn-primary:not(:disabled):hover,
.btn-danger:not(:disabled):hover,
.footer-btn:not(:disabled):hover,
.tool-icon-btn:not(:disabled):hover,
.share-app-btn:not(:disabled):hover,
.theme-toggle-btn:hover,
.theme-option:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.12);
}

/* Letiltott állapot */
button:disabled, input:disabled, select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}


/* ─── 9. HÁROM OSZLOPOS FŐ LAYOUT ─── */

/* A steps-panel (lépések sáv): csak mobilon látszana, de ott is rejtett
   mert minden oszlop saját .column-step chip-et tartalmaz */
.steps-panel {
  display: none;
}

/* Közös az oszlopoknak: flex oszlop, saját scrollhoz */
.manage-panel,
.list-panel,
.timer-panel {
  flex: 1;             /* egyenlő szélességű oszlopok */
  min-width: 0;        /* ne lógjon ki a flex konténerből */
  min-height: 0;
  overflow: hidden;    /* tartalom ne csússzon ki */
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
}

.list-panel { grid-area: list; }
.manage-panel { grid-area: manage; }
.timer-panel { grid-area: timer; }

/* Minden közvetlen gyerek alapból NEM nyúlik (csak a kijelölt scrollozható elemek) */
.manage-panel > *,
.list-panel > *,
.timer-panel > * {
  flex-shrink: 0;
}

/* Oszlop cím */
.column-title {
  margin: 0;
  font-size: clamp(1.2rem, 2vw, 1.6rem);
  font-weight: 900;
  text-align: center;
  letter-spacing: -0.02em;
}

/* Rövid utasítás chip az oszlop tetején */
.column-step {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-strong);
  font-size: 0.84rem;
  line-height: 1.25;
}

/* Ikon az utasítás chipben */
.column-icon {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--panel-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.column-icon img {
  width: 19px;
  height: 19px;
}

/* Lépés elemek (a rejtett steps-panel belsejében) */
.step-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.84rem;
  color: var(--muted);
}

.manage-header-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.manage-step-box {
  margin: 0;
}

.manage-body-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}

.manage-left-column,
.manage-right-column {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  min-height: 0;
}


/* ─── 10. MANAGE PANEL TARTALMA ─── */

/* Szünet figyelmeztetés (sárga doboz) */
.pause-warning {
  margin: 0;
  padding: 7px 10px;
  border: 1px solid color-mix(in srgb, #f59e0b 60%, var(--line));
  background: color-mix(in srgb, #f59e0b 12%, var(--surface-strong));
  border-radius: 8px;
  font-size: 0.84rem;
  line-height: 1.4;
}

/* Labelek az inputok felett */
.manage-panel label,
.builder label {
  display: block;
  margin-bottom: 4px;
  font-size: 0.93rem;
  font-weight: 800;
}

/* Szöveges inputmezők */
.template-select,
#workoutName,
.builder input,
.inline-edit-input,
.qr-url-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 0.95rem;
  background: var(--surface-strong);
  color: var(--text);
}

/* Karakter limit súgó szöveg */
.field-limit-hint {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.4;
}

/* Builder sor: névmező + idő mező + gomb */
.builder {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.builder > div:first-child { flex: 2; }     /* névmező: kétszer akkora */
.builder > div:nth-child(2) { flex: 1; }    /* időmező */
.builder-btn-wrap { flex-shrink: 0; }        /* gomb: nem zsugorodik */

.builder-help {
  margin: 0;
  color: var(--muted);
  font-size: 0.83rem;
  line-height: 1.4;
}

/* Quick-recent doboz: ez a scrollozható terület a manage panelban */
.quick-recent-box {
  flex: 1;             /* kitölti a maradék helyet */
  min-height: 0;       /* kötelező a flex scroll-hoz */
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px;
  background: var(--panel-soft);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Eszközsor (export, import, törlés gombok) */
.quick-tools-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  flex-shrink: 0;
}

/* Kis ikon gombok a toolsorban */
.tool-icon-btn {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 10px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 800;
}

.tool-icon-glyph { font-size: 0.95rem; }
.tool-icon-label { font-size: 0.8rem; white-space: nowrap; }

/* Import hiba szöveg */
.import-error {
  color: var(--danger);
  font-size: 0.84rem;
  margin: 0;
}

/* Belső scrollozható rész (gyors hozzáadás, sablonok) */
.quick-recent-scroll {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Egyedi dobozok a gyors menüben */
.quick-wrap,
.recent-workouts-wrap,
.template-wrap {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  background: var(--surface-strong);
  flex-shrink: 0;
}

.recent-workouts-wrap, .template-wrap {
  border-top-style: dashed;
}

/* Felirat a dobozok felett */
.quick-title {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 6px;
}

/* Legördülő + gomb sor */
.quick-select-row {
  display: flex;
  gap: 6px;
}

.quick-select {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 10px;
  font-size: 0.88rem;
  background: var(--surface-strong);
  color: var(--text);
}

.quick-add-btn {
  flex-shrink: 0;
  white-space: nowrap;
}

.quick-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.quick-btn {
  border: 1px solid var(--line);
  background: var(--surface-strong);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.85rem;
  cursor: pointer;
}


/* ─── 11. LIST PANEL TARTALMA ─── */

/* Tervezett idő + elemek száma */
.meta-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 0.93rem;
}

.list-summary-text {
  flex: 1 1 auto;
  min-width: 0;
  font-weight: 700;
  line-height: 1.35;
}

.list-add-new-btn {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 8px 12px;
  font-size: 0.84rem;
  white-space: nowrap;
}

.meta-top strong, .timer-meta strong, .next-row strong {
  color: var(--text);
}

/* A lista görgethető területe: kitölti a maradék helyet */
.list-scroll-area {
  flex: 1;             /* kitölti a maradék helyet */
  min-height: 0;       /* kötelező a flex scroll-hoz */
  overflow-y: auto;
  border-top: 1px solid var(--line);
  padding-top: 6px;
}

/* A lista */
.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Lista elem */
.item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas: "left name actions";
  align-items: center;
  gap: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 8px;
  background: var(--panel-soft);
  transition: transform 0.18s ease, opacity 0.18s ease, box-shadow 0.18s ease;
}

/* Drag-and-drop állapotok */
.item.dragging {
  opacity: 0.76;
  border-style: dashed;
  transform: scale(1.015) rotate(-0.4deg);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
}

.item.drag-target-before {
  border-color: var(--primary);
  background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 10%, var(--panel-soft)) 0 16%, var(--panel-soft) 16%);
}

.item.drag-target-after {
  border-color: var(--primary);
  background: linear-gradient(180deg, var(--panel-soft) 0 84%, color-mix(in srgb, var(--primary) 10%, var(--panel-soft)) 84%);
}

.item.item-removing {
  opacity: 0;
  transform: translateX(40px) scale(0.92);
  transition: opacity 0.32s ease, transform 0.32s ease;
}

.item-completed { opacity: 0.65; }
.item-current { border: 3px solid var(--primary); }

/* Fogópontos bal oldal */
.handle-wrap {
  grid-area: left;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.handle-top {
  display: flex;
  align-items: center;
  gap: 4px;
}

.handle {
  color: var(--muted);
  font-size: 1.15rem;
  cursor: default;
  user-select: none;
}

.handle.can-drag { cursor: grab; }

/* Idő jelvény */
.seconds-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 7px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  background: var(--surface-strong);
  white-space: nowrap;
  min-width: 38px;
}

.item-index {
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--muted);
  min-width: 1.2rem;
  text-align: center;
}

/* Elem neve */
.item-name {
  grid-area: name;
  font-weight: 700;
  font-size: 0.94rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  align-self: center;
}

/* Jobb oldali műveletek */
.item-actions {
  grid-area: actions;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
}

.item-actions-row {
  display: flex;
  gap: 4px;
}

.icon-btn.item-done-indicator {
  border-color: #1d7f49;
  background: #1d7f49;
  color: #fff;
  cursor: default;
}

.icon-btn.item-done-indicator-skipped {
  border-color: #d97706;
  background: #d97706;
  color: #fff;
}

.item-done-indicator-icon {
  width: 14px;
  height: 14px;
  display: block;
  fill: currentColor;
}

/* Kis ikon gombok */
.icon-btn, .inline-edit-btn {
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--text);
  border-radius: 8px;
  min-width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 900;
}

/* Szerkeszthető érték kattintásra */
.editable-value { border-radius: 6px; padding: 2px 4px; }
.editable-value.can-edit { cursor: text; }
.editable-value.can-edit:hover { background: color-mix(in srgb, var(--primary) 10%, var(--surface-strong)); }

/* Inline szerkesztő mód */
.inline-edit {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.inline-edit-input.name { width: 190px; max-width: 100%; }
.inline-edit-input.seconds { width: 78px; }
.handle-wrap .inline-edit-input.seconds { width: 60px; font-size: 0.82rem; padding: 2px 4px; text-align: center; }

.inline-edit-actions { display: flex; gap: 4px; }

.inline-edit-stepper { display: none; gap: 6px; }
.inline-edit-stepper .inline-edit-btn { min-width: 32px; }

.inline-edit-btn.ok { border-color: color-mix(in srgb, #16a34a 70%, var(--line)); color: #16a34a; }
.inline-edit-btn.cancel { border-color: var(--danger); color: var(--danger-2); }

/* Üres lista üzenet */
.empty { margin: 8px 0 0; color: var(--muted); font-size: 0.92rem; line-height: 1.4; }

/* Megosztás gomb sor */
.qr-bottom-row {
  display: flex;
  justify-content: center;
}

.list-tools-under-share {
  justify-content: center;
  margin-top: 8px;
}

.list-actions-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.list-actions-column {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.list-actions-row .ad-list-desktop {
  margin: 0;
  flex: 0 0 auto;
}

.list-actions-row .qr-bottom-row {
  justify-content: flex-start;
}

.list-actions-row .list-tools-under-share {
  justify-content: flex-start;
  margin-top: 0;
}

.share-top-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 18px;
  min-height: 52px;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 999px;
}

.share-top-btn img { width: 20px; height: 20px; }


/* ─── 12. HIRDETÉS HELYEK ─── */
.ad-list-desktop, .ad-desktop,
.ad-mobile, .ad-mobile-between, .finish-ad {
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: var(--panel-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
}

.ad-list-desktop { width: 200px; height: 200px; max-width: 100%; margin: 0 auto; }
.ad-desktop { width: 200px; height: 200px; max-width: 100%; margin: 0 auto; }

/* Mobil hirdetések: alapesetben rejtve, mobilon megjelennek */
.ad-mobile { display: none; width: min(100%, 468px); height: 60px; margin: 0 auto; }
.ad-mobile-between { display: none; width: min(320px, 100%); min-height: 50px; margin: 0 auto; }

.ad-title { color: var(--muted); font-weight: 700; }
.ad-size { color: var(--muted); font-size: 0.9rem; }


/* ─── 13. TIMER PANEL TARTALMA ─── */

/* A kijelző terület: ez nyúlik, a többi elem (fázis, meta, gombok) alatta marad */
.timer-display {
  flex: 1;             /* kitölti a maradék helyet */
  min-height: 0;       /* kötelező */
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--primary) 6%, var(--timer-panel)) 0%,
    var(--timer-panel) 100%);
  position: relative;
}

/* Fullscreen nyitó gomb (bal felső sarok) */
.fs-open-btn {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  cursor: pointer;
  font-size: 1rem;
  opacity: 0.7;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fs-open-btn:hover { opacity: 1; }

/* Visszaszámláló + stopper sor */
.timer-hero-row {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.timer-hero-row.stopwatch-hidden .timer-hero-box-stopwatch {
  display: none;
}

/* Doboz a visszaszámlálónak és a stoppernek */
.timer-hero-box {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid color-mix(in srgb, var(--primary) 14%, var(--line));
  border-radius: 16px;
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--surface-strong) 88%, transparent) 0%,
    color-mix(in srgb, var(--primary) 5%, var(--surface-strong)) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.timer-hero-box-countdown {
  flex: 1;
  min-height: 110px;
  padding: 10px 16px;
  position: relative;
  overflow: hidden;
}

.timer-hero-box-stopwatch {
  width: 150px;
  min-height: 110px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
  flex-shrink: 0;
}

/* A nagy szám (visszaszámláló) */
.countdown {
  font-size: clamp(3rem, 10vw, 6rem);
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--timer-ink);
  text-align: center;
  width: 100%;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.15);
}

.phase-inside {
  position: absolute;
  top: 10px;
  right: 12px;
  padding: 4px 8px;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  z-index: 2;
}

.timer-meta-inside {
  position: absolute;
  left: 12px;
  bottom: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.72rem;
  z-index: 2;
}

.timer-meta-inside strong {
  font-size: 0.82rem;
}

/* Jelenlegi gyakorlat doboza */
.current-block {
  flex-shrink: 0;
  position: relative;
  padding: 18px 10px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-strong) 92%, transparent);
}

/* "CURRENT:" és "NEXT:" felirat */
.current-label, .next-label {
  color: var(--timer-soft);
  text-transform: uppercase;
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 2px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  z-index: 2;
}

/* Aktuális gyakorlat neve */
.current {
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  font-weight: 900;
  line-height: 1.1;
  color: var(--timer-ink);
  text-transform: uppercase;
  text-align: center;
  width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  transition: opacity 0.35s ease;
}

/* Következő gyakorlat doboza */
.next-row {
  flex-shrink: 0;
  position: relative;
  padding: 18px 10px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-strong) 92%, transparent);
  color: var(--timer-soft);
  text-align: center;
}

.next-row strong {
  font-size: clamp(0.95rem, 2vw, 1.3rem);
  color: var(--timer-ink);
  width: 100%;
  text-align: center;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Fázis felirat (WAITING, RUNNING, PAUSED) */
.phase {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-strong) 92%, transparent);
  font-size: clamp(0.8rem, 1.1vw, 0.92rem);
  font-weight: 800;
  text-transform: uppercase;
  color: var(--timer-soft);
  letter-spacing: 0.08em;
  text-align: center;
}

/* Eltelt idő */
.timer-meta {
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-strong) 92%, transparent);
  color: var(--muted);
}

/* Vezérlő gombok sora */
.controls {
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.controls > .fs-open-btn {
  position: static;
  top: auto;
  left: auto;
  z-index: auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  cursor: pointer;
  font-size: 1rem;
  opacity: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.controls > .fs-open-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.12);
}

.control-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  cursor: pointer;
  padding: 0;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.control-btn:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.12);
}

/* Start/Pause gomb: kiemelkedő */
.control-btn-start {
  width: 52px;
  height: 52px;
  border: 0;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
}

/* Reset gomb: piros árnyalat */
.control-btn-reset {
  background: color-mix(in srgb, var(--danger) 12%, var(--surface-strong));
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 25%, var(--line));
}

.control-btn-sound { padding: 0; }
.control-btn-sound img { width: 20px; height: 20px; }

.control-icon { width: 20px; height: 20px; pointer-events: none; }
.control-btn-start .control-icon { width: 24px; height: 24px; filter: brightness(0) invert(1); }

/* Animációk */
.current.current-fade-in { animation: currentFadeIn 0.4s ease forwards; }

@keyframes currentFadeIn {
  0% { opacity: 0.15; transform: translateY(6px); }
  100% { opacity: 1; transform: translateY(0); }
}

.countdown.step-transition,
.fs-countdown.step-transition {
  animation: stepCountdownFade 0.34s ease;
}

@keyframes stepCountdownFade {
  0% { opacity: 1; }
  49% { opacity: 0; }
  51% { opacity: 0; }
  100% { opacity: 1; }
}


/* ─── 14. STOPPER WIDGET ─── */

.stopwatch-widget {
  --stopwatch-widget-size: 148px;
  --stopwatch-crown-gap: 18px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(100%, var(--stopwatch-widget-size));
  height: auto;
  padding-top: var(--stopwatch-crown-gap);
  overflow: visible;
}

/* Korona (tetőrész) */
.stopwatch-crown {
  position: absolute;
  top: 0;
  left: 50%;
  width: 22px;
  height: 14px;
  border-radius: 8px 8px 5px 5px;
  background: linear-gradient(180deg, #f8fafc 0%, #cbd5e1 55%, #94a3b8 100%);
  border: 1px solid color-mix(in srgb, #64748b 52%, var(--line));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
  transform: translateX(-50%);
  z-index: 7;
}

.stopwatch-crown::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -8px;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: linear-gradient(180deg, #e2e8f0 0%, #94a3b8 100%);
  border-left: 1px solid color-mix(in srgb, #64748b 45%, var(--line));
  border-right: 1px solid color-mix(in srgb, #64748b 45%, var(--line));
  transform: translateX(-50%);
}

/* Tárcsalap */
.stopwatch-dial {
  position: relative;
  width: calc(100% - 4px);
  max-width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid #94a3b8;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(148, 163, 184, 0.28);
}

/* Belső elemek: pozicionáltak */
.stopwatch-progress-svg,
.stopwatch-ticks,
.stopwatch-brand-text,
.stopwatch-label {
  position: absolute;
}

.stopwatch-brand-text {
  top: 32px;
  left: 50%;
  width: max-content;
  max-width: 62%;
  transform: translateX(-50%);
  color: color-mix(in srgb, var(--timer-ink) 86%, transparent);
  font-family: "Luckiest Guy", cursive;
  font-size: 0.62rem;
  line-height: 1;
  letter-spacing: 0.05em;
  text-align: center;
  white-space: nowrap;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.95);
  z-index: 3;
  pointer-events: none;
}

.stopwatch-progress-svg { display: none; }
.stopwatch-progress-circle { display: none; }

/* Osztás jelek */
.stopwatch-ticks {
  inset: 1px;
  border-radius: 50%;
  z-index: 2;
}

.stopwatch-ticks::before, .stopwatch-ticks::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
}

.stopwatch-ticks::before {
  background: repeating-conic-gradient(from -90deg, color-mix(in srgb, #64748b 48%, transparent) 0deg 0.9deg, transparent 0.9deg 6deg);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 7px), #000 calc(100% - 7px) calc(100% - 3px), transparent calc(100% - 3px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 7px), #000 calc(100% - 7px) calc(100% - 3px), transparent calc(100% - 3px));
}

.stopwatch-ticks::after {
  background: repeating-conic-gradient(from -90deg, color-mix(in srgb, #334155 82%, transparent) 0deg 1.6deg, transparent 1.6deg 30deg);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 17px), #000 calc(100% - 17px) calc(100% - 4px), transparent calc(100% - 4px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 17px), #000 calc(100% - 17px) calc(100% - 4px), transparent calc(100% - 4px));
}

/* Perc/másodperc feliratok */
.stopwatch-label {
  color: color-mix(in srgb, var(--timer-ink) 90%, transparent);
  font-family: "Barlow Condensed", "Arial Narrow", sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.9);
  z-index: 3;
}

.stopwatch-label-0  { top: 12px; left: 50%; transform: translateX(-50%); }
.stopwatch-label-15 { top: 50%; right: 12px; transform: translateY(-50%); }
.stopwatch-label-30 { bottom: 12px; left: 50%; transform: translateX(-50%); }
.stopwatch-label-45 { top: 50%; left: 12px; transform: translateY(-50%); }

/* Másodperc mutató */
.stopwatch-second-hand {
  position: absolute;
  left: 50%;
  bottom: 50%;
  width: 3px;
  height: calc(50% - 5px);
  margin-left: -1.5px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ef4444 0%, #f97316 54%, #ea580c 100%);
  transform-origin: center bottom;
  transform: rotate(0deg);
  transition: transform 1s linear;
  box-shadow: 0 0 14px color-mix(in srgb, #fb923c 55%, transparent);
  z-index: 5;
}

/* Középső gomb */
.stopwatch-center-dot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 10px;
  margin-left: -5px;
  margin-top: -5px;
  border-radius: 50%;
  background: #0f172a;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.95);
  z-index: 6;
}

/* Perc ablak */
.stopwatch-minute-window {
  position: absolute;
  left: 50%;
  top: 70%;
  transform: translate(-50%, -50%);
  min-width: 36px;
  padding: 4px 7px;
  border: 1px solid color-mix(in srgb, #94a3b8 28%, var(--line));
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--timer-ink);
  font-family: "Oxanium", sans-serif;
  font-size: 0.84rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.08em;
  text-align: center;
  font-variant-numeric: tabular-nums;
  z-index: 4;
}

/* Fullscreen stopper: nagyobb méret */
.stopwatch-widget-fullscreen { --stopwatch-crown-gap: 24px; width: 100%; }
.stopwatch-dial-fullscreen { border-width: 3px; box-shadow: none; }
.stopwatch-brand-text-fullscreen { top: 40px; font-size: clamp(0.74rem, 1vw, 0.92rem); }
.stopwatch-crown-fullscreen { top: 0; width: 28px; height: 16px; }
.stopwatch-crown-fullscreen::before { bottom: -9px; width: 10px; height: 9px; }
.stopwatch-second-hand-fullscreen { width: 4px; height: calc(50% - 6px); margin-left: -2px; }
.stopwatch-center-dot-fullscreen { width: 14px; height: 14px; margin-left: -7px; margin-top: -7px; }
.stopwatch-minute-window-fullscreen { min-width: 48px; padding: 5px 9px; font-size: clamp(0.9rem, 1.5vw, 1.08rem); }
.stopwatch-dial-fullscreen .stopwatch-label { font-size: clamp(0.95rem, 1.3vw, 1.2rem); }

body.use-new-stopwatch-dial .stopwatch-widget {
  --stopwatch-crown-gap: 0px;
  aspect-ratio: 109.91654 / 131.96034;
  padding-top: 0;
  background: var(--stopwatch-dial-image, url("./img/fittyclockszamlapnew.svg")) center top / contain no-repeat;
}

body.use-new-stopwatch-dial .stopwatch-crown,
body.use-new-stopwatch-dial .stopwatch-ticks,
body.use-new-stopwatch-dial .stopwatch-brand-text,
body.use-new-stopwatch-dial .stopwatch-label {
  display: none;
}

body.use-new-stopwatch-dial .stopwatch-dial {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: none;
  aspect-ratio: 1;
  border: 0;
  background: transparent;
  box-shadow: none;
}

body.use-new-stopwatch-dial .stopwatch-second-hand {
  bottom: calc(50% - 6px);
  height: calc(50% - 8px);
  transform-origin: center calc(100% - 6px);
}

body.use-new-stopwatch-dial .stopwatch-second-hand-fullscreen {
  bottom: calc(50% - 8px);
  height: calc(50% - 8px);
  transform-origin: center calc(100% - 8px);
}

body.use-new-stopwatch-dial .stopwatch-minute-window {
  top: 65.5%;
  min-width: 32px;
  padding: 3px 6px;
  font-size: 0.76rem;
  border-color: var(--stopwatch-minute-window-border, color-mix(in srgb, #94a3b8 28%, var(--line)));
  background: var(--stopwatch-minute-window-bg, rgba(255, 255, 255, 0.96));
  color: var(--stopwatch-minute-window-color, var(--timer-ink));
}

body.use-new-stopwatch-dial .stopwatch-minute-window-fullscreen {
  min-width: 42px;
  padding: 4px 8px;
  font-size: clamp(0.82rem, 1.25vw, 0.96rem);
}


/* ─── 15. ÉRTESÍTÉSI TOAST ─── */
.app-toast {
  position: fixed;
  left: 50%;
  top: 14px;
  transform: translateX(-50%);
  z-index: 200;
  min-width: 200px;
  max-width: min(560px, calc(100% - 24px));
  padding: 10px 14px;
  border-radius: 12px;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.28);
  pointer-events: none;
  opacity: 0;
}

.app-toast.toast-show { animation: toastFade 3s ease forwards; }
.app-toast.info    { background: rgba(30, 41, 59, 0.92); }
.app-toast.success { background: rgba(21, 128, 61, 0.94); }
.app-toast.error   { background: rgba(185, 28, 28, 0.94); }

@keyframes toastFade {
  0%       { opacity: 0; transform: translate(-50%, -10px); }
  10%, 72% { opacity: 1; transform: translate(-50%, 0); }
  100%     { opacity: 0; transform: translate(-50%, -10px); }
}


/* ─── 16. LÁBLÉC ─── */
.footer-toolbar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  flex-shrink: 0;
}

.footer-language-panel {
  display: inline-flex;
}

/* Beállítások checkboxok: 3 oszlop × 2 sor rács */
.footer-settings-inline {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 0px 6px;
  align-items: center;
  flex-shrink: 0;
  overflow: hidden;
  max-width: 100%;
  justify-content: center;
}

.footer-setting-option {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  color: var(--muted);
  /* font-size: 0.58rem; */
  font-size: 0.58rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.footer-setting-option input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--primary);
  flex-shrink: 0;
}

.footer-settings-row { margin: 0; }

.settings-status-note {
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--muted);
}

.settings-status-note[data-state="active"] {
  color: #1d7f49;
}

.settings-status-note[data-state="error"] {
  color: #b74242;
}

.footer-settings-status {
  grid-column: 1 / -1;
  text-align: center;
  padding-top: 4px;
  font-size: 0.64rem;
}

.contact-link {
  color: var(--primary-2);
  text-decoration: none;
  font-weight: 700;
}

.footer-donate-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

.donate-paypal-icon { width: 20px; height: 20px; vertical-align: middle; }


/* ─── 17. COOKIE HOZZÁJÁRULÁS ─── */
.cookie-consent {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 100;
  width: min(380px, calc(100% - 32px));
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cookie-consent-text {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.4;
}

.cookie-consent-text a { color: var(--primary-2); font-weight: 700; }

.cookie-consent-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}


/* ─── 18. MODÁLOK ─── */

/* Modál háttér (az egész képernyőt lefedi) */
.finish-modal, .qr-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
}

.qr-modal { z-index: 90; }

/* Sötét overlay a tartalom mögött */
.finish-overlay, .qr-overlay {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.45);
}

/* Modál doboz */
.finish-dialog, .qr-dialog, .template-dialog {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.finish-dialog {
  width: min(420px, calc(100% - 20px));
  margin: 16px auto;
  padding: 14px;
  max-height: calc(100dvh - 32px);
  overflow: auto;
}

.qr-dialog {
  width: min(860px, calc(100% - 20px));
  margin: 8vh auto 0;
  padding: 16px;
  max-height: calc(100dvh - 32px);
  overflow: auto;
}

.template-dialog {
  width: min(420px, calc(100% - 20px));
  margin: 10vh auto 0;
  padding: 16px;
}

/* Bezáró X gomb */
.finish-close {
  position: absolute;
  top: 8px;
  right: 8px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  border-radius: 8px;
  width: 30px;
  height: 30px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.finish-dialog h2, .qr-dialog h2, .template-dialog h2 { margin: 0 28px 10px 0; }
.finish-dialog p, .qr-note { margin: 0 0 10px; color: var(--muted); line-height: 1.4; }

.finish-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 12px;
}

.finish-elapsed-row { text-align: center; font-size: 1.1rem; font-weight: 700; margin: 0 0 8px; }
.finish-share-hint { text-align: center; font-size: 0.86rem; color: var(--muted); margin: 0 0 10px; }

.finish-social-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin: 0 0 12px;
}

.finish-social-row .share-app-btn { font-size: 0.78rem; padding: 6px 8px; min-height: 38px; white-space: nowrap; overflow: hidden; }

/* Adomány modál */
.donate-dialog { text-align: center; }

.donate-amounts { display: flex; justify-content: center; gap: 10px; margin: 14px 0; }

.donate-amount-btn {
  min-width: 72px;
  padding: 10px 16px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: var(--surface-strong);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.donate-amount-btn:hover, .donate-amount-btn.is-selected {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 12%, var(--surface-strong));
}

.donate-custom-row { display: flex; flex-direction: column; gap: 4px; margin: 0 0 14px; text-align: left; }
.donate-custom-row label { font-size: 0.84rem; font-weight: 600; color: var(--muted); }

.donate-custom-input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  font-size: 1rem;
}

.donate-pay-btn { width: 100%; padding: 12px; font-size: 1rem; font-weight: 700; border-radius: 10px; }

.donate-trigger-btn {
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  font-size: 0.88rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.donate-btn-inner { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }

.finish-ad {
  margin-top: 10px;
}

/* Beállítások modál */
.template-modal-body { display: flex; flex-direction: column; gap: 10px; }
.settings-body { display: flex; flex-direction: column; gap: 12px; }

.settings-option {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-strong);
  font-size: 0.92rem;
  font-weight: 600;
  transition: background 0.15s;
}

.settings-option:hover { background: var(--panel-soft); }
.settings-option input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--primary); flex-shrink: 0; }

/* Súgó modál */
.help-dialog { width: min(560px, calc(100% - 20px)); }
.help-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; }
.help-list li { line-height: 1.35; }


/* ─── 19. QR MEGOSZTÁS ─── */

/* Megosztás gombok: alapesetben rejtve, mobilon flex */
.qr-share-actions {
  display: none;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin: 10px 0 14px;
}

.share-app-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  min-height: 42px;
  padding: 8px 10px;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
}

.share-icon { width: 18px; height: 18px; flex-shrink: 0; }
.nav-icon { width: 24px; height: 24px; }

/* Közösségi gomb színek */
.share-native    { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.share-whatsapp  { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.share-telegram  { background: #eff6ff; color: #0369a1; border-color: #bae6fd; }
.share-messenger { background: #eef2ff; color: #4338ca; border-color: #c7d2fe; }
.share-instagram { background: #fff1f2; color: #be185d; border-color: #fecdd3; }
.share-facebook  { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }

/* QR dialog belső elrendezés */
.qr-layout {
  display: grid;
  grid-template-columns: 1.2fr minmax(280px, 0.8fr);
  gap: 16px;
  align-items: start;
}

.qr-main-column, .qr-side-column {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.qr-share-section, .qr-guide-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.qr-section-title { margin: 0 0 8px; font-size: 0.92rem; font-weight: 700; }

.qr-url-container { display: flex; gap: 6px; align-items: stretch; }
.qr-url-input { font-family: "Consolas", monospace; font-size: 0.85rem; }
.qr-url-hint { margin: 6px 0 0; font-size: 0.78rem; color: var(--muted); }

.qr-code-wrap {
  min-height: 240px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: var(--surface-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
}

.qr-code-wrap svg, .qr-code-wrap img { width: min(280px, 100%); height: auto; }

.guide-steps {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.guide-step {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px;
  background: var(--surface-strong);
  border-radius: 8px;
  border: 1px solid var(--line);
}

.guide-icon { width: 48px; height: 48px; flex-shrink: 0; }
.guide-text { flex: 1; }
.guide-text p { margin: 4px 0 0; font-size: 0.78rem; color: var(--muted); }

.qr-toggle-btn { display: none; width: 100%; }

.qr-video {
  width: 100%;
  min-height: 220px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0f172a;
}

.qr-code-section[hidden] { display: none; }


/* ─── 20. MOBIL FAB NAVIGÁCIÓ ─── */

/* Alapesetben rejtett — mobilon jelenik meg */
.mobile-fab-nav { display: none; }
.mobile-only { display: none; }

.scroll-top-btn {
  background: var(--primary);
  border-color: var(--primary-2);
  color: #fff;
  font-weight: 900;
}

.scroll-top-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}


/* ─── 21. FULLSCREEN MODÁL ─── */
.fullscreen-modal {
  position: fixed;
  inset: 0;
  z-index: 110;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fsZoomIn 0.35s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  overflow: hidden;
}

@keyframes fsZoomIn {
  0%   { opacity: 0; transform: scale(0.82); }
  100% { opacity: 1; transform: scale(1); }
}

.fullscreen-modal.fs-closing {
  animation: fsZoomOut 0.28s cubic-bezier(0.55, 0, 1, 0.45) forwards;
}

@keyframes fsZoomOut {
  0%   { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.82); }
}

/* Belső tároló: középre igazítva, flex oszlop */
.fullscreen-inner {
  width: 100%;
  max-width: 540px;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  padding: 24px 20px;
  gap: 10px;
  margin: 0 auto;
}

/* Bezárás gomb */
.fullscreen-close-btn {
  border: 1px solid var(--line);
  background: var(--surface-strong);
  border-radius: 12px;
  width: 42px;
  height: 42px;
  font-size: 1.15rem;
  cursor: pointer;
  color: var(--text);
  flex-shrink: 0;
}

/* Brand sor a fullscreen tetején */
.fs-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  flex-shrink: 0;
}

.fs-brand-main {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex: 1;
}

.fs-logo { width: 255px; height: auto; border-radius: 10px; }

.fs-brand-name {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.04em;
  font-family: "Luckiest Guy", cursive;
  text-transform: uppercase;
}

/* Fullscreen hero sor */
.fs-timer-hero-row {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: center;
  width: 100%;
  flex-shrink: 0;
}

.fs-timer-hero-row.stopwatch-hidden .timer-hero-box-stopwatch {
  display: none;
}

.fs-timer-hero-row .timer-hero-box-countdown {
  flex: 1;
  min-height: clamp(150px, 18vw, 210px);
  padding: 14px 18px;
  position: relative;
}

.fs-timer-hero-row .timer-hero-box-stopwatch {
  width: clamp(176px, 20vw, 236px);
  min-height: clamp(168px, 20vw, 230px);
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
  flex-shrink: 0;
}

/* Fullscreen szövegek */
.fs-phase {
  font-size: clamp(0.9rem, 1.6vw, 1.2rem);
  font-weight: 800;
  text-transform: uppercase;
  color: var(--timer-soft);
  letter-spacing: 0.1em;
}

.fs-phase-inside {
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: color-mix(in srgb, var(--timer-soft) 88%, transparent);
  z-index: 2;
}

.fs-countdown {
  display: grid;
  place-items: center;
  font-size: clamp(4.1rem, 14vw, 8.4rem);
  line-height: 1;
  font-weight: 900;
  letter-spacing: 2px;
  color: var(--timer-ink);
  font-variant-numeric: tabular-nums;
  width: 100%;
  overflow: hidden;
}

.fs-elapsed-inside {
  position: absolute;
  left: 12px;
  bottom: 10px;
  font-size: 0.72rem;
  color: color-mix(in srgb, var(--muted) 92%, transparent);
  z-index: 2;
}

.fs-current-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  flex-shrink: 0;
}

.fs-current-label {
  color: var(--timer-soft);
  font-size: clamp(0.8rem, 1.2vw, 1rem);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.fs-current {
  font-size: clamp(1.6rem, 4vw, 2.8rem);
  font-weight: 900;
  line-height: 1.1;
  color: var(--timer-ink);
  text-transform: uppercase;
  overflow-wrap: anywhere;
  width: 100%;
}

.fs-next-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: var(--timer-soft);
  flex-shrink: 0;
}

.fs-next-label {
  font-size: clamp(0.75rem, 1vw, 0.9rem);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.fs-next-row strong {
  font-size: clamp(1rem, 2.5vw, 1.6rem);
  line-height: 1.1;
  color: var(--timer-ink);
  overflow-wrap: anywhere;
}

.fs-elapsed { font-size: clamp(0.82rem, 1.1vw, 1rem); color: var(--muted); font-weight: 700; }

/* Fullscreen vezérlők */
.fs-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 6px;
  width: 100%;
  flex-shrink: 0;
}

.fs-controls-main {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  width: 100%;
}

.fs-control-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  min-width: 110px;
  padding: 10px 20px;
  font-size: 1rem;
  border-radius: 14px;
  font-weight: 700;
}

.fs-control-label { white-space: nowrap; }
.fs-sound-btn { min-width: 48px; padding: 10px 14px; }
.fs-skip-btn {
  width: fit-content;
  min-width: 0;
  padding: 10px 14px;
  justify-self: center;
  align-self: center;
  flex: 0 0 auto;
}
.fs-sound-btn img { width: 22px; height: 22px; }
.fs-control-icon { width: 20px; height: 20px; pointer-events: none; }
.btn-primary .fs-control-icon { filter: brightness(0) invert(1); }

@media (min-width: 981px) {
  .fullscreen-inner {
    max-width: 760px;
    padding: 20px 18px;
  }

  .fs-timer-hero-row {
    flex-direction: column;
    align-items: center;
    width: min(100%, 760px);
    gap: 12px;
  }

  .fs-timer-hero-row .timer-hero-box-countdown {
    width: 100%;
    min-height: 176px;
    padding: 16px 20px 20px;
  }

  .fs-timer-hero-row .timer-hero-box-stopwatch {
    width: clamp(160px, 18vw, 210px);
    min-height: 150px;
  }

  .fs-countdown {
    font-size: clamp(4rem, 11vw, 7rem);
  }

  .fs-current-block,
  .fs-next-row,
  .fs-controls,
  .fs-controls-main {
    width: min(100%, 760px);
  }
}


/* ─── 22. TÉMÁK ─── */

/* Sötét téma */
body[data-theme="dark"] {
  --bg: #0f172a;
  --bg-soft: #1e293b;
  --panel: #111827;
  --panel-soft: #172033;
  --surface-strong: #1a2332;
  --line: #334155;
  --text: #e5eef9;
  --muted: #a0b0c4;
  --primary: #38bdf8;
  --primary-2: #0ea5e9;
  --danger: #ef4444;
  --danger-2: #dc2626;
  --shadow: 0 18px 34px rgba(0, 0, 0, 0.35);
  --timer-ink: #f8fafc;
  --timer-soft: #cbd5e1;
  --timer-panel: rgba(15, 23, 42, 0.74);
  --font-body: "Space Grotesk", "Inter", sans-serif;
  --font-heading: "Space Grotesk", "Inter", sans-serif;
}

body[data-theme="dark"] .share-facebook  { background: #1e3a5f; color: #93bbfc; border-color: #2d4a73; }
body[data-theme="dark"] .share-whatsapp  { background: #14332a; color: #6ee7b7; border-color: #1f4d3d; }
body[data-theme="dark"] .share-telegram  { background: #152d44; color: #7dd3fc; border-color: #1e3f5f; }
body[data-theme="dark"] .share-instagram { background: #3b1a2e; color: #f9a8d4; border-color: #5c2847; }
body[data-theme="dark"] .share-native    { background: #1e3a5f; color: #93bbfc; border-color: #2d4a73; }
body[data-theme="dark"] .share-messenger { background: #1e1e5f; color: #a5b4fc; border-color: #2d2d73; }

body[data-theme="dark"] h1, body[data-theme="dark"] h2, body[data-theme="dark"] h3,
body[data-theme="dark"] label, body[data-theme="dark"] .brand-title,
body[data-theme="dark"] .brand-subtitle, body[data-theme="dark"] .item-name,
body[data-theme="dark"] .item-actions button, body[data-theme="dark"] .tool-icon-btn,
body[data-theme="dark"] .tool-icon-label, body[data-theme="dark"] .quick-title,
body[data-theme="dark"] .settings-option span, body[data-theme="dark"] .footer-btn,
body[data-theme="dark"] .contact-link { color: #e5eef9; }

/* Lányos/pink téma */
body[data-theme="girly"] {
  --bg: #2d0a1e;
  --bg-soft: #3d1229;
  --panel: #3a1027;
  --panel-soft: #331024;
  --surface-strong: #421430;
  --line: #6b2850;
  --text: #fce4ec;
  --muted: #e8a0bf;
  --primary: #ec4899;
  --primary-2: #db2777;
  --danger: #f43f5e;
  --danger-2: #e11d48;
  --shadow: 0 18px 34px rgba(0, 0, 0, 0.4);
  --timer-ink: #fce4ec;
  --timer-soft: #e8a0bf;
  --timer-panel: rgba(45, 10, 30, 0.78);
  --font-body: "DM Sans", "Inter", sans-serif;
  --font-heading: "DM Sans", "Inter", sans-serif;
}

body[data-theme="girly"] .share-facebook  { background: #3a1535; color: #f9a8d4; border-color: #5c2847; }
body[data-theme="girly"] .share-whatsapp  { background: #1e2a1e; color: #86efac; border-color: #2d4a2d; }
body[data-theme="girly"] .share-telegram  { background: #1a2535; color: #7dd3fc; border-color: #2d3f5f; }
body[data-theme="girly"] .share-instagram { background: #421430; color: #f9a8d4; border-color: #6b2850; }
body[data-theme="girly"] .share-native    { background: #3a1535; color: #f9a8d4; border-color: #5c2847; }
body[data-theme="girly"] .share-messenger { background: #2a1545; color: #c4b5fd; border-color: #4a2870; }
body[data-theme="girly"] .nav-icon { filter: hue-rotate(280deg) saturate(1.4) brightness(1.6); }

/* Fém/szürke téma */
body[data-theme="metal"] {
  --bg: #d9dde2;
  --bg-soft: #bfc7cf;
  --panel: #f3f4f6;
  --panel-soft: #e5e7eb;
  --surface-strong: #f8fafc;
  --line: #94a3b8;
  --text: #1a1f26;
  --muted: #475569;
  --primary: #374151;
  --primary-2: #1f2937;
  --danger: #991b1b;
  --danger-2: #7f1d1d;
  --timer-ink: #111827;
  --timer-soft: #475569;
  --timer-panel: rgba(248, 250, 252, 0.82);
  --font-body: "Oxanium", "Inter", sans-serif;
  --font-heading: "Oxanium", "Inter", sans-serif;
}

/* Ikonszűrők témánként */
body[data-theme="dark"] .nav-icon              { filter: invert(0.85) hue-rotate(180deg); }
body[data-theme="dark"] .control-icon          { filter: brightness(0) invert(0.9); }
body[data-theme="dark"] .control-btn-start .control-icon { filter: brightness(0) invert(1); }
body[data-theme="girly"] .control-icon         { filter: brightness(0) invert(0.9); }
body[data-theme="girly"] .control-btn-start .control-icon { filter: brightness(0) invert(1); }
body[data-theme] .theme-toggle-btn img,
body[data-theme] .share-top-btn img            { filter: none; }

body[data-theme="dark"] .control-btn:not(.control-btn-start),
body[data-theme="dark"] .controls > .fs-open-btn,
body[data-theme="dark"] .mobile-fab-btn {
  background: #0f172a;
  border-color: color-mix(in srgb, #cbd5e1 22%, #475569);
  color: #ffffff;
}

body[data-theme="dark"] .control-btn-skip {
  background: #0f172a;
  border-color: color-mix(in srgb, #cbd5e1 22%, #475569);
  color: #ffffff;
}

body[data-theme="dark"] .control-icon,
body[data-theme="dark"] .control-btn-sound img,
body[data-theme="dark"] .mobile-fab-btn .nav-icon,
body[data-theme="dark"] .mobile-fab-btn img {
  filter: brightness(0) invert(1);
}

body[data-theme="dark"] .mobile-fab-btn .scroll-top-glyph,
body[data-theme="dark"] .controls > .fs-open-btn {
  color: #ffffff;
}

body[data-theme="dark"] .column-step {
  color: #ffffff;
}


/* ══════════════════════════════════════════════════════
   RESZPONZÍV BREAKPOINTOK
   ══════════════════════════════════════════════════════ */


/* ─── DESKTOP (>= 981px) ─── */
@media (min-width: 981px) {

  .timer-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "body";
    column-gap: 0;
    row-gap: 0;
    align-items: start;
  }

  .timer-panel > .column-title {
    display: none;
  }

  .timer-panel > .column-step {
    display: none;
  }

  .timer-panel > .timer-display {
    grid-area: body;
  }

  .manage-header-row {
    flex-direction: row;
    align-items: stretch;
    justify-content: space-between;
    gap: 10px;
  }

  .manage-header-row .column-title {
    flex: 0 0 auto;
    white-space: nowrap;
    text-align: left;
  }

  .manage-step-box {
    flex: 1 1 auto;
    min-width: 0;
  }

  .manage-body-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 12px;
    align-items: start;
  }

  .manage-right-column .quick-recent-box {
    height: 100%;
  }

  .list-actions-row .ad-list-desktop {
    width: 160px;
    height: 160px;
  }

  .timer-display {
    overflow: hidden;
    padding: 12px;
  }

  .timer-layout-wrap {
    width: 100%;
    min-height: 100%;
    position: relative;
  }

  .timer-layout-table {
    width: calc(100% - 24px);
    height: 100%;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 12px 14px;
    margin: 0 auto;
  }

  .timer-layout-col-left {
    width: 70%;
  }

  .timer-layout-col-right {
    width: 30%;
  }

  .timer-layout-cell {
    padding: 0;
    vertical-align: top;
  }

  .timer-layout-cell-controls,
  .timer-layout-cell-ad {
    width: 30%;
  }

  .timer-layout-cell-hero,
  .timer-layout-cell-status {
    width: 70%;
  }

  .timer-control-stack {
    width: auto;
    height: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
    justify-content: center;
    flex: 0 0 auto;
  }

  .timer-control-stack .fs-open-btn {
    position: static;
    top: auto;
    left: auto;
    z-index: auto;
    opacity: 1;
  }

  .timer-layout-cell-hero > #timerHeroRow {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
  }

  .timer-ad-column {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
  }

  .timer-status-stack {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
  }

  .timer-control-stack .controls {
    width: 166px;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .timer-status-stack .current-block,
  .timer-status-stack #nextExerciseRow {
    width: 100%;
  }

  .timer-ad-column > .ad-desktop {
    width: 250px;
    max-width: 100%;
    height: 250px;
    margin: 0;
    display: flex;
  }

  .timer-status-stack .current {
    font-size: 1rem;
  }

  .timer-status-stack #nextExerciseRow strong {
    font-size: 1rem;
  }

  .timer-hero-row {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    height: auto;
    gap: 10px;
  }

  .timer-layout-cell-hero .timer-hero-box-countdown {
    flex: 0 1 286px;
    min-height: 96px;
  }

  .timer-layout-cell-hero .countdown {
    font-size: clamp(2rem, 3.4vw, 3rem);
  }

  .timer-layout-cell-hero .timer-hero-box-stopwatch {
    width: 140px;
    min-height: 96px;
  }

  /* Stopper/clock látható desktopon is */
  .timer-hero-box-stopwatch {
    display: flex;
  }

  /* Desktopon a checkboxok közvetlenül látszanak, a settings gomb rejtett */
  .footer-group-settings {
    align-items: stretch;
    align-content: stretch;
    max-height: none;
  }

  .footer-settings-inline {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: repeat(2, auto);
    gap: 2px 10px;
    width: 100%;
  }

  .footer-setting-option {
    width: 100%;
    min-width: 0;
    justify-content: flex-start;
    text-align: left;
    white-space: normal;
    line-height: 1.15;
  }

  .footer-settings-status {
    display: none;
  }

  #settingsBtn {
    display: none;
  }

  .footer-bar {
    padding: 5px 10px;
    font-size: 0.66rem;
  }

  .timer-hero-box-countdown {
    min-height: 140px;
    padding: 12px 16px 22px;
  }

  .timer-hero-box-countdown .phase-inside,
  .timer-hero-box-countdown .timer-meta-inside {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .timer-hero-box-countdown .phase-inside {
    top: 8px;
    right: 10px;
    font-size: 0.66rem;
  }

  .timer-hero-box-countdown .timer-meta-inside {
    left: 10px;
    bottom: 8px;
    font-size: 0.66rem;
  }

  .countdown {
    font-size: clamp(2.7rem, 6.6vw, 5rem);
  }

  /* Cookie: vízszintes sor desktopon */
  .cookie-consent {
    left: 50%;
    right: auto;
    bottom: 8px;
    transform: translateX(-50%);
    width: min(760px, calc(100% - 24px));
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
  }

  .cookie-consent-text { flex: 1; font-size: 0.76rem; }
  .cookie-consent-actions { flex-wrap: nowrap; }
}


/* ─── KIS DESKTOP (981–1280px): tömörítés ─── */
@media (min-width: 981px) and (max-width: 1280px) {

  .page {
    padding: 8px;
    gap: 8px;
  }

  .main-layout {
    gap: 8px;
  }

  .manage-panel, .list-panel, .timer-panel {
    padding: 10px;
    gap: 6px;
  }

  .manage-header-row {
    gap: 6px;
  }

  .manage-body-grid {
    gap: 8px;
  }

  .countdown {
    font-size: clamp(2.4rem, 6vw, 4.2rem);
  }

}


/* ─── TABLET (861–980px): 2 oszlopos rács ─── */
@media (min-width: 861px) and (max-width: 980px) {

  /* Átváltunk CSS Grid-re, hogy a timer panel 2 sort foglaljon el */
  .main-layout {
    display: grid;
    grid-template-columns: minmax(0, 0.3fr) minmax(0, 0.7fr);
    grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "manage timer"
      "list   timer";
  }

  .manage-header-row {
    flex-direction: row;
    align-items: stretch;
    justify-content: space-between;
    gap: 10px;
  }

  .manage-header-row .column-title {
    flex: 0 0 auto;
    white-space: nowrap;
    text-align: left;
  }

  .manage-step-box {
    flex: 1 1 auto;
    min-width: 0;
  }

  .manage-body-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 12px;
    align-items: start;
  }

  .manage-right-column .quick-recent-box {
    height: 100%;
  }

  .manage-panel { grid-area: manage; }
  .list-panel   { grid-area: list; }
  .timer-panel  { grid-area: timer; }

  .timer-layout-table,
  .timer-layout-table tbody,
  .timer-layout-table tr,
  .timer-layout-table td {
    display: block;
    width: 100% !important;
  }

  .timer-layout-table {
    height: auto;
    border-spacing: 0;
  }

  .timer-layout-cell {
    padding: 0;
  }

  .timer-layout-cell + .timer-layout-cell,
  .timer-layout-table tr + tr .timer-layout-cell {
    margin-top: 12px;
  }

  .timer-control-stack,
  .timer-status-stack,
  .timer-ad-column {
    width: 100%;
    height: auto;
  }

  .timer-layout-cell-hero > #timerHeroRow {
    height: auto;
  }

  /* Scrollozható területek tablet módban */
  .quick-recent-box, .list-scroll-area {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
  }

  .mobile-fab-nav { display: none; }
}
/* ─── MOBIL ÉRINTŐS (max. 980px, touch) ─── */
@media (max-width: 860px) {

  /* Mobilon az oldal görgethető */
  html, body {
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .page {
    height: auto;
    min-height: 100dvh;
    padding: 0;
    overflow-x: hidden;
  }

  /* A fejléc maradjon a tetején görgetés közben */
  .top-info {
    position: sticky;
    top: 0;
    z-index: 36;
    padding: 18px 10px;
  }

  .top-row {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }

  .header-brand {
    width: 100%;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
  }

  .header-logo {
    width: min(170px, 46vw);
    max-width: 170px;
    height: auto;
  }

  .brand-title {
    font-size: clamp(0.98rem, 3.8vw, 1.25rem);
  }

  .brand-subtitle {
    width: 100%;
    text-align: center;
    line-height: 1.15;
    white-space: nowrap;
  }

  .header-right-tools {
    display: none;
  }

  .header-right-tools .how-to-btn {
    display: none;
  }

  .mobile-help-row {
    display: flex;
    justify-content: center;
    padding: 6px 10px 2px;
  }

  /* Főlayout: egyoszlopos, timer felül */
  .main-layout {
    display: flex;
    flex-direction: column;
    overflow: visible;
    /* kis lélegzet a footer előtt */
    padding-bottom: 12px;
  }

  /* Az oszlopok sorrendje mobilon */
  .timer-panel  { order: 1; }
  .manage-panel { order: 2; }
  .list-panel   { order: 3; }

  /* Panelok: auto magasság mobilon (nem kell overflow hidden) */
  .manage-panel, .list-panel, .timer-panel {
    flex: none;
    overflow: visible;
    padding: 10px;
    gap: 8px;
  }

  /* A scrollozható területek mobilon kifejtve */
  .list-scroll-area, .quick-recent-box {
    flex: none;
    /* overflow: visible; */
    max-height: none;
    min-height: 0;
  }

  .list-panel {
    flex: none;
    overflow: visible;
    height: auto;
    display: flex;
    flex-direction: column;
  }

  .list-scroll-area {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    max-height: calc((7 * 4.8rem) + (6 * 0.375rem));
  }

  /* Timer kijelző: se overflow, se scroll mobilon */
  .timer-display {
    flex: none;
    overflow: hidden;
    padding: 10px;
    gap: 8px;
  }

  .timer-layout-table,
  .timer-layout-table tbody,
  .timer-layout-table tr,
  .timer-layout-table td {
    display: block;
    width: 100% !important;
  }

  .timer-layout-table {
    height: auto;
    border-spacing: 0;
  }

  .timer-layout-cell {
    padding: 0;
  }

  .timer-layout-cell + .timer-layout-cell,
  .timer-layout-table tr + tr .timer-layout-cell {
    margin-top: 12px;
  }

  .timer-control-stack,
  .timer-status-stack,
  .timer-ad-column {
    width: 100%;
    height: auto;
  }

  .timer-layout-cell-hero > #timerHeroRow {
    height: auto;
  }

  .list-actions-row {
    flex-direction: column;
  }

  .list-actions-row .ad-list-desktop {
    width: 200px;
    margin: 0 auto;
  }

  .list-actions-row .qr-bottom-row,
  .list-actions-row .list-tools-under-share {
    justify-content: center;
  }

  .timer-info-stack {
    gap: 12px;
  }

  /* Hero sor mobilon: egymás alá */
  .timer-hero-row {
    flex-direction: column;
    align-items: center;
  }

  .timer-hero-box-countdown {
    width: 100%;
    min-height: 110px;
  }

  .timer-hero-box-stopwatch {
    width: clamp(132px, 36vw, 168px);
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .timer-hero-box-countdown .phase-inside,
  .timer-hero-box-countdown .timer-meta-inside {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  /* Mobilon rejtett elemek */
  .mobile-friendly-chip { display: none; }
  .scroll-top-btn { display: none; }
  .steps-panel, .ad-desktop, .ad-list-desktop { display: none; }

  /* Mobilon látható hirdetések */
  .ad-mobile, .ad-mobile-between { display: flex; }

  /* Builder: egymás alá kerül mobilon */
  .builder {
    flex-direction: column;
  }

  .builder > div:first-child,
  .builder > div:nth-child(2) {
    flex: none;
    width: 100%;
  }

  .builder-btn-wrap, .builder-btn-wrap .btn-primary { width: 100%; }

  /* Legördülők teljes szélességben */
  .quick-select-row { flex-direction: column; }
  .quick-select, .quick-add-btn { width: 100%; }

  /* Quick dobozok: nincs keret mobilon (egyszerűbb nézet) */
  .quick-wrap, .recent-workouts-wrap, .template-wrap {
    border: 0;
    border-radius: 0;
    padding: 0;
    background: transparent;
  }

  /* Tool gombok: csak ikon, nincs felirat */
  .tool-icon-label { display: none; }
  .tool-icon-btn {
    width: fit-content;
    min-width: 0;
    justify-self: center;
    align-self: center;
    flex: 0 0 auto;
  }
  /* Vezérlők: 4 egyenlő gomb */
  .controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
  }

  .control-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    flex: 0 0 auto;
  }

  .control-btn-start {
    width: 48px;
    height: 48px;
    border-radius: 50%;
  }

  .current-block {
    margin-top: 2px;
  }

  .next-row {
    margin-top: 2px;
  }

  /* Meta és share: teljes szélesség */
  .meta-top { flex-direction: row; align-items: center; gap: 8px; }
  .share-top-btn { width: 100%; min-height: 52px; padding: 12px 14px; text-align: center; white-space: normal; }

  /* Stopper méretezés mobilon */
  .stopwatch-widget { --stopwatch-crown-gap: 22px; }
  .stopwatch-label { font-size: 0.75rem; }
  .stopwatch-brand-text { top: 31px; font-size: 0.5rem; }
  .stopwatch-label-0  { top: 10px; left: 50%; transform: translateX(-50%); }
  .stopwatch-label-15 { top: 50%; right: 10px; transform: translateY(-50%); }
  .stopwatch-label-30 { bottom: 10px; left: 50%; transform: translateX(-50%); }
  .stopwatch-label-45 { top: 50%; left: 10px; transform: translateY(-50%); }

  /* Szöveg méretek mobilon */
  .countdown { font-size: clamp(2rem, 9vw, 2.8rem); }
  .column-title { font-size: 1.28rem; }

  /* Beállítások checkboxok rejtése (modálban van mobilon) */
  .footer-settings-inline { display: none; }

  .scroll-top-btn {
    display: none !important;
  }

  /* Mobil FAB navigáció (jobb oldali lebegő gombok) */
  .mobile-fab-nav {
    position: fixed;
    right: 8px;
    top: 46%;
    transform: translateY(-50%);
    z-index: 45;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .mobile-fab-btn {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.5);
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(3px);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 16px rgba(15, 23, 42, 0.14);
  }

  .mobile-fab-btn img { width: 18px; height: 18px; }
  .mobile-only { display: inline-flex; justify-content: center; }
  #qrScanBtn.mobile-only { display: none; }

  /* Lista elemek elrendezése mobilon */
  .item {
    grid-template-columns: 1fr auto;
    grid-template-areas: "left actions" "name actions";
    align-items: start;
  }

  .handle-wrap {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 6px;
  }

  .item-name { -webkit-line-clamp: 3; line-clamp: 3; font-size: 0.9rem; align-self: start; }
  .item-actions-row { justify-content: flex-end; }
  .inline-edit-stepper { display: flex; width: 100%; justify-content: center; margin-top: 4px; }
  .inline-edit-input.name { width: 100%; }

  /* QR modál mobilon: teljes szélesség */
  .qr-dialog, .template-dialog, .help-dialog {
    width: min(100%, calc(100% - 16px));
    margin-top: 8px;
    max-height: calc(100dvh - 16px);
    overflow: auto;
  }

  .qr-share-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .qr-share-actions .share-app-btn {
    justify-content: center;
    text-align: center;
    white-space: normal;
    line-height: 1.15;
    min-height: 48px;
    padding: 8px 6px;
    font-size: 0.76rem;
  }

  .qr-layout {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

  .guide-steps { grid-template-columns: 1fr; }
  .qr-main-column { display: contents; }
  .qr-share-section { order: 1; }
  .qr-side-column { order: 2; gap: 10px; }
  .qr-guide-section { order: 3; }
  .qr-toggle-btn { display: inline-flex; justify-content: center; width: 100%; }

  /* Fullscreen modál mobilon */
  .fullscreen-inner {
    max-width: 100%;
    padding: max(12px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom));
    align-items: center;
    overflow: hidden;
  }

  .fs-brand { max-width: min(100%, 480px); }
  .fs-logo { width: 210px; height: auto; }
  .fs-brand-name { font-size: clamp(1rem, 4.6vw, 1.25rem); }

  .fs-timer-hero-row {
    flex-direction: column;
    align-items: center;
    width: min(100%, 480px);
  }

  .fs-timer-hero-row .timer-hero-box-countdown {
    width: 100%;
    min-height: 124px;
    padding: 12px 14px 24px;
  }

  .fs-countdown { font-size: clamp(3.4rem, 18vw, 5.4rem); }
  .fs-current-block { width: min(100%, 480px); }
  .fs-current { font-size: clamp(1.2rem, 5.8vw, 1.8rem); min-height: 2.4em; }
  .fs-next-row { width: min(100%, 480px); }
  .fs-next-row strong { font-size: clamp(1rem, 4.8vw, 1.3rem); }

  .fs-controls {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    width: min(100%, 480px);
  }

  .fs-controls-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .fs-sound-btn { width: 100%; justify-content: center; }
  .fs-control-btn { min-height: 50px; padding: 10px 16px; font-size: 0.92rem; }
}


/* ─── KIS KÉPERNYŐ (<= 640px) ─── */
@media (max-width: 640px) {

  .footer-bar {
    /* padding: 8px; */
    padding: 6px 8px;
    /* flex-direction: column; */
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 4px 8px;
  }

  .footer-group {
    width: auto;
    flex: 0 1 auto;
    max-height: none;
  }

  .footer-group-tools,
  .footer-group-settings,
  .footer-group-links {
    flex: 0 1 auto;
  }

  .footer-toolbar { width: auto; justify-content: center; }
  .footer-settings-row { width: auto; display: flex; justify-content: center; }

  .qr-share-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }

  .qr-share-actions .share-app-btn {
    font-size: 0.72rem;
    min-height: 50px;
  }

  /* Kis képernyőn a téma gomb felirat nem fér el: legördülő helyette */
  .theme-toggle-btn { display: none; }
  .theme-menu { display: none !important; }

  .theme-select-mobile {
    display: block;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-strong);
    color: var(--text);
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    max-width: 180px;
  }
}
