/* ==========================================================================
   GINTENT · Gemini Design Studio Options (css/gemini.css)
   Tokens-only stylesheet · Works in directions a, b, c · Dark & Light · 1440 & 390
   ========================================================================== */

.gm-root,
[class^="gm-"],
[class*=" gm-"] {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
}

/* Base Structural Primitives */
.gm-wrap {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  position: relative;
}

.gm-surface-1 {
  background: var(--s1);
  border: 1px solid var(--line);
  border-radius: var(--r2);
  color: var(--tx);
}

.gm-surface-2 {
  background: var(--s2);
  border: 1px solid var(--line);
  border-radius: var(--r2);
  color: var(--tx);
}

.gm-surface-3 {
  background: var(--s3);
  border: 1px solid var(--line2);
  border-radius: var(--r1);
  color: var(--tx);
}

.gm-gold-box {
  background: var(--gold-soft);
  border: 1px solid var(--gold-line);
  border-radius: var(--r2);
  color: var(--tx);
}

.gm-gold-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--r1);
  background: var(--gold-soft);
  border: 1px solid var(--gold-line);
  color: var(--gold);
  font-family: var(--f-m);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.gm-mono {
  font-family: var(--f-m);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.gm-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--f-m);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}

.gm-kicker::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  display: inline-block;
}

/* Responsive Grids */
.gm-split {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 24px;
  align-items: stretch;
}

.gm-split-equal {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.gm-tri-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.gm-quad-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.gm-sidebar-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

/* Direction-Specific Adaptation (a: Viewfinder, b: Screening Room, c: Control Room) */
[data-dir="a"] .gm-frame {
  position: relative;
  border: 1px solid var(--line);
}

[data-dir="a"] .gm-frame::before,
[data-dir="a"] .gm-frame::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  border-color: var(--gold);
  pointer-events: none;
}

[data-dir="a"] .gm-frame::before {
  top: -1px;
  left: -1px;
  border-top: 2px solid var(--gold);
  border-left: 2px solid var(--gold);
}

[data-dir="a"] .gm-frame::after {
  bottom: -1px;
  right: -1px;
  border-bottom: 2px solid var(--gold);
  border-right: 2px solid var(--gold);
}

[data-dir="b"] .gm-frame {
  border-top: 3px solid var(--tx);
  border-bottom: 3px solid var(--tx);
  border-radius: 0;
}

[data-dir="c"] .gm-frame {
  border-radius: var(--r3);
  box-shadow: var(--shadow);
}

/* Hero Variants */
.gm-hero-lens {
  padding: 36px 0;
}

.gm-hero-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
}

.gm-timecode-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--r1);
  font-family: var(--f-m);
  font-size: 12px;
  color: var(--tx2);
  flex-wrap: wrap;
}

.gm-slate-header {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
  background: var(--bg2);
}

.gm-slate-cell {
  padding: 12px 14px;
  border-right: 1px solid var(--line);
}

.gm-slate-cell:last-child {
  border-right: none;
}

.gm-slate-lbl {
  font-family: var(--f-m);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--tx3);
  margin-bottom: 4px;
}

.gm-slate-val {
  font-family: var(--f-u);
  font-size: 13px;
  font-weight: 600;
  color: var(--tx);
}

/* Score & Telemetry Blocks */
.gm-score-hero-num {
  font-family: var(--f-d);
  font-size: clamp(44px, 6vw, 76px);
  font-weight: var(--dw, 700);
  letter-spacing: var(--dls, -0.03em);
  line-height: 0.95;
  color: var(--gold);
}

.gm-dim-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gm-dim-row {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}

.gm-dim-track {
  height: 6px;
  background: var(--bg2);
  border-radius: var(--r1);
  overflow: hidden;
  border: 1px solid var(--line);
}

.gm-dim-fill {
  height: 100%;
  background: var(--gold);
}

/* Evidence & Timeline Strips */
.gm-ev-strip {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gm-ev-item {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) 120px;
  gap: 16px;
  padding: 16px;
  background: var(--s1);
  border: 1px solid var(--line);
  border-radius: var(--r2);
  align-items: start;
}

.gm-ev-tc {
  font-family: var(--f-m);
  font-size: 12px;
  padding: 6px 10px;
  background: var(--bg2);
  border: 1px solid var(--gold-line);
  color: var(--gold);
  border-radius: var(--r1);
  text-align: center;
}

/* Certificate Styles */
.gm-cert-canvas {
  padding: 36px;
  background: var(--bg2);
  border: 2px solid var(--gold-line);
  border-radius: var(--r2);
  position: relative;
  overflow: hidden;
}

.gm-cert-inner {
  border: 1px solid var(--line2);
  padding: 28px;
  background: var(--s1);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.gm-cert-seal {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--gold-soft);
  border: 2px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--f-d);
  font-size: 24px;
  font-weight: 700;
  color: var(--gold);
  flex-shrink: 0;
}

/* App Shell Variants */
.gm-shell-wrap {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 100vh;
  background: var(--bg);
}

.gm-shell-aside {
  background: var(--s1);
  border-right: 1px solid var(--line);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
}

.gm-shell-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.gm-shell-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 24px;
  background: var(--s1);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.gm-shell-body {
  padding: 24px;
  flex: 1;
  min-width: 0;
}

.gm-nav-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gm-nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--r1);
  color: var(--tx2);
  text-decoration: none;
  font-size: 13px;
  cursor: pointer;
  border: 1px solid transparent;
}

.gm-nav-item:hover,
.gm-nav-item.gm-active {
  background: var(--s2);
  color: var(--tx);
  border-color: var(--line);
}

.gm-nav-item.gm-active {
  border-left: 3px solid var(--gold);
  color: var(--gold);
}

/* Matrix & Checklist Blocks */
.gm-matrix-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.gm-matrix-table th,
.gm-matrix-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.gm-matrix-table th {
  font-family: var(--f-m);
  font-size: 11px;
  text-transform: uppercase;
  color: var(--tx3);
  background: var(--bg2);
}

.gm-step-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: var(--r1);
  background: var(--s2);
  border: 1px solid var(--line);
  font-family: var(--f-m);
  font-size: 11px;
  color: var(--tx2);
}

/* Mobile & Tablet Breakpoints (Strict 390px overflow prevention) */
@media (max-width: 960px) {
  .gm-split,
  .gm-split-equal,
  .gm-tri-grid,
  .gm-quad-grid,
  .gm-sidebar-layout,
  .gm-shell-wrap {
    grid-template-columns: minmax(0, 1fr);
  }

  .gm-shell-aside {
    border-right: none;
    border-bottom: 1px solid var(--line);
  }

  .gm-ev-item {
    grid-template-columns: minmax(0, 1fr);
  }

  .gm-slate-header {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .gm-dim-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }

  .gm-slate-header {
    grid-template-columns: minmax(0, 1fr);
  }

  .gm-cert-canvas,
  .gm-cert-inner,
  .gm-hero-card,
  .gm-shell-body {
    padding: 16px;
  }

  .gm-shell-topbar {
    padding: 10px 14px;
  }
}
