/*==================================================
  1. CSS 변수 (테마 관리)
==================================================*/
:root {
  --color-bg: #F5F5F7;
  --color-text: #333;
  --color-text-muted: #777;
  --color-primary: #d7263d;
  --color-error-bg: #f3f3f3;
  --color-error-border: #d7263d;
  --color-error-text: #333;
  --transition-fast: 0.3s;
  --max-content-width: 1200px;
}

[data-theme="dark"] {
  --color-bg: #1a1a1a;
  --color-text: #eee;
  --color-text-muted: #ccc;
  --color-primary: #e74c3c;
  --color-error-bg: #2a2a2a;
  --color-error-border: #e74c3c;
  --color-error-text: #eee;
}

/*==================================================
  2. 기본 설정
==================================================*/
body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
}

.top-menu a {
  font-family: 'Poppins', sans-serif;
}

a {
  text-decoration: none;
  color: inherit;
}

/*==================================================
  3. Hero Section
==================================================*/
.hero {
  height: 80vh;
  margin-top: 100px;
  background: var(--color-bg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  text-align: center;
}

.hero .bigtitle {
  font-family: 'Poppins', sans-serif;
  font-size: 5rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
}

.hero .subtext {
  margin-top: 1rem;
  font-size: 1rem;
  color: var(--color-text-muted);
}

.scroll-indicator {
  margin-top: 3rem;
  font-size: 2rem;
  color: var(--color-primary);
  cursor: pointer;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(10px); }
}

/*==================================================
  4. 공통 에러 메시지 박스
==================================================*/
.error-message {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.1rem;
  background: var(--color-error-bg);
  color: var(--color-error-text);
  padding: 1.5rem;
  border-radius: 10px;
  box-shadow: 0 0 12px rgba(0,0,0,0.05);
  border-left: 6px solid var(--color-error-border);
  width: 100%;
  margin: 0;
  display: block;
}

/*==================================================
  5. Stickers (스티커) Section
==================================================*/
.sticker {
  position: absolute;
  width: 200px;
  height: 200px;
  object-fit: cover;
  pointer-events: auto;
  cursor: pointer;
  z-index: 5;
  /* 회전은 HTML 인라인 스타일에서 처리 */
}


/*==================================================
  6. Projects Section
==================================================*/
.projects {
  max-width: var(--max-content-width);
  margin: 0 auto;
  padding: 3.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 15rem;
}

.project {
  transition: transform var(--transition-fast);
}

/* project-info, title, description, tags 기본 스타일 */
.project-info h3 {
  font-size: 2rem;
  font-weight: 800;
  margin: 0 0 0.5rem;
}

.project-description {
  color: #6b6b6b;
  margin: 0.5rem 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 70%;
  width: 100%;
  text-align: inherit;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 1px solid #ccc;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: background var(--transition-fast),
              color var(--transition-fast),
              border-color var(--transition-fast);
}
.tag:hover {
  background: #111;
  color: #fff;
  border-color: #111;
}

/*==================================================
  7. 데스크탑 레이아웃 (≥769px)
==================================================*/
@media (min-width: 769px) {
  .project {
    display: grid;
    grid-template-columns: minmax(300px, 4fr) minmax(150px, 1fr);
    padding: 3.5rem 2rem;
  }
  .project:nth-of-type(even) {
    grid-template-columns: minmax(150px, 1fr) minmax(300px, 4fr);
  }

  /* 에러 메시지 위치 */
  .project:nth-of-type(odd)  .error-message { grid-column: 1; }
  .project:nth-of-type(even) .error-message { grid-column: 2; }

  /* info 영역 배치 & 정렬 */
  .project-info {
    grid-row: 2;
    padding-top: 0.5rem;
  }
  .project:nth-of-type(odd)  .project-info { 
    grid-column: 1;
    text-align: left;
  }
  .project:nth-of-type(even) .project-info {
    grid-column: 2;
    text-align: right;
  }
  .project:nth-of-type(even) .tags {
    justify-content: flex-end;
  }

  /* description도 좌/우 정렬 */
  .project:nth-of-type(odd) .project-description {
    margin-left: 0;
    margin-right: auto;
  }
  .project:nth-of-type(even) .project-description {
    margin-left: auto;
    margin-right: 0;
  }
}

.dark-mode .hero {
  height: 80vh;
  margin-top: 100px;
  background: #121212;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  text-align: center;
}

.dark-mode .tag:hover {
  background: #fff;
  color: #000;
  border-color: #fff;
}

/*==================================================
  8. 모바일 레이아웃 (≤768px)
==================================================*/
@media (max-width: 768px) {
  .projects {
    padding: 2rem 1rem;
  }
  .project {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }
  .project .error-message {
    width: calc(100% - 2rem);
    margin: 0 auto;
    text-align: center;
  }
  .project-info {
    padding: 0 1rem;
    text-align: center;
  }
  .tags {
    justify-content: center;
  }

  /* 모바일 전용 스티커 위치 & 크기 조정 */
  .sticker {
    width: 190px !important;
    height: 190px !important;
  }
  .sticker[src$="sticker.png"] {
    top: 10% !important;
    left: 70% !important;
    transform: translateX(-50%) rotate(15deg) !important;
  }
  .sticker[src$="memory_sticker.png"] {
    top: 145% !important;
    right: 20% !important;
    transform: rotate(2deg) !important;
  }
  .sticker[src$="accident.png"] {
    top: 225% !important;
    left: 15% !important;
    transform: rotate(-5deg) !important;
  }

  .project-description {
    max-width: 100% !important;
    width: 100% !important;
  }
}

/*==================================================
  9. Terminal Selector (v2)
==================================================*/
/* CRT 안 — Night Owl 멀티 컬러 (배경에는 약한 초록 인광 깔려 있음) */
:root {
  --term-bg: #001a00;
  --term-bar: rgba(28, 31, 41, 0.5);
  --term-border: #004500;
  --term-text: #d6deeb;
  --term-muted: #7e8aa3;
  --term-blue: #82aaff;
  --term-green: #c3e88d;
  --term-yellow: #ffcb6b;
  --term-red: #ff5370;
  --term-purple: #c792ea;
  --term-pink: #f78c6c;
  --term-cyan: #89ddff;
}

/* === v2 페이지 — CRT가 화면 전체를 덮음, 스크롤 없음 === */
.ai-v2-body {
  height: 100vh;
  overflow: hidden;
  margin: 0;
  background: #000;
  color: #d6deeb;
}

.ai-v2-body .top-menu {
  background: rgba(0, 0, 0, 0.55) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: none !important;
  z-index: 200;
}

.ai-v2-body .top-menu a { color: #ddd !important; }
.ai-v2-body .top-menu a:hover { color: #fff !important; }
.ai-v2-body #darkModeToggle { color: #ddd; }

/* Hero — CRT 화면 상단 영역 */
.ai-v2-body .hero {
  height: auto !important;
  min-height: 0 !important;
  margin-top: 0 !important;
  padding: 1.8rem 2rem 0.75rem !important;
  background: transparent !important;
  flex-shrink: 0;
}

.ai-v2-body .hero .bigtitle {
  font-size: 3rem;
  color: #4eff4e;
  letter-spacing: -0.01em;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  text-shadow:
    0 0 6px rgba(78, 255, 78, 0.7),
    0 0 18px rgba(78, 255, 78, 0.35);
}

.ai-v2-body .hero .subtext {
  color: #2da72d;
  font-size: 0.95rem;
  margin-top: 0.4rem;
  font-family: 'JetBrains Mono', monospace;
  text-shadow: 0 0 4px rgba(78, 255, 78, 0.4);
}

.ai-v2-body .hero .scroll-indicator { display: none; }

.ai-v2-body .hero .highlight {
  background-color: rgba(78, 255, 78, 0.18);
  color: #87ff87;
  border-radius: 2px;
  padding: 1px 4px;
  text-shadow: 0 0 6px rgba(135, 255, 135, 0.6);
}

.terminal-stage {
  flex: 1;
  margin: 0 auto;
  padding: 0.5rem 3vw 5vh;
  width: 100%;
  max-width: 1700px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.terminal-row {
  display: flex;
  align-items: stretch;
  justify-content: center;
  width: 100%;
  gap: 0;
}

/* === 터미널 박스 === */
.terminal {
  width: 100%;
  max-width: 720px;
  background: var(--term-bg);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.45),
              0 0 0 1px var(--term-border);
  font-family: 'JetBrains Mono', monospace;
  color: var(--term-text);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: max-width 0.45s cubic-bezier(0.65, 0, 0.35, 1);
}

.terminal-bar {
  background: var(--term-bar);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--term-border);
}

.dots {
  display: flex;
  gap: 6px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: block;
}

.dot-red    { background: #ff5f56; }
.dot-yellow { background: #ffbd2e; }
.dot-green  { background: #27c93f; }

.terminal-bar .title {
  color: #8a92a6;
  font-size: 12px;
  flex: 1;
  text-align: center;
  font-weight: 500;
}

.terminal-body {
  padding: 18px 18px 14px;
  font-size: 14px;
  line-height: 1.65;
  flex: 1;
  overflow-y: auto;
  max-height: 70vh;
}

.line {
  white-space: pre-wrap;
  word-break: break-word;
}

.line.spacer {
  height: 0.6em;
}

.line.muted {
  color: var(--term-muted);
}

.append,
.line.append {
  animation: term-fade-in 0.25s ease both;
}

@keyframes term-fade-in {
  from { opacity: 0; transform: translateY(2px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* prompt 색상 */
.prompt-user  { color: var(--term-purple); }
.prompt-host  { color: var(--term-green); }
.prompt-path  { color: var(--term-blue); }
.prompt-sym   { color: var(--term-text); margin: 0 4px 0 2px; }
.cmd          { color: var(--term-text); }
.ok           { color: var(--term-green); }
.num          { color: var(--term-yellow); }

.line.err {
  color: var(--term-red);
}

.line.progress { color: var(--term-muted); }
.line.progress .bar { color: var(--term-cyan); letter-spacing: 0; }
.line.progress .pct { color: var(--term-yellow); font-variant-numeric: tabular-nums; }

.err-tag {
  background: var(--term-red);
  color: #fff;
  font-weight: 700;
  padding: 0 6px;
  border-radius: 3px;
  margin-right: 6px;
}

.dark-mode .err-tag {
  color: #15171f;
}

/* === CRT Monitor — top-menu 아래로 viewport를 덮음 === */
.crt-monitor {
  position: fixed;
  top: 50px;        /* top-menu 아래에서 시작 → 상단 베젤이 분명히 보임 */
  right: 0;
  bottom: 0;
  left: 0;
  background: linear-gradient(180deg, #1a1c1f 0%, #0a0b0d 100%);
  z-index: 1;
  box-sizing: border-box;
}

/* CRT 화면 — Pip-Boy 그린 인광 (베젤 안쪽, 곡선 모서리) */
.crt-screen {
  position: absolute;
  inset: clamp(14px, 2.4vmin, 32px) clamp(14px, 2.4vmin, 32px) clamp(40px, 5vmin, 60px);
  background:
    radial-gradient(ellipse at center, #002800 0%, #000a00 80%, #000000 100%);
  border-radius: 3.5% / 5.5%;
  overflow: hidden;
  box-shadow:
    inset 0 0 110px rgba(0, 0, 0, 0.9),
    inset 0 0 30px rgba(78, 255, 78, 0.06),
    inset 0 0 0 1px #000,
    0 0 0 2px #050505,
    0 0 0 4px rgba(80, 80, 90, 0.2);
  display: flex;
  flex-direction: column;
  z-index: 2;
  /* 본문은 원래 색 유지, 그 위에 약한 초록 인광 헤일로 */
  color: var(--term-text);
  text-shadow:
    0 0 6px rgba(78, 255, 78, 0.18),
    0 0 14px rgba(78, 255, 78, 0.08);
}

/* 스캔라인 — Pip-Boy 스타일로 굵고 진하게 */
.crt-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.45) 0,
    rgba(0, 0, 0, 0.45) 1px,
    rgba(0, 0, 0, 0) 1px,
    rgba(0, 0, 0, 0) 3px
  );
  pointer-events: none;
  z-index: 30;
}

/* 코너 비네팅 — CRT 가장자리 어두움 (강하게) */
.crt-screen::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at center,
    transparent 40%,
    rgba(0, 0, 0, 0.65) 90%,
    rgba(0, 0, 0, 0.95) 100%
  );
  pointer-events: none;
  z-index: 31;
  border-radius: inherit;
}

/* 안의 터미널 자체 그림자/배경 제거 — CRT 화면 자체에 직접 그려진 듯 */
.crt-screen .terminal {
  box-shadow: none;
  border-radius: 0;
  background: transparent;
}

.crt-screen .terminal-bar {
  background: rgba(28, 31, 41, 0.6);
}

.crt-screen .terminal-status {
  background: rgba(28, 31, 41, 0.6);
}

/* 브랜드 라벨 — 베젤 하단 중앙 */
.crt-brand {
  position: absolute;
  bottom: clamp(4px, 0.7vmin, 10px);
  left: 50%;
  transform: translateX(-50%);
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(7px, 0.85vmin, 11px);
  letter-spacing: 0.3em;
  color: #5a5e66;
  user-select: none;
  z-index: 3;
}

/* 전원 LED — 베젤 우하단 */
.crt-led {
  position: absolute;
  bottom: clamp(6px, 1vmin, 12px);
  right: clamp(10px, 1.5vmin, 22px);
  width: clamp(5px, 0.7vmin, 9px);
  height: clamp(5px, 0.7vmin, 9px);
  border-radius: 50%;
  background: #4ade80;
  box-shadow:
    0 0 8px rgba(74, 222, 128, 0.9),
    0 0 16px rgba(74, 222, 128, 0.4);
  animation: crt-led-pulse 3.5s ease-in-out infinite;
  z-index: 3;
}

@keyframes crt-led-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.65; }
}

/* article-panel — 어두운 CRT 배경에 어울리는 그림자 */
.ai-v2-body .article-panel {
  background: #fff;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04),
    0 30px 60px rgba(0, 0, 0, 0.5);
}

/* 터미널 body 높이 — CRT 화면 안에 알맞게 */
.terminal-body {
  max-height: calc(100vh - 320px);
}

/* 터미널 자체의 max-width 살짝 키워 풀스크린에 맞춤 */
.terminal {
  max-width: 760px;
}

/* prompt line */
.prompt-line {
  color: var(--term-text);
  margin-top: 6px;
}

.prompt-arrow {
  color: var(--term-cyan);
  font-weight: 700;
  margin-right: 8px;
}

.prompt-text {
  color: var(--term-muted);
}

.sel-num {
  color: var(--term-yellow);
  font-weight: 600;
}

.cursor {
  display: inline-block;
  width: 8px;
  height: 1em;
  background: var(--term-text);
  vertical-align: text-bottom;
  margin-left: 4px;
  animation: cursor-blink 1.05s steps(1) infinite;
}

@keyframes cursor-blink {
  0%, 50%   { opacity: 1; }
  50.01%, 100% { opacity: 0; }
}

/* model rows (선택 가능한 항목) */
.model-row {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 8px 10px;
  margin: 2px 0;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  color: var(--term-text);
  text-align: left;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.model-row:hover {
  background: rgba(130, 170, 255, 0.08);
  border-color: rgba(130, 170, 255, 0.25);
}

.model-row:active {
  transform: scale(0.995);
}

.model-row .idx {
  color: var(--term-muted);
}

.model-row .name {
  color: var(--term-cyan);
  font-weight: 600;
}

.model-row .meta {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: flex-end;
}

.meta-tag {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.02em;
  font-weight: 500;
  white-space: nowrap;
}

.tag-vision  { background: rgba(199, 146, 234, 0.16); color: var(--term-purple); }
.tag-paper   { background: rgba(255, 203, 107, 0.16); color: var(--term-yellow); }
.tag-domain  { background: rgba(137, 221, 255, 0.14); color: var(--term-cyan); }
.tag-llm     { background: rgba(195, 232, 141, 0.16); color: var(--term-green); }
.tag-params  { background: rgba(247, 140, 108, 0.16); color: var(--term-pink); }
.tag-gpu     { background: rgba(130, 170, 255, 0.16); color: var(--term-blue); }

/* 상태 바 */
.terminal-status {
  background: var(--term-bar);
  border-top: 1px solid var(--term-border);
  padding: 8px 16px;
  display: flex;
  gap: 22px;
  font-size: 11px;
  color: var(--term-muted);
  flex-wrap: wrap;
}

.status-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--term-green);
  box-shadow: 0 0 6px rgba(195, 232, 141, 0.7);
  display: inline-block;
}

.ticker {
  margin-left: auto;
  color: var(--term-yellow);
  font-variant-numeric: tabular-nums;
}

/* === 글 패널 === */
.article-panel {
  position: relative;
  width: 0;
  height: auto;
  align-self: stretch;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.18);
  opacity: 0;
  transform: translateX(30px);
  pointer-events: none;
  transition: width 0.45s cubic-bezier(0.65, 0, 0.35, 1),
              margin-left 0.45s cubic-bezier(0.65, 0, 0.35, 1),
              opacity 0.35s ease 0.1s,
              transform 0.45s cubic-bezier(0.65, 0, 0.35, 1);
}

.terminal-stage.article-open .article-panel {
  width: 580px;
  margin-left: 28px;
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.article-frame {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  background: #F5F5F7;
}

.article-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background 0.2s ease, transform 0.15s ease;
}

.article-close:hover { background: rgba(0, 0, 0, 0.8); }
.article-close:active { transform: scale(0.92); }

/* 모바일 닫기 버튼 — 데스크톱에선 숨김 */
.article-close-mobile {
  display: none;
}

.dark-mode .article-panel {
  background: #1c1c1e;
}
.dark-mode .article-frame {
  background: #1c1c1e;
}

/* 좁은 데스크톱 / 태블릿 / 모바일: 패널을 폰 옆에 못 두면 아래로 + 페이지 스크롤 허용 */
@media (max-width: 1300px) {
  .ai-v2-body {
    height: auto;
    overflow: auto;
  }

  .crt-monitor {
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    margin-top: 50px;
    min-height: calc(100vh - 50px);
    padding: clamp(14px, 2.4vmin, 32px) clamp(14px, 2.4vmin, 32px) clamp(40px, 5vmin, 60px);
    box-sizing: border-box;
  }

  .crt-screen {
    position: relative;
    inset: auto;
    width: auto;
    min-height: calc(100vh - 50px - 90px);
    /* 콘텐츠(글) 길이만큼 자라야 하므로 모바일에선 overflow 풀음 */
    overflow: visible;
  }

  /* 모바일에선 비네팅이 길어진 페이지에 거슬릴 수 있으니 비활성화 */
  .crt-screen::after {
    display: none;
  }

  /* 모바일 floating 닫기 버튼 — Pip-Boy phosphor 그린 CRT 톤 */
  .article-close-mobile {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: fixed;
    bottom: 22px;
    left: 50%;
    transform: translateX(-50%);
    padding: 13px 26px;
    background: rgba(0, 26, 0, 0.88);
    color: #4eff4e;
    border: 1px solid rgba(78, 255, 78, 0.55);
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.02em;
    cursor: pointer;
    z-index: 300;
    box-shadow:
      0 10px 30px rgba(0, 0, 0, 0.5),
      0 0 18px rgba(78, 255, 78, 0.25);
    text-shadow:
      0 0 6px rgba(78, 255, 78, 0.7),
      0 0 14px rgba(78, 255, 78, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.18s ease, background 0.2s ease, border-color 0.2s ease;
  }

  .article-close-mobile i {
    font-size: 0.9rem;
  }

  .article-close-mobile:hover {
    background: rgba(0, 50, 0, 0.92);
    border-color: rgba(78, 255, 78, 0.85);
    color: #87ff87;
  }

  .article-close-mobile:active {
    transform: translateX(-50%) translateY(1px);
  }

  /* 글 패널이 열려 있을 때만 표시 */
  .terminal-stage.article-open .article-close-mobile {
    opacity: 1;
    pointer-events: auto;
  }

  /* 데스크톱 작은 × 버튼은 모바일에서 숨김 */
  .article-close {
    display: none;
  }

  .terminal-row {
    flex-direction: column;
    align-items: center;
  }

  .terminal {
    max-width: 720px;
  }

  .article-panel {
    width: 100%;
    max-width: 720px;
    height: 0;
    margin-left: 0;
    transform: translateY(-20px);
    transition: opacity 0.3s ease;
  }

  .article-frame {
    height: auto;
    min-height: 200px;
  }

  .terminal-stage.article-open .article-panel {
    width: 100%;
    max-width: 720px;
    /* 콘텐츠 전체 높이만큼 — JS가 iframe 높이를 scrollHeight로 설정 */
    height: auto;
    margin-left: 0;
    margin-top: 24px;
    transform: translateY(0);
  }
}

/* 모바일 세부 조정 */
@media (max-width: 768px) {
  /* 모바일: hero 컴팩트하게 → 터미널이 빨리 보이도록 */
  .ai-v2-body .hero {
    padding: 1rem 1rem 0.5rem !important;
  }

  .ai-v2-body .hero .bigtitle {
    font-size: 2rem;
  }

  .ai-v2-body .hero .subtext {
    font-size: 0.85rem;
  }

  /* 베젤 얇게 → 콘텐츠 공간 확보 */
  .crt-monitor {
    padding: 12px 12px 28px !important;
  }

  /* 비네팅 약하게 → 스크롤 시 화면 가장자리 어두움 덜 거슬림 */
  .crt-screen::after {
    background: radial-gradient(
      ellipse at center,
      transparent 70%,
      rgba(0, 0, 0, 0.35) 100%
    );
  }

  .crt-brand {
    font-size: 8px;
    letter-spacing: 0.25em;
  }

  .terminal-stage {
    padding: 1rem 12px 2rem;
  }

  .terminal-body {
    padding: 14px 12px 10px;
    font-size: 12.5px;
    line-height: 1.6;
  }

  .terminal-bar .title {
    font-size: 11px;
  }

  .model-row {
    grid-template-columns: 26px 1fr;
    grid-template-rows: auto auto;
    row-gap: 4px;
    padding: 8px;
    font-size: 13px;
  }

  .model-row .idx {
    grid-row: 1 / span 2;
  }

  .model-row .name {
    grid-column: 2;
  }

  .model-row .meta {
    grid-column: 2;
    justify-content: flex-start;
    gap: 4px;
  }

  .meta-tag {
    font-size: 10px;
    padding: 1px 6px;
  }

  .terminal-status {
    padding: 6px 12px;
    gap: 10px;
    font-size: 10px;
  }

  .ticker {
    margin-left: 0;
  }

}

/* 매우 좁은 화면에서 prompt 줄바꿈 강제 */
@media (max-width: 420px) {
  .terminal-body .line:not(.model-row) {
    font-size: 11.5px;
  }
}

