:root {
  --bg-0: #0c1117;
  --bg-1: #111923;
  --bg-2: #1a2633;
  --line: #2b3b4d;
  --text: #e8eef5;
  --text-dim: #a6b4c4;
  --accent: #53a3ff;
  --accent-soft: rgba(83, 163, 255, 0.16);
  --warn: #f2c56d;
  --chip: #1d2b39;
  --chip-soft: rgba(99, 209, 162, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 15% 0%, #1e3044 0%, transparent 40%),
    radial-gradient(circle at 85% 0%, #173128 0%, transparent 40%),
    linear-gradient(180deg, var(--bg-1), var(--bg-0));
  color: var(--text);
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
}

.page-shell {
  width: min(1440px, 96vw);
  height: calc(100vh - 20px);
  margin: 10px auto;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 12px;
  min-height: 0;
}

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

h1 {
  margin: 0;
  font-size: 1.9rem;
  letter-spacing: 0.01em;
}

.subtitle {
  margin: 8px 0 0;
  color: var(--text-dim);
}

.delay-notice {
  margin: 10px 0 0;
  color: #ffda88;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}

.refresh-btn {
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--text);
  font-family: "IBM Plex Mono", monospace;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
}

.refresh-btn:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.logout-link {
  margin-top: 8px;
  display: inline-block;
  text-align: center;
  text-decoration: none;
}

.refresh-wrap {
  align-self: flex-start;
  border: 1px solid var(--line);
  background: rgba(16, 24, 34, 0.86);
  border-radius: 12px;
  padding: 10px 12px;
  min-width: 188px;
}

.refresh-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.refresh-wrap .refresh-btn {
  margin-top: 8px;
}

.refresh-label {
  color: var(--text-dim);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.refresh-time {
  color: var(--text);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.92rem;
}

.controls {
  background: rgba(15, 22, 31, 0.92);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
}

.control-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(220px, 0.8fr) auto;
  gap: 14px;
  align-items: end;
}

.controls input[type="search"] {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  font-size: 0.95rem;
  padding: 10px 12px;
}

.controls input[type="search"]:focus {
  outline: none;
  border-color: var(--accent);
}

.chip-title {
  display: block;
  margin: 0 0 6px;
  color: var(--text-dim);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.manager-filter {
  position: relative;
}

.manager-input-row {
  display: flex;
  gap: 8px;
}

.chip-action {
  border: 1px solid var(--line);
  background: var(--chip);
  color: var(--text);
  border-radius: 10px;
  padding: 0 12px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.8rem;
  cursor: pointer;
}

.manager-results {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 20;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #152130;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.manager-results button {
  display: flex;
  justify-content: space-between;
  width: 100%;
  border: 0;
  border-bottom: 1px solid rgba(43, 59, 77, 0.7);
  background: transparent;
  color: var(--text);
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
}

.manager-results button:last-child {
  border-bottom: 0;
}

.manager-results button:hover {
  background: rgba(83, 163, 255, 0.08);
}

.manager-count {
  color: var(--text-dim);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.76rem;
}

.toggle-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: center;
  font-family: "IBM Plex Mono", monospace;
  color: var(--text);
}

.table-shell {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: auto;
  background: rgba(11, 17, 25, 0.94);
  min-height: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1320px;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  text-align: left;
  background: #152130;
  border-bottom: 1px solid var(--line);
  color: var(--text-dim);
  font-size: 0.8rem;
  padding: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

tbody td {
  border-bottom: 1px solid rgba(43, 59, 77, 0.7);
  padding: 10px;
  vertical-align: top;
  font-size: 0.9rem;
}

tbody tr:hover {
  background: rgba(83, 163, 255, 0.08);
}

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

a:hover {
  text-decoration: underline;
}

.mono {
  font-family: "IBM Plex Mono", monospace;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  background: var(--chip-soft);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 0.76rem;
  white-space: nowrap;
}

.investor-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.investor-entry {
  border-left: 2px solid rgba(83, 163, 255, 0.35);
  padding-left: 8px;
}

.investor-entry strong {
  display: inline-block;
  margin-right: 6px;
}

.investor-role {
  color: var(--warn);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.76rem;
}

.investor-family {
  display: block;
  color: var(--text-dim);
  font-size: 0.78rem;
  margin-top: 2px;
}

.investor-evidence {
  display: block;
  color: var(--text-dim);
  font-size: 0.78rem;
  margin-top: 3px;
  line-height: 1.4;
}

.summary-text {
  line-height: 1.5;
  white-space: pre-wrap;
}

.term-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.term-list span {
  color: var(--text-dim);
}

.term-list strong {
  color: var(--text);
}

.anonymous-flag {
  margin-top: 8px;
  display: inline-block;
  border: 1px solid rgba(242, 197, 109, 0.38);
  background: rgba(242, 197, 109, 0.12);
  color: #f9d48a;
  border-radius: 8px;
  padding: 3px 8px;
  font-size: 0.76rem;
}

.state-message {
  padding: 12px;
  color: var(--text-dim);
  border-top: 1px solid var(--line);
}

.scroll-sentinel {
  height: 1px;
}

.hidden {
  display: none !important;
}

@media (max-width: 920px) {
  body {
    height: auto;
    min-height: 100vh;
    overflow: auto;
  }

  .page-shell {
    height: auto;
    margin: 20px auto 28px;
    display: block;
  }

  .hero {
    flex-direction: column;
    align-items: stretch;
  }

  .refresh-wrap {
    width: fit-content;
  }

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