:root {
  color-scheme: light;
  --bg: #f4f6fb;
  --card: #ffffff;
  --ink: #0f1d3a;
  --ink-2: #46536d;
  --muted: #8390a6;
  --line: #e7ebf3;
  --field: #f7f9fc;
  --brand: #1f5fd6;
  --brand-soft: #eaf1ff;
  --brand-grad: linear-gradient(150deg, #3d7bf0, #1846b1);
  --red: #e5484d;
  --red-soft: #fdeeee;
  --orange: #e98a15;
  --orange-soft: #fff3e3;
  --green: #1f9d5a;
  --green-soft: #e7f7ee;
  --slate: #5b6781;
  --slate-soft: #eef1f6;
  --amber: #c27c0e;
  --amber-soft: #fff6e0;
  --shadow: 0 1px 2px rgba(15, 29, 58, 0.04), 0 8px 24px rgba(15, 29, 58, 0.07);
  --shadow-sm: 0 1px 2px rgba(15, 29, 58, 0.05), 0 2px 8px rgba(15, 29, 58, 0.04);
  --radius: 18px;
  --font: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  position: fixed;
  inset: 0;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
main::-webkit-scrollbar {
  display: none;
}

.sheet {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 34rem;
  height: 100%;
  margin: 0 auto;
  padding-top: env(safe-area-inset-top);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  background: var(--bg);
}

main {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: none;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 0.85rem 1rem 1.5rem;
}

.sheet:not(.has-tabbar) main {
  padding-bottom: calc(1.5rem + env(safe-area-inset-bottom));
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.3;
  color: var(--ink);
}

p {
  margin: 0;
}

a {
  color: var(--brand);
}

button {
  font: inherit;
}

code {
  direction: ltr;
  unicode-bidi: isolate;
  padding: 0.05rem 0.45rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.75);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.ico {
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lead {
  margin: 0 0 1rem;
  color: var(--ink-2);
  font-size: 0.92rem;
}

.meta {
  color: var(--muted);
  font-size: 0.82rem;
}

.center {
  text-align: center;
}

/* App bar */

.appbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.25rem 0 1rem;
}

.brand-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 15px;
  color: #fff;
  background: var(--brand-grad);
  box-shadow: 0 8px 18px rgba(31, 95, 214, 0.28);
}

.brand-icon .ico {
  width: 1.55rem;
  height: 1.55rem;
  stroke-width: 2.2;
}

.brand-icon.big {
  width: 4.25rem;
  height: 4.25rem;
  margin: 0 auto 0.9rem;
  border-radius: 22px;
}

.brand-icon.big .ico {
  width: 2.1rem;
  height: 2.1rem;
}

.appbar-title {
  flex: 1;
  min-width: 0;
}

.appbar-title h1 {
  font-size: 1.3rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.appbar-title p {
  margin-top: 0.1rem;
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.appbar-acts {
  display: flex;
  gap: 0.5rem;
}

.icon-btn {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}

.icon-btn .ico {
  width: 1.3rem;
  height: 1.3rem;
}

.icon-btn .dot {
  position: absolute;
  top: 0.5rem;
  left: 0.55rem;
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 50%;
  background: var(--red);
  border: 2px solid var(--card);
}

/* Bottom bar + new-request button */

.tabbar {
  flex: none;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 0.15rem;
  padding: 0.45rem 0.4rem calc(0.45rem + env(safe-area-inset-bottom));
  background: var(--card);
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 24px rgba(15, 29, 58, 0.05);
}

.tabbar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.35rem 0.05rem 0.25rem;
  border-radius: 14px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.tabbar-item .ico {
  width: 1.4rem;
  height: 1.4rem;
}

.tabbar-item.on {
  color: var(--brand);
}

.tabbar-item.on .ico {
  stroke-width: 2.4;
}

.tabbar-new {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  text-decoration: none;
}

.tabbar-new span {
  display: grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  margin-top: -1.55rem;
  border: 4px solid var(--card);
  border-radius: 50%;
  background: var(--brand-grad);
  color: #fff;
  box-shadow: 0 10px 22px rgba(31, 95, 214, 0.38);
}

.tabbar-new .ico {
  width: 1.6rem;
  height: 1.6rem;
  stroke-width: 2.5;
}

/* Cards and blocks */

.card {
  margin-bottom: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

.card-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.75rem;
  font-size: 1.02rem;
  font-weight: 700;
}

.card-title .ico {
  color: var(--brand);
}

.card-sub {
  margin: -0.4rem 0 0.75rem;
}

.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 8.5rem;
  margin-bottom: 1rem;
  padding: 1.25rem;
  border-radius: 20px;
  overflow: hidden;
  color: #fff;
  background:
    linear-gradient(to left, rgba(13, 47, 116, 0.97) 0%, rgba(19, 66, 156, 0.86) 38%, rgba(19, 66, 156, 0.22) 70%, rgba(19, 66, 156, 0) 100%),
    url("/img/hero.jpg") left center / cover no-repeat,
    #1b4fae;
  box-shadow: 0 12px 28px rgba(19, 66, 156, 0.22);
}

.hero-text {
  max-width: 64%;
}

.hero h2 {
  color: #fff;
  font-size: 1.45rem;
  font-weight: 700;
}

.hero p {
  margin-top: 0.35rem;
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.9rem;
  line-height: 1.6;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
  margin-bottom: 1rem;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 0.75rem 0.25rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  color: var(--ink);
  text-align: center;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}

.stat-ico {
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand);
}

.stat b {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.15;
}

.stat-label {
  color: var(--ink-2);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.3;
}

.stat.blue { background: #f3f7ff; border-color: #dfe8fb; }
.stat.blue .stat-ico { background: #dfe9ff; color: var(--brand); }
.stat.red { background: #fff6f6; border-color: #fbe1e1; }
.stat.red .stat-ico { background: #fde3e3; color: var(--red); }
.stat.orange { background: #fffaf2; border-color: #fbeacc; }
.stat.orange .stat-ico { background: #ffedd2; color: var(--orange); }
.stat.green { background: #f4fbf7; border-color: #d9f0e3; }
.stat.green .stat-ico { background: #daf3e5; color: var(--green); }
.stat.slate { background: #f7f8fb; }
.stat.slate .stat-ico { background: var(--slate-soft); color: var(--slate); }
.stat.muted { background: #f7f8fb; }
.stat.muted .stat-ico { background: #f0f2f6; color: #98a2b5; }

/* Chart */

.chart-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.chart-head h2 {
  font-size: 1.08rem;
}

.chart-head p {
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.drop {
  position: relative;
  flex: none;
}

.drop summary {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--ink-2);
  font-size: 0.8rem;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}

.drop summary::-webkit-details-marker {
  display: none;
}

.drop summary .ico {
  width: 1rem;
  height: 1rem;
}

.drop[open] summary {
  border-color: #c9d8f6;
  color: var(--brand);
}

.drop-menu {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  z-index: 6;
  display: grid;
  min-width: 9rem;
  padding: 0.3rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.drop-menu a {
  padding: 0.5rem 0.7rem;
  border-radius: 10px;
  color: var(--ink);
  font-size: 0.85rem;
  text-decoration: none;
}

.drop-menu a[aria-current] {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 700;
}

.chart {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 0.6rem;
  overflow: visible;
}

.chart-grid {
  stroke: #e8ecf4;
  stroke-width: 1;
  stroke-dasharray: 3 4;
}

.chart-y,
.chart-x {
  fill: var(--muted);
  font-family: var(--font);
  font-size: 10px;
}

.chart-x.today {
  fill: var(--ink);
  font-weight: 700;
}

.chart-area {
  fill: url(#chartFill);
}

.chart-stop-a {
  stop-color: #2f6fe4;
  stop-opacity: 0.26;
}

.chart-stop-b {
  stop-color: #2f6fe4;
  stop-opacity: 0;
}

.chart-line {
  fill: none;
  stroke: #2f6fe4;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-dot {
  fill: #fff;
  stroke: #2f6fe4;
  stroke-width: 2;
}

.chart-dot.last {
  fill: #2f6fe4;
  stroke: #fff;
  stroke-width: 2.5;
}

.chart-halo {
  fill: rgba(47, 111, 228, 0.16);
}

/* Shortcuts, filters, section heads */

.tiles {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 0.8rem 0.15rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}

.tile .ico {
  width: 1.5rem;
  height: 1.5rem;
  color: var(--brand);
}

.tile.primary {
  border-color: transparent;
  background: var(--brand-grad);
  color: #fff;
  box-shadow: 0 10px 22px rgba(31, 95, 214, 0.3);
}

.tile.primary .ico {
  color: #fff;
}

.badge {
  position: absolute;
  top: 0.35rem;
  left: 0.35rem;
  display: grid;
  place-items: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.3rem;
  border: 2px solid var(--card);
  border-radius: 99px;
  background: var(--red);
  color: #fff;
  font-size: 0.66rem;
  font-style: normal;
  font-weight: 700;
  line-height: 1;
}

.tile.primary .badge {
  border-color: #2c66da;
}

.badge.static {
  position: static;
  border: 0;
  margin-inline-start: auto;
  min-width: 1.5rem;
  height: 1.5rem;
  font-size: 0.75rem;
}

.strip {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0 0 1rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid #cfeedd;
  border-radius: 16px;
  background: var(--green-soft);
  color: #12683c;
  font-weight: 700;
  text-decoration: none;
}

.strip-ico {
  display: grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 11px;
  background: #fff;
  color: var(--green);
}

.strip-text {
  flex: 1;
}

.segs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.45rem;
  margin-bottom: 0.25rem;
  scroll-margin-top: 0.75rem;
}

.seg {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.05rem;
  padding: 0.55rem 0.1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}

.seg b {
  font-size: 0.98rem;
  font-weight: 700;
}

.seg span {
  color: var(--ink-2);
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
}

.seg.on {
  border-color: transparent;
  background: var(--brand-grad);
  color: #fff;
  box-shadow: 0 8px 18px rgba(31, 95, 214, 0.28);
}

.seg.on span {
  color: rgba(255, 255, 255, 0.9);
}

.sec-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 1.1rem 0 0.65rem;
}

.sec-head h2 {
  font-size: 1.08rem;
  font-weight: 700;
}

.sec-head .count {
  min-width: 1.5rem;
  padding: 0.05rem 0.45rem;
  border-radius: 99px;
  background: var(--slate-soft);
  color: var(--slate);
  font-size: 0.75rem;
  font-weight: 700;
  text-align: center;
}

.sec-head a {
  display: inline-flex;
  align-items: center;
  gap: 0.1rem;
  margin-inline-start: auto;
  color: var(--ink-2);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}

.sec-head a .ico {
  width: 1rem;
  height: 1rem;
}

.group:first-of-type .sec-head {
  margin-top: 0.2rem;
}

.chips {
  display: flex;
  gap: 0.45rem;
  margin: 0 -1rem 0.75rem;
  padding: 0.1rem 1rem 0.4rem;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  touch-action: pan-x pan-y;
  scrollbar-width: none;
}

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

.chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--card);
  color: var(--ink-2);
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}

.chip em {
  padding: 0 0.4rem;
  border-radius: 99px;
  background: var(--slate-soft);
  color: var(--slate);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 700;
}

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

.chip.on em {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

/* Request rows */

.req-list {
  display: grid;
  gap: 0.6rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}

.req a {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}

.req a > .pill {
  align-self: start;
}

.req.need a {
  border-color: #f7cfcf;
  box-shadow: 0 0 0 3px rgba(229, 72, 77, 0.06), var(--shadow-sm);
}

.req-ico {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.9rem;
  height: 2.9rem;
  border-radius: 14px;
  background: var(--brand-soft);
  color: var(--brand);
}

.req-ico.amber {
  background: var(--amber-soft);
  color: var(--amber);
}

.req-ico.big {
  width: 3.4rem;
  height: 3.4rem;
  border-radius: 16px;
}

.req-ico.big .ico {
  width: 1.6rem;
  height: 1.6rem;
}

.req-main {
  display: grid;
  gap: 0.12rem;
  min-width: 0;
}

.req-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.95rem;
  font-weight: 700;
}

.req-body,
.req-reason {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.req-body {
  color: var(--ink-2);
  font-size: 0.86rem;
}

.req-reason {
  color: var(--muted);
  font-size: 0.8rem;
}

.req-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem 0.65rem;
  color: var(--muted);
  font-size: 0.74rem;
}

.req-meta > span {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.req-meta .ico {
  width: 0.85rem;
  height: 0.85rem;
}

.who {
  display: inline-block;
  padding: 0 0.4rem;
  border-radius: 6px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 700;
  line-height: 1.6;
}

.tag {
  display: inline-block;
  padding: 0 0.4rem;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.6;
}

.tag.given {
  background: var(--green-soft);
  color: #178048;
}

.tag.due {
  background: var(--orange-soft);
  color: #c26d00;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.28rem 0.6rem;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.pill .ico {
  width: 0.85rem;
  height: 0.85rem;
  stroke-width: 2.4;
}

.pill.red { background: var(--red-soft); color: #d23439; }
.pill.orange { background: var(--orange-soft); color: #c26d00; }
.pill.green { background: var(--green-soft); color: #178048; }
.pill.slate { background: var(--slate-soft); color: var(--slate); }
.pill.muted { background: #f1f3f7; color: #8a94a8; }

.empty {
  display: grid;
  justify-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding: 1.6rem 1rem;
  border: 1.5px dashed #d6deeb;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.6);
  color: var(--muted);
  text-align: center;
}

.empty .ico {
  width: 2rem;
  height: 2rem;
  color: #b3bfd3;
}

.empty .btn {
  width: auto;
  margin-top: 0.25rem;
}

.empty-line {
  margin: 0 0 1rem;
}

/* Person home */

.cta {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1rem;
  padding: 0.95rem 1rem;
  border-radius: 18px;
  background: var(--brand-grad);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 12px 26px rgba(31, 95, 214, 0.3);
}

.cta-ico {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.9rem;
  height: 2.9rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.18);
}

.cta-ico .ico {
  width: 1.5rem;
  height: 1.5rem;
  stroke-width: 2.4;
}

.cta-text {
  flex: 1;
  display: grid;
}

.cta-text b {
  font-size: 1.05rem;
}

.cta-text small {
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.82rem;
}

.attention {
  border-color: #f7d2d2;
  background: linear-gradient(180deg, #fff6f6, #fff 70%);
}

.attention .card-title {
  color: #c62f34;
}

.attention .card-title .ico {
  color: var(--red);
}

.attention .req-list {
  margin-bottom: 0;
}

.how {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.how li {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--ink-2);
  font-size: 0.88rem;
}

.how-ico {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 11px;
}

.how-ico .ico {
  width: 1.1rem;
  height: 1.1rem;
}

.how-ico.blue { background: var(--brand-soft); color: var(--brand); }
.how-ico.orange { background: var(--orange-soft); color: var(--orange); }
.how-ico.green { background: var(--green-soft); color: var(--green); }

/* Forms */

.stack {
  display: grid;
  gap: 0.85rem;
}

.stack.tight {
  gap: 0.6rem;
}

label {
  display: grid;
  gap: 0.35rem;
  color: var(--ink-2);
  font-size: 0.88rem;
  font-weight: 600;
}

input:not([type="checkbox"]):not([type="hidden"]),
select,
textarea {
  display: block;
  width: 100%;
  min-height: 3rem;
  margin: 0;
  padding: 0.7rem 0.9rem;
  border: 1px solid #dde3ee;
  border-radius: 13px;
  background-color: var(--field);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  font-weight: 500;
  -webkit-appearance: none;
  appearance: none;
}

select {
  padding-left: 2.4rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238390a6' stroke-width='2.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-position: left 0.8rem center;
  background-size: 1.05rem;
}

textarea {
  min-height: 6rem;
  resize: vertical;
  line-height: 1.6;
}

input:not([type="checkbox"]):focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #8fb0f3;
  background-color: #fff;
  box-shadow: 0 0 0 4px rgba(47, 111, 228, 0.12);
}

input::placeholder,
textarea::placeholder {
  color: #a3aec2;
}

.field {
  display: grid;
  gap: 0.4rem;
}

.field-cap {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--ink-2);
  font-size: 0.86rem;
  font-weight: 700;
}

.field-cap .ico {
  width: 1rem;
  height: 1rem;
  color: var(--brand);
}

.opt-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.amt-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  min-height: 2.9rem;
  padding: 0.5rem;
  border: 1.5px dashed #c8d4ea;
  border-radius: 13px;
  background: #f8faff;
  color: var(--ink-2);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.amt-toggle .ico {
  width: 1.1rem;
  height: 1.1rem;
  color: var(--brand);
}

.amt-toggle.on {
  border-style: solid;
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
}

.when-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.5rem;
  min-width: 0;
}

.when-box {
  position: relative;
  display: block;
  min-width: 0;
  min-height: 3.3rem;
  padding: 0.4rem 0.85rem 0.45rem;
  border: 1px solid #dde3ee;
  border-radius: 13px;
  background: var(--field);
  overflow: hidden;
  cursor: pointer;
}

.when-box:focus-within {
  border-color: #8fb0f3;
  box-shadow: 0 0 0 4px rgba(47, 111, 228, 0.12);
}

.when-cap {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 600;
}

.when-show {
  display: block;
  color: var(--ink);
  font-size: 0.98rem;
  font-weight: 700;
}

.when-box input.when-hit,
.when-box input.when-hit:focus {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-width: 100%;
  max-width: none;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0.02;
  background: transparent;
  color: transparent;
  font-size: 16px;
  box-shadow: none;
}

.compose {
  display: grid;
  gap: 0.65rem;
  padding: 0.85rem;
  border: 1px dashed #cdd8ec;
  border-radius: 14px;
  background: #f7f9fd;
}

.grid-acts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.grid-acts .span2,
.grid-acts > .btn:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.grid-acts .btn {
  min-height: 2.8rem;
  font-size: 0.9rem;
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  min-height: 3rem;
  padding: 0.65rem 1rem;
  border: 0;
  border-radius: 14px;
  background: var(--brand-grad);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(31, 95, 214, 0.24);
  -webkit-appearance: none;
  appearance: none;
}

.btn .ico {
  width: 1.15rem;
  height: 1.15rem;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.45;
  cursor: default;
  box-shadow: none;
}

.btn.big {
  min-height: 3.4rem;
  border-radius: 16px;
  font-size: 1.02rem;
}

.btn.small {
  min-height: 2.6rem;
  padding: 0.5rem 0.6rem;
  border-radius: 12px;
  font-size: 0.84rem;
}

.btn.ok {
  background: linear-gradient(150deg, #2bb36b, #178a4e);
  box-shadow: 0 8px 18px rgba(31, 157, 90, 0.24);
}

.btn.clay {
  background: linear-gradient(150deg, #f05a5f, #d1363b);
  box-shadow: 0 8px 18px rgba(229, 72, 77, 0.22);
}

.btn.ghost {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.btn.ghost.on {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
}

.btn.danger {
  border: 1px solid #f5cfd0;
  background: var(--card);
  color: #d23439;
  box-shadow: none;
}

.out {
  display: grid;
  gap: 0.6rem;
  margin: 0.25rem 0 1rem;
}

.row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.row3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
}

.row3 form {
  display: contents;
}

/* Messages */

.flash {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0 0 1rem;
  padding: 0.75rem 0.9rem;
  border-radius: 14px;
  font-size: 0.9rem;
  font-weight: 700;
}

.flash .ico {
  margin-top: 0.1rem;
}

.flash.ok {
  border: 1px solid #cdeedb;
  background: var(--green-soft);
  color: #136a3c;
}

.flash.err {
  border: 1px solid #f7d4d5;
  background: var(--red-soft);
  color: #b42328;
}

.note {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0 0 1rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid #fbe2bd;
  border-radius: 14px;
  background: var(--orange-soft);
  color: #8a5300;
  font-size: 0.88rem;
  font-weight: 600;
}

.note .ico {
  margin-top: 0.1rem;
}

.note.soft {
  border-color: #e1e9f8;
  background: #f5f8fe;
  color: var(--ink-2);
  font-weight: 500;
}

.card .note:last-child {
  margin-bottom: 0;
}

.verdict {
  display: inline-flex;
  align-items: center;
  margin-top: 0.85rem;
  padding: 0.35rem 0.85rem;
  border-radius: 99px;
  background: var(--slate-soft);
  color: var(--slate);
  font-size: 0.85rem;
  font-weight: 700;
}

.verdict.ok { background: var(--green-soft); color: #178048; }
.verdict.bad { background: var(--red-soft); color: #c62f34; }
.verdict.muted { background: #f1f3f7; color: #77839a; }
.verdict.wait { background: var(--orange-soft); color: #c26d00; }

/* Request page */

.ask-top {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
}

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

.ask-title {
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.ask-top .meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.2rem;
}

.ask-state {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.85rem;
}

.tracker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 0 1rem;
  padding: 1rem 0.4rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  list-style: none;
  box-shadow: var(--shadow-sm);
}

.tracker li {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
}

.tracker li::before {
  content: "";
  position: absolute;
  top: 1.05rem;
  left: 50%;
  width: 100%;
  height: 3px;
  border-radius: 3px;
  background: var(--line);
}

.tracker li:first-child::before {
  display: none;
}

.tracker .step {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  background: var(--slate-soft);
  color: #9aa5b8;
  box-shadow: 0 0 0 4px var(--card);
}

.tracker .step .ico {
  width: 1.05rem;
  height: 1.05rem;
  stroke-width: 2.4;
}

.tracker small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 500;
}

.tracker li.done,
.tracker li.now {
  color: var(--ink);
}

.tracker li.done .step {
  background: var(--green);
  color: #fff;
}

.tracker li.done::before,
.tracker li.now::before {
  background: var(--green);
}

.tracker li.done.bad .step { background: var(--red); }
.tracker li.done.muted .step { background: #a5afc0; }
.tracker li.done.muted::before { background: #cfd6e2; }
.tracker li.now.red .step { background: var(--red); color: #fff; box-shadow: 0 0 0 4px var(--card), 0 0 0 7px rgba(229, 72, 77, 0.16); }
.tracker li.now.orange .step { background: var(--orange); color: #fff; box-shadow: 0 0 0 4px var(--card), 0 0 0 7px rgba(233, 138, 21, 0.18); }
.tracker li.skip .step { color: #c0c8d6; }

.facts {
  display: grid;
  margin: 0;
}

.facts > div {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr);
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--line);
}

.facts > div:first-child {
  padding-top: 0;
}

.facts > div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.facts dt {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
}

.facts dd {
  margin: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.talk {
  display: grid;
  gap: 0.55rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.talk li {
  max-width: 86%;
  padding: 0.55rem 0.8rem;
  border-radius: 16px;
  font-size: 0.9rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.talk li b {
  display: block;
  margin-bottom: 0.1rem;
  font-size: 0.72rem;
  font-weight: 700;
  opacity: 0.78;
}

.talk li.theirs {
  justify-self: start;
  background: var(--slate-soft);
  color: var(--ink);
  border-start-start-radius: 6px;
}

.talk li.mine {
  justify-self: end;
  background: var(--brand-grad);
  color: #fff;
  border-start-end-radius: 6px;
}

.act-card.need {
  border-color: #f7cfcf;
  background: linear-gradient(180deg, #fff7f7, #fff 60%);
}

.act-card.need .card-title .ico {
  color: var(--red);
}

.act-card .lead {
  margin-bottom: 0.85rem;
  color: var(--ink);
  font-weight: 600;
}

/* Give */

.total-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.total-card .stat-ico {
  width: 3rem;
  height: 3rem;
  border-radius: 14px;
  background: var(--green-soft);
  color: var(--green);
}

.big-num {
  display: block;
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.2;
}

.give-cards,
.people {
  margin: 0;
  padding: 0;
  list-style: none;
}

.give-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.9rem;
  height: 2.9rem;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
  overflow: hidden;
}

.avatar .ico {
  width: 1.4rem;
  height: 1.4rem;
}

.avatar.big {
  width: 3.6rem;
  height: 3.6rem;
  font-size: 1rem;
}

.give-who {
  flex: 1;
  min-width: 0;
  display: grid;
}

.give-sum {
  text-align: left;
}

.give-amt {
  display: block;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.2;
}

.give-sum .status {
  color: #c26d00;
  font-size: 0.74rem;
  font-weight: 700;
}

.give-sum .status.zero {
  color: var(--muted);
}

.give-card form {
  grid-template-columns: minmax(0, 1fr);
  margin-top: 0.75rem;
}

.give-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.give-list .check span {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.give-each {
  flex: none;
  padding: 0.1rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--card);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
}

.given-log {
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--line);
}

.given-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 0.5rem;
  color: #178048;
  font-size: 0.88rem;
  font-weight: 700;
}

.given-title .ico {
  width: 1.15rem;
  height: 1.15rem;
}

.given-log > ul {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.given-log details {
  border-radius: 12px;
  background: var(--green-soft);
}

.given-log summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.7rem;
  list-style: none;
  cursor: pointer;
}

.given-log summary::-webkit-details-marker {
  display: none;
}

.given-log summary b {
  flex: none;
  color: #178048;
  font-size: 0.9rem;
  white-space: nowrap;
}

.given-log summary .meta {
  flex: 1;
  min-width: 0;
}

.given-log summary .ico {
  flex: none;
  width: 1.1rem;
  height: 1.1rem;
  color: var(--muted);
  transition: transform 0.2s;
}

.given-log details[open] summary .ico {
  transform: rotate(180deg);
}

.given-rows {
  display: grid;
  gap: 0.3rem;
  margin: 0;
  padding: 0 0.7rem 0.6rem;
  list-style: none;
}

.given-rows li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  color: var(--ink-2);
  font-size: 0.84rem;
}

.given-rows span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.given-rows b {
  flex: none;
  white-space: nowrap;
}

.given-more {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  margin-top: 0.55rem;
  color: var(--brand);
  font-size: 0.84rem;
  font-weight: 700;
  text-decoration: none;
}

.given-more .ico {
  width: 1rem;
  height: 1rem;
}

.give-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--field);
}

.check {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 600;
}

.check span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.check input {
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  margin: 0;
  accent-color: var(--brand);
}

/* People */

.person-top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--ink);
  text-decoration: none;
}

.person-main {
  flex: 1;
  min-width: 0;
  display: grid;
}

.person-main b {
  font-size: 1rem;
}

.person-main .meta {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.mini-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
  margin: 0.85rem 0;
}

.mini-stats div {
  display: grid;
  justify-items: center;
  padding: 0.5rem 0.3rem;
  border-radius: 12px;
  background: var(--field);
}

.mini-stats b {
  font-size: 1rem;
}

.mini-stats span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.profile-card b {
  font-size: 1.05rem;
}

.stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.stats > div {
  display: grid;
  justify-items: center;
  gap: 0.1rem;
  padding: 0.6rem 0.2rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.stats b {
  font-size: 1.1rem;
}

.stats span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.3;
}

.stats .blue b { color: var(--brand); }
.stats .green b { color: var(--green); }
.stats .slate b { color: var(--slate); }
.stats .muted b { color: #98a2b5; }
.stats .orange b { color: var(--orange); }

.stats .spent {
  grid-column: 1 / -1;
  justify-items: start;
  padding: 0.85rem 1rem;
  border: 0;
  background: var(--brand-grad);
  text-align: start;
}

.stats .spent b {
  color: #fff;
  font-size: 1.5rem;
}

.stats .spent span {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.8rem;
}

.filter-card {
  padding: 0;
}

.filter-card summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  font-weight: 700;
  list-style: none;
  cursor: pointer;
}

.filter-card summary::-webkit-details-marker {
  display: none;
}

.filter-card summary .ico:first-child {
  color: var(--brand);
}

.filter-card summary .ico:last-child {
  margin-inline-start: auto;
  color: var(--muted);
  transition: transform 0.2s;
}

.filter-card[open] summary .ico:last-child {
  transform: rotate(180deg);
}

.filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.7rem;
  padding: 0 1rem 1rem;
}

.filters .wide,
.filter-acts {
  grid-column: 1 / -1;
}

.filter-acts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.check-list {
  display: grid;
  gap: 0.5rem;
  margin: 0 0 0.85rem;
  padding: 0;
  list-style: none;
}

.check-list:last-child {
  margin-bottom: 0;
}

.check-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.check-list li.ok .ico { color: var(--green); }
.check-list li.bad .ico { color: var(--red); }

/* Login, install, offline */

.auth {
  display: flex;
  flex-direction: column;
  padding: 8vh 0.25rem 1rem;
}

.auth-brand {
  margin-bottom: 1.25rem;
  text-align: center;
}

.auth-brand h1 {
  font-size: 1.6rem;
}

.auth-brand p {
  margin-top: 0.3rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.install {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

.install-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--ink-2);
  font-size: 0.9rem;
}

.install-ico {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand);
}

.ios-hint {
  color: var(--muted);
  font-size: 0.82rem;
}

/* Export (normal page scroll + print) */

html.page-free,
html.page-free body {
  position: static;
  height: auto;
  min-height: 100%;
  overflow: visible;
  overscroll-behavior: auto;
}

.export-body {
  background: #fff;
  color: #111827;
}

.export {
  max-width: 48rem;
  margin: 0 auto;
  padding: 1.25rem 1rem 2.5rem;
}

.export header {
  margin-bottom: 1rem;
}

.export h1 {
  margin: 0.2rem 0;
  font-size: 1.5rem;
}

.export header p {
  color: var(--ink-2);
  font-size: 0.9rem;
}

.export .stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.export-ask {
  padding: 0.9rem 0;
  border-top: 1px solid #e5e7eb;
  break-inside: avoid;
}

.export-ask h2 {
  margin-bottom: 0.5rem;
  font-size: 1.02rem;
}

.events {
  display: grid;
  gap: 0.25rem;
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.85rem;
}

.events li {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr);
  gap: 0.5rem;
  padding: 0.3rem 0;
  border-bottom: 1px dashed #e5e7eb;
}

.events b {
  color: var(--ink-2);
}

@media print {
  .no-print {
    display: none !important;
  }

  html,
  body {
    background: #fff;
  }

  .export {
    max-width: none;
    padding: 0;
  }

  .stats > div {
    box-shadow: none;
  }

  .stats .spent {
    border: 1px solid #ccc;
    background: #fff;
  }

  .stats .spent b,
  .stats .spent span {
    color: #111;
  }
}

@media (max-width: 370px) {
  main {
    padding-left: 0.8rem;
    padding-right: 0.8rem;
  }

  .chips {
    margin-left: -0.8rem;
    margin-right: -0.8rem;
    padding-left: 0.8rem;
    padding-right: 0.8rem;
  }

  .stat-grid,
  .tiles,
  .segs {
    gap: 0.35rem;
  }

  .stat b {
    font-size: 1rem;
  }

  .stat-label {
    font-size: 0.64rem;
  }

  .tile {
    font-size: 0.64rem;
  }

  .seg span {
    font-size: 0.62rem;
  }

  .stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hero-text {
    max-width: 72%;
  }

  .tabbar-item {
    font-size: 0.62rem;
  }
}

@media (min-width: 34.5rem) {
  html,
  body {
    background: #e9edf5;
  }

  .sheet {
    box-shadow: 0 0 0 1px var(--line), 0 20px 60px rgba(15, 29, 58, 0.08);
  }
}
