/* Realform Studio Portfolio CMS — production styles
   Brand DNA: forest green → deep purple gradient
   Type: Inter (UI), JetBrains Mono (meta)
*/

:root {
  /* Brand */
  --green: oklch(45% 0.09 145);
  --green-deep: oklch(35% 0.08 150);
  --brand-green: oklch(0.6 0.17 131.48);
  --purple: oklch(38% 0.13 295);
  --purple-deep: oklch(28% 0.11 290);
  --gradient: linear-gradient(105deg, var(--green) 0%, var(--green-deep) 35%, var(--purple) 70%, var(--purple-deep) 100%);

  /* Neutrals — warm */
  --bg: oklch(98.5% 0.003 90);
  --surface: oklch(100% 0 0);
  --surface-2: oklch(96.5% 0.004 90);
  --line: oklch(91% 0.005 90);
  --line-strong: oklch(85% 0.006 90);
  --ink: oklch(18% 0.01 280);
  --ink-2: oklch(35% 0.012 280);
  --ink-3: oklch(55% 0.01 280);
  --ink-4: oklch(72% 0.008 280);

  /* Accent fills */
  --accent: var(--green-deep);
  --accent-soft: oklch(95% 0.025 145);
  --danger: oklch(55% 0.18 25);

  /* Type */
  --font-ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --font-display: "Inter", system-ui, sans-serif;

  /* Radii + shadow */
  --r-sm: 6px;
  --r: 10px;
  --r-lg: 14px;
  --r-xl: 20px;

  --card-radius: 12px;
  --card-bg: var(--surface);
  --card-border: 1px solid var(--line);
  --card-shadow: 0 1px 0 rgba(0, 0, 0, 0.02), 0 1px 2px rgba(0, 0, 0, 0.04);

  --shadow-pop: 0 10px 30px -10px rgba(20, 20, 30, 0.18), 0 2px 6px rgba(20, 20, 30, 0.06);
}

/* Card style variants */
[data-card-style="flat"] {
  --card-bg: var(--surface-2);
  --card-border: 1px solid transparent;
  --card-shadow: none;
}
[data-card-style="bordered"] {
  --card-bg: var(--surface);
  --card-border: 1px solid var(--line);
  --card-shadow: none;
}
[data-card-style="elevated"] {
  --card-bg: var(--surface);
  --card-border: 1px solid var(--line);
  --card-shadow: 0 1px 0 rgba(0, 0, 0, 0.02), 0 6px 20px -8px rgba(20, 20, 30, 0.12);
}

* {
  box-sizing: border-box;
}
html, body {
  margin: 0;
  padding: 0;
  background: oklch(94% 0.005 90);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
button {
  font-family: inherit;
}

/* ── LOGIN PAGE ─────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--gradient);
  padding: 20px;
}
.login-card {
  width: 100%;
  max-width: 320px;
  background: white;
  border-radius: var(--r-xl);
  padding: 40px 32px;
  box-shadow: 0 20px 60px rgba(20, 20, 30, 0.3);
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.login-card .logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.login-card .logo .mark {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--gradient);
  display: grid;
  place-items: center;
  color: white;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
}
.login-card .logo span {
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
}
.login-card h1 {
  margin: 0;
  font-size: 24px;
  text-align: center;
  color: var(--ink);
  font-weight: 600;
}
.login-card p {
  margin: 0;
  font-size: 13px;
  text-align: center;
  color: var(--ink-3);
}
.login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.login-form .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.login-form label {
  font: 500 10.5px/1 var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.login-form input {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 10px 12px;
  border-radius: 8px;
  font: 13.5px var(--font-ui);
  color: var(--ink);
  outline: none;
  transition: border-color 0.12s;
}
.login-form input:focus {
  border-color: var(--ink-3);
}
.login-form button {
  width: 100%;
  background: var(--gradient);
  color: white;
  border: 0;
  padding: 11px 16px;
  border-radius: 8px;
  font: 500 13.5px/1 var(--font-ui);
  cursor: pointer;
  margin-top: 4px;
  transition: filter 0.2s;
}
.login-form button:hover {
  filter: brightness(1.05);
}
.login-form .error {
  color: var(--danger);
  font: 500 11px/1.4 var(--font-ui);
  text-align: center;
  margin-top: -8px;
}

/* ── PUBLIC SITE ─────────────────────────────────────── */
.pub {
  font-family: var(--font-ui);
  color: var(--ink);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.pub-nav {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* Same fixed geometry as .site-nav so the logo never moves between pages. */
  box-sizing: border-box;
  height: 89px;
  padding: 0 40px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.pub-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.01em;
}
.pub-logo .mark {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--gradient);
  display: grid;
  place-items: center;
  color: white;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
}
.pub-nav-links {
  display: flex;
  gap: 28px;
  font-size: 13px;
  color: var(--ink-2);
}
.pub-nav-links a {
  text-decoration: none;
  color: inherit;
  position: relative;
  padding: 4px 0;
  cursor: pointer;
}
.pub-nav-links a[data-active="1"] {
  color: var(--ink);
}
.pub-nav-links a[data-active="1"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -19px;
  height: 2px;
  background: var(--gradient);
}

.pub-hero {
  position: relative;
  padding: 56px 28px 40px;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 36px;
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
}
.pub-hero > div:first-child {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}
.pub-feat {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.pub-hero-eyebrow {
  font: 500 11px/1 var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.pub-hero-eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--ink-3);
}
.pub-hero h1 {
  font-size: 56px;
  line-height: 1.02;
  margin: 0 0 18px;
  letter-spacing: -0.025em;
  font-weight: 600;
  text-wrap: balance;
}
.pub-hero h1 em {
  font-style: normal;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.pub-hero p {
  font-size: 16px;
  color: var(--ink-2);
  max-width: 46ch;
  margin: 0;
  text-wrap: pretty;
}
.pub-hero-meta {
  display: flex;
  gap: 22px;
  margin-top: 28px;
  font: 500 11px/1.4 var(--font-mono);
  letter-spacing: 0.04em;
  color: var(--ink-3);
  text-transform: uppercase;
}
.pub-hero-meta strong {
  display: block;
  font: 600 22px/1 var(--font-display);
  letter-spacing: -0.02em;
  color: var(--ink);
  text-transform: none;
  margin-bottom: 4px;
}

/* Featured project visual */
.pub-feat {
  background: var(--card-bg);
  border: var(--card-border);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.pub-feat .preview {
  flex: 1;
  min-height: 350px;
  width: 100%;
  aspect-ratio: 16 / 9;
  background:
    repeating-linear-gradient(45deg, oklch(72% 0.04 280) 0 8px, oklch(75% 0.04 280) 8px 16px);
  position: relative;
  display: grid;
  place-items: center;
  color: white;
  overflow: hidden;
}
.pub-feat .preview-label {
  font: 500 11px/1 var(--font-mono);
  letter-spacing: 0.06em;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  padding: 8px 12px;
  border-radius: 999px;
}
.pub-feat .preview img,
.pub-feat .preview iframe {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  max-height: 100% !important;
}

.pub-feat .preview .play {
  position: absolute;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  display: grid;
  place-items: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s;
}
.pub-feat:hover .play { transform: scale(1.08); }
.pub-feat .play::after {
  content: "";
  width: 0;
  height: 0;
  margin-left: 4px;
  border-left: 14px solid var(--ink);
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
}
.pub-feat .info {
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.pub-feat .info h3 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 600;
}
.pub-feat .info span {
  font: 500 10.5px/1 var(--font-mono);
  letter-spacing: 0.06em;
  color: var(--ink-3);
  text-transform: uppercase;
}
.pub-feat .info button {
  appearance: none;
  border: 1px solid var(--line);
  background: transparent;
  padding: 8px 14px;
  border-radius: 8px;
  font: 500 12px/1 var(--font-ui);
  color: var(--ink);
  cursor: pointer;
}
.pub-feat .info button:hover { background: var(--surface-2); }

/* Tabs for featured visual */
.feat-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--line-strong);
  background: var(--surface);
}
.feat-tabs button {
  appearance: none;
  padding: 10px 18px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-3);
  transition: color 0.2s, border-color 0.2s;
}
.feat-tabs button:hover {
  color: var(--ink-2);
}
.feat-tabs button.active {
  color: var(--ink);
  border-bottom-color: var(--brand-green);
}

/* Breakdown gallery */
.breakdown-card {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  width: 100%;
  height: 100%;
}

.breakdown-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.breakdown-caption {
  position: absolute;
  bottom: 12px;
  left: 0;
  right: 0;
  width: 100%;
  color: white;
  background: rgb(0, 0, 0);
  padding: 8px 10px;
  z-index: 10;
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  word-break: break-word;
}

.pub-hero .breakdown-caption {
  color: white !important;
}

/* Filter bar */
.pub-filters {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 24px 28px 18px;
  flex-wrap: wrap;
  position: sticky;
  top: 57px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  z-index: 5;
  border-bottom: 1px solid var(--line);
}
.pub-filters .label {
  font: 500 11px/1 var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-right: 8px;
}
.pub-chip {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 7px 12px;
  border-radius: 999px;
  font: 500 12px/1 var(--font-ui);
  color: var(--ink-2);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.pub-chip:hover { border-color: var(--line-strong); color: var(--ink); }
.pub-chip[data-active="1"] {
  background: var(--ink);
  color: white;
  border-color: var(--ink);
}
.pub-chip .count {
  font-family: var(--font-mono);
  font-size: 10.5px;
  opacity: 0.6;
}

/* Grid */
.pub-grid {
  padding: 24px 28px 48px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}
/* When every project is already shown as featured the grid is empty: do not keep its padding. */
.pub-grid:empty {
  display: none;
}
.pub-card {
  background: var(--card-bg);
  border: var(--card-border);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}
.pub-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -16px rgba(20, 20, 30, 0.18), 0 1px 2px rgba(0, 0, 0, 0.04);
}
.pub-card .thumb {
  aspect-ratio: 4/3;
  position: relative;
  background:
    repeating-linear-gradient(45deg, var(--ph-a, oklch(72% 0.04 280)) 0 6px, var(--ph-b, oklch(75% 0.04 280)) 6px 12px);
}
.pub-card .thumb-meta {
  position: absolute;
  inset: auto 8px 8px;
  display: flex;
  justify-content: space-between;
  font: 500 9.5px/1 var(--font-mono);
  letter-spacing: 0.06em;
  color: white;
  text-transform: uppercase;
}
.pub-card .thumb-meta span {
  background: rgba(0, 0, 0, 0.5);
  padding: 5px 7px;
  border-radius: 999px;
  backdrop-filter: blur(8px);
}
.pub-card .body {
  padding: 14px 14px 16px;
}
.pub-card h4 {
  margin: 0 0 4px;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
}
.pub-card .cat {
  font: 500 10px/1 var(--font-mono);
  letter-spacing: 0.06em;
  color: var(--ink-3);
  text-transform: uppercase;
}

/* Footer */
.pub-foot {
  border-top: 1px solid var(--line);
  padding: 8px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface-2);
  min-height: auto;
  margin-top: auto;
}
.pub-foot .copy {
  font: 500 11px/1.4 var(--font-mono);
  color: var(--ink-3);
}
.pub-foot .socials {
  display: flex;
  gap: 8px;
}
.pub-foot .socials a {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink-2);
  text-decoration: none;
  font-size: 12px;
}

/* ── ADMIN ─────────────────────────────────────── */
.adm {
  display: grid;
  grid-template-columns: 220px 1fr;
  height: 100vh;
  background: var(--surface);
  font-size: 13px;
  color: var(--ink);
}
.adm-side {
  background: var(--surface-2);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 18px 12px;
}
.adm-side-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 4px 8px 22px;
}
.adm-side-brand .mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--gradient);
  display: grid;
  place-items: center;
  color: white;
  font: 600 12px/1 var(--font-mono);
}
.adm-side-brand .logo {
  width: 72px;
  height: 56px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}
.adm-side-brand .name {
  font-weight: 600;
  font-size: 13px;
  letter-spacing: -0.01em;
}
.adm-side-brand .role {
  font: 500 10px/1.2 var(--font-mono);
  color: var(--ink-3);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-top: 2px;
}
.adm-nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-top: 4px;
}
.adm-nav-section {
  font: 500 10px/1 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-4);
  padding: 14px 8px 6px;
}
.adm-nav button {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 8px 10px;
  border-radius: 7px;
  font: 500 13px/1 var(--font-ui);
  color: var(--ink-2);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
}
.adm-nav button:hover { background: rgba(0, 0, 0, 0.04); color: var(--ink); }
.adm-nav button[data-active="1"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 0 0 1px var(--line);
}
.adm-nav button .icon {
  width: 14px;
  height: 14px;
  opacity: 0.7;
  flex-shrink: 0;
}
.adm-nav button[data-active="1"] .icon { opacity: 1; color: var(--accent); }
.adm-nav .badge {
  margin-left: auto;
  font: 500 10px/1 var(--font-mono);
  background: var(--accent-soft);
  color: var(--accent);
  padding: 3px 6px;
  border-radius: 999px;
}

.adm-side-foot {
  margin-top: auto;
  padding: 14px 8px 4px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--line);
}
.adm-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--gradient);
  flex-shrink: 0;
  display: grid;
  place-items: center;
  color: white;
  font: 600 11px/1 var(--font-mono);
}
.adm-side-foot .who {
  flex: 1;
  min-width: 0;
}
.adm-side-foot .who b {
  display: block;
  font-weight: 600;
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.adm-side-foot .who span {
  display: block;
  font: 500 10px/1.2 var(--font-mono);
  color: var(--ink-3);
}

.adm-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}
.adm-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  gap: 14px;
  background: var(--surface);
}
.adm-crumbs {
  font: 500 11px/1 var(--font-mono);
  letter-spacing: 0.04em;
  color: var(--ink-3);
  text-transform: uppercase;
}
.adm-crumbs b {
  color: var(--ink);
  font-weight: 600;
}
.adm-search {
  flex: 1;
  max-width: 360px;
  position: relative;
}
.adm-search input {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface-2);
  padding: 8px 12px 8px 32px;
  border-radius: 8px;
  font: 13px var(--font-ui);
  color: var(--ink);
  outline: none;
}
.adm-search input:focus { border-color: var(--ink-4); background: var(--surface); }
.adm-search svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-3);
}
.adm-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 7px 12px;
  border-radius: 8px;
  font: 500 12.5px/1.2 var(--font-ui);
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn:hover { background: var(--surface-2); }
.btn-primary {
  background: var(--ink);
  color: white;
  border-color: var(--ink);
}
.btn-primary:hover { background: oklch(28% 0.012 280); }
.btn-ghost {
  background: transparent;
  border-color: transparent;
}
.btn-ghost:hover { background: var(--surface-2); }
.btn-icon {
  width: 30px;
  height: 30px;
  padding: 0;
  display: grid;
  place-items: center;
}
.btn-grad {
  background: var(--gradient);
  color: white;
  border: 0;
}
.btn-grad:hover { filter: brightness(1.05); }

/* Admin content area */
.adm-content {
  flex: 1;
  overflow-y: auto;
  padding: 22px 24px 40px;
  scrollbar-width: thin;
}

.adm-h1 {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.adm-sub {
  margin: 0 0 22px;
  color: var(--ink-3);
  font-size: 13px;
}
.adm-section-h {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 28px 0 12px;
}
.adm-section-h h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
}
.adm-section-h .meta {
  font: 500 10.5px/1 var(--font-mono);
  letter-spacing: 0.06em;
  color: var(--ink-3);
  text-transform: uppercase;
}

/* Stats row */
.adm-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.adm-stat {
  background: var(--card-bg);
  border: var(--card-border);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  padding: 14px 16px;
}
.adm-stat .lbl {
  font: 500 10.5px/1 var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 8px;
}
.adm-stat .val {
  font: 600 26px/1 var(--font-display);
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}
.adm-stat .delta {
  font: 500 11px/1 var(--font-mono);
  color: var(--accent);
}
.adm-stat .delta.neutral { color: var(--ink-3); }

/* Table-style project list */
.adm-table {
  background: var(--card-bg);
  border: var(--card-border);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  overflow: hidden;
}
.adm-row {
  display: grid;
  grid-template-columns: 44px 1.6fr 1fr 0.7fr 0.6fr 80px;
  gap: 14px;
  align-items: center;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.12s;
}
.adm-row:first-child { border-top: 0; }
.adm-row.head {
  background: var(--surface-2);
  border: 0;
  cursor: default;
  font: 500 10.5px/1 var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 10px 16px;
}
.adm-row:hover:not(.head) { background: var(--surface-2); }
.adm-row .thumb {
  width: 44px;
  height: 32px;
  border-radius: 6px;
  background:
    repeating-linear-gradient(45deg, var(--ph-a, oklch(72% 0.04 280)) 0 4px, var(--ph-b, oklch(75% 0.04 280)) 4px 8px);
}
.adm-row .title b {
  display: block;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--ink);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.adm-row .title span {
  font: 500 10.5px/1.2 var(--font-mono);
  color: var(--ink-3);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.adm-row .cat {
  font-size: 12.5px;
  color: var(--ink-2);
}
.adm-row .status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: 500 11.5px/1 var(--font-ui);
  color: var(--ink-2);
}
.adm-row .status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink-4);
}
.adm-row .status[data-s="published"]::before { background: oklch(60% 0.13 145); }
.adm-row .status[data-s="draft"]::before { background: oklch(72% 0.05 80); }
.adm-row .updated {
  font: 500 11px/1 var(--font-mono);
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.adm-row .actions {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
}

/* Project editor — form */
.adm-form {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 22px;
  align-items: start;
}
.adm-form-col {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.field > label {
  font: 500 11px/1 var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 6px;
}
.field .opt {
  text-transform: none;
  color: var(--ink-4);
  font-weight: 500;
  letter-spacing: 0.02em;
  font-size: 10.5px;
}
.input,
.textarea,
.select {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 9px 12px;
  border-radius: 8px;
  font: 13.5px var(--font-ui);
  color: var(--ink);
  outline: none;
  transition: border-color 0.12s, background 0.12s;
}
.textarea {
  min-height: 110px;
  resize: vertical;
  font-size: 13px;
  line-height: 1.55;
}
.input:focus,
.textarea:focus,
.select:focus { border-color: var(--ink-3); }
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.helper {
  font: 500 11px/1.4 var(--font-mono);
  color: var(--ink-3);
}

/* Rich text toolbar */
.rt-toolbar {
  display: flex;
  gap: 2px;
  padding: 6px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
}
.rt-toolbar button {
  appearance: none;
  border: 0;
  background: transparent;
  width: 28px;
  height: 26px;
  border-radius: 5px;
  font: 600 12px/1 var(--font-ui);
  color: var(--ink-2);
  cursor: pointer;
}
.rt-toolbar button:hover { background: var(--surface); color: var(--ink); }
.rt-toolbar .sep {
  width: 1px;
  background: var(--line);
  margin: 4px 4px;
  cursor: default;
}
.rt-area {
  border-radius: 0 0 8px 8px;
  border-top: 0;
  min-height: 130px;
}

/* Image gallery uploader */
.uploader {
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--card-radius);
  background: var(--surface-2);
  padding: 22px;
  text-align: center;
  transition: background 0.15s, border-color 0.15s;
  cursor: pointer;
}
.uploader.drag {
  background: var(--accent-soft);
  border-color: var(--accent);
}
.uploader .icon {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: var(--surface);
  display: grid;
  place-items: center;
  margin: 0 auto 10px;
  color: var(--ink-2);
  border: 1px solid var(--line);
}
.uploader b {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
}
.uploader span {
  font: 500 11px/1.4 var(--font-mono);
  color: var(--ink-3);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.gtile {
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  background:
    repeating-linear-gradient(45deg, var(--ph-a, oklch(72% 0.04 280)) 0 6px, var(--ph-b, oklch(75% 0.04 280)) 6px 12px);
  cursor: grab;
  border: 1px solid var(--line);
}
.gtile.cover::after {
  content: "Cover";
  position: absolute;
  top: 6px;
  left: 6px;
  font: 500 9px/1 var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--ink);
  color: white;
  padding: 4px 6px;
  border-radius: 999px;
}
.gtile .x {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border: 0;
  font-size: 12px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s;
}
.gtile:hover .x { opacity: 1; }
.gtile.uploading {
  display: grid;
  place-items: center;
  background: var(--surface-2);
}
.gtile .progress {
  width: 60%;
  height: 4px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
  position: relative;
}
.gtile .progress > i {
  position: absolute;
  inset: 0;
  background: var(--gradient);
  border-radius: 999px;
}

/* Right column — editor sidebar */
.adm-form-side {
  background: var(--card-bg);
  border: var(--card-border);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 20px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}
.adm-form-side h4 {
  margin: 0 0 -4px;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
}
.tag-input {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  min-height: 38px;
}
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: 4px 8px;
  border-radius: 999px;
  font: 500 11.5px/1 var(--font-ui);
}
.tag button {
  appearance: none;
  border: 0;
  background: transparent;
  font-size: 12px;
  color: var(--ink-3);
  cursor: pointer;
  padding: 0;
}
.tag-input input {
  flex: 1;
  min-width: 80px;
  border: 0;
  background: transparent;
  outline: none;
  font: 12.5px var(--font-ui);
}

/* Breakdown items in admin */
.adm-breakdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.adm-breakdown-item:last-child {
  border-bottom: none;
}
.adm-breakdown-item img {
  width: 60px;
  height: 45px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}
.adm-breakdown-item input {
  flex: 1;
  min-width: 120px;
}

.toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.toggle-row:first-of-type { border-top: 0; padding-top: 0; }
.toggle-row .lbl b { display: block; font-size: 13px; font-weight: 600; }
.toggle-row .lbl span { font: 500 11px/1.3 var(--font-ui); color: var(--ink-3); }
.toggle {
  position: relative;
  width: 44px;
  height: 24px;
  border: 0;
  border-radius: 999px;
  background: oklch(85% 0.006 90);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s;
}
.toggle[data-on="1"] { background: oklch(50% 0.18 145); }
.toggle::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  transition: transform 0.2s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}
.toggle[data-on="1"]::after { transform: translateX(20px); }

.publish-card {
  background: var(--card-bg);
  border: var(--card-border);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.publish-card .row {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
}
.publish-card .row span:first-child { color: var(--ink-3); }
.publish-card .actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}
.publish-card .actions .btn { flex: 1; justify-content: center; }

/* Mobile add flow */
.mobile-shell {
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
  background: var(--surface);
  border-radius: 28px;
  border: 1px solid var(--line);
  box-shadow: 0 30px 60px -30px rgba(20, 20, 30, 0.3);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  font-size: 14px;
}
.mob-status {
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  font: 500 11.5px/1 var(--font-ui);
  font-feature-settings: "tnum";
}
.mob-status .right {
  display: flex;
  align-items: center;
  gap: 6px;
}
.mob-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px 12px;
  border-bottom: 1px solid var(--line);
}
.mob-nav b {
  font-size: 15px;
  font-weight: 600;
}
.mob-nav button {
  appearance: none;
  border: 0;
  background: transparent;
  font: 500 13px var(--font-ui);
  color: var(--accent);
  cursor: pointer;
  padding: 4px 6px;
}
.mob-body {
  flex: 1;
  padding: 18px 18px 8px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.mob-step {
  display: flex;
  align-items: center;
  gap: 8px;
  font: 500 10.5px/1 var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.mob-step .dots {
  display: flex;
  gap: 4px;
}
.mob-step .dots i {
  width: 16px;
  height: 3px;
  border-radius: 999px;
  background: var(--line-strong);
}
.mob-step .dots i.on { background: var(--ink); }
.mob-h2 {
  font-size: 22px;
  letter-spacing: -0.018em;
  margin: 0;
  font-weight: 600;
  text-wrap: balance;
}
.mob-help {
  margin: 0 0 4px;
  color: var(--ink-3);
  font-size: 13px;
}
.mob-add-imgs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.mob-add-imgs .add {
  aspect-ratio: 1;
  border: 1.5px dashed var(--line-strong);
  border-radius: 12px;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  color: var(--ink-3);
  font-size: 22px;
}
.mob-cat {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.mob-cat-item {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 12px;
  padding: 14px 12px;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mob-cat-item[data-active="1"] {
  border-color: var(--ink);
  background: var(--ink);
  color: white;
}
.mob-cat-item b {
  font-size: 13px;
  font-weight: 600;
}
.mob-cat-item span {
  font: 500 10px/1 var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.mob-cat-item[data-active="1"] span { color: rgba(255, 255, 255, 0.65); }

.mob-foot {
  border-top: 1px solid var(--line);
  padding: 14px 18px 22px;
  display: flex;
  gap: 10px;
}
.mob-foot .btn { flex: 1; justify-content: center; padding: 12px; font-size: 14px; }

/* Settings */
.set-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
}
.set-side {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.set-side button {
  appearance: none;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 8px 10px;
  border-radius: 7px;
  font: 500 13px var(--font-ui);
  color: var(--ink-2);
  cursor: pointer;
}
.set-side button:hover { background: var(--surface-2); color: var(--ink); }
.set-side button[data-active="1"] {
  background: var(--ink);
  color: white;
}
.set-card {
  background: var(--card-bg);
  border: var(--card-border);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.set-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* Drawer for modal forms */
.drawer-overlay {
  position: absolute;
  inset: 0;
  background: rgba(20, 20, 30, 0.32);
  backdrop-filter: blur(2px);
  z-index: 50;
  display: flex;
  justify-content: flex-end;
}
.drawer {
  width: min(560px, 92%);
  background: var(--surface);
  height: 100%;
  display: flex;
  flex-direction: column;
  animation: slideIn 0.22s ease;
}
@keyframes slideIn {
  from { transform: translateX(40px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
.drawer-h {
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.drawer-h h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}
.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.drawer-foot {
  border-top: 1px solid var(--line);
  padding: 14px 22px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  background: var(--surface-2);
}

/* Toast */
.toast {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: white;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 500;
  z-index: 100;
  box-shadow: var(--shadow-pop);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toastIn 0.2s ease;
}
@keyframes toastIn {
  from { transform: translate(-50%, 12px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

/* Utility */
.spacer { flex: 1; }
.hide { display: none !important; }

/* Code editor styles */
.code-input {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  line-height: 1.6;
  background: #1e1e1e;
  color: #d4d4d4;
  padding: 12px;
  border-radius: 6px;
  border: none;
  resize: vertical;
  width: 100%;
}

.code-input:focus {
  outline: 1px solid var(--brand);
}

/* Highlight.js Syntax Highlighting */
.hljs {
  background: #1e1e1e;
  color: #d4d4d4;
  padding: 0;
  margin: 0;
}

.hljs-string {
  color: #ce9178;
}

.hljs-number,
.hljs-literal {
  color: #b5cea8;
}

.hljs-attr {
  color: #9cdcfe;
}

.hljs-title,
.hljs-function {
  color: #dcdcaa;
}

.hljs-keyword {
  color: #569cd6;
}

.hljs-type,
.hljs-class {
  color: #4fc1ff;
}

.hljs-comment {
  color: #6a9955;
  font-style: italic;
}

.hljs-params {
  color: #9cdcfe;
}

.hljs-operator {
  color: #d4d4d4;
}

/* Status badge styling */
.status[data-s="draft"] {
  color: oklch(45% 0.01 0);
}

.status[data-s="published"] {
  color: oklch(25% 0.1 145);
}

/* Tablet responsive */
@media (max-width: 1024px) {
  .pub-hero {
    grid-template-columns: 1fr 0.9fr;
  }
}

/* Mobile responsive */
@media (max-width: 768px) {
  .pub {
    display: flex;
    flex-direction: column;
  }

  .pub-hero {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: unset !important;
    padding: 40px 20px 32px;
    gap: 28px;
  }

  /* column flex + flex-start made the featured card as wide as its content (~535px) */
  .pub-hero {
    align-items: stretch !important;
  }

  .pub-hero > div {
    min-width: 0;
    max-width: 100%;
  }

  .pub-feat {
    max-width: 100%;
  }

  .pub-hero > div:first-child {
    order: 1;
  }

  .pub-hero > div:nth-child(2) {
    order: 2;
  }

  .pub-hero h1 {
    font-size: 32px;
    line-height: 1.1;
    margin: 0 0 12px;
  }

  .pub-hero h1 br {
    display: none;
  }

  .pub-hero h1 em {
    display: block;
  }

  .pub-feat .preview {
    min-height: 300px;
  }

  .pub-grid {
    grid-template-columns: 1fr;
  }
}

/* Public Lessons Section */
.pub-lessons-list {
  max-width: 1000px;
  margin: 0 auto;
  padding: 56px 28px 120px;
}

.pub-lesson-row {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 28px;
  margin-bottom: 16px;
  background-color: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.pub-lesson-row:hover {
  border-color: var(--brand-green);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.pub-lesson-num {
  width: 60px;
  height: 60px;
  min-width: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--green) 0%, var(--purple-deep) 100%);
  color: white;
  font-weight: 700;
  font-size: 18px;
  border-radius: 10px;
  font-family: 'JetBrains Mono', monospace;
}

.pub-lesson-detail {
  width: 100%;
}

.pub-lesson-header {
  /* same mix as the home hero (.site-hero): brand gradient + diagonal stripes */
  background: var(--gradient);
  padding: 16px;
  color: white;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.pub-lesson-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(58deg, rgba(255,255,255,0.04) 0 22px, rgba(255,255,255,0.07) 22px 44px);
  mix-blend-mode: overlay;
  z-index: -1;
  pointer-events: none;
}

.pub-lesson-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 12px;
}

/* Quotes Admin Styling */
.adm-quotes-overview {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Title block like the other sections; the gap of the flex column replaces the .adm-sub bottom margin. */
.adm-quotes-head {
  margin-bottom: -2px;
}
.adm-quotes-head .adm-sub {
  margin-bottom: 0;
}

.adm-quotes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.adm-quote-card {
  background: var(--card-bg);
  border: var(--card-border);
  border-radius: var(--card-radius);
  padding: 16px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: all 0.15s ease;
}

/* Grey striped band on top, same pattern as the thumbnails in the Projects list. */
.adm-quote-card .strip {
  height: 24px;
  margin: -16px -16px 14px;
  background: repeating-linear-gradient(45deg, oklch(76% 0.005 280) 0 4px, oklch(81% 0.005 280) 4px 8px);
}

.adm-quote-card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 4px 12px rgba(20, 20, 30, 0.08);
  transform: translateY(-2px);
}

.adm-quote-card [data-badge] {
  display: inline-block;
  font: 500 10px/1 var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--ink-2);
}

.adm-quote-card [data-badge="draft"] { background: oklch(98% 0.01 25); color: oklch(40% 0.08 25); }
.adm-quote-card [data-badge="sent"] { background: oklch(97% 0.02 190); color: oklch(35% 0.12 190); }
.adm-quote-card [data-badge="accepted"] { background: oklch(95% 0.02 145); color: oklch(35% 0.1 145); }
.adm-quote-card [data-badge="rejected"] { background: oklch(96% 0.02 25); color: oklch(45% 0.15 25); }

/* Print styles for Quote PDF export */

.pub-code-block {
  background-color: #1a1a1a;
  color: #d4d4d4;
  border-radius: 10px;
  padding: 20px;
  overflow-x: auto;
  position: relative;
  font-family: 'JetBrains Mono', monospace;
  font-size: '13px';
}

@media (max-width: 900px) {
  .pub-lesson-body {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 32px 24px;
  }

  .pub-lesson-header {
    padding: 16px;
  }

  .pub-lesson-num {
    width: 52px;
    height: 52px;
    font-size: 16px;
  }

  .pub-lessons-list {
    padding: 40px 24px;
  }

  .pub-lesson-row {
    padding: 20px;
    gap: 16px;
  }
}

/* Quote PDF Preview — Screen display */
.quote-pdf-preview {
  background: white;
  transform: scale(0.65);
  transform-origin: top left;
  width: 100%;
  display: inline-block;
  height: fit-content;
}

.pdf-page {
  margin-bottom: 20px;
}


/* ===== Lesson layout, like a course player: video on the left, side panel with 3 tabs on the right
   (Code | Lesson | Course). Without a video the panel is a single centered column. ===== */
.pub-lesson-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: start;
  max-width: 1600px;
  margin: 0 auto;
  padding: 24px 24px 56px;
}
.pub-lesson-layout[data-video="1"] {
  grid-template-columns: minmax(0, 1fr) clamp(360px, 32vw, 480px);
}
.pub-lesson-layout[data-video="0"] .pub-lesson-panel {
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
}
.pub-lesson-player {
  min-width: 0;
}
.pub-lesson-video {
  background: #000;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
}
.pub-lesson-video iframe,
.pub-lesson-video video {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.pub-lesson-video-link {
  display: grid;
  place-items: center;
  height: 100%;
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}

/* Side panel */
.pub-lesson-panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
/* With a video, the panel is exactly as tall as the player (its content never sets the row height)
   and scrolls inside, so both always stay aligned. */
.pub-lesson-layout[data-video="1"] {
  align-items: stretch;
}
.pub-lesson-layout[data-video="1"] .pub-lesson-panel {
  contain: size;
  min-height: 420px;
}
.pub-lesson-tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  flex: none;
}
.pub-lesson-tabbtn {
  flex: 1;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  padding: 14px 12px;
  font: 600 12px/1 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  cursor: pointer;
}
.pub-lesson-tabbtn:hover { color: var(--ink); }
.pub-lesson-tabbtn[aria-selected="true"] {
  color: var(--ink);
  border-bottom-color: var(--brand-green);
}
.pub-lesson-panel-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
.pub-lesson-panel-body [hidden] { display: none; }

/* Lesson text: plain surface, comfortable reading width, no colored box */
.pub-lesson-text {
  padding: 20px 22px 28px;
  max-width: 72ch;
}
.pub-callout {
  background: none;
  border: 0;
  border-radius: 0;
  padding: 0;
}
.pub-callout + .pub-callout {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.pub-callout-title {
  margin: 0 0 10px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
}
.pub-callout-body {
  margin: 0 0 12px;
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--ink-2);
  white-space: pre-wrap;
}
.pub-callout-heading {
  margin: 18px 0 8px;
  font: 700 11px/1.3 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.pub-callout-list {
  margin: 8px 0 0;
  padding-left: 20px;
}
.pub-callout-list li {
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink-2);
  margin-bottom: 8px;
}

/* Code tab */
.pub-code-wrap { padding: 0; }
.pub-code-block {
  border-radius: 0;
  min-height: 100%;
  box-sizing: border-box;
}
.pub-code-snippet { position: relative; }
.pub-code-snippet + .pub-code-snippet {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.pub-code-snippet pre {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
}
.pub-code-lang {
  position: absolute;
  top: 0;
  right: 0;
  background: oklch(35% 0.09 145);
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

/* Course tab: every lesson of the course, the current one marked */
.pub-course-list { padding: 8px 0 12px; }
.pub-course-name {
  padding: 12px 22px 8px;
  font: 700 11px/1.3 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.pub-course-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  border-left: 3px solid transparent;
  padding: 12px 22px 12px 19px;
  font: inherit;
  cursor: pointer;
  color: var(--ink-2);
}
.pub-course-item:hover { background: var(--surface-2); }
.pub-course-item[aria-current="true"] {
  background: var(--surface-2);
  border-left-color: var(--brand-green);
  color: var(--ink);
  font-weight: 600;
  cursor: default;
}
.pub-course-num {
  flex: none;
  min-width: 24px;
  font: 600 12px/1.5 var(--font-mono);
  color: var(--ink-3);
}
.pub-course-title { font-size: 14px; line-height: 1.45; }

@media (max-width: 1000px) {
  .pub-lesson-layout,
  .pub-lesson-layout[data-video="1"] {
    grid-template-columns: 1fr;
    padding: 20px 16px 40px;
  }
  .pub-lesson-layout[data-video="1"] .pub-lesson-panel {
    contain: none;
    min-height: 0;
  }
  .pub-lesson-panel-body { overflow-y: visible; }
  .pub-code-block { max-height: 420px; overflow: auto; }
}

/* ===== Key words: bubbles with the main ideas of a lesson ===== */
/* Editor: a text input where every word turns into a bubble. */
.kw-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  cursor: text;
}
.kw-box:focus-within {
  border-color: var(--brand-green);
  box-shadow: 0 0 0 3px oklch(0.6 0.17 131.48 / 0.18);
}
.kw-bubble {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 6px 5px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid oklch(0.6 0.17 131.48 / 0.45);
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
}
.kw-bubble button {
  appearance: none;
  border: 0;
  background: transparent;
  width: 18px;
  height: 18px;
  padding: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--ink-3);
  font-size: 15px;
  line-height: 1;
}
.kw-bubble button:hover {
  background: rgba(0, 0, 0, 0.08);
  color: var(--ink);
}
.kw-input {
  flex: 1;
  min-width: 160px;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 14px;
  padding: 4px 2px;
  color: var(--ink);
}
.kw-help {
  margin: 6px 0 0;
  font-size: 11px;
  color: var(--ink-3);
}

/* Public lesson page: the same words as bubbles under the title, aligned to the left. */
.pub-lesson-ideas {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}
.pub-idea {
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
}

/* ===== Lecciones page: one card per category ===== */
.pub-lessons-list { max-width: 1200px; }
.pub-cats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.pub-cat-card {
  display: flex;
  align-items: center;
  gap: 20px;
  width: 100%;
  text-align: left;
  font: inherit;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.pub-cat-card:hover:not(:disabled) {
  border-color: var(--brand-green);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}
.pub-cat-card:disabled { opacity: 0.6; cursor: default; }
.pub-cat-count {
  flex: none;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--green) 0%, var(--purple-deep) 100%);
  color: #fff;
  font: 700 18px/1 'JetBrains Mono', monospace;
  border-radius: 10px;
}
.pub-cat-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.pub-cat-name { font-size: 16px; font-weight: 700; color: var(--ink); }
.pub-cat-desc { font-size: 13px; line-height: 1.5; color: var(--ink-2); }
.pub-cat-meta { font-size: 12px; color: var(--ink-3); }
.pub-cat-arrow { flex: none; font-size: 18px; color: var(--ink-2); }
