/* app-theme.css: المظهر: القائمة الجانبية والأزرار والجداول وتخطيط الهاتف. الملفات تُحمَّل بالترتيب: app.css, app-theme.css, app-motion.css, app-deeds.css, app-extras.css, app-lit.css, app-petitions.css */
/* ===== Theme proposal: calm, professional (Linear / Stripe-style dashboards, law-firm navy + muted gold) ===== */
:root {
  --bg: #f7f6f3;
  --panel: #fff;
  --ink: #18202e;
  --mute: #737985;
  --line: #ece9e3;
  --acc: #1d3b5e;
  --acc2: #eef2f7;
  --gold: #a8844f;
  --danger: #b4232a;
  --ok: #1f7a4d;
  --warn: #a85d0b;
  --onacc: #fff;
  --side: #13223a;
  --sideink: #c9d2df;
  --shadow: 0 1px 2px rgba(20, 28, 40, 0.04), 0 4px 14px rgba(20, 28, 40, 0.04);
  --r: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e131a;
    --panel: #151b24;
    --ink: #e7eaef;
    --mute: #939ba7;
    --line: #232b37;
    --acc: #8db4e2;
    --acc2: #1a2534;
    --gold: #cfae7a;
    --danger: #f08a80;
    --ok: #5fd19a;
    --warn: #f2b45a;
    --onacc: #0e131a;
    --side: #0b1017;
    --sideink: #9aa6b6;
    --shadow: none;
  }
}
body {
  font-size: 14px;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}
.app {
  grid-template-columns: 248px 1fr;
}

/* sidebar */
nav.side {
  background: var(--side);
  border-left: 0;
  padding: 22px 14px;
}
.brand {
  color: #fff;
  font-size: 15.5px;
  padding: 2px 12px 22px;
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 1.35;
}
.brand::before {
  content: "";
  flex: none;
  width: 32px;
  height: 32px;
  background: no-repeat center/contain;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cg fill='%23c9a24a'%3E%3Cg transform='translate(50 16) scale(.75)'%3E%3Ccircle r='9.5'/%3E%3Crect x='-1.6' y='-19' width='3.2' height='6' rx='1.6' transform='rotate(0)'/%3E%3Crect x='-1.6' y='-19' width='3.2' height='6' rx='1.6' transform='rotate(45)'/%3E%3Crect x='-1.6' y='-19' width='3.2' height='6' rx='1.6' transform='rotate(90)'/%3E%3Crect x='-1.6' y='-19' width='3.2' height='6' rx='1.6' transform='rotate(135)'/%3E%3Crect x='-1.6' y='-19' width='3.2' height='6' rx='1.6' transform='rotate(180)'/%3E%3Crect x='-1.6' y='-19' width='3.2' height='6' rx='1.6' transform='rotate(225)'/%3E%3Crect x='-1.6' y='-19' width='3.2' height='6' rx='1.6' transform='rotate(270)'/%3E%3Crect x='-1.6' y='-19' width='3.2' height='6' rx='1.6' transform='rotate(315)'/%3E%3C/g%3E%3Crect x='47.5' y='30' width='5' height='22'/%3E%3Crect x='10' y='30' width='80' height='4.5' rx='2.2'/%3E%3Cpath d='M5 50h18a9 9 0 0 1-18 0zM77 50h18a9 9 0 0 1-18 0z'/%3E%3Crect x='40' y='52' width='20' height='10' rx='1.5'/%3E%3Crect x='30' y='64' width='40' height='11' rx='1.5'/%3E%3Crect x='20' y='77' width='60' height='12' rx='1.5'/%3E%3C/g%3E%3Cpath d='M14 34l-8 16M14 34l8 16M86 34l-8 16M86 34l8 16' stroke='%23c9a24a' stroke-width='1.8' fill='none'/%3E%3C/svg%3E");
}
.side a {
  color: var(--sideink);
  padding: 9px 12px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 14px;
  margin-bottom: 3px;
}
.side a::before {
  content: "";
  width: 18px;
  height: 18px;
  flex: none;
  background: currentColor;
  opacity: 0.85;
  -webkit-mask: var(--ic) no-repeat center/contain;
  mask: var(--ic) no-repeat center/contain;
}
.side a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}
.side a.on {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-weight: 600;
  box-shadow: inset -3px 0 0 var(--gold);
}
.side .me {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
}
.side .me .mute {
  color: var(--sideink);
}
.side .me .btn {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--sideink);
}
:is(.side, .tabbar, .sheetnav) a[data-h="today"] {
  --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M6.3 17.7l-1.4 1.4M19.1 4.9l-1.4 1.4'/%3E%3C/svg%3E");
}
:is(.side, .tabbar, .sheetnav) a[data-h="current"] {
  --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='8' y='2' width='8' height='4' rx='1'/%3E%3Cpath d='M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2'/%3E%3Cpath d='m9 14 2 2 4-4'/%3E%3C/svg%3E");
}
:is(.side, .tabbar, .sheetnav) a[data-h="companies"],
:is(.side, .tabbar, .sheetnav) a[data-h="profile"] {
  --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z'/%3E%3Cpath d='M6 12H4a2 2 0 0 0-2 2v8h4M18 9h2a2 2 0 0 1 2 2v11h-4M10 6h4M10 10h4M10 14h4M10 18h4'/%3E%3C/svg%3E");
}
:is(.side, .tabbar, .sheetnav) a[data-h="calendar"] {
  --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3C/svg%3E");
}
:is(.side, .tabbar, .sheetnav) a[data-h="docs"] {
  --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z'/%3E%3Cpath d='M14 2v4a2 2 0 0 0 2 2h4M10 13H8M16 17H8'/%3E%3C/svg%3E");
}
:is(.side, .tabbar, .sheetnav) a[data-h="finance"],
:is(.side, .tabbar, .sheetnav) a[data-h="staffacct"],
:is(.side, .tabbar, .sheetnav) a[data-h="statement"] {
  --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='5' width='20' height='14' rx='2'/%3E%3Cpath d='M2 10h20M6 15h4'/%3E%3C/svg%3E");
}
:is(.side, .tabbar, .sheetnav) a[data-h="settings"] {
  --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M22 21v-2a4 4 0 0 0-3-3.87M16 3.13a4 4 0 0 1 0 7.75'/%3E%3C/svg%3E");
}

/* top bar */
.tb {
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  padding: 14px 32px;
}
.search input {
  background: var(--panel);
  border-color: var(--line);
  border-radius: 10px;
  padding: 9px 14px;
  box-shadow: var(--shadow);
}
.tb .btn {
  background: transparent;
  border-color: transparent;
  color: var(--mute);
}
.tb .btn:hover {
  background: var(--panel);
  border-color: var(--line);
  color: var(--ink);
}
main {
  padding: 12px 32px 72px;
  max-width: 1320px;
}

/* type */
h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.2px;
}
h4 {
  font-size: 14.5px;
  font-weight: 600;
}
.mute {
  color: var(--mute);
}
.top {
  margin-bottom: 22px;
  align-items: center;
}
.crumbs {
  margin-bottom: 6px;
  font-size: 12.5px;
}
.crumbs a {
  color: var(--mute);
}
.crumbs:has(.pback) {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.pback {
  flex: none;
}
.crumbs a:hover {
  color: var(--acc);
}

/* buttons: quieter secondary, solid primary */
.btn {
  height: 36px;
  padding: 0 14px;
  border-radius: 9px;
  border-color: var(--line);
  background: var(--panel);
  font-weight: 500;
  transition:
    background 0.15s,
    border-color 0.15s;
}
.btn:hover {
  border-color: color-mix(in srgb, var(--acc) 35%, var(--line));
  background: var(--acc2);
}
.btn.pri {
  background: var(--acc);
  border-color: var(--acc);
  box-shadow: 0 1px 2px rgba(20, 28, 40, 0.15);
}
.btn.pri:hover {
  background: color-mix(in srgb, var(--acc) 88%, #000);
}
.btn.sm {
  height: 30px;
  padding: 0 11px;
  font-size: 13px;
}
.btn.danger {
  border-color: transparent;
  background: transparent;
}
.btn.danger:hover {
  background: color-mix(in srgb, var(--danger) 8%, transparent);
}

/* surfaces */
.card,
details.sec,
.mrow,
.mc {
  border-color: var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
}
.card {
  padding: 20px;
}
details.sec > summary {
  padding: 15px 20px;
}
.secb {
  padding: 0 20px 20px;
}
.kpis {
  gap: 14px;
  margin-bottom: 22px;
}
.kpi .v {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-top: 6px;
}
.kpi > .mute:first-child {
  font-size: 12.5px;
  font-weight: 500;
}
.grid2 {
  gap: 18px;
}
.list li {
  padding: 11px 0;
}
.meta {
  background: transparent;
  border: 1px solid var(--line);
  padding: 14px 16px;
}
.meta > div > span.mute {
  font-size: 12px;
}

/* chips / badges: soft tints instead of outlines */
.chip {
  border: 0;
  background: color-mix(in srgb, var(--ink) 6%, transparent);
  padding: 2px 10px;
  font-weight: 500;
}
.chip.red {
  background: color-mix(in srgb, var(--danger) 10%, transparent);
}
.chip.orange {
  background: color-mix(in srgb, var(--warn) 11%, transparent);
}
.chip.green {
  background: color-mix(in srgb, var(--ok) 10%, transparent);
}
.badge {
  padding: 3px 11px;
}
.av {
  width: 30px;
  height: 30px;
  background: color-mix(in srgb, var(--acc) 14%, var(--panel));
  color: var(--acc);
  font-weight: 700;
}

/* matter rows */
.mlist {
  gap: 10px;
}
.mrow {
  padding: 15px 18px;
  transition:
    transform 0.12s,
    box-shadow 0.12s,
    border-color 0.12s;
}
.mrow:hover {
  border-color: color-mix(in srgb, var(--acc) 30%, var(--line));
  box-shadow: 0 6px 20px rgba(20, 28, 40, 0.07);
  transform: translateY(-1px);
}
.bar {
  height: 6px;
  background: color-mix(in srgb, var(--ink) 7%, transparent);
}
.bar i {
  background: linear-gradient(
    90deg,
    var(--acc),
    color-mix(in srgb, var(--acc) 70%, var(--gold))
  );
}

/* tabs & segmented controls */
.tabs {
  gap: 2px;
  border-bottom-color: var(--line);
  margin-bottom: 18px;
}
.tab {
  padding: 10px 14px;
  font-weight: 500;
}
.tab.on {
  border-color: var(--gold);
  color: var(--ink);
}
.seg {
  border-radius: 10px;
  background: color-mix(in srgb, var(--ink) 5%, transparent);
  border: 0;
  padding: 3px;
  gap: 2px;
}
.seg button,
.seg a.segl {
  border-radius: 8px;
  background: transparent;
  padding: 6px 14px;
}
.seg button.on,
.seg a.segl.on {
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(20, 28, 40, 0.12);
}

/* status bar */
.statusbar {
  gap: 32px;
}
.sbtn {
  border-radius: 9px;
  padding: 7px 18px;
}
.stg {
  padding: 6px 14px;
}

/* forms & dialogs */
.filters input,
.filters select,
.fl input,
.fl select,
.fl textarea,
.inl input,
.upl select,
.upl input[type="date"] {
  border-radius: 9px;
  padding: 8px 12px;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.fl input:focus,
.fl select:focus,
.fl textarea:focus,
.filters input:focus,
.inl input:focus,
.search input:focus {
  outline: 0;
  border-color: var(--acc);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--acc) 15%, transparent);
}
.ov {
  background: rgba(12, 18, 28, 0.38);
  backdrop-filter: blur(3px);
}
.dlg {
  border-radius: 18px;
  padding: 26px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
}
.dh h3 {
  font-size: 18px;
}
.catb {
  border-radius: 14px;
  transition:
    border-color 0.15s,
    background 0.15s,
    transform 0.12s;
}
.catb:hover {
  transform: translateY(-1px);
}

/* tables */
th {
  font-size: 12px;
  font-weight: 600;
  background: color-mix(in srgb, var(--ink) 3%, transparent);
}
th,
td {
  padding: 11px 12px;
}
tbody tr:hover td {
  background: color-mix(in srgb, var(--acc) 3%, transparent);
}

/* misc */
.fabb {
  background: var(--acc);
  box-shadow:
    0 8px 20px rgba(12, 18, 28, 0.22),
    0 2px 5px rgba(12, 18, 28, 0.14);
}
.hero {
  border-right-width: 3px;
}
.alert {
  border-radius: 10px;
}
.auth {
  margin-top: 12vh;
}
.auth form {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px;
  box-shadow: var(--shadow);
}
.toast {
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}
@media (max-width: 860px) {
  nav.side {
    padding: 8px 12px;
  }
  .side a::before {
    display: none;
  }
  main,
  .tb {
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* declutter helpers */
.kpi .v.zero {
  color: var(--mute) !important;
  font-weight: 500;
}
.calm {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px;
}
.calm b {
  display: block;
  font-size: 15px;
}
details.morem {
  position: relative;
}
details.morem > summary {
  list-style: none;
  cursor: pointer;
}
details.morem > summary::-webkit-details-marker {
  display: none;
}
details.morem > div {
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
  padding: 6px;
  display: flex;
  flex-direction: column;
  min-width: 210px;
  z-index: 25;
}
details.morem > div .btn {
  border: 0;
  background: none;
  justify-content: flex-start;
  width: 100%;
}
details.morem > div .btn:hover {
  background: var(--acc2);
}

/* ===== phone layout ===== */
.tabbar {
  display: none;
}
.sheetnav a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 12px;
  border-radius: 12px;
  color: var(--ink);
  font-size: 15px;
}
.sheetnav a::before {
  content: "";
  width: 20px;
  height: 20px;
  flex: none;
  background: var(--mute);
  -webkit-mask: var(--ic) no-repeat center/contain;
  mask: var(--ic) no-repeat center/contain;
}
.sheetnav a:active,
.sheetnav a.on {
  background: var(--acc2);
  color: var(--acc);
}
.sheetme {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--line);
  margin-top: 8px;
  padding: 14px 4px 2px;
}
@media (max-width: 860px) {
  .app {
    grid-template-columns: 1fr;
  }
  nav.side {
    display: none;
  }
  .tb {
    padding: 10px 14px;
    padding-top: calc(10px + env(safe-area-inset-top));
    gap: 10px;
    flex-wrap: nowrap;
    background: color-mix(in srgb, var(--bg) 92%, transparent);
  }
  .tb::before {
    content: "";
    flex: none;
    width: 36px;
    height: 36px;
    border-radius: 11px;
    background: var(--gold) no-repeat center/20px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m16 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z'/%3E%3Cpath d='m2 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z'/%3E%3Cpath d='M7 21h10'/%3E%3Cpath d='M12 3v18'/%3E%3Cpath d='M3 7h2c2 0 5-1 7-2 2 1 5 2 7 2h2'/%3E%3C/svg%3E");
  }
  .search {
    max-width: none;
  }
  .search input {
    padding: 8px 12px;
    height: 40px;
  }
  .bellw {
    margin: 0;
    position: static;
  }
  .bellw [data-act="palette"] {
    display: none;
  }
  .tb .bellw [data-act="bell"] {
    font-size: 0;
    width: 40px;
    height: 40px;
    padding: 0;
    justify-content: center;
    position: relative;
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--ink);
  }
  .bellw [data-act="bell"]::before {
    content: "";
    width: 20px;
    height: 20px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9'/%3E%3Cpath d='M10.3 21a1.94 1.94 0 0 0 3.4 0'/%3E%3C/svg%3E")
      no-repeat center/contain;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9'/%3E%3Cpath d='M10.3 21a1.94 1.94 0 0 0 3.4 0'/%3E%3C/svg%3E")
      no-repeat center/contain;
  }
  #bc {
    position: absolute;
    top: -5px;
    left: -5px;
    font-size: 11px;
    line-height: 18px;
    min-width: 18px;
    padding: 0 5px;
  }
  input,
  select,
  textarea {
    font-size: 16px !important;
  }
  main {
    padding: 6px 14px calc(100px + env(safe-area-inset-bottom));
  }
  h1 {
    font-size: 21px;
  }
  .top {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 16px;
  }
  .top > .row {
    /* Safari يمدّ الصف إلى عرض أزراره بدل عرض الشاشة فتنزاح الصفحة جانبياً: عرضه عرض الشاشة دائماً */
    min-width: 0;
    max-width: calc(100% + 28px);
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    margin: 0 -14px;
    padding: 2px 14px;
  }
  .top > .row::-webkit-scrollbar,
  .stages::-webkit-scrollbar,
  .filters::-webkit-scrollbar {
    display: none;
  }
  .top > .row > * {
    flex: none;
  }
  .top .btn {
    height: 38px;
  }
  details.morem > div {
    position: fixed;
    left: 12px;
    right: 12px;
    top: auto;
    bottom: calc(84px + env(safe-area-inset-bottom));
    z-index: 60;
    padding: 8px;
    border-radius: 16px;
  }
  details.morem > div .btn {
    height: 46px;
    font-size: 15px;
  }
  .kpis {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 16px;
  }
  .card.kpi {
    padding: 14px 16px;
  }
  .kpi .v {
    font-size: 24px;
    margin-top: 2px;
  }
  .card {
    padding: 16px;
    border-radius: 16px;
  }
  details.sec > summary {
    padding: 14px 16px;
  }
  .secb {
    padding: 0 16px 16px;
  }
  .grid2 {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .statusbar {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }
  .statusbar > *,
  .grid2 > *,
  .hero-g > * {
    min-width: 0;
  }
  .statusbar .row {
    flex-wrap: nowrap;
  }
  .sbtn {
    flex: 1;
    padding: 9px 4px;
  }
  .stages {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    margin: 0 -16px;
    padding: 0 16px;
  }
  .stg {
    flex: none;
    padding: 7px 14px;
  }
  .hero-g {
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }
  .mrow {
    grid-template-columns: 1fr auto;
    padding: 14px 16px;
  }
  .filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    margin: 0 -14px 12px;
    padding: 2px 14px;
  }
  .filters > * {
    flex: none;
  }
  .filters input[type="search"] {
    min-width: 210px;
  }
  .tabs {
    margin: 0 -14px 14px;
    padding: 0 14px;
  }
  .seg {
    max-width: 100%;
    overflow-x: auto;
  }
  .cmpg {
    grid-template-columns: 1fr;
  }
  .meta {
    grid-template-columns: 1fr 1fr;
  }
  .dgrid {
    grid-template-columns: 1fr;
  }
  .list li {
    padding: 12px 0;
  }
  .ov {
    padding: 0;
    align-items: flex-end;
  }
  .dlg,
  .dlg.wide {
    max-width: none;
    border-radius: 22px 22px 0 0;
    max-height: 92vh;
    overflow-y: auto;
    padding: 12px 16px calc(20px + env(safe-area-inset-bottom));
    animation: sheetup 0.22s ease-out;
  }
  .dlg::before {
    content: "";
    display: block;
    width: 42px;
    height: 5px;
    border-radius: 9px;
    background: var(--line);
    margin: 0 auto 12px;
  }
  .dlg .row.end {
    position: sticky;
    bottom: calc(-20px - env(safe-area-inset-bottom));
    background: var(--panel);
    padding: 10px 0 4px;
    margin-bottom: -4px;
  }
  .dlg .row.end .btn {
    flex: 1;
    height: 46px;
    justify-content: center;
  }
  .catg,
  .svcg {
    grid-template-columns: 1fr 1fr;
  }
  .fab {
    left: 16px;
    bottom: calc(86px + env(safe-area-inset-bottom));
  }
  .fabb {
    width: 54px;
    height: 54px;
  }
  .board {
    grid-template-columns: repeat(5, 84vw);
    scroll-snap-type: x mandatory;
  }
  .col {
    scroll-snap-align: start;
  }
  .cal > div {
    min-height: 62px;
    font-size: 10.5px;
  }
  .toast {
    bottom: calc(92px + env(safe-area-inset-bottom));
  }
  .bulk {
    bottom: calc(84px + env(safe-area-inset-bottom));
  }
  .tabbar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 45;
    background: color-mix(in srgb, var(--panel) 94%, transparent);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--line);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  }
  .tabbar a,
  .tabbar button {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 6px 2px;
    border: 0;
    background: none;
    color: var(--mute);
    font: inherit;
    font-size: 11px;
    line-height: 1.2;
    border-radius: 12px;
    cursor: pointer;
    white-space: nowrap;
  }
  .tabbar a::before,
  .tabbar button::before {
    content: "";
    width: 23px;
    height: 23px;
    background: currentColor;
    -webkit-mask: var(--ic) no-repeat center/contain;
    mask: var(--ic) no-repeat center/contain;
  }
  .tabbar .on {
    color: var(--acc);
    font-weight: 600;
  }
  .tabbar [data-act="moreNav"] {
    --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='7' height='7' rx='1.5'/%3E%3Crect x='14' y='3' width='7' height='7' rx='1.5'/%3E%3Crect x='3' y='14' width='7' height='7' rx='1.5'/%3E%3Crect x='14' y='14' width='7' height='7' rx='1.5'/%3E%3C/svg%3E");
  }
}
@keyframes sheetup {
  from {
    transform: translateY(40px);
    opacity: 0.5;
  }
}
#nmbox .nmrow {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
}
#nmbox select,
#nmbox input {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 9px;
  padding: 8px 10px;
  min-width: 0;
}
#nmbox .nmrow select,
#nmbox .nmrow input {
  flex: 1;
}
