/* TIMOG アプリ画面の模型（共通部品）
   ・実物の SwiftUI 画面（art/app-shots）に合わせた macOS ウインドウを HTML/CSS で描く
   ・寸法は実物のポイント（1100×720 のウインドウ）のまま組み、外側の .tm-fit で幅に合わせて縮小する
   ・色はスクリーンショットから拾った値。ライト／ダークは prefers-color-scheme で切り替える */

.tm-fit { position: relative; width: 100%; max-width: var(--tm-max, none); }
.tm-fit.tm-center { margin-left: auto; margin-right: auto; }
.tm-stage { position: absolute; top: 0; left: 0; transform-origin: 0 0; }
.tm-fit:not(.tm-ready) { min-height: 200px; }

.tm {
  /* ライト */
  --tm-bg: #ffffff;
  --tm-bg2: #f8f8f8;
  --tm-toolbar: #ffffff;
  --tm-side: linear-gradient(170deg, #f3ece6 0%, #edeeee 28%, #eceded 100%);
  --tm-side-sel: #d9d1ca;
  --tm-text: #1f1f1f;
  --tm-text2: #7a7a7a;
  --tm-text3: #b2b2b2;
  --tm-line: #e6e6e6;
  --tm-btn: #e5e5e5;
  --tm-btn-hover: #dadada;
  --tm-field: #ffffff;
  --tm-field-line: #d9d9d9;
  --tm-accent: #3478f6;
  --tm-accent-soft: #dbe5f8;
  --tm-empty: #f5f5f5;
  --tm-unassigned: #d0d0d0;
  --tm-chip-off: rgba(0, 0, 0, .04);
  --tm-chip-off-line: rgba(0, 0, 0, .14);
  --tm-shadow: 0 0 0 .5px rgba(0, 0, 0, .22), 0 24px 70px -12px rgba(0, 0, 0, .32), 0 8px 22px -8px rgba(0, 0, 0, .18);
  --tm-sheet-shadow: 0 0 0 .5px rgba(0, 0, 0, .2), 0 22px 60px rgba(0, 0, 0, .28);
  --tm-tip: #fbfbfb;
  --tm-ring: var(--ring, #f28a1e);

  position: relative;
  width: 100%; height: 100%;
  display: flex;
  background: var(--tm-bg);
  color: var(--tm-text);
  border-radius: 13px;
  overflow: hidden;
  box-shadow: var(--tm-shadow);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", sans-serif;
  font-size: 13px;
  line-height: 1.35;
  letter-spacing: 0;
  text-align: left;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
  user-select: none;
  -webkit-user-select: none;
}
@media (prefers-color-scheme: dark) {
  .tm {
    --tm-bg: #1f2326;
    --tm-bg2: #25292c;
    --tm-toolbar: #2c2c2e;
    --tm-side: linear-gradient(170deg, #2a2b2d 0%, #22292e 30%, #21292e 100%);
    --tm-side-sel: #4f4f4e;
    --tm-text: #e8e8e8;
    --tm-text2: #9a9c9e;
    --tm-text3: #64676a;
    --tm-line: #35393b;
    --tm-btn: #35393c;
    --tm-btn-hover: #404448;
    --tm-field: #181919;
    --tm-field-line: #3a3d40;
    --tm-accent: #3a82f7;
    --tm-accent-soft: #27354a;
    --tm-empty: #292d30;
    --tm-unassigned: #4a4d50;
    --tm-chip-off: rgba(255, 255, 255, .05);
    --tm-chip-off-line: rgba(255, 255, 255, .16);
    --tm-shadow: 0 0 0 1px rgba(255, 255, 255, .1), 0 24px 70px -10px rgba(0, 0, 0, .7), 0 8px 22px -8px rgba(0, 0, 0, .5);
    --tm-sheet-shadow: 0 0 0 1px rgba(255, 255, 255, .12), 0 22px 60px rgba(0, 0, 0, .6);
    --tm-tip: #3a3d40;
  }
}
.tm *, .tm *::before, .tm *::after { box-sizing: border-box; }
.tm button { font: inherit; color: inherit; letter-spacing: inherit; margin: 0; }
.tm svg { display: block; flex: none; }
.tm :focus-visible { outline: 3px solid color-mix(in srgb, var(--tm-accent) 55%, transparent); outline-offset: 1px; }

/* シートだけを見せるとき（ウインドウの枠なし） */
.tm.tm-bare { height: auto; display: block; background: transparent; box-shadow: none; overflow: visible; border-radius: 0; padding: 18px 0 0; }

/* ---------- サイドバー ---------- */
.tm-sidebar {
  width: 200px; flex: none; position: relative;
  background: var(--tm-side);
  border-right: 1px solid var(--tm-line);
  display: flex; flex-direction: column;
}
.tm-lights { position: absolute; top: 19px; left: 19px; display: flex; gap: 9px; }
.tm-lights i { width: 14px; height: 14px; border-radius: 50%; background: #ff5f57; box-shadow: inset 0 0 0 .5px rgba(0,0,0,.12); }
.tm-lights i:nth-child(2) { background: #febc2e; }
.tm-lights i:nth-child(3) { background: #28c840; }
.tm-glass {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: color-mix(in srgb, var(--tm-bg) 70%, transparent);
  box-shadow: 0 0 0 .5px rgba(0,0,0,.12), 0 2px 6px rgba(0,0,0,.08);
  color: var(--tm-text);
}
.tm-sidebar .tm-glass { position: absolute; top: 9px; right: 9px; }
.tm-nav { margin-top: 52px; padding: 0 10px; display: flex; flex-direction: column; gap: 0; }
.tm-nav button {
  display: flex; align-items: center; gap: 9px; height: 32px; padding: 0 10px 0 8px;
  border: 0; border-radius: 9px; background: transparent; cursor: pointer; text-align: left;
  font-size: 13px; font-weight: 500;
}
.tm-nav button svg { color: var(--tm-accent); }
.tm-nav button > span:not(.tm-badge) { white-space: nowrap; }
.tm-nav button:hover { background: color-mix(in srgb, var(--tm-side-sel) 45%, transparent); }
.tm-nav button[aria-current="page"] { background: var(--tm-side-sel); }
.tm-nav .tm-badge { margin-left: auto; color: var(--tm-text2); font-size: 11px; }
.tm-status { margin-top: auto; padding: 12px; }
.tm-status b { display: flex; align-items: center; gap: 6px; font-size: 10.5px; font-weight: 600; }
.tm-status b::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #34c759; }
.tm-status span { display: block; margin-top: 4px; font-size: 10.5px; color: var(--tm-text2); }

/* ---------- 右側（ツールバー＋中身） ---------- */
.tm-detail { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; }
.tm-toolbar {
  height: 52px; flex: none; display: flex; align-items: center; gap: 12px; padding: 0 20px;
  background: var(--tm-toolbar); border-bottom: 1px solid var(--tm-line);
  font-size: 14.5px; font-weight: 500; color: color-mix(in srgb, var(--tm-text) 85%, transparent);
}
.tm-toolbar .tm-lights { position: static; margin-right: 6px; }
.tm-content { flex: 1; min-height: 0; display: flex; position: relative; }
.tm-scroll { overflow-y: auto; overflow-x: hidden; scrollbar-width: none; overscroll-behavior: auto; }
.tm-scroll::-webkit-scrollbar { display: none; }

/* ---------- ボタン類（macOS 風） ---------- */
.tm-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 24px; padding: 0 11px; border: 0; border-radius: 8px;
  background: var(--tm-btn); font-size: 13px; cursor: pointer; white-space: nowrap;
  transition: background .12s, transform .12s, filter .12s;
}
.tm-btn:hover { background: var(--tm-btn-hover); }
.tm-btn.sm { height: 20px; padding: 0 8px; border-radius: 6px; font-size: 11.5px; }
.tm-btn.blue { background: var(--tm-accent); color: #fff; }
.tm-btn.blue:hover { filter: brightness(1.06); }
.tm-btn[disabled], .tm-btn[aria-disabled="true"] { color: var(--tm-text3); cursor: default; }
.tm-btn.blue[disabled] { background: color-mix(in srgb, var(--tm-accent) 55%, var(--tm-bg)); color: rgba(255,255,255,.85); }
.tm-btn.icon { width: 30px; padding: 0; }
.tm-plain { border: 0; background: none; padding: 0; cursor: pointer; color: var(--tm-text2); display: inline-flex; align-items: center; }
.tm-plain:hover { color: var(--tm-text); }
.tm-pressing { transform: scale(.94); filter: brightness(.88); }
.tm-popup {
  display: inline-flex; align-items: center; gap: 8px; height: 22px; padding: 0 4px 0 9px; border-radius: 6px;
  background: var(--tm-btn); font-size: 12.5px; white-space: nowrap; position: relative;
}
.tm-popup .tm-chev { width: 16px; height: 16px; display: grid; place-items: center; color: var(--tm-text2); }
.tm-popup select { position: absolute; inset: 0; opacity: 0; cursor: pointer; font: inherit; width: 100%; }
.tm-pill { display: inline-flex; align-items: center; padding: 1px 6px; border-radius: 4px; background: var(--tm-btn); white-space: nowrap; }
.tm-input {
  height: 22px; border: 1px solid var(--tm-field-line); border-radius: 6px; background: var(--tm-field);
  padding: 0 7px; font: inherit; font-size: 12.5px; color: var(--tm-text); min-width: 0;
}
.tm-input::placeholder { color: var(--tm-text3); }
.tm-input:focus { outline: 3px solid color-mix(in srgb, var(--tm-accent) 45%, transparent); outline-offset: 0; border-color: var(--tm-accent); }
.tm-toggle { width: 38px; height: 22px; border-radius: 999px; border: 0; padding: 0; background: var(--tm-btn); position: relative; cursor: pointer; flex: none; transition: background .18s; }
.tm-toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 24px; height: 18px; border-radius: 999px; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: left .18s; }
.tm-toggle[aria-checked="true"] { background: var(--tm-accent); }
.tm-toggle[aria-checked="true"]::after { left: 12px; }
.tm-seg { display: inline-flex; padding: 2px; border-radius: 9px; background: var(--tm-btn); gap: 2px; }
.tm-seg button { border: 0; background: transparent; height: 22px; padding: 0 14px; border-radius: 7px; font-size: 12.5px; cursor: pointer; white-space: nowrap; }
.tm-seg button[aria-pressed="true"] { background: var(--tm-accent); color: #fff; }
.tm-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--c); }
.tm-ai {
  font-size: 10px; font-weight: 600; padding: 2px 6px; border-radius: 999px;
  background: var(--tm-accent-soft); color: color-mix(in srgb, var(--tm-text) 85%, transparent);
}
.tm-chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px;
  font-size: 10.5px; white-space: nowrap; border: 1px solid var(--c); background: color-mix(in srgb, var(--c) 25%, transparent);
  color: var(--tm-text);
}
.tm-chip .n { color: var(--tm-text2); }
.tm-chip.off { border-color: var(--tm-chip-off-line); background: var(--tm-chip-off); color: var(--tm-text2); }
button.tm-chip { cursor: pointer; font-size: 10.5px; }

/* ---------- タイムライン ---------- */
.tm-main { flex: 1; min-width: 0; }
.tm-pad { padding: 24px; display: flex; flex-direction: column; gap: 20px; }
.tm-dayhead { display: flex; align-items: flex-start; gap: 8px; }
.tm-dayhead h4 { margin: 0; font-size: 17px; font-weight: 700; line-height: 1.25; }
.tm-dayhead p { margin: 4px 0 0; color: var(--tm-text2); font-size: 13px; }
.tm-dayhead .grow { flex: 1; }
.tm-dayhead .tm-navbtns { display: flex; gap: 4px; }
.tm-note { background: var(--tm-bg2); border-radius: 10px; padding: 14px; }
.tm-note-h { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.tm-note-h b { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700; }
.tm-note-h .grow { flex: 1; }
.tm-note-body { font-size: 12px; line-height: 1.55; white-space: pre-line; }
.tm-note-empty { display: flex; align-items: center; gap: 10px; color: var(--tm-text2); font-size: 12px; }
.tm-note-empty .grow { flex: 1; }
.tm-sumbar { display: flex; gap: 2px; height: 14px; border-radius: 4px; overflow: hidden; }
.tm-sumbar i { display: block; min-width: 2px; background: var(--c); flex: var(--g) 1 0; }
@keyframes tm-grow { from { flex-grow: var(--g0); } }
.tm-legend { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px 10px; margin-top: 10px; font-size: 12px; }
.tm-legend span { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.tm-legend em { font-style: normal; color: var(--tm-text2); }
.tm-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tm-hours { display: flex; flex-direction: column; gap: 6px; }
.tm-ticks { display: flex; padding-left: 48px; font-size: 10px; color: var(--tm-text3); }
.tm-ticks span { flex: 1; }
.tm-hour { display: flex; align-items: center; }
.tm-hour > em { width: 48px; flex: none; font-style: normal; font-size: 10.5px; color: var(--tm-text2); }
.tm-track { flex: 1; height: 26px; position: relative; border-radius: 3px; background: var(--tm-empty); cursor: pointer; }
.tm-seg-a {
  position: absolute; top: 0; bottom: 0; border: 0; padding: 0; margin: 0; border-radius: 0;
  background: var(--c); cursor: pointer; min-width: 1.5px;
}
.tm-seg-a.manual { opacity: .55; box-shadow: inset 0 0 0 1px var(--c); background-clip: padding-box; outline: 1px dashed var(--c); outline-offset: -1px; }
.tm-seg-a.sel { box-shadow: inset 0 0 0 2px var(--tm-text); z-index: 1; }
.tm-seg-a:focus-visible { outline: 2px solid var(--tm-accent); outline-offset: 1px; z-index: 2; }
.tm-seg-a.recolor { animation: tm-recolor 1.1s cubic-bezier(.3,.7,.2,1) both; animation-delay: var(--d, 0s); }
@keyframes tm-recolor {
  0% { background: var(--c0); }
  35% { background: var(--c0); box-shadow: 0 0 0 2px var(--tm-ring); }
  100% { background: var(--c); box-shadow: 0 0 0 0 transparent; }
}
.tm-hint { font-size: 10px; color: var(--tm-text3); padding-left: 48px; }
.tm-flash { animation: tm-flash 1.4s ease both; }
@keyframes tm-flash { 0%, 30% { color: var(--tm-ring); } 100% { color: inherit; } }

/* 右パネル */
.tm-panel { width: 320px; flex: none; background: var(--tm-bg2); border-left: 1px solid var(--tm-line); }
.tm-panel-in { padding: 16px; display: flex; flex-direction: column; gap: 20px; }
.tm-hrow { display: flex; align-items: baseline; gap: 8px; }
.tm-hrow h5 { margin: 0; font-size: 13px; font-weight: 700; flex: 1; }
.tm-hrow .v { color: var(--tm-text2); font-size: 13px; }
.tm-cap { margin: 8px 0 0; font-size: 10.5px; line-height: 1.45; color: var(--tm-text2); }
.tm-gap { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 12px; }
.tm-gap .grow { flex: 1; }
.tm-gap em { font-style: normal; color: var(--tm-text2); }
.tm-group { padding: 10px; margin-top: 10px; border-radius: 8px; }
.tm-group-h { display: flex; gap: 8px; font-size: 12px; }
.tm-group-h b { flex: 1; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-group-h span { color: var(--tm-text2); }
.tm-group p { margin: 4px 0 6px; font-size: 10.5px; color: var(--tm-text2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-group.leaving { animation: tm-leave .6s ease both; }
@keyframes tm-leave { to { opacity: 0; transform: translateX(16px); } }
.tm-detailbox { display: flex; flex-direction: column; gap: 10px; }
.tm-detailbox h6 { margin: 0; font-size: 15px; font-weight: 600; }
.tm-detailbox .t { font-size: 12px; word-break: break-all; }
.tm-detailbox .u { font-size: 10.5px; color: var(--tm-text2); word-break: break-all; }
.tm-detailbox .tm-picker { display: flex; align-items: center; gap: 10px; font-size: 12.5px; }
.tm-detailbox .tm-picker .tm-popup { flex: 1; justify-content: space-between; }
.tm-detailbox .small { font-size: 10px; color: var(--tm-text3); margin-top: -4px; }
.tm-detailbox .lab { font-size: 10.5px; font-weight: 600; }
.tm-detailbox .acts { display: flex; justify-content: flex-end; }
.tm-danger { border: 0; background: none; color: #e5484d; font-size: 10.5px; cursor: pointer; padding: 0; }
.tm-divider { height: 1px; background: var(--tm-line); }

/* ツールチップ */
.tm-tip {
  position: absolute; z-index: 30; pointer-events: none;
  background: var(--tm-tip); color: var(--tm-text); border-radius: 6px;
  box-shadow: 0 0 0 .5px rgba(0,0,0,.18), 0 6px 18px rgba(0,0,0,.18);
  padding: 5px 8px; font-size: 11px; line-height: 1.45; white-space: pre; max-width: 340px;
  opacity: 0; transition: opacity .12s;
}
.tm-tip.on { opacity: 1; }

/* 知らせ（模型の中の小さな HUD） */
.tm-toast {
  position: absolute; left: 50%; top: 66px; z-index: 40; transform: translate(-50%, -10px);
  display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 12px;
  background: rgba(30, 32, 36, .92); color: #fff; font-size: 12.5px; font-weight: 500; white-space: nowrap;
  box-shadow: 0 10px 30px rgba(0,0,0,.25); opacity: 0; transition: opacity .25s, transform .25s; pointer-events: none;
}
.tm-toast.on { opacity: 1; transform: translate(-50%, 0); }
.tm-toast svg { color: #4cd964; }

/* ---------- シート（振り分け・手動で追加） ---------- */
.tm-dim { position: absolute; inset: 0; z-index: 20; background: rgba(0, 0, 0, .1); display: flex; justify-content: center; align-items: flex-start; padding-top: 62px; animation: tm-fade .2s ease both; }
@keyframes tm-fade { from { opacity: 0; } }
.tm-sheet {
  width: 460px; border-radius: 14px; background: var(--tm-bg); box-shadow: var(--tm-sheet-shadow);
  padding: 20px 20px 16px; animation: tm-sheet-in .28s cubic-bezier(.2,.8,.2,1) both; position: relative;
}
.tm-sheet.standalone { animation: none; margin: 0 auto; }
@keyframes tm-sheet-in { from { transform: translateY(-14px) scale(.98); opacity: 0; } }
.tm-form-sec + .tm-form-sec { margin-top: 18px; }
.tm-form-sec > h6 { margin: 0 0 6px 10px; font-size: 11.5px; font-weight: 600; color: var(--tm-text2); }
.tm-form-box { background: var(--tm-bg2); border-radius: 9px; padding: 0 10px; }
.tm-form-row { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 6px 0; font-size: 12.5px; }
.tm-form-row + .tm-form-row { border-top: 1px solid var(--tm-line); }
.tm-form-row .grow { flex: 1; min-width: 0; }
.tm-form-row .sub { color: var(--tm-text2); }
.tm-form-row.stack { flex-direction: column; align-items: flex-start; gap: 2px; }
.tm-form-row h5 { margin: 0; font-size: 13px; font-weight: 700; }
.tm-form-row .tm-input { text-align: right; }
.tm-sheet-btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.tm-sheet-btns .tm-btn { min-width: 76px; height: 26px; border-radius: 999px; }

/* ---------- レポート ---------- */
.tm-report { padding: 24px; display: flex; flex-direction: column; gap: 24px; max-width: 980px; }
.tm-rhead { display: flex; align-items: center; gap: 14px; }
.tm-rhead h4 { margin: 0; font-size: 17px; font-weight: 700; flex: 1; }
.tm-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.tm-tile { background: var(--tm-bg2); border-radius: 10px; padding: 14px; }
.tm-tile small { display: block; font-size: 10.5px; color: var(--tm-text2); }
.tm-tile b { display: block; margin-top: 4px; font-size: 17px; font-weight: 700; }
.tm-tile span { display: block; margin-top: 4px; font-size: 10.5px; color: var(--tm-text2); min-height: 1.4em; }
.tm-h { margin: 0 0 8px; font-size: 13px; font-weight: 700; }
.tm-chart { position: relative; height: 200px; margin-right: 30px; border-left: 1px dashed var(--tm-line); border-bottom: 1px solid var(--tm-line); display: flex; }
.tm-chart .col { flex: 1; position: relative; border-right: 1px dashed var(--tm-line); display: flex; justify-content: center; align-items: flex-end; }
.tm-chart .bar { width: 70%; display: flex; flex-direction: column-reverse; }
.tm-chart .bar i { display: block; background: var(--c); }
.tm-chart .grid5 { position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid var(--tm-line); pointer-events: none; }
.tm-chart .yl { position: absolute; right: -30px; font-size: 10px; color: var(--tm-text2); transform: translateY(-50%); }
.tm-xl { display: flex; margin-right: 30px; font-size: 10px; color: var(--tm-text2); padding-top: 4px; }
.tm-xl span { flex: 1; padding-left: 4px; }
.tm-rlegend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; font-size: 11px; color: var(--tm-text2); }
.tm-rlegend span { display: flex; align-items: center; gap: 5px; }
.tm-rlegend .tm-dot { width: 8px; height: 8px; }
.tm-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.tm-rowbar { margin-top: 8px; }
.tm-rowbar .l { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.tm-rowbar .l .grow { flex: 1; }
.tm-rowbar .l em { font-style: normal; color: var(--tm-text2); width: 40px; text-align: right; }
.tm-rowbar .b { height: 4px; border-radius: 2px; margin-top: 3px; background: color-mix(in srgb, var(--c) 80%, transparent); }
.tm-rank { font-size: 12px; }
.tm-rank div { display: flex; gap: 8px; margin-top: 6px; }
.tm-rank div i { font-style: normal; color: var(--tm-text3); width: 18px; text-align: right; }
.tm-rank div span { flex: 1; }
.tm-rank div em { font-style: normal; color: var(--tm-text2); }

/* ---------- 分類とルール ---------- */
.tm-projects { padding: 24px; display: flex; flex-direction: column; gap: 20px; max-width: 840px; margin: 0 auto; width: 100%; }
.tm-sugg { border: 1.5px solid color-mix(in srgb, var(--tm-accent) 50%, transparent); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.tm-sugg.none { border-color: color-mix(in srgb, var(--tm-accent) 15%, transparent); }
.tm-sugg-h { display: flex; align-items: center; gap: 8px; }
.tm-sugg-h b { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; }
.tm-sugg-h .n { font-size: 10.5px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: color-mix(in srgb, var(--tm-accent) 20%, transparent); }
.tm-sugg-h .grow { flex: 1; }
.tm-srow { display: flex; align-items: flex-start; gap: 10px; background: var(--tm-bg2); border-radius: 8px; padding: 10px; }
.tm-srow .grow { flex: 1; min-width: 0; }
.tm-srow .r1 { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; font-size: 12px; }
.tm-srow .r1 .s { color: var(--tm-text2); }
.tm-srow .r1 .t { color: var(--tm-text3); }
.tm-srow .r1 b { font-weight: 600; }
.tm-srow .new { color: #f2994a; font-size: 10px; }
.tm-srow p { margin: 4px 0 0; font-size: 10.5px; color: var(--tm-text2); }
.tm-srow p.i { color: var(--tm-text3); font-size: 10px; }
.tm-srow.leaving { animation: tm-leave .5s ease both; }
.tm-desc { margin: 0; font-size: 12px; line-height: 1.6; color: var(--tm-text2); }
.tm-addrow { display: flex; align-items: center; gap: 10px; }
.tm-addrow .tm-input { flex: 1; height: 24px; }
.tm-colors { display: flex; gap: 6px; }
.tm-colors button { width: 18px; height: 18px; border-radius: 50%; border: 0; padding: 0; background: var(--c); cursor: pointer; }
.tm-colors button[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--tm-bg2), 0 0 0 4px var(--tm-text); }
.tm-card { background: var(--tm-bg2); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.tm-card-h { display: flex; align-items: center; gap: 10px; }
.tm-card-h b { flex: 1; font-size: 13px; font-weight: 700; }
.tm-rule { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.tm-rule .s { color: var(--tm-text2); }
.tm-rule .grow { flex: 1; }
.tm-rule .tm-input { flex: 1; }
.tm-rule.new-rule { animation: tm-flashbg 1.6s ease both; border-radius: 6px; }
@keyframes tm-flashbg { 0%, 40% { background: color-mix(in srgb, var(--tm-ring) 20%, transparent); } 100% { background: transparent; } }

/* ---------- 設定 ---------- */
.tm-settings { padding: 20px 0 30px; width: min(704px, calc(100% - 48px)); margin: 0 auto; }
.tm-settings .tm-form-sec + .tm-form-sec { margin-top: 22px; }
.tm-settings .tm-form-sec > h6 { font-size: 13px; color: var(--tm-text); font-weight: 700; margin-bottom: 8px; }
.tm-settings .tm-form-box { padding: 0 12px; }
.tm-settings .tm-form-row { min-height: 40px; font-size: 13px; }
.tm-settings .foot { margin: 6px 12px 0; font-size: 10.5px; color: var(--tm-text2); }
.tm-settings .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }
.tm-link { color: var(--tm-accent); font-size: 11px; }
.tm-stepper { display: flex; flex-direction: column; color: var(--tm-text2); }

/* ---------- 押す場所を示すオレンジの輪 ---------- */
.tm-ring { position: relative; z-index: 3; }
.tm-ring::after {
  content: ""; position: absolute; inset: -5px; border-radius: 12px; pointer-events: none;
  border: 2.5px solid var(--tm-ring); box-shadow: 0 0 0 4px color-mix(in srgb, var(--tm-ring) 24%, transparent);
  animation: tm-pulse 1.6s ease-in-out infinite;
}
.tm-ring[data-n]::before {
  content: attr(data-n); position: absolute; top: -15px; right: -15px; z-index: 4;
  width: 22px; height: 22px; border-radius: 50%; background: var(--tm-ring); color: #fff;
  font-size: 12px; font-weight: 800; display: grid; place-items: center; line-height: 1;
}
@keyframes tm-pulse { 50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--tm-ring) 10%, transparent); } }

@media (prefers-reduced-motion: reduce) {
  .tm *, .tm *::before, .tm *::after { animation-duration: .01s !important; animation-delay: 0s !important; transition-duration: .01s !important; }
}

/* ---------- LP 側：振り分けの実演 ---------- */
.demo-steps { list-style: none; padding: 0; margin: 28px 0 22px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.demo-steps li {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px;
  background: var(--card); border: 1px solid var(--line); color: var(--muted); font-size: .93rem; line-height: 1.6;
  transition: border-color .25s, color .25s, box-shadow .25s;
}
.demo-steps.two { grid-template-columns: repeat(2, 1fr); }
.demo-steps li b { color: var(--text); display: block; }
.demo-steps li .num { margin-top: 2px; }
.demo-steps li.on { border-color: var(--ring); color: var(--text); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 18%, transparent); }
.demo-steps li.done .num { background: var(--ring); color: #fff; }
.demo-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.demo-bar p { margin: 0; color: var(--muted); font-size: .9rem; }
@media (max-width: 760px) {
  .demo-steps, .demo-steps.two { grid-template-columns: 1fr; gap: 8px; }
  .demo-steps li { padding: 10px 14px; }
}
.mock-wrap { padding: 6px 0 18px; }
