.n3 {
  --n3-me: #637454;
  --n3-bot: #9a6a2f;
  --n3-nb: #3f6a8a;
  --n3-warn: #9a3427;
  font-family: var(--font-geist-sans), "Geist", ui-sans-serif, system-ui, sans-serif;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--foreground);
  margin-top: 1.75rem;
  margin-bottom: 1.75rem;
}
.dark .n3 {
  --n3-me: #a5b38f;
  --n3-bot: #d9a866;
  --n3-nb: #8fb8d6;
  --n3-warn: #d56a57;
}
.note-prose .n3 p {
  margin: 0;
  color: inherit;
}
.n3-cap {
  margin-top: 0.7rem;
  font-size: 0.85rem;
  color: var(--muted-foreground);
}

/* 1. flow */
.n3-flow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--card);
}
.n3-head {
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.35rem 0.6rem;
  border-bottom: 2px solid currentColor;
}
.n3-step {
  position: relative;
  padding: 0.6rem 0.7rem 0.65rem;
  border-radius: 0.5rem;
  border: 1px solid color-mix(in srgb, var(--n3-c) 45%, transparent);
  background: color-mix(in srgb, var(--n3-c) 11%, var(--card));
}
.n3-me { --n3-c: var(--n3-me); }
.n3-bot { --n3-c: var(--n3-bot); }
.n3-nb { --n3-c: var(--n3-nb); }
.n3-head.n3-me, .n3-head.n3-bot, .n3-head.n3-nb { color: var(--n3-c); }
.n3-flow .n3-me { grid-column: 1; }
.n3-flow .n3-bot { grid-column: 2; }
.n3-flow .n3-nb { grid-column: 3; }
.n3-r0 { grid-row: 1; } .n3-r1 { grid-row: 2; } .n3-r2 { grid-row: 3; } .n3-r3 { grid-row: 4; }
.n3-r4 { grid-row: 5; } .n3-r5 { grid-row: 6; } .n3-r6 { grid-row: 7; } .n3-r7 { grid-row: 8; }
.n3-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.45rem;
  height: 1.45rem;
  margin-right: 0.45rem;
  border-radius: 999px;
  background: var(--n3-c);
  color: var(--background);
  font-size: 0.8rem;
  font-weight: 600;
}
.n3-who {
  display: none;
  margin-right: 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--n3-c);
}
.n3-tag {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  vertical-align: 0.08em;
}
.n3-ok { background: color-mix(in srgb, var(--n3-me) 22%, transparent); color: var(--n3-me); }
.n3-wip { background: color-mix(in srgb, var(--n3-warn) 16%, transparent); color: var(--n3-warn); }
@media (max-width: 640px) {
  .n3-flow { grid-template-columns: 1fr; padding: 0.75rem; }
  .n3-flow .n3-step { grid-column: 1; grid-row: auto; }
  .n3-head { display: none; }
  .n3-who { display: inline; }
}

/* 2. folder + chat */
.n3-two {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 0.9rem;
  align-items: start;
}
@media (max-width: 640px) { .n3-two { grid-template-columns: 1fr; } }
.n3-panel {
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--card);
  padding: 0.9rem 1rem;
}
.n3-title {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted-foreground);
}
.n3-f {
  display: block;
  position: relative;
  padding: 0.22rem 0 0.22rem 1.7rem;
}
.n3-f::before {
  content: "";
  position: absolute;
  left: 0.15rem;
  top: 0.5rem;
  width: 1.05rem;
  height: 0.78rem;
  border-radius: 0.15rem;
  background: color-mix(in srgb, var(--n3-bot) 55%, var(--card));
  box-shadow: inset 0 0.2rem 0 color-mix(in srgb, var(--n3-bot) 85%, var(--card));
}
.n3-file::before {
  width: 0.8rem;
  height: 1rem;
  top: 0.4rem;
  left: 0.28rem;
  background: color-mix(in srgb, var(--n3-nb) 30%, var(--card));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--n3-nb) 70%, transparent);
}
.n3-d1 { margin-left: 1.3rem; }
.n3-d2 { margin-left: 2.6rem; }
.n3-d3 { margin-left: 3.9rem; }
.n3-note {
  margin-left: 0.4rem;
  font-size: 0.8rem;
  color: var(--muted-foreground);
}
.n3-hot { font-weight: 600; }
.n3-bubble {
  display: block;
  margin: 0.3rem 0 0.6rem auto;
  width: fit-content;
  max-width: 100%;
  padding: 0.55rem 0.8rem;
  border-radius: 1rem 1rem 0.25rem 1rem;
  background: var(--n3-me);
  color: var(--background);
}
.n3-reply {
  display: block;
  width: fit-content;
  max-width: 100%;
  padding: 0.55rem 0.8rem;
  border-radius: 1rem 1rem 1rem 0.25rem;
  background: var(--muted);
  color: var(--muted-foreground);
  font-size: 0.85rem;
}
.n3-or {
  display: block;
  margin: 0.2rem 0 0.7rem;
  font-size: 0.85rem;
}
.n3-clock {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--n3-bot) 50%, transparent);
  color: var(--n3-bot);
  font-weight: 600;
  font-size: 0.8rem;
}

/* 3. transcript compare */
.n3-diff {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}
@media (max-width: 640px) { .n3-diff { grid-template-columns: 1fr; } }
.n3-src {
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  background: var(--card);
  padding: 0.7rem 0.85rem;
  font-family: var(--font-geist-mono), ui-monospace, SFMono-Regular, monospace;
  font-size: 0.82rem;
  line-height: 1.7;
}
.n3-out {
  grid-column: 1 / -1;
  border-color: color-mix(in srgb, var(--n3-me) 55%, transparent);
  background: color-mix(in srgb, var(--n3-me) 8%, var(--card));
}
.n3-src .n3-title { font-family: var(--font-geist-sans), ui-sans-serif, system-ui, sans-serif; }
.n3-arrow {
  grid-column: 1 / -1;
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted-foreground);
}
.n3 mark {
  padding: 0.05rem 0.25rem;
  border-radius: 0.25rem;
  color: inherit;
}
.n3-x { background: color-mix(in srgb, var(--n3-warn) 22%, transparent); }
.n3-fix { background: color-mix(in srgb, var(--n3-me) 28%, transparent); font-weight: 600; }
.n3-unc { background: color-mix(in srgb, var(--n3-bot) 26%, transparent); }
.n3-why {
  display: block;
  margin-top: 0.5rem;
  font-family: var(--font-geist-sans), ui-sans-serif, system-ui, sans-serif;
  font-size: 0.8rem;
  color: var(--muted-foreground);
}

/* 4. stats */
.n3-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
}
.n3-stat {
  display: block;
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  background: var(--card);
  padding: 0.7rem 0.85rem;
  font-size: 0.82rem;
  color: var(--muted-foreground);
}
.n3-stat b {
  display: block;
  font-size: 1.5rem;
  line-height: 1.2;
  font-weight: 600;
  color: var(--foreground);
}
@media (max-width: 420px) { .n3-stat b { font-size: 1.2rem; } }

/* 5. lesson map */
.n3-map {
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--card);
  overflow: hidden;
}
.n3-row {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.3fr) auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.65rem 1rem;
  border-top: 1px solid var(--border);
}
.n3-row:first-child { border-top: 0; }
.n3-rowhead {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted-foreground);
  background: var(--muted);
}
.n3-ev { font-size: 0.85rem; color: var(--muted-foreground); }
.n3-label {
  justify-self: start;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}
.n3-l-ok { background: color-mix(in srgb, var(--n3-me) 22%, transparent); color: var(--n3-me); }
.n3-l-inf { background: color-mix(in srgb, var(--n3-bot) 22%, transparent); color: var(--n3-bot); }
@media (max-width: 640px) {
  .n3-row { grid-template-columns: 1fr; gap: 0.2rem; }
  .n3-rowhead { display: none; }
}

/* screenshots */
.n3-shots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}
@media (max-width: 640px) { .n3-shots { grid-template-columns: 1fr; } }
.n3-shot {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 9rem;
  padding: 1rem;
  border: 1.5px dashed var(--border);
  border-radius: 0.6rem;
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted-foreground);
}
.n3-img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 0.6rem;
}

/* wrapping */
.note-prose { word-break: keep-all; overflow-wrap: anywhere; }
.n3-cap-top { margin-top: 0; margin-bottom: 0.7rem; }

/* step layout: number, text, tag at the right */
.note-prose .n3-step p {
  display: flex;
  align-items: flex-start;
  gap: 0.15rem;
}
.n3-step .n3-num { flex: none; }
.n3-step .n3-who { flex: none; margin-top: 0.1rem; }
.n3-step .n3-tag { flex: none; margin-left: auto; margin-top: 0.15rem; }

/* connectors between steps (wide layout only) */
@media (min-width: 641px) {
  .n3-fl::before, .n3-fr::before {
    content: "";
    position: absolute;
    top: calc(-0.55rem - 1px);
    width: calc(50% + 0.55rem);
    height: calc(50% + 0.55rem);
    border-bottom: 1.5px solid var(--muted-foreground);
    opacity: 0.55;
    pointer-events: none;
  }
  .n3-fl::before {
    right: 100%;
    border-left: 1.5px solid var(--muted-foreground);
    border-bottom-left-radius: 0.6rem;
  }
  .n3-fr::before {
    left: 100%;
    border-right: 1.5px solid var(--muted-foreground);
    border-bottom-right-radius: 0.6rem;
  }
  .n3-fl::after, .n3-fr::after {
    content: "";
    position: absolute;
    top: calc(50% - 0.3rem);
    border: 0.3rem solid transparent;
    opacity: 0.7;
  }
  .n3-fl::after { right: 100%; border-left-color: var(--muted-foreground); border-right-width: 0; }
  .n3-fr::after { left: 100%; border-right-color: var(--muted-foreground); border-left-width: 0; }
}
@media (max-width: 640px) {
  .n3-flow .n3-step + .n3-step { margin-top: 0.15rem; }
  .n3-stats { grid-template-columns: 1fr; }
  .n3-stat { display: flex; align-items: baseline; gap: 0.6rem; }
  .n3-stat b { display: inline; }
}

/* real cases + lesson map rows */
.n3-case { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.5fr); align-items: start; }
.n3-mrow { grid-template-columns: minmax(0, 0.8fr) minmax(0, 2.2fr) minmax(0, 1fr); align-items: start; }
.n3-q { font-family: var(--font-geist-mono), ui-monospace, SFMono-Regular, monospace; font-size: 0.82rem; }
.n3-kind { font-weight: 600; font-size: 0.85rem; color: var(--n3-bot); }
.n3-case .n3-why { margin-top: 0.35rem; }
.n3-case .n3-label { display: inline-block; white-space: normal; }
@media (max-width: 640px) {
  .n3-case, .n3-mrow { grid-template-columns: 1fr; gap: 0.3rem; }
  .n3-case:not(.n3-rowhead) > span:nth-child(1)::before,
  .n3-case:not(.n3-rowhead) > span:nth-child(2)::before {
    display: block;
    font-family: var(--font-geist-sans), ui-sans-serif, system-ui, sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--muted-foreground);
  }
  .n3-case:not(.n3-rowhead) > span:nth-child(1)::before { content: "Existing transcript"; }
  .n3-case:not(.n3-rowhead) > span:nth-child(2)::before { content: "NotebookLM transcript"; }
  :lang(ko) .n3-case:not(.n3-rowhead) > span:nth-child(1)::before { content: "기존 전사본"; }
  :lang(ko) .n3-case:not(.n3-rowhead) > span:nth-child(2)::before { content: "NotebookLM 전사본"; }
}

/* breakdown bar */
.n3-bar {
  display: flex;
  margin-top: 0.7rem;
  height: 1.9rem;
  border-radius: 0.5rem;
  overflow: hidden;
  border: 1px solid var(--border);
}
.n3-seg {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 1.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--foreground);
}
.n3-s324 { flex: 324; background: color-mix(in srgb, var(--n3-bot) 38%, var(--card)); }
.n3-s40 { flex: 40; background: color-mix(in srgb, var(--muted-foreground) 30%, var(--card)); }
.n3-s27 { flex: 27; background: color-mix(in srgb, var(--n3-nb) 40%, var(--card)); }
.n3-s4 { flex: 4; background: color-mix(in srgb, var(--n3-me) 60%, var(--card)); }
.n3-legend { margin-top: 0.6rem; font-size: 0.85rem; }
.n3-key { display: block; position: relative; padding: 0.12rem 0 0.12rem 1.3rem; }
.n3-key::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.5rem;
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 0.2rem;
}
.n3-k324::before { background: color-mix(in srgb, var(--n3-bot) 38%, var(--card)); }
.n3-k40::before { background: color-mix(in srgb, var(--muted-foreground) 30%, var(--card)); }
.n3-k27::before { background: color-mix(in srgb, var(--n3-nb) 40%, var(--card)); }
.n3-k4::before { background: color-mix(in srgb, var(--n3-me) 60%, var(--card)); }

/* screenshots */
.n3-pair { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr); gap: 0.6rem; align-items: start; }
.n3-pair + .n3-cap, .n3-img + .n3-cap { margin-top: 0.6rem; }
@media (max-width: 640px) { .n3-pair { grid-template-columns: 1fr; } }
.n3 > .n3-img[src*="notebook-transcript"] { max-width: 22rem; }
.n3-pair-eq { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 640px) { .n3-pair-eq { grid-template-columns: 1fr; } }
.n3-pair, .n3-pair-eq { grid-template-columns: 1fr; }
.n3-img[src*="grok-bot-routine"] { max-width: 19rem; }
.n3-part { background: color-mix(in srgb, var(--n3-bot) 22%, transparent); color: var(--n3-bot); }
