/* NEWORIA.NET Community Control — v2 visual system */
:root {
  color-scheme: light;
  --bg: #edf3f6;
  --sidebar: #081b29;
  --sidebar-line: #183344;
  --panel: #ffffff;
  --panel-2: #f5f8fa;
  --line: #d7e1e7;
  --text: #142a38;
  --muted: #647987;
  --blue: #087eaa;
  --blue-light: #dff5ff;
  --green: #138766;
  --red: #bf4652;
  --amber: #087eaa;
  --radius: 9px;
  --radius-sm: 6px;
  --surface-shadow: 0 2px 7px #102d3c0b, 0 12px 28px #102d3c08;
  --control: #f7fafb;
  --focus: #72d3fb;
  --rail-width: 72px;
}
* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); scrollbar-color: #9fb3bf transparent; }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--text); color-scheme: dark; font: 14px/1.5 "Segoe UI Variable", "Segoe UI", system-ui, sans-serif; }
body.light { color-scheme: light; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
button:disabled { cursor: not-allowed; opacity: .55; }
.hidden { display: none !important; }
.layout { min-height: 100dvh; display: grid; grid-template-columns: 286px minmax(0, 1fr); background: var(--bg); }
.sidebar { position: sticky; inset: 0 auto auto 0; display: grid; height: 100dvh; min-height: 580px; grid-template-columns: 1fr; grid-template-rows: auto minmax(0,1fr) auto; overflow: hidden; padding: 15px 12px 11px; background: var(--sidebar); border-right: 1px solid var(--sidebar-line); color: #e7f1f5; }
.sidebar-brand-area { flex: 0 0 auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 1px 7px 17px; color: #effaff; text-decoration: none; }
.brand b { display: block; font-size: 14px; font-weight: 780; letter-spacing: .055em; }
.brand small { display: block; margin-top: 1px; color: #88a3b2; font-size: 10px; letter-spacing: .035em; }
.brand-mark { display: block; width: 48px; height: 48px; flex: 0 0 auto; border: 1px solid #1a607a; border-radius: 9px; background: #15191b; object-fit: cover; object-position: 81% 50%; }
.brand-mark.small { width: 36px; height: 36px; border-radius: 7px; }
.server-picker { padding: 12px 6px 15px; border-top: 1px solid var(--sidebar-line); }
.server-picker label { color: #83a2b2; font-size: 9px; font-weight: 750; letter-spacing: .1em; }
.server-picker select { width: 100%; margin-top: 6px; padding: 9px 10px; border: 1px solid #254457; border-radius: 6px; background: #102838; color: #f4f1eb; }
.sidebar-workspace { display: grid; min-height: 0; grid-template-columns: var(--rail-width) minmax(0,1fr); overflow: hidden; border-top: 1px solid var(--sidebar-line); }
.category-rail { display: flex; flex-direction: column; gap: 5px; overflow: auto; padding: 10px 4px; border-right: 1px solid var(--sidebar-line); background: #061723; }
.category-tab { display: grid; min-height: 58px; align-content: center; justify-items: center; gap: 4px; padding: 5px 2px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: #829eac; }
.category-tab span { font-size: 18px; line-height: 1.1; }
.category-tab small { max-width: 100%; overflow: hidden; font-size: clamp(8px, calc(var(--rail-width) * .125), 10px); line-height: 1.1; text-overflow: ellipsis; }
.category-size-tools { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 2px; margin: auto 2px 3px; padding-top: 7px; border-top: 1px solid var(--sidebar-line); color: #829eac; font-size: 9px; text-align: center; }
.category-size-tools button { min-height: 26px; padding: 3px 5px; border: 1px solid #254457; border-radius: 4px; background: #102838; color: #c8e3ed; font-size: 10px; font-weight: 700; }
.category-size-tools button:hover:not(:disabled) { border-color: #37b9e8; background: #102c3c; color: #fff; }
.category-size-tools button:disabled { opacity: .4; }
.category-tab:hover { background: #102c3e; color: #effaff; }
.category-tab.active { border-color: #1a607a; background: #102c3c; color: #72d3fb; }
.side-navigation { display: block; min-width: 0; overflow: auto; padding: 12px 5px 10px 9px; scrollbar-color: #315163 transparent; }
.nav-group { display: grid; align-content: start; gap: 3px; }
.nav-group[hidden] { display: none !important; }
.nav-label { margin: 5px 10px 3px; color: #7190a0; font-size: 9px; font-weight: 780; letter-spacing: .12em; text-transform: uppercase; }
.nav-item { display: flex; width: 100%; min-height: 35px; align-items: center; gap: 10px; padding: 6px 9px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: #b2c5ce; text-align: left; font-size: 12px; font-weight: 560; transition: background-color .13s ease, color .13s ease; }
.nav-item span { display: grid; width: 19px; flex: 0 0 19px; place-items: center; color: #88b0c3; font-size: 14px; }
.nav-item:hover { background: #102d40; color: #fff; }
.nav-item.active { border-color: #1a607a; background: #102c3c; color: #f4f1eb; box-shadow: inset 3px 0 #72d3fb; }
.nav-item.active span { color: #72d3fb; }
.sidebar-bottom { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 6px; margin-top: 8px; padding: 7px 3px 0; border-top: 1px solid var(--sidebar-line); background: var(--sidebar); }
.online { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; padding: 5px 7px 8px; color: #a9c3ce; font-size: 11px; }
.online i { width: 7px; height: 7px; border-radius: 50%; background: #46cf9c; box-shadow: 0 0 8px #46cf9c66; }
.logout { min-height: 32px; padding: 5px 7px; border: 0; border-radius: 4px; background: transparent; color: #92aab6; text-align: left; font-size: 10px; }
.logout:hover { background: #102d40; color: #fff; }
.main { width: 100%; max-width: 1740px; min-width: 0; margin: 0 auto; padding: 22px clamp(22px, 3.2vw, 48px) 34px; }
.topbar { position: relative; display: flex; min-height: 58px; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 23px; padding: 0 0 15px; border-bottom: 1px solid #d4e0e6; }
.topbar-title { min-width: 0; }
.topbar .eyebrow { margin: 0 0 1px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .06em; }
.topbar .eyebrow span { padding: 0 6px; color: #a0b4be; }
.topbar h1 { overflow: hidden; margin: 0; color: #102a39; font-size: clamp(22px, 2vw, 28px); font-weight: 720; letter-spacing: -.035em; text-overflow: ellipsis; white-space: nowrap; }
.topbar-actions { display: flex; align-items: center; gap: 11px; }
.user-chip { display: flex; align-items: center; gap: 8px; max-width: 220px; padding: 4px 10px 4px 5px; border: 1px solid var(--line); border-radius: 5px; background: white; color: #344e5c; font-size: 11px; }
.user-chip img { width: 27px; height: 27px; border-radius: 50%; }
.user-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mobile-server-picker { display: none; }
.view { min-width: 0; animation: page-enter .18s ease-out both; }
@keyframes page-enter { from { opacity: .72; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.main[aria-busy="true"] .view:not(.hidden) { opacity: .62; }
.eyebrow { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .06em; }
.muted, .ticket-meta { color: var(--muted); }
.section-intro { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 17px; padding: 0 0 13px; border-bottom: 1px solid var(--line); }
.section-intro h2 { margin: 0; color: #163344; font-size: 20px; font-weight: 720; letter-spacing: -.03em; }
.section-intro p { margin: 4px 0 0; font-size: 12px; }
.panel, .stat-card { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--surface-shadow); }
.panel { padding: 17px; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 13px; margin-bottom: 13px; }
.panel h3 { margin: 0; color: #183646; font-size: 14px; font-weight: 720; letter-spacing: -.01em; }
.panel-head p { margin: 4px 0 0; font-size: 11px; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(250px, .8fr); gap: 14px; }
.stat-grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 0; margin: 0 0 15px; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.stat-card { min-height: 83px; padding: 12px 14px; border: 0; border-right: 1px solid var(--line); border-radius: 0; box-shadow: none; }
.stat-card:last-child { border-right: 0; }
.stat-top, .stat-sub { color: #728894; font-size: 10px; }
.stat-value { margin-top: 5px; color: #173547; font-size: 22px; font-weight: 740; letter-spacing: -.035em; }
.stat-icon { width: 24px; height: 24px; border-radius: 4px; background: #e4f5fb; color: #137fa6; }
.overview-focus { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 0; margin: 0 0 15px; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: white; }
.focus-card { display: flex; min-width: 0; min-height: 84px; align-items: center; gap: 12px; padding: 13px 15px; border: 0; border-right: 1px solid var(--line); border-radius: 0; background: transparent; box-shadow: none; text-align: left; }
.focus-card:last-child { border-right: 0; }
.focus-card:hover { background: #f4fafc; box-shadow: none; transform: none; }
.focus-card > b { display: none; }
.focus-icon { display: grid; width: 30px; height: 30px; flex: 0 0 auto; place-items: center; border-radius: 5px; background: #e8f5f9; color: #277d9b; }
.focus-urgent .focus-icon { background: #faecee; color: #b94753; }
.focus-unassigned .focus-icon { background: #eaf7fb; color: #087eaa; }
.focus-active .focus-icon { background: #e9f5ee; color: #21815b; }
.focus-card small, .focus-card em { display: block; color: #667d89; font-size: 10px; font-style: normal; }
.focus-card strong { display: block; color: #173547; font-size: 22px; font-weight: 740; line-height: 1.25; }
.overview-hero { position: relative; isolation: isolate; display: flex; min-height: 152px; align-items: center; justify-content: space-between; gap: 18px; margin: 0 0 15px; padding: 22px 24px; overflow: hidden; border: 1px solid #39464f; border-radius: 9px; background-color: #161f27; background-image: url('/assets/rank-card-banner.png'); background-size: cover; background-position: center 50%; box-shadow: 0 9px 24px #00000026; }
.overview-hero::before { position: absolute; z-index: -1; inset: 0; background: linear-gradient(90deg,#091e2deF 0%,#0a2033e8 48%,#0b213b73 100%); content: ''; }
.overview-hero > * { position: relative; z-index: 1; }
.overview-hero .eyebrow { margin: 0 0 5px; color: var(--blue-light); font-size: 11px; letter-spacing: .08em; }
.overview-hero h2 { margin: 0 0 5px; color: #f3fbff; font-size: clamp(21px,2vw,26px); font-weight: 720; letter-spacing: -.035em; }
.overview-hero p { margin: 0; color: #b1c8d3; font-size: 11px; }
.overview-hero p strong { color: #f1faff; }
.hero-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.health-pill { display: inline-flex; align-items: center; gap: 7px; padding: 6px 9px; border: 1px solid #28674f; border-radius: 4px; background: #123b30; color: #aee2c9; font-size: 10px; font-weight: 700; white-space: nowrap; }
.health-pill i { width: 7px; height: 7px; border-radius: 50%; background: #55d6a1; }
.health-pill.offline { border-color: #81434b; background: #46242b; color: #ffc0c5; }
.health-pill.offline i { background: #ff7a84; }
.button { display: inline-flex; min-height: 35px; align-items: center; justify-content: center; gap: 7px; padding: 7px 11px; border: 1px solid transparent; border-radius: 5px; font-size: 11px; font-weight: 700; text-decoration: none; transition: background-color .13s ease,border-color .13s ease; }
.button:active { transform: scale(.98); }
.button.primary { background: #087eaa; color: white; }
.button.primary:hover { background: #086b90; }
.button.ghost { border-color: #c7d8e0; background: white; color: #254657; }
.button.ghost:hover { border-color: #5d9eb9; background: #f1f9fc; }
.text-button { padding: 5px; border: 0; background: transparent; color: #087ea9; font-size: 11px; font-weight: 700; }
.text-button:hover { color: #075e80; text-decoration: underline; }
.input, textarea.input, select.input, .server-picker select, .mobile-server-picker select, .multi-select-trigger, .form-question { width: 100%; min-height: 38px; padding: 8px 10px; border: 1px solid #cbd9e0; border-radius: 5px; background: #fbfdfe; color: #193644; }
.input:hover, textarea.input:hover, select.input:hover { border-color: #89b8c9; }
.input:focus, textarea.input:focus, select.input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px #72d3fb1c; outline: none; }
textarea.input { min-height: 86px; resize: vertical; }
.settings-panel { display: grid; gap: 14px; box-shadow: var(--surface-shadow); }
.settings-panel h3 { margin: 0; font-size: 15px; }
.settings-panel label, .field { display: grid; gap: 6px; color: #49616e; font-size: 11px; line-height: 1.45; }
.settings-panel hr { width: 100%; border: 0; border-top: 1px solid var(--line); }
.settings-panel .button { justify-self: start; }
.ticket-row { display: grid; min-height: 56px; grid-template-columns: minmax(0,1fr) auto auto; align-items: center; gap: 12px; padding: 10px 7px; border-top: 1px solid #e6edf0; cursor: pointer; }
.ticket-row:hover { background: #f3fafd; }
.ticket-name { color: #1e4255; font-size: 11px; font-weight: 700; }
.ticket-meta { font-size: 10px; }
.ticket-row:focus-visible, .ticket-table tr:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 7px; border-radius: 4px; background: #f5ead6; color: #075d7c; font-size: 9px; font-weight: 700; }
.badge.closed { background: #edf1f3; color: #63737b; }
.badge.working, .badge.claimed { background: #e8f4ec; color: #28734e; }
.badge.urgent, .badge.high { background: #fae9eb; color: #a83e4a; }
.table-panel { overflow-x: auto; padding: 0; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; border-bottom: 1px solid #e4ecef; text-align: left; vertical-align: middle; }
th { background: #f4f0e8; color: #617681; font-size: 10px; font-weight: 750; letter-spacing: .025em; }
td { color: #294452; font-size: 11px; }
tr:last-child td { border-bottom: 0; }
.type-chip, .attention-list button, .quick-actions button { border: 1px solid var(--line); border-radius: 5px; background: var(--panel-2); color: var(--text); }
.notice { margin-bottom: 14px; padding: 10px 13px; border: 1px solid #b9dfcf; border-radius: 5px; background: #edf8f2; color: #216b4d; font-size: 12px; }
.notice.error { border-color: #e7c0c4; background: #fcf0f1; color: #a23c47; }
.config-preflight-summary { display: grid; gap: 8px; margin: 0 0 14px; padding: 13px 15px; border: 1px solid #bce8f4; border-left: 4px solid #2288a5; border-radius: 5px; background: #edf9fc; color: #19313a; }
.config-preflight-summary h4, .config-preflight-summary h5, .config-preflight-summary p { margin: 0; }
.empty-state { padding: 18px 10px; color: var(--muted); text-align: center; font-size: 12px; }
.linked-role-row, .team-role-row, .invite-reward-row, .counter-row { min-width: 0; }
.linked-role-row, .team-role-row, .invite-reward-row { border-radius: 5px !important; background: #f6f9fa !important; }
.module-card { border-radius: 7px !important; }
.module-list-item { border-radius: 5px !important; }
footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 26px; padding-top: 12px; border-top: 1px solid var(--line); color: #657d89; font-size: 10px; }
.legal-links { display: flex; align-items: center; gap: 12px; }
.legal-links a { color: #526e7d; font-size: 10px; }
.mobile-tabbar, .mobile-more-dialog { display: none; }
.login-wrap { position: relative; display: grid; min-height: 100dvh; place-items: center; overflow: hidden; padding: 24px; background: #e8f0f4; }
.login-wrap::before { position: absolute; inset: 0 0 0 47%; background: #141b22 url('/assets/rank-card-banner.png') center/cover no-repeat; content: ''; }
.login-wrap::after { position: absolute; inset: 0 0 0 47%; background: linear-gradient(90deg,#141b22f0 0%,#141b2299 57%,#141b223a 100%); content: ''; }
.login-card { position: relative; z-index: 1; width: min(100%, 440px); margin-right: 42vw; padding: 38px; border: 1px solid #d7e1e7; border-radius: 9px; background: white; box-shadow: 0 24px 70px #102c3d1e; }
.login-card .brand-mark { width: 58px; height: 58px; }
.login-card .eyebrow { margin: 18px 0 5px; color: #087eaa; }
.login-card h1 { margin: 7px 0 10px; color: #153444; font-size: 31px; line-height: 1.13; letter-spacing: -.04em; }
.login-card .button { margin-top: 17px; }
.login-card .legal-links { justify-content: flex-start; margin-top: 18px; }
.appeals-public { min-height: 100dvh; padding: 22px max(20px,calc((100vw - 850px)/2)); background: #edf3f6; }
.appeals-public-head { display: flex; max-width: 850px; align-items: center; justify-content: space-between; margin: 0 auto; }
.appeals-hero { max-width: 850px; margin: 35px auto; }
.appeals-hero h1 { color: #153444; font-size: clamp(28px,5vw,42px); letter-spacing: -.04em; }
.appeals-login { max-width: 520px; }
.mobile-more-dialog { border: 0; }
.mobile-more-card { overflow: auto; max-height: 80dvh; padding: 18px; border: 1px solid var(--line); border-radius: 15px 15px 0 0; background: white; }
.mobile-more-head { display: flex; align-items: center; justify-content: space-between; margin: -2px 0 12px; }
.mobile-more-group { margin: 15px 4px 6px; color: #667e8a; font-size: 9px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.mobile-more-item { display: grid; width: 100%; grid-template-columns: 28px 1fr 20px; align-items: center; gap: 8px; padding: 11px 8px; border: 0; border-bottom: 1px solid #eaf0f3; background: white; color: #264351; text-align: left; }
.mobile-more-item.active { background: #eaf8fc; color: #086d91; }
.mobile-primary { color: var(--text); }
@media (max-width: 1120px) {
  .layout { grid-template-columns: 286px minmax(0,1fr); }
  .main { padding-right: 22px; padding-left: 22px; }
  .stat-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .stat-card:nth-child(3) { border-right: 0; }
  .stat-card:nth-child(n+4) { border-top: 1px solid var(--line); }
}
@media (max-width: 900px) {
  .layout { display: block; }
  .sidebar { display: none; }
  .main { padding: 14px 18px calc(100px + env(safe-area-inset-bottom)); }
  .topbar { position: sticky; z-index: 15; top: 0; min-height: 62px; margin: 0 -18px 16px; padding: 9px 18px; border-bottom-color: #d8e3e8; background: #edf3f6f2; }
  .topbar .eyebrow { font-size: 11px; }
  .topbar h1 { font-size: 20px; }
  .topbar-actions { gap: 7px; }
  .mobile-server-picker { display: grid; max-width: 125px; gap: 1px; color: #718894; font-size: 8px; }
  .mobile-server-picker select { max-width: 125px; min-height: 33px; padding: 4px 6px; border: 1px solid #cad9e0; border-radius: 5px; background: white; color: #234151; font-size: 11px; }
  .user-chip { max-width: 40px; padding: 4px; border: 0; background: transparent; }
  .user-chip span { display: none; }
  .user-chip img { width: 30px; height: 30px; }
  .mobile-tabbar { position: fixed; z-index: 40; inset: auto 12px calc(9px + env(safe-area-inset-bottom)); display: grid; width: min(520px,calc(100% - 24px)); grid-template-columns: repeat(5,minmax(0,1fr)); gap: 2px; margin: 0 auto; padding: 5px 6px; border: 1px solid #174056; border-radius: 9px; background: #092233f5; box-shadow: 0 9px 28px #0720313d; }
  .mobile-tab { display: grid; min-width: 0; min-height: 48px; align-content: center; justify-items: center; gap: 2px; border: 0; border-radius: 5px; background: transparent; color: #a4beca; }
  .mobile-tab span { font-size: 16px; line-height: 1; }
  .mobile-tab small { overflow: hidden; max-width: 100%; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-tab.active { background: #102c3c; color: #72d3fb; }
  .mobile-more-dialog { position: fixed; inset: auto 0 0; display: none; width: 100%; max-width: none; max-height: 82dvh; margin: 0; padding: 0; border: 0; background: transparent; }
  .mobile-more-dialog[open] { display: block; }
  .mobile-more-dialog::backdrop { background: #07141eb8; }
  .overview-hero { min-height: 140px; padding: 18px; }
  .content-grid { grid-template-columns: 1fr; }
  footer { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 600px) {
  .main { padding-right: 13px; padding-left: 13px; }
  .topbar { margin-right: -13px; margin-left: -13px; padding-right: 13px; padding-left: 13px; }
  .topbar h1 { max-width: 52vw; font-size: 19px; }
  .mobile-server-picker { max-width: 105px; }
  .mobile-server-picker select { max-width: 105px; }
  .overview-hero { display: grid; min-height: 0; gap: 14px; background-position: 76% 50%; }
  .overview-hero::before { background: linear-gradient(90deg,#091e2def,#0a2033eb 68%,#0b213b91); }
  .overview-hero h2 { font-size: 21px; }
  .hero-actions { justify-content: flex-start; }
  .overview-focus { grid-template-columns: 1fr; }
  .focus-card { min-height: 69px; border-right: 0; border-bottom: 1px solid var(--line); }
  .focus-card:last-child { border-bottom: 0; }
  .stat-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .stat-card { border-top: 1px solid var(--line); }
  .stat-card:nth-child(odd) { border-right: 1px solid var(--line); }
  .stat-card:nth-child(even) { border-right: 0; }
  .stat-card:nth-child(-n+2) { border-top: 0; }
  .panel { padding: 14px; }
  .panel-head { align-items: flex-start; }
  .section-intro { align-items: flex-start; flex-direction: column; }
  .ticket-row { grid-template-columns: minmax(0,1fr) auto; gap: 7px; }
  .ticket-row .ticket-assignee { display: none; }
  .table-panel { max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
  table { min-width: 540px; }
  .login-wrap { place-items: center; padding: 15px; background: #081b29; }
  .login-wrap::before { inset: 0; opacity: .46; }
  .login-wrap::after { inset: 0; background: linear-gradient(0deg,#071b29ef,#071b29a8 70%,#071b2970); }
  .login-card { width: 100%; margin: 0; padding: 25px 21px; }
  .appeals-public { padding: 16px 14px calc(24px + env(safe-area-inset-bottom)); }
  .appeals-hero { margin: 24px auto; }
  .legal-links { flex-wrap: wrap; }
  .button, .text-button, .multi-select-trigger, .input, select.input { min-height: 42px; }
  input.input, textarea.input, select.input { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media (prefers-reduced-transparency: reduce) {
  .mobile-tabbar, .topbar { background: var(--panel); }
}
@media (prefers-contrast: more) {
  .panel, .stat-card, .input, select.input, .mobile-tabbar { border-width: 2px; }
}
body:not(.light) {
  color-scheme: dark;
  --bg: #0d1c27; --sidebar: #07141f; --sidebar-line: #1b3545; --panel: #122633; --panel-2: #172e3c; --line: #29424f; --text: #e4e0d7; --muted: #9ab0bb; --blue: #37b9e8; --blue-light: #a7e8ff; --green: #58d2a4; --red: #ff8790; --control: #10232f; --focus: #72d3fb;
}
body:not(.light) .main { color: var(--text); }
body:not(.light) .topbar { border-color: var(--line); }
body:not(.light) .topbar h1, body:not(.light) .section-intro h2, body:not(.light) .panel h3, body:not(.light) .stat-value, body:not(.light) .focus-card strong { color: #e8f5fa; }
body:not(.light) .panel, body:not(.light) .stat-card, body:not(.light) .overview-focus, body:not(.light) .stat-grid, body:not(.light) .user-chip { background: var(--panel); color: var(--text); }
body:not(.light) .input, body:not(.light) textarea.input, body:not(.light) select.input, body:not(.light) .multi-select-trigger { border-color: var(--line); background: var(--control); color: var(--text); }
body:not(.light) th { background: #172e3c; color: #acc0c9; }
body:not(.light) td { color: #d3e2e8; }
body:not(.light) th, body:not(.light) td, body:not(.light) .ticket-row { border-color: var(--line); }
body:not(.light) .ticket-name { color: #d9edf4; }
body:not(.light) .focus-card:hover, body:not(.light) .ticket-row:hover { background: #193544; }
body:not(.light) .settings-panel label { color: #b4c8d1; }
body:not(.light) .login-wrap { background: #0d1c27; }
body:not(.light) .login-card { border-color: var(--line); background: var(--panel); }
body:not(.light) .login-card h1, body:not(.light) .appeals-hero h1 { color: #e8f5fa; }
body:not(.light) .appeals-public { background: var(--bg); }
body:not(.light) .mobile-tabbar { background: #092233f5; }
body:not(.light) .mobile-server-picker select { border-color: var(--line); background: var(--panel); color: var(--text); }

/* Overview layout is owned by neworia-dashboard.css to avoid competing grids. */
.view > .section-intro { margin-top:2px; }
.view > .section-intro h2 { font-size:24px; }
.view > .section-intro p { max-width:680px; }
.view > .panel + .panel, .view > .content-grid + .panel { margin-top:14px; }
.view .settings-panel > h3 { padding-bottom:8px; border-bottom:1px solid var(--line); }
.view .editor-heading, .view .editor-actions { display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; }
.view .content-grid { align-items:start; }
.view .panel-head { align-items:center; }
.view .panel-head .muted { max-width:620px; }
.nav-item { min-height:36px; }
.category-tab, .nav-item, .mobile-tab { -webkit-tap-highlight-color:transparent; }
body:not(.light) .overview-page-heading h2, body:not(.light) .overview-metrics-heading h3 { color:#e8f5fa; }
body:not(.light) .overview-page-heading { border-color:var(--line); }
body:not(.light) .overview-tickets > .panel-head { border-color:var(--line); }
/* Consistent, legible select controls and deliberate multi-select dialogs. */
select.input:not([multiple]), .server-picker select, .mobile-server-picker select {
  appearance:none;
  padding-right:36px;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='m4 6 4 4 4-4' stroke='%23496574' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat:no-repeat;
  background-position:right 11px center;
  background-size:15px;
  cursor:pointer;
}
select.input:not([multiple]), .server-picker select, .mobile-server-picker select {
  background-repeat:no-repeat!important;
  background-position:right 11px center!important;
  background-size:15px 15px!important;
}
select.input:not([multiple]):hover, .server-picker select:hover, .mobile-server-picker select:hover { border-color:#78aebe; }
select.input:not([multiple]):disabled, .server-picker select:disabled, .mobile-server-picker select:disabled { cursor:not-allowed; opacity:.62; }
select.input option { background:#fff; color:#193644; }
body:not(.light) select.input:not([multiple]), body:not(.light) .server-picker select, body:not(.light) .mobile-server-picker select {
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='m4 6 4 4 4-4' stroke='%23b6ccd5' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
body:not(.light) select.input option { background:#102838; color:#f4f1eb; }
.multi-select-dialog { width:min(560px,calc(100vw - 28px)); max-height:min(760px,calc(100dvh - 28px)); overflow:hidden; border:1px solid #cbd9e0; border-radius:12px; background:#fff; box-shadow:0 22px 70px #071b2b3b; }
.multi-select-card { grid-template-rows:auto auto auto auto minmax(0,1fr) auto; gap:10px; padding:20px; }
.multi-select-head { align-items:center; padding:0 30px 5px 0; }
.multi-select-head .eyebrow { margin:0 0 2px; font-size:11px; }
.multi-select-head h2 { margin:0; color:#173547; font-size:20px; font-weight:740; letter-spacing:-.025em; }
.multi-select-head .drawer-close { top:0; right:0; }
#multi-select-search { min-height:44px; padding-left:40px; background-color:#f7fafb; background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 18 18' fill='none'%3E%3Ccircle cx='7.8' cy='7.8' r='5.3' stroke='%23718794' stroke-width='1.5'/%3E%3Cpath d='m12 12 3.7 3.7' stroke='%23718794' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat:no-repeat; background-position:13px center; background-size:17px; }
.multi-select-tools { display:flex; align-items:center; justify-content:space-between; gap:10px; color:#58707d; font-size:11px; }
.multi-select-tools > span { font-weight:700; }
.multi-select-tools > div { display:flex; align-items:center; gap:8px; }
.multi-select-tools .text-button { min-height:32px; padding:5px 7px; border-radius:4px; }
.multi-select-tools .text-button:hover:not(:disabled) { background:#eaf6fa; text-decoration:none; }
.multi-select-tools .text-button:disabled { opacity:.42; }
.multi-select-selection { min-height:18px; margin:0; overflow:hidden; color:#6a7e89; font-size:10px; text-overflow:ellipsis; white-space:nowrap; }
.multi-select-options { min-height:0; gap:5px; padding:2px 4px 2px 1px; overscroll-behavior:contain; scrollbar-color:#adbdc5 transparent; }
.multi-select-option { min-height:42px; padding:8px 10px; border-color:#e0e8ec; border-radius:5px; background:#fff; transition:background-color .12s ease,border-color .12s ease; }
.multi-select-option:hover { border-color:#9fc5d2; background:#f5fafc; }
.multi-select-option.selected { border-color:#81bdd0; background:#eaf7fb; }
.multi-select-option input { width:17px; height:17px; margin:0; accent-color:#087eaa; }
.multi-select-option:focus-within { outline:2px solid #72d3fb; outline-offset:1px; }
.multi-select-actions { display:grid; grid-template-columns:auto minmax(0,1fr); gap:9px; padding-top:10px; border-top:1px solid #e1e9ed; }
.multi-select-actions .button { min-height:42px; }
.multi-select-done { width:auto; }
body:not(.light) .multi-select-dialog { border-color:#254457; background:#0e2331; }
body:not(.light) .multi-select-head h2 { color:#e8f5fa; }
body:not(.light) #multi-select-search { border-color:#294555; background-color:#0a1b27; color:#e5f1f5; }
body:not(.light) .multi-select-selection, body:not(.light) .multi-select-tools { color:#a6bdc8; }
body:not(.light) .multi-select-option { border-color:#25404e; background:#112a39; color:#deebf0 !important; }
body:not(.light) .multi-select-option:hover, body:not(.light) .multi-select-option.selected { border-color:#1a607a; background:#102c3c; }
body:not(.light) .multi-select-actions { border-color:#25404e; }
body:not(.light) .invite-reward-row { border-color:var(--line)!important; background:#172e3c!important; }
body:not(.light) .invite-reward-row label { color:#b4c8d1; }
@media (max-width:600px) {
  .multi-select-dialog { width:100vw; max-height:84dvh; border-right:0; border-bottom:0; border-left:0; border-radius:14px 14px 0 0; }
  .multi-select-card { grid-template-rows:auto auto auto auto minmax(0,1fr) auto; max-height:84dvh; padding:17px 14px calc(14px + env(safe-area-inset-bottom)); }
  .multi-select-tools { align-items:flex-start; flex-direction:column; gap:2px; }
  .multi-select-tools > div { width:100%; justify-content:flex-start; }
  .multi-select-options { min-height:120px; }
}
.section-intro p, .panel-head p { font-size:12px; line-height:1.55; }
.settings-panel label, .field { font-size:12px; }
.ticket-meta { font-size:11px; line-height:1.45; }
.badge { font-size:10px; }
.button { font-size:12px; }
.ticket-row .ticket-name { font-size:12px; }
.multi-select-trigger b { font-size:18px; line-height:1; transition:transform .14s ease; }
.multi-select-trigger[aria-expanded="true"] b { transform:rotate(180deg); }
.multi-select-option { line-height:1.4; }
body:not(.light) .section-intro p, body:not(.light) .panel-head p { color:#a8bdc7; }

/* Tablet layout: keep the desktop workspace, but give the work surface room. */
@media (min-width:901px) and (max-width:1180px) {
  .layout { grid-template-columns:286px minmax(0,1fr); }
  .main { padding:18px 18px 30px; }
  .overview-metrics .stat-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .overview-metrics .stat-card:nth-child(2) { border-right:0; }
  .overview-metrics .stat-card:nth-child(n+3) { border-top:1px solid var(--line); }
  .applications-layout { grid-template-columns:minmax(0,1fr); }
}

/* Phone and portrait-tablet shell. */
@media (max-width:900px) {
  .layout { display:block; min-height:100dvh; }
  .sidebar { display:none; }
  .main { width:100%; max-width:none; padding:0 17px calc(100px + env(safe-area-inset-bottom)); }
  .topbar { position:sticky; z-index:15; top:0; min-height:68px; margin:0 -17px 15px; padding:calc(9px + env(safe-area-inset-top)) 17px 10px; border-bottom:1px solid color-mix(in srgb,var(--line) 68%,transparent); background:color-mix(in srgb,var(--bg) 82%,transparent); -webkit-backdrop-filter:saturate(165%) blur(20px); backdrop-filter:saturate(165%) blur(20px); }
  .topbar-title { min-width:0; }
  .topbar .eyebrow { font-size:11px; }
  .topbar h1 { max-width:54vw; font-size:21px; }
  .topbar-actions { gap:8px; }
  .mobile-server-picker { display:grid; min-width:0; max-width:min(38vw,220px); gap:2px; color:var(--muted); font-size:9px; font-weight:650; }
  .mobile-server-picker span { display:block; }
  .mobile-server-picker select { width:100%; max-width:220px; min-height:42px; padding:7px 32px 7px 10px; border-radius:10px; background-color:var(--panel); color:var(--text); font-size:13px; }
  .user-chip { max-width:36px; padding:3px; border:0; background:transparent; box-shadow:none; }
  .user-chip span { display:none; }
  .user-chip img { width:30px; height:30px; }
  .mobile-tabbar { position:fixed; z-index:40; inset:auto 10px calc(9px + env(safe-area-inset-bottom)); display:grid; width:min(600px,calc(100% - 20px)); grid-template-columns:repeat(5,minmax(0,1fr)); gap:4px; margin:0 auto; padding:6px 7px; border:1px solid color-mix(in srgb,var(--line) 78%,transparent); border-radius:16px; background:color-mix(in srgb,var(--panel) 82%,transparent); -webkit-backdrop-filter:saturate(180%) blur(22px); backdrop-filter:saturate(180%) blur(22px); box-shadow:0 12px 34px #020c1460,inset 0 1px #ffffff16; }
  .mobile-tab { display:grid; min-width:0; min-height:52px; align-content:center; justify-items:center; gap:3px; padding:4px 2px; border:1px solid transparent; border-radius:11px; background:transparent; color:var(--muted); touch-action:manipulation; }
  .mobile-tab > span { font-size:19px; line-height:1; }
  .mobile-tab small { max-width:100%; overflow:hidden; font-size:10px; font-weight:650; line-height:1.15; text-overflow:ellipsis; white-space:nowrap; }
  .mobile-tab.active { border-color:color-mix(in srgb,var(--blue) 26%,transparent); background:color-mix(in srgb,var(--blue) 15%,transparent); color:var(--blue); }
  .mobile-more-dialog[open] { position:fixed; inset:auto 0 0; display:block; width:100%; max-width:none; max-height:min(84dvh,760px); margin:0; overflow:hidden; border:1px solid var(--line); border-bottom:0; border-radius:20px 20px 0 0; background:color-mix(in srgb,var(--panel) 94%,transparent); color:var(--text); -webkit-backdrop-filter:saturate(175%) blur(24px); backdrop-filter:saturate(175%) blur(24px); box-shadow:0 -18px 54px #020c1460; }
  .mobile-more-dialog::backdrop { background:#06131db3; -webkit-backdrop-filter:blur(3px); backdrop-filter:blur(3px); }
  .mobile-more-card { max-height:min(84dvh,760px); padding:16px 17px calc(17px + env(safe-area-inset-bottom)); overflow-y:auto; overscroll-behavior:contain; }
  .mobile-more-head { position:sticky; top:-16px; z-index:1; margin:-16px -17px 8px; padding:14px 17px 11px; border-bottom:1px solid var(--line); background:color-mix(in srgb,var(--panel) 95%,transparent); -webkit-backdrop-filter:blur(18px); backdrop-filter:blur(18px); }
  .mobile-more-head h2 { margin:3px 0 0; color:var(--text); font-size:20px; }
  #mobile-more-items { display:grid; gap:5px; }
  .mobile-more-group { margin:12px 4px 2px; color:var(--muted); font-size:10px; font-weight:720; letter-spacing:.08em; }
  .mobile-more-item { display:grid; width:100%; min-height:52px; grid-template-columns:38px minmax(0,1fr) 18px; align-items:center; gap:10px; padding:7px 11px; border:1px solid var(--line); border-radius:10px; background:var(--panel-2); color:var(--text); text-align:left; font-size:14px; font-weight:620; touch-action:manipulation; }
  .mobile-more-item > span:first-child { display:grid; width:36px; height:36px; place-items:center; border-radius:9px; background:color-mix(in srgb,var(--blue) 13%,transparent); color:var(--blue); font-size:17px; }
  .mobile-more-item.active { border-color:color-mix(in srgb,var(--blue) 54%,var(--line)); background:color-mix(in srgb,var(--blue) 12%,var(--panel)); }
  .mobile-more-arrow { color:var(--muted); font-size:21px; text-align:right; }
  .content-grid, .logging-studio-grid, .type-layout, .events-grid, .applications-layout { grid-template-columns:minmax(0,1fr); }
  .field-grid { grid-template-columns:minmax(0,1fr); }
  .field-grid > * { min-width:0; }
  .rating-insights { grid-template-columns:minmax(0,1fr); }
  .applications-steps { grid-template-columns:minmax(0,1fr); gap:8px; }
  .applications-steps > i { display:none; }
  .table-panel { max-width:100%; overflow-x:auto; overscroll-behavior-x:contain; -webkit-overflow-scrolling:touch; }
  .table-panel table { min-width:620px; }
  .ticket-table { min-width:680px; }
  .drawer { z-index:45; inset:0; width:100%; height:100dvh; padding:calc(64px + env(safe-area-inset-top)) 17px calc(100px + env(safe-area-inset-bottom)); border:0; border-radius:0; overscroll-behavior:contain; -webkit-overflow-scrolling:touch; }
  .drawer-close { top:max(10px,env(safe-area-inset-top)); right:12px; width:44px; height:44px; }
  .button, .text-button, .multi-select-trigger, .input, select.input { min-height:44px; }
  input.input, textarea.input, select.input { font-size:16px; }
  .editor-actions { flex-wrap:wrap; }
  .editor-actions > * { min-width:0; }
  footer { padding-bottom:8px; }
}

@media (max-width:620px) {
  .main { padding-right:13px; padding-left:13px; }
  .topbar { margin-right:-13px; margin-left:-13px; padding-right:13px; padding-left:13px; }
  .topbar h1 { max-width:48vw; font-size:19px; }
  .mobile-server-picker { max-width:36vw; }
  .mobile-server-picker select { min-height:40px; padding-left:8px; font-size:12px; }
  .overview-metrics .stat-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .panel { padding:14px; }
  .panel-head { align-items:flex-start; }
  .section-intro { align-items:flex-start; flex-direction:column; }
  .section-intro h2 { font-size:21px; }
  .section-intro .button, .section-intro .editor-actions { width:100%; }
  .section-intro .editor-actions .input { flex:1 1 125px; min-width:0; }
  .ticket-row { grid-template-columns:minmax(0,1fr) auto; gap:7px; }
  .ticket-row .ticket-assignee { display:none; }
  .ticket-table th, .ticket-table td { padding:10px 11px; }
  .team-role-row, .role-option-row, .invite-reward-row, .counter-row { grid-template-columns:minmax(0,1fr); }
  .invite-reward-row label, .invite-reward-row .invite-reward-delete { grid-column:auto; grid-row:auto; }
  .invite-reward-row .invite-reward-delete { justify-self:end; }
  .linked-role-row { grid-template-columns:minmax(0,1fr) 38px; }
  .linked-role-row > label:first-child { grid-column:1; grid-row:1; }
  .linked-role-arrow { grid-column:1; grid-row:2; justify-self:center; padding:0; transform:rotate(90deg); }
  .linked-role-row > label:nth-of-type(2) { grid-column:1; grid-row:3; }
  .linked-role-remove { grid-column:2; grid-row:1; justify-self:end; padding:5px 0; }
  .applications-steps { padding:12px; }
  .applications-settings, .applications-question-panel { padding:14px; }
  .applications-panel-head p { max-width:none; }
  .multi-select-dialog { width:100vw; max-height:84dvh; border-right:0; border-bottom:0; border-left:0; border-radius:15px 15px 0 0; }
  .multi-select-card { max-height:84dvh; padding:16px 13px calc(14px + env(safe-area-inset-bottom)); }
  .mobile-tabbar { right:8px; left:8px; width:calc(100% - 16px); gap:2px; padding:5px; border-radius:14px; }
  .mobile-tab { min-height:49px; border-radius:9px; }
  .mobile-tab small { font-size:9px; }
  .table-panel { border-radius:8px; }
  footer { align-items:flex-start; flex-direction:column; }
}

@media (prefers-reduced-transparency:reduce) and (max-width:900px) {
  .topbar, .mobile-tabbar, .mobile-more-dialog[open], .mobile-more-head { background:var(--panel); -webkit-backdrop-filter:none; backdrop-filter:none; }
}

/* Responsive workspace refinement: iPad gets the full module navigator; phones keep the compact tab bar. */
@media (min-width:700px) and (max-width:1024px) and (min-height:600px) {
  .layout { display:grid; grid-template-columns:calc(164px + var(--rail-width)) minmax(0,1fr); min-height:100dvh; }
  .sidebar { position:sticky; top:0; display:grid; width:calc(164px + var(--rail-width)); height:100dvh; min-height:0; grid-template-rows:auto minmax(0,1fr) auto; padding:12px 8px 9px; }
  .sidebar-brand-area { min-width:0; }
  .brand { gap:8px; padding:0 4px 11px; }
  .brand-mark.small { width:32px; height:32px; }
  .brand b { font-size:12px; }
  .brand small { font-size:9px; }
  .server-picker { padding:9px 3px 11px; }
  .server-picker select { min-height:40px; padding:8px 7px; font-size:12px; }
  .sidebar-workspace { grid-template-columns:var(--rail-width) minmax(0,1fr); }
  .category-rail { gap:4px; padding:8px 3px; }
  .category-tab { min-height:54px; }
  .category-tab small { font-size:clamp(7px,calc(var(--rail-width) * .11),9px); }
  .category-size-tools { grid-template-columns:1fr; gap:2px; }
  .category-size-tools span { display:none; }
  .category-size-tools button { min-height:30px; }
  .side-navigation { padding:9px 4px 8px 6px; }
  .nav-label { margin:4px 5px 3px; font-size:8px; }
  .nav-item { min-height:40px; gap:6px; padding:6px 5px; font-size:10px; line-height:1.25; }
  .nav-item span { width:17px; flex-basis:17px; font-size:13px; }
  .sidebar-bottom { grid-template-columns:1fr; gap:2px; padding:6px 2px 0; }
  .online { padding:4px 5px 5px; font-size:10px; }
  .logout { min-height:36px; font-size:10px; }
  .main { width:100%; max-width:none; padding:18px clamp(16px,2.8vw,28px) calc(28px + env(safe-area-inset-bottom)); }
  .topbar { position:sticky; top:0; z-index:15; min-height:64px; margin:0 0 18px; padding:8px 0 12px; background:color-mix(in srgb,var(--bg) 88%,transparent); -webkit-backdrop-filter:saturate(160%) blur(18px); backdrop-filter:saturate(160%) blur(18px); }
  .topbar h1 { max-width:55vw; font-size:clamp(22px,3vw,27px); }
  .content-grid, .logging-studio-grid, .type-layout, .events-grid, .applications-layout { grid-template-columns:minmax(0,1fr); }
  .mobile-tabbar { display:none; }
  .mobile-server-picker { display:none; }
}

@media (max-width:699px), (max-width:1024px) and (max-height:599px) {
  .layout { display:block; min-height:100dvh; }
  .sidebar { display:none; }
  .mobile-tabbar { padding-bottom:calc(6px + env(safe-area-inset-bottom)); }
  .main { min-height:100dvh; padding-bottom:calc(96px + env(safe-area-inset-bottom)); }
  .topbar { padding-top:calc(8px + env(safe-area-inset-top)); }
  .drawer { padding-top:calc(62px + env(safe-area-inset-top)); }
}

@media (max-width:380px) {
  .main { padding-right:10px; padding-left:10px; }
  .topbar { margin-right:-10px; margin-left:-10px; padding-right:10px; padding-left:10px; }
  .topbar h1 { max-width:43vw; font-size:18px; }
  .topbar-actions { gap:4px; }
  .mobile-server-picker { max-width:34vw; }
  .mobile-server-picker select { min-height:38px; padding-right:22px; font-size:11px; }
  .mobile-tabbar { right:6px; left:6px; width:calc(100% - 12px); }
  .mobile-tab small { font-size:8px; }
  .overview-page-heading h2 { font-size:23px; }
  .panel { padding:12px; }
}

@media (prefers-reduced-transparency:reduce) and (min-width:700px) and (max-width:1024px) and (min-height:600px) {
  .topbar { background:var(--bg); -webkit-backdrop-filter:none; backdrop-filter:none; }
}
