:root {
  --bg: #f4efe7;
  --panel: rgba(255, 250, 243, 0.84);
  --panel-strong: #fff8f0;
  --ink: #211814;
  --muted: #6d5b52;
  --accent: #d9482a;
  --accent-deep: #9f2d18;
  --line: rgba(33, 24, 20, 0.14);
  --success: #1f7a4d;
  --shadow: 0 20px 60px rgba(100, 51, 29, 0.14);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(217, 72, 42, 0.18), transparent 28%),
    radial-gradient(circle at bottom right, rgba(31, 122, 77, 0.14), transparent 24%),
    linear-gradient(135deg, #efe6da, #f7f2eb 42%, #ece4d8);
}

body.rtl {
  direction: rtl;
  font-family: Tahoma, "Segoe UI", sans-serif;
}

.app-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0 56px;
}

.hero {
  padding: 10px 8px 28px;
}

.eyebrow,
.section-label {
  margin: 0 0 10px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.82rem;
  font-weight: 800;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4.6rem);
  line-height: 0.95;
  max-width: 9ch;
}

.intro {
  margin-top: 16px;
  max-width: 44rem;
  color: var(--muted);
  font-size: 1.05rem;
}

.panel {
  position: relative;
  overflow: hidden;
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-xl);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.panel::before {
  content: "";
  position: absolute;
  inset: auto -50px -70px auto;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: rgba(217, 72, 42, 0.08);
}

.hidden {
  display: none;
}

.panel-head,
.progress-row,
.actions,
.language-box {
  position: relative;
  z-index: 1;
}

.panel-head,
.progress-row {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}

.language-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin: 24px 0 28px;
}

.option-card {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel-strong);
}

.option-copy {
  max-width: 34rem;
}

.option-note {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.5;
}

.toggle-switch {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.82);
}

.toggle-track {
  position: relative;
  width: 52px;
  height: 30px;
  border-radius: 999px;
  background: rgba(33, 24, 20, 0.16);
  transition: background 160ms ease;
}

.toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 4px 12px rgba(33, 24, 20, 0.18);
  transition: transform 160ms ease;
}

.toggle-switch.is-on .toggle-track {
  background: rgba(31, 122, 77, 0.48);
}

.toggle-switch.is-on .toggle-thumb {
  transform: translateX(22px);
}

body.rtl .toggle-switch.is-on .toggle-thumb {
  transform: translateX(-22px);
}

.toggle-text {
  font-weight: 800;
}

.field-label {
  font-size: 0.94rem;
  font-weight: 700;
}

.segmented {
  display: inline-flex;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.65);
}

.segment,
.primary-button,
.ghost-button,
.item-toggle {
  font: inherit;
}

.segment,
.ghost-button {
  cursor: pointer;
  border: 0;
  background: transparent;
}

.segment {
  padding: 10px 16px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 700;
}

.segment.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #ea6b42);
}

.category-grid,
.checklist-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.category-card,
.checklist-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel-strong);
}

.category-title {
  margin-bottom: 14px;
  font-size: 1.25rem;
  color: var(--accent);
}

.item-list,
.checklist-items {
  display: grid;
  gap: 10px;
}

.item-toggle,
.check-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.item-toggle {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
  background: #fffdf9;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.item-toggle:hover,
.item-toggle:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(217, 72, 42, 0.4);
}

.box,
.checkmark {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid rgba(33, 24, 20, 0.45);
}

.item-toggle.is-selected {
  border-color: rgba(217, 72, 42, 0.32);
  background: rgba(217, 72, 42, 0.08);
}

.item-toggle.is-selected .box {
  border-color: var(--accent);
  background:
    linear-gradient(135deg, var(--accent), #ef7d58);
  box-shadow: inset 0 0 0 4px #fff6f2;
}

.item-copy {
  text-align: start;
  font-size: 1.02rem;
}

.primary-button,
.ghost-button {
  padding: 14px 20px;
  border-radius: 999px;
  font-weight: 800;
}

.primary-button {
  border: 0;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent-deep), var(--accent));
  box-shadow: 0 14px 30px rgba(217, 72, 42, 0.26);
}

.ghost-button {
  border: 1px solid var(--line);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.65);
}

.actions {
  margin-top: 28px;
}

.counter {
  display: grid;
  place-items: center;
  min-width: 56px;
  height: 56px;
  padding: 0 16px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(31, 122, 77, 0.12), rgba(255, 255, 255, 0.85));
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--success);
}

.progress-row {
  margin: 20px 0 24px;
  color: var(--muted);
}

.check-item {
  padding: 0;
  border: 0;
  text-align: start;
  cursor: pointer;
  background: transparent;
  transition: opacity 180ms ease, transform 180ms ease;
}

.check-item:hover .checkmark,
.check-item:focus-visible .checkmark {
  border-color: var(--accent);
}

.check-item.is-removing {
  opacity: 0;
  transform: translateX(12px) scale(0.98);
}

.checkmark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: #fff;
}

.check-item-text {
  font-size: 1.12rem;
}

.empty-state {
  position: relative;
  z-index: 1;
  margin-top: 26px;
  padding: 28px;
  text-align: center;
  border: 1px dashed rgba(31, 122, 77, 0.35);
  border-radius: var(--radius-lg);
  background: rgba(31, 122, 77, 0.07);
}

.empty-state p {
  margin: 10px auto 18px;
  color: var(--muted);
  max-width: 34rem;
}

@media (max-width: 820px) {
  .app-shell {
    width: min(100% - 20px, 1120px);
    padding-top: 22px;
  }

  .panel {
    padding: 22px;
  }

  .category-grid,
  .checklist-grid {
    grid-template-columns: 1fr;
  }

  .panel-head,
  .progress-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .option-card {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
