/* Platform 設置ウィザード — v01setup_design1 移植（platform-v2.3.0 専用） */
:root {
  --ps-bg: #f5f6f8;
  --ps-fg: #2a3050;
  --ps-muted: #6b7280;
  --ps-border: #e4e7ef;
  --ps-card: #fff;
  --ps-accent: #4a90e2;
  --ps-radius: 16px;
  --ps-split-form-pct: 58%;
}

body.ps-setup-v01 { background: var(--ps-bg); }

/* 設置・設定画面はワイド（従来 860px 制限を解除） */
body.ps-setup-v01 .page-wrap {
  max-width: min(1600px, calc(100vw - 32px));
  width: 100%;
  margin: 0 auto;
}

/* --- ウィザード: 上部横ステッパー + 2ペイン --- */
.ps-wizard-shell {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.ps-wizard-stepper-top {
  border-radius: var(--ps-radius);
  border: 1px solid var(--ps-border);
  background: var(--ps-card);
  padding: 12px 16px 14px;
  box-shadow: 0 1px 3px rgba(26,39,68,0.06);
}
.ps-wizard-stepper-title {
  display: flex; align-items: center; gap: 8px;
  padding: 0 4px 10px; font-size: 14px; font-weight: 700;
}

.ps-stepper {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 4px;
}
.ps-stepper--horizontal {
  flex-direction: row;
  gap: 0;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
}
.ps-stepper--horizontal > li {
  flex: 1 1 0;
  min-width: 108px;
  position: relative;
}
.ps-stepper--horizontal > li + li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 1px;
  height: 28px;
  margin-top: -14px;
  background: var(--ps-border);
  pointer-events: none;
}

.ps-stepper-btn {
  display: flex; width: 100%; align-items: flex-start; gap: 12px;
  padding: 12px; border: none; border-radius: 12px; background: transparent;
  text-align: left; cursor: pointer; font-family: inherit; transition: background 0.15s;
}
.ps-stepper--horizontal .ps-stepper-btn {
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding: 10px 8px;
  border-radius: 10px;
}
.ps-stepper-btn:hover:not(:disabled) { background: #f3f4f6; }
.ps-stepper-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.ps-stepper-btn.is-current { background: rgba(74,144,226,0.1); }
.ps-stepper-num {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; background: #f3f4f6; color: var(--ps-muted);
}
.ps-stepper--horizontal .ps-stepper-num { width: 32px; height: 32px; font-size: 13px; }
.ps-stepper-btn.is-current .ps-stepper-num { background: var(--ps-accent); color: #fff; }
.ps-stepper-btn.is-done .ps-stepper-num { background: #10b981; color: #fff; }
.ps-stepper-label { font-size: 14px; font-weight: 600; color: var(--ps-fg); line-height: 1.3; }
.ps-stepper--horizontal .ps-stepper-label { font-size: 12px; }
.ps-stepper-desc { font-size: 12px; color: var(--ps-muted); margin-top: 2px; }
.ps-stepper--horizontal .ps-stepper-desc { display: none; }

/* 2ペイン（フォーム | プレビュー） */
.ps-wizard-split {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: stretch;
  min-height: 0;
}
@media (min-width: 1024px) {
  .ps-wizard-split {
    flex-direction: row;
    gap: 0;
    align-items: stretch;
    min-height: calc(100vh - 280px);
    max-height: calc(100vh - 200px);
  }
}

.ps-wizard-pane { min-width: 0; display: flex; flex-direction: column; }
.ps-wizard-pane--form { flex: 1 1 auto; }
@media (min-width: 1024px) {
  .ps-wizard-pane--form {
    flex: 0 0 var(--ps-split-form-pct);
    max-width: var(--ps-split-form-pct);
    overflow: hidden;
  }
  .ps-wizard-pane--preview {
    flex: 1 1 0;
    min-width: 280px;
    overflow: hidden;
  }
}

.ps-wizard-split-handle {
  display: none;
}
@media (min-width: 1024px) {
  .ps-wizard-split-handle {
    display: flex;
    flex: 0 0 12px;
    align-items: center;
    justify-content: center;
    cursor: col-resize;
    touch-action: none;
    background: transparent;
    position: relative;
    z-index: 2;
  }
  .ps-wizard-split-handle::after {
    content: '';
    width: 4px;
    height: 56px;
    border-radius: 4px;
    background: var(--ps-border);
    transition: background 0.15s, height 0.15s;
  }
  .ps-wizard-split-handle:hover::after,
  .ps-wizard-split-handle:focus-visible::after,
  body.ps-wizard-split-dragging .ps-wizard-split-handle::after {
    background: var(--ps-accent);
    height: 72px;
  }
  .ps-wizard-split-handle:focus-visible { outline: none; }
}

body.ps-wizard-split-dragging {
  cursor: col-resize;
  user-select: none;
}
body.ps-wizard-split-dragging iframe { pointer-events: none; }

#provision-form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: 100%;
}

.ps-wizard-main-card {
  border-radius: var(--ps-radius);
  border: 1px solid var(--ps-border);
  background: var(--ps-card);
  box-shadow: 0 1px 3px rgba(26,39,68,0.06);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: 100%;
}
.ps-wizard-main-hd {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 24px; border-bottom: 1px solid var(--ps-border);
  flex-shrink: 0;
}
.ps-step-kicker { font-size: 12px; font-weight: 600; color: var(--ps-accent); }
.ps-step-title { font-size: 18px; font-weight: 700; margin-top: 2px; }
.ps-progress-dots { display: none; }

.ps-wizard-main-bd {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}
.ps-step-panel { display: none; }
.ps-step-panel.is-active { display: block; }
.ps-step-panel .card { border: none; box-shadow: none; margin: 0; }
.ps-step-panel .card-header { display: none; }
.ps-step-panel .card-body { padding: 0; }

.ps-wizard-main-ft {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 24px; border-top: 1px solid var(--ps-border);
  flex-shrink: 0;
  background: var(--ps-card);
}
.ps-wizard-nav {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 16px; border-radius: 8px; font-size: 14px; font-weight: 600;
  border: none; cursor: pointer; font-family: inherit; transition: background 0.15s;
}
.ps-wizard-nav.prev { background: transparent; color: var(--ps-muted); }
.ps-wizard-nav.prev:hover:not(:disabled) { background: #f3f4f6; }
.ps-wizard-nav.prev:disabled { opacity: 0.4; cursor: not-allowed; }
.ps-wizard-nav.next { background: var(--ps-fg); color: #fff; }
.ps-wizard-nav.next:hover:not(:disabled) { background: var(--ps-accent); }
.ps-wizard-nav.next:disabled { opacity: 0.4; cursor: not-allowed; }

.ps-wizard-preview-wrap {
  border-radius: var(--ps-radius);
  border: 1px solid var(--ps-border);
  background: var(--ps-card);
  padding: 16px;
  box-shadow: 0 1px 3px rgba(26,39,68,0.06);
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
@media (min-width: 1024px) {
  .ps-wizard-preview-wrap {
    height: 100%;
    max-height: none;
  }
}
.ps-wizard-preview-wrap .br-form-preview-card {
  position: static; border: none; box-shadow: none; margin: 0;
}
.ps-wizard-preview-wrap .br-form-preview-card .card-header { padding-top: 0; }

#provision-form.has-ps-wizard .form-save-bar { display: none !important; }

.ps-page-intro { margin-bottom: 20px; }
.ps-page-intro h1 { font-size: 1.5rem; font-weight: 700; color: var(--ps-fg); line-height: 1.35; }
.ps-page-intro p { margin-top: 6px; font-size: 14px; line-height: 1.65; color: var(--ps-muted); }

.ps-settings-shell {
  display: grid; gap: 24px; grid-template-columns: 1fr; align-items: start;
}
@media (min-width: 1024px) {
  .ps-settings-shell { grid-template-columns: minmax(0, 1fr) minmax(360px, 42%); }
}
.ps-settings-main .card { border-radius: var(--ps-radius); box-shadow: 0 1px 3px rgba(26,39,68,0.06); }

.ps-layout-step, .ps-review-step { display: flex; flex-direction: column; gap: 20px; }
.ps-pane-width-box {
  border: 1px solid var(--ps-border); border-radius: 12px; background: #f8f9fb; padding: 16px;
}
.ps-pane-width-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.ps-pane-width-input { width: 88px; }
.ps-pane-width-bar {
  display: flex; height: 40px; overflow: hidden; border-radius: 8px; border: 1px solid var(--ps-border);
}
.ps-pane-width-left, .ps-pane-width-right {
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600;
  transition: width 0.2s;
}
.ps-pane-width-left { background: #fff; color: var(--ps-muted); }
.ps-pane-width-right { background: rgba(74,144,226,0.15); color: var(--ps-accent); }
.ps-pane-width-range { width: 100%; margin-top: 12px; accent-color: var(--ps-accent); }

.ps-file-mode-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .ps-file-mode-grid { grid-template-columns: 1fr 1fr; } }
.ps-file-mode-card {
  display: flex; flex-direction: column; gap: 6px; text-align: left;
  padding: 16px; border: 2px solid var(--ps-border); border-radius: 12px; background: #fff;
  cursor: pointer; font-family: inherit; transition: border-color 0.15s, background 0.15s;
}
.ps-file-mode-card strong { font-size: 14px; color: var(--ps-fg); }
.ps-file-mode-card span { font-size: 12px; line-height: 1.6; color: var(--ps-muted); }
.ps-file-mode-card:hover { border-color: #b8c8e8; background: #f8f9fb; }
.ps-file-mode-card.is-selected {
  border-color: var(--ps-accent); background: rgba(74,144,226,0.06);
  box-shadow: 0 0 0 2px rgba(74,144,226,0.12);
}
.ps-new-window-box {
  margin-top: 12px; border: 1px solid var(--ps-border); border-radius: 12px; background: #f8f9fb; padding: 16px;
}
.ps-check-row { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; }
.ps-new-window-width-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.ps-layout-hint { display: flex; align-items: center; gap: 6px; }

.ps-review-status {
  display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: 12px; font-size: 13px;
}
.ps-review-status.is-ok { border: 1px solid #b8eed0; background: #eafaf1; color: #1e7e45; }
.ps-review-status.is-warn { border: 1px solid #fce8b2; background: #fff8ec; color: #8a6020; }
.ps-review-status strong { font-size: 14px; }
.ps-review-card {
  border: 1px solid var(--ps-border); border-radius: 12px; background: #fff; padding: 16px;
}
.ps-review-card-title { font-size: 14px; font-weight: 700; margin-bottom: 12px; }
.ps-review-group + .ps-review-group { margin-top: 14px; padding-top: 14px; border-top: 1px solid #f0f2f6; }
.ps-review-group-hd {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ps-muted);
}
.ps-review-jump {
  border: none; background: none; color: var(--ps-accent); font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit;
}
.ps-review-jump:hover { text-decoration: underline; }
.ps-review-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.ps-review-list li { font-size: 13px; }
.ps-review-list li.ok { color: var(--ps-fg); }
.ps-review-list li.ng { color: #c0392b; }
.ps-review-list li em { font-style: normal; font-size: 11px; }
.ps-summary-row {
  display: flex; justify-content: space-between; gap: 16px; padding: 10px 0;
  border-bottom: 1px solid rgba(228,231,239,0.8); font-size: 13px;
}
.ps-summary-row:last-child { border-bottom: none; }
.ps-summary-row span { color: var(--ps-muted); }
.ps-summary-row strong { text-align: right; font-weight: 600; color: var(--ps-fg); }

/* v01 ライブプレビュー */
.br-v01-preview { display: flex; flex-direction: column; gap: 10px; }
.br-v01-preview-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px;
}
.br-v01-preview-label { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ps-muted); }
.br-device-toggle {
  display: inline-flex; border: 1px solid var(--ps-border); border-radius: 8px; background: #f3f4f6; padding: 2px;
}
.br-device-btn {
  border: none; background: transparent; padding: 6px 10px; border-radius: 6px;
  font-size: 12px; font-weight: 600; color: var(--ps-muted); cursor: pointer; font-family: inherit;
}
.br-device-btn.is-active { background: #fff; color: var(--ps-fg); box-shadow: 0 1px 2px rgba(0,0,0,0.06); }
.br-v01-preview-frame-wrap {
  display: flex; justify-content: center; border-radius: 12px; background: rgba(107,114,128,0.08); padding: 12px;
}
.br-v01-device-frame { width: 100%; transition: max-width 0.25s; }
.br-v01-device-frame.is-mobile { max-width: 320px; padding: 6px; border: 6px solid rgba(42,48,80,0.85); border-radius: 2rem; box-shadow: 0 8px 24px rgba(0,0,0,0.12); }
.br-v01-portal-shell {
  overflow: hidden; border: 1px solid var(--ps-border); background: #fff;
  border-radius: 8px; box-shadow: 0 1px 3px rgba(26,39,68,0.06);
}
.br-v01-device-frame.is-mobile .br-v01-portal-shell { border-radius: 1.4rem; }
.br-v01-browser-chrome {
  display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-bottom: 1px solid var(--ps-border); background: #f3f4f6;
}
.br-v01-browser-chrome .dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(107,114,128,0.3); }
.br-v01-browser-url {
  flex: 1; margin-left: 6px; padding: 4px 8px; border-radius: 4px; background: #fff;
  font-family: ui-monospace, monospace; font-size: 11px; color: var(--ps-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.br-v01-mobile-notch {
  display: none; justify-content: center; padding: 4px 0; background: rgba(42,48,80,0.85);
}
.br-v01-mobile-notch span { width: 48px; height: 4px; border-radius: 999px; background: rgba(255,255,255,0.35); }
.br-v01-device-frame.is-mobile .br-v01-browser-chrome { display: none; }
.br-v01-device-frame.is-mobile .br-v01-mobile-notch { display: flex; }
.br-v01-status-strip {
  padding: 8px 14px; border-bottom: 1px solid var(--ps-border); background: #fff;
}
.br-v01-status-badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px;
  border: 1px solid #fce8b2; background: #fff8ec; color: #8a6020; font-size: 11px; font-weight: 600;
}
.br-v01-body { display: flex; gap: 12px; padding: 12px; }
.br-v01-body.is-mobile { flex-direction: column; }
.br-v01-col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.br-v01-mini-card { border: 1px solid var(--ps-border); border-radius: 8px; background: #fff; overflow: hidden; }
.br-v01-mini-hd {
  display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-bottom: 1px solid #f0f2f6;
  font-size: 12px; font-weight: 700;
}
.br-v01-mini-bd { padding: 10px; font-size: 11px; color: var(--ps-muted); line-height: 1.6; }
.br-v01-folder-toolbar {
  padding: 6px 10px; border-bottom: 1px solid #f0f2f6; background: #f8f9fb;
  display: flex; align-items: center; gap: 8px; font-size: 10px; color: var(--ps-muted);
}
.br-v01-back-btn {
  display: inline-flex; align-items: center; gap: 2px; padding: 2px 6px; border: 1px solid var(--ps-border);
  border-radius: 4px; background: #fff; font-size: 10px;
}
.br-v01-doc-list { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.br-v01-doc-item {
  display: flex; align-items: center; gap: 6px; padding: 6px 8px; border: 1px solid rgba(228,231,239,0.9); border-radius: 6px; font-size: 11px;
}
.br-v01-news-item { display: flex; align-items: flex-start; gap: 6px; font-size: 11px; }
.br-v01-news-dot { width: 6px; height: 6px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
.br-v01-footer-meta {
  display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 14px; border-top: 1px solid var(--ps-border);
}
.br-v01-meta-chip {
  padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 600; color: #fff;
}
.br-v01-meta-chip.is-muted {
  border: 1px solid var(--ps-border); background: #fff; color: var(--ps-muted); font-weight: 500;
}
.br-v01-preview-hint { text-align: center; font-size: 11px; color: var(--ps-muted); }

@media (max-width: 1023px) {
  .ps-stepper--horizontal > li { min-width: 92px; }
  .ps-stepper--horizontal .ps-stepper-label { font-size: 11px; }
}
