:root {
  --bg-root: #070b12;
  --bg-surface: #0e1523;
  --bg-elevated: #141e30;
  --bg-input: #0a101b;
  --border: #1e2c45;
  --border-strong: #2d4266;
  --text-main: #f1f5f9;
  --text-sub: #94a3b8;
  --text-muted: #64748b;
  --emerald: #10b981;
  --emerald-dim: rgba(16, 185, 129, 0.14);
  --sky: #38bdf8;
  --sky-dim: rgba(56, 189, 248, 0.14);
  --amber: #f59e0b;
  --amber-dim: rgba(245, 158, 11, 0.16);
  --danger: #f43f5e;
  --radius: 12px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-root);
  color: var(--text-main);
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Malgun Gothic', 'Segoe UI', sans-serif;
  line-height: 1.55;
  word-break: keep-all;
  -webkit-font-smoothing: antialiased;
}

.mono, strong, .kpi-val {
  font-variant-numeric: tabular-nums;
}

.hidden {
  display: none !important;
}

a {
  color: var(--sky);
  text-decoration: none;
}

/* Buttons & Pills */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease;
  font-family: inherit;
}

.btn:active {
  transform: scale(0.98);
}

.btn-lg {
  padding: 13px 22px;
  font-size: 15px;
}

.btn-sm {
  padding: 6px 11px;
  font-size: 12px;
}

.btn-primary {
  background: var(--emerald);
  color: #04130d;
}

.btn-primary:hover {
  background: #34d399;
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-main);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  border-color: var(--sky);
}

.btn-ghost {
  background: transparent;
  color: var(--text-sub);
  border-color: var(--border);
}

.btn-ghost:hover {
  color: var(--text-main);
  border-color: var(--border-strong);
}

.btn-danger {
  background: rgba(244, 63, 94, 0.15);
  color: #fda4af;
  border-color: rgba(244, 63, 94, 0.35);
}

.btn-google {
  background: #ffffff;
  color: #1f2937;
  border-color: #e2e8f0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.btn-google:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.btn-full {
  width: 100%;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 14px;
  color: var(--text-muted);
  font-size: 12px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.oauth-hint-box {
  margin-top: 12px;
  padding: 12px 14px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 10px;
  font-size: 12.5px;
  color: #cbd5e1;
}

.oauth-hint-box strong {
  display: block;
  color: #7dd3fc;
  margin-bottom: 4px;
}

.oauth-hint-box p {
  margin: 0 0 8px;
  line-height: 1.5;
}

.oauth-uri-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--bg-input);
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.oauth-uri-row code {
  font-size: 11.5px;
  color: #34d399;
  overflow: hidden;
  text-overflow: ellipsis;
}

.link-btn {
  background: none;
  border: none;
  color: var(--text-sub);
  font-size: 13px;
  cursor: pointer;
  padding: 2px 6px;
}

.link-btn:hover {
  color: var(--text-main);
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  flex-shrink: 0;
}

.pill-emerald { background: var(--emerald-dim); color: #34d399; }
.pill-sky { background: var(--sky-dim); color: #7dd3fc; }
.pill-amber { background: var(--amber-dim); color: #fcd34d; }

.global-notice-bar {
  padding: 10px 20px;
  text-align: center;
  font-size: 13.5px;
  font-weight: 600;
  background: rgba(16, 185, 129, 0.16);
  border-bottom: 1px solid rgba(16, 185, 129, 0.4);
  color: #d1fae5;
}

.global-notice-bar.level-info {
  background: rgba(56, 189, 248, 0.15);
  border-bottom-color: rgba(56, 189, 248, 0.4);
  color: #e0f2fe;
}

.global-notice-bar.level-warning {
  background: rgba(245, 158, 11, 0.18);
  border-bottom-color: rgba(245, 158, 11, 0.45);
  color: #fef3c7;
}

.admin-nav-link {
  display: block;
  margin-top: 8px;
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.38);
  color: #7dd3fc !important;
  text-decoration: none;
}

.admin-nav-link:hover {
  background: rgba(56, 189, 248, 0.22);
}

/* Landing View */
.landing-nav {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(7, 11, 18, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-main);
  font-weight: 800;
  font-size: 19px;
}

.brand-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 12px var(--emerald);
}

.brand-tag {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 2px 7px;
  border-radius: 6px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.nav-link {
  color: var(--text-sub);
  font-size: 14px;
  font-weight: 600;
}

.nav-link:hover {
  color: var(--text-main);
}

.landing-main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 44px 24px 72px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 36px;
  align-items: start;
  margin-bottom: 80px;
}

.eyebrow {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--sky);
  margin-bottom: 12px;
}

.hero-copy h1 {
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.18;
  letter-spacing: -0.025em;
  margin: 0 0 18px;
}

.accent-emerald {
  color: #34d399;
}

.hero-lead {
  font-size: 16px;
  color: var(--text-sub);
  line-height: 1.7;
  margin: 0 0 26px;
}

.hero-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 32px;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.hero-metrics strong {
  display: block;
  font-size: 24px;
  color: var(--text-main);
}

.hero-metrics span {
  font-size: 13px;
  color: var(--text-muted);
}

.hero-preview-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45);
}

.sample-header h2 {
  font-size: 19px;
  margin: 8px 0 6px;
}

.sample-desc {
  font-size: 13px;
  color: var(--text-sub);
  margin: 0 0 14px;
}

.sample-bar, .sourcing-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.sample-bar input, .sourcing-bar input, .sourcing-bar select,
.stack-form input, .stack-form select, .stack-form textarea,
.studio-form input, .studio-form select, .workbench-body textarea, .workbench-body input {
  flex: 1;
  min-width: 150px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 10px 12px;
  color: var(--text-main);
  font-size: 14px;
  font-family: inherit;
}

.sample-bar input:focus, .sourcing-bar input:focus,
.stack-form input:focus, .studio-form input:focus, .workbench-body textarea:focus {
  outline: none;
  border-color: var(--sky);
}

.quick-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 10px 0 14px;
}

.chip {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-sub);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
}

.chip:hover {
  color: var(--text-main);
  border-color: var(--sky);
}

.tab-strip {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
  margin-bottom: 14px;
}

.tab-btn {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-sub);
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.tab-btn.active {
  background: var(--sky-dim);
  color: #7dd3fc;
  border-color: rgba(56, 189, 248, 0.45);
}

.sample-output-box {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  max-height: 310px;
  overflow-y: auto;
  font-size: 13.5px;
  white-space: pre-line;
  color: #dbeafe;
}

.landing-section {
  margin-bottom: 76px;
}

.section-head {
  margin-bottom: 26px;
}

.section-head h2 {
  font-size: 28px;
  margin: 4px 0 8px;
}

.section-head p {
  color: var(--text-sub);
  margin: 0;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.cat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
}

.cat-card h4 {
  margin: 6px 0 4px;
  font-size: 15px;
}

.cat-card p {
  margin: 0;
  font-size: 13px;
  color: var(--text-sub);
}

/* Real GPU Output Showcase Grid */
.showcase-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 18px;
  align-items: stretch;
}

.showcase-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.showcase-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.showcase-card h3 {
  margin: 0;
  font-size: 17px;
}

.showcase-media-frame {
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #05080f;
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: 430px;
}

.showcase-media-frame video,
.showcase-media-frame img {
  width: 100%;
  height: 100%;
  max-height: 430px;
  object-fit: contain;
  display: block;
}

.showcase-blog-preview {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #0c1322;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.showcase-blog-preview > img {
  width: 100%;
  height: 175px;
  object-fit: cover;
  display: block;
}

.showcase-blog-body {
  padding: 13px;
  font-size: 12.5px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.showcase-summary-box {
  background: rgba(16, 185, 129, 0.08);
  border-left: 3px solid var(--emerald);
  border-radius: 6px;
  padding: 9px 11px;
  color: var(--text-main);
}

.showcase-summary-box ul {
  margin: 6px 0 0;
  padding-left: 16px;
  color: var(--text-sub);
  line-height: 1.5;
}

.showcase-mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.showcase-mini-table th,
.showcase-mini-table td {
  border: 1px solid var(--border);
  padding: 6px 8px;
  text-align: left;
}

.showcase-mini-table th {
  background: rgba(56, 189, 248, 0.1);
  color: #7dd3fc;
}

.showcase-caption {
  margin: auto 0 0;
  font-size: 12.5px;
  color: var(--text-sub);
  line-height: 1.55;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
  gap: 16px;
}

.price-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.price-card.featured {
  border-color: var(--emerald);
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.07), var(--bg-surface));
}

.price-amount {
  font-size: 28px;
  font-weight: 800;
  margin: 10px 0 14px;
}

.price-features {
  list-style: none;
  padding: 0;
  margin: 0 0 18px;
  font-size: 13.5px;
  color: var(--text-sub);
}

.price-features li {
  margin-bottom: 7px;
}

.site-footer {
  max-width: 1280px;
  margin: 36px auto 0;
  padding: 24px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
}

.site-footer a {
  color: var(--text-sub);
  margin-right: 12px;
}

/* Authenticated Workspace Shell */
.app-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 18px;
  border-bottom: 1px solid var(--border);
}

.sidebar-brand strong {
  display: block;
  font-size: 17px;
}

.sidebar-brand small {
  color: var(--text-muted);
  font-size: 11.5px;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 16px 0 auto;
}

.side-btn {
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-sub);
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.side-btn:hover {
  background: var(--bg-elevated);
  color: var(--text-main);
}

.side-btn.active {
  background: var(--emerald-dim);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.35);
}

.sidebar-quota-box {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}

.quota-row, .user-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.quota-bar {
  height: 6px;
  background: #1e293b;
  border-radius: 999px;
  margin: 8px 0;
  overflow: hidden;
}

.quota-fill {
  height: 100%;
  background: var(--sky);
  width: 10%;
}

.user-email {
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 145px;
}

.workspace-main {
  padding: 28px 32px 64px;
  max-width: 1240px;
}

.pane-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 22px;
}

.pane-header h1 {
  margin: 0 0 5px;
  font-size: 24px;
}

.pane-header p {
  margin: 0;
  font-size: 14px;
  color: var(--text-sub);
}

.header-actions {
  display: flex;
  gap: 8px;
}

.kpi-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(195px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.kpi-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.kpi-card span {
  font-size: 12.5px;
  color: var(--text-sub);
}

.kpi-card strong {
  display: block;
  font-size: 23px;
  margin-top: 6px;
}

.two-col-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 18px;
}

.panel {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 18px;
}

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

.panel-head h3 {
  margin: 0;
  font-size: 16px;
}

.muted {
  color: var(--text-muted);
  font-size: 12.5px;
}

.stack-list, .missions-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.row-card {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.row-card-title {
  font-weight: 700;
  font-size: 14px;
}

.row-card-sub {
  font-size: 12.5px;
  color: var(--text-sub);
  margin-top: 3px;
}

.matrix-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 10px;
}

.matrix-item {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  cursor: pointer;
  transition: border-color 0.14s ease;
}

.matrix-item:hover {
  border-color: var(--emerald);
}

/* Studio Form & Workbench */
.studio-form, .stack-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.studio-form label, .stack-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-sub);
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.preset-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.preset-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.channel-check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 8px;
}

.studio-form label.ch-check,
label.ch-check {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 13px;
  color: var(--text-main);
  cursor: pointer;
}

.studio-form label.ch-check input,
label.ch-check input {
  width: 16px;
  height: 16px;
  min-width: 16px;
  margin: 0;
  padding: 0;
  flex: 0 0 auto;
  accent-color: var(--emerald);
}

.studio-submit-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.workbench-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.rich-preview-frame {
  background: #ffffff;
  color: #111827;
  border-radius: 10px;
  padding: 20px;
  margin-top: 14px;
  max-height: 420px;
  overflow-y: auto;
}

.media-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.media-gallery img {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
}

.shorts-video-wrap video {
  max-width: 300px;
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--border-strong);
  margin-top: 12px;
}

/* Modal & Toast */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 6, 12, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 60;
  padding: 18px;
}

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  width: 100%;
  max-width: 440px;
  padding: 24px;
}

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

.modal-head h3 {
  margin: 0;
}

.toast-root {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: #132238;
  border: 1px solid var(--sky);
  color: var(--text-main);
  padding: 11px 16px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}

@media (max-width: 960px) {
  .hero-grid, .two-col-grid, .form-row-2 {
    grid-template-columns: 1fr;
  }
  .app-shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
    height: auto;
  }
}

@media (max-width: 640px) {
  .nav-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px 14px;
  }
  .nav-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 6px;
  }
  .nav-link {
    display: none;
  }
  .hero-copy h1 {
    font-size: 28px;
    line-height: 1.3;
  }
  .hero-metrics {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .workspace-main {
    padding: 16px 12px 48px;
  }
  .pane-header, .studio-submit-row, .row-card, .site-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}
