:root {
  color-scheme: dark;
  --bg: #070b13;
  --surface: #0f1725;
  --surface-soft: #151f31;
  --text: #e7edf7;
  --muted: #9aa7ba;
  --line: #263348;
  --line-strong: #3a4961;
  --primary: #2563eb;
  --primary-strong: #bfdbfe;
  --green: #64d994;
  --green-soft: rgba(34, 197, 94, 0.16);
  --amber: #f6c96f;
  --amber-soft: rgba(245, 158, 11, 0.16);
  --red: #fb8b86;
  --red-soft: rgba(239, 68, 68, 0.16);
  --blue-soft: rgba(96, 165, 250, 0.16);
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.38);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  overflow: hidden;
  background:
    radial-gradient(circle at top left, rgba(120, 167, 255, 0.12), transparent 30vw),
    var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
}

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

button,
a,
select {
  cursor: pointer;
}

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

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  height: 100vh;
  border-right: 1px solid var(--line);
  background: var(--surface);
  padding: 22px 16px;
}

.side-brand {
  display: grid;
  gap: 2px;
  padding: 0 6px 8px;
}

.side-brand h1 {
  font-size: 22px;
}

.side-nav {
  display: grid;
  gap: 6px;
}

.side-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  padding: 0 10px;
  font-weight: 760;
  text-align: left;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.side-tab svg {
  width: 18px;
  height: 18px;
}

.side-tab:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.side-tab.active {
  border-color: rgba(120, 167, 255, 0.58);
  background: var(--blue-soft);
  color: var(--primary-strong);
}

.side-link {
  margin-top: auto;
  width: 100%;
}

.side-theme-toggle {
  width: 100%;
}

.content-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  padding: 24px;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1 {
  font-size: 28px;
  font-weight: 760;
  letter-spacing: 0;
}

h2 {
  font-size: 16px;
  font-weight: 720;
}

h3 {
  font-size: 14px;
  font-weight: 720;
}

.ghost-button,
.icon-button,
.action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    color 160ms ease;
}

.ghost-button {
  padding: 0 12px;
  font-weight: 650;
}

.icon-button {
  width: 38px;
  padding: 0;
}

.icon-button.small {
  width: 32px;
  min-height: 32px;
}

.ghost-button:hover,
.icon-button:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.ghost-button:focus-visible,
.icon-button:focus-visible,
.action-button:focus-visible,
.filter-chip:focus-visible,
.mini-button:focus-visible,
.side-tab:focus-visible,
.queue-item:focus-visible,
.meeting-card:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(120, 167, 255, 0.48);
  outline-offset: 2px;
}

.ghost-button svg,
.icon-button svg,
.action-button svg,
.search-box svg {
  width: 17px;
  height: 17px;
  stroke-width: 2;
}

.summary-bar {
  display: none;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0 auto 16px;
  max-width: 1440px;
}

.summary-item {
  min-height: 70px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 12px 14px;
}

.summary-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.summary-item strong {
  display: block;
  margin-top: 2px;
  font-size: 25px;
  line-height: 1.1;
}

.review-filters {
  display: flex;
  gap: 6px;
  margin: 0 auto 12px;
  max-width: 1440px;
  overflow-x: auto;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  font-weight: 750;
  white-space: nowrap;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
  padding: 0 12px;
  font-size: 13px;
}

.filter-chip:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.filter-chip.active {
  border-color: rgba(120, 167, 255, 0.58);
  background: var(--blue-soft);
  color: var(--primary-strong);
}

.screen {
  display: none;
  margin: 0 auto;
  max-width: 1440px;
  min-height: 0;
  width: 100%;
}

.screen.active {
  display: block;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

#reviewScreen.active {
  display: flex;
  flex-direction: column;
}

#projectsScreen.active,
#meetingsScreen.active,
#tasksScreen.active {
  height: 100%;
}

.review-layout {
  position: relative;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  margin: 0 auto;
  max-width: 1440px;
  min-height: 0;
  overflow: hidden;
  width: 100%;
}

.project-layout {
  display: grid;
  grid-template-columns: minmax(330px, 430px) minmax(0, 1fr);
  gap: 16px;
  min-height: calc(100vh - 210px);
}

.meeting-layout {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  width: 100%;
}

.review-layout.detail-open,
.meeting-layout.detail-open {
  grid-template-columns: minmax(0, 1fr) minmax(400px, 520px);
}

.queue-panel,
.timeline-panel,
.detail-panel,
.panel-block {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.queue-panel {
  grid-column: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.timeline-panel {
  grid-column: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.panel-block {
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.panel-head p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.select-wrap {
  display: grid;
  gap: 5px;
  min-width: 132px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.select-wrap select,
.form-field select,
.form-field input,
.form-field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}

.form-field input::placeholder,
.form-field textarea::placeholder,
.search-box input::placeholder {
  color: #7f8da2;
}

.form-field select option,
.form-field select optgroup,
.select-wrap select option {
  background: var(--surface);
  color: var(--text);
}

.select-wrap select {
  height: 36px;
  padding: 0 10px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--muted);
}

.search-box.compact {
  margin: 0;
  min-width: min(340px, 100%);
}

.search-box input {
  width: 100%;
  height: 38px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.queue-list {
  display: grid;
  align-content: start;
  flex: 1;
  gap: 6px;
  min-height: 0;
  padding: 0 12px 12px;
  overflow: auto;
}

.bulk-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 12px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 9px 10px;
}

.bulk-bar .pagination-bar {
  flex: 1 1 100%;
}

.select-all,
.select-line {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.select-all input,
.select-line input {
  width: 15px;
  height: 15px;
  accent-color: var(--primary);
}

.bulk-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

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

.mini-button {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  padding: 0 9px;
  font-size: 12px;
  font-weight: 760;
}

.mini-button.primary {
  border-color: var(--primary);
  background: var(--primary);
  color: #ffffff;
}

.mini-button.danger {
  border-color: rgba(251, 139, 134, 0.4);
  background: var(--red-soft);
  color: var(--red);
}

.mini-button:disabled {
  cursor: default;
  opacity: 0.52;
}

.queue-item {
  width: 100%;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  padding: 11px 12px;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background-color 160ms ease;
}

.queue-item.selectable {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
}

.queue-item-main {
  min-width: 0;
}

.queue-item:hover {
  background: var(--surface-soft);
}

.queue-item.active {
  border-color: rgba(120, 167, 255, 0.58);
  background: var(--blue-soft);
}

.queue-item.final {
  opacity: 0.68;
}

.queue-item.final .select-line {
  cursor: default;
}

.meeting-timeline {
  display: grid;
  align-content: start;
  flex: 1;
  gap: 18px;
  min-height: 0;
  overflow: auto;
  padding: 0 14px 16px;
}

.queue-list > .meeting-timeline {
  flex: none;
  max-height: none;
  overflow: visible;
  padding: 0;
}

.meeting-timeline.compact {
  gap: 14px;
  padding-top: 2px;
}

.timeline-context {
  display: grid;
  gap: 10px;
  background: transparent;
  padding: 0;
}

.timeline-context-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 520;
}

.timeline-context-head strong {
  flex: 0 1 auto;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 560;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-context-head::after,
.project-context-head::after,
.week-heading::after,
.day-heading::after {
  flex: 1 1 auto;
  min-width: 28px;
  height: 1px;
  background: var(--line);
  content: "";
}

.timeline-context-head::after,
.project-context-head::after {
  order: 1;
}

.timeline-context-head > span:last-child,
.project-context-head > span:last-child {
  order: 2;
  flex: 0 0 auto;
  min-height: 24px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
  padding: 0 10px;
  font-weight: 500;
  line-height: 24px;
}

.project-context {
  display: grid;
  gap: 8px;
  padding-left: 18px;
  border-left: 1px solid var(--line);
}

.project-context-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 520;
}

.project-context-head span:first-child {
  flex: 0 1 auto;
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 6px;
  color: var(--primary-strong);
  font-weight: 560;
}

.project-context-head svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}

.week-group {
  display: grid;
  align-content: start;
  gap: 12px;
}

.week-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 520;
}

.week-heading span:first-child {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--primary-strong);
  padding: 0 12px;
  font-weight: 650;
}

.week-heading::after {
  order: 1;
}

.week-heading span:last-child {
  order: 2;
  flex: 0 0 auto;
  min-height: 24px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
  padding: 0 10px;
  font-weight: 500;
  line-height: 24px;
}

.week-heading svg {
  width: 16px;
  height: 16px;
}

.day-group {
  position: relative;
  display: grid;
  align-content: start;
  gap: 10px;
  padding-left: 30px;
}

.day-group::before {
  position: absolute;
  top: 14px;
  bottom: -16px;
  left: 9px;
  width: 2px;
  background: var(--line-strong);
  content: "";
}

.day-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 28px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.day-heading strong {
  color: var(--text);
  font-size: 15px;
  font-weight: 650;
}

.day-heading::after {
  order: 2;
}

.day-heading > span:last-child:not(.timeline-dot) {
  order: 3;
  flex: 0 0 auto;
  min-height: 24px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
  padding: 0 10px;
  font-weight: 500;
  line-height: 24px;
}

.timeline-dot {
  position: absolute;
  left: 1px;
  width: 18px;
  height: 18px;
  border: 4px solid var(--primary);
  border-radius: 999px;
  background: var(--surface);
}

.meeting-day-list {
  display: grid;
  gap: 8px;
}

.task-list {
  display: grid;
  gap: 8px;
  content-visibility: auto;
  contain-intrinsic-size: 900px;
}

.meeting-card {
  display: grid;
  grid-template-columns: 54px 42px minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 12px;
  color: inherit;
  cursor: pointer;
  text-align: left;
  transition:
    border-color 160ms ease,
    background-color 160ms ease;
}

.row-action-button {
  align-self: start;
  color: var(--muted);
}

.row-action-button:hover {
  color: var(--primary-strong);
}

.meeting-card.task-card {
  padding-left: calc(12px + (var(--task-depth, 0) * 16px));
}

.meeting-card:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.meeting-card.active {
  border-color: rgba(120, 167, 255, 0.58);
  background: var(--blue-soft);
}

.meeting-time {
  color: var(--muted);
  font-size: 13px;
  font-weight: 520;
  line-height: 38px;
  text-align: right;
}

.meeting-icon {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: var(--radius);
  background: var(--blue-soft);
  color: var(--primary-strong);
}

.meeting-icon svg {
  width: 18px;
  height: 18px;
}

.meeting-card-body {
  display: grid;
  gap: 7px;
  min-width: 0;
}

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

.meeting-card-head strong {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.meeting-task-preview {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.queue-title {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.queue-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  max-width: 100%;
  border-radius: 999px;
  padding: 0 8px;
  background: rgba(148, 163, 184, 0.16);
  color: #c7d2e2;
  font-size: 12px;
  font-weight: 520;
}

.pill.pending {
  background: var(--amber-soft);
  color: var(--amber);
}

.pill.confirmed {
  background: var(--green-soft);
  color: var(--green);
}

.pill.rejected {
  background: var(--red-soft);
  color: var(--red);
}

.pill.needs_info {
  background: var(--blue-soft);
  color: var(--primary-strong);
}

.detail-panel {
  grid-column: 2;
  display: none;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.detail-open .detail-panel {
  display: flex;
}

.detail-empty,
.loading-state {
  display: grid;
  min-height: 360px;
  place-items: center;
  padding: 32px;
  color: var(--muted);
  text-align: center;
}

.detail-header {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.detail-header p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.detail-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 18px;
}

.evidence-box {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 14px;
}

.stacked-section {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.compact-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

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

.section-title-row p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.compact-row strong {
  display: block;
  font-size: 14px;
  line-height: 1.35;
}

.evidence-box p {
  margin-top: 8px;
  white-space: pre-wrap;
}

.source-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.metric {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 12px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 3px;
  font-size: 22px;
}

.table-wrap {
  overflow: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th,
.data-table td {
  border-top: 1px solid var(--line);
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
}

.data-table th {
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.data-table td strong {
  display: block;
  line-height: 1.35;
}

.muted-line {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.empty-panel {
  display: grid;
  gap: 6px;
  min-height: 180px;
  align-content: center;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.empty-panel h3 {
  color: var(--text);
}

.review-form {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.mapping-box {
  display: grid;
  gap: 4px;
}

.mapping-box p {
  color: var(--muted);
  font-size: 13px;
}

.readiness-box {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.requirement {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
}

.requirement svg {
  width: 15px;
  height: 15px;
}

.requirement.ok {
  border-color: rgba(100, 217, 148, 0.36);
  background: var(--green-soft);
  color: var(--green);
}

.requirement.missing {
  border-color: rgba(246, 201, 111, 0.4);
  background: var(--amber-soft);
  color: var(--amber);
}

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

.form-field {
  display: grid;
  gap: 6px;
}

.form-field.full {
  grid-column: 1 / -1;
}

.form-field label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  text-transform: uppercase;
}

.field-hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.merge-target-list {
  display: grid;
  gap: 8px;
}

.merge-target-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 10px;
  cursor: pointer;
  transition:
    background-color 160ms ease,
    border-color 160ms ease;
}

.merge-target-card:hover,
.merge-target-card:has(input:checked) {
  border-color: rgba(120, 167, 255, 0.58);
  background: var(--blue-soft);
}

.merge-target-card input {
  width: 15px;
  height: 15px;
  accent-color: var(--primary);
}

.merge-target-card:has(input:disabled) {
  cursor: default;
  opacity: 0.7;
}

.merge-target-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.merge-target-main strong,
.merge-target-main span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.merge-target-main strong {
  color: var(--text);
  font-size: 13px;
}

.merge-target-main span,
.merge-target-empty {
  color: var(--muted);
  font-size: 12px;
}

.merge-target-empty {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 10px;
}

.form-field input,
.form-field select {
  height: 40px;
  padding: 0 11px;
}

.form-field textarea {
  min-height: 88px;
  resize: vertical;
  padding: 10px 11px;
}

.compact-form {
  margin-top: 0;
  margin-bottom: 14px;
}

.relationship-section {
  margin-top: 14px;
}

.detail-body > .relationship-section:first-child {
  margin-top: 0;
}

.relationship-title-row p {
  max-width: 32rem;
}

.relationship-overview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.relationship-stat {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 8px;
}

.relationship-stat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--primary-strong);
}

.relationship-stat-icon svg {
  width: 15px;
  height: 15px;
}

.relationship-stat span:last-child {
  display: grid;
  min-width: 0;
}

.relationship-stat strong,
.relationship-stat em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.relationship-stat strong {
  color: var(--text);
  font-size: 13px;
  font-style: normal;
  font-weight: 760;
}

.relationship-stat em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.relationship-editor,
.relationship-block {
  display: grid;
  gap: 12px;
}

.relationship-editor {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.relationship-block + .relationship-block {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.relationship-block-head {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.relationship-block-head h4 {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 760;
}

.relationship-block-head span:not(.relationship-icon) {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.relationship-inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
}

.relationship-form {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.relationship-form-grid {
  grid-template-columns: 1fr;
}

.relation-type-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.relation-choice {
  position: relative;
  display: block;
  min-width: 0;
  cursor: pointer;
}

.relation-choice input {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.relation-choice span {
  display: grid;
  gap: 2px;
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 8px 10px;
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    color 160ms ease;
}

.relation-choice strong {
  color: var(--text);
  font-size: 12px;
  font-weight: 760;
}

.relation-choice em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  line-height: 1.25;
}

.relation-choice:hover span {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.relation-choice input:focus-visible + span {
  outline: 2px solid rgba(120, 167, 255, 0.48);
  outline-offset: 2px;
}

.relation-choice input:checked + span {
  border-color: rgba(120, 167, 255, 0.58);
  background: var(--blue-soft);
  color: var(--primary-strong);
}

.relation-choice input:checked + span strong {
  color: var(--primary-strong);
}

.relationship-actions {
  padding-top: 0;
}

.relationship-lists,
.relationship-group {
  display: grid;
  gap: 8px;
}

.relationship-group {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.relationship-group h4 {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  text-transform: uppercase;
}

.relationship-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 8px 10px;
}

.relationship-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--primary-strong);
}

.relationship-icon svg {
  width: 15px;
  height: 15px;
}

.relationship-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.relationship-main strong,
.relationship-main span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.relationship-main strong {
  font-size: 13px;
}

.relationship-main span {
  color: var(--muted);
  font-size: 12px;
}

.raw-line {
  display: flex;
  align-items: center;
  min-height: 40px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 0 11px;
  color: var(--muted);
  font-size: 14px;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 4px;
}

.action-button {
  min-width: 112px;
  padding: 0 13px;
  font-weight: 720;
}

.action-button.primary {
  border-color: var(--primary);
  background: var(--primary);
  color: #ffffff;
}

.action-button.primary:hover {
  border-color: var(--primary-strong);
  background: var(--primary-strong);
}

.action-button.warning {
  border-color: rgba(246, 201, 111, 0.4);
  background: var(--amber-soft);
  color: var(--amber);
}

.action-button.danger {
  border-color: rgba(251, 139, 134, 0.4);
  background: var(--red-soft);
  color: var(--red);
}

.action-button:disabled,
.icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 10;
  max-width: min(420px, calc(100vw - 40px));
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #08111f;
  color: #ffffff;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

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

.toast.error {
  border-color: rgba(251, 139, 134, 0.5);
  background: #4f1418;
}

@media (max-width: 980px) {
  body {
    overflow: auto;
  }

  .app-shell {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .sidebar {
    position: static;
    flex-direction: row;
    align-items: center;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 14px 16px;
  }

  .side-brand {
    min-width: 132px;
    padding: 0;
  }

  .side-brand h1 {
    font-size: 18px;
  }

  .side-nav {
    display: flex;
    flex: 1;
    gap: 6px;
    overflow-x: auto;
  }

  .side-tab {
    flex: 0 0 auto;
    width: auto;
    padding: 0 12px;
    white-space: nowrap;
  }

  .side-link {
    flex: 0 0 auto;
    margin-top: 0;
    width: auto;
  }

  .content-shell {
    height: auto;
    overflow: visible;
    padding: 16px;
  }

  .screen.active {
    overflow: visible;
  }

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

  .review-layout,
  .review-layout.detail-open,
  .project-layout,
  .meeting-layout,
  .meeting-layout.detail-open {
    grid-template-columns: 1fr;
    gap: 12px;
    height: auto;
    min-height: auto;
    overflow: visible;
  }

  .detail-panel {
    grid-column: 1;
    height: auto;
    max-height: 75vh;
  }

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

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

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

  .queue-list {
    max-height: 60vh;
  }

  .meeting-timeline {
    max-height: 70vh;
  }
}

@media (max-width: 640px) {
  .sidebar {
    display: grid;
    grid-template-columns: 1fr;
  }

  .side-nav {
    width: 100%;
  }

  .side-link {
    display: none;
  }

  .panel-head,
  .detail-header {
    align-items: stretch;
    flex-direction: column;
  }

  .form-actions {
    justify-content: stretch;
  }

  .ghost-button,
  .action-button {
    flex: 1;
  }

  .summary-bar,
  .form-grid,
  .metric-grid,
  .readiness-box {
    grid-template-columns: 1fr;
  }

  .meeting-card {
    grid-template-columns: 40px 40px minmax(0, 1fr) auto;
  }

  .meeting-card.task-card {
    padding-left: 12px;
  }

  .relationship-overview,
  .relation-type-grid,
  .relationship-inline-form {
    grid-template-columns: 1fr;
  }

  .relationship-row {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .relationship-row .pill,
  .relationship-row .icon-button {
    justify-self: start;
  }

  .meeting-time {
    display: none;
  }

  .select-wrap {
    min-width: 0;
  }
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-soft: #f9fafb;
  --text: #18202f;
  --muted: #647084;
  --line: #d8dee8;
  --line-strong: #c4ccd9;
  --primary: #2563eb;
  --primary-strong: #1d4ed8;
  --green: #16803f;
  --green-soft: #e8f5ed;
  --amber: #a16207;
  --amber-soft: #fff3d6;
  --red: #b42318;
  --red-soft: #fff0ed;
  --blue-soft: #eaf1ff;
  --shadow: 0 16px 40px rgba(24, 32, 47, 0.08);
}

:root[data-theme="light"] body {
  background: var(--bg);
}

:root[data-theme="light"] .pill {
  background: #edf0f5;
  color: #4b5565;
}

:root[data-theme="light"] .pill.pending {
  background: var(--amber-soft);
  color: var(--amber);
}

:root[data-theme="light"] .pill.confirmed {
  background: var(--green-soft);
  color: var(--green);
}

:root[data-theme="light"] .pill.rejected {
  background: var(--red-soft);
  color: var(--red);
}

:root[data-theme="light"] .pill.needs_info,
:root[data-theme="light"] .week-heading span:first-child,
:root[data-theme="light"] .meeting-icon {
  background: #eef2ff;
  color: #3730a3;
}

:root[data-theme="light"] .toast {
  background: #121826;
  color: #ffffff;
}

:root[data-theme="light"] .toast.error {
  border-color: #fecaca;
  background: #7f1d1d;
}

/* Visual polish pass: denser hub layout inspired by timeline/transcript tools. */
.app-shell {
  grid-template-columns: 260px minmax(0, 1fr);
}

.sidebar {
  gap: 22px;
  padding: 28px 18px 18px;
}

.side-brand {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 0 10px 24px;
  border-bottom: 1px solid var(--line);
}

.side-brand-mark {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(135deg, #4f7cff, #7c5cff);
  color: #ffffff;
  box-shadow: 0 16px 36px rgba(79, 124, 255, 0.24);
}

.side-brand-mark svg {
  width: 25px;
  height: 25px;
}

.side-brand-copy {
  min-width: 0;
}

.side-brand h1 {
  margin: 0;
  font-size: 19px;
  font-weight: 860;
  letter-spacing: 0;
}

.side-brand p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 660;
}

.side-nav {
  gap: 10px;
}

.side-tab {
  min-height: 54px;
  gap: 12px;
  border-radius: 16px;
  padding: 0 16px;
  font-size: 15px;
}

.side-tab svg {
  width: 22px;
  height: 22px;
}

.side-link,
.side-theme-toggle {
  min-height: 50px;
  border-radius: 16px;
  font-size: 15px;
  font-weight: 760;
}

.content-shell {
  padding: 26px 24px;
}

.review-layout,
.meeting-layout {
  max-width: 1540px;
}

.meeting-layout.detail-open,
.review-layout.detail-open {
  grid-template-columns: minmax(0, 1fr) minmax(390px, 480px);
}

.queue-panel,
.timeline-panel,
.detail-panel,
.panel-block {
  border-radius: 20px;
}

.panel-head {
  padding: 20px 22px;
}

.panel-head h2 {
  font-size: 18px;
  font-weight: 850;
}

.panel-head p {
  margin-top: 3px;
  font-size: 13px;
}

.search-box {
  min-height: 62px;
  margin: 18px 22px;
  border-radius: 18px;
  padding: 0 18px;
}

.search-box input {
  height: 60px;
  font-size: 16px;
}

.meeting-timeline {
  padding: 12px 22px 22px;
}

.week-group,
.day-group,
.timeline-context,
.project-context,
.meeting-day-list,
.meeting-card {
  min-width: 0;
  max-width: 100%;
}

.week-heading span:first-child {
  min-height: 42px;
  padding: 0 18px;
  font-size: 16px;
  font-weight: 650;
}

.day-group {
  gap: 14px;
  padding-left: 38px;
}

.day-group::before {
  left: 13px;
  width: 3px;
}

.timeline-dot {
  left: 2px;
  width: 24px;
  height: 24px;
  border-width: 5px;
}

.day-heading {
  min-height: 34px;
  gap: 12px;
  font-size: 14px;
}

.day-heading strong {
  font-size: 17px;
  font-weight: 650;
}

.timeline-context-head {
  min-height: 34px;
  padding-left: 0;
}

.timeline-context-head strong {
  font-size: 15px;
  font-weight: 560;
}

.meeting-day-list {
  gap: 11px;
}

.meeting-card {
  grid-template-columns: 58px 52px minmax(0, 1fr) auto;
  gap: 14px;
  min-height: 88px;
  border-radius: 18px;
  padding: 15px 18px;
}

.meeting-card.task-card {
  padding-left: calc(18px + (var(--task-depth, 0) * 18px));
}

.meeting-time {
  font-size: 14px;
  font-weight: 520;
  line-height: 52px;
}

.meeting-icon {
  width: 52px;
  height: 52px;
  border-radius: 15px;
}

.meeting-icon svg {
  width: 22px;
  height: 22px;
}

.meeting-card-head strong {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.26;
}

.meeting-task-preview {
  margin-top: 8px;
  font-size: 13px;
}

.queue-meta {
  margin-top: 9px;
  gap: 7px;
}

.pill {
  min-height: 26px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 520;
}

.detail-header {
  padding: 24px 26px 20px;
}

.detail-header h2 {
  font-size: 18px;
  line-height: 1.32;
  font-weight: 860;
}

.detail-body {
  padding: 22px 26px 26px;
}

.evidence-box {
  border-radius: 18px;
  padding: 18px;
}

.relationship-overview {
  gap: 10px;
}

.relationship-stat,
.relationship-row,
.relation-choice span {
  border-radius: 14px;
}

.relationship-stat {
  min-height: 58px;
  padding: 12px;
}

.relation-choice span {
  min-height: 64px;
  padding: 11px 12px;
}

.relation-choice strong {
  font-size: 13px;
}

.relation-choice em {
  font-size: 12px;
}

.form-field input,
.form-field select {
  height: 46px;
}

.form-field textarea {
  min-height: 94px;
}

.action-button {
  min-height: 44px;
  border-radius: 13px;
}

:root[data-theme="dark"] {
  --bg: #07080c;
  --surface: #15161c;
  --surface-soft: #202127;
  --text: #f2f4f8;
  --muted: #a0a5b1;
  --line: #2a2b32;
  --line-strong: #3a3c45;
  --blue-soft: rgba(74, 111, 255, 0.18);
  --shadow: 0 24px 54px rgba(0, 0, 0, 0.36);
}

:root[data-theme="dark"] body {
  background: #07080c;
}

:root[data-theme="dark"] body,
:root[data-theme="light"] body {
  overflow-x: hidden;
}

:root[data-theme="dark"] .sidebar {
  background: #121318;
}

:root[data-theme="dark"] .side-tab.active {
  border-color: rgba(84, 125, 255, 0.42);
  background: rgba(76, 111, 255, 0.18);
}

:root[data-theme="dark"] .queue-panel,
:root[data-theme="dark"] .timeline-panel,
:root[data-theme="dark"] .detail-panel,
:root[data-theme="dark"] .panel-block {
  background: #111217;
}

:root[data-theme="dark"] .search-box,
:root[data-theme="dark"] .meeting-card,
:root[data-theme="dark"] .evidence-box,
:root[data-theme="dark"] .relationship-stat,
:root[data-theme="dark"] .relationship-row,
:root[data-theme="dark"] .relation-choice span,
:root[data-theme="dark"] .form-field input,
:root[data-theme="dark"] .form-field select,
:root[data-theme="dark"] .form-field textarea,
:root[data-theme="dark"] .ghost-button,
:root[data-theme="dark"] .icon-button,
:root[data-theme="dark"] .action-button {
  background: #18191f;
  border-color: #2b2d35;
}

:root[data-theme="dark"] .meeting-card:hover,
:root[data-theme="dark"] .relation-choice:hover span,
:root[data-theme="dark"] .ghost-button:hover,
:root[data-theme="dark"] .icon-button:hover {
  background: #202129;
  border-color: #3c4251;
}

:root[data-theme="dark"] .meeting-card.active,
:root[data-theme="dark"] .relation-choice input:checked + span {
  border-color: rgba(93, 129, 255, 0.68);
  background: rgba(65, 101, 210, 0.28);
}

:root[data-theme="dark"] .pill {
  background: #2a2b31;
  color: #c5cad5;
}

:root[data-theme="dark"] .meeting-icon,
:root[data-theme="dark"] .relationship-icon,
:root[data-theme="dark"] .relationship-stat-icon {
  background: rgba(84, 125, 255, 0.18);
  color: #79a0ff;
}

:root[data-theme="dark"] .week-heading span:first-child {
  background: rgba(84, 125, 255, 0.18);
  color: #79a0ff;
}

:root[data-theme="dark"] .timeline-dot {
  border-color: #5b7cff;
  background: #111217;
}

:root[data-theme="light"] .app-shell {
  grid-template-columns: 260px minmax(0, 1fr);
}

:root[data-theme="light"] .side-brand-mark {
  box-shadow: 0 16px 36px rgba(37, 99, 235, 0.2);
}

:root[data-theme="light"] .queue-panel,
:root[data-theme="light"] .timeline-panel,
:root[data-theme="light"] .detail-panel,
:root[data-theme="light"] .panel-block,
:root[data-theme="light"] .meeting-card,
:root[data-theme="light"] .evidence-box,
:root[data-theme="light"] .relationship-stat,
:root[data-theme="light"] .relationship-row,
:root[data-theme="light"] .relation-choice span {
  box-shadow: 0 12px 30px rgba(24, 32, 47, 0.04);
}

@media (max-width: 980px) {
  .app-shell,
  :root[data-theme="light"] .app-shell {
    grid-template-columns: 1fr;
  }

  .review-layout,
  .review-layout.detail-open,
  .meeting-layout,
  .meeting-layout.detail-open {
    grid-template-columns: 1fr;
  }

  .sidebar {
    padding: 16px;
  }

  .side-brand {
    grid-template-columns: 44px minmax(0, 1fr);
    padding: 0 0 12px;
  }

  .side-brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 13px;
  }

  .side-tab {
    min-height: 44px;
  }
}

@media (max-width: 640px) {
  .sidebar {
    min-width: 0;
    overflow: hidden;
  }

  .side-brand {
    min-width: 0;
    width: 100%;
  }

  .side-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, calc((100vw - 42px) / 2)));
    gap: 10px;
    width: calc(100vw - 32px);
    max-width: calc(100vw - 32px);
    min-width: 0;
    overflow: visible;
  }

  .side-tab {
    justify-content: center;
    min-width: 0;
    width: 100%;
    padding: 0 8px;
    font-size: 14px;
    white-space: normal;
  }

  .side-tab span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .content-shell {
    padding: 16px;
    overflow-x: hidden;
  }

  .screen.active,
  .timeline-panel,
  .detail-panel {
    overflow-x: hidden;
  }

  .meeting-card {
    grid-template-columns: 42px 42px minmax(0, 1fr) auto;
    min-height: 94px;
    gap: 12px;
    padding: 12px;
  }

  .meeting-card.task-card {
    padding-left: 12px;
  }

  .meeting-card-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .meeting-card-head .pill {
    align-self: start;
  }

  .meeting-icon {
    width: 48px;
    height: 48px;
  }

  .day-group {
    padding-left: 18px;
  }

  .day-group::before {
    left: 8px;
  }

  .project-context {
    border-left: 0;
    padding-left: 0;
  }

  .project-context-head {
    align-items: flex-start;
  }

  .project-context-head span:first-child {
    white-space: normal;
  }

  .meeting-timeline {
    padding: 10px 12px 16px;
  }

  .timeline-dot {
    left: 0;
    width: 18px;
    height: 18px;
    border-width: 4px;
  }

  .search-box {
    margin: 14px 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
