:root {
  --green: #123e37;
  --green-2: #1f5b50;
  --ink: #172421;
  --soft-green: #e4ece7;
  --paper: #f5f6f3;
  --gold: #b68a3a;
  --line: #d8dfda;
  --white: #ffffff;
  --muted: #65716d;
  --danger: #a13f32;
  --shadow: 0 18px 45px rgba(18, 62, 55, 0.08);
}

* { box-sizing: border-box; }
html { font-family: "Hiragino Sans", "Yu Gothic", Meiryo, sans-serif; color: var(--ink); background: var(--paper); }
body { margin: 0; min-width: 320px; min-height: 100vh; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin-top: 0; }
h1, h2 { font-family: "Yu Mincho", "Hiragino Mincho ProN", serif; letter-spacing: 0.02em; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

.pilot-banner { min-height: 42px; display: flex; justify-content: center; gap: 12px; align-items: center; padding: 9px 24px; background: #fff1ce; color: #624911; border-bottom: 1px solid #e7cf98; font-size: 13px; }
.pilot-banner strong { letter-spacing: .04em; }
.eyebrow { margin-bottom: 8px; color: var(--gold); font-weight: 800; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; }
.muted { color: var(--muted); }

.login-layout { min-height: calc(100vh - 42px); display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(360px, .7fr); }
.login-story { padding: clamp(48px, 8vw, 120px); color: white; background: linear-gradient(145deg, rgba(18,62,55,.97), rgba(18,62,55,.82)), radial-gradient(circle at 80% 20%, #b68a3a 0, transparent 36%); display: flex; flex-direction: column; justify-content: center; }
.brand-mark { width: 72px; height: 72px; border-radius: 22px; display: grid; place-items: center; background: var(--gold); color: white; font: 700 40px/1 "Yu Mincho", serif; margin-bottom: 30px; box-shadow: 0 16px 35px rgba(0,0,0,.18); }
.brand-mark.small { width: 40px; height: 40px; border-radius: 12px; margin: 0; font-size: 24px; }
.login-story h1 { font-size: clamp(36px, 5vw, 68px); line-height: 1.3; max-width: 900px; margin-bottom: 26px; }
.login-story .lead { max-width: 680px; color: rgba(255,255,255,.82); line-height: 1.9; font-size: 17px; }
.guardrail-list { list-style: none; padding: 0; margin: 34px 0 0; display: grid; gap: 12px; color: rgba(255,255,255,.9); }
.guardrail-list li::before { content: "✓"; color: #eac46f; margin-right: 10px; font-weight: 900; }
.login-card { background: var(--white); padding: clamp(40px, 6vw, 88px); display: flex; flex-direction: column; justify-content: center; }
.login-card h2 { font-size: 34px; margin-bottom: 12px; }
form { display: grid; gap: 17px; }
label { display: grid; gap: 8px; font-weight: 700; font-size: 14px; }
.check-row { display: flex; align-items: flex-start; gap: 10px; font-weight: 600; line-height: 1.5; }
.check-row input { width: auto; margin-top: 3px; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 13px 14px; background: white; color: var(--ink); outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--green-2); box-shadow: 0 0 0 3px rgba(31,91,80,.12); }
textarea { resize: vertical; line-height: 1.7; }
.form-error { min-height: 1.5em; color: var(--danger); margin-top: 14px; }

.button { min-height: 44px; border-radius: 10px; padding: 10px 17px; border: 1px solid transparent; font-weight: 800; transition: .15s ease; }
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.button.primary { background: var(--green); color: white; }
.button.secondary { background: var(--soft-green); color: var(--green); border-color: #c4d3ca; }
.button.ghost { background: transparent; color: var(--muted); border-color: var(--line); }
.button.danger { color: var(--danger); background: #fff0ed; border-color: #efc7c0; }
.button.wide { width: 100%; }
.button-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.button-row.end { justify-content: flex-end; }

.app-layout { min-height: calc(100vh - 42px); display: grid; grid-template-columns: 250px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: calc(100vh - 42px); padding: 28px 20px; background: var(--green); color: white; display: flex; flex-direction: column; }
.brand { display: flex; gap: 12px; align-items: center; margin-bottom: 40px; }
.brand strong, .brand small { display: block; }
.brand small { color: rgba(255,255,255,.55); margin-top: 3px; font-size: 11px; }
.sidebar nav { display: grid; gap: 7px; }
.nav-link { min-height: 46px; padding: 10px 14px; text-align: left; border: 0; border-radius: 10px; background: transparent; color: rgba(255,255,255,.72); font-weight: 700; }
.nav-link:hover, .nav-link.active { background: rgba(255,255,255,.12); color: white; }
.sidebar-note { margin-top: auto; padding: 15px; border-radius: 12px; background: rgba(255,255,255,.08); display: grid; gap: 5px; font-size: 12px; }
.sidebar-note span { color: rgba(255,255,255,.6); }

.content-shell { min-width: 0; }
.topbar { min-height: 95px; padding: 23px clamp(22px, 4vw, 62px); background: white; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.topbar h1 { font-size: 25px; margin-bottom: 0; }
.account-menu { display: flex; gap: 13px; align-items: center; font-size: 13px; }
.view-panel { padding: 34px clamp(22px, 4vw, 62px) 70px; }
.notice { margin: 20px clamp(22px, 4vw, 62px) 0; padding: 14px 17px; border-radius: 12px; background: var(--soft-green); color: var(--green); border: 1px solid #c7d7cd; }
.notice.error { color: var(--danger); background: #fff0ed; border-color: #efc7c0; }
.hero-card { border-radius: 20px; padding: clamp(24px, 4vw, 46px); background: linear-gradient(130deg, var(--green), #255f54); color: white; display: flex; justify-content: space-between; align-items: center; gap: 30px; box-shadow: var(--shadow); }
.hero-card h2 { font-size: clamp(25px, 4vw, 38px); margin-bottom: 12px; }
.hero-card p:not(.eyebrow) { color: rgba(255,255,255,.72); max-width: 680px; margin-bottom: 0; }
.hero-card .button { background: white; color: var(--green); flex: 0 0 auto; }

.kpi-grid { display: grid; grid-template-columns: repeat(6, minmax(120px,1fr)); gap: 14px; margin: 22px 0 42px; }
.kpi-card { padding: 20px; border-radius: 16px; background: white; border: 1px solid var(--line); }
.kpi-card span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 10px; }
.kpi-card strong { font: 700 28px/1 "Yu Mincho", serif; color: var(--green); }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 18px; margin: 28px 0 18px; }
.section-heading h2 { margin-bottom: 5px; font-size: 27px; }
.section-heading p:not(.eyebrow) { color: var(--muted); margin-bottom: 0; }
.filters { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { min-height: 38px; border-radius: 999px; border: 1px solid var(--line); background: white; padding: 7px 13px; color: var(--muted); }
.chip.active { background: var(--green); border-color: var(--green); color: white; }

.card-list { display: grid; gap: 14px; }
.opportunity-card, .offer-card { border: 1px solid var(--line); border-radius: 18px; background: white; padding: 21px; box-shadow: 0 5px 20px rgba(18,62,55,.035); }
.opportunity-head { display: flex; justify-content: space-between; gap: 18px; align-items: start; }
.opportunity-head h3 { margin-bottom: 6px; font-size: 18px; }
.opportunity-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; color: var(--muted); font-size: 12px; }
.opportunity-body { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 22px; margin-top: 17px; align-items: end; }
.opportunity-body p { color: #4e5c57; line-height: 1.7; margin-bottom: 0; }
.amount { text-align: right; white-space: nowrap; }
.amount span { display: block; color: var(--muted); font-size: 11px; }
.amount strong { color: var(--green); font-size: 22px; }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 17px; padding-top: 16px; border-top: 1px solid #edf0ee; }
.status { display: inline-flex; align-items: center; min-height: 28px; border-radius: 999px; padding: 4px 10px; font-size: 11px; font-weight: 800; background: var(--soft-green); color: var(--green); }
.status.blocked { background: #fff0ed; color: var(--danger); }
.status.gold { background: #fff1ce; color: #705313; }
.empty-state { padding: 48px 20px; text-align: center; border: 1px dashed #becac3; border-radius: 16px; color: var(--muted); background: rgba(255,255,255,.45); }

.two-column { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(320px, .6fr); gap: 28px; align-items: start; }
.form-card { background: white; border: 1px solid var(--line); border-radius: 18px; padding: 24px; box-shadow: var(--shadow); }
.form-card h2 { font-size: 24px; }
.form-card.narrow { max-width: 780px; margin-top: 28px; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.offer-card { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 18px; }
.offer-card h3 { margin-bottom: 6px; }
.offer-card p { color: var(--muted); margin-bottom: 0; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; background: white; }
table { width: 100%; border-collapse: collapse; min-width: 780px; }
th, td { padding: 14px 16px; text-align: left; border-bottom: 1px solid #edf0ee; font-size: 13px; }
th { color: var(--muted); background: #fafbfa; font-size: 11px; letter-spacing: .05em; }
.timeline { display: grid; gap: 0; }
.timeline-item { position: relative; padding: 0 0 24px 30px; border-left: 2px solid var(--line); margin-left: 8px; }
.timeline-item::before { content: ""; position: absolute; width: 12px; height: 12px; border-radius: 50%; background: var(--gold); left: -7px; top: 4px; }
.timeline-item strong { display: block; margin-bottom: 5px; }
.timeline-item span { color: var(--muted); font-size: 12px; }

.dialog { width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 40px); border: 0; border-radius: 20px; padding: 0; box-shadow: 0 35px 90px rgba(0,0,0,.25); }
.dialog::backdrop { background: rgba(12,31,28,.62); backdrop-filter: blur(3px); }
.dialog form { padding: 28px; }
.small-dialog { width: min(560px, calc(100vw - 32px)); }
.dialog-heading { display: flex; justify-content: space-between; gap: 16px; align-items: start; }
.dialog-heading h2 { font-size: 28px; }
.icon-button { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; background: white; font-size: 25px; color: var(--muted); }
.safety-note { padding: 13px 15px; border-radius: 10px; background: #f0f5f2; color: #52635d; line-height: 1.7; font-size: 12px; }

@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .two-column { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .pilot-banner { align-items: flex-start; flex-direction: column; gap: 3px; padding-inline: 14px; }
  .login-layout { grid-template-columns: 1fr; }
  .login-story { min-height: 48vh; padding: 42px 24px; }
  .login-story h1 { font-size: 36px; }
  .login-card { padding: 40px 24px 60px; }
  .app-layout { display: block; padding-bottom: 72px; }
  .sidebar { position: fixed; z-index: 20; inset: auto 0 0 0; height: 68px; padding: 7px 8px; display: block; border-top: 1px solid rgba(255,255,255,.16); }
  .sidebar .brand, .sidebar-note { display: none; }
  .sidebar nav { height: 100%; display: grid; grid-template-columns: repeat(5,1fr); gap: 3px; }
  .nav-link { min-height: 54px; padding: 4px; text-align: center; font-size: 10px; }
  .topbar { padding: 16px 18px; min-height: 82px; }
  .topbar h1 { font-size: 21px; }
  .account-menu span { display: none; }
  .view-panel { padding: 24px 16px 48px; }
  .notice { margin-inline: 16px; }
  .hero-card { align-items: stretch; flex-direction: column; }
  .hero-card .button { width: 100%; }
  .kpi-grid { grid-template-columns: repeat(2,1fr); }
  .section-heading { align-items: stretch; flex-direction: column; }
  .opportunity-head, .opportunity-body { grid-template-columns: 1fr; display: grid; }
  .amount { text-align: left; }
  .form-row { grid-template-columns: 1fr; }
  .offer-card { grid-template-columns: 1fr; }
  .dialog form { padding: 22px 18px; }
  .button-row.end .button { flex: 1 1 100%; }
}
