/* ── UTTA Platform — Dark Gold Theme ── */

:root {
  --bg: #0a0a0a;
  --surface: #111111;
  --surface2: #181818;
  --surface3: #1f1f1f;
  --border: #2a2a2a;
  --gold: #c9a84c;
  --gold-light: #e8c76d;
  --gold-dim: #7a6430;
  --cubixa: #818cf8;
  --cubixa-light: #a5b4fc;
  --cubixa-dim: #3730a3;
  --text: #e8e8e8;
  --text-muted: #777;
  --text-dim: #444;
  --red: #c0392b;
  --green: #27ae60;
  --yellow: #f39c12;
  --blue: #2980b9;
  --radius: 8px;
  --radius-sm: 4px;
  --shadow: 0 4px 24px rgba(0,0,0,0.6);
  --shadow-gold: 0 0 20px rgba(201,168,76,0.15);
  --shadow-cubixa: 0 0 20px rgba(129,140,248,0.15);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--gold); text-decoration: none; transition: color .2s; }
a:hover { color: var(--gold-light); }

/* ── NAV ── */
.nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-right: 3rem;
}

.nav-links { display: flex; gap: 0.25rem; flex: 1; }

.nav-links a {
  padding: 0.4rem 1rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all .2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--gold);
  background: rgba(201,168,76,0.08);
}

.nav-module-label {
  font-size: 0.7rem;
  letter-spacing: 1px;
  color: var(--text-dim);
  text-transform: uppercase;
  padding: 0 0.5rem;
  align-self: center;
}

/* ── LAYOUT ── */
.container { max-width: 1100px; margin: 0 auto; padding: 2rem 1.5rem; }
.page-header { margin-bottom: 2rem; }
.page-header h1 { font-size: 1.7rem; font-weight: 700; color: var(--text); }
.page-header .subtitle { color: var(--text-muted); margin-top: 0.25rem; font-size: 0.9rem; }

.page-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
}

/* ── CARDS ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--gold);
}

/* ── STATS GRID ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 100%;
  background: var(--gold);
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 0.4rem;
}

/* ── TABLES ── */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

thead th {
  background: var(--surface2);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background .15s;
}

tbody tr:hover { background: var(--surface2); }

tbody td { padding: 0.85rem 1rem; vertical-align: middle; }

/* ── BADGES ── */
.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.badge-high    { background: rgba(39,174,96,0.15);  color: #2ecc71; border: 1px solid rgba(39,174,96,0.3); }
.badge-medium  { background: rgba(243,156,18,0.15); color: #f39c12; border: 1px solid rgba(243,156,18,0.3); }
.badge-low     { background: rgba(192,57,43,0.15);  color: #e74c3c; border: 1px solid rgba(192,57,43,0.3); }
.badge-pending { background: rgba(120,120,120,0.15);color: #888;    border: 1px solid rgba(120,120,120,0.3); }
.badge-approved{ background: rgba(39,174,96,0.15);  color: #2ecc71; border: 1px solid rgba(39,174,96,0.3); }
.badge-rejected{ background: rgba(192,57,43,0.15);  color: #e74c3c; border: 1px solid rgba(192,57,43,0.3); }
.badge-held    { background: rgba(41,128,185,0.15);  color: #3498db; border: 1px solid rgba(41,128,185,0.3); }

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.2rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all .2s;
  text-decoration: none;
}

.btn-primary {
  background: var(--gold);
  color: #000;
}
.btn-primary:hover {
  background: var(--gold-light);
  color: #000;
  box-shadow: var(--shadow-gold);
}

.btn-outline {
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--gold-dim);
}
.btn-outline:hover {
  background: rgba(201,168,76,0.08);
  border-color: var(--gold);
  color: var(--gold-light);
}

.btn-danger {
  background: transparent;
  color: var(--red);
  border: 1px solid rgba(192,57,43,0.4);
}
.btn-danger:hover { background: rgba(192,57,43,0.12); }

.btn-sm { padding: 0.3rem 0.75rem; font-size: 0.8rem; }

/* ── FORMS ── */
.form-group { margin-bottom: 1.25rem; }

label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 0.4rem;
}

input[type="text"],
input[type="number"],
textarea,
select {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 0.65rem 0.9rem;
  font-size: 0.95rem;
  transition: border-color .2s;
  outline: none;
  font-family: inherit;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(201,168,76,0.1);
}

textarea {
  resize: vertical;
  min-height: 120px;
  pointer-events: auto !important;
  position: relative !important;
  z-index: 10 !important;
}

select option { background: var(--surface2); }

.form-hint { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.3rem; }

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
}

input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: var(--gold);
  cursor: pointer;
}

/* ── AI ANALYSIS BLOCK ── */
.ai-analysis {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  font-size: 0.88rem;
  line-height: 1.7;
  white-space: pre-wrap;
  color: var(--text);
}

/* ── PROGRESS BARS ── */
.progress-wrap { margin: 0.5rem 0; }
.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}
.progress-bar {
  height: 8px;
  background: var(--surface3);
  border-radius: 4px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}
.progress-fill.human { background: linear-gradient(90deg, var(--gold-dim), var(--gold)); }
.progress-fill.ai    { background: linear-gradient(90deg, #2980b9, #3498db); }

/* ── TIMELINE ── */
.timeline { position: relative; padding-left: 1.5rem; }
.timeline::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--border);
}
.timeline-item {
  position: relative;
  margin-bottom: 1.5rem;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: -1.85rem;
  top: 0.4rem;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--gold);
  border: 2px solid var(--bg);
}
.timeline-date { font-size: 0.75rem; color: var(--text-dim); }
.timeline-title { font-weight: 600; margin: 0.2rem 0; }
.timeline-body { font-size: 0.85rem; color: var(--text-muted); }

/* ── REVENUE SIMULATOR ── */
.revenue-box {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-top: 1rem;
}
.revenue-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.revenue-row:last-child { border-bottom: none; font-weight: 700; font-size: 1rem; }
.revenue-amount { color: var(--gold); font-weight: 700; }

/* ── FILTER BAR ── */
.filter-bar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.filter-btn {
  padding: 0.35rem 0.9rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  text-decoration: none;
  transition: all .2s;
}
.filter-btn:hover,
.filter-btn.active {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(201,168,76,0.08);
}

/* ── DETAIL META ── */
.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.meta-item {}
.meta-key { font-size: 0.72rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; }
.meta-value { font-size: 0.95rem; color: var(--text); font-weight: 500; margin-top: 0.2rem; }

/* ── MODULE BANNER ── */
.module-banner {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(201,168,76,0.06);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius-sm);
  padding: 0.4rem 1rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.module-banner .dot {
  width: 6px; height: 6px;
  background: var(--gold);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ── HERO ── */
.hero {
  text-align: center;
  padding: 4rem 2rem 4rem;
  overflow: visible;
}
.hero-title {
  font-size: 3rem;
  font-weight: 900;
  letter-spacing: 6px;
  color: var(--gold);
  text-transform: uppercase;
}
.hero-subtitle {
  font-size: 0.9rem;
  letter-spacing: 3px;
  color: var(--text-muted);
  margin-top: 0.5rem;
  text-transform: uppercase;
}
.hero-divider {
  width: 60px;
  height: 2px;
  background: var(--gold);
  margin: 1.5rem auto;
}

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-dim);
}
.empty-state .icon { font-size: 2.5rem; margin-bottom: 1rem; }
.empty-state p { margin-bottom: 1.5rem; }

/* ── GRID 2 COL ── */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 720px) {
  .grid-2 { grid-template-columns: 1fr; }
  .nav { padding: 0 1rem; }
  .nav-module-label { display: none; }
  .hero-title { font-size: 2rem; }
}

/* ── ACTION ROW ── */
.action-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

/* ── STATUS FORM INLINE ── */
.status-form { display: inline; }

/* ── SECTION TITLE ── */
.section-title {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1rem;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-dim); }

/* ── CUBIXA MODULE STYLES ── */
.module-banner-cubixa {
  background: rgba(129,140,248,0.06);
  border-color: var(--cubixa-dim);
  color: var(--cubixa-light);
}
.module-banner-cubixa .dot {
  background: var(--cubixa-light);
}

.stat-card.stat-card-cubixa::before {
  background: var(--cubixa);
}
.stat-card.stat-card-cubixa .stat-value {
  color: var(--cubixa-light);
}

/* ── SYSTEM FLOW ── */
.flow-steps {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  flex-wrap: nowrap !important;
  overflow-x: auto !important;
  gap: 0 !important;
  margin: 2.5rem auto 0;
  padding: 0 1.5rem 0.5rem;
  max-width: 1000px;
  width: 100%;
  box-sizing: border-box;
}

.flow-step {
  min-width: 130px;
  max-width: 160px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 16px 12px;
  border: 1px solid rgba(201,168,76,0.3);
  border-radius: 8px;
  background: rgba(201,168,76,0.05);
  cursor: default;
  transition: background 0.2s, border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.flow-step:hover {
  background: rgba(201,168,76,0.12);
  border-color: rgba(201,168,76,0.65);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4), 0 0 16px rgba(201,168,76,0.12);
}

.flow-step-num {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--gold-dim);
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.flow-step-icon {
  font-size: 1.8rem;
  line-height: 1;
  margin-bottom: 8px;
}

.flow-step-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 4px;
}

.flow-step-desc {
  font-size: 0.7rem;
  color: #777777;
  line-height: 1.4;
}

.flow-arrow {
  font-size: 1.5rem;
  color: var(--gold);
  padding: 0 8px;
  flex-shrink: 0;
  line-height: 1;
  user-select: none;
}

@media (max-width: 768px) {
  .flow-steps {
    flex-wrap: wrap !important;
    overflow-x: visible !important;
    justify-content: center !important;
    gap: 10px !important;
    padding: 0 1rem 0.5rem;
  }
  .flow-arrow { display: none; }
  .flow-step { min-width: 120px; max-width: 140px; }
}

/* ── MODULE INTRO CARDS ── */
.module-intro-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
}
.module-intro-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  position: relative;
  overflow: hidden;
}
.module-intro-card.utta { border-top: 2px solid var(--gold); }
.module-intro-card.cubixa { border-top: 2px solid var(--cubixa); }
.module-intro-name {
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 0.3rem;
}
.module-intro-card.utta .module-intro-name { color: var(--gold); }
.module-intro-card.cubixa .module-intro-name { color: var(--cubixa-light); }
.module-intro-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ── REVENUE HIGHLIGHT BOXES ── */
.revenue-highlight-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.revenue-highlight-box {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
}
.revenue-highlight-box.total { border-top: 2px solid var(--text-dim); }
.revenue-highlight-box.human { border-top: 2px solid var(--gold); }
.revenue-highlight-box.ai-share { border-top: 2px solid var(--cubixa); }
.revenue-highlight-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
}
.revenue-highlight-value {
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1;
}
.revenue-highlight-box.total .revenue-highlight-value { color: var(--text); }
.revenue-highlight-box.human .revenue-highlight-value { color: var(--gold); }
.revenue-highlight-box.ai-share .revenue-highlight-value { color: var(--cubixa-light); }
.revenue-highlight-pct {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 0.3rem;
}

/* ── REASON DISPLAY ── */
.reason-box {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold-dim);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ── FORM GUIDE SECTIONS ── */
.form-guide {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  font-size: 0.78rem;
  color: var(--text-dim);
  line-height: 1.6;
  pointer-events: none;
  position: relative;
  z-index: 1;
}
.form-guide strong { color: var(--text-muted); }

@media (max-width: 720px) {
  .flow-section { gap: 0.25rem; }
  .flow-arrow { display: none; }
  .module-intro-grid { grid-template-columns: 1fr; }
  .revenue-highlight-grid { grid-template-columns: 1fr; }
}

.input-method-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-bottom:18px;}
.input-method-card{background:var(--bg-card);border:1px solid var(--border);color:var(--text-muted);padding:18px 12px;cursor:pointer;border-radius:6px;text-align:center;transition:all 0.2s;}
.input-method-card:hover,.input-method-card.active{border-color:var(--gold);background:rgba(201,168,76,0.08);}
.input-method-icon{font-size:22px;margin-bottom:8px;}
.input-method-title{font-weight:700;font-size:13px;}
.input-panel{display:none;margin-top:16px;padding:18px;border:1px solid var(--border);border-radius:6px;background:var(--bg-card);}
.input-panel.active{display:block;}
.section-label{color:var(--gold);font-size:0.6rem;font-weight:700;margin-bottom:12px;letter-spacing:0.2em;}
.field-label{display:block;color:var(--text-muted);font-size:0.75rem;margin:14px 0 6px;font-weight:700;letter-spacing:0.05em;}
.field-input,.field-textarea{width:100%;background:var(--bg-card);color:var(--text-primary);border:1px solid var(--border);border-radius:4px;padding:10px 12px;font-size:0.85rem;box-sizing:border-box;}
.field-textarea{min-height:120px;resize:vertical;}
.decision-context-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:12px;margin-top:12px;}
.upload-box{display:block;border:2px dashed var(--gold-dim, #3730a3);border-radius:6px;padding:32px 20px;text-align:center;cursor:pointer;background:rgba(201,168,76,0.03);}
.upload-icon{font-size:28px;margin-bottom:10px;}
.upload-title{color:var(--text-primary);font-weight:700;margin-bottom:6px;font-size:0.85rem;}
.upload-desc{color:var(--text-dim);font-size:0.72rem;}
.file-info{margin-top:12px;padding:10px 12px;border:1px solid var(--border);border-radius:4px;color:var(--text-muted);font-size:0.82rem;}
.hidden{display:none;}
.analysis-status{margin-top:10px;color:var(--text-dim);font-size:0.78rem;}
.voice-controls{display:flex;align-items:center;gap:12px;margin-bottom:12px;}
.primary-btn,.submit-btn{background:var(--gold);color:#0a0a0f;border:none;border-radius:4px;padding:10px 22px;cursor:pointer;font-weight:700;font-size:0.85rem;}
.cancel-btn{background:transparent;color:var(--text-muted);border:1px solid var(--border);border-radius:4px;padding:10px 18px;cursor:pointer;font-size:0.85rem;}
.form-actions{margin-top:18px;display:flex;gap:10px;}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 768px) {

  /* 네비게이션 */
  .nav { padding: 0.5rem 1rem; flex-wrap: wrap; gap: 0.5rem; position: relative; }
  .nav-brand { font-size: 1.1rem; }
  .nav-links { display: none; flex-direction: column; gap: 0; width: 100%;
               background: var(--surface2); padding: 0.5rem 0;
               border-top: 1px solid var(--border); }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 0.6rem 1rem; font-size: 0.85rem; border-bottom: 1px solid var(--border); }
  .nav-module-label { display: none; }

  /* 컨테이너 */
  .container { padding: 1rem; }

  /* 그리드 */
  .grid-2, .grid-3 { grid-template-columns: 1fr !important; }

  /* 카드 */
  .card { padding: 1rem; }

  /* 페이지 타이틀 */
  .page-title-row { flex-direction: column; gap: 0.75rem; }
  .page-title-row h1 { font-size: 1.4rem; }

  /* 메타 그리드 */
  .meta-grid { grid-template-columns: 1fr 1fr !important; }

  /* 버튼 */
  .btn { padding: 0.5rem 1rem; font-size: 0.8rem; }
  .action-row { flex-wrap: wrap; }

  /* 테이블 */
  table { font-size: 0.72rem; }
  th, td { padding: 0.4rem 0.5rem !important; }

  /* CUBIXA 분석 */
  #resultCard { margin-top: 1rem; }

  /* KAVIX 그리드 */
  div[style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* 폼 */
  .form-group input, .form-group textarea, .form-group select {
    font-size: 16px !important; /* iOS 줌 방지 */
  }

  /* 통계 카드 */
  .stat-card { padding: 0.75rem; }
  .stat-value { font-size: 1.8rem; }

  /* 히어로 */
  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.2rem; }
}

@media (max-width: 480px) {
  .meta-grid { grid-template-columns: 1fr !important; }
  .page-title-row h1 { font-size: 1.2rem; }
}


/* ============================================================
   UTTA MOBILE RESPONSIVE SYSTEM v2
   전체 페이지 공통 적용 | Mark + Clay 협업
   ============================================================ */

/* 기본 overflow 방지 */
html, body {
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }

/* 공통 word-break */
.card, .ai-analysis, .meta-value, .page-title-row h1,
.trace-id, .cert-id, [style*="font-family:monospace"] {
  word-break: break-all;
  overflow-wrap: anywhere;
}

/* ── 태블릿 (768px 이하) ── */
@media (max-width: 768px) {

  /* 네비게이션 */
  .nav {
    padding: 0.6rem 1rem;
    flex-wrap: nowrap;
    position: relative;
  }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #0d0d14;
    border-top: 1px solid rgba(255,255,255,0.08);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-direction: column;
    z-index: 999;
    padding: 0.5rem 0;
    max-height: 80vh;
    overflow-y: auto;
  }
  .nav-links.open { display: flex; }
  .nav-links a {
    padding: 0.65rem 1.25rem;
    font-size: 0.88rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    white-space: nowrap;
  }
  .nav-module-label { display: none; }
  .nav-toggle { display: flex !important; }

  /* 컨테이너 */
  .container {
    padding: 1rem;
    max-width: 100%;
  }

  /* 페이지 타이틀 */
  .page-title-row {
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-start;
  }
  .page-title-row h1 { font-size: 1.4rem; line-height: 1.3; }
  .page-title-row > div:last-child {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    width: 100%;
  }

  /* 그리드 → 1열 */
  .grid-2, .grid-3,
  [style*="grid-template-columns: 1fr 1fr"],
  [style*="grid-template-columns:1fr 1fr"],
  [style*="grid-template-columns: 2fr 1fr"],
  [style*="grid-template-columns:2fr 1fr"],
  [style*="grid-template-columns: 1fr 2fr"],
  [style*="display:grid"] {
    grid-template-columns: 1fr !important;
  }

  /* 카드 */
  .card {
    padding: 1rem;
    margin-bottom: 0.75rem;
  }

  /* 메타 그리드 */
  .meta-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 0.5rem;
  }

  /* 폼 요소 */
  .form-group input,
  .form-group textarea,
  .form-group select,
  input[type="text"],
  input[type="email"],
  input[type="number"],
  textarea, select {
    width: 100% !important;
    font-size: 16px !important; /* iOS 줌 방지 */
    box-sizing: border-box;
  }
  textarea { min-height: 80px; }

  .form-group { margin-bottom: 0.75rem; }
  label { font-size: 0.82rem; }

  /* 버튼 */
  .btn {
    padding: 0.55rem 1rem;
    font-size: 0.82rem;
  }
  .action-row {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .action-row .btn { flex: 1; min-width: 120px; text-align: center; }

  /* 입력 탭 (TEXT / FILE / VOICE 등) */
  .input-tabs, [class*="tab-group"] {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.3rem;
  }

  /* 통계 카드 */
  .stat-card { padding: 0.75rem; }
  .stat-value { font-size: 1.6rem !important; }
  .stat-label { font-size: 0.68rem; }

  /* 테이블 → 카드형 */
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 6px;
  }
  table {
    min-width: 500px;
    font-size: 0.72rem;
  }
  th, td { padding: 0.4rem 0.6rem !important; }

  /* 로그 목록 */
  .log-row, [class*="list-item"] {
    flex-wrap: wrap;
    gap: 0.3rem;
    font-size: 0.75rem;
  }

  /* 배지 */
  .badge { font-size: 0.68rem; padding: 2px 6px; }

  /* UTTALOGY 단계 카드 */
  .step-card, [class*="step-"] {
    width: 100% !important;
    min-width: unset !important;
  }

  /* 모듈 배너 */
  .module-banner { font-size: 0.65rem; padding: 4px 10px; }

  /* 결과 박스 */
  .result-box, .ai-analysis, .verdict-card {
    padding: 0.75rem;
    font-size: 0.82rem;
  }

  /* 진행바 */
  .progress-bar { height: 8px !important; }

  /* 인라인 flex → wrap */
  [style*="display:flex"][style*="gap"] {
    flex-wrap: wrap;
  }

  /* 숨길 요소 */
  .hide-mobile { display: none !important; }

  /* 모바일 전용 표시 */
  .show-mobile { display: block !important; }
}

/* ── 소형 모바일 (480px 이하) ── */
@media (max-width: 480px) {
  .container { padding: 0.75rem; }
  .page-title-row h1 { font-size: 1.2rem; }
  .meta-grid { grid-template-columns: 1fr !important; }
  .card { padding: 0.75rem; }
  .stat-value { font-size: 1.4rem !important; }

  /* 대시보드 stat 카드 4개 → 2x2 */
  .stats-row, [class*="stat-grid"] {
    grid-template-columns: 1fr 1fr !important;
    gap: 0.5rem;
  }

  h1 { font-size: 1.3rem !important; }
  h2 { font-size: 1.1rem !important; }
  .btn { padding: 0.5rem 0.75rem; font-size: 0.78rem; }
}

/* --- UI 丵: ׺̼    ȭ --- */
.nav-toggle {
    display: flex !important;
    position: fixed !important;
    top: 15px;
    left: 15px;
    z-index: 10000;
    background: #2563eb;
    color: white;
    padding: 12px;
    border-radius: 50%;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.sidebar {
    position: fixed;
    height: 100vh;
    z-index: 9999;
    background: #0f172a;
    transition: all 0.3s ease-in-out;
}

/* 길   ī ̾ƿ  */
.container {
    padding-top: 80px !important;
}
