:root {
  color-scheme: light;
  --bg: #f5f6f8;
  --panel: #ffffff;
  --text: #14161a;
  --muted: #606875;
  --line: #d8dde5;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --danger: #b42318;
  --ok: #027a48;
  --warn: #b54708;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 30px;
  font-weight: 760;
}

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

.topbar p,
.hint,
.metrics span {
  color: var(--muted);
}

.status {
  min-width: 120px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--muted);
  text-align: center;
  font-weight: 650;
}

.status.ok {
  border-color: #abefc6;
  color: var(--ok);
  background: #ecfdf3;
}

.status.warn {
  border-color: #fedf89;
  color: var(--warn);
  background: #fffaeb;
}

.status.error {
  border-color: #fecdca;
  color: var(--danger);
  background: #fef3f2;
}

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

.hidden {
  display: none;
}

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

label {
  display: grid;
  gap: 6px;
  color: #313741;
  font-weight: 650;
}

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

input {
  height: 40px;
  padding: 0 10px;
}

input[type="file"] {
  height: auto;
  padding: 9px 10px;
}

textarea {
  min-height: 180px;
  resize: vertical;
  padding: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}

input:focus,
textarea:focus {
  outline: 2px solid rgba(15, 118, 110, 0.22);
  border-color: var(--accent);
}

.actions,
.listHead {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.actions {
  margin-top: 12px;
}

button {
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 0 12px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}

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

button:disabled:hover {
  border-color: var(--line);
  color: var(--text);
}

.actions.inline {
  margin-top: 0;
}

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

button.primary:hover,
#submitPublic:hover,
#loadRemote:hover {
  background: var(--accent-dark);
}

.hint {
  margin-top: 10px;
  font-size: 13px;
}

.fileLoader {
  margin-top: 12px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.metrics div {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.metrics strong {
  display: block;
  font-size: 26px;
  line-height: 1.1;
}

.metrics span {
  display: block;
  margin-top: 4px;
}

.checkResult {
  margin-top: 10px;
  min-height: 28px;
  color: var(--muted);
  font-weight: 650;
}

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

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

.listHead {
  justify-content: space-between;
  margin-bottom: 10px;
}

pre {
  min-height: 160px;
  max-height: 300px;
  overflow: auto;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0f172a;
  color: #e5e7eb;
  font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (max-width: 820px) {
  .topbar,
  .actions,
  .listHead {
    align-items: stretch;
    flex-direction: column;
  }

  .grid,
  .metrics {
    grid-template-columns: 1fr;
  }

  .status {
    width: 100%;
  }

  button {
    width: 100%;
  }
}
