:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #f7f9fc;
  --line: #d8dee8;
  --text: #111827;
  --muted: #5f6b7a;
  --blue: #2563eb;
  --blue-soft: #eaf1ff;
  --green: #15803d;
  --green-soft: #e8f7ee;
  --grey: #eef2f7;
  --shadow: 0 14px 34px rgba(17, 24, 39, 0.08);
}

* {
  box-sizing: border-box;
}

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

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

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.app-shell {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 20px;
}

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

.eyebrow {
  margin: 0 0 4px;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 6vw, 3.25rem);
  line-height: 1;
}

h2 {
  margin-bottom: 0;
  font-size: 1.55rem;
}

h3 {
  margin-bottom: 8px;
}

.status-pill,
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.84rem;
  font-weight: 700;
  white-space: nowrap;
}

.status-pill {
  background: var(--grey);
  color: var(--muted);
}

.status-pill.is-ok {
  background: var(--green-soft);
  color: var(--green);
}

.status-pill.is-warn {
  background: var(--blue-soft);
  color: var(--blue);
}

.tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 18px 0;
}

.tab {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--muted);
  cursor: pointer;
  font-weight: 700;
}

.tab.is-active {
  border-color: var(--blue);
  background: var(--blue);
  color: #ffffff;
}

.workspace {
  display: none;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.workspace.is-active {
  display: block;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.primary-action,
.secondary-action {
  min-height: 42px;
  border-radius: 8px;
  padding: 0 16px;
  cursor: pointer;
  font-weight: 800;
}

.primary-action {
  border: 1px solid var(--green);
  background: var(--green);
  color: #ffffff;
}

.secondary-action {
  border: 1px solid var(--blue);
  background: var(--bg);
  color: var(--blue);
}

.clip-form {
  display: grid;
  gap: 16px;
}

.clip-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.form-status {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.form-status[data-state="success"] {
  color: var(--green);
}

.form-status[data-state="error"] {
  color: #b91c1c;
}

.form-status[data-state="pending"] {
  color: var(--blue);
}

.saved-panel {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  padding: 16px;
}

.saved-panel a {
  color: var(--blue);
  font-weight: 800;
  overflow-wrap: anywhere;
}

label {
  display: grid;
  gap: 7px;
  color: var(--text);
  font-size: 0.94rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  padding: 11px 12px;
}

textarea {
  resize: vertical;
}

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

.data-card {
  min-height: 172px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  padding: 18px;
}

.data-card p {
  color: var(--muted);
  margin-bottom: 0;
}

.tag.blue {
  background: var(--blue-soft);
  color: var(--blue);
}

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

.digest-list,
.config-list {
  display: grid;
  gap: 10px;
}

.digest-row,
.config-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  padding: 12px 14px;
}

.digest-row span,
.config-list dd {
  color: var(--muted);
}

.config-list {
  margin: 0;
}

.config-list dt {
  font-weight: 800;
}

.config-list dd {
  margin: 0;
}

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

.output-types span {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  padding: 10px;
  text-align: center;
  font-weight: 800;
}

@media (max-width: 760px) {
  .app-shell {
    padding: 14px;
  }

  .topbar,
  .section-heading,
  .clip-actions {
    align-items: stretch;
    flex-direction: column;
  }

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

  .workspace {
    padding: 16px;
  }

  .form-row,
  .card-grid,
  .output-types {
    grid-template-columns: 1fr;
  }

  .digest-row,
  .config-list div {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }
}
