#login-shell[hidden], .workspace[hidden], .rail[hidden], .rail [hidden],
.workspace-account [hidden], .access-message[hidden], .access-notice[hidden] { display: none !important; }

.workspace-account {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.workspace-account .btn { padding: 4px 8px; min-height: 28px; }

.access-login-frame {
  display: grid;
  place-items: center;
  min-height: 100svh;
  padding: 28px 16px;
  background: #f5f8fd;
}
.access-login-card {
  width: min(100%, 424px);
  padding: clamp(24px, 5vw, 40px);
  background: var(--report-surface);
  border-radius: 16px;
  box-shadow: var(--report-shadow-panel);
}
.access-login-card .access-brand { margin: 0 0 28px; }
.access-login-card h1, .access-heading h1, .access-denied h1 {
  color: var(--report-heading);
  font-size: 28px;
  line-height: 36px;
  margin: 0;
}
.access-muted { color: var(--report-muted); margin: 4px 0 0; }
.access-login-form { display: grid; gap: 8px; margin-top: 24px; }
.access-login-form label { font-weight: 600; }
.access-login-form input, #access-search {
  min-width: 0;
  min-height: 40px;
  padding: 8px 12px;
  background: var(--report-surface);
  color: var(--report-ink);
  border: 1px solid var(--report-control-edge);
  border-radius: 8px;
}
.access-login-form input { margin-bottom: 8px; }
.access-login-form .btn.primary, .access-editor-actions .btn.primary {
  border-color: var(--report-action);
  background: var(--report-action);
  color: white;
}
.access-login-form .btn.primary { min-height: 44px; margin-top: 4px; }
.access-demo { margin-top: 22px; }
.access-demo p { margin: 0 0 8px; color: var(--report-muted); font-size: 12px; }
.access-demo div { display: flex; gap: 8px; flex-wrap: wrap; }

#mobile-reports {
  max-width: 40rem;
  margin: 0 auto;
  padding: 0 max(20px, env(safe-area-inset-right)) 40px max(20px, env(safe-area-inset-left));
}
.mobile-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  border-bottom: 1px solid var(--report-review-bg);
}
.mobile-bar .brand { margin: 0; color: var(--report-ink); font-size: 22px; }
.mobile-bar .btn { min-height: 44px; padding-inline: 12px; color: var(--report-muted); }
#mobile-reports h1 { margin: 32px 0 8px; font-size: 28px; line-height: 36px; color: var(--report-heading); }
#mobile-reports .mobile-hint {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 8px;
  margin: 0 0 16px;
  color: var(--report-muted);
}
#desktop-entry {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--report-action);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}
#desktop-entry:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
#mobile-reports nav { border-block: 1px solid var(--report-review-bg); }
#mobile-reports nav a {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 76px;
  color: var(--report-ink);
  text-decoration: none;
}
#mobile-reports nav a + a { border-top: 1px solid var(--report-review-bg); }
#mobile-reports strong { flex: 1; font-size: 18px; line-height: 24px; }
.mobile-icon {
  box-sizing: content-box;
  width: 22px;
  height: 22px;
  padding: 10px;
  border-radius: 10px;
  background: var(--report-selection);
  color: var(--report-action);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linejoin: round;
  stroke-linecap: round;
}
#mobile-reports nav a[href]::after {
  content: "";
  width: 8px;
  height: 8px;
  margin-inline: 4px 8px;
  border: solid var(--report-action);
  border-width: 1.5px 1.5px 0 0;
  transform: rotate(45deg);
}
#mobile-reports nav a[href] small { display: none; }
#mobile-reports nav a[aria-disabled] { color: var(--report-muted); }

.phone-preview {
  display: block;
  width: min(400px, 100%);
  height: 780px;
  height: clamp(360px, calc(100dvh - 185px), 780px);
  margin: 0 auto;
  border: 1px solid var(--report-control-edge);
  border-radius: 16px;
  background: #0a0e1f;
}

.access-users-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.8fr);
  align-items: start;
  gap: 24px;
}
.access-panel {
  min-width: 0;
  background: var(--report-surface);
  border-radius: 16px;
  box-shadow: var(--report-shadow-panel);
  padding: 20px 24px;
}
.access-panel h2 { margin: 0; font-size: 18px; line-height: 24px; }
.access-panel-head, .access-editor-actions, .access-grant {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.access-panel-head { flex-wrap: wrap; margin-bottom: 16px; }
.access-table-scroll { overflow-x: auto; }
.access-directory table { border-collapse: collapse; width: 100%; min-width: 420px; }
.access-directory th, .access-directory td {
  padding: 12px 10px;
  text-align: left;
  overflow-wrap: anywhere;
}
.access-directory thead th { color: var(--report-muted); font-size: 12px; font-weight: 600; }
.access-directory tr.is-selected { background: var(--report-selection); }
.access-directory tr.is-selected th:first-child { border-radius: 8px 0 0 8px; }
.access-directory tr.is-selected td:last-child { border-radius: 0 8px 8px 0; }
.access-user-link {
  color: var(--report-action);
  background: transparent;
  border: 0;
  padding: 2px 0;
  text-align: left;
  font-weight: 600;
}
.access-chip {
  display: inline-block;
  padding: 2px 7px;
  background: var(--report-review-bg);
  color: var(--report-review);
  border-radius: 5px;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 500;
}
.access-chip.is-allowed { background: var(--report-success-bg); color: var(--report-success); }
.access-directory .access-table-empty { padding-block: 24px; }
.access-editor-head { margin-bottom: 16px; }

.access-grants fieldset { margin: 0; border: 0; padding: 0; min-width: 0; }
.access-grants h3 { margin: 18px 0 6px; font-size: 14px; }
.access-grant { min-height: 40px; }
.access-grant.login-grant {
  padding: 12px;
  border-radius: 10px;
  background: var(--report-review-bg);
}
.access-grant p { font-size: 12px; line-height: 18px; }
.access-switch {
  display: inline-flex;
  min-width: 44px;
  min-height: 32px;
  align-items: center;
  justify-content: center;
  flex: none;
  position: relative;
  cursor: pointer;
}
.access-switch input { position: absolute; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: inherit; }
.access-switch span { width: 38px; height: 22px; border-radius: 11px; background: #8391a2; pointer-events: none; }
.access-switch span::after {
  content: "";
  display: block;
  width: 16px;
  height: 16px;
  margin: 3px;
  border-radius: 50%;
  background: var(--report-surface);
}
.access-switch input:checked + span { background: var(--report-action); }
.access-switch input:checked + span::after { transform: translateX(16px); }
.access-switch input:focus-visible + span { outline: 2px solid var(--report-action); outline-offset: 2px; }
.access-switch input:disabled + span { opacity: .55; }
.access-editor-actions { justify-content: flex-end; flex-wrap: wrap; margin-top: 16px; }
.access-notice, .access-message, .access-admin-note {
  padding: 10px 12px;
  border-radius: 8px;
  margin: 6px 0 16px;
  background: var(--report-review-bg);
  color: var(--report-ink);
}
.access-error { background: var(--report-error-bg); color: var(--report-error); }
.access-denied { max-width: 640px; }

@media (max-width: 1050px) {
  .access-users-grid { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 520px) {
  .access-panel { padding: 16px; }
  .workspace-account { gap: 4px 8px; }
}
