:root {
  color-scheme: light;
  --bg: #eef5f4;
  --panel: #ffffff;
  --line: #d7e3e0;
  --text: #1d2b2a;
  --muted: #657777;
  --accent: #0f766e;
  --accent-strong: #0b5f59;
  --coral: #f97066;
  --blue: #3d9be9;
  --yellow: #f7c948;
  --danger: #b42318;
  --shadow: 0 18px 45px rgba(15, 67, 63, .12);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, #f7fbfa 0, var(--bg) 340px),
    var(--bg);
  color: var(--text);
  font-family: "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
}

.shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.shell.compact {
  padding-top: 16px;
}

.first-panel {
  margin-top: 0;
}

.tool-title {
  font-size: 28px;
  line-height: 1.25;
  margin: 2px 0 4px;
}

.hero,
.job-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 28px;
  align-items: center;
  margin-bottom: 18px;
}

.job-hero {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.hero-copy h1,
.job-hero h1 {
  max-width: 720px;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.18;
  letter-spacing: 0;
  margin: 6px 0 12px;
}

.hero-copy p,
.job-hero p {
  max-width: 660px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
}

.eyebrow {
  color: var(--accent);
  font-weight: 800;
  letter-spacing: 0;
}

.hero-art {
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: var(--shadow);
  background: #fff;
}

.hero-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.quick-map,
.status-help {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.status-help {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.map-item,
.status-help > div,
.panel,
.history,
.stat {
  background: rgba(255, 255, 255, .94);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(22, 67, 63, .06);
}

.map-item,
.status-help > div {
  min-height: 104px;
  padding: 14px;
  display: grid;
  align-content: start;
  gap: 6px;
}

.map-item .sprite,
.status-help .sprite,
.section-title .sprite,
.stat .sprite {
  filter: drop-shadow(0 8px 12px rgba(21, 83, 78, .12));
}

.map-item strong,
.status-help strong {
  font-size: 15px;
}

.map-item span:last-child,
.status-help p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  margin: 0;
}

.panel,
.history {
  padding: 20px;
  margin-top: 16px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h2 {
  font-size: 19px;
}

h3 {
  font-size: 17px;
}

.section-title,
.step-head {
  display: flex;
  gap: 12px;
  align-items: center;
}

.section-title p,
.step-head p,
.muted {
  color: var(--muted);
}

.job-form {
  display: grid;
  gap: 18px;
}

.step-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fbfdfc;
}

.step-head {
  margin-bottom: 14px;
}

.step-no {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  flex: 0 0 auto;
}

.grid {
  display: grid;
  gap: 14px;
}

.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

label {
  display: grid;
  gap: 7px;
  font-size: 13px;
  font-weight: 800;
}

input,
select,
button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  font: inherit;
  background: white;
}

input:focus,
select:focus {
  outline: 3px solid rgba(15, 118, 110, .18);
  border-color: var(--accent);
}

.file-card,
.choice-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
}

.file-card {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
}

.file-card input {
  grid-column: 1 / -1;
}

.file-card small,
.choice-card small {
  color: var(--muted);
  font-weight: 600;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.mode-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.mode-card input[type="radio"] {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 18px;
  min-height: 18px;
}

.mode-card strong,
.mode-card small {
  grid-column: 2;
}

.mode-card small {
  color: var(--muted);
  font-weight: 600;
  line-height: 1.45;
}

.mode-card:has(input[type="radio"]:checked) {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, .14);
}

.choice-card {
  position: relative;
  display: grid;
  gap: 8px;
  align-content: start;
}

.choice-card > input[type="radio"] {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 18px;
  min-height: 18px;
}

.choice-card:has(input[type="radio"]:checked) {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, .14);
}

.checks {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.checks label {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
}

button,
.primary,
.danger,
.link-button {
  cursor: pointer;
}

.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
  font-weight: 800;
}

.primary:hover {
  background: var(--accent-strong);
}

.large {
  min-height: 52px;
  font-size: 16px;
}

.danger {
  border-color: #f3c7c1;
  color: var(--danger);
}

.actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.stat {
  min-height: 112px;
  padding: 14px;
  display: grid;
  align-content: start;
  gap: 4px;
}

.stat strong {
  display: block;
  font-size: 28px;
}

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

.table,
.rows {
  display: grid;
  gap: 8px;
}

.row,
.job-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr .7fr;
  gap: 12px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
  background: white;
}

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

.job-row {
  grid-template-columns: 64px 1.4fr .8fr 1.2fr;
}

.badge {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 800;
  background: #edf2f7;
}

.badge.success {
  background: #dff3ea;
  color: #095846;
}

.badge.failed,
.badge.invalid {
  background: #fde7e7;
  color: var(--danger);
}

.badge.running {
  background: #e5f0ff;
  color: #175cd3;
}

.logs {
  height: 320px;
  overflow: auto;
  white-space: pre-wrap;
  background: #102120;
  color: #eaf7f5;
  padding: 14px;
  border-radius: 8px;
  margin-top: 14px;
}

.back,
.link-button {
  display: inline-flex;
  color: var(--accent);
  text-decoration: none;
  font-weight: 800;
}

.link-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
  background: #fff;
}

.result-link {
  margin-top: 12px;
}

.status-art {
  width: 96px;
}

.sprite {
  display: inline-block;
  width: 64px;
  height: 64px;
  border-radius: 8px;
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  background-color: #e8f7f4;
  border: 1px solid #d3ebe7;
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, .55);
  flex: 0 0 auto;
}

.sprite.small {
  width: 42px;
  height: 42px;
}

.sprite.xl {
  width: 96px;
  height: 96px;
}

.sprite.sheet { background-image: url("/web_static/assets/icon-sheet.png"); }
.sprite.zip { background-image: url("/web_static/assets/icon-zip.png"); }
.sprite.drive { background-image: url("/web_static/assets/icon-drive.png"); }
.sprite.login { background-image: url("/web_static/assets/icon-login.png"); }
.sprite.captcha { background-image: url("/web_static/assets/icon-captcha.png"); }
.sprite.progress { background-image: url("/web_static/assets/icon-progress.png"); }

@media (max-width: 900px) {
  .hero,
  .job-hero,
  .status-help,
  .stats,
  .choice-grid,
  .mode-grid,
  .two {
    grid-template-columns: 1fr;
  }

  .quick-map {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-art {
    max-width: 360px;
  }

  .actions {
    flex-wrap: wrap;
  }
}

@media (max-width: 680px) {
  .shell {
    width: min(100% - 20px, 1180px);
    padding-top: 18px;
  }

  .row,
  .job-row,
  .section-head {
    grid-template-columns: 1fr;
    display: grid;
  }

  .hero {
    gap: 18px;
  }

  .hero-copy h1 {
    font-size: 28px;
  }

  .hero-art {
    max-width: 352px;
  }

  .map-item {
    min-height: 96px;
    padding: 12px;
  }

  .map-item .sprite {
    width: 48px;
    height: 48px;
  }
}
