/* Nikkah. Colours from the logo: deep green lettering, warm gold dome, cream ground. Mobile first. */
:root {
  --green: #022b1b; --green-2: #0b4a30; --green-l: #e6efe9;
  --gold: #c6983a; --gold-d: #8f6a1e; --gold-l: #f6ecd6;
  --cream: #fcf6ef; --card: #fffdf9; --ink: #1d2a22; --muted: #5d6a62; --line: #e8dcc8;
  --ok: #1d7a4c; --ok-l: #e3f3ea; --warn: #9a6a00; --warn-l: #fff4d9; --bad: #b3322f; --bad-l: #fbe9e8; --info-l: #eaf1f7;
  --r: 14px; --r-sm: 9px; --shadow: 0 1px 2px rgba(2, 43, 27, .05), 0 6px 22px rgba(2, 43, 27, .06);
  --font: 'Source Sans 3', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --serif: 'Cormorant Garamond', Georgia, serif; --caps: 'Cinzel', Georgia, serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 17px/1.6 var(--font); color: var(--ink); background: var(--cream); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--green-2); text-underline-offset: 2px; }
h1, h2, h3, h4 { font-family: var(--serif); color: var(--green); line-height: 1.15; margin: 0 0 .5em; font-weight: 700; font-variant-numeric: lining-nums; }
h1 { font-size: clamp(2.1rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.1rem); }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 760px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.tiny { font-size: .8rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--green); color: #fff; padding: 8px 12px; border-radius: 6px; z-index: 60; }
.skip:focus { left: 8px; }
.section { padding-top: 56px; padding-bottom: 56px; }
.band { background: #f6eee2; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.eyebrow { font-family: var(--caps); letter-spacing: .14em; text-transform: uppercase; color: var(--gold-d); font-size: .85rem; margin-bottom: .6em; }
.lead { font-size: 1.15rem; color: #34433a; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45em; border: 1px solid transparent; border-radius: 10px; padding: .65em 1.15em;
  font-weight: 600; cursor: pointer; text-decoration: none; line-height: 1.15; background: var(--card); color: var(--green); white-space: nowrap; }
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-2); }
.btn-gold { background: var(--gold); color: #1f1606; }
.btn-gold:hover { background: #b88a2f; }
.btn-ghost { background: transparent; border-color: #cdbd9f; color: var(--green); }
.btn-ghost:hover { background: #fff; }
.btn-danger { background: var(--bad); color: #fff; }
.btn-danger-ghost { background: transparent; border-color: #e3b5b3; color: var(--bad); }
.btn-sm { padding: .45em .8em; font-size: .92rem; }
.btn-lg { padding: .8em 1.4em; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.linkish { background: none; border: 0; padding: 0; color: var(--green-2); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; font-weight: 600; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* Header & footer */
.site-header { background: rgba(252, 246, 239, .96); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; backdrop-filter: blur(6px); }
.header-row { display: flex; align-items: center; gap: 12px; padding-top: 10px; padding-bottom: 10px; }
.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.brand img { width: 34px; height: 34px; }
.wordmark { font-family: var(--caps); font-weight: 700; font-size: 1.45rem; letter-spacing: .06em; color: var(--green); line-height: 1; }
.wordmark-sm { font-size: 1.2rem; margin-bottom: .3em; }
.top-nav { margin-left: auto; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.top-nav > a:not(.btn) { color: var(--green); text-decoration: none; font-weight: 600; padding: 6px 8px; display: none; }
.top-nav > a:not(.btn):hover { text-decoration: underline; }
@media (min-width: 760px) { .top-nav > a:not(.btn) { display: inline; } }
.site-footer { background: var(--green); color: #e5ece7; margin-top: 40px; padding-top: 36px; }
.site-footer a { color: #f3e3bf; }
.site-footer .wordmark { color: #fff; }
.footer-grid { display: grid; gap: 20px; }
.footer-grid nav { display: grid; gap: 6px; }
.footer-base { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; border-top: 1px solid rgba(255, 255, 255, .15); margin-top: 24px; padding-top: 14px; padding-bottom: 20px; color: #b9c8bf; }
@media (min-width: 760px) { .footer-grid { grid-template-columns: 1fr 2fr; } .footer-grid nav { grid-template-columns: 1fr 1fr; } }

/* Home */
.hero { background: radial-gradient(900px 420px at 80% 0%, #f8ead0, transparent 65%), var(--cream); border-bottom: 1px solid var(--line); }
.hero-grid { display: grid; gap: 28px; align-items: center; padding-top: 36px; padding-bottom: 40px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0 12px; }
.hero-art img { width: 100%; max-width: 520px; margin: 0 auto; mix-blend-mode: multiply; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1.05fr 1fr; padding-top: 56px; padding-bottom: 64px; } }
.cards-3 { display: grid; gap: 16px; margin-top: 20px; }
@media (min-width: 760px) { .cards-3 { grid-template-columns: repeat(3, 1fr); } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; box-shadow: var(--shadow); }
.feature h3 { color: var(--green); }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 14px; }
.steps li { counter-increment: s; position: relative; padding: 14px 16px 14px 60px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.steps li::before { content: counter(s); position: absolute; left: 16px; top: 14px; width: 30px; height: 30px; border-radius: 50%; background: var(--gold-l); color: var(--gold-d);
  font-family: var(--caps); font-weight: 700; display: grid; place-items: center; }

/* Prose pages (terms, privacy, conduct) */
.prose { padding-top: 36px; padding-bottom: 40px; }
.prose h2 { margin-top: 1.6em; font-size: 1.6rem; }
.prose h3 { margin-top: 1.2em; }
.prose li { margin-bottom: .4em; }
.prose table { width: 100%; border-collapse: collapse; margin: 1em 0; font-size: .95rem; background: var(--card); }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.prose th { background: #f6eee2; }
.notice { background: var(--gold-l); border: 1px solid #ead7a8; border-radius: var(--r-sm); padding: 12px 14px; }
.notice-info { background: var(--info-l); border-color: #cfdce8; }
.notice-ok { background: var(--ok-l); border-color: #bfe0cc; }
.notice-bad { background: var(--bad-l); border-color: #efc4c2; }
.ribbon { background: var(--gold-l); color: #5c4512; font-size: .85rem; text-align: center; padding: 6px 12px; border-bottom: 1px solid #ead7a8; }

/* Forms */
.fl { display: grid; gap: 5px; margin-bottom: 16px; }
.fl > span:first-child { font-weight: 600; color: var(--green); }
.fl .req::after { content: ' *'; color: var(--bad); }
.fl small, .help { color: var(--muted); font-size: .88rem; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=date], input[type=search], select, textarea {
  width: 100%; border: 1px solid #d7c9b0; background: #fff; border-radius: var(--r-sm); padding: .6em .75em; min-height: 44px; }
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--green-2); box-shadow: 0 0 0 3px rgba(11, 74, 48, .15); }
.has-err input, .has-err select, .has-err textarea, .has-err .choices { border-color: var(--bad); }
.err-text { color: var(--bad); font-size: .9rem; }
.choices { display: grid; gap: 6px; border: 1px solid transparent; border-radius: var(--r-sm); }
.choices.inline { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.choice { display: flex; align-items: flex-start; gap: 9px; padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; cursor: pointer; line-height: 1.35; }
.choice input { margin-top: .2em; accent-color: var(--green); width: 18px; height: 18px; flex: none; }
.choice:has(input:checked) { border-color: var(--green-2); background: var(--green-l); }
.check { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; line-height: 1.45; }
.check input { margin-top: .25em; accent-color: var(--green); width: 18px; height: 18px; flex: none; }
.form-msg { margin: 10px 0; min-height: 1em; }
.form-msg.err { color: var(--bad); }
.form-msg.ok { color: var(--ok); }
.vis-tag { display: inline-block; font-size: .75rem; font-weight: 600; padding: 1px 7px; border-radius: 99px; margin-left: 6px; vertical-align: 1px; }
.vis-private { background: #eceff4; color: #3e4b5c; }
.vis-hideable { background: var(--gold-l); color: var(--gold-d); }
.privacy-line { font-size: .85rem; color: var(--muted); margin-top: 10px; }
.pw-field { position: relative; }
.pw-field input { padding-right: 70px; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--green-2); font-weight: 600; cursor: pointer; padding: 6px 8px; }
.pw-rules { list-style: none; padding: 0; margin: 6px 0 0; font-size: .86rem; color: var(--muted); display: grid; gap: 2px; }
.pw-rules li.ok { color: var(--ok); }
.field-hint { font-size: .88rem; margin: 4px 0 0; }
.pw-suggest { margin-top: 4px; }
.link { background: none; border: 0; padding: 0; color: var(--green-2); text-decoration: underline; cursor: pointer; font-weight: 600; }
.ts-slot { margin: 6px 0 14px; min-height: 65px; }
.demo-box { background: var(--gold-l); border: 1px dashed var(--gold); border-radius: var(--r-sm); padding: 10px 12px; margin: 12px 0; word-break: break-all; font-size: .92rem; }

/* App shell */
.app-layout { display: grid; gap: 18px; padding-top: 18px; padding-bottom: 40px; }
@media (min-width: 960px) { .app-layout { grid-template-columns: 230px 1fr; align-items: start; } }
.side-nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.side-nav::-webkit-scrollbar { display: none; }
.side-nav a, .side-nav button { white-space: nowrap; padding: 8px 12px; border-radius: 9px; color: var(--green); text-decoration: none; font-weight: 600; background: none; border: 0; cursor: pointer; text-align: left; }
.side-nav a:hover, .side-nav button:hover { background: #f3e8d6; }
.side-nav a.on { background: var(--green); color: #fff; }
.side-nav .count { background: var(--gold); color: #1f1606; border-radius: 99px; font-size: .75rem; padding: 0 7px; margin-left: 4px; }
.side-nav .nav-sep { display: none; }
@media (min-width: 960px) {
  .side-nav { flex-direction: column; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); padding: 8px; position: sticky; top: 76px; }
  .side-nav .nav-sep { display: block; height: 1px; background: var(--line); margin: 6px 4px; }
}
.main-col { min-width: 0; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.page-head h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); margin: 0; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; margin-bottom: 16px; box-shadow: var(--shadow); }
.panel h2 { font-size: 1.5rem; }
.panel > h3:first-child, .panel > h2:first-child { margin-top: 0; }
.grid-2 { display: grid; gap: 14px; }
@media (min-width: 720px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: .8rem; font-weight: 700; padding: 2px 9px; border-radius: 99px; background: #efe7da; color: #4b4232; white-space: nowrap; }
.chip-ok { background: var(--ok-l); color: var(--ok); }
.chip-wait { background: var(--warn-l); color: var(--warn); }
.chip-bad { background: var(--bad-l); color: var(--bad); }
.chip-info { background: var(--info-l); color: #2c5577; }
.chip-gold { background: var(--gold-l); color: var(--gold-d); }
.kv { display: grid; grid-template-columns: minmax(120px, 38%) 1fr; gap: 6px 14px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.list { list-style: none; margin: 0; padding: 0; }
.list > li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: 0; }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%) translateY(150%); background: var(--green); color: #fff; padding: 11px 18px; border-radius: 10px;
  box-shadow: var(--shadow); transition: transform .25s; z-index: 80; max-width: calc(100% - 32px); }
.toast.show { transform: translateX(-50%) translateY(0); }
.toast-err { background: var(--bad); }

/* Profile form */
.stepper { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: thin; padding-bottom: 6px; margin-bottom: 12px; }
.stepper a { flex: none; display: flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 99px; border: 1px solid var(--line); background: #fff; color: var(--green); text-decoration: none; font-size: .9rem; font-weight: 600; }
.stepper a.on { background: var(--green); color: #fff; border-color: var(--green); }
.stepper a .dot { width: 9px; height: 9px; border-radius: 50%; background: #d6c8ad; }
.stepper a.done .dot { background: var(--ok); }
.stepper a.missing .dot { background: var(--gold); }
.progress { height: 8px; background: #ede2cf; border-radius: 99px; overflow: hidden; margin: 6px 0 14px; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--green-2), var(--gold)); }
.form-nav { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 14px; margin-top: 8px; }

/* Member cards */
.results { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.mcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); color: inherit; text-decoration: none; }
.mcard:hover { border-color: #cdb98f; }
.mcard .ph { aspect-ratio: 4 / 3; background: linear-gradient(135deg, #f3e7cf, #e9dcc2); display: grid; place-items: center; color: var(--gold-d); font-family: var(--caps); font-size: 2.2rem; }
.mcard .ph img { width: 100%; height: 100%; object-fit: cover; }
.mcard .ph.none { aspect-ratio: auto; height: 92px; font-size: 1.8rem; }
.mcard .body { padding: 12px 14px 14px; display: grid; gap: 4px; }
.mcard h3 { margin: 0; font-size: 1.35rem; }
.mcard .meta { color: var(--muted); font-size: .92rem; }
.filters { display: grid; gap: 10px; }
.filters .row { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.filters label { display: grid; gap: 3px; font-size: .9rem; font-weight: 600; color: var(--green); }
.filters details summary { cursor: pointer; font-weight: 600; color: var(--green-2); }
.prof-head { display: grid; gap: 16px; }
@media (min-width: 760px) { .prof-head { grid-template-columns: 260px 1fr; } }
.gallery { display: grid; gap: 8px; grid-template-columns: repeat(3, 1fr); }
.gallery img { border-radius: 10px; aspect-ratio: 1; object-fit: cover; width: 100%; }
.gallery img:first-child { grid-column: 1 / -1; aspect-ratio: 4 / 3; }
.ph-empty { aspect-ratio: 4 / 3; border-radius: var(--r); background: linear-gradient(135deg, #f3e7cf, #e9dcc2); display: grid; place-items: center; text-align: center; padding: 16px; color: var(--gold-d); }
.thumbs { display: flex; flex-wrap: wrap; gap: 10px; }
.thumb { width: 130px; display: grid; gap: 6px; font-size: .85rem; }
.thumb img { width: 130px; height: 130px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.msgs { display: grid; gap: 8px; margin: 10px 0; }
.msg { max-width: 85%; padding: 9px 12px; border-radius: 12px; background: #f1ebe0; white-space: pre-wrap; }
.msg.mine { margin-left: auto; background: var(--green-l); }
.msg .tiny { display: block; color: var(--muted); margin-top: 3px; }

/* Admin */
.stat-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.stat { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; text-decoration: none; color: inherit; }
.stat:hover { border-color: #cdb98f; }
.stat b { display: block; font-family: var(--serif); font-variant-numeric: lining-nums; font-size: 2.1rem; color: var(--green); line-height: 1.1; }
.stat.hot b { color: var(--gold-d); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); }
table.data { width: 100%; border-collapse: collapse; font-size: .94rem; }
table.data th, table.data td { padding: 9px 11px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.data th { background: #f6eee2; font-weight: 700; color: var(--green); white-space: nowrap; }
table.data tr:last-child td { border-bottom: 0; }
table.data tr.click { cursor: pointer; }
table.data tr.click:hover td { background: #fbf5ea; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.tabs a { padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line); background: #fff; color: var(--green); text-decoration: none; font-weight: 600; font-size: .92rem; }
.tabs a.on { background: var(--green); color: #fff; border-color: var(--green); }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.toolbar input, .toolbar select { width: auto; min-width: 160px; flex: 1 1 180px; }
.private-box { border: 1px dashed #b7c2cf; background: #f5f7fa; border-radius: var(--r-sm); padding: 10px 12px; }
dialog { border: 0; border-radius: var(--r); padding: 0; max-width: min(560px, calc(100% - 24px)); width: 100%; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
dialog::backdrop { background: rgba(2, 43, 27, .45); }
dialog .dlg { padding: 20px; }
dialog h3 { margin-top: 0; }
pre.json { white-space: pre-wrap; font-size: .8rem; background: #f6f2ea; padding: 8px; border-radius: 8px; margin: 0; max-height: 200px; overflow: auto; }
fieldset.plain { border: 0; padding: 0; margin: 0 0 14px; }
.filters label.check, .filters label.choice { display: flex; font-weight: 400; color: var(--ink); }
.filters details summary { padding: 2px 0; }
