
/* React 화면의 작은 보완 스타일 */
.problem-text {
  white-space: pre-wrap;
}
.chat-msg {
  white-space: pre-wrap;
}

.error-banner {
  position: fixed;
  top: 16px;
  left: 50%;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(560px, calc(100% - 32px));
  padding: 12px 16px;
  border: 1px solid #e5a3a3;
  border-radius: 8px;
  background: #fff4f4;
  box-shadow: 0 8px 24px rgba(80, 20, 20, 0.15);
  color: #9c2929;
  transform: translateX(-50%);
}

.error-banner-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
}

.error-banner-message {
  flex: 1 1 auto;
  min-width: 0;
}

.error-banner-countdown {
  flex: 0 0 auto;
  color: #b15b5b;
  font-size: 11px;
  white-space: nowrap;
}

.error-banner-progress {
  position: absolute;
  right: 1px;
  bottom: 1px;
  left: 1px;
  height: 2px;
  overflow: hidden;
  border-radius: 0 0 7px 7px;
  background: #efc2c2;
}

.error-banner-progress-value {
  height: 100%;
  background: #922b2b;
  transition: width 0.25s linear;
}

.error-banner button {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 12px;
}

.tutor-chat-fab {
  position: fixed;
  right: 34px;
  bottom: 34px;
  z-index: 20;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, #3858a9, #1d2d5a);
  box-shadow: 0 6px 16px rgba(29, 45, 90, 0.2);
  color: #fff;
  font-size: 18px;
  opacity: 0.5;
  cursor: pointer;
  transition: width 180ms ease, height 180ms ease, right 180ms ease, bottom 180ms ease, opacity 180ms ease, box-shadow 180ms ease, transform 180ms ease, filter 180ms ease;
}

.tutor-chat-fab.is-active,
.tutor-chat-fab:hover,
.tutor-chat-fab:focus-visible {
  right: 28px;
  bottom: 28px;
  width: 56px;
  height: 56px;
  box-shadow: 0 10px 26px rgba(29, 45, 90, 0.35);
  font-size: 24px;
  opacity: 1;
}

.tutor-chat-fab:hover,
.tutor-chat-fab:focus-visible {
  transform: translateY(-2px);
  filter: brightness(1.08);
}
.tutor-chat-prompt {
  position: fixed;
  right: 28px;
  bottom: 96px;
  z-index: 21;
  width: min(300px, calc(100% - 40px));
  padding: 16px 18px 14px;
  border: 1px solid #b9c8ea;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(29, 45, 90, 0.2);
  color: #26345a;
  line-height: 1.5;
}

.tutor-chat-prompt::after {
  position: absolute;
  right: 20px;
  bottom: -8px;
  width: 14px;
  height: 14px;
  border-right: 1px solid #b9c8ea;
  border-bottom: 1px solid #b9c8ea;
  background: #fff;
  content: "";
  transform: rotate(45deg);
}

.tutor-chat-prompt strong {
  display: block;
  margin-bottom: 4px;
  color: #1d2d5a;
  font-size: 13px;
}

.tutor-chat-prompt p {
  margin: 0 0 8px;
  font-size: 12px;
}

.tutor-chat-prompt a {
  color: #3858a9;
  font-size: 11.5px;
  font-weight: 700;
  text-decoration: none;
}

.tutor-chat-prompt a:hover {
  text-decoration: underline;
}

.tutor-chat-prompt-close {
  position: absolute;
  top: 6px;
  right: 8px;
  border: 0;
  background: transparent;
  color: #6f7b9e;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.tutor-chat-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
}
.tutor-chat-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(15, 17, 21, 0.55);
}
.tutor-chat-card {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(560px, 100%);
  height: min(680px, 82vh);
  padding: 18px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}
.tutor-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.tutor-chat-header strong {
  display: block;
  font-size: 16px;
}
.tutor-chat-header span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}
.tutor-chat-card .chat-messages {
  flex: 1;
  max-height: none;
  padding: 16px 2px;
  margin: 0;
}
.chat-badge.blocked {
  background: #fdecec;
  color: #b23b3b;
}
.chat-badge.system {
  background: #fff4dd;
  color: #a06a00;
}
.chat-box.chat-blocked .chat-msg {
  background: #fdecec;
  border-color: #f2b9b9;
  color: #8f2b2b;
}
.chat-box.chat-system .chat-msg {
  background: #fff4dd;
  border-color: #f0d99b;
  color: #7a5200;
}
.chat-caret {
  display: inline-block;
  width: 2px;
  height: 12px;
  margin-left: 2px;
  background: currentColor;
  vertical-align: text-bottom;
  animation: chat-caret-blink 0.9s steps(1) infinite;
}
@keyframes chat-caret-blink {
  0%,
  50% {
    opacity: 1;
  }
  50.01%,
  100% {
    opacity: 0;
  }
}
.chat-loading {
  padding: 8px 2px;
  color: var(--muted);
  font-size: 12px;
}
.chat-loading-error {
  color: #b23b3b;
}
@media (max-width: 900px) {
  .work-columns {
    grid-template-columns: 1fr;
  }
  .sidebar {
    width: 160px;
  }
  .topbar-meta {
    display: none;
  }
  .tutor-chat-fab {
    right: 24px;
    bottom: 24px;
  }
  .tutor-chat-fab.is-active,
  .tutor-chat-fab:hover,
  .tutor-chat-fab:focus-visible {
    right: 18px;
    bottom: 18px;
  }
  .tutor-chat-prompt {
    right: 18px;
    bottom: 86px;
    width: min(300px, calc(100% - 36px));
  }
}
.new-round-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding: 9px 12px;
  border: 1px solid #e5c98f;
  border-radius: 7px;
  background: var(--warning);
  color: #765523;
  font-size: 12px;
  line-height: 1.5;
}
