:root {
  font-family: Pretendard, ui-rounded, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #253236;
  background: #f8fbff;
  --mint: #4fc3ad;
  --mint-dark: #23796d;
  --cream: #fff7df;
  --peach: #ffddd3;
  --yellow: #ffe8a7;
  --green: #dff4d6;
  --purple: #e5dcff;
  --blue: #dff2ff;
  --pink: #ffe3ee;
  --ink: #253236;
  --muted: #6f7f86;
  --card: rgba(255, 255, 255, 0.78);
  --line: rgba(215, 230, 236, 0.82);
  --shadow: 0 22px 70px rgba(35, 83, 96, 0.14);
  --shadow-soft: 0 12px 32px rgba(35, 83, 96, 0.10);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% 10%, rgba(255, 221, 211, 0.9), transparent 24%),
    radial-gradient(circle at 88% 6%, rgba(223, 242, 255, 0.95), transparent 26%),
    radial-gradient(circle at 70% 80%, rgba(229, 220, 255, 0.78), transparent 30%),
    linear-gradient(150deg, #fffaf1 0%, #f5fcff 47%, #f7f4ff 100%);
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,.7) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(to bottom, #000, transparent 82%);
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.5; }

.app-shell { min-height: 100vh; position: relative; }

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px clamp(16px, 4vw, 42px);
  background: rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(22px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 8px 28px rgba(70, 102, 115, 0.06);
}

.brand {
  border: 0;
  background: transparent;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-align: left;
}
.brand-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 20px;
  background: linear-gradient(135deg, #ffffff, #e9fff9);
  box-shadow: 0 14px 28px rgba(58, 144, 132, 0.18);
  font-size: 26px;
}
.brand strong, .brand small { display: block; }
.brand strong { letter-spacing: -0.03em; }
.brand small { color: var(--muted); margin-top: 2px; }

.top-nav { display: flex; gap: 8px; }
.top-nav button, .ghost-button, .text-button {
  border: 0;
  background: rgba(255, 255, 255, 0.78);
  border-radius: 999px;
  padding: 10px 14px;
  color: #435a60;
  box-shadow: 0 8px 20px rgba(53, 96, 105, 0.08);
}
.text-button {
  padding: 4px 0;
  background: transparent;
  color: #7b8b91;
  font-size: 0.76rem;
  text-decoration: underline;
  box-shadow: none;
}

.page {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: clamp(18px, 4vw, 44px);
}
.narrow-page { width: min(540px, 100%); }

.hero-card, .student-welcome, .admin-hero {
  display: grid;
  grid-template-columns: 1.35fr 0.95fr;
  gap: clamp(18px, 4vw, 42px);
  align-items: center;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 38px;
  padding: clamp(24px, 5vw, 54px);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.hero-card::after, .student-welcome::after, .admin-hero::after {
  content: '';
  position: absolute;
  inset: 1px;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255,255,255,.7), transparent 38%, rgba(255,255,255,.28));
}
.hero-card > *, .student-welcome > *, .admin-hero > * { position: relative; z-index: 1; }
.student-welcome, .admin-hero { grid-template-columns: 1fr auto; margin-bottom: 22px; }

h1, h2, p { margin-top: 0; }
h1 {
  font-size: clamp(2rem, 5vw, 3.75rem);
  line-height: 1.04;
  letter-spacing: -0.055em;
  margin-bottom: 14px;
}
h2 { font-size: 1.38rem; letter-spacing: -0.03em; }
.eyebrow {
  display: inline-flex;
  width: fit-content;
  padding: 8px 13px;
  border-radius: 999px;
  background: rgba(225, 247, 239, 0.9);
  color: #23796d;
  font-weight: 900;
  font-size: 0.86rem;
  margin-bottom: 16px;
}
.hero-text { color: #52656b; font-size: 1.08rem; line-height: 1.72; }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.button-row.right { justify-content: flex-end; }
.button-row.compact { margin-top: 12px; }

.primary-button, .secondary-button, .help-button {
  border: 0;
  border-radius: 18px;
  padding: 12px 18px;
  font-weight: 900;
  transition: transform 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
}
.primary-button {
  color: white;
  background: linear-gradient(135deg, #34b9a4, #6dd6c2 60%, #9bdcff);
  box-shadow: 0 12px 24px rgba(52, 159, 141, 0.26);
}
.secondary-button {
  color: #385f67;
  background: rgba(255,255,255,.88);
  border: 1px solid rgba(208, 231, 236, 0.9);
  box-shadow: 0 8px 18px rgba(48, 97, 109, 0.08);
}
.help-button { color: #884a4a; background: #ffe5df; box-shadow: 0 8px 20px rgba(199, 109, 91, .14); }
.help-button.small, .danger-lite { padding: 9px 12px; border-radius: 14px; font-size: 0.88rem; }
.danger-lite { color: #965a54; background: #fff0ed; }
.large-action { font-size: 1.02rem; padding: 15px 20px; border-radius: 22px; }
.primary-button:hover, .secondary-button:hover, .help-button:hover { transform: translateY(-1px); }

.hero-art { position: relative; min-height: 280px; display: grid; place-items: center; }
.hero-phone {
  width: min(270px, 80vw);
  min-height: 230px;
  border-radius: 34px;
  padding: 26px;
  background: linear-gradient(180deg, rgba(255,255,255,.95), rgba(250,253,255,.82));
  box-shadow: 0 30px 70px rgba(53, 96, 105, .18);
  border: 1px solid rgba(255,255,255,.95);
  transform: rotate(-3deg);
}
.hero-phone span { display: inline-flex; padding: 7px 10px; border-radius: 999px; background: #e9fff9; color: #23796d; font-weight: 900; font-size: .82rem; }
.hero-phone strong { display: block; font-size: 1.55rem; margin: 42px 0 10px; letter-spacing: -.04em; }
.hero-phone p { color: var(--muted); line-height: 1.6; }
.orb {
  position: absolute;
  display: grid;
  place-items: center;
  width: 70px;
  height: 70px;
  border-radius: 26px;
  background: rgba(255,255,255,.88);
  box-shadow: 0 18px 34px rgba(35, 83, 96, .14);
  font-size: 32px;
  z-index: 2;
}
.orb-a { left: 8%; top: 16%; transform: rotate(-10deg); }
.orb-b { right: 8%; top: 8%; transform: rotate(10deg); }
.orb-c { right: 18%; bottom: 12%; transform: rotate(8deg); }

.guide-character {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255, 255, 255, 0.82);
  border-radius: 28px;
  padding: 18px;
  box-shadow: var(--shadow-soft);
}
.guide-face {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  border-radius: 28px;
  background: var(--cream);
  font-size: 48px;
}
.guide-bubble {
  position: relative;
  background: #ffffff;
  border-radius: 22px;
  padding: 16px;
  font-weight: 900;
  line-height: 1.5;
}
.guide-bubble::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 28px;
  width: 16px;
  height: 16px;
  background: white;
  transform: rotate(45deg);
}
.character-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 6px 10px;
  background: white;
  font-weight: 900;
  color: #405258;
  box-shadow: 0 8px 16px rgba(63, 101, 110, 0.08);
}
.character-small { padding: 5px; width: 36px; height: 36px; justify-content: center; }
.character-medium { min-height: 42px; }
.character-large { padding: 10px 16px; font-size: 1.1rem; }
.character-mint, .character-mint .guide-face { background: #e1f7ef; }
.character-cream, .character-cream .guide-face { background: #fff4d7; }
.character-yellow, .character-yellow .guide-face { background: #fff0bd; }
.character-peach, .character-peach .guide-face { background: #ffe2d9; }
.character-green, .character-green .guide-face { background: #dff3d6; }
.character-purple, .character-purple .guide-face { background: #e8e3ff; }
.character-blue, .character-blue .guide-face { background: #dff1ff; }
.character-pink, .character-pink .guide-face { background: #ffe1ec; }

.install-card, .soft-card {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: 30px;
  padding: 20px;
  box-shadow: var(--shadow-soft);
}
.install-card { margin-top: 20px; display: flex; gap: 16px; align-items: flex-start; }
.install-card.premium { background: linear-gradient(135deg, rgba(255,255,255,.9), rgba(233,255,249,.82)); }
.install-card.installed { background: #ecfff8; }
.install-emoji { font-size: 32px; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 18px; background: #fff; box-shadow: var(--shadow-soft); }
.install-guide { margin-top: 12px; padding: 12px 14px; border-radius: 18px; background: rgba(255,255,255,.72); }
.install-guide ol { margin: 0; padding-left: 20px; color: #52656b; line-height: 1.75; }

.principle-grid, .room-grid, .stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 20px;
}
.principle-grid article, .stats-grid article {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255,255,255,.88);
  border-radius: 26px;
  padding: 18px;
  box-shadow: 0 8px 18px rgba(55, 95, 107, 0.08);
}
.principle-grid strong, .principle-grid span, .stats-grid strong, .stats-grid span { display: block; }
.principle-grid span, .stats-grid span { color: var(--muted); margin-top: 8px; line-height: 1.5; }
.stats-grid strong { font-size: 2.2rem; color: var(--mint-dark); }

.form-card { display: grid; gap: 14px; }
label { display: grid; gap: 8px; font-weight: 900; }
input, select, textarea {
  width: 100%;
  border: 1px solid #dce9e5;
  background: rgba(255,255,255,.92);
  color: var(--ink);
  border-radius: 18px;
  padding: 13px 14px;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
}
input:focus, select:focus, textarea:focus {
  border-color: #75ceb9;
  box-shadow: 0 0 0 4px rgba(79, 195, 173, 0.16);
}
textarea { resize: vertical; }
.tiny-note { color: var(--muted); font-size: 0.82rem; line-height: 1.6; margin-bottom: 0; }
.error-text { color: #c14545; font-weight: 900; margin-bottom: 0; }

.student-welcome p { color: #52656b; line-height: 1.7; }
.student-actions { display: grid; gap: 10px; min-width: 180px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.time-chip, .room-badge {
  display: inline-flex;
  width: fit-content;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.82);
  color: #507176;
  font-weight: 900;
  font-size: .84rem;
  box-shadow: 0 6px 14px rgba(55, 95, 107, .08);
}
.my-room-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px;
  border-radius: 26px;
  background: rgba(255,255,255,.58);
  box-shadow: var(--shadow-soft);
}
.my-room-strip div { display: flex; gap: 8px; flex-wrap: wrap; }
.my-room-strip button { border: 0; border-radius: 999px; background: white; color: #405258; padding: 9px 12px; font-weight: 900; }

.room-grid { grid-template-columns: repeat(3, 1fr); }
.room-card {
  position: relative;
  overflow: hidden;
  min-height: 258px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(255,255,255,.82);
  border: 1px solid rgba(255,255,255,.92);
  border-radius: 30px;
  padding: 20px;
  box-shadow: var(--shadow-soft);
}
.room-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 82% 12%, rgba(255,255,255,.7), transparent 30%);
  pointer-events: none;
}
.room-card > * { position: relative; z-index: 1; }
.room-card.locked { filter: grayscale(.12); }
.room-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.room-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 20px;
  background: rgba(255,255,255,.82);
  font-size: 28px;
  box-shadow: 0 10px 20px rgba(55, 95, 107, .08);
}
.room-card strong { font-size: 1.18rem; letter-spacing: -.03em; }
.room-card small { color: #5f7178; font-weight: 900; }
.room-card p { color: #52656b; line-height: 1.6; flex: 1; }
.room-meta, .room-footer { display: flex; justify-content: space-between; gap: 8px; color: #61757c; font-size: .82rem; }
.room-footer { border-top: 1px solid rgba(255,255,255,.82); padding-top: 10px; }
.gradient-sunset { background: linear-gradient(145deg, rgba(255,246,235,.94), rgba(255,221,211,.86)); }
.gradient-sky { background: linear-gradient(145deg, rgba(245,252,255,.96), rgba(223,242,255,.88)); }
.gradient-leaf { background: linear-gradient(145deg, rgba(250,255,247,.96), rgba(223,244,214,.88)); }
.gradient-star { background: linear-gradient(145deg, rgba(255,250,235,.96), rgba(255,232,167,.82)); }
.gradient-peach { background: linear-gradient(145deg, rgba(255,255,255,.96), rgba(255,226,219,.86)); }
.gradient-violet { background: linear-gradient(145deg, rgba(255,255,255,.96), rgba(229,220,255,.88)); }

.chat-page { width: min(940px, 100%); }
.chat-card {
  background: rgba(255,255,255,.78);
  border: 1px solid rgba(255,255,255,.9);
  border-radius: 34px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  background: linear-gradient(135deg, rgba(255,255,255,.95), rgba(233,255,249,.72));
  border-bottom: 1px solid var(--line);
}
.chat-header strong, .chat-header small { display: block; }
.chat-header small { color: var(--muted); margin-top: 4px; }
.chat-submeta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; color: #6b8087; font-size: .8rem; }
.chat-submeta span { padding: 5px 8px; border-radius: 999px; background: rgba(255,255,255,.72); }
.chat-header-actions { display: flex; gap: 8px; align-items: center; }
.member-strip {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 18px;
  background: rgba(255,255,255,.46);
  border-bottom: 1px solid var(--line);
}
.night-card {
  margin: 16px 18px 0;
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 16px;
  border-radius: 24px;
  background: #f0edff;
}
.moon { font-size: 32px; }
.message-list {
  min-height: 420px;
  max-height: 58vh;
  overflow: auto;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.message-row { display: flex; gap: 10px; align-items: flex-start; }
.message-row.mine { flex-direction: row-reverse; }
.message-bubble {
  max-width: min(620px, 78%);
  padding: 14px 16px;
  border-radius: 22px 22px 22px 8px;
  background: rgba(255,255,255,.92);
  box-shadow: 0 10px 22px rgba(55, 95, 107, .08);
}
.message-row.mine .message-bubble {
  border-radius: 22px 22px 8px 22px;
  background: linear-gradient(135deg, #e5fff8, #f4fbff);
}
.message-meta { display: flex; justify-content: space-between; gap: 12px; color: #61757c; font-size: .82rem; }
.message-bubble p { margin: 8px 0; line-height: 1.6; }
.message-warning { color: #b06445; font-weight: 900; }
.empty-message { display: grid; place-items: center; padding: 40px 0; }
.chat-input {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 16px;
  background: rgba(255,255,255,.64);
  border-top: 1px solid var(--line);
}

.admin-columns { display: grid; grid-template-columns: 1.1fr .9fr; gap: 18px; margin: 18px 0; }
.alias-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.alias-card { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px; border-radius: 20px; background: rgba(255,255,255,.68); }
code { background: #f3fbff; padding: 6px 8px; border-radius: 10px; color: #3c6970; font-weight: 900; }
.table-list { display: grid; gap: 10px; }
.table-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 20px;
  background: rgba(255,255,255,.68);
  border: 1px solid rgba(255,255,255,.82);
}
.table-row.compact { grid-template-columns: 1fr auto auto; }
.table-row strong, .table-row small { display: block; }
.table-row small { color: var(--muted); margin-top: 4px; }
.row-actions { display: flex; gap: 8px; }
.muted-row { opacity: .62; }
.report-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.report-card { padding: 16px; border-radius: 22px; background: rgba(255,255,255,.68); border: 1px solid rgba(255,255,255,.82); }
.report-header { display: flex; justify-content: space-between; gap: 10px; }
.context-line { margin: 8px 0; color: #52656b; }
.empty-line { color: var(--muted); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.room-create-modal { width: min(640px, calc(100vw - 28px)); }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(29, 48, 54, 0.32);
  backdrop-filter: blur(12px);
}
.modal-card {
  width: min(620px, calc(100vw - 28px));
  max-height: calc(100vh - 40px);
  overflow: auto;
  display: grid;
  gap: 14px;
  padding: 22px;
  border-radius: 32px;
  background: rgba(255,255,255,.92);
  box-shadow: 0 24px 80px rgba(17, 48, 58, .22);
  border: 1px solid rgba(255,255,255,.96);
}
.notice {
  position: fixed;
  top: 78px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  width: min(560px, calc(100vw - 24px));
  padding: 14px 16px;
  border-radius: 18px;
  box-shadow: var(--shadow-soft);
  font-weight: 900;
  text-align: center;
}
.notice-info { background: #e9f7ff; color: #2c6477; }
.notice-success { background: #e9fff6; color: #23796d; }
.notice-warning { background: #fff5d7; color: #8a6a23; }
.notice-danger { background: #ffe5e2; color: #a33f3a; }

@media (max-width: 900px) {
  .hero-card, .student-welcome, .admin-hero { grid-template-columns: 1fr; border-radius: 30px; }
  .hero-art { min-height: 220px; }
  .principle-grid, .room-grid, .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-columns { grid-template-columns: 1fr; }
  .report-list { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .app-header { align-items: flex-start; }
  .brand small { display: none; }
  .page { padding: 16px; }
  .principle-grid, .room-grid, .stats-grid { grid-template-columns: 1fr; }
  .chat-header { align-items: flex-start; flex-direction: column; }
  .chat-header-actions { width: 100%; justify-content: space-between; }
  .chat-input { grid-template-columns: 1fr; }
  .message-bubble { max-width: 84%; }
  .alias-list { grid-template-columns: 1fr; }
  .table-row, .table-row.compact { grid-template-columns: 1fr; }
  .row-actions { flex-wrap: wrap; }
  .two-col { grid-template-columns: 1fr; }
  .my-room-strip { align-items: flex-start; flex-direction: column; }
}

.server-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  color: #36515d;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 10px 24px rgba(57, 97, 112, 0.08);
  white-space: nowrap;
}
.server-connected {
  color: #167356;
  background: rgba(220, 255, 239, 0.9);
}
.server-saving,
.server-checking {
  color: #725218;
  background: rgba(255, 243, 207, 0.9);
}
.server-local-only,
.server-error {
  color: #8a3a3a;
  background: rgba(255, 225, 225, 0.9);
}

.admin-settings-card {
  display: grid;
  gap: 16px;
  margin: 18px 0;
  background: linear-gradient(135deg, rgba(255,255,255,.88), rgba(233,255,249,.74));
}
.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.toggle-line {
  display: flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255,255,255,.72);
}
.toggle-line input {
  width: 20px;
  height: 20px;
  accent-color: var(--mint);
  box-shadow: none;
}
.server-live {
  color: #146f62;
  background: rgba(214, 255, 244, 0.95);
}
@media (max-width: 900px) {
  .settings-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  .settings-grid { grid-template-columns: 1fr; }
  .toggle-line { width: 100%; }
}


/* v0.4.3 관리자 별칭 카드 관리 */
.section-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(79, 195, 173, 0.12);
  color: var(--mint-dark);
  font-weight: 900;
  white-space: nowrap;
}

.alias-manager-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 14px 0 18px;
}

.mini-form {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.58);
}

.mini-form h3,
.alias-manager h3 {
  margin: 0;
}

.alias-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border-radius: 20px;
  background: rgba(248, 251, 255, 0.8);
  border: 1px dashed rgba(79, 195, 173, 0.36);
}

.alias-list-managed {
  grid-template-columns: 1fr;
  margin-bottom: 16px;
}

.alias-card.managed {
  align-items: center;
}

.alias-card.managed > div {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.inactive-alias-list {
  opacity: 0.82;
}

.settings-save-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 6px;
}

.settings-save-row .tiny-note {
  max-width: 560px;
}

@media (max-width: 820px) {
  .alias-manager-grid,
  .admin-columns {
    grid-template-columns: 1fr;
  }

  .settings-save-row,
  .section-title-row {
    flex-direction: column;
    align-items: stretch;
  }
}

/* v0.4.4 별칭 카드 인쇄·학급별 묶음·캐릭터 관리·스크롤 개선 */
.admin-columns {
  align-items: start;
}

.admin-room-card {
  align-self: start;
  position: sticky;
  top: 92px;
  max-height: calc(100vh - 112px);
  overflow: auto;
}

.alias-manager {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 112px);
  overflow: hidden;
}

.alias-manager-header {
  flex: 0 0 auto;
}

.alias-manager-scroll {
  min-height: 0;
  overflow: auto;
  padding-right: 6px;
}

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

.character-image {
  width: 1.45em;
  height: 1.45em;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  box-shadow: 0 0 0 1px rgba(255,255,255,.9), 0 2px 8px rgba(31, 71, 80, .12);
}

.character-custom,
.character-custom .guide-face {
  background: #eef7ff;
}

.character-maker {
  margin: 16px 0 18px;
  background: linear-gradient(135deg, rgba(255,255,255,.7), rgba(241,248,255,.7));
}

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

.custom-character-preview,
.character-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px;
  border-radius: 20px;
  background: rgba(255,255,255,.7);
  border: 1px solid rgba(255,255,255,.88);
}

.custom-character-preview img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.9);
  box-shadow: 0 8px 18px rgba(55, 95, 107, .12);
}

.custom-character-preview > span {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fff;
  font-size: 24px;
}

.custom-character-list {
  margin: 12px 0 20px;
}

.character-chip-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.character-chip {
  justify-content: space-between;
}

.alias-tools-row {
  display: grid;
  gap: 10px;
  margin: 18px 0 10px;
}

.homeroom-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.homeroom-filter button {
  border: 0;
  border-radius: 999px;
  padding: 9px 12px;
  background: rgba(255,255,255,.72);
  color: #405258;
  font-weight: 900;
  box-shadow: 0 6px 14px rgba(55, 95, 107, .08);
  cursor: pointer;
}

.homeroom-filter button.active {
  background: linear-gradient(135deg, var(--mint), #7fd9ff);
  color: #fff;
}

.alias-group-scroll {
  display: grid;
  gap: 12px;
  max-height: 420px;
  overflow: auto;
  padding-right: 4px;
}

.alias-group-section {
  padding: 10px;
  border-radius: 22px;
  background: rgba(255,255,255,.45);
  border: 1px solid rgba(255,255,255,.78);
}

.alias-group-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}

.alias-group-title span {
  display: inline-flex;
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(79,195,173,.12);
  color: var(--mint-dark);
  font-weight: 900;
  font-size: .82rem;
}

.inactive-alias-details {
  margin-top: 14px;
  padding: 12px;
  border-radius: 20px;
  background: rgba(255,255,255,.52);
}

.inactive-alias-details summary {
  cursor: pointer;
  font-weight: 900;
}

@media (max-width: 900px) {
  .admin-room-card {
    position: static;
    max-height: none;
  }
  .alias-manager {
    max-height: none;
  }
  .alias-manager-scroll,
  .alias-group-scroll {
    max-height: none;
  }
}

@media (max-width: 620px) {
  .character-maker-grid,
  .character-chip-grid {
    grid-template-columns: 1fr;
  }
  .header-actions {
    justify-content: stretch;
  }
  .header-actions > * {
    width: 100%;
  }
}

/* v0.4.5 학생 별칭 카드 만들기 + 학교 코드 관리 */
.student-login-page {
  gap: 18px;
}

.student-alias-section {
  display: grid;
  gap: 12px;
  background: linear-gradient(135deg, rgba(255,255,255,.88), rgba(243,252,255,.72));
}

.student-alias-creator {
  display: grid;
  gap: 12px;
  padding-top: 4px;
}

.student-alias-mode {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 6px;
  border-radius: 18px;
  background: rgba(255,255,255,.62);
  border: 1px solid rgba(255,255,255,.82);
}

.student-alias-mode button {
  border: 0;
  border-radius: 14px;
  padding: 11px 10px;
  background: transparent;
  color: #4b6269;
  font-weight: 900;
  cursor: pointer;
}

.student-alias-mode button.active {
  background: linear-gradient(135deg, var(--mint), #7fd9ff);
  color: #fff;
  box-shadow: 0 10px 22px rgba(44, 166, 144, .16);
}

.student-custom-character-grid {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 22px;
  background: rgba(255,255,255,.58);
  border: 1px solid var(--line);
}

.student-preview {
  justify-content: flex-start;
  gap: 12px;
  background: rgba(255, 249, 226, .72);
}

.student-preview-face {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 18px;
  background: #fff;
  font-size: 24px;
  box-shadow: 0 8px 18px rgba(55, 95, 107, .1);
}

.status-text {
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255,255,255,.62);
}

.admin-right-stack {
  align-self: start;
  position: sticky;
  top: 92px;
  max-height: calc(100vh - 112px);
  overflow: auto;
  display: grid;
  gap: 18px;
}

.admin-right-stack .admin-room-card {
  position: static;
  top: auto;
  max-height: none;
  overflow: visible;
}

.school-code-card {
  background: linear-gradient(135deg, rgba(255,255,255,.9), rgba(235,248,255,.78));
}

.school-code-preview {
  justify-content: flex-start;
  gap: 12px;
}

.school-code-actions {
  flex-wrap: wrap;
}

.pending-alias-panel {
  display: grid;
  gap: 10px;
  margin: 16px 0;
  padding: 14px;
  border-radius: 24px;
  background: rgba(255, 249, 221, .62);
  border: 1px solid rgba(242, 216, 116, .42);
}

.alias-card.pending {
  background: rgba(255,255,255,.74);
}

.small-pill {
  padding: 5px 8px;
  font-size: .76rem;
}

.pending-pill {
  background: rgba(255, 236, 166, 0.48);
  color: #8b6820;
}

@media (max-width: 900px) {
  .admin-right-stack {
    position: static;
    max-height: none;
  }
}

@media (max-width: 620px) {
  .student-alias-mode {
    grid-template-columns: 1fr;
  }
}

/* v0.4.7 모바일/꾸미기/그림 기능 개선 */
.student-mobile-page,
.student-login-page {
  max-width: 760px;
  margin-inline: auto;
}

.student-login-page .soft-card,
.chat-card,
.room-card,
.modal-card {
  border-radius: 32px;
}

.mobile-chat-header {
  align-items: flex-start;
  gap: 12px;
}

.round-icon {
  min-width: 42px;
  min-height: 42px;
  border-radius: 999px;
  padding: 0;
}

.chat-title-box {
  min-width: 0;
  flex: 1;
}

.room-theme-bar {
  display: flex;
  justify-content: flex-end;
  padding: 8px 4px 12px;
}

.room-theme-bar label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  color: #47616d;
}

.chat-style-panel {
  margin: 10px 0 14px;
  padding: 12px 14px;
  border-radius: 24px;
  background: rgba(255,255,255,.62);
  border: 1px solid rgba(185, 220, 224, .52);
}

.chat-style-panel summary {
  cursor: pointer;
  font-weight: 900;
  color: #2f5361;
}

.style-grid,
.drawing-tools {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.style-grid label,
.drawing-tools label {
  display: grid;
  gap: 6px;
  font-size: .85rem;
  font-weight: 800;
  color: #526a74;
}

.mobile-chat-input {
  position: sticky;
  bottom: 10px;
  z-index: 4;
  padding: 10px;
  border-radius: 24px;
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(14px);
  box-shadow: 0 16px 40px rgba(67, 109, 116, .12);
}

.mobile-chat-input input {
  border-radius: 18px;
  min-height: 50px;
}

.draw-button {
  min-width: 62px;
}

.message-bubble.font-rounded { font-family: ui-rounded, 'Arial Rounded MT Bold', 'Nunito', system-ui, sans-serif; }
.message-bubble.font-neat { font-family: 'Trebuchet MS', 'Noto Sans KR', system-ui, sans-serif; }
.message-bubble.font-hand { font-family: 'Comic Sans MS', 'Segoe Print', 'Noto Sans KR', cursive; }
.message-bubble.size-large p { font-size: 1.08rem; line-height: 1.7; }
.message-bubble.text-slate { color: #334155; }
.message-bubble.text-blue { color: #1d4ed8; }
.message-bubble.text-green { color: #15803d; }
.message-bubble.text-purple { color: #7e22ce; }
.message-bubble.text-brown { color: #854d0e; }
.message-bubble.bubble-white { background: rgba(255,255,255,.94); }
.message-bubble.bubble-mint { background: #e8fff8; }
.message-bubble.bubble-sky { background: #eaf7ff; }
.message-bubble.bubble-peach { background: #fff0e7; }
.message-bubble.bubble-lavender { background: #f4efff; }
.message-bubble.bubble-yellow { background: #fff9d8; }

.theme-mint { background: linear-gradient(150deg, rgba(237,255,248,.96), rgba(255,255,255,.9)); }
.theme-sky { background: linear-gradient(150deg, rgba(232,247,255,.96), rgba(255,255,255,.9)); }
.theme-peach { background: linear-gradient(150deg, rgba(255,240,231,.96), rgba(255,255,255,.9)); }
.theme-lavender { background: linear-gradient(150deg, rgba(246,240,255,.96), rgba(255,255,255,.9)); }
.theme-cream { background: linear-gradient(150deg, rgba(255,250,230,.96), rgba(255,255,255,.9)); }
.theme-green { background: linear-gradient(150deg, rgba(239,255,236,.96), rgba(255,255,255,.9)); }

.drawing-modal {
  max-width: 380px;
}

.drawing-canvas {
  width: 100%;
  aspect-ratio: 14 / 9;
  border-radius: 22px;
  border: 2px solid rgba(125, 204, 195, .55);
  background: white;
  touch-action: none;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.7), 0 14px 34px rgba(42, 80, 90, .12);
}

.drawing-message img {
  max-width: min(260px, 72vw);
  border-radius: 18px;
  border: 1px solid rgba(151, 185, 190, .36);
  background: white;
}

.student-custom-character-grid select,
.student-alias-creator select {
  min-height: 50px;
}

@media (max-width: 720px) {
  .page {
    padding: 14px;
  }
  .app-header {
    border-radius: 0 0 26px 26px;
    padding: 10px 12px;
  }
  .brand small,
  .top-nav .server-badge {
    display: none;
  }
  .student-welcome.modern-welcome {
    grid-template-columns: 1fr;
    border-radius: 30px;
    padding: 20px;
  }
  .student-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .room-grid.upgraded {
    grid-template-columns: 1fr;
  }
  .room-card {
    padding: 18px;
  }
  .mobile-chat-header {
    display: grid;
    grid-template-columns: 42px 1fr;
  }
  .chat-header-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
  .member-strip {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
  }
  .style-grid,
  .drawing-tools {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .mobile-chat-input {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 8px;
  }
  .mobile-chat-input button {
    padding-inline: 12px;
  }
}

@media (max-width: 430px) {
  .student-actions {
    grid-template-columns: 1fr;
  }
  .mobile-chat-input {
    grid-template-columns: 1fr;
  }
  .mobile-chat-input input,
  .mobile-chat-input button {
    width: 100%;
  }
}

/* v0.4.8 동기화 안정화 + 말랑톡 모바일 UI */
.message-bubble.pattern-dots {
  background-image: radial-gradient(rgba(79,195,173,.22) 2px, transparent 2px);
  background-size: 18px 18px;
}
.message-bubble.pattern-stripes {
  background-image: repeating-linear-gradient(135deg, rgba(79,195,173,.14) 0 8px, transparent 8px 18px);
}
.message-bubble.pattern-custom {
  background-image: var(--bubble-pattern);
  background-size: 96px 96px;
  background-repeat: repeat;
}
.chat-card.has-room-pattern {
  background-image: linear-gradient(150deg, rgba(255,255,255,.76), rgba(255,255,255,.62)), var(--room-pattern) !important;
  background-size: auto, 140px 140px;
  background-repeat: repeat, repeat;
}
.room-theme-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
}
.room-theme-bar label { min-width: 180px; }
.secondary-button.small { padding: 9px 12px; border-radius: 14px; font-size: .86rem; }

@media (max-width: 720px) {
  body {
    background: linear-gradient(150deg, #fffdf5 0%, #f2fdff 54%, #f8f4ff 100%);
  }
  .hero-card.modern-hero {
    grid-template-columns: 1fr;
    padding: 22px;
    border-radius: 32px;
  }
  .hero-card.modern-hero h1 {
    font-size: clamp(2.1rem, 15vw, 3.4rem);
    word-break: keep-all;
  }
  .hero-art { min-height: 210px; }
  .soft-card,
  .room-card,
  .chat-card,
  .modal-card,
  .student-alias-section {
    border-radius: 28px;
  }
  input, select, textarea {
    border-radius: 18px;
    min-height: 48px;
    font-size: 16px;
  }
  .primary-button, .secondary-button, .help-button {
    border-radius: 20px;
    min-height: 48px;
  }
  .chat-card.modern-chat-card {
    padding: 12px;
    border-radius: 28px;
  }
  .message-list {
    max-height: min(58vh, 560px);
  }
  .message-bubble {
    border-radius: 22px 22px 22px 10px;
  }
  .message-row.mine .message-bubble {
    border-radius: 22px 22px 10px 22px;
  }
}

/* v0.4.9 안정화: 분류/꾸미기/채팅 스크롤 가시성 강화 */
.alias-card-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.alias-card.active-card {
  background: linear-gradient(135deg, rgba(236, 255, 248, .95), rgba(255,255,255,.82));
  border: 1px solid rgba(111, 218, 199, .32);
}
.alias-card.inactive-card,
.alias-card.muted-row {
  background: linear-gradient(135deg, rgba(241, 245, 249, .86), rgba(255,255,255,.72));
  border: 1px dashed rgba(148, 163, 184, .55);
  opacity: .78;
}
.active-pill { background: #dbfff7; color: #04786a; }
.inactive-pill { background: #eef2f7; color: #64748b; }
.pending-pill { background: #fff6d7; color: #8a6200; }

.message-list[data-preserve-scroll] {
  scroll-behavior: auto;
  overscroll-behavior: contain;
}
.chat-header-actions .secondary-button.small {
  font-weight: 900;
}

.message-bubble {
  border: 2px solid rgba(255,255,255,.96);
  box-shadow: 0 12px 28px rgba(49, 83, 92, .15);
}
.message-bubble.font-rounded { font-family: ui-rounded, 'Arial Rounded MT Bold', 'Nunito', system-ui, sans-serif; font-weight: 900; letter-spacing: -.02em; }
.message-bubble.font-neat { font-family: 'Trebuchet MS', 'Noto Sans KR', system-ui, sans-serif; font-weight: 800; }
.message-bubble.font-hand { font-family: 'Comic Sans MS', 'Segoe Print', 'Noto Sans KR', cursive; font-weight: 800; }
.message-bubble.size-large p { font-size: 1.22rem; line-height: 1.78; }
.message-bubble.text-blue { color: #0b4fd7; border-color: rgba(90, 151, 255, .45); }
.message-bubble.text-green { color: #047857; border-color: rgba(57, 208, 169, .45); }
.message-bubble.text-purple { color: #7c1dba; border-color: rgba(180, 132, 255, .5); }
.message-bubble.text-brown { color: #92400e; border-color: rgba(255, 186, 103, .55); }
.message-bubble.bubble-mint { background: linear-gradient(135deg, #c9fff0, #effffb); }
.message-bubble.bubble-sky { background: linear-gradient(135deg, #cfeeff, #f0fbff); }
.message-bubble.bubble-peach { background: linear-gradient(135deg, #ffe1cf, #fff5ee); }
.message-bubble.bubble-lavender { background: linear-gradient(135deg, #eadcff, #fbf7ff); }
.message-bubble.bubble-yellow { background: linear-gradient(135deg, #fff0a8, #fffbe1); }
.message-bubble.pattern-dots {
  background-image: radial-gradient(rgba(34, 137, 124, .42) 2.5px, transparent 3px), linear-gradient(135deg, rgba(255,255,255,.15), rgba(255,255,255,.2));
  background-size: 16px 16px, auto;
}
.message-bubble.pattern-stripes {
  background-image: repeating-linear-gradient(135deg, rgba(34, 137, 124, .24) 0 9px, transparent 9px 18px), linear-gradient(135deg, rgba(255,255,255,.15), rgba(255,255,255,.2));
}
.message-bubble.pattern-custom {
  background-image: var(--bubble-pattern), linear-gradient(135deg, rgba(255,255,255,.2), rgba(255,255,255,.28));
  background-size: 80px 80px, auto;
  background-repeat: repeat;
}
.chat-card.has-room-pattern {
  background-image: linear-gradient(150deg, rgba(255,255,255,.72), rgba(255,255,255,.55)), var(--room-pattern) !important;
  background-size: auto, 120px 120px !important;
  background-repeat: repeat, repeat !important;
}
.room-card.theme-mint,
.room-card.theme-sky,
.room-card.theme-peach,
.room-card.theme-lavender,
.room-card.theme-cream,
.room-card.theme-green {
  border: 1px solid rgba(255,255,255,.9);
}

@media (max-width: 720px) {
  .top-nav button[data-action="logout"] { font-size: .82rem; padding: 8px 10px; }
  .chat-header-actions { gap: 8px; }
  .chat-header-actions button { flex: 1; }
  .message-list { padding: 14px 8px; gap: 12px; }
  .message-bubble { max-width: 86%; padding: 13px 14px; }
  .alias-list.alias-list-managed { grid-template-columns: 1fr; }
  .alias-card.managed { align-items: flex-start; }
}

/* v0.4.9 동기화/표시 안정화: 말풍선과 방 꾸미기를 더 두드러지게 표시 */
.message-bubble {
  border: 2px solid rgba(100, 116, 139, .10);
}
.message-bubble.font-rounded p { font-weight: 800; letter-spacing: -.015em; }
.message-bubble.font-neat p { font-weight: 900; letter-spacing: .015em; }
.message-bubble.font-hand p { font-size: 1.05em; letter-spacing: .02em; }
.message-bubble.size-large p { font-size: 1.22rem !important; }
.message-bubble.text-blue { color: #0f52ba !important; border-color: rgba(59,130,246,.28); }
.message-bubble.text-green { color: #057a55 !important; border-color: rgba(16,185,129,.28); }
.message-bubble.text-purple { color: #7c3aed !important; border-color: rgba(139,92,246,.28); }
.message-bubble.text-brown { color: #92400e !important; border-color: rgba(245,158,11,.30); }
.message-bubble.bubble-mint { background: linear-gradient(135deg, #c8fff1, #f1fffb) !important; }
.message-bubble.bubble-sky { background: linear-gradient(135deg, #c7ecff, #f3fbff) !important; }
.message-bubble.bubble-peach { background: linear-gradient(135deg, #ffd7c2, #fff5ef) !important; }
.message-bubble.bubble-lavender { background: linear-gradient(135deg, #dfd3ff, #faf7ff) !important; }
.message-bubble.bubble-yellow { background: linear-gradient(135deg, #fff2a8, #fffbe6) !important; }
.message-bubble.pattern-dots,
.message-bubble.pattern-stripes,
.message-bubble.pattern-custom {
  background-blend-mode: multiply;
  border-width: 3px;
}
.message-bubble.pattern-dots {
  background-image: radial-gradient(rgba(15,118,110,.35) 3px, transparent 3px), linear-gradient(135deg, rgba(255,255,255,.95), rgba(255,255,255,.75));
  background-size: 18px 18px, auto;
}
.message-bubble.pattern-stripes {
  background-image: repeating-linear-gradient(135deg, rgba(15,118,110,.22) 0 8px, transparent 8px 18px), linear-gradient(135deg, rgba(255,255,255,.94), rgba(255,255,255,.72));
}
.message-row.mine .message-bubble {
  box-shadow: 0 14px 30px rgba(20, 184, 166, .18);
}
.chat-card.has-room-pattern {
  background-size: auto, 120px 120px !important;
  background-blend-mode: normal, multiply;
}
.chat-card.theme-mint { box-shadow: inset 0 0 0 3px rgba(94, 234, 212, .28), var(--shadow-card); }
.chat-card.theme-sky { box-shadow: inset 0 0 0 3px rgba(125, 211, 252, .30), var(--shadow-card); }
.chat-card.theme-peach { box-shadow: inset 0 0 0 3px rgba(251, 146, 60, .24), var(--shadow-card); }
.chat-card.theme-lavender { box-shadow: inset 0 0 0 3px rgba(167, 139, 250, .28), var(--shadow-card); }
.chat-card.theme-cream { box-shadow: inset 0 0 0 3px rgba(250, 204, 21, .22), var(--shadow-card); }
.chat-card.theme-green { box-shadow: inset 0 0 0 3px rgba(134, 239, 172, .28), var(--shadow-card); }
.active-pill { background: #e7fff7; color: #0f766e; }
.inactive-pill { background: #f1f5f9; color: #64748b; }
.pending-pill { background: #fff7d6; color: #a16207; }
.alias-card.inactive-card { opacity: .72; filter: grayscale(.12); }
.alias-card.active-card { outline: 1px solid rgba(20, 184, 166, .18); }

@media (max-width: 720px) {
  .chat-card.modern-chat-card { border-radius: 26px; }
  .message-list { padding: 14px; gap: 12px; }
  .message-bubble { max-width: 82%; border-radius: 22px 22px 22px 10px; padding: 13px 14px; }
  .message-row.mine .message-bubble { border-radius: 22px 22px 10px 22px; }
  .chat-header-actions { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .chat-header-actions button { width: 100%; }
}

/* v0.4.9: stronger visible styling and clearer active/inactive alias states */
.message-bubble.style-preview {
  max-width: 100%;
  margin: 12px 0;
  border: 3px dashed rgba(45, 122, 114, .32);
  transform: none;
}
.message-bubble.font-rounded { font-family: ui-rounded, 'Arial Rounded MT Bold', 'Nunito', system-ui, sans-serif; font-weight: 800; }
.message-bubble.font-neat { font-family: 'Trebuchet MS', 'Noto Sans KR', system-ui, sans-serif; letter-spacing: .01em; }
.message-bubble.font-hand { font-family: 'Comic Sans MS', 'Segoe Print', 'Noto Sans KR', cursive; font-weight: 700; }
.message-bubble.size-large p { font-size: 1.32rem !important; line-height: 1.72; }
.message-bubble.text-slate { color: #263238; }
.message-bubble.text-blue { color: #1249c9; border-color: rgba(37, 99, 235, .35); }
.message-bubble.text-green { color: #0b7a3e; border-color: rgba(22, 163, 74, .35); }
.message-bubble.text-purple { color: #6d20c7; border-color: rgba(147, 51, 234, .35); }
.message-bubble.text-brown { color: #7a3e0a; border-color: rgba(180, 83, 9, .35); }
.message-bubble.bubble-white { background: #ffffff; border: 2px solid rgba(148, 163, 184, .24); }
.message-bubble.bubble-mint { background: linear-gradient(135deg, #c7fff1, #eafff8); border: 2px solid rgba(20, 184, 166, .33); }
.message-bubble.bubble-sky { background: linear-gradient(135deg, #c7ebff, #eff9ff); border: 2px solid rgba(14, 165, 233, .33); }
.message-bubble.bubble-peach { background: linear-gradient(135deg, #ffd8c4, #fff2ea); border: 2px solid rgba(251, 146, 60, .34); }
.message-bubble.bubble-lavender { background: linear-gradient(135deg, #e7d7ff, #f8f1ff); border: 2px solid rgba(168, 85, 247, .32); }
.message-bubble.bubble-yellow { background: linear-gradient(135deg, #fff0a8, #fffbe2); border: 2px solid rgba(234, 179, 8, .34); }
.message-bubble.pattern-dots { background-image: radial-gradient(rgba(15, 118, 110, .28) 2px, transparent 2px), var(--bubble-base, linear-gradient(135deg, transparent, transparent)); background-size: 16px 16px, auto; }
.message-bubble.pattern-stripes { background-image: repeating-linear-gradient(135deg, rgba(15, 118, 110, .20) 0 5px, transparent 5px 13px); }
.message-bubble.pattern-custom { background-image: var(--bubble-pattern); background-size: 84px 56px; background-repeat: repeat; }
.chat-card.has-room-pattern { background-image: var(--room-pattern), linear-gradient(150deg, rgba(255,255,255,.82), rgba(255,255,255,.55)); background-size: 150px 96px, auto; background-repeat: repeat; }
.status-chip, .active-pill, .inactive-pill, .pending-pill { font-size: .72rem; padding: 5px 8px; border-radius: 999px; font-weight: 900; }
.active-pill, .status-active { background: #dcfce7; color: #166534; }
.inactive-pill, .status-inactive { background: #fee2e2; color: #991b1b; }
.status-pending, .pending-pill { background: #fef3c7; color: #92400e; }
.alias-card.inactive-card { background: rgba(248,250,252,.7); border: 1px dashed rgba(148,163,184,.65); }
.alias-card.active-card { background: rgba(255,255,255,.9); border: 1px solid rgba(94, 207, 194, .22); }
.chat-header-actions .secondary-button.small { white-space: nowrap; }
@media (max-width: 720px) {
  .chat-header.mobile-chat-header { grid-template-columns: 1fr; }
  .chat-header-actions { justify-content: stretch; }
  .chat-header-actions button { flex: 1; }
  .message-list { min-height: 48vh; max-height: 56vh; padding: 14px; }
  .message-bubble { max-width: 82vw; }
  .chat-input.mobile-chat-input { position: sticky; bottom: 0; }
}


/* v0.4.10 관리자 대시보드·별칭 분류·말풍선 꾸미기 강화 */
.admin-stat-tabs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0 18px;
  padding: 14px 16px;
  border: 1px solid rgba(154, 218, 209, .38);
  border-radius: 24px;
  background: rgba(255, 255, 255, .78);
  box-shadow: 0 18px 42px rgba(39, 84, 91, .08);
}
.admin-stat-tabs span { font-weight: 900; color: #29474d; margin-right: 4px; }
.admin-stat-tabs button {
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  background: #f3fbff;
  color: #45646c;
  font-weight: 900;
  cursor: pointer;
}
.admin-stat-tabs button.active {
  color: #fff;
  background: linear-gradient(135deg, #49c9b6, #70d4f0);
  box-shadow: 0 12px 24px rgba(73, 201, 182, .24);
}
.admin-management-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}
.admin-scroll-card { min-height: 0; }
.scroll-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.scroll-card-header h2 { margin: 0; }
.scroll-card-header span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  padding: 7px 12px;
  border-radius: 999px;
  background: #e8fbf6;
  color: #18796e;
  font-weight: 900;
}
.admin-inner-scroll {
  max-height: 360px;
  overflow: auto;
  padding-right: 6px;
  scrollbar-gutter: stable;
}
.alias-list-managed .alias-card.inactive-card {
  border-style: dashed;
  background: rgba(248, 250, 252, .74);
  opacity: .8;
}
.alias-list-managed .alias-card.active-card {
  border: 2px solid rgba(79, 201, 182, .28);
  background: linear-gradient(135deg, rgba(238, 255, 250, .96), rgba(255,255,255,.96));
}
.inactive-alias-details {
  margin-top: 18px;
  padding: 14px;
  border-radius: 24px;
  background: rgba(248, 250, 252, .72);
  border: 1px dashed rgba(137, 163, 171, .42);
}
.inactive-alias-details summary {
  cursor: pointer;
  font-weight: 900;
  color: #31464d;
}
/* 말풍선 글꼴 효과를 실제 웹폰트 없이도 확실히 보이게 강화 */
.message-bubble.font-basic p { font-family: Pretendard, system-ui, sans-serif; font-weight: 700; letter-spacing: 0; }
.message-bubble.font-neat p {
  font-family: 'Arial Black', Impact, Pretendard, system-ui, sans-serif;
  font-weight: 950;
  letter-spacing: .055em;
  text-transform: none;
}
.message-bubble.font-rounded p {
  font-family: ui-rounded, 'Arial Rounded MT Bold', 'Trebuchet MS', Pretendard, system-ui, sans-serif;
  font-weight: 900;
  letter-spacing: -.025em;
  border-radius: 12px;
}
.message-bubble.font-hand p {
  font-family: 'Comic Sans MS', 'Segoe Print', 'Bradley Hand', cursive, Pretendard, system-ui;
  font-style: italic;
  font-weight: 800;
  letter-spacing: .045em;
  transform: rotate(-.8deg);
  display: inline-block;
}
.message-bubble.font-hand { transform: rotate(.35deg); }
.message-bubble.font-neat { border-width: 3px !important; box-shadow: 0 12px 0 rgba(15, 23, 42, .05), 0 18px 36px rgba(15, 23, 42, .08); }
.message-bubble.font-rounded { border-radius: 30px 30px 30px 14px !important; }
.message-row.mine .message-bubble.font-rounded { border-radius: 30px 30px 14px 30px !important; }
.message-bubble.pattern-dots {
  background-image: radial-gradient(rgba(15, 118, 110, .42) 2.5px, transparent 2.5px), linear-gradient(135deg, rgba(255,255,255,.28), rgba(255,255,255,.05)) !important;
  background-size: 15px 15px, auto !important;
}
.message-bubble.pattern-stripes {
  background-image: repeating-linear-gradient(135deg, rgba(15, 118, 110, .25) 0 6px, rgba(255,255,255,.08) 6px 12px, transparent 12px 18px) !important;
}
.message-bubble.pattern-custom {
  background-image: var(--bubble-pattern), linear-gradient(135deg, rgba(255,255,255,.42), rgba(255,255,255,.18)) !important;
  background-size: 64px 42px, auto !important;
  background-repeat: repeat !important;
  background-blend-mode: multiply, normal;
}
.message-bubble.style-preview {
  min-height: 72px;
  display: inline-flex;
  align-items: center;
}
@media (max-width: 860px) {
  .admin-management-grid { grid-template-columns: 1fr; }
  .admin-inner-scroll { max-height: 330px; }
  .admin-stat-tabs { border-radius: 20px; }
}

/* v0.4.11: 글꼴 선택 효과를 더 확실하게 분리 */
.message-bubble.font-neat {
  border-radius: 10px 18px 10px 18px !important;
  border: 3px solid rgba(30, 41, 59, .38) !important;
  box-shadow: 6px 6px 0 rgba(15, 23, 42, .12), 0 16px 36px rgba(15, 23, 42, .08) !important;
}
.message-bubble.font-neat p {
  font-family: 'Courier New', 'Consolas', 'D2Coding', 'Nanum Gothic Coding', monospace !important;
  font-weight: 900 !important;
  letter-spacing: .085em !important;
  transform: scaleX(.92) !important;
  display: inline-block !important;
  text-shadow: 1px 0 0 currentColor !important;
}
.message-bubble.font-rounded {
  border-radius: 34px 34px 34px 16px !important;
  border: 2px solid rgba(20, 184, 166, .34) !important;
  box-shadow: 0 16px 34px rgba(20, 184, 166, .14) !important;
}
.message-row.mine .message-bubble.font-rounded {
  border-radius: 34px 34px 16px 34px !important;
}
.message-bubble.font-rounded p {
  font-family: ui-rounded, 'Arial Rounded MT Bold', 'Trebuchet MS', 'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, sans-serif !important;
  font-weight: 950 !important;
  letter-spacing: -.055em !important;
  transform: scaleX(1.08) !important;
  display: inline-block !important;
  text-shadow: 0 2px 0 rgba(255,255,255,.9), 0 0 12px rgba(94, 234, 212, .25) !important;
}
.message-bubble.font-hand p {
  font-family: 'Comic Sans MS', 'Segoe Print', 'Bradley Hand', 'Apple SD Gothic Neo', cursive !important;
  font-style: italic !important;
  transform: rotate(-1.6deg) skewX(-6deg) !important;
  display: inline-block !important;
  letter-spacing: .06em !important;
}


/* v0.5.0 owner/admin auth additions */
.centered-note { text-align: center; margin-top: 14px; }
.owner-page .admin-management-grid { align-items: start; }
.owner-login-card { border: 1px solid rgba(87, 203, 191, .35); }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-form input { min-width: 160px; }
.admin-password-card { display: grid; gap: 14px; }
.owner-preview .admin-scroll-list,
.admin-section-scroll .admin-scroll-list { max-height: 360px; overflow: auto; padding-right: 8px; }
code { background: rgba(86, 207, 193, .14); border-radius: 10px; padding: 2px 6px; }

/* v0.5.2 UI polish: 한글 제목 줄바꿈 안정화 */
.admin-hero h1,
.landing-hero h1,
.student-welcome h1,
.owner-page h1 {
  word-break: keep-all;
  overflow-wrap: normal;
  line-height: 1.08;
  letter-spacing: -0.045em;
  text-wrap: balance;
}
.headline-line {
  display: inline-block;
  white-space: nowrap;
}
.admin-hero {
  gap: clamp(18px, 3vw, 32px);
}
.admin-hero h1 {
  max-width: 900px;
  font-size: clamp(2.25rem, 5.2vw, 4.8rem);
}
.landing-hero h1 {
  max-width: 820px;
  font-size: clamp(2.15rem, 5vw, 4.7rem);
}
.form-card h2,
.soft-card h2,
.section-title-row h2,
.scroll-card-header h2 {
  word-break: keep-all;
  overflow-wrap: normal;
  letter-spacing: -0.035em;
}
.talk-code-list {
  max-height: 220px;
  overflow: auto;
  padding-right: 4px;
}
.school-code-card input[readonly] {
  background: rgba(241, 245, 249, .78);
  color: #475569;
  cursor: default;
}
@media (max-width: 720px) {
  .admin-hero h1,
  .landing-hero h1 {
    font-size: clamp(2rem, 11vw, 3.4rem);
  }
  .headline-line { white-space: normal; }
}

/* v0.5.3 owner school-code management */
.owner-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin: 18px 0;
}
.owner-filter-bar > div {
  display: grid;
  gap: 4px;
}
.owner-filter-bar label {
  min-width: 220px;
  margin: 0;
}
.owner-filter-bar input[type="date"] {
  min-height: 46px;
}
.owner-school-row {
  align-items: center;
  gap: 12px;
}
.owner-school-row small {
  display: block;
}
.owner-school-row .pill {
  white-space: nowrap;
}
@media (max-width: 760px) {
  .owner-filter-bar { align-items: stretch; }
  .owner-filter-bar label,
  .owner-filter-bar button { width: 100%; }
  .owner-school-row { grid-template-columns: 1fr; }
}
.owner-stat-tabs {
  align-items: center;
  gap: 10px;
}
.inline-date-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.inline-date-filter input[type="date"] {
  width: auto;
  min-height: 40px;
  border-radius: 14px;
}
.compact-tabs {
  margin: 8px 0 12px;
}
.owner-school-list {
  max-height: 360px;
}
@media (max-width: 760px) {
  .inline-date-filter {
    width: 100%;
  }
  .inline-date-filter input[type="date"],
  .inline-date-filter button {
    width: 100%;
  }
}

/* v0.5.4 owner admin list readability polish */
.owner-admin-section {
  grid-column: span 2;
}
.owner-admin-section .tiny-note {
  margin-top: -2px;
  margin-bottom: 14px;
}
.owner-admin-list {
  max-height: 420px;
  display: grid;
  gap: 12px;
  padding-right: 4px;
}
.owner-admin-row {
  grid-template-columns: minmax(260px, 1.15fr) minmax(280px, .95fr) auto;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border-radius: 26px;
  background: linear-gradient(135deg, rgba(255,255,255,.9), rgba(247, 254, 255, .74));
  border: 1px solid rgba(199, 232, 236, .9);
  box-shadow: 0 14px 30px rgba(45, 93, 104, .07);
}
.owner-admin-main {
  min-width: 0;
  display: grid;
  gap: 8px;
}
.owner-admin-main strong {
  display: block;
  font-size: clamp(1.05rem, 1.4vw, 1.22rem);
  line-height: 1.35;
  letter-spacing: -0.02em;
  color: var(--ink);
  word-break: keep-all;
  overflow-wrap: anywhere;
}
.owner-admin-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}
.owner-admin-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(232, 249, 247, .95);
  color: #42656c;
  font-size: .86rem;
  font-weight: 800;
  line-height: 1.1;
  max-width: 100%;
}
.owner-admin-meta .status-chip.active {
  background: #dcfaf2;
  color: #1f7a68;
}
.owner-admin-meta .status-chip.inactive {
  background: #ffe9e4;
  color: #a65243;
}
.owner-admin-reset {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin: 0;
}
.owner-admin-reset input {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  border-radius: 18px;
}
.owner-admin-toggle {
  min-width: 104px;
  justify-self: end;
}
@media (max-width: 1120px) {
  .owner-admin-section {
    grid-column: auto;
  }
  .owner-admin-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .owner-admin-reset {
    grid-template-columns: 1fr auto;
  }
  .owner-admin-toggle {
    justify-self: start;
  }
}
@media (max-width: 640px) {
  .owner-admin-row {
    padding: 16px;
    border-radius: 22px;
  }
  .owner-admin-reset {
    grid-template-columns: 1fr;
  }
  .owner-admin-reset button,
  .owner-admin-toggle {
    width: 100%;
    justify-self: stretch;
  }
}

/* v0.5.5 safety filter and compact management polish */
.filter-manager .filter-split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  align-items: start;
}
.filter-manager h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  white-space: nowrap;
}
.filter-form {
  display: grid;
  grid-template-columns: minmax(160px, 1.4fr) minmax(92px, .7fr) minmax(82px, .6fr) minmax(160px, 1.2fr) auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}
.filter-form input,
.filter-form select {
  min-height: 42px;
}
.filter-row {
  gap: 12px;
  align-items: center;
}
.filter-title-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 4px;
}
.status-chip.owner {
  background: #ede9fe;
  color: #6d28d9;
  border: 1px solid #ddd6fe;
}
.small-scroll {
  max-height: 260px;
}
@media (max-width: 760px) {
  .filter-form {
    grid-template-columns: 1fr;
  }
  .filter-title-line strong {
    display: block;
    width: 100%;
  }
}

/* v0.5.6 filter/support UI polish */
.filter-manager-polished,
.filter-manager {
  overflow: hidden;
}
.filter-panel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}
.filter-panel {
  min-width: 0;
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(255,255,255,.92), rgba(246, 253, 252, .82));
  border: 1px solid rgba(191, 231, 229, .82);
  box-shadow: 0 16px 36px rgba(44, 95, 103, .07);
}
.readonly-filter-panel {
  background: linear-gradient(135deg, rgba(250, 248, 255, .96), rgba(245, 255, 252, .78));
}
.filter-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.filter-panel-head h3 {
  margin: 0;
  font-size: clamp(1.02rem, 1.4vw, 1.18rem);
  white-space: normal;
  word-break: keep-all;
}
.filter-panel-head span {
  font-size: .82rem;
  font-weight: 900;
  color: #5b7680;
  background: rgba(232, 249, 247, .95);
  border-radius: 999px;
  padding: 7px 11px;
}
.filter-create-card {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) minmax(110px, .7fr) minmax(100px, .6fr);
  gap: 10px;
  align-items: end;
  padding: 14px;
  border-radius: 24px;
  border: 1px solid rgba(201, 234, 236, .9);
  background: rgba(255,255,255,.82);
}
.filter-create-card label {
  display: grid;
  gap: 6px;
  min-width: 0;
  font-size: .86rem;
  font-weight: 900;
  color: #42636c;
}
.filter-create-card input,
.filter-create-card select {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  border-radius: 18px;
}
.filter-message-field {
  grid-column: span 2;
}
.filter-add-button {
  min-height: 48px;
  white-space: nowrap;
}
.filter-list-scroll {
  display: grid;
  gap: 10px;
  max-height: 310px;
  overflow: auto;
  padding-right: 5px;
}
.filter-card-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 22px;
  background: rgba(255,255,255,.86);
  border: 1px solid rgba(216, 239, 242, .95);
  box-shadow: 0 10px 24px rgba(48, 91, 102, .05);
}
.filter-card-main { min-width: 0; }
.filter-card-main p {
  margin: 6px 0 0;
  color: #667c85;
  font-size: .92rem;
  line-height: 1.45;
  word-break: keep-all;
}
.action-block { background: #fee2e2 !important; color: #b03a3a !important; }
.action-warn { background: #fff7db !important; color: #8a6517 !important; }
.readonly-pill { background: #f2edff !important; color: #6d28d9 !important; }
.owner-safety-overview,
.owner-support-section {
  margin-top: 18px;
}
.owner-safety-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.owner-safety-school-card,
.support-request-card {
  padding: 16px;
  border-radius: 24px;
  background: rgba(255,255,255,.86);
  border: 1px solid rgba(204, 235, 238, .9);
  box-shadow: 0 12px 28px rgba(45, 94, 103, .06);
}
.owner-safety-school-card > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.owner-safety-school-card strong,
.support-request-main strong {
  font-size: 1.03rem;
  word-break: keep-all;
}
.owner-safety-counts {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0;
}
.owner-safety-counts span {
  padding: 7px 10px;
  border-radius: 999px;
  background: #e8fbf6;
  color: #18796e;
  font-weight: 900;
  font-size: .85rem;
}
.owner-safety-school-card p,
.support-request-card p {
  margin: 6px 0;
  color: #6b7f86;
  line-height: 1.45;
}
.owner-safety-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}
.owner-safety-columns h3 {
  margin: 0 0 10px;
  font-size: 1.04rem;
}
.support-request-list {
  display: grid;
  gap: 12px;
  max-height: 420px;
  overflow: auto;
  padding-right: 6px;
}
.support-request-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}
.report-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}
.report-actions select { min-width: 140px; }
@media (max-width: 940px) {
  .filter-panel-grid,
  .owner-safety-columns,
  .support-request-card {
    grid-template-columns: 1fr;
  }
  .filter-create-card {
    grid-template-columns: 1fr;
  }
  .filter-message-field {
    grid-column: auto;
  }
  .filter-card-item {
    grid-template-columns: 1fr;
  }
  .filter-add-button,
  .support-request-card .button-row .secondary-button {
    width: 100%;
  }
}

/* v0.5.7 mobile overlap fix + student room approval UI */
.pending-room-row {
  background: linear-gradient(135deg, rgba(255, 250, 232, .92), rgba(255, 255, 255, .84));
  border-color: rgba(245, 196, 96, .44) !important;
}
.owner-page .owner-safety-overview,
.owner-page .owner-support-section,
.owner-page .owner-preview,
.owner-page .admin-section-scroll,
.owner-page .soft-card {
  position: relative;
  clear: both;
  transform: none !important;
}
.owner-safety-overview,
.owner-support-section {
  display: block;
  width: 100%;
  isolation: isolate;
}
.owner-safety-columns > section {
  min-width: 0;
  padding: 12px;
  border-radius: 22px;
  background: rgba(255,255,255,.52);
  border: 1px solid rgba(214, 236, 240, .75);
}
.owner-safety-columns .admin-scroll-list,
.owner-support-section .admin-scroll-list,
.owner-support-section .support-request-list {
  contain: content;
}
.admin-settings-card select[name="studentRoomApprovalMode"] {
  border-color: rgba(79, 195, 173, .34);
  background: rgba(255,255,255,.95);
}
@media (max-width: 760px) {
  .page,
  .owner-page,
  .admin-page {
    width: 100%;
    padding: 12px;
  }
  .app-header {
    position: sticky;
    padding: 10px 12px;
    gap: 8px;
  }
  .brand-icon { width: 42px; height: 42px; border-radius: 16px; }
  .brand strong { font-size: .96rem; }
  .brand small { font-size: .72rem; }
  .top-nav { gap: 6px; }
  .top-nav button { padding: 9px 11px; font-size: .88rem; }
  .admin-hero,
  .student-welcome,
  .hero-card {
    grid-template-columns: 1fr !important;
    border-radius: 28px;
    padding: 20px;
  }
  .owner-page .admin-management-grid,
  .admin-management-grid,
  .admin-columns,
  .filter-panel-grid,
  .owner-safety-columns,
  .owner-safety-grid,
  .support-request-card {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }
  .owner-page .soft-card,
  .owner-safety-overview,
  .owner-support-section,
  .owner-preview {
    margin: 14px 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden;
    border-radius: 28px;
  }
  .owner-page .table-row,
  .owner-page .table-row.compact,
  .admin-page .table-row,
  .admin-page .table-row.compact {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
    min-height: auto !important;
    height: auto !important;
  }
  .owner-page .table-row > *,
  .admin-page .table-row > * {
    width: 100%;
    min-width: 0;
  }
  .owner-page .table-row span,
  .admin-page .table-row span {
    align-self: flex-start;
  }
  .owner-page .admin-scroll-list,
  .owner-safety-columns .admin-scroll-list,
  .support-request-list,
  .admin-inner-scroll {
    max-height: 54vh !important;
    overflow: auto !important;
    padding-right: 4px;
  }
  .section-title-row,
  .scroll-card-header,
  .filter-panel-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .filter-card-item,
  .support-request-card {
    grid-template-columns: 1fr !important;
  }
  .button-row.compact,
  .report-actions,
  .row-actions {
    width: 100%;
  }
  .button-row.compact > button,
  .report-actions > button,
  .row-actions > button,
  .owner-support-section button {
    min-height: 42px;
  }
  .filter-title-line {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
  }
  .filter-title-line strong {
    width: 100%;
  }
}

/* v0.5.8 clean UI defaults: readable forms, filter buttons, report cards */
:root {
  --clean-card-border: rgba(196, 229, 233, .88);
  --clean-shadow: 0 14px 34px rgba(42, 84, 96, .075);
}
.filter-create-card {
  grid-template-columns: minmax(180px, 1.1fr) minmax(110px, .72fr) minmax(100px, .62fr) minmax(0, 1.1fr) auto !important;
  align-items: end !important;
  gap: 10px !important;
}
.filter-message-field { grid-column: auto !important; }
.filter-add-button {
  min-width: 112px !important;
  padding-inline: 18px !important;
  text-align: center;
  word-break: keep-all;
  white-space: nowrap !important;
}
.filter-create-card input,
.filter-create-card select,
.report-actions-clean select {
  font-size: .96rem;
  letter-spacing: -0.02em;
}
.report-list-clean {
  grid-template-columns: 1fr !important;
  gap: 14px !important;
}
.report-card-clean {
  display: grid;
  gap: 12px;
  padding: 18px 20px !important;
  border-radius: 26px !important;
  background: linear-gradient(135deg, rgba(255,255,255,.94), rgba(247,253,252,.82)) !important;
  border: 1px solid var(--clean-card-border) !important;
  box-shadow: var(--clean-shadow);
  min-width: 0;
}
.report-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.report-title-block {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}
.report-title-block strong {
  font-size: clamp(1.05rem, 1.2vw, 1.22rem);
  line-height: 1.25;
  word-break: keep-all;
  overflow-wrap: break-word;
}
.report-topline time {
  flex: 0 0 auto;
  color: #5c737a;
  font-weight: 800;
  font-size: .9rem;
  white-space: nowrap;
}
.report-status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #e9fbf6;
  color: #16796e;
  font-size: .82rem;
  font-weight: 900;
  white-space: nowrap;
}
.report-status-chip.status-new { background: #fff4d8; color: #956615; }
.report-status-chip.status-checking { background: #e7f2ff; color: #2563a7; }
.report-status-chip.status-resolved { background: #e7f9ee; color: #177245; }
.report-status-chip.status-stored { background: #edf2f7; color: #475569; }
.report-status-chip.status-false_alarm { background: #f3e8ff; color: #6b21a8; }
.report-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.report-meta-grid span {
  min-width: 0;
  padding: 9px 12px;
  border-radius: 16px;
  background: rgba(232, 250, 247, .72);
  color: #5c737a;
  font-size: .9rem;
  line-height: 1.35;
}
.report-meta-grid b {
  color: #263238;
  font-weight: 900;
  word-break: keep-all;
}
.report-description {
  margin: 0 !important;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255,255,255,.74);
  color: #32464d;
  font-size: 1rem;
  font-weight: 750;
  line-height: 1.55;
  word-break: keep-all;
  overflow-wrap: break-word;
}
.report-actions-clean {
  display: grid !important;
  grid-template-columns: minmax(150px, 220px) auto 1fr;
  align-items: center !important;
  gap: 10px !important;
  margin-top: 0 !important;
}
.report-actions-clean .soft-pill { justify-self: start; }
.report-actions-clean button { white-space: nowrap; }
@media (max-width: 1120px) {
  .filter-create-card {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
  .filter-pattern-field,
  .filter-message-field { grid-column: span 3 !important; }
  .filter-add-button { width: 100%; }
}
@media (max-width: 760px) {
  .filter-create-card {
    grid-template-columns: 1fr !important;
    padding: 14px !important;
  }
  .filter-pattern-field,
  .filter-message-field { grid-column: auto !important; }
  .filter-add-button {
    width: 100% !important;
    min-height: 50px !important;
    writing-mode: horizontal-tb !important;
    line-height: 1.2 !important;
  }
  .report-section-clean { overflow: hidden; }
  .report-card-clean { padding: 16px !important; border-radius: 24px !important; }
  .report-topline { flex-direction: column; gap: 8px; }
  .report-topline time { font-size: .86rem; white-space: normal; }
  .report-meta-grid { grid-template-columns: 1fr; }
  .report-description { font-size: .96rem; padding: 13px; }
  .report-actions-clean {
    grid-template-columns: 1fr !important;
    width: 100%;
  }
  .report-actions-clean select,
  .report-actions-clean button {
    width: 100% !important;
    min-height: 46px;
  }
  .report-actions-clean .soft-pill { justify-self: stretch; text-align: center; }
}


/* v0.5.9 plan / AI toggle polish */
.owner-school-plan-row { gap: 12px; align-items: center; }
.owner-school-plan-form { display:flex; gap:8px; align-items:center; flex-wrap:wrap; justify-content:flex-end; }
.owner-school-plan-form select { min-width: 96px; }
.plan-info-card { margin-top: 12px; padding: 14px 16px; border-radius: 18px; background: linear-gradient(135deg, #eefdf7, #f7f3ff); border: 1px solid rgba(125, 211, 252, .35); color:#334155; }
.plan-info-card p { margin: 6px 0 0; line-height: 1.55; font-size: .92rem; }
.disabled-line { opacity: .72; }
@media (max-width: 720px) {
  .owner-school-plan-row { display:grid; grid-template-columns: 1fr; }
  .owner-school-plan-form { justify-content:stretch; }
  .owner-school-plan-form select, .owner-school-plan-form button { width:100%; }
}

/* v0.5.10 owner school plan target fix */
.owner-school-plan-form {
  min-width: 176px;
}
.owner-school-plan-form select {
  min-width: 86px;
}
@media (max-width: 720px) {
  .owner-school-plan-row {
    align-items: stretch;
  }
  .owner-school-plan-form {
    width: 100%;
    min-width: 0;
  }
  .owner-school-plan-form select,
  .owner-school-plan-form button {
    width: 100%;
  }
}

/* v0.6.1 plan request UI polish + payment prep */
.polished-plan-card,
.polished-owner-plan-section {
  overflow: hidden;
}
.payment-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 22px 0 18px;
}
.payment-info-grid article,
.payment-admin-note {
  border: 1px solid rgba(174, 220, 215, .72);
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(241, 255, 251, .96), rgba(255, 255, 255, .88));
  box-shadow: 0 14px 34px rgba(73, 150, 150, .08);
}
.payment-info-grid article {
  padding: 18px 20px;
  display: grid;
  gap: 8px;
}
.payment-info-grid strong,
.payment-admin-note strong {
  color: #24363a;
  font-size: 1.05rem;
  letter-spacing: -.02em;
}
.payment-info-grid span,
.payment-admin-note p {
  color: #6b7f86;
  line-height: 1.65;
  margin: 0;
}
.plan-request-form.clean-form {
  display: grid;
  grid-template-columns: minmax(180px, .8fr) minmax(260px, 1.4fr) auto;
  gap: 18px;
  align-items: end;
  padding: 18px;
  border: 1px solid rgba(201, 229, 226, .86);
  border-radius: 28px;
  background: rgba(255, 255, 255, .76);
}
.plan-request-form.clean-form label {
  margin: 0;
}
.plan-request-form.clean-form textarea {
  min-height: 84px;
  resize: vertical;
}
.plan-request-submit {
  display: flex;
  align-items: end;
  justify-content: flex-end;
}
.plan-request-submit .primary-button {
  min-width: 128px;
  white-space: nowrap;
}
.plan-status-box {
  margin: 18px 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  border-radius: 24px;
  padding: 18px 20px;
}
.plan-status-box p { margin: 8px 0 0; color: #6b7f86; line-height: 1.55; }
.plan-status-box.pending { background: #fff9e9; border: 1px solid rgba(236, 195, 101, .45); }
.plan-status-box.active { background: #eafaf4; border: 1px solid rgba(91, 196, 161, .45); }
.clean-history summary {
  cursor: pointer;
  font-weight: 900;
  color: #2f565b;
  padding: 10px 2px;
}
.plan-history-list {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}
.plan-history-item {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 20px;
  border: 1px solid rgba(221, 235, 236, .9);
  background: rgba(255,255,255,.72);
}
.plan-history-item > div {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.plan-history-item p { margin: 0; color: #5f747a; line-height: 1.5; }
.plan-history-item small { color: #8aa0a6; }
.payment-admin-note {
  padding: 18px 20px;
  margin: 18px 0;
}
.owner-plan-request-list {
  display: grid;
  gap: 16px;
  max-height: 540px;
  overflow: auto;
  padding: 4px 8px 4px 2px;
}
.owner-plan-request-card {
  display: grid;
  gap: 16px;
  padding: 20px;
  border-radius: 28px;
  border: 1px solid rgba(214, 232, 233, .95);
  background: linear-gradient(135deg, rgba(255,255,255,.95), rgba(247, 253, 252, .9));
  box-shadow: 0 16px 42px rgba(43, 92, 107, .08);
}
.owner-plan-request-card.pending {
  border-color: rgba(93, 203, 194, .42);
  background: linear-gradient(135deg, rgba(241,255,251,.98), rgba(255,255,255,.9));
}
.owner-plan-request-card.approved {
  border-color: rgba(89, 196, 154, .4);
}
.owner-plan-request-card.rejected {
  border-color: rgba(241, 169, 169, .42);
}
.owner-plan-request-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.owner-plan-school {
  display: grid;
  gap: 6px;
  min-width: 0;
}
.owner-plan-school strong {
  font-size: 1.12rem;
  color: #26383d;
  letter-spacing: -.02em;
}
.owner-plan-school small,
.owner-plan-meta {
  color: #7a9298;
  font-weight: 700;
}
.owner-plan-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.owner-plan-request-body p {
  margin: 0 0 12px;
  color: #445b61;
  line-height: 1.7;
  font-size: .98rem;
}
.owner-plan-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: .86rem;
}
.plan-request-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 4px;
}
.plan-request-actions .secondary-button {
  min-width: 110px;
  min-height: 44px;
}
.plan-decision-note {
  display: grid;
  gap: 6px;
  justify-items: end;
}
.plan-decision-note p {
  margin: 0;
  color: #6b7f86;
  line-height: 1.5;
}
@media (max-width: 820px) {
  .payment-info-grid,
  .plan-request-form.clean-form {
    grid-template-columns: 1fr;
  }
  .plan-request-submit,
  .plan-request-submit .primary-button {
    width: 100%;
  }
  .owner-plan-request-top,
  .plan-status-box {
    flex-direction: column;
  }
  .owner-plan-badges,
  .plan-request-actions,
  .plan-decision-note {
    justify-content: flex-start;
    justify-items: start;
    width: 100%;
  }
  .plan-request-actions .secondary-button {
    flex: 1 1 120px;
  }
  .owner-plan-request-card {
    padding: 18px;
    border-radius: 24px;
  }
}


/* v0.6.3 plan sync + game features */
.student-game-panel,
.admin-game-manager {
  margin-top: 24px;
}
.game-mode-section {
  margin-top: 18px;
}
.game-mode-section h3 {
  margin: 0 0 10px;
  font-size: 1.05rem;
  color: var(--ink, #263238);
}
.game-card-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.game-card,
.admin-game-item,
.chat-game-panel {
  border: 1px solid rgba(79, 195, 173, 0.28);
  border-radius: 24px;
  background: rgba(255,255,255,0.86);
  box-shadow: 0 14px 34px rgba(74, 114, 120, 0.08);
  padding: 18px;
}
.game-card-head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 10px;
  align-items: center;
  margin-bottom: 10px;
}
.game-card-head span {
  grid-row: span 2;
  width: 42px;
  height: 42px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #dffbf3, #eff8ff);
  font-size: 1.4rem;
}
.game-card-head strong,
.admin-game-item strong {
  font-size: 1.05rem;
  word-break: keep-all;
}
.game-card-head small,
.admin-game-item small {
  color: #6b7b84;
}
.game-answer-row {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}
.game-answer-row.wrap {
  flex-wrap: wrap;
}
.game-answer-row .secondary-button {
  min-width: 64px;
  justify-content: center;
}
.chat-game-panel {
  margin: 14px 0;
  background: linear-gradient(135deg, rgba(245, 255, 251, 0.95), rgba(244, 246, 255, 0.9));
}
.chat-game-panel h3 {
  margin: 4px 0;
  font-size: 1.15rem;
}
.game-result-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.game-result-strip span {
  border-radius: 999px;
  background: #eefaf7;
  padding: 6px 10px;
  color: #41656a;
  font-weight: 700;
  font-size: .86rem;
}
.game-create-card {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
  padding: 18px;
  border: 1px solid rgba(79,195,173,.24);
  border-radius: 24px;
  background: rgba(247, 253, 251, 0.78);
}
.game-create-card .wide,
.game-create-card button {
  grid-column: 1 / -1;
}
.admin-game-list {
  max-height: 420px;
  display: grid;
  gap: 12px;
}
.admin-game-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
}
.admin-game-item p {
  margin: 8px 0 0;
  color: #52666f;
}
@media (max-width: 720px) {
  .game-card-list,
  .game-create-card,
  .admin-game-item {
    grid-template-columns: 1fr;
  }
  .game-card,
  .admin-game-item,
  .chat-game-panel {
    padding: 16px;
    border-radius: 20px;
  }
  .game-answer-row .secondary-button,
  .game-answer-row .primary-button {
    flex: 1;
  }
}

/* v0.6.4 retro game / plan polish */
.score-stack{display:flex;flex-direction:column;gap:8px;align-items:flex-end}
.score-pill{display:inline-flex;align-items:center;justify-content:center;padding:8px 14px;border-radius:999px;background:linear-gradient(135deg,#fff7d6,#e8fff7);font-weight:900;color:#25525a;border:1px solid rgba(77,196,181,.25);box-shadow:0 12px 28px rgba(25,80,90,.08)}
.retro-game-create{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;align-items:end;padding:18px;border:1px solid rgba(77,196,181,.25);border-radius:24px;background:rgba(255,255,255,.72)}
.retro-game-create .wide,.retro-game-create .game-form-help,.retro-game-create button{grid-column:1/-1}
.game-form-help{padding:14px 16px;border-radius:18px;background:#f0fffb;color:#46676e;font-weight:700;border:1px dashed rgba(77,196,181,.35)}
.retro-game-zone{margin-top:14px;padding:14px;border-radius:22px;background:rgba(255,255,255,.68);border:1px solid rgba(77,196,181,.22)}
.retro-answer{min-width:120px;background:linear-gradient(135deg,#ffffff,#ecfffb);border-radius:18px;font-weight:900}
.omok-grid{display:grid;grid-template-columns:repeat(3,58px);gap:8px;justify-content:center;margin-top:10px}
.omok-cell{width:58px;height:58px;border-radius:16px;border:1px solid rgba(69,96,105,.18);background:linear-gradient(135deg,#fff,#f3fffb);font-size:20px;font-weight:900;color:#334155;box-shadow:0 8px 20px rgba(25,80,90,.08)}
.owner-school-plan-form{gap:8px;flex-wrap:wrap;min-width:260px}
.owner-school-plan-form select{min-width:96px}
.game-card.snake,.game-card.memory,.game-card.brick,.game-card.pipe,.game-card.omok{border:1px solid rgba(77,196,181,.2)}
@media (max-width:720px){.retro-game-create{grid-template-columns:1fr}.score-stack{align-items:flex-start}.retro-answer{width:100%;min-width:0}.game-answer-row.wrap{display:grid;grid-template-columns:1fr 1fr;gap:10px}.owner-school-plan-form{width:100%;}.owner-school-plan-form select,.owner-school-plan-form button{width:100%}.principle-grid article span{line-height:1.55}}


/* v0.6.5: list classification filters and adaptive game forms */
.clean-filter-bar,
.list-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  margin: 12px 0 16px;
  padding: 12px;
  border: 1px solid rgba(91, 196, 178, 0.22);
  border-radius: 22px;
  background: rgba(255,255,255,0.72);
}
.clean-filter-bar label,
.list-filter-bar label {
  min-width: 180px;
  flex: 1 1 220px;
  font-weight: 800;
  color: #39515a;
}
.clean-filter-bar select,
.list-filter-bar select {
  width: 100%;
  min-height: 48px;
  border-radius: 18px;
  border: 1px solid rgba(105, 191, 179, 0.35);
  background: #fff;
  padding: 0 14px;
  font-weight: 800;
}
.retro-game-create [data-game-field] {
  transition: opacity .18s ease, transform .18s ease;
}
.room-create-modal [data-chat-room-fields],
.room-create-modal [data-game-room-fields] {
  display: grid;
  gap: 14px;
}
@media (max-width: 720px) {
  .clean-filter-bar,
  .list-filter-bar {
    display: grid;
    grid-template-columns: 1fr;
    padding: 10px;
  }
  .clean-filter-bar label,
  .list-filter-bar label {
    min-width: 0;
  }
  .row-actions,
  .button-row.compact {
    gap: 10px;
    flex-wrap: wrap;
  }
}
