:root {
  color-scheme: light;
  --ink: #10233f;
  --ink-soft: #2a3f5c;
  --paper: #eef3f8;
  --surface: #ffffff;
  --line: #c5d0de;
  --muted: #5a6b82;
  --accent: #0e7c6b;
  --accent-hover: #0a6356;
  --accent-soft: #d8f3ee;
  --action: #d97706;
  --action-hover: #b45309;
  --console: #0b1626;
  --console-text: #d7e4f5;
  --progress-a: #1d4ed8;
  --progress-b: #0e7c6b;
  --font-display: "Space Grotesk", "Segoe UI", sans-serif;
  --font-body: "IBM Plex Sans", "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", Consolas, monospace;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
}

body {
  margin: 0;
}

button,
input,
select {
  font: inherit;
}

label {
  display: grid;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--surface);
  color: var(--ink);
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  background: var(--action);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

button:hover:not(:disabled) {
  background: var(--action-hover);
}

button.secondary {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

button.secondary:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

button:disabled {
  cursor: default;
  opacity: 0.55;
}

.flash-page {
  min-height: 100vh;
  background:
    radial-gradient(ellipse 70% 45% at 0% -10%, rgba(14, 124, 107, 0.14), transparent 55%),
    radial-gradient(ellipse 55% 40% at 100% 0%, rgba(29, 78, 216, 0.1), transparent 50%),
    linear-gradient(180deg, #f4f7fb 0%, var(--paper) 40%, #e6edf5 100%);
}

.flash-layout {
  max-width: 980px;
  margin: 0 auto;
  padding: 36px clamp(18px, 5vw, 56px) 56px;
}

.flash-header {
  display: block;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.flash-layout h1 {
  max-width: 18ch;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 4vw, 2.65rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.intro {
  margin: 0 0 22px;
  max-width: 54ch;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.55;
}

.intro a {
  color: var(--accent);
  font-weight: 600;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

.upload-panel {
  margin-bottom: 20px;
}

.file-drop {
  display: grid;
  gap: 8px;
  padding: 30px 24px;
  border: 1.5px dashed var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.file-drop:hover,
.file-drop.is-dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px rgba(14, 124, 107, 0.12);
}

.file-drop.is-ready {
  border-style: solid;
  border-color: var(--accent);
  background: var(--surface);
}

.file-drop-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ink);
}

.file-drop-hint {
  color: var(--muted);
  font-size: 0.95rem;
}

.file-name {
  margin-top: 6px;
  color: var(--accent);
  font-weight: 600;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  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: 14px;
  margin: 24px 0;
}

.status-grid div {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px 15px;
  background: var(--surface);
}

.status-grid span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-grid strong {
  display: block;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.flash-page button {
  min-height: 48px;
  padding: 0 22px;
}

.flash-page button:not(.secondary) {
  background: var(--action);
}

.flash-page button:not(.secondary):hover:not(:disabled) {
  background: var(--action-hover);
}

progress {
  display: block;
  width: 100%;
  height: 8px;
  margin: 14px 0 20px;
  overflow: hidden;
  border: 0;
  border-radius: 4px;
  background: #d5dee9;
}

progress::-webkit-progress-bar {
  border-radius: 4px;
  background: #d5dee9;
}

progress::-webkit-progress-value {
  border-radius: 4px;
  background: linear-gradient(90deg, var(--progress-a), var(--progress-b));
}

progress::-moz-progress-bar {
  border-radius: 4px;
  background: linear-gradient(90deg, var(--progress-a), var(--progress-b));
}

pre {
  min-height: 300px;
  max-height: 460px;
  overflow: auto;
  border: 1px solid #1a2b44;
  border-radius: 10px;
  padding: 20px 22px;
  background: var(--console);
  color: var(--console-text);
  font-family: var(--font-mono);
  font-size: 0.86rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.monitor-panel {
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.monitor-panel h2 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.monitor-hint {
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.5;
}

.monitor-status {
  margin: 0 0 12px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 500;
}

.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(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--surface);
  color: var(--ink);
}

.monitor-send input:focus,
select:focus {
  outline: 2px solid rgba(14, 124, 107, 0.35);
  outline-offset: 1px;
}

@media (max-width: 640px) {
  .flash-layout h1 {
    max-width: none;
  }

  .status-grid {
    grid-template-columns: 1fr;
  }

  .actions {
    align-items: stretch;
    flex-direction: column;
  }

  .monitor-send {
    grid-template-columns: 1fr;
  }
}
