/* =========================================================================
 * マイページ(MYPAGE-1)
 *
 * すべて #screen-mypage の中だけに効かせる。クラス名は .mp-* に揃え、
 * ルーム画面・家具編集・掲示板・管理画面・オートメーション画面へ漏らさない。
 * 色はここで決める(ルームの暗い配色の変数は使わない)。
 * 見た目はオートメーション画面と同じトーン(白基調・カード・角丸12px)。
 * ======================================================================= */
#screen-mypage {
  --mp-bg: #f5f7fb;
  --mp-surface: #ffffff;
  --mp-surface-2: #f8fafc;
  --mp-line: #e4e8ef;
  --mp-line-strong: #cbd5e1;
  --mp-text: #0f172a;
  --mp-text-2: #475569;
  --mp-muted: #64748b;
  --mp-primary: #4f46e5;
  --mp-primary-hover: #4338ca;
  --mp-primary-weak: #eef2ff;
  --mp-ok: #059669;
  --mp-warn: #b45309;
  --mp-warn-weak: #fffbeb;
  --mp-danger: #dc2626;
  --mp-radius: 12px;
  --mp-shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .1);
  color-scheme: light;
  background: var(--mp-bg);
  color: var(--mp-text);
  font-family: var(--font-body, system-ui, sans-serif);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

#screen-mypage .mp-root { display: flex; flex-direction: column; min-height: 100vh; }

/* ---------------------------------------------------------------- 上部 */
#screen-mypage .mp-header {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; padding: 12px 20px;
  background: rgba(255, 255, 255, .92); backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--mp-line);
}
#screen-mypage .mp-header-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
#screen-mypage .mp-header-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
#screen-mypage .mp-title { font-size: 17px; letter-spacing: .01em; }
#screen-mypage .mp-user { font-size: 13px; color: var(--mp-text-2); }
#screen-mypage .mp-plan-badge {
  font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 999px;
  background: var(--mp-primary-weak); color: var(--mp-primary); border: 1px solid #c7d2fe;
}

/* ---------------------------------------------------------------- 部品 */
#screen-mypage .mp-i {
  width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
#screen-mypage .mp-i-lg { width: 30px; height: 30px; }
#screen-mypage .mp-btn {
  appearance: none; font: inherit; font-size: 14px; font-weight: 600; line-height: 1.2;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 9px; padding: 8px 14px; cursor: pointer; white-space: nowrap;
  border: 1px solid var(--mp-line-strong); background: var(--mp-surface); color: var(--mp-text);
  min-height: 36px; transition: background .12s, border-color .12s;
}
#screen-mypage .mp-btn:hover:not(:disabled) { background: var(--mp-surface-2); border-color: var(--mp-muted); }
#screen-mypage .mp-btn:disabled { opacity: .5; cursor: not-allowed; }
#screen-mypage .mp-btn:focus-visible { outline: 2px solid var(--mp-primary); outline-offset: 2px; }
#screen-mypage .mp-btn-primary {
  background: var(--mp-primary); border-color: var(--mp-primary); color: #fff;
}
#screen-mypage .mp-btn-primary:hover:not(:disabled) {
  background: var(--mp-primary-hover); border-color: var(--mp-primary-hover);
}
#screen-mypage .mp-btn-ghost { background: transparent; border-color: transparent; color: var(--mp-text-2); }
#screen-mypage .mp-btn-ghost:hover:not(:disabled) { background: var(--mp-surface-2); border-color: var(--mp-line); }
#screen-mypage .mp-btn-sm { font-size: 13px; padding: 6px 11px; min-height: 32px; }
/* グレーの地と枠のボタン(AUTH-2.3)。白地のボタンより「押せる」と分かりやすい。
   「外部サービス連携へ」「Googleと連携」など、主ではない操作に使う。 */
#screen-mypage .mp-btn-soft {
  background: #eef1f5; border-color: #c4ccd8; color: #1e293b;
}
#screen-mypage .mp-btn-soft:hover:not(:disabled) { background: #e2e7ee; border-color: #aab4c3; }
#screen-mypage .mp-btn-soft:active:not(:disabled) { background: #d5dce6; border-color: #94a0b2; }
#screen-mypage .mp-btn-soft:focus-visible { outline: 2px solid var(--mp-primary); outline-offset: 2px; }
/* 取り消しにくい操作(連携の解除)。赤い文字と薄い赤の枠。 */
#screen-mypage .mp-btn-danger-ghost {
  background: #fff; border-color: #fecaca; color: var(--mp-danger);
}
#screen-mypage .mp-btn-danger-ghost:hover:not(:disabled) { background: #fef2f2; border-color: #fca5a5; }
#screen-mypage .mp-btn-danger-ghost:active:not(:disabled) { background: #fee2e2; }
#screen-mypage .mp-link {
  color: var(--mp-primary); font-weight: 600; text-decoration: none;
  display: inline-flex; align-items: center; gap: 4px;
}
#screen-mypage .mp-link:hover { text-decoration: underline; }
#screen-mypage .mp-link .mp-i { width: 14px; height: 14px; }

/* ---------------------------------------------------------------- 本体 */
#screen-mypage .mp-body {
  flex: 1; display: grid; grid-template-columns: 232px minmax(0, 1fr);
  gap: 20px; padding: 20px; align-items: start; max-width: 1180px; width: 100%;
  margin: 0 auto;
}
#screen-mypage .mp-side {
  display: flex; flex-direction: column; gap: 2px; position: sticky; top: 84px;
  background: var(--mp-surface); border: 1px solid var(--mp-line);
  border-radius: var(--mp-radius); padding: 8px; box-shadow: var(--mp-shadow);
}
#screen-mypage .mp-side-item {
  appearance: none; font: inherit; font-size: 14px; text-align: left; cursor: pointer;
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 0;
  border-radius: 9px; background: transparent; color: var(--mp-text-2);
}
#screen-mypage .mp-side-item:hover { background: var(--mp-surface-2); color: var(--mp-text); }
#screen-mypage .mp-side-item.is-active {
  background: var(--mp-primary-weak); color: var(--mp-primary); font-weight: 700;
}
#screen-mypage .mp-main { min-width: 0; }
#screen-mypage .mp-loading { padding: 40px; text-align: center; color: var(--mp-muted); }
#screen-mypage .mp-alert {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 14px; border-radius: 10px; font-size: 14px;
  background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c;
}

/* ---------------------------------------------------------------- カード */
#screen-mypage .mp-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px;
}
#screen-mypage .mp-grid-1 { grid-template-columns: minmax(0, 1fr); }
#screen-mypage .mp-card {
  background: var(--mp-surface); border: 1px solid var(--mp-line);
  border-radius: var(--mp-radius); padding: 18px; box-shadow: var(--mp-shadow);
  display: flex; flex-direction: column; gap: 12px; min-width: 0;
}
#screen-mypage .mp-card-title { font-size: 14px; font-weight: 700; color: var(--mp-text-2); }
#screen-mypage .mp-big { font-size: 22px; font-weight: 700; }
#screen-mypage .mp-note { font-size: 13px; color: var(--mp-muted); line-height: 1.8; }

#screen-mypage .mp-rows { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 16px; margin: 0; }
#screen-mypage .mp-rows dt { font-size: 12px; color: var(--mp-muted); }
#screen-mypage .mp-rows dd { font-size: 14px; margin: 0; overflow-wrap: anywhere; }

#screen-mypage .mp-profile { display: flex; gap: 14px; align-items: flex-start; min-width: 0; }
#screen-mypage .mp-avatar {
  display: grid; place-items: center; width: 64px; height: 64px; flex: none;
  border-radius: 14px; background: var(--mp-primary-weak); color: var(--mp-primary);
  overflow: hidden;
}
#screen-mypage .mp-avatar-canvas { width: 64px; height: 64px; image-rendering: pixelated; }
#screen-mypage .mp-profile-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
#screen-mypage .mp-profile-name { font-size: 18px; font-weight: 700; overflow-wrap: anywhere; }
#screen-mypage .mp-profile-sub { font-size: 13px; color: var(--mp-muted); overflow-wrap: anywhere; }
#screen-mypage .mp-profile-bio { font-size: 13px; color: var(--mp-text-2); line-height: 1.7; overflow-wrap: anywhere; }

#screen-mypage .mp-chips { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
#screen-mypage .mp-chip {
  font-size: 12px; padding: 5px 9px; border-radius: 999px; background: var(--mp-surface-2);
  border: 1px solid var(--mp-line); color: var(--mp-text-2); white-space: nowrap;
}
#screen-mypage .mp-chip.is-on { color: var(--mp-ok); background: #ecfdf5; border-color: #a7f3d0; }

#screen-mypage .mp-soon {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px;
  border-radius: 10px; background: var(--mp-warn-weak); border: 1px solid #fde68a;
  color: var(--mp-warn);
}
#screen-mypage .mp-soon .mp-i { margin-top: 2px; }
#screen-mypage .mp-soon-text { font-size: 13px; font-weight: 600; line-height: 1.7; }
#screen-mypage .mp-soon-sub { font-size: 12px; line-height: 1.7; opacity: .9; margin-top: 2px; }

#screen-mypage .mp-todo { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
#screen-mypage .mp-todo li { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--mp-text-2); }
#screen-mypage .mp-todo .mp-i { width: 14px; height: 14px; color: var(--mp-muted); }

/* ---------------------------------------------------------------- 入力フォーム(MYPAGE-2) */
#screen-mypage .mp-form {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px;
}
#screen-mypage .mp-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
/* 一言コメントだけは横いっぱいに使う(複数行のため) */
#screen-mypage .mp-field-wide { grid-column: 1 / -1; }
#screen-mypage .mp-label {
  font-size: 12px; font-weight: 600; color: var(--mp-text-2);
  display: flex; align-items: center; gap: 6px;
}
#screen-mypage .mp-req {
  font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 4px;
  background: var(--mp-primary-weak); color: var(--mp-primary);
}
#screen-mypage .mp-input {
  appearance: none; font: inherit; font-size: 14px; width: 100%; box-sizing: border-box;
  padding: 9px 11px; min-height: 38px; border-radius: 9px; color: var(--mp-text);
  border: 1px solid var(--mp-line-strong); background: var(--mp-surface);
}
#screen-mypage select.mp-input { cursor: pointer; }
#screen-mypage .mp-input:focus { outline: 2px solid var(--mp-primary); outline-offset: -1px; border-color: var(--mp-primary); }
#screen-mypage .mp-input:disabled { background: var(--mp-surface-2); color: var(--mp-muted); cursor: not-allowed; }
#screen-mypage .mp-textarea { min-height: 76px; line-height: 1.7; resize: vertical; }
#screen-mypage .mp-field.is-error .mp-input { border-color: var(--mp-danger); }
#screen-mypage .mp-field-error { font-size: 12px; color: var(--mp-danger); line-height: 1.6; }
#screen-mypage .mp-field-help { font-size: 11px; color: var(--mp-muted); }
#screen-mypage .mp-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
#screen-mypage .mp-dirty { font-size: 12px; color: var(--mp-warn); font-weight: 600; }
#screen-mypage .is-hidden { display: none; }
#screen-mypage .mp-ok {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px;
  background: #ecfdf5; border: 1px solid #a7f3d0; color: var(--mp-ok);
  font-size: 13px; font-weight: 600;
}
#screen-mypage .mp-ok .mp-i { width: 16px; height: 16px; }
#screen-mypage .mp-pw {
  display: flex; flex-direction: column; gap: 12px;
  border-top: 1px solid var(--mp-line); padding-top: 14px;
}
#screen-mypage .mp-sub-title { font-size: 13px; font-weight: 700; color: var(--mp-text-2); }
/* ログインに使っている方法(AUTH-1)。パスワードの枠と同じ見た目で、
   「ログイン情報」カードの中で区切りが分かるようにする。 */
#screen-mypage .mp-login-methods {
  display: flex; flex-direction: column; gap: 10px;
  border-top: 1px solid var(--mp-line); padding-top: 14px;
}

/* ---------------------------------------------------------------- プラン */
#screen-mypage .mp-current { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
#screen-mypage .mp-badge {
  font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px;
  border: 1px solid transparent; white-space: nowrap;
}
#screen-mypage .mp-badge-current { background: var(--mp-primary); color: #fff; }
#screen-mypage .mp-badge-reco { background: var(--mp-warn-weak); color: var(--mp-warn); border-color: #fde68a; }
#screen-mypage .mp-badge-admin { background: #ecfdf5; color: var(--mp-ok); border-color: #a7f3d0; }

#screen-mypage .mp-plans {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px;
}
#screen-mypage .mp-plan {
  border: 1px solid var(--mp-line); border-radius: 11px; padding: 14px;
  display: flex; flex-direction: column; gap: 8px; background: var(--mp-surface);
  min-width: 0;
}
#screen-mypage .mp-plan.is-current { border-color: var(--mp-primary); background: var(--mp-primary-weak); }
#screen-mypage .mp-plan.is-recommended { border-color: #fcd34d; }
#screen-mypage .mp-plan-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
}
#screen-mypage .mp-plan-name { font-size: 16px; font-weight: 700; }
#screen-mypage .mp-plan-price { font-size: 20px; font-weight: 700; display: flex; align-items: baseline; gap: 6px; }
#screen-mypage .mp-plan-price-unit { font-size: 11px; font-weight: 600; color: var(--mp-muted); }
#screen-mypage .mp-plan-lead { font-size: 12px; color: var(--mp-muted); }
#screen-mypage .mp-plan-audience { font-size: 12px; font-weight: 600; color: var(--mp-text-2); }
#screen-mypage .mp-plan-desc { font-size: 12px; color: var(--mp-muted); line-height: 1.7; }
#screen-mypage .mp-plan-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
#screen-mypage .mp-plan-list li { display: flex; align-items: flex-start; gap: 6px; font-size: 12px; color: var(--mp-text-2); line-height: 1.6; overflow-wrap: anywhere; }
#screen-mypage .mp-plan-list .mp-i { width: 14px; height: 14px; color: var(--mp-ok); margin-top: 2px; flex: none; }
#screen-mypage .mp-plan-current { font-size: 12px; font-weight: 700; color: var(--mp-primary); }

/* 比較表。**横に伸びるのはこの枠の中だけ**(ページ全体を横スクロールさせない) */
#screen-mypage .mp-compare-wrap {
  overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%;
  border: 1px solid var(--mp-line); border-radius: 10px;
}
#screen-mypage .mp-compare-wrap:focus-visible { outline: 2px solid var(--mp-primary); outline-offset: 2px; }
#screen-mypage .mp-compare { border-collapse: collapse; width: 100%; min-width: 560px; font-size: 12px; }
#screen-mypage .mp-compare th,
#screen-mypage .mp-compare td {
  border-bottom: 1px solid var(--mp-line); padding: 9px 12px; text-align: left;
  vertical-align: top; line-height: 1.6;
}
#screen-mypage .mp-compare thead th {
  background: var(--mp-surface-2); font-weight: 700; white-space: nowrap;
  position: sticky; top: 0;
}
#screen-mypage .mp-compare tbody th { font-weight: 600; color: var(--mp-text-2); white-space: nowrap; }
#screen-mypage .mp-compare tbody tr:last-child th,
#screen-mypage .mp-compare tbody tr:last-child td { border-bottom: 0; }
#screen-mypage .mp-compare .is-current { background: var(--mp-primary-weak); }
#screen-mypage .mp-compare thead th.is-current { color: var(--mp-primary); }
#screen-mypage .mp-th-now { display: block; font-size: 10px; font-weight: 700; color: var(--mp-primary); }

/* ---------------------------------------------------------------- 絞り込みの丸ボタン・チェックボックス・履歴の行 */
#screen-mypage .mp-filters { display: flex; gap: 6px; flex-wrap: wrap; }
#screen-mypage .mp-filter {
  appearance: none; font: inherit; font-size: 12px; cursor: pointer; white-space: nowrap;
  border: 1px solid var(--mp-line-strong); border-radius: 999px; padding: 6px 12px;
  background: var(--mp-surface); color: var(--mp-text-2); min-height: 32px;
}
#screen-mypage .mp-filter:hover:not(:disabled) { background: var(--mp-surface-2); }
#screen-mypage .mp-filter.is-active {
  background: var(--mp-primary); border-color: var(--mp-primary); color: #fff; font-weight: 700;
}
#screen-mypage .mp-filter:disabled { opacity: .5; cursor: not-allowed; }
#screen-mypage .mp-toggle {
  display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--mp-text-2);
  cursor: pointer;
}
#screen-mypage .mp-check { width: 16px; height: 16px; accent-color: var(--mp-primary); cursor: pointer; }
#screen-mypage .mp-badge-done { background: #ecfdf5; color: var(--mp-ok); border-color: #a7f3d0; }
#screen-mypage .mp-logs { display: flex; flex-direction: column; gap: 8px; }
#screen-mypage .mp-log {
  border: 1px solid var(--mp-line); border-radius: 9px; padding: 10px 12px;
  display: flex; flex-direction: column; gap: 4px; min-width: 0;
}
#screen-mypage .mp-log-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; }
#screen-mypage .mp-log-target { font-size: 13px; overflow-wrap: anywhere; }

/* ---------------------------------------------------------------- 外部サービス */
#screen-mypage .mp-services { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
#screen-mypage .mp-service {
  border: 1px solid var(--mp-line); border-radius: 11px; padding: 14px;
  display: flex; flex-direction: column; gap: 8px; align-items: flex-start;
}
#screen-mypage .mp-service-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; width: 100%; justify-content: space-between; }
#screen-mypage .mp-service-name { font-size: 15px; font-weight: 700; }
#screen-mypage .mp-service-desc { font-size: 12px; color: var(--mp-muted); line-height: 1.7; }
/* 外部サービス連携(MYPAGE-5) */
#screen-mypage .mp-service.is-connected { border-color: var(--mp-ok); background: #f6fffb; }
#screen-mypage .mp-service .mp-rows { font-size: 12px; }
#screen-mypage .mp-service .mp-actions { margin-top: auto; }
#screen-mypage .mp-chip.is-warn { background: var(--mp-warn-weak); color: var(--mp-warn); border-color: #fde68a; }

/* -------------------------------------------- お支払いのボタン(BILLING-1.1) */
/* 「お支払い情報の管理へ」と「最新の状態に更新」。**並べても見分けがつく**ように、
   主要ボタンと副ボタンで色を分ける。狭い画面では縦に積む。 */
#screen-mypage .mp-actions-wrap { flex-wrap: wrap; gap: 8px; }
#screen-mypage .mp-btn-secondary {
  background: var(--mp-primary-weak); color: var(--mp-primary);
  border-color: #c7d2fe; font-weight: 600;
}
#screen-mypage .mp-btn-secondary:hover:not(:disabled) {
  background: #e0e7ff; border-color: var(--mp-primary);
}
#screen-mypage .mp-btn-secondary .mp-i { color: inherit; }
@media (max-width: 480px) {
  /* 390px では縦積み。ボタンが潰れて読めなくならないようにする。 */
  #screen-mypage .mp-actions-wrap { flex-direction: column; align-items: stretch; }
  #screen-mypage .mp-actions-wrap .mp-btn { width: 100%; justify-content: center; }
}

/* ---------------------------------------------------- 通知設定(NOTIFY-1) */
#screen-mypage .mp-muted { font-size: 12px; color: var(--mp-muted); }
#screen-mypage .mp-notify { display: flex; flex-direction: column; gap: 2px; }
#screen-mypage .mp-notify-cat {
  margin: 14px 0 4px; font-size: 13px; font-weight: 700; color: var(--mp-text-2);
}
#screen-mypage .mp-notify-cat:first-child { margin-top: 0; }
#screen-mypage .mp-notify-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--mp-line); min-width: 0;
}
#screen-mypage .mp-notify-row:last-child { border-bottom: 0; }
#screen-mypage .mp-notify-row.is-busy { opacity: .6; }
/* 項目ごとの LINE / メールのスイッチ(NOTIFY-3)。狭い画面では縦に積む。 */
#screen-mypage .mp-notify-switches { display: flex; gap: 14px; align-items: center; flex-shrink: 0; }
#screen-mypage .mp-notify-switch { display: inline-flex; align-items: center; gap: 6px; }
@media (max-width: 480px) {
  #screen-mypage .mp-notify-switches { flex-direction: column; align-items: flex-end; gap: 6px; }
}
#screen-mypage .mp-notify-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
#screen-mypage .mp-notify-name { font-size: 14px; font-weight: 600; }
#screen-mypage .mp-notify-desc { font-size: 12px; color: var(--mp-muted); line-height: 1.6; }
#screen-mypage .mp-notify-flag { font-size: 11px; color: var(--mp-warn); }
/* どのチャネルで届くか(NOTIFY-2)。**小さな印だけ**で、操作はしない。 */
#screen-mypage .mp-notify-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
#screen-mypage .mp-mini {
  font-size: 10px; line-height: 1.6; padding: 0 6px; border-radius: 999px;
  border: 1px solid var(--mp-line); color: var(--mp-muted); white-space: nowrap;
}
#screen-mypage .mp-mini.is-on { background: #ecfdf5; color: var(--mp-ok); border-color: #a7f3d0; }
#screen-mypage .mp-mini.is-soon { background: var(--mp-surface-2); }
/* 通知履歴の絞り込み */
#screen-mypage .mp-filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }

/* ON/OFF スイッチ。中身は checkbox(キーボードでも操作できる)。 */
#screen-mypage .mp-switch { position: relative; flex: 0 0 auto; display: inline-flex; cursor: pointer; }
#screen-mypage .mp-switch.is-disabled { cursor: not-allowed; opacity: .45; }
#screen-mypage .mp-switch-input {
  position: absolute; inset: 0; margin: 0; opacity: 0; width: 100%; height: 100%;
  cursor: inherit;
}
#screen-mypage .mp-switch-track {
  display: block; width: 44px; height: 24px; border-radius: 999px;
  background: var(--mp-line-strong); transition: background .15s;
}
#screen-mypage .mp-switch-knob {
  display: block; width: 18px; height: 18px; margin: 3px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(15, 23, 42, .3); transition: transform .15s;
}
#screen-mypage .mp-switch-input:checked + .mp-switch-track { background: var(--mp-primary); }
#screen-mypage .mp-switch-input:checked + .mp-switch-track .mp-switch-knob {
  transform: translateX(20px);
}
#screen-mypage .mp-switch-input:focus-visible + .mp-switch-track {
  outline: 2px solid var(--mp-primary); outline-offset: 2px;
}

/* ------------------------------------------------- お知らせ(MYPAGE-5.1) */
/* Notion 連携が終わったことを伝えるモーダル。白ベース + 背景オーバーレイ。
   マイページの中だけに効かせる(ルーム側の .modal には触れない)。 */
#screen-mypage .mp-modal-overlay {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, .55);
  overflow-y: auto;
}
#screen-mypage .mp-modal {
  position: relative;
  width: min(420px, 100%);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  background: var(--mp-surface);
  border: 1px solid var(--mp-line);
  border-radius: var(--mp-radius);
  box-shadow: 0 10px 30px rgba(15, 23, 42, .25);
  padding: 20px 20px 18px;
  text-align: center;
}
#screen-mypage .mp-modal-x {
  position: absolute; top: 6px; right: 8px;
  width: 32px; height: 32px; line-height: 1;
  border: 0; border-radius: 8px; background: transparent;
  color: var(--mp-muted); font-size: 20px; cursor: pointer;
}
#screen-mypage .mp-modal-x:hover { background: var(--mp-surface-2); color: var(--mp-text); }
#screen-mypage .mp-modal-art {
  display: block; width: 100%; height: auto; max-width: 320px; margin: 4px auto 14px;
  border-radius: 10px; background: var(--mp-surface-2);
}
#screen-mypage .mp-modal-title { margin: 0 0 8px; font-size: 18px; font-weight: 700; }
#screen-mypage .mp-modal-text {
  margin: 0 0 16px; font-size: 13px; line-height: 1.8; color: var(--mp-text-2);
}
#screen-mypage .mp-modal-actions { display: flex; justify-content: center; }

/* ---------------------------------------------------------------- 狭い画面 */
@media (max-width: 899px) {
  #screen-mypage .mp-body { grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 14px 12px 28px; }
  /* サイドバーは上部の横スクロールするタブにする(画面ごと横に伸びない) */
  #screen-mypage .mp-side {
    position: static; flex-direction: row; overflow-x: auto; gap: 4px; padding: 6px;
  }
  #screen-mypage .mp-side-item { white-space: nowrap; padding: 9px 12px; }
  #screen-mypage .mp-grid { grid-template-columns: minmax(0, 1fr); }
  #screen-mypage .mp-header { padding: 10px 12px; }
  #screen-mypage .mp-title { font-size: 15px; }
}
@media (max-width: 480px) {
  #screen-mypage .mp-rows { grid-template-columns: minmax(0, 1fr); gap: 2px 0; }
  #screen-mypage .mp-rows dd { margin-bottom: 8px; }
  #screen-mypage .mp-card { padding: 14px; }
  /* 390px でも横に溢れない(絵は幅いっぱいまでで止める) */
  #screen-mypage .mp-modal { padding: 18px 14px 14px; }
  #screen-mypage .mp-modal-art { max-width: 240px; }
  #screen-mypage .mp-modal-title { font-size: 16px; }
}

/* ---------------------------------------------------------------- ログイン方法(AUTH-2.3) */
#screen-mypage .mp-methods { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
#screen-mypage .mp-method {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 10px 12px; border: 1px solid var(--mp-line); border-radius: 10px; background: var(--mp-surface);
}
#screen-mypage .mp-method-main { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
#screen-mypage .mp-method-name { font-weight: 700; font-size: 14px; }
#screen-mypage .mp-method-detail { flex-basis: 100%; font-size: 12px; color: var(--mp-text-2); overflow-wrap: anywhere; }
#screen-mypage .mp-method-note { flex-basis: 100%; font-size: 12px; color: var(--mp-muted); }
#screen-mypage .mp-method-actions { display: flex; gap: 6px; flex-wrap: wrap; }
#screen-mypage .mp-reauth { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
#screen-mypage .mp-pw-state { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
#screen-mypage .mp-pw-setup { margin-top: 10px; }

/* ---------------------------------------------------------------- 通知音(AUTH-2.3) */
#screen-mypage .mp-services-1 { grid-template-columns: minmax(0, 1fr); }
#screen-mypage .mp-sound-state { font-size: 12px; color: var(--mp-text-2); margin: 0; }
@media (max-width: 480px) {
  #screen-mypage .mp-method { align-items: flex-start; }
  #screen-mypage .mp-method-actions { width: 100%; }
  #screen-mypage .mp-method-actions .mp-btn { flex: 1 1 auto; }
}

/* ---------------------------------------------------------------- 公開プロフィール(PROFILE-PAGE-1) */
#screen-mypage .mp-pp-urlrow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
#screen-mypage .mp-pp-urlrow .mp-input { flex: 1 1 200px; min-width: 0; }
#screen-mypage .mp-pp-url { font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
/* 「URLを追加」の行(PROFILE-LINKS-1): 表示名・URL・並べ替え・削除・＋。狭い画面では2段に折り返す */
#screen-mypage .mp-pp-links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
#screen-mypage .mp-pp-link-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
#screen-mypage .mp-pp-link-label { flex: 0 1 180px; min-width: 120px; }
#screen-mypage .mp-pp-link-url { flex: 1 1 240px; min-width: 0; }
#screen-mypage .mp-pp-link-ops { display: inline-flex; gap: 4px; flex: 0 0 auto; min-width: 156px; }   /* ＋の有無で URL の欄の幅をそろえる */
#screen-mypage .mp-pp-link-ops .mp-btn { min-width: 36px; padding-left: 8px; padding-right: 8px; }
@media (max-width: 560px) {
  #screen-mypage .mp-pp-link-row { padding-bottom: 8px; border-bottom: 1px solid var(--mp-line); }
  #screen-mypage .mp-pp-link-label, #screen-mypage .mp-pp-link-url { flex: 1 1 100%; }
}
#screen-mypage a.mp-btn { text-decoration: none; display: inline-flex; align-items: center; }
#screen-mypage .mp-btn.is-disabled { opacity: .45; pointer-events: none; cursor: not-allowed; }
#screen-mypage .mp-pp-skills { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
#screen-mypage .mp-pp-skill {
  display: inline-flex; align-items: center; gap: 4px; max-width: 100%;
  padding: 2px 4px 2px 10px; border: 1px solid var(--mp-line); border-radius: 99px;
  background: var(--mp-bg); font-size: 13px; overflow-wrap: anywhere;
}
#screen-mypage .mp-pp-skill-x {
  min-width: 28px; min-height: 28px; border: 0; border-radius: 50%;
  background: transparent; color: var(--mp-muted); font-size: 16px; cursor: pointer;
}
#screen-mypage .mp-pp-skill-x:hover:not(:disabled) { background: var(--mp-line); color: var(--mp-text); }
#screen-mypage .mp-pp-works { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
#screen-mypage .mp-pp-work {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 10px; border: 1px solid var(--mp-line); border-radius: 10px; background: var(--mp-surface);
}
/* 公開ページと同じ 16:9 の枠に、欠けないように収めて見せる */
#screen-mypage .mp-pp-thumb {
  width: 160px; height: 90px; flex: 0 0 auto; object-fit: contain;
  border-radius: 8px; background: var(--mp-bg); border: 1px solid var(--mp-line);
}
#screen-mypage .mp-pp-work-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
#screen-mypage .mp-pp-work-body .mp-input { width: 100%; max-width: none; }
#screen-mypage .mp-pp-work-actions { display: flex; gap: 6px; flex-wrap: wrap; }
#screen-mypage .mp-pp-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
#screen-mypage .mp-pp-rooms { display: flex; flex-direction: column; gap: 6px; }
#screen-mypage .mp-pp-intro { min-height: 140px; resize: vertical; }
#screen-mypage .mp-pp-counter-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
#screen-mypage .mp-pp-count { flex: none; font-size: 12px; color: var(--mp-muted); font-variant-numeric: tabular-nums; }
#screen-mypage .mp-pp-count.is-max { color: var(--mp-danger); font-weight: 700; }
#screen-mypage .mp-pp-spec {
  display: flex; flex-direction: column; gap: 2px; margin: 8px 0 0; padding: 10px 12px;
  background: var(--mp-primary-weak); border: 1px solid #c7d2fe; border-radius: 10px;
  font-size: 12px; color: var(--mp-text-2);
}
#screen-mypage .mp-pp-spec strong { color: var(--mp-primary); font-size: 13px; }
#screen-mypage .mp-pp-save { flex-wrap: wrap; }
#screen-mypage .mp-pp-save .mp-alert, #screen-mypage .mp-pp-save .mp-ok { flex-basis: 100%; }
@media (max-width: 480px) {
  #screen-mypage .mp-pp-work { flex-direction: column; align-items: stretch; }
  #screen-mypage .mp-pp-thumb { width: 100%; height: auto; aspect-ratio: 16 / 9; }
}

/* ---------------------------------------------------------------- チャット履歴(CHAT-HISTORY-1) */
#screen-mypage .mp-chh-filters {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px 12px;
  margin: 4px 0 14px; align-items: start;
}
#screen-mypage .mp-chh-buttons { grid-column: 1 / -1; margin: 0; }
#screen-mypage .mp-chh-scroll { overflow-x: auto; border: 1px solid var(--mp-line); border-radius: 10px; }
#screen-mypage .mp-chh-table { width: 100%; border-collapse: collapse; font-size: 13px; }
#screen-mypage .mp-chh-table th {
  text-align: left; font-weight: 600; color: var(--mp-text-2); background: var(--mp-surface-2);
  padding: 8px 10px; border-bottom: 1px solid var(--mp-line); white-space: nowrap;
}
#screen-mypage .mp-chh-table td { padding: 8px 10px; border-bottom: 1px solid var(--mp-line); vertical-align: top; }
#screen-mypage .mp-chh-table tr:last-child td { border-bottom: 0; }
#screen-mypage .mp-chh-time { white-space: nowrap; color: var(--mp-text-2); font-variant-numeric: tabular-nums; }
#screen-mypage .mp-chh-room, #screen-mypage .mp-chh-who { white-space: nowrap; max-width: 14em; overflow: hidden; text-overflow: ellipsis; }
#screen-mypage .mp-chh-text { white-space: pre-wrap; word-break: break-word; min-width: 12em; }
/* 入退室のお知らせ(PRESENCE-LOG-1)。白地で読める濃さの黄緑(入室)と薄めの赤(退出) */
#screen-mypage .mp-chh-system.is-enter .mp-chh-text { color: #3f8a12; font-weight: 600; }
#screen-mypage .mp-chh-system.is-leave .mp-chh-text { color: #d0473f; font-weight: 600; }
#screen-mypage .mp-chh-tag {
  display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 99px; font-size: 11px;
  background: var(--mp-primary-weak); color: var(--mp-primary);
}
/* スマホ: 1件を縦に並べたカードにする(横に溢れない) */
@media (max-width: 600px) {
  #screen-mypage .mp-chh-filters { grid-template-columns: minmax(0, 1fr); }
  #screen-mypage .mp-chh-scroll { border: 0; overflow: visible; }
  #screen-mypage .mp-chh-table thead { display: none; }
  #screen-mypage .mp-chh-table, #screen-mypage .mp-chh-table tbody,
  #screen-mypage .mp-chh-table tr, #screen-mypage .mp-chh-table td { display: block; width: 100%; }
  #screen-mypage .mp-chh-table tr {
    border: 1px solid var(--mp-line); border-radius: 10px; padding: 8px 10px; margin-bottom: 8px;
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px;
  }
  #screen-mypage .mp-chh-table td { padding: 0; border: 0; max-width: none; }
  #screen-mypage .mp-chh-time { grid-column: 1 / -1; font-size: 12px; }
  #screen-mypage .mp-chh-who { grid-column: 1; grid-row: 2; font-weight: 600; }
  #screen-mypage .mp-chh-room { grid-column: 2; grid-row: 2; text-align: right; font-size: 12px; color: var(--mp-text-2); }
  #screen-mypage .mp-chh-text { grid-column: 1 / -1; min-width: 0; margin-top: 2px; }
}

/* 解約予定の案内(BILLING-3) */
.mp-cancel-notice { margin: 12px 0; align-items: flex-start; }
.mp-cancel-notice .mp-actions { margin-top: 10px; }
.mp-payment-note { margin: 0; padding: 0 2px; }

/* ---- プランカードと比較表(LP /pricing と同じ見た目。色と作りは cyberoffice-pop-lp の pages.css / launch.css。
   マイページの本文は LP より狭いので、文字の大きさだけ1段小さくしている) ---- */
.mp-lp-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 18px 0 15px; }
.mp-lp-card { position: relative; min-height: 310px; background: #fff; border: 1px solid #dce9fa; border-radius: 12px; padding: 12px;
              display: flex; flex-direction: column; gap: 10px; text-align: center; color: #091544; min-width: 0; }
.mp-lp-card.is-recommended { border: 3px solid #ffbf00; }
.mp-lp-tag { position: absolute; right: 10px; top: -14px; background: #ffce18; padding: 4px 14px; border-radius: 8px; font-weight: 900; font-size: 13px; }
.mp-lp-now { position: absolute; left: 10px; top: -14px; background: #2178f3; color: #fff; padding: 4px 10px; border-radius: 8px; font-weight: 800; font-size: 12px; }
.mp-lp-avatar-wrap { height: 92px; overflow: hidden; display: grid; place-items: center; }
.mp-lp-avatar { display: inline-block; width: 92px; height: 92px; background-size: 184px 368px; background-position: 0 0; background-repeat: no-repeat;
                image-rendering: pixelated; transform: scale(1.08); transform-origin: center; }
.mp-lp-box { flex: 1 1 auto; background: #f6f9fd; border-radius: 8px; min-height: 130px; padding: 10px 6px; }
.mp-lp-starter .mp-lp-box { background: #f1ffe2; }
.mp-lp-business .mp-lp-box { background: #eaf4ff; }
.mp-lp-pro .mp-lp-box { background: #f5f0ff; }
#screen-mypage .mp-lp-name { font-size: 17px; font-weight: 900; margin: 0 0 5px; color: #091544; white-space: nowrap; }
.mp-lp-price { font-size: 13px; margin: 0; font-weight: 700; white-space: nowrap; }
.mp-lp-price strong { font-size: 24px; font-weight: 900; }
.mp-lp-tax { font-size: 10px; font-weight: 700; white-space: nowrap; }
.mp-lp-tagline { display: block; font-size: 12px; font-weight: 700; color: #647398; margin-top: 4px; }
#screen-mypage .mp-btn.mp-lp-cta { min-height: 44px; width: 100%; font-size: 13px; font-weight: 900; border-radius: 6px; line-height: 1.3; padding: 6px 8px;
                                   box-shadow: 0 6px 13px #53668b25; white-space: normal; }
#screen-mypage .mp-btn.mp-lp-cta.is-primary { background: #ffce12; border: 2px solid #ffb600; color: #091544; }
#screen-mypage .mp-btn.mp-lp-cta.is-secondary { background: #fff; border: 2px solid #ffb600; color: #091544; }
#screen-mypage .mp-btn.mp-lp-cta.is-off { background: #eef1f6; border: 2px solid #dce3ee; color: #647398; box-shadow: none; }
.mp-lp-matrix-wrap { overflow-x: auto; max-width: 100%; border: 1px solid #dce9fa; border-radius: 8px; background: #fff; }
.mp-lp-matrix { border-collapse: collapse; width: 100%; min-width: 700px; font-size: 13px; line-height: 1.25; color: #091544; }
.mp-lp-matrix th, .mp-lp-matrix td { border: 1px solid #dce9fa; padding: 7px 9px; }
.mp-lp-matrix thead th { background: #e8f4ff; text-align: center; font-weight: 900; }
.mp-lp-matrix thead th:nth-child(3), .mp-lp-matrix tbody td:nth-child(3) { background: #f1ffe2; }
.mp-lp-matrix thead th:nth-child(4), .mp-lp-matrix tbody td:nth-child(4) { background: #eaf4ff; }
.mp-lp-matrix thead th:nth-child(5), .mp-lp-matrix tbody td:nth-child(5) { background: #faf6ff; }
.mp-lp-matrix tbody th { text-align: left; width: 32%; font-weight: 700; }
.mp-lp-matrix tbody th svg { width: 22px; height: 22px; color: #2178f3; display: inline-block; vertical-align: middle; margin-right: 10px; }
.mp-lp-matrix td { text-align: center; width: 17%; font-weight: 700; }
.mp-lp-matrix td.check { font-size: 21px; color: #0781ef; font-weight: 900; }
.mp-th-now { display: block; font-size: 10px; color: #2178f3; }
@media (max-width: 800px) {
  .mp-lp-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 7px; margin-top: 14px; }
  .mp-lp-card { min-height: 240px; padding: 6px; gap: 6px; }
  .mp-lp-avatar-wrap { height: 62px; }
  .mp-lp-avatar { transform: scale(.75); }
  .mp-lp-box { min-height: 112px; padding: 6px; }
  #screen-mypage .mp-lp-name { font-size: 14px; }
  .mp-lp-price { font-size: 12px; }
  .mp-lp-price strong { font-size: 20px; }
  .mp-lp-tax { font-size: 9px; }
  .mp-lp-tagline { font-size: 10px; }
  #screen-mypage .mp-btn.mp-lp-cta { font-size: 10px; min-height: 34px; }
  .mp-lp-tag { font-size: 10px; top: -10px; padding: 3px 8px; }
  .mp-lp-now { font-size: 10px; top: -10px; padding: 3px 6px; }
  .mp-lp-matrix { font-size: 11px; }
}

/* ---- 友だちを紹介する ---- */
.mp-ref-url { display: flex; gap: 8px; align-items: center; }
#screen-mypage .mp-ref-url .mp-input { flex: 1 1 auto; min-width: 0; width: auto; }
.mp-ref-copy { flex: none; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 1px solid #dce3ee; border-radius: 8px; background: #fff; cursor: pointer; color: var(--mp-primary, #4f46e5); }
.mp-ref-copy.is-copied { background: #e8f8ef; color: #1a7f4b; }
.mp-ref-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.mp-ref-stat { display: flex; flex-direction: column; gap: 4px; padding: 12px; background: #f6f9fd; border-radius: 8px; }
.mp-ref-stat-k { font-size: 12px; color: #647398; }
.mp-ref-stat strong { font-size: 20px; color: #091544; }
.mp-ref-table-wrap { overflow-x: auto; }
.mp-ref-table { width: 100%; min-width: 760px; border-collapse: collapse; font-size: 13px; }
.mp-ref-table th, .mp-ref-table td { padding: 8px; border-bottom: 1px solid #e6ecf5; text-align: left; white-space: nowrap; }
.mp-ref-table th { font-size: 12px; color: #647398; }
.mp-ref-rules { margin: 0; padding-left: 20px; font-size: 13px; line-height: 1.8; }
