:root{
  --bg:#0b1220;
  --bg2:#151e3e;
  --panel:rgba(17,24,50,.82);
  --line:rgba(255,255,255,.10);
  --text:#eef2ff;
  --muted:#b8c2e4;
  --mint:#87f0da;
  --blue:#7ea2ff;
  --pink:#ff9bd0;
  --shadow:0 24px 60px rgba(0,0,0,.28);
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  min-height:100vh;
  color:var(--text);
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans JP","Yu Gothic",sans-serif;
  background:
    radial-gradient(circle at top, rgba(126,162,255,.16), transparent 32%),
    linear-gradient(180deg, var(--bg2), var(--bg));
}
button,input,select{font:inherit}
a{color:inherit;text-decoration:none}
img{display:block;max-width:100%}

.page-shell{width:min(1200px, calc(100% - 24px));margin:18px auto 28px}
.panel{
  border:1px solid var(--line);
  border-radius:26px;
  background:linear-gradient(180deg, rgba(20,29,60,.84), rgba(12,18,42,.88));
  box-shadow:var(--shadow);
}
.hero{
  padding:18px 20px;
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:18px;
  margin-bottom:16px;
}
.eyebrow,.section-kicker{
  margin:0;
  color:var(--mint);
  font-size:13px;
  font-weight:700;
  letter-spacing:.04em;
}
.hero h1{margin:6px 0 0;font-size:clamp(28px,3.8vw,44px);line-height:1.15}
.hero-sub{margin:10px 0 0;color:var(--muted);line-height:1.75}
.hero-actions{display:flex;gap:10px;flex-wrap:wrap;justify-content:flex-end}
.hero-actions a,.action-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:44px;
  padding:0 16px;
  border-radius:999px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.06);
  color:var(--text);
  cursor:pointer;
}
.hero-actions a:hover,.action-btn:hover{transform:translateY(-1px)}
.layout-grid{
  display:grid;
  grid-template-columns:minmax(0,1.45fr) minmax(330px,.88fr);
  gap:16px;
}
.preview-panel,.control-panel,.info-panel{padding:18px}
.side-stack{display:grid;gap:16px;align-content:start}
.panel-head{
  display:flex;justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:14px
}
.panel-head.compact{margin-bottom:12px}
.panel-head h2{margin:4px 0 0;font-size:clamp(24px,3vw,34px)}
.panel-head h3{margin:4px 0 0;font-size:22px}
.status-pill{
  display:inline-flex;align-items:center;justify-content:center;
  min-height:38px;padding:0 14px;border-radius:999px;
  border:1px solid rgba(126,162,255,.28);
  background:rgba(126,162,255,.12);font-weight:700;font-size:13px
}
.preview-stage{
  position:relative;
  min-height:480px;
  border-radius:24px;
  border:1px solid var(--line);
  background:
    radial-gradient(circle at 50% 0%, rgba(126,162,255,.14), transparent 28%),
    rgba(0,0,0,.28);
  display:grid;
  place-items:center;
  overflow:hidden;
}
#preview{max-width:100%;max-height:100%;object-fit:contain}
.preview-empty{
  position:absolute;inset:0;display:grid;place-items:center;text-align:center;padding:24px;color:var(--muted)
}
.preview-empty strong{display:block;color:var(--text);margin-bottom:8px}
.stage-meta{
  margin-top:12px;
  display:grid;grid-template-columns:1fr 1fr;gap:10px;
}
.metric-box{
  border:1px solid var(--line);
  border-radius:20px;
  background:rgba(255,255,255,.05);
  min-height:108px;
  padding:14px 16px;
  display:grid;align-content:start;gap:6px;
}
.metric-label{color:var(--mint);font-size:13px;font-weight:700}
.metric-box strong{font-size:clamp(38px,6vw,58px);line-height:1}
.progress-wrap{margin-top:12px;display:grid;gap:8px}
.progress-meta{
  display:flex;justify-content:space-between;gap:10px;
  color:var(--muted);font-size:12px;font-weight:700
}
.progress-bar{
  height:12px;border-radius:999px;background:rgba(255,255,255,.08);overflow:hidden
}
.progress-fill{
  height:100%;width:0;border-radius:999px;
  background:linear-gradient(90deg, var(--pink), var(--blue), var(--mint));
  transition:width .22s ease
}
.progress-fill.is-pulse{animation:progressPulse .42s ease}
@keyframes progressPulse{
  0%{filter:brightness(1);transform:scaleY(1)}
  40%{filter:brightness(1.22);transform:scaleY(1.08)}
  100%{filter:brightness(1);transform:scaleY(1)}
}

.note-link{
  margin-bottom:12px;
  display:flex;gap:8px;align-items:center;flex-wrap:wrap;
  color:var(--muted);font-size:13px
}
.note-link a{color:var(--mint);text-decoration:underline;text-underline-offset:3px}
.field-stack{display:grid;gap:12px}
.field{display:grid;gap:6px}
.field-label{color:var(--muted);font-size:13px;font-weight:700}
.field-input{
  width:100%;min-height:46px;border-radius:16px;border:1px solid var(--line);
  background:rgba(255,255,255,.05);color:var(--text);padding:0 14px
}
.file-input{padding:10px 14px}
.action-grid{
  margin-top:14px;
  display:grid;grid-template-columns:1fr 1fr;gap:10px
}
.action-btn{
  min-height:48px;border-radius:16px;background:rgba(255,255,255,.06);font-weight:800
}
.action-btn.primary{background:linear-gradient(135deg, rgba(126,162,255,.82), rgba(158,198,255,.82))}
.action-btn.accent{background:linear-gradient(135deg, rgba(255,155,208,.26), rgba(126,162,255,.24))}
.action-btn:disabled{opacity:.48;cursor:not-allowed;transform:none !important}
.mini-note{margin:12px 0 0;color:var(--muted);font-size:12px;line-height:1.7}
.status-box{
  border:1px solid var(--line);
  border-radius:18px;
  background:rgba(255,255,255,.05);
  min-height:120px;
  padding:14px 16px;
  color:var(--muted);
  white-space:pre-wrap;
  line-height:1.7
}
.terms-details{
  margin-top:12px;border:1px solid var(--line);border-radius:18px;background:rgba(255,255,255,.04);overflow:hidden
}
.terms-details summary{
  list-style:none;cursor:pointer;padding:14px 16px;font-weight:700
}
.terms-details summary::-webkit-details-marker{display:none}
.terms-body{padding:0 16px 16px;color:var(--muted);font-size:12px;line-height:1.8}
.terms-body h4{margin:10px 0 6px;color:var(--text);font-size:13px}
.terms-body ul{margin:6px 0;padding-left:18px}
.footer-note{
  margin-top:16px;color:var(--muted);font-size:12px;line-height:1.7;text-align:center
}
.flash{animation:stageFlash .5s ease}
@keyframes stageFlash{
  0%{box-shadow:0 0 0 rgba(126,162,255,0)}
  30%{box-shadow:0 0 0 10px rgba(126,162,255,.10)}
  100%{box-shadow:0 0 0 rgba(126,162,255,0)}
}

@media (max-width: 960px){
  .layout-grid{grid-template-columns:1fr}
}
@media (max-width: 640px){
  .page-shell{width:min(100%, calc(100% - 12px));margin-top:10px}
  .hero,.preview-panel,.control-panel,.info-panel{padding:14px}
  .hero{flex-direction:column}
  .hero-actions{
    width:100%;
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:8px
  }
  .hero-actions a:last-child{grid-column:span 2}
  .action-grid{grid-template-columns:1fr}
  .preview-stage{min-height:280px}
  .metric-box{min-height:92px}
  .metric-box strong{font-size:clamp(30px,10vw,44px)}
}


.field-input,
.field-input option{
  color: var(--text);
}
select.field-input{
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background:
    linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.05)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 20 20'%3E%3Cpath fill='%23eef2ff' d='M5.5 7.5 10 12l4.5-4.5'/%3E%3C/svg%3E") no-repeat right 14px center / 16px;
  padding-right: 40px;
}
select.field-input option{
  background: #10182f;
}
