/*
 * One Style 会員サイト レイアウト改修モック（試作）
 * 色・書体・角丸・余白は本番 onestyle-events/src/styles/tokens.css をそのまま写している。
 * 文字とボタンは本番より一段大きくしている（運営の依頼「見やすく」）。
 */

:root {
  --ivory: #ffffff;
  --white: #ffffff;
  --paper: #ffffff;
  --beige: #d8cdbe;
  --greige: #b9a894;
  --stone: #a9a9a5;
  --taupe: #6b5b4e;
  --charcoal: #3f4340;
  --body: #3d3a35;
  --muted: #6b5b4e;
  --rule: #e8e6e1;
  --rule-strong: #d8cdbe;
  --placeholder-fill: #e8e6e1;
  --nav-surface: #f4f4f1;
  --surface-sub: #e8e6e1;
  --accent: #8fa495;
  --accent-soft: #e3eae4;
  --error: #c0392b;
  --unread-line: #b03a2e;
  --unread-bg: #f0f5f1;
  --to-me-unread: #3d6b4f;
  --mention: #9a887e;
  --mention-soft: #f1ece7;

  --font-mincho: 'Yu Mincho', '游明朝体', YuMincho, 'Shippori Mincho', 'Hiragino Mincho ProN', serif;
  --font-gothic: 'Yu Gothic Medium', '游ゴシック Medium', YuGothic, 'Hiragino Sans', 'Noto Sans JP', sans-serif;
  --font-label: Inter, Helvetica, sans-serif;

  --radius: 2px;
  --radius-pill: 999px;
  --pad-mobile: 20px;
  --duration: 200ms;
  --easing: ease-out;
  --tap-min: 44px;
  --tap-min-pc: 48px;

  /* モックだけの値：マイページの大きなボタンのやわらかい地（One Style のトーンの中で） */
  --tile-beige: #f3ede4;
  --tile-green: #e9efea;
  --tile-pink: #f5ebe6;
  --tile-blue: #e8edf1;

  --band-h: 30px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
}

body {
  background: var(--ivory);
  color: var(--body);
  font-family: var(--font-gothic);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  line-break: strict;
  overflow-wrap: anywhere;
}

h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }

button, input, textarea {
  font: inherit;
  color: inherit;
}

button { cursor: pointer; }

a { color: inherit; }

.diamond {
  display: inline-block;
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  transform: rotate(45deg);
  border: 1px solid var(--greige);
}

.diamond.is-current { background: var(--charcoal); border-color: var(--charcoal); }
.diamond.is-done { background: var(--accent); border-color: var(--accent); }

/* ---------- モックの帯 ---------- */

.mock-band {
  position: relative;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 14px;
  height: var(--band-h);
  padding: 0 16px;
  background: #f6efe4;
  border-bottom: 1px solid var(--rule-strong);
  color: #8a5a1f;
  font-size: 12.5px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.mock-band strong { font-weight: 700; }

.mock-band-links {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
}

.mock-band a { color: #8a5a1f; text-underline-offset: 3px; }

.mock-band .seg {
  display: inline-flex;
  border: 1px solid #c9ad86;
  border-radius: var(--radius);
  overflow: hidden;
}

.mock-band .seg button {
  height: 22px;
  padding: 0 12px;
  background: transparent;
  border: none;
  color: #8a5a1f;
  font-size: 12px;
}

.mock-band .seg button.is-on { background: #8a5a1f; color: var(--white); }

/* ---------- 共通の枠（パソコン） ---------- */

.shell {
  display: flex;
  height: calc(100dvh - var(--band-h));
  overflow: hidden;
}

.side {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  width: 296px;
  padding: 18px 0 10px;
  background: var(--nav-surface);
  border-right: 1px solid var(--rule);
  min-height: 0;
}

.side-logo-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px 0 24px;
  margin-bottom: 14px;
}

.side-logo { display: block; width: 128px; height: auto; }

.bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--tap-min);
  height: var(--tap-min);
  background: transparent;
  border: none;
  color: var(--charcoal);
}

.bell-dot {
  position: absolute;
  top: 8px;
  right: 9px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--charcoal);
  border: 1.5px solid var(--nav-surface);
}

.side-nav {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  gap: 4px;
  padding: 0 14px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  background: transparent;
  border: none;
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 16px;
  letter-spacing: 0.08em;
  text-align: left;
  text-decoration: none;
  transition: background var(--duration) var(--easing), color var(--duration) var(--easing);
}

.nav-link:hover { color: var(--charcoal); background: rgba(63, 67, 64, 0.04); }

.nav-link.is-active {
  background: var(--surface-sub);
  color: var(--charcoal);
}

.nav-link .nav-badge { margin-left: auto; }

.nav-chev {
  margin-left: 6px;
  transition: transform var(--duration) var(--easing);
}

.nav-group.is-open .nav-chev { transform: rotate(180deg); }

.nav-group {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.nav-group.is-open { flex: 1; }

.nav-group .room-panel { display: none; }
.nav-group.is-open .room-panel { display: flex; }

.nav-admin {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--rule);
}

.staff-only {
  margin-left: auto;
  padding: 0 6px;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  color: var(--taupe);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.side-account {
  padding: 8px 26px 0;
  color: var(--muted);
  font-size: 12.5px;
  letter-spacing: 0.08em;
  line-height: 1.8;
}

/* ---------- チャットの一覧（左メニューの中／スマホの一覧） ---------- */

.room-panel {
  flex-direction: column;
  flex: 1;
  min-height: 0;
  margin: 6px -14px 4px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}

.room-tools {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--rule);
}

.room-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--taupe);
}

.room-search input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-size: 14px;
}

.room-search input::placeholder { color: var(--stone); }

.room-new {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.btn-line {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 12px;
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  color: var(--charcoal);
  font-size: 13.5px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.btn-line:hover { background: var(--nav-surface); }

.btn-fill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 22px;
  background: var(--charcoal);
  border: 1px solid var(--charcoal);
  border-radius: var(--radius);
  color: var(--white);
  font-size: 15px;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

.btn-fill:hover { opacity: 0.88; }

.room-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.room-sec {
  margin: 0;
  padding: 12px 16px 6px;
  color: var(--taupe);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.room-sec.is-to-me { color: var(--to-me-unread); font-weight: 700; }

.room {
  position: relative;
  display: flex;
  gap: 10px;
  width: 100%;
  padding: 11px 14px 11px 16px;
  background: transparent;
  border: none;
  border-top: 1px solid var(--rule);
  text-align: left;
  transition: background var(--duration) var(--easing);
}

.room:hover { background: var(--nav-surface); }

.room.is-selected {
  background: var(--surface-sub);
  outline: 1px solid var(--charcoal);
  outline-offset: -1px;
}

.room.is-unread::before,
.room.is-to-me::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 3px;
  background: var(--charcoal);
}

.room.is-to-me:not(.is-selected) { background: var(--unread-bg); }
.room.is-to-me::before { width: 4px; background: var(--to-me-unread); }

.room-ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--surface-sub);
  color: var(--charcoal);
  font-family: var(--font-label);
  font-size: 11.5px;
}

.room-ic.is-ai { background: var(--charcoal); color: var(--white); }
.room-ic.is-dm { background: var(--mention-soft); color: var(--taupe); }

.room-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.room-top {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.room-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--charcoal);
  font-size: 15px;
  letter-spacing: 0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room.is-unread .room-name,
.room.is-to-me .room-name { font-weight: 700; }

.room-pin { color: var(--taupe); flex-shrink: 0; align-self: center; }

.room-time {
  flex-shrink: 0;
  color: var(--muted);
  font-family: var(--font-label);
  font-size: 11.5px;
}

.room-bottom {
  display: flex;
  align-items: center;
  gap: 8px;
}

.room-last {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room.is-unread .room-last,
.room.is-to-me .room-last { color: var(--body); }

.room-sub {
  color: var(--taupe);
  font-size: 11.5px;
}

.count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--radius-pill);
  background: var(--charcoal);
  color: var(--white);
  font-family: var(--font-label);
  font-size: 12px;
  line-height: 1;
}

.count.is-to-me { background: var(--to-me-unread); font-weight: 700; }

.count-label {
  color: var(--to-me-unread);
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

/* ---------- 会話（真ん中） ---------- */

.main {
  position: relative;
  display: flex;
  flex: 1;
  min-width: 0;
  min-height: 0;
}

.conv {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  min-height: 0;
}

.conv-head {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 72px;
  padding: 12px 32px;
  border-bottom: 1px solid var(--rule);
}

.conv-title { flex: 1; min-width: 0; }

.conv-name {
  margin: 0;
  overflow: hidden;
  color: var(--charcoal);
  font-family: var(--font-mincho);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conv-meta {
  color: var(--taupe);
  font-size: 13px;
  letter-spacing: 0.04em;
}

.conv-ov-btn.is-on { background: var(--surface-sub); border-color: var(--charcoal); }

.conv-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 32px 24px;
}

.conv-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 0 0 18px;
  padding: 12px 14px;
  background: var(--nav-surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  color: var(--taupe);
  font-size: 13.5px;
  line-height: 1.7;
}

.conv-date,
.conv-unread {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 18px 0 10px;
}

.conv-date::before, .conv-date::after,
.conv-unread::before, .conv-unread::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--rule);
}

.conv-date span {
  color: var(--muted);
  font-family: var(--font-label);
  font-size: 12px;
  letter-spacing: 0.16em;
}

.conv-unread::before, .conv-unread::after { height: 2px; background: var(--unread-line); }

.conv-unread span {
  color: var(--unread-line);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

/* Chatwork と同じく上から下へ時系列。左にアイコン、右に「名前・時刻」と本文 */
.msg {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 14px;
  padding: 12px 14px;
  border-radius: var(--radius);
}

.msg + .msg { border-top: 1px solid #f1f0ec; }

.msg.is-unread { background: var(--unread-bg); border-top-color: #e2ebe4; }

.av {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface-sub);
  color: var(--charcoal);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0;
}

.av.c-b { background: var(--accent-soft); }
.av.c-c { background: var(--mention-soft); color: var(--taupe); }
.av.c-d { background: var(--tile-blue); }
.av.c-staff { background: var(--charcoal); color: var(--white); }
.av.c-ai { background: var(--charcoal); color: var(--white); font-family: var(--font-label); }

.msg-meta {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 10px;
}

.msg-name {
  color: var(--charcoal);
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.msg-role {
  color: var(--taupe);
  font-size: 12px;
}

.msg-you {
  padding: 0 6px;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  color: var(--taupe);
  font-size: 11px;
  line-height: 1.6;
}

.msg-time {
  color: var(--muted);
  font-family: var(--font-label);
  font-size: 12px;
}

.msg-to {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 6px 0 2px;
  padding: 1px 9px;
  border-radius: var(--radius);
  background: var(--to-me-unread);
  color: var(--white);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.msg-to.is-other {
  background: var(--surface-sub);
  color: var(--charcoal);
  font-weight: 500;
}

.msg-text {
  margin: 4px 0 0;
  color: var(--body);
  font-size: 15.5px;
  line-height: 1.85;
  white-space: pre-wrap;
}

.msg-file {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 8px 12px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--charcoal);
  font-size: 13.5px;
}

/* 入力欄 */
.composer {
  flex-shrink: 0;
  padding: 12px 32px 16px;
  border-top: 1px solid var(--rule);
  background: var(--paper);
}

.composer-box {
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  background: var(--paper);
}

.composer-box:focus-within { border-color: var(--charcoal); }

.composer textarea {
  display: block;
  width: 100%;
  min-height: 64px;
  max-height: 160px;
  padding: 12px 14px 6px;
  border: none;
  outline: none;
  resize: none;
  background: transparent;
  font-size: 15.5px;
  line-height: 1.7;
}

.composer textarea::placeholder { color: var(--stone); }

.composer-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px 6px;
}

.tool {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 10px;
  background: transparent;
  border: none;
  border-radius: var(--radius);
  color: var(--taupe);
  font-size: 13px;
  white-space: nowrap;
}

.tool:hover { background: var(--nav-surface); color: var(--charcoal); }

.composer-send { margin-left: auto; min-height: 40px; padding: 0 20px; }

.composer-hint {
  margin: 6px 2px 0;
  color: var(--muted);
  font-size: 12px;
}

.composer-closed {
  flex-shrink: 0;
  padding: 16px 32px 18px;
  border-top: 1px solid var(--rule);
  background: var(--nav-surface);
  color: var(--taupe);
  font-size: 14px;
  text-align: center;
}

/* 概要とタスク（右から開く。既定は閉） */
.ov {
  display: none;
  flex-direction: column;
  flex-shrink: 0;
  width: 340px;
  min-height: 0;
  border-left: 1px solid var(--rule);
  background: var(--paper);
}

.main.is-ov-open .ov { display: flex; animation: ov-in var(--duration) var(--easing); }

@keyframes ov-in {
  from { transform: translateX(24px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

@media (max-width: 1199px) {
  .ov {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 5;
  }
}

.ov-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 0 12px 0 24px;
  border-bottom: 1px solid var(--rule);
}

.ov-head h2 {
  margin: 0;
  color: var(--charcoal);
  font-family: var(--font-mincho);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--tap-min);
  height: var(--tap-min);
  background: transparent;
  border: none;
  border-radius: var(--radius);
  color: var(--charcoal);
}

.icon-btn:hover { background: var(--nav-surface); }

.ov-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 24px 28px;
}

.ov-label {
  margin: 18px 0 8px;
  color: var(--muted);
  font-family: var(--font-label);
  font-size: 11.5px;
  letter-spacing: 0.2em;
}

.ov-label:first-child { margin-top: 0; }

.ov-text {
  margin: 0;
  color: var(--body);
  font-size: 14.5px;
  line-height: 1.9;
}

.ov-task {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--rule);
  font-size: 14.5px;
  line-height: 1.7;
}

.ov-task .diamond { margin-top: 8px; }
.ov-task.is-done .ov-task-text { color: var(--muted); opacity: 0.7; }
.ov-task-due { display: block; color: var(--taupe); font-size: 12.5px; }

/* トースト */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 100;
  max-width: calc(100% - 32px);
  padding: 10px 18px;
  border-radius: var(--radius);
  background: var(--charcoal);
  color: var(--white);
  font-size: 13.5px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity var(--duration) var(--easing), transform var(--duration) var(--easing);
}

.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 目次 ---------- */

.toc {
  max-width: 880px;
  margin: 0 auto;
  padding: 56px 24px 80px;
}

.toc-label {
  color: var(--muted);
  font-family: var(--font-label);
  font-size: 12px;
  letter-spacing: 0.2em;
}

.toc h1 {
  margin: 10px 0 12px;
  color: var(--charcoal);
  font-family: var(--font-mincho);
  font-size: 32px;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.5;
}

.toc-lead { margin: 0 0 32px; color: var(--taupe); font-size: 15px; }

.toc-list { display: flex; flex-direction: column; gap: 14px; }

.toc-item {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 22px 24px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  text-decoration: none;
  transition: background var(--duration) var(--easing);
}

.toc-item:hover { background: var(--nav-surface); }

.toc-no {
  color: var(--muted);
  font-family: var(--font-label);
  font-size: 13px;
  letter-spacing: 0.1em;
}

.toc-item h2 {
  margin: 0 0 4px;
  color: var(--charcoal);
  font-family: var(--font-mincho);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.toc-item p { margin: 0; color: var(--taupe); font-size: 14px; line-height: 1.8; }
.toc-arrow { margin-left: auto; color: var(--charcoal); flex-shrink: 0; }

.toc-foot {
  margin-top: 36px;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
  color: var(--taupe);
  font-size: 13px;
  line-height: 1.9;
}

/* ---------- スマホの比較ページ ---------- */

.compare {
  min-height: calc(100dvh - var(--band-h));
  padding: 28px 24px 48px;
  background: var(--nav-surface);
}

.compare-head {
  max-width: 1000px;
  margin: 0 auto 22px;
  text-align: center;
}

.compare-head h1 {
  margin: 0 0 6px;
  color: var(--charcoal);
  font-family: var(--font-mincho);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.compare-head p { margin: 0; color: var(--taupe); font-size: 14px; }

.compare-cols {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 48px;
}

.compare-col { width: 410px; }

.compare-col h2 {
  margin: 0 0 12px;
  color: var(--charcoal);
  font-family: var(--font-mincho);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-align: center;
}

.compare-col h2 small {
  display: block;
  color: var(--taupe);
  font-family: var(--font-gothic);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.02em;
}

.phone {
  width: 410px;
  padding: 10px;
  border-radius: 46px;
  background: #2b2d2b;
}

.phone iframe {
  display: block;
  width: 390px;
  height: 760px;
  border: none;
  border-radius: 36px;
  background: var(--white);
}

.pros {
  margin-top: 16px;
  padding: 16px 18px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--paper);
  font-size: 14px;
  line-height: 1.8;
}

.pros dt {
  color: var(--charcoal);
  font-weight: 700;
  font-size: 13.5px;
}

.pros dt.is-plus::before { content: '○ '; color: var(--to-me-unread); }
.pros dt.is-minus::before { content: '△ '; color: var(--taupe); }
.pros dd { margin: 2px 0 10px; color: var(--body); }
.pros dd:last-child { margin-bottom: 0; }

/* ---------- スマホのアプリ（iframe の中身） ---------- */

.sp-app {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
  background: var(--ivory);
}

.sp-status {
  flex-shrink: 0;
  height: 34px;
}

.sp-head {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  min-height: 58px;
  padding: 4px 8px 4px 12px;
  border-bottom: 1px solid var(--rule);
  background: var(--ivory);
}

.sp-head .side-logo { width: 112px; margin-left: 6px; }
.sp-head .bell { margin-left: auto; }

.sp-head .conv-title { padding: 0 4px; }
.sp-head .conv-name { font-size: 17.5px; }
.sp-head .conv-meta { font-size: 12px; line-height: 1.4; }

.sp-ov-btn {
  min-height: 36px;
  padding: 0 10px;
  font-size: 12.5px;
}

.sp-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.sp-title {
  margin: 0;
  padding: 18px var(--pad-mobile) 10px;
  color: var(--charcoal);
  font-family: var(--font-mincho);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.sp-app .room-tools { padding: 4px var(--pad-mobile) 12px; border-bottom: none; }
.sp-app .room-search { height: 44px; }
.sp-app .btn-line { min-height: 42px; font-size: 14px; }
.sp-app .room { padding: 13px var(--pad-mobile); gap: 12px; }
.sp-app .room-name { font-size: 16px; }
.sp-app .room-last { font-size: 13.5px; }
.sp-app .room-ic { width: 40px; height: 40px; font-size: 12px; }
.sp-app .room-sec { padding: 14px var(--pad-mobile) 6px; font-size: 13px; }

.sp-app .conv-scroll { padding: 12px 12px 16px; }
.sp-app .msg { grid-template-columns: 36px minmax(0, 1fr); gap: 10px; padding: 11px 10px; }
.sp-app .av { width: 36px; height: 36px; font-size: 11.5px; }
.sp-app .msg-text { font-size: 15.5px; }

.sp-app .composer { padding: 8px 10px 12px; }
.sp-app .composer textarea { min-height: 44px; padding: 10px 12px 4px; font-size: 16px; }
.sp-app .composer-bar { gap: 0; padding: 2px 4px 4px; }
.sp-app .tool { min-height: var(--tap-min); min-width: var(--tap-min); justify-content: center; padding: 0 8px; }
.sp-app .tool span { display: none; }
.sp-app .composer-send { min-height: 40px; padding: 0 18px; font-size: 14.5px; }
.sp-app .composer-closed { padding: 14px 16px 18px; font-size: 13.5px; }

.sp-nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  flex-shrink: 0;
  height: 76px;
  padding: 0 8px 12px;
  border-top: 1px solid var(--rule);
  background: var(--nav-surface);
}

.sp-tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 12.5px;
  letter-spacing: 0.08em;
}

.sp-tab.is-active { color: var(--charcoal); font-weight: 700; }

.sp-tab .count {
  position: absolute;
  top: 6px;
  left: calc(50% + 10px);
}

.sp-placeholder {
  padding: 24px var(--pad-mobile);
  color: var(--taupe);
  font-size: 14.5px;
  line-height: 1.9;
}

.sp-card {
  display: block;
  margin: 0 0 12px;
  padding: 16px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  color: var(--charcoal);
  text-decoration: none;
}

.sp-card small { display: block; color: var(--taupe); font-size: 12.5px; }

/* 概要とタスク（スマホは右から全面に） */
.sp-app .ov {
  position: absolute;
  inset: 0;
  z-index: 20;
  width: auto;
  border-left: none;
}

.sp-app.is-ov-open .ov { display: flex; animation: ov-in var(--duration) var(--easing); }
.sp-app .ov-head { min-height: 58px; margin-top: 34px; }

/* 案B：左からのメニュー */
.drawer-scrim {
  position: absolute;
  inset: 0;
  z-index: 30;
  background: rgba(43, 45, 43, 0.38);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration) var(--easing);
}

.drawer {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 31;
  display: flex;
  flex-direction: column;
  width: 86%;
  padding: 34px 0 0;
  background: var(--nav-surface);
  border-right: 1px solid var(--rule);
  transform: translateX(-102%);
  transition: transform 240ms var(--easing);
}

.sp-app.is-drawer-open .drawer { transform: none; }
.sp-app.is-drawer-open .drawer-scrim { opacity: 1; pointer-events: auto; }

.drawer .side-logo-row { padding: 8px 8px 0 20px; margin-bottom: 14px; }
.drawer .side-nav { padding: 0 10px; }
.drawer .nav-link { min-height: 50px; font-size: 16.5px; }
.drawer .room-panel { margin: 6px -10px 4px; }
.drawer .room { padding: 12px 16px; }
.drawer .room-name { font-size: 15.5px; }
.drawer .room-tools { padding: 12px 16px 10px; }

/* ---------- マイページ ---------- */

.mp {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
}

.mp-inner {
  max-width: 1120px;
  padding: 40px 48px 56px;
}

.mp-head {
  display: flex;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 28px;
}

.mp-hello { flex: 1; min-width: 0; }

.mp-label {
  color: var(--muted);
  font-family: var(--font-label);
  font-size: 12.5px;
  letter-spacing: 0.24em;
}

.mp-hello h1 {
  margin: 8px 0 0;
  color: var(--charcoal);
  font-family: var(--font-mincho);
  font-size: 32px;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.5;
}

/* ワンスタイル365日：小さく、邪魔にならない位置に */
.d365 {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  max-width: 320px;
  padding: 10px 14px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  color: var(--charcoal);
  text-decoration: none;
  font-size: 13px;
  line-height: 1.6;
}

.d365:hover { background: var(--nav-surface); }

.d365-day {
  flex-shrink: 0;
  color: var(--taupe);
  font-family: var(--font-label);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-align: center;
  line-height: 1.3;
}

.d365-day b { display: block; color: var(--charcoal); font-size: 18px; letter-spacing: 0; }
.d365-text small { display: block; color: var(--taupe); font-size: 11.5px; letter-spacing: 0.06em; }

.acts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 36px;
}

.act {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 168px;
  padding: 22px 20px 18px;
  border-radius: 16px;
  color: var(--charcoal);
  text-decoration: none;
  transition: transform var(--duration) var(--easing), filter var(--duration) var(--easing);
}

.act:hover { filter: brightness(0.975); }
.act:active { transform: scale(0.985); }

.act.t-beige { background: var(--tile-beige); }
.act.t-green { background: var(--tile-green); }
.act.t-pink { background: var(--tile-pink); }
.act.t-blue { background: var(--tile-blue); }

.act-ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.72);
  color: var(--charcoal);
}

.act-title {
  margin-top: 4px;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.4;
}

.act-desc {
  color: var(--taupe);
  font-size: 13.5px;
  line-height: 1.6;
}

.act .count {
  position: absolute;
  top: 18px;
  right: 18px;
  min-width: 26px;
  height: 26px;
  font-size: 13.5px;
}

.act-arrow {
  position: absolute;
  right: 18px;
  bottom: 18px;
  color: var(--taupe);
}

.mp-cols {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.mp-col { display: flex; flex-direction: column; gap: 28px; }

.box {
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--paper);
}

.box-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--rule);
}

.box-head h2 {
  margin: 0;
  color: var(--charcoal);
  font-family: var(--font-mincho);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.box-head a, .box-more {
  color: var(--charcoal);
  font-size: 13.5px;
  text-underline-offset: 3px;
  white-space: nowrap;
}

.box-note {
  margin: 0;
  padding: 10px 20px 14px;
  color: var(--taupe);
  font-size: 12.5px;
  line-height: 1.7;
}

.row {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 56px;
  padding: 12px 20px;
  border-top: 1px solid var(--rule);
  color: var(--body);
  text-decoration: none;
  transition: background var(--duration) var(--easing);
}

.row:first-of-type { border-top: none; }
.row:hover { background: var(--nav-surface); }

.row-main { flex: 1; min-width: 0; }

.row-title {
  display: block;
  color: var(--charcoal);
  font-size: 15px;
  line-height: 1.6;
}

.row-sub { display: block; color: var(--taupe); font-size: 12.5px; }

.row.is-new .row-title { font-weight: 700; }

.new-dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--charcoal);
}

.new-dot.is-read { background: transparent; border: 1px solid var(--rule-strong); }

.date-chip {
  flex-shrink: 0;
  width: 52px;
  padding: 4px 0;
  border: 1px solid var(--rule);
  border-radius: 4px;
  text-align: center;
  line-height: 1.25;
}

.date-chip small { display: block; color: var(--taupe); font-family: var(--font-label); font-size: 11px; letter-spacing: 0.06em; }
.date-chip b { display: block; color: var(--charcoal); font-family: var(--font-label); font-size: 18px; font-weight: 500; }
.date-chip i { display: block; color: var(--taupe); font-size: 11px; font-style: normal; }

.tag {
  flex-shrink: 0;
  padding: 1px 8px;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  color: var(--taupe);
  font-size: 11.5px;
  white-space: nowrap;
}

.tag.is-dark { background: var(--charcoal); border-color: var(--charcoal); color: var(--white); }

.todo-ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

.chev { flex-shrink: 0; color: var(--taupe); }

.row.is-danger .row-title { color: var(--taupe); }

/* マイページ：スマホ表示の切り替え */
.mp-stage {
  display: none;
  justify-content: center;
  gap: 40px;
  min-height: calc(100dvh - var(--band-h));
  padding: 28px 24px 40px;
  background: var(--nav-surface);
}

.is-sp-view .shell { display: none; }
.is-sp-view .mp-stage { display: flex; }

.mp-stage-note {
  width: 280px;
  padding-top: 40px;
  color: var(--taupe);
  font-size: 14px;
  line-height: 1.9;
}

.mp-stage-note h2 {
  margin: 0 0 10px;
  color: var(--charcoal);
  font-family: var(--font-mincho);
  font-size: 20px;
  font-weight: 600;
}

.mp-stage-note ol { margin: 0; padding-left: 1.4em; }

/* スマホのマイページ（iframe の中身） */
.sp-app .mp-inner { padding: 20px var(--pad-mobile) 32px; }
.sp-app .mp-head { display: block; margin-bottom: 18px; }
.sp-app .mp-hello h1 { font-size: 24px; }
.sp-app .acts { grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 26px; }
.sp-app .act { min-height: 150px; padding: 16px 14px 14px; gap: 6px; border-radius: 14px; }
.sp-app .act-ic { width: 46px; height: 46px; }
.sp-app .act-title { font-size: 18px; letter-spacing: 0.04em; }
.sp-app .act-desc { font-size: 12.5px; }
.sp-app .act .count { top: 14px; right: 14px; }
.sp-app .act-arrow { display: none; }
.sp-app .mp-col { gap: 20px; }
.sp-app .box-head { padding: 14px 16px 10px; }
.sp-app .row { padding: 12px 16px; min-height: 58px; }
.sp-app .row-title { font-size: 15.5px; }
.sp-app .box-note { padding: 10px 16px 14px; }
.sp-app .d365 { max-width: none; margin-top: 20px; }

/* iframe の中（スマホ枠）では帯と比較ページの外側を出さない */
.is-frame .mock-band,
.is-frame .compare { display: none; }

/* 仕上げの調整（スクショ確認後） */
.side:has(.nav-group.is-open) .side-account { display: none; }
.side .room-tools { gap: 6px; padding: 10px 14px 8px; }
.side .room-search { height: 38px; }
.side .btn-line { min-height: 34px; font-size: 13px; }
.side .nav-link { min-height: 44px; }
.act-desc { padding-right: 24px; word-break: keep-all; overflow-wrap: anywhere; }
.mp-stage { align-items: flex-start; }
@media (max-height: 820px) {
  .composer textarea { min-height: 48px; }
  .conv-head { min-height: 64px; padding-top: 8px; padding-bottom: 8px; }
}

/* ---------- パターン切り替え（上の帯） ---------- */
.pat-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.pat-switch a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 22px;
  padding: 0 6px;
  border: 1px solid #c9ad86;
  border-radius: var(--radius);
  font-family: var(--font-label);
  font-size: 12px;
  text-decoration: none;
}

.pat-switch a.is-on { background: #8a5a1f; border-color: #8a5a1f; color: var(--white); }
.pat-name { color: #8a5a1f; }

@media (max-width: 1100px) {
  .mock-band .band-note { display: none; }
}

/* =========================================================
 * パターン2「仕事向け・すっきり（Chatwork寄り）」
 * 辻さんが毎日たくさん返信する前提。密度高め・ゴシック中心・未読の強調を強く。
 * ========================================================= */
[data-pattern="2"] body { font-size: 14px; }
[data-pattern="2"] .side { width: 320px; padding-top: 14px; }
[data-pattern="2"] .side-logo-row { margin-bottom: 8px; }
[data-pattern="2"] .side-logo { width: 112px; }
[data-pattern="2"] .side .nav-link { min-height: 40px; font-size: 15px; letter-spacing: 0.04em; }
[data-pattern="2"] .side-account { display: none; }

/* 一覧：1行に「名前・最終発言・時刻・件数」 */
[data-pattern="2"] .room { align-items: center; gap: 8px; padding: 8px 12px 8px 14px; min-height: 44px; }
[data-pattern="2"] .room-ic { width: 24px; height: 24px; margin: 0; font-size: 9.5px; }
[data-pattern="2"] .room-ic svg { width: 14px; height: 14px; }
[data-pattern="2"] .room-main { flex-direction: row; align-items: center; gap: 8px; }
[data-pattern="2"] .room-top,
[data-pattern="2"] .room-bottom { display: contents; }
[data-pattern="2"] .room-name { flex: 0 1 auto; max-width: 48%; font-size: 14px; order: 1; }
[data-pattern="2"] .room-pin { order: 2; }
[data-pattern="2"] .room-last { flex: 1 1 0; order: 3; font-size: 12px; }
[data-pattern="2"] .room-sub { flex: 1 1 0; order: 3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
[data-pattern="2"] .room-time { order: 4; font-size: 11px; }
[data-pattern="2"] .room .count { order: 5; min-width: 22px; height: 20px; }
[data-pattern="2"] .room-sec { padding: 8px 14px 4px; font-size: 12px; }
[data-pattern="2"] .room-sec.is-to-me {
  margin-top: 4px;
  background: var(--to-me-unread);
  color: var(--white);
}
[data-pattern="2"] .room.is-to-me:not(.is-selected) { background: #e1ede4; }
[data-pattern="2"] .room.is-to-me::before { width: 5px; }
[data-pattern="2"] .room.is-to-me .room-name { color: var(--to-me-unread); }
[data-pattern="2"] .side .room-tools { flex-direction: row; flex-wrap: wrap; }
[data-pattern="2"] .side .room-search { flex: 1 1 100%; height: 34px; }
[data-pattern="2"] .side .room-new { flex: 1 1 100%; }
[data-pattern="2"] .side .btn-line { min-height: 32px; }

/* 会話：ゴシック・詰めた行 */
[data-pattern="2"] .conv-head { min-height: 56px; padding: 8px 24px; }
[data-pattern="2"] .conv-name { font-family: var(--font-gothic); font-size: 17px; font-weight: 700; letter-spacing: 0.02em; }
[data-pattern="2"] .conv-meta { font-size: 12px; }
[data-pattern="2"] .conv-scroll { padding: 10px 24px 16px; }
[data-pattern="2"] .msg { grid-template-columns: 32px minmax(0, 1fr); gap: 10px; padding: 8px 10px; border-radius: 0; }
[data-pattern="2"] .av { width: 32px; height: 32px; font-size: 11px; }
[data-pattern="2"] .msg-name { font-size: 13.5px; }
[data-pattern="2"] .msg-text { margin-top: 2px; font-size: 14.5px; line-height: 1.7; }
[data-pattern="2"] .msg-to { margin: 3px 0 0; }
[data-pattern="2"] .msg.is-unread { box-shadow: inset 3px 0 0 var(--to-me-unread); }
[data-pattern="2"] .msg.is-unread:has(.msg-to:not(.is-other)) { background: #e1ede4; }
[data-pattern="2"] .conv-date, [data-pattern="2"] .conv-unread { margin: 10px 0 6px; }
[data-pattern="2"] .conv-unread span { font-size: 12.5px; }
[data-pattern="2"] .composer { padding: 8px 24px 12px; }
[data-pattern="2"] .composer textarea { min-height: 52px; font-size: 14.5px; }
[data-pattern="2"] .composer-hint { display: none; }
[data-pattern="2"] .ov { width: 300px; }
[data-pattern="2"] .ov-head { min-height: 56px; }
[data-pattern="2"] .ov-head h2,
[data-pattern="2"] .box-head h2,
[data-pattern="2"] .mp-hello h1,
[data-pattern="2"] .sp-title { font-family: var(--font-gothic); font-weight: 700; letter-spacing: 0.03em; }

/* マイページ：横長のコンパクトなボタン */
[data-pattern="2"] .mp-inner { padding: 28px 36px 40px; }
[data-pattern="2"] .mp-hello h1 { font-size: 24px; }
[data-pattern="2"] .mp-head { margin-bottom: 20px; }
[data-pattern="2"] .acts { gap: 12px; margin-bottom: 24px; }
[data-pattern="2"] .act {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 12px;
  row-gap: 0;
  align-items: center;
  min-height: 84px;
  padding: 14px 16px;
  border-radius: 6px;
}
[data-pattern="2"] .act-ic { grid-row: 1 / 3; width: 44px; height: 44px; }
[data-pattern="2"] .act-title { margin: 0; font-size: 16px; }
[data-pattern="2"] .act-desc { font-size: 12.5px; }
[data-pattern="2"] .act .count { top: 10px; right: 10px; min-width: 22px; height: 22px; font-size: 12px; }
[data-pattern="2"] .act-arrow { display: none; }
[data-pattern="2"] .mp-cols { gap: 20px; }
[data-pattern="2"] .mp-col { gap: 20px; }
[data-pattern="2"] .box { border-radius: 2px; }
[data-pattern="2"] .box-head { padding: 10px 16px 8px; }
[data-pattern="2"] .box-head h2 { font-size: 16px; }
[data-pattern="2"] .row { min-height: 46px; padding: 8px 16px; gap: 12px; }
[data-pattern="2"] .row-title { font-size: 14px; }
[data-pattern="2"] .todo-ic { width: 30px; height: 30px; }
[data-pattern="2"] .todo-ic svg { width: 18px; height: 18px; }
[data-pattern="2"] .date-chip { width: 46px; padding: 2px 0; }
[data-pattern="2"] .date-chip b { font-size: 15px; }
[data-pattern="2"] .box-note { padding: 8px 16px 10px; }

/* スマホ（パターン2）：タップ領域は44px以上を保ったまま詰める */
[data-pattern="2"] .sp-app .room { padding: 10px var(--pad-mobile); min-height: 52px; gap: 10px; }
[data-pattern="2"] .sp-app .room-ic { width: 28px; height: 28px; }
[data-pattern="2"] .sp-app .room-name { font-size: 15px; max-width: 52%; }
[data-pattern="2"] .sp-app .room-last { font-size: 12.5px; }
[data-pattern="2"] .sp-app .room-sec { padding: 8px var(--pad-mobile) 4px; }
[data-pattern="2"] .sp-app .msg { grid-template-columns: 30px minmax(0, 1fr); padding: 8px 8px; }
[data-pattern="2"] .sp-app .av { width: 30px; height: 30px; font-size: 10.5px; }
[data-pattern="2"] .sp-app .msg-text { font-size: 15px; }
[data-pattern="2"] .sp-app .acts { gap: 10px; }
[data-pattern="2"] .sp-app .act { grid-template-columns: 1fr; min-height: 108px; padding: 12px; align-items: start; }
[data-pattern="2"] .sp-app .act-ic { grid-row: auto; width: 38px; height: 38px; }
[data-pattern="2"] .sp-app .act-title { font-size: 16px; margin-top: 6px; }
[data-pattern="2"] .sp-title { font-size: 19px; padding-top: 14px; }
[data-pattern="2"] .drawer .room { padding: 9px 14px; }

/* =========================================================
 * パターン3「やわらかい・カード（ラフ寄り）」
 * 運営のラフに寄せる。淡い色の角丸カード・大きめのボタン・スマホ優先の触りやすさ。
 * ========================================================= */
[data-pattern="3"] .side { width: 304px; }
[data-pattern="3"] .side .nav-link,
[data-pattern="3"] .drawer .nav-link { border-radius: 12px; min-height: 50px; }
[data-pattern="3"] .nav-link.is-active { background: var(--tile-beige); }
[data-pattern="3"] .room-panel { margin: 8px 0 4px; border: none; background: transparent; }
[data-pattern="3"] .room-tools { border-bottom: none; padding: 4px 0 10px; }
[data-pattern="3"] .drawer .room-tools { padding: 8px 4px 10px; }
[data-pattern="3"] .room-search { border-radius: 999px; background: var(--white); padding: 0 16px; }
[data-pattern="3"] .btn-line { border-radius: 999px; }
[data-pattern="3"] .btn-fill { border-radius: 999px; min-height: 48px; padding: 0 26px; }
[data-pattern="3"] .room-list { padding: 0 0 8px; }
[data-pattern="3"] .room {
  margin: 0 0 8px;
  border: 1px solid var(--rule);
  border-radius: 16px;
  background: var(--white);
  overflow: hidden;
}
[data-pattern="3"] .room:hover { background: #fbfaf8; }
[data-pattern="3"] .room.is-selected { outline: 2px solid var(--charcoal); outline-offset: -2px; background: var(--white); }
[data-pattern="3"] .room.is-to-me:not(.is-selected) { background: var(--unread-bg); border-color: #c9dccf; }
[data-pattern="3"] .room.is-unread::before { display: none; }
[data-pattern="3"] .room.is-unread { border-color: var(--rule-strong); }
[data-pattern="3"] .room.is-to-me::before { width: 5px; }
[data-pattern="3"] .room-ic { width: 40px; height: 40px; background: var(--tile-beige); }
[data-pattern="3"] .room-ic.is-dm { background: var(--tile-pink); }
[data-pattern="3"] .room-ic.is-ai { background: var(--charcoal); }
[data-pattern="3"] .room-sec { padding: 8px 6px 6px; }
[data-pattern="3"] .count { min-width: 22px; height: 22px; font-size: 12.5px; }

[data-pattern="3"] .main { background: var(--nav-surface); }
[data-pattern="3"] .conv-head { background: var(--white); }
[data-pattern="3"] .conv-scroll { padding: 20px 32px 24px; }
[data-pattern="3"] .msg {
  margin-bottom: 10px;
  padding: 14px 16px;
  border: 1px solid var(--rule);
  border-radius: 16px;
  background: var(--white);
}
[data-pattern="3"] .msg + .msg { border-top: 1px solid var(--rule); }
[data-pattern="3"] .msg.is-unread { background: var(--unread-bg); border-color: #c9dccf; }
[data-pattern="3"] .msg-to { border-radius: 999px; padding: 1px 12px; }
[data-pattern="3"] .msg-file { border-radius: 10px; }
[data-pattern="3"] .conv-note { border-radius: 14px; background: var(--white); }
[data-pattern="3"] .composer { background: var(--white); }
[data-pattern="3"] .composer-box { border-radius: 20px; }
[data-pattern="3"] .composer textarea { padding: 14px 18px 6px; }
[data-pattern="3"] .tool { border-radius: 999px; }
[data-pattern="3"] .conv-ov-btn, [data-pattern="3"] .sp-ov-btn { border-radius: 999px; }
[data-pattern="3"] .ov { background: var(--white); }
[data-pattern="3"] .ov-task { border-top: none; margin-bottom: 8px; padding: 12px 14px; border-radius: 12px; background: var(--nav-surface); }

[data-pattern="3"] .mp { background: var(--nav-surface); }
[data-pattern="3"] .act { min-height: 190px; border-radius: 24px; padding: 24px 22px 20px; }
[data-pattern="3"] .act-ic { width: 60px; height: 60px; }
[data-pattern="3"] .act-ic svg { width: 30px; height: 30px; }
[data-pattern="3"] .act-title { font-size: 21px; }
[data-pattern="3"] .act-desc { font-size: 14px; }
[data-pattern="3"] .box { border: none; border-radius: 20px; overflow: hidden; }
[data-pattern="3"] .box-head { border-bottom: none; padding: 20px 22px 8px; }
[data-pattern="3"] .row { border-top: none; margin: 0 10px 6px; padding: 12px 12px; border-radius: 14px; min-height: 60px; }
[data-pattern="3"] .row:hover { background: var(--nav-surface); }
[data-pattern="3"] .box > .row:last-of-type { margin-bottom: 12px; }
[data-pattern="3"] .date-chip { border-radius: 12px; background: var(--tile-blue); border: none; }
[data-pattern="3"] .tag { border-radius: 999px; }
[data-pattern="3"] .d365 { border-radius: 16px; background: var(--white); }

[data-pattern="3"] .sp-app { background: var(--nav-surface); }
[data-pattern="3"] .sp-head { background: var(--white); }
[data-pattern="3"] .sp-app .room-tools { padding: 4px var(--pad-mobile) 12px; }
[data-pattern="3"] .sp-app .room-list { padding: 0 14px 12px; }
[data-pattern="3"] .sp-app .room { padding: 16px; border-radius: 18px; }
[data-pattern="3"] .sp-app .room-ic { width: 44px; height: 44px; }
[data-pattern="3"] .sp-app .room-name { font-size: 16.5px; }
[data-pattern="3"] .sp-app .room-sec { padding: 10px 6px 6px; }
[data-pattern="3"] .sp-app .room-search { height: 48px; }
[data-pattern="3"] .sp-app .btn-line { min-height: 46px; }
[data-pattern="3"] .sp-app .conv-scroll { padding: 12px 10px 16px; }
[data-pattern="3"] .sp-app .msg { padding: 12px 12px; border-radius: 16px; }
[data-pattern="3"] .sp-app .composer-send { min-height: 44px; }
[data-pattern="3"] .sp-nav { height: 84px; padding: 6px 10px 14px; gap: 6px; background: var(--white); }
[data-pattern="3"] .sp-tab { border-radius: 16px; font-size: 13px; }
[data-pattern="3"] .sp-tab.is-active { background: var(--tile-beige); }
[data-pattern="3"] .sp-tab svg { width: 24px; height: 24px; }
[data-pattern="3"] .sp-card { border-radius: 16px; background: var(--white); }
[data-pattern="3"] .sp-app .act { min-height: 160px; border-radius: 20px; }
[data-pattern="3"] .sp-app .act-ic { width: 50px; height: 50px; }
[data-pattern="3"] .sp-app .row { margin: 0 8px 6px; padding: 12px 10px; }
[data-pattern="3"] .drawer { background: var(--nav-surface); }
[data-pattern="3"] .drawer .room-list { padding: 0 4px 10px; }

/* =========================================================
 * 部品の状態・操作性（全パターン共通）
 * hover / focus-visible / pressed / 選択中 / 無効、タップ領域44px、動きを減らす設定
 * ========================================================= */

/* 読み上げ専用の文言（件数バッジの「あなた宛て」「件」など） */
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* キーボードで来たときだけ出す枠（Focus ring）。マウスでは出さない */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--charcoal);
  outline-offset: 2px;
}
.room:focus-visible,
.row:focus-visible,
.msg-file:focus-visible { outline-offset: -2px; }
.act:focus-visible { outline-offset: 3px; }
.composer-box:has(textarea:focus-visible) { outline: 2px solid var(--charcoal); outline-offset: 1px; }
.composer textarea:focus-visible { outline: none; }
.room-search:has(input:focus-visible) { outline: 2px solid var(--charcoal); outline-offset: 1px; }
.room-search input:focus-visible { outline: none; }

/* 押した瞬間（pressed） */
.nav-link:active,
.room:active,
.row:active,
.tool:active,
.btn-line:active,
.icon-btn:active,
.sp-tab:active,
.bell:active { opacity: 0.7; }
.btn-fill:active:not(:disabled) { transform: scale(0.98); }

/* 無効（送信ボタンは入力が空のあいだ押せない） */
.btn-fill:disabled {
  background: var(--surface-sub);
  border-color: var(--surface-sub);
  color: var(--taupe);
  cursor: default;
  opacity: 1;
}

/* 選択中のトグル（概要とタスクを開いている） */
.conv-ov-btn[aria-expanded="true"] { background: var(--surface-sub); border-color: var(--charcoal); }

/* タップ領域：見た目が小さいボタンも、押せる範囲は縦44px以上にする */
.btn-line,
.tool,
.icon-btn,
.bell { position: relative; }
.btn-line::after,
.tool::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: max(100%, 44px);
  transform: translateY(-50%);
}

/* ホームインジケータの分を空ける */
.sp-nav { padding-bottom: max(12px, env(safe-area-inset-bottom)); }

/* スマホは入力欄のヒントを出さない（キーボードの上を広く） */
.sp-app .composer-hint { display: none; }

/* 開閉の動きは150〜250ms。「視差効果を減らす」設定の人には動かさない */
.nav-group .room-panel { animation: none; }
.nav-group.is-open .room-panel { animation: panel-in 200ms var(--easing); }
@keyframes panel-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* パターン2：1行に収めるため、パソコンではアイコンを外して名前と最終発言に幅を回す */
[data-pattern="2"] .side { width: 340px; }
[data-pattern="2"] .side .room-ic { display: none; }
[data-pattern="2"] .side .room-name { max-width: 58%; }
[data-pattern="2"] .side .room { padding-left: 16px; }

/* 1文字だけ次の行に落ちる（「…ていま／す」）のを防ぐ */
.row-title, .act-desc, .msg-text, .ov-text, .box-note { text-wrap: pretty; }


/* =========================================================
 * 第2版の追加（立場の切り替え／あなた宛ての帯／未読だけ表示／やること／写真つき投稿）
 * ========================================================= */

/* 上の帯：せまい画面でははみ出さず横にスクロール */
.mock-band { overflow-x: auto; scrollbar-width: none; }
.mock-band::-webkit-scrollbar { display: none; }
.mock-band > * { flex-shrink: 0; }
.mock-band .role-seg { border-color: #8a5a1f; }
.mock-band .role-seg button { height: 24px; }

/* 一覧：未読だけ表示 */
.room-filter { display: flex; }
.filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  position: relative;
  min-height: 34px;
  padding: 0 12px;
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  color: var(--charcoal);
  font-size: 13px;
  letter-spacing: 0.04em;
}
.filter-btn::after { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: max(100%, 44px); transform: translateY(-50%); }
.filter-btn:hover { background: var(--nav-surface); }
.filter-btn:active { opacity: 0.7; }
.filter-btn.is-on { background: var(--charcoal); border-color: var(--charcoal); color: var(--white); }
.filter-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: var(--radius-pill);
  background: var(--surface-sub); color: var(--charcoal);
  font-family: var(--font-label); font-size: 11.5px; line-height: 1;
}
.filter-btn.is-on .filter-count { background: var(--white); }
.sp-app .filter-btn { min-height: 42px; font-size: 14px; }
.room-empty { margin: 0; padding: 20px 16px; color: var(--taupe); font-size: 13.5px; line-height: 1.8; }

/* 件数：あなた宛て＝緑の数字、ほかの未読＝小さな灰色の文字 */
.count-other { flex-shrink: 0; color: var(--muted); font-size: 11.5px; letter-spacing: 0.02em; white-space: nowrap; }
.room.is-to-me .count.is-to-me { min-width: 24px; height: 24px; font-size: 14px; }

/* 初回だけの凡例 */
.room-legend {
  display: flex; align-items: flex-start; gap: 6px;
  margin: 0; padding: 8px 6px 8px 16px;
  background: var(--nav-surface);
  border-bottom: 1px solid var(--rule);
  color: var(--taupe); font-size: 11.5px; line-height: 1.7;
}
.room-legend p { flex: 1; margin: 0; }
.legend-dot { display: inline-block; width: 9px; height: 9px; margin-right: 4px; border-radius: 50%; background: var(--charcoal); vertical-align: baseline; }
.legend-dot.is-to-me { background: var(--to-me-unread); }
.legend-close { position: relative; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 28px; height: 28px; background: transparent; border: none; color: var(--taupe); }
.legend-close svg { width: 14px; height: 14px; }
.legend-close::after { content: ''; position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; transform: translate(-50%, -50%); }
.sp-app .room-legend { padding-left: var(--pad-mobile); font-size: 12.5px; }

/* 左メニューの並びが入れ替わるとき（控えめに） */
.nav-group.is-open { animation: panel-in 200ms var(--easing); }
button.nav-admin { width: 100%; }

/* メッセージの写真・リアクション（シェアルームから移した投稿の見本） */
.msg-photos { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.msg-photo {
  display: flex; align-items: flex-end;
  width: min(100%, 320px); aspect-ratio: 4 / 3;
  border: 1px solid var(--rule); border-radius: 6px; overflow: hidden;
}
.msg-photo span { width: 100%; padding: 6px 10px; background: rgba(63, 67, 64, 0.45); color: var(--white); font-size: 12px; }
.msg-reacts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.react {
  display: inline-flex; align-items: center; gap: 5px;
  min-height: 26px; padding: 0 10px;
  border: 1px solid var(--rule-strong); border-radius: var(--radius-pill);
  background: var(--paper); color: var(--charcoal); font-size: 13px;
}
.react b { color: var(--taupe); font-family: var(--font-label); font-size: 12px; font-weight: 500; }
[data-pattern="3"] .msg-photo { border-radius: 14px; }

/* 概要パネルの一言 */
.ov-note { margin: 0 0 6px; color: var(--taupe); font-size: 12.5px; line-height: 1.7; }

/* マイページ：あなた宛ての未読の帯 */
.unread-band {
  display: flex; align-items: center; gap: 14px;
  min-height: 64px; margin-bottom: 20px; padding: 12px 18px;
  background: var(--unread-bg);
  border: 1px solid #c9dccf; border-left: 5px solid var(--to-me-unread); border-radius: 8px;
  color: var(--charcoal); text-decoration: none;
  transition: background var(--duration) var(--easing), transform var(--duration) var(--easing);
}
.unread-band:hover { background: #e4eee7; }
.unread-band:active { transform: scale(0.992); }
.unread-band-ic { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 44px; height: 44px; border-radius: 50%; background: var(--to-me-unread); color: var(--white); }
.unread-band-text { flex: 1; min-width: 0; line-height: 1.5; }
.unread-band-text b { display: block; font-size: 16px; letter-spacing: 0.04em; }
.unread-band-text em { color: var(--to-me-unread); font-family: var(--font-label); font-size: 20px; font-style: normal; font-weight: 700; }
.unread-band-text small { display: block; overflow: hidden; color: var(--taupe); font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap; }
.unread-band-go { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; color: var(--to-me-unread); font-size: 14px; font-weight: 700; white-space: nowrap; }
/* 運営として見たときは、いちばん目立たせる */
.unread-band.is-staff { min-height: 80px; padding: 14px 22px; background: var(--to-me-unread); border-color: var(--to-me-unread); color: var(--white); }
.unread-band.is-staff:hover { background: #335c44; }
.unread-band.is-staff .unread-band-ic { background: rgba(255, 255, 255, 0.2); }
.unread-band.is-staff .unread-band-text b { font-size: 17px; }
.unread-band.is-staff .unread-band-text em { color: var(--white); font-size: 28px; }
.unread-band.is-staff .unread-band-text small { color: rgba(255, 255, 255, 0.85); }
.unread-band.is-staff .unread-band-go { color: var(--white); }
.sp-app .unread-band { flex-wrap: wrap; gap: 8px 12px; padding: 12px 14px; }
.sp-app .unread-band.is-staff { padding: 14px; }
.sp-app .unread-band-ic { width: 40px; height: 40px; }
.sp-app .unread-band-text b { font-size: 15.5px; white-space: nowrap; }
.sp-app .unread-band-go {
  flex: 1 1 100%; justify-content: center; min-height: 44px;
  border-radius: var(--radius); background: var(--to-me-unread); color: var(--white); font-size: 14.5px;
}
.sp-app .unread-band.is-staff .unread-band-go { background: var(--white); color: var(--to-me-unread); }
[data-pattern="3"] .unread-band { border-radius: 20px; }
[data-pattern="2"] .unread-band { border-radius: 2px; }

/* マイページ：やること */
.box-count { color: var(--taupe); font-size: 13px; white-space: nowrap; }
.task-row { align-items: flex-start; gap: 6px; padding-left: 6px; }
.task-row .row-title { font-size: 15px; }
.task-row .row-sub { margin-top: 2px; }
.task-check {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 44px; height: 44px; margin-top: -4px;
  background: transparent; border: none; border-radius: var(--radius);
}
.task-check .diamond { width: 16px; height: 16px; border-width: 1.5px; }
.task-check:hover .diamond { border-color: var(--charcoal); }
.task-check:active { opacity: 0.7; }
.task-link {
  position: relative; flex-shrink: 0; align-self: center;
  color: var(--charcoal); font-size: 13px; text-underline-offset: 3px; white-space: nowrap;
}
.task-link::after { content: ''; position: absolute; left: -8px; right: -8px; top: 50%; height: 44px; transform: translateY(-50%); }
.task-done-label { margin: 0; padding: 10px 20px 4px; border-top: 1px solid var(--rule); color: var(--taupe); font-size: 12.5px; letter-spacing: 0.04em; }
.task-row.is-done { opacity: 0.6; }
.task-row.is-done .row-title { color: var(--muted); }
.task-row.is-done .diamond { background: var(--accent); border-color: var(--accent); }
.sp-app .task-row { padding: 10px 14px 10px 4px; }
.sp-app .task-link { align-self: flex-start; margin-top: 8px; }
.mp-col .d365 { align-self: flex-start; max-width: 340px; }
[data-pattern="3"] .task-row { margin: 0 8px 6px; padding-left: 4px; }
[data-pattern="2"] .count-other { order: 5; font-size: 11px; }

/* せまい画面（実機のスマホ）で比較ページを開いたとき、スマホ枠が横にはみ出さない */
@media (max-width: 460px) {
  .compare { padding-left: 8px; padding-right: 8px; }
  .compare-cols { gap: 32px; }
  .phone { width: 100%; max-width: 410px; padding: 8px; border-radius: 36px; }
  .phone iframe { width: 100%; border-radius: 28px; }
  .mp-stage { padding-left: 8px; padding-right: 8px; }
}

.legend-line { display: inline-block; margin-right: 14px; white-space: nowrap; }
.legend-line:last-child { display: block; margin-top: 2px; margin-right: 0; white-space: normal; }
.task-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0 12px; color: var(--taupe); font-size: 12.5px; line-height: 1.6; }
.task-room { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-meta .task-link { align-self: center; }
.sp-app .task-link { align-self: center; margin-top: 0; }

/* 低い画面では左メニュー全体を縦にスクロール（一覧が潰れすぎないように） */
.side-nav { overflow-y: auto; }
.nav-group.is-open .room-list { min-height: 180px; }
[data-pattern="3"] .filter-btn { border-radius: 999px; }
[data-pattern="3"] .react { background: var(--white); }

/* ---------- v3：細かい点検の修正 ---------- */
/* マイページの大ボタン：説明文は区切りごとにまとめて、1〜2文字だけが次の行に落ちないようにする */
.act-desc .nb { display: inline-block; white-space: nowrap; }
[data-pattern] .sp-app .act { min-height: 0; padding: 12px 12px 12px; gap: 3px; border-radius: 16px; }
[data-pattern] .sp-app .act-ic { width: 38px; height: 38px; }
[data-pattern] .sp-app .act-ic svg { width: 20px; height: 20px; }
[data-pattern] .sp-app .act-title { margin-top: 2px; font-size: 17px; letter-spacing: 0.02em; }
[data-pattern] .sp-app .act-desc { padding-right: 0; font-size: 12px; letter-spacing: 0; line-height: 1.5; }
[data-pattern] .sp-app .act .count { top: 10px; right: 10px; }
[data-pattern] .sp-app .acts { gap: 10px; margin-bottom: 20px; }
[data-pattern] .sp-app .mp-head { margin-bottom: 12px; }
[data-pattern] .sp-app .mp-inner { padding: 14px var(--pad-mobile) 32px; }

/* 「概要とタスク」ボタンの未完了数 */
.ov-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; margin-left: 6px; padding: 0 5px; border-radius: var(--radius-pill); background: var(--charcoal); color: var(--white); font-family: var(--font-label); font-size: 11.5px; line-height: 1; }
.ov-task .task-check { margin: -10px -6px -10px -10px; }
.ov-task .task-check .diamond { margin-top: 0; }
[data-pattern="3"] .ov-task { align-items: center; }

/* 受信専用などの付記は、ルーム名の後ろの小さいラベル */
.room-tag { display: inline-block; margin-left: 6px; padding: 0 5px; border: 1px solid var(--rule-strong); border-radius: 3px; color: var(--taupe); font-size: 10.5px; font-weight: 400; letter-spacing: 0; line-height: 1.5; vertical-align: 1px; }
[data-pattern="2"] .room-name,
[data-pattern="2"] .side .room-name { flex: 0 1 auto; min-width: 8.5em; max-width: 64%; }
[data-pattern="2"] .side .room-last { min-width: 0; }

/* 一覧の上の操作を詰める：検索の下は「未読だけ表示」と「＋個別」「＋グループ」を1行に */
.room-tools { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; }
.room-tools .room-search { flex: 1 1 100%; }
.room-tools .room-filter { flex: 0 0 auto; }
.room-tools .room-new { flex: 1 1 0; min-width: 0; gap: 6px; }
.room-tools .room-new .btn-line { padding: 0 6px; gap: 3px; min-width: 0; letter-spacing: 0.02em; }
.room-tools .room-new .btn-line svg { width: 12px; height: 12px; }
[data-pattern] .room-tools .room-new { flex: 1 1 0; }
.sp-app .room-tools { padding-top: 2px; padding-bottom: 8px; }
.sp-app .room-legend { padding-top: 4px; padding-bottom: 4px; font-size: 12px; line-height: 1.6; }
.sp-app .room-legend .legend-line { margin-right: 10px; }
.sp-app .room-list { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
/* スマホの一覧：部屋が4件ほど見えるように、見出し・行の余白を詰める（タップ領域44px以上は保つ） */
[data-pattern] .sp-app .sp-title { padding-top: 6px; padding-bottom: 6px; margin-bottom: 0; font-size: 20px; }
[data-pattern] .sp-app .room { padding-top: 8px; padding-bottom: 8px; min-height: 56px; }
[data-pattern] .sp-app .room-ic { width: 36px; height: 36px; }
[data-pattern] .sp-app .room-sec { padding-top: 6px; padding-bottom: 4px; }
[data-pattern="3"] .sp-app .room { padding: 10px 14px; border-radius: 16px; }
.room-tools .room-new .btn-line svg { flex-shrink: 0; }
.drawer .room-tools .btn-line, .drawer .room-tools .filter-btn { font-size: 13px; }
.sp-app .room-tools .btn-line, .sp-app .room-tools .filter-btn { min-height: 44px; }
.side .room-tools { gap: 6px; }
.side .room-tools .btn-line, .side .room-tools .filter-btn { font-size: 12.5px; letter-spacing: 0.02em; }
.side .room-tools .filter-btn { padding: 0 8px; gap: 5px; }
.side .room-tools .room-new .btn-line { padding: 0 4px; }
.side .room-tools .room-new { gap: 4px; }
.room-tools .room-new, [data-pattern] .room-tools .room-new { flex: 1 1 152px; min-width: 152px; }
.drawer .room-tools { padding-left: 12px; padding-right: 12px; }
.side .room-tools { padding-left: 10px; padding-right: 10px; }
.side .room-tools .room-new, [data-pattern] .side .room-tools .room-new { flex: 1 1 146px; min-width: 146px; }
.side .room-tools .room-new .btn-line svg { width: 11px; height: 11px; }
.side .room-tools .room-new .btn-line { gap: 2px; padding: 0 3px; }
[data-pattern="3"] .side .room-tools { padding-left: 4px; padding-right: 4px; }
[data-pattern="3"] .side .room-tools .filter-btn { padding: 0 6px; }
[data-pattern="3"] .side .room-tools .room-new { flex: 1 1 140px; min-width: 140px; }
.side .room { padding-top: 8px; padding-bottom: 8px; }
.side .room-sec { padding-top: 8px; padding-bottom: 4px; }
.side .room-legend { padding-top: 4px; padding-bottom: 4px; }
