:root {
  color-scheme: light;
  --bg: #f7f8fb;
  --panel: #ffffff;
  --text: #152034;
  --muted: #667085;
  --line: #d9dee8;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --danger: #b42318;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

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

.topbar,
.toolbar,
.tabs,
.actions,
.qr-box {
  display: flex;
  gap: 12px;
  align-items: center;
}

.topbar {
  justify-content: space-between;
  margin-bottom: 18px;
}

.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
}

h1 {
  font-size: 28px;
}

h2 {
  font-size: 20px;
}

h3 {
  font-size: 16px;
}

p {
  color: var(--muted);
  line-height: 1.5;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 12px 30px rgba(21, 32, 52, 0.06);
}

.panel-copy {
  max-width: 720px;
  margin-bottom: 16px;
}

.form-grid,
.data-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

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

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

.button {
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  min-height: 40px;
  padding: 9px 13px;
}

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

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

.button.secondary {
  background: #fff;
  border-color: var(--line);
  color: var(--text);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.actions {
  margin-top: 14px;
}

.qr-box {
  align-items: flex-start;
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 18px;
}

#qrCanvas {
  width: 256px;
  height: 256px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.status-line {
  color: var(--muted);
  font-size: 13px;
  margin-top: 10px;
}

.toolbar {
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.toolbar label {
  min-width: 180px;
}

.tabs {
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
  overflow-x: auto;
}

.tab {
  background: transparent;
  border: 0;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: 12px 10px;
  white-space: nowrap;
}

.tab.active {
  border-bottom-color: var(--accent);
  color: var(--text);
}

.content {
  display: grid;
  gap: 14px;
}

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.metric {
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  display: block;
  color: var(--text);
  font-size: 24px;
  margin-bottom: 4px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

th,
td {
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  padding: 9px 10px;
  text-align: left;
  vertical-align: top;
}

th {
  background: #f0f3f8;
  color: #344054;
  font-weight: 800;
}

td {
  color: #344054;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  word-break: break-all;
}

pre {
  background: #111827;
  border-radius: 8px;
  color: #f9fafb;
  overflow: auto;
  padding: 12px;
}

.error {
  background: #fff1f0;
  border: 1px solid #fecdca;
  border-radius: 8px;
  color: var(--danger);
  margin-top: 14px;
  padding: 12px;
}

.hidden {
  display: none !important;
}

@media (max-width: 720px) {
  .topbar,
  .qr-box {
    align-items: stretch;
    flex-direction: column;
  }

  #qrCanvas {
    height: auto;
    max-width: 100%;
  }
}
