:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --ink: #17202a;
  --muted: #647184;
  --line: #d8dee8;
  --accent: #176b58;
  --accent-strong: #0f5645;
  --danger: #9c2f2f;
  --focus: #2a7fff;
}

* {
  box-sizing: border-box;
}

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

button,
input,
textarea {
  font: inherit;
}

button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  padding: 0 14px;
}

button:hover {
  border-color: #aab5c3;
}

button:focus,
input:focus,
textarea:focus {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

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

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

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

button.primary:hover {
  background: var(--accent-strong);
}

button.danger {
  color: var(--danger);
}

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

textarea {
  resize: vertical;
}

label {
  display: grid;
  gap: 7px;
  color: #344054;
  font-weight: 600;
}

.page-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.page-header h1,
.popup-header h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
}

.page-header p,
.popup-header p {
  margin: 8px 0 0;
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.header-actions,
.row-actions,
.actions,
.section-title {
  display: flex;
  gap: 10px;
}

.header-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.import-panel,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 18px;
}

.import-panel {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

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

.help-text {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.profile-grid {
  display: grid;
  gap: 18px;
}

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

.panel p {
  margin: 0;
  color: #344054;
  line-height: 1.6;
}

.clean-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding-left: 20px;
  color: #344054;
  line-height: 1.5;
}

.form-grid {
  display: grid;
  gap: 14px;
}

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

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

.section-title {
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-title h2 {
  margin: 0;
}

.repeat-list {
  display: grid;
  gap: 12px;
}

.repeat-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 44px 14px 14px;
}

.remove-card {
  position: absolute;
  top: 10px;
  right: 10px;
  min-height: 30px;
  color: var(--danger);
}

.save-status {
  min-height: 24px;
  color: var(--accent-strong);
  font-weight: 700;
}

.settings-panel {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.settings-panel h2 {
  margin-bottom: 0;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.check-row input {
  width: auto;
}

.document-list {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.document-item {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfe;
  padding: 9px 10px;
}

.popup {
  width: 340px;
  background: #fff;
}

.popup main {
  padding: 16px;
}

.popup-header {
  margin-bottom: 14px;
}

.popup-header h1 {
  font-size: 21px;
}

.actions {
  flex-direction: column;
}

.result {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  color: var(--muted);
  line-height: 1.45;
}

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

@media (max-width: 720px) {
  .page-header {
    align-items: stretch;
    flex-direction: column;
  }

  .header-actions {
    justify-content: flex-start;
  }

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