:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f7fb;
  color: #1e293b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

a {
  color: inherit;
}

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

.flash-stack {
  position: fixed;
  right: 16px;
  top: 16px;
  z-index: 10;
}

.flash {
  background: #17324d;
  border-radius: 6px;
  color: white;
  padding: 10px 14px;
  box-shadow: 0 8px 24px rgb(15 23 42 / 18%);
}

.login-page {
  align-items: center;
  display: flex;
  min-height: 100vh;
  justify-content: center;
  padding: 24px;
}

.login-panel {
  background: white;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  box-shadow: 0 18px 60px rgb(30 41 59 / 12%);
  display: grid;
  gap: 28px;
  max-width: 420px;
  padding: 36px;
  width: 100%;
}

.eyebrow {
  color: #2f6f73;
  font-size: 13px;
  font-weight: 700;
  margin: 0 0 8px;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

.muted {
  color: #64748b;
}

.google-button,
.new-topic,
.topic-main,
.topic-edit,
.small-logout,
.logout {
  text-decoration: none;
}

.google-button,
.new-topic,
.form-actions button,
.panel-title button {
  background: #256c67;
  border: 0;
  border-radius: 6px;
  color: white;
  cursor: pointer;
  display: inline-flex;
  font-weight: 700;
  justify-content: center;
  padding: 11px 14px;
}

.sidebar-separator {
  border-top: 1px solid #dbe3ef;
}

.app-shell {
  display: grid;
  grid-template-columns: 300px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: #ffffff;
  border-right: 1px solid #dbe3ef;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px;
}

.user-strip {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: 42px 1fr;
}

.user-strip img {
  border-radius: 50%;
  height: 42px;
  width: 42px;
}

.user-strip span,
.topic-main span {
  color: #64748b;
  display: block;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topic-list {
  display: grid;
  gap: 8px;
  overflow: auto;
}

.team-filter {
  display: grid;
  gap: 6px;
}

.team-filter label {
  margin: 0;
}

.call-source-switch {
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: hidden;
}

.call-source-switch a {
  color: #475569;
  font-weight: 800;
  padding: 9px 10px;
  text-align: center;
  text-decoration: none;
}

.call-source-switch a + a {
  border-left: 1px solid #cbd5e1;
}

.call-source-switch a:hover {
  background: #eef7f6;
}

.call-source-switch a.is-active {
  background: #256c67;
  color: white;
}

.topic-item {
  align-items: stretch;
  border: 1px solid #dbe3ef;
  border-radius: 6px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  overflow: hidden;
}

.topic-item:hover {
  background: #eef7f6;
  border-color: #9fc7c3;
}

.topic-item.is-active {
  background: #fff4cf;
  border-color: #e6c96d;
}

.topic-item.is-active:hover {
  background: #fff0bd;
}

.topic-main {
  display: block;
  min-width: 0;
  padding: 12px;
}

.topic-edit {
  align-items: center;
  border-left: 1px solid #dbe3ef;
  color: #475569;
  display: inline-flex;
  justify-content: center;
}

.topic-edit:hover {
  background: #dff0ee;
  color: #1e293b;
}

.topic-edit svg {
  fill: none;
  height: 18px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.1;
  width: 18px;
}

.empty-list {
  color: #64748b;
  margin: 0;
}

.logout {
  color: #64748b;
  margin-top: auto;
}

.small-logout {
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  color: #475569;
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  margin-top: 8px;
  padding: 5px 8px;
}

.small-logout:hover {
  background: #f1f5f9;
  color: #1e293b;
}

.workspace {
  min-width: 0;
}

.workspace iframe {
  border: 0;
  display: block;
  height: 100vh;
  width: 100%;
}

.blank-state {
  display: grid;
  min-height: 100vh;
  place-content: center;
  text-align: center;
}

.eu-calls-page {
  display: grid;
  gap: 22px;
  padding: 24px;
}

.page-header {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.page-header h1 {
  font-size: 26px;
  margin: 0;
}

.word-cloud-preview {
  background: white;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  overflow: hidden;
}

.word-cloud-preview h2 {
  border-bottom: 1px solid #dbe3ef;
  font-size: 16px;
  margin: 0;
  padding: 12px 14px;
}

.word-cloud-preview iframe {
  border: 0;
  display: block;
  height: 360px;
  width: 100%;
}

.word-cloud-preview iframe:not([src]) {
  display: none;
}

.word-cloud-empty {
  align-items: center;
  color: #64748b;
  display: flex;
  font-size: 15px;
  font-weight: 700;
  height: 360px;
  justify-content: center;
  padding: 24px;
  text-align: center;
}

.word-cloud-empty[hidden] {
  display: none;
}

.call-topic-section {
  display: grid;
  gap: 10px;
}

.call-topic-header {
  align-items: center;
  display: flex;
  gap: 14px;
}

.call-topic-title {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.call-topic-title h2 {
  font-size: 18px;
  margin: 0;
}

.future-filter {
  align-items: center;
  color: #475569;
  cursor: pointer;
  display: inline-flex;
  font-size: 13px;
  font-weight: 700;
  gap: 7px;
  margin: 0;
  white-space: nowrap;
}

.future-filter input {
  cursor: pointer;
  height: 16px;
  padding: 0;
  width: 16px;
}

.call-topic-section.has-no-visible-calls .calls-table-wrap {
  opacity: 0.55;
}

.calls-table-wrap {
  background: white;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  overflow: auto;
}

.calls-table {
  min-width: 960px;
}

.calls-table tbody tr {
  cursor: pointer;
}

.calls-table tbody tr:hover,
.calls-table tbody tr.is-selected {
  background: #eef7f6;
}

.calls-table td:nth-child(1),
.calls-table td:nth-child(2) {
  width: 90px;
}

.calls-table td:nth-child(3),
.calls-table td:nth-child(4) {
  width: 170px;
}

.calls-table td:nth-child(6),
.calls-table td:nth-child(7) {
  width: 110px;
}

.calls-table a {
  color: #256c67;
  font-weight: 700;
}

.score-cell {
  color: var(--score-color, #2563eb);
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.topic-editor {
  padding: 24px;
}

.topic-editor form {
  display: grid;
  gap: 22px;
}

.form-header {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(220px, 1fr) minmax(160px, 240px) minmax(160px, 240px);
}

label {
  color: #475569;
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
}

input,
select,
textarea {
  background: white;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  color: #1e293b;
  min-width: 0;
  padding: 10px;
  width: 100%;
}

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

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

.table-panel {
  background: white;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  overflow: hidden;
}

.panel-title {
  align-items: center;
  border-bottom: 1px solid #dbe3ef;
  display: flex;
  justify-content: space-between;
  padding: 14px;
}

.panel-title h2 {
  font-size: 18px;
  margin: 0;
}

table {
  border-collapse: collapse;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid #edf2f7;
  padding: 10px;
  text-align: left;
  vertical-align: top;
}

th {
  color: #475569;
  font-size: 12px;
  font-weight: 800;
}

.sort-header {
  align-items: center;
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: inherit;
  gap: 4px;
  padding: 0;
  text-transform: inherit;
}

.sort-header:hover,
.sort-header.is-active {
  color: #1e293b;
}

.sort-header span {
  display: inline-block;
  font-size: 13px;
  line-height: 1;
  min-width: 1ch;
}

td:nth-child(2) {
  width: 150px;
}

td:nth-child(3) {
  width: 80px;
}

td:nth-child(4) {
  width: 88px;
}

.row-actions {
  display: flex;
  gap: 6px;
}

.hit-count {
  display: inline-block;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  line-height: 1.2;
  min-width: 4.5ch;
}

.importance-column {
  display: none;
}

.topic-help-text {
  color: #64748b;
  font-size: 14px;
  line-height: 1.5;
  margin: -8px 0 0;
  max-width: 980px;
}

.row-action {
  border-radius: 6px;
  border: 0;
  color: white;
  cursor: pointer;
  display: inline-grid;
  flex: 0 0 auto;
  height: 34px;
  place-items: center;
  width: 34px;
}

.row-action svg {
  fill: none;
  height: 18px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
  width: 18px;
}

.add-row-button {
  background: #256c67;
}

.add-row-button:hover {
  background: #1f5b57;
}

.remove-row-button {
  background: #b42318;
}

.remove-row-button:hover {
  background: #8f1d15;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.form-actions .danger-button {
  background: #b42318;
  border: 0;
  border-radius: 6px;
  color: white;
  cursor: pointer;
  display: inline-flex;
  font-weight: 700;
  justify-content: center;
  padding: 11px 14px;
}

.form-actions .danger-button:hover {
  background: #8f1d15;
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-bottom: 1px solid #dbe3ef;
    border-right: 0;
    max-height: 45vh;
  }

  .workspace iframe {
    height: 70vh;
  }

  .form-header,
  .language-grid {
    grid-template-columns: 1fr;
  }
}
