:root {
  --p: #7c3aed; --p2: #a855f7; --p-dark: #5b21b6;
  --bg: #ffffff; --bg2: #f6f2fd; --card: #ffffff; --text: #12091f; --muted: #6b6280; --border: #e3daf3;
  --bubble: #f1ebfb; --bubble-me: #7c3aed; --bubble-me-text: #fff; --shadow: 0 10px 40px rgba(60, 20, 120, .18);
  --radius: 16px;
}
:root[data-theme="dark"] {
  --bg: #08040f; --bg2: #110920; --card: #150c27; --text: #f6f1ff; --muted: #a99bc6; --border: #2c1d4a;
  --bubble: #211338; --bubble-me: #7c3aed; --shadow: 0 10px 40px rgba(0, 0, 0, .6);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; background: var(--bg); color: var(--text); line-height: 1.5; -webkit-text-size-adjust: 100%; }
a { color: var(--p); }
img { max-width: 100%; }
.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip:focus { position: fixed; top: 8px; left: 8px; z-index: 999; background: var(--p); color: #fff; padding: 8px 12px; border-radius: 8px; }
:focus-visible { outline: 3px solid var(--p2); outline-offset: 2px; }
[hidden] { display: none !important; }
.muted { color: var(--muted); } .small { font-size: .8rem; }

/* header */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); }
.nav { max-width: 1200px; margin: auto; padding: 10px 20px; display: flex; align-items: center; gap: 16px; justify-content: space-between; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 800; }
.brand img { width: 38px; height: 38px; border-radius: 10px; object-fit: cover; }
.nav-links { display: flex; gap: 20px; }
.nav-links a { color: var(--text); text-decoration: none; font-weight: 600; opacity: .85; transition: color .2s, opacity .2s; }
.nav-links a:hover { color: var(--p); opacity: 1; }
.nav-tools { display: flex; gap: 8px; align-items: center; }
.select { background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; font: inherit; max-width: 100%; }
.language-trigger { display: flex; align-items: center; gap: 8px; min-width: 0; max-width: min(260px, calc(100vw - 48px)); cursor: pointer; text-align: start; }
.language-trigger::after { content: "⌄"; flex: none; color: var(--muted); }
.language-trigger-flag { flex: none; }
.language-trigger-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.language-trigger-status { color: var(--muted); font-size: .72rem; white-space: nowrap; }
.icon-btn { background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: 10px; width: 40px; height: 40px; cursor: pointer; font-size: 1.1rem; transition: transform .2s; }
.icon-btn:hover { transform: scale(1.08); }
.mobile-menu-trigger { display: none; }
.mobile-menu {
  --menu-offscreen: 100%;
  position: fixed; inset-block: 0; inset-inline-start: auto; inset-inline-end: 0; margin: 0;
  width: min(440px, 100vw); max-width: none; height: 100vh; height: 100dvh; max-height: none;
  padding: max(24px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(28px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
  border: 0; color: #fff; background: radial-gradient(ellipse at 100% 0, #33145d 0, transparent 48%), #0b0712;
  overflow-y: auto; overscroll-behavior: contain; box-shadow: -20px 0 70px rgba(0, 0, 0, .35);
}
[dir="rtl"] .mobile-menu { --menu-offscreen: -100%; }
.mobile-menu[open] { display: flex; flex-direction: column; animation: menu-in .28s ease both; }
.mobile-menu[open].is-closing { animation: menu-out .2s ease both; }
.mobile-menu::backdrop { background: rgba(5, 2, 10, .72); }
.mobile-menu-open { overflow: hidden; }
.mobile-menu-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.mobile-menu-brand { display: flex; align-items: center; gap: 12px; font-size: 1rem; font-weight: 800; }
.mobile-menu-brand img { width: 48px; height: 48px; border-radius: 12px; object-fit: cover; }
.mobile-menu-close { flex: none; width: 48px; height: 48px; border: 1px solid #554565; border-radius: 50%; color: #fff; background: #1d1528; font: inherit; font-size: 2rem; line-height: 1; cursor: pointer; }
.mobile-menu-links { display: flex; flex-direction: column; align-items: stretch; gap: 4px; margin-block: clamp(56px, 13vh, 120px) 32px; }
.mobile-menu-links > a:not(.mobile-menu-download) { padding: 18px 0; border-bottom: 1px solid #34283f; color: #fff; font-size: clamp(1.45rem, 5vw, 2rem); font-weight: 800; letter-spacing: .04em; line-height: 1.2; text-decoration: none; text-transform: uppercase; }
.mobile-menu-links > a:not(.mobile-menu-download):hover { color: #d7bcff; }
.mobile-menu-download { display: flex; align-items: center; gap: 14px; margin-top: 40px; padding: 18px; border: 1px solid #a477ec; border-radius: 16px; background: linear-gradient(130deg, #6d28d9, #9d54ec); box-shadow: 0 12px 34px rgba(124, 58, 237, .3); color: #fff; font-size: 1rem; font-weight: 800; letter-spacing: .03em; line-height: 1.3; text-decoration: none; text-transform: uppercase; }
.mobile-menu-download:hover { background: linear-gradient(130deg, #7c3aed, #b578f3); }
.mobile-menu-download-icon { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border: 1px solid rgba(255,255,255,.55); border-radius: 12px; font-size: 1.7rem; line-height: 1; }
@keyframes menu-in { from { transform: translateX(var(--menu-offscreen)); } to { transform: translateX(0); } }
@keyframes menu-out { from { transform: translateX(0); } to { transform: translateX(var(--menu-offscreen)); } }

/* buttons */
.btn { font: inherit; font-weight: 700; border: 1px solid transparent; border-radius: 12px; padding: 10px 18px; cursor: pointer; transition: transform .15s, box-shadow .2s, background .2s; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, var(--p), var(--p2)); color: #fff; box-shadow: 0 6px 18px rgba(124, 58, 237, .35); }
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg2); }
.btn-link { background: none; color: var(--muted); text-decoration: underline; padding: 4px; }
.btn-sm { padding: 6px 12px; font-size: .85rem; } .btn-lg { padding: 14px 28px; font-size: 1.05rem; }

/* hero */
.hero { position: relative; color: #fff; background: #12062a url("../assets/city-bg.svg") center bottom / cover no-repeat; padding: clamp(56px, 12vw, 130px) 20px clamp(80px, 14vw, 170px); text-align: center; overflow: hidden; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8,4,15,.35), rgba(8,4,15,.15) 50%, var(--bg)); }
.hero-inner { position: relative; z-index: 1; max-width: 760px; margin: auto; animation: rise .7s ease both; }
.hero-logo { width: 88px; height: 88px; border-radius: 22px; object-fit: cover; margin-bottom: 18px; box-shadow: 0 8px 30px rgba(168, 85, 247, .6); }
.hero h1 { font-size: clamp(1.9rem, 5.5vw, 3.4rem); line-height: 1.15; margin-bottom: 26px; text-shadow: 0 2px 18px rgba(0,0,0,.5); }
.search { display: flex; align-items: center; gap: 8px; background: #fff; border-radius: 18px; padding: 8px 8px 8px 16px; box-shadow: var(--shadow); }
:root[data-theme="dark"] .search { background: #1a0f2e; }
.search-icon { font-size: 1.5rem; color: var(--p); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 1.1rem; color: var(--text); padding: 12px 4px; }
:root:not([data-theme="dark"]) .search input { color: #12091f; }
.platform-row { margin-top: 16px; display: flex; gap: 10px; justify-content: center; align-items: center; flex-wrap: wrap; font-weight: 600; }

/* sections */
.wrap { max-width: 1200px; margin: auto; padding: 36px 20px; }
.wrap h2 { margin-bottom: 18px; font-size: 1.6rem; }
.cat-grid, .art-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.cat-card, .art-card { text-align: start; font: inherit; color: var(--text); background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; transition: transform .2s, box-shadow .2s, border-color .2s; animation: rise .5s ease both; }
.cat-card:hover, .art-card:hover { transform: translateY(-4px); border-color: var(--p2); box-shadow: var(--shadow); }
.cat-ico { font-size: 1.8rem; }
.art-card img, .art-ph { width: 100%; height: 170px; object-fit: cover; object-position: top; border-radius: 10px; margin-bottom: 6px; background: var(--bg2); }
.art-ph { display: grid; place-items: center; font-size: 3rem; }
.tag { font-size: .7rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--p); }
#listView .btn { margin-bottom: 14px; }
.cta { text-align: center; background: var(--bg2); border-radius: 24px; margin: 20px auto 40px; max-width: 1160px; }
.site-footer { border-top: 1px solid var(--border); padding: 22px 20px; display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; color: var(--muted); }
.privacy-policy { max-width: 880px; }
.privacy-policy h1 { margin-bottom: 8px; }
.privacy-policy h2 { margin: 28px 0 8px; }
.privacy-policy p, .privacy-policy ul { margin: 12px 0; }
.privacy-policy ul { padding-inline-start: 24px; }

/* dialog */
.dialog { border: 1px solid var(--border); border-radius: 20px; background: var(--card); color: var(--text); width: min(680px, 94vw); max-height: 90vh; overflow: auto; padding: 22px; margin: auto; box-shadow: var(--shadow); }
.dialog::backdrop { background: rgba(8, 4, 15, .65); backdrop-filter: blur(3px); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.language-dialog { border: 1px solid var(--border); border-radius: 18px; background: var(--card); color: var(--text); width: min(480px, calc(100vw - 24px)); max-height: min(88vh, 700px); max-height: min(88dvh, 700px); overflow: hidden; padding: 16px; margin: auto; box-shadow: var(--shadow); }
.language-dialog::backdrop { background: rgba(8, 4, 15, .65); backdrop-filter: blur(3px); }
.language-dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.language-dialog-head h2 { font-size: 1.25rem; }
.language-search-label { display: block; margin-bottom: 5px; font-size: .9rem; font-weight: 700; }
.language-search { width: 100%; min-height: 44px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); color: var(--text); font: inherit; padding: 8px 10px; }
.language-list { max-height: min(60vh, 480px); max-height: min(60dvh, 480px); overflow-y: auto; overscroll-behavior: contain; margin-top: 10px; padding: 2px; }
.language-group { border: 0; min-width: 0; padding: 0; }
.language-group + .language-group { margin-top: 10px; }
.language-group legend { width: 100%; padding: 4px 2px; font-size: .85rem; font-weight: 800; }
.language-option { display: grid; grid-template-columns: 20px 26px minmax(0, 1fr) max-content; align-items: center; gap: 8px; padding: 8px; border: 1px solid transparent; border-radius: 10px; cursor: pointer; }
.language-option:hover, .language-option.is-selected { border-color: var(--border); background: var(--bg2); }
.language-option.is-selected { border-color: var(--p2); }
.language-option.is-unavailable { color: var(--muted); cursor: not-allowed; }
.language-option input { width: 18px; height: 18px; accent-color: var(--p); }
.language-flag { font-size: 1.2rem; text-align: center; }
.language-option-label { display: flex; flex-direction: column; min-width: 0; }
.language-name { overflow-wrap: anywhere; }
.language-code { color: var(--muted); font-size: .74rem; }
.language-status { color: var(--muted); font-size: .72rem; text-align: end; }
.language-empty { color: var(--muted); padding: 16px 4px; }
.dialog-img { border-radius: 12px; margin-bottom: 14px; max-height: 60vh; object-fit: contain; display: block; margin-inline: auto; }
.steps { padding-inline-start: 22px; display: grid; gap: 8px; }

/* support widget */
.fab { position: fixed; right: 20px; bottom: 20px; z-index: 90; width: 62px; height: 62px; border-radius: 50%; border: 0; cursor: pointer; background: linear-gradient(135deg, var(--p), var(--p2)); color: #fff; font-size: 1.6rem; box-shadow: 0 10px 30px rgba(124, 58, 237, .55); transition: transform .2s; }
.fab:hover { transform: scale(1.08); } .fab.is-open { transform: scale(.9); }
.fab-badge, .wp-dot { position: absolute; top: -2px; right: -2px; min-width: 22px; height: 22px; border-radius: 11px; background: #ef4444; color: #fff; font-size: .75rem; font-weight: 800; display: grid; place-items: center; padding: 0 5px; }
.wp-dot { top: 2px; right: 2px; min-width: 10px; height: 10px; padding: 0; }
.wp { position: fixed; right: 20px; bottom: 96px; z-index: 91; width: min(400px, calc(100vw - 24px)); height: min(640px, calc(100dvh - 120px)); display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow); overflow: hidden; animation: pop .22s ease both; }
.wp-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: linear-gradient(135deg, #1a0536, var(--p)); color: #fff; }
.wp-logo { width: 32px; height: 32px; border-radius: 9px; object-fit: cover; }
.wp-title { flex: 1; font-weight: 800; }
.wp-icon-btn { position: relative; background: rgba(255,255,255,.15); color: #fff; border: 0; border-radius: 10px; width: 34px; height: 34px; cursor: pointer; font-size: 1rem; }
.wp-body { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 12px; background: var(--card); }
.msgs { display: flex; flex-direction: column; gap: 10px; }
.msgs.thread { max-height: 46vh; overflow-y: auto; }
.bubble { background: var(--bubble); border-radius: 16px 16px 16px 4px; padding: 10px 14px; white-space: pre-wrap; overflow-wrap: anywhere; animation: rise .35s ease both; }
.msg { display: flex; flex-direction: column; gap: 2px; max-width: 88%; }
.msg.me { align-self: flex-end; align-items: flex-end; }
.msg.me .bubble { background: var(--bubble-me); color: var(--bubble-me-text); border-radius: 16px 16px 4px 16px; }
.msg-who { font-size: .72rem; font-weight: 700; color: var(--muted); }
.att { display: block; max-width: 100%; max-height: 220px; border-radius: 10px; margin-top: 8px; }
.wp-section { font-weight: 800; margin-top: 4px; }
.chips { display: grid; gap: 8px; }
.chip { text-align: left; font: inherit; color: var(--text); background: var(--bg2); border: 1px solid var(--border); border-radius: 14px; padding: 11px 14px; cursor: pointer; transition: border-color .2s, transform .15s; }
.chip:hover { border-color: var(--p2); transform: translateX(3px); }
.wp-actions { display: flex; flex-direction: column; gap: 8px; align-items: stretch; margin-top: auto; }
.form { display: flex; flex-direction: column; gap: 8px; }
.form label { font-weight: 700; font-size: .85rem; }
.form input:not([type=checkbox]):not([type=file]), .form textarea, .form select { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 10px; width: 100%; }
.form textarea { resize: vertical; }
.form-err { color: #ef4444; font-size: .85rem; min-height: 0; }
.demo-note { background: rgba(124, 58, 237, .12); border: 1px dashed var(--p2); border-radius: 10px; padding: 8px 10px; font-size: .8rem; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab { font: inherit; font-weight: 700; background: transparent; color: var(--muted); border: 0; border-bottom: 3px solid transparent; padding: 8px 12px; cursor: pointer; }
.tab.on { color: var(--p); border-color: var(--p); }
.cat-pill { background: var(--bg2); border: 1px solid var(--border); border-radius: 999px; padding: 6px 12px; font-size: .85rem; font-weight: 700; }
.file-list { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.file-chip { background: var(--bg2); border-radius: 999px; padding: 3px 4px 3px 10px; font-size: .78rem; display: inline-flex; gap: 6px; align-items: center; }
.file-chip button { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 1rem; }
.tlist { display: flex; flex-direction: column; gap: 8px; }
.titem { text-align: left; font: inherit; color: var(--text); background: var(--bg2); border: 1px solid var(--border); border-radius: 14px; padding: 10px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; transition: border-color .2s; }
.titem:hover, .titem.sel { border-color: var(--p2); } .titem.unread { border-left: 4px solid var(--p); }
.titem-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.titem-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-head { display: flex; flex-direction: column; gap: 2px; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.thread-subj { font-weight: 700; }
.composer textarea { min-height: 56px; }
.pill { font-size: .7rem; font-weight: 800; padding: 2px 9px; border-radius: 999px; background: var(--bg2); border: 1px solid var(--border); width: fit-content; }
.st-open { background: #dbeafe; color: #1e40af; border-color: transparent; } .st-pending { background: #fef3c7; color: #92400e; border-color: transparent; }
.st-in_progress { background: #ede9fe; color: #5b21b6; border-color: transparent; } .st-resolved { background: #dcfce7; color: #166534; border-color: transparent; }
.st-closed { background: #e5e7eb; color: #374151; border-color: transparent; }
.pr-urgent { background: #fee2e2; color: #991b1b; border-color: transparent; } .pr-high { background: #ffedd5; color: #9a3412; border-color: transparent; }

/* staff */
.staff-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.card.narrow { max-width: 420px; margin: 40px auto; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.split { display: grid; gap: 16px; grid-template-columns: minmax(280px, 1fr) 2fr; align-items: start; }
.detail { position: sticky; top: 80px; display: flex; flex-direction: column; gap: 12px; }
.detail .msgs.thread { max-height: 50vh; }
.stats { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-bottom: 16px; }
.stat { background: linear-gradient(135deg, var(--p-dark), var(--p)); color: #fff; border-radius: var(--radius); padding: 20px; }
.stat .muted { color: #e9ddff; } .stat-n { font-size: 2.4rem; font-weight: 800; }
.two { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.bar-row { display: grid; grid-template-columns: 110px 1fr 30px; gap: 8px; align-items: center; margin-top: 8px; }
.bar { background: var(--bg2); border-radius: 99px; height: 10px; overflow: hidden; } .bar i { display: block; height: 100%; background: var(--p); }
.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; } .tbl th, .tbl td { text-align: left; padding: 8px; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.checks { display: flex; gap: 12px; flex-wrap: wrap; } .check { display: flex; gap: 6px; align-items: center; font-weight: 600; }

@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

@media (max-width: 860px) { .split { grid-template-columns: 1fr; } .detail { position: static; } .nav-links { display: none; } }
@media (max-width: 860px) {
  .public-page .nav-links { display: none; }
  .mobile-menu-trigger { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; width: 44px; height: 44px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); cursor: pointer; }
  .mobile-menu-trigger span { display: block; width: 20px; height: 2px; border-radius: 2px; background: var(--text); }
  .public-page section[id] { scroll-margin-top: 170px; }
}
@media (max-width: 520px) {
  .public-page .brand { flex: 1; }
  .public-page .mobile-menu-trigger { order: 2; }
  .public-page .nav-tools { width: 100%; order: 3; }
  .public-page .language-trigger { flex: 1; max-width: none; min-height: 44px; }
  .public-page .nav-tools .icon-btn { flex: none; width: 44px; height: 44px; }
  .public-page .platform-row { flex-direction: column; align-items: stretch; text-align: start; }
  .public-page .platform-row .select { width: 100%; min-height: 44px; }
  .wp { right: 0; bottom: 0; width: 100vw; height: 100dvh; border-radius: 0; }
  .fab { right: 14px; bottom: 14px; }
  .fab.is-open { display: none; }
  .search { flex-wrap: wrap; } .search .btn { width: 100%; }
  .language-dialog { width: calc(100vw - 20px); max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); border-radius: 16px; padding: 14px; }
  .language-option { grid-template-columns: 20px 24px minmax(0, 1fr) max-content; gap: 6px; padding: 7px 5px; }
  .language-status { font-size: .68rem; }
}
.tbl-wrap { overflow-x: auto; }
.tbl-wrap .tbl { min-width: 560px; }
.tbl-wrap .tbl th, .tbl-wrap .tbl td { overflow-wrap: normal; }

/* Public pages use logical alignment and keep the skip link on the reading edge. */
[dir="rtl"] .skip:focus { left: auto; right: 8px; }
[dir="rtl"] .search input { text-align: start; }
[dir="rtl"] .privacy-policy { text-align: start; }
