/* Phone app (PWA) - نقابة المحامين في طرابلس (2026-11-03). App design (not the website design). */
:root {
  --ink: #3b302b; --ink-2: #4e413b; --ink-3: #655856;
  --gold: #a87b4f; --gold-d: #8f6740; --gold-l: #f0ce90;
  --cream: #fbf1dc; --paper: #fbf6ea; --line: #ece1cc; --cedar: #485850;
  --text: #2e2724; --muted: #7a6d63; --white: #fff;
  --bar-h: 58px; --tabs-h: 64px;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; background: var(--paper); color: var(--text); }
body { font-family: 'Tajawal', Tahoma, Arial, sans-serif; font-size: 16px; line-height: 1.6; overscroll-behavior-y: contain; -webkit-text-size-adjust: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
img { max-width: 100%; display: block; }
svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }

/* ---------- top bar ---------- */
.bar { position: fixed; top: 0; right: 0; left: 0; z-index: 20; height: calc(var(--bar-h) + var(--safe-t)); padding: var(--safe-t) 10px 0;
  display: flex; align-items: center; gap: 6px; color: #fff; background: linear-gradient(120deg, var(--ink), var(--ink-2)); box-shadow: 0 2px 12px rgba(0,0,0,.18); }
.brand { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; padding-inline-start: 4px; }
.brand img { width: 34px; height: 34px; border-radius: 8px; background: var(--cream); }
.brand span { display: flex; flex-direction: column; line-height: 1.15; }
.brand b { font-family: 'Amiri', serif; font-size: 19px; }
.brand small { font-size: 11.5px; color: var(--gold-l); }
.bar-title { flex: 1; margin: 0; font-size: 17px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-btn { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; position: relative; color: #fff; flex: none; }
.bar-btn:active { background: rgba(255,255,255,.14); }
.bar-btn .dot { position: absolute; top: 9px; left: 10px; width: 9px; height: 9px; border-radius: 50%; background: var(--gold-l); box-shadow: 0 0 0 2px var(--ink); }
.offline { position: fixed; top: calc(var(--bar-h) + var(--safe-t)); right: 0; left: 0; z-index: 19; background: var(--gold-d); color: #fff; font-size: 12.5px; text-align: center; padding: 4px 8px; }

/* ---------- content ---------- */
.view { padding: calc(var(--bar-h) + var(--safe-t) + 14px) 14px calc(var(--tabs-h) + var(--safe-b) + 22px); min-height: 100vh; outline: none; max-width: 760px; margin: 0 auto; }
.h { font-family: 'Amiri', serif; font-size: 25px; color: var(--ink); margin: 6px 2px 12px; line-height: 1.3; }
.sub { color: var(--muted); font-size: 14px; margin: -6px 2px 14px; }

/* chips / segmented */
.chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 -14px 14px; padding: 2px 14px 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 7px 15px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-size: 14px; font-weight: 700; color: var(--ink-2); }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: #efe5d2; border-radius: 12px; padding: 4px; margin-bottom: 14px; }
.seg button { padding: 9px 6px; border-radius: 9px; font-weight: 700; font-size: 14.5px; color: var(--ink-2); }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(59,48,43,.15); }

/* news */
.feat { display: block; position: relative; border-radius: 16px; overflow: hidden; background: var(--ink-2); margin-bottom: 14px; box-shadow: 0 8px 22px rgba(59,48,43,.18); aspect-ratio: 16 / 10; }
.feat img { width: 100%; height: 100%; object-fit: cover; }
.feat .cap { position: absolute; inset: auto 0 0 0; padding: 40px 16px 14px; background: linear-gradient(transparent, rgba(30,22,18,.88)); color: #fff; }
.feat .cap b { display: block; font-size: 18.5px; line-height: 1.45; }
.feat .cap .tag { background: var(--gold); color: #fff; }
.feat.noimg { aspect-ratio: auto; background: linear-gradient(120deg, var(--ink), var(--ink-3)); }
.feat.noimg .cap { position: static; background: none; padding: 22px 16px; }
.tag { display: inline-block; font-size: 11.5px; font-weight: 800; padding: 2px 9px; border-radius: 999px; background: var(--cream); color: var(--gold-d); margin-bottom: 6px; }
.meta { font-size: 12.5px; color: var(--muted); }
.feat .meta { color: #e9dcc3; }
.card { display: flex; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px; margin-bottom: 10px; align-items: flex-start; }
.card:active, .doc:active, .law:active { background: #fffaf0; }
.card .th { width: 104px; height: 78px; flex: none; border-radius: 10px; overflow: hidden; background: var(--cream) url(/app/icons/icon-192.png) center / 46px no-repeat; }
.card .th img { width: 100%; height: 100%; object-fit: cover; }
.card .tx { flex: 1; min-width: 0; }
.card b { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: 15.5px; line-height: 1.5; color: var(--ink); }
.more { display: block; width: 100%; margin: 6px 0 4px; padding: 13px; border-radius: 12px; background: #fff; border: 1px solid var(--line); font-weight: 800; color: var(--gold-d); }

/* docs */
.doc { display: flex; gap: 12px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 13px 12px; margin-bottom: 9px; }
.doc .ic { width: 42px; height: 42px; border-radius: 11px; flex: none; display: grid; place-items: center; background: var(--cream); color: var(--gold-d); }
.doc b { display: block; font-size: 15px; line-height: 1.5; color: var(--ink); }
.doc .chev { margin-inline-start: auto; color: #c9b9a1; flex: none; }
.chev svg { width: 18px; height: 18px; transform: scaleX(-1); }

/* article */
.art-img { margin: -14px -14px 14px; aspect-ratio: 16 / 10; background: var(--cream); overflow: hidden; }
.art-img img { width: 100%; height: 100%; object-fit: cover; }
.art h2 { font-family: 'Amiri', serif; font-size: 25px; line-height: 1.45; margin: 4px 0 6px; color: var(--ink); }
.art .body { font-size: 17px; line-height: 1.95; margin-top: 16px; overflow-wrap: anywhere; }
.art .body img { height: auto !important; border-radius: 10px; margin: 10px auto; }
.art .body table { width: 100% !important; border-collapse: collapse; font-size: 14px; display: block; overflow-x: auto; }
.art .body td, .art .body th { border: 1px solid var(--line); padding: 6px; }
.art .body a { color: var(--gold-d); text-decoration: underline; }
.art .body iframe { width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; border-radius: 10px; }
.art-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 22px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 16px; border-radius: 12px; font-weight: 800; font-size: 15px; }
.btn svg { width: 20px; height: 20px; }
.btn-gold { background: var(--gold); color: #fff; }
.btn-ink { background: var(--ink); color: #fff; }
.btn-line { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn-block { display: flex; width: 100%; }

/* lawyers */
.search { position: sticky; top: calc(var(--bar-h) + var(--safe-t) + 8px); z-index: 5; display: flex; align-items: center; gap: 8px; background: #fff; border: 1.5px solid var(--line); border-radius: 14px; padding: 4px 12px; box-shadow: 0 6px 18px rgba(59,48,43,.10); margin-bottom: 14px; }
.search:focus-within { border-color: var(--gold); }
.search svg { color: var(--muted); flex: none; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; font: inherit; font-size: 16.5px; padding: 10px 0; background: transparent; color: var(--text); }
.search button { color: var(--muted); padding: 6px; }
.search input::-webkit-search-cancel-button, .search input::-webkit-search-decoration { -webkit-appearance: none; display: none; }
.law { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 13px 14px; margin-bottom: 10px; }
.law-h { display: flex; align-items: flex-start; gap: 10px; }
.law-h b { flex: 1; font-size: 16.5px; color: var(--ink); line-height: 1.45; }
.law .tag { margin: 0; flex: none; }
.phones { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.tel { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 10px; background: #f3f6f4; color: var(--cedar); font-weight: 800; font-size: 15px; direction: ltr; }
.tel svg { width: 17px; height: 17px; }
.tel small { font-weight: 500; color: var(--muted); font-size: 11.5px; direction: rtl; }
.law .link { display: inline-block; margin-top: 8px; font-size: 13px; color: var(--gold-d); font-weight: 700; }
.empty { text-align: center; color: var(--muted); padding: 34px 18px; }
.empty svg { width: 54px; height: 54px; color: #d6c7ae; margin: 0 auto 10px; display: block; stroke-width: 1.3; }

/* contact */
.hero { border-radius: 18px; padding: 22px 18px; color: #fff; background: linear-gradient(130deg, var(--ink), var(--ink-3)); display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.hero img { width: 64px; height: 64px; border-radius: 12px; background: var(--cream); flex: none; }
.hero b { font-family: 'Amiri', serif; font-size: 22px; display: block; line-height: 1.3; }
.hero small { color: var(--gold-l); }
.box { background: #fff; border: 1px solid var(--line); border-radius: 14px; margin-bottom: 12px; overflow: hidden; }
.box h3 { margin: 0; padding: 12px 14px 4px; font-size: 13px; color: var(--muted); font-weight: 700; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-top: 1px solid #f4ecdc; }
.box h3 + .row { border-top: 0; }
.row .ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--cream); color: var(--gold-d); flex: none; }
.row .ic svg { width: 20px; height: 20px; }
.row b { display: block; font-size: 15.5px; }
.row .num { direction: ltr; text-align: right; }
.row span { font-size: 13px; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }

/* notification prompt card */
.notif { display: flex; gap: 12px; align-items: center; background: #fff; border: 1px solid var(--line); border-right: 4px solid var(--gold); border-radius: 14px; padding: 12px; margin-bottom: 14px; }
.notif .ic { width: 40px; height: 40px; border-radius: 50%; background: var(--cream); color: var(--gold-d); display: grid; place-items: center; flex: none; }
.notif p { margin: 0; flex: 1; font-size: 14px; line-height: 1.5; }
.notif .btn { padding: 9px 14px; font-size: 14px; }

/* skeleton */
.sk { background: linear-gradient(90deg, #f1e8d7 25%, #f8f1e4 50%, #f1e8d7 75%); background-size: 200% 100%; animation: sk 1.2s infinite linear; border-radius: 12px; }
@keyframes sk { to { background-position: -200% 0; } }

/* ---------- bottom tabs ---------- */
.tabs { position: fixed; bottom: 0; right: 0; left: 0; z-index: 20; height: calc(var(--tabs-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  display: grid; grid-template-columns: repeat(4, 1fr); background: rgba(255,255,255,.97); border-top: 1px solid var(--line); box-shadow: 0 -4px 18px rgba(59,48,43,.08); backdrop-filter: blur(8px); }
.tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: #9a8c7e; font-size: 11.5px; font-weight: 700; position: relative; }
.tabs a svg { width: 25px; height: 25px; }
.tabs a.on { color: var(--ink); }
.tabs a.on::before { content: ""; position: absolute; top: 0; width: 34px; height: 3px; border-radius: 0 0 3px 3px; background: var(--gold); }

/* ---------- sheet / toast ---------- */
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(30,22,18,.45); }
.sheet { position: fixed; right: 0; left: 0; bottom: 0; z-index: 41; background: #fff; border-radius: 20px 20px 0 0; padding: 10px 18px calc(20px + var(--safe-b)); box-shadow: 0 -10px 30px rgba(0,0,0,.2); max-width: 560px; margin: 0 auto; animation: up .22s ease-out; }
@keyframes up { from { transform: translateY(100%); } }
.sheet .grip { width: 40px; height: 4px; border-radius: 4px; background: #ddd2c0; margin: 0 auto 14px; }
.sheet .head { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.sheet .head img { width: 56px; height: 56px; border-radius: 13px; background: var(--cream); }
.sheet h3 { margin: 0; font-size: 18px; color: var(--ink); }
.sheet p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.steps { list-style: none; margin: 8px 0 16px; padding: 0; counter-reset: s; }
.steps li { counter-increment: s; display: flex; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid #f2eadb; font-size: 15px; }
.steps li::before { content: counter(s); width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: #fff; font-weight: 800; display: grid; place-items: center; flex: none; font-size: 14px; }
.steps .ios-ic { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 7px; background: #f1f1f4; color: #0a7aff; vertical-align: middle; margin: 0 3px; }
.steps .ios-ic svg { width: 19px; height: 19px; }
.sheet .acts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sheet .acts.one { grid-template-columns: 1fr; }
.status { display: flex; align-items: center; gap: 8px; padding: 12px; border-radius: 12px; background: var(--paper); margin-bottom: 14px; font-size: 14.5px; font-weight: 700; }
.status i { width: 10px; height: 10px; border-radius: 50%; background: #c9b9a1; flex: none; }
.status.on i { background: #3c9a5f; }
.status.off i { background: #c2563f; }
.toast { position: fixed; z-index: 50; right: 16px; left: 16px; bottom: calc(var(--tabs-h) + var(--safe-b) + 14px); max-width: 480px; margin: 0 auto; background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 12px; font-size: 14.5px; text-align: center; box-shadow: 0 10px 24px rgba(0,0,0,.25); }

@media (min-width: 700px) {
  .card .th { width: 150px; height: 100px; }
  .art-img { margin: 0 0 16px; border-radius: 16px; }
}
@media (prefers-reduced-motion: reduce) { .sheet { animation: none; } .sk { animation: none; } }
