:root {
  --bg: #08142f;
  --bg-alt: #10214a;
  --panel: rgba(10, 24, 57, 0.82);
  --panel-light: rgba(255, 255, 255, 0.08);
  --line: rgba(255, 255, 255, 0.12);
  --text: #edf2ff;
  --muted: #a7b6d9;
  --accent: #8cf0dc;
  --accent-2: #7ba4ff;
  --accent-3: #f4d57e;
  --danger: #ff9f9f;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.28);
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, serif;
  --sans: "Avenir Next", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(123, 164, 255, 0.28), transparent 28%),
    radial-gradient(circle at 80% 15%, rgba(140, 240, 220, 0.16), transparent 20%),
    linear-gradient(180deg, #08142f 0%, #0c1741 35%, #08112b 100%);
  font-family: var(--sans);
  min-height: 100vh;
}

.access-gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
  background:
    radial-gradient(circle at 20% 30%, rgba(57, 99, 210, 0.16), transparent 26%),
    radial-gradient(circle at 80% 10%, rgba(92, 123, 255, 0.12), transparent 18%),
    linear-gradient(180deg, #070b25 0%, #08142f 100%);
  position: relative;
  overflow: hidden;
}

.access-gate::before {
  content: "";
  position: absolute;
  inset: -10% -5%;
  background-image:
    radial-gradient(circle at 20% 35%, transparent 0 72px, rgba(70, 98, 201, 0.45) 73px 74px, transparent 75px),
    radial-gradient(circle at 28% 28%, transparent 0 132px, rgba(70, 98, 201, 0.28) 133px 134px, transparent 135px),
    radial-gradient(circle at 34% 36%, transparent 0 184px, rgba(70, 98, 201, 0.18) 185px 186px, transparent 187px),
    radial-gradient(circle at 68% 18%, transparent 0 94px, rgba(70, 98, 201, 0.24) 95px 96px, transparent 97px),
    radial-gradient(circle at 62% 22%, transparent 0 146px, rgba(70, 98, 201, 0.16) 147px 148px, transparent 149px);
  opacity: 0.75;
  pointer-events: none;
}

.access-card {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 32px;
  background: rgba(10, 20, 49, 0.7);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
  padding: 42px 34px 34px;
}

.access-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  margin-bottom: 26px;
}

.brand-wordmark {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 0.9;
  font-family: var(--sans);
  font-size: clamp(2.7rem, 5vw, 4.4rem);
  font-weight: 700;
  letter-spacing: -0.05em;
}

.brand-mark {
  width: 68px;
  display: grid;
  place-items: center;
}

.brand-mark svg {
  display: block;
  width: 100%;
  height: auto;
}

.brand-line {
  display: block;
}

.access-copy {
  text-align: center;
  margin-bottom: 18px;
}

.access-copy h2 {
  font-family: var(--serif);
  font-size: 2rem;
  margin-bottom: 8px;
}

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

.access-submit {
  margin-top: 18px;
}

.access-device-hint {
  margin-top: 8px;
  width: 100%;
  display: block;
  color: var(--muted);
  font-size: 0.88rem;
  text-align: center;
}

.access-error {
  margin: 6px 0 0;
  color: var(--danger);
  text-align: center;
}

.app-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 28px;
}

.app-modal-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top left, rgba(123, 164, 255, 0.18), transparent 30%),
    linear-gradient(180deg, rgba(3, 8, 22, 0.84), rgba(3, 8, 22, 0.94));
  backdrop-filter: blur(14px);
}

.app-modal-shell {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
}

.app-modal-card {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(11, 25, 61, 0.96), rgba(7, 16, 41, 0.97));
  box-shadow: var(--shadow);
  padding: 28px 28px 24px;
}

.app-modal-card h3 {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  letter-spacing: -0.03em;
}

.app-modal-message {
  margin: 12px 0 0;
  color: var(--muted);
  white-space: pre-line;
  line-height: 1.55;
}

.app-modal-input-wrap {
  margin-top: 20px;
}

.app-modal-input-wrap select,
.app-modal-input-wrap input {
  width: 100%;
}

.app-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 22px;
}

.app-modal-confirm-danger {
  background: linear-gradient(135deg, #ffb0b0, #ff8d8d);
  color: #22070f;
}

.button-danger {
  border-color: rgba(255, 159, 159, 0.42);
  color: #ffd6d6;
  background: rgba(120, 28, 40, 0.34);
}

.button-danger:hover:not(:disabled) {
  background: rgba(150, 36, 52, 0.46);
  border-color: rgba(255, 176, 176, 0.58);
}

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

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

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  padding: 28px;
  border-right: 1px solid var(--line);
  background: rgba(8, 20, 47, 0.82);
  backdrop-filter: blur(20px);
  overflow-y: auto;
}

.sidebar-inner {
  display: grid;
  gap: 18px;
}

.sidebar-logout {
  margin-top: 16px;
}

.sidebar-top-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.sidebar-top-actions .button {
  flex: 1;
}

.sidebar-secondary-actions {
  margin-top: 10px;
}

.sidebar-secondary-actions .button {
  width: 100%;
}

.main-content {
  padding: 28px;
}

.app-loading-banner {
  position: sticky;
  top: 16px;
  z-index: 40;
  margin-bottom: 18px;
  border: 1px solid rgba(140, 240, 220, 0.18);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(10, 25, 59, 0.96), rgba(7, 18, 44, 0.96));
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.24);
  overflow: hidden;
}

.app-loading-banner-bar {
  height: 4px;
  width: 100%;
  background:
    linear-gradient(90deg, rgba(140, 240, 220, 0.15), rgba(123, 164, 255, 0.8), rgba(244, 213, 126, 0.4), rgba(140, 240, 220, 0.15));
  background-size: 220% 100%;
  animation: shimmer-slide 1.2s linear infinite;
}

.app-loading-banner-copy {
  padding: 16px 18px 18px;
}

.app-loading-banner-copy h3 {
  font-size: 1.05rem;
  margin-bottom: 6px;
}

.app-loading-banner-copy p {
  margin: 0;
}

.eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
  font-size: 0.76rem;
}

h1,
h2,
h3,
h4 {
  margin: 0;
}

h1,
.hero h2 {
  font-family: var(--serif);
  font-weight: 700;
  letter-spacing: -0.03em;
}

h1 {
  font-size: 2.4rem;
  line-height: 1;
}

.sidebar-copy,
.hero-copy,
.muted,
.hint,
.detail-copy p,
.section-note {
  color: var(--muted);
}

.panel,
.hero,
.kpi-card {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  border-radius: 24px;
}

.panel {
  padding: 18px;
}

.panel-dark {
  background: linear-gradient(180deg, rgba(11, 29, 71, 0.95), rgba(6, 15, 38, 0.95));
}

#portfolio-sim-panel .button {
  width: 100%;
}

.portfolio-sim-results {
  margin-top: 18px;
  padding-top: 6px;
}

.portfolio-sim-results-head {
  margin-bottom: 12px;
}

.portfolio-sim-results-head h4 {
  margin: 0;
}

.portfolio-sim-results-head p {
  margin: 6px 0 0;
}

label {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  font-size: 0.92rem;
  color: var(--muted);
}

.field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.field-help {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.info-chip {
  margin-top: 0;
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(140, 240, 220, 0.28);
  background: rgba(140, 240, 220, 0.08);
  color: var(--accent-2);
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1;
}

.field-tooltip {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 180px;
  padding: 9px 11px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(6, 15, 38, 0.98);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.32);
  color: var(--text);
  font-size: 0.78rem;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 120ms ease, transform 120ms ease;
  z-index: 5;
}

.field-help:hover .field-tooltip,
.field-help:focus-within .field-tooltip {
  opacity: 1;
  transform: translateY(0);
}

input,
textarea,
select {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 12px 14px;
}

textarea {
  resize: vertical;
}

.button {
  margin-top: 14px;
  border: 0;
  border-radius: 999px;
  padding: 11px 16px;
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
  cursor: pointer;
}

.button-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #071224;
  font-weight: 700;
}

.button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.button-busy {
  position: relative;
}

.button-ghost {
  background: transparent;
  border: 1px solid var(--line);
}

.toggle-button {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 0;
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 700;
}

.hero {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 24px;
  padding: 28px;
  min-height: 260px;
}

#saved-portfolio-page {
  display: grid;
  gap: 18px;
}

.hero-actions {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
}

.hero h2 {
  font-size: clamp(2.1rem, 3.5vw, 3.5rem);
  max-width: 13ch;
}

.hero-art {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(123, 164, 255, 0.12), rgba(140, 240, 220, 0.02));
  min-height: 188px;
  width: 100%;
}

.hero-growth {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-line {
  fill: none;
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 10px rgba(123, 164, 255, 0.14));
  stroke-dasharray: 420;
  stroke-dashoffset: 420;
  animation:
    draw-growth 2.4s ease forwards,
    pulse-growth 3.2s ease-in-out 2.4s infinite alternate;
}

.hero-line-a {
  stroke: url(#heroGlowA);
  stroke-width: 4.4;
}

.hero-line-b {
  stroke: url(#heroGlowB);
  animation-delay: 0.16s, 2.56s;
}

.hero-line-c {
  stroke: url(#heroGlowC);
  animation-delay: 0.32s, 2.72s;
  stroke-width: 3.2;
}

.hero-line-d {
  stroke: url(#heroGlowD);
  animation-delay: 0.12s, 2.5s;
  stroke-width: 3.9;
}

.hero-line-e {
  stroke: url(#heroGlowE);
  animation-delay: 0.44s, 2.84s;
  stroke-width: 3.1;
}

@keyframes draw-growth {
  from {
    stroke-dashoffset: 420;
    opacity: 0.25;
  }
  to {
    stroke-dashoffset: 0;
    opacity: 1;
  }
}

@keyframes pulse-growth {
  from {
    transform: translateY(0);
    opacity: 0.86;
  }
  to {
    transform: translateY(-2px);
    opacity: 1;
  }
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  margin: 18px 0;
}

.kpi-card {
  padding: 18px;
}

.kpi-grid-loading {
  opacity: 1;
}

.kpi-label,
.kpi-subtle,
.chart-label,
.small {
  color: var(--muted);
}

.kpi-value {
  display: block;
  font-size: 1.8rem;
  margin: 8px 0;
}

.workspace-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) 420px;
  gap: 18px;
  align-items: start;
}

.center-column {
  display: grid;
  gap: 18px;
}

.panel-wide {
  min-width: 0;
}

.panel-loading {
  position: relative;
}

.panel-loading::after {
  content: "Loading...";
  position: absolute;
  inset: 14px 14px auto auto;
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(8, 20, 47, 0.82);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
}

.detail-panel {
  position: sticky;
  top: 28px;
  height: calc(100vh - 56px);
  max-height: calc(100vh - 56px);
  overflow-y: auto;
}

.detail-drawer-handle {
  display: none;
}

.section-head,
.detail-head,
.admin-head,
.admin-live {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
}

.admin-nav {
  display: grid;
  gap: 10px;
}

.saved-summary-card,
.saved-comparison-card,
.saved-placeholder-card {
  min-height: 100%;
}

.saved-summary-card h3,
.saved-comparison-card h3,
.saved-placeholder-card h3 {
  font-family: var(--serif);
  font-size: 1.9rem;
  letter-spacing: -0.03em;
}

.saved-comparison-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.saved-comparison-item {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  padding: 16px;
}

.saved-comparison-item span {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
}

.saved-comparison-item strong {
  display: block;
  margin-top: 8px;
  font-size: 1.35rem;
  line-height: 1.1;
}

.saved-comparison-item small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.4;
}

.portfolio-dashboard-shell {
  align-items: stretch;
}

.portfolio-board {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.portfolio-board-row {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.04);
  padding: 16px 18px;
  cursor: pointer;
  transition: border-color 140ms ease, transform 140ms ease, background 140ms ease;
}

.portfolio-board-row:hover {
  border-color: rgba(140, 240, 220, 0.28);
  background: rgba(255, 255, 255, 0.055);
  transform: translateY(-1px);
}

.portfolio-board-row-active {
  border-color: rgba(140, 240, 220, 0.42);
  box-shadow: inset 3px 0 0 rgba(140, 240, 220, 0.72);
}

.portfolio-board-copy h4 {
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.portfolio-board-copy p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.35;
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.portfolio-feed-panel {
  min-height: 320px;
}

.portfolio-feed-copy {
  max-width: 72ch;
  color: var(--muted);
  line-height: 1.65;
}

.portfolio-detail-panel .detail-stats {
  margin-bottom: 16px;
}

.portfolio-detail-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}

.portfolio-detail-actions .button {
  margin-top: 0;
}

.portfolio-companies-block {
  display: grid;
  gap: 12px;
}

.portfolio-companies-block h4 {
  margin: 0;
}

.detail-head {
  align-items: flex-start;
}

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

.chip {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
}

.chip-active {
  background: rgba(140, 240, 220, 0.16);
  color: var(--text);
}

.pie-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.pie-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.03);
  padding: 16px;
}

.pie-card-head {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}

.pie-card-head h4 {
  font-size: 1rem;
}

.pie-active {
  min-height: 4.2em;
  line-height: 1.4;
  margin: 0;
}

.pie-chart {
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart-skeleton {
  fill: rgba(255, 255, 255, 0.1);
  animation: pulse 1.5s ease-in-out infinite;
}

.pie-slice {
  transition: transform 140ms ease, opacity 140ms ease;
  transform-origin: 140px 140px;
  cursor: pointer;
}

.pie-slice:hover,
.pie-slice:focus {
  opacity: 0.9;
  transform: scale(1.03);
}

.pie-center {
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 1;
}

.pie-center-value,
.pie-center-label {
  fill: var(--text);
}

.pie-center-value {
  font-size: 1.1rem;
  font-weight: 700;
}

.pie-center-label {
  font-size: 0.72rem;
  fill: var(--muted);
}

.stage-bar {
  transition: opacity 140ms ease, transform 140ms ease;
  transform-box: fill-box;
  transform-origin: center bottom;
  cursor: pointer;
}

.stage-bar:hover,
.stage-bar:focus {
  opacity: 0.92;
  transform: scaleY(1.03);
}

.stage-value,
.stage-label {
  fill: var(--text);
}

.stage-value {
  font-size: 0.74rem;
  font-weight: 700;
}

.stage-label {
  font-size: 0.72rem;
  fill: var(--muted);
}

.stage-axis {
  stroke: rgba(255, 255, 255, 0.18);
  stroke-width: 1;
}

.table-wrap {
  overflow: auto;
}

.sidebar,
.detail-panel,
.table-wrap,
#audit-log-list {
  -webkit-mask-image: none !important;
  mask-image: none !important;
}

.sidebar::before,
.sidebar::after,
.detail-panel::before,
.detail-panel::after,
.table-wrap::before,
.table-wrap::after,
#audit-log-list::before,
#audit-log-list::after {
  content: none !important;
  display: none !important;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 10px;
  text-align: left;
  border-top: 1px solid var(--line);
}

thead th {
  color: var(--muted);
  font-weight: 600;
  border-top: 0;
}

tbody tr.active-row {
  background: rgba(140, 240, 220, 0.08);
}

tbody tr.selected-row {
  background: rgba(140, 240, 220, 0.08);
  box-shadow: inset 3px 0 0 rgba(123, 164, 255, 0.72);
}

.link-button {
  background: transparent;
  border: 0;
  color: var(--text);
  padding: 0;
  cursor: pointer;
  font-weight: 700;
}

.select-col {
  width: 112px;
  white-space: nowrap;
}

.table-action {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 7px 12px;
  cursor: pointer;
}

.skeleton {
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.06) 0%,
    rgba(255, 255, 255, 0.12) 50%,
    rgba(255, 255, 255, 0.06) 100%
  );
  background-size: 200% 100%;
  animation: pulse 1.5s ease-in-out infinite;
}

.skeleton-card {
  display: grid;
  gap: 10px;
}

.skeleton-label {
  width: 44%;
  height: 12px;
}

.skeleton-value {
  width: 62%;
  height: 30px;
}

.skeleton-subtle {
  width: 78%;
  height: 12px;
}

.skeleton-line {
  width: 88%;
  height: 14px;
}

.skeleton-chip {
  width: 74px;
  height: 30px;
}

.table-action-active {
  background: rgba(123, 164, 255, 0.18);
  color: var(--text);
}

.table-action-danger {
  border-color: rgba(255, 159, 159, 0.35);
  color: #ffd0d0;
}

.row-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.detail-empty {
  display: grid;
  place-items: center;
  min-height: 320px;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 18px;
}

.badge,
.admin-pill {
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(123, 164, 255, 0.18);
  color: var(--text);
  text-transform: capitalize;
  white-space: nowrap;
}

.detail-stat {
  border-radius: 16px;
  background: var(--panel-light);
  padding: 12px;
  min-height: 112px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.detail-stat span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.detail-stat strong {
  display: block;
  font-size: 1.05rem;
  line-height: 1;
}

.detail-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.detail-stat-emphasis {
  padding: 16px 16px 18px;
}

.detail-stat-emphasis strong {
  font-size: 1.05rem;
}

.detail-copy {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.detail-actions {
  display: grid;
  gap: 10px;
  margin-top: 6px;
  margin-bottom: 18px;
}

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

#user-form,
#admin-panel {
  display: grid;
  gap: 14px;
}

#user-form-submit {
  align-self: end;
}

.admin-block {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

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

.admin-list-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.compact-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 12px;
}

.duplicate-review-list {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.admin-list-group {
  display: grid;
  gap: 12px;
}

.admin-list-group-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.admin-list-group-head h4 {
  font-size: 1rem;
}

.admin-list-group-body {
  display: grid;
  gap: 10px;
}

#audit-log-list {
  max-height: 520px;
  overflow-y: auto;
  padding-right: 4px;
}

.duplicate-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  padding: 14px;
  display: grid;
  gap: 10px;
}

.admin-entry-card {
  transition: border-color 140ms ease, transform 140ms ease, background 140ms ease;
}

.admin-entry-card-active {
  border-color: rgba(140, 240, 220, 0.42);
  background: rgba(140, 240, 220, 0.08);
}

.duplicate-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.duplicate-card-head h4 {
  font-size: 0.98rem;
}

.duplicate-reason {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.duplicate-rows {
  display: grid;
  gap: 8px;
}

.duplicate-row {
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(123, 164, 255, 0.08);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.duplicate-row-meta {
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 4px;
}

.audit-summary {
  color: var(--muted);
  font-size: 0.84rem;
  margin-top: 4px;
}

.admin-json-block {
  margin: 10px 0 0;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(4, 11, 30, 0.78);
  color: var(--text);
  font-size: 0.8rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.full-span {
  grid-column: 1 / -1;
}

.search {
  min-width: 220px;
}

.hidden {
  display: none !important;
}

@keyframes pulse {
  0% {
    background-position: 200% 0;
    opacity: 0.72;
  }
  50% {
    opacity: 1;
  }
  100% {
    background-position: -200% 0;
    opacity: 0.72;
  }
}

@keyframes shimmer-slide {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -20% 0;
  }
}

@media (max-width: 1280px) {
  .workspace-shell,
  .portfolio-dashboard-shell,
  .portfolio-board-row {
    grid-template-columns: 1fr;
  }

  .detail-panel {
    position: fixed;
    top: 24px;
    right: 0;
    z-index: 30;
    width: min(420px, calc(100vw - 48px));
    height: calc(100vh - 48px);
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    overflow-x: visible;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.38);
    transform: translateX(calc(100% - 44px));
    transition: transform 180ms ease, box-shadow 180ms ease;
  }

  .detail-panel:hover,
  .detail-panel:focus-within {
    transform: translateX(0);
    box-shadow: 0 28px 96px rgba(0, 0, 0, 0.48);
  }

  .detail-drawer-handle {
    display: flex;
    position: absolute;
    left: 0;
    top: 26px;
    width: 44px;
    height: 132px;
    align-items: center;
    justify-content: center;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, rgba(21, 42, 90, 0.98), rgba(11, 24, 55, 0.98));
    color: var(--muted);
    font-size: 0.74rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    border-top-left-radius: 18px;
    border-bottom-left-radius: 18px;
    pointer-events: none;
  }

  .detail-panel > *:not(.detail-drawer-handle) {
    margin-left: 18px;
  }
}

@media (max-width: 1100px) {
  .app-shell,
  .hero,
  .kpi-grid {
    grid-template-columns: 1fr;
  }

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

  .detail-panel {
    position: static;
    width: auto;
    height: auto;
    max-height: none;
    overflow: visible;
    border-top-right-radius: 24px;
    border-bottom-right-radius: 24px;
    transform: none;
    box-shadow: var(--shadow);
  }

  .detail-drawer-handle {
    display: none;
  }

  .detail-panel > *:not(.detail-drawer-handle) {
    margin-left: 0;
  }
}

@media (max-width: 720px) {
  .compact-form,
  .detail-stats {
    grid-template-columns: 1fr;
  }

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

  .section-head,
  .detail-head,
  .admin-head,
  .admin-live,
  .duplicate-card-head,
  .duplicate-row {
    align-items: flex-start;
    flex-direction: column;
  }
}
