/* リモコン（遠隔指定の操作ページ）。別サイトとして単独で出せるよう、このファイルだけで完結させる。 */
:root {
  color-scheme: light;
  --ink: #1f2230;
  --sub: #5d6070;
  --line: #d9dae2;
  --navy: #1f2a44;
  --ok: #17703f;
  --ok-bg: #e8f4ec;
  --ng: #b3261e;
  --wait-bg: #eceef3;
}

* {
  box-sizing: border-box;
}

html {
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: #f3f4f7;
  color: var(--ink);
  font-family:
    "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo,
    system-ui, sans-serif;
  line-height: 1.6;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.remote-body {
  min-height: 100vh;
  min-height: 100dvh;
}

.rm {
  max-width: 480px;
  margin: 0 auto;
  padding: calc(22px + env(safe-area-inset-top)) 16px 40px;
}

.rm-head h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
}

.rm-head p {
  margin: 4px 0 18px;
  color: var(--sub);
  font-size: 13px;
}

.rm-card {
  margin-top: 12px;
  padding: 18px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.rm-card h2 {
  margin: 0 0 12px;
  font-size: 17px;
  font-weight: 800;
}

.rm-label {
  display: block;
  margin: 16px 0 6px;
  color: var(--sub);
  font-size: 13px;
  font-weight: 700;
}

/* ---- つなぐ前の手順 ---- */
.rm-steps {
  margin: 0;
  padding: 0;
  counter-reset: step;
  list-style: none;
}

.rm-steps li {
  position: relative;
  min-height: 28px;
  margin-bottom: 10px;
  padding-left: 38px;
  counter-increment: step;
  font-size: 15px;
}

.rm-steps li::before {
  position: absolute;
  top: -1px;
  left: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  content: counter(step);
  font-size: 13px;
  font-weight: 800;
  line-height: 26px;
  text-align: center;
}

/* ---- 入力とボタン ---- */
.rm-send {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.rm-field {
  width: 100%;
  min-width: 0;
  height: 52px;
  padding: 0 14px;
  border: 1px solid #b9bbc7;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: 20px;
  font-weight: 700;
}

.rm-field.code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.rm-field::placeholder {
  color: #a6a8b3;
  font-weight: 400;
}

.rm-field:focus-visible,
.rm-btn:focus-visible,
.rm-choices button:focus-visible,
.rm-link:focus-visible {
  outline: 3px solid #7d95d6;
  outline-offset: 2px;
}

.rm-btn {
  height: 52px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 800;
  white-space: nowrap;
}

.rm-btn.solid {
  background: var(--navy);
  color: #fff;
}

.rm-btn.plain {
  border-color: #b9bbc7;
  background: #fff;
  color: var(--ink);
}

.rm-btn.wide {
  width: 100%;
}

/* ---- つながり具合 ---- */
.rm-status {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--wait-bg);
}

.rm-status.live {
  border-color: #b9dcc6;
  background: var(--ok-bg);
}

.rm-status-main {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 15px;
  font-weight: 800;
}

.rm-status-sub {
  margin: 4px 0 0 18px;
  color: var(--sub);
  font-size: 13px;
}

.rm-dot {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #9a9cab;
}

.rm-status.live .rm-dot {
  background: var(--ok);
}

/* ---- いまどの段階か ---- */
.rm-flow {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.rm-flow li {
  padding: 8px 8px 9px;
  border-top: 3px solid #cfd1db;
  color: #8b8e9c;
  font-size: 12px;
  line-height: 1.45;
}

.rm-flow li span {
  display: block;
  font-size: 13px;
  font-weight: 800;
}

.rm-flow li.done {
  border-top-color: #8793b3;
}

.rm-flow li.now {
  border-top-color: var(--navy);
  color: var(--ink);
  font-weight: 700;
}

/* ---- 値を選ぶ ---- */
.rm-choices {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
  gap: 8px;
}

.rm-choices button {
  min-height: 52px;
  padding: 6px;
  overflow-wrap: anywhere;
  border: 1px solid #b9bbc7;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
}

.rm-choices button:active {
  background: #e4e7f0;
}

/* ---- 決めたあと ---- */
.rm-pending {
  border-color: var(--navy);
  border-width: 2px;
}

.rm-pending-label {
  margin: 0;
  color: var(--sub);
  font-size: 13px;
  font-weight: 700;
}

.rm-pending-value {
  margin: 2px 0 6px;
  overflow-wrap: anywhere;
  font-size: 56px;
  font-weight: 800;
  line-height: 1.15;
}

.rm-pending-next {
  margin: 0 0 16px;
  font-size: 15px;
  font-weight: 700;
}

.rm-result {
  margin: 0 0 4px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
}

.rm-result.ok {
  background: var(--ok-bg);
  color: var(--ok);
}

.rm-result.ng {
  background: #fbeceb;
  color: var(--ng);
}

.rm-error {
  min-height: 1.6em;
  margin: 10px 0 0;
  color: var(--ng);
  font-size: 13px;
}

.rm-error:empty {
  min-height: 0;
  margin: 0;
}

.rm-code {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 18px 2px 0;
  color: var(--sub);
  font-size: 13px;
}

.rm-link {
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--navy);
  font-size: 13px;
  text-decoration: underline;
}
