/* Final portal-wide visual refinements. */
@media (min-width: 761px) {
  .sidebar {
    position: sticky !important;
    top: 64px !important;
    align-self: flex-start;
    max-height: calc(100vh - 64px);
    overflow-y: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
  }

  .sidebar::-webkit-scrollbar { width: 0; height: 0; display: none; }
}

@media (max-width: 760px) {
  .sidebar {
    position: fixed !important;
    z-index: 70;
    top: 51px !important;
    left: 0;
    bottom: 0;
    align-self: auto;
    width: 260px !important;
    max-height: calc(100vh - 51px);
    min-height: 0 !important;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    box-shadow: 16px 0 35px rgba(0, 0, 0, .34);
    scrollbar-width: none;
  }

  .sidebar::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
  }

  .app-shell:not(.sidebar-collapsed) .page {
    margin-left: 260px !important;
  }

  .app-shell.sidebar-collapsed .sidebar {
    width: 0 !important;
    flex-basis: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    border-right: 0 !important;
    box-shadow: none;
    overflow: visible;
  }

  .app-shell.sidebar-collapsed .page {
    margin-left: 0 !important;
  }

  .topbar {
    flex-direction: row !important;
    align-items: center !important;
  }

  .topbar .account-nav {
    margin-left: auto;
  }

  .account-menu summary {
    width: 42px !important;
    height: 42px !important;
    max-width: none !important;
    justify-content: center !important;
    gap: 0 !important;
    overflow: visible !important;
  }

  .account-menu summary::after,
  .header-user-name,
  .header-menu-arrow {
    display: none !important;
  }

  .header-avatar-wrap {
    width: 38px !important;
    height: 38px !important;
    flex: 0 0 38px !important;
  }

  .header-user-avatar {
    width: 38px !important;
    height: 38px !important;
  }

  .account-menu-popover.online-popover {
    right: 0 !important;
  }

  body:has(.app-shell:not(.sidebar-collapsed)) .topbar .account-nav {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
}

/* MIS access matrix */
.mis-access-page { width: min(1100px, 100%); margin: 0 auto; }
.mis-access-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
  padding: 27px 29px;
  border: 1px solid rgba(255,214,0,.2);
  border-radius: 22px;
  background: radial-gradient(circle at 90% 0, rgba(255,214,0,.12), transparent 38%), #141414;
}
.mis-access-hero h1 { margin: 3px 0 7px; font-size: clamp(34px,5vw,54px); }
.mis-access-hero p:last-child { max-width: 700px; margin: 0; color: #999; }
.mis-access-source { padding: 7px 11px; border: 1px solid #403a12; border-radius: 999px; color: var(--yellow); font-size: 12px; font-weight: 850; white-space: nowrap; }
.mis-access-form { display: grid; gap: 16px; }
.mis-access-section { padding: 23px; border: 1px solid #292929; border-radius: 20px; background: #121212; }
.mis-access-heading { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.mis-access-heading > span { display: grid; width: 42px; height: 42px; place-items: center; border: 1px solid rgba(255,214,0,.4); border-radius: 13px; background: rgba(255,214,0,.08); color: var(--yellow); font-weight: 950; }
.mis-access-heading h2 { margin: 0 0 3px; }
.mis-access-heading p { margin: 0; color: #888; font-size: 13px; }
.mis-access-list { display: grid; gap: 10px; }
.mis-access-option { display: grid; grid-template-columns: minmax(260px,.8fr) minmax(0,1.7fr); align-items: center; gap: 18px; padding: 17px; border: 1px solid #292929; border-radius: 15px; background: #0d0d0d; }
.mis-access-option h3 { margin: 0; color: #f2f2f2; font-size: 15px; line-height: 1.45; }
.mis-access-groups { display: flex; flex-wrap: wrap; gap: 7px; }
.mis-access-chip { position: relative; cursor: pointer; }
.mis-access-chip input { position: absolute; opacity: 0; pointer-events: none; }
.mis-access-chip span { display: inline-flex; min-height: 34px; align-items: center; padding: 0 11px; border: 1px solid #333; border-radius: 9px; background: #171717; color: #999; font-size: 12px; font-weight: 800; transition: .16s ease; }
.mis-access-chip input:checked + span { border-color: rgba(255,214,0,.65); background: rgba(255,214,0,.12); color: var(--yellow); box-shadow: inset 0 0 0 1px rgba(255,214,0,.08); }
.mis-access-chip:hover span { border-color: #666; color: #fff; }
.mis-access-save { position: sticky; bottom: 12px; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 18px; border: 1px solid rgba(255,214,0,.35); border-radius: 16px; background: rgba(18,18,18,.96); box-shadow: 0 14px 40px rgba(0,0,0,.45); backdrop-filter: blur(12px); }
.mis-access-save p { margin: 0; color: #8d8d8d; font-size: 13px; }
@media (max-width: 760px) {
  .mis-access-hero { align-items: flex-start; flex-direction: column; padding: 22px; }
  .mis-access-option { grid-template-columns: 1fr; gap: 12px; }
  .mis-access-section { padding: 17px; }
  .mis-access-save { align-items: stretch; flex-direction: column; }
  .mis-access-save .button { justify-content: center; }
}

/* Global mourning mode and funeral ribbon */
body.mourning-mode {
  --yellow: #aaa;
  --black: #050505;
  --panel: #101010;
  --line: #303030;
  --muted: #858585;
  background:
    radial-gradient(circle at 50% -10%, #181818 0, #090909 36%, #030303 78%),
    #030303;
  color: #d2d2d2;
}
body.mourning-mode::after {
  content: '';
  position: fixed;
  z-index: 999;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 42%, rgba(0,0,0,.34) 100%);
  pointer-events: none;
}
body.mourning-mode .topbar {
  border-bottom-color: #333!important;
  background: linear-gradient(180deg,#0d0d0d,#050505)!important;
  box-shadow: 0 8px 30px rgba(0,0,0,.38);
}
body.mourning-mode .sidebar {
  border-right-color: #292929!important;
  background: linear-gradient(180deg,#0a0a0a,#030303)!important;
}
body.mourning-mode .nav-section,
body.mourning-mode .card,
body.mourning-mode .form-card,
body.mourning-mode .profile-panel,
body.mourning-mode .mis-report-card,
body.mourning-mode .mis-access-section,
body.mourning-mode .profile-edit-section,
body.mourning-mode .developer-menu-card {
  border-color: #303030!important;
  background: linear-gradient(145deg,#141414,#090909)!important;
  box-shadow: inset 0 1px rgba(255,255,255,.025), 0 12px 32px rgba(0,0,0,.18);
}
body.mourning-mode .eyebrow,
body.mourning-mode a:not(.button):not(.danger),
body.mourning-mode th,
body.mourning-mode .number,
body.mourning-mode .badge {
  color: #aaa!important;
}
body.mourning-mode h1,
body.mourning-mode h2,
body.mourning-mode h3,
body.mourning-mode strong { color: #e0e0e0; }
body.mourning-mode .button,
body.mourning-mode button.button {
  border: 1px solid #555!important;
  background: linear-gradient(180deg,#3a3a3a,#202020)!important;
  color: #eee!important;
  box-shadow: 0 7px 20px rgba(0,0,0,.3);
}
body.mourning-mode .button:hover,
body.mourning-mode button.button:hover { background: linear-gradient(180deg,#4a4a4a,#292929)!important; }
body.mourning-mode input,
body.mourning-mode textarea,
body.mourning-mode select {
  border-color: #484848!important;
  background: #080808!important;
  color: #ddd!important;
}
body.mourning-mode img { filter: grayscale(1) saturate(.15) brightness(.78); }
body.mourning-mode .header-online-dot,
body.mourning-mode .user-online-dot,
body.mourning-mode .home-online { filter: grayscale(1); box-shadow: none!important; }
body.mourning-mode .nav-section-links a.active,
body.mourning-mode .mis-tabs a.active,
body.mourning-mode .mis-list-card.active {
  border-color: #666!important;
  background: linear-gradient(135deg,#252525,#111)!important;
  color: #ddd!important;
}
body.mourning-mode .sidebar-donate-button { filter: grayscale(1) brightness(.72); }
body.mourning-mode .flash.error { color: #fff; filter: none; }

.mourning-mode .topbar { position: relative; }
.mourning-banner {
  position: absolute;
  z-index: 5;
  top: 50%;
  left: 50%;
  display: flex;
  min-width: 250px;
  height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 26px 0 15px;
  border: 1px solid #303030;
  background: linear-gradient(180deg,#151515,#050505);
  color: #d7d7d7;
  clip-path: polygon(0 50%,8% 0,92% 0,100% 50%,92% 100%,8% 100%);
  transform: translate(-50%,-50%);
  box-shadow: 0 5px 18px rgba(0,0,0,.55), inset 0 1px rgba(255,255,255,.04);
  pointer-events: none;
}
.mourning-banner strong {
  font-family: Georgia,'Times New Roman',serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
  text-shadow: 0 1px 2px #000;
}
.mourning-banner .mourning-ribbon { margin: 0 -2px 0 0; transform: scale(.68); }

.flash.error {
  position: fixed;
  z-index: 1000;
  top: 68px;
  right: 18px;
  width: min(430px, calc(100vw - 36px));
  margin: 0;
  border: 1px solid rgba(255,110,110,.42);
  background: rgba(72,30,30,.97);
  box-shadow: 0 18px 48px rgba(0,0,0,.55);
  animation: portal-error-in .24s ease-out;
}
@keyframes portal-error-in { from { opacity:0; transform:translateX(24px); } to { opacity:1; transform:none; } }

.mourning-ribbon {
  position: relative;
  width: 38px;
  height: 46px;
  flex: 0 0 38px;
  margin-left: 8px;
  filter: drop-shadow(0 3px 3px rgba(0,0,0,.55));
}
.mourning-ribbon::before {
  content: '';
  position: absolute;
  z-index: 2;
  top: 2px;
  left: 7px;
  width: 18px;
  height: 25px;
  border: 6px solid #050505;
  border-radius: 55% 55% 48% 48%;
  transform: rotate(-5deg);
  box-shadow: inset 1px 0 #303030, 1px 0 #303030;
}
.mourning-ribbon::after,
.mourning-ribbon > span::before {
  content: '';
  position: absolute;
  z-index: 1;
  top: 23px;
  width: 11px;
  height: 23px;
  background: linear-gradient(90deg,#050505,#202020 52%,#050505);
  clip-path: polygon(0 0,100% 0,88% 100%,50% 84%,12% 100%);
}
.mourning-ribbon::after { left: 10px; transform: rotate(17deg); }
.mourning-ribbon > span::before { left: 21px; transform: rotate(-18deg); }
.mourning-ribbon > span::after {
  content: '';
  position: absolute;
  z-index: 3;
  top: 24px;
  left: 15px;
  width: 13px;
  height: 9px;
  border-radius: 50%;
  background: #090909;
  transform: rotate(-7deg);
}

.appearance-settings-page { width: min(920px,100%); margin: 0 auto; }
.appearance-settings-hero { margin: 18px 0; padding: 27px; border: 1px solid #292929; border-radius: 21px; background: #141414; }
.appearance-settings-hero h1 { margin: 3px 0 7px; font-size: clamp(34px,5vw,52px); }
.appearance-settings-hero p:last-child { margin: 0; color: #949494; }
.appearance-option-card { display: grid; grid-template-columns: 145px minmax(0,1fr) auto; align-items: center; gap: 21px; padding: 24px; border: 1px solid #323232; border-radius: 20px; background: linear-gradient(145deg,#171717,#101010); }
.appearance-option-preview { display: grid; width: 130px; min-height: 112px; place-items: center; gap: 2px; padding: 10px; border: 1px solid #303030; border-radius: 17px; background: #090909; color:#bbb; text-align:center; }
.appearance-option-preview strong { font: 700 11px/1.3 Georgia,serif; letter-spacing:.04em; text-transform:uppercase; }
.mourning-ribbon-preview { width: 57px; height: 69px; margin: 0; transform: scale(1.15); }
.appearance-option-copy h2 { margin: 0 0 7px; font-size: 25px; }
.appearance-option-copy p { margin: 0; color: #999; line-height: 1.55; }
.appearance-switch { display: grid; grid-template-columns: 54px auto; align-items: center; gap: 10px; cursor: pointer; }
.appearance-switch input { position: absolute; opacity: 0; pointer-events: none; }
.appearance-switch > span { position: relative; width: 54px; height: 30px; border: 1px solid #444; border-radius: 999px; background: #252525; transition: .2s ease; }
.appearance-switch > span::after { content:''; position:absolute; top:4px; left:4px; width:20px; height:20px; border-radius:50%; background:#777; transition:.2s ease; }
.appearance-switch input:checked + span { border-color:#777; background:#050505; box-shadow:0 0 0 3px rgba(255,255,255,.05); }
.appearance-switch input:checked + span::after { left:28px; background:#e0e0e0; }
.appearance-switch b { color:#aaa; font-size:13px; }
.appearance-save { grid-column: 1 / -1; display:flex; justify-content:flex-end; padding-top:17px; border-top:1px solid #292929; }
@media(max-width:700px){
  .mourning-banner { right: 54px; left: 54px; min-width: 0; height: 38px; padding: 0 13px; transform: translateY(-50%); }
  .mourning-banner strong { overflow:hidden; font-size:11px; letter-spacing:.035em; text-overflow:ellipsis; }
  .mourning-banner .mourning-ribbon { display:none; }
  .appearance-option-card { grid-template-columns: 1fr; text-align:center; }
  .appearance-option-preview { margin:0 auto; }
  .appearance-switch { justify-content:center; }
  .appearance-save { justify-content:stretch; }
  .appearance-save .button { width:100%; justify-content:center; }
}

/* Audit log */
.audit-page { width:min(1120px,100%); margin:0 auto; }
.audit-hero { display:flex; align-items:flex-end; justify-content:space-between; gap:20px; margin:18px 0; padding:26px 28px; border:1px solid #303030; border-radius:21px; background:radial-gradient(circle at 90% 0,rgba(255,214,0,.08),transparent 36%),#141414; }
.audit-hero h1 { margin:3px 0 6px; font-size:clamp(34px,5vw,52px); }
.audit-hero p:last-child { margin:0; color:#999; }
.audit-hero > span { padding:7px 12px; border:1px solid #45400f; border-radius:999px; color:var(--yellow); font-size:12px; font-weight:850; white-space:nowrap; }
.audit-filters { display:grid; grid-template-columns:minmax(260px,1fr) 190px auto auto; gap:10px; margin-bottom:16px; padding:14px; border:1px solid #292929; border-radius:15px; background:#111; }
.audit-filters input,.audit-filters select { margin:0; }
.audit-list { display:grid; gap:10px; margin:0; }
.audit-entry { display:grid; grid-template-columns:42px minmax(0,1fr); gap:14px; padding:17px; border:1px solid #2d2d2d; border-radius:16px; background:linear-gradient(145deg,#151515,#0d0d0d); }
.audit-entry-mark { display:grid; width:38px; height:38px; place-items:center; border:1px solid #555; border-radius:11px; background:#191919; color:#ddd; font-size:20px; font-weight:950; }
.audit-create .audit-entry-mark { border-color:#315d38; color:#87d693; }
.audit-update .audit-entry-mark { border-color:#60581e; color:#ead96a; }
.audit-delete .audit-entry-mark { border-color:#633535; color:#ef8888; }
.audit-entry-title { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; }
.audit-entry-title h2 { margin:0; font-size:17px; }
.audit-entry-title time { color:#aaa; font:750 12px/1.4 ui-monospace,Consolas,monospace; white-space:nowrap; }
.audit-meta { display:flex; flex-wrap:wrap; gap:6px 17px; margin-top:9px; color:#8e8e8e; font-size:12px; }
.audit-meta b { color:#c8c8c8; }
.audit-details { margin-top:12px; border-top:1px solid #292929; }
.audit-details summary { width:max-content; padding-top:10px; color:var(--yellow); font-size:12px; font-weight:850; cursor:pointer; }
.audit-change-list { display:grid; gap:6px; margin-top:10px; }
.audit-change-list > div { display:grid; grid-template-columns:minmax(100px,.5fr) minmax(0,1fr) 24px minmax(0,1fr); align-items:start; gap:8px; padding:9px; border-radius:9px; background:#090909; font-size:12px; }
.audit-change-list code { color:#d4d4d4; word-break:break-word; }
.audit-change-list span { max-height:140px; overflow:auto; padding:5px 7px; border-radius:6px; white-space:pre-wrap; word-break:break-word; }
.audit-before { background:rgba(150,50,50,.13); color:#d7a0a0; }
.audit-after { background:rgba(60,145,75,.13); color:#a8d7ad; }
.audit-change-list i { color:#666; font-style:normal; text-align:center; }
.audit-pagination { display:flex; align-items:center; justify-content:center; gap:18px; margin-top:18px; }
.audit-pagination a { padding:8px 12px; border:1px solid #3a3a3a; border-radius:9px; text-decoration:none; }
.audit-pagination span { color:#888; font-size:13px; }
@media(max-width:760px){
  .audit-hero { align-items:flex-start; flex-direction:column; padding:21px; }
  .audit-filters { grid-template-columns:1fr; }
  .audit-entry { grid-template-columns:1fr; }
  .audit-entry-title { flex-direction:column; gap:5px; }
  .audit-change-list > div { grid-template-columns:1fr; }
  .audit-change-list i { transform:rotate(90deg); }
}

/* Sidebar: polished compact navigation. */
.sidebar {
  background:
    radial-gradient(circle at 80% 0%, rgba(255,214,0,.055), transparent 34%),
    linear-gradient(180deg, #0d0d0d, #090909) !important;
}

.sidebar-title {
  margin-bottom: 14px !important;
  color: #6f7480 !important;
  font-size: 10px !important;
  letter-spacing: .18em !important;
}

.side-nav {
  gap: 8px !important;
}

.nav-section {
  overflow: hidden;
  padding: 5px !important;
  border: 1px solid rgba(255,255,255,.055) !important;
  border-radius: 14px !important;
  background:
    linear-gradient(135deg, rgba(255,255,255,.035), rgba(255,255,255,.01)),
    rgba(18,18,18,.72) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035);
}

.nav-section summary {
  display: flex !important;
  min-height: 25px !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 3px 5px 5px !important;
  border: 0 !important;
  border-radius: 10px !important;
  background: transparent !important;
  color: #9ca3af !important;
  font-size: 10px !important;
  line-height: 1.15 !important;
  letter-spacing: .14em !important;
}

.nav-section summary::-webkit-details-marker {
  display: none;
}

.nav-section summary::after {
  content: "⌄";
  display: grid;
  width: 18px;
  height: 18px;
  margin-left: 8px;
  place-items: center;
  border-radius: 999px;
  background: rgba(255,214,0,.08);
  color: var(--yellow);
  font-size: 12px;
  line-height: 1;
  transition: transform .16s ease, background .16s ease;
}

.nav-section[open] summary {
  color: #e5e7eb !important;
}

.nav-section[open] summary::after {
  transform: rotate(180deg);
  background: rgba(255,214,0,.15);
}

.nav-section-links {
  gap: 2px !important;
  padding: 2px 0 0 !important;
}

.side-nav a {
  position: relative;
  width: 100% !important;
  min-height: 28px !important;
  margin-left: 0 !important;
  padding: 5px 8px 5px 12px !important;
  border: 0 !important;
  border-radius: 10px !important;
  color: #d9d9d9 !important;
  font-size: 13px !important;
  line-height: 1.2 !important;
  background: transparent !important;
}

.side-nav a::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 50%;
  width: 3px;
  height: 0;
  border-radius: 999px;
  background: var(--yellow);
  box-shadow: 0 0 10px rgba(255,214,0,.55);
  transform: translateY(-50%);
  transition: height .16s ease;
}

.side-nav a.active,
.side-nav a:hover {
  background: linear-gradient(90deg, rgba(255,214,0,.20), rgba(255,214,0,.075)) !important;
  color: #fff !important;
  box-shadow: inset 0 0 0 1px rgba(255,214,0,.12) !important;
}

.side-nav a.active {
  color: var(--yellow) !important;
  font-weight: 900 !important;
}

.side-nav a.active::before,
.side-nav a:hover::before {
  height: 15px;
}

.nav-section.binds-divider {
  position: relative;
  margin-top: 24px;
}

.nav-section.binds-divider::before {
  content: "";
  position: absolute;
  left: 5px;
  right: 5px;
  top: -14px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--yellow), rgba(255,214,0,.28));
  box-shadow: 0 0 14px rgba(255,214,0,.25);
}
.sidebar-donate-button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  padding: 13px 12px;
  border: 1px solid rgba(255, 214, 0, .42);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255, 214, 0, .18), rgba(255, 159, 28, .08)), #111;
  color: #fff;
  text-align: left;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}
.sidebar-donate-button:hover,
.sidebar-donate-button:focus-visible {
  transform: translateY(-1px);
  border-color: var(--yellow);
  background: linear-gradient(135deg, rgba(255, 214, 0, .28), rgba(255, 159, 28, .14)), #171717;
  outline: none;
}
.sidebar-donate-button span {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  place-items: center;
  border-radius: 9px;
  background: #ffd600;
  color: #070707;
  font-weight: 1000;
}
.sidebar-donate-button strong {
  color: #fff;
  font-size: 13px;
  line-height: 1.2;
}

.roleplays-nav-link {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  border: 1px solid rgba(255, 210, 0, .42);
  background: linear-gradient(135deg, rgba(255, 210, 0, .14), rgba(255, 210, 0, .035));
  color: var(--yellow) !important;
}
.roleplays-nav-link span { font-size: 16px; }
.roleplays-catalogs { display: grid; gap: 18px; }
.roleplays-catalog {
  overflow: hidden;
  border: 1px solid #3c3c3c;
  border-radius: 16px;
  background: linear-gradient(145deg, #191919, #101010);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .24);
}
.roleplays-catalog-head {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 18px 20px;
  border-bottom: 1px solid #333;
}
.roleplays-catalog-head span {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 11px;
  background: var(--yellow);
  color: #111;
  font-weight: 900;
}
.roleplays-catalog-head h2 { margin: 0; }
.roleplays-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 16px; }
.roleplays-links a {
  display: flex;
  min-height: 58px;
  flex-direction: column;
  justify-content: center;
  padding: 12px 15px;
  border: 1px solid #353535;
  border-radius: 11px;
  background: #161616;
  color: #f1f1f1;
  text-decoration: none;
  font-weight: 800;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.roleplays-links a:hover { transform: translateY(-2px); border-color: var(--yellow); background: #211f14; color: var(--yellow); }
.roleplays-links small { margin-top: 4px; color: #999; font-weight: 600; }
@media (max-width: 720px) { .roleplays-links { grid-template-columns: 1fr; } }
.roleplays-sidebar .roleplays-nav-link { margin-bottom: 14px; }
.roleplays-sidebar .nav-section summary { color: #f4f4f4; }
.roleplays-sidebar .nav-section-links a.active {
  color: var(--yellow);
  background: #29250d;
  border-left-color: var(--yellow);
}
.roleplays-welcome {
  display: flex;
  align-items: center;
  gap: 22px;
  max-width: 880px;
  padding: 28px;
  border: 1px solid #4b4311;
  border-radius: 18px;
  background: linear-gradient(135deg, #181818, #201e13);
}
.roleplays-welcome h2 { margin: 0 0 8px; }
.roleplays-welcome p { margin: 0; color: #aaa; line-height: 1.65; }
.roleplays-welcome-mark {
  display: grid;
  place-items: center;
  width: 82px;
  height: 82px;
  flex: 0 0 82px;
  border-radius: 18px;
  background: var(--yellow);
  color: #050505;
  font-size: 22px;
  font-weight: 1000;
}
@media (max-width: 720px) {
  .roleplays-welcome { align-items: flex-start; padding: 20px; }
  .roleplays-welcome-mark { width: 58px; height: 58px; flex-basis: 58px; font-size: 16px; }
}

/* The course selector follows the yellow/black hospital palette. */
.course-select { border-color: #5a5218; background: #0c0c0c; }
.course-select[open] { border-color: var(--yellow); box-shadow: 0 0 0 3px rgba(255, 210, 0, .12); }
.course-select[open] summary { border-bottom-color: #5a5218; }
.course-select summary:after { color: var(--yellow) !important; }
.course-select-options { background: #151515; }
.course-select-options .checkbox:hover { background: #28230c; }
.course-select-options .checkbox:has(input:checked) { background: #3d3507; color: #fff; }
.course-select-options .checkbox:nth-child(even):not(:has(input:checked)) { background: #111; }
.course-select-options input[type=checkbox] { accent-color: var(--yellow) !important; }

.profile-online-status { color: #33d17a; font-weight: 800; }
.profile-actions form { margin: 0; }
/* All profiles are public; leave no visibility setting in the personal form. */
label:has(input[name="is_profile_public"]) { display: none !important; }

.home-action-donate .home-action-icon {
  background: linear-gradient(135deg, #ffd600, #ff9f1c);
  color: #070707;
}

.donate-modal-window {
  width: min(560px, calc(100vw - 32px));
}

.donate-widget-wrap {
  display: grid;
  justify-items: center;
  margin-top: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 214, 0, .22);
  border-radius: 16px;
  background: #fff;
}

.donate-widget-wrap iframe {
  display: block;
  max-width: 100%;
}

@media (max-width: 560px) {
  .donate-widget-wrap iframe {
    width: 100%;
  }
}

/* News author: a selected profile plus a separate, fixed @ sign. */
.news-author-picker { display: block; margin: 16px 0; font-weight: 800; }
.news-author-visible-list { display: grid; gap: 7px; margin-top: 7px; }
.news-author-visible-list input { position: absolute; inline-size: 1px; block-size: 1px; opacity: 0; pointer-events: none; }
.news-author-visible-list label { display: flex !important; align-items: center; justify-content: space-between; gap: 16px; min-height: 48px; margin: 0 !important; padding: 11px 14px; border: 1px solid #38331a; border-radius: 8px; background: #101010; color: #eee; cursor: pointer; transition: border-color .18s ease, background .18s ease, transform .18s ease; }
.news-author-visible-list label:hover { border-color: #766c20; background: #18170d; transform: translateX(2px); }
.news-author-visible-list label span { color: var(--yellow); white-space: nowrap; }
.news-author-visible-list input:checked + label { border-color: var(--yellow); background: #302a09; color: #fff; box-shadow: inset 4px 0 0 var(--yellow); }
.news-author-visible-list input:focus-visible + label { outline: 2px solid var(--yellow); outline-offset: 2px; }
.news-author-admin { margin-top: 24px; }
.news-author-admin h2 { margin-top: 0; }
.news-author-list { display: grid; gap: 8px; margin: 16px 0; }
.news-author-list .news-author-row { display: flex; align-items: center; gap: 16px; padding: 12px 14px; border: 1px solid #38331a; border-radius: 8px; background: #101010; }
.news-author-row strong { margin-right: auto; }
.news-author-row form { margin: 0; }
.news-author-list span { color: var(--yellow); white-space: nowrap; }
.news-author-add-form { display: grid; gap: 12px; max-width: 620px; }

/* Document generators and reusable automatic-order signatures. */
.generator-page { max-width: 1180px; margin: 0 auto; }
.page-heading { margin-bottom: 24px; }
.page-heading h1 { margin: 4px 0 8px; }
.page-heading > p:not(.eyebrow) { color: #aaa; max-width: 720px; }
.generator-layout { display: grid; grid-template-columns: minmax(280px, .85fr) minmax(340px, 1.15fr); gap: 22px; align-items: start; }
.generator-form,.generator-result,.signature-item { border: 1px solid #403914; border-radius: 14px; background: #171717; }
.generator-form { display: grid; gap: 14px; padding: 22px; }
.generator-form label,.signature-form label { display: grid; gap: 7px; color: #f1f1f1; font-weight: 800; }
.generator-form textarea { min-height: 86px; resize: vertical; }
.generator-result { min-height: 100%; overflow: hidden; }
.generator-result-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 18px; border-bottom: 1px solid #343018; }
.generator-result h2 { margin: 0; font-size: 19px; }
.generator-result pre,.signature-item pre { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; font: 500 15px/1.6 Inter,Segoe UI,Arial,sans-serif; color: #e9e9e9; }
.generator-result pre { min-height: 310px; padding: 20px; }
.button.secondary { background: #252525; border: 1px solid #5a5a5a; color: #fff; }
.button.secondary:hover { background: #333; }
.text-link { color: var(--yellow); font-weight: 800; text-decoration: underline; }
.form-hint { margin: -3px 0 0; color: #aaa; font-size: 13px; }
.signature-page { max-width: 1000px; margin: 0 auto; }
.signature-list { display: grid; gap: 12px; margin-top: 22px; }
.signature-item { display: flex; justify-content: space-between; gap: 22px; padding: 18px; }
.signature-item h2 { margin: 0 0 8px; font-size: 19px; color: var(--yellow); }
.signature-actions { display: flex; align-items: flex-start; gap: 12px; white-space: nowrap; }
.signature-actions form { margin: 0; }
.signature-form { max-width: 760px; margin: 0 auto; }
.signature-form form { display: grid; gap: 16px; }
.empty-state { color: #aaa; }
@media (max-width:760px) { .generator-layout { grid-template-columns: 1fr; }.signature-item { flex-direction: column; }.generator-result pre { min-height: 220px; }.signature-actions { align-items:center; } }
.order-template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  align-items: stretch;
}

.order-template-card {
  position: relative;
  display: flex;
  min-height: 210px;
  flex-direction: column;
  gap: 22px;
  padding: 25px;
  overflow: hidden;
  border: 1px solid rgba(255, 214, 0, .24);
  border-radius: 16px;
  background: linear-gradient(145deg, #1b1b1b, #121212);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.order-template-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent, #ffd600);
  box-shadow: 0 12px 28px rgba(0,0,0,.28), 0 0 0 1px rgba(255,214,0,.08);
}

.order-template-number {
  position: absolute;
  top: 12px;
  right: 18px;
  margin: 0;
  color: rgba(255,214,0,.18);
  font-size: 48px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -2px;
}

.order-template-copy { position: relative; z-index: 1; }
.order-template-copy h2 { margin: 8px 0 10px; font-size: 26px; }
.order-template-card .button { width: fit-content; margin-top: auto; }
.template-variable-panel { margin: 4px 0 0; padding: 18px; border: 1px solid #403914; border-radius: 14px; background: #141414; }
.template-variable-panel-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.template-variable-panel-head .eyebrow { margin: 0 0 4px; }
.template-variable-panel-head h2 { margin: 0; font-size: 19px; }
.template-variable-panel-head > p { margin: 0; max-width: 290px; color: #9c9c9c; font-size: 13px; text-align: right; }
.template-variable-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); gap: 9px; }
.template-variable { display: grid; gap: 5px; min-height: 69px; padding: 11px 13px; text-align: left; cursor: pointer; border: 1px solid #413d25; border-radius: 10px; background: #1b1b1b; transition: transform .16s ease, border-color .16s ease, background .16s ease; }
.template-variable:hover,.template-variable:focus-visible { transform: translateY(-2px); border-color: var(--yellow); background: #22200f; outline: none; }
.template-variable.is-inserted { transform: scale(.97); background: #312d0c; }
.template-variable span { color: var(--yellow); font-size: 13px; font-weight: 800; line-height: 1.15; }
.template-variable code { color: #fff; font: 700 14px/1.2 Consolas, monospace; }

@media (max-width: 600px) {
  .order-template-grid { grid-template-columns: 1fr; }
  .order-template-card { min-height: 180px; }
  .template-variable-panel-head { align-items: start; flex-direction: column; }
  .template-variable-panel-head > p { text-align: left; }
}

.order-success-toast {
  position: fixed; right: 28px; bottom: 28px; z-index: 1000;
  display: flex; align-items: center; gap: 10px; padding: 12px 18px;
  border: 1px solid var(--yellow); border-radius: 12px; background: #171717;
  color: #f5f5f5; font-weight: 800; box-shadow: 0 16px 42px rgba(0,0,0,.45);
  opacity: 0; transform: translateY(12px); transition: opacity .22s ease, transform .22s ease;
  pointer-events: none;
}
.order-success-toast.is-visible { opacity: 1; transform: translateY(0); }
.order-success-toast__check {
  display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: #168447; color: #fff; font-size: 16px; line-height: 1;
}
@media (max-width: 700px) {
  .order-success-toast { right: 16px; bottom: 16px; }
}

/* Login screen */
.login-page {
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(255, 210, 0, .08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 210, 0, .05) 1px, transparent 1px),
    radial-gradient(circle at 72% 44%, rgba(255, 210, 0, .14), transparent 30%),
    linear-gradient(135deg, #050505 0%, #0a0a08 52%, #11100a 100%);
  background-size: 64px 64px, 64px 64px, auto, auto;
}

.login-page .topbar {
  background: rgba(7, 7, 7, .86);
  backdrop-filter: blur(10px);
}

.login-page .page {
  display: grid;
  min-height: calc(100vh - 65px);
  max-width: 1180px;
  align-items: center;
  padding-top: 44px;
  padding-bottom: 44px;
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(340px, 500px);
  gap: 56px;
  align-items: center;
  margin: 0;
}

.login-intro {
  max-width: 610px;
}

.login-mark {
  display: inline-grid;
  min-width: 150px;
  min-height: 78px;
  place-items: center;
  margin: 0 0 26px;
  border: 1px solid rgba(255, 210, 0, .5);
  border-radius: 8px;
  background: #ffd200;
  color: #070707;
  font-size: 32px;
  font-weight: 1000;
  letter-spacing: 0;
  box-shadow: 12px 12px 0 #111, 12px 12px 0 1px rgba(255, 210, 0, .35);
}

.login-intro h1 {
  max-width: 610px;
  margin: 0 0 18px;
  font-size: clamp(42px, 5vw, 68px);
  letter-spacing: 0;
}

.login-intro p:not(.eyebrow) {
  max-width: 560px;
  margin: 0;
  color: #cfcfcf;
  font-size: 18px;
}

.login-meta {
  display: grid;
  max-width: 560px;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 30px 0 0;
}

.login-meta div {
  padding: 14px 15px;
  border: 1px solid rgba(255, 210, 0, .22);
  border-radius: 8px;
  background: rgba(17, 17, 17, .78);
}

.login-meta dt {
  color: var(--yellow);
  font-size: 12px;
  font-weight: 900;
}

.login-meta dd {
  margin: 3px 0 0;
  color: #f2f2f2;
  font-weight: 850;
}

.login-card {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 34px;
  border-color: rgba(255, 210, 0, .42);
  border-radius: 8px;
  background: rgba(18, 18, 18, .94);
  box-shadow: 0 30px 70px rgba(0, 0, 0, .46), inset 0 1px 0 rgba(255, 255, 255, .04);
}

.login-card-head {
  margin-bottom: 22px;
}

.login-card-head h2 {
  margin: 0;
  font-size: 42px;
}

.login-card-head p:not(.eyebrow) {
  margin: 8px 0 0;
  color: #aaa;
}

.login-form {
  display: grid;
  gap: 16px;
}

.login-form label {
  margin: 0;
}

.login-form input {
  min-height: 52px;
  margin-top: 7px;
  border-color: #4e4e4e;
  border-radius: 7px;
  background: #080808;
}

.login-form input::placeholder {
  color: #757575;
}

.login-submit {
  width: 100%;
  min-height: 52px;
  margin-top: 6px;
  border-radius: 7px;
  font-weight: 950;
}

.vk-login-button {
  display: grid;
  width: 100%;
  min-height: 50px;
  place-items: center;
  border-color: #3f7cff;
  background: #163f91;
  color: #fff;
  text-align: center;
  font-weight: 900;
}

.vk-login-button:hover {
  background: #1d55c4;
}

.vk-only-form {
  margin-top: 10px;
}

.auth-settings-card {
  max-width: 780px;
}

.auth-settings-form {
  display: grid;
  gap: 14px;
}

.auth-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px;
  border: 1px solid rgba(255, 214, 0, .22);
  border-radius: 16px;
  background: rgba(10, 10, 10, .42);
}

.auth-toggle-row span {
  display: grid;
  gap: 5px;
}

.auth-toggle-row strong {
  color: #fff;
  font-size: 18px;
}

.auth-toggle-row small {
  color: #a9a9a9;
  line-height: 1.45;
}

.auth-toggle-row input[type="checkbox"] {
  width: 54px;
  height: 30px;
  flex: 0 0 auto;
  accent-color: var(--yellow);
}

.user-editor-card {
  max-width: 920px;
  border-color: rgba(255, 214, 0, .28);
  background:
    radial-gradient(circle at 12% 0%, rgba(255, 214, 0, .10), transparent 28%),
    linear-gradient(145deg, #181818, #101010 64%);
  box-shadow: 0 22px 70px rgba(0, 0, 0, .42);
}

.user-editor-hero {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 214, 0, .18);
}

.user-editor-hero h1 {
  margin: 4px 0 8px;
  line-height: .98;
}

.user-editor-avatar {
  display: grid;
  width: 94px;
  height: 94px;
  flex: 0 0 94px;
  place-items: center;
  overflow: hidden;
  border: 2px solid var(--yellow);
  border-radius: 26px;
  background: #242006;
  color: var(--yellow);
  font-size: 42px;
  font-weight: 1000;
  box-shadow: 0 14px 35px rgba(255, 214, 0, .12);
}

.user-editor-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-editor-form {
  display: grid;
  gap: 18px;
}

.autofill-decoy {
  position: fixed !important;
  left: -10000px !important;
  top: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.user-editor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.user-editor-section {
  min-width: 0;
  margin: 0;
  padding: 18px;
  border: 1px solid rgba(255, 214, 0, .18);
  border-radius: 18px;
  background: rgba(8, 8, 8, .34);
}

.user-editor-section legend {
  padding: 0 10px;
  color: var(--yellow);
  font-weight: 1000;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.user-editor-courses {
  background: rgba(255, 214, 0, .035);
}

.user-editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

@media (max-width: 860px) {
  .user-editor-grid { grid-template-columns: 1fr; }
  .user-editor-hero { align-items: flex-start; }
  .user-editor-avatar { width: 72px; height: 72px; flex-basis: 72px; border-radius: 20px; font-size: 32px; }
}

.bind-page-heading .actions,
.bind-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.bind-list {
  display: grid;
  gap: 14px;
}

.bind-card {
  overflow: hidden;
  border: 1px solid rgba(255, 214, 0, .28);
  border-radius: 18px;
  background: linear-gradient(145deg, #181818, #101010);
  box-shadow: 0 14px 35px rgba(0, 0, 0, .28);
}

.bind-card summary {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  min-height: 72px;
  padding: 0 20px;
  cursor: pointer;
  list-style: none;
}

.bind-card summary::-webkit-details-marker {
  display: none;
}

.bind-chevron {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--yellow);
  border-radius: 50%;
  color: var(--yellow);
  font-size: 26px;
  line-height: 1;
  transition: transform .18s ease;
}

.bind-card[open] .bind-chevron {
  transform: rotate(90deg);
}

.bind-card summary strong {
  color: #fff;
  font-size: 22px;
}

.bind-card summary small {
  color: #9d9d9d;
  font-weight: 800;
}

.bind-lines {
  display: grid;
  gap: 8px;
  padding: 0 20px 18px 66px;
}

.bind-comment {
  padding: 11px 14px;
  border-left: 3px solid #ff8a2a;
  border-radius: 10px;
  background: rgba(255, 138, 42, .10);
  color: #ffc28d;
  font-weight: 900;
  line-height: 1.35;
}

.bind-copy-button {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #333;
  border-radius: 12px;
  background: #0b0b0b;
  color: #eee;
  text-align: left;
  font: 800 15px/1.35 Inter, Segoe UI, Arial, sans-serif;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}

.bind-copy-button:hover,
.bind-copy-button.copied {
  border-color: var(--yellow);
  background: #241f06;
  color: #fff;
}

.bind-copy-button.copied {
  border-color: #fff;
  background: linear-gradient(135deg, rgba(255,255,255,.14), rgba(255,214,0,.09)), #181818;
  box-shadow: inset 4px 0 0 var(--yellow), 0 0 0 1px rgba(255,255,255,.08);
}

.bind-copy-toast {
  position: fixed;
  top: 74px;
  left: 50%;
  z-index: 1300;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 17px;
  border: 1px solid rgba(255, 214, 0, .42);
  border-radius: 999px;
  background: rgba(17, 17, 17, .96);
  color: #fff;
  box-shadow: 0 16px 45px rgba(0,0,0,.48), inset 0 1px 0 rgba(255,255,255,.06);
  opacity: 0;
  transform: translate(-50%, -10px);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}

.bind-copy-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.bind-copy-toast span {
  display: grid;
  width: 23px;
  height: 23px;
  place-items: center;
  border-radius: 50%;
  background: #22c55e;
  color: #071307;
  font-weight: 1000;
}

.bind-copy-toast strong {
  color: #f5f5f5;
  font-size: 14px;
}

.mis-health-heading {
  max-width: 880px;
}

.mis-sync-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: -8px 0 20px;
  padding: 14px 16px;
  border: 1px solid rgba(255,214,0,.18);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(255,214,0,.10), rgba(255,255,255,.025)),
    #111;
}

.mis-sync-panel strong {
  color: #fff;
  font-size: 16px;
}

.mis-sync-panel p {
  margin: 3px 0 0;
  color: #aaa;
  font-size: 13px;
}

.mis-sync-panel form {
  margin: 0;
}

.mis-sync-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.mis-json-upload {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(255, 214, 0, .34);
  border-radius: 12px;
  background: rgba(255, 214, 0, .08);
  color: var(--yellow);
  font-weight: 900;
  font-size: 13px;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}

.mis-json-upload:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 214, 0, .7);
  background: rgba(255, 214, 0, .14);
}

.mis-json-upload input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.mis-report-heading {
  max-width: 820px;
}

.mis-report-card,
.mis-report-help {
  max-width: 880px;
  border: 1px solid rgba(255, 214, 0, .18);
  border-radius: 22px;
  background:
    radial-gradient(circle at top right, rgba(255, 214, 0, .10), transparent 34%),
    #141414;
  padding: 26px;
}

.mis-report-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.mis-report-card label {
  display: block;
  margin: 0 0 16px;
  color: #f3f3f3;
  font-weight: 900;
}

.mis-report-card input,
.mis-report-card select,
.mis-report-card textarea {
  margin-top: 8px;
}

.mis-report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.mis-report-guide {
  margin: 4px 0 20px;
  padding: 20px;
  border: 1px solid rgba(255, 214, 0, .24);
  border-radius: 16px;
  background: rgba(0, 0, 0, .34);
}

.mis-report-guide[hidden] {
  display: none;
}

.mis-report-guide h2 {
  margin: 5px 0 12px;
  color: #fff;
  font-size: clamp(20px, 2.4vw, 28px);
}

.mis-report-guide div {
  color: #dedede;
  line-height: 1.6;
  white-space: pre-wrap;
}

.mis-report-help {
  margin-top: 18px;
}

.mis-report-help pre {
  white-space: pre-wrap;
  padding: 14px;
  border: 1px solid rgba(255, 214, 0, .18);
  border-radius: 14px;
  background: #0b0b0b;
  color: #ffd600;
}

.mis-report-warning {
  margin-left: 0;
}

/* Profile editor */
.profile-edit-page {
  width: min(980px, 100%);
  margin: 0 auto;
}

.profile-edit-back {
  display: inline-flex;
  margin-bottom: 18px;
  color: #bdbdbd;
  text-decoration: none;
  font-weight: 750;
}

.profile-edit-back:hover { color: var(--yellow); }

.profile-edit-hero {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 18px;
  padding: 27px 30px;
  border: 1px solid rgba(255, 214, 0, .18);
  border-radius: 24px;
  background: radial-gradient(circle at 15% 0, rgba(255,214,0,.12), transparent 36%), #141414;
}

.profile-edit-hero h1 { margin: 3px 0 6px; font-size: clamp(32px, 5vw, 52px); }
.profile-edit-hero p:last-child { margin: 0; color: #9c9c9c; }

.profile-edit-avatar {
  display: grid;
  width: 112px;
  height: 112px;
  flex: 0 0 112px;
  overflow: hidden;
  place-items: center;
  border: 3px solid var(--yellow);
  border-radius: 30px;
  background: #090909;
  color: var(--yellow);
  font-size: 44px;
  font-weight: 950;
  box-shadow: 0 16px 45px rgba(0,0,0,.34), 0 0 26px rgba(255,214,0,.09);
}

.profile-edit-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-edit-form { display: grid; gap: 14px; }

.profile-edit-section {
  padding: 24px;
  border: 1px solid #292929;
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(255,255,255,.028), transparent), #121212;
}

.profile-edit-section-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 21px;
}

.profile-edit-section-head h2 { margin: 0 0 3px; font-size: 21px; }
.profile-edit-section-head p { margin: 0; color: #888; font-size: 13px; }

.profile-edit-icon {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  border: 1px solid rgba(255,214,0,.35);
  border-radius: 12px;
  background: rgba(255,214,0,.09);
  color: var(--yellow);
  font-size: 20px;
}

.profile-edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
}

.profile-edit-section label { display: grid; gap: 7px; color: #eee; font-weight: 850; }
.profile-edit-section input,
.profile-edit-section select,
.profile-edit-section textarea { margin: 0; }
.profile-edit-main > label { margin-top: 16px; }

.profile-vk-status {
  display: grid;
  align-content: center;
  gap: 7px;
  min-height: 76px;
  padding: 12px 14px;
  border: 1px solid #303030;
  border-radius: 12px;
  background: #0c0c0c;
}

.profile-vk-status span { color: #eee; font-weight: 850; }
.profile-vk-status a { overflow: hidden; color: var(--yellow); text-overflow: ellipsis; white-space: nowrap; }
.profile-vk-status b { color: #777; }

.profile-avatar-controls {
  display: grid;
  grid-template-columns: minmax(250px, .85fr) minmax(280px, 1.15fr);
  gap: 14px;
}

.profile-upload-box {
  position: relative;
  min-height: 102px;
  align-content: center;
  padding: 18px;
  border: 1px dashed rgba(255,214,0,.46);
  border-radius: 15px;
  background: rgba(255,214,0,.045);
  cursor: pointer;
}

.profile-upload-box:hover { border-color: var(--yellow); background: rgba(255,214,0,.08); }
.profile-upload-box small { color: #8e8e8e; font-weight: 600; }
.profile-upload-box input { margin-top: 7px; font-size: 12px; }
.profile-photo-url { align-content: center; }

.profile-remove-avatar {
  display: flex!important;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 9px!important;
  width: max-content;
  margin-top: 14px;
  color: #d66!important;
  cursor: pointer;
}

.profile-remove-avatar input { width: auto; }
.profile-password-section { padding: 0; overflow: hidden; }
.profile-password-section summary { display: flex; align-items: center; gap: 14px; padding: 20px 24px; cursor: pointer; list-style: none; }
.profile-password-section summary::-webkit-details-marker { display: none; }
.profile-password-section summary span:nth-child(2) { display: grid; gap: 3px; }
.profile-password-section summary b { color: #fff; }
.profile-password-section summary small { color: #858585; }
.profile-password-section summary i { margin-left: auto; color: var(--yellow); font-size: 22px; font-style: normal; transition: transform .2s ease; }
.profile-password-section[open] summary i { transform: rotate(180deg); }
.profile-password-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 13px; padding: 0 24px 24px; }
.profile-edit-submit { display: flex; justify-content: flex-end; gap: 10px; padding-top: 4px; }

@media (max-width: 760px) {
  .profile-edit-hero { flex-direction: column; padding: 23px; text-align: center; }
  .profile-edit-avatar { width: 96px; height: 96px; flex-basis: 96px; border-radius: 26px; }
  .profile-edit-grid,
  .profile-avatar-controls,
  .profile-password-grid { grid-template-columns: 1fr; }
  .profile-edit-section { padding: 19px; }
  .profile-password-section { padding: 0; }
  .profile-password-section summary { padding: 18px; }
  .profile-password-grid { padding: 0 18px 18px; }
}

.mis-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: -4px 0 22px;
}

.mis-tabs a {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  gap: 10px;
  padding: 0 15px;
  border: 1px solid rgba(255, 214, 0, .22);
  border-radius: 999px;
  background: #131313;
  color: #eee;
  text-decoration: none;
  font-weight: 900;
}

.mis-tabs a.active {
  border-color: var(--yellow);
  background: linear-gradient(135deg, rgba(255,214,0,.28), rgba(255,214,0,.08)), #171717;
  color: var(--yellow);
}

.mis-tabs span {
  min-width: 26px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  color: #fff;
  text-align: center;
  font-size: 12px;
}

.mis-health-shell {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  gap: 18px;
}

.mis-application-list {
  display: grid;
  align-content: start;
  gap: 9px;
  max-height: calc(100vh - 190px);
  overflow: auto;
  padding: 10px;
  border: 1px solid rgba(255,214,0,.16);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.01)), #111;
}

.mis-list-card {
  display: grid;
  gap: 3px;
  padding: 12px 13px;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 14px;
  background: rgba(255,255,255,.025);
  color: #dfdfdf;
  text-decoration: none;
}

.mis-list-card:hover,
.mis-list-card.active {
  border-color: rgba(255,214,0,.48);
  background: linear-gradient(135deg, rgba(255,214,0,.18), rgba(255,214,0,.04)), #151515;
  color: #fff;
}

.mis-list-card.pinned {
  box-shadow: inset 4px 0 0 var(--yellow);
}

.mis-list-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mis-list-top strong {
  overflow: hidden;
  color: #fff;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mis-list-top small {
  color: var(--yellow);
  font-size: 16px;
}

.mis-list-card > span:last-child {
  color: #a8a8a8;
  font-size: 13px;
  font-weight: 800;
}

.mis-application-detail {
  min-height: 520px;
  padding: 22px;
  border: 1px solid rgba(255,214,0,.20);
  border-radius: 20px;
  background:
    radial-gradient(circle at 100% 0%, rgba(255,214,0,.10), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.015)),
    #151515;
  box-shadow: 0 18px 55px rgba(0,0,0,.30);
}

.mis-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.mis-detail-head h2 {
  margin: 0 0 6px;
  font-size: clamp(28px, 4vw, 44px);
}

.mis-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.mis-detail-actions form {
  margin: 0;
}

.mis-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 18px;
}

.mis-detail-grid div {
  padding: 12px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 13px;
  background: rgba(0,0,0,.22);
}

.mis-detail-grid dt {
  margin-bottom: 4px;
  color: #858585;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.mis-detail-grid dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: #f2f2f2;
  font-weight: 800;
}

.mis-application-text {
  margin: 0;
}

.mis-application-text h3 {
  margin: 0 0 10px;
  color: var(--yellow);
}

.mis-application-text pre {
  max-height: 520px;
  overflow: auto;
  margin: 0;
  padding: 16px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 15px;
  background: #080808;
  color: #efefef;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 700 14px/1.55 Inter, Segoe UI, Arial, sans-serif;
}

.empty.compact {
  margin: 0;
  padding: 18px;
}

@media (max-width: 860px) {
  .mis-health-shell {
    grid-template-columns: 1fr;
  }

  .mis-application-list {
    max-height: none;
  }

  .mis-detail-head,
  .mis-detail-grid {
    grid-template-columns: 1fr;
  }

  .mis-detail-head {
    display: grid;
  }

  .mis-detail-actions {
    justify-content: flex-start;
  }
}

.bind-actions {
  padding: 0 20px 20px 66px;
}

.bind-actions a,
.bind-actions button {
  display: inline-grid;
  min-height: 38px;
  place-items: center;
  padding: 0 14px;
  border: 1px solid #4a4a4a;
  border-radius: 10px;
  background: #222;
  color: #fff;
  text-decoration: none;
  font-weight: 900;
  cursor: pointer;
}

.bind-actions button {
  border-color: #5c2020;
  background: #421b1b;
}

.bind-actions form {
  margin: 0;
}

.bind-helper-panel,
.bind-preview-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(255, 214, 0, .18);
  border-radius: 18px;
  background: rgba(10, 10, 10, .38);
}

.bind-helper-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: baseline;
  justify-content: space-between;
}

.bind-helper-head h2 {
  margin: 0;
  color: var(--yellow);
  font-size: 18px;
}

.bind-variable-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bind-variable-pill {
  display: grid;
  min-width: 92px;
  padding: 8px 12px;
  border: 1px solid #ff8a2a;
  border-radius: 15px;
  background: #151515;
  color: #f1f1f1;
  text-align: left;
  cursor: pointer;
}

.bind-variable-pill b {
  color: var(--yellow);
  font-size: 13px;
}

.bind-variable-pill span {
  font-weight: 900;
}

.bind-variable-pill small {
  color: #898989;
  font-size: 11px;
}

.bind-variable-pill:hover {
  background: rgba(255, 138, 42, .12);
}

.bind-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.bind-preview-grid article {
  padding: 14px;
  border: 1px solid #2d2d2d;
  border-radius: 14px;
  background: #0d0d0d;
}

.bind-preview-grid h3 {
  margin: 0 0 10px;
  color: #fff;
}

.bind-preview-lines {
  display: grid;
  gap: 7px;
}

.bind-preview-lines > div {
  padding: 9px 11px;
  border-radius: 9px;
  background: #181818;
  color: #eee;
  font-weight: 800;
}

.bind-preview-lines > .bind-preview-comment {
  border-left: 3px solid #ff8a2a;
  background: rgba(255, 138, 42, .10);
  color: #ffc28d;
}

@media (max-width: 780px) {
  .bind-preview-grid { grid-template-columns: 1fr; }
  .bind-lines,
  .bind-actions { padding-left: 20px; }
}

@media (max-width: 820px) {
  .login-page .page {
    min-height: auto;
  }

  .login-shell {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .login-mark {
    min-width: 132px;
    min-height: 66px;
    font-size: 28px;
  }

  .login-intro h1 {
    font-size: clamp(36px, 11vw, 52px);
  }

  .login-meta {
    grid-template-columns: 1fr;
  }

  .login-card {
    padding: 26px;
  }
}
