/* «حايك» — shared styles (copied from the approved demo and adapted for P1a). Mobile first, few colours, big
   touch targets, logical properties for RTL. Every colour is a token in :root. The CSP allows no inline styles,
   so every style lives in a file under /css. */

@font-face {
  font-family: 'App Sans';
  font-style: normal;
  font-display: swap;
  font-weight: 200 1000;
  src: url('/fonts/cairo-arabic.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E,
    U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

@font-face {
  font-family: 'App Sans';
  font-style: normal;
  font-display: swap;
  /* Same weight range as Cairo on purpose: Chromium only mixes faces by unicode-range when weights match. */
  font-weight: 200 1000;
  src: url('/fonts/manrope-latin.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 {
  --brand: #0f5c4d;
  --brand-ink: #0b463b;
  --brand-soft: #e2eee8;
  --bg: #f4f2ed;
  --surface: #ffffff;
  --text: #1c2220;
  --muted: #5b6460;
  --line: #e2ded5;
  --field-line: #8b918e;
  --late: #b42318;
  --late-soft: #fdecea;
  --soon: #8a5300;
  --soon-fill: #e0a33b;
  --soon-soft: #fff2d9;
  --ok: #1f7a4d;
  --ok-soft: #e4f3eb;
  --zakat: #0f5c4d;
  --zakat-soft: #e2eee8;
  --sadaqah: #3b4a9b;
  --sadaqah-soft: #e8ebf8;
  --in: #1f7a4d;
  --out: #b42318;
  --test: #6b4f00;
  --test-soft: #fbf3dc;
  --radius: 16px;
  --radius-sm: 12px;
  --tap: 52px;
  --tabbar-h: 66px;
  --rail-w: 236px;
  --shadow: 0 1px 2px rgba(20, 30, 25, 0.05), 0 1px 4px rgba(20, 30, 25, 0.07);
  --shadow-lg: 0 10px 30px rgba(20, 30, 25, 0.18);
  color-scheme: only light;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: 'App Sans', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-tap-highlight-color: transparent;
}

body.has-sheet {
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent);
  outline-offset: 2px;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 14px;
}

.icon {
  display: inline-flex;
  flex-shrink: 0;
}

.icon svg {
  width: 1.2em;
  height: 1.2em;
}

bdi[dir='ltr'] {
  unicode-bidi: isolate;
}

/* ------------------------------------------------------------ shell */

.frame {
  min-height: 100vh;
}

/* The top bar and, on staging, the «نسخة تجربة» bar: they stay at the top together while the page scrolls. On
   desktop the top bar is hidden and the staging bar alone stays. */
.top-stack {
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(env(safe-area-inset-top) + 8px) 16px 8px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.wordmark {
  color: var(--brand);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0;
}

.top-links {
  display: flex;
  gap: 4px;
}

.top-link {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  min-height: 48px;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
}

.top-link .icon svg {
  width: 24px;
  height: 24px;
}

.top-link.active {
  color: var(--brand);
  background: var(--brand-soft);
}

/* The permanent «نسخة تجربة» bar (staging only). Inside the app it sits in .top-stack; on the screens before the
   app (login, setup, /reset, /confirm) it sticks to the top by itself. */
.env-bar {
  padding: 4px 16px;
  background: var(--test-soft);
  color: var(--test);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.view {
  max-width: 720px;
  margin: 0 auto;
  padding: 12px 16px calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 96px);
  outline: none;
}

.tabbar {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface);
  border-top: 1px solid var(--line);
}

.tab {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--muted);
  font-size: 12px; /* six tabs on a 360px phone */
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
}

.tab .icon svg {
  width: 24px;
  height: 24px;
}

.tab .nav-label {
  max-width: 100%;
  /* Six tabs on a 360px phone: a long label («زكاة وصدقة») wraps to two short lines instead of being cut. */
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.tab.active {
  color: var(--brand);
}

.tab.active::before {
  content: '';
  position: absolute;
  top: 0;
  inset-inline: 22%;
  height: 3px;
  border-radius: 0 0 999px 999px;
  background: var(--brand);
}

.rail {
  display: none;
}

@media (min-width: 960px) {
  .rail {
    position: fixed;
    inset-block: 0;
    inset-inline-start: 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: var(--rail-w);
    padding: 20px 14px;
    background: var(--surface);
    border-inline-end: 1px solid var(--line);
  }

  .rail-brand {
    margin: 0 10px 18px;
    color: var(--brand);
    font-size: 26px;
    font-weight: 900;
  }

  .rail-link {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    color: var(--text);
    font-weight: 700;
  }

  .rail-link .icon svg {
    width: 24px;
    height: 24px;
    color: var(--muted);
  }

  .rail-link:hover {
    background: var(--bg);
  }

  .rail-link.active {
    background: var(--brand-soft);
    color: var(--brand-ink);
  }

  .rail-link.active .icon svg {
    color: var(--brand);
  }

  .rail-sep {
    height: 1px;
    margin: 12px 8px;
    background: var(--line);
  }

  .frame {
    margin-inline-start: var(--rail-w);
  }

  .topbar,
  .tabbar {
    display: none;
  }

  .view {
    padding: 28px 32px 120px;
  }
}

/* ------------------------------------------------------------ screen head */

.screen-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 14px;
}

.screen-head-text {
  flex: 1;
  min-width: 0;
}

.screen-title {
  margin: 0;
  font-size: 25px;
  font-weight: 900;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.screen-subtitle {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.screen-actions {
  display: flex;
  gap: 6px;
}

/* ------------------------------------------------------------ buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 8px 20px;
  border: 1.5px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  text-align: center;
  line-height: 1.3;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--brand);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--brand-ink);
}

.btn-secondary {
  background: var(--surface);
  border-color: var(--line);
  color: var(--brand-ink);
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--brand);
}

.btn-ghost {
  background: transparent;
  color: var(--brand-ink);
}

.btn-danger {
  background: var(--late);
  color: #fff;
}

.btn-ok {
  background: var(--ok);
  color: #fff;
}

.btn-small {
  min-height: 44px;
  padding: 6px 14px;
  font-size: 15px;
}

.btn-full {
  width: 100%;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.icon-btn:hover {
  background: color-mix(in srgb, var(--text) 7%, transparent);
}

.icon-btn .icon svg {
  width: 24px;
  height: 24px;
}

.fab {
  position: fixed;
  inset-inline-end: 16px;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 16px);
  z-index: 15;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 58px;
  padding: 10px 22px 10px 24px;
  border: 0;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 17px;
  font-weight: 800;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
}

.fab .icon svg {
  width: 26px;
  height: 26px;
  stroke-width: 2.2;
}

@media (min-width: 960px) {
  .fab {
    bottom: 28px;
    inset-inline-end: 32px;
  }
}

/* ------------------------------------------------------------ search and filters */

.search {
  position: relative;
  display: block;
  margin: 0 0 10px;
}

.search .icon {
  position: absolute;
  inset-inline-start: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.search-input {
  padding-inline-start: 44px !important;
}

.filters {
  display: flex;
  gap: 8px;
  margin: 0 -16px 12px;
  padding: 2px 16px 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.filters::-webkit-scrollbar {
  display: none;
}

.filters > * {
  flex-shrink: 0;
}

.chips {
  display: flex;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  padding: 6px 16px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.chip-on {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.chip-zakat.chip-on {
  border-color: var(--zakat);
  background: var(--zakat);
}

.chip-sadaqah.chip-on {
  border-color: var(--sadaqah);
  background: var(--sadaqah);
}

.chip-count {
  min-width: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: color-mix(in srgb, currentColor 16%, transparent);
  font-size: 13px;
  text-align: center;
}

.filter-select {
  width: auto !important;
  min-height: 42px !important;
  padding: 4px 36px 4px 14px !important;
  padding-inline: 14px 36px !important;
  border-radius: 999px !important;
  font-size: 15px !important;
  font-weight: 700;
}

/* ------------------------------------------------------------ rows (list items) */

.rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 66px;
  padding: 12px 16px;
  border: 0;
  border-inline-start: 4px solid transparent;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--text);
  text-align: start;
  cursor: default;
}

a.row,
button.row {
  cursor: pointer;
}

a.row:hover,
button.row:hover {
  background: #fcfbf8;
}

.row-late {
  border-inline-start-color: var(--late);
}

.row-soon {
  border-inline-start-color: var(--soon-fill);
}

.row-ok {
  border-inline-start-color: var(--ok);
}

.row-zakat {
  border-inline-start-color: var(--zakat);
}

.row-sadaqah {
  border-inline-start-color: var(--sadaqah);
}

.row-done {
  opacity: 0.72;
}

.row-leading {
  flex-shrink: 0;
}

.row-main {
  flex: 1;
  min-width: 0;
}

.row-title {
  font-size: 17px;
  font-weight: 800;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.row-sub {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.row-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.row-side {
  flex-shrink: 0;
  text-align: end;
}

.row-side-sub {
  color: var(--muted);
  font-size: 13px;
}

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-weight: 900;
}

/* ------------------------------------------------------------ badges, money, groups */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3em; /* text + money inside one badge: flex drops the spaces between them */
  min-height: 26px;
  padding: 1px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
  white-space: nowrap;
}

.badge-muted {
  background: #eeece6;
  color: var(--muted);
}

.badge-brand {
  background: var(--brand-soft);
  color: var(--brand-ink);
}

.badge-late {
  background: var(--late-soft);
  color: var(--late);
}

.badge-soon {
  background: var(--soon-soft);
  color: var(--soon);
}

.badge-ok {
  background: var(--ok-soft);
  color: var(--ok);
}

.badge-zakat {
  background: var(--zakat-soft);
  color: var(--zakat);
}

.badge-sadaqah {
  background: var(--sadaqah-soft);
  color: var(--sadaqah);
}

.money {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.money-in {
  color: var(--in);
}

.money-out {
  color: var(--out);
}

.money-late {
  color: var(--late);
}

.group {
  margin-top: 22px;
}

.group:first-child {
  margin-top: 6px;
}

.group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 800;
}

.group-late .group-title {
  color: var(--late);
}

.group-soon .group-title {
  color: var(--soon);
}

.group-count {
  min-width: 24px;
  padding: 0 7px;
  border-radius: 999px;
  background: color-mix(in srgb, currentColor 14%, transparent);
  font-size: 13px;
  text-align: center;
}

.empty {
  padding: 40px 16px;
  color: var(--muted);
  text-align: center;
}

.empty p {
  margin: 0 0 14px;
}

.empty-small {
  margin: 0;
  padding: 14px;
  color: var(--muted);
  font-size: 15px;
  text-align: center;
}

/* ------------------------------------------------------------ panels, facts, notices, totals */

.panel {
  margin-bottom: 14px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel > :first-child {
  margin-top: 0;
}

.panel > :last-child {
  margin-bottom: 0;
}

.facts {
  display: grid;
  gap: 2px;
  margin: 0;
}

.fact {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.fact:last-child {
  border-bottom: 0;
}

.fact dt {
  color: var(--muted);
  font-size: 15px;
}

.fact dd {
  margin: 0;
  font-weight: 700;
  text-align: end;
  overflow-wrap: anywhere;
}

.notice {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
}

.notice-info {
  background: var(--brand-soft);
  color: var(--brand-ink);
}

.notice-late {
  background: var(--late-soft);
  color: var(--late);
}

.notice-soon {
  background: var(--soon-soft);
  color: var(--soon);
}

.notice-ok {
  background: var(--ok-soft);
  color: var(--ok);
}

.totals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  margin: 0 0 14px;
}

.total {
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.total-label {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.total-value {
  font-size: 20px;
  font-weight: 900;
}

.total-in .total-value {
  color: var(--in);
}

.total-out .total-value {
  color: var(--out);
}

.total-zakat {
  background: var(--zakat-soft);
}

.total-zakat .total-value {
  color: var(--zakat);
}

.total-sadaqah {
  background: var(--sadaqah-soft);
}

.total-sadaqah .total-value {
  color: var(--sadaqah);
}

/* ------------------------------------------------------------ sheets */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(15, 25, 20, 0);
  transition: background 0.16s ease;
}

.backdrop.open {
  background: rgba(15, 25, 20, 0.42);
}

/* While a closed sheet fades out, taps must reach what is under it. */
.backdrop.closing {
  pointer-events: none;
}

.sheet {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-height: 94vh;
  max-height: 94dvh;
  border-radius: 22px 22px 0 0;
  background: var(--bg);
  box-shadow: var(--shadow-lg);
  transform: translateY(24px);
  opacity: 0;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.backdrop.open .sheet {
  transform: none;
  opacity: 1;
}

.backdrop.closing .sheet {
  transform: translateY(24px);
  opacity: 0;
}

.sheet-tall {
  min-height: 70vh;
  min-height: 70dvh;
}

.sheet-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px 6px 16px;
  padding-inline: 18px 8px;
}

.sheet-title {
  flex: 1;
  margin: 0;
  font-size: 21px;
  font-weight: 900;
}

.sheet-body {
  flex: 1;
  overflow-y: auto;
  padding: 6px 18px 18px;
  overscroll-behavior: contain;
}

.sheet-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.sheet-actions .btn {
  flex: 1 1 140px;
}

@media (min-width: 720px) {
  .backdrop {
    align-items: center;
    padding: 24px;
  }

  .sheet {
    max-width: 560px;
    max-height: 88vh;
    border-radius: 22px;
    overflow: hidden;
  }

  .sheet-tall {
    min-height: 0;
  }
}

.confirm-text {
  margin: 4px 0 8px;
  font-size: 18px;
}

/* ------------------------------------------------------------ forms */

.form-error {
  margin: 0 0 14px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--late-soft);
  color: var(--late);
  font-weight: 700;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
  min-width: 0;
}

.field-label {
  font-size: 15px;
  font-weight: 800;
}

.req {
  color: var(--late);
}

.field-hint {
  color: var(--muted);
  font-size: 14px;
}

.field-error {
  color: var(--late);
  font-size: 14px;
  font-weight: 700;
}

.input {
  width: 100%;
  min-height: var(--tap);
  padding: 10px 14px;
  border: 1.5px solid var(--field-line);
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: 17px;
}

.input:focus {
  outline: 3px solid color-mix(in srgb, var(--brand) 25%, transparent);
  border-color: var(--brand);
}

.input::placeholder {
  color: #7a817e;
}

textarea.input {
  resize: vertical;
  line-height: 1.6;
}

select.input {
  appearance: none;
  padding-inline-end: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235b6460' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 20px;
  background-position: left 12px center;
}

input[type='date'].input {
  direction: rtl;
  text-align: start;
}

.money-field {
  display: flex;
  align-items: stretch;
}

.money-field .input {
  border-start-end-radius: 0;
  border-end-end-radius: 0;
  font-size: 20px;
  font-weight: 800;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.money-unit {
  display: flex;
  align-items: center;
  padding: 0 14px;
  border: 1.5px solid var(--field-line);
  border-inline-start: 0;
  border-start-end-radius: var(--radius-sm);
  border-end-end-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--muted);
  font-weight: 800;
}

.input-iban {
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 8px;
}

.seg {
  min-height: var(--tap);
  padding: 8px 12px;
  border: 1.5px solid var(--field-line);
  border-radius: var(--radius-sm);
  background: #fff;
  font-weight: 800;
  cursor: pointer;
}

.seg-on {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.seg-zakat.seg-on {
  border-color: var(--zakat);
  background: var(--zakat);
}

.seg-sadaqah.seg-on {
  border-color: var(--sadaqah);
  background: var(--sadaqah);
}

.seg-late.seg-on {
  border-color: var(--late);
  background: var(--late);
}

.seg-ok.seg-on {
  border-color: var(--ok);
  background: var(--ok);
}

.picker-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  text-align: start;
  font-weight: 700;
  cursor: pointer;
}

.picker-btn .placeholder {
  color: #7a817e;
  font-weight: 400;
}

.picker-btn .icon {
  color: var(--muted);
}

.picker-rows {
  margin-top: 12px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-height: 38px;
  padding-inline: 14px 4px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-weight: 700;
}

.tag-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-weight: 700;
  cursor: pointer;
}

.check input {
  width: 22px;
  height: 22px;
  accent-color: var(--brand);
}

/* ------------------------------------------------------------ attachments */

.attachments {
  margin-top: 22px;
}

.files {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.file {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 6px 6px 12px;
  padding-inline: 12px 6px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.file-thumb {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
}

.file-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--bg);
  color: var(--muted);
}

.file-name {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 0;
  border: 0;
  background: none;
  font-weight: 700;
  text-align: start;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.file-size {
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}

/* ------------------------------------------------------------ toast */

.toast {
  position: fixed;
  inset-inline: 16px;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 88px);
  z-index: 80;
  max-width: 480px;
  margin: 0 auto;
  padding: 12px 16px;
  border-radius: 14px;
  background: #1c2220;
  color: #fff;
  font-weight: 700;
  text-align: center;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.show {
  opacity: 1;
  transform: none;
}

@media (min-width: 960px) {
  .toast {
    bottom: 32px;
    margin-inline-start: calc(var(--rail-w) + 16px);
  }
}

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

/* ------------------------------------------------------------ P1a: the red line, placeholders, start-up */

/* The red line: a problem the owner must act on (now: the recovery email is not confirmed). */
.red-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
  padding: 8px 16px;
  background: var(--late);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
}

.red-line-text {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.red-line-btn {
  min-height: 40px;
  padding: 4px 14px;
  border: 1.5px solid #fff;
  border-radius: 999px;
  background: transparent;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.red-line-btn:hover:not(:disabled) {
  background: color-mix(in srgb, #fff 16%, transparent);
}

.red-line-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

/* A section that comes in a later phase. */
.placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding: 48px 20px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--muted);
  text-align: center;
}

.placeholder .icon svg {
  width: 44px;
  height: 44px;
  color: var(--brand);
  stroke-width: 1.4;
}

.placeholder p {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}

/* Before /api/status answers, and when it cannot be reached. */
.boot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px 16px;
  color: var(--muted);
  font-weight: 700;
  text-align: center;
}

.boot p {
  max-width: 420px;
  margin: 0;
}
