:root {
  color-scheme: light;
  --bg: #f6f7f8;
  --panel: #ffffff;
  --text: #182026;
  --muted: #66717c;
  --line: #d9e0e5;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --danger: #b42318;
}

* {
  box-sizing: border-box;
}

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

.shell {
  width: min(960px, calc(100% - 28px));
  margin: 24px auto;
  display: grid;
  gap: 16px;
}

.capture,
.history {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

h1,
h2 {
  margin: 0 0 14px;
  letter-spacing: 0;
}

h1 {
  font-size: 24px;
}

h2 {
  font-size: 18px;
}

form {
  display: grid;
  gap: 12px;
}

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

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

.file-input {
  width: 100%;
  min-height: 48px;
  opacity: 0;
  position: absolute;
  left: 0;
  top: 0;
  cursor: pointer;
}

.file-button {
  position: relative;
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  width: 100%;
  background: #f8fafb;
  border: 1px solid var(--accent);
  border-radius: 6px;
  border-color: var(--accent);
  color: var(--accent-dark);
  font-weight: 650;
  cursor: pointer;
  overflow: hidden;
}

.file-name {
  color: var(--text);
  font-size: 13px;
  overflow-wrap: anywhere;
}

textarea {
  resize: vertical;
}

.actions,
.section-head {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
}

button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 14px;
  background: #fff;
  color: var(--text);
  font-weight: 650;
  cursor: pointer;
}

button[type="submit"] {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  flex: 1;
}

button.subtle {
  min-height: 36px;
  color: var(--muted);
  font-weight: 600;
}

button[type="submit"]:hover {
  background: var(--accent-dark);
}

.status {
  margin: 12px 0 0;
  color: var(--muted);
  min-height: 24px;
}

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

.items {
  display: grid;
  gap: 10px;
}

.item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  gap: 6px;
}

.item-title {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.item-meta {
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #e7f5f3;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 700;
}

.badge.failed {
  background: #fee4e2;
  color: var(--danger);
}

.hidden {
  display: none;
}

@media (max-width: 640px) {
  .shell {
    width: min(100% - 20px, 960px);
    margin: 10px auto;
  }

  .actions {
    display: grid;
  }
}
