/* Mini room on the home page (miniroom plan todo 12). Lives inside the .mh frame of
 * homes/_minihome_style.html and uses its tokens (--mh-ink, --mh-muted, --mh-link, --mh-wash,
 * --mh-line, --mh-ai, --mh-ai-wash), its radii (10 / 14 / 999px) and its rem spacing steps.
 * The room-only tokens below extend that set; components never use raw values. */
.room {
  --room-stage-bg: linear-gradient(180deg, var(--mh-ai-wash), var(--mh-wash));
  --room-stage-radius: 14px;
  --room-control-radius: 10px;
  --room-pill: 999px;
  --room-accent: #c2410c; /* same emphasis red as .mh-counter b */
  --room-on-ink: #fff;
  --room-bubble-bg: #fff;
  --room-control-height: 2.25rem; /* .mh .gb-tools button */
  --room-gap: .45rem;
  --room-block-gap: .6rem;
  --room-text-sm: .82rem;
  --room-text-xs: .78rem;
  margin: 0 0 1.2rem;
}

.room-stage { position: relative; background: var(--room-stage-bg); border: 1px solid var(--mh-line); border-radius: var(--room-stage-radius); padding: var(--room-block-gap); margin: 0 0 var(--room-block-gap); overflow: hidden; }
.room-stage[hidden] { display: none; }
.room-canvas { display: block; width: 100%; max-width: var(--room-canvas-max, 100%); height: auto; margin: 0 auto; touch-action: manipulation; user-select: none; -webkit-user-select: none; border-radius: var(--room-control-radius); }
.room-canvas:focus-visible { outline: 2px solid var(--mh-link); outline-offset: 2px; }
.room-stage[data-hover="1"] .room-canvas { cursor: pointer; }
.room-stage[data-editing="1"] .room-canvas { cursor: crosshair; }
.room-overlay { position: absolute; inset: 0; pointer-events: none; }
.room-bubble { position: absolute; transform: translate(-50%, -100%); max-width: 14rem; background: var(--room-bubble-bg); color: var(--mh-ink); border: 1px solid var(--mh-line); border-radius: var(--room-pill); padding: .1rem .6rem; font-size: var(--room-text-xs); line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room-bubble::after { content: ""; position: absolute; left: 50%; bottom: -1px; width: .4rem; height: .4rem; background: var(--room-bubble-bg); border-right: 1px solid var(--mh-line); border-bottom: 1px solid var(--mh-line); transform: translate(-50%, 50%) rotate(45deg); }

.room-status { margin: 0 0 var(--room-block-gap); min-height: 1.4em; font-size: var(--room-text-sm); }
.room-status:empty { margin: 0; min-height: 0; }
.room-status[data-tone="error"], .room-status[data-tone="conflict"] { color: var(--room-accent); }
.room-status[data-tone="applied"] { color: var(--mh-ink); }
.room-notice { margin-top: 0; }

.room-edit-toggle[aria-pressed="true"] { background: var(--mh-ink); color: var(--room-on-ink); border-color: var(--mh-ink); }
.room-customize-link { display: inline-flex; align-items: center; min-height: var(--room-control-height); padding: .2rem .8rem; border: 1px solid var(--mh-line); border-radius: var(--room-pill); font-size: var(--room-text-sm); font-weight: 400; text-decoration: none; color: var(--mh-link); vertical-align: middle; }
.room-editor { display: grid; gap: var(--room-gap); margin: 0 0 var(--room-block-gap); padding: var(--room-block-gap) .8rem; background: var(--mh-wash); border-radius: var(--room-control-radius); }
.room-editor[hidden] { display: none; }
.room-editor-head { display: flex; flex-wrap: wrap; gap: .3rem .8rem; align-items: baseline; font-size: var(--room-text-sm); color: var(--mh-muted); }
.room-editor-head b { color: var(--mh-ink); font-variant-numeric: tabular-nums; }
.room-tools { display: flex; flex-wrap: wrap; gap: var(--room-gap); align-items: center; }
.room-tools-label { font-size: var(--room-text-xs); color: var(--mh-muted); flex: 0 0 100%; margin: .15rem 0 -.2rem; }
.mh .room-editor button { min-height: var(--room-control-height); font-size: var(--room-text-sm); padding: .2rem .7rem; }
.mh .room-editor button[aria-pressed="true"] { background: var(--mh-ink); color: var(--room-on-ink); border-color: var(--mh-ink); }
.mh .room-editor button:disabled { opacity: .5; cursor: default; }
.room-editor label { font-size: var(--room-text-sm); display: inline-flex; align-items: center; gap: .3rem; }
.room-editor select { font: inherit; font-size: var(--room-text-sm); min-height: var(--room-control-height); padding: .2rem .5rem; border: 1px solid var(--mh-line); border-radius: var(--room-control-radius); background: var(--room-bubble-bg); color: var(--mh-ink); }
.room-frozen { margin: 0; }

.room-dialog { margin: 0 0 var(--room-block-gap); }
.room-dialog[hidden] { display: none; }
.room-panel { background: var(--room-bubble-bg); border: 1px solid var(--mh-line); border-radius: var(--room-stage-radius); padding: .8rem 1rem; }
.room-panel-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.mh .room-panel-head h2 { margin: 0; }
.mh .room-panel-close { min-height: var(--room-control-height); min-width: var(--room-control-height); padding: 0 .6rem; font-size: 1.1rem; line-height: 1; }
.room-panel-meaning { margin: .2rem 0 .6rem; font-size: var(--room-text-sm); color: var(--mh-muted); }
.room-panel ul { list-style: none; padding: 0; margin: 0; }
.room-panel li { padding: .45rem 0; border-top: 1px dotted var(--mh-line); font-size: .92rem; }
.room-panel li:first-child { border-top: 0; }
.room-panel time, .room-panel small { color: var(--mh-muted); font-size: var(--room-text-xs); margin-left: .35rem; font-variant-numeric: tabular-nums; }
.room-panel .status-badge { display: inline-block; font-size: var(--room-text-xs); padding: 0 .5rem; border-radius: var(--room-pill); background: var(--mh-ai-wash); color: var(--mh-ai); margin: 0 0 0 .3rem; }
.room-panel progress { width: 100%; accent-color: var(--mh-ai); }
.room-panel blockquote { margin: .5rem 0 0; padding: .4rem .7rem; border-left: 3px solid var(--mh-line); color: var(--mh-muted); font-size: var(--room-text-sm); }

.room-facts { margin: 0; }
.room-items, .room-roster { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .15rem .6rem; }
.room-items a { font-size: var(--room-text-xs); }

@media (prefers-reduced-motion: reduce) {
  .room-canvas { scroll-behavior: auto; }
}
