/* Festival board — pastel, RTL, mobile-first */
:root {
  --bg: #FFF7EE;
  --card: #FFFFFF;
  --text: #3A2E2A;
  --muted: #8C7C74;
  --line: #F2E7DC;
  --mango: #FFB05C;
  --mango-deep: #F58A3D;
  --mango-soft: #FFE3C4;
  --mint: #CDEFDF;
  --lav: #E7DFFF;
  --sky: #DCEEFF;
  --lemon: #FFF1BF;
  --rose: #FFDDE6;
  --radius: 18px;
  --shadow: 0 6px 24px rgba(120, 80, 40, 0.08);
  --shadow-sm: 0 2px 10px rgba(120, 80, 40, 0.07);
  --font-head: 'Fredoka', 'Varela Round', system-ui, sans-serif;
  --font-body: 'Varela Round', 'Fredoka', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(60vw 40vw at 100% -10%, #FFE6CF 0%, rgba(255, 230, 207, 0) 70%),
    radial-gradient(50vw 40vw at -10% 30%, #E9F7EE 0%, rgba(233, 247, 238, 0) 70%),
    radial-gradient(50vw 40vw at 80% 110%, #EEE8FF 0%, rgba(238, 232, 255, 0) 70%);
  background-attachment: fixed;
  min-height: 100vh;
}
body.no-scroll { overflow: hidden; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--font-head); font-weight: 600; margin: 0; line-height: 1.25; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.05rem; }
p { margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
small { color: var(--muted); }
.wrap { max-width: 960px; margin: 0 auto; padding: 0 14px; }
.loading { text-align: center; padding: 30vh 0; color: var(--muted); font-family: var(--font-head); }
.loading .spin { display: inline-block; font-size: 2.5rem; animation: bob 1.2s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 20; background: rgba(255, 247, 238, 0.85); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 8px; padding-bottom: 6px; }
.brand { font-family: var(--font-head); font-weight: 600; font-size: 1.15rem; display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 12px; font-size: 0.85rem; white-space: nowrap; box-shadow: var(--shadow-sm); }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 8px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: 0 0 auto; padding: 6px 12px; border-radius: 999px; font-size: 0.9rem; background: #fff; border: 1px solid var(--line); color: var(--muted); }
.tab.on { background: var(--mango-soft); color: var(--text); border-color: transparent; font-weight: 600; }

/* ---------- layout ---------- */
main.wrap { padding-top: 16px; padding-bottom: 60px; }
section { margin-bottom: 22px; }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.sec-head h2 { display: flex; align-items: center; gap: 6px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.card + .card { margin-top: 10px; }
.grid { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 900px) { .grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.empty { color: var(--muted); text-align: center; padding: 18px; background: rgba(255, 255, 255, 0.6); border-radius: var(--radius); border: 1px dashed var(--line); }
.hint { color: var(--muted); font-size: 0.9rem; }
.back { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); font-size: 0.9rem; margin-bottom: 10px; }

/* ---------- buttons & chips ---------- */
.btn { border: none; border-radius: 999px; padding: 9px 16px; font-family: var(--font-head); font-weight: 600; font-size: 0.95rem; background: #fff; box-shadow: var(--shadow-sm); border: 1px solid var(--line); display: inline-flex; align-items: center; gap: 6px; transition: transform 0.08s ease; }
.btn:active { transform: scale(0.97); }
.btn.primary { background: linear-gradient(135deg, var(--mango) 0%, var(--mango-deep) 100%); color: #fff; border-color: transparent; box-shadow: 0 6px 16px rgba(245, 138, 61, 0.35); }
.btn.soft { background: var(--mango-soft); border-color: transparent; }
.btn.ghost { background: transparent; box-shadow: none; border-color: transparent; color: var(--muted); }
.btn.danger { background: #fff; color: #B23A48; border-color: #FFD0DA; }
.btn.sm { padding: 5px 11px; font-size: 0.85rem; }
.btn.block { width: 100%; justify-content: center; }
.btn.wide { padding: 12px 18px; font-size: 1rem; }
.chip { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 3px 10px 3px 4px; background: #fff; border: 1px solid var(--line); font-size: 0.85rem; }
.chip.person { padding-inline-start: 4px; }
.tag { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 2px 9px; font-size: 0.78rem; background: var(--c, var(--lav)); color: var(--text); }
.need { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 3px 10px; font-size: 0.8rem; background: var(--rose); color: #9B2C45; font-weight: 600; }
.av { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; font-family: var(--font-head); font-weight: 600; font-size: 0.85rem; color: var(--text); flex: 0 0 auto; }
.av.sm { width: 22px; height: 22px; font-size: 0.7rem; }
.avs { display: inline-flex; }
.avs .av { margin-inline-end: -6px; border: 2px solid #fff; }
.who { display: inline-flex; align-items: center; gap: 4px; font-size: 0.82rem; color: var(--muted); }
.pill { border: none; border-radius: 999px; padding: 4px 10px; font-family: var(--font-head); font-weight: 600; font-size: 0.8rem; white-space: nowrap; }
.pill.open { background: #EFE9E2; color: #6B5F58; }
.pill.doing { background: var(--lemon); color: #7A5A00; }
.pill.done { background: var(--mint); color: #1F6B4A; }
.pill.stuck { background: #FFD0DA; color: #9B2C45; }

/* ---------- hero ---------- */
.hero { text-align: center; padding: 22px 16px 18px; position: relative; overflow: hidden; }
.hero .big { font-size: 3rem; line-height: 1; margin-bottom: 4px; }
.hero h1 { font-size: 1.9rem; }
.hero .sub { color: var(--muted); margin-top: 4px; }
.hero .meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 14px; margin-top: 12px; font-size: 0.95rem; }
.hero .intro { margin-top: 12px; font-size: 0.92rem; color: #5b4c45; background: #FFF9F2; border-radius: 14px; padding: 10px 12px; }
.hero .edit { position: absolute; top: 10px; left: 10px; }
.poll { margin-top: 12px; text-align: start; background: #FFF9F2; border-radius: 14px; padding: 10px 12px; }
.poll .t { font-size: 0.85rem; color: var(--muted); margin-bottom: 6px; }
.poll .row { display: grid; grid-template-columns: 5.5rem 1fr 2.2rem; align-items: center; gap: 8px; font-size: 0.9rem; margin: 4px 0; }
.poll .bar { height: 12px; border-radius: 999px; background: #F3EBE3; overflow: hidden; }
.poll .bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--mango), var(--mango-deep)); }
.poll .row.lead { font-weight: 600; }
.poll .note { font-size: 0.8rem; color: var(--muted); margin-top: 6px; }
.countdown { display: inline-flex; align-items: center; gap: 6px; background: var(--mint); border-radius: 999px; padding: 4px 12px; font-weight: 600; font-family: var(--font-head); }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stat { background: #fff; border-radius: 14px; padding: 10px 6px; text-align: center; box-shadow: var(--shadow-sm); }
.stat b { display: block; font-family: var(--font-head); font-size: 1.4rem; line-height: 1.1; }
.stat span { font-size: 0.75rem; color: var(--muted); }

/* ---------- area cards ---------- */
.area-card { display: flex; flex-direction: column; gap: 6px; background: #fff; border-radius: var(--radius); padding: 14px 12px 12px; box-shadow: var(--shadow-sm); border-top: 6px solid var(--c, var(--lav)); min-height: 130px; transition: transform 0.1s ease; }
.area-card:active { transform: scale(0.98); }
.area-card .a-emoji { font-size: 1.7rem; line-height: 1; }
.area-card .a-name { font-family: var(--font-head); font-weight: 600; font-size: 1.02rem; }
.area-card .a-owners { display: flex; flex-wrap: wrap; gap: 4px; font-size: 0.8rem; color: var(--muted); align-items: center; }
.area-card .a-foot { margin-top: auto; font-size: 0.75rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 8px; }
.area-card .a-foot .warn { color: #B0562C; font-weight: 600; }
.area-head { display: flex; align-items: flex-start; gap: 12px; background: var(--c, #fff); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; position: relative; }
.area-head .big { font-size: 2.6rem; line-height: 1; }
.area-head .owners { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; align-items: center; }
.area-head .edit { position: absolute; top: 10px; left: 10px; }
.about { white-space: pre-wrap; }
.about a { color: #B0562C; text-decoration: underline; }
.about.placeholder { color: var(--muted); font-style: italic; }
.ctas { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; }
@media (min-width: 640px) { .ctas { grid-template-columns: repeat(4, 1fr); } }
.cta-big { display: flex; flex-direction: column; align-items: center; gap: 4px; background: #fff; border-radius: var(--radius); padding: 16px 8px; box-shadow: var(--shadow-sm); text-align: center; font-family: var(--font-head); font-weight: 600; border-bottom: 5px solid var(--c, var(--lav)); }
.cta-big .e { font-size: 2rem; line-height: 1; }
.cta-big small { font-weight: 400; }

/* ---------- roles ---------- */
.role { background: #fff; border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 8px; }
.role + .role { margin-top: 8px; }
.role .r-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.role .r-title { font-family: var(--font-head); font-weight: 600; font-size: 1rem; }
.role .r-time { font-size: 0.82rem; color: var(--muted); }
.role .r-note { font-size: 0.85rem; color: #5b4c45; }
.role .r-people { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.role .r-people .chip { padding-inline-end: 6px; }
.role .r-people .chip .x { border: none; background: transparent; color: var(--muted); padding: 0 2px; font-size: 0.8rem; line-height: 1; }
.role .r-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.prog { flex: 1; display: flex; align-items: center; gap: 8px; font-size: 0.82rem; color: var(--muted); }
.prog .bar { flex: 1; height: 8px; border-radius: 999px; background: #F3EBE3; overflow: hidden; max-width: 160px; }
.prog .bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #7ED9A6, #3EB77C); }
.prog.full .bar i { background: linear-gradient(90deg, #7ED9A6, #3EB77C); }
.role-group { margin-bottom: 14px; }
.role-group .g-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-family: var(--font-head); font-weight: 600; }

/* ---------- signups (offers) ---------- */
.offer { background: #fff; border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow-sm); display: flex; gap: 10px; align-items: flex-start; }
.offer + .offer { margin-top: 8px; }
.offer .o-body { flex: 1; min-width: 0; }
.offer .o-name { font-family: var(--font-head); font-weight: 600; }
.offer .o-title { font-weight: 600; color: #5b4c45; }
.offer .o-line { font-size: 0.85rem; color: var(--muted); white-space: pre-wrap; }
.offer .edit-btn { border: none; background: transparent; color: var(--muted); font-size: 1rem; padding: 2px 4px; }

/* ---------- tasks ---------- */
.tasks { display: flex; flex-direction: column; gap: 8px; }
.task { background: #fff; border-radius: 14px; padding: 10px 12px; box-shadow: var(--shadow-sm); display: flex; gap: 10px; align-items: flex-start; }
.task.is-done { opacity: 0.6; }
.task.is-done .t-title { text-decoration: line-through; text-decoration-color: #B8ADA6; }
.task .t-main { flex: 1; min-width: 0; cursor: pointer; }
.task .t-title { font-weight: 600; font-size: 0.97rem; }
.task .t-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 4px; align-items: center; font-size: 0.82rem; color: var(--muted); }
.task .due.late { color: #B23A48; font-weight: 600; }
.task .due.soon { color: #B0562C; font-weight: 600; }
.task .note { flex-basis: 100%; white-space: pre-wrap; }
.group-title { display: flex; align-items: center; gap: 8px; margin: 18px 0 8px; font-family: var(--font-head); font-weight: 600; color: #5b4c45; }
.group-title .n { background: #fff; border-radius: 999px; padding: 0 8px; font-size: 0.8rem; color: var(--muted); border: 1px solid var(--line); }
.filters { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
.filters .tab { font-size: 0.85rem; }
.filters select { border-radius: 999px; border: 1px solid var(--line); background: #fff; padding: 5px 10px; font-size: 0.85rem; }
.holidays { font-size: 0.82rem; color: var(--muted); background: rgba(255, 255, 255, 0.7); border-radius: 12px; padding: 8px 12px; margin-bottom: 8px; }

/* ---------- people ---------- */
.person-card { background: #fff; border-radius: var(--radius); padding: 14px 12px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.person-card .av { width: 48px; height: 48px; font-size: 1.3rem; }
.person-card .p-name { font-family: var(--font-head); font-weight: 600; font-size: 1.05rem; }
.person-card .p-line { font-size: 0.78rem; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- log ---------- */
.log-row { display: flex; gap: 8px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 0.9rem; }
.log-row .when { color: var(--muted); font-size: 0.78rem; flex: 0 0 5.5rem; }
.log-row .what { flex: 1; }
.trash-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 0.9rem; }

/* ---------- footer ---------- */
footer { color: var(--muted); font-size: 0.8rem; text-align: center; padding: 20px 14px 40px; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; }
footer a { text-decoration: underline; text-decoration-color: #D9CCC0; }

/* ---------- modal / bottom sheet ---------- */
#modal-root { position: fixed; inset: 0; z-index: 50; display: none; }
#modal-root.open { display: block; }
.backdrop { position: absolute; inset: 0; background: rgba(58, 46, 42, 0.35); backdrop-filter: blur(2px); }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; background: #fff; border-radius: 22px 22px 0 0; padding: 14px 16px calc(16px + env(safe-area-inset-bottom)); max-height: 92vh; overflow: auto; box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.15); animation: up 0.18s ease-out; }
@keyframes up { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (min-width: 640px) {
  .sheet { left: 50%; right: auto; top: 50%; bottom: auto; transform: translate(-50%, -50%); width: min(520px, 92vw); border-radius: 22px; animation: pop 0.15s ease-out; }
  @keyframes pop { from { transform: translate(-50%, -48%); opacity: 0; } to { transform: translate(-50%, -50%); opacity: 1; } }
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.sheet .x { border: none; background: #F6EFE8; border-radius: 50%; width: 32px; height: 32px; color: var(--muted); }
.sheet .hint { margin-bottom: 8px; }
.f { display: block; margin: 10px 0; }
.f > span { display: block; font-size: 0.85rem; color: var(--muted); margin-bottom: 4px; }
.f .req { color: #E0572E; }
.f input, .f textarea, .f select { width: 100%; border: 1.5px solid #EADFD4; border-radius: 12px; padding: 10px 12px; background: #FFFDFB; outline: none; }
.f input:focus, .f textarea:focus, .f select:focus { border-color: var(--mango); box-shadow: 0 0 0 3px rgba(255, 176, 92, 0.25); }
.f input.err, .f textarea.err { border-color: #E0572E; }
.f small { display: block; margin-top: 3px; font-size: 0.75rem; }
.sheet-actions { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.sheet-actions .grow { flex: 1; }
.status-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0 4px; }
.status-pick .pill { padding: 12px; font-size: 1rem; text-align: center; border: 2px solid transparent; }
.status-pick .pill.cur { border-color: var(--text); }

/* ---------- toast ---------- */
#toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--text); color: #fff; padding: 8px 16px; border-radius: 999px; font-size: 0.9rem; opacity: 0; transition: all 0.2s ease; z-index: 60; pointer-events: none; white-space: nowrap; max-width: 92vw; overflow: hidden; text-overflow: ellipsis; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
