:root {
  color-scheme: light;
  --ink: #17231f;
  --muted: #68756f;
  --line: #dce4df;
  --line-strong: #cbd6d0;
  --paper: #f5f7f5;
  --white: #ffffff;
  --green: #174f3b;
  --green-deep: #103b2c;
  --green-soft: #e6f1eb;
  --lime: #b9e36b;
  --amber: #a9541d;
  --amber-soft: #fff0e4;
  --red: #a83f32;
  --shadow: 0 22px 70px rgba(22, 50, 39, 0.1);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(23, 79, 59, 0.22);
  outline-offset: 2px;
}

.app-shell {
  min-height: 100vh;
}

.app-header {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  padding: 0 max(28px, calc((100vw - 1440px) / 2));
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
}

.brand-button {
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  text-align: left;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 11px;
  background: var(--green);
  color: var(--lime);
  font-weight: 850;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  letter-spacing: -0.025em;
}

.brand small {
  margin-top: 1px;
  color: var(--muted);
  font-size: 11px;
}

.header-actions,
.filters {
  display: flex;
  align-items: center;
  gap: 10px;
}

.primary-nav {
  display: flex;
  gap: 12px;
  margin-right: 8px;
}

.company-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.company-picker {
  position: relative;
}

.company-picker input {
  width: min(260px, 24vw);
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  padding: 6px 10px;
}

.company-options {
  width: min(360px, 80vw);
  max-height: 320px;
  overflow-y: auto;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 40;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--white);
  box-shadow: var(--shadow);
  padding: 6px;
}

.company-option,
.company-options-status {
  width: 100%;
  display: block;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  padding: 9px 10px;
  text-align: left;
}

.company-option:hover,
.company-option:focus-visible,
.company-option[aria-selected="true"] {
  background: var(--green-soft);
}

.company-option small,
.company-options-status {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.account-label {
  max-width: 220px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #339266;
  box-shadow: 0 0 0 4px rgba(51, 146, 102, 0.12);
}

.status.is-busy .status-dot {
  background: #d49337;
  box-shadow: 0 0 0 4px rgba(212, 147, 55, 0.13);
}

.button {
  min-height: 42px;
  border: 0;
  border-radius: 10px;
  padding: 10px 16px;
  font-weight: 750;
  transition: transform 150ms ease, opacity 150ms ease, background 150ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: wait;
  opacity: 0.58;
}

.button-primary {
  background: var(--green);
  color: var(--white);
}

.button-primary:hover:not(:disabled) {
  background: var(--green-deep);
}

.button-quiet {
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
}

.text-button {
  justify-self: center;
  border: 0;
  background: transparent;
  color: var(--green);
  padding: 3px;
  font-size: 12px;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.signin-view {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(430px, 0.82fr);
}

.signin-story {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  position: relative;
  background:
    radial-gradient(circle at 82% 80%, rgba(185, 227, 107, 0.16), transparent 26rem),
    var(--green-deep);
  color: var(--white);
  padding: clamp(36px, 5vw, 76px);
}

.signin-story::after {
  content: "";
  width: 410px;
  height: 410px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 50%;
  position: absolute;
  right: -170px;
  bottom: -180px;
  box-shadow:
    0 0 0 62px rgba(255, 255, 255, 0.025),
    0 0 0 124px rgba(255, 255, 255, 0.018);
}

.signin-brand small,
.signin-story .lead {
  color: rgba(255, 255, 255, 0.68);
}

.signin-story .eyebrow {
  color: var(--lime);
}

.signin-story h1 {
  max-width: 780px;
  margin: 0 0 25px;
  font-size: clamp(48px, 5.4vw, 82px);
  line-height: 0.99;
  letter-spacing: -0.058em;
}

.signin-story .lead {
  max-width: 660px;
  margin: 0;
}

.signin-proof {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  position: relative;
  z-index: 1;
}

.signin-proof span {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  padding: 8px 12px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  font-weight: 700;
}

.signin-panel {
  display: grid;
  min-height: 100vh;
  place-items: center;
  background:
    radial-gradient(circle at 100% 0%, rgba(185, 227, 107, 0.2), transparent 23rem),
    var(--paper);
  padding: 44px;
}

.signin-card {
  width: min(100%, 440px);
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  padding: clamp(28px, 4vw, 42px);
}

.signin-card h2 {
  margin: 0 0 10px;
  font-size: 30px;
  letter-spacing: -0.04em;
}

.signin-card form {
  display: grid;
  gap: 15px;
  margin-top: 28px;
}

.signin-card .button-primary {
  width: 100%;
  margin-top: 3px;
}

.eyebrow {
  margin: 0 0 9px;
  color: var(--green);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.lead {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
}

.lead.compact {
  margin: 10px 0 0;
  font-size: 14px;
}

.muted {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

label {
  display: grid;
  gap: 7px;
  color: #405049;
  font-size: 12px;
  font-weight: 750;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--white);
  color: var(--ink);
  padding: 9px 12px;
  outline: none;
}

input:focus,
select:focus {
  border-color: #43826a;
  box-shadow: 0 0 0 3px rgba(67, 130, 106, 0.11);
}

.advanced-settings {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}

.advanced-settings summary {
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.advanced-settings label {
  margin-top: 14px;
}

.inline-error {
  margin-top: 16px;
  border-radius: 10px;
  background: #fff0ef;
  color: #8e2f27;
  padding: 11px 13px;
  font-size: 13px;
  line-height: 1.45;
}

.security-note {
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.workspace {
  width: min(1440px, calc(100% - 56px));
  margin: 0 auto;
  padding: 48px 0 76px;
}

.page-heading,
.detail-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 32px;
}

.page-heading h1,
.detail-heading h1,
.error-state h1 {
  margin: 0;
  font-size: clamp(38px, 5vw, 62px);
  line-height: 1;
  letter-spacing: -0.055em;
}

.page-heading-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 11px;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric-card,
.panel {
  border: 1px solid var(--line);
  background: var(--white);
}

.metric-card {
  min-height: 148px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-radius: 15px;
  padding: 20px;
}

.metric-card > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.metric-card strong {
  font-size: 42px;
  letter-spacing: -0.055em;
}

.metric-card small {
  color: var(--muted);
}

.metric-card.metric-risk {
  border-color: #efd5c3;
  background: var(--amber-soft);
}

.metric-risk strong {
  color: var(--amber);
}

.panel {
  min-width: 0;
  overflow: hidden;
  border-radius: 16px;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  padding: 22px 24px 18px;
}

.panel-header h2 {
  margin: 0;
  font-size: 21px;
  letter-spacing: -0.03em;
}

.list-toolbar {
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.list-toolbar .filters {
  flex-wrap: wrap;
}

.list-toolbar .muted {
  margin-top: 5px;
}

.filters input {
  width: 270px;
}

.filters select {
  width: 170px;
}

.column-picker {
  position: relative;
}

.column-picker summary {
  min-height: 42px;
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  padding: 9px 14px;
  font-size: 12px;
  font-weight: 750;
  list-style: none;
}

.column-picker summary::-webkit-details-marker {
  display: none;
}

.column-picker summary::after {
  content: "▾";
  margin-left: 9px;
  color: var(--muted);
}

.column-picker[open] summary {
  border-color: var(--green);
}

.column-picker fieldset {
  width: 210px;
  display: grid;
  gap: 9px;
  position: absolute;
  z-index: 10;
  top: calc(100% + 7px);
  right: 0;
  margin: 0;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--white);
  box-shadow: 0 14px 34px rgba(22, 50, 39, 0.16);
  padding: 14px;
}

.column-picker legend {
  padding: 0 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.column-picker label {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-size: 12px;
  white-space: nowrap;
}

.filters .column-picker input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--green);
}

.table-wrap {
  overflow-x: auto;
}

.workbook-table {
  table-layout: fixed;
}

.workbook-table-wrap {
  scroll-margin-top: 88px;
}

.workbook-table th,
.workbook-table td {
  padding-right: 14px;
  padding-left: 14px;
}

.workbook-table th:first-child,
.workbook-table td:first-child {
  width: 22%;
  min-width: 240px;
}

.workbook-table th:nth-child(6),
.workbook-table td:nth-child(6) { width: 11%; }
.workbook-table th:last-child,
.workbook-table td:last-child { width: 4%; }
.workbook-table [data-column="owner"] { width: 13%; }
.workbook-table [data-column="location"] { width: 8%; }
.workbook-table [data-column="sheets"] { width: 5%; }
.workbook-table [data-column="size"] { width: 6%; }
.workbook-table [data-column="risk"] { width: 11%; }
.workbook-table [data-column="trend"] { width: 9%; }
.workbook-table [data-column="opened"] { width: 6%; }
.workbook-table [data-column="events"] { width: 5%; }

.workbook-table .user-link {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workbook-table .file-copy,
.workbook-table .file-copy strong,
.workbook-table .file-copy small {
  max-width: 100%;
}

.workbook-table .risk-trend {
  min-width: 0;
}

.workbook-table .table-labels,
.workbook-table .risk-chips {
  max-height: 24px;
  overflow: hidden;
}

.table-pagination {
  min-height: 68px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  border-top: 1px solid var(--line);
  padding: 12px 20px;
}

.page-size,
.pagination-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-size {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.page-size select {
  width: 70px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  padding: 6px 8px;
}

.table-pagination p {
  margin: 0;
  text-align: center;
}

.pagination-actions {
  justify-content: flex-end;
}

.pagination-actions .button {
  min-height: 36px;
  padding: 7px 12px;
  font-size: 11px;
}

.pagination-actions .button:disabled {
  cursor: not-allowed;
}

#workbook-page-number {
  min-width: 88px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th,
td {
  border-bottom: 1px solid #edf1ee;
  padding: 15px 22px;
  vertical-align: middle;
}

th {
  background: #fafbfa;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

td {
  font-size: 12px;
}

tbody tr {
  transition: background 120ms ease;
}

tbody tr:hover {
  background: #fbfcfb;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.workbook-link {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  text-align: left;
}

.user-link {
  border: 0;
  background: transparent;
  color: var(--green);
  padding: 0;
  font-size: inherit;
  font-weight: 750;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.file-mark {
  width: 36px;
  height: 36px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 10px;
  background: var(--green-soft);
  color: var(--green);
  font-weight: 850;
}

.file-copy {
  min-width: 0;
}

.file-copy strong,
.file-copy small,
.table-primary,
.table-secondary,
.risk-total {
  display: block;
}

.file-copy strong {
  max-width: 360px;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-copy small {
  max-width: 420px;
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-primary {
  font-size: 12px;
}

.table-secondary {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #edf2ef;
  padding: 6px 9px;
  font-size: 10px;
  font-weight: 750;
}

.risk-total {
  color: var(--amber);
  font-weight: 800;
}

.risk-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.scan-freshness {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 9px;
}

.risk-chip {
  border-radius: 999px;
  background: var(--amber-soft);
  color: #75401e;
  padding: 3px 6px;
  font-size: 9px;
  font-weight: 700;
}

.table-labels,
.label-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}

.label-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid #c9d9d0;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  padding: 4px 8px;
  font-size: 9px;
  font-weight: 800;
}

.label-chip-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 5px;
}

button.label-chip:hover {
  border-color: var(--green);
}

.event-count {
  font-size: 14px;
}

.row-arrow {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--green);
  font-size: 17px;
  font-weight: 800;
}

.row-arrow:hover {
  background: var(--green-soft);
}

.empty-row td,
.activity-empty {
  color: var(--muted);
  padding: 40px 24px;
  text-align: center;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  color: var(--green);
  padding: 0;
  margin-bottom: 30px;
  font-size: 12px;
  font-weight: 800;
}

.detail-heading {
  align-items: flex-start;
}

.detail-kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.mono {
  color: var(--muted);
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 10px;
}

.detail-path {
  max-width: 840px;
  overflow-wrap: anywhere;
}

.detail-summary {
  min-width: 170px;
  border-left: 1px solid var(--line);
  padding-left: 24px;
}

.detail-summary span,
.detail-summary strong {
  display: block;
}

.detail-summary span {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.detail-summary strong {
  font-size: 18px;
}

.loading-panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--white);
  color: var(--muted);
  padding: 54px;
  text-align: center;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 0.72fr);
  gap: 16px;
}

.detail-risk-stack {
  display: grid;
  align-content: start;
  min-width: 0;
  gap: 16px;
}

.activity-panel {
  grid-column: 1 / -1;
}

.history-panel {
  grid-column: 1 / -1;
}

.owner-history-panel {
  grid-column: 1 / -1;
}

.owner-history-list {
  max-height: 360px;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
}

.owner-change-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid #edf1ee;
  padding: 16px 24px;
}

.owner-change-item:last-child {
  border-bottom: 0;
}

.owner-change-copy strong,
.owner-change-copy small {
  display: block;
}

.owner-change-copy small,
.owner-change-item time {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
}

.owner-change-item time {
  flex: 0 0 auto;
  margin: 0;
}

.history-panel .panel-header {
  align-items: center;
}

.chart-wrap {
  overflow-x: auto;
  padding: 18px 20px 12px;
}

#risk-history-chart {
  width: 100%;
  min-width: 680px;
  height: auto;
  display: block;
}

.high-risk-total {
  text-align: right;
}

.high-risk-total strong,
.high-risk-total span {
  display: block;
}

.high-risk-total strong {
  color: var(--amber);
  font-size: 32px;
  line-height: 1;
  letter-spacing: -0.05em;
}

.high-risk-total span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.risk-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
}

.risk-stat {
  min-height: 88px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--white);
  padding: 12px 18px;
}

.risk-stat span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.risk-stat strong {
  font-size: 29px;
  letter-spacing: -0.04em;
}

.risk-stat.has-risk strong {
  color: var(--amber);
}

.facts-list {
  margin: 0;
  padding: 6px 24px;
}

.facts-list > div {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid #edf1ee;
  padding: 16px 0;
}

.facts-list > div:last-child {
  border-bottom: 0;
}

.facts-list dt {
  color: var(--muted);
  font-size: 11px;
}

.facts-list dd {
  margin: 0;
  font-size: 11px;
  font-weight: 750;
  text-align: right;
}

.facts-list .owner-fact {
  align-items: flex-start;
}

.facts-list .label-fact {
  align-items: flex-start;
}

.label-fact dd {
  max-width: 260px;
}

.label-fact .label-chips {
  justify-content: flex-end;
  margin-top: 0;
}

.owner-form {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

.owner-form input {
  min-width: 180px;
  max-width: 240px;
}

.owner-form .button {
  min-height: 38px;
  padding: 8px 12px;
}

.field-status {
  display: block;
  max-width: 260px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 10px;
}

.label-control {
  min-width: 250px;
  margin-top: 10px;
  position: relative;
}

.label-menu-button {
  width: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  padding: 8px 11px;
  font-size: 11px;
  font-weight: 700;
  text-align: left;
}

.label-menu-button:hover,
.label-menu-button[aria-expanded="true"] {
  border-color: #aebeb5;
  background: #f9fbfa;
}

.label-menu {
  width: min(340px, calc(100vw - 44px));
  overflow: hidden;
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  z-index: 30;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--white);
  box-shadow: 0 18px 50px rgba(22, 50, 39, 0.18);
  color: var(--ink);
  text-align: left;
}

.label-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 13px 14px;
}

.label-menu-header strong {
  font-size: 12px;
}

.label-menu-header button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0 3px;
  font-size: 20px;
  line-height: 1;
}

.label-menu-search {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  margin: 10px;
  padding: 0 9px;
  color: var(--muted);
}

.label-menu-search:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(23, 79, 59, 0.12);
}

.label-menu-search input {
  width: 100%;
  min-height: 38px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
}

.label-picker {
  max-height: 290px;
  overflow-y: auto;
  border-top: 1px solid #edf1ee;
}

.label-menu-option {
  display: grid;
  grid-template-columns: 18px 12px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  border-bottom: 1px solid #edf1ee;
  padding: 10px 13px;
  cursor: pointer;
}

.label-menu-option:hover {
  background: #f4f8f5;
}

.label-menu-option:has(input:checked) {
  background: var(--green-soft);
}

.label-menu-option input {
  width: 16px;
  height: 16px;
  margin: 1px 0 0;
  accent-color: var(--green);
}

.label-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-top: 3px;
}

.label-option-copy {
  min-width: 0;
}

.label-option-copy strong,
.label-option-copy small {
  display: block;
}

.label-option-copy strong {
  font-size: 12px;
}

.label-option-copy small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.35;
}

.label-picker-empty {
  margin: 0;
  color: var(--muted);
  padding: 30px 18px;
  font-size: 11px;
  text-align: center;
}

.label-menu-footer {
  width: 100%;
  border: 0;
  border-top: 1px solid var(--line);
  background: #fafbfa;
  color: var(--green);
  padding: 11px 14px;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.label-menu-footer:hover {
  background: var(--green-soft);
}

.label-create-panel {
  margin-bottom: 16px;
}

.label-create-form {
  display: grid;
  grid-template-columns: minmax(150px, 0.7fr) minmax(210px, 1fr) minmax(130px, 0.5fr) minmax(210px, 1fr) auto;
  gap: 12px;
  align-items: end;
  padding: 20px 24px;
}

.label-create-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.label-create-form input,
.label-create-form select,
.label-rule-form input,
.label-rule-form select {
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  padding: 9px 11px;
}

.label-create-panel > .field-status {
  max-width: none;
  margin: -10px 24px 18px;
}

.user-detail-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.75fr) minmax(0, 1.5fr);
  gap: 16px;
}

.owned-files {
  display: grid;
}

.owned-file {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  border-bottom: 1px solid #edf1ee;
  background: transparent;
  color: inherit;
  padding: 16px 22px;
  text-align: left;
}

.owned-file:hover {
  background: #fbfcfb;
}

.owned-file strong,
.owned-file small {
  display: block;
}

.owned-file small {
  max-width: 420px;
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-link {
  font-size: 12px;
  font-weight: 750;
}

.user-detail-grid .activity-item {
  grid-template-columns: 38px minmax(0, 1fr) 100px;
}

.activity-list {
  max-height: 510px;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
}

.activity-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 80px 100px;
  gap: 14px;
  align-items: center;
  border-bottom: 1px solid #edf1ee;
  padding: 16px 24px;
}

.activity-item:last-child {
  border-bottom: 0;
}

.event-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--green-soft);
  color: var(--green);
  font-weight: 850;
}

.event-icon.saved {
  background: #e7eef7;
  color: #345c8c;
}

.activity-copy strong,
.activity-copy small,
.activity-risk strong,
.activity-risk small {
  display: block;
}

.activity-copy strong {
  font-size: 12px;
}

.activity-copy small,
.activity-risk small,
.activity-item time {
  color: var(--muted);
  font-size: 10px;
}

.activity-copy small {
  margin-top: 4px;
}

.activity-risk {
  text-align: right;
}

.activity-item time {
  text-align: right;
}

.error-state {
  width: min(620px, 100%);
  margin: 80px auto;
  text-align: center;
}

.error-mark {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #ffebe8;
  color: var(--red);
  margin: 0 auto 24px;
  font-size: 24px;
  font-weight: 850;
}

.error-state .lead {
  margin: 18px auto 28px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

@media (max-width: 1050px) {
  .signin-view {
    grid-template-columns: 1fr;
  }

  .signin-story {
    min-height: 56vh;
    gap: 70px;
  }

  .signin-panel {
    min-height: auto;
    padding: 60px 28px;
  }

  .metrics-grid,
  .risk-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .user-detail-grid {
    grid-template-columns: 1fr;
  }

  .activity-panel {
    grid-column: auto;
  }


  .history-panel {
    grid-column: auto;
  }

  .owner-history-panel {
    grid-column: auto;
  }
}

@media (max-width: 760px) {
  .app-header {
    height: auto;
    align-items: flex-start;
    padding: 15px 18px;
  }

  .status,
  .account-label,
  #refresh-button {
    display: none;
  }

  .primary-nav {
    order: 3;
  }

  .company-switcher > span:first-child {
    display: none;
  }

  .company-switcher .company-picker {
    display: inline-block;
  }

  .company-switcher input {
    width: min(52vw, 240px);
  }

  .workspace {
    width: min(100% - 32px, 1440px);
    padding-top: 32px;
  }

  .page-heading,
  .detail-heading,
  .list-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .detail-summary {
    display: none;
  }

  .page-heading-meta {
    width: 100%;
    align-items: flex-start;
    justify-content: space-between;
  }

  .filters {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .label-create-form {
    grid-template-columns: 1fr;
  }

  .label-rule-form {
    grid-template-columns: 1fr;
  }

  .filters input,
  .filters select {
    width: 100%;
  }

  .column-picker,
  .column-picker summary {
    width: 100%;
  }

  .column-picker summary {
    justify-content: space-between;
  }

  .column-picker fieldset {
    width: 100%;
  }

  .metrics-grid {
    grid-template-columns: 1fr 1fr;
  }

  .metric-card {
    min-height: 126px;
  }

  th,
  td {
    padding: 13px 16px;
  }

  table:not(.workbook-table) th.optional-column,
  table:not(.workbook-table) td.optional-column {
    display: none;
  }

  .workbook-table {
    min-width: 660px;
  }

  .table-pagination {
    grid-template-columns: 1fr 1fr;
  }

  .table-pagination p {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .pagination-actions {
    justify-content: flex-end;
  }

  .risk-grid {
    grid-template-columns: 1fr 1fr;
  }

  .activity-item {
    grid-template-columns: 36px minmax(0, 1fr) 66px;
  }

  .activity-item time {
    display: none;
  }
}

@media (max-width: 520px) {
  .signin-story {
    min-height: 62vh;
    padding: 30px 24px;
  }

  .signin-story h1 {
    font-size: 44px;
  }

  .signin-proof {
    display: none;
  }

  .signin-panel {
    padding: 32px 16px;
  }

  .metrics-grid {
    grid-template-columns: 1fr;
  }

  .table-pagination {
    grid-template-columns: 1fr;
  }

  .table-pagination p,
  .pagination-actions,
  .page-size {
    grid-column: 1;
    justify-content: center;
  }

  .page-heading h1,
  .detail-heading h1,
  .error-state h1 {
    font-size: 40px;
  }
}

.risk-history-tooltip {
  position: fixed;
  z-index: 1000;
  max-width: min(360px, calc(100vw - 16px));
  padding: 12px 15px;
  border: 1px solid #dce4df;
  border-radius: 10px;
  background: #ffffff;
  color: #263b30;
  box-shadow: 0 6px 24px #183d2426;
  font: 13px/1.6 "Segoe UI", Arial, sans-serif;
  white-space: pre-line;
  overflow-wrap: anywhere;
  pointer-events: none;
}
.aggregate-risk-panel { margin-bottom: 24px; }
.graph-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.table-sort-button { border: 0; background: transparent; color: inherit; font: inherit; text-transform: inherit; letter-spacing: inherit; padding: 6px 0; cursor: pointer; text-align: left; white-space: nowrap; }
.table-sort-button:hover { color: var(--green); }
.table-sort-button:focus-visible { outline: 2px solid var(--green); outline-offset: 4px; border-radius: 2px; }
.aggregate-risk-panel .panel-header { flex-wrap: wrap; gap: 16px; }
#aggregate-risk-status { margin: 0; padding: 0 24px 12px; }
.aggregate-risk-chart { padding: 0 16px; overflow-x: auto; }
.aggregate-risk-chart svg { display: block; width: 100%; min-width: 560px; }
.aggregate-risk-chart text { fill: #69746d; font: 12px sans-serif; }
#aggregate-risk-data { padding: 12px 24px 20px; }
#aggregate-risk-data summary { cursor: pointer; }

/* Insights */
.insights-heading { align-items: flex-end; }

.insight-scatter-panel { margin-bottom: 18px; }

.insight-chart-header {
  align-items: center;
  flex-wrap: wrap;
}

.insight-chart-header .muted,
.attention-panel .panel-header .muted {
  max-width: 760px;
  margin: 6px 0 0;
}

.insight-chart-filters {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.insight-chart-filters input { width: 220px; }
.insight-chart-filters select { width: 180px; }

.insight-scatter-body { padding: 18px 24px 20px; }

.insight-legend-block {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
}

.insight-legend-block > div:first-child {
  min-width: 128px;
}

.insight-legend-block strong,
.insight-legend-block .muted { display: block; }
.insight-legend-block strong { font-size: 12px; }
.insight-legend-block .muted { margin-top: 3px; font-size: 11px; }

.insight-tag-filters {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 7px;
}

.insight-tag-filter {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  color: var(--ink);
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 750;
}

.insight-tag-filter::before {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--tag-color, #89948f);
  content: "";
}
.insight-tag-filter[data-marker-shape="triangle"]::before { border-radius: 0; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.insight-tag-filter[data-marker-shape="square"]::before { border-radius: 1px; }
.insight-tag-filter[data-marker-shape="diamond"]::before { border-radius: 1px; transform: rotate(45deg); }
.insight-tag-filter[data-marker-shape="hexagon"]::before { border-radius: 0; clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); }

.insight-tag-filter:hover { border-color: var(--line-strong); background: var(--paper); }
.insight-tag-filter[aria-pressed="true"] { color: var(--muted); text-decoration: line-through; opacity: 0.7; }
.insight-tag-filter[aria-pressed="true"]::before { background: #b9c0bc; }

#insight-scatter-status { margin: 2px 0 4px; font-size: 12px; }

.insight-scatter-chart {
  min-height: 420px;
  overflow-x: auto;
}

.insight-scatter-chart svg {
  display: block;
  width: 100%;
  min-width: 720px;
}

.insight-scatter-chart .grid-line { stroke: #e7ece9; stroke-width: 1; }
.insight-scatter-chart .quadrant-line { stroke: #bcc8c2; stroke-width: 1; stroke-dasharray: 5 6; }
.insight-scatter-chart .scatter-displacement { stroke: #c7d0cb; stroke-width: 1; }
.insight-scatter-chart text { fill: var(--muted); font: 11px Inter, "Segoe UI", Arial, sans-serif; }
.insight-scatter-chart .axis-label { fill: var(--ink); font-size: 12px; font-weight: 750; }
.insight-scatter-chart .quadrant-label { fill: #84918a; font-size: 10px; font-weight: 800; letter-spacing: 0.08em; }
.insight-scatter-chart .scatter-point { cursor: pointer; outline: none; }
.insight-scatter-chart .point-shape {
  stroke: var(--white);
  stroke-width: 2;
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 120ms ease, opacity 120ms ease;
}
.insight-scatter-chart .scatter-point:hover .point-shape,
.insight-scatter-chart .scatter-point:focus .point-shape { stroke: var(--ink); transform: scale(1.4); }
.insight-scatter-chart .scatter-cluster { cursor: pointer; }
.insight-scatter-chart .scatter-cluster.is-expanded .point-shape { stroke: var(--ink); stroke-width: 3; }
.insight-scatter-chart .cluster-count {
  fill: var(--white);
  font-size: 10px;
  font-weight: 850;
  pointer-events: none;
}
.insight-scatter-chart .cluster-expansion-line {
  stroke: #9aa9a1;
  stroke-width: 1;
  stroke-dasharray: 2 3;
}
.insight-scatter-chart .expanded-workbook .point-shape { stroke-width: 2.5; }

.insight-method-note {
  margin: 6px 0 0;
  border-top: 1px solid var(--line);
  padding-top: 13px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.insight-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.75fr) minmax(0, 0.75fr) minmax(340px, 1.5fr);
  gap: 18px;
}

.insight-summary-panel .panel-header,
.attention-panel .panel-header { padding-bottom: 16px; }

.bar-list { padding: 20px 24px 24px; }

.bar-row + .bar-row { margin-top: 18px; }

.bar-row-copy {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
  font-size: 12px;
}

.bar-row-copy strong { font-size: 12px; }
.bar-row-copy span:last-child { color: var(--muted); font-variant-numeric: tabular-nums; }

.bar-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--paper);
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.risk-bars .bar-row:nth-child(2) .bar-fill { background: #d6a349; }
.risk-bars .bar-row:nth-child(3) .bar-fill { background: #c87535; }
.risk-bars .bar-row:nth-child(4) .bar-fill { background: var(--red); }

.attention-list { padding: 8px 24px 14px; }

.attention-item {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto 22px;
  align-items: center;
  gap: 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: inherit;
  padding: 14px 0;
  text-align: left;
}

.attention-item:last-child { border-bottom: 0; }
.attention-item:hover .attention-name { color: var(--green); }
.attention-name { min-width: 0; }
.attention-name strong,
.attention-name small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attention-name small { margin-top: 4px; color: var(--muted); font-size: 10px; }

.attention-score { min-width: 66px; text-align: right; }
.attention-score strong,
.attention-score small { display: block; }
.attention-score strong { font-size: 16px; }
.attention-score small { margin-top: 2px; color: var(--muted); font-size: 9px; text-transform: uppercase; }
.attention-arrow { color: var(--muted); font-size: 18px; }

.insight-empty {
  margin: 0;
  padding: 28px 0;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 1120px) {
  .insight-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .attention-panel { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .insight-chart-filters,
  .insight-chart-filters label,
  .insight-chart-filters input,
  .insight-chart-filters select,
  .insight-chart-filters button { width: 100%; }
  .insight-legend-block { display: block; }
  .insight-tag-filters { justify-content: flex-start; margin-top: 12px; }
  .insight-scatter-body { padding: 16px; }
  .insight-grid { grid-template-columns: 1fr; }
  .attention-panel { grid-column: auto; }
}
/* Keep cloud launch actions separate from workbook detail navigation. */
.workbook-excel-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  margin-top: 3px;
  border-radius: 4px;
  color: var(--green);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
  text-decoration: none;
  white-space: nowrap;
}

.label-auto-mark {
  margin-left: 5px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
}

.label-rules-panel {
  margin-bottom: 16px;
}

.label-rule-list {
  display: grid;
  gap: 8px;
  padding: 0 24px 16px;
}

.label-rule-item {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 12px;
}

.label-rule-item code {
  overflow-wrap: anywhere;
}

.label-rule-form {
  display: grid;
  grid-template-columns: 160px minmax(240px, 1fr) auto;
  align-items: end;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding: 16px 24px;
}

.label-rule-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.label-rule-status {
  margin: -6px 24px 16px;
}

.risk-trend {
  display: block;
  min-width: 128px;
}

.risk-trend strong,
.risk-trend small {
  display: block;
}

.risk-trend strong {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.risk-trend-icon {
  width: 22px;
  height: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.risk-trend small {
  max-width: 170px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.35;
}

.risk-trend-up strong { color: var(--red); }
.risk-trend-down strong { color: var(--green); }

td > .workbook-excel-link {
  margin-left: 48px;
}

.workbook-excel-link:hover {
  color: var(--green-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.workbook-excel-link:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}

#detail-open-links .workbook-excel-link {
  font-size: 12px;
}
