:root {
  --brand: #4d7e77;
  --brand-dark: #3d6862;
  --brand-soft: #eef6f4;
  --brand-softer: #f4f9f7;
  --bg: #f9fafb;
  --surface: #ffffff;
  --text: #232832;
  --muted: #7b818b;
  --line: #e6e9ec;
  --line-strong: #d8dddf;
  --danger: #bd4b4b;
  --danger-soft: #fff3f3;
  --warning: #9a6b26;
  --warning-soft: #fff8e8;
  --success: #3f756d;
  --success-soft: #eef8f5;
  --shadow: 0 8px 28px rgba(35, 40, 50, 0.06);
  --shadow-soft: 0 2px 10px rgba(35, 40, 50, 0.045);
  --card-radius: 16px;
  --control-radius: 11px;
  --sidebar-width: 255px;
  --topbar-height: 72px;
  --font-sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", Meiryo, sans-serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { color-scheme: light; }

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

button,
input,
select,
textarea { font: inherit; }

button,
a { -webkit-tap-highlight-color: transparent; }

a { color: var(--brand-dark); }

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(77, 126, 119, 0.22);
  outline-offset: 2px;
}

input,
select,
textarea {
  width: 100%;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--control-radius);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input:not([type="checkbox"]):not([type="color"]):not([type="file"]),
select { min-height: 44px; padding: 0.65rem 0.82rem; }

textarea { padding: 0.82rem 0.9rem; resize: vertical; }

input:hover,
select:hover,
textarea:hover { border-color: #bdc8c5; }

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(77, 126, 119, 0.11);
  outline: 0;
}

input:disabled,
select:disabled,
textarea:disabled,
button:disabled { cursor: not-allowed; opacity: 0.56; }

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

h1,
h2,
h3 {
  color: var(--text);
  font-family: var(--font-sans);
  letter-spacing: -0.025em;
}

h1 { font-size: clamp(1.65rem, 3vw, 2rem); line-height: 1.3; }
h2 { font-size: 1.18rem; line-height: 1.4; }
h3 { font-size: 1rem; line-height: 1.5; }

.primary-button,
.secondary-button,
.text-button,
.icon-button,
.secondary-link {
  border-radius: var(--control-radius);
  font-weight: 700;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease, color 150ms ease;
}

.primary-button {
  color: #fff;
  background: var(--brand);
  border: 1px solid var(--brand);
  box-shadow: 0 2px 5px rgba(77, 126, 119, 0.14);
}

.primary-button:hover:not(:disabled) { background: var(--brand-dark); border-color: var(--brand-dark); }

.secondary-button,
.secondary-link {
  color: var(--brand-dark);
  background: #fff;
  border: 1px solid var(--line-strong);
  box-shadow: none;
}

.secondary-button:hover:not(:disabled),
.secondary-link:hover { color: var(--brand-dark); background: var(--brand-soft); border-color: #c7d9d5; }

.text-button { color: var(--brand-dark); }
.text-button.danger { color: var(--danger); }
.helper-text, .field-meta { color: var(--muted); }

.status-message.error {
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid #f0d3d3;
  border-radius: 10px;
  padding: 0.7rem 0.82rem;
}

.status-message.success {
  color: var(--success);
  background: var(--success-soft);
  border: 1px solid #d5e9e4;
  border-radius: 10px;
  padding: 0.7rem 0.82rem;
}

.eyebrow {
  color: var(--brand);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Customer flow */
body.customer-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% -10%, rgba(77, 126, 119, 0.11), transparent 30rem),
    var(--bg);
}

.customer-topbar {
  min-height: 68px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.customer-topbar-inner {
  width: min(100%, 1040px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.customer-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.ui-brand-mark {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  color: #fff;
  background: var(--brand);
  border-radius: 11px;
  font-size: 0.9rem;
  box-shadow: 0 4px 12px rgba(77, 126, 119, 0.18);
}

.customer-store-label { color: var(--muted); font-size: 0.82rem; }

body.customer-body .app-shell {
  width: min(calc(100% - 32px), 590px);
  min-height: auto;
  margin: 42px auto 28px;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

body.customer-body .brand-header {
  padding: 28px 30px 20px;
  border: 0;
  background: #fff;
  text-align: center;
  justify-content: center;
}

body.customer-body .brand-copy { width: 100%; }
body.customer-body .brand-copy h1 { margin: 0.2rem 0 0; font-size: 1.25rem; }
body.customer-body .eyebrow-row { justify-content: center; }

body.customer-body .notice-card {
  margin: 0 30px 22px;
  padding: 16px 18px;
  color: var(--text);
  background: var(--brand-softer);
  border: 1px solid #dcebe7;
  border-radius: 13px;
  box-shadow: none;
}

body.customer-body .notice-card strong { color: var(--brand-dark); }
body.customer-body .notice-card p { color: var(--muted); margin-bottom: 0; }

body.customer-body .progress {
  position: relative;
  margin: 0 30px;
  padding: 0 0 22px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  border: 0;
}

body.customer-body .progress::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 7px;
  height: 3px;
  background: var(--line);
  border-radius: 999px;
}

body.customer-body .progress-item {
  position: relative;
  padding: 0;
  color: #9aa0a8;
  background: transparent;
  border: 0;
  font-size: 0.74rem;
  font-weight: 700;
  text-align: center;
}

body.customer-body .progress-item::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -18px;
  width: 9px;
  height: 9px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--line-strong);
  transform: translateX(-50%);
  z-index: 1;
}

body.customer-body .progress-item.is-active { color: var(--brand-dark); background: transparent; }
body.customer-body .progress-item.is-active::after { background: var(--brand); }

body.customer-body .step { padding: 24px 30px 30px; }
body.customer-body .section-heading { text-align: center; margin-bottom: 24px; }
body.customer-body .section-heading h2 { font-size: 1.38rem; margin: 0.45rem 0 0.55rem; }
body.customer-body .section-heading p { color: var(--muted); margin-bottom: 0; }

body.customer-body .step-label {
  display: inline-flex;
  padding: 0.25rem 0.62rem;
  color: var(--brand-dark);
  background: var(--brand-soft);
  border-radius: 999px;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
}

body.customer-body .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
body.customer-body .category-button,
body.customer-body .choice-chips button,
body.customer-body .candidate-card {
  border-color: var(--line);
  border-radius: 13px;
  box-shadow: none;
}

body.customer-body .category-button:hover,
body.customer-body .choice-chips button:hover,
body.customer-body .candidate-card:hover { border-color: #a9c4be; background: var(--brand-softer); }

body.customer-body .category-button.is-selected,
body.customer-body .choice-chips button.is-selected,
body.customer-body .candidate-card.is-selected {
  color: var(--brand-dark);
  background: var(--brand-soft);
  border-color: var(--brand);
}

body.customer-body .candidate-list { gap: 12px; }
body.customer-body .candidate-card { padding: 17px 18px; background: #fff; }
body.customer-body .candidate-card p { color: var(--text); }

body.customer-body .none-match-button,
body.customer-body .choice-panel,
body.customer-body .review-panel,
body.customer-body .posted-confirm-card {
  border-color: var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: none;
}

body.customer-body .choice-panel { padding: 18px; }
body.customer-body .choice-number { color: #fff; background: var(--brand); }
body.customer-body .review-panel { background: var(--brand-softer); }
body.customer-body .confirm-box { border-color: #d9e7e3; background: var(--brand-softer); border-radius: 13px; }
body.customer-body footer { border-top: 1px solid var(--line); color: var(--muted); text-align: center; }

.powered-by {
  margin: 0 auto 28px;
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
}

/* Login */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 18px;
  background:
    radial-gradient(circle at 50% 0, rgba(77, 126, 119, 0.15), transparent 32rem),
    var(--bg);
}

.login-shell {
  width: min(100%, 440px);
  margin: 0;
  padding: 0;
}

.login-brand { margin-bottom: 22px; text-align: center; }
.login-brand .customer-brand { justify-content: center; font-size: 1.35rem; }
.login-brand p { margin: 0.65rem 0 0; color: var(--muted); }

.login-card {
  padding: 30px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.login-card h1 { margin-bottom: 0.45rem; font-size: 1.45rem; }
.login-card form { display: grid; gap: 17px; margin-top: 24px; }
.login-card label { display: grid; gap: 7px; font-weight: 700; }
.login-card .primary-button { width: 100%; min-height: 46px; margin-top: 4px; }
.login-card .status-message { margin-bottom: 0; }

@media (max-width: 620px) {
  .customer-topbar { min-height: 60px; padding: 0 16px; }
  .customer-store-label { display: none; }
  body.customer-body .app-shell { width: calc(100% - 24px); margin: 20px auto 18px; border-radius: 17px; }
  body.customer-body .brand-header { padding: 23px 20px 16px; }
  body.customer-body .notice-card { margin: 0 20px 18px; }
  body.customer-body .progress { margin: 0 20px; }
  body.customer-body .step { padding: 22px 20px 24px; }
  body.customer-body .category-grid { grid-template-columns: 1fr; }
  body.customer-body .section-heading h2 { font-size: 1.22rem; }
  body.customer-body .progress-item { font-size: 0.66rem; }
  .login-card { padding: 25px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
