/* ===================== Code, Prompts & Terminal posts ===================== */
.kc-snip-home, .kc-snip, .kc-snip-composer {
  --sn-ink: #101628; --sn-muted: #697187; --sn-card: #ffffff; --sn-card-2: #f3f5fb; --sn-line: #e1e5f0; --sn-bg: #f7f8fc;
  --sn-a: #4f8dff; --sn-b: #8b6cff; --sn-grad: linear-gradient(135deg, #4f8dff, #8b6cff);
  --sn-code-bg: #0f1420; --sn-code-bar: rgba(255,255,255,.06); --sn-code-ink: #e6edf3;
  --sn-code: #4f8dff; --sn-prompt: #e04bd0; --sn-terminal: #1f9d63;
}
body[data-theme="dark"] .kc-snip-home, body[data-theme="dark"] .kc-snip, body[data-theme="dark"] .kc-snip-composer {
  --sn-ink: #e6edf3; --sn-muted: #8b949e; --sn-card: #161b22; --sn-card-2: #1c222b; --sn-line: rgba(255,255,255,.14); --sn-bg: #0d1117;
  --sn-code-bg: #0b0f16;
}
.kc-snip-home.is-hidden { display: none; }
.kc-snip-home { margin: 6px 0 14px; padding: 0 2px; }

/* ---- section ---- */
.kc-snip-section-head { align-items: center; display: flex; gap: 10px; justify-content: space-between; margin: 4px 2px 10px; }
.kc-snip-section-head strong { color: var(--sn-ink); display: block; font-size: 15px; letter-spacing: -.01em; }
.kc-snip-section-head small { color: var(--sn-muted); display: block; font-size: 11px; margin-top: 2px; }
.kc-snip-share { align-items: center; background: var(--sn-grad); border: 0; border-radius: 999px; box-shadow: 0 8px 18px -10px rgba(139,108,255,.95); color: #fff; display: inline-flex; font: 800 11px/1 "Manrope", system-ui, sans-serif; gap: 5px; padding: 9px 13px; }
.kc-snip-share svg { fill: none; height: 13px; stroke: currentColor; stroke-linecap: round; stroke-width: 2.4; width: 13px; }
.kc-snip-chips { display: flex; gap: 7px; margin: 0 0 10px; overflow-x: auto; padding: 0 2px 2px; scrollbar-width: none; }
.kc-snip-chips::-webkit-scrollbar { display: none; }
.kc-snip-chip { background: var(--sn-card); border: 1px solid var(--sn-line); border-radius: 999px; color: var(--sn-muted); flex: 0 0 auto; font: 700 11px/1 "Manrope", system-ui, sans-serif; padding: 8px 13px; }
.kc-snip-chip.is-active { background: var(--sn-ink); border-color: var(--sn-ink); color: var(--sn-bg); }
.kc-snip-list { display: grid; gap: 12px; }
.kc-snip-empty { align-items: center; background: var(--sn-card); border: 1px dashed var(--sn-line); border-radius: 18px; color: var(--sn-muted); display: flex; flex-direction: column; gap: 8px; padding: 22px 14px; text-align: center; }
.kc-snip-empty > span { align-items: center; background: var(--sn-grad); border-radius: 14px; color: #fff; display: inline-flex; height: 44px; justify-content: center; width: 44px; }
.kc-snip-empty svg { height: 22px; width: 22px; }
.kc-snip-empty p { font-size: 12px; margin: 0; }
.kc-snip-loadmore { background: var(--sn-card); border: 1px solid var(--sn-line); border-radius: 12px; color: var(--sn-ink); display: block; font: 800 12px/1 "Manrope", system-ui, sans-serif; margin: 12px auto 0; padding: 12px 22px; }

/* ---- card ---- */
.kc-snip { background: var(--sn-card); border: 1px solid var(--sn-line); border-radius: 20px; box-shadow: 0 1px 2px rgba(16,22,40,.04); display: grid; gap: 8px; overflow: hidden; padding: 14px 14px 12px; position: relative; }
.kc-snip::before { background: var(--accent, var(--sn-code)); content: ""; height: 3px; left: 0; position: absolute; right: 0; top: 0; }
.kc-snip.is-code { --accent: var(--sn-code); }
.kc-snip.is-prompt { --accent: var(--sn-prompt); }
.kc-snip.is-terminal { --accent: var(--sn-terminal); }
.kc-snip-head { align-items: center; display: flex; gap: 8px; }
.kc-snip-author { align-items: center; cursor: pointer; display: flex; flex: 1 1 auto; gap: 9px; min-width: 0; }
.kc-snip-author .mini-avatar { height: 34px; width: 34px; }
.kc-snip-who { display: grid; min-width: 0; }
.kc-snip-who strong { color: var(--sn-ink); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kc-snip-who small { color: var(--sn-muted); font-size: 10.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kc-snip-kind { align-items: center; background: color-mix(in srgb, var(--accent) 14%, transparent); border-radius: 999px; color: var(--accent); display: inline-flex; flex: 0 0 auto; font: 800 10px/1 "Manrope", system-ui, sans-serif; gap: 5px; letter-spacing: .03em; padding: 6px 9px 6px 7px; text-transform: uppercase; }
.kc-snip-kind svg { height: 12px; width: 12px; }
.kc-snip-del { background: transparent; border: 0; border-radius: 8px; color: var(--sn-muted); height: 30px; width: 30px; }
.kc-snip-del svg { fill: none; height: 16px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; width: 16px; }
.kc-snip-title { color: var(--sn-ink); font-size: 15.5px; letter-spacing: -.01em; line-height: 1.3; margin: 2px 0 0; }
.kc-snip-desc { color: var(--sn-muted); font-size: 12.5px; line-height: 1.5; margin: 0; white-space: pre-line; overflow-wrap: anywhere; }

/* ---- the code / prompt / terminal block ---- */
.kc-snip-codewrap { background: var(--sn-code-bg); border-radius: 14px; margin-top: 2px; overflow: hidden; position: relative; }
.kc-snip-bar { align-items: center; background: var(--sn-code-bar); display: flex; justify-content: space-between; padding: 6px 8px 6px 12px; }
.kc-snip-lang { align-items: center; color: #98a2b8; display: inline-flex; font: 600 10.5px "DM Mono", ui-monospace, monospace; gap: 6px; letter-spacing: .03em; }
.kc-snip-lang svg { height: 13px; width: 13px; color: var(--accent); }
.kc-snip-lang b { font-weight: 600; }
.kc-snip-copy { align-items: center; background: var(--sn-grad); border: 0; border-radius: 9px; color: #fff; display: inline-flex; font: 800 11px/1 "Manrope", system-ui, sans-serif; gap: 6px; padding: 7px 12px; transition: background .2s, transform .12s; }
.kc-snip-copy:active { transform: scale(.95); }
.kc-snip-copy svg { fill: none; height: 13px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.1; width: 13px; }
.kc-snip-copy.is-done { background: #1f9d63; }
.kc-snip-scroll { -webkit-overflow-scrolling: touch; overflow-x: auto; }
.kc-snip-codewrap.is-collapsed .kc-snip-scroll { max-height: 224px; overflow-y: hidden; }
.kc-snip-codewrap.is-open .kc-snip-scroll { max-height: 560px; overflow-y: auto; }
.kc-snip-codewrap.is-collapsed::after { background: linear-gradient(transparent, var(--sn-code-bg) 80%); bottom: 36px; content: ""; height: 54px; left: 0; pointer-events: none; position: absolute; right: 0; }
.kc-snip-pre { color: var(--sn-code-ink); margin: 0; padding: 12px 14px; }
.kc-snip-pre code { background: none; color: inherit; display: block; font: 500 12px/1.6 "DM Mono", ui-monospace, monospace; min-width: max-content; padding: 0; white-space: pre; }
.kc-snip-prompt { color: #e6edf3; font-size: 13px; line-height: 1.6; padding: 12px 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.kc-snip-more { background: var(--sn-code-bar); border: 0; color: #c9d1e0; display: block; font: 700 11px "Manrope", system-ui, sans-serif; padding: 10px; position: relative; text-align: center; width: 100%; z-index: 1; }
.kc-prompt { color: var(--sn-terminal); font-weight: 700; user-select: none; -webkit-user-select: none; }
.tk-c { color: #7d8aa3; font-style: italic; }
.tk-s { color: #a5e075; }
.tk-n { color: #f0b36b; }
.tk-k { color: #c792ea; }
.tk-f { color: #82aaff; }

/* ---- footer ---- */
.kc-snip-foot { align-items: center; display: flex; gap: 10px; justify-content: space-between; padding-top: 2px; }
.kc-snip-tags { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.kc-snip-tags i { background: var(--sn-card-2); border-radius: 999px; color: var(--sn-muted); font: 700 10.5px/1 "Manrope", system-ui, sans-serif; font-style: normal; padding: 5px 9px; }
.kc-snip-stats { align-items: center; color: var(--sn-muted); display: inline-flex; flex: 0 0 auto; font: 700 11px "Manrope", system-ui, sans-serif; gap: 12px; }
.kc-snip-stats svg { fill: none; height: 15px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.9; width: 15px; }
.kc-snip-like, .kc-snip-copies { align-items: center; background: transparent; border: 0; color: inherit; display: inline-flex; gap: 5px; padding: 4px; }
.kc-snip-like.is-on { color: #ffb020; }
.kc-snip-like.is-on svg { fill: currentColor; }

/* ---- composer (full screen) ---- */
body.kc-snip-open { overflow: hidden; }
.kc-snip-composer { background: var(--sn-bg); bottom: 0; color: var(--sn-ink); display: flex; flex-direction: column; left: 0; opacity: 0; position: fixed; right: 0; top: 0; transform: translateY(18px); transition: opacity .2s ease, transform .22s ease; z-index: 3500; }
.kc-snip-composer.is-in { opacity: 1; transform: none; }
.kc-snip-composer.is-hidden { display: none; }
.kc-sc-top { align-items: center; background: var(--sn-card); border-bottom: 1px solid var(--sn-line); display: flex; gap: 10px; padding: calc(env(safe-area-inset-top, 0px) + 10px) 12px 10px; }
.kc-sc-close { align-items: center; background: var(--sn-card-2); border: 0; border-radius: 12px; color: var(--sn-ink); display: inline-flex; height: 38px; justify-content: center; width: 38px; }
.kc-sc-close svg { fill: none; height: 20px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; width: 20px; }
.kc-sc-title { display: grid; flex: 1 1 auto; line-height: 1.15; }
.kc-sc-title small { color: var(--sn-muted); font: 600 9px "DM Mono", monospace; letter-spacing: .12em; }
.kc-sc-title strong { font-size: 15px; }
.kc-sc-post { background: var(--sn-grad); border: 0; border-radius: 12px; box-shadow: 0 8px 18px -10px rgba(139,108,255,.95); color: #fff; font: 800 13px/1 "Manrope", system-ui, sans-serif; padding: 11px 20px; }
.kc-sc-post:not(.is-ready) { background: var(--sn-card-2); box-shadow: none; color: var(--sn-muted); }
.kc-sc-post:disabled { opacity: .7; }
.kc-sc-body { -webkit-overflow-scrolling: touch; display: grid; flex: 1 1 auto; gap: 14px; align-content: start; overflow-y: auto; padding: 14px 14px calc(env(safe-area-inset-bottom, 0px) + 28px); }
.kc-sc-kinds { background: var(--sn-card-2); border-radius: 16px; display: grid; gap: 4px; grid-template-columns: repeat(3, 1fr); padding: 4px; }
.kc-sc-kind { align-items: center; background: transparent; border: 0; border-radius: 12px; color: var(--sn-muted); display: inline-flex; font: 800 12px/1 "Manrope", system-ui, sans-serif; gap: 7px; justify-content: center; padding: 12px 6px; transition: background .15s, color .15s; }
.kc-sc-kind svg { height: 16px; width: 16px; }
.kc-sc-kind.is-active { background: var(--sn-card); box-shadow: 0 2px 8px rgba(16,22,40,.12); color: var(--sn-ink); }
.kc-sc-field { display: grid; gap: 7px; }
.kc-sc-field.is-hidden { display: none; }
.kc-sc-field > span { align-items: center; color: var(--sn-ink); display: flex; font: 800 12px "Manrope", system-ui, sans-serif; justify-content: space-between; }
.kc-sc-field > span em { color: var(--sn-muted); font: 600 10.5px "DM Mono", monospace; font-style: normal; }
.kc-sc-field > span em.is-over { color: #ed5a7c; }
.kc-sc-field input, .kc-sc-field textarea, .kc-sc-field select { background: var(--sn-card); border: 1px solid var(--sn-line); border-radius: 14px; color: var(--sn-ink); font-family: "Manrope", system-ui, sans-serif; font-size: 16px; padding: 12px 13px; resize: vertical; width: 100%; }
.kc-sc-field textarea.kc-sc-code { background: var(--sn-code-bg); border-color: transparent; color: var(--sn-code-ink); font: 500 13px/1.55 "DM Mono", ui-monospace, monospace; min-height: 220px; tab-size: 2; white-space: pre; overflow: auto; resize: vertical; }
.kc-sc-field textarea.kc-sc-code.is-prompt { font: 500 14px/1.6 "Manrope", system-ui, sans-serif; white-space: pre-wrap; }
.kc-sc-field input:focus, .kc-sc-field textarea:focus, .kc-sc-field select:focus { border-color: var(--sn-b); box-shadow: 0 0 0 3px color-mix(in srgb, var(--sn-b) 22%, transparent); outline: 0; }
.kc-sc-tagbox { align-items: center; background: var(--sn-card); border: 1px solid var(--sn-line); border-radius: 14px; display: flex; flex-wrap: wrap; gap: 6px; min-height: 48px; padding: 7px 9px; }
.kc-sc-tagbox > span { display: contents; }
.kc-sc-tagbox input { background: transparent !important; border: 0 !important; box-shadow: none !important; flex: 1 1 90px; min-width: 90px; padding: 6px 4px !important; width: auto !important; }
.kc-sc-tagbox input[hidden] { display: none; }
.kc-sc-tag { align-items: center; background: color-mix(in srgb, var(--sn-b) 15%, transparent); border: 0; border-radius: 999px; color: var(--sn-b); display: inline-flex; font: 800 12px/1 "Manrope", system-ui, sans-serif; gap: 5px; padding: 7px 8px 7px 11px; }
.kc-sc-tag svg { fill: none; height: 11px; stroke: currentColor; stroke-linecap: round; stroke-width: 2.6; width: 11px; }
.kc-sc-suggest { display: flex; flex-wrap: wrap; gap: 6px; }
.kc-sc-sug { background: var(--sn-card); border: 1px dashed var(--sn-line); border-radius: 999px; color: var(--sn-muted); font: 700 11px/1 "Manrope", system-ui, sans-serif; padding: 7px 10px; }
.kc-sc-note { color: var(--sn-muted); font-size: 11px; line-height: 1.5; margin: 2px 2px 0; }

@media (min-width: 860px) {
  .kc-snip-composer { align-items: center; background: rgba(8,10,18,.55); }
  .kc-snip-composer > * { width: min(640px, 100%); }
  .kc-snip-composer .kc-sc-top { border-radius: 22px 22px 0 0; margin-top: 4vh; }
  .kc-snip-composer .kc-sc-body { background: var(--sn-bg); border-radius: 0 0 22px 22px; flex: 0 1 auto; max-height: 84vh; }
}
@media (prefers-reduced-motion: reduce) { .kc-snip-composer { transition: none; } }
.np-type-card.np-type-snippet .np-type-icon { background: linear-gradient(135deg, #4f8dff, #8b6cff); color: #fff; }

/* ===================== Full-screen post layout (no separate boxes) ===================== */
.kc-snip {
  -webkit-user-select: text; user-select: text; touch-action: pan-y pinch-zoom;
  background: transparent; border: 0; border-bottom: 1px solid var(--sn-line); border-radius: 0; box-shadow: none;
  gap: 10px; padding: 16px 16px 6px;
}
.kc-snip::before { display: none; }
.kc-snip button { -webkit-user-select: none; user-select: none; }
.kc-snip-list, #projectFeed > .kc-snip { gap: 0; }
/* edge to edge on phones */
@media (max-width: 859px) {
  #projectFeed > .kc-snip, #page-collection-view .kc-snip { margin-inline: calc(50% - 50vw); width: 100vw; box-sizing: border-box; }
}
@media (min-width: 860px) {
  #projectFeed > .kc-snip { padding-inline: 4px; }
}
.kc-snip-title { font-size: 17px; }
.kc-snip-desc { font-size: 13.5px; }

/* the code / prompt / terminal block: edge to edge, 10 lines visible, scroll for the rest */
.kc-snip-codewrap { border-radius: 12px; margin-inline: -4px; }
.kc-snip-codewrap::after { display: none !important; }
.kc-snip-lang i { color: #6f7a92; font-size: 10px; font-style: normal; margin-left: 8px; opacity: .9; }
.kc-snip-scroll {
  -webkit-overflow-scrolling: touch; max-height: calc(10 * 1.6 * 12px + 26px); overflow: auto;
  overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.28) transparent;
  touch-action: pan-x pan-y; -webkit-user-select: text; user-select: text;
}
.kc-snip.is-prompt .kc-snip-scroll { max-height: calc(10 * 1.6 * 13px + 26px); }
.kc-snip-scroll::-webkit-scrollbar { height: 6px; width: 6px; }
.kc-snip-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,.28); border-radius: 6px; }
.kc-snip-codewrap.is-long .kc-snip-scroll { box-shadow: inset 0 -14px 12px -14px rgba(0,0,0,.6); }
.kc-snip-more { display: none; }

/* tags + the three actions: Kudos · Share · Save */
.kc-snip-tags { margin: 0; }
.kc-snip-foot { border-top: 1px solid var(--sn-line); display: grid; gap: 0; grid-template-columns: repeat(3, 1fr); margin: 4px -16px 0; padding: 0; }
.kc-snip-act {
  align-items: center; background: transparent; border: 0; color: var(--sn-muted); display: inline-flex;
  font: 800 12.5px "Manrope", system-ui, sans-serif; gap: 7px; justify-content: center; min-height: 46px; padding: 0;
  transition: color .15s, transform .12s, background .15s;
}
.kc-snip-act:active { background: var(--sn-card-2); transform: scale(.96); }
.kc-snip-act svg { fill: none; height: 20px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.9; width: 20px; }
.kc-snip-act + .kc-snip-act { border-left: 1px solid var(--sn-line); }
.kc-snip-like.is-on { color: #ffb020; }
.kc-snip-like.is-on svg { fill: currentColor; }
.kc-snip-save.is-on { color: var(--sn-b); }
.kc-snip-save.is-on svg { fill: currentColor; }
