/* لوحة التشغيل: نفس الهوية والمتغيرات (tokens.css)، بتجربة عمل أكثف.
   الجوال: شريط سفلي ثابت. الكمبيوتر (من 1024px): شريط جانبي يمين الشاشة. الألوان كلها من tokens.css */
body.admin { font-size: 15px; background: var(--bg); min-height: 100dvh; overflow-x: hidden; }
.admin input:not([type]) { width: 100%; font: inherit; font-size: 16px; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: var(--r); background: var(--input-bg); color: var(--text); min-height: 48px; }
.admin input:not([type]):focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); outline: none; }
.admin input[type=text], .admin input[type=email], .admin input[type=date], .admin input[type=datetime-local], .admin input[type=search], .admin input[type=password], .admin select { min-height: 48px; padding-block: 10px; }
.admin textarea { min-height: 88px; }
.admin .field { margin-bottom: 14px; }
.admin label.lbl, .admin legend.lbl { font-size: 15px; margin-bottom: 6px; }
.admin .help { font-size: 14px; margin: 0 0 12px; }
.admin :focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.ic { width: 18px; height: 18px; flex: none; vertical-align: -3px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .02em; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.muted { color: var(--muted); }
.bad-text { color: var(--bad); }
.num { font-variant-numeric: tabular-nums; }
.btn-danger { background: var(--bad-bg); color: var(--bad); border: 1px solid var(--bad-line); }
.btn-danger:hover { color: var(--bad); filter: brightness(1.05); }
.btn-link.danger { color: var(--bad); }
.btn[aria-busy="true"] { cursor: progress; }

/* ===== الهيكل ===== */
.shell { min-height: 100dvh; }
.side { display: none; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: calc(env(safe-area-inset-top) + 8px) 14px 8px; background: var(--header-bg); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line-2); }
.top-brand { display: flex; align-items: center; gap: 10px; color: var(--heading); text-decoration: none; min-width: 0; }
.top-brand b { font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.view { padding: 0 14px calc(96px + env(safe-area-inset-bottom)); outline: none; }
.page { max-width: 1100px; margin-inline: auto; padding-top: 16px; min-width: 0; }

.bottom-nav { position: fixed; inset-inline: 0; bottom: 0; z-index: 30; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  background: var(--surface-solid); border-top: 1px solid var(--line); padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); box-shadow: 0 -8px 24px rgba(0, 0, 0, .12); }
.bottom-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 56px; min-width: 0; border-radius: 12px; color: var(--muted); text-decoration: none; font-size: 11.5px; font-weight: 600; }
.bottom-nav a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bottom-nav a .ic { width: 22px; height: 22px; }
.bottom-nav a[aria-current="page"] { color: var(--heading); background: var(--accent-soft); }
.bottom-nav a[aria-current="page"] .ic { color: var(--accent); }

@media (min-width: 1024px) {
  .shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); }
  .side { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 0; height: 100dvh; padding: 18px 14px; background: var(--surface-solid); border-inline-end: 1px solid var(--line); overflow-y: auto; grid-row: 1 / span 2; }
  .side-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--heading); padding: 4px 6px 12px; border-bottom: 1px solid var(--line-2); }
  .side-brand small { display: block; color: var(--muted); font-size: 12px; }
  #side-nav { display: grid; gap: 2px; }
  #side-nav a { display: flex; align-items: center; gap: 12px; min-height: var(--tap); padding: 0 12px; border-radius: 12px; color: var(--text); text-decoration: none; font-weight: 500; }
  #side-nav a:hover { background: var(--surface-2); }
  #side-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--heading); font-weight: 700; box-shadow: inset -3px 0 0 var(--accent); }
  #side-nav a[aria-current="page"] .ic { color: var(--accent); }
  .side-foot { margin-top: auto; display: grid; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line-2); }
  .who b { display: block; color: var(--heading); font-size: 14px; overflow-wrap: anywhere; }
  .who small { color: var(--muted); font-size: 12px; }
  .topbar { grid-column: 2; }
  .top-brand img { display: none; }
  .bottom-nav { display: none; }
  .view { grid-column: 2; padding: 0 28px 48px; }
}

/* ===== شاشة الدخول ===== */
.gate { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px calc(24px + env(safe-area-inset-bottom)); background: var(--hero-bg); }
.gate-card { width: min(480px, 100%); background: var(--surface-solid); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px 20px; box-shadow: var(--sh-2); }
.gate-card h1 { font-size: 24px; color: var(--heading); margin: 0 0 8px; }
.gate-card p { color: var(--text); }
.gate-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.gate-brand small { display: block; color: var(--muted); font-size: 13px; }
.gate-theme { margin-inline-start: auto; }
.gate-theme .seg span { display: none; }
.btn-block { width: 100%; }
.gate-card form .field { margin-bottom: 16px; }
.gate-card input:not([type=checkbox]) { width: 100%; }
.pass-wrap { position: relative; }
.pass-wrap input { padding-left: 52px !important; }
.pass-eye { position: absolute; left: 4px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted); }
.gate-links { margin: 14px 0 0; text-align: start; }
.gate-link { color: var(--accent); font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap); }
.gate-link:hover { text-decoration: underline; }
.gate-links .btn-link { text-decoration: none; color: var(--muted); font-size: 15px; padding: 0; min-height: var(--tap); }
.gate-h2 { font-size: 18px; color: var(--heading); margin: 22px 0 6px; padding-top: 16px; border-top: 1px solid var(--line-2); }
.gate details summary { cursor: pointer; color: var(--accent); font-weight: 600; min-height: var(--tap); display: flex; align-items: center; }
.steps-list { padding-inline-start: 20px; color: var(--text); }
.qr { width: 196px; margin: 12px auto; background: #fff; border-radius: 12px; padding: 8px; }
.qr svg { display: block; width: 100%; height: auto; }
.code-in { font-size: 24px !important; letter-spacing: .3em; text-align: center !important; }
.codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding-inline-start: 22px; font-size: 17px; }
.state-ic .ic { width: 40px; height: 40px; color: var(--accent); }

/* ===== عناوين الصفحات ===== */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.page-head h1 { font-size: clamp(22px, 5vw, 28px); color: var(--heading); margin: 0; line-height: 1.3; }
.page-head .sub { color: var(--muted); margin: 4px 0 0; font-size: 15px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.sec-title { font-size: 17px; color: var(--heading); margin: 24px 0 10px; display: flex; align-items: center; gap: 8px; }
.count { display: inline-grid; place-items: center; min-width: 26px; height: 24px; padding: 0 7px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 13px; font-weight: 700; }
.back { display: inline-flex; align-items: center; gap: 4px; min-height: var(--tap); color: var(--muted); text-decoration: none; font-size: 14px; }
.empty { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 24px 12px; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--r); }
.empty .ic { width: 28px; height: 28px; color: var(--muted-2); }
.empty p { margin: 0; }
.quiet { margin-top: 16px; }
.skeleton { display: grid; gap: 12px; }
.skeleton span { height: 76px; border-radius: var(--r); background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: sk 1.2s linear infinite; }
@keyframes sk { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton span { animation: none; } }

/* ===== الرئيسية: مؤشرات تفتح سجلاتها ===== */
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); }
.kpi { background: var(--surface-solid); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; border-inline-start: 4px solid var(--info-line); }
.kpi.tone-bad { border-inline-start-color: var(--bad); }
.kpi.tone-warn { border-inline-start-color: var(--warn); }
.kpi-head { display: flex; align-items: center; gap: 12px; padding: 14px; text-decoration: none; color: var(--text); min-height: 64px; }
.kpi-head:hover { background: var(--surface-2); }
.kpi-n { font-size: 30px; color: var(--heading); min-width: 44px; text-align: center; line-height: 1; }
.kpi-n .ic { width: 28px; height: 28px; color: var(--warn); }
.kpi-head > span { flex: 1; min-width: 0; }
.kpi-head b { display: block; color: var(--heading); }
.kpi-head small { color: var(--muted); font-size: 13px; }
.kpi-items { border-top: 1px solid var(--line-2); display: grid; }
.kpi-items > a, .kpi-items > span { display: flex; align-items: center; gap: 8px; padding: 10px 14px; min-height: var(--tap); text-decoration: none; color: var(--text); border-bottom: 1px solid var(--line-2); min-width: 0; flex-wrap: wrap; }
.kpi-items > a:hover { background: var(--surface-2); }
.kpi-items small { color: var(--muted); margin-inline-start: auto; }
.kpi-items span { min-width: 0; overflow-wrap: anywhere; }
.kpi-items .more { color: var(--accent); font-weight: 600; justify-content: center; }
.ref { font-weight: 700; color: var(--heading); white-space: nowrap; }

/* ===== التصفية: تتمرر داخلياً دون تمرير الصفحة ===== */
.filters { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 10px; scrollbar-width: thin; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.chip[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--heading); font-weight: 700; }
.chip .ic { width: 16px; height: 16px; }
.search { display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr) auto; margin-bottom: 14px; }
.search select { display: none; }
@media (min-width: 720px) { .search { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) auto; } .search select { display: block; } }

/* ===== بطاقات السجلات ===== */
.rlist { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); }
.rcard { display: grid; gap: 4px; align-content: start; padding: 14px; background: var(--surface-solid); border: 1px solid var(--line); border-radius: var(--r); color: var(--text); text-decoration: none; min-width: 0; transition: border-color var(--dur); }
a.rcard:hover { border-color: var(--accent-line); }
.rcard.late { border-inline-start: 4px solid var(--bad); }
.rcard.compact { padding: 10px 14px; }
.rcard-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rcard-title { color: var(--heading); font-size: 16px; overflow-wrap: anywhere; }
.rcard-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 14px; min-width: 0; overflow-wrap: anywhere; }
.rcard-meta .ic { width: 15px; height: 15px; color: var(--muted-2); }
.rcard details { margin-top: 4px; }
.rcard details summary, .panel details summary { cursor: pointer; color: var(--accent); font-weight: 600; min-height: 36px; display: flex; align-items: center; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; align-items: center; }
.body-text { white-space: pre-wrap; overflow-wrap: anywhere; margin: 4px 0; }
.flash { animation: flash 1.6s var(--ease); }
@keyframes flash { 0%, 40% { box-shadow: 0 0 0 3px var(--accent); } 100% { box-shadow: none; } }

.panel { background: var(--surface-solid); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin-bottom: 14px; min-width: 0; }
.panel h2 { font-size: 17px; color: var(--heading); margin: 0 0 12px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.panel h3 { font-size: 15px; color: var(--heading); margin: 16px 0 8px; }
.kvs { display: grid; grid-template-columns: minmax(110px, 30%) minmax(0, 1fr); gap: 8px 14px; margin: 0; }
.kvs dt { color: var(--muted); font-size: 14px; }
.kvs dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.kvs .qa { display: block; }
@media (max-width: 520px) { .kvs { grid-template-columns: 1fr; gap: 2px; } .kvs dt { margin-top: 8px; font-size: 13px; } }
.stats { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr)); margin-bottom: 14px; }
.stat { background: var(--surface-solid); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; display: grid; gap: 4px; min-width: 0; }
.stat small { color: var(--muted); display: flex; align-items: center; gap: 4px; }
.stat b { font-size: 22px; color: var(--heading); overflow-wrap: anywhere; }
.card-list { display: grid; gap: 4px; }
.group { margin-bottom: 12px; }
.group h3 { font-size: 15px; color: var(--heading); margin: 8px 0; }
.city-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; border-bottom: 1px solid var(--line-2); }
.toggle.strong { align-items: flex-start; padding: 12px; border: 1.5px solid var(--accent-line); border-radius: var(--r); background: var(--accent-soft); width: 100%; }
.toggle.strong small { display: block; font-weight: 400; color: var(--muted); font-size: 13px; }
.toggle span { min-width: 0; }
ul.plain { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
ul.plain li { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; }
li.voided { text-decoration: line-through; color: var(--muted); }
.linkbox { direction: ltr; font-family: ui-monospace, Menlo, monospace; background: var(--surface-2); border: 1px solid var(--line); padding: 10px; border-radius: 10px; overflow-wrap: anywhere; font-size: 13px; margin: 8px 0; user-select: all; }
.bars { display: grid; gap: 6px; }
.bar-row { display: grid; grid-template-columns: 72px minmax(0, 1fr) 40px; gap: 8px; align-items: center; }
.bar { display: block; height: 14px; min-inline-size: 4px; border-radius: 6px; background: var(--accent-grad); }
.more-list { display: grid; gap: 4px; margin-bottom: 16px; }
.more-list a { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 0 14px; background: var(--surface-solid); border: 1px solid var(--line); border-radius: var(--r); color: var(--text); text-decoration: none; font-weight: 600; }
.more-list a span { flex: 1; }
.grid-form { display: grid; gap: 0 12px; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); align-items: end; }
.grid-form .wide { grid-column: 1 / -1; }
.grid-form .check { margin-bottom: 14px; }

/* ===== صفحة الطلب ===== */
.req-head { background: var(--surface-solid); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; margin-bottom: 12px; }
.req-title h1 { font-size: clamp(20px, 5vw, 26px); color: var(--heading); margin: 0 0 8px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.req-title h1 span { font-size: 16px; color: var(--text); font-weight: 600; overflow-wrap: anywhere; }
.pills { display: flex; gap: 6px; flex-wrap: wrap; }
.hub { display: grid; gap: 10px; margin: 14px 0 4px; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); }
.hub > div { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; min-width: 0; }
.hub dt { color: var(--muted); font-size: 13px; display: flex; gap: 6px; align-items: center; }
.hub dd { margin: 2px 0 0; font-weight: 600; color: var(--heading); overflow-wrap: anywhere; }
.hub small { color: var(--muted); font-weight: 400; }
.tabs-seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); width: 100%; margin-bottom: 12px; border-radius: 14px; }
.tabs-seg a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px; padding: 4px; border-radius: 11px; color: var(--muted); text-decoration: none; font-size: 13px; text-align: center; min-width: 0; }
.tabs-seg a span { overflow-wrap: anywhere; line-height: 1.3; }
@media (min-width: 720px) { .tabs-seg a { flex-direction: row; gap: 6px; font-size: 14px; min-height: var(--tap); } }
.tabs-seg a[aria-selected="true"] { background: var(--accent-soft); color: var(--heading); font-weight: 700; }
.files { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.files li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.files li span { overflow-wrap: anywhere; min-width: 0; }

/* الملاحظات: الداخلية تختلف بصرياً عن الرسائل التي يراها صاحب العقار أو المكتب */
.notes { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
.note { border-radius: 12px; padding: 10px 12px; border: 1px solid var(--line); }
.note p { margin: 6px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.note-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 14px; }
.note.aud-internal { background: repeating-linear-gradient(-45deg, var(--surface-2) 0 10px, transparent 10px 20px); border-style: dashed; }
.note.aud-client { background: var(--info-bg); border-color: var(--info-line); }
.note.aud-office { background: var(--surface-2); border-inline-start: 4px solid var(--accent); }
.aud { display: grid; gap: 8px; }
.aud .choice span { min-height: 56px; }
.pick { display: grid; gap: 8px; max-height: 50vh; overflow-y: auto; }

.qitems { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 6px; }
.qitems li { display: grid; gap: 2px; padding-bottom: 6px; border-bottom: 1px solid var(--line-2); }
.qitems small { color: var(--muted); }
.mode { display: inline-flex; width: fit-content; font-size: 12.5px; font-weight: 700; padding: 1px 9px; border-radius: 999px; border: 1px solid; }

.progress-steps { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); }
.progress-steps li { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); color: var(--muted); font-size: 14px; min-width: 0; }
.progress-steps li.done { color: var(--heading); background: var(--ok-bg); }
.progress-steps li.done .ic { color: var(--ok); }
.progress-steps small { display: block; color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.contract.cancelled { opacity: .7; }

.offer-ed { border: 1px solid var(--line); border-radius: var(--r); padding: 0 12px; margin-bottom: 10px; background: var(--surface-2); }
.offer-ed > summary { min-height: 52px; display: flex; align-items: center; gap: 8px; cursor: pointer; }
.offer-ed[open] { padding-bottom: 12px; }
.items-ed { display: grid; gap: 8px; }
.item-ed { border: 1px dashed var(--line); border-radius: 12px; padding: 10px; background: var(--surface-solid); }
.preview-box { border: 2px dashed var(--line); border-radius: var(--r); padding: 12px; margin-top: 12px; }
.builder-start p { margin-top: 0; }

.timeline { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; border-inline-start: 2px solid var(--line); margin-inline-start: 6px; }
.timeline li { position: relative; padding: 10px 16px 10px 0; padding-inline-start: 16px; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; border-bottom: 1px solid var(--line-2); min-width: 0; }
.timeline li::before { content: ""; position: absolute; inset-inline-start: -7px; top: 16px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); border: 2px solid var(--bg); }
.timeline li.faint { opacity: .6; }
.timeline li.note { border-radius: 0; border-width: 0 0 1px; margin: 0; }
.timeline .t-at { color: var(--muted); font-size: 13px; flex-basis: 100%; }
.timeline .t-who { color: var(--muted); font-size: 13px; display: inline-flex; gap: 4px; align-items: center; }
.timeline .t-reason { flex-basis: 100%; color: var(--text); font-size: 14px; overflow-wrap: anywhere; }

/* ===== نافذة الحوار: ورقة سفلية على الجوال ===== */
.dlg { border: 0; padding: 0; background: transparent; color: var(--text); max-width: 100vw; max-height: 100dvh; width: 100%; margin: auto auto 0; }
.dlg::backdrop { background: rgba(5, 4, 16, .55); backdrop-filter: blur(2px); }
.dlg-in { background: var(--surface-solid); border: 1px solid var(--line); border-radius: 20px 20px 0 0; display: flex; flex-direction: column; max-height: 92dvh; padding-bottom: env(safe-area-inset-bottom); }
.dlg header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
.dlg h2 { font-size: 18px; margin: 0; color: var(--heading); }
.dlg-body { padding: 16px; overflow-y: auto; overscroll-behavior: contain; }
.dlg footer { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line-2); flex-wrap: wrap; }
.dlg footer .btn { flex: 1 1 140px; }
.dlg[open] .dlg-in { animation: up var(--dur-slow) var(--ease); }
@keyframes up { from { transform: translateY(24px); opacity: 0; } }
@media (min-width: 720px) {
  .dlg { width: min(560px, calc(100vw - 32px)); margin: auto; }
  .dlg.wide { width: min(760px, calc(100vw - 32px)); }
  .dlg-in { border-radius: var(--r-lg); max-height: 86dvh; }
}
.perm-sec { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 10px 0 0; }
.perm-sec legend { font-weight: 700; color: var(--heading); padding: 0 4px; display: flex; gap: 6px; align-items: center; }
.perm-acts { display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); }
.perm-acts .check { padding: 8px 10px; min-height: var(--tap); align-items: center; font-size: 14px; }
.perm-acts .check input { margin-top: 0; }

#toast { position: fixed; z-index: 60; inset-inline: 12px; bottom: calc(80px + env(safe-area-inset-bottom)); margin-inline: auto; max-width: 460px; display: flex; gap: 10px; align-items: center;
  background: var(--heading); color: var(--bg); padding: 12px 16px; border-radius: 14px; box-shadow: var(--sh-3); font-weight: 600; }
#toast.bad { background: var(--bad); color: #fff; }
[data-theme="light"] #toast.bad { color: #fff; }
@media (min-width: 1024px) { #toast { bottom: 24px; inset-inline-start: auto; inset-inline-end: 24px; margin: 0; } }
.demo-bar { position: relative; z-index: 40; }
