:root {
  color-scheme: light;
  --bg: #e9e8e5;
  --panel: #fff;
  --ink: #1f1f21;
  --sub: #6d6d72;
  --line: #e6e5e1;
  --edge: rgba(0, 0, 0, 0.09);
  --track: #dddbd6;
  --bar: linear-gradient(#3b3b3d, #232325);
  --light: #f2c200;
  --light-hot: #ffd83a;
  --light-ink: #1f1f21;
  --light-soft: #fff5d1;
  --light-edge: #ebc84f;
  --light-text: #a87400;
  --rain-a: #ff4d4d;
  --rain-b: #ff9f1a;
  --rain-c: #2fce62;
  --rain-d: #2f8cff;
  --rain-e: #7a5cff;
  --bomb: #1f7ae0;
  --bomb-ink: #fff;
  --bomb-soft: #e6f0fc;
  --bomb-edge: #9fc5f1;
  --bomb-text: #1a63b8;
  --zao: #d8382a;
  --zao-text: #b3281c;
  --alert: #c8281e;
  --alert-soft: #fdeceb;
  --alert-edge: #eaa9a3;
  --arena: #f4efe0;
  --cut: 14px;
  --rain-line: linear-gradient(90deg, var(--rain-a), var(--rain-b), var(--light-hot), var(--rain-c), var(--rain-d), var(--rain-e));
}

.tool-rube { --accent: var(--light); --accent-ink: var(--light-ink); --accent-text: var(--light-text); }
.tool-delmeze { --accent: var(--bomb); --accent-ink: #fff; --accent-text: var(--bomb-text); }
.tool-scorpide { --accent: var(--zao); --accent-ink: #fff; --accent-text: var(--zao-text); }
.tool-party { --accent: #8a5ae6; --accent-ink: #fff; --accent-text: #6a3fc4; }

* { box-sizing: border-box; }

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: "SF Pro JP", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic Pro", "Hiragino Sans", "Segoe UI", Meiryo, "Noto Sans JP", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.4;
  letter-spacing: -0.2px;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

button { font: inherit; color: inherit; }

a, button, label, select { touch-action: manipulation; }

:focus, :focus-visible { outline: none; }

body.settings-only main,
body.settings-only .foot,
body.settings-only .top .strength,
body.settings-only .top .icon-btn { display: none; }

body.settings-only dialog#settings {
  position: static;
  display: block;
  width: auto;
  max-width: 640px;
  max-height: none;
  margin: 0 auto;
  padding: 8px max(16px, env(safe-area-inset-right)) 28px max(16px, env(safe-area-inset-left));
  background: transparent;
  clip-path: none;
  overflow: visible;
}

body.settings-only dialog#settings .settings { padding: 0; max-height: none; overflow: visible; }
body.settings-only dialog#settings h2,
body.settings-only dialog#settings .close { display: none; }

body.loading main,
body.loading .strength,
body.loading .foot { visibility: hidden; }

.now,
.buttons button,
dialog {
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, 0 100%);
}

.top {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 8px;
  height: calc(64px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) max(16px, calc((100% - 608px) / 2)) 0;
  background: var(--bar);
  color: #fff;
  border-bottom: 3px solid #5a5a5e;
}

.top h1 {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top .logo { display: block; flex: none; margin-right: 10px; border-radius: 7px; }
.top .logo img { display: block; border-radius: 7px; }

.strength {
  display: flex;
  background: rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  padding: 2px;
}

.strength button {
  border: 0;
  background: transparent;
  min-width: 34px;
  height: 36px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.66);
}

.strength button[aria-checked="true"] {
  background: var(--accent);
  color: var(--accent-ink);
}

.icon-btn {
  width: 38px;
  height: 40px;
  border-radius: 8px;
  border: 0;
  background: transparent;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.icon-btn svg { width: 22px; height: 22px; fill: rgba(255, 255, 255, 0.82); fill-rule: evenodd; }
.icon-btn:active { background: rgba(255, 255, 255, 0.14); }
.icon-btn[hidden] { display: none; }
.icon-btn.mic.on { background: var(--accent); }
.icon-btn.mic.on svg { fill: var(--accent-ink); }
.settings .help[hidden] { display: none; }
.icon-btn.party { width: auto; min-width: 38px; padding: 0 8px; display: flex; gap: 5px; }
.icon-btn.party.on { background: #34c759; }
.icon-btn.party.on svg { fill: #fff; }
.icon-btn.party.wait { background: #8e8e93; }
.leave h2 { margin: 0 0 10px; text-align: center; }
.leave .leave-note { margin: -4px 0 12px; text-align: center; font-size: 13px; color: var(--sub); }
.leave .leave-note[hidden] { display: none; }
.leave .leave-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.leave .leave-actions button { min-height: 48px; margin: 0; font-size: 16px; }
.leave .leave-actions .leave-cancel { border: 1px solid #c8c7c3; background: #f3f2ef; color: var(--ink); font-weight: 700; cursor: pointer; }
.party-code { color: #fff; font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: 0.04em; }
.party-code:empty { display: none; }
.strength.follow button { opacity: 0.55; }
.strength.follow button[aria-checked="true"] { opacity: 1; }
.buttons.locked .move { opacity: 0.4; }
.party .party-box { display: grid; gap: 12px; padding: 6px 0 4px; }
.party .party-box[hidden] { display: none; }
.party .party-make { min-height: 52px; border: 0; background: var(--ink); color: #fff; font: inherit; font-size: 17px; font-weight: 700; cursor: pointer; }
.party .party-make:disabled { opacity: 0.5; }
.party .party-box > .card { display: grid; gap: 10px; margin: 0; padding-bottom: 14px; }
.party .party-box > .card header { margin-bottom: 0; }
.party .party-input { width: 100%; box-sizing: border-box; height: 72px; border: 1px solid #c8c7c3; border-radius: 0; background: #fff; color: var(--ink); font: inherit; font-size: 40px; font-weight: 800; letter-spacing: 0.5em; text-indent: 0.5em; text-align: center; font-variant-numeric: tabular-nums; }
.party .party-input::placeholder { color: #d1d1d6; }
.party .party-input:focus { outline: 2px solid #34c759; outline-offset: -2px; }
.party .party-num { margin: 0; font-size: 56px; font-weight: 800; letter-spacing: 0.18em; text-indent: 0.18em; text-align: center; font-variant-numeric: tabular-nums; line-height: 1.1; }
.party .party-meta { margin: 0; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 15px; }
.party .party-dot { width: 10px; height: 10px; border-radius: 50%; background: #c7c7cc; }
.party .party-dot.ok { background: #34c759; }
.party .party-role { margin: 0; text-align: center; font-size: 14px; color: var(--sub); }
.party .party-role:empty { display: none; }
.party .party-leave { justify-self: center; margin-top: 2px; padding: 8px 16px; border: 0; background: none; color: var(--sub); font: inherit; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.party .party-leave[hidden] { display: none; }
.party .party-msg { margin: 0; min-height: 0; font-size: 14px; color: #d70015; text-align: center; }
.party .party-msg:empty { display: none; }
.party .party-cap { display: block; margin: 0 0 -6px; font-size: 13px; color: var(--sub); text-align: center; }
.party .card .party-cap { margin: 0 0 -4px; text-align: left; }
#voice-heard { display: block; margin-top: 4px; color: var(--ink); }
#voice-heard:empty { display: none; }

main {
  max-width: 640px;
  margin: 0 auto;
  padding: 14px max(16px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left));
}

.now {
  background: var(--panel);
  box-shadow: inset 0 0 0 1px var(--edge);
  padding: 16px 18px 14px;
  min-height: var(--now-h, 228px);
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto auto 1fr auto auto;
  grid-template-areas:
    "label"
    "sub"
    "count"
    "bar"
    "hint";
  column-gap: 10px;
  align-items: center;
}

.tool-rube .now {
  grid-template-columns: 1fr var(--ring-w, 92px);
  grid-template-areas:
    "label ring"
    "sub ring"
    "count ring"
    "bar bar"
    "hint hint";
}

.now-label {
  grid-area: label;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.25;
  min-height: 28px;
  letter-spacing: 0;
}

.now-sub { grid-area: sub; font-size: 15px; font-weight: 600; color: var(--accent-text); min-height: 0; }
.now-sub:empty { display: none; }

.now-count {
  grid-area: count;
  display: flex;
  align-items: baseline;
  align-self: center;
  gap: 6px;
  min-width: 0;
  margin-top: 4px;
}

.now-count .pre,
.now-count .unit {
  font-size: 17px;
  font-weight: 600;
  color: var(--sub);
  letter-spacing: 0;
}

#now-count {
  font-size: 80px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 0.95;
  letter-spacing: -2px;
}

.now-count.is-idle,
.now-count.is-idle + .bar { visibility: hidden; }

.ring { grid-area: ring; width: var(--ring-w, 92px); height: var(--ring-w, 92px); }
.ring[hidden] { display: block; visibility: hidden; }

.hint {
  grid-area: hint;
  margin: 12px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--sub);
  font-size: 14px;
  line-height: 1.45;
  min-height: 29px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar {
  grid-area: bar;
  height: 10px;
  background: var(--track);
  margin-top: 14px;
  overflow: hidden;
  -webkit-mask: repeating-linear-gradient(90deg, #000 0, #000 calc(10% - 3px), transparent calc(10% - 3px), transparent 10%);
  mask: repeating-linear-gradient(90deg, #000 0, #000 calc(10% - 3px), transparent calc(10% - 3px), transparent 10%);
}

.bar i {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--light);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.1s linear;
  will-change: transform;
}

.now:not(.soon) .bar i { transform: scaleX(0) !important; transition: none; }
.now.kind-rain .bar i { background: var(--rain-line); }
.now.kind-bomb .bar i { background: var(--bomb); }
.now.kind-zao .bar i { background: var(--zao); }
.now.urgent.kind-zao { background: var(--alert-soft); box-shadow: inset 0 0 0 1px var(--alert-edge); }
.now.urgent.kind-zao .now-sub { color: var(--alert); }
.now.kind-rest .bar i { background: #129e8f; }
.now.kind-rest .now-sub { color: #0f7f74; }
.tool-scorpide .buttons .move { grid-column: 1 / -1; }

.now.soon.kind-light { background: var(--light-soft); box-shadow: inset 0 0 0 1px var(--light-edge); }
.now.soon.kind-light .now-sub { color: var(--light-text); }

.now.soon.kind-rain {
  background:
    linear-gradient(#fff, #fff) padding-box,
    var(--rain-line) border-box;
  border: 2px solid transparent;
  box-shadow: none;
}

.now.soon.kind-bomb { background: var(--bomb-soft); box-shadow: inset 0 0 0 1px var(--bomb-edge); }

.now.urgent #now-count { color: var(--alert); }
.now.urgent.kind-bomb { background: var(--alert-soft); box-shadow: inset 0 0 0 1px var(--alert-edge); }
.now.urgent.kind-bomb .bar i { background: var(--alert); }
.now.urgent.kind-bomb .now-sub { color: var(--alert); }

.now.appear.kind-light { background: var(--light-hot); color: var(--light-ink); box-shadow: none; }

.now.appear.kind-light .pre,
.now.appear.kind-light .unit,
.now.appear.kind-light .hint,
.now.appear.kind-light .now-sub { color: var(--light-ink); }

.now.appear.kind-light .hint { border-top-color: rgba(0, 0, 0, 0.14); }

.now.appear.kind-rain {
  background:
    linear-gradient(#fff, #fff) padding-box,
    var(--rain-line) border-box;
  border: 3px solid transparent;
  box-shadow: none;
}

.now.appear.kind-bomb { background: var(--alert); color: #fff; box-shadow: none; }

.now.appear.kind-bomb .pre,
.now.appear.kind-bomb .unit,
.now.appear.kind-bomb .hint,
.now.appear.kind-bomb .now-sub { color: #fff; }

.now.appear.kind-bomb .hint { border-top-color: rgba(255, 255, 255, 0.3); }
.now.appear .now-count,
.now.appear .bar { visibility: hidden; }
.now.appear .now-label { font-size: 32px; line-height: 1.2; }

.ring .arena { fill: var(--arena); }
.ring .lit { fill: #ebb829; }
.ring .edge { fill: none; stroke: #9a8a60; stroke-width: 1; }
.ring .tick { stroke: #9a8a60; stroke-width: 1; opacity: 0.7; }
.now.appear.kind-light .ring .arena { fill: #fff8de; }
.now.appear.kind-light .ring .lit { fill: #d79a00; }

.queue {
  list-style: none;
  margin: 0;
  padding: 0;
}

.queue li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 38px;
  margin-top: 4px;
  padding: 0 14px;
  background: var(--panel);
  box-shadow: inset 0 0 0 1px var(--edge);
  font-size: 16px;
  font-weight: 700;
}

.queue li:first-child { margin-top: 8px; }
.queue li.empty { display: none; }
.queue .q-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue .q-left { display: flex; align-items: baseline; gap: 3px; flex: none; }
.queue .pre, .queue .unit { font-size: 12px; font-weight: 600; color: var(--sub); }
.queue .q-sec { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; min-width: 2.2em; text-align: right; }
.queue li.soon { background: var(--bomb-soft); box-shadow: inset 0 0 0 1px var(--bomb-edge); }
.queue li.soon .q-sec { color: var(--bomb-text); }
.queue li.urgent { background: var(--alert-soft); box-shadow: inset 0 0 0 1px var(--alert-edge); }
.queue li.urgent .q-sec { color: var(--alert); }

.buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.buttons button {
  min-height: 60px;
  border: 0;
  background: var(--panel);
  box-shadow: inset 0 0 0 1px var(--edge);
  color: var(--ink);
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  text-align: left;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.buttons button:active { background: #f1f0ed; }
.buttons .move { touch-action: pan-y; }
.buttons .move:active:not(.held) { background: var(--panel); }
.buttons .move.held { background: #f1f0ed; }
.buttons button.pressed { background: var(--ink); color: #fff; box-shadow: none; }
.buttons button[hidden] { display: none; }

.buttons .lbl { min-width: 0; }

.buttons kbd { display: none; }

@media (hover: hover) and (pointer: fine) {
  .buttons kbd { display: inline; }
}

.buttons kbd {
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--sub);
  flex: none;
}

.buttons button.pressed kbd { color: rgba(255, 255, 255, 0.7); }

.calls-now {
  min-height: 0;
  height: 176px;
  grid-template-rows: auto 1fr auto;
  grid-template-areas:
    "label"
    "big"
    "hint";
}

.calls-now .now-label { font-size: 15px; font-weight: 600; color: var(--sub); min-height: 21px; }
.call-big { grid-area: big; align-self: center; font-size: 40px; font-weight: 800; line-height: 1.15; letter-spacing: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.call-big.is-idle { font-size: 22px; font-weight: 700; color: #b8b7b3; }
.calls-now.heard { background: #e8f8ec; box-shadow: inset 0 0 0 2px var(--accent); }
.calls-now.heard .call-big { color: var(--accent-text); }

.voicelog { margin-top: 8px; }
.voicelog .vl-idle,
.voicelog .vl-list li {
  height: 52px;
  box-sizing: border-box;
  margin: 0;
  padding: 0 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, 0 100%);
}
.voicelog .vl-idle { background: var(--panel); box-shadow: inset 0 0 0 1px var(--edge); font-size: 14px; font-weight: 600; color: #b8b7b3; }
.voicelog.has .vl-idle { display: none; }
.voicelog .vl-list { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.voicelog .vl-list li { background: #6c6c70; color: #fff; }
.voicelog .vl-list li.s-ok,
.voicelog .vl-list li.s-wait,
.voicelog .vl-list li.s-recv { background: #2aa84a; }
.voicelog .vl-list li.s-warn,
.voicelog .vl-list li.s-fail { background: var(--alert); }
.voicelog .vl-word { flex: 0 1 auto; min-width: 0; font-size: 26px; font-weight: 800; line-height: 1; letter-spacing: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.voicelog .vl-note { flex: 1 1 0; min-width: 0; text-align: right; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.heard-line { margin: 8px 2px 0; height: 20px; font-size: 13px; line-height: 20px; color: var(--sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.heard-line + .buttons { margin-top: 6px; }

.buttons.call-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.buttons.call-grid button { min-height: 60px; justify-content: center; text-align: center; font-size: 17px; padding: 8px 10px; }
.buttons.call-grid .lbl { overflow-wrap: anywhere; }

@media (min-width: 640px) {
  .buttons.call-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.buttons.call-grid[data-n="1"] { grid-template-columns: minmax(0, 1fr); }
.buttons.call-grid[data-n="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }

@media (max-width: 639px) {
  .buttons.call-grid > :last-child:nth-child(odd) { grid-column: 1 / -1; }
}

.buttons .reset { grid-column: 1 / -1; }

.buttons .reset {
  min-height: 60px;
  justify-content: center;
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  background: #6c6c70;
  box-shadow: none;
}

.buttons .reset:active { background: #48484a; color: #fff; }

.buttons .reset kbd { color: rgba(255, 255, 255, 0.75); }

.buttons .reset kbd { margin-left: 8px; }

.foot {
  max-width: 640px;
  margin: 4px auto 0;
  padding: 8px max(16px, env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  font-size: 12px;
  color: var(--sub);
  line-height: 1.5;
}

.foot p { margin: 4px 0; }
.foot a { color: var(--sub); }

dialog {
  border: 0;
  padding: 0;
  background: var(--panel);
  color: var(--ink);
  width: min(460px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px);
}

dialog::backdrop { background: rgba(0, 0, 0, 0.42); }

.settings {
  padding: 18px 18px 16px;
  display: grid;
  gap: 4px;
  overflow: auto;
  max-height: calc(100dvh - 48px);
}

.settings h2 { margin: 0 0 8px; font-size: 17px; font-weight: 700; }
.settings .card { background: var(--panel); border: 1px solid var(--line); padding: 12px 14px 4px; margin: 8px 0 0; clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%); }
.settings .card header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.settings .card h3 { margin: 0; font-size: 16px; font-weight: 700; line-height: 1.35; min-width: 0; }
.settings .reset { flex: none; min-height: 32px; padding: 0 10px; border: 0; border-radius: 999px; background: transparent; color: var(--sub); font-size: 13px; font-weight: 600; cursor: pointer; }
.settings .reset:active { background: rgba(0, 0, 0, 0.07); color: var(--ink); }
.settings .row { display: grid; gap: 8px; font-size: 15px; padding: 10px 0; }
.settings .row small { display: block; color: var(--sub); font-size: 12px; font-weight: 400; margin-top: 2px; }
.settings .row.check { grid-template-columns: 1fr auto; align-items: center; gap: 10px; }
.settings .row[hidden] { display: none; }
.settings .row.key-row { grid-template-columns: 1fr auto; align-items: center; gap: 10px; }
.guide-btn { display: block; width: 100%; margin-top: 8px; min-height: 60px; border: 0; background: #6c6c70; color: #fff; font-size: 17px; font-weight: 700; cursor: pointer; clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%); }
.guide-btn:active { background: #48484a; }
.settings.guide .guide-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; }
.settings.guide .guide-name { font-weight: 700; overflow-wrap: anywhere; }
.settings.guide .guide-say { color: var(--sub); overflow-wrap: anywhere; }
.settings .key-names { display: grid; gap: 4px; min-width: 0; }
.settings .keybtn { min-width: 108px; min-height: 36px; padding: 0 14px; border: 0; border-radius: 8px; background: #f1f0ed; color: var(--ink); font-size: 14px; font-weight: 700; cursor: pointer; }
.settings .keybtn.on { background: var(--ink); color: #fff; }
.settings .range { display: flex; align-items: center; gap: 10px; }
.settings .range input { flex: 1; min-width: 0; }
.settings output { min-width: 60px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.settings select { width: 100%; min-height: 44px; padding: 0 36px 0 12px; border: 1px solid #c8c7c3; border-radius: 0; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2348484a' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 12px center; color: var(--ink); font: inherit; font-size: 15px; -webkit-appearance: none; appearance: none; cursor: pointer; text-overflow: ellipsis; }
.settings .voice-state { margin: 0 0 2px; min-height: 1.5em; font-size: 13px; color: var(--sub); line-height: 1.5; overflow-wrap: anywhere; }
.settings .voice-state:empty { display: none; }
.settings .help { margin: 0; font-size: 12px; color: var(--sub); line-height: 1.55; border-top: 1px solid var(--line); padding-top: 10px; }
.settings input[type="range"] { -webkit-appearance: none; appearance: none; height: 30px; background: transparent; margin: 0; cursor: pointer; }
.settings input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(to right, #48484a var(--p, 50%), #e5e5ea var(--p, 50%)); }
.settings input[type="range"]::-moz-range-track { height: 6px; border-radius: 3px; background: #e5e5ea; }
.settings input[type="range"]::-moz-range-progress { height: 6px; border-radius: 3px; background: #48484a; }
.settings input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 26px; height: 26px; margin-top: -10px; border-radius: 50%; background: #fff; border: 1px solid #c8c7c3; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); }
.settings input[type="range"]::-moz-range-thumb { width: 24px; height: 24px; border-radius: 50%; background: #fff; border: 1px solid #c8c7c3; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); }
.settings .switch { -webkit-appearance: none; appearance: none; width: 51px; height: 31px; margin: 0; border-radius: 16px; background: #e5e5ea; position: relative; cursor: pointer; transition: background 0.2s; }
.settings .switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); transition: transform 0.2s; }
.settings .switch:checked { background: #34c759; }
.settings .switch:checked::after { transform: translateX(20px); }

.settings .close {
  margin-top: 8px;
  min-height: 46px;
  border: 0;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}


@media (min-width: 640px) {
  body { --now-h: 262px; --ring-w: 118px; }
  #now-count { font-size: 104px; }
}

@media (max-width: 360px) {
  body { --now-h: 208px; --ring-w: 76px; }
  #now-count { font-size: 64px; }
  .now-label { font-size: 19px; }
  .strength button { min-width: 31px; }
  .icon-btn { width: 34px; }
}

@media (max-width: 599px) {
  .top {
    display: grid;
    grid-template-columns: auto 1fr auto auto auto;
    grid-template-areas: "title title title title title" "strength . party mic gear";
    align-items: center;
    gap: 0 4px;
    height: auto;
    padding: 0;
    background: none;
    border-bottom: 0;
    color: var(--ink);
  }
  .top h1 {
    grid-area: title;
    height: calc(64px + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
    background: var(--bar);
    color: #fff;
    border-bottom: 3px solid #5a5a5e;
  }
  .top .strength { grid-area: strength; justify-self: start; margin: 8px 0 8px max(16px, env(safe-area-inset-left)); background: rgba(0, 0, 0, 0.07); }
  .top .strength button { color: var(--sub); }
  .top .strength button[aria-checked="true"] { color: var(--accent-ink); }
  .top #party { grid-area: party; margin-block: 8px; }
  .top #voice { grid-area: mic; margin-block: 8px; }
  .top #open-settings { grid-area: gear; margin: 8px max(16px, env(safe-area-inset-right)) 8px 0; }
  .top .icon-btn svg { fill: #3a3a3c; }
  .top .icon-btn:active { background: rgba(0, 0, 0, 0.1); }
  .top .icon-btn.party.wait svg { fill: #fff; }
}

.now .hint:empty { border-top-color: transparent !important; }

.strength button.locked { opacity: 0.4; position: relative; }
.strength button.locked::after {
  content: "";
  position: absolute;
  right: 3px;
  bottom: 4px;
  width: 6px;
  height: 5px;
  border-radius: 1px;
  background: var(--light-hot);
}
.buttons button.disabled { opacity: 0.45; cursor: default; }
