:root {
  color-scheme: dark;
  --ink: #f0e9e3;
  --muted: #a9a09b;
  --faint: #746d69;
  --bg: #151211;
  --panel: #201c1a;
  --panel-2: #292321;
  --line: rgba(237, 229, 222, .11);
  --brand: #523a3a;
  --brand-soft: #775855;
  --cream: #ece6e0;
  --serif: 'DM Sans', 'IBM Plex Sans Arabic', Tahoma, Arial, sans-serif;
  --sans: 'IBM Plex Sans Arabic', 'DM Sans', Tahoma, Arial, sans-serif;
  font-family: var(--sans);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; background: var(--bg); overflow-x: clip; }
body { margin: 0; min-width: 320px; max-width: 100%; overflow-x: clip; color: var(--ink); background: var(--bg); font-family: var(--sans); line-height: 1.7; }
body, button, input, textarea, select { font-family: var(--sans); }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid #c1a19a; outline-offset: 3px; }
.boot-screen { min-height: 100svh; display: flex; align-items: center; justify-content: center; gap: 14px; color: var(--muted); letter-spacing: .18em; font-size: 12px; }
.brand-symbol { display: inline-block; width: 27px; height: 27px; background: var(--site-logo, url('/assets/riwaq-mark.png')) center/cover; border-radius: 50%; flex: 0 0 auto; }
.wrap { width: min(1320px, calc(100% - 88px)); margin-inline: auto; }
.topbar { position: absolute; inset: 24px 0 auto; z-index: 5; }
.nav-shell { height: 68px; display: flex; align-items: center; justify-content: space-between; padding: 0 21px; border: 1px solid rgba(240, 233, 227, .19); background: rgba(24, 20, 19, .62); backdrop-filter: blur(18px); border-radius: 8px; }
.wordmark { display: inline-flex; align-items: center; gap: 11px; direction: ltr; font-family: 'DM Sans', sans-serif; font-size: 15px; font-weight: 600; letter-spacing: .11em; }
.wordmark .brand-symbol { width: 34px; height: 34px; }
.nav-links { display: flex; align-items: center; gap: clamp(18px, 3vw, 42px); color: #e6dfd9; font-size: 13px; }
.nav-links a { opacity: .83; transition: opacity .2s, color .2s; }
.nav-links a:hover { opacity: 1; color: #fff; }
.nav-side { display: flex; align-items: center; gap: 17px; }
.nav-mini { color: #ded6cf; font-size: 11px; letter-spacing: .14em; direction: ltr; }
.menu-toggle { display: none; border: 0; background: none; font-size: 22px; padding: 6px; cursor: pointer; }
.hero { min-height: min(780px, 100svh); height: 760px; max-height: 88svh; position: relative; display: flex; align-items: end; overflow: hidden; background: #221c1b var(--hero-image, url('/assets/riwaq-studio-hero.png')) center 47%/cover no-repeat; }
.hero::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(13,11,11,.34) 0%, transparent 27%, rgba(18,15,14,.14) 59%, rgba(18,15,14,.56) 100%), linear-gradient(90deg, rgba(17,14,14,.18), transparent 55%, rgba(17,14,14,.1)); }
.hero-bottom { position: relative; z-index: 1; width: min(1320px, calc(100% - 88px)); margin: 0 auto; padding-bottom: 46px; display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.hero-kicker { color: #e2d9d3; font-size: 11px; letter-spacing: .15em; direction: ltr; text-transform: uppercase; }
.hero-side-copy { color: #e0d8d2; max-width: 250px; font-size: 13px; }
.hero-scroll { display: flex; align-items: center; gap: 12px; color: #eee7e1; font-size: 11px; }
.hero-scroll::before { content: ''; width: 42px; height: 1px; background: rgba(238,230,224,.65); }
.intro-band { border-bottom: 1px solid var(--line); background: linear-gradient(90deg, rgba(82,58,58,.15), transparent 47%); }
.intro-inner { min-height: 166px; display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; gap: 42px; padding-block: 36px; }
.eyebrow { color: #c3aaa4; text-transform: uppercase; direction: ltr; letter-spacing: .19em; font-size: 10px; }
.intro-inner h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(27px, 4vw, 48px); line-height: 1.16; letter-spacing: -.02em; margin: 10px 0 0; }
.intro-text { font-size: 14px; color: #bcb3ad; max-width: 460px; line-height: 1.95; margin: 0; }
.portfolio-main { padding: 92px 0 110px; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 27px; }
.section-heading h2 { margin: 5px 0 0; font: 400 clamp(28px, 4vw, 42px)/1.2 var(--serif); }
.section-count { color: var(--faint); font-size: 11px; letter-spacing: .1em; direction: ltr; }
.latest-section { margin-bottom: 100px; }
.collection-tabs { display: flex; align-items: center; gap: 8px; padding-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.collection-tabs::-webkit-scrollbar { display: none; }
.collection-tab { white-space: nowrap; border: 1px solid var(--line); color: #beb5af; padding: 9px 16px; font-size: 12px; background: transparent; border-radius: 3px; transition: all .2s; }
.collection-tab:hover, .collection-tab.active { color: var(--ink); background: var(--brand); border-color: var(--brand-soft); }
.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 18px; }
.project-card { display: block; min-width: 0; position: relative; background: var(--panel); border: 1px solid var(--line); overflow: hidden; transition: transform .3s, border-color .3s; }
.project-card:hover { transform: translateY(-4px); border-color: rgba(230,215,208,.36); }
.project-thumb { aspect-ratio: 1.42; position: relative; background: #292220; overflow: hidden; }
.project-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2,.7,.1,1); }
.project-card:hover .project-thumb img { transform: scale(1.035); }
.project-thumb::after { content: ''; position: absolute; inset: 35% 0 0; background: linear-gradient(transparent, rgba(12,10,10,.42)); pointer-events: none; }
.project-badge { position: absolute; z-index: 1; top: 15px; right: 15px; background: rgba(20,17,16,.75); backdrop-filter: blur(8px); padding: 5px 9px; font-size: 9px; letter-spacing: .1em; direction: ltr; border: 1px solid rgba(255,255,255,.15); }
.project-arrow { position: absolute; z-index: 1; bottom: 15px; left: 15px; height: 34px; width: 34px; border: 1px solid rgba(255,255,255,.5); border-radius: 50%; display: grid; place-items: center; font-size: 17px; direction: ltr; }
.project-meta { display: flex; align-items: start; justify-content: space-between; gap: 12px; padding: 17px 17px 20px; }
.project-meta h3 { margin: 0; font-size: 15px; font-weight: 500; }
.project-meta p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.project-meta small { flex: 0 0 auto; color: #c4b3ac; font-size: 9px; letter-spacing: .12em; direction: ltr; }
.empty-state { min-height: 230px; border: 1px solid var(--line); background: linear-gradient(125deg, rgba(82,58,58,.14), rgba(32,28,26,.78) 45%); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 32px; }
.empty-mark { width: 42px; height: 42px; border: 1px solid rgba(228,211,203,.36); border-radius: 50%; display: grid; place-items: center; margin-bottom: 13px; color: #ddc9c2; font: 20px var(--serif); }
.empty-state h3 { font-size: 15px; font-weight: 400; margin: 0; }
.empty-state p { color: var(--muted); font-size: 12px; margin: 6px 0 0; }
.collection-section { padding-top: 58px; margin-top: 38px; border-top: 1px solid var(--line); }
.collection-section .section-heading { margin-bottom: 20px; }
.collection-section .empty-state { min-height: 168px; }
.collection-section .empty-state p { max-width: 380px; }
.site-footer { background: #100e0d; border-top: 1px solid var(--line); }
.footer-main { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding-block: 31px; }
.footer-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.footer-admin-entry { color: #c8bbb4; opacity: .3; font: 8px/1 var(--sans); letter-spacing: .12em; padding: 4px 2px; transition: opacity .2s; }
.footer-admin-entry:hover, .footer-admin-entry:focus-visible { opacity: .78; }
.footer-main p { color: var(--muted); margin: 0; font-size: 11px; }
.footer-links { display: flex; gap: 20px; font-size: 11px; color: #c6bdb7; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.07); padding-block: 14px; color: #77706b; font-size: 10px; display: flex; justify-content: space-between; direction: ltr; }

/* Project details */
.detail-topbar { height: 72px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); padding-inline: max(26px, calc((100vw - 1320px)/2)); background: rgba(21,18,17,.96); }
.back-link { display: inline-flex; align-items: center; gap: 9px; color: #ddd4ce; font-size: 12px; }
.back-link span { font-size: 18px; }
.detail-mark { color: #9d918a; font-size: 10px; direction: ltr; letter-spacing: .18em; }
.detail-wrap { width: min(1120px, calc(100% - 56px)); margin: 0 auto; padding: 56px 0 92px; }
.detail-cover { position: relative; min-height: 290px; aspect-ratio: 2.35; background: #27211f; overflow: hidden; margin-bottom: 36px; border: 1px solid var(--line); }
.detail-cover img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.detail-cover::after { content: ''; position: absolute; inset: 35% 0 0; background: linear-gradient(transparent, rgba(15,12,12,.72)); }
.detail-cover-title { position: absolute; z-index: 1; inset: auto 30px 27px; }
.detail-cover-title .eyebrow { color: #d7bdb5; }
.detail-cover-title h1 { margin: 8px 0 0; font: 400 clamp(28px,4vw,54px)/1.1 var(--serif); overflow-wrap: anywhere; }
.detail-body { display: grid; grid-template-columns: minmax(0,1fr) 250px; gap: 44px; align-items: start; }
.detail-copy { color: #c2b8b2; font-size: 14px; line-height: 2; white-space: pre-wrap; }
.detail-description { margin: 0 0 24px; }
.detail-side { border-right: 1px solid var(--line); padding-right: 22px; }
.detail-fact { padding: 12px 0; border-bottom: 1px solid var(--line); }
.detail-fact small { color: var(--faint); display: block; font-size: 10px; margin-bottom: 4px; }
.detail-fact span { font-size: 12px; }
.package-pill { display: inline-flex!important; width: fit-content; border: 1px solid #75605b; padding: 3px 8px; color: #e4d2cb; direction: ltr; letter-spacing: .1em; }
.detail-gallery { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; margin-top: 33px; }
.gallery-photo { border: 1px solid var(--line); background: #211c1a; cursor: zoom-in; overflow: hidden; }
.gallery-photo img { width: 100%; aspect-ratio: 1.2; object-fit: contain; background: #191514; transition: transform .35s; }
.gallery-photo:hover img { transform: scale(1.025); }
.gallery-wide { grid-column: 1 / -1; }
.gallery-wide img { aspect-ratio: 1.9; }
.live-link { display: inline-flex; align-items: center; gap: 10px; margin-top: 22px; border-bottom: 1px solid var(--brand-soft); padding-bottom: 4px; color: #e2cec6; font-size: 12px; }
.lightbox { position: fixed; z-index: 50; inset: 0; display: grid; grid-template-columns: 54px minmax(0,1fr) 54px; align-items: center; justify-items: center; gap: 14px; padding: 58px 32px 34px; background: rgba(10,8,8,.96); backdrop-filter: blur(14px); }
.lightbox figure { display: grid; grid-column: 2; grid-row: 1; justify-items: center; gap: 10px; width: 100%; height: 100%; margin: 0; }
.lightbox img { width: 100%; height: calc(100% - 30px); object-fit: contain; }
.lightbox figcaption { display: flex; justify-content: space-between; gap: 16px; width: min(1200px,100%); color: #bfb5af; font-size: 11px; }
.lightbox-step { display: grid; place-items: center; width: 48px; height: 48px; border: 1px solid rgba(255,255,255,.25); border-radius: 50%; background: rgba(255,255,255,.05); font-size: 28px; cursor: pointer; }
.lightbox-step:hover { background: rgba(82,58,58,.8); }
.lightbox-step:disabled { opacity: .3; cursor: default; }
.lightbox-previous { grid-column: 1; grid-row: 1; }
.lightbox-next { grid-column: 3; grid-row: 1; }
.lightbox-close { position: absolute; top: 20px; left: 22px; border: 1px solid rgba(255,255,255,.3); background: transparent; width: 42px; height: 42px; border-radius: 50%; font-size: 23px; cursor: pointer; }

/* Custom server exploration */
.server-app { width: 100%; max-width: 100vw; min-height: 100svh; display: grid; grid-template-columns: 64px 248px minmax(0,1fr); background: #171514; direction: ltr; overflow-x: clip; align-items: stretch; }
.server-app.has-bots { grid-template-columns: 64px 248px minmax(0,1fr) 196px; }
.server-rail { border-left: 1px solid var(--line); background: #131110; padding: 18px 0; display: flex; flex-direction: column; align-items: center; gap: 11px; position: sticky; top: 0; align-self: start; height: 100svh; min-height: 100svh; overflow-y: auto; }
.server-rail-brand { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 7px; padding: 0 4px; }
.server-rail-brand img { width: 38px; height: 38px; flex: 0 0 auto; object-fit: contain; border: 1px solid rgba(255,255,255,.12); background: #302927; }
.server-rail-studio-mark { border-radius: 50%; }
.server-rail-project-mark { border-radius: 10px; }
.rail-button { width: 40px; height: 40px; display: grid; place-items: center; background: #282321; color: #e7ded7; border: 0; border-radius: 50%; font-size: 15px; cursor: pointer; transition: background .2s, border-radius .2s; }
.rail-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.rail-button:hover, .rail-button.selected { background: var(--brand); border-radius: 12px; }
.rail-spacer { flex: 1; }
.server-channels { background: #211d1b; border-left: 1px solid var(--line); min-width: 0; direction: rtl; position: sticky; top: 0; align-self: start; height: 100svh; min-height: 100svh; overflow-y: auto; }
.server-banner { height: 110px; position: relative; background: #302927; overflow: hidden; }
.server-banner.empty { display: none; }
.server-banner img { width: 100%; height: 100%; object-fit: cover; opacity: .8; }
.server-banner::after { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, #211d1b, transparent 90%); }
.server-brand { position: relative; padding: 15px 15px 17px; z-index: 1; }
.server-site-identity { display: flex; align-items: center; gap: 9px; color: #e8dfd9; font-size: 10px; letter-spacing: .09em; }
.server-site-identity img { width: 31px; height: 31px; flex: 0 0 auto; object-fit: contain; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; background: #302927; }
.server-brand-divider { display: block; width: 100%; height: 1px; margin: 13px 0; background: rgba(238,230,224,.1); }
.server-project-profile { display: flex; align-items: center; gap: 11px; min-width: 0; }
.server-avatar { width: 56px; height: 56px; flex: 0 0 auto; border: 1px solid rgba(255,255,255,.1); border-radius: 15px; object-fit: cover; background: #312a28; }
.server-avatar.is-placeholder { object-fit: contain; padding: 8px; background: transparent; border-color: rgba(238,230,224,.08); }
.server-project-names { min-width: 0; }
.server-project-names small { display: block; color: #867d78; font-size: 9px; }
.server-project-names h1 { font-size: 14px; line-height: 1.5; font-weight: 600; margin: 2px 0 0; overflow-wrap: anywhere; }
.server-client-name { color: #b9aca4; font-size: 10px; margin: 2px 0 0; overflow-wrap: anywhere; }
.server-project-description { color: #a99f99; font-size: 11px; line-height: 1.8; margin: 11px 0 0; }
.server-facts { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 12px; margin-top: 12px; }
.server-facts .detail-fact { padding: 8px 0; border-bottom-color: rgba(255,255,255,.06); }
.server-facts .detail-fact small { font-size: 9px; }
.server-facts .detail-fact span { font-size: 10px; }
.server-stats { display: flex; gap: 15px; padding: 12px 17px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: #b7ada7; font-size: 10px; }
.server-stats strong { color: var(--ink); font-weight: 500; }
.channel-head { display: flex; justify-content: space-between; align-items: center; padding: 22px 17px 8px; color: #867d78; font-size: 10px; }
.room-list { padding: 4px 9px 20px; display: grid; gap: 3px; }
.room-list:empty { display: none; }
.room-button { width: 100%; display: flex; gap: 9px; align-items: center; text-align: right; border: 0; background: transparent; color: #aaa19b; border-radius: 4px; padding: 8px 9px; cursor: pointer; font-size: 12px; }
.room-button::before { content: '#'; font-family: var(--serif); color: #756c67; font-size: 16px; }
.room-button:hover { background: rgba(255,255,255,.04); color: #e4ddd7; }
.room-button.active { background: rgba(82,58,58,.62); color: #fff; }
.server-content { min-width: 0; min-height: 100svh; padding: 34px clamp(22px, 4vw, 64px) 54px; direction: rtl; }
.server-content-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); padding-bottom: 17px; margin-bottom: 24px; }
.room-title { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.room-title span { color: #817874; font: 22px var(--serif); }
.room-title h2 { margin: 0; font-size: 16px; font-weight: 500; overflow-wrap: anywhere; }
.image-count { color: #837a75; font-size: 10px; direction: ltr; }
.room-intro { color: #b9b0aa; font-size: 12px; margin: 0 0 22px; }
.room-feed { width: min(100%, 1080px); margin-inline: auto; display: grid; gap: 14px; align-items: start; }
.room-feed-item { display: block; width: 100%; min-width: 0; overflow: hidden; padding: 0; border: 1px solid rgba(255,255,255,.1); background: #201b19; cursor: zoom-in; }
.room-feed-item:hover { border-color: rgba(238,230,224,.26); }
.room-feed-image { width: 100%; height: auto; max-width: 100%; object-fit: contain; }
.room-empty { border: 1px dashed rgba(238,230,224,.2); padding: 38px; text-align: center; color: #a79d97; font-size: 12px; }
.server-bots { background: #1e1a19; border-left: 1px solid var(--line); padding: 24px 14px; direction: rtl; position: sticky; top: 0; align-self: start; height: 100svh; min-height: 100svh; overflow-y: auto; }
.server-bot-section h3 { font-size: 10px; color: #827975; font-weight: 500; margin: 0 0 12px; }
.bot-list { display: grid; gap: 8px; }
.bot-item { display: flex; align-items: center; gap: 9px; min-height: 43px; padding: 5px 6px; border-radius: 5px; color: #bab0aa; font-size: 11px; overflow-wrap: anywhere; }
.bot-item img { width: 30px; height: 30px; object-fit: cover; border-radius: 8px; background: #332b29; }
.bot-item .bot-initial { display: grid; place-items: center; width: 30px; height: 30px; background: #3b302d; border-radius: 8px; color: #e0c7bf; }
.bot-note { color: #746b66; font-size: 10px; line-height: 1.8; padding: 10px 5px; }
.server-mobilebar { display: none; }
.mobile-riwaq { display: none; }

/* Owner studio */
.admin-shell { min-height: 100svh; display: grid; grid-template-columns: 245px minmax(0,1fr); background: #171514; }
.admin-sidebar { background: #1d1918; border-left: 1px solid var(--line); padding: 23px 15px; display: flex; flex-direction: column; position: sticky; height: 100svh; top: 0; }
.admin-brand { display: flex; align-items: center; gap: 12px; padding: 0 9px 22px; border-bottom: 1px solid var(--line); direction: ltr; font: 16px var(--serif); letter-spacing: .15em; }
.admin-brand .brand-symbol { width: 34px; height: 34px; }
.admin-nav-label { color: #786f6a; font-size: 9px; letter-spacing: .14em; direction: ltr; padding: 23px 10px 8px; }
.admin-nav { display: grid; gap: 4px; }
.admin-nav button { display: flex; align-items: center; gap: 11px; text-align: right; width: 100%; border: 0; padding: 11px 10px; color: #a99f99; background: transparent; border-radius: 4px; font-size: 12px; cursor: pointer; }
.admin-nav button:hover, .admin-nav button.active { background: #302624; color: #f0e8e2; }
.nav-icon { width: 19px; text-align: center; color: #c3a7a0; font: 17px var(--serif); }
.nav-badge { margin-right: auto; background: var(--brand); color: white; min-width: 17px; height: 17px; border-radius: 10px; display: grid; place-items: center; font-size: 9px; }
.admin-sidebar-foot { margin-top: auto; border-top: 1px solid var(--line); padding: 15px 8px 0; display: grid; gap: 12px; }
.owner-label { color: #a69c96; font-size: 10px; }
.admin-main { min-width: 0; padding: 30px clamp(20px, 4vw, 56px) 70px; max-width: 1450px; width: 100%; margin: 0 auto; }
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 23px; margin-bottom: 25px; border-bottom: 1px solid var(--line); }
.admin-head h1 { font-size: 21px; font-weight: 500; margin: 3px 0 0; }
.admin-subtitle { color: #908680; font-size: 11px; margin: 4px 0 0; }
.admin-actions { display: flex; gap: 9px; align-items: center; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); padding: 10px 15px; background: #292320; color: var(--ink); font-size: 11px; cursor: pointer; transition: .2s; border-radius: 3px; }
.button:hover { background: #38302d; border-color: rgba(255,255,255,.25); }
.button.primary { background: var(--brand); border-color: #694d4b; }
.button.primary:hover { background: #684949; }
.button.subtle { background: transparent; }
.button.danger { color: #dbaaa2; }
.button.small { padding: 6px 9px; font-size: 10px; }
.stat-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin-bottom: 28px; }
.stat-card { border: 1px solid var(--line); background: linear-gradient(145deg,#26201e,#1e1a19); min-height: 119px; padding: 18px; }
.stat-card small { color: #928781; display: block; font-size: 10px; }
.stat-card strong { display: block; font: 28px var(--serif); margin-top: 9px; }
.admin-panel { border: 1px solid var(--line); background: #1e1a19; margin-bottom: 18px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.panel-heading h2 { font-size: 13px; font-weight: 500; margin: 0; }
.panel-body { padding: 18px; }
.admin-project-list { display: grid; }
.admin-project-row { display: grid; grid-template-columns: 74px minmax(0,1fr) auto auto; align-items: center; gap: 14px; padding: 11px 18px; border-bottom: 1px solid rgba(255,255,255,.055); }
.admin-project-row:last-child { border-bottom: 0; }
.admin-project-thumb { width: 74px; height: 52px; object-fit: cover; background: #302927; }
.admin-project-thumb[src$="server-placeholder.png"] { object-fit: contain; padding: 7px; background: #292321; }
.admin-project-name { min-width: 0; }
.admin-project-name strong { font-size: 12px; font-weight: 500; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-project-name small { font-size: 10px; color: #8d837d; }
.status-tag { border: 1px solid var(--line); padding: 4px 8px; font-size: 9px; color: #c6b8b0; white-space: nowrap; }
.status-tag.published { color: #a9c3b2; border-color: rgba(131,181,145,.27); }
.status-tag.draft { color: #d5b99f; border-color: rgba(199,159,120,.25); }
.admin-table-actions { display: flex; gap: 6px; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.field { display: grid; align-content: start; gap: 6px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label, .field-label { color: #cfc4be; font-size: 10px; }
.field input:not([type=checkbox]):not([type=file]), .field textarea, .field select, .setting-input { width: 100%; border: 1px solid rgba(238,230,224,.13); border-radius: 2px; padding: 11px 12px; color: var(--ink); background: #171413; font-size: 12px; }
.field input::placeholder, .field textarea::placeholder, .setting-input::placeholder { color: #6d6560; }
.field textarea { resize: vertical; min-height: 96px; line-height: 1.8; }
.field select { appearance: auto; }
.field option { background: #211c1a; }
.field-hint { color: #7e746e; font-size: 9px; }
.checkbox-line { display: inline-flex; align-items: center; gap: 9px; color: #c2b7b1; font-size: 11px; }
.checkbox-line input { accent-color: #80615c; }
.form-section-title { grid-column: 1 / -1; color: #d4c7c0; font-size: 12px; border-bottom: 1px solid var(--line); padding-bottom: 8px; margin-top: 5px; }
.image-upload { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; border: 1px dashed rgba(238,230,224,.2); padding: 11px; min-height: 56px; }
.upload-pick { display: inline-flex; align-items: center; gap: 7px; position: relative; cursor: pointer; color: #dbcbc4; border: 1px solid rgba(230,214,206,.23); padding: 7px 10px; font-size: 10px; white-space: nowrap; }
.upload-pick input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.image-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.image-chip { display: flex; position: relative; width: 66px; height: 57px; border: 1px solid var(--line); background: #282321; }
.image-chip img { width: 100%; height: 100%; object-fit: cover; }
.image-chip button { position: absolute; inset: -6px -6px auto auto; border: 0; color: white; background: #573d3b; border-radius: 50%; width: 18px; height: 18px; font-size: 12px; line-height: 1; cursor: pointer; }
.image-card { display: inline-grid; gap: 3px; width: 86px; }
.image-card-actions { position: absolute; inset: auto 0 0; display: flex; justify-content: center; gap: 2px; background: rgba(15,13,12,.82); padding: 2px; }
.image-card-actions button { position: static; border-radius: 1px; width: 19px; height: 18px; padding: 0; font-size: 10px; }
.bot-label-input { width: 86px; border: 1px solid var(--line); background: #171413; color: var(--ink); padding: 4px; font-size: 9px; }
.watermark-toggle { display: flex; align-items: center; white-space: nowrap; gap: 4px; color: #9e938c; font-size: 8px; }
.watermark-toggle input { accent-color: #80615c; }
.setting-preview { width: 78px; height: 58px; object-fit: cover; background: #282321; border: 1px solid var(--line); }
.upload-message { color: #9aa896; font-size: 10px; }
.upload-message.error { color: #dcaaa1; }
.room-editor { border: 1px solid var(--line); margin-top: 10px; padding: 13px; background: #191615; }
.room-editor-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.room-editor-head input { flex: 1; min-width: 120px; }
.room-editor-head .field input { min-width: 120px; }
.room-editor-head .button { padding: 6px 9px; }
.room-asset-line { padding-top: 10px; }
.settings-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
.setting-block { border-bottom: 1px solid var(--line); padding-bottom: 18px; margin-bottom: 18px; }
.setting-block h3 { margin: 0 0 12px; font-size: 12px; font-weight: 500; }
.setting-row { display: grid; grid-template-columns: 145px minmax(0,1fr); align-items: center; gap: 12px; margin-top: 10px; }
.setting-row label { font-size: 10px; color: #9f958f; }
.settings-grid input[type=range] { accent-color: #876660; width: 100%; }
.social-row { display: grid; grid-template-columns: 110px 1fr; gap: 8px; margin-top: 8px; }
.social-row input { min-width: 0; }
.activity-list { display: grid; }
.activity-row { display: grid; grid-template-columns: 105px minmax(0,1fr); gap: 14px; padding: 13px 17px; border-bottom: 1px solid rgba(255,255,255,.06); }
.activity-row:last-child { border-bottom: 0; }
.activity-row time { color: #827973; font-size: 10px; direction: ltr; text-align: right; }
.activity-row p { margin: 0; font-size: 11px; color: #c8beb8; }
.notice-dot { width: 7px; height: 7px; display: inline-block; background: #96716a; border-radius: 50%; margin-left: 6px; }
.login-screen { min-height: 100svh; display: grid; grid-template-columns: 1fr minmax(360px, .7fr); background: #171413; }
.login-art { position: relative; background: #221c1b url('/assets/riwaq-studio-hero.png') center/cover no-repeat; min-height: 100svh; }
.login-art::after { content: ''; position: absolute; inset: 0; background: rgba(16,13,13,.38); }
.login-form-wrap { display: grid; place-items: center; padding: 34px; }
.login-card { width: min(100%, 390px); }
.login-card .admin-brand { border: 0; padding: 0; margin-bottom: 48px; }
.login-card h1 { font: 400 29px var(--serif); margin: 0; }
.login-card > p { color: #a59b95; font-size: 12px; margin: 8px 0 27px; }
.login-card .field { margin-bottom: 15px; }
.login-card .button { width: 100%; margin-top: 10px; }
.login-error { min-height: 22px; color: #daa99f; font-size: 10px; margin-top: 9px; }
.toast-stack { position: fixed; z-index: 80; left: 22px; bottom: 22px; display: grid; gap: 8px; }
.toast { background: #292321; border: 1px solid rgba(235,224,216,.2); color: #ece3dd; padding: 11px 15px; min-width: 220px; max-width: min(400px, calc(100vw - 44px)); box-shadow: 0 12px 35px rgba(0,0,0,.3); font-size: 11px; animation: toastIn .25s ease-out; }
.toast.error { border-color: rgba(191,111,102,.55); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.mobile-cover-toggle { display: none; }

@media (max-width: 1050px) {
  .server-app { grid-template-columns: 56px 205px minmax(0,1fr); }
  .server-app.has-bots { grid-template-columns: 56px 205px minmax(0,1fr) 160px; }
  .server-bots { display: block; padding: 20px 10px; }
  .server-content { padding-inline: clamp(14px, 2.5vw, 28px); }
  .detail-body { grid-template-columns: minmax(0,1fr) 205px; gap: 28px; }
  .admin-shell { grid-template-columns: 205px minmax(0,1fr); }
  .admin-project-row { grid-template-columns: 66px minmax(0,1fr) auto; }
  .admin-table-actions { grid-column: 2 / -1; justify-content: flex-start; }
}
@media (max-width: 760px) {
  .wrap, .hero-bottom { width: calc(100% - 36px); }
  .topbar { inset-block-start: 12px; }
  .nav-shell { height: 58px; padding: 0 12px; }
  .wordmark { font-size: 14px; }
  .wordmark .brand-symbol { width: 30px; height: 30px; }
  .menu-toggle { display: block; }
  .nav-links { display: none; position: absolute; top: 65px; right: 0; left: 0; background: #221d1b; border: 1px solid var(--line); padding: 14px; flex-direction: column; align-items: stretch; gap: 2px; }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 9px 7px; }
  .nav-mini { display: none; }
  .hero { height: 77svh; min-height: 510px; max-height: none; background-position: center; background-size: auto 52svh; }
  .hero-bottom { padding-bottom: 18px; }
  .hero-side-copy { max-width: 180px; font-size: 11px; }
  .hero-scroll { font-size: 10px; }
  .hero-scroll::before { width: 23px; }
  .hero-kicker { display: none; }
  .intro-inner { grid-template-columns: 1fr; gap: 13px; padding-block: 31px; }
  .intro-inner h1 { max-width: 460px; }
  .intro-text { font-size: 12px; }
  .portfolio-main { padding: 55px 0 68px; }
  .latest-section { margin-bottom: 64px; }
  .section-heading { margin-bottom: 19px; }
  .section-count { font-size: 9px; }
  .project-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
  .project-thumb { aspect-ratio: 1.07; }
  .project-meta { padding: 11px 10px 13px; }
  .project-meta h3 { font-size: 12px; }
  .project-meta p { font-size: 10px; }
  .project-meta small { display: none; }
  .project-badge { top: 8px; right: 8px; font-size: 8px; padding: 4px 6px; }
  .project-arrow { width: 29px; height: 29px; bottom: 8px; left: 8px; }
  .empty-state { min-height: 205px; padding: 22px 16px; }
  .collection-section { margin-top: 29px; padding-top: 38px; }
  .collection-section .empty-state { min-height: 130px; }
  .footer-main { display: grid; padding-block: 24px; }
  .footer-links { flex-wrap: wrap; }
  .footer-bottom { font-size: 9px; }
  .detail-topbar { height: 60px; padding-inline: 18px; }
  .detail-wrap { width: calc(100% - 36px); padding: 26px 0 58px; }
  .detail-cover { min-height: 225px; aspect-ratio: 1.35; margin-bottom: 23px; }
  .detail-cover-title { inset: auto 15px 15px; }
  .detail-body { grid-template-columns: 1fr; gap: 20px; }
  .detail-side { order: -1; border: 0; border-bottom: 1px solid var(--line); padding: 0 0 10px; display: flex; flex-wrap: wrap; gap: 0 20px; }
  .detail-fact { min-width: 100px; border: 0; }
  .detail-copy { font-size: 12px; }
  .detail-gallery { gap: 7px; margin-top: 20px; }
  .gallery-photo img { aspect-ratio: .92; }
  .gallery-wide img { aspect-ratio: 1.3; }
  .lightbox { grid-template-columns: 38px minmax(0,1fr) 38px; gap: 5px; padding: 68px 9px 22px; }
  .lightbox-step { width: 36px; height: 36px; font-size: 21px; }
  .lightbox img { height: calc(100% - 35px); }
  .server-app { display: block; min-height: 100svh; }
  .server-rail { display: none; }
  .server-channels { display: none; position: fixed; z-index: 30; inset: 0 0 0 auto; width: min(86vw, 310px); overflow-y: auto; box-shadow: -18px 0 55px rgba(0,0,0,.45); }
  .server-channels.open { display: block; }
  .server-bots { display: none; position: fixed; z-index: 30; inset: 0 0 0 auto; width: min(76vw, 280px); overflow-y: auto; box-shadow: -18px 0 55px rgba(0,0,0,.45); height: 100svh; min-height: 100svh; }
  .server-bots.open { display: block; }
  .server-mobilebar { min-height: 57px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: #1e1a19; position: sticky; top: 0; z-index: 4; direction: ltr; }
  .mobile-bar-left { display: flex; gap: 8px; align-items: center; min-width: 0; }
  .mobile-bar-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11px; }
  .mobile-cover-toggle { display: grid; place-items: center; width: 33px; height: 33px; border: 1px solid var(--line); background: transparent; font-size: 15px; }
  .server-content { min-height: 100svh; padding: 0 12px 76px; }
  .server-content-head { margin-bottom: 16px; }
  .room-feed { gap: 10px; }
  .server-overlay { display: none; position: fixed; z-index: 20; inset: 0; background: rgba(0,0,0,.57); }
  .server-overlay.open { display: block; }
  .mobile-riwaq { position: fixed; z-index: 10; bottom: 14px; left: 14px; width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.15); border-radius: 50%; background: rgba(32,28,26,.94); color: #eee5df; box-shadow: 0 5px 18px rgba(0,0,0,.3); }
  .mobile-riwaq svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
  .mobile-cover-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
  .admin-shell { display: block; }
  .admin-sidebar { position: fixed; z-index: 15; inset: 0 auto 0 0; width: 250px; height: 100svh; transform: translateX(-101%); transition: transform .25s; box-shadow: 14px 0 40px rgba(0,0,0,.4); }
  .admin-sidebar.open { transform: none; }
  .admin-main { padding: 19px 14px 55px; }
  .admin-head { align-items: start; }
  .admin-head h1 { font-size: 18px; }
  .mobile-admin-menu { display: inline-grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--line); background: transparent; font-size: 17px; cursor: pointer; }
  .admin-head-title { display: flex; align-items: center; gap: 10px; }
  .stat-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .stat-card { min-height: 95px; padding: 13px; }
  .stat-card strong { font-size: 23px; }
  .admin-project-row { grid-template-columns: 58px minmax(0,1fr) auto; gap: 9px; padding: 10px; }
  .admin-project-thumb { width: 58px; height: 44px; }
  .admin-project-name strong { font-size: 11px; }
  .admin-table-actions { grid-column: 2 / -1; }
  .form-grid, .settings-grid { grid-template-columns: 1fr; }
  .field.full, .form-section-title { grid-column: auto; }
  .setting-row { grid-template-columns: 115px 1fr; }
  .activity-row { grid-template-columns: 80px minmax(0,1fr); gap: 9px; padding-inline: 11px; }
  .login-screen { display: block; }
  .login-art { display: none; }
  .login-form-wrap { min-height: 100svh; padding: 25px; }
  .admin-actions { flex-wrap: wrap; justify-content: end; }
}
@media (max-width: 410px) {
  .project-grid { grid-template-columns: 1fr; }
  .project-thumb { aspect-ratio: 1.45; }
  .hero-side-copy { max-width: 145px; }
  .collection-tab { padding: 8px 12px; }
  .button { padding-inline: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto!important; animation-duration: .01ms!important; transition-duration: .01ms!important; }
}
