.command-shell { max-width: 1150px; padding-bottom: 3.5rem; }
.command-title { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: 1rem; padding: 2.4rem 0 1.3rem; }
.command-title .preview-note { margin: 0 0 .72rem; }
.command-title h1 { margin: 0 0 .5rem; font-size: clamp(2.3rem, 5.7vw, 4.15rem); letter-spacing: -.062em; }
.command-description, .command-panel p { color: var(--muted); }
.command-status { min-height: 1.5rem; margin: 0 0 .65rem; color: var(--blue); font-size: .92rem; }
.command-status:empty { display: none; }
.command-panel {
  padding: clamp(.9rem, 3vw, 1.35rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 11px;
  min-width: 0;
}
.command-panel h2 { font-size: 1.24rem; letter-spacing: -.035em; }
.command-panel p { font-size: .9rem; }
.command-panel .text-button { margin-top: .65rem; }
.command-heading, .command-row, .command-copy { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .55rem 1rem; }
.command-heading { margin-bottom: .65rem; }
.pair-panel { margin: 0 0 .9rem; }
.command-copy { margin: .72rem 0; padding: .67rem .75rem; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; }

.server-workspace { display: grid; grid-template-columns: 204px minmax(0, 1fr); align-items: start; gap: .9rem; }
.server-rail { position: sticky; top: 87px; padding: .65rem; background: #10131e; border: 1px solid var(--line); border-radius: 11px; }
.server-picker { padding: .25rem .15rem .7rem; }
.server-picker label { display: block; margin-bottom: .48rem; color: var(--muted); font: .78rem var(--mono); }
.server-picker select { width: 100%; padding-block: .55rem; background-color: #090d17; }
.server-nav { display: grid; gap: .24rem; padding-top: .58rem; border-top: 1px solid var(--line); }
.command-tab {
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: .48rem .56rem;
  font-size: .91rem;
  text-align: left;
  font-weight: 650;
}
.command-tab:hover { background: #ffffff09; color: var(--text); }
.command-tab[aria-pressed=true] { border-color: #7296f549; background: #7496fb20; color: #c9d8ff; }
.server-details { min-width: 0; }
.server-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: .55rem 1rem;
  min-height: 90px;
  margin-bottom: .72rem;
  padding: .85rem 1.1rem;
  border: 1px solid #333f5a;
  border-radius: 11px;
  background:
    radial-gradient(ellipse at 88% 20%, #253454 0, transparent 63%),
    linear-gradient(115deg, #171d2f, #121625);
}
.server-banner h2 { font-size: clamp(1.35rem, 3.2vw, 2.05rem); line-height: 1.14; letter-spacing: -.048em; overflow-wrap: anywhere; }
.server-banner p { margin-top: .35rem; color: var(--muted); font: .77rem/1.5 var(--mono); }
.server-banner .command-actions { align-items: center; }
.server-sync {
  flex: 0 0 auto;
  color: var(--muted);
  font: .76rem/1.4 var(--mono);
  padding: .25rem .53rem;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #0d111d;
}
.server-sync[data-fresh=true] { color: var(--green); border-color: #67dfae49; }
.server-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .65rem; margin: 0 0 .72rem; }
.server-stats > div { padding: .64rem .75rem; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow-wrap: anywhere; }
.server-stats dt { color: var(--muted); font: .75rem/1.35 var(--mono); }
.server-stats dd { margin: .3rem 0 0; font-weight: 750; font-size: 1.1rem; }
.version-table { width: 100%; border-collapse: collapse; margin-top: .85rem; table-layout: fixed; font-size: .92rem; }
.version-table :is(th, td) { padding: .55rem .62rem; text-align: left; overflow-wrap: anywhere; }
.version-table thead { color: var(--muted); background: #171e2d; font: .76rem var(--mono); }
.version-table thead th:first-child { width: 42%; border-radius: 6px 0 0 6px; }
.version-table thead th:last-child { border-radius: 0 6px 6px 0; }
.version-table tbody th { font-weight: 650; }
.version-table tbody td, .version-table tbody th { border-bottom: 1px solid var(--line); }
.version-table tbody tr:last-child > * { border-bottom: 0; }
.version-chip { color: #c0d3ff; font: .81rem var(--mono); }
.version-chip.staged { color: #ffd1a0; }

.timeline-panel { margin-top: .72rem; }
.timeline-filter { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem; max-width: 100%; color: var(--muted); font-size: .875rem; }
.timeline-filter select { max-width: 100%; }
.timeline-list { padding: 0; margin: .65rem 0; list-style: none; }
.timeline-list:empty, .timeline-status:empty { display: none; }
.timeline-list li { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: .28rem 1rem; padding: .64rem .65rem .64rem 1.08rem; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.timeline-list li::before { position: absolute; inset: 1.12rem auto auto .28rem; content: ''; width: .36rem; height: .36rem; border-radius: 100%; background: var(--blue); }
.timeline-list li[data-kind=release-failed]::before { background: var(--red); }
.timeline-list h3 { font-size: .94rem; }
.timeline-list time { font: .76rem/1.5 var(--mono); color: #c4d2f2; text-align: right; }
.timeline-list .timeline-meta { color: var(--faint); font-size: .8rem; }
.timeline-panel .timeline-status { color: var(--muted); }

.command-list { margin-top: .68rem; }
.command-row { padding: .58rem 0; border-bottom: 1px solid var(--line); }
.command-row:last-child { border-bottom: 0; }
.command-row h3 { font-size: .96rem; font-weight: 650; }
.command-row p { font-size: .83rem; }
.command-row code, .command-copy code { overflow-wrap: anywhere; }
.command-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.disconnect { margin: 1.2rem 0 0 .24rem; color: var(--red); }

.telemetry-panel { margin-bottom: .72rem; padding: 1rem 1.12rem 1.12rem; background: var(--surface); border: 1px solid var(--line); border-radius: 11px; }
.telemetry-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .6rem 1rem; margin-bottom: .9rem; }
.telemetry-heading h2 { font-size: 1.18rem; letter-spacing: -.035em; }
.telemetry-heading p { color: var(--muted); font-size: .875rem; }
.telemetry-status { display: inline-flex; align-items: center; gap: .45rem; padding: .2rem .58rem; color: #ffd2a1; background: #221d1b; border: 1px solid #ffb77338; border-radius: 1rem; font-size: .8125rem; }
.telemetry-status::before { content: ''; width: .42rem; height: .42rem; border-radius: 100%; background: currentColor; }
.telemetry-status[data-fresh=true] { color: var(--green); background: #112321; border-color: #67dfae38; }
.telemetry-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; margin: 0; }
.telemetry-grid > div { display: grid; align-content: start; min-width: 0; padding: .68rem .72rem .82rem; background: #0b101b; border: 1px solid #293349; border-radius: 8px; }
.telemetry-grid dt { color: #b6c2db; font-size: .875rem; }
.telemetry-grid dd { margin: .25rem 0 0; color: #e5edff; font: 600 clamp(1.12rem, 2.1vw, 1.55rem)/1.2 var(--mono); overflow-wrap: anywhere; }
.telemetry-grid .telemetry-detail { margin-top: .25rem; color: var(--muted); font: .8125rem/1.4 var(--sans); }
.telemetry-grid progress { display: block; width: 100%; height: 4px; margin-top: .53rem; border: 0; border-radius: 4px; background: #243145; color: var(--blue); }
.telemetry-grid progress::-webkit-progress-bar { border-radius: 4px; background: #243145; }
.telemetry-grid progress::-webkit-progress-value { border-radius: 4px; background: linear-gradient(90deg, #819dff, #ac9af8); }
.telemetry-grid progress::-moz-progress-bar { border-radius: 4px; background: #819dff; }

.access-heading {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: .9rem 1.05rem;
  margin-bottom: .72rem;
  padding: clamp(1rem, 3vw, 1.65rem);
  border: 1px solid #404a72;
  border-radius: 13px;
  background: radial-gradient(ellipse at 9% 0, #383968 0, transparent 58%), linear-gradient(120deg, #1a233c, #161727 82%);
  box-shadow: inset 0 1px #adb3ff16;
}
.access-mark { display: grid; place-items: center; width: 3.4rem; aspect-ratio: 1; border: 1px solid #a6afff5e; border-radius: 14px; color: #dce0ff; background: #9c9af42b; box-shadow: 0 8px 25px #080d2455; }
.access-mark span { position: relative; width: 1.2rem; height: .85rem; margin-top: .45rem; border: 2px solid currentColor; border-radius: 3px; }
.access-mark span::before { content: ''; position: absolute; inset: -.66rem .11rem auto; height: .56rem; border: 2px solid currentColor; border-bottom: 0; border-radius: .4rem .4rem 0 0; }
.access-mark span::after { content: ''; position: absolute; left: calc(50% - 1px); top: .19rem; width: 2px; height: 4px; border-radius: 1px; background: currentColor; }
.access-heading .access-kicker { color: #c3c9fb; text-transform: uppercase; letter-spacing: .11em; font: 600 .75rem/1.4 var(--mono); }
.access-heading h2 { margin: .19rem 0 .25rem; color: #f6f5ff; font-size: clamp(1.65rem, 3vw, 2.2rem); line-height: 1.1; letter-spacing: -.055em; }
.access-heading p { color: #d0d8ec; font-size: .9375rem; }
.access-heading .primary { gap: .42rem; white-space: nowrap; }
.add-mark { font-size: 1.32rem; line-height: .8; }
.owner-strip { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .72rem; margin: 0 0 .72rem; padding: .72rem .9rem; border: 1px solid #413841; border-radius: 10px; background: linear-gradient(105deg, #231e27, #141722 68%); }
.owner-mark { display: grid; place-items: center; width: 2.2rem; aspect-ratio: 1; color: #ffcf8f; background: #ffd09514; border-radius: 8px; }
.owner-strip h3 { font-size: 1rem; line-height: 1.35; overflow-wrap: anywhere; }
.owner-strip p, .approval-heading p { font-size: .875rem; color: var(--muted); }
.owner-badge { padding: .15rem .5rem; color: #ffdcab; border: 1px solid #ffbd794a; border-radius: 6px; background: #ffbd7910; font-size: .8125rem; }

.approval-panel { padding: 1rem 1.12rem .35rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.approval-heading { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: .35rem .75rem; }
.approval-heading h3 { display: flex; align-items: center; flex-wrap: wrap; gap: .45rem; margin-bottom: .18rem; font-size: 1.17rem; letter-spacing: -.028em; }
.approval-count { padding: .12rem .46rem; border: 1px solid #7597f34a; border-radius: 1rem; background: #7897ee19; color: #cfdaff; font: 500 .77rem/1.4 var(--mono); }
.approval-tools { display: flex; gap: .55rem; margin: .88rem 0 .7rem; }
.approval-search { flex: 1; min-width: 0; position: relative; }
.approval-tools :is(input, select) { min-height: 43px; background-color: #0a0e18; }
.approval-search input[type=search] { min-height: 43px; }
.approval-search .search-icon { top: 14px; }
.approval-tools select { max-width: 100%; }
.approval-feedback { margin: .45rem 0; color: var(--green); font-size: .875rem; overflow-wrap: anywhere; }
.approval-feedback:empty, .approval-error:empty { margin: 0; }
.approval-table { width: 100%; table-layout: fixed; border-spacing: 0; text-align: left; }
.approval-table th, .approval-table td { padding: .6rem .46rem; }
.approval-table thead th { color: var(--muted); background: #191f30; font-size: .8125rem; font-weight: 650; }
.approval-table thead th:first-child { width: 38%; border-radius: 7px 0 0 7px; }
.approval-table thead th:last-child { width: 135px; border-radius: 0 7px 7px 0; text-align: right; }
.approval-table tbody tr + tr > * { border-top: 1px solid var(--line); }
.approval-table tbody tr:focus-within > *, .approval-table tbody tr:hover > * { background: #89a5fb0a; }
.approval-identity { display: flex; align-items: flex-start; gap: .58rem; }
.approval-identity strong { display: block; font-size: .875rem; font-weight: 700; }
.approval-identity code { display: block; color: #b2bed6; font: .78rem/1.35 var(--mono); overflow-wrap: anywhere; }
.provider-mark { flex: 0 0 2rem; display: grid; place-items: center; aspect-ratio: 1; color: #cdd9ef; background: #26354a; border: 1px solid #ffffff1e; border-radius: 7px; font: 700 .82rem var(--mono); }
.provider-mark[data-provider=discord] { color: #d8d8ff; background: #343669; }
.provider-mark[data-provider=fivem] { color: #ffdcaf; background: #553c31; }
.provider-mark[data-provider^=license] { color: #fee9ad; background: #51452d; }
.provider-mark[data-provider=steam] { color: #d0e7ff; background: #274360; }
.grant-chips, .approval-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .27rem; }
.grant-summary { display: grid; gap: .3rem; }
.grant-group { display: grid; grid-template-columns: 3.5rem minmax(0, 1fr); align-items: baseline; gap: .3rem; }
.grant-scope { color: var(--muted); font-size: .75rem; font-weight: 650; }
.grant-chip { display: inline-block; padding: .12rem .41rem; color: #ccd5e8; background: #899bb81a; border: 1px solid #899bb82e; border-radius: 6px; font-size: .8125rem; line-height: 1.4; }
.grant-group[data-scope=website] .grant-chip { color: #c0d1ff; background: #83a3ff15; border-color: #83a3ff33; }
.grant-group[data-scope=in-game] .grant-chip { color: #9ce6c8; background: #67dfae12; border-color: #67dfae35; }
.approval-actions { justify-content: flex-end; }
.approval-actions .button { min-height: 34px; padding: .31rem .49rem; border-radius: 7px; font-size: .8125rem; }
.approval-actions .revoke-link { color: #ffa6ad; background: transparent; border-color: transparent; }
.approval-actions .revoke-link:hover { background: #ff757e18; border-color: #ff757e38; }
.approval-readonly { display: block; color: var(--muted); font-size: .8125rem; text-align: right; }
.approval-empty { padding: 1.3rem .6rem; color: var(--muted); text-align: center; border-top: 1px solid var(--line); }

.access-dialog { max-height: calc(100dvh - 24px); overflow: auto; }
.access-dialog-header { display: flex; justify-content: space-between; align-items: start; gap: .8rem; padding: 1.1rem 1.25rem; border-bottom: 1px solid var(--line); background: linear-gradient(115deg, #202847, #151826 75%); }
.access-dialog-header h2 { font-size: 1.36rem; letter-spacing: -.035em; }
.access-dialog-header p { color: var(--muted); font-size: .875rem; overflow-wrap: anywhere; }
.approval-form { padding: 1.1rem 1.25rem 1.25rem; }
.approval-fields { display: grid; grid-template-columns: minmax(9.5rem, .72fr) minmax(0, 1fr); gap: .65rem; }
.approval-fields label { display: grid; gap: .28rem; font-size: .875rem; font-weight: 650; }
.approval-fields :is(input, select) { width: 100%; min-width: 0; min-height: 43px; background-color: #090e18; border: 1px solid #353f55; border-radius: 8px; }
.approval-fields input { padding: .49rem .65rem; font: .875rem var(--mono); }
.approval-form > p { margin-top: .43rem; color: var(--muted); font-size: .875rem; }
.approval-scopes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; margin: .75rem 0 .68rem; }
.approval-grants { display: grid; align-content: start; gap: .4rem; min-width: 0; margin: 0; padding: .45rem .55rem .55rem; border: 1px solid #394258; border-radius: 9px; }
.approval-grants legend { padding: 0 .28rem; color: #d9e1f1; font-size: .875rem; font-weight: 700; }
.approval-grants[data-scope=website] { border-color: #83a3ff59; }
.approval-grants[data-scope=website] legend { color: #c0d1ff; }
.approval-grants[data-scope=in-game] { grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); border-color: #67dfae47; }
.approval-grants[data-scope=in-game] legend { color: #9ce6c8; }
.approval-grants label { display: flex; align-items: start; gap: .52rem; min-width: 0; padding: .55rem .58rem; background: #ffffff05; border: 1px solid var(--line); border-radius: 8px; font-size: .875rem; cursor: pointer; }
.approval-grants label:has(:checked) { border-color: #7296f571; background: #7496fb1b; }
.approval-grants label:has(:disabled) { cursor: default; }
.approval-grants label:has(:disabled:not(:checked)) { color: var(--muted); }
.approval-grants label strong, .approval-grants label small { display: block; }
.approval-grants label small { margin-top: .14rem; color: var(--muted); font-size: .8125rem; line-height: 1.32; }
.approval-grants input { flex: 0 0 auto; width: 1rem; height: 1rem; margin: .16rem 0 0; accent-color: var(--blue); }
.access-dialog .approval-error { color: #ffa6ad; }
.access-dialog-actions { display: flex; align-items: center; justify-content: flex-end; gap: .5rem; margin-top: .85rem; }
.revoke-dialog { max-width: 440px; }
.revoke-dialog > p { margin: .85rem 1.25rem; color: var(--muted); font-size: .9375rem; overflow-wrap: anywhere; }
.revoke-dialog > .access-dialog-actions { margin: .85rem 1.25rem 1.25rem; }
.revoke-button { color: #fff1f2; background: #9a344b; border-color: #f3809061; }
.revoke-button:hover { background: #ae3e56; border-color: #f3809091; }

@media (prefers-reduced-motion: no-preference) {
  .server-workspace:not([hidden]), .server-view:not([hidden]), .pair-panel:not([hidden]) { animation: panel-enter 240ms cubic-bezier(.22,.72,.31,1) both; }
  #permissions-panel:not([hidden]) :is(.access-heading, .approval-panel), #overview-panel:not([hidden]) .telemetry-grid { animation: panel-enter 260ms 45ms cubic-bezier(.22,.72,.31,1) both; }
  .access-dialog[open] { animation: dialog-enter 190ms cubic-bezier(.2,.72,.31,1) both; }
  .access-dialog[open]::backdrop { animation: backdrop-enter 180ms ease-out both; }
  .command-shell :is(.command-tab, .button, .approval-grants label) { transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease; }
  .command-shell .button:active:not(:disabled) { transform: translateY(1px); }
  .approval-table tbody tr > * { transition: background-color 150ms ease; }
}
@keyframes panel-enter { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@keyframes dialog-enter { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes backdrop-enter { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 850px) {
  .server-workspace { grid-template-columns: 172px minmax(0, 1fr); }
  .telemetry-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .approval-table thead th:first-child { width: 40%; }
}
@media (max-width: 650px) {
  .command-title { padding-top: 1.45rem; }
  .server-workspace { grid-template-columns: minmax(0, 1fr); gap: .62rem; }
  .server-rail { position: static; }
  .server-picker { padding-top: 0; padding-bottom: .55rem; }
  .server-nav { display: flex; flex-wrap: wrap; gap: .22rem; }
  .command-tab { font-size: .87rem; }
  .server-stats { gap: .4rem; }
  .server-stats > div { padding: .46rem .43rem; }
  .server-stats dd { font-size: 1rem; }
  .version-table :is(th, td) { padding-inline: .32rem; }
}
@media (max-width: 540px) {
  .timeline-list li { grid-template-columns: minmax(0, 1fr); }
  .timeline-list time { text-align: left; }
  .access-heading { grid-template-columns: auto minmax(0, 1fr); }
  .access-heading .primary { grid-column: 2; justify-self: start; }
  .access-mark { width: 2.6rem; border-radius: 10px; }
  .approval-panel { padding-inline: .8rem; }
  .approval-table, .approval-table tbody { display: block; }
  .approval-table thead { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
  .approval-table tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .4rem; padding: .67rem 0; border-top: 1px solid var(--line); }
  .approval-table tbody tr :is(th, td) { padding: 0; border: 0; grid-column: 1 / -1; }
  .approval-table tbody tr td:last-child { grid-column: 2; }
  .approval-table tbody tr td:nth-child(2) { grid-column: 1; align-self: center; }
  .approval-table tbody tr:focus-within > *, .approval-table tbody tr:hover > * { background: none; }
}
@media (max-width: 400px) {
  .approval-tools { align-items: stretch; flex-direction: column; }
  .approval-fields, .approval-scopes, .approval-grants[data-scope=in-game] { grid-template-columns: 1fr; }
  .approval-form, .access-dialog-header { padding-inline: .9rem; }
  .telemetry-panel { padding-inline: .75rem; }
}
