[hidden] { display: none !important; }

main.share-shell { width: min(1120px, calc(100% - 28px)); }

.share-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 22px;
  align-items: start;
}

.draft-pill {
  display: inline-block;
  margin-bottom: 12px;
  padding: 2px 10px;
  border: 1px solid var(--card-border);
  border-radius: 999px;
  color: var(--tx-muted);
  font-size: 12px;
  letter-spacing: .04em;
}

.share-editor input.share-title[type="text"] {
  width: 100%;
  min-width: 0;
  margin: 0 0 14px;
  padding: 4px 0 8px;
  border: 0;
  border-bottom: 1px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--tx);
  font-size: 28px;
  font-weight: 750;
  letter-spacing: -0.03em;
}

.share-title::placeholder { color: #64748b; font-weight: 650; }
.share-editor input.share-title[type="text"]:focus { outline: none; border-bottom-color: var(--card-border); }

.share-label {
  display: block;
  margin-bottom: 6px;
  color: var(--tx-muted);
  font-size: 14px;
}

.share-editor textarea,
.share-editor input[type="text"],
.share-editor input[type="url"],
.picker-panel input[type="search"] {
  width: 100%;
  min-width: 0;
  font: inherit;
  color: var(--tx);
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 10px 12px;
}

.share-editor textarea { min-height: 88px; resize: vertical; }
.share-pitch { min-height: 64px; }

.cover-drop {
  display: grid;
  place-items: center;
  min-height: 190px;
  margin-top: 16px;
  border: 1px dashed var(--card-border);
  border-radius: 14px;
  background: rgba(255, 255, 255, .45);
  color: var(--tx-muted);
  cursor: pointer;
  overflow: hidden;
  position: relative;
}

.cover-drop.has-image { min-height: 0; border-style: solid; }
.cover-drop img { width: 100%; max-height: 340px; object-fit: cover; display: block; }
.cover-drop span { padding: 16px; text-align: center; }
.cover-drop.has-image span {
  position: absolute;
  left: 10px;
  bottom: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .82);
  font-size: 13px;
}

.share-editor section {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--card-border);
  scroll-margin-top: 84px;
}

.share-editor h2 { font-size: 18px; margin-bottom: 10px; }
.share-editor h3 {
  font-size: 14px;
  margin: 16px 0 8px;
  color: var(--tx-muted);
  font-weight: 650;
}

.checkline {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 12px;
  color: var(--tx);
  font-size: 14px;
}

.hint { color: var(--tx-muted); font-size: 13px; margin: -6px 0 10px; }

.person-row, .part-row, .plain-row {
  display: grid;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
}

.person-row { grid-template-columns: 42px minmax(0, 1fr) auto; }
.part-row { grid-template-columns: 56px minmax(0, 1fr) auto; }
.plain-row {
  grid-template-columns: minmax(0, 1fr) auto;
  border-bottom: 1px solid var(--card-border);
}

.avatar, .part-thumb {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #c8e8e9;
  color: #065f46;
  font-weight: 750;
  cursor: pointer;
}

.part-thumb {
  width: 56px;
  height: 42px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid var(--card-border);
  cursor: default;
  color: var(--tx-muted);
  font-size: 13px;
}

.avatar img, .part-thumb img { width: 100%; height: 100%; object-fit: cover; }
.part-thumb img { object-fit: contain; padding: 4px; }

.person-row input[type="text"] {
  background: transparent;
  border-color: transparent;
  padding-left: 0;
}
.person-row input[type="text"]:focus {
  border-color: var(--card-border);
  padding-left: 10px;
}

.icon-btn, .stepper button {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  background: #ffffff;
  color: var(--tx);
  cursor: pointer;
  font: inherit;
}

.icon-btn.danger { color: #b91c1c; }
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper b { min-width: 1.2em; text-align: center; font-weight: 650; }

.empty-note { color: var(--tx-muted); font-size: 14px; margin: 4px 0 8px; }

.text-btn {
  display: inline-block;
  margin-top: 6px;
  padding: 6px 0;
  border: 0;
  background: none;
  color: var(--ac-text);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  text-align: left;
}

.text-btn:hover { text-decoration: underline; }
.text-btn.danger { color: #b91c1c; text-decoration: none; }
.text-btn.edit-section { letter-spacing: .04em; font-size: 13px; }

.picker-panel {
  margin-top: 8px;
  padding: 10px;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  background: #ffffff;
}

.picker-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 240px;
  overflow: auto;
  margin-top: 8px;
}

.picker-list button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  font: inherit;
  color: var(--tx);
  background: transparent;
  border: 0;
  border-radius: 8px;
  padding: 6px 8px;
  cursor: pointer;
}

.picker-list button:hover { background: rgba(16, 185, 129, .15); }
.picker-list img { width: 28px; height: 22px; object-fit: contain; }

.share-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 28px;
  padding: 14px 0 8px;
  background: linear-gradient(rgba(255, 255, 255, 0), var(--card) 28%);
}

.save-status { color: #047857; font-size: 13px; }

.checklist-card {
  position: sticky;
  top: 74px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 16px;
}

.checklist-card h2 { font-size: 18px; margin-bottom: 8px; }
.checklist-card > p { color: var(--tx-muted); font-size: 14px; }

.check-list { list-style: none; margin-top: 8px; }
.check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 0;
  border: 0;
  background: none;
  color: var(--tx-muted);
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}

.check-item .dot {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  border-radius: 50%;
  border: 2px solid var(--card-border);
}

.check-item.done { color: var(--tx); }
.check-item.done .dot {
  background: var(--ac);
  border-color: var(--ac);
  box-shadow: inset 0 0 0 3px #c8e8e9;
}

.guide-dialog {
  width: min(520px, calc(100% - 24px));
  background: var(--card);
  color: var(--tx);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 18px;
}

.guide-dialog::backdrop { background: rgba(2, 6, 23, .72); }
.guide-dialog h2 { margin-bottom: 8px; }
.guide-dialog li { margin: 8px 0 8px 18px; color: var(--tx-muted); }
.guide-dialog li strong { color: var(--tx); }

.preview-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
}

.preview-bar .draft-pill { margin: 0; }
.preview-cover {
  width: 100%;
  max-height: 380px;
  object-fit: cover;
  border-radius: 14px;
  margin-bottom: 16px;
  background: #ffffff;
}

.preview h1 { font-size: 32px; margin-bottom: 6px; }
.preview section { margin-top: 22px; }
.preview h2 { font-size: 18px; margin-bottom: 8px; }
.preview-pre {
  white-space: pre-wrap;
  background: #f7f9f9;
  border-radius: 12px;
  padding: 12px 14px;
  overflow-x: auto;
}

.preview a { color: #047857; }
.block-list { display: flex; flex-direction: column; gap: 8px; }
.block-list p { color: var(--tx-muted); }

@media (max-width: 860px) {
  .share-layout { grid-template-columns: 1fr; }
  .checklist-card { position: static; }
  .share-title { font-size: 22px; }
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px 22px;
}
.project-card {
  display: block;
  text-decoration: none;
  color: inherit;
  /* a white card on the grey page, like Project Hub */
  padding: 10px 10px 12px;
  border: 1px solid var(--card-border);
  border-radius: 14px;
  background: var(--card);
  transition: box-shadow .15s, border-color .15s;
}
.project-card:hover { border-color: #b9c9c9; box-shadow: 0 6px 18px rgba(23, 30, 33, .08); }
.project-card h2 {
  font-size: 18px;
  line-height: 1.35;
  letter-spacing: -0.02em;
  margin: 10px 0 4px;
}
.card-photo, .card-art {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 10px;
  display: block;
}
.card-photo { object-fit: cover; background: #f7f9f9; }
.card-art {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  overflow: hidden;
}
.card-art img { height: 68%; width: auto; max-width: 46%; object-fit: contain; }
.tone-blue { background: radial-gradient(circle at 50% 42%, #1d4ed8, #f7f9f9 72%); }
.tone-board { background: linear-gradient(180deg, #f8fafc, #dbe4ea); }
.tone-dark { background: radial-gradient(circle at 70% 40%, #134e4a, #020617 70%); }
.tone-paper { background: #f4f1ea; }
.project-by { color: var(--tx-muted); font-size: 14px; }
.project-by span { color: #0f766e; font-weight: 650; }
.project-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 8px;
  color: var(--tx-muted);
  font-size: 13px;
}
.project-stats span { display: inline-flex; align-items: center; gap: 5px; }
.project-stats svg { flex: 0 0 auto; }
.hub-back { margin: 0 0 12px; }
.hub-back a { color: var(--tx-muted); text-decoration: none; }
.hub-back a:hover { color: var(--tx); }

.hub-switch { display: flex; gap: 10px; overflow: auto; margin-bottom: 18px; }
.hub-pick {
  flex: 0 0 240px;
  display: block;
  text-decoration: none;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--card-border);
  background: var(--card);
}
.hub-pick strong { display: block; font-size: 14px; }
.hub-pick span { color: var(--tx-muted); font-size: 12px; }
.hub-pick.on { border-color: var(--ac); }

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

.hub-cover {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  min-height: 220px;
  margin-bottom: 16px;
  padding: 18px;
  border-radius: 16px;
  background:
    radial-gradient(420px 180px at 20% 20%, rgba(0, 151, 157, .35), transparent 70%),
    #f7f9f9;
  border: 1px solid var(--card-border);
}
.hub-cover img.photo { width: 100%; max-height: 360px; object-fit: cover; border-radius: 12px; }
.hub-cover img.part { width: 180px; height: 120px; object-fit: contain; }

.hub-kicker { color: var(--tx-muted); margin: 8px 0 12px; }
.hub-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--tx-muted);
  font-size: 14px;
  margin-bottom: 22px;
}
.hub-meta button {
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  padding: 0;
}
.hub-meta button.on { color: #047857; font-weight: 700; }

.hub-section { margin: 26px 0; scroll-margin-top: 84px; }
.hub-section h2 { font-size: 20px; margin-bottom: 10px; }
.bom-row, .soft-row {
  display: grid;
  grid-template-columns: 52px 36px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--card-border);
}
.soft-row { grid-template-columns: 52px minmax(0, 1fr); }
.bom-thumb {
  width: 52px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid var(--card-border);
  overflow: hidden;
  color: var(--tx-muted);
  font-weight: 700;
}
.bom-thumb img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.bom-row b { font-weight: 650; }

.prose p { margin: 0 0 12px; color: #171e21; }
.prose ul { margin: 0 0 12px 18px; color: #171e21; }
.prose li { margin: 4px 0; }
.prose code {
  font-family: Consolas, "Fira Code", monospace;
  font-size: .92em;
  background: #f7f9f9;
  border-radius: 4px;
  padding: 0 4px;
}

.code-panel {
  border: 1px solid var(--card-border);
  border-radius: 12px;
  background: #0b1220;
  overflow: auto;
}
.code-panel header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  color: var(--tx-muted);
  font-size: 13px;
  border-bottom: 1px solid var(--card-border);
}
.code-caption { margin: 8px 0; color: var(--tx-muted); }
ol.code-lines {
  margin: 0;
  padding: 10px 16px 14px 52px;
  font-family: Consolas, "Fira Code", monospace;
  font-size: 13px;
  line-height: 1.6;
}
ol.code-lines li::marker { color: #64748b; }
ol.code-lines code { font-family: inherit; }

.comment-form, .comment {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  margin: 12px 0;
}
.comment-form form, .comment-body { min-width: 0; }
.comment-form form { display: flex; gap: 8px; }
.comment-form input[type="text"] {
  flex: 1;
  min-width: 0;
  font: inherit;
  color: var(--tx);
  background: #ffffff;
  border: 1px solid var(--card-border);
  border-radius: 999px;
  padding: 8px 12px;
}
.comment header { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.comment header b { font-size: 14px; }
.comment header span, .comment .reply { color: var(--tx-muted); font-size: 13px; }
.comment p { margin: 4px 0; }
.comment a { color: #047857; }
.replies { margin-left: 52px; }
.reply-note { color: #047857; font-size: 13px; margin-bottom: 6px; }

.hub-side { position: sticky; top: 74px; display: flex; flex-direction: column; gap: 12px; }
.author-card, .toc-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 16px;
}
.author-card { text-align: center; }
.author-card .avatar {
  width: 72px;
  height: 72px;
  margin: 0 auto 8px;
  font-size: 28px;
  cursor: default;
}
.author-card h2 { font-size: 18px; margin-bottom: 4px; }
.author-card p { color: var(--tx-muted); font-size: 14px; }
.toc-card h2 { font-size: 16px; margin-bottom: 8px; }
.toc-card a { display: block; text-decoration: none; padding: 5px 0; color: var(--tx-muted); }
.toc-card a:hover { color: var(--tx); }
.hub-counts { display: flex; gap: 16px; color: var(--tx-muted); font-size: 13px; }
.hub-counts b { display: block; color: var(--tx); font-size: 20px; }
.draft-banner { margin-bottom: 12px; }

@media (max-width: 980px) {
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .hub-layout { grid-template-columns: 1fr; }
  .hub-side { position: static; }
}
@media (max-width: 640px) {
  .project-grid { grid-template-columns: 1fr; }
}

/* an opened Gallery post that can run in the simulator */
.hub-try { margin: 6px 0 14px; }

/* ===== Post page: code with colours, a file header, Copy / Download; tags; contents ===== */
.code-panel header { align-items: center; background: #111a2e; }
.code-file { color: #e2e8f0; font-weight: 600; }
.code-actions { display: flex; align-items: center; gap: 8px; }
.code-lang { padding: 2px 8px; border-radius: 999px; background: rgba(148, 163, 184, .16); font-size: 12px; }
/* the code box keeps its dark header, so its buttons are light on dark */
.code-btn { padding: 4px 10px; border-radius: 6px; border: 1px solid #3b4a63; background: rgba(255, 255, 255, .08); color: #e2e8f0; font: inherit; font-size: 12px; cursor: pointer; }
.code-btn:hover { border-color: #34d399; color: #6ee7b7; }
.code-caption-in { margin: 0; padding: 8px 14px; border-bottom: 1px solid var(--card-border); font-size: 13px; }
ol.code-lines code { color: #d4d4d4; white-space: pre; }
.tk-com { color: #6a9955; font-style: italic; }
.tk-str { color: #ce9178; }
.tk-num { color: #b5cea8; }
.tk-pre { color: #c586c0; }
.tk-kw { color: #569cd6; }
.tk-type { color: #4ec9b0; }
.tk-const { color: #4fc1ff; }
.tk-obj { color: #9cdcfe; }
.tk-fn { color: #dcdcaa; }
.hub-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.hub-tag { padding: 3px 10px; border-radius: 999px; border: 1px solid rgba(52, 211, 153, .45); color: #047857; font-size: 12px; font-weight: 600; }
.prose h3 { margin: 18px 0 6px; font-size: 17px; scroll-margin-top: 80px; }
.toc-card a.toc-sub { padding-left: 14px; font-size: 13px; }

/* ===== Gallery: bigger card pictures (two per row on a wide screen); circuit photos fill them ===== */
.project-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)) !important; gap: 26px !important; }
.card-photo { aspect-ratio: 5 / 3; object-fit: cover; object-position: center; border: 1px solid var(--card-border); background: #ecf1f1; }
.project-card:hover .card-photo, .project-card:hover .card-art { border-color: #34d399; box-shadow: 0 0 0 2px rgba(52, 211, 153, .35); }
.hub-cover:has(img.photo) { padding: 0; min-height: 0; overflow: hidden; background: #ecf1f1; }
.hub-cover img.photo { display: block; width: 100%; max-height: 460px; object-fit: contain; border-radius: 0; }

/* ===== Gallery list: banner, filters, count and sort, level badges, pages ===== */
.gal-hero { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin: 0 0 18px; padding: 22px 24px; border-radius: 16px; border: 1px solid var(--card-border);
  background: radial-gradient(520px 200px at 85% 20%, rgba(16, 185, 129, .25), transparent 70%), #ffffff; }
.gal-hero h2 { font-size: 24px; margin: 2px 0 6px; }
.gal-hero p { margin: 0; color: var(--tx-muted); }
.gal-kicker { color: #047857 !important; font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.gal-filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.gal-filters input, .gal-filters select, .gal-bar select { font: inherit; font-size: 14px; color: var(--tx); background: #ffffff; border: 1px solid var(--card-border); border-radius: 10px; padding: 9px 12px; }
.gal-filters input { flex: 1 1 240px; min-width: 0; }
.gal-bar { display: flex; justify-content: space-between; align-items: center; margin: 4px 0 16px; color: var(--tx-muted); font-size: 14px; }
.gal-bar label { display: flex; align-items: center; gap: 8px; }
.card-pic { position: relative; display: block; }
.card-level { position: absolute; left: 10px; top: 10px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: rgba(255, 255, 255, .85); }
.lv-beginner { color: #047857; } .lv-intermediate { color: #a16207; } .lv-advanced { color: #b91c1c; }
.gal-pages { display: flex; justify-content: center; align-items: center; gap: 16px; margin: 26px 0 8px; color: var(--tx-muted); }
.gal-pages .btn[disabled] { opacity: .4; cursor: default; }
/* ===== Post: share row and Report ===== */
.share-row { display: flex; align-items: center; gap: 4px; margin: 2px 0 10px; color: #5d6a6b; }
.share-btn { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; border: none; background: none; color: inherit; cursor: pointer; text-decoration: none; }
.share-btn:hover { background: rgba(148, 163, 184, .14); color: #171e21; }
.share-btn.fb:hover { color: #60a5fa; } .share-btn.in:hover { color: #0369a1; }
.share-btn.on { color: #b91c1c; }
.share-sep { width: 1px; height: 22px; margin: 0 10px; background: rgba(148, 163, 184, .35); }
.share-note { margin-left: 8px; font-size: 13px; color: #047857; }
.report-box { display: grid; gap: 6px; max-width: 420px; margin: 0 0 14px; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--card-border); background: #f7f9f9; }
.report-box[hidden] { display: none; }
.report-box p { margin: 0 0 4px; color: var(--tx-muted); font-size: 14px; }
.report-box label { font-size: 14px; }
.report-box input[type="text"] { font: inherit; font-size: 14px; color: var(--tx); background: #ffffff; border: 1px solid var(--card-border); border-radius: 8px; padding: 8px 10px; }
.report-actions { display: flex; gap: 8px; margin-top: 4px; }

/* ===== Gallery: three smaller cards per row ===== */
.project-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)) !important; gap: 20px !important; }
.project-card h2 { font-size: 16px; }
.card-photo { aspect-ratio: 16 / 10; }
/* ===== pictures inside a post's description ===== */
.desc-pic { margin: 10px 0 14px; padding: 14px; border-radius: 12px; border: 1px solid var(--card-border); background: linear-gradient(160deg, #f8fafc, #dbe3ee); text-align: center; }
.desc-pic img { display: block; max-width: min(100%, 360px); max-height: 200px; margin: 0 auto; object-fit: contain; }
.desc-pic figcaption { margin-top: 8px; color: #334155; font-size: 13px; }

/* ===== Post: parts in two columns; long code folded to the first lines ===== */
.bom-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 28px; }
@media (max-width: 640px) { .bom-grid { grid-template-columns: 1fr; } }
.code-body { position: relative; }
.code-body.folded { max-height: 360px; overflow: hidden; }
.code-body.folded::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 90px; background: linear-gradient(rgba(255, 255, 255, 0), #f7f9f9); pointer-events: none; }
.code-more { display: block; width: 100%; padding: 10px; border: none; border-top: 1px solid var(--card-border); background: #f7f9f9; color: #047857; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.code-more:hover { background: #16223a; }

/* ===== A light reading page for posts (the site header and the code box stay dark) ===== */
body.read-light { background: var(--bg); }
body.read-light main.share-shell {
  color: var(--tx);
}
/* the article is the white part you read, beside the white side cards */
.hub-layout > div:first-child { padding: 26px 30px; border: 1px solid var(--card-border); border-radius: 14px; background: var(--card); }
@media (max-width: 700px) { .hub-layout > div:first-child { padding: 18px 16px; } }
body.read-light .hub-back a { color: #0f766e; }
body.read-light .hub-cover { border-color: #e2e8f0; }
body.read-light .bom-thumb, body.read-light .soft-row .bom-thumb { background: #f1f5f9; border-color: #e2e8f0; }
body.read-light .prose code { background: #eef2f6; color: #0f172a; }
body.read-light .prose a { color: #0f766e; }
body.read-light .hub-tag { color: #047857; border-color: #6ee7b7; background: #ecfdf5; }
body.read-light .share-row { color: #64748b; }
body.read-light .share-btn:hover { background: #e2e8f0; color: #0f172a; }
body.read-light .share-note { color: #047857; }
body.read-light .report-box { background: #ffffff; }
body.read-light .report-box input[type="text"], body.read-light .comment-form input { background: #ffffff; color: #1e293b; border-color: #cbd5e1; }
body.read-light .author-card, body.read-light .toc-card { box-shadow: 0 4px 14px rgba(15, 23, 42, .06); }
body.read-light .desc-pic { border-color: #e2e8f0; }
/* the code box stays dark, with its own light text */
body.read-light .code-panel { --tx: #e2e8f0; --tx-muted: #94a3b8; --card-border: #1f2a40; color: #e2e8f0; border-color: #1f2a40; }
/* who made it */
.hub-by { margin: -4px 0 10px; color: var(--tx-muted); font-size: 14px; }
.hub-by b { color: var(--tx); font-weight: 600; }
.team-card h2 { font-size: 16px; margin-bottom: 10px; }
.team-card ul { list-style: none; display: grid; gap: 10px; text-align: left; }
.team-card li { display: flex; align-items: center; gap: 10px; }
.team-card li .avatar { width: 34px; height: 34px; font-size: 15px; flex: none; }
.team-card li small { display: block; color: var(--tx-muted); font-size: 12px; }
body.read-light .prose p, body.read-light .prose ul { color: #1e293b; }
.team-card { text-align: left; }
.team-card h2 { text-align: center; }
.team-card li .avatar { margin: 0; }
.team-card li > span:last-child { min-width: 0; }

/* New project: add your own part when it is not in the list */
.picker-hint { margin: 6px 2px 4px; font-size: 13px; color: var(--tx-muted); }
.picker-list button.add-own { flex-wrap: wrap; border: 1px dashed rgba(52, 211, 153, .6); background: rgba(16, 185, 129, .1); color: #047857; font-weight: 700; }
.picker-list button.add-own small { flex-basis: 100%; font-weight: 400; font-size: 12px; color: var(--tx-muted); }

/* the form's circuit choice, and the note next to the post's simulator button */
.sim-pick { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; font-weight: 600; font-size: 14px; }
.sim-pick select { font: inherit; font-weight: 400; color: var(--tx); background: #ffffff; border: 1px solid var(--card-border); border-radius: 8px; padding: 8px 10px; max-width: 420px; }
.hub-try-note { margin-left: 8px; font-size: 13px; color: var(--tx-muted); }

/* The link between a post and the ready simulation it runs */
.hub-sim-link { margin: -6px 0 14px; font-size: 14px; color: var(--tx-muted); }
.hub-sim-link b { color: var(--tx); }
.hub-sim-link a { color: #0f766e; font-weight: 600; text-decoration: none; }
.hub-sim-link a:hover { text-decoration: underline; }
body.read-light .hub-sim-link { color: #475569; }
body.read-light .hub-sim-link b { color: #0f172a; }
body.read-light .hub-sim-link a { color: #0f766e; }
.card-sim { margin: 2px 0 0; font-size: 13px; font-weight: 600; color: #047857; }
.gal-sim-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 0 0 12px; padding: 10px 14px; border: 1px solid rgba(16, 185, 129, .45); border-radius: 12px; background: rgba(16, 185, 129, .08); font-size: 14px; }
.gal-sim-filter span { margin-right: auto; }
.gal-sim-filter a { color: #047857; font-weight: 600; text-decoration: none; }
.gal-sim-filter a:hover { text-decoration: underline; }

/* Pictures in the description: the upload button and part menu, and an uploaded photo */
.desc-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-top: 10px; }
.desc-tools .text-btn { cursor: pointer; }
.desc-part { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--tx-muted); }
.desc-part select { font: inherit; color: var(--tx); background: #ffffff; border: 1px solid var(--card-border); border-radius: 8px; padding: 6px 10px; }
.desc-photo { padding: 0; overflow: hidden; background: #ffffff; }
.desc-photo img { max-width: 100%; max-height: 460px; width: auto; }
.desc-photo figcaption { margin: 0; padding: 8px 12px; background: #f8fafc; }

/* Project Description: the short guide above the box, and a big box to write in */
.desc-guide { margin: 4px 0 12px; padding: 10px 14px 10px 32px; border: 1px solid var(--card-border); border-radius: 10px; background: rgba(255, 255, 255, .5); font-size: 14px; color: var(--tx-muted); }
.desc-guide li + li { margin-top: 4px; }
.desc-guide b { color: var(--tx); }
.desc-guide code { font-size: 12.5px; padding: 1px 5px; border-radius: 4px; background: #ffffff; color: #047857; }
.share-editor textarea.desc-box { min-height: 380px; line-height: 1.55; font-size: 15px; }

/* Simulation: the choices for what "Try it in the simulator" opens */
.sim-choices { display: grid; gap: 10px; margin-top: 10px; }
.sim-choice { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--card-border); border-radius: 12px; background: rgba(255, 255, 255, .5); cursor: pointer; }
.sim-choice.on { border-color: #10b981; background: rgba(16, 185, 129, .08); }
.sim-choice input[type="radio"] { margin-top: 3px; accent-color: #10b981; }
.sim-choice > span { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; }
.sim-choice small { color: var(--tx-muted); font-size: 13px; }
.sim-choice select { font: inherit; color: var(--tx); background: #ffffff; border: 1px solid var(--card-border); border-radius: 8px; padding: 8px 10px; max-width: 420px; }
.sim-choice select:disabled { opacity: .6; }
.sim-design { cursor: default; border-style: dashed; padding-left: 40px; }
.sim-design .btn { align-self: flex-start; }
.sim-none { padding-top: 10px; padding-bottom: 10px; }
.sim-attached { margin: 12px 2px 0; font-size: 14px; color: #047857; }
.sim-attached:empty { display: none; }
.sim-attached a { color: #0f766e; font-weight: 600; }

/* the author's Edit button beside "Project Gallery" on their own post */
.hub-back { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.hub-edit { padding: 6px 14px; font-size: 14px; }
body.read-light .hub-edit { color: #0f766e; border-color: #99f6e4; background: #fff; }
body.read-light .hub-edit:hover { background: #f0fdfa; }

/* Delete post (only while editing a published post), and the note after it */
.danger-btn { margin-left: auto; background: transparent; color: #b91c1c; border: 1px solid #fca5a5; }
.danger-btn:hover { background: rgba(239, 68, 68, .12); color: #b91c1c; border-color: #ef4444; }
.danger-btn[hidden] { display: none; }
.gal-deleted { margin: 0 0 12px; padding: 10px 14px; border-radius: 10px; border: 1px solid #fca5a5; background: rgba(239, 68, 68, .1); color: #b91c1c; font-size: 14px; }

/* Light theme: the share form is the white part you work in */
.share-editor { padding: 24px 26px; border: 1px solid var(--card-border); border-radius: 14px; background: var(--card); }

/* The share form, opened from a Classroom assignment */
.assign-for { margin: 0 0 16px; padding: 12px 14px; border-radius: 12px; border: 1px solid #c4b5fd; background: #f5f3ff; font-size: 14px; }
.assign-for p { margin: 0 0 6px; }
.assign-for-note { color: #4c1d95; }
.assign-for .checkline { font-weight: 600; }

.hub-handed { margin: -4px 0 12px; padding: 8px 12px; border-radius: 10px; background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; font-weight: 600; font-size: 14px; }

/* ===== Admins: changing posts on the website ===== */
.hub-admin { display: inline-flex; flex-wrap: wrap; gap: 8px; }
.hub-edit.danger { color: #b91c1c; border-color: #fca5a5; }
.hub-admin-note { margin: 0 0 12px; padding: 8px 12px; border-radius: 10px; border: 1px dashed #f59e0b; background: rgba(245, 158, 11, .1); color: #92400e; font-size: 14px; }
.card-hidden { position: absolute; right: 10px; top: 10px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: #92400e; color: #fff; }
.team-box { margin: 0 0 14px; padding: 12px 14px; border-radius: 12px; border: 1px dashed #14b8a6; background: rgba(20, 184, 166, .08); }
.team-box[hidden], .team-fields[hidden] { display: none; }
.team-fields { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; margin-top: 10px; }
.team-fields label { display: grid; gap: 4px; font-size: 13px; }
.team-fields input { padding: 7px 10px; border-radius: 8px; border: 1px solid var(--card-border, #cbd5e1); background: transparent; color: inherit; font: inherit; }
