/* iPhone-inspired, RTL. Glass is used only on the navigation bar. */

/* Assistant (SIL Open Font License, public/fonts/LICENSE-Assistant.txt): a light, refined Hebrew typeface.
   Served from the app itself, so it also works offline and needs no outside font service. */
@font-face {
  font-family: "Assistant";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("/fonts/assistant-hebrew-wght-normal.woff2") format("woff2");
  unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F;
}
@font-face {
  font-family: "Assistant";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("/fonts/assistant-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light dark;
  /* Graphite and Gold: warm ivory page, white cards, graphite text, gold accent. */
  --bg: #f5f3ef;
  --surface: #ffffff;
  --text: #1f1d1a;
  --muted: #7a746b;
  --line: rgba(31, 29, 26, 0.1);
  --accent: #a87a24;
  --accent-text: #ffffff;
  --fill: rgba(120, 108, 90, 0.12);
  --red: #c4271d;
  --orange: #a35a00;
  --green: #1d7a36;
  --radius: 20px;
  --tabbar: 58px;
}
/* Dark colours: when the device is dark (unless I chose light), or when I chose dark. Keep the two lists identical. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    /* Graphite dark: soft charcoal, not pure black; gold accent. */
    --bg: #121315;
    --surface: #1c1e22;
    --text: #f1eee8;
    --muted: #a39d93;
    --line: rgba(241, 238, 232, 0.1);
    --accent: #d4a64a;
    --accent-text: #1a1406;
    --fill: rgba(241, 238, 232, 0.08);
    --red: #ff6b61;
    --orange: #ffb340;
    --green: #4cd471;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  /* Graphite dark: soft charcoal, not pure black; gold accent. */
  --bg: #121315;
  --surface: #1c1e22;
  --text: #f1eee8;
  --muted: #a39d93;
  --line: rgba(241, 238, 232, 0.1);
  --accent: #d4a64a;
  --accent-text: #1a1406;
  --fill: rgba(241, 238, 232, 0.08);
  --red: #ff6b61;
  --orange: #ffb340;
  --green: #4cd471;
}
:root[data-theme="light"] {
  color-scheme: light;
}

* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}
body {
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.5 "Assistant", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Noto Sans Hebrew", Arial, sans-serif;
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
main {
  max-width: 720px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 12px) 16px calc(var(--tabbar) + env(safe-area-inset-bottom) + 28px);
}
h1 {
  font-size: 32px;
  line-height: 1.15;
  font-weight: 700;
  margin: 0;
  letter-spacing: 0;
}
h2 {
  font-size: 20px;
  font-weight: 650;
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
h3 {
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 6px;
}
p {
  margin: 0 0 8px;
}
a {
  color: var(--accent);
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 14px;
}
.error {
  color: var(--red);
}
.ok {
  color: var(--green);
}
.loading {
  text-align: center;
  padding: 40vh 16px 0;
  color: var(--muted);
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  padding: 12px 4px 14px;
}

.section {
  margin-top: 34px;
}
/* Section headings: smaller and calmer than page titles, so the cards carry the weight. */
.section > h2 {
  padding: 0 4px;
  margin-bottom: 12px;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: 0.01em;
}
.count {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  background: var(--fill);
  border-radius: 999px;
  padding: 1px 9px;
}

.card {
  background: var(--surface);
  /* A card sets its own text colour, so a light card inside the dark briefing stays readable. */
  color: var(--text);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.plain {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
}
.plain li {
  padding: 3px 0;
}
.briefing h2 {
  font-size: 18px;
}
/* Urgency: soft and rounded, the whole card takes a wash of its colour instead of a hard edge. */
.order.late,
.briefing .card.order.late {
  background: color-mix(in srgb, var(--red) 13%, var(--surface));
}
.order.due,
.briefing .card.order.due {
  background: color-mix(in srgb, var(--orange) 15%, var(--surface));
}
/* Card hierarchy: a clear title, then a quieter line of details. */
.order-title {
  font-size: 17.5px;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  align-items: center;
  color: var(--muted);
  font-size: 14px;
  margin-top: 6px;
}
.badge {
  font-size: 13px;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--fill);
  color: var(--text);
}
.badge.good {
  color: var(--green);
}
.badge.warn {
  color: var(--orange);
}
.quote {
  margin: 6px 0 2px;
  overflow-wrap: anywhere;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  align-items: center;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  /* Soft and rounded: pill-shaped buttons. */
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-text);
  font: inherit;
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.button.secondary {
  background: var(--fill);
  color: var(--accent);
}
.button.whatsapp {
  background: #1f8f4d;
  color: #ffffff;
}
.button:disabled {
  opacity: 0.45;
  cursor: default;
}
.button:active:not(:disabled) {
  opacity: 0.7;
}
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
[hidden] {
  display: none !important;
}

.banner {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin: 12px 0 0;
  font-size: 15px;
}
.banner.warn {
  color: var(--orange);
}
/* A device in the notifications list, with its "remove" button. */
.device-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.link-button {
  border: 0;
  background: none;
  padding: 6px 4px;
  color: var(--red);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.push-off {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
}
.push-off .button {
  min-height: 40px;
  padding: 0 16px;
}

.status-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 6px 0 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 10px;
}
.status-row > div {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.status-row p {
  margin: 2px 0 0;
}
.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 8px;
  flex: none;
}
.dot.good {
  background: var(--green);
}
.dot.bad {
  background: var(--red);
}

.draft {
  border-top: 1px solid var(--line);
  margin-top: 14px;
  padding-top: 14px;
}
.warnings {
  margin: 0 0 8px;
  padding-inline-start: 18px;
  color: var(--orange);
}
textarea,
input,
select {
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  min-height: 44px;
  max-width: 100%;
}
textarea.message {
  width: 100%;
  resize: vertical;
  line-height: 1.5;
  margin-bottom: 8px;
}
select {
  flex: 1;
  min-width: 0;
}
.form {
  display: grid;
  gap: 8px;
  margin-top: 6px;
}
details {
  margin-top: 10px;
}
summary {
  cursor: pointer;
  color: var(--accent);
  min-height: 44px;
  display: flex;
  align-items: center;
}
pre.source {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: inherit;
  font-size: 15px;
  background: var(--bg);
  border-radius: 10px;
  padding: 10px 12px;
  margin: 0;
}
.offscreen {
  position: fixed;
  top: -1000px;
  opacity: 0;
}

.login {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  padding-bottom: 40px;
}
.login-icon {
  border-radius: 20px;
}
.google-button {
  min-height: 52px;
  margin-top: 12px;
  display: grid;
  justify-items: center;
  gap: 8px;
}

/* Navigation: the only translucent surface. */
.tabbar {
  position: fixed;
  inset: auto 0 0 0;
  display: flex;
  justify-content: center;
  gap: 4px;
  padding: 6px 12px calc(6px + env(safe-area-inset-bottom));
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  z-index: 10;
}
.tab {
  flex: 1;
  max-width: 160px;
  min-height: 46px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  border-radius: 12px;
  -webkit-tap-highlight-color: transparent;
}
.tab.active {
  color: var(--accent);
}
.icon {
  display: inline-flex;
  width: 24px;
  height: 24px;
}
.icon svg {
  width: 100%;
  height: 100%;
}

.toast {
  position: fixed;
  inset: auto 16px calc(var(--tabbar) + env(safe-area-inset-bottom) + 18px) 16px;
  margin: 0 auto;
  max-width: 420px;
  background: #2c2c2e;
  color: #ffffff;
  border-radius: 14px;
  padding: 12px 16px;
  text-align: center;
  font-size: 15px;
  z-index: 20;
  animation: rise 0.2s ease-out;
}
/* ---- Soft and rounded (Graphite and Gold): light title, white briefing card, graphite navigation ---- */
:root {
  --ink: #1e2126;
  --ink-2: #2c3038;
  --ink-3: #3a3f48;
  --on-ink: #f4f1ea;
  --on-ink-muted: rgba(244, 241, 234, 0.68);
  --shadow-soft: 0 1px 2px rgba(31, 29, 26, 0.05), 0 6px 18px rgba(31, 29, 26, 0.06);
}
main {
  padding-top: 0;
}
/* No dark band: the title sits on the page, like a greeting. */
.page-header {
  margin: 0 0 18px;
  padding: calc(env(safe-area-inset-top) + 22px) 4px 4px;
  background: none;
  color: var(--text);
  align-items: center;
  flex-wrap: wrap;
}
.page-title p {
  color: var(--muted);
  margin: 4px 0 0;
}
.header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
/* Kept as a class name for the header and briefing buttons; now a soft pill on a light surface. */
.button.on-dark {
  background: var(--surface);
  color: var(--text);
  border: 0;
  box-shadow: var(--shadow-soft);
  min-height: 44px;
  font-size: 15px;
  padding: 0 16px;
}
.button.on-dark .icon {
  width: 18px;
  height: 18px;
}
.button.danger {
  color: var(--red);
}
.briefing {
  background: var(--surface);
  color: var(--text);
}
.briefing .plain li {
  padding: 5px 0;
  border-bottom: 1px solid var(--line);
}
.briefing .plain li:last-child {
  border-bottom: 0;
}
/* Cards inside the briefing sit on the page colour, so they read as a soft inset. */
.briefing .card {
  background: var(--bg);
  box-shadow: none;
}
.briefing-more {
  margin-top: 12px;
  border-top: 1px solid var(--line);
}
.briefing-more > summary {
  font-weight: 600;
  gap: 8px;
}
.briefing-more > .section {
  margin-top: 14px;
}
.briefing-more > .section h2 {
  font-size: 16px;
}
.briefing-more > .section:last-child {
  margin-bottom: 8px;
}
/* Settings: sections in groups, each group opened by a small title and a thin line. */
.settings-group {
  margin-top: 40px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.settings-group-title {
  margin: 0 4px;
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
}
.settings-group > .section:first-of-type {
  margin-top: 14px;
}
/* Section heading marker: a small gold dot. */
.section > h2::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}
.card {
  box-shadow: var(--shadow-soft);
}
.count {
  background: var(--fill);
  color: var(--text);
}

.tabbar {
  background: rgba(30, 33, 38, 0.9);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .tabbar {
    background: var(--ink);
  }
}
.tab {
  color: var(--on-ink-muted);
  background: none;
  border: 0;
  font-family: inherit;
  cursor: pointer;
  max-width: 130px;
}
.tab.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.13);
}
.menu-panel {
  position: absolute;
  bottom: calc(100% + 8px);
  inset-inline-end: 12px;
  min-width: 230px;
  background: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  padding: 6px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.38);
  display: grid;
  gap: 2px;
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 12px;
  color: var(--on-ink);
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
}
.menu-item.active,
.menu-item:active {
  background: rgba(255, 255, 255, 0.13);
}
/* Dates waiting for review: a red count on the menu button and on "Settings". */
.tab .count,
.menu-item .count {
  background: var(--red);
  color: #ffffff;
  font-size: 11px;
  padding: 0 6px;
}
.tab .count {
  position: absolute;
  top: 2px;
  inset-inline-end: 22%;
}
.tab {
  position: relative;
}
.menu-item .count {
  margin-inline-start: auto;
}

/* ---- Notes, contacts, connected systems ---- */
.list.spaced {
  margin-top: 4px;
}
.link-card {
  display: block;
  color: inherit;
  text-decoration: none;
}
.preview {
  margin: 6px 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.empty {
  text-align: center;
  padding: 40px 12px;
}
.title-input {
  width: 100%;
  font-size: 22px;
  font-weight: 700;
  background: var(--surface);
  margin-bottom: 10px;
}
textarea.note-text {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  resize: vertical;
  line-height: 1.55;
}
textarea.note-text:focus-visible {
  outline: none;
}
.checklist {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
}
.checklist li {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
}
.checklist input[type="text"] {
  flex: 1;
  width: 0;
  min-width: 0;
  border-color: transparent;
  background: transparent;
  padding: 8px 6px;
}
.checklist input[type="text"]:focus {
  border-color: var(--line);
  background: var(--bg);
}
.checklist li.done input[type="text"] {
  text-decoration: line-through;
  color: var(--muted);
}
input[type="checkbox"] {
  width: 24px;
  height: 24px;
  min-height: 0;
  padding: 0;
  flex: none;
  accent-color: var(--ink-3);
}
.mini {
  min-width: 36px;
  min-height: 44px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  border-radius: 8px;
}
.mini:disabled {
  opacity: 0.25;
}
.mini.danger {
  color: var(--red);
}
.add-row {
  display: flex;
  gap: 8px;
}
.add-row input {
  flex: 1;
  min-width: 0;
}
.form.card {
  margin-bottom: 14px;
}
.form textarea {
  width: 100%;
}
.check-label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
}
.search {
  width: 100%;
  background: var(--surface);
  margin-bottom: 12px;
}
.phone {
  font-size: 18px;
  font-weight: 600;
  margin: 8px 0 0;
  text-align: right;
}
.route {
  margin: 8px 0 4px;
  overflow-wrap: anywhere;
}
.login {
  padding-top: 24px;
}

/* ---- Tasks and search ---- */
.quick {
  margin-bottom: 12px;
}
.quick-row,
.search-form {
  display: flex;
  gap: 8px;
}
.quick-input {
  flex: 1;
  min-width: 0;
  background: var(--surface);
}
.quick-hint {
  margin: 6px 4px 0;
}
.search-form {
  margin-bottom: 10px;
}
.search-form .search {
  margin-bottom: 0;
}
.home-glass > .search-form {
  margin-top: 12px;
}
.segments {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 0 10px;
  scrollbar-width: none;
}
.segment {
  flex: none;
  min-height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.segment.active {
  background: var(--ink);
  color: #ffffff;
}
.segment-count {
  font-size: 12px;
  opacity: 0.7;
}
.task {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.task {
  flex-wrap: wrap;
}
.task-restore {
  flex: none;
  min-height: 34px;
  padding: 0 12px;
  font-size: 14px;
}
.task-actions {
  flex-basis: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Task categories: each has its own colour, shown as frosted glass on the cards and the tabs. */
.cat-today {
  --cat: #e0352b;
}
.cat-todo {
  --cat: #c9a227;
}
.cat-upcoming {
  --cat: #f28322;
}
.cat-later {
  --cat: #1fb5ad;
}
.cat-done {
  --cat: #2e9d4f;
}
/* Event categories: today red, this week mustard, later turquoise, passed green, trips blue. */
.cat-week {
  --cat: #c9a227;
}
.cat-past {
  --cat: #2e9d4f;
}
.cat-travel {
  --cat: #2f6fd6;
}
.event-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}
.event-form input,
.event-form textarea {
  font: inherit;
  width: 100%;
  box-sizing: border-box;
}
.briefing-link {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}
.briefing-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.card.glass {
  position: relative;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--cat) 24%, rgba(255, 255, 255, 0.62)), color-mix(in srgb, var(--cat) 12%, rgba(255, 255, 255, 0.4)));
  -webkit-backdrop-filter: blur(16px) saturate(170%);
  backdrop-filter: blur(16px) saturate(170%);
  border: 1px solid color-mix(in srgb, var(--cat) 45%, rgba(255, 255, 255, 0.5));
  border-inline-start: 5px solid var(--cat);
  box-shadow:
    0 4px 16px color-mix(in srgb, var(--cat) 18%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
}
.segment[class*="cat-"] {
  background: color-mix(in srgb, var(--cat) 16%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--cat) 45%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.segment[class*="cat-"]::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--cat);
}
.segment[class*="cat-"].active {
  background: color-mix(in srgb, var(--cat) 82%, #000000);
  color: #ffffff;
  border-color: var(--cat);
}
.segment[class*="cat-"].active::before {
  background: #ffffff;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .card.glass {
    background:
      linear-gradient(135deg, color-mix(in srgb, var(--cat) 30%, rgba(28, 30, 34, 0.8)), color-mix(in srgb, var(--cat) 14%, rgba(28, 30, 34, 0.62)));
    border-color: color-mix(in srgb, var(--cat) 50%, rgba(255, 255, 255, 0.08));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  }
}
:root[data-theme="dark"] .card.glass {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--cat) 30%, rgba(28, 30, 34, 0.8)), color-mix(in srgb, var(--cat) 14%, rgba(28, 30, 34, 0.62)));
  border-color: color-mix(in srgb, var(--cat) 50%, rgba(255, 255, 255, 0.08));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .card.glass {
    background: var(--surface);
  }
  .segment[class*="cat-"].active {
    background: var(--cat);
  }
}
.task.done .order-title {
  text-decoration: line-through;
  color: var(--muted);
}
.task input[type="checkbox"] {
  margin-top: 2px;
}
.task-body {
  flex: 1;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}
.flag {
  color: var(--red);
}
.badge.bad {
  color: var(--red);
}
.field {
  display: grid;
  gap: 4px;
  font-size: 14px;
  color: var(--muted);
}
.field > input,
.field > select,
.field > textarea {
  width: 100%;
  font-size: 17px;
}
.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.sub-title {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.checklist li.done .sub-title {
  text-decoration: line-through;
  color: var(--muted);
}
mark {
  background: #ffe08a;
  color: #1c1c1e;
  border-radius: 3px;
  padding: 0 1px;
}
.toast-action {
  margin-inline-start: 12px;
  border: 0;
  background: none;
  color: #e3c27a;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  min-height: 32px;
}
.tab {
  max-width: 110px;
}

/* ---- Spreadsheets and mail ---- */
.tab-row {
  border-top: 1px solid var(--line);
  margin-top: 10px;
  padding-top: 6px;
}
.tab-row p {
  margin: 0 0 6px;
}
.card.unread {
  border-inline-start: 4px solid var(--accent);
}
.mail-preview {
  margin: 8px 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.steps {
  padding-inline-start: 20px;
  margin: 8px 0;
}
.steps li {
  margin-bottom: 4px;
}
.token {
  flex: 1;
  min-width: 0;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 14px;
}

/* ---- Files, recorder, export ---- */
.files {
  list-style: none;
  margin: 10px 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.file {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}
.file-preview img {
  max-width: 100%;
  max-height: 320px;
  border-radius: 10px;
  margin-top: 8px;
  display: block;
}
.file-preview audio {
  width: 100%;
  margin-top: 8px;
}
.actions.first {
  margin-top: 0;
}
.button.mic {
  background: var(--red);
  color: #ffffff;
}
.button.on-dark.mic {
  background: #c4271d;
  border-color: transparent;
}
.recorder {
  margin: 12px 0;
  border: 1px solid var(--line);
}
.rec-line {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}
.rec-clock {
  margin-inline-start: auto;
  font-variant-numeric: tabular-nums;
  font-size: 20px;
}
.rec-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--red);
  animation: pulse 1.2s ease-in-out infinite;
}
.recorder.paused .rec-dot {
  animation: none;
  background: var(--muted);
}
@keyframes pulse {
  50% {
    opacity: 0.25;
  }
}
.list-recorder {
  margin-bottom: 12px;
}
.list-recorder > .button {
  margin-bottom: 4px;
}
#print-area {
  display: none;
}
@media print {
  #app,
  .toast {
    display: none !important;
  }
  body {
    background: #ffffff;
    color: #000000;
  }
  #print-area {
    display: block;
    font-size: 12pt;
    line-height: 1.5;
  }
  #print-area h1 {
    font-size: 20pt;
    margin: 0 0 12pt;
  }
  #print-area h2 {
    font-size: 14pt;
    margin: 16pt 0 6pt;
    display: block;
  }
  #print-area p {
    margin: 0 0 4pt;
    white-space: pre-wrap;
  }
  #print-area ul {
    padding-inline-start: 18pt;
  }
  #print-area .print-checks {
    list-style: none;
    padding: 0;
  }
  #print-area .print-checks li {
    break-inside: avoid;
  }
  #print-area img {
    max-width: 100%;
    max-height: 22cm;
    margin: 8pt 0;
    break-inside: avoid;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
@media (prefers-reduced-transparency: reduce) {
  .tabbar {
    background: var(--surface);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

/* ---- Settings: a checkbox with its label ---- */
.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 44px;
  font-weight: 600;
}
.check-row input {
  width: 22px;
  height: 22px;
  flex: none;
  margin-top: 2px;
}

/* ---- Recording transcript ---- */
.transcript {
  margin: 8px 0;
}
.transcript-text {
  white-space: pre-wrap;
  background: var(--fill);
  border-radius: 10px;
  padding: 10px 12px;
  margin: 4px 0 8px;
}

/* ---- Bibi: floating button (physical left, bottom) and chat panel ---- */
.bibi-fab {
  position: fixed;
  left: calc(14px + env(safe-area-inset-left));
  bottom: calc(var(--tabbar) + env(safe-area-inset-bottom) + 16px);
  z-index: 15;
  min-width: 58px;
  height: 58px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 29px;
  /* Frosted glass: the screen shows through, blurred. */
  background: rgba(30, 33, 38, 0.4);
  -webkit-backdrop-filter: blur(14px) saturate(170%);
  backdrop-filter: blur(14px) saturate(170%);
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  font: inherit;
  font-weight: 700;
  font-size: 16px;
  box-shadow:
    0 6px 20px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.bibi-fab.dragging {
  cursor: grabbing;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.3);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .bibi-fab {
    background: rgba(30, 33, 38, 0.75);
  }
}
.bibi-fab.unread::after {
  content: "";
  position: absolute;
  top: 4px;
  right: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ff453a;
  border: 2px solid #ffffff;
}
.bibi-panel {
  position: fixed;
  left: calc(12px + env(safe-area-inset-left));
  bottom: calc(var(--tabbar) + env(safe-area-inset-bottom) + 12px);
  z-index: 30;
  width: min(420px, calc(100vw - 24px));
  height: min(620px, calc(100dvh - var(--tabbar) - env(safe-area-inset-bottom) - env(safe-area-inset-top) - 36px));
  display: flex;
  flex-direction: column;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}
.bibi-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  background: var(--ink, #1e2126);
  color: #ffffff;
}
.bibi-head strong {
  font-size: 18px;
}
.bibi-status {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.72);
}
.bibi-status.on {
  color: #7be495;
}
.bibi-head-actions {
  display: flex;
  gap: 12px;
  flex: none;
}
.bibi-link {
  background: none;
  border: 0;
  padding: 6px 2px;
  min-height: 32px;
  color: var(--accent);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.bibi-head .bibi-link {
  color: #ffffff;
}
.bibi-panel > .bibi-link,
.bibi-panel > .error {
  margin: 0 14px 8px;
  text-align: start;
}
.bibi-setup {
  margin: 10px 12px 0;
  padding: 12px;
  border-radius: 12px;
  background: var(--fill);
  font-size: 14px;
  max-height: 45%;
  overflow-y: auto;
}
.bibi-setup p {
  margin: 0 0 6px;
}
.bibi-setup ol {
  margin: 0 0 10px;
  padding-inline-start: 20px;
}
.bibi-token code {
  display: block;
  word-break: break-all;
  user-select: all;
  padding: 8px;
  margin-bottom: 8px;
  border-radius: 8px;
  background: var(--surface);
  font-size: 13px;
}
.bibi-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bibi-msg {
  max-width: 88%;
  padding: 9px 12px;
  border-radius: 16px;
  font-size: 15px;
}
.bibi-msg p {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.bibi-msg.user {
  align-self: flex-start;
  background: var(--accent);
  color: var(--accent-text);
}
.bibi-msg.agent {
  align-self: flex-end;
  background: var(--fill);
}
.bibi-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 4px;
  font-size: 12px;
  opacity: 0.85;
}
.bibi-meta .bibi-link {
  color: inherit;
  text-decoration: underline;
  font-size: 12px;
  min-height: 0;
  padding: 0;
}
.bibi-compose {
  border-top: 1px solid var(--line);
  padding: 10px 12px;
  display: grid;
  gap: 8px;
}
.bibi-compose textarea {
  width: 100%;
  resize: none;
  font: inherit;
  font-size: 16px;
  padding: 9px 11px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
}
.bibi-compose-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.bibi-compose-row select {
  flex: 1;
  min-height: 44px;
  font: inherit;
  font-size: 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  padding: 0 8px;
}
@media print {
  .bibi {
    display: none;
  }
}

/* ---- Swipe right to delete ---- */
.swipeable {
  touch-action: pan-y;
  transition:
    transform 0.16s ease-out,
    opacity 0.16s ease-out;
}
.swipeable.swiping {
  transition: none;
  user-select: none;
}

/* Logistics worker's space and my reports screen. */
.page-title p.over {
  margin: 0 0 4px;
}
.task-body.as-button {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  text-align: start;
  cursor: pointer;
}
dialog.sheet {
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100dvh - 32px);
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  padding: 20px;
  box-shadow: var(--shadow-soft);
}
/* Long details scroll inside the sheet, not the page behind it. */
dialog.sheet {
  overflow-y: auto;
  overscroll-behavior: contain;
}
/* The whole text, every line (the worker's details sheet). */
.full-text {
  margin: 8px 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
dialog.sheet::backdrop {
  background: rgba(18, 19, 21, 0.45);
}
dialog.sheet h2 {
  margin-top: 0;
}
dialog.sheet textarea {
  font: inherit;
  width: 100%;
  box-sizing: border-box;
}
.report-photo {
  display: block;
  max-width: 100%;
  max-height: 360px;
  margin: 10px 0;
  border-radius: 14px;
}
.details {
  margin: 8px 0 12px;
}
.detail-row {
  margin: 4px 0;
}
.sheet-section {
  border-top: 1px solid var(--line);
  margin-top: 16px;
  padding-top: 8px;
}
dialog.sheet h2:focus {
  outline: none;
}

/* ---- Home screens (mine and the worker's): frosted glass over soft shapes that move slowly ---- */
:root {
  --pane: rgba(255, 255, 255, 0.58);
  --pane-line: rgba(255, 255, 255, 0.7);
  --blob-opacity: 0.55;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --pane: rgba(28, 30, 34, 0.58);
    --pane-line: rgba(255, 255, 255, 0.08);
    --blob-opacity: 0.3;
  }
}
:root[data-theme="dark"] {
  --pane: rgba(28, 30, 34, 0.58);
  --pane-line: rgba(255, 255, 255, 0.08);
  --blob-opacity: 0.3;
}
.home-backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.home-backdrop .blob {
  position: absolute;
  border-radius: 50%;
  opacity: var(--blob-opacity);
  will-change: transform;
}
.blob.b1 {
  width: 60vmax;
  height: 60vmax;
  max-width: 520px;
  max-height: 520px;
  background: #afa9ec;
  top: 8%;
  right: -18%;
  animation: blob-1 18s ease-in-out infinite alternate;
}
.blob.b2 {
  width: 55vmax;
  height: 55vmax;
  max-width: 480px;
  max-height: 480px;
  background: #9fe1cb;
  top: 42%;
  left: -20%;
  animation: blob-2 22s ease-in-out infinite alternate;
}
.blob.b3 {
  width: 45vmax;
  height: 45vmax;
  max-width: 400px;
  max-height: 400px;
  background: #f5c4b3;
  bottom: -8%;
  right: 10%;
  animation: blob-3 26s ease-in-out infinite alternate;
}
@keyframes blob-1 {
  to {
    transform: translate(-18vw, 8vh) scale(1.15);
  }
}
@keyframes blob-2 {
  to {
    transform: translate(20vw, -7vh) scale(0.9);
  }
}
@keyframes blob-3 {
  to {
    transform: translate(-12vw, -10vh) scale(1.2);
  }
}
.home-glass .briefing,
.glass-pane,
.home-glass .glass-field {
  background: var(--pane);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid var(--pane-line);
  box-shadow: none;
}
/* The search and quick-task fields: an icon and the field inside one rounded pane. */
.glass-field {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
}
.glass-field .icon {
  width: 18px;
  height: 18px;
  flex: none;
}
.glass-field input {
  flex: 1;
  min-width: 0;
  width: 100%;
  background: transparent;
  border: 0;
  padding-inline: 0;
  margin: 0;
  outline: none;
}
.glass-field:focus-within {
  border-color: var(--accent);
}
.home-glass .briefing .card {
  background: var(--pane);
}
/* The coming week: one row per day; the row opens to its tasks and events. */
.week-day {
  margin: 0 0 8px;
  border-radius: 16px;
  padding: 0 14px;
}
.week-day.today {
  border-color: color-mix(in srgb, var(--accent) 60%, transparent);
}
.week-day > summary {
  color: var(--text);
  gap: 10px;
  list-style: none;
}
.week-day > summary::-webkit-details-marker {
  display: none;
}
.week-name {
  font-weight: 600;
  min-width: 52px;
}
.week-date {
  color: var(--muted);
  font-size: 15px;
}
.week-count {
  margin-inline-start: auto;
  font-size: 15px;
  color: var(--muted);
  white-space: nowrap;
}
.week-items {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  font-size: 15px;
}
.week-items li {
  padding: 6px 0;
  border-top: 1px solid var(--line);
}
.week-items a {
  color: var(--text);
  text-decoration: none;
}
/* The worker's home: today's progress and what is new since the last visit. */
.worker-progress,
.worker-news {
  margin-top: 12px;
}
.worker-progress h2,
.worker-news h2 {
  font-size: 17px;
  margin: 0 0 6px;
}
.progress-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.progress-count {
  font-weight: 700;
}
.worker-progress progress {
  width: 100%;
  height: 8px;
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  border-radius: 8px;
  overflow: hidden;
  background: var(--fill);
}
.worker-progress progress::-webkit-progress-bar {
  background: var(--fill);
}
.worker-progress progress::-webkit-progress-value {
  background: var(--green);
  border-radius: 8px;
}
.worker-progress progress::-moz-progress-bar {
  background: var(--green);
  border-radius: 8px;
}
.worker-progress p {
  margin: 4px 0 0;
}
.worker-news .plain {
  list-style: none;
  margin: 0;
  padding: 0;
}
.worker-news li + li {
  border-top: 1px solid var(--line);
}
.news-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  min-height: 44px;
  background: none;
  border: 0;
  font: inherit;
  color: inherit;
  text-align: start;
  cursor: pointer;
}
.news-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}
.news-text {
  flex: 1;
  display: flex;
  flex-direction: column;
}
@media (prefers-reduced-transparency: reduce) {
  .home-glass .briefing,
  .glass-pane,
  .home-glass .glass-field {
    background: var(--surface);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

/* ---- Chat between me and the worker's space ---- */
.chat-tools summary {
  cursor: pointer;
  font-weight: 700;
  min-height: 32px;
}
.chat-tools h3 {
  margin: 14px 0 6px;
  font-size: 15px;
}
.chat-selection {
  position: sticky;
  top: calc(env(safe-area-inset-top) + 8px);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.chat-selection .actions {
  margin: 0;
}
.chat-list {
  list-style: none;
  margin: 12px 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chat-msg {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  max-width: 88%;
}
/* RTL: my messages on the right (start), the other side's on the left. */
.chat-msg.mine {
  align-self: flex-start;
}
.chat-msg.theirs {
  align-self: flex-end;
}
.chat-pick {
  width: 22px;
  height: 22px;
  flex: none;
  margin-top: 10px;
}
.chat-bubble {
  padding: 9px 12px 6px;
  border-radius: 16px;
  font-size: 15px;
  min-width: 0;
}
.chat-msg.mine .chat-bubble {
  background: var(--accent);
  color: var(--accent-text);
}
.chat-msg.theirs .chat-bubble {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
}
.chat-msg.selected .chat-bubble {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}
.chat-bubble p {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.chat-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
  font-size: 12px;
  opacity: 0.85;
}
.chat-copy {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 12px;
  padding: 4px 0;
  cursor: pointer;
}
.chat-copy .icon,
.chat-copy svg {
  width: 15px;
  height: 15px;
}
.chat-compose {
  position: sticky;
  bottom: calc(var(--tabbar) + env(safe-area-inset-bottom) + 8px);
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 8px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
}
.chat-compose textarea {
  flex: 1;
  min-width: 0;
  resize: none;
  font: inherit;
  font-size: 16px;
  padding: 9px 11px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
}
