:root {
  color-scheme: light;
  --bg: #f5f7f6;
  --surface: #ffffff;
  --line: #d8dfda;
  --text: #17201a;
  --muted: #657067;
  --primary: #236b51;
  --primary-dark: #184d3a;
  --soft: #eef3f0;
  --danger: #b42318;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

button,
input,
textarea {
  font: inherit;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 32px auto;
}

.toolbar,
.filters,
.account,
.wizard,
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
}

.toolbar-actions,
.actions,
.wizard-actions,
.row-actions {
  display: flex;
  gap: 10px;
}

h1,
h2 {
  margin: 0;
  line-height: 1.15;
  letter-spacing: 0;
}

h1 {
  font-size: 28px;
}

h2 {
  font-size: 20px;
}

p {
  margin: 6px 0 0;
  color: var(--muted);
}

.notice {
  width: 100%;
  margin-top: 10px;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 14px;
}

.notice.success {
  background: #e8f5ee;
  color: #16543a;
}

.notice.error {
  background: #fdebea;
  color: #8f1d14;
}

.notice.neutral {
  background: var(--soft);
  color: var(--muted);
}

button {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  padding: 0 14px;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
}

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

button:disabled {
  opacity: 0.45;
  cursor: default;
}

button.secondary,
.chip {
  background: var(--soft);
  color: var(--text);
}

button.secondary:hover,
.chip:hover {
  background: #dfe9e3;
}

button.danger {
  background: transparent;
  color: var(--danger);
  padding: 0 8px;
}

.filters,
.account {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding: 14px;
}

.otp-form {
  display: flex;
  align-items: end;
  gap: 10px;
}

.wizard {
  margin-top: 14px;
  padding: 16px;
}

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

form {
  margin: 0;
}

.wizard-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 16px 0;
}

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

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 11px;
  color: var(--text);
  background: #fff;
}

textarea {
  resize: vertical;
}

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

.prompt-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.prompt-button {
  min-height: 74px;
  padding: 10px;
  white-space: normal;
  line-height: 1.25;
}

.prompt-button.selected {
  background: var(--primary);
  color: #fff;
}

.chips {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  min-height: 34px;
  border: 1px solid var(--line);
}

.review-list {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.review-list div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

dd {
  margin: 6px 0 0;
  overflow-wrap: anywhere;
}

.wizard-actions {
  justify-content: flex-end;
}

.table-wrap {
  position: relative;
  margin-top: 14px;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

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

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

td {
  font-size: 14px;
}

tr:last-child td {
  border-bottom: 0;
}

.row-actions {
  justify-content: flex-end;
}

.empty {
  padding: 24px;
  margin: 0;
}

@media (max-width: 860px) {
  .prompt-grid,
  .review-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 640px) {
  .shell {
    width: min(100% - 20px, 1180px);
    margin: 16px auto;
  }

  .toolbar,
  .filters,
  .account,
  .otp-form,
  .wizard-head {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar-actions,
  .actions,
  .wizard-actions {
    flex-wrap: wrap;
  }

  .prompt-grid,
  .review-list,
  .wizard-panel {
    grid-template-columns: 1fr;
  }
}
