:root {
  --ink: #111;
  --muted: #656565;
  --line: rgba(17, 17, 17, 0.14);
  --line-strong: rgba(17, 17, 17, 0.32);
  --paper: #f7f7f4;
  --panel: rgba(255, 255, 255, 0.92);
  --panel-soft: #f4f1eb;
  --accent: #0b5d6b;
  --accent-soft: #e4f1f3;
  --warn: #8f3b1b;
  --shadow-soft: 0 18px 60px rgba(17, 17, 17, 0.07);
  --shadow-tight: 0 8px 24px rgba(17, 17, 17, 0.06);
  --radius: 6px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

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

button {
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #fff;
  min-height: 40px;
  padding: 0 16px;
  cursor: pointer;
  border-radius: var(--radius);
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

button.secondary,
.portal-nav button {
  background: transparent;
  color: var(--ink);
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
  padding: 0 16px;
  text-decoration: none;
}

button.active,
.portal-nav button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.portal-nav button:hover:not(.active) {
  background: rgba(11, 93, 107, 0.08);
  border-color: rgba(11, 93, 107, 0.28);
  color: var(--accent);
}

button:hover {
  box-shadow: var(--shadow-tight);
}

button:active {
  transform: translateY(1px);
}

.portal-app {
  min-height: 100vh;
}

.portal-login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(320px, 420px);
  gap: 32px;
  align-items: center;
  padding: clamp(24px, 6vw, 80px);
}

.login-copy h1 {
  max-width: 720px;
  font-size: clamp(2.2rem, 6vw, 5.8rem);
  line-height: 0.95;
  letter-spacing: 0;
  margin: 0 0 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  font-weight: 700;
}

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

.portal-sidebar {
  border-right: 1px solid var(--line);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 26px;
  position: sticky;
  top: 0;
  height: 100vh;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.45), transparent 220px),
    var(--panel-soft);
}

.portal-sidebar h2 {
  margin: 0;
  font-size: 1.24rem;
  line-height: 1.12;
}

.portal-nav {
  display: grid;
  gap: 9px;
}

.portal-nav button {
  text-align: left;
  width: 100%;
  min-height: 44px;
  border-color: var(--line-strong);
  padding-inline: 18px;
}

.mobile-nav-toggle {
  display: none;
}

.portal-main {
  width: min(100%, 1780px);
  padding: 28px clamp(22px, 3vw, 40px) 56px;
  min-width: 0;
}

.portal-topbar {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 28px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 24px;
  margin-bottom: 22px;
}

.portal-topbar h1 {
  margin: 0;
  font-size: clamp(2rem, 3.8vw, 3.25rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.page-subtitle {
  max-width: 680px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.45;
}

.topbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: min(100%, 520px);
}

.topbar-actions input,
.topbar-actions select {
  width: 100%;
}

input,
textarea,
select {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  min-height: 44px;
  padding: 10px 12px;
  width: 100%;
  border-radius: var(--radius);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(11, 93, 107, 0.12);
  outline: 0;
}

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

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.9rem;
}

.portal-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-tight);
  padding: 18px;
}

.portal-panel h2,
.panel-heading h2 {
  margin: 0 0 14px;
  font-size: 1rem;
}

.login-form,
.invite-form,
.help-form,
.compact-form {
  display: grid;
  gap: 12px;
}

.auth-panel-wrap {
  width: 100%;
}

.auth-actions {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 8px;
  margin-top: 4px;
  padding-top: 12px;
}

.link-button {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
  text-align: center;
  box-shadow: none;
}

.link-button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.help-copy {
  color: var(--muted);
  margin: 0;
}

.portal-view {
  display: none;
}

.portal-view.active {
  display: block;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.metric {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-tight);
  padding: 18px;
  position: relative;
  overflow: hidden;
}

.metric::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--accent);
}

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

.metric strong {
  display: block;
  margin-top: 10px;
  font-size: 2.15rem;
  line-height: 1;
}

.executive-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.executive-card {
  display: grid;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.78)),
    var(--panel);
  box-shadow: var(--shadow-tight);
  padding: 16px;
}

.executive-card span,
.executive-card small,
.source-pill,
.status-badge,
.type-badge {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.executive-card strong {
  font-size: 1.05rem;
}

.executive-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.next-steps-panel {
  margin-bottom: 18px;
}

.next-steps-list {
  display: grid;
  gap: 10px;
}

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

.next-step p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.4;
}

.empty-state {
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 180px;
  gap: 8px;
  color: var(--muted);
  text-align: center;
  padding: 20px;
}

.empty-state strong {
  color: var(--ink);
}

.empty-state p {
  max-width: 460px;
  margin: 0;
  line-height: 1.45;
}

.two-column,
.split-tools {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.4fr);
  gap: 16px;
  align-items: start;
}

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

.access-panel {
  display: grid;
  gap: 16px;
  margin: 16px 0;
}

.access-panel .panel-heading p {
  color: var(--muted);
  margin: -8px 0 0;
}

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

.access-grid form,
.access-summary-column {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 14px;
}

.access-grid h3,
.access-summary-column h3 {
  font-size: 0.9rem;
  margin: 0 0 10px;
}

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

.access-summary-column {
  display: grid;
  gap: 10px;
}

.access-summary-column article {
  display: grid;
  gap: 6px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.access-summary-column article:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.access-summary-column span {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.knowledge-library {
  display: grid;
  gap: 12px;
}

.knowledge-commandbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-tight);
  padding: 16px 18px;
}

.knowledge-commandbar h2 {
  margin: 0;
  font-size: 1.1rem;
}

.knowledge-table {
  display: grid;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-tight);
  overflow: hidden;
}

.knowledge-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(180px, 0.4fr) minmax(130px, 0.25fr);
  gap: 12px;
  align-items: center;
  min-height: 48px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
}

.knowledge-row:last-child {
  border-bottom: 0;
}

.knowledge-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.knowledge-row strong {
  display: block;
}

.source-pill,
.status-badge,
.type-badge {
  display: inline-flex;
  align-items: center;
  width: max-content;
  min-height: 24px;
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-soft);
  padding: 0 8px;
}

.scout-source {
  border-color: rgba(11, 93, 107, 0.28);
  background: var(--accent-soft);
  color: var(--accent);
}

.status-badge {
  background: #fff;
}

.type-badge {
  background: var(--panel-soft);
}

.knowledge-item {
  width: 100%;
  border-top: 0;
  border-right: 0;
  border-left: 0;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.knowledge-item:hover,
.knowledge-item:focus-visible {
  background: var(--accent-soft);
  color: var(--ink);
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.knowledge-header {
  min-height: 38px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.knowledge-empty {
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 260px;
  gap: 6px;
  color: var(--muted);
  text-align: center;
}

.knowledge-empty strong {
  color: var(--ink);
}

.knowledge-empty p {
  margin: 0;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(17, 17, 17, 0.42);
  backdrop-filter: blur(4px);
}

.walkthrough {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
}

.walkthrough-scrim {
  position: absolute;
  inset: 0;
  background: rgba(17, 17, 17, 0.62);
  pointer-events: auto;
}

.walkthrough-highlight {
  position: fixed;
  top: var(--walkthrough-top, 24px);
  left: var(--walkthrough-left, 24px);
  width: var(--walkthrough-width, 160px);
  height: var(--walkthrough-height, 80px);
  border: 3px solid #fff;
  border-radius: 8px;
  box-shadow:
    0 0 0 4px rgba(11, 93, 107, 0.72),
    0 18px 60px rgba(0, 0, 0, 0.32);
  pointer-events: none;
  transition: top 180ms ease, left 180ms ease, width 180ms ease, height 180ms ease;
}

.walkthrough-card {
  position: fixed;
  display: grid;
  gap: 10px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.28);
  padding: 16px;
  pointer-events: auto;
}

.walkthrough-card h2 {
  margin: 0;
  font-size: 1.08rem;
}

.walkthrough-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.walkthrough-card footer {
  display: flex;
  justify-content: end;
  gap: 8px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.walkthrough-progress {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.walkthrough-target {
  position: relative;
  z-index: 91;
}

.knowledge-modal {
  width: min(720px, 100%);
  max-height: min(820px, calc(100vh - 48px));
  overflow: auto;
  display: grid;
  gap: 14px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 28px 90px rgba(17, 17, 17, 0.22);
  padding: 18px;
}

.knowledge-modal header,
.knowledge-modal footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.knowledge-modal h2 {
  margin: 0;
  font-size: 1.1rem;
}

.knowledge-modal footer {
  justify-content: end;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.knowledge-fields {
  display: grid;
  gap: 12px;
}

.knowledge-detail-modal {
  width: min(780px, 100%);
}

.detail-date {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.knowledge-detail-fields {
  display: grid;
  gap: 12px;
}

.knowledge-detail-field {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.knowledge-detail-field h3 {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.knowledge-detail-field p {
  margin: 0;
  line-height: 1.55;
  white-space: pre-wrap;
}

.project-workspace,
.project-dashboard {
  display: grid;
  gap: 16px;
}

.project-commandbar {
  display: grid;
  grid-template-columns: minmax(260px, 420px) auto;
  gap: 12px;
  align-items: end;
  justify-content: start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-tight);
  padding: 16px 18px;
}

.project-summary {
  min-height: 0;
}

.project-overview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.9fr);
  gap: 18px;
  align-items: start;
  box-shadow: var(--shadow-tight);
}

.project-overview h2 {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2.6rem);
}

.project-overview p,
.project-empty p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.project-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 8px;
}

.project-section {
  width: 100%;
}

.project-section [data-project-list] {
  display: grid;
  gap: 10px;
}

.project-row {
  display: grid;
  grid-template-columns: minmax(260px, 0.36fr) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 14px;
}

.project-record-button {
  width: 100%;
  min-height: 0;
  color: var(--ink);
  text-align: left;
  box-shadow: none;
}

.project-record-button:hover,
.project-record-button:focus-visible {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--ink);
  outline: 0;
}

.project-row strong {
  display: block;
}

.project-row span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.84rem;
}

.project-row p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.project-scout {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 40;
  width: min(440px, calc(100vw - 32px));
  max-height: min(720px, calc(100vh - 44px));
  display: grid;
  grid-template-rows: auto minmax(180px, 1fr) auto;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.18);
}

.project-scout header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  border-bottom: 1px solid var(--line);
  padding: 14px;
}

.project-scout h2 {
  margin: 0;
  font-size: 1rem;
}

.project-scout-log {
  display: grid;
  align-content: start;
  gap: 10px;
  overflow: auto;
  padding: 14px;
}

.scout-bubble {
  max-width: 92%;
  border: 1px solid var(--line);
  padding: 10px;
  white-space: pre-wrap;
  line-height: 1.45;
}

.scout-bubble.assistant {
  background: #f4f1eb;
}

.scout-bubble.user {
  justify-self: end;
  background: var(--accent-soft);
}

.project-scout-form {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding: 14px;
}

.project-scout-form textarea {
  min-height: 90px;
}

.project-scout-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.work-workspace {
  display: grid;
  gap: 14px;
}

.work-commandbar {
  display: grid;
  grid-template-columns: auto minmax(220px, 360px) auto;
  gap: 12px;
  align-items: end;
  justify-content: start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-tight);
  padding: 16px;
}

.work-tabs {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.work-tab-panel {
  display: none;
}

.work-tab-panel.active {
  display: block;
}

.task-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(220px, 1fr));
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.task-column {
  min-width: 220px;
  min-height: 520px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.7);
  overflow: hidden;
  box-shadow: var(--shadow-tight);
}

.task-column.drag-over {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.task-column header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  min-height: 44px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-soft);
  padding: 12px;
}

.task-column h2 {
  margin: 0;
  font-size: 0.95rem;
}

.task-column header span {
  color: var(--muted);
  font-size: 0.85rem;
}

.task-column-list {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 8px;
}

.task-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 8px 20px rgba(17, 17, 17, 0.045);
  padding: 12px;
  color: var(--ink);
  text-align: left;
}

.task-card.movable {
  cursor: grab;
}

.task-card:hover,
.task-card:focus-visible {
  border-color: var(--accent);
  box-shadow: var(--shadow-tight);
  outline: 0;
}

.task-card.movable:active {
  cursor: grabbing;
}

.task-card-heading {
  display: grid;
  gap: 8px;
}

.task-card-heading strong {
  overflow-wrap: anywhere;
}

.task-card dl,
.task-card section b {
  color: var(--muted);
  font-size: 0.78rem;
}

.task-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.task-card p {
  margin: 0;
  line-height: 1.45;
}

.task-card dl {
  display: grid;
  gap: 4px;
  margin: 0;
}

.task-card dl div {
  display: flex;
  gap: 6px;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding-top: 4px;
}

.task-card dt,
.task-card dd {
  margin: 0;
}

.task-card dd {
  color: var(--ink);
  text-align: right;
}

.task-form-button {
  justify-self: start;
  min-height: 36px;
  padding: 8px 12px;
}

.task-complete-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  border: 1px solid rgba(46, 125, 50, 0.25);
  border-radius: 999px;
  background: rgba(46, 125, 50, 0.08);
  color: #2e7d32;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 5px 9px;
}

.task-complete-note::before {
  content: "✓";
  font-weight: 900;
}

.task-answer-modal small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

.story-list {
  display: grid;
  gap: 10px;
}

.story-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-tight);
  overflow: hidden;
}

.story-item summary {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  cursor: pointer;
  padding: 12px;
}

.story-item summary strong,
.story-item summary small {
  display: block;
}

.story-item summary small,
.story-item summary > span:last-child {
  color: var(--muted);
  font-size: 0.82rem;
}

.story-item > p,
.story-item > section {
  margin: 0;
  border-top: 1px solid var(--line);
  padding: 12px;
  line-height: 1.5;
}

.story-task-list {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding: 12px;
}

.story-task-list button {
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  text-align: left;
  padding: 10px;
}

.story-task-list span {
  color: var(--muted);
  font-size: 0.82rem;
}

.story-task-list button:hover,
.story-task-list button:focus-visible {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--ink);
  outline: 0;
}

.column-empty {
  min-height: 84px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  margin: 0;
}

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

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

.support-workspace {
  display: grid;
  gap: 16px;
}

.support-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(320px, 1.2fr);
  gap: 16px;
  align-items: start;
}

.meeting-scheduler {
  display: grid;
  gap: 12px;
}

.panel-heading p {
  margin: -8px 0 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

.slot-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}

.slot-button {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 52px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  border-color: var(--line-strong);
  box-shadow: none;
}

.slot-button small {
  color: var(--muted);
}

.slot-button.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.slot-button.active small {
  color: #fff;
}

.slot-button.unavailable,
.slot-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.upcoming-list,
.support-timeline {
  display: grid;
  gap: 10px;
}

.timeline-group {
  display: grid;
  gap: 10px;
}

.timeline-group h3 {
  margin: 8px 0 0;
  color: var(--accent);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.timeline-card {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 12px;
}

.timeline-card span {
  color: var(--muted);
  font-size: 0.82rem;
}

.timeline-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.meeting-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 6px;
}

.meeting-scout-modal {
  width: min(920px, 100%);
}

.meeting-scout-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.meeting-scout-grid section,
.meeting-response-log,
.meeting-transcript-form {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 12px;
}

.meeting-scout-grid h3 {
  margin: 0;
  font-size: 0.92rem;
}

.meeting-response-log h3 {
  margin: 0;
  font-size: 0.92rem;
}

.meeting-artifact {
  color: var(--muted);
  line-height: 1.5;
  white-space: normal;
}

.meeting-response-item {
  display: grid;
  gap: 4px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.meeting-response-item:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.meeting-response-item span {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.meeting-response-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.meeting-response-item.stopped p {
  color: var(--warn);
}

.meeting-transcript-form footer {
  border-top: 0;
  padding-top: 0;
}

.document-library {
  display: grid;
  gap: 12px;
}

.library-commandbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-tight);
  padding: 12px;
}

.library-actions,
.folder-create-form,
.library-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.folder-create-form {
  min-width: min(100%, 420px);
}

.folder-create-form input {
  width: min(52vw, 260px);
}

.library-breadcrumbs {
  color: var(--muted);
  font-size: 0.9rem;
}

.document-location {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-tight);
  padding: 14px 16px;
}

.document-location h2 {
  margin: 0;
  font-size: 1.1rem;
}

.breadcrumb-button {
  min-height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
}

.document-upload-requests {
  display: grid;
  gap: 12px;
}

.upload-request-panel {
  display: grid;
  gap: 12px;
  background: rgba(11, 93, 107, 0.04);
}

.upload-request-list,
.task-upload-list {
  display: grid;
  gap: 10px;
}

.upload-request-row,
.task-upload-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 12px;
}

.upload-request-row p,
.task-upload-item p {
  margin: 4px 0;
  color: var(--muted);
  line-height: 1.45;
}

.upload-request-row small {
  color: var(--muted);
}

.task-upload-item.complete {
  border-color: rgba(46, 125, 50, 0.28);
  background: rgba(46, 125, 50, 0.06);
}

.upload-file-picker {
  display: inline-grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.85rem;
}

.upload-file-picker input {
  max-width: 260px;
}

.library-dropzone {
  min-height: 420px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-tight);
  overflow: hidden;
}

.library-dropzone.drag-over {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.library-table {
  display: grid;
}

.library-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(120px, 0.4fr) minmax(130px, 0.35fr) minmax(80px, 0.25fr);
  gap: 12px;
  align-items: center;
  min-height: 46px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}

.library-header {
  min-height: 38px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.library-item {
  width: 100%;
  border-top: 0;
  border-right: 0;
  border-left: 0;
  background: #fff;
  text-align: left;
}

.library-item:hover,
.library-item.drag-over {
  background: var(--accent-soft);
}

.library-item span:first-child {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.file-icon {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--accent);
  background: var(--accent-soft);
}

.folder-icon::before {
  content: "";
  width: 17px;
  height: 12px;
  border: 2px solid currentColor;
  border-top-width: 5px;
  border-radius: 2px;
  transform: translateY(1px);
}

.document-icon::before {
  content: "";
  width: 14px;
  height: 18px;
  border: 2px solid currentColor;
  border-radius: 2px;
  background: linear-gradient(135deg, transparent 0 70%, currentColor 71% 84%, transparent 85%);
}

.record-list,
.timeline,
.tour-list {
  display: grid;
  gap: 10px;
}

.record-row,
.timeline article,
.tour-step,
.client-row {
  display: grid;
  gap: 4px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  padding: 12px;
}

.record-row span,
.timeline span,
.tour-step > span,
.client-row span {
  color: var(--muted);
  font-size: 0.82rem;
}

.record-row p,
.timeline p,
.tour-step p {
  color: var(--muted);
  margin: 0;
}

.tour-panel {
  margin-bottom: 18px;
}

.tour-step {
  grid-template-columns: 44px minmax(0, 1fr);
}

.tour-step.completed {
  border-color: rgba(46, 125, 50, 0.28);
  background: rgba(46, 125, 50, 0.06);
}

.tour-step > span {
  color: var(--accent);
  font-weight: 800;
}

.tour-step.completed > span {
  color: #2e7d32;
}

.tour-step p {
  margin: 4px 0 10px;
}

.tour-step button:disabled {
  cursor: default;
  opacity: 0.78;
}

.tour-check {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #2e7d32;
  color: #fff;
  font-weight: 900;
}

.tour-complete {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border: 1px solid rgba(46, 125, 50, 0.28);
  border-radius: var(--radius);
  background: rgba(46, 125, 50, 0.07);
  padding: 16px;
}

.tour-complete p {
  margin: 4px 0 0;
  color: var(--muted);
}

.form-status,
.portal-notice,
.empty {
  color: var(--muted);
}

.portal-notice.error,
.form-status {
  color: var(--warn);
}

.portal-notice:not(:empty) {
  display: inline-block;
  margin: -8px 0 12px;
  border: 1px solid rgba(11, 93, 107, 0.2);
  border-radius: var(--radius);
  background: rgba(11, 93, 107, 0.06);
  padding: 8px 10px;
}

.portal-notice.error:not(:empty) {
  border-color: rgba(143, 59, 27, 0.22);
  background: rgba(143, 59, 27, 0.06);
}

.portal-notice.loading:not(:empty)::before {
  content: "";
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 8px;
  border: 2px solid rgba(11, 93, 107, 0.25);
  border-top-color: var(--accent);
  border-radius: 999px;
  animation: portal-spin 700ms linear infinite;
}

.toast-region {
  position: fixed;
  right: 24px;
  top: 24px;
  z-index: 80;
  display: grid;
  gap: 8px;
  pointer-events: none;
}

.toast {
  border: 1px solid rgba(11, 93, 107, 0.28);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow-soft);
  padding: 12px 14px;
}

button[data-admin-only]:not([hidden]) {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

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

.ai-output {
  white-space: pre-wrap;
  margin: 0;
  color: var(--ink);
}

.inline-check {
  display: flex;
  align-items: center;
  gap: 8px;
}

.inline-check input {
  width: auto;
  min-height: auto;
}

[data-invite-output] {
  min-height: 70px;
}

@media (max-width: 900px) {
  .portal-login,
  .portal-shell,
  .two-column,
  .split-tools,
  .executive-grid,
  .project-overview,
  .project-commandbar,
  .work-commandbar,
  .task-form-grid,
  .meeting-scout-grid,
  .support-grid,
  .project-row,
  .knowledge-row {
    grid-template-columns: 1fr;
  }

  .portal-sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 18px;
    gap: 14px;
  }

  .mobile-nav-toggle {
    display: block;
  }

  .portal-nav {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    max-height: 0;
    overflow: hidden;
    transition: max-height 180ms ease;
  }

  .portal-sidebar.open .portal-nav {
    max-height: 440px;
  }

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

  .topbar-actions {
    flex-direction: column;
    min-width: 0;
  }

  .portal-main {
    padding-inline: 16px;
  }

  .next-step,
  .document-location {
    align-items: stretch;
    flex-direction: column;
  }

  .knowledge-commandbar,
  .knowledge-modal header,
  .knowledge-modal footer {
    align-items: stretch;
    flex-direction: column;
  }

  .knowledge-header {
    display: none;
  }

  .library-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 3px;
    align-items: start;
    padding: 10px 12px;
  }

  .library-header {
    display: none;
  }

  .folder-create-form,
  .folder-create-form input {
    width: 100%;
  }

  .toast-region {
    inset: auto 16px 16px;
  }

  .walkthrough-card {
    position: fixed;
    right: 16px;
    bottom: 16px;
    left: 16px !important;
    top: auto !important;
    width: auto !important;
  }

  .walkthrough-card footer {
    justify-content: stretch;
    flex-wrap: wrap;
  }

  .project-scout {
    right: 12px;
    bottom: 12px;
    width: calc(100vw - 24px);
  }

  .task-board {
    grid-template-columns: repeat(5, minmax(240px, 80vw));
  }
}
