:root,
:root[data-theme="light"] {
  color-scheme: light;
  --lab-bg: #ffffff;
  --lab-fg: #0a0a0a;
  --lab-sub: #5a5a5a;
  --lab-line: #0a0a0a;
  --lab-line-soft: #e5e5e5;
  --lab-surface: #f5f5f2;
  --lab-accent: #10a35a;
  --lab-accent-fg: #ffffff;
  --lab-danger: #be123c;
  --lab-radius: 1px;
  --lab-font-sans: "Noto Sans JP", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --lab-font-mono: "JetBrains Mono", "SF Mono", ui-monospace, monospace;

  /* 既存ページ互換 */
  --page: var(--lab-bg);
  --header: rgba(255, 255, 255, .96);
  --panel: var(--lab-bg);
  --panel2: var(--lab-surface);
  --line: var(--lab-line-soft);
  --lineStrong: var(--lab-line);
  --fg: var(--lab-fg);
  --muted: var(--lab-sub);
  --accent: var(--lab-accent);
  --accent2: var(--lab-accent);
  --accentSoft: rgba(16, 163, 90, .08);
  --danger: var(--lab-danger);
  --chip: transparent;
  --shadow: none;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --lab-bg: #0a0a0a;
  --lab-fg: #ededed;
  --lab-sub: #888888;
  --lab-line: #1f1f1f;
  --lab-line-soft: #1a1a1a;
  --lab-surface: #0f0f0f;
  --lab-accent: #10a35a;
  --lab-accent-fg: #ffffff;
  --lab-danger: #fb7185;

  --page: var(--lab-bg);
  --header: rgba(10, 10, 10, .96);
  --panel: var(--lab-bg);
  --panel2: var(--lab-surface);
  --line: var(--lab-line);
  --lineStrong: var(--lab-line);
  --fg: var(--lab-fg);
  --muted: var(--lab-sub);
  --accent: var(--lab-accent);
  --accent2: var(--lab-accent);
  --accentSoft: rgba(16, 163, 90, .12);
  --danger: var(--lab-danger);
  --chip: transparent;
  --shadow: none;
}

* { box-sizing: border-box; }
html { background: var(--lab-bg); color: var(--lab-fg); }

.lab-accent-dot {
  color: var(--lab-accent);
}

body {
  margin: 0;
  background: var(--lab-bg) !important;
  color: var(--lab-fg) !important;
  font-family: var(--lab-font-sans) !important;
  letter-spacing: .01em;
}
a { color: inherit; }

/* 共通ヘッダー */
.lab-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  min-height: 36px;
  padding: 8px 24px;
  border-bottom: 1px solid var(--lab-line-soft);
  background: var(--header);
  color: var(--lab-fg);
}
.lab-brand {
  color: var(--lab-accent);
  font-family: var(--lab-font-mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .18em;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
}
.lab-brand-logo { display: block; height: 28px; width: auto; }
.lab-brand-logo--dark { display: none; }
:root[data-theme="dark"] .lab-brand-logo--light { display: none; }
:root[data-theme="dark"] .lab-brand-logo--dark { display: block; }
.lab-nav,
.lab-header-actions,
.lab-theme-toggle,
.lab-logout-form {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.lab-nav { overflow-x: auto; scrollbar-width: thin; }
.lab-nav a,
.lab-header-actions a,
.lab-header-actions button,
.lab-logout-button,
.lab-theme-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 20px;
  border: 0;
  border-bottom: 1px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--lab-sub);
  padding: 2px 0 3px;
  font-family: var(--lab-font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .05em;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.lab-nav a:hover,
.lab-header-actions a:hover,
.lab-header-actions button:hover,
.lab-nav a.is-active,
.lab-theme-button[aria-pressed="true"] {
  color: var(--lab-fg);
  border-bottom-color: var(--lab-accent);
}
.lab-theme-toggle { gap: 10px; border-left: 1px solid var(--lab-line-soft); padding-left: 12px; }
.lab-theme-label { display: none; }
.lab-theme-button {
  min-height: 20px;
  border: 0;
  border-bottom: 1px solid transparent;
  padding: 2px 0 3px;
}
.lab-theme-button[aria-pressed="true"] {
  background: transparent;
  border-bottom-color: var(--lab-accent);
  color: var(--lab-fg);
}
.lab-logout-form { margin: 0; }
.lab-logout-button { color: var(--lab-sub); }

/* 共通フッター */
.lab-footer {
  max-width: 1120px;
  margin: 0 auto;
  padding: 16px 18px 26px;
  border-top: 1px solid var(--lab-line);
  color: var(--lab-sub);
  font-family: var(--lab-font-mono);
  font-size: 10px;
}
.lab-footer-simple {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.lab-footer a {
  color: var(--lab-sub);
  text-decoration: none;
}
.lab-footer a:hover { color: var(--lab-accent); }
.lab-footer-home {
  display: grid;
  grid-template-columns: 1.2fr .8fr .8fr;
  gap: 28px;
}
.lab-footer-title {
  margin: 0 0 8px;
  color: var(--lab-fg);
  font-size: 10px;
  letter-spacing: .12em;
}
.lab-footer-text,
.lab-footer-list {
  margin: 0;
  line-height: 1.75;
}
.lab-footer-list { display: grid; gap: 4px; }

/* 後続フェーズ用の共通部品 */
.lab-page { min-height: 100vh; background: var(--lab-bg); color: var(--lab-fg); }
.lab-main,
.lab-section {
  width: min(1120px, calc(100vw - 36px));
  margin: 0 auto;
}
.lab-kicker {
  color: var(--lab-accent);
  font-family: var(--lab-font-mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .18em;
}
.lab-button,
.lab-button-primary,
.lab-button-ghost,
.lab-button-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 34px;
  border: 1px solid var(--lab-line);
  border-radius: 0;
  padding: 8px 14px;
  background: transparent;
  color: var(--lab-fg);
  font-family: var(--lab-font-mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}
.lab-button-primary { background: var(--lab-accent); border-color: var(--lab-accent); color: var(--lab-accent-fg); }
.lab-button-ghost { border-color: var(--lab-line-soft); color: var(--lab-sub); }
.lab-button:hover,
.lab-button-primary:hover,
.lab-button-ghost:hover { border-color: var(--lab-accent); color: var(--lab-accent); }
.lab-button-primary:hover { color: var(--lab-accent-fg); }
.lab-table { width: 100%; border-collapse: collapse; }
.lab-row { border-top: 1px solid var(--lab-line-soft); }
.lab-badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--lab-line-soft);
  padding: 2px 6px;
  color: var(--lab-accent);
  font-family: var(--lab-font-mono);
  font-size: 10px;
  font-weight: 800;
}
.lab-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.lab-tab { border: 1px solid var(--lab-line-soft); border-radius: 0; background: transparent; color: var(--lab-sub); }
.lab-tab.is-active,
.lab-tab.active { background: var(--lab-accent); border-color: var(--lab-accent); color: var(--lab-accent-fg); }
.lab-input,
.lab-textarea,
.lab-note {
  border: 1px solid var(--lab-line-soft);
  border-radius: 0;
  background: var(--lab-surface);
  color: var(--lab-fg);
}
.lab-note { padding: 12px; color: var(--lab-sub); line-height: 1.75; }

/* 既存画面をログ・管理画面風へ寄せる */
.orb { display: none !important; }
.hero,
.card,
.panel,
.composer,
.post,
.box,
.notice,
.item,
.link,
.chip,
.btn,
.tab,
.themeBtn,
.menuSummary,
.menuBody,
.menuItem,
.input,
textarea,
select,
input,
.headerPreview,
.cropEditor,
.cropCanvasWrap,
.headerCropCanvasWrap,
.empty,
.cover,
.profileCard,
.targetBox,
.member,
.mediaItem,
.promoteBox,
.cushionOverlay {
  border-radius: var(--lab-radius) !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
.hero:before,
.card:before,
.panel:before,
.composer:before { display: none !important; }
.card,
.panel,
.composer,
.post,
.box,
.notice,
.item,
.profileCard,
.targetBox,
.member {
  background: var(--lab-bg) !important;
  border-color: var(--lab-line-soft) !important;
}
.btn,
.tab,
.chip,
.themeBtn,
.menuSummary,
.profileLink {
  background: transparent !important;
  border-color: var(--lab-line-soft) !important;
  color: var(--lab-fg) !important;
}
.btn.primary,
.tab.active,
.btn[type="submit"]:not(.danger),
button.primary,
a.primary {
  background: var(--lab-accent) !important;
  border-color: var(--lab-accent) !important;
  color: var(--lab-accent-fg) !important;
}
input,
textarea,
select {
  background: var(--lab-surface) !important;
  border-color: var(--lab-line-soft) !important;
  color: var(--lab-fg) !important;
}
.avatar,
.avatarFallback,
.profileLinkIcon,
.live-avatar { border-radius: 2px !important; }
.emptyIcon { border-radius: 0 !important; }
.muted,
.sub,
.status,
.inlineTime,
.authorSlug { color: var(--lab-sub) !important; }

/* TOPページ */
.lab-home-main { width: min(1120px, calc(100vw - 36px)); margin: 0 auto; padding: 58px 0 34px; }
.lab-home-hero { min-height: 330px; display: grid; place-items: center; text-align: center; border-bottom: 1px solid var(--lab-line); }
.lab-home-hero-inner { max-width: 760px; padding: 42px 0 58px; }
.lab-home-kicker { margin-bottom: 18px; color: var(--lab-accent); font-family: var(--lab-font-mono); font-size: 10px; font-weight: 800; letter-spacing: .22em; }
.lab-home-title { margin: 0 0 18px; color: var(--lab-fg); font-size: clamp(46px, 7vw, 92px); font-weight: 900; letter-spacing: -.08em; line-height: .96; display: inline-flex; align-items: center; justify-content: center; }
.lab-home-logo { display: block; width: clamp(280px, 40vw, 540px); height: auto; }
.lab-home-logo--dark { display: none; }
:root[data-theme="dark"] .lab-home-logo--light { display: none; }
:root[data-theme="dark"] .lab-home-logo--dark { display: block; }
.lab-home-title-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.lab-home-lead { margin: 0 auto; max-width: 690px; color: var(--lab-sub); font-size: 14px; line-height: 2; }
.lab-home-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.lab-services { padding: 40px 0 30px; }
.lab-others { padding-top: 18px; }
.lab-services-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.lab-services-title { margin: 0; font-family: var(--lab-font-mono); font-size: 13px; letter-spacing: .04em; }
.lab-services-count { color: var(--lab-sub); font-family: var(--lab-font-mono); font-size: 10px; }
.lab-service-list { border-top: 1px solid var(--lab-line); }
.lab-service-row {
  display: grid;
  grid-template-columns: 64px minmax(140px, .7fr) minmax(240px, 1.5fr) 150px;
  gap: 20px;
  align-items: stretch;
  min-height: 118px;
  border-bottom: 1px solid var(--lab-line-soft);
  color: var(--lab-fg);
  text-decoration: none;
}
.lab-service-row:hover { background: var(--lab-surface); }
.lab-service-no { padding-top: 24px; color: var(--lab-accent); font-family: var(--lab-font-mono); font-size: 18px; font-weight: 900; }
.lab-service-name { padding: 22px 0; }
.lab-service-name h2 { margin: 0 0 6px; font-size: 24px; line-height: 1.2; letter-spacing: -.04em; }
.lab-service-en { color: var(--lab-sub); font-family: var(--lab-font-mono); font-size: 10px; }
.lab-service-desc { padding: 22px 0; }
.lab-service-lead { margin: 0 0 12px; font-size: 13px; font-weight: 800; line-height: 1.6; }
.lab-service-bullets { display: flex; flex-wrap: wrap; gap: 6px 12px; margin: 0; padding: 0; list-style: none; color: var(--lab-sub); font-size: 11px; line-height: 1.5; }
.lab-service-bullets li::before { content: "- "; color: var(--lab-accent); }
.lab-service-meta { display: grid; align-content: center; gap: 8px; padding: 18px 0 18px 16px; border-left: 1px solid var(--lab-line-soft); font-family: var(--lab-font-mono); font-size: 10px; color: var(--lab-sub); }
.lab-service-tag,
.lab-service-status { display: flex; justify-content: space-between; gap: 8px; }
.lab-service-status strong { color: var(--lab-accent); font-size: 10px; }

@media (max-width: 900px) {
  .lab-header { grid-template-columns: 1fr auto; gap: 8px; padding: 9px 14px; }
  .lab-nav { grid-column: 1 / -1; order: 3; padding-top: 3px; gap: 10px; }
  .lab-header-actions { justify-content: flex-end; }
  .lab-service-row { grid-template-columns: 44px 1fr; gap: 12px; min-height: 0; padding: 16px 0; }
  .lab-service-no, .lab-service-name, .lab-service-desc, .lab-service-meta { padding: 0; }
  .lab-service-desc, .lab-service-meta { grid-column: 2; }
  .lab-service-meta { border-left: 0; border-top: 1px solid var(--lab-line-soft); padding-top: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lab-footer-home { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .lab-header { padding: 8px 12px; }
  .lab-header-actions { gap: 7px; }
  .lab-theme-button { padding: 2px 0 3px; font-size: 9px; }
  .lab-logout-button { font-size: 9px; }
  .lab-home-main { width: min(100% - 24px, 1120px); padding-top: 34px; }
  .lab-home-hero { min-height: 270px; }
  .lab-home-title { font-size: clamp(42px, 14vw, 64px); }
  .lab-home-lead { font-size: 13px; line-height: 1.9; }
  .lab-services-head { display: block; }
  .lab-service-row { grid-template-columns: 34px 1fr; }
  .lab-service-name h2 { font-size: 20px; }
  .lab-service-bullets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lab-service-meta { grid-template-columns: 1fr; }
  .lab-footer-simple { display: grid; gap: 8px; }
}

.lab-service-tag strong { color: var(--lab-accent); font-size: 10px; }

/* Phase 3: 設定ページ */
.lab-settings-page { background: var(--lab-bg); color: var(--lab-fg); }
.lab-settings-shell {
  width: min(1120px, calc(100vw - 36px));
  margin: 0 auto;
  padding: 28px 0 42px;
}
.lab-settings-titlebar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  padding: 22px 0 18px;
  border-bottom: 2px solid var(--lab-line);
}
.lab-settings-titlebar h1 {
  margin: 7px 0 0;
  color: var(--lab-fg);
  font-size: clamp(30px, 4.6vw, 58px);
  font-weight: 900;
  letter-spacing: -.08em;
  line-height: .95;
}
.lab-settings-save {
  display: grid;
  gap: 4px;
  min-width: 168px;
  text-align: right;
  color: var(--lab-sub);
  font-family: var(--lab-font-mono);
  font-size: 10px;
}
.lab-settings-save strong { color: var(--lab-fg); font-weight: 700; line-height: 1.45; }
.lab-settings-message {
  margin: 14px 0 0;
  border: 1px solid var(--lab-accent);
  border-left-width: 4px;
  padding: 10px 12px;
  background: var(--lab-bg);
  color: var(--lab-accent);
  font-size: 12px;
  font-weight: 800;
}
.lab-settings-layout {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 18px;
  padding-top: 18px;
}
.lab-settings-index {
  position: sticky;
  top: 54px;
  align-self: start;
  border-left: 1px solid var(--lab-accent);
  background: var(--lab-surface);
  padding: 12px;
  min-height: 260px;
}
.lab-settings-index-title {
  margin: 0 0 10px;
  color: var(--lab-fg);
  font-family: var(--lab-font-mono);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .12em;
}
.lab-settings-quick-title { margin-top: 0; }
.lab-settings-index-separator {
  height: 1px;
  margin: 14px 0 12px;
  background: var(--lab-line-soft);
  opacity: 1;
}
.lab-settings-index a,
.lab-settings-index-disabled {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--lab-line-soft);
  padding: 8px 0;
  color: var(--lab-fg);
  text-decoration: none;
  font-size: 12px;
  font-weight: 800;
}
.lab-settings-index a span,
.lab-settings-index-disabled em {
  color: var(--lab-sub);
  font-family: var(--lab-font-mono);
  font-size: 9px;
  font-style: normal;
  font-weight: 700;
}
.lab-settings-index a:hover { color: var(--lab-accent); }
.lab-settings-index-disabled { color: var(--lab-sub); }
.lab-settings-content { display: grid; gap: 18px; }
.lab-settings-panel {
  scroll-margin-top: 76px;
  border-top: 2px solid var(--lab-line);
  border-bottom: 1px solid var(--lab-line-soft);
  background: var(--lab-bg);
  padding: 16px 0 18px;
}
.lab-settings-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
}
.lab-settings-panel h2,
.lab-settings-subpanel h3 {
  margin: 5px 0 0;
  color: var(--lab-fg);
  font-weight: 900;
  letter-spacing: -.04em;
  line-height: 1.1;
}
.lab-settings-panel h2 { font-size: 22px; }
.lab-settings-subpanel h3 { font-size: 17px; }
.lab-settings-mini {
  color: var(--lab-sub);
  font-family: var(--lab-font-mono);
  font-size: 10px;
  white-space: nowrap;
}
.lab-settings-table {
  display: grid;
  border-top: 1px solid var(--lab-line-soft);
}
.lab-settings-table.compact { margin-top: 12px; }
.lab-settings-row {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  min-height: 38px;
  border-bottom: 1px solid var(--lab-line-soft);
  padding: 9px 0;
}
.lab-settings-row span {
  color: var(--lab-sub);
  font-family: var(--lab-font-mono);
  font-size: 10px;
  font-weight: 800;
}
.lab-settings-row strong {
  color: var(--lab-fg);
  font-size: 12px;
  line-height: 1.65;
  word-break: break-word;
}
.lab-settings-row a { color: var(--lab-fg); text-decoration: underline; text-decoration-color: var(--lab-accent); text-underline-offset: 3px; }
.lab-settings-note {
  margin: 10px 0 0;
  border-left: 2px solid var(--lab-line-soft);
  padding: 8px 0 8px 12px;
  color: var(--lab-sub);
  font-size: 12px;
  line-height: 1.85;
}
.lab-settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 13px;
}
.lab-settings-inline-form,
.lab-settings-formline { margin: 0; }
.lab-danger-link { color: var(--lab-danger) !important; }
.lab-state-ok { color: var(--lab-accent) !important; }
.lab-state-warn { color: #9f6b00 !important; }
:root[data-theme="dark"] .lab-state-warn { color: #f6d365 !important; }
.lab-settings-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--lab-line);
  border-left-width: 4px;
  padding: 14px 16px;
  margin-bottom: 10px;
}
.lab-settings-status > div {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.lab-settings-status strong {
  color: var(--lab-fg);
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -.03em;
}
.lab-settings-status small {
  color: var(--lab-sub);
  font-family: var(--lab-font-mono);
  font-size: 10px;
  text-align: right;
}
.lab-settings-status-ok { border-left-color: var(--lab-accent); }
.lab-settings-status-warn { border-left-color: #c58b00; }
.lab-settings-dot {
  width: 9px;
  height: 9px;
  border: 1px solid currentColor;
  background: var(--lab-accent);
  display: inline-block;
}
.lab-settings-status-warn .lab-settings-dot { background: #c58b00; }
.lab-settings-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 10px 0 14px;
}
.lab-badge.is-ok { border-color: var(--lab-accent); color: var(--lab-accent); }
.lab-badge.is-warn { border-color: #c58b00; color: #9f6b00; }
:root[data-theme="dark"] .lab-badge.is-warn { color: #f6d365; }
.lab-settings-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.lab-settings-subpanel {
  border: 1px solid var(--lab-line-soft);
  padding: 14px;
  background: var(--lab-surface);
}
.lab-settings-subpanel p {
  margin: 9px 0 0;
  color: var(--lab-sub);
  font-size: 12px;
  line-height: 1.85;
}
.lab-settings-condition-list {
  display: grid;
  gap: 0;
  margin-top: 12px;
  border-top: 1px solid var(--lab-line-soft);
}
.lab-settings-condition-list span {
  border-bottom: 1px solid var(--lab-line-soft);
  padding: 8px 0;
  color: var(--lab-sub);
  font-size: 12px;
  line-height: 1.6;
}
.lab-settings-condition-list span::before { content: "+ "; color: var(--lab-accent); font-family: var(--lab-font-mono); }
.lab-settings-result {
  margin-top: 12px;
  border: 1px solid currentColor;
  padding: 8px 10px;
  font-family: var(--lab-font-mono);
  font-size: 10px;
  font-weight: 900;
}
.lab-settings-result.is-ok { color: var(--lab-accent); }
.lab-settings-result.is-warn { color: #9f6b00; }
:root[data-theme="dark"] .lab-settings-result.is-warn { color: #f6d365; }
.lab-settings-field {
  display: grid;
  gap: 7px;
  width: 100%;
  color: var(--lab-sub);
  font-family: var(--lab-font-mono);
  font-size: 10px;
  font-weight: 800;
}
.lab-settings-formline { display: grid; gap: 10px; margin-top: 12px; }
.lab-settings-channel-list {
  display: grid;
  margin-top: 12px;
  border-top: 1px solid var(--lab-line-soft);
}
.lab-settings-channel-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  border-bottom: 1px solid var(--lab-line-soft);
  padding: 9px 0;
  font-size: 12px;
}
.lab-settings-channel-row span { color: var(--lab-fg); word-break: break-word; }
.lab-settings-channel-row strong { color: var(--lab-accent); font-family: var(--lab-font-mono); font-size: 10px; }
.lab-settings-block-list { display: grid; border-top: 1px solid var(--lab-line-soft); }
.lab-settings-block-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--lab-line-soft);
  padding: 10px 0;
}
.lab-settings-block-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.lab-settings-block-main strong { display: block; font-size: 13px; }
.lab-settings-block-main span { display: block; margin-top: 2px; color: var(--lab-sub); font-size: 11px; }
.lab-settings-avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  object-fit: cover;
  border: 1px solid var(--lab-line-soft);
  border-radius: 0 !important;
}
.lab-settings-avatar-placeholder {
  display: grid;
  place-items: center;
  color: var(--lab-accent);
  font-family: var(--lab-font-mono);
  font-size: 10px;
  font-weight: 900;
}
.lab-settings-toggle-list {
  display: grid;
  margin-top: 14px;
  border-top: 1px solid var(--lab-line-soft);
}
.lab-settings-toggle-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border-bottom: 1px solid var(--lab-line-soft);
  padding: 12px 0;
  cursor: pointer;
}
.lab-settings-toggle-row strong { display: block; color: var(--lab-fg); font-size: 13px; }
.lab-settings-toggle-row small { display: block; margin-top: 3px; color: var(--lab-sub); font-size: 11px; line-height: 1.7; }
.lab-settings-toggle-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--lab-accent);
}
.lab-settings-toggle-row:hover strong { color: var(--lab-accent); }

@media (max-width: 900px) {
  .lab-settings-shell { width: min(100% - 24px, 1120px); padding-top: 18px; }
  .lab-settings-titlebar { display: block; }
  .lab-settings-save { margin-top: 12px; text-align: left; }
  .lab-settings-layout { grid-template-columns: 1fr; }
  .lab-settings-index {
    position: static;
    display: flex;
    overflow-x: auto;
    gap: 10px;
    min-height: 0;
    border-left: 0;
    border-top: 1px solid var(--lab-accent);
    padding: 10px 0;
    background: transparent;
  }
  .lab-settings-index-title { flex: 0 0 auto; margin: 0; padding: 8px 2px 8px 0; }
  .lab-settings-quick-title { margin-top: 0; }
  .lab-settings-index-separator { flex: 0 0 1px; width: 1px; height: 34px; margin: 0 2px; background: var(--lab-line-soft); }
  .lab-settings-index a,
  .lab-settings-index-disabled {
    flex: 0 0 auto;
    min-width: 110px;
    border: 1px solid var(--lab-line-soft);
    padding: 8px;
  }
  .lab-settings-columns { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .lab-settings-titlebar h1 { font-size: 40px; }
  .lab-settings-panel-head { display: block; }
  .lab-settings-mini { display: inline-block; margin-top: 8px; }
  .lab-settings-row { grid-template-columns: 1fr; gap: 2px; align-items: start; }
  .lab-settings-status { display: grid; }
  .lab-settings-status small { text-align: left; }
  .lab-settings-block-row { align-items: flex-start; flex-direction: column; }
  .lab-settings-toggle-row { grid-template-columns: 1fr auto; }
}

/* Phase 5: ざわプロフ公開/編集ページ */
body.lab-profile-page,
body.lab-profile-editor-page,
body.lab-profile-placeholder-page {
  margin: 0;
  min-height: 100vh;
  background: var(--lab-bg) !important;
  color: var(--lab-fg) !important;
  font-family: var(--lab-font-sans) !important;
}
body.lab-profile-page .page,
body.lab-profile-editor-page .page,
body.lab-profile-placeholder-page .page {
  min-height: 100vh;
  background: var(--lab-bg) !important;
  overflow: visible;
}
body.lab-profile-page .wrap,
body.lab-profile-editor-page .wrap,
body.lab-profile-placeholder-page .wrap {
  width: min(1120px, calc(100vw - 36px)) !important;
  max-width: none !important;
  margin: 0 auto !important;
  padding: 30px 0 54px !important;
}
body.lab-profile-page .card,
body.lab-profile-editor-page .card,
body.lab-profile-placeholder-page .card {
  border: 0 !important;
  border-top: 2px solid var(--lab-line) !important;
  border-bottom: 1px solid var(--lab-line-soft) !important;
  background: var(--lab-bg) !important;
  box-shadow: none !important;
  padding: 18px 0 22px !important;
  margin: 0 0 18px !important;
  overflow: visible !important;
}
body.lab-profile-page .card::before,
body.lab-profile-editor-page .card::before,
body.lab-profile-placeholder-page .card::before { display: none !important; }
body.lab-profile-page .cover {
  height: clamp(120px, 18vw, 188px) !important;
  border: 1px solid var(--lab-line-soft) !important;
  background: var(--lab-surface) !important;
  margin-bottom: 0 !important;
}
body.lab-profile-page .cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
body.lab-profile-page .body { padding: 0 !important; }
body.lab-profile-page .profileHeadMedia {
  align-items: flex-end !important;
  gap: 8px !important;
  margin-top: -48px !important;
  margin-left: 16px !important;
}
body.lab-profile-page .avatar,
body.lab-profile-editor-page .avatar,
body.lab-profile-placeholder-page .avatar {
  width: 96px !important;
  height: 96px !important;
  border: 1px solid var(--lab-line) !important;
  border-radius: 0 !important;
  background: var(--lab-bg) !important;
  box-shadow: none !important;
  margin: 0 !important;
  object-fit: cover;
}
body.lab-profile-page .avatarFallback,
body.lab-profile-placeholder-page .avatar {
  display: grid !important;
  place-items: center !important;
  color: var(--lab-accent) !important;
  font-size: 32px !important;
}
body.lab-profile-page .qrThumb {
  width: 42px !important;
  height: 42px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  padding: 0 !important;
  box-shadow: none !important;
  line-height: 0 !important;
  cursor: pointer;
}
body.lab-profile-page .qrThumb img {
  width: 42px !important;
  height: 42px !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  image-rendering: pixelated;
  background: #fff;
}
body.lab-profile-page h1 {
  margin: 14px 0 8px !important;
  padding: 0 16px !important;
  color: var(--lab-fg) !important;
  font-size: clamp(30px, 4.6vw, 56px) !important;
  line-height: .98 !important;
  font-weight: 950 !important;
  letter-spacing: -.08em !important;
}
body.lab-profile-page .profileSlug {
  color: var(--lab-sub) !important;
  font-family: var(--lab-font-mono) !important;
  font-size: 12px !important;
  letter-spacing: .02em !important;
}
body.lab-profile-page .bio {
  margin: 12px 16px 0 !important;
  padding: 14px 0 !important;
  border-top: 1px solid var(--lab-line-soft) !important;
  border-bottom: 1px solid var(--lab-line-soft) !important;
  color: var(--lab-fg) !important;
  font-size: 14px !important;
  line-height: 1.95 !important;
  white-space: pre-wrap !important;
}
body.lab-profile-page .tagList {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
  margin: 12px 16px 0 !important;
}
body.lab-profile-page .tagChip,
body.lab-profile-editor-page .tagChip {
  display: inline-flex !important;
  align-items: center !important;
  border: 1px solid var(--lab-line-soft) !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: var(--lab-accent) !important;
  padding: 4px 7px !important;
  font-family: var(--lab-font-mono) !important;
  font-size: 10px !important;
  font-weight: 850 !important;
  text-decoration: none !important;
}
body.lab-profile-page .tagChip:hover,
body.lab-profile-editor-page .tagChip:hover { border-color: var(--lab-accent) !important; }
body.lab-profile-page .chip.yt,
body.lab-profile-page .link {
  border: 1px solid var(--lab-line-soft) !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: var(--lab-fg) !important;
  font-family: var(--lab-font-mono) !important;
  font-size: 11px !important;
  box-shadow: none !important;
}
body.lab-profile-page .chip.yt { margin: 12px 16px 0 !important; padding: 8px 10px !important; }
body.lab-profile-page .links {
  display: grid !important;
  gap: 0 !important;
  margin: 16px 16px 0 !important;
  border-top: 1px solid var(--lab-line-soft) !important;
}
body.lab-profile-page .link {
  justify-content: space-between !important;
  border-top: 0 !important;
  padding: 10px 0 !important;
  border-left: 0 !important;
  border-right: 0 !important;
  border-bottom: 1px solid var(--lab-line-soft) !important;
}
body.lab-profile-page .blocksSection { margin-top: 0 !important; gap: 12px !important; }
body.lab-profile-page .halfRow { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 12px !important; }
body.lab-profile-page .profileBlock,
body.lab-profile-page .shopItem,
body.lab-profile-page .statBox,
body.lab-profile-page .scheduleItem,
body.lab-profile-page .faqItem details summary,
body.lab-profile-page .faqAnswer,
body.lab-profile-page .offlineMsg,
body.lab-profile-page .liveCard,
body.lab-profile-page .linkIconBtn,
body.lab-profile-page .linkListItem {
  border-radius: 0 !important;
  box-shadow: none !important;
}
body.lab-profile-page .profileBlock {
  border: 1px solid var(--lab-line-soft) !important;
  background: var(--lab-bg) !important;
  padding: 16px !important;
}
body.lab-profile-page .freeProfileElContent .profileBlock,
body.lab-profile-editor-page .previewBody .layoutElContent .profileBlock {
  width: 100% !important;
  height: 100% !important;
  padding: clamp(6px, 2.2%, 16px) !important;
  margin: 0 !important;
}
body.lab-profile-page .profileBlock h3 {
  margin: 0 0 10px !important;
  color: var(--lab-fg) !important;
  font-family: var(--lab-font-mono) !important;
  font-size: 11px !important;
  font-weight: 900 !important;
  letter-spacing: .1em !important;
}
body.lab-profile-page .profileBlock p,
body.lab-profile-page .blockMd { color: var(--lab-fg) !important; font-size: 13px !important; line-height: 1.9 !important; }
body.lab-profile-page .profileBlock[data-block-font],
body.lab-profile-editor-page .previewBody .profileBlock[data-block-font] {
  font-family: var(--block-font-family, var(--lab-font-sans)) !important;
  font-size: calc(14px * var(--block-font-scale, 1)) !important;
}
body.lab-profile-page .profileBlock[data-block-font] h3,
body.lab-profile-editor-page .previewBody .profileBlock[data-block-font] h3 {
  font-family: inherit !important;
  font-size: 1.08em !important;
  line-height: 1.45 !important;
  letter-spacing: 0 !important;
}
body.lab-profile-page .profileBlock[data-block-font] .blockMd,
body.lab-profile-editor-page .previewBody .profileBlock[data-block-font] .blockMd {
  font-family: inherit !important;
  font-size: 1em !important;
  line-height: 1.85 !important;
}
body.lab-profile-page .profileBlock[data-block-font] .blockMd strong,
body.lab-profile-editor-page .previewBody .profileBlock[data-block-font] .blockMd strong { font-weight: 850 !important; }
body.lab-profile-page .linkIconBtn,
body.lab-profile-page .linkListItem,
body.lab-profile-page .scheduleItem,
body.lab-profile-page .faqItem details summary,
body.lab-profile-page .faqAnswer,
body.lab-profile-page .offlineMsg,
body.lab-profile-page .shopItem,
body.lab-profile-page .statBox {
  background: var(--lab-surface) !important;
  border-color: var(--lab-line-soft) !important;
}
body.lab-profile-page .linkIconBtn,
body.lab-profile-page .linkListItem,
body.lab-profile-editor-page .previewBody .linkIconBtn,
body.lab-profile-editor-page .previewBody .linkListItem {
  align-items: center !important;
  line-height: 1 !important;
}
body.lab-profile-page .linkIconBtn .linkLabelText,
body.lab-profile-page .linkListItem .linkLabelText,
body.lab-profile-editor-page .previewBody .linkIconBtn .linkLabelText,
body.lab-profile-editor-page .previewBody .linkListItem .linkLabelText {
  display: inline-flex !important;
  align-items: center !important;
  line-height: 1 !important;
  min-height: 1em !important;
}
body.lab-profile-page .linkListItem .linkLeft,
body.lab-profile-editor-page .previewBody .linkListItem .linkLeft {
  display: inline-flex !important;
  align-items: center !important;
  line-height: 1 !important;
}
body.lab-profile-page .linkIconImg,
body.lab-profile-page .linkIconBtn svg,
body.lab-profile-page .linkListItem svg,
body.lab-profile-editor-page .previewBody .linkIconImg,
body.lab-profile-editor-page .previewBody .linkIconBtn svg,
body.lab-profile-editor-page .previewBody .linkListItem svg {
  display: block !important;
  flex: 0 0 auto !important;
}
body.lab-profile-page .statNum,
body.lab-profile-page .scheduleDate,
body.lab-profile-page .shopPrice,
body.lab-profile-page .shopUnlocked { color: var(--lab-accent) !important; }
body.lab-profile-page .shopBtn,
body.lab-profile-page .liveBtn {
  border-radius: 0 !important;
  background: var(--lab-accent) !important;
  color: var(--lab-accent-fg) !important;
  box-shadow: none !important;
}
body.lab-profile-page .qrModal {
  background: rgba(0,0,0,.74) !important;
  backdrop-filter: none !important;
}
body.lab-profile-page .qrDialog {
  width: auto !important;
  max-width: min(92vw, 330px) !important;
  border: 1px solid var(--lab-line) !important;
  border-radius: 0 !important;
  background: var(--lab-bg) !important;
  box-shadow: none !important;
  padding: 18px !important;
  line-height: 0 !important;
}
body.lab-profile-page .qrClose {
  right: -1px !important;
  top: -37px !important;
  width: 36px !important;
  height: 36px !important;
  border: 1px solid var(--lab-line) !important;
  border-radius: 0 !important;
  background: var(--lab-bg) !important;
  color: var(--lab-fg) !important;
}
body.lab-profile-page .qrLarge { margin: 0 !important; padding: 0 !important; background: #fff !important; }
body.lab-profile-page .qrLarge img { width: min(72vw, 290px) !important; height: min(72vw, 290px) !important; display: block !important; }

body.lab-profile-editor-page .eyebrow,
body.lab-profile-placeholder-page .eyebrow {
  color: var(--lab-accent) !important;
  font-family: var(--lab-font-mono) !important;
  font-size: 10px !important;
  font-weight: 900 !important;
  letter-spacing: .16em !important;
  margin-bottom: 8px !important;
}
body.lab-profile-editor-page h1,
body.lab-profile-placeholder-page h1 {
  color: var(--lab-fg) !important;
  font-size: clamp(30px, 4.5vw, 58px) !important;
  font-weight: 950 !important;
  letter-spacing: -.08em !important;
  line-height: .98 !important;
  margin: 0 0 12px !important;
}
body.lab-profile-editor-page h2,
body.lab-profile-placeholder-page h2 {
  color: var(--lab-fg) !important;
  font-size: 20px !important;
  font-weight: 900 !important;
  letter-spacing: -.04em !important;
}
body.lab-profile-editor-page .formGrid,
body.lab-profile-placeholder-page .grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 0 !important;
  border-top: 1px solid var(--lab-line-soft) !important;
  border-left: 1px solid var(--lab-line-soft) !important;
}
body.lab-profile-editor-page .field,
body.lab-profile-placeholder-page .box {
  border-right: 1px solid var(--lab-line-soft) !important;
  border-bottom: 1px solid var(--lab-line-soft) !important;
  padding: 12px !important;
  background: var(--lab-bg) !important;
  gap: 7px !important;
}
body.lab-profile-editor-page .field.full { grid-column: 1 / -1 !important; }
body.lab-profile-editor-page label,
body.lab-profile-editor-page .label,
body.lab-profile-placeholder-page .label {
  color: var(--lab-sub) !important;
  font-family: var(--lab-font-mono) !important;
  font-size: 10px !important;
  font-weight: 850 !important;
  letter-spacing: .08em !important;
}
body.lab-profile-editor-page .input,
body.lab-profile-editor-page textarea,
body.lab-profile-editor-page select.input,
body.lab-profile-editor-page .smallInput,
body.lab-profile-editor-page .smallTextarea,
body.lab-profile-editor-page .iconSel,
body.lab-profile-editor-page .blockWidthSel,
body.lab-profile-editor-page .blockCornerSel {
  border: 1px solid var(--lab-line-soft) !important;
  border-radius: 0 !important;
  background: var(--lab-surface) !important;
  color: var(--lab-fg) !important;
  box-shadow: none !important;
}
body.lab-profile-editor-page .input:focus,
body.lab-profile-editor-page textarea:focus,
body.lab-profile-editor-page .smallInput:focus,
body.lab-profile-editor-page .smallTextarea:focus {
  border-color: var(--lab-accent) !important;
  outline: 1px solid var(--lab-accent) !important;
  outline-offset: -1px !important;
  box-shadow: none !important;
}
body.lab-profile-editor-page .btn,
body.lab-profile-placeholder-page .btn,
body.lab-profile-placeholder-page .pill,
body.lab-profile-placeholder-page .themeBtn {
  border: 1px solid var(--lab-line-soft) !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: var(--lab-fg) !important;
  font-family: var(--lab-font-mono) !important;
  font-size: 10px !important;
  font-weight: 850 !important;
  letter-spacing: .04em !important;
  box-shadow: none !important;
}
body.lab-profile-editor-page .btn.primary,
body.lab-profile-placeholder-page .btn.primary,
body.lab-profile-placeholder-page .themeBtn[aria-pressed="true"] {
  background: var(--lab-accent) !important;
  border-color: var(--lab-accent) !important;
  color: var(--lab-accent-fg) !important;
}
body.lab-profile-editor-page .btn.danger { color: var(--lab-danger) !important; }
body.lab-profile-editor-page .notice,
body.lab-profile-placeholder-page .notice {
  border: 1px solid var(--lab-line-soft) !important;
  border-left: 3px solid var(--lab-accent) !important;
  border-radius: 0 !important;
  background: var(--lab-bg) !important;
  color: var(--lab-sub) !important;
}
body.lab-profile-editor-page .preview,
body.lab-profile-editor-page .cropEditor,
body.lab-profile-editor-page .cropCanvasWrap,
body.lab-profile-editor-page .headerCropCanvasWrap,
body.lab-profile-editor-page .headerPreview,
body.lab-profile-editor-page .fixed,
body.lab-profile-editor-page .previewPane,
body.lab-profile-editor-page .blockItem,
body.lab-profile-editor-page .blockSettings,
body.lab-profile-editor-page .blockImgPreview,
body.lab-profile-editor-page .shopItem {
  border-radius: 0 !important;
  box-shadow: none !important;
}
body.lab-profile-editor-page .headerPreview,
body.lab-profile-editor-page .cropEditor,
body.lab-profile-editor-page .previewPane,
body.lab-profile-editor-page .blockItem,
body.lab-profile-editor-page .fixed {
  border-color: var(--lab-line-soft) !important;
  background-color: var(--lab-bg) !important;
}
body.lab-profile-editor-page .blocksLayout {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px) !important;
  gap: 18px !important;
}
body.lab-profile-editor-page .blocksRight { position: sticky !important; top: 58px !important; }
body.lab-profile-editor-page .previewPane {
  border: 1px solid var(--lab-line) !important;
  background: var(--lab-bg) !important;
}
body.lab-profile-editor-page .previewPaneHeader {
  border-bottom: 1px solid var(--lab-line-soft) !important;
  background: var(--lab-surface) !important;
  color: var(--lab-sub) !important;
  font-family: var(--lab-font-mono) !important;
  font-size: 10px !important;
}
body.lab-profile-editor-page .blockItemHeader {
  border-bottom: 1px solid var(--lab-line-soft) !important;
  background: var(--lab-bg) !important;
}
body.lab-profile-editor-page .blockTypeBadge {
  border: 1px solid var(--lab-line-soft) !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: var(--lab-accent) !important;
  font-family: var(--lab-font-mono) !important;
}
body.lab-profile-editor-page .blockSettings { border-top: 0 !important; background: var(--lab-surface) !important; }
body.lab-profile-editor-page .blockAddBtns { border-top: 1px solid var(--lab-line-soft); padding-top: 12px; }
body.lab-profile-editor-page .previewBody .card,
body.lab-profile-editor-page .previewBody .profileBlock,
body.lab-profile-editor-page .previewBody .shopItem,
body.lab-profile-editor-page .previewBody .statBox,
body.lab-profile-editor-page .previewBody .scheduleItem,
body.lab-profile-editor-page .previewBody .faqItem details summary,
body.lab-profile-editor-page .previewBody .faqAnswer,
body.lab-profile-editor-page .previewBody .linkIconBtn,
body.lab-profile-editor-page .previewBody .linkListItem {
  border-radius: 0 !important;
  box-shadow: none !important;
}
body.lab-profile-editor-page .previewBody .profileBlock,
body.lab-profile-editor-page .previewBody .card {
  background: var(--lab-bg) !important;
  border-color: var(--lab-line-soft) !important;
}
body.lab-profile-editor-page .shopItem {
  border: 1px solid var(--lab-line-soft) !important;
  background: var(--lab-bg) !important;
}
body.lab-profile-editor-page #shopItemList > .card {
  border: 1px solid var(--lab-line-soft) !important;
  padding: 14px !important;
}
@media (max-width: 960px) {
  body.lab-profile-editor-page .blocksLayout { grid-template-columns: 1fr !important; }
  body.lab-profile-editor-page .blocksRight { position: static !important; }
}
@media (max-width: 760px) {
  body.lab-profile-page .wrap,
  body.lab-profile-editor-page .wrap,
  body.lab-profile-placeholder-page .wrap { width: min(100% - 24px, 1120px) !important; padding-top: 20px !important; }
  body.lab-profile-page .halfRow,
  body.lab-profile-editor-page .formGrid,
  body.lab-profile-placeholder-page .grid { grid-template-columns: 1fr !important; }
  body.lab-profile-page .profileHeadMedia { margin-left: 10px !important; }
  body.lab-profile-page .avatar { width: 82px !important; height: 82px !important; }
  body.lab-profile-page .qrThumb,
  body.lab-profile-page .qrThumb img { width: 38px !important; height: 38px !important; }
  body.lab-profile-page h1 { padding: 0 10px !important; font-size: 36px !important; }
  body.lab-profile-page .bio,
  body.lab-profile-page .tagList,
  body.lab-profile-page .links,
  body.lab-profile-page .chip.yt { margin-left: 10px !important; margin-right: 10px !important; }
  body.lab-profile-editor-page .field,
  body.lab-profile-placeholder-page .box { grid-column: 1 !important; }
  body.lab-profile-editor-page .cropEditorInner { grid-template-columns: 1fr !important; }
  body.lab-profile-editor-page .cropCanvasWrap { width: 100% !important; }
}

/* Phase6 follow-up: profile tabs / media row / mobile timeline fit */
body.lab-profile-page .profileTopTabs {
  display: flex !important;
  align-items: flex-end !important;
  flex-wrap: wrap !important;
  gap: 0 !important;
  border-bottom: 2px solid var(--lab-line) !important;
  margin: 0 0 18px !important;
  padding: 0 !important;
}
body.lab-profile-page .profileTopTab {
  appearance: none !important;
  border: 1px solid var(--lab-line-soft) !important;
  border-bottom: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: var(--lab-fg) !important;
  padding: 8px 13px !important;
  margin: 0 6px 0 0 !important;
  font-family: var(--lab-font-mono) !important;
  font-size: 11px !important;
  font-weight: 900 !important;
  letter-spacing: .06em !important;
  line-height: 1.2 !important;
  cursor: pointer !important;
  box-shadow: none !important;
}
body.lab-profile-page .profileTopTab:hover {
  color: var(--lab-accent) !important;
  border-color: var(--lab-accent) !important;
}
body.lab-profile-page .profileTopTab.active {
  color: var(--lab-accent) !important;
  text-decoration: underline !important;
  text-decoration-color: var(--lab-accent) !important;
  text-underline-offset: 5px !important;
  background: var(--lab-bg) !important;
}
body.lab-profile-page .profileHeadMedia {
  display: flex !important;
  align-items: flex-end !important;
  flex-wrap: wrap !important;
  gap: 10px !important;
}
body.lab-profile-page .profileYoutubeChip,
body.lab-profile-page .chip.yt.profileYoutubeChip {
  margin: 0 !important;
  align-self: flex-end !important;
  min-height: 30px !important;
  padding: 8px 10px !important;
  white-space: nowrap !important;
}
body.lab-profile-page .profileHeadMedia .qrThumb {
  align-self: flex-end !important;
  margin: 0 0 0 0 !important;
}
body.lab-profile-page .profileTitleBlock {
  margin-top: 14px !important;
}
body.lab-profile-page .profileNameRow {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 0 16px !important;
}
body.lab-profile-page .profileNameRow h1 {
  padding: 0 !important;
  margin: 0 !important;
}
body.lab-profile-page .profileSlug {
  display: block !important;
  margin: 5px 16px 0 !important;
}
body.lab-profile-page .statBox,
body.lab-profile-editor-page .previewBody .statBox {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 74px !important;
  text-align: center !important;
}
body.lab-profile-page .statNum,
body.lab-profile-editor-page .previewBody .statNum {
  min-height: 28px !important;
  line-height: 1 !important;
  display: flex !important;
  align-items: flex-end !important;
  justify-content: center !important;
  white-space: nowrap !important;
  font-variant-numeric: tabular-nums !important;
}
body.lab-profile-page .statLabel,
body.lab-profile-editor-page .previewBody .statLabel {
  line-height: 1.2 !important;
}
body.lab-profile-page .scheduleItem,
body.lab-profile-editor-page .previewBody .scheduleItem {
  display: grid !important;
  grid-template-columns: minmax(110px, auto) minmax(0, 1fr) auto !important;
  gap: 10px !important;
  align-items: start !important;
}
body.lab-profile-page .scheduleDate,
body.lab-profile-editor-page .previewBody .scheduleDate {
  padding-top: 1px !important;
  white-space: nowrap !important;
  font-variant-numeric: tabular-nums !important;
}
body.lab-profile-page .recurrenceBadge,
body.lab-profile-editor-page .previewBody .recurrenceBadge {
  justify-self: end !important;
}
@media (max-width: 760px) {
  body.lab-profile-page .profileTopTabs { margin-bottom: 16px !important; }
  body.lab-profile-page .profileTopTab { flex: 1 1 calc(50% - 4px) !important; margin-right: 4px !important; }
  body.lab-profile-page .profileHeadMedia { gap: 8px !important; }
  body.lab-profile-page .profileYoutubeChip,
  body.lab-profile-page .chip.yt.profileYoutubeChip { font-size: 10px !important; padding: 7px 8px !important; }
  body.lab-profile-page .profileNameRow { padding: 0 10px !important; }
  body.lab-profile-page .profileSlug { margin-left: 10px !important; margin-right: 10px !important; }
  body.lab-profile-page .scheduleItem { grid-template-columns: 1fr !important; gap: 5px !important; }
  body.lab-profile-page .recurrenceBadge { justify-self: start !important; }
}

/* Phase7: 規約・お問い合わせ・コイン・投稿詳細 共通デザイン */
.lab-doc-shell,
.lab-post-detail-shell {
  width: min(980px, calc(100vw - 36px));
  margin: 0 auto;
  padding: 30px 0 64px;
}
.lab-doc-shell.wide { width: min(1120px, calc(100vw - 36px)); }
.lab-doc-hero,
.lab-doc-panel,
.lab-post-detail-panel,
.lab-post-author-panel {
  border: 1px solid var(--lab-line);
  background: var(--lab-bg);
  color: var(--lab-fg);
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: none;
  border-radius: 0;
}
.lab-doc-hero { border-top-color: var(--lab-line); padding: 22px 18px; }
.lab-doc-hero h1,
.lab-post-detail-title h1 { margin: 8px 0 0; color: var(--lab-fg); font-size: clamp(28px, 5vw, 54px); line-height: 1; letter-spacing: -.04em; }
.lab-doc-hero p,
.lab-doc-panel p,
.lab-post-sub,
.lab-post-detail-note { color: var(--lab-sub); line-height: 1.9; }
.lab-doc-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, .8fr); gap: 16px; align-items: start; }
.lab-doc-toc,
.lab-doc-actions,
.lab-post-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.lab-doc-toc a,
.lab-doc-chip,
.lab-post-chip { display: inline-flex; align-items: center; min-height: 28px; border: 1px solid var(--lab-line-soft); padding: 6px 10px; color: var(--lab-fg); background: transparent; font-family: var(--lab-font-mono); font-size: 10px; font-weight: 850; letter-spacing: .06em; text-decoration: none; }
.lab-doc-toc a:hover,
.lab-doc-chip:hover,
.lab-post-chip:hover { border-color: var(--lab-accent); color: var(--lab-accent); }
.lab-doc-panel h2,
.lab-doc-panel h3 { color: var(--lab-fg); }
.lab-doc-panel h2 { margin: 0 0 12px; border-bottom: 1px solid var(--lab-line); padding-bottom: 10px; font-size: 22px; }
.lab-doc-panel h3 { margin: 24px 0 8px; border-left: 2px solid var(--lab-accent); padding-left: 10px; font-size: 15px; }
.lab-doc-panel ul { padding-left: 1.35em; }
.lab-doc-panel li { color: var(--lab-sub); line-height: 1.85; margin: 2px 0; }
.lab-form-grid { display: grid; gap: 12px; }
.lab-form-grid label { display: grid; gap: 6px; color: var(--lab-sub); font-size: 12px; font-weight: 850; }
.lab-form-grid input,
.lab-form-grid textarea,
.lab-form-grid select { width: 100%; border: 1px solid var(--lab-line-soft); background: var(--lab-surface); color: var(--lab-fg); padding: 10px 11px; font: inherit; border-radius: 0; }
.lab-form-grid textarea { min-height: 150px; resize: vertical; }
.lab-form-grid option { background: var(--lab-bg); color: var(--lab-fg); }
.lab-message-ok,
.lab-message-error { border: 1px solid var(--lab-line); border-left: 4px solid var(--lab-accent); padding: 10px 12px; margin: 12px 0; color: var(--lab-fg); background: var(--lab-surface); font-size: 13px; font-weight: 800; }
.lab-message-error { border-left-color: var(--lab-danger); color: var(--lab-danger); }
.lab-log-list { display: grid; gap: 0; border-top: 1px solid var(--lab-line); }
.lab-log-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center; border-bottom: 1px solid var(--lab-line-soft); padding: 12px 0; color: var(--lab-fg); text-decoration: none; }
.lab-log-row:hover { background: var(--lab-surface); }
.lab-log-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.lab-log-avatar { width: 42px; height: 42px; object-fit: cover; border: 1px solid var(--lab-line); background: var(--lab-surface); display: grid; place-items: center; flex: 0 0 auto; font-family: var(--lab-font-mono); font-size: 11px; color: var(--lab-accent); }
.lab-log-name { font-weight: 950; }
.lab-log-sub { color: var(--lab-sub); font-size: 12px; word-break: break-all; }
.lab-log-value { color: var(--lab-accent); font-family: var(--lab-font-mono); font-size: 16px; font-weight: 950; white-space: nowrap; }
.lab-empty-box { border: 1px dashed var(--lab-line-soft); padding: 18px; color: var(--lab-sub); line-height: 1.8; background: var(--lab-surface); }

/* 既存terms内のwrap/card/tocを標準デザインに寄せる */
.lab-legal-page .wrap { width: min(980px, calc(100vw - 36px)); max-width: none; padding: 30px 0 64px; }
.lab-legal-page .card { border: 1px solid var(--lab-line) !important; background: var(--lab-bg) !important; border-radius: 0 !important; padding: 18px !important; }
.lab-legal-page .toc { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.lab-legal-page .toc a { border: 1px solid var(--lab-line-soft) !important; border-radius: 0 !important; background: transparent !important; color: var(--lab-fg) !important; font-family: var(--lab-font-mono); font-size: 10px; font-weight: 850; text-decoration: none; padding: 6px 10px; }
.lab-legal-page .toc a:hover { border-color: var(--lab-accent) !important; color: var(--lab-accent) !important; }
.lab-legal-page .section-title { color: var(--lab-fg) !important; border-bottom: 1px solid var(--lab-line); padding-bottom: 10px; }
.lab-legal-page h3 { border-left: 2px solid var(--lab-accent) !important; color: var(--lab-fg) !important; }
.lab-legal-page p,
.lab-legal-page li,
.lab-legal-page .lead,
.lab-legal-page .meta { color: var(--lab-sub) !important; }

.lab-post-detail-page { background: var(--lab-bg); color: var(--lab-fg); }
.lab-post-detail-hero { display: flex; align-items: end; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--lab-line); padding: 28px 0 16px; margin-bottom: 16px; }
.lab-post-detail-title h1 { font-size: clamp(34px, 6vw, 62px); }
.lab-post-detail-panel { position: relative; padding: 0; }
.lab-post-detail-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--lab-line-soft); padding: 10px 12px; }
.lab-post-detail-meta-right { display: flex; align-items: center; gap: 8px; color: var(--lab-sub); font-family: var(--lab-font-mono); font-size: 10px; font-weight: 850; }
.lab-post-detail-kind { border: 1px solid var(--lab-line-soft); padding: 3px 6px; }
.lab-post-detail-body { padding: 16px 12px 18px; }
.lab-post-detail-author { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; }
.lab-post-detail-author .avatar { width: 42px !important; height: 42px !important; border: 1px solid var(--lab-line); object-fit: cover; }
.lab-post-detail-author-name { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; font-weight: 950; }
.lab-post-detail-author-slug,
.lab-post-detail-time { color: var(--lab-sub); font-family: var(--lab-font-mono); font-size: 11px; }
.lab-post-detail-text { white-space: pre-wrap; word-break: break-word; line-height: 1.9; font-size: 15px; }
.lab-post-detail-page .mediaGrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; margin-top: 14px; }
.lab-post-detail-page .mediaItem { position: relative; overflow: hidden; border: 1px solid var(--lab-line); aspect-ratio: 1; background: var(--lab-surface); }
.lab-post-detail-page .mediaItem img { width: 100%; height: 100%; display: block; object-fit: cover; cursor: zoom-in; }
.lab-post-detail-page .audioList { display: grid; gap: 8px; margin-top: 14px; }
.lab-post-detail-page .audioList audio { width: 100%; }
.lab-post-detail-footer { border-top: 1px solid var(--lab-line-soft); padding: 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.lab-post-author-panel h2 { margin: 0 0 12px; font-family: var(--lab-font-mono); font-size: 11px; letter-spacing: .14em; }
.lab-post-author-links { display: flex; flex-wrap: wrap; gap: 8px; }
.lab-post-detail-page .postLink { color: var(--lab-accent); text-decoration: underline; text-underline-offset: 2px; word-break: break-all; }
.lab-post-detail-page .textCushion.isHidden { display: inline-block; filter: blur(5px); background: rgba(128,128,128,.25); padding: 0 4px; cursor: pointer; user-select: none; }
.lab-post-detail-page .mediaCushion { filter: blur(28px); transform: scale(1.08); }
.lab-post-detail-page .cushionOverlay { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.44); color: #fff; font-size: 12px; font-weight: 900; text-align: center; padding: 10px; cursor: pointer; border: 0; width: 100%; height: 100%; }
.lab-post-detail-page #imgLightbox { display: none; position: fixed; inset: 0; z-index: 9999; background: rgba(0,0,0,.88); align-items: center; justify-content: center; cursor: zoom-out; }
.lab-post-detail-page #imgLightbox.open { display: flex; }
.lab-post-detail-page #imgLightbox img { max-width: 90vw; max-height: 90vh; object-fit: contain; transform-origin: center; transition: transform .1s; user-select: none; cursor: default; }
.lab-post-detail-page #lbClose { position: fixed; top: 16px; right: 20px; color: #fff; font-size: 28px; cursor: pointer; line-height: 1; background: rgba(0,0,0,.5); border: 0; width: 36px; height: 36px; display: grid; place-items: center; }
@media (max-width: 760px) {
  .lab-doc-shell,
  .lab-post-detail-shell { width: min(100% - 24px, 980px); padding: 22px 0 48px; }
  .lab-doc-grid { grid-template-columns: 1fr; }
  .lab-log-row { grid-template-columns: 1fr; }
  .lab-log-value { justify-self: start; }
  .lab-post-detail-hero { display: block; }
  .lab-post-actions { margin-top: 12px; }
  .lab-post-detail-meta { align-items: flex-start; }
  .lab-post-detail-page .mediaGrid { grid-template-columns: 1fr !important; }
}

.lab-note-list { display: grid; gap: 8px; margin: 10px 0 12px; }
.lab-note-list > div { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px; align-items: start; border: 1px solid var(--lab-line-soft); padding: 8px 9px; background: var(--lab-bg); }
.lab-note-list strong { color: var(--lab-accent); font-family: var(--lab-font-mono); font-size: 11px; letter-spacing: .08em; }
.lab-note-list span { color: var(--lab-sub); font-size: 12px; line-height: 1.7; }
.profileHistoryBody.isClamped { max-height: var(--profile-history-clamp-height, 21em); overflow: hidden; position: relative; }
.profileHistoryBody.isClamped:not(.isExpanded)::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3em; background: linear-gradient(to bottom, rgba(255,255,255,0), var(--lab-bg)); pointer-events: none; }
html[data-theme="dark"] .profileHistoryBody.isClamped:not(.isExpanded)::after { background: linear-gradient(to bottom, rgba(10,10,10,0), var(--lab-bg)); }
.profileHistoryBody.isExpanded { max-height: none !important; }
.profileHistoryBodyToggle { margin-top: 5px; border: 1px solid var(--lab-line-soft); background: transparent; color: var(--lab-accent); font: inherit; font-family: var(--lab-font-mono); font-size: 10px; font-weight: 900; padding: 4px 7px; cursor: pointer; }
.profileHistoryBodyToggle:hover { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 640px) {
  .lab-note-list > div { grid-template-columns: 1fr; gap: 4px; }
  .schedCardNoticeRow { grid-template-columns: 1fr !important; }
}

/* YouTube実績: 公開プロフは lab の汎用 .statBox / .profileBlock が !important で縦パディング・min-height を強制し、
   エディタのレイアウトキャンバスと表示がズレていた。実績ブロックだけ締め直す。 */
body.lab-profile-page .profileBlock.statsBlock,
body.lab-profile-page .freeProfileElContent .profileBlock.statsBlock {
  padding: 2px 4px !important;
}
body.lab-profile-page .profileBlock.statsBlock .statBox,
body.lab-profile-page .freeProfileElContent .statsBlock .statBox,
body.lab-profile-editor-page .layoutElContent .statsBlock .statBox {
  justify-content: flex-start !important;
  min-height: 0 !important;
}
body.lab-profile-page .profileBlock.statsBlock .statNum,
body.lab-profile-page .freeProfileElContent .statsBlock .statNum,
body.lab-profile-editor-page .layoutElContent .statsBlock .statNum {
  min-height: 0 !important;
  display: block !important;
  align-items: unset !important;
  justify-content: unset !important;
  line-height: 1.1 !important;
}

/* 配信ウィジェット: Lab の .profileBlock 16px パディング + overflow で低いレイヤーだとオフライン文がクリップされる。 */
body.lab-profile-page .profileBlock.liveWidgetBlock,
body.lab-profile-page .freeProfileElContent .profileBlock.liveWidgetBlock {
  padding: 6px 8px !important;
  overflow: visible !important;
}
body.lab-profile-editor-page .layoutElContent .profileBlock.liveWidgetBlock {
  padding: 6px 8px !important;
  overflow: visible !important;
}

/* zawa: 実績・配信をレイヤー親の高さに追従＋オフライン文言の可読性（Lab より後ろで確定） */
body.lab-profile-page .profileBlock.statsBlock.zawaStatsLayerRoot,
body.lab-profile-page .freeProfileElContent .profileBlock.statsBlock.zawaStatsLayerRoot,
body.lab-profile-page .profileBlock.liveWidgetBlock.zawaLiveLayerRoot,
body.lab-profile-page .freeProfileElContent .profileBlock.liveWidgetBlock.zawaLiveLayerRoot {
  height: 100% !important;
  max-height: 100%;
  min-height: 0;
  box-sizing: border-box;
}
body.lab-profile-page .profileBlock.liveWidgetBlock .offlineMsg[data-live-offline-msg="1"],
body.lab-profile-page .freeProfileElContent .offlineMsg[data-live-offline-msg="1"] {
  color: var(--lab-fg) !important;
  line-height: 1.55 !important;
}
body.lab-profile-editor-page .layoutElContent .profileBlock.statsBlock.zawaStatsLayerRoot,
body.lab-profile-editor-page .layoutElContent .profileBlock.liveWidgetBlock.zawaLiveLayerRoot {
  height: 100% !important;
  max-height: 100%;
  min-height: 0;
  box-sizing: border-box;
}
body.lab-profile-editor-page .layoutElContent .offlineMsg[data-live-offline-msg="1"] {
  color: var(--lab-fg) !important;
  line-height: 1.55 !important;
}

/* zawa profile free-layout parity: public profile and editor preview must render through the same visual rules. */
body.lab-profile-page .freeProfileStage,
body.lab-profile-editor-page .previewBody .freeProfileStage {
  width: 720px !important;
  height: 1080px !important;
  background: var(--page) !important;
  border: 1px solid var(--lineStrong) !important;
  box-shadow: 0 22px 80px rgba(0,0,0,.28) !important;
  overflow: hidden !important;
}
body.lab-profile-page .freeProfileEl,
body.lab-profile-editor-page .previewBody .freeProfileEl {
  position: absolute !important;
  transform-origin: center center !important;
}
body.lab-profile-page .freeProfileElContent,
body.lab-profile-editor-page .previewBody .freeProfileElContent {
  width: 100% !important;
  height: 100% !important;
  overflow: hidden !important;
  container-type: inline-size !important;
  box-sizing: border-box !important;
}
body.lab-profile-page .freeProfileElInner,
body.lab-profile-editor-page .previewBody .freeProfileElInner {
  width: 100% !important;
  height: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  box-sizing: border-box !important;
}
body.lab-profile-page .freeProfileElContent .profileBlock,
body.lab-profile-editor-page .previewBody .freeProfileElContent .profileBlock {
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: clamp(6px, 2.2%, 16px) !important;
  border: 1px solid var(--lab-line-soft) !important;
  border-radius: 0 !important;
  background: var(--lab-bg) !important;
  box-shadow: none !important;
  color: var(--lab-fg) !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}
body.lab-profile-page .freeProfileElContent .profileBlock h3,
body.lab-profile-editor-page .previewBody .freeProfileElContent .profileBlock h3 {
  margin: 0 0 10px !important;
  color: var(--lab-fg) !important;
  font-family: var(--lab-font-mono) !important;
  font-size: 11px !important;
  font-weight: 900 !important;
  letter-spacing: .1em !important;
  line-height: 1.45 !important;
}
body.lab-profile-page .freeProfileElContent .profileBlock p,
body.lab-profile-page .freeProfileElContent .blockMd,
body.lab-profile-editor-page .previewBody .freeProfileElContent .profileBlock p,
body.lab-profile-editor-page .previewBody .freeProfileElContent .blockMd {
  color: var(--lab-fg) !important;
  font-size: 13px !important;
  line-height: 1.9 !important;
}
body.lab-profile-page .freeProfileElContent .profileBlock[data-block-font],
body.lab-profile-editor-page .previewBody .freeProfileElContent .profileBlock[data-block-font] {
  font-family: var(--block-font-family, var(--lab-font-sans)) !important;
  font-size: calc(14px * var(--block-font-scale, 1)) !important;
}
body.lab-profile-page .freeProfileElContent .profileBlock[data-block-font] h3,
body.lab-profile-editor-page .previewBody .freeProfileElContent .profileBlock[data-block-font] h3 {
  font-family: inherit !important;
  font-size: 1.08em !important;
  letter-spacing: 0 !important;
}
body.lab-profile-page .freeProfileElContent .profileBlock[data-block-font] .blockMd,
body.lab-profile-editor-page .previewBody .freeProfileElContent .profileBlock[data-block-font] .blockMd {
  font-family: inherit !important;
  font-size: 1em !important;
  line-height: 1.85 !important;
}
body.lab-profile-page .freeProfileElContent .linkIconBtn,
body.lab-profile-page .freeProfileElContent .linkListItem,
body.lab-profile-page .freeProfileElContent .scheduleItem,
body.lab-profile-page .freeProfileElContent .faqItem details summary,
body.lab-profile-page .freeProfileElContent .faqAnswer,
body.lab-profile-page .freeProfileElContent .offlineMsg,
body.lab-profile-page .freeProfileElContent .liveCard,
body.lab-profile-page .freeProfileElContent .shopItem,
body.lab-profile-page .freeProfileElContent .statBox,
body.lab-profile-editor-page .previewBody .freeProfileElContent .linkIconBtn,
body.lab-profile-editor-page .previewBody .freeProfileElContent .linkListItem,
body.lab-profile-editor-page .previewBody .freeProfileElContent .scheduleItem,
body.lab-profile-editor-page .previewBody .freeProfileElContent .faqItem details summary,
body.lab-profile-editor-page .previewBody .freeProfileElContent .faqAnswer,
body.lab-profile-editor-page .previewBody .freeProfileElContent .offlineMsg,
body.lab-profile-editor-page .previewBody .freeProfileElContent .liveCard,
body.lab-profile-editor-page .previewBody .freeProfileElContent .shopItem,
body.lab-profile-editor-page .previewBody .freeProfileElContent .statBox {
  border-radius: 0 !important;
  box-shadow: none !important;
  background: var(--lab-surface) !important;
  border-color: var(--lab-line-soft) !important;
}
body.lab-profile-page .freeProfileElContent .linkIconBtn,
body.lab-profile-page .freeProfileElContent .linkListItem,
body.lab-profile-page .freeProfileElContent .linkListItem .linkLeft,
body.lab-profile-page .freeProfileElContent .linkLabelText,
body.lab-profile-editor-page .previewBody .freeProfileElContent .linkIconBtn,
body.lab-profile-editor-page .previewBody .freeProfileElContent .linkListItem,
body.lab-profile-editor-page .previewBody .freeProfileElContent .linkListItem .linkLeft,
body.lab-profile-editor-page .previewBody .freeProfileElContent .linkLabelText {
  align-items: center !important;
  line-height: 1 !important;
}
body.lab-profile-page .freeProfileElContent .linkLabelText,
body.lab-profile-editor-page .previewBody .freeProfileElContent .linkLabelText {
  display: inline-flex !important;
  min-height: 1em !important;
}
body.lab-profile-page .freeProfileElContent:has(.profileBlock.statsBlock),
body.lab-profile-page .freeProfileElContent:has(.profileBlock.liveWidgetBlock),
body.lab-profile-editor-page .previewBody .freeProfileElContent:has(.profileBlock.statsBlock),
body.lab-profile-editor-page .previewBody .freeProfileElContent:has(.profileBlock.liveWidgetBlock) {
  overflow: visible !important;
}
body.lab-profile-page .freeProfileElContent .profileBlock.statsBlock,
body.lab-profile-page .freeProfileElContent .profileBlock.liveWidgetBlock,
body.lab-profile-editor-page .previewBody .freeProfileElContent .profileBlock.statsBlock,
body.lab-profile-editor-page .previewBody .freeProfileElContent .profileBlock.liveWidgetBlock {
  height: 100% !important;
  max-height: 100% !important;
  min-height: 0 !important;
  box-sizing: border-box !important;
}
body.lab-profile-page .freeProfileElContent .profileBlock.statsBlock,
body.lab-profile-editor-page .previewBody .freeProfileElContent .profileBlock.statsBlock {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  gap: 0 !important;
  padding: 2px 4px !important;
  overflow: visible !important;
}
body.lab-profile-page .freeProfileElContent .statsBlock .statsGrid,
body.lab-profile-editor-page .previewBody .freeProfileElContent .statsBlock .statsGrid {
  flex: 1 1 auto !important;
  width: 100% !important;
  min-height: 0 !important;
  display: grid !important;
  grid-auto-rows: minmax(0,1fr) !important;
  gap: 3px !important;
  align-items: stretch !important;
  justify-items: stretch !important;
}
body.lab-profile-page .freeProfileElContent .statsBlock .statBox,
body.lab-profile-editor-page .previewBody .freeProfileElContent .statsBlock .statBox {
  min-height: 0 !important;
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-start !important;
  overflow: visible !important;
  box-sizing: border-box !important;
}

body.lab-profile-page .freeProfileElInner.hasLayerZabuton > .profileBlock.linksBlock,
body.lab-profile-editor-page .previewBody .freeProfileElInner.hasLayerZabuton > .profileBlock.linksBlock {
  background: transparent !important;
  border-color: transparent !important;
}
body.lab-profile-editor-page .previewBody .layoutEl.isLocked {
  pointer-events: none !important;
  cursor: default !important;
}
body.lab-profile-editor-page .layoutLayerBtn.isLocked {
  opacity: .72 !important;
}
body.lab-profile-editor-page .layoutLayerLock {
  margin-left: auto !important;
  width: 24px !important;
  height: 24px !important;
  display: inline-grid !important;
  place-items: center !important;
  border: 1px solid var(--lab-line-soft) !important;
  background: var(--lab-bg) !important;
  color: var(--lab-sub) !important;
  font-size: 13px !important;
  line-height: 1 !important;
  flex: 0 0 auto !important;
  cursor: pointer !important;
}
body.lab-profile-editor-page .layoutLayerBtn.isLocked .layoutLayerLock {
  color: var(--lab-accent) !important;
  border-color: color-mix(in srgb, var(--lab-accent) 48%, var(--lab-line-soft)) !important;
}
body.lab-profile-editor-page .layoutLayerBtn.isLocked .layoutLayerText {
  color: var(--lab-sub) !important;
}

body.lab-profile-page .freeProfileStage.hasHybridSnapshot {
  background: transparent !important;
}
body.lab-profile-page .freeProfileSnapshot {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  z-index: 0 !important;
  pointer-events: none !important;
  user-select: none !important;
}
body.lab-profile-page .freeProfileStage.hasHybridSnapshot .freeProfileEl.isHybridHitLayer {
  opacity: 0 !important;
}
body.lab-profile-page .freeProfileStage.hasHybridSnapshot .freeProfileEl.isHybridHitLayer,
body.lab-profile-page .freeProfileStage.hasHybridSnapshot .freeProfileEl.isHybridHitLayer * {
  pointer-events: auto !important;
}
