:root {
  color-scheme: light;
  --ps-primary: #5b47f4;
  --ps-primary-hover: #4837d7;
  --ps-primary-soft: #f1edff;
  --ps-primary-soft-strong: #e7e1ff;
  --ps-background: #f5f7fb;
  --ps-surface: #ffffff;
  --ps-surface-secondary: #f8f9fc;
  --ps-sidebar: #fbfbfe;
  --ps-border: #e7e8ef;
  --ps-border-strong: #d9dce8;
  --ps-text: #171a24;
  --ps-text-secondary: #5f6678;
  --ps-success: #1d8b63;
  --ps-success-soft: #ebfaf4;
  --ps-danger: #d5465a;
  --ps-danger-soft: #fff1f3;
  --ps-warning: #b26d1d;
  --ps-warning-soft: #fff7e9;
  --ps-shadow-sm: 0 1px 2px rgba(20, 24, 38, 0.04);
  --ps-shadow-md: 0 12px 26px rgba(20, 24, 38, 0.06);
  --ps-radius-sm: 10px;
  --ps-radius-md: 14px;
  --ps-radius-lg: 18px;
  --ps-font: "Segoe UI Variable", "Segoe UI", "Helvetica Neue", sans-serif;
  --bg: var(--ps-background);
  --bg-soft: var(--ps-surface-secondary);
  --panel: var(--ps-surface);
  --panel-alt: var(--ps-surface-secondary);
  --sidebar: var(--ps-sidebar);
  --border: var(--ps-border);
  --border-strong: var(--ps-border-strong);
  --text: var(--ps-text);
  --muted: var(--ps-text-secondary);
  --muted-strong: #424a5a;
  --accent: var(--ps-primary);
  --accent-strong: var(--ps-primary-hover);
  --accent-soft: var(--ps-primary-soft);
  --success: var(--ps-success);
  --success-soft: var(--ps-success-soft);
  --danger: var(--ps-danger);
  --danger-soft: var(--ps-danger-soft);
  --warning: var(--ps-warning);
  --warning-soft: var(--ps-warning-soft);
  --shadow-sm: var(--ps-shadow-sm);
  --shadow-md: var(--ps-shadow-md);
  --radius-sm: var(--ps-radius-sm);
  --radius-md: var(--ps-radius-md);
  --radius-lg: var(--ps-radius-lg);
  --font: var(--ps-font);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--ps-background) !important;
  color: var(--ps-text) !important;
  font-family: var(--ps-font);
  line-height: 1.5;
  color-scheme: light;
}

html {
  background-color: var(--ps-background) !important;
}

body {
  background-image: none !important;
}

body {
  font-size: 14px;
}

a {
  color: var(--accent-strong);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.bulk-drop-zone:focus-visible {
  outline: 2px solid rgba(25, 95, 201, 0.34);
  outline-offset: 2px;
}

img {
  max-width: 100%;
}

.public-body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--ps-background);
  padding: 0;
}

.auth-topbar {
  width: 100%;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--ps-border);
  backdrop-filter: blur(10px);
}

.auth-topbar-inner {
  width: min(1200px, calc(100% - 32px));
  height: 78px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.auth-topbar-logo {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--ps-surface);
  border: 1px solid var(--ps-border);
  padding: 7px;
}

.auth-brand-name {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--ps-text);
}

.auth-topbar-divider {
  width: 1px;
  height: 28px;
  background: var(--ps-border);
}

.auth-product-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ps-text-secondary);
  letter-spacing: 0.01em;
}

.auth-topbar-meta {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ps-text-secondary);
}

.auth-topbar-link {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--ps-text-secondary);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.auth-topbar-link:hover {
  color: var(--ps-primary);
  text-decoration: none;
}

.auth-page {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 44px 20px 32px;
}

.auth-shell {
  width: min(100%, 600px);
}

.auth-panel,
.auth-card,
.panel,
.metric-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.auth-card {
  padding: 28px 28px 24px;
}

.auth-card-content {
  display: grid;
  gap: 18px;
}

.auth-card-header {
  display: grid;
  gap: 8px;
}

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

.form-field {
  display: grid;
  gap: 8px;
}

.form-field label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ps-text);
}

.field-input {
  position: relative;
}

.field-input input {
  padding-right: 16px;
}

.password-toggle-wrap input {
  padding-right: 72px;
}

.password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: var(--ps-primary);
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  padding: 6px 8px;
}

.message-inline,
.field-error-message {
  font-size: 0.82rem;
  color: var(--ps-danger);
  min-height: 16px;
}

.field-error-message {
  display: none;
}

.form-field.has-error .field-error-message {
  display: block;
}

.form-field.has-error input {
  border-color: var(--ps-danger);
  box-shadow: 0 0 0 4px rgba(213, 70, 90, 0.08);
  background: #fff8f9;
}

.form-alert {
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
}

.form-alert-error {
  border: 1px solid rgba(213, 70, 90, 0.18);
  background: rgba(213, 70, 90, 0.06);
  color: #962d3d;
}

.auth-submit {
  width: 100%;
  min-height: 48px;
  font-size: 1rem;
}

.auth-utility {
  display: flex;
  justify-content: flex-start;
}

.auth-link {
  color: var(--ps-primary);
  font-weight: 700;
}

.auth-divider {
  position: relative;
  text-align: center;
  color: var(--ps-text-secondary);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-divider::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  border-top: 1px solid var(--ps-border);
}

.auth-divider span {
  position: relative;
  display: inline-block;
  padding: 0 10px;
  background: var(--ps-surface);
}

.auth-signup {
  text-align: center;
  color: var(--ps-text-secondary);
  font-size: 0.95rem;
}

.auth-footer {
  width: 100%;
  padding: 0 20px 28px;
}

.auth-footer-inner {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  color: var(--ps-text-secondary);
  font-size: 0.82rem;
}

.page-shell {
  display: grid;
  grid-template-columns: 296px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
  border-right: 1px solid var(--border);
  background: var(--sidebar);
  padding: 22px 18px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand,
.brand-inline {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand {
  margin-bottom: 6px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
}

.brand:hover {
  text-decoration: none;
  background: rgba(21, 36, 52, 0.025);
}

.brand-mark {
  width: 46px;
  height: 46px;
  padding: 8px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid var(--border);
}

.brand-name {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.15;
}

.brand-tag,
.meta,
.lead,
.eyebrow,
dt,
.analysis-card span,
.small-note {
  color: var(--muted);
}

.brand-tag {
  margin-top: 2px;
  font-size: 0.87rem;
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 700;
}

.lead {
  margin: 0 0 20px;
  line-height: 1.65;
  font-size: 0.98rem;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.nav-group {
  display: grid;
  gap: 4px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(21, 36, 52, 0.06);
}

.nav-group:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.nav-group-label {
  padding: 0 10px 6px;
  color: var(--muted);
  font-size: 0.69rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
}

.nav-link {
  display: block;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--muted-strong);
  font-weight: 600;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.nav-link.active,
.nav-link:hover {
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-color: rgba(25, 95, 201, 0.12);
  text-decoration: none;
}

.sidebar-footer {
  border-top: 1px solid rgba(21, 36, 52, 0.06);
  padding: 14px 10px 4px;
}

.sidebar-footer-label {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.69rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
}

.sidebar-footer-link {
  display: inline-block;
  max-width: 100%;
  color: var(--text);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.content {
  padding: 28px 30px 36px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  box-shadow: var(--shadow-sm);
}

.page-header-copy {
  min-width: 0;
}

.page-header-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.page-header h1,
.stack h1 {
  margin: 0;
  font-size: clamp(1.45rem, 2vw, 1.9rem);
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.form-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

label {
  display: grid;
  gap: 7px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
}

input,
select,
button,
textarea {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: #ffffff;
  color: var(--text);
  padding: 10px 13px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

textarea {
  min-height: 112px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(25, 95, 201, 0.4);
  box-shadow: 0 0 0 4px rgba(25, 95, 201, 0.08);
}

button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
}

button:hover {
  transform: none;
}

button:disabled,
button[disabled],
.primary[disabled],
.secondary[disabled],
.danger[disabled] {
  cursor: not-allowed;
  opacity: 0.56;
  box-shadow: none;
}

.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  box-shadow: none;
}

.primary:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.secondary {
  background: #ffffff;
  color: var(--text);
  border-color: var(--border-strong);
}

.secondary:hover {
  background: var(--panel-alt);
  text-decoration: none;
}

.danger {
  background: #ffffff;
  border-color: rgba(187, 61, 79, 0.2);
  color: var(--danger);
}

.danger:hover {
  background: var(--danger-soft);
}

.compact {
  min-height: 36px;
  padding: 7px 11px;
  font-size: 0.88rem;
}

.ps-identify-shell {
  display: grid;
  gap: 18px;
  padding: 22px 22px 20px;
  margin-bottom: 18px;
  overflow: hidden;
}

.ps-identify-shell .panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.ps-identify-shell .panel-head h2 {
  margin: 0;
  font-size: clamp(1.35rem, 2vw, 1.7rem);
  letter-spacing: -0.04em;
  color: var(--ps-text);
}

.ps-identify-lang-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ps-identify-shell form {
  display: grid;
  gap: 16px;
}

.ps-identify-dropzone {
  position: relative;
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 30px 22px;
  border: 1.5px dashed rgba(91, 71, 244, 0.26);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(241,237,255,0.82));
  color: var(--ps-text);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, transform 0.15s ease;
}

.ps-identify-dropzone:hover,
.ps-identify-dropzone:focus-within {
  border-color: rgba(91, 71, 244, 0.52);
  background: linear-gradient(180deg, rgba(255,255,255,1), rgba(241,237,255,0.92));
  box-shadow: 0 0 0 5px rgba(91, 71, 244, 0.08);
}

.ps-identify-dropzone.is-dragover {
  border-color: var(--ps-primary);
  background: rgba(241, 237, 255, 0.96);
  box-shadow: 0 0 0 5px rgba(91, 71, 244, 0.08);
  transform: translateY(-1px);
}

.ps-identify-dropzone input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.ps-identify-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: var(--ps-primary-soft);
  color: var(--ps-primary-hover);
  font-size: 1.7rem;
  box-shadow: inset 0 0 0 1px rgba(91, 71, 244, 0.08);
}

.ps-identify-dropzone strong {
  font-size: 1.08rem;
  letter-spacing: -0.02em;
}

.ps-identify-dropzone .meta {
  display: block;
  color: var(--ps-text-secondary);
}

.ps-identify-file-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--ps-border);
  border-radius: 12px;
  background: var(--ps-surface-secondary);
  color: var(--ps-text-secondary);
}

.ps-identify-file-meta [data-pc-identify-file-name='true'] {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.ps-identify-file-meta [data-pc-identify-file-size='true'] {
  font-weight: 700;
  color: var(--ps-text);
}

.ps-identify-file-meta button {
  flex-shrink: 0;
}

[data-pc-identify-status='true'] {
  min-height: 20px;
  margin: 0;
  color: var(--ps-text-secondary);
  font-size: 0.88rem;
}

[data-pc-identify-status='true'].is-error {
  color: var(--ps-danger);
  font-weight: 600;
}

.ps-identify-result {
  display: grid;
  gap: 16px;
  padding: 20px 22px;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(249,250,255,0.98));
}

.ps-identify-result-neutral {
  border-color: rgba(91, 71, 244, 0.14);
}

.ps-identify-result-positive {
  border-color: rgba(29, 139, 99, 0.18);
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(235,250,244,0.9));
}

.ps-identify-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.ps-identify-result-head h2 {
  margin: 0;
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  letter-spacing: -0.04em;
  color: var(--ps-text);
}

.ps-identify-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(91, 71, 244, 0.10);
  border: 1px solid rgba(91, 71, 244, 0.14);
  color: var(--ps-primary-hover);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.ps-identify-result p {
  margin: 0;
  color: var(--ps-text-secondary);
  line-height: 1.6;
}

.ps-identify-history {
  display: grid;
  gap: 12px;
}

.table-wrapper {
  width: 100%;
  overflow-x: auto;
}

.ps-history-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.ps-history-pagination .meta {
  margin-right: 6px;
}

.ps-identify-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 0;
}

.ps-identify-detail-grid div {
  display: grid;
  gap: 5px;
  padding: 12px 14px;
  border: 1px solid var(--ps-border);
  border-radius: 12px;
  background: rgba(255,255,255,0.72);
}

.ps-identify-detail-grid dt {
  color: var(--ps-text-secondary);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}

.ps-identify-detail-grid dd {
  margin: 0;
  color: var(--ps-text);
  font-weight: 600;
  word-break: break-word;
}

.ps-identify-integrity-intact {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--ps-success-soft);
  border: 1px solid rgba(29, 139, 99, 0.12);
  color: var(--ps-success);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ps-identify-integrity-modified {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--ps-warning-soft);
  border: 1px solid rgba(178, 109, 29, 0.12);
  color: var(--ps-warning);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

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

.ps-identify-actions a,
.ps-identify-actions button {
  text-decoration: none;
}

.hero-grid,
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric-card,
.kpi-card {
  padding: 16px 18px;
}

.metric-card span,
.kpi-label,
.summary-card span {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}

.metric-card strong,
.kpi-card strong,
.summary-card strong {
  display: block;
  font-size: clamp(1.45rem, 1.9vw, 2rem);
  letter-spacing: -0.045em;
}

.kpi-card small,
.summary-card small {
  color: var(--muted);
}

.document-header,
.overview-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.document-header-copy {
  min-width: 0;
}

.document-header h2,
.overview-title {
  margin: 0;
  font-size: clamp(1.58rem, 2.2vw, 2.1rem);
  letter-spacing: -0.04em;
}

.document-subtitle,
.section-context {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 0.96rem;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin: 0 0 18px;
}

.summary-card,
.analysis-card {
  background: var(--panel-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: none;
}

.summary-card strong {
  margin-bottom: 2px;
}

.document-toolbar-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) repeat(4, minmax(132px, 1fr)) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 14px;
}

.document-toolbar-grid button,
.document-toolbar-grid .secondary,
.document-toolbar-grid .primary {
  align-self: end;
}

.panel {
  padding: 20px;
  margin-bottom: 18px;
  overflow-x: auto;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-head h2,
.finding-group h3,
.bulk-upload-head h3 {
  margin: 0;
  font-size: 1.04rem;
  letter-spacing: -0.01em;
}

.panel-head a {
  font-size: 0.9rem;
  font-weight: 600;
}

.data-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(21, 36, 52, 0.08);
  text-align: left;
  vertical-align: top;
}

.data-table th {
  color: var(--muted);
  font-size: 0.73rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  white-space: nowrap;
}

.data-table td {
  font-size: 0.94rem;
}

.data-table td .meta,
.data-table td .code-inline {
  display: block;
  margin-top: 4px;
}

.data-table tbody tr:hover {
  background: rgba(25, 95, 201, 0.025);
}

.compact-table td,
.compact-table th {
  padding-top: 10px;
  padding-bottom: 10px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.detail-grid > div {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel-alt);
}

.detail-grid dd {
  margin: 6px 0 0;
  color: var(--text);
  font-weight: 600;
  overflow-wrap: anywhere;
}

dt {
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}

.flash {
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 16px;
  font-weight: 600;
  border: 1px solid transparent;
}

.flash.success {
  background: var(--success-soft);
  border-color: rgba(33, 121, 92, 0.14);
  color: #175844;
}

.flash.error {
  background: var(--danger-soft);
  border-color: rgba(187, 61, 79, 0.12);
  color: #922d3c;
}

.share-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.share-input,
.code-block,
.code-inline {
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
}

.share-input,
.code-block {
  background: var(--panel-alt);
}

.code-inline,
.code-block {
  overflow-wrap: anywhere;
}

.status-line {
  margin-top: 0;
}

form[action$="/read"],
form[action$="/acknowledge"],
form[action*="/revoke"],
form[action="/operator/logout"] {
  display: inline-block;
  margin-right: 8px;
  margin-bottom: 8px;
}

.bulk-upload-shell {
  margin-top: 16px;
  display: grid;
  gap: 12px;
}

.bulk-drop-zone {
  border: 1px dashed rgba(25, 95, 201, 0.28);
  border-radius: 14px;
  padding: 18px;
  background: rgba(25, 95, 201, 0.03);
  display: grid;
  gap: 12px;
}

.bulk-drop-zone p,
.bulk-progress {
  margin: 0;
  color: var(--muted);
}

.bulk-drop-zone.is-dragover {
  border-color: rgba(33, 121, 92, 0.6);
  background: rgba(33, 121, 92, 0.05);
}

.bulk-actions,
.header-actions,
.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bulk-picker,
.action-row > a,
.action-row > form {
  display: inline-flex;
}

.bulk-progress-bar,
.distribution-bar {
  width: 100%;
  background: rgba(21, 36, 52, 0.08);
  overflow: hidden;
}

.bulk-progress-bar {
  height: 8px;
  border-radius: 999px;
}

.bulk-progress-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #1d6fe8, #21795c);
  transition: width 0.2s ease;
}

.bulk-table td {
  word-break: break-word;
}

.bulk-state {
  text-transform: capitalize;
  font-weight: 600;
}

.bulk-state-waiting { color: var(--muted); }
.bulk-state-uploading { color: var(--accent); }
.bulk-state-completed { color: var(--success); }
.bulk-state-duplicate,
.bulk-state-rejected { color: var(--warning); }
.bulk-state-failed { color: var(--danger); }

.risk-pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  border: 1px solid transparent;
  font-size: 0.71rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
  white-space: nowrap;
}

.risk-low,
.status-pill.positive {
  background: rgba(33, 121, 92, 0.09);
  border-color: rgba(33, 121, 92, 0.16);
  color: #1c694f;
}

.risk-medium,
.status-pill.neutral,
.status-pill.warning {
  background: rgba(166, 107, 22, 0.1);
  border-color: rgba(166, 107, 22, 0.16);
  color: #8a590f;
}

.risk-high,
.risk-critical,
.status-pill.danger {
  background: rgba(187, 61, 79, 0.08);
  border-color: rgba(187, 61, 79, 0.14);
  color: #9e2f42;
}

.risk-unknown {
  background: rgba(100, 119, 138, 0.1);
  border-color: rgba(100, 119, 138, 0.14);
  color: var(--muted-strong);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.locale-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
}

.discovery-panel .panel-head {
  align-items: flex-start;
}

.discovery-setup {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.discovery-widget {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--panel-alt);
  padding: 16px;
}

.discovery-root-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.discovery-root-list span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 5px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: white;
  color: var(--muted-strong);
  font-size: 0.76rem;
}

.discovery-form {
  display: grid;
  gap: 12px;
}

.discovery-form label {
  display: grid;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted-strong);
}

.discovery-form input,
.discovery-form select {
  min-height: 38px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 8px 10px;
  font: inherit;
  color: var(--ps-text);
  background: white;
}

.checkbox-inline {
  display: flex !important;
  align-items: center;
  gap: 8px;
  font-weight: 600 !important;
}

.checkbox-inline input {
  width: 16px;
  height: 16px;
  min-height: 16px;
}

.discovery-locked {
  display: grid;
  min-height: 140px;
  align-items: center;
  font-weight: 600;
  color: var(--muted);
}

.discovery-import-shell {
  display: grid;
  gap: 14px;
}

.discovery-import-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
}

.inline-select {
  display: inline-grid;
  gap: 4px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-strong);
}

.inline-select select {
  min-height: 34px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 7px 10px;
  font: inherit;
  color: var(--ps-text);
  background: #ffffff;
}

.discovery-import-review {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.discovery-import-review-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--panel-alt);
  padding: 14px;
}

.discovery-import-review-card h3 {
  margin-top: 0;
  margin-bottom: 12px;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.kpi {
  display: grid;
  gap: 4px;
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-strong);
}

.kpi strong {
  font-size: 1.08rem;
  letter-spacing: normal;
  text-transform: none;
  color: var(--ps-text);
}

.discovery-risk-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.discovery-risk-breakdown span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: #fff;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--muted-strong);
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.discovery-progress-table {
  margin-bottom: 8px;
}

.discovery-progress-table td {
  vertical-align: top;
}

.inline-search {
  display: inline-flex;
  align-items: center;
}

.inline-search input {
  min-height: 34px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 7px 10px;
  font: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: #ffffff;
  color: var(--muted-strong);
  font-size: 0.86rem;
  font-weight: 600;
}

.filter-chip:hover,
.filter-chip.active {
  color: var(--accent-strong);
  border-color: rgba(25, 95, 201, 0.16);
  background: var(--accent-soft);
  text-decoration: none;
}

.analysis-grid,
.content-grid {
  display: grid;
  gap: 16px;
}

.analysis-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 14px;
}

.content-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 18px;
}

.analysis-card strong {
  display: block;
  margin-top: 8px;
  font-size: 1rem;
}

.scan-live-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.scan-spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(25, 95, 201, 0.2);
  border-top-color: var(--accent-strong);
  animation: scan-spin 0.9s linear infinite;
}

@keyframes scan-spin {
  to {
    transform: rotate(360deg);
  }
}

.distribution-wrap {
  display: grid;
  gap: 12px;
}

.distribution-row {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.distribution-name {
  color: var(--muted-strong);
  font-weight: 600;
}

.distribution-count {
  font-weight: 700;
  min-width: 24px;
  text-align: right;
}

.distribution-bar {
  height: 10px;
  border-radius: 999px;
}

.distribution-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.distribution-fill.low { background: #21795c; }
.distribution-fill.medium { background: #a66b16; }
.distribution-fill.high { background: #c25634; }
.distribution-fill.critical { background: #bb3d4f; }

.empty-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  width: 100%;
  padding: 12px 14px;
  color: var(--muted-strong);
  font-weight: 600;
  background: var(--panel-alt);
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  text-align: center;
}

.empty-state.compact {
  min-height: 34px;
  padding: 8px 10px;
}

.workspace-switcher {
  display: flex;
  align-items: center;
}

.workspace-switcher label {
  display: grid;
  gap: 6px;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.workspace-switcher select {
  min-width: 220px;
  background: #ffffff;
}

.finding-group {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 10px;
  background: var(--panel-alt);
}

.finding-group ul {
  margin: 0;
  padding-left: 18px;
}

.finding-group li {
  margin-bottom: 8px;
}

.finding-count {
  color: var(--accent-strong);
  font-size: 0.82rem;
}

.app-body {
  background: var(--ps-background);
  color: var(--ps-text);
}

.ps-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--ps-border);
  backdrop-filter: blur(10px);
}

.ps-topbar-inner {
  width: min(1400px, calc(100% - 32px));
  height: 76px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 18px;
}

.ps-topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ps-topbar-logo {
  width: 36px;
  height: 36px;
  padding: 6px;
  border-radius: 10px;
  background: var(--ps-surface);
  border: 1px solid var(--ps-border);
}

.ps-brand-copy {
  display: grid;
  gap: 2px;
}

.ps-brand-name {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--ps-text);
}

.ps-brand-subtitle {
  font-size: 0.72rem;
  color: var(--ps-text-secondary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}

.ps-topbar-search {
  margin-left: auto;
  min-width: 190px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--ps-surface-secondary);
  border: 1px solid var(--ps-border);
  border-radius: 12px;
  color: var(--ps-text-secondary);
  font-weight: 600;
}

.ps-search-icon {
  font-size: 1rem;
  opacity: 0.8;
}

.ps-topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ps-header-button,
.ps-user-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ps-border);
  background: var(--ps-surface);
  border-radius: 12px;
  color: var(--ps-text);
  font-weight: 600;
}

.ps-header-button {
  min-height: 38px;
  padding: 0 12px;
  cursor: pointer;
}

.ps-user-pill {
  gap: 10px;
  min-height: 38px;
  padding: 0 10px 0 6px;
}

.ps-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--ps-primary-soft);
  color: var(--ps-primary-hover);
  font-size: 0.72rem;
  font-weight: 800;
}

.ps-panel,
.ps-hero,
.ps-kpi-card,
.ps-document-card,
.ps-action-card,
.ps-alert-card,
.ps-empty-state {
  background: var(--ps-surface);
  border: 1px solid var(--ps-border);
  border-radius: 18px;
  box-shadow: var(--ps-shadow-sm);
}

.ps-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px;
  margin-bottom: 18px;
}

.ps-hero h2 {
  margin: 0;
  font-size: clamp(1.7rem, 2vw, 2.2rem);
  letter-spacing: -0.06em;
  line-height: 1.08;
}

.ps-eyebrow {
  margin: 0 0 8px;
  color: var(--ps-primary-hover);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.7rem;
  font-weight: 800;
}

.ps-subtle {
  margin: 8px 0 0;
  color: var(--ps-text-secondary);
  font-size: 0.96rem;
}

.ps-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.ps-kpi-card {
  padding: 18px 18px 16px;
}

.ps-kpi-label {
  display: block;
  margin-bottom: 12px;
  color: var(--ps-text-secondary);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}

.ps-kpi-card strong {
  display: block;
  font-size: clamp(1.8rem, 2vw, 2.1rem);
  letter-spacing: -0.06em;
  line-height: 1.1;
}

.ps-kpi-card small {
  display: block;
  margin-top: 8px;
  color: var(--ps-text-secondary);
}

.ps-actions-panel,
.ps-panel {
  padding: 22px 20px;
  margin-bottom: 20px;
}

.ps-panel-head,
.ps-panel-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.ps-panel-head h3,
.ps-panel-head-row h2 {
  margin: 0;
  font-size: 1.15rem;
  letter-spacing: -0.03em;
}

.ps-panel-head a,
.ps-link-inline {
  color: var(--ps-primary);
  font-weight: 700;
}

.ps-action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.ps-action-card {
  display: grid;
  gap: 10px;
  padding: 18px 16px;
  color: var(--ps-text);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.ps-action-card:hover,
.ps-document-card:hover,
.ps-alert-card:hover {
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: var(--ps-shadow-md);
}

.ps-action-card.primary {
  background: var(--ps-primary);
  border-color: var(--ps-primary);
  color: white;
}

.ps-action-card.primary small,
.ps-action-card.primary strong {
  color: white;
}

.ps-action-icon {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--ps-primary-soft);
  color: var(--ps-primary);
  font-size: 1.2rem;
  font-weight: 700;
}

.ps-action-card.primary .ps-action-icon {
  background: rgba(255,255,255,0.14);
  color: white;
}

.ps-action-card strong {
  font-size: 1rem;
}

.ps-action-card small {
  color: var(--ps-text-secondary);
}

.ps-main-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 20px;
}

.ps-doc-list,
.ps-alert-list,
.ps-alert-stack {
  display: grid;
  gap: 12px;
}

.ps-document-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.ps-document-card {
  display: grid;
  gap: 16px;
  padding: 16px 16px 14px;
}

.ps-doc-header,
.ps-doc-footer,
.ps-alert-head,
.ps-alert-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ps-doc-type {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--ps-primary-soft);
  color: var(--ps-primary-hover);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.ps-doc-type-pdf { background: rgba(91,71,244,0.1); color: var(--ps-primary-hover); }
.ps-doc-type-doc { background: rgba(60,153,255,0.12); color: #275fb0; }
.ps-doc-type-xls { background: rgba(30,176,111,0.12); color: #227e56; }
.ps-doc-type-ppt { background: rgba(220,122,39,0.12); color: #b45b1d; }
.ps-doc-type-img { background: rgba(136,92,255,0.12); color: #7044d1; }
.ps-doc-type-txt { background: rgba(81,93,112,0.12); color: #465264; }

.ps-doc-menu {
  min-width: 30px;
  min-height: 30px;
  border: 1px solid var(--ps-border);
  background: transparent;
  border-radius: 10px;
  color: var(--ps-text-secondary);
  cursor: pointer;
}

.ps-doc-body h3 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: -0.03em;
  color: var(--ps-text);
}

.ps-doc-body p,
.ps-alert-main p,
.ps-alert-main small,
.ps-mini-doc p {
  margin: 0;
  color: var(--ps-text-secondary);
}

.ps-doc-meta-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--ps-text-secondary);
  font-size: 0.82rem;
  margin-top: 8px;
}

.ps-badge,
.ps-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid transparent;
}

.ps-badge.success,
.ps-status-pill.success { background: var(--ps-success-soft); border-color: rgba(29,139,99,0.12); color: var(--ps-success); }
.ps-badge.info,
.ps-status-pill.info { background: rgba(91,71,244,0.08); border-color: rgba(91,71,244,0.12); color: var(--ps-primary-hover); }
.ps-badge.warning,
.ps-status-pill.warning { background: var(--ps-warning-soft); border-color: rgba(178,109,29,0.12); color: var(--ps-warning); }
.ps-badge.danger,
.ps-status-pill.danger { background: var(--ps-danger-soft); border-color: rgba(213,70,90,0.12); color: var(--ps-danger); }

.ps-mini-doc {
  display: grid;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--ps-border);
  background: var(--ps-surface-secondary);
}

.ps-mini-doc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ps-doc-ext {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: white;
  border: 1px solid var(--ps-border);
  font-size: 0.72rem;
  font-weight: 800;
}

.ps-mini-doc h3 {
  margin: 0;
  font-size: 0.97rem;
}

.ps-alert-card {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 14px;
  padding: 14px;
}

.ps-alert-stamp {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 800;
  background: var(--ps-primary-soft);
  color: var(--ps-primary-hover);
}

.ps-alert-stamp.success { background: var(--ps-success-soft); color: var(--ps-success); }
.ps-alert-stamp.warning { background: var(--ps-warning-soft); color: var(--ps-warning); }
.ps-alert-stamp.danger { background: var(--ps-danger-soft); color: var(--ps-danger); }
.ps-alert-stamp.info { background: rgba(91,71,244,0.08); color: var(--ps-primary-hover); }

.ps-alert-main {
  display: grid;
  gap: 6px;
}

.ps-alert-main strong {
  font-size: 0.97rem;
}

.ps-alert-main p,
.ps-alert-main small {
  font-size: 0.82rem;
}

.ps-alert-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.ps-empty-state {
  display: grid;
  place-items: center;
  min-height: 200px;
  padding: 28px 20px;
  text-align: center;
  color: var(--ps-text-secondary);
}

.ps-empty-state h3 {
  margin: 0 0 8px;
  color: var(--ps-text);
  font-size: 1.2rem;
}

.ps-empty-state.compact {
  min-height: 120px;
}

.ps-topbar-search {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 190px;
  padding: 10px 12px;
  border: 1px solid var(--ps-border); 
  border-radius: 12px;
  background: var(--ps-surface-secondary);
  color: var(--ps-text-secondary);
  font-weight: 600;
  text-decoration: none;
}

.ps-topbar-search:hover {
  text-decoration: none;
  border-color: var(--ps-border-strong);
  color: var(--ps-primary-hover);
}

.ps-header-button,
.ps-user-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border-radius: 12px;
  border: 1px solid var(--ps-border);
  background: var(--ps-surface);
  color: var(--ps-text);
  font-weight: 600;
  text-decoration: none;
  padding: 0 12px;
}

.ps-user-pill {
  padding-left: 6px;
  gap: 10px;
}

.ps-map-panel {
  margin-top: 8px;
}

.ps-map-shell {
  position: relative;
  min-height: 210px;
  margin-top: 12px;
  border: 1px solid rgba(91, 71, 244, 0.12);
  border-radius: 18px;
  background:
    radial-gradient(circle at 18% 30%, rgba(91, 71, 244, 0.10), transparent 20%),
    radial-gradient(circle at 66% 52%, rgba(91, 71, 244, 0.09), transparent 18%),
    linear-gradient(135deg, rgba(245,247,251,0.98), rgba(241,237,255,0.9));
  overflow: hidden;
}

.ps-map-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(91,71,244,0.06) 1px, transparent 1px), linear-gradient(90deg, rgba(91,71,244,0.06) 1px, transparent 1px);
  background-size: 52px 52px;
  opacity: 0.7;
}

.ps-map-point {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  border: 2px solid rgba(255,255,255,0.8);
  box-shadow: 0 0 0 8px rgba(91,71,244,0.06);
  z-index: 1;
}

.ps-map-low { background: #29a06a; }
.ps-map-medium { background: #b26d1d; }
.ps-map-high { background: #d5465a; }
.ps-map-critical { background: #7b1d35; }
.ps-map-info { background: #5b47f4; }

.ps-map-empty,
.ps-map-empty-small {
  display: grid;
  place-items: center;
  min-height: 120px;
  text-align: center;
  margin-top: 12px;
  border: 1px dashed rgba(91,71,244,0.18);
  border-radius: 14px;
  background: rgba(255,255,255,0.5);
  color: var(--ps-text-secondary);
}

.ps-map-empty h3 {
  margin: 0 0 8px;
  color: var(--ps-text);
}

.ps-map-empty p {
  margin: 0;
}

.ps-map-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.ps-map-list li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  background: var(--ps-surface-secondary);
  border: 1px solid var(--ps-border);
  color: var(--ps-text-secondary);
}

.ps-map-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ps-primary);
}

.ps-map-tag.risk-low { background: #29a06a; }
.ps-map-tag.risk-medium { background: #b26d1d; }
.ps-map-tag.risk-high { background: #d5465a; }
.ps-map-tag.risk-critical { background: #7b1d35; }
.ps-map-tag.risk-info { background: #5b47f4; }

.ps-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid transparent;
  font-weight: 700;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.15s ease;
}

.share-choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.share-choice-card {
  border: 1px solid var(--ps-border);
  border-radius: 12px;
  background: var(--ps-surface-secondary);
  padding: 12px;
  display: grid;
  gap: 8px;
}

.share-choice-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.share-choice-icon {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(91, 71, 244, 0.10);
}

.ps-button:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.ps-button-primary {
  background: var(--ps-primary);
  border-color: var(--ps-primary);
  color: white;
}

.ps-button-primary:hover {
  background: var(--ps-primary-hover);
  border-color: var(--ps-primary-hover);
}

.ps-button-secondary {
  background: white;
  border-color: var(--ps-border-strong);
  color: var(--ps-text);
}

.ps-button-secondary:hover {
  background: var(--ps-surface-secondary);
}

.ps-toolbar-actions,
.ps-form-row,
.ps-filter-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ps-toolbar-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.ps-toolbar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 220px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--ps-border);
  border-radius: 12px;
  background: var(--ps-surface-secondary);
  color: var(--ps-text-secondary);
}

.ps-toolbar-search input,
.ps-form-row input,
.ps-form-row select {
  min-height: 42px;
  border: 1px solid var(--ps-border-strong);
  background: white;
  border-radius: 12px;
  color: var(--ps-text);
  padding: 10px 12px;
}

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

.ps-form-row {
  flex-wrap: wrap;
  align-items: end;
}

.ps-form-row label {
  display: grid;
  gap: 8px;
  flex: 1 1 200px;
  color: var(--ps-text);
  font-size: 0.9rem;
  font-weight: 600;
}

.ps-filter-row {
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.ps-filter-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--ps-border-strong);
  border-radius: 999px;
  color: var(--ps-text-secondary);
  background: white;
  font-weight: 700;
  font-size: 0.82rem;
}

.ps-filter-chip.active,
.ps-filter-chip:hover {
  text-decoration: none;
  color: var(--ps-primary-hover);
  background: var(--ps-primary-soft);
  border-color: rgba(91,71,244,0.16);
}

.ps-documents-page {
  background: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(244,242,255,0.9));
}

.ps-docs-hero {
  align-items: flex-end;
  margin-bottom: 10px;
}

.ps-docs-copy {
  display: grid;
  gap: 6px;
}

.ps-docs-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.ps-docs-filters {
  margin-top: 10px;
}

.ps-doc-upload-form {
  margin-top: 8px;
}

.ps-upload-dropzone {
  position: relative;
  border: 1px solid rgba(91,71,244,0.18);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(91,71,244,0.03), rgba(255,255,255,0.96));
  padding: 26px 20px;
  margin-bottom: 18px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
}

.ps-upload-dropzone.is-dragover {
  border-color: rgba(91,71,244,0.38);
  background: linear-gradient(180deg, rgba(91,71,244,0.06), rgba(255,255,255,0.98));
  box-shadow: 0 0 0 4px rgba(91,71,244,0.08);
}

.ps-dropzone-stack {
  display: grid;
  place-items: center;
  gap: 10px;
  text-align: center;
  color: var(--ps-text-secondary);
}

.ps-dropzone-icon {
  width: 58px;
  height: 58px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  background: white;
  border: 1px solid rgba(91,71,244,0.18);
  color: var(--ps-primary);
  font-size: 1.5rem;
  font-weight: 700;
  box-shadow: 0 14px 26px rgba(91,71,244,0.08);
}

.ps-dropzone-stack strong {
  color: var(--ps-text);
  font-size: 1.15rem;
  letter-spacing: -0.03em;
}

.ps-dropzone-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 8px;
}

.ps-bulk-progress {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ps-text-secondary);
  margin-top: 2px;
}

.ps-bulk-progress-bar {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(91,71,244,0.08);
  border: 1px solid rgba(91,71,244,0.12);
  overflow: hidden;
  margin-top: 10px;
  margin-bottom: 18px;
}

.ps-bulk-progress-bar span {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--ps-primary), var(--ps-primary-hover));
}

.ps-bulk-table {
  margin-top: 10px;
}

.ps-document-grid {
  margin-top: 18px;
}

.ps-document-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,246,255,0.96));
  border: 1px solid rgba(91,71,244,0.08);
  border-radius: 18px;
  box-shadow: 0 10px 26px rgba(17,24,39,0.04);
}

.ps-document-card:hover {
  box-shadow: 0 18px 30px rgba(91,71,244,0.08);
}

.ps-doc-header,
.ps-doc-footer {
  align-items: center;
}

.ps-link-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ps-primary-hover);
}

.ps-link-inline:hover {
  text-decoration: underline;
}

@media (max-width: 1200px) {
  .document-toolbar-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .document-toolbar-grid > :first-child {
    grid-column: 1 / -1;
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

  .ps-main-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .page-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .nav {
    overflow-x: auto;
  }

  .content {
    padding: 20px 18px 28px;
  }

  .workspace-switcher select {
    min-width: 0;
  }

  .discovery-import-review {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .public-body {
    padding: 18px 12px;
  }

  .auth-panel,
  .panel {
    padding: 16px;
  }

  .page-header,
  .document-header,
  .overview-header {
    flex-direction: column;
    align-items: stretch;
  }

  .page-header-tools {
    justify-content: flex-start;
  }

  .document-toolbar-grid,
  .form-grid.three,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .discovery-import-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .discovery-import-toolbar .inline-search,
  .discovery-import-toolbar .inline-select,
  .discovery-import-toolbar button {
    width: 100%;
  }

  .discovery-import-toolbar .inline-search input,
  .discovery-import-toolbar .inline-select select {
    width: 100%;
  }

  .data-table {
    min-width: 620px;
  }
}

@media (max-width: 390px) {
  .content {
    padding: 16px 12px 22px;
  }

  .page-header,
  .auth-panel,
  .panel {
    border-radius: 14px;
  }

  .brand-name {
    font-size: 1.18rem;
  }
}