/* ld_kouryaku_indicator.css */
:root{
  --bg:#0b0f14;
  --panel:#111823;
  --panel2:#0f1620;
  --text:#e6edf6;
  --muted:#9fb0c3;
  --line:#223042;
  --ok:#30d158;
  --ng:#ff453a;
  --warn:#ffd60a;
  --shadow: 0 10px 25px rgba(0,0,0,.35);
  --radius: 14px;
  --pad: 12px;
  --maxw: 420px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}
*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", sans-serif;
  background: linear-gradient(180deg, #070a0f 0%, var(--bg) 50%, #070a0f 100%);
  color:var(--text);
}
.topbar{
  position: sticky;
  top:0;
  z-index:10;
  background: rgba(11,15,20,.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar__inner{
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 12px 14px;
  display:flex;
  gap:12px;
  align-items:center;
  justify-content:space-between;
}
.title__main{ font-weight:800; letter-spacing:.02em; }
.title__sub{ font-size:12px; color:var(--muted); margin-top:2px; }
.status{ font-size:12px; color:var(--muted); }

.container{
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 12px;
  padding-bottom: 40px;
  display:flex;
  flex-direction:column;
  gap: 12px;
}
.card{
  background: linear-gradient(180deg, rgba(17,24,35,.95), rgba(12,17,25,.95));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--pad);
}
.card__title{
  margin: 0 0 12px;
  font-size: 15px;
  color: #d9e5f6;
  letter-spacing:.02em;
}



/* ---- Inline Wheel Picker (no modal) ---- */
.select--hidden{
  position:absolute;
  opacity:0;
  pointer-events:none;
  width:1px;
  height:1px;
}

.wheel-field{
  position:relative;
  border-radius: 10px;
  border: 1px solid rgba(140, 190, 255, .18);
  background: linear-gradient(180deg, rgba(8, 12, 18, .70), rgba(8, 12, 18, .52));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
  overflow:hidden;
}

.wheel{
  --wheel-rows: 5;
  --wheel-row-h: 20px;
  height: calc(var(--wheel-rows) * var(--wheel-row-h));
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-top: calc((var(--wheel-rows) / 2 - 0.5) * var(--wheel-row-h));
  padding-bottom: calc((var(--wheel-rows) / 2 - 0.5) * var(--wheel-row-h));
}
.wheel::-webkit-scrollbar{ display:none; }

.wheel__item{
  height: var(--wheel-row-h);
  display:flex;
  align-items:center;
  justify-content:center;
  scroll-snap-align: center;
  font-family: var(--mono);
  font-size: 12px;
  color: rgba(233,241,255,.78);
  user-select:none;
}
.wheel__item.is-selected{
  color: var(--ok);
  font-weight: 900;
  font-size: 13px;
  background: rgba(48,209,88,.12);
  border: 1px solid rgba(48,209,88,.28);
  border-radius: 10px;
  margin: 0 8px;
}

.wheel-field::before{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  background:
    linear-gradient(180deg, rgba(9,12,18,.95) 0%, rgba(9,12,18,0) 22%, rgba(9,12,18,0) 78%, rgba(9,12,18,.95) 100%);
  opacity:.75;
}
.wheel-field::after{
  content:"";
  position:absolute;
  left:6px;
  right:6px;
  top:50%;
  transform: translateY(-50%);
  height: var(--wheel-row-h);
  border-radius: 10px;
  border: 1px solid rgba(109,168,255,.28);
  background: rgba(109,168,255,.08);
  box-shadow: 0 0 0 3px rgba(109,168,255,.08);
  pointer-events:none;
}

/* ---- Compact layout helpers ---- */


/* ---- 3 columns fixed for compare (prev/test) ---- */
.grid3-compare{
  display:grid;
  grid-template-columns: minmax(0,1fr) minmax(0,1fr) minmax(0,1fr);
  gap: 10px;
}

/* Make wheels fit comfortably in narrow widths */
.grid3-compare .field__label{
  font-size: 12px;
  letter-spacing: .02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;

  display:block;
  line-height: 1.1;
  min-height: 14px;
  margin-bottom: 8px;
}

.grid3-always{
  display:grid;
  grid-template-columns: minmax(0,1fr) minmax(0,1fr) minmax(0,1fr);
  gap: 10px;
}
@media (max-width: 380px){
  .grid3-always{ grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
}

.grid2-always{
  display:grid;
  grid-template-columns: minmax(0,1fr) minmax(0,1fr);
  gap: 12px;
}
@media (max-width: 340px){
  .grid2-always{ grid-template-columns: 1fr; }
}

.grid-span-2{ grid-column: 1 / -1; }

/* ---- Radios (no pill containers) ---- */
.radio-row{
  display:flex;
  flex-wrap:wrap;
  gap: 12px;
  align-items:center;
}
.radio-pill{
  display:inline-flex;
  align-items:center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 0;
  font-size: 12px;
  color: var(--text);
  user-select:none;
}
.radio-pill input{ accent-color: #6da8ff; }

/* ---- Tabs ---- */
.tabs{
  display:flex;
  gap: 8px;
  margin-bottom: 12px;
}
.tab{
  flex: 1;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #2a3a52;
  background: rgba(8,12,18,.45);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .03em;
}
.tab.is-active{
  color: var(--text);
  border-color: #3e5c86;
  background: rgba(15,22,32,.70);
  box-shadow: 0 0 0 3px rgba(62,92,134,.15);
}
.tabpane[hidden]{ display:none !important; }
}

.field{ display:flex; flex-direction:column; gap:6px; }
.field__label{ font-size: 12px; color: var(--muted); }
.hint{ font-size: 11px; color: var(--muted); opacity:.9; }

.input, .select{
  width:100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #2a3a52;
  background: rgba(8,12,18,.65);
  color: var(--text);
  outline: none;
}
.input:focus, .select:focus{
  border-color: #3e5c86;
  box-shadow: 0 0 0 3px rgba(62,92,134,.20);
}
.suffix-wrap{ position:relative; }
.suffix-wrap .suffix{
  position:absolute;
  right: 10px;
  top:50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 12px;
}
.suffix-wrap .input{ padding-right: 28px; }

.slider-block{
  display:flex;
  flex-direction:column;
  gap: 8px;
}
.slider-top{
  display:flex;
  gap: 10px;
  align-items:center;
  justify-content:space-between;
}
.slider-value{
  font-family: var(--mono);
  font-size: 12px;
  color: #cfe0f7;
  white-space:nowrap;
}
.step-btns{ display:flex; gap:6px; flex-wrap:wrap; justify-content:flex-end; }
.btn{
  border:1px solid #2a3a52;
  background: rgba(8,12,18,.55);
  color: var(--text);
  padding: 7px 9px;
  border-radius: 10px;
  font-size: 12px;
}
.btn:active{ transform: translateY(1px); }

input[type="range"]{
  width:100%;
}

.pill-row{ display:flex; gap:8px; flex-wrap:wrap; margin-bottom:10px; }
.pill{
  background: rgba(8,12,18,.55);
  border:1px solid #2a3a52;
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 12px;
  color: #d4e5fb;
}
.pill span{ font-family: var(--mono); }

.result__grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.kv{
  border:1px solid #223042;
  border-radius: 10px;
  padding: 10px 12px;
  background: rgba(8,12,18,.45);
}
.kv--wide{ grid-column: 1 / -1; }
.kv__k{ font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.kv__v{
  font-family: var(--mono);
  font-size: 12px;
  color: #eaf2ff;
  word-break: break-word;
}
.judge{
  font-weight: 900;
  letter-spacing: .06em;
  font-size: 11px;
  padding: 10px 12px;
  border-radius: 10px;
  border:1px solid #2a3a52;
  background: rgba(8,12,18,.45);
}
.judge.ok{ border-color: rgba(48,209,88,.55); color: var(--ok); }
.judge.ng{ border-color: rgba(255,69,58,.55); color: var(--ng); }

.subgrid{
  margin-top: 10px;
  display:grid;
  grid-template-columns: 1fr;
  gap:10px;
}
@media (min-width: 440px){
  .subgrid{ grid-template-columns: 1fr 1fr; }
}

.details{
  margin-top: 10px;
  border: 1px solid #223042;
  border-radius: 10px;
  background: rgba(8,12,18,.35);
  padding: 10px 12px;
}
.details summary{
  cursor:pointer;
  font-size: 12px;
  color: #d4e5fb;
}
.detail-grid{
  margin-top: 10px;
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:10px;
}

.footer{
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  text-align:center;
}

/* ---- Wave subsections (no tabs) ---- */
.subhead{
  margin: 6px 2px 10px;
  font-weight: 900;
  letter-spacing: .02em;
  color: rgba(233,241,255,.95);
}
.subhead--mt{ margin-top: 18px; }

label.field__label{ display:block; }

.is-hidden{display:none !important;}

.input--hidden{display:none !important;}

/* ---- coin digit wheels (X,XXX,000) ---- */
.coinwheel{ display:flex; align-items:stretch; gap: 4px; }
.coinwheel__sep{
  align-self:center;
  opacity:.7;
  font-weight:700;
  padding: 0 2px;
}
.coinwheel__suffix{
  align-self:center;
  opacity:.85;
  font-weight:700;
  letter-spacing:.06em;
}
.wheel-field--digit{ width: 44px; }
.wheel-field--tight{
  max-width: 220px;
}
.buffwheel{
  display:flex;
  align-items:center;
  gap: 8px;
}
.wheel-field--buff{ width: 100%; }
.subnote{
  margin-top: 6px;
  font-size: 12px;
  opacity: .75;
}

/* --- accordion (詳細設定) --- */
.accordion{ margin-top: 10px; }
.accordion__summary{
  cursor: pointer;
  user-select: none;
  font-weight: 600;
  font-size: 13px;
  color: rgba(255,255,255,.92);
  padding: 8px 2px;
  border-radius: 10px;
}
.accordion__summary::-webkit-details-marker{ display:none; }
.accordion__summary::before{ content:"▶ "; color: rgba(255,255,255,.75); }
.accordion[open] .accordion__summary::before{ content:"▼ "; }
.accordion__body{ margin-top: 8px; }

.section-divider{
  height: 1px;
  background: rgba(255,255,255,.08);
  margin: 14px 0 10px;
}
.card__title--sub{
  margin-top: 0;
  font-size: 18px;
}
.field--full{ grid-column: 1 / -1; }

/* --- test wave metrics + summary under wheels --- */
.metrics3{
  display:grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 10px;
  margin-top: 10px;
}
.metric-card{
  background: rgba(0,0,0,.25);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  padding: 10px 12px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.02);
}
.metric-card__label{
  font-size: 12px;
  color: rgba(217,229,246,.75);
  margin-bottom: 4px;
}
.metric-card__value{
  font-size: 18px;
  letter-spacing: .02em;
  color: #d9e5f6;
  font-weight: 700;
}
.summary-box{
  margin-top: 10px;
  background: rgba(0,0,0,.28);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  padding: 12px 14px;
}
.summary-line{
  font-size: 12px;
  color: rgba(217,229,246,.92);
  line-height: 1.35;
  white-space: pre-wrap;
}

#prevWaveField{ margin-bottom: 6px; }

/* prevent default details marker from duplicating arrows */
.accordion__summary{
  list-style: none;
  display:flex;
  align-items:center;
  gap: 4px;
}
.accordion__summary::marker{ content:""; }

/* unify typography for section labels (match '共通') */
.card__title--sub,
.subhead,
.accordion__summary{
  font-size: 15px;
  font-weight: 400;
  color: #d9e5f6;
  letter-spacing:.02em;
}
.subhead{
  margin: 6px 2px 10px;
}


/* --- Breakdown / Judge (v7t) --- */
.kv--judge{
  margin-top: 10px;
}
.breakdown{
  margin-top: 10px;
}
.summary-sep{
  height: 1px;
  background: rgba(255,255,255,.10);
  margin: 8px 0;
}
.summary-line--muted{
  color: rgba(255,255,255,.78);
}

/* accordion arrow open state */
.accordion[open] > .accordion__summary::before{ content:"▼"; }

#needRow{ margin-top: 10px; }


/* ---- Title rows & header buttons ---- */
.topbar__btn{
  appearance:none;
  border:1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.92);
  padding: 8px 12px;
  border-radius: 12px;
  font-weight: 800;
  letter-spacing: .02em;
}
.topbar__btn:active{ transform: translateY(1px); }

.card__titleRow{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.card__titleRow .card__title{ margin:0; }

.subheadRow{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  margin-top: 14px;
  margin-bottom: 8px;
}
.subheadRow .subhead{ margin:0; }

/* mini button */
.miniBtn{
  appearance:none;
  border:1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.92);
  padding: 8px 12px;
  border-radius: 12px;
  font-weight: 800;
  letter-spacing: .02em;
  white-space: nowrap;
}
.miniBtn--ghost{
  background: transparent;
}
.miniBtn:active{ transform: translateY(1px); }

/* 判定：1行に収める */
.judge{
  font-size: 13px; /* slightly smaller */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- Modal ---- */
.modal{
  position: fixed;
  inset: 0;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 18px;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(8px);
  z-index: 9999;
}
.modal.is-hidden{ display:none; }
.modal__panel{
  width: min(520px, 100%);
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.14);
  background: linear-gradient(180deg, rgba(26,35,48,.96), rgba(14,20,30,.96));
  box-shadow: 0 18px 60px rgba(0,0,0,.55);
  padding: 14px;
}
.modal__title{
  font-size: 16px;
  font-weight: 900;
  margin: 2px 2px 10px;
}
.modal__body{
  color: rgba(255,255,255,.86);
  line-height: 1.5;
  padding: 0 2px 12px;
  font-size: 14px;
}
.modal__body ul{ margin: 10px 0 0 18px; }
.modal__actions{
  display:flex;
  gap: 10px;
  justify-content:flex-end;
}

.labelSmall{ font-size: 12px; }
.manual__h{
  font-size: 15px;
  font-weight: 900;
  margin: 10px 0 6px;
}
.manual__p{
  margin: 6px 0;
}
.manual__ul{
  margin: 6px 0 8px 18px;
}
.manual__ul li{
  margin: 4px 0;
}


/* modal: prevent clipping on mobile (iOS Safari) */
.modal{
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
}
.modal__panel{
  max-height: calc(100dvh - 24px);
  max-height: calc(100vh - 24px);
  display: flex;
  flex-direction: column;
}
.modal__body{
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 6px;
}
.modal__actions{
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  padding-top: 10px;
  background: linear-gradient(180deg, rgba(26,35,48,0), rgba(14,20,30,.96) 40%);
  border-top: 1px solid rgba(255,255,255,.08);
}


/* v7aa: reduce modal height to about 70% of viewport for iPhone */
.modal__panel{
  height: 70dvh;
  height: 70vh;
  max-height: 70dvh;
  max-height: 70vh;
}
