.field-group {
    min-width: 0;
    margin-top: 18px;
  }
  
  input,
  textarea,
  select {
    width: 100%;
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--md-sys-shape-corner-medium);
    background: var(--md-sys-color-surface);
    color: var(--md-sys-color-on-surface);
    font: inherit;
    font-size: 0.9375rem;
    padding: 14px 16px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
  }
  
  input,
  select {
    min-height: 52px;
  }

  select {
    appearance: auto;
    cursor: pointer;
  }
  
  textarea {
    min-height: 96px;
    resize: vertical;
    line-height: 1.6;
  }
  
  input:focus,
  textarea:focus,
  select:focus {
    border-color: var(--md-sys-color-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--md-sys-color-primary) 22%, transparent);
  }
  
  .room-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
  }
  
  .status-pill {
    display: inline-block;
    margin: 0 0 10px;
    padding: 5px 12px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--success) 12%, var(--md-sys-color-surface));
    color: var(--success);
    font-size: 0.8125rem;
    font-weight: 700;
  }
  
  .status-pill.is-finished {
    background: var(--danger-container);
    color: var(--danger);
  }
  
  .btn--finish {
    background: var(--danger);
    color: #fff;
    border: 1px solid var(--danger);
  }
  
  .room-title {
    margin: 0;
    color: var(--md-sys-color-on-surface);
    font-size: clamp(1.2rem, 4vw, 1.6rem);
    font-weight: 700;
    line-height: 1.45;
    overflow-wrap: anywhere;
  }
  
  .expire-text {
    margin: 8px 0 0;
    color: var(--md-sys-color-on-surface-variant);
    font-size: 0.875rem;
  }
  
  .qr-preview {
    margin-top: 16px;
    padding: 18px;
    border-radius: var(--md-sys-shape-corner-large);
    background: var(--md-sys-color-surface);
    border: 1px solid var(--md-sys-color-outline-variant);
    text-align: center;
  }
  
  .admin-qr-preview {
    margin-top: 20px;
  }
  
  #admin-qr-code {
    display: flex;
    justify-content: center;
    margin: 0 auto 12px;
  }
  
  #admin-qr-code img,
  #admin-qr-code canvas {
    display: block;
    width: 220px;
    height: 220px;
    max-width: 100%;
  }
  
  .qr-preview p {
    margin: 0;
    color: var(--md-sys-color-on-surface-variant);
    font-size: 0.875rem;
  }
  
  .qr-actions {
    justify-content: center;
    margin-top: 14px;
  }
  
  .join-area,
  .new-room-area {
    margin-top: 18px;
    padding: 16px;
    border-radius: var(--md-sys-shape-corner-large);
    background: var(--md-sys-color-surface);
    border: 1px solid var(--md-sys-color-outline-variant);
  }
  
  .new-room-area h3 {
    margin: 0 0 6px;
    color: var(--md-sys-color-on-surface);
    font-size: 1rem;
  }
  
  .new-room-area p {
    margin: 0;
    color: var(--md-sys-color-on-surface-variant);
    font-size: 0.875rem;
    line-height: 1.6;
  }
  
  .chat-area {
    display: grid;
    gap: 16px;
    margin-top: 20px;
  }
  
  .chat-panel,
  .participants-panel {
    min-width: 0;
    padding: 16px;
    border-radius: var(--md-sys-shape-corner-large);
    background: var(--md-sys-color-surface);
    border: 1px solid var(--md-sys-color-outline-variant);
  }
  
  .chat-panel {
    display: grid;
    grid-template-rows: minmax(320px, 52vh) auto;
    gap: 14px;
  }
  
  .message-list {
    min-height: 320px;
    max-height: 52vh;
    overflow-y: auto;
    padding: 18px;
    border-radius: var(--md-sys-shape-corner-medium);
    background: color-mix(in srgb, var(--md-sys-color-primary-container) 34%, var(--md-sys-color-surface));
    border: 1px solid var(--md-sys-color-outline-variant);
  }
  
  .chat-message {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin: 10px 0;
  }
  
  .chat-message.is-mine {
    align-items: flex-end;
  }
  
  .chat-message.is-other {
    align-items: flex-start;
  }
  
  .chat-message__meta {
    display: flex;
    align-items: center;
    gap: 6px;
    max-width: min(74%, 560px);
    color: var(--md-sys-color-on-surface-variant);
    font-size: 0.75rem;
  }
  
  .chat-message.is-mine .chat-message__meta {
    justify-content: flex-end;
    text-align: right;
  }
  
  .chat-message.is-other .chat-message__meta {
    justify-content: flex-start;
    text-align: left;
  }
  
  .chat-message__name {
    font-weight: 700;
    color: var(--md-sys-color-on-surface);
    overflow-wrap: anywhere;
  }
  
  .chat-message__admin {
    padding: 0;
    background: transparent;
    color: inherit;
    font-size: 0.9rem;
    line-height: 1;
  }
  
  .chat-message__bubble {
    position: relative;
    max-width: min(74%, 560px);
    padding: 10px 14px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  }
  
  .chat-message.is-mine .chat-message__bubble {
    margin-left: auto;
    border-radius: 18px 18px 4px 18px;
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
  }
  
  .chat-message.is-other .chat-message__bubble {
    margin-right: auto;
    border-radius: 18px 18px 18px 4px;
    background: var(--md-sys-color-surface);
    color: var(--md-sys-color-on-surface);
    border: 1px solid var(--md-sys-color-outline-variant);
  }
  
  .chat-message.is-mine .chat-message__bubble::after {
    content: "";
    position: absolute;
    right: -5px;
    bottom: 2px;
    width: 10px;
    height: 10px;
    background: var(--md-sys-color-primary);
    clip-path: polygon(0 0, 100% 100%, 0 100%);
  }
  
  .chat-message.is-other .chat-message__bubble::after {
    content: "";
    position: absolute;
    left: -5px;
    bottom: 2px;
    width: 10px;
    height: 10px;
    background: var(--md-sys-color-surface);
    border-left: 1px solid var(--md-sys-color-outline-variant);
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
    clip-path: polygon(100% 0, 100% 100%, 0 100%);
  }
  
  .chat-message__text {
    margin: 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    line-height: 1.65;
    font-size: 0.9375rem;
  }
  
  .message-form {
    display: grid;
    gap: 10px;
  }
  
  .message-form__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }
  
  .message-count {
    color: var(--md-sys-color-on-surface-variant);
    font-size: 0.8125rem;
  }
  
  .participants-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
  }
  
  .participants-panel__header h3 {
    margin: 0;
    color: var(--md-sys-color-on-surface);
    font-size: 1rem;
    letter-spacing: 0.02em;
  }
  
  .participants-count {
    color: var(--md-sys-color-on-surface);
    font-size: 1rem;
    font-weight: 700;
  }
  
  .participants-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
  }
  
  .participant-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    padding: 7px 10px;
    border-radius: 999px;
    background: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
    font-size: 0.8125rem;
    font-weight: 700;
    overflow-wrap: anywhere;
  }
  
  .participant-chip__admin {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    border-radius: 999px;
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 1.2;
  }
  
  .empty-message {
    margin: 0;
    color: var(--md-sys-color-on-surface-variant);
    font-size: 0.875rem;
    text-align: center;
  }
  
  @media (max-width: 760px) {
    .chat-panel {
      grid-template-rows: minmax(300px, 52vh) auto;
    }
  
    .message-list {
      min-height: 300px;
    }
  
    .chat-message__bubble,
    .chat-message__meta {
      max-width: 86%;
    }
  }
  
  @media (max-width: 600px) {
    input,
    textarea,
    select {
      padding: 12px 10px;
      font-size: 0.875rem;
    }
  
    input,
    select {
      min-height: 48px;
    }
  
    .room-header {
      display: block;
    }
  
    .room-header .btn {
      margin-top: 14px;
      width: 100%;
    }
  
    .qr-actions .btn,
    .new-room-area .btn {
      width: 100%;
    }
  
    .message-form__footer {
      display: grid;
      gap: 10px;
    }
  
    .message-form__footer .btn {
      width: 100%;
    }
  
    .chat-message__bubble,
    .chat-message__meta {
      max-width: 92%;
    }
  }