/* מסלול — iOS-style, RTL, light / dark / red-night themes */

:root {
  --bg: #f2f2f7;
  --surface: #ffffff;
  --surface-2: #eeeef3;
  --seg-active: #ffffff;
  --text: #111114;
  --muted: #6c6c72;
  --faint: #b3b3ba;
  --line: rgba(60, 60, 67, 0.16);
  --accent: #3b6e3a;
  --accent-soft: rgba(59, 110, 58, 0.13);
  --on-accent: #ffffff;
  --danger: #d92d20;
  --danger-soft: rgba(217, 45, 32, 0.1);
  --warn: #b25a00;
  --warn-soft: rgba(219, 124, 0, 0.13);
  --ok: #2e7d32;
  --ok-soft: rgba(46, 125, 50, 0.12);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.04);
  --toast-bg: rgba(28, 28, 30, 0.95);
  --toast-text: #ffffff;
  --radius: 14px;
  --tabbar-h: 54px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #000000;
    --surface: #1c1c1e;
    --surface-2: #2c2c2e;
    --seg-active: #5a5a5f;
    --text: #f2f2f7;
    --muted: #9a9aa1;
    --faint: #5c5c61;
    --line: rgba(84, 84, 88, 0.5);
    --accent: #7cc47a;
    --accent-soft: rgba(124, 196, 122, 0.16);
    --on-accent: #0b1a0b;
    --danger: #ff6961;
    --danger-soft: rgba(255, 105, 97, 0.16);
    --warn: #ffb340;
    --warn-soft: rgba(255, 179, 64, 0.15);
    --ok: #7cc47a;
    --ok-soft: rgba(124, 196, 122, 0.15);
    --shadow: none;
    --toast-bg: rgba(58, 58, 60, 0.97);
    color-scheme: dark;
  }
}

:root[data-theme='dark'] {
  --bg: #000000;
  --surface: #1c1c1e;
  --surface-2: #2c2c2e;
  --seg-active: #5a5a5f;
  --text: #f2f2f7;
  --muted: #9a9aa1;
  --faint: #5c5c61;
  --line: rgba(84, 84, 88, 0.5);
  --accent: #7cc47a;
  --accent-soft: rgba(124, 196, 122, 0.16);
  --on-accent: #0b1a0b;
  --danger: #ff6961;
  --danger-soft: rgba(255, 105, 97, 0.16);
  --warn: #ffb340;
  --warn-soft: rgba(255, 179, 64, 0.15);
  --ok: #7cc47a;
  --ok-soft: rgba(124, 196, 122, 0.15);
  --shadow: none;
  --toast-bg: rgba(58, 58, 60, 0.97);
  color-scheme: dark;
}

/* Red night mode: preserves night vision (משמעת אור) */
:root[data-theme='red'] {
  --bg: #000000;
  --surface: #140202;
  --surface-2: #240606;
  --seg-active: #4a0d0a;
  --text: #ff4a3d;
  --muted: #b8392f;
  --faint: #6e1d17;
  --line: rgba(255, 74, 61, 0.22);
  --accent: #ff4a3d;
  --accent-soft: rgba(255, 74, 61, 0.15);
  --on-accent: #000000;
  --danger: #ff4a3d;
  --danger-soft: rgba(255, 74, 61, 0.15);
  --warn: #ff4a3d;
  --warn-soft: rgba(255, 74, 61, 0.12);
  --ok: #ff4a3d;
  --ok-soft: rgba(255, 74, 61, 0.12);
  --shadow: none;
  --toast-bg: #2a0503;
  --toast-text: #ff4a3d;
  color-scheme: dark;
}
:root[data-theme='red'] .emo,
:root[data-theme='red'] img {
  filter: grayscale(1) sepia(1) saturate(8) hue-rotate(-45deg) brightness(0.75);
}

/* ---- Base ---- */
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.42 -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', 'Heebo', 'Arial Hebrew', Arial, sans-serif;
  min-height: 100vh;
  min-height: 100dvh;
  overscroll-behavior-y: none;
}
body.sheet-open {
  overflow: hidden;
}
button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
a {
  color: var(--accent);
}
[hidden] {
  display: none !important;
}
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.muted {
  color: var(--muted);
}
.emo {
  font-style: normal;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---- Layout ---- */
.view {
  max-width: 720px;
  margin: 0 auto;
  padding: calc(var(--safe-t) + 14px) 16px calc(var(--tabbar-h) + var(--safe-b) + 100px);
}
.boot {
  padding: 40vh 0;
  text-align: center;
  color: var(--muted);
}
.page-head {
  padding: 6px 2px 4px;
}
.page-head h1 {
  margin: 0;
  font-size: 32px;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.eyebrow {
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
}
.page-sub {
  color: var(--muted);
  font-size: 15px;
  margin-top: 2px;
  padding: 0 2px;
}
.section {
  margin-top: 22px;
}
.section.tight {
  margin-top: 12px;
}
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 4px 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
}
.section-title.danger {
  color: var(--danger);
}
.section-title .count {
  font-size: 12px;
  font-weight: 700;
  min-width: 22px;
  padding: 1px 7px;
  border-radius: 99px;
  background: var(--surface-2);
  text-align: center;
}
.toolbar {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

/* ---- Tab bar & FAB ---- */
.tabbar {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  justify-content: space-around;
  padding: 6px 8px calc(var(--safe-b) + 4px);
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 84%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-top: 0.5px solid var(--line);
}
.tab {
  flex: 1;
  max-width: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 0;
  color: var(--faint);
  text-decoration: none;
  font-size: 11px;
  font-weight: 600;
}
.tab.active {
  color: var(--accent);
}
.tab-icon svg {
  display: block;
  width: 26px;
  height: 26px;
}
.fab {
  position: fixed;
  z-index: 21;
  inset-inline-end: 20px;
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 18px);
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 0;
  background: var(--accent);
  color: var(--on-accent);
  display: grid;
  place-items: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
  transition: transform 0.15s;
}
.fab:active {
  transform: scale(0.92);
}

/* ---- Cards, lists ---- */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}
.card + .card,
.sheet-body > .card {
  margin-top: 12px;
}
.card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 10px;
}
.list {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.list.flat {
  box-shadow: none;
  background: transparent;
}
.list.empty-row {
  padding: 14px 16px;
  color: var(--muted);
  font-size: 15px;
}
.hint {
  font-size: 13px;
  color: var(--muted);
  margin-top: 8px;
  line-height: 1.5;
}
.hint.flush {
  margin-top: 0;
  margin-bottom: 10px;
}
.hint.strong {
  color: var(--text);
  font-weight: 600;
}
.lead {
  margin: 0 2px 14px;
  color: var(--muted);
  font-size: 15px;
}
.pill {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 99px;
  background: var(--surface-2);
  color: var(--muted);
}
.pill.ok {
  background: var(--ok-soft);
  color: var(--ok);
}
.pill.danger {
  background: var(--danger-soft);
  color: var(--danger);
}
.pill.warn {
  background: var(--warn-soft);
  color: var(--warn);
}

/* ---- Task row ---- */
.task-row {
  position: relative;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 11px 14px 11px 14px;
  cursor: pointer;
  transition: background 0.15s;
}
.task-row:active {
  background: var(--surface-2);
}
.task-row:not(:first-child)::before {
  content: '';
  position: absolute;
  top: 0;
  inset-inline-start: 54px;
  inset-inline-end: 0;
  border-top: 0.5px solid var(--line);
}
.task-row::after {
  content: '';
  position: absolute;
  inset-block: 12px;
  inset-inline-start: 0;
  width: 3px;
  border-start-end-radius: 3px;
  border-end-end-radius: 3px;
}
.task-row.prio-high::after {
  background: var(--warn);
}
.task-row.prio-critical::after {
  background: var(--danger);
}
.check {
  flex: none;
  width: 34px;
  height: 34px;
  margin: -4px -4px -4px 0;
  padding: 0;
  border: 0;
  background: none;
  display: grid;
  place-items: center;
}
.check i {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--faint);
  display: grid;
  place-items: center;
  font-style: normal;
  font-size: 13px;
  font-weight: 900;
  color: var(--on-accent);
  transition: background 0.15s, border-color 0.15s;
}
.task-row.overdue .check i {
  border-color: var(--danger);
}
.task-row.done .check i,
.check-item.done .check i {
  background: var(--accent);
  border-color: var(--accent);
}
.check.small {
  width: 30px;
  height: 30px;
  margin: 0;
}
.check.small i {
  width: 22px;
  height: 22px;
}
.task-main {
  flex: 1;
  min-width: 0;
}
.task-title {
  font-size: 16.5px;
  font-weight: 600;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.task-row.done .task-title {
  color: var(--muted);
  text-decoration: line-through;
  font-weight: 500;
}
.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 10px;
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
}
.meta-danger {
  color: var(--danger);
  font-weight: 700;
}
.meta-warn {
  color: var(--warn);
  font-weight: 700;
}

/* ---- Today ---- */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 14px;
}
.stat {
  background: var(--surface);
  border: 0;
  border-radius: var(--radius);
  padding: 12px;
  text-align: start;
  box-shadow: var(--shadow);
}
.stat b {
  display: block;
  font-size: 26px;
  font-weight: 800;
  line-height: 1.1;
}
.stat span {
  font-size: 12.5px;
  color: var(--muted);
}
.stat.danger b {
  color: var(--danger);
}
.stat.ok b {
  color: var(--ok);
}
.progress-card {
  background: var(--accent);
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 72%, #000));
  color: var(--on-accent);
  border-radius: 18px;
  padding: 16px;
}
.pc-row {
  display: flex;
  justify-content: space-between;
  font-size: 17px;
}
.pc-row span {
  font-weight: 800;
}
.bar {
  height: 8px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.28);
  overflow: hidden;
  margin-top: 10px;
}
:root[data-theme='red'] .bar {
  background: rgba(0, 0, 0, 0.35);
}
.bar > i {
  display: block;
  height: 100%;
  background: currentColor;
  border-radius: inherit;
}
.pc-sub {
  font-size: 13.5px;
  margin-top: 8px;
  opacity: 0.92;
}
.quick {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 5px;
  box-shadow: var(--shadow);
}
.quick input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  font-size: 16px;
  padding: 10px;
  outline: none;
}
.quick input::placeholder {
  color: var(--faint);
}
.quick-btn {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  border: 0;
  background: var(--accent);
  color: var(--on-accent);
  display: grid;
  place-items: center;
}
.quick-preview {
  min-height: 18px;
  margin: 6px 10px 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}
.hscroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  margin: 0 -16px;
  padding: 2px 16px 6px;
  scrollbar-width: none;
}
.hscroll::-webkit-scrollbar {
  display: none;
}
.cd-card {
  flex: none;
  min-width: 140px;
  max-width: 200px;
  scroll-snap-align: start;
  background: var(--surface);
  border: 0;
  border-radius: var(--radius);
  padding: 12px 14px;
  text-align: start;
  box-shadow: var(--shadow);
}
.cd-card .emo {
  font-size: 22px;
}
.cd-value {
  font-size: 19px;
  font-weight: 800;
  margin-top: 4px;
}
.cd-title {
  font-size: 13px;
  color: var(--muted);
}
.cd-add {
  display: grid;
  place-items: center;
  background: transparent;
  border: 1.5px dashed var(--line);
  color: var(--accent);
  font-weight: 700;
  box-shadow: none;
  font-size: 14px;
}
.cd-add.wide {
  min-width: 100%;
  max-width: none;
  min-height: 64px;
}
.next-reminder {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  width: 100%;
  margin-top: 14px;
  padding: 10px 14px;
  border: 0;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--text);
  font-size: 14px;
  text-align: start;
}
.more-link {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 12px;
  border: 0;
  background: none;
  color: var(--accent);
  font-weight: 600;
  font-size: 15px;
}
.welcome-title {
  font-size: 20px;
  font-weight: 800;
}
.welcome p {
  color: var(--muted);
  margin: 6px 0 14px;
}
.welcome-steps {
  display: grid;
  gap: 8px;
}
.banner {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--accent-soft);
  box-shadow: var(--shadow);
}
.banner > .emo {
  font-size: 24px;
  line-height: 1.2;
}
.banner-body {
  flex: 1;
  font-size: 14px;
  color: var(--muted);
}
.banner-body b {
  display: block;
  color: var(--text);
  font-size: 15.5px;
  margin-bottom: 2px;
}
.banner .btn-row {
  margin-top: 10px;
}

/* ---- Notes ---- */
.note-card {
  display: block;
  width: 100%;
  margin-bottom: 10px;
  padding: 12px 14px;
  border: 0;
  border-radius: var(--radius);
  background: var(--surface);
  text-align: start;
  box-shadow: var(--shadow);
}
.note-title {
  font-weight: 700;
  font-size: 16px;
  overflow-wrap: anywhere;
}
.note-snippet {
  margin-top: 3px;
  font-size: 14px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.note-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--faint);
}
.note-body {
  width: 100%;
  min-height: 45vh;
  margin-top: 6px;
  padding: 4px 2px;
  border: 0;
  background: transparent;
  font-size: 17px;
  line-height: 1.55;
  outline: none;
  resize: none;
}

/* ---- Controls ---- */
.input {
  width: 100%;
  display: block;
  font-size: 16px;
  background: var(--surface-2);
  border: 0;
  border-radius: 10px;
  padding: 11px 12px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  min-height: 44px;
}
textarea.input {
  resize: none;
  line-height: 1.45;
}
.input:focus {
  box-shadow: 0 0 0 2px var(--accent-soft), 0 0 0 1px var(--accent) inset;
}
.input::placeholder,
textarea::placeholder {
  color: var(--faint);
}
.input.mono {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 13px;
  direction: ltr;
  text-align: left;
}
.search-input {
  background: var(--surface);
  box-shadow: var(--shadow);
}
input[type='date'].input,
input[type='datetime-local'].input {
  text-align: start;
}
.title-input {
  width: 100%;
  border: 0;
  background: transparent;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.3;
  padding: 4px 2px 8px;
  outline: none;
  resize: none;
  overflow: hidden;
}
.title-input.single {
  font-size: 22px;
  margin-top: 12px;
}
.field-label {
  margin: 14px 0 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}
.field-label:first-child {
  margin-top: 0;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.card .chips {
  margin-top: 10px;
}
.card .field-label + .chips {
  margin-top: 0;
}
.chips.scroll {
  flex-wrap: nowrap;
  overflow-x: auto;
  margin: 0 -16px;
  padding: 0 16px 2px;
  scrollbar-width: none;
}
.chips.scroll::-webkit-scrollbar {
  display: none;
}
.chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  font-size: 14px;
  font-weight: 500;
  padding: 7px 12px;
  border-radius: 99px;
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.toolbar .chip {
  background: var(--surface);
  box-shadow: var(--shadow);
}
.chip.active {
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
}
.chip.ghost {
  background: transparent;
  color: var(--muted);
  box-shadow: inset 0 0 0 1px var(--line);
}
.seg {
  display: flex;
  gap: 2px;
  padding: 2px;
  border-radius: 10px;
  background: var(--surface-2);
}
.toolbar .seg {
  background: color-mix(in srgb, var(--text) 8%, transparent);
}
.seg-btn {
  flex: 1;
  border: 0;
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  padding: 7px 4px;
  border-radius: 8px;
}
.seg-btn.active {
  background: var(--seg-active);
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 10px 16px;
  border: 0;
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 15.5px;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  transition: opacity 0.15s, transform 0.1s;
}
.btn:active {
  transform: scale(0.98);
}
.btn:disabled {
  opacity: 0.45;
}
.btn.small {
  min-height: 38px;
  padding: 8px 13px;
  font-size: 14.5px;
}
.btn.primary {
  background: var(--accent);
  color: var(--on-accent);
}
.btn.danger {
  color: var(--danger);
}
.btn.block {
  display: flex;
  width: 100%;
}
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.btn-row.center {
  justify-content: center;
}
.card > .btn.block,
.card > .btn-row {
  margin-top: 10px;
}
.link-btn {
  border: 0;
  background: none;
  color: var(--accent);
  font-size: 17px;
  padding: 8px 2px;
}
.link-btn.strong {
  font-weight: 700;
}
.link-btn.small {
  font-size: 13px;
  padding: 2px 4px;
}
.link-btn.danger {
  color: var(--danger);
}
.icon-btn {
  flex: none;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--faint);
  font-size: 15px;
}

/* ---- Sheet ---- */
.sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.38);
  opacity: 0;
  transition: opacity 0.28s;
}
.sheet-overlay.show {
  opacity: 1;
}
.sheet {
  position: fixed;
  z-index: 41;
  inset-inline: 0;
  bottom: 0;
  top: calc(var(--safe-t) + 12px);
  max-width: 720px;
  margin: 0 auto;
  background: var(--bg);
  border-radius: 14px 14px 0 0;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.2);
  transform: translateY(102%);
  transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
  display: flex;
  flex-direction: column;
}
.sheet.show {
  transform: none;
}
.sheet-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}
.sheet-head {
  flex: none;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 6px 14px;
  border-bottom: 0.5px solid var(--line);
}
.sheet-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}
.sheet-head .start {
  justify-self: start;
}
.sheet-head .end {
  justify-self: end;
}
.save-state {
  font-size: 13px;
  color: var(--muted);
}
.sheet-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 14px 16px calc(var(--safe-b) + 40px);
}
.sheet-body > .btn.block {
  margin-top: 16px;
}
.meta-foot {
  margin-top: 18px;
  font-size: 12px;
  color: var(--faint);
  text-align: center;
}

/* Checklist & notes log in task sheet */
.checklist {
  display: grid;
  gap: 2px;
}
.check-item {
  display: flex;
  align-items: center;
  gap: 6px;
}
.check-text {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  font-size: 16px;
  padding: 8px 2px;
  outline: none;
}
.check-item.done .check-text {
  color: var(--muted);
  text-decoration: line-through;
}
.inline-add {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  align-items: center;
}
.inline-add.column {
  flex-direction: column;
  align-items: stretch;
  margin-top: 0;
}
.inline-add.column .btn {
  align-self: flex-start;
}
.notes-log {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}
.notes-log:empty {
  display: none;
}
.log-item {
  background: var(--surface-2);
  border-radius: 10px;
  padding: 10px 12px;
}
.log-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 15px;
}
.log-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}
.source-row {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 10px;
}

/* Import */
.steps {
  margin: 0 0 12px;
  padding-inline-start: 20px;
  font-size: 14.5px;
  line-height: 1.55;
}
.steps li + li {
  margin-top: 3px;
}
.howto {
  margin: 12px 0;
  font-size: 14px;
}
.howto summary {
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 8px;
}
.imp-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 11px 14px;
  border-top: 0.5px solid var(--line);
}
.imp-row:first-child {
  border-top: 0;
}
.imp-row input {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--accent);
}
.imp-row.muted .imp-title {
  color: var(--muted);
}
.imp-main {
  flex: 1;
  min-width: 0;
}
.imp-title {
  font-weight: 600;
  overflow-wrap: anywhere;
}
.imp-meta {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}
.pill.state-new {
  background: var(--ok-soft);
  color: var(--ok);
}
.pill.state-update {
  background: var(--warn-soft);
  color: var(--warn);
}

/* Settings */
.set-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 8px 0;
  border: 0;
  background: none;
  text-align: start;
}
.set-row + .set-row {
  border-top: 0.5px solid var(--line);
}
.set-label {
  flex: 1;
  font-size: 15.5px;
  font-weight: 500;
}
.set-label .hint {
  margin-top: 0;
}
.set-control {
  flex: 1.2;
  display: flex;
  justify-content: flex-end;
}
.set-control .input {
  text-align: start;
}
.set-row.clickable {
  cursor: pointer;
}
.roadmap {
  margin: 0;
  padding-inline-start: 20px;
  font-size: 14.5px;
  line-height: 1.7;
}
.app-foot {
  margin-top: 30px;
  text-align: center;
  font-size: 12.5px;
  color: var(--faint);
  line-height: 1.7;
}

/* ---- Schedule (לו״ז) ---- */
.sync-bar {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 9px 14px;
  border: 0;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  text-align: start;
}
.sync-bar.warn {
  background: var(--warn-soft);
  color: var(--warn);
}
.week-strip {
  display: flex;
  align-items: stretch;
  gap: 4px;
  margin-top: 14px;
  padding: 6px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.week-nav {
  flex: none;
  width: 28px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 17px;
}
.wd {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 0 5px;
  border: 0;
  border-radius: 10px;
  background: none;
}
.wd-name {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 600;
}
.wd-num {
  font-size: 17px;
  font-weight: 700;
}
.wd.today .wd-num {
  color: var(--accent);
}
.wd.sel {
  background: var(--accent);
}
.wd.sel .wd-name,
.wd.sel .wd-num {
  color: var(--on-accent);
}
.wd .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}
.wd.sel .dot {
  background: var(--on-accent);
}
.wd .dot.off {
  visibility: hidden;
}
.day-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 18px 4px 8px;
  font-size: 15px;
}
.allday {
  margin-bottom: 8px;
}
.agenda {
  display: grid;
  gap: 6px;
}
.agenda-empty {
  padding: 10px 4px;
  color: var(--muted);
  font-size: 14px;
}
.ev-row {
  --ev-color: var(--accent);
  position: relative;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  width: 100%;
  padding: 10px 14px;
  border: 0;
  border-radius: 12px;
  background: var(--surface);
  text-align: start;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.ev-row::before {
  content: '';
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: 4px;
  background: var(--ev-color);
}
.ev-row.kind-block {
  --ev-color: #2e8b57;
  background: color-mix(in srgb, var(--ev-color) 9%, var(--surface));
}
.ev-row.kind-class {
  --ev-color: #3a73c9;
}
.ev-row.kind-personal {
  --ev-color: #9b59b6;
}
.ev-row.kind-external {
  --ev-color: #8e8e93;
}
.ev-row.deadline {
  --ev-color: var(--danger);
  background: var(--danger-soft);
  box-shadow: none;
}
.ev-row.live {
  box-shadow: 0 0 0 2px var(--accent);
}
.ev-row.past {
  opacity: 0.55;
}
.ev-row.static {
  cursor: default;
}
:root[data-theme='red'] .ev-row {
  --ev-color: var(--accent) !important;
}
.ev-time {
  flex: none;
  width: 44px;
  display: flex;
  flex-direction: column;
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.ev-time b {
  font-size: 15px;
  color: var(--text);
}
.ev-main {
  flex: 1;
  min-width: 0;
}
.ev-title {
  font-weight: 600;
  font-size: 15.5px;
  overflow-wrap: anywhere;
}
.ev-meta {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 2px;
}
.gap-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 14px;
  border: 1.5px dashed var(--line);
  border-radius: 12px;
  background: transparent;
  font-size: 14px;
  text-align: start;
}
.gap-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  flex: none;
}
.gap-text {
  flex: 1;
}
.gap-cta {
  color: var(--accent);
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
}
.now-line {
  position: relative;
  height: 2px;
  margin: 6px 0;
  background: var(--danger);
  border-radius: 2px;
}
.now-line span {
  position: absolute;
  inset-inline-start: 0;
  top: -9px;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}
:root[data-theme='red'] .now-line span {
  color: #000;
}
.nownext {
  display: grid;
  gap: 6px;
  width: 100%;
  padding: 12px 14px;
  border: 0;
  border-radius: var(--radius);
  background: var(--surface);
  text-align: start;
  box-shadow: var(--shadow);
}
.nn-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
}
.nn-label {
  font-size: 12px;
  font-weight: 800;
  color: var(--on-accent);
  background: var(--accent);
  padding: 1px 8px;
  border-radius: 99px;
}
.nn-row + .nn-row .nn-label {
  background: var(--surface-2);
  color: var(--muted);
}
.nn-title {
  font-weight: 700;
}
.nn-detail {
  font-size: 13px;
  color: var(--muted);
}

/* Planner */
.plan-task {
  padding: 2px 2px 12px;
}
.plan-task b {
  display: block;
  font-size: 19px;
}
.slot-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: 0;
  background: none;
  text-align: start;
  border-top: 0.5px solid var(--line);
}
.slot-row:first-child {
  border-top: 0;
}
.slot-row:active {
  background: var(--surface-2);
}
.slot-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.slot-main .muted {
  font-size: 13px;
}
.slot-add {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 800;
  font-size: 18px;
}
.blocks {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}
.blocks:empty {
  display: none;
}
.block-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border: 0;
  border-radius: 10px;
  background: var(--surface-2);
  font-size: 14.5px;
  text-align: start;
}
.card .block-item + .block-item {
  margin-top: 6px;
}
.title-input.static {
  padding-bottom: 12px;
}
.ro-row {
  font-size: 15px;
  padding: 4px 0;
}
.ro-notes {
  margin-top: 8px;
  font-size: 14px;
  color: var(--muted);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Calendar settings */
.cal-list {
  display: grid;
  gap: 2px;
}
.cal-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  font-size: 15px;
}
.cal-row input {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
}
.cal-dot {
  --c: var(--accent);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--c);
  flex: none;
}
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  font-size: 15px;
}
.switch {
  -webkit-appearance: none;
  appearance: none;
  flex: none;
  position: relative;
  width: 51px;
  height: 31px;
  margin: 0;
  border-radius: 99px;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: background 0.2s;
  cursor: pointer;
}
.switch::after {
  content: '';
  position: absolute;
  top: 2px;
  inset-inline-start: 2px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s;
}
.switch:checked {
  background: var(--accent);
}
.switch:checked::after {
  transform: translateX(-20px); /* RTL: knob moves left */
}
:root[dir='ltr'] .switch:checked::after {
  transform: translateX(20px);
}
code.uri {
  display: block;
  margin-top: 4px;
  padding: 6px 8px;
  border-radius: 8px;
  background: var(--surface-2);
  font-size: 12.5px;
  direction: ltr;
  text-align: left;
  overflow-wrap: anywhere;
  user-select: all;
}
.warn-text {
  color: var(--warn);
}

/* Empty state */
.empty {
  text-align: center;
  padding: 40px 16px;
  color: var(--muted);
}
.empty .big {
  display: block;
  font-size: 44px;
  margin-bottom: 8px;
}
.empty b {
  display: block;
  font-size: 18px;
  color: var(--text);
}
.empty p {
  margin: 6px auto 16px;
  max-width: 320px;
  font-size: 15px;
}

/* Toasts */
#toast-root {
  position: fixed;
  z-index: 60;
  inset-inline: 0;
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 90px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  pointer-events: none;
}
body.sheet-open #toast-root {
  bottom: calc(var(--safe-b) + 24px);
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 520px;
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--toast-bg);
  color: var(--toast-text);
  font-size: 15px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.22s, transform 0.22s;
}
.toast.show {
  opacity: 1;
  transform: none;
}
.toast-danger {
  box-shadow: 0 0 0 1.5px var(--danger), 0 8px 28px rgba(0, 0, 0, 0.25);
}
.toast-msg {
  flex: 1;
}
.toast-action {
  flex: none;
  border: 0;
  background: none;
  color: #9fe09c;
  font-weight: 800;
  font-size: 15px;
  padding: 4px;
}
:root[data-theme='red'] .toast-action {
  color: var(--accent);
}

@media (min-width: 760px) {
  .sheet {
    top: 6vh;
    bottom: 6vh;
    border-radius: 16px;
  }
}

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