:root {
  --bg: #f6f9ff;
  --card: #ffffff;
  --line: #dfe8ff;
  --text: #1f2a44;
  --muted: #6d7890;
  --primary: #4f7cff;
  --primary2: #73d2ff;
  --danger: #e5484d;
  --shadow: 0 16px 40px rgba(58, 87, 140, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Pretendard", "Malgun Gothic", system-ui, sans-serif;
  background: linear-gradient(180deg, #f8fbff, #eef5ff);
  color: var(--text);
}

.nav {
  position: sticky;
  top: 64px;
  z-index: 40;
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px;
  background: rgba(246, 249, 255, 0.92);
  border-bottom: 1px solid var(--line);
}

.nav a {
  position: relative;
  text-decoration: none;
  color: #375072;
  background: white;
  border: 1px solid var(--line);
  padding: 10px 13px;
  border-radius: 999px;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(58, 87, 140, 0.06);
}

.badge {
  position: absolute;
  top: -7px;
  right: -6px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #ff3b30;
  color: white;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 22px;
}

.hero-card,
.panel,
.post,
.auth-card,
.menu-card {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: var(--shadow);
}

.hero-card {
  padding: 38px;
  background: linear-gradient(135deg, #fff, #eef6ff);
}

.kicker {
  font-size: 13px;
  font-weight: 900;
  color: var(--primary);
}

h1,
h2 {
  letter-spacing: -0.7px;
}

.primary {
  border: 0;
  background: linear-gradient(135deg, var(--primary), var(--primary2));
  color: white !important;
  border-radius: 14px;
  padding: 11px 16px;
  font-weight: 900;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 20px;
}

.menu-card {
  padding: 20px;
  text-decoration: none;
  color: var(--text);
  display: grid;
  gap: 8px;
}

.menu-icon {
  font-size: 30px;
}

.menu-card small {
  color: var(--muted);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.post-list {
  display: grid;
  gap: 16px;
}

.post {
  padding: 20px;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: #eaf1ff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.avatar.big {
  width: 92px;
  height: 92px;
  font-size: 42px;
}

.post-img {
  max-width: 100%;
  border-radius: 18px;
  border: 1px solid var(--line);
  margin-top: 10px;
}

.body {
  line-height: 1.75;
  white-space: normal;
}

.actions {
  display: flex;
  gap: 12px;
  margin-top: 12px;
  align-items: center;
}

.actions form {
  display: inline;
}

.link-danger {
  border: 0;
  background: transparent;
  color: var(--danger);
  cursor: pointer;
  font-weight: 900;
}

.form {
  display: grid;
  gap: 14px;
}

.form label {
  display: grid;
  gap: 7px;
  font-weight: 800;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 11px 12px;
  font: inherit;
  background: white;
}

textarea {
  resize: vertical;
}

.check {
  display: flex !important;
  grid-template-columns: auto 1fr;
  align-items: center;
}

.check input {
  width: auto;
}

.auth-card,
.panel {
  padding: 22px;
}

.profile-row {
  display: flex;
  gap: 18px;
  align-items: center;
  margin: 14px 0;
}

.flash {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 16px;
  background: #fff7d6;
  border: 1px solid #ffe69c;
}

.danger {
  color: var(--danger);
}

.empty {
  padding: 28px;
  background: white;
  border: 1px dashed var(--line);
  border-radius: 22px;
  color: var(--muted);
}

.chat-page {
  display: grid;
  gap: 14px;
}

.chat-bubble b {
  display: block;
  margin-bottom: 3px;
}

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

.chat-input {
  display: flex;
  gap: 10px;
}

.chat-input input {
  flex: 1;
}

.inline-form,
.mini-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 800px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px;
  vertical-align: top;
}

th {
  text-align: left;
  background: #f4f8ff;
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  width: 100%;
}

@media (max-width: 800px) {
  .nav {
    display: none;
    position: fixed;
    top: 64px;
    left: 12px;
    right: 12px;
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: var(--shadow);
  }

  .nav.open {
    display: grid;
  }

  .nav a {
    border-radius: 14px;
  }

  .container {
    padding: 14px;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .chat-input {
    flex-direction: column;
  }
}

/* Admin UX upgrade */

.admin-page {
  display: grid;
  gap: 18px;
}

.admin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.compact {
  margin-bottom: 12px;
}

.search-input {
  max-width: 260px;
}

.role-info {
  display: grid;
  gap: 12px;
}

.role-info div {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f8fbff;
}

.role-info span {
  color: var(--muted);
}

.user-card-list {
  display: grid;
  gap: 14px;
}

.user-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(180deg, #fff, #f7fbff);
  box-shadow: 0 10px 24px rgba(58, 87, 140, 0.08);
}

.user-main {
  display: flex;
  gap: 14px;
  align-items: center;
  min-width: 0;
}

.user-info {
  min-width: 0;
}

.user-name {
  font-size: 20px;
  font-weight: 950;
}

.user-id {
  color: var(--muted);
  font-size: 14px;
  margin-top: 2px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 900;
}

.role-admin {
  background: #fff1d6;
  color: #9b5b00;
}

.role-teacher {
  background: #e6f7ff;
  color: #006d9c;
}

.role-student {
  background: #eef4ff;
  color: #315aa8;
}

.banned {
  background: #ffe8e8;
  color: #c8242f;
}

.normal {
  background: #e9fbe9;
  color: #247a32;
}

.ban-reason {
  margin-top: 8px;
  color: #a83232;
  font-size: 13px;
}

.user-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.role-form {
  display: flex;
  gap: 8px;
}

.role-form select {
  width: 110px;
}

.soft-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: #335173;
  border-radius: 12px;
  padding: 9px 11px;
  font-weight: 900;
  cursor: pointer;
  text-decoration: none;
}

.soft-btn:hover {
  background: #f2f7ff;
  text-decoration: none;
}

.danger-soft {
  border-color: #ffd4d6;
  background: #fff6f6;
  color: #d12b36;
}

.danger-primary {
  background: linear-gradient(135deg, #ff5c61, #ff8a8f) !important;
}

.modal.large {
  width: min(560px, calc(100vw - 28px));
}

.ban-time-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 560px) {
  .ban-time-grid {
    grid-template-columns: 1fr;
  }
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.perm-checks {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f8fbff;
}

.perm-checks label {
  display: flex;
  gap: 8px;
  align-items: center;
  font-weight: 800;
}

.perm-checks input {
  width: auto;
}

@media (max-width: 900px) {
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .user-card {
    grid-template-columns: 1fr;
  }

  .user-actions {
    justify-content: flex-start;
  }

  .role-form {
    width: 100%;
  }

  .role-form select {
    flex: 1;
  }

  .two-col {
    grid-template-columns: 1fr;
  }
}

/* Notice popup */

.notice-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(28, 40, 70, 0.42);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.notice-modal {
  width: min(520px, 100%);
  max-height: calc(100vh - 42px);
  overflow: auto;
  background: white;
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: 0 34px 90px rgba(31, 42, 68, 0.32);
  padding: 22px;
}

.notice-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.notice-modal-head h2 {
  margin: 0;
}

.notice-modal-head button {
  border: 0;
  background: #f1f5ff;
  border-radius: 12px;
  padding: 7px 10px;
  cursor: pointer;
}

.notice-modal-body {
  line-height: 1.75;
  color: var(--text);
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  margin-bottom: 14px;
}

/* Scoped ban chips */

.chip.banned {
  background: #ffe8e8;
  color: #c8242f;
}

/* v2 UI polish */

.muted {
  margin: 0.25rem 0;
  color: var(--muted);
}

.gallery-list {
  grid-template-columns: repeat(3, 1fr);
}

.gallery-post {
  padding: 14px;
}

.gallery-img {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
}

.form-panel {
  max-width: 760px;
  margin: 0 auto;
}

.danger-text {
  color: var(--danger) !important;
}

/* Kakao-like chat */

.chat-actions {
  display: none;
  gap: 4px;
  margin-top: 5px;
}

.chat-bubble:hover .chat-actions {
  display: flex;
}

.chat-actions button {
  border: 0;
  background: rgba(255, 255, 255, 0.8);
  color: #4d6584;
  border-radius: 999px;
  padding: 4px 7px;
  font-size: 11px;
  cursor: pointer;
  font-weight: 800;
}

@media (max-width: 800px) {
  .gallery-list {
    grid-template-columns: 1fr;
  }

  .chat-actions {
    display: flex;
  }
}

/* Seat table input/view */

.seat-table-check {
  font-weight: 900;
  color: #27406f;
}

@media (max-width: 720px) {
  .seat-table-view {
    padding: 12px;
    gap: 10px;
  }

  .seat-table-row {
    grid-template-columns: 1fr;
  }

  .seat-table-seat {
    min-height: 40px;
  }
}

/* v3 interaction polish */

a,
button,
.primary,
.soft-btn,
.menu-card,
.post,
.nav a,
.side-menu a {
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease,
    border-color 0.16s ease;
}

button:hover,
.primary:hover,
.soft-btn:hover,
.menu-card:hover,
.nav a:hover,
.side-menu a:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(58, 87, 140, 0.12);
}

.side-menu {
  position: fixed;
  z-index: 100;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(320px, 82vw);
  padding: 18px;
  background: rgba(255, 255, 255, 0.96);
  border-right: 1px solid var(--line);
  box-shadow: 0 30px 90px rgba(31, 42, 68, 0.24);
  transform: translateX(-105%);
  transition: transform 0.22s ease;
  display: grid;
  align-content: start;
  gap: 8px;
}

.side-menu.open {
  transform: translateX(0);
}

.side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 20px;
}

.side-head button {
  border: 0;
  background: #f1f5ff;
  border-radius: 12px;
  padding: 8px 11px;
  cursor: pointer;
}

.side-menu a {
  position: relative;
  text-decoration: none;
  color: #375072;
  background: white;
  border: 1px solid var(--line);
  padding: 12px 14px;
  border-radius: 15px;
  font-weight: 900;
}

/* profile modal */

.mypage-card {
  display: grid;
  gap: 18px;
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(31, 42, 68, 0.36);
  backdrop-filter: blur(4px);
}

.modal-backdrop.show {
  display: block;
}

.modal {
  max-height: calc(100vh - 40px);
  overflow: auto;
  display: none;
  position: fixed;
  z-index: 210;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(460px, calc(100vw - 28px));
  background: white;
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 30px 90px rgba(31, 42, 68, 0.28);
  padding: 20px;
}

.modal.show {
  display: block;
}

.modal-head {
  gap: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.modal-head h2 {
  margin: 0;
}

.modal-head button {
  border: 0;
  background: #f1f5ff;
  border-radius: 12px;
  padding: 7px 10px;
  cursor: pointer;
}

/* notifications */

.notification-card {
  display: block;
  text-decoration: none;
  color: var(--text);
  background: white;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px;
  box-shadow: 0 8px 18px rgba(58, 87, 140, 0.06);
}

.notification-card p {
  color: var(--muted);
  line-height: 1.6;
}

/* post/comment */

.post-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.post-meta > div {
  display: grid;
  gap: 2px;
}

.post-author {
  font-weight: 900;
  color: var(--text);
}

.icon-btn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  width: 36px;
  height: 36px;
  font-weight: 900;
  cursor: pointer;
}

.post-menu-wrap {
  position: relative;
}

.post-menu {
  display: none;
  position: absolute;
  top: 42px;
  right: 0;
  min-width: 140px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 18px 42px rgba(31, 42, 68, 0.16);
  padding: 8px;
  z-index: 20;
}

.post-menu-wrap.open .post-menu {
  display: grid;
}

.post-menu a,
.post-menu button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 10px 11px;
  border-radius: 10px;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.post-menu a:hover,
.post-menu button:hover {
  background: #f3f7ff;
}

.comments {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.comments h3 {
  font-size: 16px;
}

.comment {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 10px 0;
}

.avatar.small {
  width: 28px;
  height: 28px;
  font-size: 13px;
}

.comment p {
  margin: 4px 0;
  line-height: 1.5;
}

.comment-empty {
  color: var(--muted);
  font-size: 14px;
}

.comment-form {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.comment-form input {
  flex: 1;
}

/* seats */

.current-seat-post {
  border-color: #75b7ff !important;
  box-shadow: 0 20px 48px rgba(79, 124, 255, 0.2) !important;
  background: linear-gradient(180deg, #fff, #eef7ff) !important;
}

.seat-period-badge {
  padding: 7px 10px;
  border-radius: 999px;
  background: #eef4ff;
  color: #315aa8;
  font-size: 12px;
  font-weight: 950;
}

.seat-period-badge.now {
  background: #ffefbd;
  color: #945c00;
}

.seat-period-line {
  margin: 8px 0 12px;
  color: #5a6b86;
  font-weight: 800;
}

.seat-table-tools {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff, #f6f9ff);
}

.seat-helper {
  padding: 13px;
  border: 1px dashed rgba(79, 124, 255, 0.35);
  border-radius: 16px;
  background: #f8fbff;
}

.seat-helper-title {
  font-weight: 950;
  margin-bottom: 8px;
  color: #335173;
}

.seat-helper pre {
  color: #1f2a44;
  margin: 0;
  white-space: pre-wrap;
  font-family: "Consolas", "D2Coding", monospace;
  line-height: 1.8;
}

.seat-table-view {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72);
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(122, 143, 191, 0.2);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.94),
    rgba(244, 248, 255, 0.94)
  );
}

.seat-table-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.seat-table-pair {
  box-shadow: 0 6px 14px rgba(58, 87, 140, 0.06);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 8px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid rgba(122, 143, 191, 0.18);
}

.seat-table-seat {
  color: #1f2a44;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 13px;
  background: linear-gradient(135deg, #eef5ff, #f9fcff);
  font-weight: 950;
  border: 1px solid rgba(122, 143, 191, 0.16);
}

/* article viewer */

.article-title-link {
  text-decoration: none;
  color: var(--text);
}

.article-title-link:hover {
  color: var(--primary);
}

.article-viewer {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
}

.slide-stage {
  height: 70vh;
  background: #0f172a;
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.article-slide {
  display: none;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.article-slide.active {
  display: block;
}

.slide-btn {
  border: 0;
  border-radius: 18px;
  background: white;
  box-shadow: var(--shadow);
  font-size: 42px;
  width: 58px;
  height: 74px;
  cursor: pointer;
}

.slide-counter {
  text-align: center;
  font-weight: 950;
  margin-top: 10px;
}

/* chat */

.chat-list {
  height: 60vh;
  overflow: auto;
  border: 1px solid var(--line);
  padding: 16px;
  display: grid;
  align-content: start;
  gap: 10px;
  background: linear-gradient(180deg, #eaf4ff, #f8fbff);
  border-radius: 26px;
}

.chat-msg.same-group {
  margin-top: -5px;
}

.chat-stack {
  display: grid;
  gap: 3px;
  max-width: 76%;
}

.chat-msg.mine .chat-stack {
  justify-items: end;
}

.chat-name {
  font-size: 13px;
  margin-left: 2px;
  color: #40536d;
}

.chat-msg.mine .chat-bubble {
  background: #dff0ff;
  border-color: #b7dcff;
}

.chat-time {
  font-size: 10px;
  color: #7c8799;
  white-space: nowrap;
  margin-bottom: 2px;
}

.edited {
  display: inline-block;
  margin-left: 5px;
  font-size: 10px;
  color: #8792a6;
}

.reply-preview {
  display: grid;
  gap: 2px;
  width: 100%;
  border: 0;
  text-align: left;
  border-left: 3px solid #8fb7ff;
  background: rgba(255, 255, 255, 0.72);
  padding: 6px 8px;
  border-radius: 10px;
  margin-bottom: 6px;
  color: #56657c;
  cursor: pointer;
}

.reply-preview b {
  font-size: 12px;
}

.reply-preview span {
  font-size: 12px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.reply-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 10px 12px;
}

.reply-box p {
  margin: 3px 0 0;
  color: var(--muted);
  max-width: 720px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.reply-box button {
  border: 0;
  background: #f2f6ff;
  border-radius: 12px;
  padding: 7px 10px;
  cursor: pointer;
}

.chat-context-menu {
  display: none;
  position: fixed;
  z-index: 500;
  min-width: 130px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 20px 52px rgba(31, 42, 68, 0.22);
  padding: 7px;
}

.chat-context-menu.show {
  display: grid;
}

.chat-context-menu button {
  border: 0;
  background: transparent;
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  font-weight: 900;
  cursor: pointer;
}

.chat-context-menu button:hover {
  background: #f3f7ff;
}

.return-origin-btn {
  position: sticky;
  bottom: 82px;
  z-index: 30;
  justify-self: center;
  border: 0;
  border-radius: 999px;
  background: #1f2a44;
  color: #fff;
  padding: 10px 14px;
  font-weight: 950;
  box-shadow: 0 14px 32px rgba(31, 42, 68, 0.22);
  cursor: pointer;
}

.jump-highlight .chat-bubble {
  outline: 3px solid #ffcf5a;
  animation: pulseJump 1.4s ease;
}

@keyframes pulseJump {
  0%,
  100% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.04);
  }
}

@media (max-width: 800px) {
  .comment-form {
    flex-direction: column;
  }

  .seat-table-row {
    grid-template-columns: 1fr;
  }

  .article-viewer {
    grid-template-columns: 1fr;
  }

  .slide-btn {
    width: 100%;
    height: 46px;
  }

  .slide-stage {
    height: 62vh;
  }

  .chat-stack {
    max-width: 82%;
  }
}

.desktop-nav {
  position: sticky;
  top: 64px;
  z-index: 40;
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 12px;
  background: rgba(246, 249, 255, 0.92);
  border-bottom: 1px solid var(--line);
}

.desktop-nav-item {
  text-decoration: none;
  color: #375072;
  background: white;
  border: 1px solid var(--line);
  padding: 11px 16px;
  border-radius: 999px;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(58, 87, 140, 0.06);
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.library-menu {
  position: fixed;
  z-index: 100;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(720px, 92vw);
  background: #ffffff;
  border-right: 1px solid var(--line);
  box-shadow: 0 30px 90px rgba(31, 42, 68, 0.28);
  transform: translateX(-105%);
  transition: transform 0.24s ease;
  display: grid;
  grid-template-rows: auto 1fr;
}

.library-menu.open {
  transform: translateX(0);
}

.library-menu-head {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  font-size: 20px;
}

.library-menu-head button {
  border: 0;
  background: #f1f5ff;
  border-radius: 12px;
  padding: 8px 11px;
  cursor: pointer;
}

.library-menu-body {
  display: grid;
  grid-template-columns: 190px 1fr;
  min-height: 0;
}

.library-menu-groups {
  background: linear-gradient(180deg, #f4f8ff, #eef5ff);
  border-right: 1px solid var(--line);
  padding: 14px;
  display: grid;
  align-content: start;
  gap: 10px;
}

.library-group-btn {
  border: 1px solid transparent;
  background: transparent;
  border-radius: 16px;
  padding: 14px 12px;
  font: inherit;
  font-weight: 900;
  color: #40536d;
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  text-align: left;
}

.library-group-btn.active {
  background: white;
  border-color: var(--line);
  color: #2457c5;
  box-shadow: 0 10px 24px rgba(58, 87, 140, 0.1);
}

.library-menu-items {
  padding: 22px;
  overflow: auto;
}

.library-menu-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.library-menu-title h2 {
  margin: 0;
}

.library-link-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.library-link {
  position: relative;
  text-decoration: none;
  color: var(--text);
  background: linear-gradient(180deg, #ffffff, #f7fbff);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(58, 87, 140, 0.06);
}

.library-link:hover,
.desktop-nav-item:hover,
.library-group-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(58, 87, 140, 0.14);
}

@media (max-width: 800px) {
  .desktop-nav {
    display: none;
  }

  .library-menu {
    width: min(560px, 94vw);
  }

  .library-menu-body {
    grid-template-columns: 128px 1fr;
  }

  .library-menu-groups {
    padding: 10px;
  }

  .library-group-btn {
    padding: 12px 8px;
    font-size: 14px;
  }

  .library-link-list {
    grid-template-columns: 1fr;
  }
}

/* v5 clean mobile-only menu */

.top {
  position: sticky;
  top: 0;
  z-index: 60;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

.top-title {
  text-align: center;
  line-height: 1.25;
}

.top-kicker {
  font-size: 12px;
  font-weight: 950;
  color: #5d77c2;
  letter-spacing: 0.6px;
}

.motto {
  letter-spacing: -0.5px;
  font-size: 20px;
  font-weight: 950;
  color: #1f2a44;
}

.side-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(20, 30, 50, 0.38);
  backdrop-filter: blur(4px);
}

.side-backdrop.show {
  display: block;
}

.mobile-menu {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  width: min(360px, 88vw);
  background: #fff;
  border-left: 1px solid var(--line);
  box-shadow: -30px 0 80px rgba(31, 42, 68, 0.22);
  transform: translateX(105%);
  transition: transform 0.24s ease;
  padding: 18px;
  display: grid;
  align-content: start;
  gap: 10px;
}

.mobile-menu.open {
  transform: translateX(0);
}

.mobile-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.mobile-menu-head button {
  border: 0;
  background: #f1f5ff;
  border-radius: 12px;
  padding: 8px 11px;
  cursor: pointer;
}

.mobile-menu-link,
.mobile-menu-bottom a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-decoration: none;
  color: var(--text);
  background: linear-gradient(180deg, #fff, #f7fbff);
  border: 1px solid var(--line);
  border-radius: 17px;
  padding: 14px;
  font-weight: 950;
}

.mobile-menu-folder {
  border: 1px solid var(--line);
  border-radius: 17px;
  background: #f5f8ff;
  padding: 14px;
  font: inherit;
  font-weight: 950;
  color: #223554;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  margin-bottom: 12px;
}

.mobile-menu-folder.open {
  background: #fff;
  color: #2457c5;
  box-shadow: 0 10px 24px rgba(58, 87, 140, 0.1);
}

.mobile-menu-sub a {
  position: relative;
  text-decoration: none;
  color: #40536d;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 13px;
  font-weight: 900;
}

.mobile-menu-bottom {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.badge.inline {
  position: static;
  margin-left: 8px;
}

.page-slide {
  animation: pageIn 0.24s ease both;
}

.page-slide-out {
  animation: pageOut 0.18s ease both;
}

@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateX(18px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pageOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(-18px);
  }
}

/* timetable */

.plan-panel {
  margin-top: 18px;
}

.plan-table .today {
  background: #e6f1ff;
  border-color: #75b7ff;
  color: #1657c8;
  box-shadow: 0 8px 18px rgba(79, 124, 255, 0.14);
}

/* seat dedicated modal */

.seat-preview-empty {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 18px;
  background: #f8fbff;
  color: var(--muted);
}

.seat-editor-modal {
  display: none;
  position: fixed;
  z-index: 210;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(760px, calc(100vw - 28px));
  max-height: calc(100vh - 36px);
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: 0 30px 90px rgba(31, 42, 68, 0.28);
  padding: 20px;
}

.seat-editor-modal.show {
  display: block;
}

.seat-editor-grid {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.seat-editor-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.seat-editor-input {
  text-align: center;
  font-weight: 950;
  min-width: 0;
}

.seat-extra-desc {
  padding: 12px 14px;
  border-radius: 16px;
  background: #f8fbff;
  border: 1px solid var(--line);
  color: #40536d;
  line-height: 1.7;
}

/* gallery video */

.gallery-video {
  width: 100%;
  max-height: 420px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #111827;
  margin-top: 10px;
}

.video-link-card {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 110px;
  text-decoration: none;
  color: #fff;
  background: linear-gradient(135deg, #1f2a44, #4f7cff);
  border-radius: 18px;
  font-weight: 950;
  margin-top: 10px;
}

.upload-note {
  padding: 12px;
  border-radius: 14px;
  background: #fff9e8;
  border: 1px solid #ffe2a6;
  color: #7a5614;
  font-weight: 800;
}

@media (max-width: 800px) {
  .hamburger {
    display: inline-flex;
  }

  .motto {
    padding-right: 56px;
    padding-left: 52px;
    font-size: 16px;
  }

  .top {
    justify-content: center;
  }

  .seat-editor-row {
    grid-template-columns: repeat(3, 1fr);
  }
}

.desktop-nav,
.nav {
  display: none !important;
}

.chat-context-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 480;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(3px);
}

.chat-context-backdrop.show {
  display: block;
}

.chat-context-modal {
  display: none;
  position: fixed;
  z-index: 500;
  left: 50%;
  top: 50%;
  width: min(320px, calc(100vw - 32px));
  transform: translate(-50%, -50%);
  background: white;
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 30px 90px rgba(31, 42, 68, 0.3);
  padding: 16px;
}

.chat-context-modal.show {
  display: grid;
  gap: 8px;
}

.chat-context-modal button {
  border: 0;
  background: #f6f9ff;
  border-radius: 14px;
  padding: 13px 14px;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  text-align: left;
}

.chat-context-modal button:hover {
  background: #eaf2ff;
}

.chat-msg {
  scroll-margin: 120px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.chat-msg.mine {
  flex-direction: row-reverse;
  grid-template-columns: minmax(0, 1fr) 42px;
}

.chat-msg.mine .chat-profile-area {
  grid-column: 2;
  grid-row: 1;
}

.chat-profile-area {
  width: 42px;
  min-width: 42px;
}

.chat-content-area {
  display: grid;
  gap: 3px;
  min-width: 0;
  max-width: 78%;
}

.chat-msg.mine .chat-content-area {
  grid-column: 1;
  grid-row: 1;
  justify-items: end;
  margin-left: auto;
}

.chat-avatar {
  width: 36px;
  height: 36px;
}

.chat-avatar.ghost {
  visibility: hidden;
}

.chat-row {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  min-width: 0;
}

.chat-msg.mine .chat-row {
  flex-direction: row-reverse;
}

.chat-bubble {
  position: relative;
  background: #fff;
  border: 1px solid rgba(160, 184, 230, 0.55);
  border-radius: 18px;
  padding: 9px 11px;
  box-shadow: 0 8px 16px rgba(58, 87, 140, 0.06);
  max-width: min(520px, 100%);
  word-break: break-word;
}

.plan-table-wrap {
  overflow-x: auto;
  border-radius: 18px;
  background: white;
  box-shadow: 0 8px 22px rgba(58, 87, 140, 0.08);
}

.plan-table {
  border-spacing: 8px;
  overflow: hidden;
  border-radius: 18px;
  box-shadow: 0 8px 20px rgba(58, 87, 140, 0.08);
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
  background: white;
}

.plan-table th,
.plan-table td {
  border-radius: 14px;
  background: white;
  border: 1px solid #dfe8ff;
  padding: 14px 12px;
  text-align: center;
  font-weight: 950;
  color: #061933;
  line-height: 1.25;
}

.plan-table thead th {
  background: #e9f1ff;
  color: #315ccf;
  font-size: 17px;
}

.plan-table .period-col {
  width: 82px;
  background: #f8fbff;
  color: #061933;
}

.plan-table th.today,
.plan-table td.today {
  background: #e8f3ff;
  color: #225be3;
}

@media (max-width: 720px) {
  .plan-table {
    border-radius: 14px;
    min-width: 0;
    font-size: 12px;
  }

  .plan-table th,
  .plan-table td {
    padding: 10px 4px;
  }

  .plan-table .period-col {
    display: none;
  }
}

.mobile-menu-sub {
  padding: 3px 0 6px 18px;
  display: grid;
  gap: 8px;
  padding-left: 18px;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(-6px);
  transition:
    max-height 0.28s ease,
    opacity 0.22s ease,
    transform 0.22s ease,
    padding-top 0.22s ease,
    padding-bottom 0.22s ease;
  padding-top: 0;
  padding-bottom: 0;
}

.mobile-menu-sub.show {
  display: grid;
  gap: 8px;
  max-height: 240px;
  opacity: 1;
  transform: translateY(0);
  padding-top: 3px;
  padding-bottom: 6px;
}

.folder-icon {
  position: relative;
  width: 18px;
  height: 18px;
  display: inline-block;
}

.folder-icon::before,
.folder-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transform: translate(-50%, -50%);
  transition:
    transform 0.24s ease,
    opacity 0.2s ease;
}

/* 세로줄: + 상태 */

.folder-icon::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

/* 열림 상태: 세로줄 사라져서 - */

.mobile-menu-folder.open .folder-icon::after {
  transform: translate(-50%, -50%) rotate(0deg);
  opacity: 0;
}

.mobile-menu-folder.open .folder-icon::before {
  transform: translate(-50%, -50%) rotate(180deg);
}

/* PC에서도 햄버거 버튼 항상 표시 */

.hamburger {
  position: absolute;
  right: 14px;
  left: auto;
  top: 15px;
  border: 0;
  border-radius: 16px;
  background: #edf4ff;
  font-size: 24px;
  padding: 8px 13px;
  cursor: pointer;
  display: flex !important;
}

/* 데스크톱 메뉴 전부 숨김 */

.nav,
.navbar,
.menu,
.desktop-menu,
.top-nav,
.main-nav,
.quick-menu,
.page-nav {
  display: none !important;
}
/* 모바일 메뉴 통일 스타일 */
.mobile-menu {
  gap: 0;
}

#menuContainer,
.mobile-menu-bottom {
  display: grid;
  gap: 12px;
}

.mobile-menu-link,
.mobile-menu-folder,
.mobile-menu-bottom a {
  width: 100%;
  min-height: 62px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff, #f7fbff);
  color: var(--text);
  font-size: 18px;
  font-weight: 950;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(58, 87, 140, 0.06);

  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 0 14px;

  border-radius: 14px;

  font-size: 15px;
  font-weight: 800;
}

.mobile-menu-folder {
  margin: 0;
}

.mobile-menu-folder span,
.mobile-menu-link span,
.mobile-menu-bottom a span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.mobile-menu-folder.open {
  background: linear-gradient(180deg, #eef5ff, #ffffff);
  color: #2457c5;
  border-color: #cddcff;
}

.mobile-menu-sub {
  margin: 0;
  padding-left: 16px;
}

.mobile-menu-sub.show {
  margin-top: 8px;
  margin-bottom: 10px;
}

.mobile-menu-sub a {
  min-height: 52px;
  padding: 0 16px;
  border-radius: 16px;
  font-size: 16px;
  background: #ffffff;

  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mobile-menu-bottom {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.mobile-menu-sub a:hover {
  transform: translateY(-3px);

  border-color: #c7d9ff;

  box-shadow: 0 10px 24px rgba(58, 87, 140, 0.12);

  color: #2457c5;
}
.article-tools {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 12px 0;
}

.slide-stage {
  cursor: grab;
  touch-action: none;
}

.slide-stage.dragging {
  cursor: grabbing;
}

.article-slide {
  transform-origin: center center;
  transition: transform 0.08s ease-out;
  user-select: none;
  -webkit-user-drag: none;
}

.article-slide.active {
  display: block;
}
@media (max-width: 720px) {
  .slide-btn {
    width: 40px;
    height: 40px;

    min-height: 40px;

    font-size: 28px;
  }
}
@media (max-width: 720px) {
  .article-viewer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "prev next"
      "image image";

    gap: 10px;
  }

  .slide-stage {
    grid-area: image;
  }

  .slide-btn:first-of-type {
    grid-area: prev;

    position: static;
    transform: none;

    width: 100%;
    height: 48px;
  }

  .slide-btn:last-of-type {
    grid-area: next;

    position: static;
    transform: none;

    width: 100%;
    height: 48px;
  }
}
#menuContainer {
  display: block;
}

.mobile-menu-link,
.mobile-menu-folder {
  margin-bottom: 16px;
}

.mobile-menu-sub {
  display: grid;
  gap: 10px;

  max-height: 0;
  opacity: 0;
  overflow: hidden;

  margin-top: -16px;
  margin-bottom: 16px;
  padding-left: 16px;

  transform: translateY(-6px);

  transition:
    max-height 0.28s ease,
    opacity 0.22s ease,
    transform 0.22s ease,
    margin-top 0.22s ease;
}

.mobile-menu-sub.show {
  max-height: 260px;
  opacity: 1;

  margin-top: -4px;
  margin-bottom: 16px;

  transform: translateY(0);
}
/* timetable redesign */
.plan-table-wrap {
  overflow-x: auto;
  border-radius: 20px;
  background: white;
  border: 1px solid rgba(122, 143, 191, 0.16);
  box-shadow: 0 10px 24px rgba(88, 109, 165, 0.06);
}

.plan-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  border-spacing: 0;
  background: white;
  box-shadow: none;
}

.plan-table th,
.plan-table td {
  border: 0;
  border-bottom: 1px solid rgba(122, 143, 191, 0.14);
  border-right: 1px solid rgba(122, 143, 191, 0.1);
  border-radius: 0;
  padding: 12px 10px;
  text-align: center;
  font-size: 14px;
  font-weight: 800;
  color: #1a2540;
  background: rgba(255, 255, 255, 0.82);
  white-space: nowrap;
}

.plan-table th:last-child,
.plan-table td:last-child {
  border-right: 0;
}

.plan-table tbody tr:last-child th,
.plan-table tbody tr:last-child td {
  border-bottom: 0;
}

.plan-table thead th {
  background: #edf3ff;
  color: #4862b5;
  font-size: 14px;
  font-weight: 950;
}

.plan-table .period-col {
  width: 76px;
  background: #f8fbff;
  color: #1a2540;
  font-weight: 950;
}

.plan-table th.today,
.plan-table td.today {
  background: #eef6ff;
  color: #3053cc;
  font-weight: 950;
}
.birthday-sort {
  display: flex;
  gap: 8px;
}

.birthday-list {
  display: grid;
  gap: 12px;
}

.birthday-card {
  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;

  box-shadow: 0 8px 18px rgba(58, 87, 140, 0.06);

  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease;
}

.birthday-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(58, 87, 140, 0.12);
}

.birthday-name {
  font-size: 18px;
  font-weight: 950;
  color: var(--text);
}

.birthday-type {
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
}

.birthday-date {
  font-size: 18px;
  font-weight: 950;
  color: var(--primary);
}
.birthday-toolbar {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.birthday-search {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 13px 14px;
  font-weight: 800;
}

.search-mark {
  background: #fff2a8;
  color: inherit;
  border-radius: 5px;
  padding: 0 3px;
}
.plan-info {
  display: flex;
  justify-content: space-between;
  gap: 10px;

  margin-bottom: 10px;
  padding: 12px 14px;

  border: 1px solid rgba(122, 143, 191, 0.16);
  border-radius: 16px;

  background: #f8fbff;
  color: #31457a;
  font-weight: 900;
}

.plan-info span {
  color: var(--muted);
}

.plan-table-wrap {
  overflow-x: auto;
  border-radius: 20px;
  background: white;
  border: 1px solid rgba(122, 143, 191, 0.16);
  box-shadow: 0 10px 24px rgba(88, 109, 165, 0.06);
}

.plan-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  background: white;
}

.plan-table th,
.plan-table td {
  border: 0;
  border-bottom: 1px solid rgba(122, 143, 191, 0.14);
  border-right: 1px solid rgba(122, 143, 191, 0.1);

  padding: 12px 10px;
  text-align: center;

  font-size: 14px;
  font-weight: 850;
  color: #1a2540;
  background: rgba(255, 255, 255, 0.82);
  white-space: nowrap;
}

.plan-table th:last-child,
.plan-table td:last-child {
  border-right: 0;
}

.plan-table tbody tr:last-child th,
.plan-table tbody tr:last-child td {
  border-bottom: 0;
}

.plan-table thead th {
  background: #edf3ff;
  color: #4862b5;
  font-weight: 950;
}

.plan-table .period-col {
  width: 76px;
  background: #f8fbff;
  color: #1a2540;
  font-weight: 950;
}

.plan-table th.today,
.plan-table td.today {
  background: #eef6ff;
  color: #3053cc;
  font-weight: 950;
}

@media (max-width: 720px) {
  .plan-info {
    display: grid;
    gap: 4px;
  }

  .plan-table {
    min-width: 0;
  }

  .plan-table th,
  .plan-table td {
    padding: 9px 4px;
    font-size: 12px;
  }

  .plan-table .period-col {
    display: none;
  }
}
.plan-week-buttons {
  display: flex;
  gap: 8px;
  margin: 10px 0 12px;
}

.plan-week-buttons .soft-btn.active {
  background: #eaf2ff;
  border-color: #9bbcff;
  color: #2457c5;
}
.meal-week-buttons {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.meal-week-buttons .soft-btn.active {
  background: #eaf2ff;
  border-color: #9bbcff;
  color: #2457c5;
}

.meal-list {
  display: grid;
  gap: 12px;
}

.meal-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
}

.meal-card h3 {
  margin: 0 0 8px;
}

.meal-menu {
  line-height: 1.7;
  font-weight: 800;
}
.meal-empty {
  color: #8a94a6;
  font-weight: 700;
  padding: 12px 0;
}
.meal-card.today {
  border: 2px solid #7aa7ff;
  background: #eef5ff;
  box-shadow: 0 4px 12px rgba(122, 167, 255, 0.15);
}

.meal-card.today h3 {
  color: #2f5fd0;
}
.plan-table td.changed {
  background: #fff7bf;
}

.plan-table td.changed .plan-subject {
  display: inline;
  padding: 0 4px;
  border-radius: 4px;
  background: linear-gradient(transparent 45%, rgba(255, 221, 64, 0.75) 45%);
}
.avatar.empty,
.chat-avatar.empty {
  object-fit: cover;
  background: #f4f7ff;
}

.chat-avatar.ghost {
  visibility: hidden;
}
/* mypage redesign */

.mypage-wrap {
  width: min(860px, 100%);
  margin: 34px auto;
}

.mypage-card {
  padding: 34px;
  display: grid;
  gap: 28px;
}

.mypage-card .profile-row {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 24px;
}

.mypage-card .avatar.big {
  width: 118px;
  height: 118px;
  flex: 0 0 auto;
  border: 4px solid #fff;
  box-shadow: 0 14px 34px rgba(58, 87, 140, 0.18);
}

.profile-info h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 42px);
}

.profile-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.profile-actions .soft-btn,
.profile-actions .primary {
  width: 100%;
  min-height: 48px;
  border-radius: 16px;
}

/* modal fix */

.modal-backdrop {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw;
  height: 100vh;
  z-index: 900 !important;
  background: rgba(15, 23, 42, 0.58) !important;
  backdrop-filter: blur(6px);
}

.modal-backdrop.show {
  display: block !important;
}

.modal.mypage-modal {
  position: fixed !important;
  left: 50% !important;
  top: 50% !important;
  z-index: 910 !important;
  transform: translate(-50%, -50%) !important;

  width: min(480px, calc(100vw - 28px));
  max-height: calc(100dvh - 32px);
  overflow-y: auto;

  padding: 24px;
  border-radius: 28px;
  box-shadow: 0 34px 100px rgba(15, 23, 42, 0.36);
}

.modal.mypage-modal.show {
  display: block !important;
}

.modal-head {
  margin-bottom: 18px;
}

.modal-head h2 {
  font-size: 22px;
}

.modal-head button {
  width: 38px;
  height: 38px;
  font-size: 16px;
}

.default-profile-form {
  margin-top: 12px;
}

.default-profile-form .soft-btn {
  width: 100%;
  min-height: 44px;
}

@media (max-width: 720px) {
  .mypage-wrap {
    margin: 12px auto;
  }

  .mypage-card {
    padding: 22px;
    border-radius: 24px;
  }

  .mypage-card .profile-row {
    flex-direction: column;
    text-align: center;
    gap: 14px;
  }

  .mypage-card .avatar.big {
    width: 104px;
    height: 104px;
  }

  .profile-actions {
    grid-template-columns: 1fr;
  }

  .profile-actions .soft-btn,
  .profile-actions .primary {
    min-height: 52px;
    font-size: 15px;
  }

  .modal.mypage-modal {
    width: calc(100vw - 22px);
    padding: 20px;
    border-radius: 24px;
  }
}
.reply-box[hidden] {
  display: none !important;
}
.birthday-sort button.soft-btn.active {
  background: #2563eb !important;
  color: #fff !important;
  border-color: #2563eb !important;
}
.primary.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.static-page {
  display: grid;
  gap: 18px;
}

.static-page h1 {
  margin-bottom: 4px;
}

.static-block {
  display: grid;
  gap: 12px;
}

.static-block h2 {
  font-size: 22px;
  font-weight: 900;
  color: #243252;
}

.static-card-list,
.static-number-list {
  display: grid;
  gap: 12px;
}

.charm-item,
.number-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: white;
  border: 1px solid rgba(122, 143, 191, 0.14);
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 8px 18px rgba(88, 109, 165, 0.06);
}

.charm-icon,
.number-badge {
  min-width: 38px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #eef3ff, #f2fbff);
  color: #4e69ba;
  font-weight: 900;
  font-size: 14px;
  flex-shrink: 0;
}

.charm-text,
.number-text {
  flex: 1;
  font-size: 15px;
  line-height: 1.8;
  color: #1a2540;
  word-break: keep-all;
}
.seat-live-editor {
  display: grid;
  gap: 14px;
  background: #fff;
  border: 1px solid rgba(122, 143, 191, 0.22);
  border-radius: 28px;
  padding: 22px;
  box-shadow: 0 12px 28px rgba(88, 109, 165, 0.08);
}

.seat-live-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.seat-live-pair {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  background: #fff;
  border-radius: 18px;
  padding: 10px;
  box-shadow: 0 8px 18px rgba(88, 109, 165, 0.06);
}

.seat-live-input {
  width: 100%;
  height: 54px;
  border-radius: 14px;
  border: 1px solid #d9e5ff;
  background: linear-gradient(180deg, #f7fbff, #eef5ff);
  text-align: center;
  font-size: 16px;
  font-weight: 800;
  color: #1a2540;
}

.seat-live-input:focus {
  outline: none;
  border-color: #5b8cff;
  box-shadow: 0 0 0 3px rgba(91, 140, 255, 0.15);
}

@media (max-width: 720px) {
  .seat-live-row {
    grid-template-columns: 1fr;
  }
}
.seat-live-editor {
  display: grid;
  gap: 14px;
  background: #fff;
  border: 1px solid rgba(122, 143, 191, 0.22);
  border-radius: 28px;
  padding: 22px;
  box-shadow: 0 12px 28px rgba(88, 109, 165, 0.08);
}

.seat-live-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.seat-live-pair {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  background: #fff;
  border-radius: 18px;
  padding: 10px;
  box-shadow: 0 8px 18px rgba(88, 109, 165, 0.06);
}

.seat-live-input {
  width: 100%;
  height: 54px;
  border-radius: 14px;
  border: 1px solid #d9e5ff;
  background: linear-gradient(180deg, #f7fbff, #eef5ff);
  text-align: center;
  font-size: 16px;
  font-weight: 800;
  color: #1a2540;
}

.seat-live-input:focus {
  outline: none;
  border-color: #5b8cff;
  box-shadow: 0 0 0 3px rgba(91, 140, 255, 0.15);
}

@media (max-width: 720px) {
  .seat-live-row {
    grid-template-columns: 1fr;
  }
}

/* ===== v2 socket/update 리팩토링 추가 스타일 ===== */
.section-head-stacked {
  align-items: flex-start;
}
.section-write-btn {
  display: inline-flex;
  margin-top: 10px;
}
.board-table-wrap {
  display: grid;
  gap: 8px;
  background: #fff;
  border: 1px solid rgba(122, 143, 191, 0.16);
  border-radius: 22px;
  padding: 12px;
  box-shadow: 0 10px 24px rgba(88, 109, 165, 0.07);
}
.board-table-head,
.board-table-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px 70px;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
}
.board-table-head {
  font-weight: 900;
  color: #5b6685;
  border-bottom: 1px solid rgba(122, 143, 191, 0.16);
}
.board-table-row {
  color: inherit;
  text-decoration: none;
  border-radius: 14px;
  transition:
    background 0.15s ease,
    transform 0.15s ease;
}
.board-table-row:hover {
  background: #f4f8ff;
  transform: translateY(-1px);
}
.board-title-cell {
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.board-detail {
  display: grid;
  gap: 14px;
}
.dynamic-list {
  display: grid;
  gap: 10px;
}
.dynamic-item {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  align-items: center;
  background: #fff;
  border: 1px solid rgba(122, 143, 191, 0.16);
  border-radius: 18px;
  padding: 10px;
}
.rank-item {
  grid-template-columns: 140px minmax(0, 1fr) auto;
}
.tournament-view,
.tournament-block {
  display: grid;
  gap: 10px;
}
.tournament-item,
.tournament-rank {
  display: grid;
  gap: 6px;
  background: #fff;
  border: 1px solid rgba(122, 143, 191, 0.16);
  border-radius: 16px;
  padding: 12px;
}
.tournament-item em {
  color: #2563eb;
  font-style: normal;
  font-weight: 800;
}
@media (max-width: 720px) {
  .board-table-head,
  .board-table-row {
    grid-template-columns: minmax(0, 1fr) 80px 52px;
    font-size: 14px;
  }
  .dynamic-item,
  .rank-item {
    grid-template-columns: 1fr;
  }
}

/* ===== v2.1 realtime/comment/profile fixes ===== */
.board-author-cell,
.board-detail-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.board-author-cell span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-detail-head {
  align-items: flex-start;
}

.comment-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.comment-list.closed,
.comment-replies.closed {
  display: none !important;
}

.comment-body {
  flex: 1;
  min-width: 0;
}

.comment-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.reply-comment-btn {
  border: 0;
  background: #eef4ff;
  color: #4265b9;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.comment-replies {
  margin-top: 8px;
  margin-left: 12px;
  padding-left: 12px;
  border-left: 2px solid #dce7ff;
}

.comment.reply {
  padding: 8px 0;
}

.reply-target {
  width: 100%;
  padding: 8px 10px;
  border-radius: 12px;
  background: #f3f7ff;
  color: #526179;
  font-size: 13px;
  font-weight: 700;
}

.board-comment-form {
  flex-wrap: wrap;
}

@media (max-width: 720px) {
  .board-table-head,
  .board-table-row {
    grid-template-columns: minmax(0, 1fr) 96px 54px;
    gap: 8px;
    padding: 11px 8px;
  }

  .board-author-cell .avatar.small {
    width: 22px;
    height: 22px;
  }
}
.mobile-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 18px 16px;
  margin: -4px -4px 12px;
  border-radius: 0 0 24px 24px;
  background:
    radial-gradient(
      circle at 12% 18%,
      rgba(255, 255, 255, 0.45),
      transparent 28%
    ),
    linear-gradient(135deg, #5b7cfa 0%, #7c5cff 45%, #ff7ab6 100%);
  color: #fff;
  box-shadow: 0 14px 30px rgba(91, 124, 250, 0.28);
}

.mobile-menu-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.mobile-menu-logo {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(10px);
  font-weight: 900;
  letter-spacing: -0.5px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.mobile-menu-title {
  font-size: 13px;
  font-weight: 800;
  opacity: 0.88;
  letter-spacing: 0.2px;
}

.mobile-menu-motto {
  margin-top: 4px;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.25;
  letter-spacing: -0.5px;
  word-break: keep-all;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
}

.mobile-menu-close {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.28);
  color: #ffffff;
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
  backdrop-filter: blur(8px);
  box-shadow:
    0 8px 18px rgba(15, 23, 42, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
  transition:
    transform 0.15s ease,
    background 0.15s ease,
    border-color 0.15s ease;
}

.mobile-menu-close:hover {
  background: rgba(15, 23, 42, 0.45);
  border-color: rgba(255, 255, 255, 0.8);
  transform: rotate(90deg) scale(1.04);
}

@media (max-width: 420px) {
  .mobile-menu-head {
    padding: 16px 14px 14px;
  }

  .mobile-menu-logo {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
    border-radius: 14px;
    font-size: 14px;
  }

  .mobile-menu-motto {
    font-size: 14px;
  }
}
.mobile-menu-close {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border: 1px solid rgba(79, 70, 229, 0.28);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.92);
  color: #4f46e5;
  cursor: pointer;

  display: grid;
  place-items: center;

  box-shadow:
    0 10px 22px rgba(79, 70, 229, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);

  transition:
    transform 0.18s ease,
    background 0.18s ease,
    color 0.18s ease,
    border-color 0.18s ease;
}

.mobile-menu-close span {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  line-height: 1;
  font-size: 19px;
  font-weight: 900;
  transform: translateY(-1px);
}

.mobile-menu-close:hover,
.mobile-menu-close:active,
.mobile-menu-close.clicked {
  background: #ff4f9a;
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.75);
  transform: rotate(90deg) scale(1.05);
}

/* POST 방식 로그아웃 버튼: 기존 메뉴 링크와 같은 모양 */
.mobile-menu-bottom .logout-form {
  margin: 0;
  width: 100%;
}

.mobile-menu-bottom .logout-form button {
  width: 100%;
  min-height: 62px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff, #f7fbff);
  color: var(--text);
  font: inherit;
  font-size: 18px;
  font-weight: 950;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(58, 87, 140, 0.06);
}

/* 2026-06-17 실시간/권한 UI 보완 */
.mobile-menu-link,
.mobile-menu-folder,
.mobile-menu-sub a,
.mobile-menu-bottom a,
.mobile-menu-bottom .logout-form button {
  transition:
    transform 0.18s ease,
    background 0.18s ease,
    color 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.mobile-menu-link:hover,
.mobile-menu-folder:hover,
.mobile-menu-sub a:hover,
.mobile-menu-bottom a:hover,
.mobile-menu-bottom .logout-form button:hover {
  transform: translateY(-3px);
  border-color: #c7d9ff;
  box-shadow: 0 10px 24px rgba(58, 87, 140, 0.12);
  color: #2457c5;
  background: linear-gradient(180deg, #f3f7ff, #ffffff);
}

.mobile-menu-bottom .logout-form {
  margin: 0;
  width: 100%;
}

.mobile-menu-bottom .logout-form button {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff, #f7fbff);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(58, 87, 140, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.library-frame {
  width: 100%;
  height: calc(100vh - 190px);
  min-height: 700px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}

.library-fallback {
  margin-top: 10px;
}

.realtime-toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 9999;
  width: min(380px, calc(100vw - 36px));
  padding: 15px 17px;
  border: 1px solid #cddcff;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.97);
  color: var(--text);
  text-decoration: none;
  box-shadow: 0 18px 50px rgba(32, 61, 110, 0.2);
  display: grid;
  gap: 5px;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.realtime-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.realtime-toast span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.permission-group-panel {
  margin-bottom: 18px;
}

.permission-group-list {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.permission-group-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  overflow: hidden;
}

.permission-group-card > summary {
  cursor: pointer;
  padding: 15px 17px;
  font-weight: 900;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  background: #f8fbff;
}

.permission-group-body,
.permission-group-card.new-group .group-editor {
  padding: 16px;
  display: grid;
  gap: 16px;
}

.permission-check-grid,
.group-member-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}

.permission-check-item,
.group-member-grid label {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 11px 12px;
  background: #fbfdff;
}

.permission-check-item span {
  display: grid;
  gap: 3px;
}

.permission-check-item small,
.group-member-grid small {
  color: var(--muted);
  font-weight: 600;
}

.permission-chip {
  background: #efeaff;
  color: #6344b8;
}

.moderation-log-list {
  display: grid;
  gap: 10px;
}

.moderation-log-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px 15px;
  display: grid;
  gap: 5px;
  background: #fff;
}

.moderation-log-item p {
  margin: 0;
}

.moderation-log-item small {
  color: var(--muted);
}

.board-detail-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin: 10px 0 18px;
}

.board-detail-actions form {
  margin: 0;
}

@media (max-width: 700px) {
  .library-frame {
    height: calc(100vh - 160px);
    min-height: 620px;
  }
}

.permission-category {
  margin: 14px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
}
.permission-category legend {
  padding: 0 8px;
  font-weight: 900;
  color: #375072;
}

/* Admin and shared modal stacking fix
   The shared backdrop uses z-index 900, so every regular modal moved
   directly under <body> must stay above it. */
body > .modal {
  z-index: 910 !important;
  filter: none !important;
  backdrop-filter: none !important;
}

body > .modal.show {
  display: block !important;
}


/* ===== media edit state + newspaper viewer ===== */
.media-field {
  display: grid;
  gap: 8px;
}

.media-field-label {
  font-weight: 900;
  color: var(--text);
}

.smart-file-picker {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f8fbff;
}

.smart-file-input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.smart-file-name {
  min-width: 0;
  flex: 1 1 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #52627a;
  font-weight: 800;
}

.media-preview-modal {
  width: min(900px, calc(100vw - 28px));
  z-index: 930 !important;
}

.media-preview-backdrop {
  z-index: 920 !important;
}

.media-preview-stage {
  height: min(68vh, 720px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 18px;
  background: #101827;
}

.media-preview-stage img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.media-preview-filename {
  margin-top: 3px;
  max-width: 620px;
  color: var(--muted);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-preview-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 12px;
}

body.modal-open {
  overflow: hidden;
}

.article-open-card {
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.article-open-card:hover {
  transform: translateY(-2px);
  border-color: #bfd2ff;
  box-shadow: 0 16px 34px rgba(58, 87, 140, 0.13);
}

.slide-counter {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 12px;
}

.slide-counter strong {
  max-width: min(70vw, 620px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.slide-stage.can-drag {
  cursor: grab;
}

.slide-stage.can-drag.dragging {
  cursor: grabbing;
}

@media (max-width: 640px) {
  .smart-file-picker {
    align-items: stretch;
  }

  .smart-file-picker .soft-btn {
    flex: 1 1 auto;
  }

  .smart-file-name {
    order: -1;
    flex-basis: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .media-preview-stage {
    height: 62vh;
  }
}


/* Notice popup form state */
.notice-popup-settings .form-help {
  margin: 6px 0 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.notice-popup-dependent,
.notice-period-settings {
  transition: opacity 0.18s ease;
}

.notice-popup-dependent.is-disabled,
.notice-period-settings.is-disabled {
  opacity: 0.48;
}

.notice-popup-dependent.is-disabled,
.notice-period-settings.is-disabled,
.notice-popup-dependent.is-disabled *,
.notice-period-settings.is-disabled * {
  cursor: not-allowed;
}

.notice-modal-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.notice-modal-remaining {
  color: #8b95a7;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}


/* Home weekly birthday */
.weekly-birthday-panel {
  margin-bottom: 28px;
}

.birthday-week-buttons {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.birthday-week-buttons .soft-btn.active {
  background: var(--primary, #6f8cff);
  color: #fff;
  border-color: transparent;
}

.weekly-birthday-list {
  display: grid;
  gap: 12px;
}

.weekly-birthday-card {
  display: grid;
  grid-template-columns: minmax(88px, auto) 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 17px 18px;
  border: 1px solid var(--line, #e4e9f2);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(42, 60, 98, 0.06);
}

.weekly-birthday-date {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.weekly-birthday-date strong {
  font-size: 19px;
}

.weekly-birthday-date span,
.weekly-birthday-message {
  color: var(--muted, #77839a);
  font-size: 14px;
}

.weekly-birthday-person {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.weekly-birthday-person strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 17px;
}

.weekly-birthday-role {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef3ff;
  color: #526aa5;
  font-size: 12px;
  font-weight: 800;
}

.birthday-week-empty {
  min-height: 100px;
  display: grid;
  place-items: center;
}

@media (max-width: 680px) {
  .weekly-birthday-card {
    grid-template-columns: 78px 1fr;
    gap: 10px 12px;
  }

  .weekly-birthday-message {
    grid-column: 1 / -1;
  }
}

/* 2026-06-18 모바일 채팅 및 햄버거 메뉴 반응형 보완 */
body[data-path="/chat"] {
  height: 100dvh;
  overflow: hidden;
}

body[data-path="/chat"] .container {
  height: calc(100dvh - 72px);
  min-height: 0;
  overflow: hidden;
  padding-bottom: max(14px, env(safe-area-inset-bottom));
}

body[data-path="/chat"] #livePageContent,
body[data-path="/chat"] .chat-page {
  height: 100%;
  min-height: 0;
}

body[data-path="/chat"] .chat-page {
  position: relative;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  gap: 10px;
}

body[data-path="/chat"] .section-head {
  margin-bottom: 0;
}

body[data-path="/chat"] .chat-list {
  height: auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

body[data-path="/chat"] .reply-box {
  margin: 0;
  max-height: 86px;
  overflow: auto;
}

body[data-path="/chat"] .chat-input {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 -8px 24px rgba(58, 87, 140, 0.1);
  backdrop-filter: blur(12px);
}

body[data-path="/chat"] .chat-input input {
  width: 100%;
  min-width: 0;
  min-height: 46px;
}

body[data-path="/chat"] .chat-input .primary {
  min-width: 72px;
  min-height: 46px;
}

.scroll-latest-btn {
  position: absolute;
  right: 14px;
  bottom: 72px;
  z-index: 8;
  border: 1px solid #cbdcff;
  border-radius: 999px;
  padding: 9px 13px;
  background: rgba(255, 255, 255, 0.96);
  color: #2457c5;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 10px 26px rgba(58, 87, 140, 0.2);
  cursor: pointer;
}

.scroll-latest-btn[hidden] {
  display: none;
}

.mobile-menu {
  height: 100dvh;
  max-height: 100dvh;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr) auto;
  align-content: stretch;
  overflow: hidden;
  padding-top: max(14px, env(safe-area-inset-top));
  padding-bottom: max(14px, env(safe-area-inset-bottom));
}

.mobile-menu-head {
  min-height: 0;
  flex-shrink: 0;
}

#menuContainer {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 2px 3px 12px;
}

.mobile-menu-bottom {
  min-height: 0;
  max-height: 42dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  margin-top: 8px;
  padding-top: 10px;
  padding-bottom: 2px;
  background: #fff;
}

body.side-menu-open {
  overflow: hidden;
  touch-action: none;
}

@media (max-width: 800px) {
  body[data-path="/chat"] .container {
    padding: 8px 10px max(8px, env(safe-area-inset-bottom));
  }

  body[data-path="/chat"] .section-head h1 {
    margin: 0;
    font-size: 23px;
  }

  body[data-path="/chat"] .section-head .muted {
    display: none;
  }

  body[data-path="/chat"] .chat-list {
    padding: 10px 8px;
    border-radius: 18px;
  }

  body[data-path="/chat"] .chat-input {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 8px;
  }

  body[data-path="/chat"] .chat-content-area {
    max-width: 86%;
  }

  .mobile-menu {
    width: min(360px, 94vw);
    padding-left: 12px;
    padding-right: 12px;
  }

  .mobile-menu-head {
    margin-bottom: 8px;
  }

  #menuContainer,
  .mobile-menu-bottom {
    gap: 8px;
  }

  .mobile-menu-link,
  .mobile-menu-folder,
  .mobile-menu-bottom a,
  .mobile-menu-bottom .logout-form button {
    min-height: 44px;
    padding: 0 12px;
    font-size: 14px;
  }

  .mobile-menu-sub a {
    min-height: 42px;
    padding: 0 13px;
    font-size: 14px;
  }
}

@media (max-height: 650px) {
  .mobile-menu-head {
    padding-top: 10px;
    padding-bottom: 10px;
    margin-bottom: 6px;
  }

  .mobile-menu-logo {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }

  .mobile-menu-motto {
    font-size: 12px;
  }

  .mobile-menu-bottom {
    max-height: 38dvh;
  }
}

/* 관람 계정 읽기 전용 표시 */
.viewer-lock-notice,
.viewer-readonly-note {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 14px;
  background: rgba(99, 102, 241, 0.07);
  color: #4b5563;
}

.viewer-lock-notice b {
  display: block;
  margin-bottom: 5px;
  color: #3730a3;
}

.viewer-lock-notice p,
.viewer-readonly-note {
  line-height: 1.55;
}

.viewer-lock-notice p {
  margin: 0;
}

.chat-readonly-note {
  flex: 0 0 auto;
  margin: 8px 0 0;
  text-align: center;
}

.chip.role-viewer_no_chat_board,
.chip.role-viewer_no_chat,
.chip.role-viewer_no_board,
.chip.role-viewer_all {
  background: #eef2ff;
  color: #4338ca;
}
