:root {
  --ink: #2A1A22;
  --ink-soft: #6E5A63;
  --wine: #8C1D4E;
  --wine-deep: #6B1339;
  --blush: #FBEFF3;
  --paper: #FFFCFD;
  --line: #EEDFE5;
  --prio2: #C98BA6;
  --font-display: 'Frank Ruhl Libre', Georgia, serif;
  --font-body: 'Assistant', system-ui, sans-serif;
  --header-h: 56px;
  --tabs-h: 56px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  overflow-x: hidden;
  text-align: right;
}

body { font-size: 1.0625rem; font-weight: 400; }

p { text-wrap: pretty; max-width: 68ch; }

button, input, select, textarea { font-family: var(--font-body); }

:focus-visible {
  outline: 2px solid var(--wine);
  outline-offset: 2px;
}

/* ===== Header ===== */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 15;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: var(--wine);
  color: #fff;
  padding: 0 16px;
}
.top-bar h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.75rem;
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-align: right;
}

/* ===== Segmented control ===== */
.tabs {
  position: sticky;
  top: var(--header-h);
  z-index: 14;
  background: var(--paper);
  padding: 8px 16px;
  display: flex;
  justify-content: center;
}
.tabs-inner {
  display: flex;
  gap: 4px;
  background: var(--blush);
  border-radius: 12px;
  padding: 4px;
  height: 48px;
  width: 100%;
  max-width: 720px;
}
.tab-btn {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--ink-soft);
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: 9px;
  cursor: pointer;
  min-height: 40px;
  transition: background 150ms ease-out, color 150ms ease-out;
}
.tab-btn.active {
  background: #fff;
  color: var(--wine);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

main { padding: 12px 16px 120px; max-width: 720px; margin: 0 auto; }

.view { display: none; }
.view.active { display: block; }

/* ===== Filters ===== */
.chips-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  padding: 4px 0 8px;
  scrollbar-width: none;
}
.chips-scroll::-webkit-scrollbar { display: none; }
.chips-scroll .chip { scroll-snap-align: start; flex: 0 0 auto; }

.chip {
  height: 32px;
  padding: 0 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 150ms ease-out, color 150ms ease-out;
}
.chip.active {
  background: var(--wine);
  border-color: var(--wine);
  color: #fff;
}

.filter-details { margin: 0 0 4px; }
.filter-details summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: var(--wine);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 6px 4px;
  min-height: 44px;
  list-style: none;
}
.filter-details summary::-webkit-details-marker { display: none; }
.filter-details summary::before { content: "⌄"; font-size: 0.8em; transition: transform 150ms ease-out; }
.filter-details[open] summary::before { transform: rotate(180deg); }
.filter-count {
  background: var(--wine);
  color: #fff;
  border-radius: 999px;
  font-size: 0.75rem;
  padding: 1px 8px;
}
.filter-count.hidden { display: none; }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 0 8px; }

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line);
  padding: 2px 0 8px;
  margin-bottom: 12px;
}
.clear-btn {
  background: none;
  border: none;
  color: var(--wine);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  padding: 8px;
  min-height: 44px;
}

/* ===== Cards ===== */
.records-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 720px;
  margin: 0 auto;
}

.record-card {
  position: relative;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 1px 2px rgba(42, 26, 34, 0.05);
}
.record-card::before {
  content: "";
  position: absolute;
  right: 0;
  top: 14px;
  bottom: 14px;
  width: 3px;
  border-radius: 2px;
}
.record-card.prio-1::before { background: var(--wine); }
.record-card.prio-2::before { background: var(--prio2); }
.record-card.prio-3::before { background: var(--line); }

.record-meta-top {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
  margin-bottom: 4px;
}

.record-title {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.record-desc {
  margin: 0 0 4px;
  color: var(--ink);
  white-space: pre-wrap;
}
.record-desc.clamped {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.desc-more {
  background: none;
  border: none;
  color: var(--wine);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  padding: 8px 0;
  min-height: 44px;
}
.desc-more.hidden { display: none; }

.record-actions {
  display: flex;
  justify-content: flex-start;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.nav-btn, .link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  padding: 0 16px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9375rem;
  transition: background 150ms ease-out;
}
.nav-btn { background: var(--wine); color: #fff; }
.nav-btn:hover { background: var(--wine-deep); }
.link-btn { background: transparent; border: 1px solid var(--line); color: var(--wine); }
.link-btn:hover { background: var(--blush); }
.nav-btn svg, .link-btn svg { width: 16px; height: 16px; flex: 0 0 auto; }
.nav-btn.hidden, .link-btn.hidden { display: none; }

/* ===== Day grouping ===== */
.day-picker {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 4px 0 12px;
}
.day-picker::-webkit-scrollbar { display: none; }
.day-btn {
  flex: 0 0 auto;
  min-width: 64px;
  min-height: 44px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: background 150ms ease-out, color 150ms ease-out;
}
.day-btn.active { background: var(--wine); border-color: var(--wine); color: #fff; }

.day-header {
  position: sticky;
  top: calc(var(--header-h) + var(--tabs-h) + 8px);
  z-index: 5;
  background: rgba(255, 252, 253, 0.95);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--wine);
  padding: 8px 4px;
  border-bottom: 1px solid var(--line);
  margin: 4px 0 8px;
}

/* ===== Emergency ===== */
.emergency-banner {
  background: var(--blush);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 14px;
  padding: 16px 20px;
  margin-bottom: 16px;
}
.emergency-banner strong {
  font-family: var(--font-display);
  font-size: 1.25rem;
  display: block;
  margin-bottom: 2px;
  color: var(--wine);
}
.emergency-banner p { margin: 0; color: var(--ink-soft); font-size: 0.9375rem; }

.empty-state {
  text-align: center;
  color: var(--ink-soft);
  padding: 40px 16px;
  font-size: 1rem;
}
.empty-state .clear-btn { display: inline-block; margin-top: 4px; }

/* ===== FABs ===== */
.fab {
  position: fixed;
  bottom: max(16px, env(safe-area-inset-bottom, 0px) + 16px);
  left: 16px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--wine);
  color: #fff;
  border: none;
  box-shadow: 0 4px 12px rgba(140, 29, 78, 0.3);
  cursor: pointer;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 150ms ease-out;
}
.fab:hover { background: var(--wine-deep); }
.fab svg { width: 24px; height: 24px; }

.fab-assistant {
  bottom: max(84px, env(safe-area-inset-bottom, 0px) + 84px);
  font-size: 1.5rem;
  background: #fff;
  border: 1.5px solid var(--wine);
  color: var(--wine);
}
.fab-assistant:hover { background: var(--blush); }

/* ===== Modals ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(42, 26, 34, 0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 30;
}
.modal-overlay.hidden { display: none; }

.modal {
  background: #fff;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 20px 20px 0 0;
  padding: 20px;
}
@media (min-width: 600px) {
  .modal-overlay { align-items: center; }
  .modal { border-radius: 16px; }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.modal-header h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}
.close-btn {
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--ink);
  min-width: 44px;
  min-height: 44px;
}

#addForm label {
  display: block;
  font-weight: 600;
  margin-bottom: 14px;
  font-size: 0.9375rem;
}
#addForm input, #addForm select, #addForm textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 12px;
  font-size: 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-family: inherit;
  min-height: 48px;
  background: var(--paper);
  color: var(--ink);
}
#addForm textarea { min-height: 80px; }

.form-row-split { display: flex; gap: 12px; }
.form-row-split label { flex: 1; }

.hp-field {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.primary-btn {
  width: 100%;
  padding: 0 16px;
  min-height: 48px;
  background: var(--wine);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 150ms ease-out;
}
.primary-btn:hover { background: var(--wine-deep); }
.primary-btn:disabled { opacity: 0.6; }

.form-error {
  background: #FDECEF;
  color: #7A1F35;
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 12px;
  font-size: 0.875rem;
}
.form-error.hidden { display: none; }

.toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 12px 20px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.9375rem;
  z-index: 40;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}
.toast.hidden { display: none; }

/* ===== Assistant chat ===== */
.assistant-modal {
  display: flex;
  flex-direction: column;
  height: 85vh;
  max-height: 700px;
}

.code-gate { text-align: center; padding: 20px 8px; }
.code-gate input {
  display: block;
  margin: 12px auto;
  padding: 14px;
  font-size: 1.5rem;
  text-align: center;
  letter-spacing: 0.5em;
  width: 180px;
  border: 1px solid var(--line);
  border-radius: 12px;
  direction: ltr;
}

.assistant-chat { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.assistant-chat.hidden, .code-gate.hidden { display: none; }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 2px 12px;
}

.chat-bubble {
  max-width: 88%;
  padding: 12px 14px;
  border-radius: 16px;
  font-size: 1rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}
.chat-bubble.user {
  align-self: flex-start;
  background: var(--wine);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-bubble.bot {
  align-self: flex-end;
  background: var(--blush);
  color: var(--ink);
  border-bottom-left-radius: 4px;
}
.chat-bubble.error {
  align-self: center;
  background: #FDECEF;
  color: #7A1F35;
}

.chat-working { padding: 8px 4px; color: var(--wine); font-weight: 600; font-size: 0.9375rem; }
.chat-working.hidden { display: none; }
.chat-working .dots { animation: blinkdots 1.2s infinite; }
@keyframes blinkdots { 0%, 100% { opacity: 0.2; } 50% { opacity: 1; } }

.chat-input-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}
.chat-input-row textarea {
  flex: 1;
  padding: 12px;
  font-size: 1rem;
  font-family: inherit;
  border: 1px solid var(--line);
  border-radius: 12px;
  resize: none;
  min-height: 52px;
}
.chat-send-btn { width: auto; padding: 0 18px; min-height: 52px; }

/* ===== Motion ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

.chat-hint {
  margin: 8px 2px 0;
  font-size: 0.8125rem;
  color: var(--ink-soft);
  text-align: center;
}

/* ===== לוח הטיול ===== */
.cal-modes { display: flex; gap: 8px; padding: 4px 0 10px; }
.cal-mode-btn.active { background: var(--wine); border-color: var(--wine); color: #fff; }

.cal-range-row { display: flex; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.cal-range-row label { font-size: 0.875rem; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.cal-range-row input {
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px;
  font-family: inherit; font-size: 0.9375rem; min-height: 44px; background: #fff;
}
.cal-range-row.hidden { display: none; }

.cal-notice {
  background: var(--blush); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 14px; font-size: 0.9375rem; margin: 0 0 12px;
}
.cal-notice.hidden { display: none; }

.cal-board { display: flex; gap: 12px; overflow-x: auto; align-items: flex-start; padding-bottom: 8px; }
.cal-board.single-day { overflow-x: visible; }
.cal-board.single-day .cal-day { flex: 1; max-width: none; }

.cal-day {
  flex: 0 0 240px; max-width: 240px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 0 10px 10px; min-height: 120px;
}
.cal-day-header { position: static; border-bottom: 1px solid var(--line); margin: 0 -10px 8px; padding: 10px 12px 8px; background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }

.cal-zone-label {
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.03em;
  color: var(--ink-soft); margin: 2px 0 6px;
}
.cal-allday { border-bottom: 1px dashed var(--line); padding-bottom: 8px; margin-bottom: 8px; }
.cal-allday:last-child { border-bottom: none; margin-bottom: 0; }

.cal-item {
  position: relative; display: flex; align-items: baseline; gap: 6px; width: 100%;
  text-align: right; background: var(--paper); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 12px 8px 8px; margin-bottom: 6px;
  font-family: inherit; font-size: 0.875rem; cursor: pointer; min-height: 44px;
  transition: background 150ms ease-out;
}
.cal-item:hover { background: var(--blush); }
.cal-item::before {
  content: ""; position: absolute; right: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 2px;
}
.cal-item.prio-1::before { background: var(--wine); }
.cal-item.prio-2::before { background: var(--prio2); }
.cal-item.prio-3::before { background: var(--line); }

.cal-time {
  flex: 0 0 auto; font-weight: 700; color: var(--wine);
  font-variant-numeric: tabular-nums; direction: ltr;
}
.cal-item-title { flex: 1; font-weight: 600; color: var(--ink); word-break: break-word; }
.cal-cat { flex: 0 0 auto; font-size: 0.75rem; color: var(--ink-soft); }

.cal-empty { color: var(--ink-soft); font-size: 0.875rem; padding: 12px 4px; text-align: center; }

.no-date-details { margin-top: 16px; }
.no-date-details summary {
  cursor: pointer; color: var(--wine); font-weight: 600; font-size: 0.9375rem;
  padding: 10px 4px; min-height: 44px; display: inline-flex; align-items: center; gap: 8px;
  list-style: none;
}
.no-date-details summary::-webkit-details-marker { display: none; }
.no-date-details summary::before { content: "⌄"; font-size: 0.8em; transition: transform 150ms ease-out; }
.no-date-details[open] summary::before { transform: rotate(180deg); }
.no-date-details .filter-count { font-size: 0.75rem; }

.detail-when { font-weight: 600; color: var(--wine); margin: 4px 0 8px; }
.detail-when.hidden { display: none; }

/* נייד: עמודות הלוח נערמות אנכית, יום אחרי יום */
@media (max-width: 700px) {
  .cal-board { flex-direction: column; overflow-x: visible; }
  .cal-day { flex: 1 1 auto; max-width: none; }
  .cal-day-header {
    position: sticky; top: calc(var(--header-h) + var(--tabs-h) + 8px); z-index: 5;
    background: rgba(255, 252, 253, 0.95);
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  }
}

/* ===== מי בטיול ===== */
.block-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 4px 16px 8px;
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
}
.block-filter::-webkit-scrollbar { display: none; }
.block-filter-label {
  flex: 0 0 auto;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--ink-soft);
}
.block-chip { flex: 0 0 auto; }

/* ===== המלצות פתוחות ===== */
.open-notice { margin: 4px 0 16px; }
.schedule-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 44px; padding: 0 16px; border-radius: 10px;
  background: var(--blush); border: 1px solid var(--wine); color: var(--wine);
  font-weight: 600; font-size: 0.9375rem; cursor: pointer;
  transition: background 150ms ease-out;
}
.schedule-btn:hover { background: var(--wine); color: #fff; }

#scheduleForm label {
  display: block; font-weight: 700; margin-bottom: 14px; font-size: 0.9375rem;
}
#scheduleForm input {
  display: block; width: 100%; margin-top: 6px; padding: 12px; font-size: 1rem;
  border: 1px solid var(--line); border-radius: 10px; font-family: inherit;
  min-height: 48px; background: var(--paper); color: var(--ink);
}

/* ===== מפת הטיול ===== */
#mapContainer {
  width: 100%;
  height: 62vh;
  min-height: 380px;
  border: 1px solid var(--line);
  border-radius: 14px;
  z-index: 1;
}
.route-panel { margin-bottom: 12px; }
.route-btn.active { background: var(--wine); border-color: var(--wine); color: #fff; }
.route-sub { margin: 8px 0; font-size: 0.9375rem; font-weight: 600; }
.route-sub select {
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px;
  font-family: inherit; font-size: 0.9375rem; min-height: 44px; background: #fff;
  margin-right: 6px;
}
.route-sub.hidden { display: none; }
.route-summary {
  background: var(--blush); border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 14px; font-size: 0.9375rem; font-weight: 600; margin: 8px 0;
}
.route-summary.hidden { display: none; }
.route-gmaps { margin-bottom: 8px; }
.route-gmaps.hidden { display: none; }

.map-dot {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
.map-house {
  width: 28px; height: 28px; border-radius: 7px;
  border: 2.5px solid #fff; box-shadow: 0 1px 5px rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center;
}
.map-house svg { width: 16px; height: 16px; }
.map-stop-num {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--ink); color: #fff; border: 2px solid #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.8rem; box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
.map-popup { font-family: var(--font-body); font-size: 0.9375rem; text-align: right; }
.popup-meta { color: var(--ink-soft); font-size: 0.8125rem; }
.popup-nav { color: var(--wine); font-weight: 600; }

.map-legend {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 0.8125rem; color: var(--ink-soft); margin-top: 10px;
}
.legend-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.legend-ro { background: #6B1339; }
.legend-four { background: #C98BA6; }
.legend-five { background: #8C1D4E; }
.legend-none { background: #9b8f96; }
.legend-house {
  width: 14px; height: 14px; border-radius: 4px; background: #8C1D4E; display: inline-block;
}

@media (max-width: 700px) {
  #mapContainer { height: 55vh; }
}

/* ===== תג "בתוכנית" / "תוכנית אפשרית" ===== */
.record-meta-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.plan-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.plan-badge.planned { background: var(--wine); color: #fff; }
.plan-badge.possible { background: var(--line); color: var(--ink-soft); }
.event-date-line {
  margin: 2px 0 4px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--wine);
}

/* ===== עריכת רשומות ===== */
.edit-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 10px;
  background: transparent; border: 1px solid var(--line); color: var(--ink-soft);
  cursor: pointer; transition: background 150ms ease-out, color 150ms ease-out;
}
.edit-btn:hover { background: var(--blush); color: var(--wine); }
.edit-btn svg { width: 16px; height: 16px; }

.edit-prio-group { margin-bottom: 14px; }
.edit-label { display: block; font-weight: 600; font-size: 0.9375rem; margin-bottom: 6px; }
.prio-buttons { display: flex; gap: 8px; }
.prio-big-btn {
  flex: 1; min-height: 60px; border-radius: 12px;
  border: 2px solid var(--line); background: #fff; color: var(--ink);
  font-size: 1.3rem; font-weight: 800; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  transition: background 150ms ease-out, border-color 150ms ease-out;
}
.prio-big-btn small { font-size: 0.72rem; font-weight: 600; color: var(--ink-soft); }
.prio-big-btn.active { border-color: var(--wine); background: var(--blush); color: var(--wine); }
.prio-big-btn.active small { color: var(--wine); }

#editForm label { display: block; font-weight: 600; margin-bottom: 14px; font-size: 0.9375rem; }
#editForm input, #editForm select, #editForm textarea {
  display: block; width: 100%; margin-top: 6px; padding: 12px; font-size: 1rem;
  border: 1px solid var(--line); border-radius: 10px; font-family: inherit;
  min-height: 48px; background: var(--paper); color: var(--ink);
}
#editForm textarea { min-height: 60px; }
.edit-date-hint { text-align: right; margin-top: -8px; }
#editFileLabel.hidden { display: none; }

/* ===== תגובות ===== */
.comments-area { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 6px; }
.comments-area summary {
  cursor: pointer; color: var(--ink-soft); font-size: 0.8125rem; font-weight: 600;
  list-style: none; padding: 6px 0; min-height: 32px; display: inline-flex; align-items: center; gap: 6px;
}
.comments-area summary::-webkit-details-marker { display: none; }
.comments-area summary::before { content: "💬"; font-size: 0.9em; }
.comments-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.comment-item { font-size: 0.875rem; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.comment-author { font-weight: 700; color: var(--ink); display: inline-flex; align-items: center; gap: 5px; flex: 0 0 auto; }
.member-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: 0 0 auto; }
.comment-text { color: var(--ink); }
.comments-loading { color: var(--ink-soft); font-size: 0.8125rem; margin: 4px 0; }
.comment-form { display: flex; gap: 6px; }
.comment-form input {
  flex: 1; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px;
  font-family: inherit; font-size: 0.9375rem; min-height: 42px;
}
.comment-send { width: auto; min-height: 42px; padding: 0 14px; font-size: 0.875rem; }

/* ===== שעות פתיחה והתראת סגור ===== */
.hours-line { margin: 2px 0 4px; font-size: 0.8125rem; color: var(--ink-soft); }
.closed-warning {
  margin: 4px 0; font-size: 0.8125rem; font-weight: 700;
  color: #a11212; background: #fdeaea; border: 1px solid #f0c0c0;
  border-radius: 8px; padding: 5px 10px; display: inline-block;
}
.cal-item-closed { border-color: #e08585; background: #fdf1f1; }

/* ===== זמני נסיעה ===== */
.travel-time {
  font-size: 0.75rem; color: var(--ink-soft); font-weight: 600;
  padding: 1px 8px 3px; margin: -2px 0 4px;
  border-right: 2px dotted var(--line); margin-right: 10px;
}

.order-day-btn { margin-bottom: 10px; background: var(--blush); border-color: var(--wine); color: var(--wine); font-weight: 700; }

/* חלק 6: צירוף צילום מסך לצ'אט */
.chat-image-btn {
  flex: 0 0 auto;
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--border, #d9c8ce);
  background: var(--surface, #fff);
  border-radius: 10px;
  font-size: 1.15rem;
  cursor: pointer;
}
.chat-image-btn:hover { background: var(--surface-alt, #f6eef1); }
.chat-image-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  padding: 6px 10px;
  background: var(--surface-alt, #f6eef1);
  border: 1px solid var(--border, #d9c8ce);
  border-radius: 10px;
  font-size: 0.9rem;
  width: fit-content;
  max-width: 100%;
}
.chat-image-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 240px;
}
.chat-image-chip button {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 1rem;
  min-width: 32px;
  min-height: 32px;
}

/* חלק 7: קבצים מצורפים */
.files-chip {
  border: 1px solid var(--border, #d9c8ce);
  background: var(--surface-alt, #f6eef1);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.85rem;
  cursor: pointer;
  margin-inline-start: 6px;
}
.files-chip:hover { background: var(--surface, #fff); }
.detail-files { margin: 10px 0; }
.detail-files-label { font-weight: 600; margin-bottom: 6px; }
.detail-file-link {
  display: block;
  padding: 8px 10px;
  margin-bottom: 6px;
  border: 1px solid var(--border, #d9c8ce);
  border-radius: 10px;
  background: var(--surface-alt, #f6eef1);
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.detail-file-link:hover { background: var(--surface, #fff); }

/* חלק 8: פס צבע לפי מי הוסיף + מקרא */
.record-card::after {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 3px;
  border-radius: 2px;
  background: var(--member-color, transparent);
}
.member-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  justify-content: center;
  margin: 28px auto 16px;
  padding: 12px 16px;
  font-size: 0.85rem;
  color: var(--muted, #7a6a70);
}
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.member-legend .member-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  flex: 0 0 auto;
}
