:root {
  color-scheme: light;
  --bg: #eaf2f5;
  --surface: #ffffff;
  --surface-soft: #eef5f7;
  --ink: #15323b;
  --muted: #4b616b;
  --line: #d6e4e9;
  --line-strong: #b3cad2;
  --deep: #14313a;
  --deep-soft: #1f4b57;
  --teal: #1b7183;
  --teal-strong: #145a68;
  --teal-soft: #dceff3;
  --coral: #1b7183;
  --coral-soft: #e3f1f4;
  --yellow: #1b7183;
  --yellow-soft: #e3f1f4;
  --danger: #b0473a;
  --shadow: 0 10px 28px rgba(31, 90, 105, 0.1);
  --radius: 12px;
  font-family:
    "Microsoft YaHei UI", "PingFang SC", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button,
input[type="range"],
input[type="checkbox"] {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(21, 122, 110, 0.24);
  outline-offset: 2px;
}

button:disabled,
input:disabled {
  cursor: not-allowed;
}

.app-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: 100%;
  height: 100%;
}

.mobile-nav {
  display: none;
}

.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
  padding: 12px 18px;
  color: #f7fbfa;
  background: var(--deep);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand,
.topbar-actions,
.room-button,
.connection-pill,
.brand-mark,
.panel-heading,
.session-stat,
.master-volume,
.online-count,
.chat-notice,
.modal-header,
.modal-actions {
  display: flex;
  align-items: center;
}

.brand {
  gap: 11px;
}

.brand-mark {
  justify-content: center;
  width: 42px;
  height: 42px;
  color: var(--deep);
  background: var(--yellow);
  border-radius: var(--radius);
}

.brand-mark svg {
  width: 23px;
  height: 23px;
  stroke-width: 2.2;
}

.brand > span:last-child {
  display: grid;
  gap: 1px;
}

.brand strong {
  font-size: 18px;
  line-height: 1.1;
}

.brand small {
  color: #b9d0d1;
  font-size: 11px;
}

.topbar-actions {
  gap: 10px;
}

.room-button,
.connection-pill {
  height: 38px;
  border-radius: 999px;
}

.room-button {
  gap: 8px;
  min-width: 164px;
  padding: 0 13px;
  color: #eaf4f3;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.13);
}

.room-button:hover {
  background: rgba(255, 255, 255, 0.13);
}

.room-button-label {
  color: #9ab8ba;
  font-size: 12px;
}

.room-button strong {
  flex: 1;
  overflow: hidden;
  font-size: 13px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-button svg {
  width: 15px;
  height: 15px;
  color: #a9c5c5;
}

.connection-pill {
  gap: 7px;
  padding: 0 12px;
  color: #d7e5e4;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.11);
  font-size: 12px;
  white-space: nowrap;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: #91a2a5;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(145, 162, 165, 0.15);
}

.connection-pill.is-online .status-dot {
  background: #5bd6a1;
  box-shadow: 0 0 0 3px rgba(91, 214, 161, 0.16);
}

.connection-pill.is-connecting .status-dot {
  background: var(--yellow);
  box-shadow: 0 0 0 3px rgba(232, 184, 77, 0.17);
  animation: pulse 1.2s ease-in-out infinite;
}

.connection-pill.is-error .status-dot {
  background: #f0856b;
  box-shadow: 0 0 0 3px rgba(240, 133, 107, 0.17);
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
}

.icon-button:hover:not(:disabled) {
  color: var(--teal-strong);
  background: var(--surface-soft);
  border-color: var(--line);
}

.icon-button svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}

.topbar-icon {
  color: #d9e7e6;
  border-color: rgba(255, 255, 255, 0.13);
}

.topbar-icon:hover:not(:disabled) {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.18);
}

.workspace {
  display: grid;
  grid-template-columns:
    minmax(380px, 1.18fr)
    minmax(286px, 0.82fr)
    minmax(342px, 0.98fr);
  gap: 14px;
  min-height: 0;
  padding: 14px;
}

.panel {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel-heading {
  justify-content: space-between;
  gap: 12px;
}

.heading-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.host-control-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 27px;
  padding: 0 8px;
  color: #765516;
  background: var(--yellow-soft);
  border: 1px solid #ecd58d;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.host-control-badge svg {
  width: 13px;
  height: 13px;
}

.room-control-notice {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 9px;
  padding: 8px 10px;
  color: #52696e;
  background: #edf3f3;
  border: 1px solid #d9e5e5;
  border-radius: 6px;
  font-size: 11px;
}

.room-control-notice svg {
  width: 14px;
  height: 14px;
}

.panel-heading h1,
.panel-heading h2,
.modal-header h2 {
  margin: 2px 0 0;
  color: var(--ink);
  font-size: 20px;
  line-height: 1.2;
}

.eyebrow {
  margin: 0;
  color: var(--teal);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.timer-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 20px 22px 18px;
}

.timer-heading {
  margin-bottom: 14px;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  padding: 3px;
  background: #edf3f3;
  border: 1px solid #dde7e7;
  border-radius: var(--radius);
}

.segment {
  min-height: 34px;
  padding: 0 8px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 5px;
  font-size: 13px;
}

.segment:hover {
  color: var(--ink);
}

.segment.is-active {
  color: var(--deep);
  background: var(--surface);
  box-shadow: 0 2px 8px rgba(21, 50, 58, 0.08);
  font-weight: 700;
}

.timer-stage {
  position: relative;
  display: grid;
  flex: 1;
  place-items: center;
  min-height: 280px;
  margin: 4px 0;
}

.timer-ring {
  width: min(300px, 74%);
  aspect-ratio: 1;
  overflow: visible;
  transform: rotate(-90deg);
}

.timer-ring-track,
.timer-ring-progress {
  fill: none;
  stroke-width: 11;
}

.timer-ring-track {
  stroke: #e7eeee;
}

.timer-ring-progress {
  stroke: var(--teal);
  stroke-linecap: round;
  stroke-dasharray: 703.72;
  stroke-dashoffset: 0;
  transition: stroke 0.25s ease;
}

.timer-panel[data-mode="short"] .timer-ring-progress,
.timer-panel[data-mode="long"] .timer-ring-progress {
  stroke: var(--coral);
}

.timer-face {
  position: absolute;
  display: grid;
  justify-items: center;
  width: 72%;
  text-align: center;
}

.timer-mode-label {
  margin-bottom: 7px;
  color: var(--teal-strong);
  font-size: 12px;
  font-weight: 700;
}

.timer-display,
#timerDisplay {
  color: var(--deep);
  font-size: clamp(54px, 6.2vw, 78px);
  font-variant-numeric: tabular-nums;
  font-weight: 720;
  line-height: 1;
}

.timer-hint {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.timer-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 2px;
}

.control-secondary {
  width: 44px;
  height: 44px;
  background: var(--surface-soft);
  border-color: var(--line);
}

.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 18px;
  border-radius: var(--radius);
  font-weight: 700;
}

.primary-action {
  min-width: 154px;
  color: #ffffff;
  background: var(--teal);
  border: 1px solid var(--teal);
}

.primary-action:hover:not(:disabled) {
  background: var(--teal-strong);
  border-color: var(--teal-strong);
}

.primary-action svg,
.secondary-action svg {
  width: 18px;
  height: 18px;
}

.secondary-action {
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
}

.secondary-action:hover:not(:disabled) {
  color: var(--teal-strong);
  background: var(--surface-soft);
}

.timer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 16px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}

.session-stat {
  gap: 10px;
  min-width: 0;
}

.session-stat > span:last-child {
  display: grid;
  gap: 1px;
}

.session-stat small {
  color: var(--muted);
  font-size: 11px;
}

.session-stat strong {
  font-size: 13px;
}

.stat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  color: var(--coral);
  background: var(--coral-soft);
  border-radius: var(--radius);
}

.stat-icon svg {
  width: 17px;
  height: 17px;
}

.switch-control {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.switch-control input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch-track {
  position: relative;
  width: 34px;
  height: 20px;
  background: #c7d3d4;
  border-radius: 999px;
  transition: background 0.2s ease;
}

.switch-track::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(21, 50, 58, 0.25);
  content: "";
  transition: transform 0.2s ease;
}

.switch-control input:checked + .switch-track {
  background: var(--teal);
}

.switch-control input:checked + .switch-track::after {
  transform: translateX(14px);
}

.sound-panel {
  display: flex;
  flex-direction: column;
  padding: 20px 18px 16px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.sound-panel .panel-heading {
  margin-bottom: 15px;
}

.room-audio-notice {
  display: grid;
  gap: 9px;
  margin-bottom: 11px;
  padding: 9px 10px;
  color: var(--teal-strong);
  background: var(--teal-soft);
  border: 1px solid #badcd6;
  border-radius: 6px;
  font-size: 11px;
}

.room-audio-notice > span {
  display: flex;
  align-items: center;
  gap: 7px;
}

.room-audio-notice svg {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
}

.room-audio-notice button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 10px;
  color: #ffffff;
  background: var(--teal);
  border: 1px solid var(--teal);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
}

.room-audio-notice button:hover {
  background: var(--teal-strong);
  border-color: var(--teal-strong);
}

.room-audio-notice button svg {
  width: 14px;
  height: 14px;
}

.preset-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  margin-bottom: 12px;
}

.preset-button {
  min-height: 32px;
  padding: 0 5px;
  color: var(--muted);
  background: #eff4f4;
  border: 1px solid #dfe8e8;
  border-radius: 6px;
  font-size: 12px;
}

.preset-button:hover,
.preset-button.is-active {
  color: var(--teal-strong);
  background: var(--teal-soft);
  border-color: #b8dbd5;
  font-weight: 700;
}

.sound-list {
  display: grid;
  gap: 2px;
}

.sound-track {
  display: grid;
  grid-template-columns: 32px minmax(62px, auto) minmax(62px, 1fr) 32px;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 3px 0;
  border-bottom: 1px solid #edf2f2;
}

.sound-track:last-child {
  border-bottom: 0;
}

.sound-symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  color: var(--muted);
  background: var(--surface-soft);
  border-radius: 6px;
}

.sound-symbol svg {
  width: 16px;
  height: 16px;
}

.sound-track.is-active .sound-symbol {
  color: var(--teal-strong);
  background: var(--teal-soft);
}

.sound-name {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.volume-slider {
  width: 100%;
  height: 4px;
  margin: 0;
  appearance: none;
  background: #dce5e5;
  border-radius: 999px;
}

.volume-slider::-webkit-slider-thumb {
  width: 14px;
  height: 14px;
  appearance: none;
  background: var(--surface);
  border: 3px solid var(--teal);
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(21, 50, 58, 0.18);
}

.sound-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  color: #8a9b9f;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.sound-toggle svg {
  width: 15px;
  height: 15px;
}

.sound-toggle[aria-pressed="true"] {
  color: #ffffff;
  background: var(--teal);
  border-color: var(--teal);
}

.timer-panel.is-room-locked .segment,
.timer-panel.is-room-locked .timer-controls button,
.sound-panel.is-room-locked .preset-button,
.sound-panel.is-room-locked .sound-toggle,
.sound-panel.is-room-locked .volume-slider,
.sound-panel.is-room-locked #soundMute {
  cursor: not-allowed;
  opacity: 0.58;
}

.timer-panel.is-room-locked .timer-controls,
.sound-panel.is-room-locked .preset-strip,
.sound-panel.is-room-locked .sound-list,
.sound-panel.is-room-locked .master-volume {
  user-select: none;
}

.master-volume {
  display: grid;
  grid-template-columns: 18px auto minmax(70px, 1fr) 36px;
  gap: 8px;
  align-items: center;
  margin-top: 14px;
  padding-top: 13px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 12px;
}

.master-volume svg {
  width: 16px;
  height: 16px;
}

.master-volume output {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.chat-panel {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
}

.chat-heading {
  padding: 18px 18px 12px;
}

.online-count {
  gap: 6px;
  min-width: 50px;
  height: 30px;
  padding: 0 9px;
  color: var(--teal-strong);
  background: var(--teal-soft);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.online-count svg {
  width: 15px;
  height: 15px;
}

.participant-strip {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 6px 18px 10px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}

.participant-strip::-webkit-scrollbar {
  display: none;
}

.participant-placeholder {
  color: #94a3a6;
  font-size: 12px;
  white-space: nowrap;
}

.participant {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 104px;
  margin-right: 7px;
  padding: 4px 8px 4px 4px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  white-space: nowrap;
}

.participant-avatar,
.message-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  color: #ffffff;
  background: var(--teal);
  border-radius: 50%;
  font-weight: 700;
}

.participant-avatar {
  width: 24px;
  height: 24px;
  font-size: 10px;
}

.participant > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
}

.participant.is-host {
  background: var(--yellow-soft);
  border-color: #ead58d;
}

.participant-role {
  flex: 0 0 auto;
  padding: 1px 4px;
  color: #765516;
  background: #ffffff;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
}

.chat-notice {
  gap: 7px;
  margin: 10px 14px 0;
  padding: 8px 10px;
  color: #7b632d;
  background: var(--yellow-soft);
  border: 1px solid #efdda7;
  border-radius: 6px;
  font-size: 11px;
}

.chat-notice svg {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
}

.message-list {
  min-height: 0;
  padding: 12px 14px 16px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.empty-chat {
  display: grid;
  justify-items: center;
  margin: 54px auto 0;
  color: var(--muted);
  text-align: center;
}

.empty-chat > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-bottom: 12px;
  color: var(--teal);
  background: var(--teal-soft);
  border-radius: 50%;
}

.empty-chat svg {
  width: 22px;
  height: 22px;
}

.empty-chat strong {
  color: var(--ink);
  font-size: 14px;
}

.empty-chat p {
  max-width: 240px;
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.6;
}

.message {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 9px;
  margin-bottom: 14px;
}

.message.is-own {
  grid-template-columns: minmax(0, 1fr) 32px;
}

.message-avatar {
  width: 32px;
  height: 32px;
  font-size: 12px;
}

.message.is-own .message-avatar {
  grid-column: 2;
  grid-row: 1;
  background: var(--coral);
}

.message-body {
  min-width: 0;
}

.message.is-own .message-body {
  grid-column: 1;
  grid-row: 1;
  text-align: right;
}

.message-meta {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin-bottom: 4px;
}

.message.is-own .message-meta {
  justify-content: flex-end;
}

.message-author {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-time {
  color: #91a0a3;
  font-size: 10px;
}

.message-content {
  display: inline-block;
  max-width: 100%;
  margin: 0;
  padding: 8px 10px;
  color: #293f45;
  background: #eff4f4;
  border-radius: 3px 8px 8px 8px;
  line-height: 1.5;
  text-align: left;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.message.is-own .message-content {
  color: #ffffff;
  background: var(--teal);
  border-radius: 8px 3px 8px 8px;
}

.system-message {
  margin: 12px 0;
  color: #829397;
  font-size: 11px;
  text-align: center;
}

.chat-compose {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  gap: 8px;
  padding: 12px 14px 14px;
  background: var(--surface);
  border-top: 1px solid var(--line);
}

.chat-compose input {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  color: var(--ink);
  background: #f2f6f6;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.chat-compose input::placeholder {
  color: #9aa8aa;
}

.chat-compose input:disabled {
  background: #f5f6f6;
}

.send-button {
  width: 38px;
  height: 38px;
  color: #ffffff;
  background: var(--teal);
  border-color: var(--teal);
}

.send-button:hover:not(:disabled) {
  color: #ffffff;
  background: var(--teal-strong);
  border-color: var(--teal-strong);
}

.send-button:disabled {
  color: #99a6a8;
  background: #e2e8e8;
  border-color: #e2e8e8;
}

.modal {
  width: min(470px, calc(100vw - 36px));
  padding: 0;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 24px 70px rgba(14, 39, 46, 0.25);
}

.modal::backdrop {
  background: rgba(14, 39, 46, 0.56);
  backdrop-filter: blur(3px);
}

.modal form {
  padding: 24px;
}

.modal-header {
  gap: 12px;
  margin-bottom: 22px;
}

.modal-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--deep);
  background: var(--yellow);
  border-radius: var(--radius);
}

.modal-mark svg {
  width: 22px;
  height: 22px;
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 15px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.input-wrap {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-height: 43px;
  padding: 0 12px;
  background: #f5f8f8;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.input-wrap:focus-within {
  background: #ffffff;
  border-color: #83bdb5;
  box-shadow: 0 0 0 3px rgba(21, 122, 110, 0.09);
}

.input-wrap > svg {
  width: 17px;
  height: 17px;
  color: #809195;
}

.input-wrap input {
  width: 100%;
  height: 40px;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
}

.input-wrap input::placeholder {
  color: #9aa8aa;
}

.field-help {
  margin: -7px 0 20px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.modal-actions {
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

.timer-settings-modal {
  width: min(520px, calc(100vw - 36px));
}

.duration-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.field.compact {
  margin-bottom: 0;
}

.suffix-wrap {
  grid-template-columns: minmax(0, 1fr) auto;
}

.suffix-wrap small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 20;
  max-width: min(380px, calc(100vw - 40px));
  padding: 11px 14px;
  color: #ffffff;
  background: var(--deep);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  box-shadow: 0 14px 36px rgba(14, 39, 46, 0.25);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: minmax(370px, 1.1fr) minmax(270px, 0.76fr) minmax(
        330px,
        0.94fr
      );
    gap: 10px;
    padding: 10px;
  }

  .timer-panel {
    padding-right: 17px;
    padding-left: 17px;
  }

  .sound-panel {
    padding-right: 14px;
    padding-left: 14px;
  }

  .sound-track {
    grid-template-columns: 30px minmax(54px, auto) minmax(48px, 1fr) 30px;
    gap: 6px;
  }

  .chat-heading {
    padding-right: 14px;
    padding-left: 14px;
  }
}

@media (max-height: 760px) {
  .topbar {
    min-height: 62px;
    padding-top: 9px;
    padding-bottom: 9px;
  }

  .workspace {
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .timer-panel,
  .sound-panel {
    padding-top: 16px;
    padding-bottom: 13px;
  }

  .timer-stage {
    min-height: 230px;
  }

  .timer-ring {
    width: min(250px, 68%);
  }

  .timer-display,
  #timerDisplay {
    font-size: clamp(50px, 5.7vw, 68px);
  }

  .timer-footer {
    margin-top: 10px;
    padding-top: 10px;
  }
}

@media (max-width: 980px) {
  html,
  body {
    height: 100dvh;
    overscroll-behavior: none;
  }

  .topbar {
    min-height: 58px;
    padding:
      calc(7px + env(safe-area-inset-top))
      max(10px, env(safe-area-inset-right))
      7px
      max(10px, env(safe-area-inset-left));
  }

  .brand {
    gap: 8px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
  }

  .brand-mark svg {
    width: 20px;
    height: 20px;
  }

  .brand strong {
    font-size: 16px;
  }

  .brand small {
    display: none;
  }

  .topbar-actions {
    gap: 6px;
  }

  .room-button {
    min-width: 0;
    max-width: 142px;
    height: 36px;
    padding: 0 10px;
  }

  .room-button-label {
    display: none;
  }

  .room-button strong {
    max-width: 84px;
  }

  .connection-pill {
    max-width: 94px;
    height: 36px;
    padding: 0 9px;
    overflow: hidden;
  }

  .connection-pill span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .topbar-icon {
    width: 36px;
    height: 36px;
  }

  .workspace {
    display: block;
    min-height: 0;
    padding: 8px;
    overflow: hidden;
  }

  .panel {
    display: none;
    width: 100%;
    height: 100%;
    min-height: 0;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(21, 50, 58, 0.08);
  }

  body[data-mobile-view="timer"] .timer-panel {
    display: flex;
  }

  body[data-mobile-view="sound"] .sound-panel {
    display: flex;
  }

  body[data-mobile-view="chat"] .chat-panel {
    display: grid;
  }

  .timer-panel {
    padding: 15px 15px 13px;
    overflow-y: auto;
  }

  .timer-heading {
    margin-bottom: 10px;
  }

  .panel-heading h1,
  .panel-heading h2,
  .modal-header h2 {
    font-size: 18px;
  }

  .host-control-badge {
    min-height: 25px;
    padding: 0 7px;
  }

  .segmented-control {
    flex: 0 0 auto;
  }

  .segment {
    min-height: 40px;
  }

  .room-control-notice {
    flex: 0 0 auto;
  }

  .timer-stage {
    flex: 1 0 250px;
    min-height: 250px;
    margin: 0;
  }

  .timer-ring {
    width: min(270px, 78vw);
  }

  .timer-display,
  #timerDisplay {
    font-size: clamp(56px, 18vw, 74px);
  }

  .timer-controls {
    flex: 0 0 auto;
    gap: 10px;
  }

  .primary-action,
  .secondary-action {
    min-height: 46px;
  }

  .control-secondary {
    width: 46px;
    height: 46px;
  }

  .timer-footer {
    flex: 0 0 auto;
    align-items: flex-start;
    margin-top: 12px;
  }

  .switch-control {
    min-height: 34px;
  }

  .sound-panel {
    padding: 15px 14px calc(14px + env(safe-area-inset-bottom));
    overflow-y: auto;
  }

  .preset-button {
    min-height: 42px;
  }

  .sound-track {
    min-height: 56px;
    grid-template-columns: 36px minmax(64px, auto) minmax(70px, 1fr) 38px;
    gap: 8px;
  }

  .sound-symbol,
  .sound-toggle {
    width: 36px;
    height: 36px;
  }

  .volume-slider {
    height: 6px;
  }

  .volume-slider::-webkit-slider-thumb {
    width: 22px;
    height: 22px;
    border-width: 4px;
  }

  .master-volume {
    grid-template-columns: 20px auto minmax(90px, 1fr) 42px;
    min-height: 50px;
  }

  .chat-panel {
    grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  }

  .chat-heading {
    padding: 14px 14px 10px;
  }

  .participant-strip {
    min-height: 50px;
    padding: 7px 14px 9px;
  }

  .chat-notice {
    margin: 8px 12px 0;
  }

  .message-list {
    padding: 12px 12px 14px;
  }

  .chat-compose {
    grid-template-columns: minmax(0, 1fr) 46px;
    gap: 8px;
    padding: 9px 10px calc(9px + env(safe-area-inset-bottom));
  }

  .chat-compose input,
  .chat-compose .send-button {
    height: 46px;
  }

  .chat-compose input {
    font-size: 16px;
  }

  .mobile-nav {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    min-height: 58px;
    padding:
      5px
      max(8px, env(safe-area-inset-right))
      calc(5px + env(safe-area-inset-bottom))
      max(8px, env(safe-area-inset-left));
    background: var(--deep);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }

  .mobile-nav-button {
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 2px;
    min-width: 0;
    min-height: 48px;
    padding: 4px 6px;
    color: #a9c0c2;
    background: transparent;
    border: 0;
    border-radius: 7px;
    font-size: 11px;
  }

  .mobile-nav-button.is-active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.11);
  }

  .mobile-nav-button svg {
    width: 21px;
    height: 21px;
    stroke-width: 2.1;
  }

  .mobile-nav-icon-wrap {
    position: relative;
    display: inline-flex;
  }

  .mobile-chat-badge {
    position: absolute;
    top: -7px;
    right: -12px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    color: #ffffff;
    background: var(--coral);
    border: 2px solid var(--deep);
    border-radius: 999px;
    font-size: 9px;
    font-weight: 700;
    line-height: 13px;
    text-align: center;
  }

  .modal {
    width: calc(100vw - 20px);
    max-height: calc(100dvh - 20px);
    overflow-y: auto;
  }

  .modal form {
    padding: 20px 16px calc(18px + env(safe-area-inset-bottom));
  }

  .modal-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .modal-actions .primary-action,
  .modal-actions .secondary-action {
    width: 100%;
  }

  .duration-grid {
    grid-template-columns: 1fr;
  }

  .field input {
    font-size: 16px;
  }

  .toast {
    right: 10px;
    bottom: calc(72px + env(safe-area-inset-bottom));
    left: 10px;
    max-width: none;
    text-align: center;
  }
}

/* Fresh rain redesign
   Redesign - preserve: markup, information architecture and copy are untouched.
   Design read: quiet online study room for students, fresh rain language, leaning on
   native CSS glass over a live rain backdrop with a single cool teal accent.
   Dials: DESIGN_VARIANCE 3 / MOTION_INTENSITY 4 / VISUAL_DENSITY 5
   VARIANCE stays low on purpose: the timer has to be readable at a glance.

   Shape rule for this page: panels 12px, controls and fields 9px, status chips full pill.
   Colour rule: one accent (`--teal`). Amber appears only as a semantic warning on the
   public-channel notice. */

:root {
  color-scheme: light;
  --bg: #eaf2f5;
  --surface: #ffffff;
  --surface-soft: #eef5f7;
  --ink: #15323b;
  --muted: #4b616b;
  --line: #d6e4e9;
  --line-strong: #b3cad2;
  --deep: #14313a;
  --deep-soft: #1f4b57;
  --teal: #1b7183;
  --teal-strong: #145a68;
  --teal-soft: #dceff3;
  --coral: #1b7183;
  --coral-soft: #e3f1f4;
  --yellow: #1b7183;
  --yellow-soft: #e3f1f4;
  --warn: #7a5310;
  --warn-soft: #fbf2dd;
  --danger: #b0473a;
  --glass: rgba(253, 255, 255, 0.66);
  --shadow: 0 10px 28px rgba(31, 90, 105, 0.1);
  --radius: 12px;
  --radius-sm: 9px;
  --font-display:
    "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --font-ui:
    "Noto Sans SC", "PingFang SC", "Microsoft YaHei UI", "Segoe UI", sans-serif;
  --font-data:
    "Bahnschrift", "DIN Alternate", "Avenir Next Condensed", "Consolas",
    monospace;
}

body {
  color: var(--ink);
  background: linear-gradient(180deg, #f1f7f9 0%, #e6f0f4 46%, #dde9ee 100%);
  font-family: var(--font-ui);
}

/* Rain backdrop. A tiled field of soft vertical dashes is rotated with the layer and
   translated along its own axis, so the 240px loop is seamless and transform only. */
body::before {
  position: fixed;
  inset: -30% -18%;
  z-index: 0;
  background-image:
    radial-gradient(
      ellipse 2.2px 74px at 50% 50%,
      rgba(112, 154, 173, 0.58),
      rgba(112, 154, 173, 0) 72%
    ),
    radial-gradient(
      ellipse 1.6px 46px at 50% 50%,
      rgba(112, 154, 173, 0.42),
      rgba(112, 154, 173, 0) 74%
    ),
    radial-gradient(
      ellipse 2.6px 104px at 50% 50%,
      rgba(255, 255, 255, 0.7),
      rgba(255, 255, 255, 0) 76%
    );
  background-position: 0 0, 42px 96px, 104px 30px;
  background-repeat: repeat;
  background-size: 112px 240px, 74px 240px, 186px 240px;
  animation: rainfall 1.6s linear infinite;
  content: "";
  pointer-events: none;
  transform: rotate(11deg) translate3d(0, 0, 0);
  will-change: transform;
}

/* Mist wash: soft sky light and a faint vignette sitting between the rain and the app. */
body::after {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(
      110% 70% at 10% -8%,
      rgba(255, 255, 255, 0.7),
      rgba(255, 255, 255, 0) 62%
    ),
    radial-gradient(
      80% 55% at 95% 2%,
      rgba(208, 231, 240, 0.6),
      rgba(208, 231, 240, 0) 68%
    ),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(210, 229, 237, 0.3));
  content: "";
  pointer-events: none;
}

.app-shell {
  position: relative;
  z-index: 1;
}

@keyframes rainfall {
  from {
    transform: rotate(11deg) translate3d(0, -240px, 0);
  }
  to {
    transform: rotate(11deg) translate3d(0, 0, 0);
  }
}

/* A closer rain layer drifts in front of the glass so the weather reads even when the
   three panels fill the viewport. Opacity stays low to protect body-text contrast. */
html::after {
  position: fixed;
  inset: -30% -18%;
  z-index: 2;
  background-image: radial-gradient(
    ellipse 3px 120px at 50% 50%,
    rgba(94, 138, 160, 0.16),
    rgba(94, 138, 160, 0) 78%
  );
  background-position: 20px 10px;
  background-repeat: repeat;
  background-size: 168px 300px;
  animation: rainfall-near 1.05s linear infinite;
  content: "";
  pointer-events: none;
  transform: rotate(10deg);
  will-change: transform;
}

@keyframes rainfall-near {
  from {
    transform: rotate(10deg) translate3d(0, -300px, 0);
  }
  to {
    transform: rotate(10deg) translate3d(0, 0, 0);
  }
}

button:focus-visible,
input:focus-visible {
  outline: 2px solid rgba(31, 127, 146, 0.45);
  outline-offset: 3px;
}

.topbar {
  min-height: 64px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.6);
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  backdrop-filter: blur(10px) saturate(120%);
}

.brand-mark {
  color: var(--teal-strong);
  background: var(--teal-soft);
  border: 1px solid rgba(31, 127, 146, 0.24);
  border-radius: var(--radius-sm);
}

.brand strong,
.panel-heading h1,
.panel-heading h2,
.modal-header h2 {
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 700;
}

.brand strong {
  font-size: 21px;
  font-weight: 800;
}

.brand small {
  color: var(--muted);
  font-family: var(--font-data);
  font-size: 10px;
}

.room-button {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.7);
  border-color: var(--line);
}

.room-button:hover {
  background: #ffffff;
}

.room-button-label,
.room-button svg {
  color: var(--muted);
}

.connection-pill {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.7);
  border-color: var(--line);
}

.icon-button {
  color: var(--muted);
  border-color: transparent;
  border-radius: var(--radius-sm);
}

.icon-button:hover:not(:disabled) {
  color: var(--teal-strong);
  background: #ffffff;
  border-color: var(--line);
}

.topbar-icon {
  color: var(--muted);
  border-color: var(--line);
}

.topbar-icon:hover:not(:disabled) {
  color: var(--teal-strong);
  background: #ffffff;
  border-color: var(--teal);
}

.workspace {
  background: transparent;
}

.panel {
  background: var(--glass);
  background-image: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.58),
    rgba(255, 255, 255, 0.14)
  );
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius);
  box-shadow:
    var(--shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
  -webkit-backdrop-filter: blur(8px) saturate(118%);
  backdrop-filter: blur(8px) saturate(118%);
}

.panel-heading h1,
.panel-heading h2 {
  font-size: 22px;
  line-height: 1.15;
}

.host-control-badge {
  color: var(--teal-strong);
  background: var(--teal-soft);
  border-color: rgba(31, 127, 146, 0.32);
}

.room-control-notice {
  color: var(--muted);
  background: rgba(220, 239, 243, 0.72);
  border: 1px solid rgba(31, 127, 146, 0.16);
  border-left: 3px solid var(--teal);
  border-radius: var(--radius-sm);
}

.timer-panel,
.sound-panel,
.chat-panel {
  background: transparent;
}

.segmented-control {
  gap: 3px;
  padding: 3px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.segment {
  min-height: 34px;
  color: var(--muted);
  border-radius: 999px;
}

.segment:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.75);
}

.segment.is-active {
  color: #ffffff;
  background: var(--teal);
  box-shadow: 0 6px 16px rgba(31, 127, 146, 0.28);
}

.timer-stage::before {
  position: absolute;
  width: min(332px, 82%);
  aspect-ratio: 1;
  background: radial-gradient(
    circle at 50% 42%,
    rgba(255, 255, 255, 0.72),
    rgba(255, 255, 255, 0) 64%
  );
  border: 1px dashed rgba(31, 127, 146, 0.26);
  border-radius: 50%;
  content: "";
}

.timer-ring {
  position: relative;
  z-index: 1;
}

.timer-ring-track,
.timer-ring-progress {
  stroke-width: 8;
}

.timer-ring-track {
  stroke: rgba(179, 202, 210, 0.42);
}

.timer-ring-progress {
  stroke: var(--teal);
}

.timer-panel[data-mode="short"] .timer-ring-progress,
.timer-panel[data-mode="long"] .timer-ring-progress {
  stroke: var(--teal-strong);
}

.timer-face {
  z-index: 2;
}

.timer-mode-label {
  color: var(--teal-strong);
}

.timer-display,
#timerDisplay {
  color: var(--ink);
  font-family: var(--font-data);
  font-weight: 600;
}

.primary-action {
  color: #ffffff;
  background: var(--teal);
  border-color: var(--teal);
  box-shadow: 0 8px 18px rgba(31, 127, 146, 0.24);
}

.primary-action:hover:not(:disabled) {
  color: #ffffff;
  background: var(--teal-strong);
  border-color: var(--teal-strong);
}

.secondary-action,
.control-secondary {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  border-color: var(--line-strong);
}

.secondary-action:hover:not(:disabled),
.control-secondary:hover:not(:disabled) {
  color: var(--teal-strong);
  background: #ffffff;
  border-color: var(--teal);
}

.primary-action:active:not(:disabled),
.secondary-action:active:not(:disabled),
.control-secondary:active:not(:disabled),
.icon-button:active:not(:disabled),
.preset-button:active,
.sound-toggle:active {
  transform: translateY(1px);
}

.timer-footer {
  border-top-color: var(--line);
}

.stat-icon {
  color: var(--warn);
  background: var(--warn-soft);
  border: 1px solid #e7d3a6;
}

.switch-track {
  background: #c8d9df;
  border-radius: 999px;
}

.switch-track::after {
  border-radius: 50%;
}

.switch-control input:checked + .switch-track {
  background: var(--teal);
}

.room-audio-notice {
  color: var(--teal-strong);
  background: var(--teal-soft);
  border: 1px solid rgba(31, 127, 146, 0.2);
  border-radius: var(--radius-sm);
}

.room-audio-notice button {
  color: #ffffff;
  background: var(--teal);
  border-color: var(--teal);
  border-radius: var(--radius-sm);
}

.preset-strip {
  gap: 6px;
}

.preset-button {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.62);
  border-color: var(--line);
  border-radius: 999px;
}

.preset-button:hover,
.preset-button.is-active {
  color: #ffffff;
  background: var(--teal);
  border-color: var(--teal);
}

.sound-track {
  border-bottom-color: rgba(214, 228, 233, 0.9);
}

.sound-symbol {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.sound-track.is-active .sound-symbol {
  color: var(--teal-strong);
  background: var(--teal-soft);
  border-color: rgba(31, 127, 146, 0.35);
}

.volume-slider {
  background: #cfdfe4;
  border-radius: 999px;
}

.volume-slider::-webkit-slider-thumb {
  background: #ffffff;
  border: 3px solid var(--teal);
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(21, 60, 72, 0.22);
}

.sound-toggle {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.66);
  border-color: var(--line);
  border-radius: var(--radius-sm);
}

.sound-toggle[aria-pressed="true"] {
  color: #ffffff;
  background: var(--teal);
  border-color: var(--teal);
}

.master-volume {
  color: var(--muted);
  border-top-color: var(--line);
}

.online-count {
  color: var(--teal-strong);
  background: var(--teal-soft);
  border: 1px solid rgba(31, 127, 146, 0.2);
}

.participant-strip {
  border-bottom-color: var(--line);
}

.participant-placeholder {
  color: var(--muted);
}

.participant {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.66);
  border-color: var(--line);
}

.participant.is-host {
  background: var(--teal-soft);
  border-color: rgba(31, 127, 146, 0.35);
}

.participant-role {
  color: #ffffff;
  background: var(--teal);
  border-radius: 999px;
}

.participant-avatar,
.message-avatar {
  color: #ffffff;
  background: var(--teal);
}

.message.is-own .message-avatar {
  background: var(--deep-soft);
}

.message-author {
  color: var(--ink);
}

.message-time {
  color: var(--muted);
  font-family: var(--font-data);
}

.message-content {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  border-radius: 3px var(--radius-sm) var(--radius-sm) var(--radius-sm);
}

.message.is-own .message-content {
  color: #ffffff;
  background: var(--teal);
  border-color: var(--teal);
  border-radius: var(--radius-sm) 3px var(--radius-sm) var(--radius-sm);
}

.chat-notice {
  color: var(--warn);
  background: var(--warn-soft);
  border: 1px solid #e7d3a6;
  border-radius: var(--radius-sm);
}

.empty-chat {
  color: var(--muted);
}

.empty-chat > span {
  color: var(--teal-strong);
  background: var(--teal-soft);
  border: 1px solid rgba(31, 127, 146, 0.22);
  border-radius: 50%;
}

.empty-chat strong {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 16px;
}

.system-message {
  color: var(--muted);
}

.message-list {
  background: transparent;
}

.chat-compose {
  background: rgba(255, 255, 255, 0.6);
  border-top-color: var(--line);
}

.chat-compose input {
  color: var(--ink);
  background: #ffffff;
  border-color: var(--line);
}

.chat-compose input::placeholder,
.input-wrap input::placeholder {
  color: #647b85;
}

.send-button {
  color: #ffffff;
  background: var(--teal);
  border-color: var(--teal);
}

.send-button:hover:not(:disabled) {
  color: #ffffff;
  background: var(--teal-strong);
  border-color: var(--teal-strong);
}

.send-button:disabled {
  color: #8fa3aa;
  background: #e3ecef;
  border-color: #e3ecef;
}

.modal {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.93);
  border-color: rgba(255, 255, 255, 0.8);
  border-radius: var(--radius);
  box-shadow: 0 24px 70px rgba(18, 60, 72, 0.28);
  -webkit-backdrop-filter: blur(18px) saturate(120%);
  backdrop-filter: blur(18px) saturate(120%);
}

.modal::backdrop {
  background: rgba(20, 55, 66, 0.4);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.modal-mark {
  color: var(--teal-strong);
  background: var(--teal-soft);
  border: 1px solid rgba(31, 127, 146, 0.24);
  border-radius: var(--radius-sm);
}

.field {
  color: var(--muted);
}

.input-wrap {
  background: #f4f9fa;
  border-color: var(--line);
  border-radius: var(--radius-sm);
}

.input-wrap:focus-within {
  background: #ffffff;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(31, 127, 146, 0.14);
}

.input-wrap input {
  color: var(--ink);
}

.input-wrap > svg {
  color: var(--muted);
}

.field-help,
.suffix-wrap small {
  color: var(--muted);
}

.toast {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(31, 127, 146, 0.3);
  border-radius: var(--radius-sm);
  box-shadow: 0 14px 36px rgba(18, 60, 72, 0.2);
  font-weight: 700;
}

.mobile-nav {
  background: rgba(255, 255, 255, 0.7);
  border-top-color: var(--line);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.mobile-nav-button {
  color: var(--muted);
  border-radius: var(--radius-sm);
}

.mobile-nav-button.is-active {
  color: var(--teal-strong);
  background: var(--teal-soft);
}

.mobile-chat-badge {
  color: #ffffff;
  background: var(--teal);
  border-color: rgba(255, 255, 255, 0.9);
  border-radius: 999px;
}

@supports not (
  (backdrop-filter: blur(2px)) or (-webkit-backdrop-filter: blur(2px))
) {
  .panel,
  .topbar,
  .modal,
  .mobile-nav {
    background: rgba(255, 255, 255, 0.96);
  }
}

@media (min-width: 981px) and (max-width: 1180px) {
  .workspace {
    grid-template-columns:
      minmax(340px, 1.12fr) minmax(252px, 0.78fr) minmax(302px, 0.94fr);
    gap: 8px;
    padding: 8px;
  }
}

@media (max-width: 980px) {
  .workspace {
    gap: 0;
    padding: 8px;
  }

  .panel {
    border-radius: var(--radius-sm);
  }

  .timer-stage::before {
    width: min(300px, 80vw);
  }

  .mobile-nav {
    gap: 0;
    padding:
      0
      env(safe-area-inset-right)
      env(safe-area-inset-bottom)
      env(safe-area-inset-left);
  }

  .mobile-nav-button {
    min-height: 58px;
    border-right: 1px solid var(--line);
    border-radius: 0;
  }

  .mobile-nav-button:last-child {
    border-right: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  body::before {
    animation: none;
  }

  html::after {
    animation: none;
  }
}

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