:root {
  --bg: #f6f3ee;
  --panel: #ffffff;
  --text: #1f2933;
  --muted: #667085;
  --primary: #2f5d62;
  --primary-dark: #24494d;
  --primary-soft: #edf5f4;
  --accent: #b7791f;
  --border: #ded7cc;
  --line: #ebe5dc;
  --warn: #fff7ed;
  --warn-border: #f3c58f;
  --ok: #eef8f1;
  --ok-border: #b7dfc2;
  --shadow: 0 10px 26px rgba(31, 41, 51, .06);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 15px;
}

.site-header {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 26px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}
.eyebrow {
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  margin: 0 0 8px;
}
h1 {
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.15;
  margin: 0 0 10px;
  font-weight: 700;
}
h2 { margin: 0; font-size: 21px; }
h3 { margin: 0 0 12px; font-size: 17px; }
.subtitle {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
}
.summary-card {
  min-width: 250px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fbfaf8;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  overflow: hidden;
}
.summary-card div {
  padding: 14px 12px;
  text-align: center;
  border-left: 1px solid var(--line);
}
.summary-card div:first-child { border-left: 0; }
.summary-card span { display: block; font-size: 24px; font-weight: 700; color: var(--primary); }
.summary-card small { color: var(--muted); }

.layout {
  max-width: 1180px;
  margin: 22px auto 40px;
  padding: 0 22px;
  display: grid;
  gap: 16px;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px;
  box-shadow: var(--shadow);
}
.full { overflow: hidden; }
.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.section-title.compact { margin-bottom: 6px; }
.step {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex: 0 0 auto;
}
.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.top-space { margin-top: 12px; }
label {
  display: grid;
  gap: 7px;
  color: #475467;
  font-weight: 600;
}
input, select {
  width: 100%;
  border: 1px solid #cfc7bd;
  border-radius: 8px;
  padding: 10px 11px;
  font-size: 15px;
  color: var(--text);
  background: #fff;
  outline: none;
}
input:focus, select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(47, 93, 98, .12);
}
.check-row {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.check-row label { display: flex; align-items: center; gap: 8px; }
.check-row input { width: auto; }
.info-box {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid #d8c29d;
  background: #fffaf1;
  border-radius: 9px;
  color: #5f4b2d;
  line-height: 1.5;
}
.hint { color: var(--muted); line-height: 1.55; margin-top: 0; }
.upload-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.upload-card {
  background: #fcfbf8;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
}
.upload-card p { color: var(--muted); line-height: 1.5; }
code { background: #f0ebe3; padding: 2px 6px; border-radius: 5px; font-size: .92em; }
.action-panel { display: flex; justify-content: space-between; gap: 18px; align-items: center; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
button {
  border: 0;
  background: var(--primary);
  color: #fff;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background .14s ease, opacity .14s ease;
}
button:hover { background: var(--primary-dark); }
button:disabled { opacity: .45; cursor: not-allowed; }
button.secondary { background: #475467; }
button.secondary:hover { background: #344054; }
button.ghost { background: var(--primary-soft); color: var(--primary); padding: 9px 12px; }
button.ghost:hover { background: #dfeeed; }
.message { margin-top: 12px; color: var(--muted); }
.message.error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; padding: 12px; border-radius: 8px; }
.message.ok { background: var(--ok); color: #166534; border: 1px solid var(--ok-border); padding: 12px; border-radius: 8px; }
.message.warn { background: var(--warn); color: #9a3412; border: 1px solid var(--warn-border); padding: 12px; border-radius: 8px; }
.tabs { display: flex; gap: 8px; padding-bottom: 14px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.tab { background: #f0ebe3; color: #475467; }
.tab.active { background: var(--primary); color: white; }
.table-wrap { max-height: 520px; overflow: auto; border: 1px solid var(--border); border-radius: 10px; margin-top: 14px; }
table { border-collapse: collapse; width: 100%; min-width: 780px; font-size: 14px; }
th, td { border-bottom: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top; }
th { position: sticky; top: 0; background: #f7f4ef; z-index: 1; font-weight: 700; color: #344054; }
tr:nth-child(even) td { background: #fdfbf8; }
.badge { display: inline-block; background: var(--primary-soft); color: var(--primary); padding: 4px 8px; border-radius: 999px; font-weight: 700; }
.warn-list { display: grid; gap: 10px; margin-top: 14px; }
.warn-item { padding: 12px; border-radius: 8px; background: var(--warn); border: 1px solid var(--warn-border); }
.empty { color: var(--muted); padding: 18px; }
footer { max-width: 1180px; margin: 0 auto 30px; padding: 0 22px; color: var(--muted); }

@media (max-width: 880px) {
  .header-inner, .action-panel { flex-direction: column; align-items: stretch; }
  .summary-card, .grid.two, .upload-grid { grid-template-columns: 1fr; }
  .actions { justify-content: flex-start; }
}


/* v1.5: Header/mobile overflow fixes */
html, body { width: 100%; max-width: 100%; overflow-x: hidden; }
.site-header { width: 100%; }
.header-copy { min-width: 0; }
.eyebrow, h1, .subtitle { overflow-wrap: anywhere; }
.summary-card { flex: 0 0 auto; }

@media (max-width: 560px) {
  body { font-size: 14px; }
  .header-inner {
    padding: 20px 14px 18px;
    gap: 16px;
  }
  .eyebrow {
    font-size: 11px;
    line-height: 1.45;
    letter-spacing: .015em;
    word-break: normal;
  }
  h1 {
    font-size: clamp(28px, 9vw, 36px);
    line-height: 1.08;
  }
  .subtitle {
    font-size: 15px;
    line-height: 1.5;
  }
  .summary-card {
    width: 100%;
    min-width: 0;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .summary-card div { padding: 11px 8px; }
  .summary-card span { font-size: 22px; }
  .layout {
    margin-top: 14px;
    padding: 0 12px;
    gap: 12px;
  }
  .panel {
    padding: 18px 14px;
    border-radius: 10px;
  }
  h2 { font-size: 19px; }
  input, select { font-size: 16px; }
  .tabs { gap: 6px; }
  .tab { padding: 9px 11px; }
}
