@font-face {
  font-family: 'HeirOfLight';
  src: url('/font/HeirofLight.ttf') format('truetype');
  font-display: swap;
}

@font-face {
  font-family: 'EliceDigitalBaeum';
  src: url('/font/EliceDigitalBaeum_Regular.ttf') format('truetype');
  font-display: swap;
}

@font-face {
  font-family: 'HakgyoansimChulseokbuB';
  src: url('/font/Hakgyoansim Chulseokbu TTF B.ttf') format('truetype');
  font-display: swap;
}

@font-face {
  font-family: 'HakgyoansimWoojuR';
  src: url('/font/HakgyoansimWoojuR.ttf') format('truetype');
  font-display: swap;
}

@font-face {
  font-family: 'JHaebaragi';
  src: url('/font/J해바라기-Medium.ttf') format('truetype');
  font-display: swap;
}

@font-face {
  font-family: 'Orbit';
  src: url('/font/Orbit-Regular.ttf') format('truetype');
  font-display: swap;
}

@font-face {
  font-family: 'Paperlogy5Medium';
  src: url('/font/Paperlogy-5Medium.ttf') format('truetype');
  font-display: swap;
}

@font-face {
  font-family: 'Paperlogy8ExtraBold';
  src: url('/font/Paperlogy-8ExtraBold.ttf') format('truetype');
  font-display: swap;
}

:root {
  --bg-color: #0f172a;
  --panel-color: #1e293b;
  --accent-color: #38bdf8;
  --text-color: #e2e8f0;
  --muted-color: #94a3b8;
  --danger-color: #f87171;
  --success-color: #34d399;
  --app-font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  --bell-icon-on: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23facc15' d='M16 8a4 4 0 1 0-8 0v2.418c0 .894-.316 1.76-.894 2.44l-1.513 1.816A1 1 0 0 0 6.41 16H9a3 3 0 0 0 6 0h2.59a1 1 0 0 0 .817-1.326l-1.513-1.816A4.002 4.002 0 0 1 16 10.418V8Zm-4 11a1.5 1.5 0 0 1-1.493-1.355L10.5 17h3a1.5 1.5 0 0 1-1.355 1.493L12 18Z'/%3E%3C/svg%3E");
  --bell-icon-off: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23475569' d='M16 8a4 4 0 1 0-8 0v2.418c0 .894-.316 1.76-.894 2.44l-1.513 1.816A1 1 0 0 0 6.41 16H9a3 3 0 0 0 6 0h2.59a1 1 0 0 0 .817-1.326l-1.513-1.816A4.002 4.002 0 0 1 16 10.418V8Zm-4 11a1.5 1.5 0 0 1-1.493-1.355L10.5 17h3a1.5 1.5 0 0 1-1.355 1.493L12 18Z'/%3E%3C/svg%3E");
  font-family: var(--app-font-family);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg-color);
  color: var(--text-color);
  min-height: 100vh;
  overflow-y: auto;
  font-family: var(--app-font-family);
}

body[data-font='heiroflight'] {
  --app-font-family: 'HeirOfLight', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body[data-font='elicedigitalbaeum'] {
  --app-font-family: 'EliceDigitalBaeum', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body[data-font='hakgyoansim-chulseokbu'] {
  --app-font-family: 'HakgyoansimChulseokbuB', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body[data-font='hakgyoansim-wooju'] {
  --app-font-family: 'HakgyoansimWoojuR', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body[data-font='jhaebaragi'] {
  --app-font-family: 'JHaebaragi', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body[data-font='orbit'] {
  --app-font-family: 'Orbit', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body[data-font='paperlogy-medium'] {
  --app-font-family: 'Paperlogy5Medium', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body[data-font='paperlogy-extrabold'] {
  --app-font-family: 'Paperlogy8ExtraBold', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body[data-font='system'],
body:not([data-font]) {
  --app-font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.app-header h1 {
  margin: 0;
  font-size: 1.5rem;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-switches {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: nowrap;
  white-space: nowrap;
}
.header-switches__divider {
  color: rgba(148, 163, 184, 0.65);
  font-weight: 600;
  font-size: 1.1rem;
}

.app-title-button {
  margin: 0;
}

.app-title-button button {
  font: inherit;
  font-size: 1.5rem;
  font-weight: 700;
}

.app-title-button .header-toggle {
  font-size: 1.5rem;
  font-weight: 700;
  padding: 0.35rem 1.1rem;
}

.header-toggle--icon {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  font-size: 1rem;
  min-width: 0;
}

.header-toggle--icon span {
  font-size: 1.05rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.lct-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: rgba(239, 68, 68, 0.18);
  color: rgba(248, 113, 113, 0.95);
  border: 1px solid rgba(248, 113, 113, 0.4);
  min-width: 82px;
  text-align: center;
}

.lct-status--connected {
  background: rgba(34, 197, 94, 0.18);
  color: rgba(74, 222, 128, 0.95);
  border-color: rgba(74, 222, 128, 0.45);
}

.lct-status--loading {
  background: rgba(59, 130, 246, 0.2);
  color: rgba(191, 219, 254, 0.95);
  border-color: rgba(147, 197, 253, 0.45);
}


.app-title-button button {
  display: flex;
  align-items: center;
  white-space: nowrap;
  min-width: 140px;
  text-align: right;
}

.user-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
  min-width: 140px;
  text-align: right;
  color: var(--muted-color);
}

.user-info__line {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.user-info__line--name {
  font-weight: 600;
  color: var(--text-color);
}

.user-info__line--level {
  font-size: 0.8rem;
}

.user-info__nickname {
  display: inline-flex;
  align-items: baseline;
  gap: 0.2rem;
}

.user-info__tail {
  color: rgba(148, 163, 184, 0.85);
  font-weight: 500;
  font-size: 0.85rem;
}

.user-info__char {
  font-size: 0.7rem;
  color: var(--muted-color);
  background: rgba(148, 163, 184, 0.2);
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
}

.user-info__placeholder {
  font-size: 0.85rem;
}

.header-button {
  background: rgba(56, 189, 248, 0.2);
  color: var(--text-color);
  padding: 0.55rem 1rem;
  border-radius: 999px;
  min-width: 120px;
  white-space: nowrap;
  text-align: center;
}

.header-button:hover {
  box-shadow: 0 10px 18px rgba(56, 189, 248, 0.25);
}


.list li.room-admin {
  border-left: 4px solid rgba(56, 189, 248, 0.45);
}

.list li.room-admin.room-has-unread {
  border-color: rgba(248, 113, 113, 0.75);
}

.list li.room-admin .room-actions {
  gap: 0.3rem;
}

.list li.room-admin .badge {
  background: rgba(248, 113, 113, 0.92);
  color: #fff;
}

.room-admin-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(148, 163, 184, 0.75);
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem;
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 0;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.icon-button::before {
  content: '';
  display: block;
  width: 24px;
  height: 24px;
  background-image: var(--bell-icon-on);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.icon-button.off::before {
  background-image: var(--bell-icon-off);
}

.icon-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.icon-button:active {
  transform: translateY(0);
  filter: brightness(0.95);
}

.icon-button:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

.icon-button.off {
  opacity: 0.75;
}

.icon-button.on {
  opacity: 1;
}

.app-body {
  flex: 1 1 auto;
  display: flex;
  padding: 1rem;
  min-height: 0;
  height: auto;
  width: 100%;
  overflow: visible;
}

@media (min-width: 961px) {
  body.view-messenger {
    height: 100vh;
    overflow: hidden;
  }

  body.view-messenger #app {
    height: 100%;
  }

  body.view-messenger .app-body {
    height: 100%;
    overflow: hidden;
  }

  body.view-messenger .messenger {
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  body.view-messenger .sidebar,
  body.view-messenger .chat-pane {
    height: 100%;
    min-height: 0;
  }

  body.view-messenger .chat-pane {
    overflow: hidden;
  }

  body.view-board.board-editor-active {
    height: 100vh;
    overflow: hidden;
  }

  body.view-board.board-editor-active #app {
    height: 100%;
  }

  .admin-console {
    width: 100%;
  }

  .admin-console__layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 1rem;
    width: 100%;
    min-height: 60vh;
  }

  .admin-console__sidebar {
    background: rgba(30, 41, 59, 0.75);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 16px;
    padding: 1rem;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
  }

  .admin-console__sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
  }

  .admin-console__sidebar-header h3 {
    margin: 0;
    font-size: 1.05rem;
  }

  .admin-console__nav {
    margin-top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  .admin-console__nav-btn {
    width: 100%;
    text-align: left;
    padding: 0.65rem 0.8rem;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: rgba(15, 23, 42, 0.55);
    color: var(--text-color);
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.15s ease;
  }

  .admin-console__nav-btn:hover,
  .admin-console__nav-btn:focus-visible {
    border-color: rgba(56, 189, 248, 0.65);
    outline: none;
    transform: translateY(-1px);
  }

  .admin-console__nav-btn--active {
    border-color: rgba(56, 189, 248, 0.9);
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.18), rgba(56, 189, 248, 0.08));
    box-shadow: 0 14px 28px rgba(56, 189, 248, 0.16);
  }

  .admin-console__content {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 16px;
    padding: 1.25rem;
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.32);
  }

  .admin-popup__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
  }

  .admin-popup__meta {
    color: var(--muted-color);
    font-size: 0.95rem;
    min-height: 1.2em;
  }

  .admin-popup__list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  .admin-popup__empty {
    color: var(--muted-color);
  }

  .admin-popup__error {
    color: var(--danger-color);
    font-weight: 600;
  }

  .admin-popup-card {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.94));
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 16px;
    padding: 1rem;
    box-shadow: 0 16px 42px rgba(0, 0, 0, 0.35);
  }

  .admin-popup-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
  }

  .admin-popup-card__title-row {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex: 1 1 auto;
  }

  .admin-popup-card__title-row label {
    color: var(--muted-color);
    font-size: 0.9rem;
  }

  .admin-popup-card__title-input {
    width: 100%;
    padding: 0.55rem 0.65rem;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(15, 23, 42, 0.65);
    color: var(--text-color);
  }

  .admin-popup-card__title-input:focus-visible {
    outline: 2px solid rgba(56, 189, 248, 0.8);
    border-color: rgba(56, 189, 248, 0.8);
  }

  .admin-popup-card__actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  .admin-popup-card__switch {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--muted-color);
    font-size: 0.9rem;
  }

  .admin-popup-card__switch input {
    accent-color: var(--accent-color);
  }

  .admin-popup-card textarea {
    width: 100%;
    min-height: 120px;
    padding: 0.65rem 0.75rem;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: rgba(15, 23, 42, 0.65);
    color: var(--text-color);
    resize: vertical;
  }

  .admin-popup-card textarea:focus-visible {
    outline: 2px solid rgba(56, 189, 248, 0.8);
    border-color: rgba(56, 189, 248, 0.8);
  }

  .admin-popup-card__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 0.75rem;
    margin-top: 0.75rem;
  }

  .admin-popup-card__grid label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    color: var(--muted-color);
    font-size: 0.92rem;
  }

  .admin-popup-card__grid input {
    width: 100%;
    padding: 0.55rem 0.6rem;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(15, 23, 42, 0.65);
    color: var(--text-color);
  }

  .admin-popup-card__grid input:focus-visible {
    outline: 2px solid rgba(56, 189, 248, 0.8);
    border-color: rgba(56, 189, 248, 0.8);
  }

  .admin-popup-card__footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.85rem;
  }

  .admin-popup-card__hint {
    margin-top: 0.5rem;
    color: var(--muted-color);
    font-size: 0.9rem;
  }

  .admin-popup-card__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: rgba(56, 189, 248, 0.18);
    color: rgba(125, 211, 252, 0.95);
    border: 1px solid rgba(56, 189, 248, 0.45);
  }

  .admin-popup-card__badge--off {
    background: rgba(148, 163, 184, 0.18);
    color: rgba(148, 163, 184, 0.9);
    border-color: rgba(148, 163, 184, 0.4);
  }

  .popup-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1400;
  }

  .popup-overlay:not(.hidden) {
    display: flex;
  }

  .popup-overlay__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
  }

  .popup-overlay__stack {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: min(720px, 92vw);
  }

  .popup-card {
    position: relative;
    background: linear-gradient(160deg, rgba(30, 41, 59, 0.94), rgba(15, 23, 42, 0.96));
    border: 1px solid rgba(56, 189, 248, 0.35);
    border-radius: 18px;
    padding: 1.2rem 1.25rem 1.1rem;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  }

  .popup-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
  }

  .popup-card__title {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 700;
    font-size: 1.15rem;
  }

  .popup-card__icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #38bdf8, #6366f1);
    color: #0b132b;
    box-shadow: 0 10px 24px rgba(56, 189, 248, 0.25);
  }

  .popup-card__close {
    background: linear-gradient(135deg, rgba(248, 113, 113, 0.9), rgba(239, 68, 68, 0.9));
    border: none;
    color: #0b132b;
    border-radius: 12px;
    width: 36px;
    height: 36px;
    cursor: pointer;
    display: grid;
    place-items: center;
    box-shadow: 0 10px 24px rgba(239, 68, 68, 0.35);
    font-weight: 800;
    font-size: 1rem;
    line-height: 1;
    padding: 0;
  }

  .popup-card__close:hover,
  .popup-card__close:focus-visible {
    filter: brightness(1.05);
    color: #0b132b;
    outline: none;
  }

  .popup-card__body {
    margin-top: 0.75rem;
    color: var(--text-color);
    line-height: 1.6;
    font-size: 1rem;
    text-align: center;
  }

  .popup-card__meta {
    margin-top: 0.65rem;
    color: var(--muted-color);
    font-size: 0.9rem;
  }

  .popup-card__counter {
    margin-top: 0.4rem;
    color: var(--muted-color);
    font-size: 0.9rem;
    text-align: center;
  }

  @media (max-width: 900px) {
    .admin-console__layout {
      grid-template-columns: 1fr;
    }

    .admin-console__sidebar {
      order: 2;
    }

    .admin-console__content {
      order: 1;
    }
  }

  body.view-board.board-editor-active .app-body {
    height: 100%;
    overflow: hidden;
  }

  body.view-board.board-editor-active .board {
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  body.view-board.board-editor-active .board-pane {
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  body.view-board.board-editor-active .board-content {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  body.view-board.board-editor-active #board-editor {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  body.view-board.board-editor-active .board-editor__content {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
  }
}

.auth-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

.main-landing {
  flex: 1 1 auto;
  width: 100%;
  max-width: 1040px;
  margin: 0 auto 1.5rem;
  padding: 0 1rem;
  overflow-y: auto;
}

.main-landing__inner {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.95));
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 24px;
  padding: 2.5rem;
  box-shadow: 0 25px 60px rgba(2, 6, 23, 0.45);
}

.main-landing__header {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 1rem;
  margin-bottom: 1rem;
}

.main-landing__eyebrow {
  letter-spacing: 0.4em;
  font-size: 0.75rem;
  color: rgba(148, 163, 184, 0.75);
  margin: 0 0 0.4rem;
}

.main-landing__title {
  font-size: clamp(2rem, 3vw, 2.75rem);
  margin: 0;
}

.main-landing__edit {
  align-self: flex-start;
  white-space: nowrap;
}

.main-landing__meta {
  margin: 1rem 0 1.5rem;
  color: rgba(148, 163, 184, 0.85);
  font-size: 0.95rem;
  min-height: 1.2rem;
}

.main-landing__permission {
  margin: -0.5rem 0 1.5rem;
  color: rgba(148, 163, 184, 0.75);
  font-size: 0.85rem;
  min-height: 1rem;
}

.main-landing__meta--error {
  color: var(--danger-color);
}

.main-landing__content {
  min-height: 300px;
  border-radius: 16px;
  padding: 1.5rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.18);
  line-height: 1.7;
}

.main-landing__placeholder {
  margin: 0;
  color: rgba(148, 163, 184, 0.9);
}

.main-landing__content h1,
.main-landing__content h2,
.main-landing__content h3,
.main-landing__content h4 {
  color: var(--text-color);
}

.main-landing__content p {
  margin: 0 0 1rem;
  color: rgba(226, 232, 240, 0.95);
}

.main-landing__content img {
  max-width: 100%;
  border-radius: 12px;
  margin: 1rem 0;
}

.main-landing__content:empty::after {
  content: '첫 페이지가 준비 중입니다.';
  color: rgba(148, 163, 184, 0.9);
}

.panel {
  background: var(--panel-color);
  padding: 1.5rem;
  border-radius: 1rem;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.4);
}

.panel h2 {
  margin: 0 0 1rem;
}

form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.sidebar-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.badge--pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.75rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
}
.badge--yellow {
  background-color: #fef08a;
  color: #854d0e;
  border: 1px solid #f59e0b;
}
label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.9rem;
}

input,
textarea,
button,
select {
  border-radius: 0.75rem;
  border: none;
  padding: 0.75rem 1rem;
  font-size: 1rem;
}

input,
textarea,
select {
  background: rgba(15, 23, 42, 0.7);
  color: var(--text-color);
  border: 1px solid rgba(148, 163, 184, 0.25);
}

button {
  cursor: pointer;
  background: var(--accent-color);
  color: #0f172a;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(56, 189, 248, 0.3);
}

button:focus-visible {
  outline: 2px solid rgba(56, 189, 248, 0.6);
  outline-offset: 2px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  box-shadow: none;
}

button.danger {
  background: var(--danger-color);
  color: #fff;
}

button.secondary {
  background: rgba(148, 163, 184, 0.2);
  color: var(--text-color);
}

.header-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.3rem;
  padding: 0.45rem 1.2rem;
  background: rgba(15, 23, 42, 0.55);
  color: var(--text-color);
  font-weight: 600;
  font-size: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.4);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.35), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  backdrop-filter: blur(10px);
  color: #e4f1ff;
}

.header-toggle:hover,
.header-toggle:focus-visible {
  background: rgba(30, 41, 59, 0.65);
  border-color: rgba(148, 163, 184, 0.55);
  transform: translateY(-1px);
  outline: none;
  box-shadow: 0 14px 32px rgba(30, 41, 59, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.header-toggle--active {
  background: rgba(56, 189, 248, 0.28);
  border-color: rgba(56, 189, 248, 0.65);
  color: #fff;
  box-shadow: 0 16px 32px rgba(14, 165, 233, 0.35), inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.header-toggle:disabled {
  opacity: 0.6;
  pointer-events: none;
  transform: none;
  box-shadow: none;
}

.hidden {
  display: none !important;
}

.messenger {
  display: flex;
  gap: 1rem;
  width: 100%;
  min-height: 0;
  flex: 1 1 auto;
  overflow: hidden;
  align-items: stretch;
}

.board {
  display: flex;
  gap: 1rem;
  width: 100%;
  flex: 1 1 auto;
  overflow: visible;
  align-items: flex-start;
}

.board-sidebar {
  flex: 0 0 clamp(260px, 26vw, 340px);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
  background: var(--panel-color);
  border-radius: 1rem;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.45);
  height: 100%;
  min-height: 0;
  overflow-y: auto;
}

.board-sidebar__divider {
  height: 1px;
  background: linear-gradient(90deg, rgba(148, 163, 184, 0), rgba(148, 163, 184, 0.45), rgba(148, 163, 184, 0));
  margin: 0.25rem 0 0.5rem;
}

.board-sidebar__header h3 {
  margin: 0;
  font-size: 1.1rem;
}

.board-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.board-list-home-item {
  display: flex;
}

.board-list > .board-list-home-item {
  padding: 0;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  flex-direction: row;
  gap: 0;
  flex: 0 0 auto;
  width: 100%;
  align-items: stretch;
}


.board-list-home {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.65rem 0.9rem;
  border-radius: 0.85rem;
  border: 1px solid rgba(250, 204, 21, 0.65);
  background: transparent;
  color: rgba(250, 204, 21, 0.92);
  font: inherit;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
  box-shadow: none;
}

.board-list-home:hover,
.board-list-home:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(250, 204, 21, 0.85);
  background: rgba(250, 204, 21, 0.18);
}

.board-list-home.is-active {
  border-color: rgba(250, 204, 21, 0.95);
  background: rgba(250, 204, 21, 0.22);
  box-shadow: 0 10px 24px rgba(250, 204, 21, 0.2);
}

.board-list-home__label {
  font-size: 0.95rem;
  font-weight: 700;
}

.board-list-entry {
  border-radius: 0.9rem;
  border: 1px solid transparent;
  background: rgba(15, 23, 42, 0.55);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.board-list-entry:hover {
  transform: translateY(-1px);
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.12);
}

.board-list-entry.is-active {
  border-color: rgba(56, 189, 248, 0.45);
  background: rgba(56, 189, 248, 0.18);
  box-shadow: 0 12px 28px rgba(56, 189, 248, 0.18);
}

.board-list-entry:focus-visible {
  outline: 2px solid rgba(56, 189, 248, 0.6);
  outline-offset: 2px;
}

.board-list-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.65rem 0.85rem;
}

.board-list-item__icon {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  color: rgba(226, 232, 240, 0.95);
}

.board-list-entry.is-active .board-list-item__icon {
  color: #fff;
}

.board-list-item__info {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.board-list-item__title {
  font-weight: 600;
  font-size: 0.95rem;
  color: rgba(226, 232, 240, 0.95);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.board-list-item__title.is-active {
  color: #fff;
}

.board-list-item__description {
  font-size: 0.8rem;
  color: rgba(148, 163, 184, 0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.board-list-item__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
  margin-left: auto;
}

.board-list-item__meta.board-list-item__meta--empty {
  display: none;
}

.board-list-item__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.25);
  color: rgba(226, 232, 240, 0.88);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
}

.board-list-empty {
  padding: 0.85rem;
  border-radius: 0.8rem;
  background: rgba(15, 23, 42, 0.35);
  text-align: center;
  color: var(--muted-color);
  font-size: 0.9rem;
}

.board-create {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: auto;
}

.board-create__controls {
  display: flex;
  gap: 0.5rem;
}

.board-create__controls input {
  flex: 1 1 auto;
}

.board-pane {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

.board-pane__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.board-pane__title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.board-pane__header h2 {
  margin: 0;
  font-size: 1.25rem;
}

.board-pane__actions {
  display: flex;
  gap: 0.5rem;
}

.board-access-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(30, 41, 59, 0.6);
  color: #e2e8f0;
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.board-access-button:hover,
.board-access-button:focus-visible {
  background: rgba(56, 189, 248, 0.25);
  border-color: rgba(56, 189, 248, 0.65);
  color: #f8fafc;
}

.board-access-button:focus-visible {
  outline: 2px solid rgba(56, 189, 248, 0.55);
  outline-offset: 2px;
}

.board-toolbar {
  display: flex;
  padding: 0.75rem 1rem;
  background: rgba(15, 23, 42, 0.45);
  border-radius: 1rem;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.35);
}

.board-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  flex-wrap: nowrap;
}

.board-search input {
  flex: 1 1 auto;
  padding: 0.5rem 0.8rem;
  height: 2.5rem;
  box-sizing: border-box;
}

.board-search button {
  min-width: 72px;
  flex: 0 0 auto;
  white-space: nowrap;
  height: 2.5rem;
  padding: 0 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.board-content {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
  width: 100%;
}

.board-home {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
  background: rgba(15, 23, 42, 0.45);
  border-radius: 1rem;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.35);
  min-height: auto;
  position: relative;
}

.board-home__edit {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  z-index: 2;
}

.board-home__meta {
  margin: 0 4.5rem 0.75rem 0;
  font-size: 0.85rem;
  color: var(--muted-color);
  min-height: 1rem;
}

.board-home__meta--error {
  color: var(--danger-color);
}

.board-home--editable .board-home__content {
  padding-top: 2.5rem;
}

.board-home__content {
  flex: 0 0 auto;
  min-height: 0;
  overflow: visible;
  line-height: 1.65;
  font-size: 0.97rem;
}

.board-home__content p {
  margin: 0 0 1rem;
}

.board-home__content img {
  max-width: 100%;
  height: auto;
  border-radius: 0.75rem;
  margin: 0.75rem 0;
}

.board-home__empty {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--muted-color);
  font-size: 0.95rem;
}

.board-home__hint {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 0.9rem;
  background: rgba(56, 189, 248, 0.12);
  color: rgba(226, 232, 240, 0.9);
  font-size: 0.9rem;
}

#board-list-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

.board-post-list {
  width: 100%;
  overflow: visible;
  background: rgba(15, 23, 42, 0.45);
  border-radius: 1rem;
  padding: 0.25rem 0;
}

.board-posts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.board-posts__item {
  padding: 0.25rem 0.75rem;
  display: flex;
}

.board-posts__item + .board-posts__item {
  border-top: 1px solid rgba(15, 23, 42, 0.45);
}

.board-posts__item--notice {
  background: linear-gradient(90deg, rgba(250, 204, 21, 0.12), rgba(250, 204, 21, 0));
  border-left: 3px solid rgba(250, 204, 21, 0.55);
}

.board-posts__link {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.45rem;
  background: transparent;
  padding: 0.35rem 10px;
  color: var(--text-color);
  text-align: left;
  border-radius: 0.55rem;
}

.board-posts__link:hover,
.board-posts__link:focus-visible {
  background: rgba(56, 189, 248, 0.1);
}

.board-posts__icon {
  width: 28px;
  height: 28px;
  border-radius: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.25);
}

.board-posts__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(250, 204, 21, 0.95);
  color: #0f172a;
  font-weight: 700;
  font-size: 0.75rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  margin-right: 0.5rem;
}

.board-posts__title {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
  font-weight: 600;
  min-width: 0;
}

.board-posts__title-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-posts__meta {
  justify-self: end;
  font-size: 0.8rem;
  color: var(--muted-color);
  white-space: nowrap;
  text-align: right;
}

.board-empty {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--muted-color);
}

.board-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
}

.board-pagination__inner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(15, 23, 42, 0.45);
  padding: 0.5rem 0.75rem;
  border-radius: 999px;
}

.board-page-btn {
  min-width: 48px;
  padding: 0.4rem 0.75rem;
  background: transparent;
  border-radius: 999px;
}

.board-page-btn.is-active {
  background: rgba(56, 189, 248, 0.22);
  color: #fff;
}

.board-detail,
.board-editor {
  background: rgba(15, 23, 42, 0.45);
  border-radius: 1rem;
  padding: 1rem;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.35);
  flex: 0 0 auto;
  width: 100%;
  box-sizing: border-box;
  overflow: visible;
}

.board-detail {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.board-editor {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  overflow: hidden;
}

.board-detail__header {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-bottom: 1.25rem;
}

.board-detail__header h3 {
  margin: 0;
  font-size: 1.2rem;
}

.board-detail__header p {
  margin: 0;
  color: var(--muted-color);
  font-size: 0.9rem;
}

.board-detail__divider {
  width: 100%;
  height: 2px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.25);
  margin: 0.4rem 0;
}

.board-detail__title {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.board-detail__icon {
  width: 46px;
  height: 46px;
  border-radius: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.25);
}

.board-detail__title .board-posts__badge {
  margin-right: 0.35rem;
}

.board-detail-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.board-detail-actions.hidden {
  display: none;
}

.board-detail__body {
  flex: 0 0 auto;
  min-height: 320px;
  max-height: none;
  overflow: visible;
  line-height: 1.6;
  font-size: 0.97rem;
  width: 100%;
  box-sizing: border-box;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.board-detail__body img {
  max-width: 100%;
  height: auto;
  border-radius: 0.75rem;
  margin: 0.75rem 0;
}

.board-detail__body * {
  max-width: 100%;
  box-sizing: border-box;
}

.board-comments {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.board-comments.hidden {
  display: none;
}

.board-comments__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.board-comments__header h4 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.board-comments__count {
  font-size: 0.875rem;
  color: #6b7280;
}

.board-comments__disabled {
  margin: 0;
  padding: 0.75rem 1rem;
  background-color: transparent;
  border: none;
  font-size: 0.875rem;
  font-weight: 600;
  color: #4b5563;
}

.board-comments__disabled--error {
  background-color: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
}

.board-comments__empty {
  margin: 0;
  font-size: 0.875rem;
  color: #6b7280;
}

.board-comments__empty.hidden {
  display: none;
}

.board-comment-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.board-comment-form.hidden {
  display: none;
}

.board-comment-form textarea {
  resize: vertical;
  min-height: 90px;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 0.95rem;
  line-height: 1.5;
  transition: border-color 0.2s ease;
}

.board-comment-form textarea:focus {
  border-color: #38bdf8;
  outline: none;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.board-comment-form__hint {
  font-size: 0.875rem;
  color: #2563eb;
}

.board-comment-form__hint.hidden {
  display: none;
}

.board-comment-form__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.board-comment-form__counter {
  font-size: 0.75rem;
  color: #6b7280;
}

.board-comment-form__counter--limit {
  color: #dc2626;
  font-weight: 600;
}

.board-comment-list {
  display: flex;
  flex-direction: column;
}

.board-comment {
  padding: 1rem 0;
  border-top: 1px solid #e5e7eb;
}

.board-comment.board-comment--active {
  background-color: #f9fafb;
  border-radius: 0.5rem;
  padding: 1rem;
  border-top-color: transparent;
}

.board-comment.board-comment--active + .board-comment {
  border-top-color: transparent;
}

.board-comment:first-child {
  border-top: none;
}

.board-comment__meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #6b7280;
}

.board-comment__author {
  font-weight: 600;
  color: #f8fafc;
}

.board-comment__time {
  font-size: 0.75rem;
  color: rgba(226, 232, 240, 0.65);
}

.board-comment__badge {
  display: inline-flex;
  align-items: center;
  padding: 0 0.35rem;
  border-radius: 9999px;
  background-color: #dbeafe;
  color: #1d4ed8;
  font-size: 0.7rem;
}

.board-comment__content {
  margin-top: 0.5rem;
  font-size: 0.95rem;
  line-height: 1.6;
  white-space: pre-line;
  word-break: break-word;
  color: #e5e7eb;
}

.board-comment__content--deleted {
  color: #9ca3af;
  font-style: italic;
}

.board-comment__deleted-meta {
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: #9ca3af;
}

.board-comment__actions {
  margin-top: 0.6rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.board-comment__actions button {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.75rem;
  color: #2563eb;
  cursor: pointer;
  transition: color 0.2s ease;
}

.board-comment__actions button:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

.board-comment__actions button[disabled] {
  color: #9ca3af;
  cursor: not-allowed;
  text-decoration: none;
}

.board-comment__children {
  margin-top: 1rem;
  margin-left: 1.5rem;
  padding-left: 1rem;
  border-left: 1px solid #e5e7eb;
}

@media (max-width: 768px) {
  .board-comment__children {
    margin-left: 1rem;
    padding-left: 0.75rem;
  }
}

.board-editor__header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.board-editor__icon {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0;
  background: transparent;
  border-radius: 0;
  align-items: center;
  min-height: 0;
  margin-right: 0.25rem;
}

.board-icon-option {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 0.4rem;
  background: transparent;
  border: none;
  transition: transform 0.18s ease;
  cursor: pointer;
  color: inherit;
}

.board-icon-option:hover,
.board-icon-option:focus-visible {
  transform: translateY(-1px);
}

.board-icon-option.is-selected {
  transform: translateY(-1px) scale(1.05);
}

.board-icon-option__glyph {
  width: 26px;
  height: 26px;
  border-radius: 0.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.board-editor--landing .board-editor__header,
.board-editor--landing .board-editor-notice {
  display: none !important;
}

.board-editor--landing .board-editor__actions {
  justify-content: flex-end;
}

.board-editor__header input {
  flex: 1 1 auto;
  padding: 0.6rem 0.85rem;
}

.board-editor-notice {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.9rem;
  color: var(--muted-color);
}

.board-editor__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  padding-bottom: 0.6rem;
}

.board-editor__group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.board-editor__label-inline {
  font-weight: 600;
  color: var(--muted-color);
  font-size: 0.95rem;
}

.board-editor__page-field {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border-radius: 0.75rem;
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(148, 163, 184, 0.2);
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.board-editor__page-field input {
  width: 140px;
  max-width: 100%;
  padding: 0.45rem 0.6rem;
}

.board-editor__hint-inline {
  font-size: 0.9rem;
  color: var(--muted-color);
}

.board-editor__group button {
  min-width: 38px;
  padding: 0.4rem 0.6rem;
  font-weight: 600;
}

.board-editor__group select {
  padding: 0.4rem 0.6rem;
}

.board-editor__group.board-editor__colors {
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.board-editor__color-picker-row {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.board-editor-line-height-slider {
  width: 140px;
  accent-color: #38bdf8;
  cursor: pointer;
}

.board-editor-color-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  max-width: 100%;
}

.board-color-swatch {
  width: 16px;
  height: 16px;
  border-radius: 0.45rem;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: var(--swatch-color, transparent);
  padding: 0;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.board-color-swatch:hover,
.board-color-swatch:focus-visible {
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.45);
}

.board-color-swatch:focus-visible {
  outline: 2px solid rgba(56, 189, 248, 0.55);
  outline-offset: 2px;
}

.board-color-swatch.is-active {
  outline: 2px solid rgba(59, 130, 246, 0.85);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.8), 0 8px 18px rgba(15, 23, 42, 0.5);
}

.board-color-swatch--reset {
  min-width: 50px;
  height: 32px;
  padding: 0 0.65rem;
  background: rgba(15, 23, 42, 0.45);
  color: var(--text-color);
  font-size: 0.85rem;
  line-height: 1;
}

.board-editor-color-picker {
  width: 48px;
  height: 34px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 0.5rem;
  background: rgba(15, 23, 42, 0.45);
  padding: 0;
}

.board-editor__content {
  flex: 1 1 auto;
  min-height: 320px;
  max-height: 100%;
  background: rgba(30, 41, 59, 0.55);
  border-radius: 0.75rem;
  padding: 1rem;
  overflow-y: auto;
  line-height: 1.6;
  font-size: 0.97rem;
}

.board-editor__content:focus {
  outline: 2px solid rgba(56, 189, 248, 0.55);
}

.board-editor__content img {
  max-width: 100%;
  height: auto;
  border-radius: 0.75rem;
  margin: 0.75rem 0;
}

.board-editor__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.board-editor__actions button {
  min-width: 96px;
}

.board-editor__group input[type='range'] {
  width: 140px;
}

.board-content__divider {
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(56, 189, 248, 0), rgba(56, 189, 248, 0.45), rgba(56, 189, 248, 0));
  opacity: 0.9;
  margin: 0 0.5rem;
}

@media (max-width: 768px) {
  .board-pane__header {
    flex-direction: column;
    align-items: flex-start;
  }
  .board-pane__actions {
    align-self: stretch;
    justify-content: flex-end;
  }
  .board-toolbar {
    flex-direction: column;
    gap: 0.75rem;
  }
  .board-search {
    flex-wrap: nowrap;
    align-items: center;
  }
  .board-search button {
    flex: 0 0 auto;
  }
  .board-post-list {
    max-height: clamp(320px, 55vh, 520px);
  }
  .board-detail,
  .board-editor {
    padding: 0.85rem;
  }
}

@media (max-width: 560px) {
  .board-sidebar {
    gap: 0.75rem;
    padding: 0.85rem;
  }
  .board-toolbar {
    padding: 0.65rem 0.75rem;
  }
  .board-editor__toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  .board-editor__group {
    flex-wrap: wrap;
    justify-content: flex-start;
  }
  .board-editor__group button,
  .board-editor__group select {
    flex: 1 1 auto;
    min-width: 0;
  }
  .board-editor__actions {
    flex-direction: column;
    align-items: stretch;
  }
  .board-editor__actions button {
    width: 100%;
  }
}

.sidebar {
  flex: 0 0 clamp(320px, 30vw, 420px);
  width: clamp(320px, 30vw, 420px);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
}

.sidebar-section {
  background: var(--panel-color);
  padding: 1rem;
  border-radius: 1rem;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.4);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.sidebar-section h3 {
  margin: 0 0 0.5rem;
}

.group-form {
  margin-top: 0.5rem;
}

.group-form-row {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  align-items: stretch;
}

.group-form-row input {
  width: 100%;
}

.group-form-row button {
  width: 100%;
  max-width: 240px;
  min-width: 0;
  padding: 0.6rem 1.2rem;
  align-self: flex-end;
}

@media (max-width: 520px) {
  .group-form-row button {
    max-width: 100%;
    align-self: stretch;
  }
}

.group-form--disabled input,
.group-form--disabled button {
  cursor: not-allowed;
  opacity: 0.6;
}

.search-form {
  margin-bottom: 0.4rem;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-icon input {
  width: 100%;
  padding: 0.6rem 2.5rem 0.6rem 1rem;
  line-height: 1.4;
}

.input-inline {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.input-inline input {
  flex: 1 1 auto;
}

.input-inline__button {
  flex: 0 0 auto;
  min-width: 96px;
  padding: 0 1rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(56, 189, 248, 0.4);
  background: rgba(56, 189, 248, 0.18);
  color: var(--text-color);
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.input-inline__button:hover,
.input-inline__button:focus-visible {
  transform: translateY(-1px);
  background: rgba(56, 189, 248, 0.28);
  border-color: rgba(56, 189, 248, 0.55);
  box-shadow: 0 10px 18px rgba(56, 189, 248, 0.25);
  outline: 2px solid rgba(56, 189, 248, 0.45);
  outline-offset: 2px;
}

.input-inline__button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  transform: none;
  box-shadow: none;
}

.input-inline__hint {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  color: var(--muted-color);
  min-height: 1.1em;
}

.input-inline__hint[data-status='success'] {
  color: rgba(134, 239, 172, 0.95);
}

.input-inline__hint[data-status='error'] {
  color: rgba(248, 113, 113, 0.95);
}

.search-icon-button {
  position: absolute;
  right: 0.35rem;
  background: transparent;
  border: none;
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--muted-color);
  transition: color 0.2s ease;
  border-radius: 999px;
}

.search-icon-button::before {
  content: '🔍';
}

.search-icon-button:hover,
.search-icon-button:focus-visible {
  color: var(--accent-color);
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

.sidebar-admin-button {
  margin-top: 0.4rem;
  width: 100%;
  padding: 0.55rem 0.8rem;
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.12);
  color: #e2e8f0;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: background 0.2s ease, transform 0.2s ease;
}

.sidebar-admin-button:hover {
  background: rgba(56, 189, 248, 0.2);
  transform: translateY(-1px);
}

.sidebar-admin-button:focus-visible {

#room-section {
  flex: 1 1 auto;
  min-height: 0;
}

#room-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 0.25rem;
}

#group-section {
  flex: 0 0 auto;
}
  outline: 2px solid rgba(56, 189, 248, 0.85);
  outline-offset: 2px;
}

.helper-text {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--muted-color);
}

.search-result-name {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  flex: 1 1 auto;
}

.search-result-name .nickname-level {
  flex: 0 0 auto;
}

.search-result-name .nickname-text {
  display: inline-flex;
  align-items: baseline;
  gap: 0.25rem;
}

.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.list li {
  background: rgba(15, 23, 42, 0.6);
  padding: 0.75rem;
  border-radius: 0.75rem;
  cursor: pointer;
  border: 1px solid transparent;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.list li.room-notice {
  border-color: rgba(250, 204, 21, 0.45);
  background: rgba(250, 204, 21, 0.12);
  position: relative;
}

.list li.active {
  border-color: var(--accent-color);
  background: rgba(56, 189, 248, 0.15);
}

.list li.room-has-unread {
  border-color: rgba(250, 204, 21, 0.6);
  box-shadow: 0 0 0 1px rgba(250, 204, 21, 0.15);
}

.list li.room-left {
  opacity: 0.7;
  background: rgba(15, 23, 42, 0.35);
  border-style: dashed;
  border-color: rgba(148, 163, 184, 0.4);
}

.list li.room-left .room-title__label,
.list li.room-left .room-subtitle {
  color: rgba(148, 163, 184, 0.9);
}

.list li.room-left.room-has-unread {
  border-color: rgba(248, 113, 113, 0.4);
  box-shadow: none;
}

.list li.room-notice.room-has-unread {
  animation: noticePulse 2s ease-in-out infinite;
}

@keyframes noticePulse {
  0% {
    border-color: rgba(250, 204, 21, 0);
  }
  50% {
    border-color: rgba(250, 204, 21, 0.8);
  }
  100% {
    border-color: rgba(250, 204, 21, 0);
  }
}

.room-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.room-actions .room-left-label {
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  font-size: 0.85rem;
  background: rgba(248, 113, 113, 0.15);
  color: #f87171;
  border: 1px solid rgba(248, 113, 113, 0.4);
}

.room-actions button {
  padding: 0.45rem 0.75rem;
  font-size: 0.9rem;
}

.room-actions .room-mute-button {
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #facc15;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, filter 0.2s ease;
  font-size: 0;
}

.room-leave-button {
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(248, 113, 113, 0.15);
  color: #f87171;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0;
  transition: background-color 0.2s ease, transform 0.2s ease, filter 0.2s ease;
}

.room-leave-button--icon::before {
  content: '';
  width: 14px;
  height: 14px;
  display: inline-block;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath fill='none' stroke='%23f87171' stroke-width='2' stroke-linecap='round' d='M3 3l8 8M11 3l-8 8'/%3E%3C/svg%3E");
}

.room-leave-button:hover,
.room-leave-button:focus-visible {
  background: rgba(248, 113, 113, 0.28);
  transform: translateY(-1px);
}

.room-leave-button:focus-visible {
  outline: 2px solid rgba(248, 113, 113, 0.45);
  outline-offset: 2px;
}

.room-leave-button--text {
  width: auto;
  height: auto;
  padding: 0.35rem 0.9rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 999px;
}

.room-leave-button--text::before {
  display: none;
}

.room-mute-button::before {
  content: '';
  display: block;
  width: 24px;
  height: 24px;
  background-image: var(--bell-icon-on);
  background-size: 24px 24px;
  background-repeat: no-repeat;
  background-position: center;
}

.room-mute-button.off::before {
  background-image: var(--bell-icon-off);
}

.room-mute-button:hover,
.room-mute-button:focus-visible {
  transform: translateY(-1px);
  filter: drop-shadow(0 6px 16px rgba(56, 189, 248, 0.3));
}

.room-mute-button.off {
  color: #475569;
}

.left-room-toggle {
  width: 100%;
  margin-top: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: 0.75rem;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: rgba(226, 232, 240, 0.9);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.left-room-toggle:hover:not(:disabled),
.left-room-toggle:focus-visible:not(:disabled) {
  background: rgba(15, 23, 42, 0.75);
  color: #ffffff;
  transform: translateY(-1px);
  outline: 2px solid rgba(56, 189, 248, 0.35);
  outline-offset: 2px;
}

.left-room-toggle:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.left-room-toggle--active {
  background: rgba(248, 113, 113, 0.2);
  border-color: rgba(248, 113, 113, 0.5);
  color: #fee2e2;
}

.left-room-toggle__icon {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  border: 2px solid currentColor;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.left-room-toggle__icon::before,
.left-room-toggle__icon::after {
  content: '';
  position: absolute;
  width: 6px;
  height: 2px;
  background: currentColor;
  border-radius: 999px;
}

.left-room-toggle__icon::before {
  transform: translateY(-2px);
}

.left-room-toggle__icon::after {
  transform: translateY(2px);
}

.left-room-toggle__label {
  font-size: 0.9rem;
}

.room-mute-button:focus-visible {
  outline: 2px solid rgba(56, 189, 248, 0.6);
  outline-offset: 2px;
}

.list li.room-muted {
  opacity: 0.85;
}

.list li.room-muted .room-title {
  color: rgba(148, 163, 184, 0.85);
}

.list li.room-muted .room-subtitle {
  color: rgba(100, 116, 139, 0.65);
}

.list li.room-observer:not(.active) {
  background: rgba(71, 85, 105, 0.28);
  border-color: rgba(148, 163, 184, 0.35);
}

.list li.room-observer:not(.active) .room-title__label,
.list li.room-observer:not(.active) .room-title,
.list li.room-observer:not(.active) .room-subtitle {
  color: rgba(148, 163, 184, 0.85);
}

.list li.room-observer:not(.active) .room-title__count {
  color: rgba(148, 163, 184, 0.65);
}

.list li.room-observer:not(.active) .room-title__group-icon {
  filter: grayscale(0.65) opacity(0.75);
}

.list li.room-observer:not(.active) .room-actions button,
.list li.room-observer:not(.active) .favorite-button,
.list li.room-observer:not(.active) .room-mute-button {
  opacity: 0.7;
}

.list li.room-observer:not(.active) .badge {
  background: rgba(148, 163, 184, 0.25);
  color: rgba(226, 232, 240, 0.9);
}

.badge {
  min-width: 26px;
  height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  background: #f97316;
  color: #ffffff;
  border: 1px solid #ea580c;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 700;
}

.badge.hidden {
  display: none;
}

.chat-pane {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  background: var(--panel-color);
  border-radius: 1rem;
  padding: 1rem;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.4);
  min-height: 0;
  overflow: hidden;
  position: relative;
}



.chat-header {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  margin-bottom: 1rem;
  font-weight: 600;
}

.chat-header__actions {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

.chat-header__leave-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(248, 113, 113, 0.55);
  background: rgba(15, 23, 42, 0.2);
  color: rgba(248, 250, 252, 0.95);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.chat-header__leave-btn:hover,
.chat-header__leave-btn:focus-visible {
  background: rgba(248, 113, 113, 0.2);
  color: #fee2e2;
  transform: translateY(-1px);
}

.chat-header__leave-btn:focus-visible {
  outline: 2px solid rgba(248, 113, 113, 0.65);
  outline-offset: 2px;
}

.admin-header {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.admin-header.hidden {
  display: none !important;
}

.chat-title {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  max-width: calc(100% - 160px);
  font-size: 1.05rem;
  font-weight: 600;
}

.chat-title__text {
  display: inline-flex;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-title__count {
  flex: 0 0 auto;
  font-size: 0.9rem;
  color: rgba(148, 163, 184, 0.85);
  font-weight: 500;
  white-space: nowrap;
}

.chat-title__manage-btn {
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.chat-title__leave-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.chat-title__leave-btn::before {
  content: '';
  width: 16px;
  height: 16px;
  display: inline-block;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%23ef4444' d='M3 1h5a1 1 0 0 1 1 1v2h-1V2H4v12h4v-2h1v2a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1z'/%3E%3Cpath fill='%23ef4444' d='M9 5l4 3-4 3V9H6V7h3V5z'/%3E%3C/svg%3E");
}

.chat-title__leave-btn:hover,
.chat-title__leave-btn:focus-visible {
  background: rgba(248, 113, 113, 0.18);
  transform: translateY(-1px);
}

.chat-title__leave-btn:focus-visible {
  outline: 2px solid rgba(248, 113, 113, 0.55);
  outline-offset: 2px;
}

.chat-title__manage-btn::before {
  content: '';
  width: 40px;
  height: 40px;
  display: inline-block;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Cdefs%3E%3ClinearGradient id='manageGrad' x1='0%' y1='0%' x2='100%' y2='100%'%3E%3Cstop offset='0%' stop-color='%23304366'/%3E%3Cstop offset='100%' stop-color='%2344577c'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect x='2' y='2' width='36' height='36' rx='12' fill='url(%23manageGrad)' opacity='0.95'/%3E%3Cpath d='M24.8 12.2l3.1 3.1-12.7 12.7-3.9.5.5-3.9z' fill='%23dbeafe'/%3E%3Cpath d='M26.2 11c.6-.6 1.6-.6 2.2 0l2.6 2.6c.6.6.6 1.6 0 2.2l-1.2 1.2-4.8-4.8z' fill='%23bfdbfe'/%3E%3Cpath d='M11.6 28.4l3.3-.4-2.9-2.9z' fill='%2393c5fd'/%3E%3C/svg%3E");
  box-shadow: 0 10px 22px rgba(59, 130, 246, 0.25);
  border-radius: 12px;
}

.chat-title__manage-btn:hover,
.chat-title__manage-btn:focus-visible {
  transform: translateY(-1px) scale(1.03);
  filter: drop-shadow(0 12px 24px rgba(59, 130, 246, 0.32));
}

.chat-title__manage-btn:focus-visible {
  outline: 2px solid rgba(148, 197, 253, 0.65);
  outline-offset: 3px;
}

.chat-title__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid transparent;
}

.chat-title__badge--frozen {
  background: rgba(248, 113, 113, 0.18);
  border-color: rgba(248, 113, 113, 0.35);
  color: rgba(252, 165, 165, 0.95);
  box-shadow: 0 8px 18px rgba(248, 113, 113, 0.2);
}

.chat-title__badge--deleted {
  background: rgba(148, 163, 184, 0.2);
  border-color: rgba(148, 163, 184, 0.32);
  color: rgba(226, 232, 240, 0.9);
  box-shadow: 0 8px 18px rgba(148, 163, 184, 0.18);
}

.chat-title--frozen .chat-title__text {
  color: rgba(226, 232, 240, 0.95);
}

#public-room-toggle {
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-right: 0.5rem;
  min-height: 0;
  max-height: calc(100vh - 16rem);
  align-items: flex-start;
}

.search-results-panel {
  width: 100%;
  flex: 0 0 auto;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 1rem;
  padding: 0.75rem 0.75rem 0.6rem;
  margin-bottom: 0.75rem;
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.35);
  max-height: min(260px, 35vh);
  overflow-y: auto;
  backdrop-filter: blur(6px);
}

.admin-tools {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1rem;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden auto;
  scrollbar-gutter: stable both-edge;
}

.admin-view {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1 1 auto;
  min-height: 0;
}

@media (max-width: 960px) and (max-height: 820px) {
  .admin-tools {
    max-height: min(440px, 48vh);
  }
  .chat-messages {
    max-height: calc(100vh - 16rem);
  }
}

@media (max-width: 960px) and (max-height: 720px) {
  .admin-tools {
    max-height: min(360px, 50vh);
  }
  .chat-messages {
    max-height: calc(100vh - 14rem);
  }
}

.admin-view__controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.admin-view__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.admin-view__actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-direction: row-reverse;
  margin-left: auto;
  flex-wrap: nowrap;
}

.admin-view__status {
  font-size: 0.75rem;
  color: rgba(148, 163, 184, 0.75);
}

.admin-view__status--error {
  color: rgba(248, 113, 113, 0.9);
}

.admin-view__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.admin-entry {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.35rem 0.55rem;
  border-radius: 0.7rem;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.2);
  line-height: 1.1;
}

.admin-entry__time {
  flex: 0 0 auto;
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(148, 163, 184, 0.85);
  min-width: 46px;
}

.admin-entry__body {
  flex: 1 1 auto;
  display: inline-flex;
  align-items: flex-start;
  gap: 0.4rem;
  min-width: 0;
  flex-wrap: wrap;
  white-space: normal;
  overflow: visible;
  color: rgba(226, 232, 240, 0.95);
}

.admin-entry__tag {
  flex: 0 0 auto;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.24);
  color: rgba(56, 189, 248, 0.95);
}

.admin-entry__text {
  flex: 1 1 auto;
  min-width: 0;
  overflow: visible;
  white-space: normal;
  word-break: break-word;
}

.admin-gm-alias {
  border: none;
  background: rgba(56, 189, 248, 0.18);
  color: rgba(226, 232, 240, 0.95);
  font-weight: 600;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.admin-gm-alias:hover,
.admin-gm-alias:focus-visible {
  background: rgba(56, 189, 248, 0.3);
  box-shadow: 0 6px 14px rgba(56, 189, 248, 0.25);
  outline: none;
}

.admin-gm-alias:focus-visible {
  outline: 2px solid rgba(148, 197, 253, 0.6);
  outline-offset: 2px;
}

.admin-gm-direction,
.admin-gm-divider {
  color: rgba(148, 163, 184, 0.75);
  font-weight: 500;
}

.admin-gm-text {
  color: rgba(226, 232, 240, 0.95);
}

.admin-entry--unread {
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.25);
}

.admin-entry--danger {
  border-color: rgba(248, 113, 113, 0.45);
  background: rgba(248, 113, 113, 0.12);
}

.admin-entry--monitor-transfer .admin-entry__time,
.admin-entry--monitor-transfer .admin-entry__body,
.admin-entry--monitor-transfer .admin-entry__text {
  color: #ff6868;
}

.admin-entry--monitor-transfer .admin-entry__tag {
  background: rgba(255, 104, 104, 0.18);
  color: #ffe0e0;
}

.admin-entry--monitor-party .admin-entry__time,
.admin-entry--monitor-party .admin-entry__body,
.admin-entry--monitor-party .admin-entry__text {
  color: #e5bd43;
}

.admin-entry--monitor-party .admin-entry__tag {
  background: rgba(229, 189, 67, 0.18);
  color: #fff4c3;
}

.admin-entry--monitor-trade .admin-entry__time,
.admin-entry--monitor-trade .admin-entry__body,
.admin-entry--monitor-trade .admin-entry__text {
  color: #ff5dcd;
}

.admin-entry--monitor-trade .admin-entry__tag {
  background: rgba(255, 93, 205, 0.18);
  color: #ffe0f5;
}

.admin-view__empty {
  margin: 0;
  font-size: 0.8rem;
  color: rgba(148, 163, 184, 0.7);
}

.admin-gm-form {
  display: grid;
  grid-template-columns: minmax(128px, 1fr) minmax(220px, 2fr) auto;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.75rem;
}

.admin-gm-form input {
  width: 100%;
}

.admin-gm-form button {
  white-space: nowrap;
  padding-inline: 1.25rem;
}

.search-results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
  font-weight: 600;
}

.search-results-header span {
  color: var(--text-color);
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-results-close {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.65);
  color: var(--muted-color);
  font-size: 1.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.search-results-close:hover,
.search-results-close:focus-visible {
  transform: translateY(-1px);
  background: rgba(56, 189, 248, 0.2);
  color: #0f172a;
  box-shadow: 0 10px 18px rgba(56, 189, 248, 0.25);
  outline: 2px solid rgba(56, 189, 248, 0.5);
  outline-offset: 2px;
}

.list--search {
  gap: 0.5rem;
}

.list--search li {
  cursor: default;
}

.search-result-body {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.search-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.search-result-actions button {
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.2);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: var(--text-color);
  font-size: 0.85rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.search-result-actions button:hover,
.search-result-actions button:focus-visible {
  transform: translateY(-1px);
  background: rgba(56, 189, 248, 0.35);
  box-shadow: 0 10px 18px rgba(56, 189, 248, 0.25);
  outline: 2px solid rgba(56, 189, 248, 0.5);
  outline-offset: 2px;
}

.search-result-actions button.secondary {
  background: rgba(148, 163, 184, 0.2);
  border-color: rgba(148, 163, 184, 0.35);
}

.chat-status {
  width: 100%;
  text-align: center;
  font-size: 0.9rem;
  color: var(--danger-color);
  margin: 0 0 0.5rem;
  font-weight: 600;
  align-self: stretch;
}

.message-empty {
  width: 100%;
  text-align: center;
  color: #94a3b8;
  padding: 1rem 0;
  font-size: 0.95rem;
}

.message {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-width: 85%;
  align-self: flex-start;
  padding: 0.75rem 1.25rem 0.75rem 1rem;
  border-radius: 1rem;
  background: rgba(148, 163, 184, 0.15);
  position: relative;
  padding-right: 1.6rem;
  margin-right: 0;
  transition: box-shadow 0.2s ease, background 0.2s ease;
}

.message--pending .meta-time {
  opacity: 0.7;
}

.message-status {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  margin-top: 0.35rem;
  color: rgba(100, 116, 139, 0.9);
}

.message-status--error {
  color: #d9534f;
}

.message-status__text {
  line-height: 1.4;
}

.message-status__spinner {
  width: 0.75rem;
  height: 0.75rem;
  border: 2px solid rgba(148, 163, 184, 0.35);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: message-status-spin 0.9s linear infinite;
}

.message-status__retry {
  margin-left: 0.25rem;
  padding: 0;
  border: 0;
  background: none;
  font-size: 0.75rem;
  color: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.message-status__retry:hover,
.message-status__retry:focus {
  text-decoration: none;
}

@keyframes message-status-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.message.reply-target {
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.45);
}

.message.reply-target:not(.mine) {
  background: rgba(56, 189, 248, 0.18);
}

.message.mine.reply-target {
  background: rgba(56, 189, 248, 0.28);
}

.message.mine {
  align-self: flex-end;
  background: rgba(56, 189, 248, 0.2);
  margin-right: 0;
  padding-right: 2.85rem;
}

.message:not(.mine) {
  margin-right: 2.35rem;
}

.message .meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.75rem;
  color: var(--muted-color);
}

.meta-time {
  color: rgba(148, 163, 184, 0.85);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.message.image {
  background: rgba(56, 189, 248, 0.12);
  max-width: calc(min(320px, 70vw) + 2rem);
  padding: 0.65rem 0.75rem 0.75rem;
  padding-right: 1.6rem;
}

.message .content-block {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.message-reply {
  align-self: stretch;
  padding: 0.45rem 0.65rem;
  border-radius: 0.75rem;
  background: rgba(148, 163, 184, 0.12);
  border-left: 3px solid rgba(148, 163, 184, 0.35);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.message.mine .message-reply {
  background: rgba(56, 189, 248, 0.18);
  border-left-color: rgba(56, 189, 248, 0.55);
}

.message-reply--interactive {
  cursor: pointer;
}

.message-reply--interactive:focus-visible {
  outline: 2px solid rgba(56, 189, 248, 0.6);
  outline-offset: 2px;
}

.message-reply__author {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-color);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.message-reply__text {
  font-size: 0.85rem;
  color: var(--muted-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.message-reply__text--deleted {
  font-style: italic;
}

.message.image .content-block {
  align-self: flex-start;
  max-width: min(320px, 70vw);
}

.message.mine.image {
  padding-right: 2.85rem;
}

.message.mine.image .content-block {
  align-self: flex-end;
}

.message.mine .content-block {
  align-items: flex-end;
}

.message.image .content-block {
  max-width: min(320px, 70vw);
}

.message.video .content-block {
  max-width: min(420px, 80vw);
}

.message img.message-image {
  display: block;
  max-width: min(320px, 70vw);
  width: 100%;
  border-radius: 0.75rem;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.45);
  align-self: stretch;
  cursor: zoom-in;
}

.message video.message-video {
  display: block;
  width: 100%;
  max-width: min(420px, 80vw);
  border-radius: 0.75rem;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.45);
  background: #0f172a;
}

.message.mine img.message-image {
  align-self: stretch;
}

.message .caption {
  font-size: 0.9rem;
  line-height: 1.4;
  word-break: break-word;
  white-space: pre-wrap;
}

.message .text {
  font-size: 0.95rem;
  line-height: 1.45;
  word-break: break-word;
  white-space: pre-wrap;
}

.message .text a,
.message .caption a {
  color: var(--accent-color);
  text-decoration: underline;
  word-break: break-word;
}

.message .text a:hover,
.message .caption a:hover,
.message .text a:focus-visible,
.message .caption a:focus-visible {
  color: #bae6fd;
}

.nickname-button {
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  text-align: left;
}

.nickname-button:hover,
.nickname-button:focus-visible {
  text-decoration: underline;
  color: var(--accent-color);
}

.nickname-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 600;
  color: var(--text-color);
}

.meta-left {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.nickname-char {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: var(--muted-color);
  background: rgba(148, 163, 184, 0.2);
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
}


.nickname-level {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 1.35rem;
  padding: 0 0.5rem;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-color);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.nickname-text {
  display: inline-flex;
  align-items: baseline;
  gap: 0.2rem;
  font-weight: 600;
  color: var(--text-color);
  white-space: nowrap;
}

.nickname-tail {
  font-size: 0.85rem;
  color: rgba(148, 163, 184, 0.85);
  font-weight: 500;
}

.nickname-icon {
  margin-left: 0.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nickname--admin {
  font-weight: 700;
  color: #facc15;
}

@supports (-webkit-background-clip: text) {
  .nickname--admin {
    background-image: linear-gradient(90deg, #fef3c7 0%, #facc15 45%, #f97316 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 12px rgba(250, 204, 21, 0.35);
  }
}

@supports (background-clip: text) {
  .nickname--admin {
    background-image: linear-gradient(90deg, #fef3c7 0%, #facc15 45%, #f97316 100%);
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 12px rgba(250, 204, 21, 0.35);
  }
}

.message-actions {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  display: flex;
  gap: 0.3rem;
  align-items: center;
}

.message-actions button {
  border: none;
  background: transparent;
  color: rgba(148, 163, 184, 0.8);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  transition: color 0.2s ease, transform 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.message-actions .reply-btn {
  color: rgba(148, 163, 184, 0.6);
}

.message-actions button:hover,
.message-actions button:focus-visible {
  transform: translateY(-1px);
  outline: 2px solid rgba(56, 189, 248, 0.6);
  outline-offset: 2px;
}

.message-actions .reply-btn:hover,
.message-actions .reply-btn:focus-visible {
  color: var(--accent-color);
}

.message-actions .delete-btn:hover,
.message-actions .delete-btn:focus-visible {
  color: var(--danger-color);
}

.message-reply-anchor {
  position: absolute;
  right: -2.1rem;
  bottom: 0.25rem;
  z-index: 1;
}

.message.mine .message-reply-anchor {
  display: none;
}

.message-reply-anchor .reply-btn {
  border: none;
  background: transparent;
  color: rgba(148, 163, 184, 0.1);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease, transform 0.2s ease;
}

.message-reply-anchor .reply-btn:hover,
.message-reply-anchor .reply-btn:focus-visible {
  color: var(--accent-color);
  transform: translateY(-1px);
  outline: 2px solid rgba(56, 189, 248, 0.6);
  outline-offset: 2px;
}

.message.deleted {
  opacity: 0.7;
}

@media (max-width: 720px) {
  .message:not(.mine) {
    margin-right: 1.6rem;
  }

  .message-reply-anchor {
    right: -1.6rem;
  }
}

.message.deleted .text,
.message .deleted-text {
  color: var(--muted-color);
  font-style: italic;
}

.user-icon {
  position: relative;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  filter: drop-shadow(0 0 6px rgba(15, 23, 42, 0.25));
}

.user-icon::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #38bdf8 0%, #1d4ed8 90%);
}

.user-icon.active {
  filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.3));
}

.user-icon.nickname-icon {
  width: 14px;
  height: 14px;
  filter: drop-shadow(0 0 4px rgba(15, 23, 42, 0.18));
}

.user-icon.group-member-item__icon {
  width: 18px;
  height: 18px;
  filter: drop-shadow(0 0 5px rgba(15, 23, 42, 0.2));
}

.user-icon--triangle::before {
  clip-path: polygon(20% 0%, 80% 0%, 100% 42%, 72% 100%, 28% 100%, 0% 42%);
  border-radius: 0;
  background: linear-gradient(158deg, #cffafe 0%, #38bdf8 42%, #1d4ed8 100%);
  box-shadow: 0 0 10px rgba(14, 165, 233, 0.4);
}

.user-icon--diamond::before {
  border-radius: 0;
  clip-path: polygon(50% 0%, 85% 22%, 85% 78%, 50% 100%, 15% 78%, 15% 22%);
  background: linear-gradient(140deg, #38bdf8 0%, #6366f1 55%, #a855f7 100%);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.45);
}

.user-icon--shield::before {
  clip-path: polygon(50% 0%, 95% 28%, 82% 100%, 50% 86%, 18% 100%, 5% 28%);
  border-radius: 0;
  background: linear-gradient(180deg, #c4b5fd 0%, #7c3aed 100%);
}

.user-icon--wing::before {
  clip-path: polygon(3% 70%, 22% 25%, 45% 5%, 70% 0%, 97% 45%, 65% 55%, 85% 100%, 30% 75%);
  border-radius: 0;
  background: linear-gradient(135deg, #fef08a 0%, #f97316 100%);
}

.user-icon--phoenix::before {
  clip-path: polygon(50% 0%, 85% 18%, 100% 50%, 67% 62%, 88% 100%, 50% 85%, 12% 100%, 33% 62%, 0 50%, 15% 18%);
  border-radius: 0;
  background: linear-gradient(135deg, #fb7185 0%, #ef4444 50%, #facc15 100%);
}

.user-icon--gold-crown::before {
  border-radius: 0;
  background: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cdefs%3E%3ClinearGradient id='crownGrad' x1='2' y1='5' x2='22' y2='19' gradientUnits='userSpaceOnUse'%3E%3Cstop offset='0' stop-color='%23fef08a'/%3E%3Cstop offset='.55' stop-color='%23facc15'/%3E%3Cstop offset='1' stop-color='%23f97316'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath fill='url(%23crownGrad)' d='M3 17h18l-2.2-9-3.6 3.4L12 5.5l-3.2 5.9L5.2 8 3 17Z'/%3E%3Ccircle cx='5.5' cy='8.2' r='1.1' fill='%23fde68a'/%3E%3Ccircle cx='12' cy='6.2' r='1.3' fill='%23fde68a'/%3E%3Ccircle cx='18.5' cy='8.2' r='1.1' fill='%23fde68a'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  box-shadow: none;
  filter: drop-shadow(0 0 8px rgba(234, 179, 8, 0.4));
}

.room-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
  min-width: 0;
}

.room-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  color: var(--text-color);
  min-width: 0;
  white-space: nowrap;
}

.room-title__group-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none'%3E%3Cdefs%3E%3ClinearGradient id='groupGrad' x1='4' y1='4' x2='20' y2='20' gradientUnits='userSpaceOnUse'%3E%3Cstop stop-color='%2338bdf8'/%3E%3Cstop offset='1' stop-color='%236367f1'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M8.5 11.25a2.75 2.75 0 1 0 0-5.5 2.75 2.75 0 0 0 0 5.5Zm7 0a2.75 2.75 0 1 0 0-5.5 2.75 2.75 0 0 0 0 5.5Zm-9.75 1.5A3.75 3.75 0 0 0 2 16.5V18a1 1 0 0 0 1 1h7.5v-2.5a4.5 4.5 0 0 1 1.04-2.9 3.74 3.74 0 0 0-3.79-1.85ZM14.5 16.5V19H21a1 1 0 0 0 1-1v-1.5a3.75 3.75 0 0 0-3.75-3.75h-.02a3.74 3.74 0 0 0-3.73 3.75Z' fill='url(%23groupGrad)'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  filter: drop-shadow(0 2px 4px rgba(56, 189, 248, 0.35));
}

.room-title__label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.room-title__count {
  flex: 0 0 auto;
  font-size: 0.82rem;
  color: rgba(148, 163, 184, 0.8);
  font-weight: 500;
  white-space: nowrap;
}

.room-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(148, 163, 184, 0.18);
  color: rgba(226, 232, 240, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.room-badge--frozen {
  background: rgba(248, 113, 113, 0.2);
  color: rgba(252, 165, 165, 0.95);
  border-color: rgba(248, 113, 113, 0.35);
  box-shadow: 0 6px 14px rgba(248, 113, 113, 0.22);
}

.room-badge--deleted {
  background: rgba(148, 163, 184, 0.18);
  color: rgba(226, 232, 240, 0.9);
  border-color: rgba(148, 163, 184, 0.35);
  box-shadow: 0 6px 14px rgba(148, 163, 184, 0.18);
}

.room-badge--left {
  background: rgba(248, 113, 113, 0.18);
  color: rgba(254, 226, 226, 0.95);
  border-color: rgba(248, 113, 113, 0.45);
  box-shadow: 0 6px 14px rgba(248, 113, 113, 0.15);
}

.room-deleted .room-title__label {
  color: rgba(148, 163, 184, 0.85);
}

.room-deleted .room-subtitle {
  color: rgba(148, 163, 184, 0.7);
}

.room-subtitle {
  font-size: 0.8rem;
  color: var(--muted-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.room-frozen .room-subtitle {
  color: rgba(252, 165, 165, 0.78);
}


.room-lock-icon {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 44px;
  margin: 0;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 26px 26px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%239b1c1c' d='M6 2.75a1 1 0 0 1 1 1v16.5a1.75 1.75 0 0 1-3.5 0V3.75a1 1 0 0 1 1-1H6Z'/%3E%3Cpath fill='%23ef4444' d='M7 3.5h10.2a1 1 0 0 1 .93 1.37l-.74 1.89a1 1 0 0 0 0 .68l.74 1.89a1 1 0 0 1-.93 1.37H7Z'/%3E%3Cpath fill='%23f87171' fill-opacity='0.85' d='M7 3.5v6.28l4.52-.68c1.12-.17 2.25.08 3.19.7L17 11.9V3.5Z'/%3E%3C/svg%3E");
  filter: drop-shadow(0 0 6px rgba(248, 113, 113, 0.35));
}

.favorite-button {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  padding: 0;
  border: none;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.favorite-button::before {
  content: '';
  width: 28px;
  height: 28px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 28px 28px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.6l2.69 5.45 6.01.87-4.35 4.19 1.03 6.03L12 16.94l-5.38 2.2 1.03-6.03-4.35-4.19 6.01-.87z' fill='%2394a3b8' fill-opacity='0.85'/%3E%3C/svg%3E");
  opacity: 0.85;
  transition: opacity 0.2s ease, transform 0.2s ease, filter 0.2s ease;
}

.favorite-button:hover::before,
.favorite-button:focus-visible::before {
  opacity: 1;
  transform: scale(1.05);
}

.favorite-button:hover,
.favorite-button:focus-visible {
  transform: translateY(-1px);
}

.favorite-button:focus-visible {
  outline: 2px solid rgba(250, 204, 21, 0.55);
  outline-offset: 3px;
}

.favorite-button.on::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 24 24'%3E%3Cdefs%3E%3ClinearGradient id='favStarFill' x1='50%' y1='0%' x2='50%' y2='100%'%3E%3Cstop offset='0%' stop-color='%23fef9c3'/%3E%3Cstop offset='55%' stop-color='%23facc15'/%3E%3Cstop offset='100%' stop-color='%23f97316'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M12 2.6l2.69 5.45 6.01.87-4.35 4.19 1.03 6.03L12 16.94l-5.38 2.2 1.03-6.03-4.35-4.19 6.01-.87z' fill='url(%23favStarFill)'/%3E%3C/svg%3E");
  opacity: 1;
  filter: drop-shadow(0 0 12px rgba(250, 204, 21, 0.45));
}

.room-invite-button {
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
}

.profile-summary__nickname {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  font-weight: 600;
}

.profile-summary__user-id {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted-color);
}

.profile-tail-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.profile-tail-form label {
  font-weight: 600;
  color: var(--text-color);
}

.profile-tail-form__controls {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.profile-tail-form__controls input {
  flex: 1;
}

.profile-tail-form__hint {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted-color);
}

.profile-char-display {
  margin-top: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 0.9rem;
  border-radius: 0.85rem;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.profile-char-display__label {
  font-weight: 600;
  color: var(--muted-color);
}

.profile-char-display__value {
  font-weight: 600;
  color: rgba(148, 163, 184, 0.85);
  white-space: pre-line;
}

.profile-char-display__value--placeholder {
  font-style: italic;
  font-weight: 400;
  color: rgba(148, 163, 184, 0.6);
}

.level-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.18);
  color: var(--accent-color);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.icon-picker {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.icon-picker__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.5rem;
}

.icon-picker__item {
  display: flex;
}

.icon-picker__button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.25);
  padding: 0.65rem 0.8rem;
  border-radius: 0.9rem;
  color: var(--text-color);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.icon-picker__button.selected {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25);
}

.icon-picker__button.locked {
  opacity: 0.75;
}

.icon-picker__button.locked .icon-picker__requirement {
  color: #fca5a5;
  background: rgba(248, 113, 113, 0.18);
}

.icon-picker__label {
  display: none;
}

.icon-picker__requirement {
  font-size: 0.75rem;
  color: var(--muted-color);
  margin-left: auto;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.2);
}

.icon-picker__placeholder {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted-color);
  font-weight: 600;
}

.user-popup-level {
  margin: 0;
  font-size: 0.9rem;
}

.user-popup-level:not(.nickname--admin) {
  color: var(--muted-color);
}

.user-popup-icon {
  display: flex;
  justify-content: center;
}

.user-popup-icon .user-icon {
  width: 40px;
  height: 40px;
}

.chat-input {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
  margin-top: 1rem;
}

.chat-input__controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: nowrap;
  width: 100%;
}

.chat-input--muted {
  opacity: 0.7;
}

.chat-input--muted textarea,
.chat-input--muted button,
.chat-input--muted .attach-button {
  cursor: not-allowed;
}

.chat-input--muted textarea {
  background: rgba(15, 23, 42, 0.5);
}

.message-submit {
  height: 48px;
  min-width: 96px;
}

.attach-button {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border-radius: 0.9rem;
  border: none;
  background: rgba(15, 23, 42, 0.45);
  color: var(--muted-color);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.attach-button::before {
  content: '';
  display: inline-block;
  width: 28px;
  height: 28px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 24 24'%3E%3Crect x='2' y='4' width='20' height='16' rx='3' ry='3' fill='%23e2e8f0'/%3E%3Cpath d='M4.3 15.4l4.2-4.7a1 1 0 011.48-.04l2.78 2.9 2.3-2.35a1 1 0 011.49.06l3.35 3.73z' fill='%230f172a'/%3E%3Ccircle cx='8.6' cy='9.2' r='1.5' fill='%230f172a'/%3E%3C/svg%3E");
}

.attach-button:hover,
.attach-button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(56, 189, 248, 0.25);
  background: rgba(56, 189, 248, 0.2);
  outline: 2px solid rgba(56, 189, 248, 0.6);
  outline-offset: 2px;
}

.message-input-body {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: 1 1 auto;
  width: 100%;
}

.reply-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  padding: 0.65rem 0.9rem;
  margin-bottom: 0.5rem;
  border-radius: 0.9rem;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  flex-wrap: wrap;
}

.reply-preview__body {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.reply-preview__label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: rgba(56, 189, 248, 0.85);
  text-transform: uppercase;
}

.reply-preview__content {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.reply-preview__author {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reply-preview__text {
  font-size: 0.8rem;
  color: var(--muted-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reply-preview__cancel {
  border: none;
  background: transparent;
  color: rgba(148, 163, 184, 0.75);
  width: 28px;
  height: 28px;
  border-radius: 999px;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  transform: none;
}

.reply-preview__cancel:hover,
.reply-preview__cancel:focus-visible {
  color: var(--danger-color);
  background: rgba(248, 113, 113, 0.1);
  outline: none;
  box-shadow: none;
  transform: none;
}

.message-input-body textarea {
  flex: 1;
  resize: none;
  min-height: 48px;
  max-height: 48px;
  overflow-y: hidden;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.message-input-body .attachment-preview {
  flex: 0 0 auto;
}

.attachment-preview {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 0.75rem;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.35);
  flex: 0 0 auto;
}

.attachment-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.attachment-preview__label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  background: rgba(15, 23, 42, 0.75);
  word-break: break-word;
}

.attachment-preview--video {
  border-color: #f97316;
  background: #0f172a;
}

.attachment-preview--video img {
  display: none;
}

.attachment-preview button {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(15, 23, 42, 0.8);
  color: var(--text-color);
  border-radius: 999px;
  width: 24px;
  height: 24px;
  line-height: 1;
  font-size: 0.9rem;
  padding: 0;
}

.attachment-preview button:hover,
.attachment-preview button:focus-visible {
  background: var(--danger-color);
  color: #fff;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.toast {
  position: fixed;
  top: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.85rem 1.2rem;
  background: rgba(15, 23, 42, 0.9);
  border-radius: 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.3);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.5);
  transition: opacity 0.2s ease;
  z-index: 120;
  max-width: min(calc(100vw - 2rem), 420px);
  text-align: center;
}

.dialog-layer,
.user-popup {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(3px);
  z-index: 80;
}

.dialog-window,
.user-popup-window {
  background: var(--panel-color);
  padding: 1.5rem;
  border-radius: 1rem;
  box-shadow: 0 20px 44px rgba(15, 23, 42, 0.55);
  width: min(360px, 90%);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.dialog-window h2 {
  margin-top: 0;
}

.dialog-window p {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.4;
  word-break: break-word;
}

.dialog-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: transparent;
  border: none;
  color: var(--muted-color);
  font-size: 1.25rem;
  cursor: pointer;
}

.dialog-close:hover,
.dialog-close:focus-visible {
  color: var(--accent-color);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0;
}

.board-access-layer {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
  z-index: 90;
}

.board-access-window {
  width: min(400px, 90%);
  background: var(--panel-color);
  border-radius: 1rem;
  box-shadow: 0 24px 56px rgba(15, 23, 42, 0.55);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.5rem 1.75rem 1.75rem;
  position: relative;
}

.board-access-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.25rem;
}

.board-access-header h2 {
  margin: 0;
  font-size: 1.2rem;
}

.board-access-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.board-access-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.board-access-field label {
  font-size: 0.9rem;
  font-weight: 600;
}

.board-access-field input {
  border-radius: 0.65rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.75);
  color: #f8fafc;
  padding: 0.55rem 0.75rem;
}

.board-access-field input:focus-visible {
  outline: 2px solid rgba(56, 189, 248, 0.6);
  outline-offset: 2px;
}

.board-access-delete-field strong {
  color: var(--danger-color);
}

.board-access-delete-input--armed {
  border-color: rgba(248, 113, 113, 0.85);
  box-shadow: 0 0 0 2px rgba(248, 113, 113, 0.25);
}

.board-access-hint {
  margin: 0;
  font-size: 0.8rem;
  color: rgba(148, 163, 184, 0.85);
}

.board-access-error {
  margin: 0;
  font-size: 0.85rem;
  color: var(--danger-color);
}

.board-access-error.hidden {
  display: none;
}

.board-access-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.board-access-actions__controls {
  display: flex;
  gap: 0.5rem;
}

.board-access-delete {
  margin-right: auto;
  white-space: nowrap;
}

.board-access-delete.armed {
  box-shadow: 0 0 0 2px rgba(248, 113, 113, 0.25);
}

.user-popup-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: stretch;
  text-align: center;
}

.user-popup-char {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted-color);
}

.user-popup-name-row {
  display: flex;
  align-items: baseline;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.user-popup-body h2 {
  margin: 0;
  font-size: 1.1rem;
  word-break: break-word;
}


.user-popup-tail {
  font-size: 0.95rem;
}

.user-popup-body button {
  width: 100%;
}

.user-list-layer {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
  z-index: 85;
}

.user-list-window {
  width: min(720px, 92%);
  max-height: min(80vh, 720px);
  background: var(--panel-color);
  border-radius: 1.25rem;
  box-shadow: 0 24px 56px rgba(15, 23, 42, 0.55);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.user-list-header {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1.25rem 1.5rem 0.5rem;
  gap: 0.75rem;
  order: 0;
}

.user-list-header-info {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.user-list-header-info h2 {
  margin: 0;
  font-size: 1.25rem;
}

.user-list-counts {
  margin: 0;
  font-size: 0.85rem;
  color: rgba(148, 163, 184, 0.9);
  font-weight: 500;
}

.user-list-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-left: auto;
  padding-right: clamp(72px, 12vw, 100px);
}

.user-list-header-actions .secondary {
  min-width: 108px;
  white-space: nowrap;
}

.user-list-close {
  position: absolute;
  top: 1.1rem;
  right: 1.5rem;
}

.user-list-search {
  padding: 0 1.5rem 0.75rem;
}

.user-list-search label {
  display: block;
  margin: 0 0 0.35rem;
  font-size: 0.85rem;
  color: rgba(148, 163, 184, 0.95);
}

.user-list-search input {
  width: 100%;
  padding: 0.65rem 1rem;
  border-radius: 0.8rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.75);
  color: #f8fafc;
}

.user-list-search input:focus-visible {
  outline: 2px solid rgba(56, 189, 248, 0.6);
  outline-offset: 2px;
}

.user-list-content {
  flex: 1 1 auto;
  order: 1;
  padding: 0 1.5rem 1rem;
  overflow-y: auto;
  overscroll-behavior: contain;
}


.user-list-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.user-list-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-radius: 0.9rem;
  background: rgba(15, 23, 42, 0.35);
  border: 1px solid rgba(148, 163, 184, 0.25);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.user-list-item:hover,
.user-list-item:focus-within {
  border-color: rgba(148, 163, 184, 0.55);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.45);
}

.user-list-main {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1 1 auto;
  min-width: 0;
}

.user-list-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem;
}

.user-list-line--primary {
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.user-list-line--secondary {
  font-size: 0.88rem;
  color: var(--muted-color);
  gap: 0.3rem;
  flex-wrap: nowrap;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-list-level {
  font-weight: 700;
  color: var(--accent-color);
  white-space: nowrap;
  margin-right: 0.25rem;
}

.user-list-head {
  color: var(--muted-color);
  min-width: 0;
  word-break: break-word;
}

.user-list-nickname {
  font-size: 1.05rem;
  font-weight: 600;
  word-break: break-word;
}

.user-list-tail {
  font-size: 0.95rem;
  color: var(--muted-color);
  word-break: break-word;
}

.user-list-character {
  font-weight: 500;
  color: rgba(248, 250, 252, 0.92);
  word-break: break-word;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-list-id {
  white-space: nowrap;
  color: rgba(226, 232, 240, 0.9);
  flex: 0 0 auto;
}

.user-list-joined {
  white-space: nowrap;
  flex: 0 0 auto;
}

.user-list-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  flex: 0 0 auto;
  flex-wrap: wrap;
}

.user-list-item--offline {
  background: rgba(15, 23, 42, 0.28);
  border-color: rgba(148, 163, 184, 0.2);
}

.user-list-actions button {
  min-width: 96px;
  white-space: nowrap;
}

.user-list-empty {
  margin: 2rem auto 1rem;
  text-align: center;
  color: var(--muted-color);
  font-size: 0.95rem;
}

.user-list-badge {
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: rgba(94, 234, 212, 0.12);
  color: var(--success-color);
}

.user-list-badge--admin {
  background: rgba(248, 250, 252, 0.12);
  color: rgba(248, 250, 252, 0.85);
  border: 1px solid rgba(248, 250, 252, 0.2);
}

.user-list-badge--offline {
  background: rgba(148, 163, 184, 0.12);
  color: rgba(148, 163, 184, 0.9);
}

.user-level-popover {
  position: fixed;
  top: 0;
  left: 0;
  width: min(240px, 92vw);
  background: var(--panel-color);
  border-radius: 0.9rem;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.55);
  padding: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.3);
  z-index: 120;
}

.user-password-popover {
  position: fixed;
  top: 0;
  left: 0;
  width: min(280px, 94vw);
  background: var(--panel-color);
  border-radius: 0.95rem;
  box-shadow: 0 20px 44px rgba(15, 23, 42, 0.6);
  padding: 1.1rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  z-index: 120;
}

.user-level-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.user-password-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.user-password-form h3 {
  margin: 0;
  font-size: 1rem;
  word-break: break-word;
}

.user-password-hint {
  margin: 0;
  font-size: 0.8rem;
  color: rgba(148, 163, 184, 0.9);
}

.user-password-form label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: rgba(148, 163, 184, 0.95);
}

.user-password-form input {
  padding: 0.55rem 0.85rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.75);
  color: #f8fafc;
}

.user-password-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

.user-level-form h3 {
  margin: 0;
  font-size: 1rem;
  word-break: break-word;
}

.user-level-label {
  font-size: 0.85rem;
  color: var(--muted-color);
}

.user-level-form input[type="number"] {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: 0.65rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.35);
  color: inherit;
  font-size: 0.95rem;
}

.user-level-form input[type="number"]:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(94, 234, 212, 0.25);
}

.user-level-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.user-list-scroller-shadow::before {
  content: '';
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  height: 0.75rem;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0));
}

@media (max-width: 768px) {
  .user-list-window {
    width: min(96vw, 540px);
  }

  .user-list-item {
    flex-direction: column;
    align-items: stretch;
  }

  .user-list-actions {
    justify-content: flex-end;
    flex-wrap: nowrap;
  }

  .user-list-actions button {
    flex: 0 0 auto;
  }
}

@media (max-width: 480px) {
  .user-list-window {
    width: min(98vw, 420px);
    border-radius: 1rem;
  }

  .user-list-header,
  .user-list-search,
  .user-list-content {
    padding-left: 1.1rem;
    padding-right: 1.1rem;
  }

  .user-level-popover {
    width: min(92vw, 320px);
    border-radius: 0.75rem;
  }
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(3px);
  z-index: 50;
}

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 60;
}

.modal-content {
  background: var(--panel-color);
  padding: 1.5rem;
  border-radius: 1rem;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.5);
  width: min(420px, 90%);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
}

.profile-modal-content {
  width: min(620px, 92%);
  max-height: 80vh;
  padding: 2rem 2rem 1.5rem;
  gap: 0.85rem;
  overflow-y: auto;
}

.group-manage-content {
  width: min(420px, 92%);
}

.group-manage-content .dialog-close {
  width: 44px;
  height: 44px;
  font-size: 1.6rem;
}

.group-rename-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.group-rename-form input {
  width: 100%;
}

.group-rename-hint {
  margin: -0.25rem 0 0;
  font-size: 0.8rem;
  color: #64748b;
}

.group-clan-input--readonly {
  background-color: #f8fafc;
  cursor: default;
}

.group-rename-form--disabled {
  opacity: 0.6;
}

.group-rename-form--disabled input {
  cursor: not-allowed;
}

.modal-actions--split {
  justify-content: flex-end;
}

.group-member-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(148, 163, 184, 0.15);
}

.group-member-section__header {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.group-member-section__header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.group-member-section__hint {
  margin: 0;
  font-size: 0.8rem;
  color: rgba(148, 163, 184, 0.8);
}

.group-member-section__hint:empty {
  display: none;
}

.group-member-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  max-height: 220px;
  overflow-y: auto;
}

.group-member-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: 0.85rem;
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.group-member-item__info {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.group-member-item__icon {
  flex: 0 0 auto;
}

.group-member-item__text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.group-member-item__name {
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-color);
}

.group-member-item__badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.18);
  color: rgba(56, 189, 248, 0.95);
}

.group-member-item--owner .group-member-item__badge {
  background: rgba(234, 179, 8, 0.25);
  color: rgba(250, 204, 21, 0.95);
}

.group-member-item--admin .group-member-item__badge {
  background: rgba(96, 165, 250, 0.22);
  color: rgba(59, 130, 246, 0.95);
}

.group-member-item__meta {
  font-size: 0.78rem;
  color: rgba(148, 163, 184, 0.75);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.group-member-item__action {
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(30, 64, 175, 0.12);
  color: rgba(79, 70, 229, 0.9);
  padding: 0.45rem 1rem;
  border-radius: 999px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.group-member-item__action:hover,
.group-member-item__action:focus-visible {
  background: rgba(30, 64, 175, 0.22);
  box-shadow: 0 6px 12px rgba(59, 130, 246, 0.25);
  transform: translateY(-1px);
  outline: none;
}

.group-member-item--owner {
  border-color: rgba(250, 204, 21, 0.45);
  background: rgba(234, 179, 8, 0.12);
}

.group-member-item--admin:not(.group-member-item--owner) {
  border-color: rgba(96, 165, 250, 0.32);
}

.group-member-item--self {
  box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.25);
}

.group-member-empty {
  margin: 0;
  font-size: 0.82rem;
  color: rgba(148, 163, 184, 0.75);
}

.group-delete-section {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0.85rem;
  border-radius: 0.9rem;
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.25);
}

.group-delete-section p {
  margin: 0;
  font-size: 0.85rem;
  color: rgba(248, 113, 113, 0.9);
}

.group-delete-section strong {
  color: #f97316;
}

.group-delete-section input {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(248, 113, 113, 0.35);
}

.group-delete-section button {
  align-self: flex-end;
}

.profile-summary {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.profile-font-picker {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.profile-font-picker select {
  width: 100%;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

.modal-close {
  align-self: flex-end;
  background: rgba(148, 163, 184, 0.2);
  color: var(--text-color);
}

.full-width {
  width: 100%;
  margin-top: 0.5rem;
}

.profile-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.profile-actions--primary {
  justify-content: flex-end;
  width: 100%;
}

#modal-logout-btn {
  margin-right: auto;
}

.profile-logout-button {
  padding: 0.55rem 1.4rem;
  border-radius: 0.75rem;
  min-width: auto;
}

@media (max-width: 960px) {
  .app-body {
    padding: 0.75rem;
    overflow-y: auto;
  }
  .messenger {
    flex-direction: column;
    overflow: visible;
    align-items: stretch;
  }
  .sidebar {
    flex: 0 0 auto;
    width: 100%;
    flex-direction: column;
    gap: 0.75rem;
    height: auto;
    max-height: none;
    overflow: visible;
  }
  .chat-pane {
    flex: 0 0 auto;
    width: 100%;
    min-height: clamp(360px, 62vh, 720px);
  }
  .admin-tools {
    max-height: min(520px, 45vh);
  }
  .chat-messages {
    max-height: calc(100vh - 18rem);
  }
  #room-section {
    min-height: clamp(260px, 45vh, 520px);
  }
}

@media (max-width: 720px) {
  #room-section {
    min-height: clamp(220px, 50vh, 480px);
  }
}

@media (max-width: 640px) {
  .app-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  .header-switches {
    flex-wrap: nowrap;
  }
  .header-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
  }
  .header-button {
    min-width: clamp(148px, 60vw, 220px);
    padding: 0.65rem 1.6rem;
    font-size: 1rem;
  }
  .app-body {
    padding: 0.85rem;
    overflow-y: auto;
  }
  .messenger {
    overflow: visible;
    min-width: 0;
  }
  .sidebar {
    gap: 0.75rem;
    min-width: 0;
    width: 100%;
  }
  .chat-pane {
    padding: 1rem 1.1rem 1.2rem;
    min-width: 0;
    width: 100%;
  }
  #room-section {
    min-height: auto;
  }
  .message-input-body {
    width: 100%;
  }
  .chat-messages {
    font-size: 1.05rem;
  }
  #message-form textarea {
    font-size: 1.05rem;
  }
  button,
  textarea,
  input {
    font-size: 1rem;
  }
}

@media (max-width: 540px) {
  .app-body {
    padding: 0.75rem 0.65rem 1rem;
  }
  .sidebar {
    gap: 0.65rem;
  }
  .header-button {
    min-width: clamp(160px, 70vw, 240px);
    font-size: 1.05rem;
  }
  .chat-pane {
    padding: 0.95rem 1rem 1.1rem;
    border-radius: 0.9rem;
  }
  .chat-messages {
    font-size: 1.08rem;
  }
  #message-form textarea {
    font-size: 1.08rem;
  }
}
