:root {
  color-scheme: light;
  font-family: "Segoe UI", Arial, sans-serif;
  background: #f4f7f9;
  color: #16202a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

button,
input,
textarea {
  font: inherit;
}

.shell {
  width: min(1380px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

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

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 32px;
  line-height: 1.1;
}

h2 {
  font-size: 18px;
}

.toolbar p,
.hint {
  color: #5d6b78;
  margin-top: 6px;
}

.mode-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid #b9c6d3;
  background: #e7edf3;
  border-radius: 8px;
  overflow: hidden;
  min-width: 250px;
}

.mode-toggle button {
  border: 0;
  background: transparent;
  padding: 12px 14px;
  cursor: pointer;
}

.mode-toggle button.active {
  background: #174ea6;
  color: white;
}

.grid {
  display: grid;
  grid-template-columns: minmax(360px, 430px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.panel {
  background: white;
  border: 1px solid #d5dde5;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 8px 24px rgba(22, 32, 42, 0.06);
}

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

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

input,
textarea {
  width: 100%;
  border: 1px solid #b8c4cf;
  border-radius: 6px;
  padding: 10px 11px;
  background: #fbfdff;
}

.drop-zone {
  display: grid;
  place-items: center;
  min-height: 112px;
  border: 2px dashed #86a0b7;
  border-radius: 8px;
  background: #f1f6fa;
  color: #425466;
  text-align: center;
  padding: 14px;
}

.drop-zone.hot {
  border-color: #174ea6;
  background: #e7f0ff;
}

.capture-actions {
  display: flex;
  gap: 10px;
}

button {
  border: 1px solid #aebdca;
  border-radius: 6px;
  background: #f7fafc;
  color: #172432;
  padding: 10px 13px;
  cursor: pointer;
}

button:hover {
  background: #edf3f8;
}

.primary {
  border-color: #174ea6;
  background: #174ea6;
  color: white;
  font-weight: 700;
}

.primary:hover {
  background: #103f89;
}

.preview {
  min-height: 520px;
}

canvas {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  max-height: 72vh;
  background: #0f1720;
  border-radius: 6px;
}

#status {
  margin-top: 10px;
  color: #425466;
  min-height: 24px;
}

.hidden {
  display: none !important;
}

.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.entries {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.entry {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 12px;
  align-items: center;
  border: 1px solid #d9e1e8;
  border-radius: 8px;
  padding: 10px;
  background: #fbfdff;
}

.entry img {
  width: 88px;
  height: 64px;
  object-fit: cover;
  border-radius: 6px;
  background: #dce5ee;
}

.entry strong,
.entry span {
  display: block;
  overflow-wrap: anywhere;
}

.entry span {
  color: #5d6b78;
  font-size: 13px;
  margin-top: 4px;
}

@media (max-width: 860px) {
  .toolbar,
  .grid {
    display: grid;
  }

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

  .mode-toggle {
    width: 100%;
  }
}
