:root {
  --bg: #f7f4ef;
  --surface: #fff;
  --surface-alt: #f1ece3;
  --border: #e0d9cd;
  --border-strong: #c7bdac;
  --text: #2e2a26;
  --text-muted: #6d655c;
  --text-faint: #8b8178;
  --accent: #b4551f;
  --accent-hover: #8f4218;
  --accent-soft: #fbf0e6;
  --ok-bg: #edf5ed;
  --ok-border: #a9cbab;
  --ok-text: #2a6b2e;
  --err-bg: #fdeeec;
  --err-border: #e0a49c;
  --err-text: #a3271b;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
}

.container {
  max-width: 1024px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

header {
  text-align: center;
  margin-bottom: 1.5rem;
}

header h1 {
  /* Shrink-wrapped so the hover above only triggers on the title itself. */
  display: inline-block;
  font-size: 2rem;
  color: var(--text);
  letter-spacing: 0.05em;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
}

/*
 * Hovering the title says the pun out loud: fitfall.de reads pitfall.  The p
 * is stacked onto the f rather than replacing it, and the .de only fades, so
 * the word stays exactly where it was instead of jumping under the cursor.
 */
.annotated-title .tld {
  color: var(--text-faint);
}

.annotated-title .pun-f,
.annotated-title .pun-p,
.annotated-title .tld {
  transition: opacity 0.2s;
}

.annotated-title .pun-p {
  /* One monospace advance back, plus the letter-spacing above. */
  margin-left: calc(-1ch - 0.05em);
  opacity: 0;
  -webkit-user-select: none;
  user-select: none;
}

.annotated-title:hover .pun-f,
.annotated-title:hover .tld {
  opacity: 0;
}

.annotated-title:hover .pun-p {
  opacity: 1;
}

.tagline {
  margin-top: 0.4rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

.wb {
  position: relative;
  padding-bottom: 6px;
  margin-bottom: 4px;
  margin-right: 0.15em;
  transition: color 0.2s;
  cursor: default;
}

.wb::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 5px;
  border-left: 1.5px solid var(--border-strong);
  border-right: 1.5px solid var(--border-strong);
  border-bottom: 1.5px solid var(--border-strong);
  border-radius: 0 0 4px 4px;
  transition: border-color 0.2s;
}

.wb:last-of-type {
  margin-right: 0;
}

.wb:hover {
  color: var(--accent);
}

.wb:hover::before {
  border-color: var(--accent);
}

.main-panel {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.full-width-panel {
  margin-bottom: 2rem;
}

.cat-art {
  flex: 0 0 auto;
  width: 280px;
}

.cat-art {
  position: relative;
}

.cat-art img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  transition: opacity 2s ease;
  position: absolute;
  top: 0;
  left: 0;
}

.cat-art img:first-child {
  position: relative;
}

.cat-art img.cat-hidden {
  opacity: 0;
  pointer-events: none;
}

.controls-panel {
  flex: 1;
  min-width: 0;
}

@media (max-width: 640px) {
  .main-panel {
    flex-direction: column;
  }

  .cat-art {
    width: 200px;
    align-self: center;
  }
}

.dropzone {
  border: 2px dashed var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  padding: 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  margin-bottom: 1rem;
  min-height: calc(280px * 1259 / 1536);
  display: flex;
  align-items: center;
  justify-content: center;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.dropzone p {
  color: var(--text-muted);
  pointer-events: none;
}

.dropzone input[type="file"] {
  display: none;
}

.progress-container {
  height: 6px;
  background: var(--surface-alt);
  border-radius: 3px;
  margin-bottom: 1rem;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.fit-info {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0 1.2rem 1rem;
  margin-bottom: 1rem;
}

.fit-tabs {
  display: flex;
  gap: 0;
  margin: 0 -1.2rem;
  padding: 0 1.2rem;
  border-bottom: 1px solid var(--border);
}

.fit-tab {
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.7rem 1rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.fit-tab:hover {
  color: var(--text);
}

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

.fit-tab-content {
  padding-top: 0.8rem;
}

.fit-info table {
  width: 100%;
  border-collapse: collapse;
}

.fit-info td {
  padding: 0.2rem 0.5rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}

.fit-info td:first-child {
  color: var(--text-muted);
  white-space: nowrap;
}

.fit-info .row-orig td {
  color: var(--text-faint);
}

.sig-count {
  color: var(--accent);
  font-weight: 700;
}

.empty-note {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.empty-note-sm {
  color: var(--text-faint);
  font-size: 0.8rem;
  padding: 0.3rem 0;
}

.img-download {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dotted var(--border-strong);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.img-download:hover {
  color: var(--accent);
  border-color: var(--accent);
  width: 1%;
}

.error-box {
  background: var(--err-bg);
  border: 1px solid var(--err-border);
  border-radius: 6px;
  padding: 0.8rem 1rem;
  margin-bottom: 1rem;
  color: var(--err-text);
  font-size: 0.9rem;
}

.options {
  margin-bottom: 1.2rem;
}

.options label {
  display: block;
  padding: 0.4rem 0;
  cursor: pointer;
  font-size: 0.95rem;
}

.options input[type="checkbox"] {
  margin-right: 0.5rem;
  accent-color: var(--accent);
}

.debug-separator,
.option-separator {
  border: none;
  border-top: 1px dashed var(--border-strong);
  margin: 0.6rem 0 0.2rem;
}

.method-option {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.method-option label {
  cursor: default;
}

.method-option select {
  flex: 1 1 18rem;
  padding: 0.3rem 0.4rem;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}

.method-option select:focus {
  outline: none;
  border-color: var(--accent);
}

.method-option input[type="text"] {
  flex: 0 1 11rem;
  padding: 0.3rem 0.4rem;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  color: var(--text);
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.9rem;
}

.method-option input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
}

.option-note {
  margin: 0 0 0.4rem;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.option-note code {
  font-size: 0.95em;
}

.option-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.kernel-option {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.kernel-upload {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.kernel-upload input[type="file"] {
  display: none;
}

.kernel-upload span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.browse-btn {
  font-family: inherit;
  font-size: 0.8rem;
  padding: 0.2rem 0.6rem;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  cursor: pointer;
}

.browse-btn:hover {
  background: var(--surface-alt);
  border-color: var(--accent);
}

.root-btn {
  display: block;
  width: 100%;
  padding: 0.9rem;
  font-size: 1.35rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-transform: lowercase;
  transition: background 0.15s;
  margin-bottom: 1rem;
}

.root-btn:hover {
  background: var(--accent-hover);
}

.root-btn:active {
  background: var(--accent-hover);
}

.root-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--accent);
}

.download-section {
  text-align: center;
  margin-bottom: 1rem;
}

.download-link {
  display: inline-block;
  padding: 0.8rem 1.5rem;
  background: var(--ok-bg);
  border: 1px solid var(--ok-border);
  border-radius: 6px;
  color: var(--ok-text);
  text-decoration: none;
  font-size: 1rem;
  transition: background 0.2s;
}

.download-link:hover {
  background: #e2efe2;
}

.explainer {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.explainer h2 {
  font-size: 1.1rem;
  color: var(--text);
  margin-bottom: 0.8rem;
}

.explainer p {
  margin-bottom: 0.8rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.qa {
  margin-bottom: 1rem;
}

.qa dt {
  font-weight: 600;
  color: var(--text);
  font-size: 0.95rem;
  margin-bottom: 0.3rem;
  margin-top: 1.2rem;
}

.qa dt:first-child {
  margin-top: 0;
}

.qa dd {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-left: 0;
  margin-bottom: 0.5rem;
}

.qa dd p {
  margin: 0 0 0.6rem;
}

.qa dd p:last-child {
  margin-bottom: 0;
}

.explainer ul {
  margin: 0.5rem 0 1rem 1.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.explainer li {
  margin-bottom: 0.4rem;
}

.explainer a {
  color: var(--accent);
}

.explainer a:hover {
  color: var(--accent-hover);
}

.explainer code {
  background: var(--surface-alt);
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  font-size: 0.85rem;
  color: var(--text);
  font-family: 'JetBrains Mono', 'Courier New', monospace;
}

.disclaimer {
  color: var(--text-muted) !important;
  font-size: 0.85rem !important;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.8rem 1rem;
}

footer {
  text-align: center;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  color: var(--text-faint);
  font-size: 0.8rem;
}

/* A hairline between the copyright and the source link: there if looked for. */
.footer-sep {
  display: inline-block;
  width: 1px;
  height: 0.75em;
  margin: 0 0.6rem;
  vertical-align: -0.08em;
  background: var(--border);
}

.footer-github {
  text-decoration: none;
  opacity: 0.65;
}

.footer-github:hover,
.footer-github:focus-visible {
  opacity: 1;
}

.footer-github img {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  vertical-align: -0.2em;
}

.config-entry {
  margin-bottom: 0.3rem;
}

.config-header {
  padding: 0.4rem 0.5rem;
  cursor: pointer;
  font-size: 0.85rem;
  border-radius: 4px;
  transition: background 0.15s;
}

.config-header:hover {
  background: var(--surface-alt);
}

.config-toggle {
  display: inline-block;
  width: 1em;
  font-size: 0.7rem;
  color: var(--text-faint);
  transition: color 0.15s;
}

.config-header:hover .config-toggle {
  color: var(--accent);
}

.config-images {
  padding-left: 1.5rem;
}

.config-images table {
  width: 100%;
  border-collapse: collapse;
}

.config-images td {
  padding: 0.15rem 0.5rem;
  font-size: 0.8rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
}

.badge-default,
.badge-signed,
.badge-x509,
.badge-hab,
.badge-vab,
.badge-entry,
.badge-broken,
.badge-pwned {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  padding: 0.05rem 0.35rem;
  border-radius: 3px;
  border: 1px solid;
  letter-spacing: 0.05em;
  margin-left: 0.3rem;
  vertical-align: middle;
}

.badge-default {
  background: #eaf1f7;
  border-color: #a9c5dd;
  color: #2b5f8a;
  text-transform: uppercase;
}

.badge-signed {
  background: #fbf0e6;
  border-color: #ddab74;
  color: #96551b;
}

.badge-x509,
.badge-hab,
.badge-vab,
.badge-entry {
  background: #f8f3dd;
  border-color: #cfbf7e;
  color: #7a6712;
}

.badge-broken,
.badge-pwned {
  font-size: 0.75rem;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  text-transform: uppercase;
  margin-left: 0.4rem;
}

.badge-pwned {
  background: var(--ok-bg);
  border-color: var(--ok-border);
  color: var(--ok-text);
}

.badge-broken {
  background: var(--err-bg);
  border-color: var(--err-border);
  color: var(--err-text);
}

.fit-select {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem 1.2rem;
  margin-bottom: 1rem;
}

.fit-select h2 {
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 0.3rem;
}

.fit-select p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.8rem;
}

.fit-select-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.7rem 1rem;
  margin-bottom: 0.4rem;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.fit-select-btn:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.fit-select-btn strong {
  color: var(--accent);
}

.hidden {
  display: none !important;
}
