/* オペレーター詳細。 */
.training-track { height: .65rem; border-radius: .4rem; overflow: hidden; background: #526176; }
.training-track span { display: block; height: 100%; background: #51b5de; }
.detail { padding: 1rem; border: 1px solid #59677b; }
.expanded-operator { width: 100%; min-width: 0; border-bottom: 2px solid #51b5de; }
.expanded-operator .detail {
    width: 100%;
    min-width: 0;
    border: 0;
    border-left: 3px solid #51b5de;
    background: #202a38;
}
.app-shell.light .expanded-operator .detail { background: #e8eef6; }
.detail-heading, .drawer-heading { display: flex; align-items: start; justify-content: space-between; gap: .8rem; }
.detail-heading p { margin: .25rem 0; opacity: .75; }
.app-shell .paradox-controls, .app-shell .detail-section-heading { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.app-shell .paradox-controls { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); }
.app-shell .paradox-controls label { display: inline-flex; align-items: center; gap: 4px; }
.app-shell .detail-section-heading { justify-content: space-between; }
.app-shell .training-statistics { grid-column: 1 / -1; display: flex; gap: 6px; padding: 2px 0 6px; color: var(--mute2); font: 10px var(--font-mono); }
.app-shell .training-statistics span { min-width: 38px; text-align: right; }
.app-shell .field-row textarea { flex: 1 1 12rem; max-width: 24rem; resize: vertical; }
.app-shell .expanded-operator { border-bottom: 1px solid var(--line2); }
.app-shell .expanded-operator .detail {
    color: var(--text);
    background: var(--detail-bg);
    border: 0;
    padding: 14px 16px;
    position: sticky;
    left: 0;
    width: 100cqw;
}
.app-shell .detail-heading h2 { color: var(--text); font-size: 16px; }
.app-shell .detail-heading p { color: var(--code); font: 11px var(--font-mono); }
.app-shell .detail-actions { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: flex-end; gap: 7px; }
.app-shell .detail-actions :is(button, a) { display: inline-flex; align-items: center; justify-content: center; min-height: 34px; white-space: nowrap; text-decoration: none; font-size: 12px; padding: 5px 9px; line-height: 1.2; }
.app-shell .detail-actions .op-wiki-btn { color: var(--accent); background: var(--accent-soft); border: 1px solid var(--btn-accent-line); }
.app-shell .detail-actions .op-enhance-btn { color: var(--ok-text); background: var(--ok-soft); border: 1px solid var(--ok); }
.app-shell .detail-actions .op-plan-btn { color: var(--tgt-text); background: var(--tgt-soft); border: 1px solid var(--tgt-btn); }
.app-shell .detail-actions .op-train-room-btn { color: var(--danger); background: var(--danger-soft); border: 1px solid var(--danger); }
.app-shell .detail-actions .op-close-btn { color: var(--mute); background: var(--btn-bg); border: 1px solid var(--btn-line); }
.app-shell .detail h3 { border-bottom: 1px solid var(--detail-grid); padding-bottom: 5px; }
.app-shell .detail .edit-grid input { font: 12px var(--font-mono); }
.app-shell .detail .toolbar { margin: 8px 0 14px; }
.app-shell .detail-columns {
    display: grid;
    grid-template-columns: minmax(240px, max-content) max-content minmax(0, 1fr);
    gap: 24px;
    min-width: 0;
    background: var(--card);
    border: 1px solid var(--card-line);
    border-radius: var(--bevel-container);
    corner-shape: bevel;
    padding: 12px 16px;
}
.app-shell .detail-columns > section { padding: 0; }
.app-shell .detail-columns > section + section { border-left: 0; }
.app-shell .detail-columns:is(.plan-edit, .stats-on) { grid-template-columns: minmax(240px, max-content) minmax(0, 1fr); }
.app-shell .detail-columns:is(.plan-edit, .stats-on) > .detail-demand { display: none; }
.app-shell .detail-columns h3 { margin: 0 0 10px; color: var(--text2); }
.app-shell .detail-facts {
    display: grid;
    grid-template-columns: minmax(5rem, auto) minmax(0, 1fr);
    gap: 7px 10px;
    font-size: 12px;
}
.app-shell .detail-facts span { color: var(--mute2); }
.app-shell .detail-facts strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.app-shell .detail-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 12px; }
.app-shell .detail-tags span {
    padding: 2px 6px;
    border: 1px solid var(--accent-soft-line);
    border-radius: 20px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 10px;
}
.app-shell .detail-subheading { margin: 16px 0 7px; padding-bottom: 4px; border-bottom: 1px solid var(--detail-grid); color: var(--text2); font-weight: 600; }
.app-shell .detail-other-row { display: grid; grid-template-columns: minmax(4rem, 1fr) 106px; align-items: center; gap: 8px; margin: 4px 0; color: var(--mute2); }
.app-shell .detail-other-row .detail-mirror { text-align: center; }
.app-shell .detail-train-scroll { overflow: visible; }
.app-shell .detail-columns:is(.plan-edit, .stats-on) .detail-train-scroll { overflow-x: auto; }
.app-shell .detail-mirror { display: inline-flex; justify-content: center; align-items: center; min-height: 28px; width: 106px; color: var(--text2); background: var(--chip); font-family: var(--font-mono); }
.app-shell .num-stepper { width: 106px; }
.app-shell .num-stepper .num-stepper-btn { min-width: 20px; min-height: 20px; padding: 0; border-radius: 0; font-size: 14px; }
.app-shell .num-stepper .num-stepper-input { width: 100%; min-width: 0; padding: 2px 4px; text-align: center; }
.app-shell .op-group-control { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--detail-grid); }
.app-shell .op-meta-row { display: flex; align-items: center; gap: 7px; }
.app-shell .op-meta-k { width: 90px; flex: 0 0 auto; color: var(--mute2); }
.app-shell .dd-trigger.op-group-meta-select { display: flex; align-items: center; justify-content: space-between; gap: 6px; width: 106px; min-width: 0; min-height: 29px; padding: 4px 8px; color: var(--text); background: var(--input); border: 1px solid var(--btn-line); font-size: 13px; }
.app-shell .dd-trigger::after { content: ''; flex: 0 0 auto; border-left: 3.5px solid transparent; border-right: 3.5px solid transparent; border-top: 4px solid var(--dim); }
.app-shell .dd-trigger:hover::after { border-top-color: var(--mute2); }
.app-shell .op-group-badges { display: flex; flex-wrap: wrap; gap: 5px; justify-content: flex-end; width: min-content; min-width: 100%; margin-top: 6px; }
.app-shell .op-group-badge { padding: 2px 9px; color: var(--text2); background: var(--chip); border: 1px solid var(--line2); border-radius: 999px; corner-shape: round; font-size: 11px; line-height: 1.5; }
.app-shell .dd-backdrop { position: fixed; inset: 0; z-index: 60; width: 100vw; height: 100vh; min-height: 0; padding: 0; margin: 0; border: 0; background: transparent; cursor: default; }
/* backdrop は <button> なので base.css のボタン面が当たる。ライトの平常時も明示する — `.app-shell.light button` は
   上の `.app-shell .dd-backdrop` より詳細度が高く、外すと項目の上にポインタがある間だけ全画面がボタン色で覆われる (#690)。 */
.app-shell .dd-backdrop:is(:hover, :active), .app-shell.light .dd-backdrop { background: transparent; border: 0; }
.app-shell .dd-popup { position: fixed; z-index: 61; overflow-x: hidden; overflow-y: auto; color: var(--text); background: var(--panel2); border: 1px solid var(--line2); box-shadow: 0 2px 8px #0006; }
.app-shell .dd-popup .dd-item { display: flex; align-items: center; gap: 6px; width: 100%; height: var(--dd-item-h); min-height: 0; padding: 0 9px; color: var(--text); background: transparent; border: 0; text-align: left; white-space: nowrap; }
.app-shell .dd-popup .dd-item:hover { background: var(--accent-soft); }
.app-shell .dd-popup .dd-item.dd-hl:not(.dd-sel):not(:hover) { outline: 1px solid var(--accent); outline-offset: -1px; }
.app-shell .dd-popup .dd-item.dd-sel { color: var(--text3); font-weight: 600; background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.app-shell .dd-item-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-shell .dd-edit-btn { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 18px; height: 18px; color: var(--mute2); cursor: pointer; }
.app-shell .dd-edit-btn:hover { color: var(--text); background: var(--btn-hover-bg); }
.app-shell .dd-item-editing { display: flex; align-items: center; gap: 6px; height: var(--dd-item-h); padding: 0 9px; }
.app-shell .dd-edit-key { flex: 0 0 auto; color: var(--dim); }
.app-shell .dd-edit-input { min-width: 0; flex: 1 1 auto; }
.app-shell .detail-memos { padding: 12px; border: 1px solid var(--card-line); background: var(--card); }
.app-shell .detail-memo-labels, .app-shell .detail-memo-row { display: grid; grid-template-columns: 32px minmax(0, 2fr) minmax(100px, 1fr) 32px; align-items: start; gap: 7px; }
.app-shell .detail-memo-labels { margin-bottom: 5px; color: var(--mute2); font-size: 11px; }
.app-shell .detail-memo-row { margin-bottom: 6px; }
.app-shell .detail-memo-row :is(input, textarea) { width: 100%; min-width: 0; }
.app-shell .detail-memo-row button { min-height: 29px; padding: 0; }
.app-shell .detail-memo-confirm { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 7px 0 10px 32px; padding: 8px; border: 1px solid var(--danger-line); background: var(--danger-soft); }
.app-shell .detail-demand { position: relative; min-height: 0; max-height: none; overflow: visible; }
/* ---- シートとダイアログ(強化実行・訓練室)。スマホは下から出るシート、それ以外は画面中央のダイアログ (#618)。 ---- */
.app-shell .browser-sheet-backdrop { position: fixed; inset: 0; z-index: 100; background: #0009; }
.app-shell .browser-sheet {
    position: fixed;
    z-index: 101;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(560px, 94vw);
    max-height: 85dvh;
    overflow: auto;
    margin: 0;
    padding: 14px 16px 16px;
    color: var(--text);
    background: var(--panel2);
    border: 1px solid var(--line2);
    box-shadow: 0 18px 48px #0009;
}
.app-shell .browser-sheet h3 { margin: 0 0 10px; }
.app-shell .browser-sheet .toolbar { margin: 8px 0; }
.app-shell .browser-sheet-actions { display: flex; gap: 8px; margin-top: 12px; }
.app-shell .browser-sheet-actions button { flex: 1 1 0; min-height: 40px; }
.app-shell .enhancement-sheet { width: min(760px, 96vw); }
.app-shell .enhancement-sheet .detail-demand { margin-top: 12px; }

/* ---- タブレットの詳細: 左に育成、右に素材/情報のタブ (#618)。 ---- */
.app-shell .op-detail-tablet .detail-columns.detail-columns-tablet { grid-template-columns: max-content minmax(0, 1fr); }
.app-shell .op-detail-tablet .detail-columns.detail-columns-tablet:is(.plan-edit, .stats-on) { grid-template-columns: minmax(0, 1fr); }
.app-shell .detail-tablet-main, .app-shell .detail-tablet-side { min-width: 0; }
.app-shell .detail-columns-tablet:is(.plan-edit, .stats-on) .detail-train-scroll { overflow-x: auto; }
.app-shell .op-detail-tablet .detail-heading { flex-wrap: wrap; }
.app-shell .op-detail-tablet .detail-actions { justify-content: flex-start; }
.app-shell .detail-tablet-main .pd-core { max-width: 360px; }
.app-shell .pd-core { margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--detail-grid); }
.app-shell .pd-tabs { display: flex; flex-wrap: nowrap; gap: 0; margin: 0 0 10px; border-bottom: 1px solid var(--line); }
.app-shell .pd-tabs button {
    flex: 1 1 0;
    min-height: 40px;
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    color: var(--mute);
    background: transparent;
    font-size: 13px;
}
.app-shell .pd-tabs button.on { color: var(--accent); border-bottom-color: var(--accent); }

/* ---- スマホの詳細: 全画面ページ(見出し・タブ・本文・下部の操作バー) (#618)。 ---- */
.app-shell .expanded-operator .detail.pd-page {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
    background: var(--detail-bg);
}
.app-shell .pd-page .pd-head {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 48px;
    padding: 4px 6px;
}
.app-shell .pd-page .pd-head h2 { flex: 1 1 auto; min-width: 0; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--r6); font-size: 16px; }
.app-shell .pd-code { color: var(--code); font: 12px var(--font-mono); }
.app-shell .pd-training { padding: 2px 8px; border: 1px solid var(--accent-soft-line); border-radius: 20px; color: var(--accent); background: var(--accent-soft); font-size: 11px; white-space: nowrap; }
.app-shell .pd-icon { min-width: 40px; min-height: 40px; padding: 0; font-size: 18px; line-height: 1; }
.app-shell .pd-page .pd-tabs { margin: 0; background: var(--panel2); }
.app-shell .pd-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 12px; }
.app-shell .pd-body > section + section { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--detail-grid); }
.app-shell .pd-body.stats-on .detail-train-scroll { overflow-x: auto; }
.app-shell .pd-body .op-wiki-btn { display: inline-flex; align-items: center; min-height: 40px; margin-top: 14px; padding: 0 14px; border: 1px solid var(--btn-accent-line); color: var(--accent); background: var(--accent-soft); text-decoration: none; }
.app-shell .pd-actions {
    display: flex;
    gap: 6px;
    padding: 8px;
    background: var(--chrome);
    border-top: 1px solid var(--chrome-line);
}
.app-shell .pd-actions button { flex: 1 1 0; min-height: 44px; }
.app-shell .pd-actions .op-enhance-btn { color: var(--ok-text); background: var(--ok-soft); border-color: var(--ok); }
.app-shell .pd-actions .op-plan-btn { color: var(--tgt-text); background: var(--tgt-soft); border-color: var(--tgt-btn); }
.app-shell .pd-actions .op-train-room-btn { color: var(--danger); background: var(--danger-soft); border-color: var(--danger); }
/* 確定・キャンセルは下部の操作バーに出すため、育成欄見出しの同じボタンは隠す。 */
.app-shell .pd-body .op-plan-actions { display: none; }
.app-shell .pd-page .browser-sheet {
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    transform: none;
    width: auto;
    border-width: 1px 0 0;
    box-shadow: 0 -12px 32px #000a;
}
.app-shell .pd-page .enhancement-sheet .detail-train-scroll { overflow-x: auto; }

/* ---- 計画編集の目標チップ(スマホで2列だけ出すときの列選択) ---- */
.app-shell .op-plan-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 12px; }
.app-shell :is(.op-plan-chip, .op-plan-chip > button, .op-plan-chip-add, .pd-training) { corner-shape: round; }
.app-shell .op-plan-chip { display: inline-flex; align-items: center; gap: 2px; padding: 0 4px 0 0; border: 1px solid var(--line2); border-radius: 18px; }
.app-shell .op-plan-chip > button:first-child { min-height: 34px; padding: 0 12px; border: 0; border-radius: 18px; background: transparent; }
.app-shell .op-plan-chip.on { border-color: var(--tgt-line); background: var(--tgt-soft); }
.app-shell .op-plan-chip.on > button:first-child { color: var(--tgt-text); }
.app-shell .op-plan-chip .op-plan-del { width: 22px; min-height: 22px; height: 22px; padding: 0; }
.app-shell .op-plan-chip-add { min-height: 34px; padding: 0 12px; border-style: dashed; border-color: var(--tgt-line); border-radius: 18px; color: var(--tgt-text); background: transparent; }
/* 素材需要の内訳は PC の3カラムでは隣の欄の行高へ絶対配置で引き伸ばす(App 共有の operator-detail.css)。
   隣に高さを決める欄が無いスマホの素材タブ・タブレットの右側・強化シートでは高さ 0 になるため、
   通常の流し込みに戻して内容の高さで伸ばす (#619)。 */
.app-shell :is(.pd-body, .detail-tablet-side, .enhancement-sheet) .op-detail-materials-inner { position: static; }
.app-shell :is(.pd-body, .detail-tablet-side, .enhancement-sheet) .op-demand-scroll { overflow: visible; }
/* 押せない「次の目標へ」の理由。PC は title で足りるためスマホだけ出す (responsive.css)。 */
.app-shell .op-plan-next-hint { display: none; margin-left: 8px; color: var(--mute2); font-size: 11px; }
/* 広い画面で素材名と個数が離れすぎないよう、内訳の行幅に上限を付ける (#619)。 */
.app-shell .op-demand-group { max-width: 420px; }
/* 強化モードの前提と、直前の強化結果(「強化する」の直下) (#619)。 */
.app-shell .op-enh-hint { margin: 0 0 6px; color: var(--mute2); font-size: 11px; }
.app-shell .op-enh-status { margin: 0 0 8px; padding: 6px 10px; border: 1px solid var(--line2); background: var(--panel2); font-weight: 600; }
.app-shell .op-enh-status-success { color: var(--ok-text); border-color: var(--ok-line); background: var(--ok-soft); }
.app-shell :is(.op-enh-status-shortage, .op-enh-status-invalid, .op-enh-status-error) { color: var(--danger); border-color: var(--danger-line); background: var(--danger-soft); }
