:root {
  color-scheme: light;
  --bg: #eef2f5;
  --ink: #17202a;
  --muted: #64707d;
  --line: #cfd8df;
  --panel: #ffffff;
  --panel-soft: #f7f9fb;
  --accent: #0f6bc7;
  --mint: #21a67a;
  --gold: #bc7a00;
  --shadow: 0 16px 50px rgba(28, 39, 49, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(135deg, #eef2f5 0%, #f8fafc 48%, #e8f0ee 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

a {
  color: inherit;
  text-decoration: none;
}

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

.workspace {
  display: grid;
  grid-template-columns: minmax(300px, 0.78fr) minmax(380px, 1.22fr);
  min-height: 620px;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.controls {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 28px;
  background: #f8fafb;
  border-right: 1px solid var(--line);
}

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

.mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 8px;
  background: #14213d;
  color: #ffe169;
  font-size: 22px;
  font-weight: 900;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.05;
}

.brand p,
.panel-head span,
.eyebrow,
.stat-grid span,
label span,
legend,
.badge-row span {
  color: var(--muted);
  font-size: 13px;
}

.toolbar {
  display: grid;
  gap: 18px;
}

.notice {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid #e4c56b;
  border-radius: 8px;
  background: #fff8df;
  color: #4e3b00;
}

.notice strong {
  font-size: 13px;
}

.notice span {
  color: #6b560d;
  font-size: 13px;
  line-height: 1.35;
}

.claim-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.claim-box div {
  display: grid;
  gap: 4px;
}

.claim-box span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.claim-box strong {
  font-size: 15px;
}

.connect {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--ink);
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

label {
  display: grid;
  gap: 7px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
}

input,
select {
  height: 44px;
  padding: 0 12px;
}

textarea {
  min-height: 76px;
  padding: 12px;
  resize: vertical;
  color: #27313b;
  background: #f7f9fb;
}

fieldset {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

legend {
  grid-column: 1 / -1;
  margin-bottom: 2px;
  font-weight: 700;
}

fieldset label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
}

fieldset input {
  width: 15px;
  height: 15px;
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: auto;
}

.stat-grid div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.stat-grid strong {
  font-size: 20px;
}

.preview {
  display: grid;
  grid-template-rows: auto minmax(260px, 1fr) auto auto;
  gap: 18px;
  padding: 28px;
  background:
    linear-gradient(90deg, rgba(15, 107, 199, 0.07), transparent 42%),
    linear-gradient(180deg, #ffffff, #f7faf9);
}

.preview-head,
.panel-head,
.badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.preview h2,
.panel h2 {
  margin-top: 4px;
  font-size: 20px;
}

.copy {
  min-width: 76px;
  height: 38px;
  border: 0;
  border-radius: 8px;
  background: var(--ink);
  color: #ffffff;
  font-weight: 800;
  cursor: pointer;
}

.card-stage {
  display: grid;
  place-items: center;
  min-height: 298px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(45deg, #f1f4f6 25%, transparent 25%),
    linear-gradient(-45deg, #f1f4f6 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #f1f4f6 75%),
    linear-gradient(-45deg, transparent 75%, #f1f4f6 75%);
  background-color: #ffffff;
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
  background-size: 24px 24px;
}

.card-stage img {
  width: min(100%, 640px);
  height: auto;
  border-radius: 8px;
  box-shadow: 0 14px 36px rgba(20, 33, 61, 0.15);
}

.badge-row,
.share-row {
  min-height: 36px;
}

.badge-row img {
  height: 28px;
}

.share-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.share-row a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: #27313b;
  font-size: 13px;
  font-weight: 800;
}

.lower {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

.panel {
  min-height: 220px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.tool-list {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.sources {
  grid-column: 1 / -1;
  min-height: 120px;
}

.source-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.source-list span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: #2a3540;
  font-size: 13px;
  font-weight: 800;
}

.tool-row {
  display: grid;
  gap: 7px;
}

.tool-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.meter {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7edf1;
}

.meter span {
  display: block;
  height: 100%;
  min-width: 4px;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--mint), var(--gold));
}

pre {
  overflow: auto;
  min-height: 132px;
  margin: 18px 0 0;
  padding: 14px;
  border-radius: 8px;
  background: #111820;
  color: #d7eee2;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
}

@media (max-width: 900px) {
  .workspace,
  .lower {
    grid-template-columns: 1fr;
  }

  .controls {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 560px) {
  .shell {
    width: min(100% - 20px, 1180px);
    padding: 10px 0;
  }

  .controls,
  .preview,
  .panel {
    padding: 18px;
  }

  fieldset {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 24px;
  }
}
