:root {
  --ink: #14231f;
  --muted: #4d635c;
  --line: color-mix(in srgb, var(--ink) 12%, transparent);
  --surface: color-mix(in srgb, #f7fbf8 88%, white);
  --surface-strong: #ffffffd9;
  --accent: #0f766e;
  --accent-deep: #0b4f4a;
  --warm: #c45c26;
  --ok: #1f7a4d;
  --warn: #9a6700;
  --radius: 14px;
  --font: "Manrope", "Noto Sans SC", sans-serif;
  --shadow-soft: 0 18px 50px color-mix(in srgb, #0b4f4a 10%, transparent);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: #e8f2ee;
  line-height: 1.5;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 520px at 8% -10%, #b7e4d6 0%, transparent 55%),
    radial-gradient(700px 480px at 92% 8%, #f3d5b8 0%, transparent 50%),
    linear-gradient(165deg, #eef7f3 0%, #e3eee9 48%, #dce8e3 100%);
  animation: drift 18s ease-in-out infinite alternate;
}

@keyframes drift {
  from { transform: scale(1) translateY(0); }
  to { transform: scale(1.04) translateY(-12px); }
}

@media (prefers-reduced-motion: reduce) {
  .atmosphere { animation: none; }
  .primary, .ghost, .fill-table tbody tr { transition: none; }
}

.page {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 120px;
}

.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  margin-bottom: 28px;
}

.brand-lockup { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background:
    linear-gradient(145deg, #19a392 0%, #0f766e 55%, #0b4f4a 100%);
  box-shadow: inset 0 0 0 1px #ffffff55;
  position: relative;
}
.brand-mark::after {
  content: "";
  position: absolute;
  inset: 11px 10px 12px 18px;
  border-radius: 999px 4px 999px 4px;
  background: #f3faf8;
  transform: rotate(-18deg);
}
.brand {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}
.brand-sub {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}
.companion {
  margin: 0;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 0.9rem;
}
.companion strong { color: var(--ink); font-weight: 600; }

.hero {
  margin-bottom: 22px;
  animation: rise 0.7s ease both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.order-chip {
  display: inline-block;
  margin: 0 0 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 12%, white);
  color: var(--accent-deep);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.hero h1 {
  margin: 0 0 8px;
  font-size: clamp(1.8rem, 3vw, 2.45rem);
  line-height: 1.15;
  letter-spacing: -0.04em;
  font-weight: 700;
  max-width: 16ch;
}
.lede {
  margin: 0 0 18px;
  max-width: 36rem;
  color: var(--muted);
  font-size: 1.02rem;
}
.progress-bar {
  height: 6px;
  width: min(360px, 100%);
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 8%, white);
  overflow: hidden;
}
.progress-bar span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #2aa391);
  transition: width 0.35s ease;
}
.progress-text {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
}

.guide {
  display: grid;
  gap: 6px;
  margin-bottom: 18px;
  padding: 14px 16px;
  border-left: 3px solid var(--accent);
  background: color-mix(in srgb, white 70%, #d7eee7);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--muted);
  font-size: 0.94rem;
}
.guide p { margin: 0; }
.guide strong { color: var(--ink); font-weight: 600; }
.guide code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
  color: var(--accent-deep);
  background: #ffffffaa;
  padding: 1px 6px;
  border-radius: 6px;
}

.sheet {
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  animation: rise 0.85s ease both;
  animation-delay: 0.08s;
}
.sheet-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.sheet-head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}
.sheet-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.table-wrap { overflow: auto; max-height: min(58vh, 640px); }

.fill-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.92rem;
}
.fill-table th,
.fill-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}
.fill-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f4faf7ee;
  backdrop-filter: blur(8px);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.8rem;
}
.fill-table th span {
  display: inline-block;
  margin-left: 4px;
  font-weight: 500;
  opacity: 0.7;
}
.fill-table th.primary-col { color: var(--accent-deep); }
.fill-table tbody tr { transition: background 0.2s ease; }
.fill-table tbody tr:hover { background: color-mix(in srgb, var(--accent) 5%, white); }
.fill-table tbody tr.is-complete { background: color-mix(in srgb, var(--ok) 6%, white); }
.fill-table .locked {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.fill-table .register { max-width: 220px; white-space: normal; }
.fill-table input,
.fill-table textarea {
  width: 100%;
  min-width: 140px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  color: var(--ink);
  background: color-mix(in srgb, white 80%, #e7f3ee);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.fill-table .primary-col + td input,
.fill-table td:nth-child(3) input {
  min-width: 180px;
  font-weight: 600;
  background: #fff;
  border-color: color-mix(in srgb, var(--accent) 28%, transparent);
}
.fill-table input:focus,
.fill-table textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
  background: #fff;
}
.fill-table textarea {
  min-height: 42px;
  resize: vertical;
  white-space: normal;
  min-width: 160px;
}
.status {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}
.status.ready { color: var(--ok); }
.status.bad { color: var(--warm); }
.status.pending { color: var(--warn); }

.submit-bar {
  position: sticky;
  bottom: 12px;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, #f7fbf8 92%, white);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-soft);
}
#feedback {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  min-height: 1.4em;
  flex: 1 1 220px;
}
.submit-actions { display: flex; flex-wrap: wrap; gap: 8px; }

button {
  font: inherit;
  cursor: pointer;
  border-radius: 10px;
  border: 1px solid transparent;
  padding: 10px 14px;
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease;
}
button:active { transform: translateY(1px); }
.ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}
.ghost:hover { background: #fff; }
.primary {
  background: var(--accent);
  color: #f4fffb;
  font-weight: 650;
  letter-spacing: -0.01em;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--accent) 28%, transparent);
}
.primary:hover { background: var(--accent-deep); }
.primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

@media (max-width: 720px) {
  .page { width: min(100% - 20px, 1180px); padding-top: 18px; }
  .hero h1 { max-width: none; }
  .submit-bar { bottom: 0; border-radius: 12px 12px 0 0; }
}
