:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #101418;
  color: #eef4f8;
  --panel: #171d22;
  --panel-strong: #1f272e;
  --line: #33414b;
  --muted: #9baab5;
  --accent: #4fb3a5;
  --accent-strong: #6ac7b9;
  --danger: #e27b7b;
  --ok: #86d28d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(135deg, rgba(79, 179, 165, 0.12), transparent 30%),
    #101418;
}

button,
input,
select {
  font: inherit;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px clamp(18px, 3vw, 36px);
  border-bottom: 1px solid var(--line);
  background: rgba(16, 20, 24, 0.92);
  position: sticky;
  top: 0;
  z-index: 2;
}

.brand-title {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.topbar-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  min-width: min(420px, 45vw);
}

.brand-logo {
  display: block;
  width: 72px;
  height: 72px;
  flex: 0 0 auto;
  object-fit: contain;
  border-radius: 8px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 760;
}

h2 {
  font-size: 17px;
  font-weight: 720;
}

h3 {
  font-size: 15px;
  font-weight: 720;
  margin: 0;
}

.eyebrow {
  color: var(--accent-strong);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 6px;
}

.status {
  min-width: 220px;
  text-align: right;
  color: var(--muted);
  font-size: 14px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(360px, 1fr);
  gap: 18px;
  padding: 18px clamp(18px, 3vw, 36px) 36px;
  flex: 1;
}

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

.metadata-panel {
  min-height: 520px;
}

.operations-panel {
  grid-column: 1 / -1;
}

.panel-title,
.verify-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

button {
  border: 1px solid #44606a;
  background: #223039;
  color: #edf7f6;
  border-radius: 7px;
  min-height: 38px;
  padding: 0 14px;
  cursor: pointer;
}

button:hover {
  border-color: var(--accent);
  background: #273b43;
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

input,
select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  background: #10171c;
  color: #eff7f7;
  border-radius: 7px;
  padding: 0 10px;
}

.dropzone {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 170px;
  border: 1px dashed #5a737b;
  border-radius: 8px;
  background: #121a20;
  cursor: pointer;
  text-align: center;
  padding: 18px;
}

.dropzone.drag {
  border-color: var(--accent-strong);
  background: #16262a;
}

.dropzone input {
  display: none;
}

.dropzone span {
  font-weight: 700;
}

.dropzone small,
.file-meta,
label {
  color: var(--muted);
  font-size: 13px;
}

.file-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.file-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #11181d;
}

.file-item strong {
  overflow-wrap: anywhere;
}

.file-item button {
  grid-row: span 2;
}

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

.metadata.empty {
  display: block;
  color: var(--muted);
}

.metric {
  background: #11181d;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px;
  min-width: 0;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.metric strong {
  display: block;
  overflow-wrap: anywhere;
  font-weight: 650;
}

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

.raw-summary {
  margin: 14px 0 0;
  max-height: 260px;
  overflow: auto;
  white-space: pre-wrap;
  color: #c8d6dd;
  background: #0d1216;
  border: 1px solid #25323a;
  border-radius: 7px;
  padding: 12px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px;
}

.operations-sections {
  display: grid;
  gap: 16px;
}

.operation-section {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.operation-section:first-child {
  border-top: 0;
  padding-top: 0;
}

.compact-section {
  max-width: 980px;
}

.section-heading {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
}

.section-heading p {
  color: var(--muted);
  font-size: 13px;
}

.csr-grid {
  grid-template-columns: repeat(3, minmax(180px, 1fr));
}

.two-col-grid {
  grid-template-columns: repeat(2, minmax(220px, 1fr));
}

label {
  display: grid;
  gap: 6px;
}

.section-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.operation-result,
#verifyResult {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.ok {
  color: var(--ok);
}

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

a {
  color: var(--accent-strong);
}

.site-footer {
  padding: 18px clamp(18px, 3vw, 36px) 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

@media (max-width: 900px) {
  .topbar,
  .topbar-meta,
  .panel-title,
  .verify-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-meta {
    min-width: 0;
  }

  .status {
    min-width: 0;
    text-align: left;
  }

  .brand-title {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .brand-logo {
    width: 96px;
  }

  .layout,
  .form-grid,
  .two-col-grid,
  .metadata {
    grid-template-columns: 1fr;
  }

  .operations-panel {
    grid-column: auto;
  }
}
