:root {
  --bg: #f6f4ec;
  --ink: #1d2418;
  --ink-soft: #4c5342;
  --muted: #777b6c;
  --line: #e4dfd0;
  --card: #fffdf7;
  --lime: #c9f24d;
  --lime-deep: #a9d92f;
  --green: #22300f;
  --shadow-sm: 0 12px 30px -20px rgba(35, 48, 25, 0.35);
  --shadow-lg: 0 28px 60px -30px rgba(35, 48, 25, 0.4);
  --radius: 24px;
  --max: 1040px;
  --font: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  display: flex;
  flex-direction: column;
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection {
  background: var(--lime);
  color: var(--green);
}

a {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

.skip-link {
  position: absolute;
  top: -60px;
  left: 16px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.skip-link:focus {
  top: 16px;
}

/* ---------- Háttér ---------- */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(20px);
}

.glow-a {
  top: -360px;
  right: -200px;
  width: 760px;
  height: 760px;
  background: radial-gradient(circle, rgba(201, 242, 77, 0.42), rgba(201, 242, 77, 0) 66%);
}

.glow-b {
  bottom: -420px;
  left: -280px;
  width: 820px;
  height: 820px;
  background: radial-gradient(circle, rgba(230, 196, 106, 0.16), rgba(230, 196, 106, 0) 66%);
}

/* ---------- Fejléc ---------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 24px 32px 6px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  border-radius: 14px;
}

.brand:focus-visible {
  outline: 3px solid var(--lime-deep);
  outline-offset: 5px;
}

.brand-mark {
  display: block;
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  box-shadow: 0 10px 22px -14px rgba(35, 48, 25, 0.6);
}

.brand-mark svg {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
}

.brand-word {
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1;
}

.brand-dot {
  color: var(--lime-deep);
}

.settings-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 253, 247, 0.75);
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.settings-btn:hover {
  background: #fff;
  border-color: #cfc9b6;
}

.settings-btn:focus-visible {
  outline: 3px solid var(--lime-deep);
  outline-offset: 3px;
}

/* ---------- Bevezető ---------- */

main {
  flex: 1 0 auto;
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 32px 40px;
}

.intro {
  padding: 54px 0 46px;
}

h1 {
  margin: 0;
  max-width: 12ch;
  font-size: clamp(42px, 5.4vw, 68px);
  font-weight: 800;
  letter-spacing: -0.055em;
  line-height: 0.97;
}

.mark {
  background: linear-gradient(
    180deg,
    transparent 60%,
    rgba(201, 242, 77, 0.9) 60%,
    rgba(201, 242, 77, 0.9) 92%,
    transparent 92%
  );
  padding-right: 0.05em;
}

/* ---------- Szekciók ---------- */

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 14px;
}

.section-head h2 {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.apps-primary {
  margin-bottom: 40px;
}

.primary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}

.primary-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 136px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(130% 150% at 100% 0%, color-mix(in srgb, var(--accent) 34%, transparent), transparent 58%),
    var(--card);
  color: inherit;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease;
  overflow: hidden;
}

.primary-card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--accent) 60%, #c9c3b0);
  box-shadow: var(--shadow-lg);
}

.primary-card:focus-visible {
  outline: 3px solid #7fae22;
  outline-offset: 4px;
}

.primary-icon {
  flex: none;
  width: 76px;
  height: 76px;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 18px 32px -20px rgba(35, 48, 25, 0.55);
}

.primary-icon img {
  width: 100%;
  height: 100%;
}

.primary-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.primary-copy strong {
  font-size: clamp(21px, 2.4vw, 26px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.1;
}

.primary-copy small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.primary-arrow {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  margin-left: auto;
  border-radius: 50%;
  background: var(--ink);
  color: var(--lime);
  font-size: 18px;
  transition: transform 0.24s ease;
}

.primary-card:hover .primary-arrow {
  transform: translateX(3px);
}

.apps-secondary {
  margin-bottom: 30px;
}

.secondary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 10px;
}

.secondary-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  color: inherit;
  text-decoration: none;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.secondary-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 55%, #c9c3b0);
  box-shadow: var(--shadow-sm);
}

.secondary-card:focus-visible {
  outline: 3px solid #7fae22;
  outline-offset: 3px;
}

.secondary-icon {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  overflow: hidden;
}

.secondary-icon img {
  width: 100%;
  height: 100%;
}

.secondary-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.secondary-copy strong {
  font-size: 13.5px;
  font-weight: 750;
  letter-spacing: -0.015em;
}

.secondary-copy small {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.secondary-arrow {
  margin-left: auto;
  color: #a4a797;
  font-size: 14px;
}

.letter-icon {
  display: grid;
  place-items: center;
  width: var(--size, 38px);
  height: var(--size, 38px);
  border-radius: calc(var(--size, 38px) * 0.29);
  background: var(--accent);
  color: #2c2a1e;
  font-size: calc(var(--size, 38px) * 0.42);
  font-weight: 800;
  letter-spacing: -0.02em;
  flex: none;
}

.empty-note {
  margin: 0;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  color: var(--muted);
  font-size: 13px;
}

/* ---------- Lábléc ---------- */

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: var(--max);
  margin: auto auto 0;
  padding: 18px 32px 30px;
  color: #9a9b8b;
  font-size: 11px;
  font-weight: 600;
}

.footer-admin {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-admin:hover {
  color: var(--ink);
}

/* ---------- Beállítások ---------- */

.settings {
  width: min(620px, calc(100vw - 24px));
  max-height: 88vh;
  padding: 0;
  border: none;
  border-radius: 26px;
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 40px 100px -30px rgba(20, 26, 14, 0.55);
}

.settings::backdrop {
  background: rgba(24, 30, 18, 0.42);
  backdrop-filter: blur(4px);
}

.settings-inner {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px;
  max-height: 88vh;
}

.settings-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.settings-head h2 {
  margin: 0 0 4px;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.settings-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.close-btn {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--ink-soft);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.close-btn:hover {
  background: #f1eee2;
}

.settings-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: 44vh;
  overflow: auto;
}

.settings-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 2px;
  border-bottom: 1px dashed #e9e4d5;
}

.settings-row:last-child {
  border-bottom: none;
}

.settings-row.is-primary {
  background: transparent;
}

.settings-icon {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  overflow: hidden;
}

.settings-icon img {
  width: 100%;
  height: 100%;
}

.settings-icon .letter-icon {
  --size: 34px;
}

.settings-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.settings-copy strong {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.settings-copy small {
  color: var(--muted);
  font-size: 10.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pin-btn,
.move-btn,
.delete-btn {
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.pin-btn {
  min-width: 38px;
  height: 28px;
  padding: 0 8px;
  color: #8b8e7d;
}

.pin-btn.is-on {
  border-color: #cfe39a;
  background: #eaf8c8;
  color: #4d6618;
}

.move-btn {
  width: 28px;
  height: 28px;
  font-size: 13px;
}

.move-btn:disabled {
  opacity: 0.32;
  cursor: default;
}

.move-btn:not(:disabled):hover,
.pin-btn:hover {
  border-color: #c9c3b0;
}

.delete-btn {
  width: 28px;
  height: 28px;
  color: #a06050;
  font-size: 16px;
}

.delete-btn:hover {
  border-color: #e4bfb4;
  background: #fbf0ec;
}

.settings-empty {
  padding: 14px;
  color: var(--muted);
  font-size: 12px;
}

.add-block {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.add-block h3 {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.add-grid {
  display: grid;
  grid-template-columns: 1fr 1.35fr auto auto;
  gap: 7px;
  align-items: center;
}

.add-grid input[type="text"] {
  min-width: 0;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  font-size: 12px;
}

.add-grid input[type="text"]:focus {
  outline: 2px solid var(--lime-deep);
  outline-offset: 1px;
}

.add-primary {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
}

.add-primary input {
  accent-color: #7fae22;
}

.add-btn {
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--ink);
  border-radius: 9px;
  background: var(--ink);
  color: #fff;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}

.add-btn:hover {
  background: #2c3520;
}

.form-error {
  min-height: 14px;
  margin: 6px 0 0;
  color: #a14c3c;
  font-size: 11px;
}

.settings-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 4px;
}

.link-btn {
  border: none;
  background: none;
  padding: 0;
  color: var(--muted);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.settings-note {
  flex: 1;
  color: #a2a493;
  font-size: 10.5px;
  text-align: right;
}

.done-btn {
  height: 36px;
  padding: 0 18px;
  border: none;
  border-radius: 999px;
  background: var(--lime);
  color: var(--green);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
}

.done-btn:hover {
  background: #bde63c;
}

/* ---------- Reszponzív ---------- */

@media (max-width: 720px) {
  .site-header {
    padding: 18px 18px 4px;
  }

  main {
    padding: 0 18px 30px;
  }

  .intro {
    padding: 38px 0 34px;
  }

  h1 {
    font-size: clamp(38px, 11vw, 50px);
  }

  .primary-grid,
  .secondary-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .primary-card {
    min-height: 0;
    padding: 18px;
    gap: 15px;
  }

  .primary-icon {
    width: 62px;
    height: 62px;
    border-radius: 18px;
  }

  .primary-arrow {
    width: 38px;
    height: 38px;
  }

  .settings-inner {
    padding: 18px;
  }

  .settings-head p {
    max-width: 34ch;
  }

  .add-grid {
    grid-template-columns: 1fr 1fr;
  }

  .add-grid #add-app {
    grid-column: span 2;
  }

  .add-primary {
    justify-self: start;
  }

  .settings-note {
    display: none;
  }

  .site-footer {
    padding: 14px 18px 26px;
  }
}

@media (max-width: 430px) {
  .settings-row {
    flex-wrap: wrap;
  }

  .settings-copy {
    flex-basis: calc(100% - 42px);
  }

  .settings-row .pin-btn {
    margin-left: 42px;
  }
}

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