:root {
  --ink: #18202a;
  --muted: #637083;
  --line: #d8dee8;
  --panel: #ffffff;
  --page: #f4f7fb;
  --brand: #235f9e;
  --brand-dark: #153b63;
  --accent: #55a9d4;
  --ok: #177245;
  --warn: #946200;
  --danger: #a33a3a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--page);
}

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

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

h1 {
  font-size: 28px;
  line-height: 1.1;
}

h2 {
  font-size: 24px;
}

h3 {
  font-size: 17px;
  margin-bottom: 14px;
}

.muted,
.meta {
  color: var(--muted);
}

.version {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  margin-bottom: 5px;
}

.context-line {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
}

.access-gate {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(244, 247, 251, 0.96);
}

.access-gate.hidden {
  display: none;
}

.hidden {
  display: none !important;
}

.access-panel {
  width: min(620px, 100%);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 26px;
  box-shadow: 0 20px 60px rgba(24, 32, 42, 0.14);
}

.access-logo {
  width: 190px;
  max-height: 95px;
  object-fit: contain;
  height: auto;
  margin-bottom: 12px;
}

.topbar {
  min-height: 94px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  padding: 16px 28px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand img {
  width: 148px;
  max-height: 62px;
  object-fit: contain;
  height: auto;
}

.role-switcher {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: calc(100vh - 94px);
}

.sidebar {
  display: flex;
  flex-direction: column;
  padding: 18px;
  border-right: 1px solid var(--line);
  background: #edf2f6;
}

.nav-item {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  margin-bottom: 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.nav-item.active,
.nav-item:hover {
  background: #ffffff;
  border-color: var(--line);
}

.workspace {
  padding: 26px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.compact {
  margin-top: 14px;
  align-items: start;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 13px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #c8d1dc;
  border-radius: 6px;
  padding: 10px 11px;
  color: var(--ink);
  background: #ffffff;
}

textarea {
  resize: vertical;
}

button {
  border: 0;
  border-radius: 6px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 700;
}

.primary {
  background: var(--brand);
  color: #ffffff;
}

.primary:hover {
  background: var(--brand-dark);
}

.secondary {
  background: #e6eef2;
  color: var(--brand-dark);
}

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

.actions.wrap {
  flex-wrap: wrap;
}

.import-button {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  margin: 0;
  border-radius: 6px;
  padding: 10px 14px;
  background: #e6eef2;
  color: var(--brand-dark);
  font-weight: 800;
  cursor: pointer;
}

.import-button input {
  display: none;
}

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

.upload-row input {
  grid-column: 1 / -1;
}

.stack {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 0;
  list-style: none;
}

.proposal-section,
.meeting-context-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin-top: 14px;
  background: #f8fafc;
}

.proposal-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  font-weight: 800;
  margin-bottom: 10px;
}

.role-hint,
.topic-count {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.proposal-input-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, 220px) auto;
  gap: 8px;
  align-items: center;
}

.proposal-list {
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.proposal-item,
.compact-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.compact-list li {
  grid-template-columns: minmax(0, 1fr) auto;
}

.user-table {
  display: grid;
  gap: 10px;
}

.user-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
}

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

.item,
.card,
.blog-post {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #ffffff;
  text-align: left;
}

details.card summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  list-style: none;
}

details.card summary::-webkit-details-marker {
  display: none;
}

details.card[open] {
  grid-column: span 2;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.meeting-item {
  width: 100%;
}

.meeting-item.selected {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(35, 95, 158, 0.12);
}

.item-title {
  font-weight: 800;
  margin-bottom: 5px;
}

.meta {
  font-size: 13px;
}

.approved-summary {
  color: var(--ink);
  margin-top: 8px;
  white-space: pre-wrap;
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef4f5;
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 800;
  margin-top: 9px;
}

.badge.sensitive {
  background: #fff0e3;
  color: var(--warn);
}

.badge.ok,
.status-line.ok {
  background: #e7f4ed;
  color: var(--ok);
}

.badge.danger,
.status-line.danger {
  background: #f8e8e8;
  color: var(--danger);
}

.example {
  color: #7b8795;
  background: #f2f4f7;
  animation: demoPulse 1.8s ease-in-out infinite;
}

@keyframes demoPulse {
  0%,
  100% {
    opacity: 0.42;
  }
  50% {
    opacity: 0.78;
  }
}

.topic-form,
.question-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 14px;
  margin-bottom: 16px;
}

.topic-form .wide {
  grid-column: 1 / -1;
}

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

.question-form label:first-child {
  grid-column: 1 / -1;
}

.blog-list {
  display: grid;
  gap: 14px;
}

.blog-post h3 {
  margin-bottom: 10px;
}

.blog-post p + p {
  margin-top: 10px;
}

.status-line {
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-radius: 6px;
  background: #f1f5f8;
  color: var(--muted);
  margin-bottom: 12px;
}

#summaryText {
  min-height: 280px;
}

#toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 30;
  max-width: 380px;
  padding: 12px 14px;
  background: var(--ink);
  color: #ffffff;
  border-radius: 8px;
  opacity: 0;
  transform: translateY(10px);
  transition: 180ms ease;
  pointer-events: none;
}

#toast.show {
  opacity: 1;
  transform: translateY(0);
}

.powered-by {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
  padding: 10px 6px 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.powered-by img {
  width: 112px;
  height: auto;
}

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

  .sidebar {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .powered-by {
    min-width: 190px;
    margin-top: 0;
    padding: 8px 4px;
  }

  .nav-item {
    min-width: 170px;
  }

  .grid.two,
  .cards,
  .topic-form,
  .question-form,
  .proposal-input-grid,
  .proposal-item,
  .compact-list li {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .topbar,
  .section-heading,
  .upload-row,
  .actions,
  .role-switcher,
  .brand,
  .user-row {
    align-items: stretch;
    flex-direction: column;
    grid-template-columns: 1fr;
  }

  .workspace {
    padding: 18px;
  }

  .brand img {
    width: 132px;
  }
}
