@font-face {
  font-family: "FF Mark";
  src: url("./assets/fonts/MarkOffcPro.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "FF Mark";
  src: url("./assets/fonts/MarkOffcPro-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "FF Mark";
  src: url("./assets/fonts/MarkOffcPro-Heavy.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f6f6f4;
  --card: #ffffff;
  --ink: #1f1f1f;
  --muted: #666666;
  --line: #cccccc;
  --accent: #ff6633;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "FF Mark", "Avenir Next", "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

.shell {
  max-width: 936px;
  margin: 0 auto;
  padding: 18px 14px 40px;
  display: grid;
  gap: 14px;
}

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

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

.view-nav-btn {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 600;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
}

.view-nav-btn.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.brand-wrap {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.build-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 8px;
  border: 1px solid #e1d5cf;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: #7f4f3f;
  background: #fff7f3;
}

.logo {
  width: 140px;
  height: auto;
}

h1 {
  margin: 0;
  font-size: 28px;
}

h2 {
  margin: 0 0 12px;
  font-size: 20px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  min-width: 0;
}

.auth-card {
  max-width: 420px;
}

.auth-card #loginBtn {
  margin-top: 16px;
}

#appSection,
.view-panel {
  display: grid;
  gap: 16px;
  min-width: 0;
}

label {
  display: block;
  margin-top: 10px;
  margin-bottom: 6px;
  font-size: 13px;
  color: #333333;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
  background: #ffffff;
}

textarea {
  resize: vertical;
}

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

.file-list li {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
}

.dropzone {
  margin-top: 10px;
  border: 2px dashed #d5b9ae;
  border-radius: 10px;
  padding: 18px 14px;
  text-align: center;
  background: #fffdfc;
  display: grid;
  gap: 4px;
  cursor: pointer;
}

.dropzone.dragover {
  border-color: var(--accent);
  background: #fff5f1;
}

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

.section-stack {
  display: grid;
  gap: 6px;
}

.field-label {
  font-size: 13px;
  color: #333333;
}

.og-input {
  width: 100%;
}

.og-card-title {
  font-size: 18px;
  font-weight: 700;
}

.og-card-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

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

.inline-actions,
.actions-row {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.btn {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 14px;
  cursor: pointer;
  font-weight: 600;
  background: #ffffff;
  color: var(--ink);
}

.btn.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.btn.ghost {
  border-style: dashed;
  background: #ffffff;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.status {
  margin: 10px 0 0;
  font-size: 14px;
}

.table-wrap {
  margin-top: 12px;
  overflow: auto;
  max-height: 290px;
  width: 100%;
  max-width: 100%;
  border: 1px solid #dccfc8;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #fffaf7 100%);
  box-shadow: 0 1px 0 rgba(31, 31, 31, 0.04);
}

.table-wrap.is-compact {
  max-height: 290px;
}

.table-wrap.is-expanded {
  max-height: 72vh;
}

.table-wrap.is-collapsed {
  display: none;
}

.table-hidden-hint {
  margin: 10px 0 0;
  font-size: 13px;
}

.data-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.22;
  color: #2a2f3a;
}

.data-table th,
.data-table td {
  border: 1px solid #ddd2cb;
  padding: 5px 8px;
  min-width: 92px;
  vertical-align: top;
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f3e4dc;
  color: #3b2d27;
  border-bottom: 2px solid #d3aaa0;
  font-size: 14px;
  font-weight: 700;
}

.data-table tbody tr:nth-child(even) td {
  background: #fff8f4;
}

.data-table tbody tr:hover td {
  background: #fff0e8;
}

.data-table [contenteditable="true"] {
  outline: none;
}

.data-table [contenteditable="true"]:focus {
  background: #ffffff;
  box-shadow: inset 0 0 0 2px rgba(255, 102, 51, 0.32);
}

.toolbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.participant-subheading {
  font-size: 16px;
  font-weight: 700;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border: 1px solid #e4d5ce;
  border-radius: 999px;
  background: #fff8f5;
  color: #5f4f48;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

.preview-header {
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.preview-title {
  line-height: 1.2;
}

.preview-badge {
  margin-left: auto;
}

.parser-debug-card {
  padding-top: 10px;
}

.parser-debug-summary {
  list-style: none;
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
}

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

.parser-debug-controls {
  margin-top: 10px;
}

.parser-debug-panel {
  margin-top: 10px;
  border: 1px solid #dccfc8;
  border-radius: 12px;
  overflow: auto;
  background: #fffdfc;
  max-height: 360px;
}

.parser-debug-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.28;
}

.parser-debug-table th,
.parser-debug-table td {
  border-bottom: 1px solid #ebdfd9;
  padding: 7px 9px;
  text-align: left;
  vertical-align: top;
}

.parser-debug-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f2e5de;
  border-bottom: 2px solid #d5b3a8;
  font-weight: 700;
  color: #3a2f2a;
}

.parser-debug-table tbody tr:nth-child(even) td {
  background: #fffcfb;
}

.parser-debug-table tbody tr:hover td {
  background: #fff3ec;
}

.parser-debug-table tr.is-active td {
  background: #ffece2;
}

.parser-debug-reason {
  color: #504a47;
  max-width: 420px;
}

.data-preview-area {
  display: block;
  margin-top: 2px;
}

.report-preview-window {
  border: 1px solid rgba(204, 204, 204, 0.84);
  border-radius: 12px;
  background: #ffffff;
  padding: 8px;
  min-height: 24rem;
  overflow: auto;
}

.report-preview-image {
  display: block;
  width: 100%;
  height: auto;
}

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

.warnings {
  margin: 8px 0 0;
  padding-left: 18px;
  color: #8d381f;
}

.session-meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

[hidden] {
  display: none !important;
}

@media (max-width: 760px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

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

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

  .preview-header {
    align-items: flex-start;
  }

  .preview-badge {
    margin-left: 0;
  }

  .table-wrap.is-compact {
    max-height: 230px;
  }

}
