/* The builder shares the demo identity while keeping its editing workflow. */
.meta-builder {
  --surface2: var(--surface-2);
  --surface3: var(--surface-3);
  font-family: "Yu Gothic UI", "Hiragino Kaku Gothic ProN", Meiryo, system-ui, sans-serif;
  background: var(--bg);
}
.meta-builder main.mb-shell {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 40px 48px;
}
.meta-builder.mb-record-mode main.mb-shell { max-width: 1240px; }
.mb-header { min-height: 80px; padding: 16px 0; border-color: #233247; }
.meta-builder .mb-brand { display: inline-flex; align-items: center; gap: 10px; font-size: 19px; letter-spacing: -.03em; }
.mb-brand .brand__orb { display: inline-block; flex: 0 0 25px; width: 25px; height: 25px; margin: 0; box-shadow: none; }
.mb-brand small { margin-left: 10px; padding-left: 16px; border-left: 1px solid #34475e; font-size: 10px; font-weight: 500; letter-spacing: .12em; color: var(--muted); }
.mb-header-nav { display: flex; align-items: center; gap: 24px; }
.mb-header-nav .mb-badge { padding: 0; border: 0; background: transparent; color: var(--muted); font-size: 12px; }
.mb-header-nav a { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; color: #d2e1f5; font-size: 13px; text-decoration: none; }
.mb-header-nav a:hover { color: var(--blue); }
.mb-skip-link { position: fixed; top: 12px; left: 20px; z-index: 20; padding: 12px 16px; color: var(--bg); background: var(--text); transform: translateY(-160%); }
.mb-skip-link:focus { transform: none; }
.meta-builder :is(button, a, summary, input, textarea, select):focus-visible { outline: 2px solid #99c7ff; outline-offset: 3px; }

.meta-builder .mb-intro { margin: 40px 0 28px; align-items: flex-end; gap: 24px; }
.meta-builder .mb-intro h1 { font-size: clamp(26px, 2.6vw, 36px); font-weight: 650; line-height: 1.5; letter-spacing: -.035em; margin-bottom: 12px; }
.mb-intro p:not(.mb-eyebrow) { font-size: 15px; line-height: 1.8; }
.mb-intro .mb-eyebrow { font-size: 11px; font-weight: 500; letter-spacing: .14em; margin-bottom: 10px; }
.meta-builder button { min-height: 44px; border-radius: 6px; font-size: 13px; padding: 10px 16px; }
.meta-builder button:disabled { opacity: .55; }
.meta-builder .mb-primary { border-color: #99c3ff; background: #99c3ff; color: #081829; font-weight: 700; }
.meta-builder .mb-primary:hover { border-color: #bedaff; background: #bedaff; }
.meta-builder #mb-sample { background: transparent; color: #c9d9ed; border-color: #34475e; }
.meta-builder #mb-sample:hover { background: var(--surface-2); }
.meta-builder .mb-card { border-color: #2b3b50; border-radius: 8px; }
.meta-builder details.mb-request { margin: 0 0 8px; border-color: #34475e; border-radius: 8px; background: #101d2e; }
.mb-request > summary { padding: 18px 24px; font-size: 14px; font-weight: 600; }
.mb-request > summary span { font-size: 12px; }
.mb-request[open] > summary { border-color: #2b3b50; }
.mb-request-body { padding: 12px 24px 20px; }
.mb-request-body > label { margin: 8px 0 12px; font-size: 16px; color: var(--text); }
.meta-builder :is(input:not([type=file]):not([type=checkbox]), select, textarea) { min-height: 44px; padding: 10px 12px; border-color: #34475e; border-radius: 6px; font-size: 14px; }
.meta-builder textarea::placeholder, .meta-builder input::placeholder { color: #8e9fb5; opacity: 1; }
.meta-builder #mb-instruction { min-height: 116px; padding: 16px; line-height: 1.8; background: #0a1423; }
.mb-request .mb-row { gap: 20px; margin-top: 12px; }
.mb-request .mb-row label { width: 270px; font-size: 12px; }
.mb-request .mb-row select { width: 100%; }
.meta-builder #mb-generate { min-width: 190px; min-height: 48px; padding: 12px 24px; }
.mb-hint { font-size: 12px; line-height: 1.85; }
.mb-request #mb-mode-hint { margin: 8px 0 0; }
.meta-builder .mb-statusbar { min-height: 52px; }
.meta-builder #mb-status { margin: 10px 0; font-size: 12px; line-height: 1.8; }
.mb-clarification { font-size: 13px; }

.mb-toolbar { padding: 16px 0; margin: 0 0 24px; border-color: #29384b; }
.mb-toolbar #mb-revision { font-size: 12px; }
.mb-workspace { grid-template-columns: minmax(360px, .88fr) minmax(0, 1.2fr); gap: 24px; }
.mb-editor-tabs { padding: 8px 16px 0; background: #0d1929; }
.meta-builder .mb-editor-tabs button { padding: 14px 8px; font-size: 14px; }
.mb-editor-panel { padding: 24px; }
.mb-section-heading { margin-bottom: 20px; }
.mb-card h2 { font-size: 18px; font-weight: 600; }
.mb-input-tabs { gap: 4px; padding: 4px; border-radius: 6px; border-color: #34475e; }
.meta-builder .mb-input-tabs button { min-height: 40px; padding: 8px 2px; font-size: 12px; }
.meta-builder .mb-dropzone { min-height: 176px; border-color: #55789f; border-radius: 6px; background: #112338; }
.mb-dropzone strong { font-size: 14px; line-height: 1.8; }
.mb-dropzone > span:not(.mb-upload-icon) { font-size: 12px; }
.meta-builder summary { line-height: 1.8; }
.mb-editor-panel summary { padding: 4px 0; font-size: 13px; }
.meta-builder .mb-next-step { margin-top: 24px; }
.mb-preview { min-height: 580px; padding: 24px; }
.mb-preview h2 { font-size: 24px; font-weight: 600; }
.mb-preview #mb-description { font-size: 13px; line-height: 1.85; }
.mb-preview .mb-badge { border-color: #34475e; background: #17263a; color: #b2c3d9; border-radius: 5px; }
.mb-empty { min-height: 300px; padding: 24px 0; }
.mb-empty > span { font-size: 36px; }
.mb-empty h3 { font-size: 18px; font-weight: 600; }
.mb-empty p { max-width: 38em; margin: 0 auto; font-size: 13px; line-height: 1.9; }
.mb-export { gap: 10px; padding-bottom: 20px; }
.mb-export select { flex: 1; min-width: 0; }
.mb-footer { margin-top: 28px; padding-top: 24px; border-top: 1px solid #233247; font-size: 12px; text-align: left; }

.mb-app-library { padding: 8px 0 20px; border-color: #29384b; margin-bottom: 28px; }
.mb-app-library-details > summary { min-height: 44px; padding: 12px 0; font-size: 13px; }
.mb-record-mode:not(.mb-has-app) #mb-record-app h2 { margin: 8px 0 16px; font-size: 20px; font-weight: 600; }
.mb-app-heading h1 { font-size: 30px; font-weight: 600; }
.mb-app-description { font-size: 14px; }
.mb-app-layout { gap: 28px; }
.mb-app-form { border-radius: 8px; border-color: #34475e; padding: 24px; }
.mb-app-form h3, .mb-app-list h3 { font-size: 16px; }
.mb-app-form label { font-size: 13px; }
.mb-app-list .mb-table-scroll { border-radius: 8px; }
.mb-app-list :is(th, td) { font-size: 13px; }
.mb-app-storage { font-size: 12px; }

@media (max-width: 1050px) {
  .meta-builder main.mb-shell { padding: 0 24px 40px; }
  .mb-workspace { grid-template-columns: minmax(320px, .9fr) minmax(0, 1.1fr); gap: 20px; }
  .mb-editor-panel, .mb-preview { padding: 20px; }
  .mb-header-nav .mb-badge { display: none; }
}
@media (max-width: 800px) {
  .mb-workspace { grid-template-columns: minmax(0, 1fr); }
  .meta-builder .mb-intro { align-items: flex-start; margin-top: 28px; }
  .mb-header { min-height: 72px; }
  .mb-preview { min-height: 0; }
  .mb-empty { min-height: 240px; }
  .mb-app-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 540px) {
  .meta-builder main.mb-shell { padding: 0 16px 32px; }
  .meta-builder .mb-brand { font-size: 17px; gap: 8px; }
  .mb-brand small { display: none; }
  .mb-header-nav { gap: 0; }
  .mb-header-nav a { font-size: 12px; gap: 6px; }
  .meta-builder .mb-intro { margin: 24px 0; gap: 16px; }
  .meta-builder .mb-intro h1 { font-size: 25px; }
  .mb-intro p:not(.mb-eyebrow) { font-size: 13px; }
  .mb-request > summary { padding: 14px 16px; font-size: 13px; }
  .mb-request-body { padding: 8px 16px 16px; }
  .mb-request-body > label { font-size: 15px; }
  .mb-request .mb-row { gap: 8px; }
  .mb-request .mb-row label, .meta-builder #mb-generate { width: 100%; }
  .meta-builder #mb-instruction { padding: 12px; min-height: 136px; }
  .mb-toolbar { gap: 8px; }
  .mb-toolbar #mb-revision { width: 100%; }
  .mb-editor-panel, .mb-preview { padding: 16px; }
  .mb-editor-tabs { padding: 4px 8px 0; }
  .mb-input-tabs { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .meta-builder .mb-input-tabs button { grid-column: span 2; }
  .meta-builder .mb-input-tabs button:last-child { grid-column: span 4; }
  .mb-preview h2 { font-size: 21px; }
  .mb-export { justify-content: flex-start; }
  .mb-export select { max-width: none; width: 100%; flex-basis: 100%; }
  .mb-app-library { align-items: flex-start; gap: 8px; }
  .mb-app-form { padding: 18px; }
  .mb-app-heading h1 { font-size: 25px; }
}
