/* לוח ההצעות — עיצוב פשוט ונקי, RTL, מותאם לטלפון. צבעים כמשתנים; מצב כהה לפי הגדרת המערכת. */
:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --ink: #1d2433;
  --muted: #667085;
  --line: #e4e7ec;
  --brand: #0f766e;
  --brand-soft: #e6f4f2;
  --on-brand: #ffffff;
  --pending: #fff7e0;
  --pending-line: #f2c94c;
  --ok: #157f3b;
  --danger: #b42318;
  --s-proposed: #eef1f5;   --s-proposed-ink: #475467;
  --s-review: #e8f0fe;     --s-review-ink: #1d4ed8;
  --s-planned: #f1ebff;    --s-planned-ink: #6d28d9;
  --s-building: #fff1e0;   --s-building-ink: #b45309;
  --s-shipped: #e3f6ea;    --s-shipped-ink: #157f3b;
  --s-rejected: #f2f4f7;   --s-rejected-ink: #667085;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f141b;
    --surface: #171e27;
    --ink: #e6e9ee;
    --muted: #98a2b3;
    --line: #273142;
    --brand: #2bb3a3;
    --brand-soft: #123532;
    --on-brand: #0b1512;
    --pending: #2b2414;
    --pending-line: #8a6d1d;
    --ok: #4cc27a;
    --danger: #f97066;
    --s-proposed: #222b38;   --s-proposed-ink: #c0c8d4;
    --s-review: #1b2a48;     --s-review-ink: #9dbbff;
    --s-planned: #2a2145;    --s-planned-ink: #c4b0ff;
    --s-building: #3a2a14;   --s-building-ink: #f5b765;
    --s-shipped: #16321f;    --s-shipped-ink: #7ddc9f;
    --s-rejected: #222b38;   --s-rejected-ink: #98a2b3;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Arial, "Noto Sans Hebrew", sans-serif;
}
.wrap { width: 100%; max-width: 860px; margin: 0 auto; padding: 0 16px; }
button, input, textarea, select { font: inherit; color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- כותרת ---------- */
.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; }
.brand { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); }
.account { display: flex; align-items: center; gap: 12px; min-width: 0; }
.who { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hero { padding-top: 20px; padding-bottom: 24px; }
.hero h1 { margin: 0 0 6px; font-size: clamp(1.6rem, 4.5vw, 2.2rem); line-height: 1.25; }
.lead { margin: 0 0 18px; color: var(--muted); font-size: 1.05rem; max-width: 46em; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.filters { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); }
.filters button { border: 0; background: none; padding: 6px 14px; border-radius: 999px; cursor: pointer; color: var(--muted); font-weight: 600; font-size: .92rem; }
.filters button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

/* ---------- כפתורים ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 18px; border-radius: 10px; border: 1px solid transparent; font-weight: 700; cursor: pointer; }
.btn:disabled { opacity: .6; cursor: default; }
.btn-primary { background: var(--brand); color: var(--on-brand); }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: .9rem; }
.link-btn { border: 0; background: none; padding: 0; color: var(--brand); font-weight: 600; cursor: pointer; }
.link-btn:disabled { opacity: .6; }
.link-btn.danger { color: var(--danger); }
.link-btn.ok { color: var(--ok); }
.icon-btn { border: 0; background: none; width: 36px; height: 36px; border-radius: 8px; cursor: pointer; color: var(--muted); font-size: 1rem; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------- הודעות ---------- */
main { padding-top: 20px; padding-bottom: 32px; }
.notice { margin: 0 0 14px; padding: 10px 14px; border-radius: 10px; background: var(--brand-soft); }
.notice.is-error { background: color-mix(in srgb, var(--danger) 12%, var(--surface)); color: var(--danger); }
.notice.is-ok { background: color-mix(in srgb, var(--ok) 12%, var(--surface)); }
.admin-bar { margin: 0 0 14px; padding: 10px 14px; border-radius: 10px; background: var(--pending); border: 1px solid var(--pending-line); font-weight: 600; }

/* ---------- רשימת ההצעות ---------- */
.ideas { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.loading, .empty { padding: 28px 16px; text-align: center; color: var(--muted); background: var(--surface); border-radius: var(--radius); border: 1px solid var(--line); }
.idea { display: flex; gap: 14px; align-items: flex-start; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.idea.is-pending { background: var(--pending); border-color: var(--pending-line); }
.idea-main { flex: 1; min-width: 0; }
.idea-title { margin: 0 0 4px; font-size: 1.12rem; line-height: 1.4; overflow-wrap: anywhere; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 8px; color: var(--muted); font-size: .88rem; }
.status { display: inline-block; padding: 1px 10px; border-radius: 999px; font-weight: 700; font-size: .8rem; background: var(--s-proposed); color: var(--s-proposed-ink); }
.s-review { background: var(--s-review); color: var(--s-review-ink); }
.s-planned { background: var(--s-planned); color: var(--s-planned-ink); }
.s-building { background: var(--s-building); color: var(--s-building-ink); }
.s-shipped { background: var(--s-shipped); color: var(--s-shipped-ink); }
.s-rejected { background: var(--s-rejected); color: var(--s-rejected-ink); }
.pending-tag { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--pending); border: 1px solid var(--pending-line); color: var(--ink); font-size: .78rem; font-weight: 700; }
.badge { display: inline-block; padding: 0 7px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-size: .74rem; font-weight: 700; }
.rich { overflow-wrap: anywhere; }
.rich p { margin: 0 0 8px; }
.rich ul { margin: 0 0 8px; padding-inline-start: 20px; }
.rich .bullet { display: list-item; margin-inline-start: 20px; }
.team-note { margin: 10px 0 4px; padding: 10px 12px; border-radius: 10px; background: var(--s-shipped); color: var(--ink); border-inline-start: 3px solid var(--ok); }
.idea-foot { display: flex; align-items: center; gap: 16px; margin-top: 6px; }

/* כפתור ההצבעה — עמודה בצד הכרטיס; בטלפון שורה מתחת לכותרת. */
.vote { flex: none; display: grid; justify-items: center; gap: 0; width: 72px; padding: 8px 4px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); cursor: pointer; color: var(--ink); }
.vote:disabled { opacity: .5; cursor: default; }
.vote.is-on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.vote-arrow { font-size: .8rem; line-height: 1; }
.vote-count { font-size: 1.25rem; font-weight: 800; line-height: 1.3; }
.vote-label { font-size: .7rem; color: var(--muted); white-space: nowrap; }
.vote.is-on .vote-label { color: inherit; }

/* ---------- דיון ---------- */
.discussion { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.muted { color: var(--muted); }
.comment { padding: 10px 12px; border-radius: 10px; background: var(--bg); }
.comment.is-staff { background: var(--brand-soft); }
.comment.is-pending { background: var(--pending); border: 1px dashed var(--pending-line); }
.comment-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0 0 2px; font-size: .9rem; }
.reply-to { margin: 0 0 2px; font-size: .82rem; }
.comment-body { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.comment-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 4px; font-size: .88rem; }
.admin-inline { display: inline-flex; gap: 14px; }
.comment-form { display: grid; gap: 8px; }
.comment-form textarea, .field input, .field textarea, .admin-form textarea, .admin-form select {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); resize: vertical;
}
.comment-form .btn { justify-self: start; }
.replying { margin: 0; font-size: .88rem; }
.login-hint { margin: 4px 0 0; color: var(--muted); }

/* ---------- ניהול ---------- */
.admin-panel { margin-top: 10px; border: 1px dashed var(--line); border-radius: 10px; padding: 6px 10px; }
.admin-panel summary { cursor: pointer; color: var(--muted); font-weight: 600; font-size: .9rem; }
.admin-form { display: grid; gap: 8px; margin: 8px 0 4px; }
.admin-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

/* ---------- חלונות ---------- */
.sheet { width: min(440px, calc(100vw - 32px)); border: 0; border-radius: 16px; padding: 18px 20px 20px; background: var(--surface); color: var(--ink); box-shadow: 0 20px 50px rgba(16, 24, 40, .25); }
.sheet::backdrop { background: rgba(15, 20, 27, .45); }
.sheet h2 { margin: 0 0 4px; font-size: 1.3rem; }
.sheet .sub { margin: 0 0 16px; color: var(--muted); }
.sheet-close-row { display: flex; justify-content: flex-end; margin: -6px -8px 0 -8px; }
.google-slot { display: flex; justify-content: center; min-height: 44px; }
.or { display: flex; align-items: center; gap: 10px; margin: 14px 0; color: var(--muted); font-size: .85rem; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.stack { display: grid; gap: 12px; }
.field { display: grid; gap: 4px; font-weight: 600; font-size: .92rem; }
.field input, .field textarea { font-weight: 400; }
.msg { margin: 12px 0 0; min-height: 1.2em; font-size: .92rem; }
.msg.is-error { color: var(--danger); }
.msg.is-ok { color: var(--ok); }

.foot { padding-bottom: 28px; color: var(--muted); font-size: .85rem; text-align: center; }
.foot p { margin: 0; }

@media (max-width: 560px) {
  .idea { flex-direction: column; gap: 10px; padding: 14px; }
  .vote { order: 2; display: inline-flex; align-items: center; gap: 6px; width: auto; padding: 6px 12px; border-radius: 999px; }
  .vote-count { font-size: 1rem; }
  .vote-label { font-size: .8rem; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .filters { justify-content: center; }
  .filters button { flex: 1; }
}
