:root {
  color-scheme: light;
  --ml-orange: #f5a95c;
  --ml-coral: #e85b5d;
  --ml-ink: #000;
  --ml-gray: #c9c8c8;
  --ml-teal: #4b9ba4;
  --ml-teal-logo: #72a6bf;
  --ml-paper: #fff;
  --ml-soft: #f7f7f6;
  --ml-line: #e4e1df;
  --ml-muted: #6f6f6f;
  --ml-console: #151515;
  font-family: "Futura PT", Futura, Poppins, Arial, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ml-ink);
  background: var(--ml-paper);
}

body {
  margin: 0;
}

button,
input,
select {
  font: inherit;
}

label {
  display: grid;
  gap: 6px;
  color: #344256;
  font-size: 13px;
  font-weight: 700;
}

select {
  min-height: 40px;
  border: 1px solid var(--ml-line);
  border-radius: 6px;
  padding: 0 10px;
  background: var(--ml-paper);
  color: var(--ml-ink);
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 999px;
  padding: 0 16px;
  background: var(--ml-coral);
  color: var(--ml-paper);
  font-weight: 800;
  cursor: pointer;
}

button.secondary {
  border: 1px solid var(--ml-gray);
  background: var(--ml-paper);
  color: var(--ml-ink);
}

button:disabled {
  cursor: default;
  opacity: 0.55;
}

.flash-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 0%, rgba(201, 200, 200, 0.16), transparent 28rem),
    linear-gradient(110deg, transparent 0 74%, rgba(201, 200, 200, 0.18) 74% 78%, transparent 78%),
    var(--ml-paper);
}

.flash-layout {
  max-width: 980px;
  margin: 0 auto;
  padding: 32px clamp(18px, 5vw, 56px);
}

.flash-header {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 28px;
  align-items: center;
  margin-bottom: 26px;
}

.brand-logo {
  width: 132px;
  height: auto;
  display: block;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--ml-teal);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.flash-layout h1 {
  max-width: 680px;
  margin: 0;
  font-size: clamp(20px, 3vw, 38px);
  font-weight: 500;
  line-height: 1.05;
}

.intro {
  margin: 0 0 20px;
  color: var(--ml-muted);
  font-size: 1rem;
  line-height: 1.5;
}

.intro a {
  color: var(--ml-teal);
  font-weight: 700;
}

.upload-panel {
  margin-bottom: 20px;
}

.file-drop {
  display: grid;
  gap: 8px;
  padding: 28px 24px;
  border: 2px dashed var(--ml-line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.file-drop:hover,
.file-drop.is-dragover {
  border-color: var(--ml-teal);
  background: #f3fafb;
}

.file-drop.is-ready {
  border-style: solid;
  border-color: var(--ml-teal);
}

.file-drop-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--ml-ink);
}

.file-drop-hint {
  color: var(--ml-muted);
  font-size: 0.95rem;
}

.file-name {
  margin-top: 6px;
  color: var(--ml-teal);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.settings-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 8px;
}

.settings-row label {
  min-width: 220px;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: 26px 0;
}

.status-grid div {
  border: 1px solid var(--ml-line);
  border-radius: 18px;
  padding: 14px 18px 16px;
  background: rgba(255, 255, 255, 0.86);
}

.status-grid span {
  display: block;
  margin-bottom: 6px;
  color: var(--ml-teal);
  font-size: 13px;
  font-weight: 800;
}

.status-grid strong {
  display: block;
  color: var(--ml-ink);
  font-size: 18px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}

.flash-page button {
  min-height: 50px;
  padding: 0 24px;
  box-shadow: none;
}

.flash-page button:not(.secondary) {
  background: var(--ml-coral);
}

.flash-page button:not(.secondary):hover {
  background: #d94f51;
}

.flash-page button.secondary:hover {
  border-color: var(--ml-teal);
}

progress {
  display: block;
  width: 100%;
  height: 10px;
  margin: 16px 0 22px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: #ecebea;
}

progress::-webkit-progress-bar {
  border-radius: 999px;
  background: #ecebea;
}

progress::-webkit-progress-value {
  border-radius: 999px;
  background: linear-gradient(90deg, var(--ml-teal), var(--ml-coral), var(--ml-orange));
}

progress::-moz-progress-bar {
  border-radius: 999px;
  background: linear-gradient(90deg, var(--ml-teal), var(--ml-coral), var(--ml-orange));
}

pre {
  min-height: 300px;
  max-height: 460px;
  overflow: auto;
  border: 0;
  border-radius: 18px;
  padding: 24px;
  background: var(--ml-console);
  color: #f5f5f5;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

@media (max-width: 640px) {
  .flash-header {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .brand-logo {
    width: 112px;
  }

  .flash-layout h1 {
    white-space: normal;
  }

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

  .actions {
    align-items: stretch;
    flex-direction: column;
  }

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

.monitor-panel {
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--ml-line);
}

.monitor-panel h2 {
  margin: 0 0 8px;
  font-size: 1.35rem;
  font-weight: 800;
}

.monitor-hint {
  margin: 0 0 16px;
  color: var(--ml-muted);
  line-height: 1.45;
}

.monitor-status {
  margin: 0 0 12px;
  color: var(--ml-teal);
  font-weight: 700;
}

.monitor-panel pre {
  min-height: 220px;
  max-height: 360px;
}

.monitor-send {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px auto;
  gap: 10px;
  margin-top: 12px;
}

.monitor-send input {
  min-height: 44px;
  border: 1px solid var(--ml-line);
  border-radius: 6px;
  padding: 0 12px;
  background: var(--ml-paper);
}
