body {
  margin: 0;
  background: #f8fafc;
  color: #102a43;
  font-family: Arial, sans-serif;
}

body.theme-dark {
  background: #030603;
  color: #a8ffb0;
  font-family: "Courier New", "Lucida Console", Monaco, monospace;
}

body.theme-light {
  background: #fff;
  color: #111;
  font-family: "Brush Script MT", "Segoe Script", "Snell Roundhand", cursive;
}

a {
  color: inherit;
}

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

.topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}

.topline a {
  color: #004085;
  font-weight: 800;
  text-decoration: none;
}

.hero {
  margin-bottom: 24px;
  border-bottom: 1px solid #d9e2ec;
  padding-bottom: 20px;
}

.kicker {
  margin: 0 0 8px;
  color: #2f855a;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

h1 {
  margin: 0;
  color: #102a43;
  font-size: 2.3rem;
}

.hero p,
.note {
  max-width: 780px;
  color: #52606d;
  line-height: 1.6;
}

.panel {
  background: #fff;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(16, 42, 67, 0.08);
  padding: 22px;
  margin-top: 18px;
}

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

.catalog-card {
  display: block;
  min-height: 150px;
  background: #fff;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(16, 42, 67, 0.08);
  padding: 20px;
  text-decoration: none;
}

.catalog-card span {
  display: block;
  color: #2f855a;
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.catalog-card h2 {
  margin: 8px 0;
  color: #102a43;
  font-size: 1.2rem;
}

.catalog-card p {
  color: #52606d;
  line-height: 1.5;
}

.drop-zone {
  display: grid;
  place-items: center;
  min-height: 130px;
  padding: 20px;
  border: 2px dashed #9fb3c8;
  border-radius: 8px;
  background: #f8fafc;
  color: #102a43;
  cursor: pointer;
  text-align: center;
}

.drop-zone.is-dragging {
  background: #e8fff1;
  border-color: #2f855a;
}

input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 18px 0;
}

label {
  display: grid;
  gap: 6px;
  color: #102a43;
  font-weight: 800;
}

select,
input,
textarea {
  box-sizing: border-box;
  border: 1px solid #bcccdc;
  border-radius: 6px;
  padding: 9px 10px;
  font: inherit;
}

textarea {
  width: 100%;
  min-height: 160px;
  resize: vertical;
  font-family: "Courier New", monospace;
}

button,
.download-link {
  border: 0;
  border-radius: 6px;
  background: #004085;
  color: #fff;
  cursor: pointer;
  font-weight: 900;
  padding: 9px 12px;
  text-decoration: none;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0;
}

canvas {
  width: 100%;
  max-width: 100%;
  height: auto;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  background: #f8fafc;
}

.output,
pre {
  min-height: 86px;
  margin: 12px 0;
  padding: 12px;
  border-radius: 8px;
  background: #102a43;
  color: #d9f99d;
  overflow: auto;
  white-space: pre-wrap;
  font-family: "Courier New", monospace;
}

.result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 10px;
  padding: 12px;
  border-radius: 8px;
  background: #f8fafc;
  border-left: 4px solid #2f855a;
}

.result-row strong,
.result-row span {
  display: block;
}

.result-row span {
  color: #52606d;
  font-size: 0.92rem;
}

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

.stats span {
  display: grid;
  gap: 4px;
  padding: 10px;
  border-radius: 8px;
  background: #f8fafc;
  color: #52606d;
}

.stats strong {
  color: #102a43;
}

.site-theme-toolbar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.site-theme-option {
  min-height: 32px;
  border: 1px solid #9fb3c8;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 900;
  padding: 6px 10px;
}

.site-theme-option[data-site-theme="dark"] {
  background: #030603;
  border-color: #2b7a38;
  color: #a8ffb0;
  font-family: "Courier New", "Lucida Console", Monaco, monospace;
}

.site-theme-option[data-site-theme="light"] {
  background: #fff;
  border-color: #111;
  color: #111;
  font-family: "Brush Script MT", "Segoe Script", "Snell Roundhand", cursive;
}

.site-theme-option.is-active {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.theme-dark .topline a,
.theme-dark .kicker,
.theme-dark h1,
.theme-dark .catalog-card h2,
.theme-dark label,
.theme-dark .stats strong {
  color: #c7ffd0;
}

.theme-dark .hero p,
.theme-dark .note,
.theme-dark .catalog-card p,
.theme-dark .result-row span,
.theme-dark .stats span {
  color: #a8ffb0;
}

.theme-dark .hero,
.theme-dark .panel,
.theme-dark .catalog-card,
.theme-dark .drop-zone,
.theme-dark .result-row,
.theme-dark .stats span {
  background: #061106;
  border-color: #2b7a38;
  color: #a8ffb0;
  box-shadow: 0 0 18px rgba(168, 255, 176, 0.1);
}

.theme-dark select,
.theme-dark input,
.theme-dark textarea {
  background: #030603;
  border-color: #2b7a38;
  color: #a8ffb0;
}

.theme-dark canvas {
  background: #030603;
  border-color: #2b7a38;
}

.theme-light .topline a,
.theme-light .kicker,
.theme-light h1,
.theme-light .catalog-card h2,
.theme-light label,
.theme-light .stats strong,
.theme-light .hero p,
.theme-light .note,
.theme-light .catalog-card p,
.theme-light .result-row span,
.theme-light .stats span {
  color: #111;
}

.theme-light .hero,
.theme-light .panel,
.theme-light .catalog-card,
.theme-light .drop-zone,
.theme-light .result-row,
.theme-light .stats span {
  background: #fff;
  border-color: #111;
  color: #111;
  box-shadow: none;
}

.theme-light select,
.theme-light input,
.theme-light textarea {
  background: #fff;
  border-color: #111;
  color: #111;
}

.theme-light canvas {
  background: #fff;
  border-color: #111;
}

@media (max-width: 640px) {
  .topline {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-theme-toolbar {
    margin-left: 0;
  }

  .result-row {
    align-items: flex-start;
    flex-direction: column;
  }
}

body.theme-dark {
  background: #000;
  color: #39ff14;
  font-family: "Courier New", "Lucida Console", Monaco, monospace;
  font-size: 1rem;
  line-height: 1.56;
}

body.theme-light {
  background: #fffff0;
  color: #1b1610;
  font-family: "Brush Script MT", "Segoe Script", "Snell Roundhand", "Apple Chancery", cursive;
  font-size: 1.12rem;
  line-height: 1.68;
}

body.theme-dark .topline a,
body.theme-dark .site-theme-toolbar,
body.theme-dark .kicker,
body.theme-dark h1,
body.theme-dark h2,
body.theme-dark h3,
body.theme-dark label,
body.theme-dark strong,
body.theme-dark a {
  color: #7cff7c;
  font-family: inherit;
}

body.theme-dark p,
body.theme-dark span,
body.theme-dark li,
body.theme-dark .note,
body.theme-dark .catalog-card p,
body.theme-dark .result-row span,
body.theme-dark .stats span {
  color: #39ff14;
}

body.theme-dark .hero,
body.theme-dark .panel,
body.theme-dark .catalog-card,
body.theme-dark .drop-zone,
body.theme-dark .result-row,
body.theme-dark .stats span {
  background: #000;
  border-color: #1fbf3a;
  color: #39ff14;
  box-shadow: 0 0 16px rgba(57, 255, 20, 0.16);
}

body.theme-dark button,
body.theme-dark .download-link,
body.theme-dark .site-theme-option {
  background: #000;
  border: 1px solid #39ff14;
  color: #39ff14;
  font-family: inherit;
}

body.theme-dark button:hover,
body.theme-dark .download-link:hover,
body.theme-dark .site-theme-option.is-active {
  background: #062b06;
  color: #b6ffb6;
}

body.theme-dark select,
body.theme-dark input,
body.theme-dark textarea,
body.theme-dark canvas,
body.theme-dark .output,
body.theme-dark pre {
  background: #000;
  border-color: #1fbf3a;
  color: #39ff14;
  font-family: inherit;
}

body.theme-light .topline a,
body.theme-light .site-theme-toolbar,
body.theme-light .kicker,
body.theme-light h1,
body.theme-light h2,
body.theme-light h3,
body.theme-light label,
body.theme-light strong,
body.theme-light a,
body.theme-light p,
body.theme-light span,
body.theme-light li,
body.theme-light .note,
body.theme-light .catalog-card p,
body.theme-light .result-row span,
body.theme-light .stats span {
  color: #1b1610;
  font-family: inherit;
}

body.theme-light .hero,
body.theme-light .panel,
body.theme-light .catalog-card,
body.theme-light .drop-zone,
body.theme-light .result-row,
body.theme-light .stats span {
  background: #fffff0;
  border-color: #1b1610;
  color: #1b1610;
  box-shadow: none;
}

body.theme-light button,
body.theme-light .download-link,
body.theme-light .site-theme-option {
  background: #fffff0;
  border: 1px solid #1b1610;
  color: #1b1610;
  font-family: inherit;
}

body.theme-light button:hover,
body.theme-light .download-link:hover,
body.theme-light .site-theme-option.is-active {
  background: #1b1610;
  color: #fffff0;
}

body.theme-light select,
body.theme-light input,
body.theme-light textarea,
body.theme-light canvas,
body.theme-light .output,
body.theme-light pre {
  background: #fffff0;
  border-color: #1b1610;
  color: #1b1610;
  font-family: inherit;
}
