:root {
  color-scheme: dark;
  --bg: #111318; --panel: #191c23; --panel2: #1f232c; --border: #303541;
  --text: #f4f6fb; --muted: #b9c0cc; --accent: #c5f36a; --danger: #ff6b6b;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; } /* author display rules (.gcard flex, .ggrid grid) must not beat the hidden attribute */
body { margin: 0; background: var(--bg); color: var(--text); min-height: 100vh;
  display: flex; flex-direction: column; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { color: var(--accent); font-size: .9em; }

.topbar { display: flex; align-items: center; justify-content: space-between;
  padding: 16px 28px; border-bottom: 1px solid var(--border); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 22px;
  letter-spacing: -.04em; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark { width: 30px; height: 30px; display: block; }
.org-logo { display: inline-flex; align-items: center; }
.org-logo img { height: 36px; max-width: 200px; width: auto; object-fit: contain; display: block; }
.branding-row { display: flex; gap: 22px; align-items: flex-start; flex-wrap: wrap; }
.branding-preview { flex: 0 0 200px; min-height: 72px; display: flex; align-items: center; justify-content: center;
  background: var(--panel2); border: 1px dashed var(--border); border-radius: 12px; padding: 12px; }
.branding-preview img { max-height: 72px; max-width: 100%; object-fit: contain; }
.branding-form { flex: 1 1 280px; }
.status-admin { background: #1a2436; color: #a9d8ff; }
.card h3.mt { margin-top: 26px; }
.nav { display: flex; align-items: center; gap: 18px; }
.nav .who { color: var(--muted); font-size: 14px; }
.nav .slug { color: var(--accent); }
.link { background: none; border: none; color: var(--muted); cursor: pointer; font: inherit; }
.link:hover { color: var(--text); }

.wrap { width: min(1040px, calc(100% - 48px)); margin: 28px auto; flex: 1; }
.foot { border-top: 1px solid var(--border); padding: 18px 28px; color: var(--muted);
  font-size: 12px; line-height: 1.5; }

.flash { width: min(1040px, calc(100% - 48px)); margin: 16px auto -6px; padding: 12px 16px;
  border-radius: 12px; font-size: 14px; }
.flash-success { background: #1c2a17; border: 1px solid #3c5a2a; color: #d4f5b6; }
.flash-error { background: #2a1717; border: 1px solid #5a2a2a; color: #ffc9c9; }
.flash-info { background: var(--panel2); border: 1px solid var(--border); }

.hero { text-align: center; padding: 8vh 0; }
.hero h1 { display: flex; align-items: center; justify-content: center; gap: .16em;
  font-size: clamp(46px, 9vw, 82px); letter-spacing: -.06em; margin: 0 0 8px; }
.hero-mark { width: 1.05em; height: 1.05em; display: block; }
.tagline { font-size: clamp(18px, 3vw, 24px); font-weight: 600; letter-spacing: -.02em; margin: 0 0 20px; }
.lede { color: var(--muted); font-size: 18px; max-width: 520px; margin: 0 auto 28px; line-height: 1.6; }

.card { background: var(--panel); border: 1px solid var(--border); border-radius: 18px;
  padding: 22px; margin-bottom: 18px; }
.card h3 { margin-top: 0; }
.dev-card { max-width: 460px; margin: 0 auto; text-align: left; }
.badge { display: inline-block; background: #3a2a12; color: #ffcf8f; border-radius: 8px;
  padding: 2px 10px; font-size: 12px; font-weight: 700; }
.center { text-align: center; max-width: 520px; margin: 6vh auto; }

.btn { display: inline-block; background: var(--panel2); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px; padding: 8px 14px; cursor: pointer;
  font: inherit; font-size: 14px; }
.btn:hover { border-color: #4a5162; text-decoration: none; }
.btn.primary { background: var(--accent); color: #10130a; border-color: var(--accent); font-weight: 700; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.big { font-size: 16px; padding: 12px 22px; }
.btn.danger:hover { border-color: var(--danger); color: var(--danger); }
.inline { display: inline; }

.stack { display: flex; flex-direction: column; gap: 14px; }
.stack label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600;
  letter-spacing: .01em; color: var(--muted); }
.stack input[type=text], .stack input[type=email], .stack input[type=password],
.stack input[type=number], .stack input[type=url], .stack select, .stack textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; font: inherit; font-size: 15px; color: var(--text); transition: border-color .12s, box-shadow .12s; }
.stack input:focus, .stack select:focus, .stack textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(197, 243, 106, .18); }
.stack input::placeholder { color: #6b7280; }
/* The submit button reads as the primary action: full width, comfortable hit area. */
.stack > .btn.primary { width: 100%; padding: 12px; font-size: 15px; margin-top: 4px; }
.check { flex-direction: row !important; align-items: center; gap: 8px !important;
  font-weight: 500 !important; }

/* Auth screens (login / reset / forgot / request): a tidy centered card instead
   of a full-width strip, with left-aligned form fields. */
.hero .card { max-width: 420px; margin-left: auto; margin-right: auto; text-align: left; padding: 26px; }
.hero .or-sep { max-width: 420px; margin: 6px auto; }
.hero .muted { max-width: 420px; margin-left: auto; margin-right: auto; }

.cols { display: grid; grid-template-columns: 1fr 340px; gap: 24px; }
@media (max-width: 820px) { .cols { grid-template-columns: 1fr; } }
/* Admin: "Add a user" + "Branding" side by side on desktop, equal-height cards. */
.admin-pair { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 24px; }
.admin-pair > div { display: flex; flex-direction: column; min-width: 0; }
.admin-pair > div > .card { flex: 1; }
@media (max-width: 820px) { .admin-pair { grid-auto-flow: row; } }
.projects { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; }
.project { background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 16px 18px; }
.project-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.route { color: var(--muted); }
.pill { background: var(--panel2); border: 1px solid var(--border); border-radius: 20px;
  padding: 2px 10px; font-size: 12px; color: var(--muted); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.team { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.muted { color: var(--muted); }

.grid { width: 100%; border-collapse: collapse; margin-bottom: 26px; font-size: 14px; }
.grid th, .grid td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.grid th { color: var(--muted); font-weight: 600; }
.status { border-radius: 8px; padding: 2px 8px; font-size: 12px; }
.status-active { background: #1c2a17; color: #d4f5b6; }
.status-disabled { background: #2a1717; color: #ffc9c9; }
.status-denied { background: #2a1717; color: #ffc9c9; }

/* File manager */
.crumbs { margin: 8px 0 18px; color: var(--muted); font-size: 14px; }
.crumbs a { color: var(--accent); }
.filemgr { display: flex; flex-direction: column; gap: 16px; }
.dropzone { border: 2px dashed var(--border); border-radius: 16px; padding: 28px;
  text-align: center; background: var(--panel); transition: border-color .15s, background .15s; }
.dropzone.dragging { border-color: var(--accent); background: #1b1f27; }
.dropzone code { color: var(--accent); }
.dropzone label.btn { cursor: pointer; }
.inline-form { display: flex; gap: 8px; align-items: center; }
.inline-form input[type=text] { background: var(--bg); border: 1px solid var(--border);
  border-radius: 10px; padding: 8px 12px; color: var(--text); font: inherit; }
.grid.files td { vertical-align: middle; }
.grid.files td:first-child { font-size: 15px; }
.filetitle { word-break: break-all; }
.filecontent { background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  padding: 18px; overflow-x: auto; white-space: pre; font-family: ui-monospace, SFMono-Regular,
  Menlo, Consolas, monospace; font-size: 13px; line-height: 1.5; color: #e6e9f0; }
.fileedit { width: 100%; box-sizing: border-box; background: var(--panel);
  border: 1px solid var(--border); border-radius: 12px; padding: 18px; color: #e6e9f0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px;
  line-height: 1.5; white-space: pre; overflow-wrap: normal; resize: vertical; tab-size: 4; }

/* Sharing controls */
.sharing { display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.vis-badge { font-size: 12px; padding: 2px 10px; border-radius: 20px; border: 1px solid var(--border); }
.vis-public { color: #ffcf8f; border-color: #5a4a2a; }
.vis-private { color: var(--muted); }
.btn.small { font-size: 12px; padding: 5px 10px; }
.share-url { flex: 1; min-width: 200px; background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 10px; color: var(--accent); font-family: ui-monospace, monospace;
  font-size: 12px; }
.vis-team { color: #9ec5ff; border-color: #2a4a5a; }
.vis-set { display: inline-flex; gap: 4px; }
.btn.small.current { background: var(--accent); color: #10130a; border-color: var(--accent);
  cursor: default; font-weight: 700; }

/* Project card ... overflow menu: a link, then labeled sections split by dividers */
.actions .menu { position: relative; display: inline-block; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-toggle { padding: 8px 12px; font-weight: 700; letter-spacing: 1px; line-height: 1; }
.menu[open] > summary.menu-toggle { border-color: #4a5162; }
.menu-items { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30;
  background: var(--panel2); border: 1px solid var(--border); border-radius: 12px;
  padding: 10px; width: 280px; max-width: calc(100vw - 32px); display: flex; flex-direction: column;
  gap: 10px; box-shadow: 0 14px 44px #000a; }
.menu-btn { width: 100%; text-align: left; }
.menu-section { display: flex; flex-direction: column; gap: 6px; padding-top: 10px;
  border-top: 1px solid var(--border); }
.menu-section form { margin: 0; }
.menu-label { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.menu-row { display: flex; gap: 6px; }
.menu-row input { flex: 1; min-width: 0; background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 5px 10px; color: var(--text); font: inherit; font-size: 12px; }
.menu-row input:focus { outline: none; border-color: var(--accent); }
.menu-row input::placeholder { color: #6b7280; }
.menu-split { flex-direction: row; }
.menu-split form { flex: 1; }
.menu-split .menu-btn { text-align: center; }
.collab-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 13px; }
.collab-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.collab-row .x { padding: 1px 7px; line-height: 1.2; }

/* Integrations sidebar */
.integration { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.int-name { font-weight: 600; }
.int-status { font-size: 12px; color: var(--muted); }
.int-status.connected { color: #d4f5b6; }
.int-hint { font-size: 12px; margin: 6px 0 14px; }
.int-hint code { font-size: 11px; }

.pill.owner { opacity: .85; }

/* Project folders (dashboard grouping) */
.projects-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.projects-bar .menu { position: relative; }
.projects-tools { display: flex; align-items: center; gap: 6px; }
.search-toggle { line-height: 1; padding: 5px 8px; }
.project-filter { width: 170px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  padding: 5px 10px; color: var(--text); font: inherit; font-size: 12px; }
.project-filter[hidden] { display: none; }
.filter-none[hidden] { display: none; }
.filtered-out { display: none !important; }
/* Grouped layout (any folders): each folder, plus "Unfiled", is a collapsible
   card of compact project rows. With no folders the plain card list is used. */
.foldered .projects-title h2 { margin: 0; }
.projects-sub { margin: 4px 0 0; font-size: 14px; }
.foldered { min-width: 0; }
.foldered .projects-bar { margin-bottom: 20px; align-items: flex-start; flex-wrap: wrap; }
.ico { width: 16px; height: 16px; flex: none; display: block; }
/* Square icon buttons in the grouped-layout header (search, new folder). */
.btn.icon-btn { width: 34px; height: 34px; padding: 0; display: inline-grid; place-items: center; color: var(--text); }
.btn.icon-btn .ico { width: 16px; height: 16px; }
.btn.icon-btn:hover, .menu[open] > summary.icon-btn, .icon-btn[aria-expanded="true"] { border-color: #4a5162; }
.projects-tools { gap: 8px; }
.project-filter { height: 34px; font-size: 13px; }
.folder { background: var(--panel); border: 1px solid var(--border); border-radius: 16px; }
.folder-head { display: flex; align-items: center; gap: 12px; padding: 16px 16px 16px 18px; }
.folder:not(.collapsed) > .folder-head { border-bottom: 1px solid var(--border); }
.folder-head { position: relative; }
.folder-handle { position: absolute; left: 3px; top: 50%; transform: translateY(-50%); margin: 0;
  opacity: 0; transition: opacity .12s; }
.folder-head:hover .folder-handle { opacity: 1; }
.folder.dragging { opacity: .45; }
/* While a project is dragged out of a folder: a drop strip under the top-level
   list (the ::after is part of the ul, so drops there land at the end). */
.dragging-out ul.sortable.top { position: relative; padding-bottom: 66px; }
.dragging-out ul.sortable.top::after { content: 'Drop here to take it out of the folder'; position: absolute;
  left: 0; right: 0; bottom: 0; height: 52px; display: grid; place-items: center; color: var(--muted);
  font-size: 13px; border: 2px dashed var(--border); border-radius: 16px; }
.folder-head .menu { position: relative; }
.folder-toggle { flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; background: none; border: none;
  color: var(--text); font: inherit; text-align: left; cursor: pointer; padding: 0; }
.folder-toggle .caret { color: var(--muted); display: inline-flex; width: 22px; justify-content: center; transition: transform .15s; }
.folder.collapsed .caret { transform: rotate(-90deg); }
/* Folder colors: .fc-<key> sets --fc (icon/initials) and --fc-bg (tile). Keys
   mirror ProjectRepository::FOLDER_COLORS. */
.fc-amber  { --fc: #f5a623; --fc-bg: #2d2214; }
.fc-green  { --fc: #8bd96a; --fc-bg: #1c2a17; }
.fc-teal   { --fc: #4fd1c5; --fc-bg: #142a29; }
.fc-blue   { --fc: #6ea8ff; --fc-bg: #162238; }
.fc-purple { --fc: #b49cff; --fc-bg: #231b3a; }
.fc-pink   { --fc: #f478b8; --fc-bg: #321a28; }
.fc-red    { --fc: #ff7a6b; --fc-bg: #331b19; }
.fc-gray   { --fc: #b9c0cc; --fc-bg: #262a33; }
.folder-icon { width: 44px; height: 44px; border-radius: 12px; flex: none; display: grid; place-items: center;
  background: var(--fc-bg, #2d2214); color: var(--fc, #f5a623); }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.swatch { width: 26px; height: 26px; border-radius: 8px; padding: 0; cursor: pointer;
  background: var(--fc); border: 2px solid var(--panel2); box-shadow: 0 0 0 1px var(--border); }
.swatch:hover { box-shadow: 0 0 0 2px var(--fc); }
.swatch.current { box-shadow: 0 0 0 2px var(--text); }
.folder-icon .ico { width: 20px; height: 20px; }
.folder-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.folder-name { font-weight: 700; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-sub { color: var(--muted); font-size: 13px; }
.folder-peek { display: none; }
.folder.collapsed .folder-peek { display: flex; }
.folder-peek span { width: 26px; height: 30px; margin-left: -4px; border-radius: 7px; display: grid; place-items: center;
  font-size: 12px; font-weight: 700; color: var(--fc, #f5a623); background: var(--fc-bg, #2a2116); border: 2px solid var(--panel); }
.folder.collapsed > .projects, .folder.collapsed > .folder-empty, .folder.collapsed > .folder-more { display: none; }
.folder > .folder-empty { font-size: 13px; margin: 0; padding: 14px 18px 14px 80px; }
.folder > .projects { gap: 0; padding: 0 16px 0 80px; }
.project-row { display: flex; align-items: center; gap: 12px; position: relative;
  background: none; border: none; border-radius: 0; padding: 12px 0; }
.project-row + .project-row { border-top: 1px solid var(--border); }
.project-row .drag-handle { position: absolute; left: -26px; top: 50%; transform: translateY(-50%);
  opacity: 0; transition: opacity .12s; margin: 0; }
.project-row:hover .drag-handle, .project-row .drag-handle:focus { opacity: 1; }
.row-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.row-info strong { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-meta { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-meta code { font-size: inherit; }
.project-row .actions { flex-wrap: nowrap; gap: 10px; }
.project-row .menu-toggle, .folder-head .menu-toggle { padding: 8px 10px; }
.vis-pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 5px 11px;
  font-size: 12px; font-weight: 600; white-space: nowrap; margin-right: 2px; }
.vis-pill .ico { width: 13px; height: 13px; }
.vis-pill.vis-private { color: #f0a35e; background: #2b1f13; }
.vis-pill.vis-public { color: #8fb6ff; background: #17223a; }
.vis-pill.vis-team { color: #bba6ff; background: #231b3a; }
.vis-menu { position: relative; }
.vis-menu > summary.vis-pill { cursor: pointer; border: 1px solid transparent; }
.vis-menu > summary.vis-pill:hover, .vis-menu[open] > summary.vis-pill { border-color: currentColor; }
.vis-menu .menu-items { width: 270px; gap: 6px; }
.vis-menu form { margin: 0; }
.btn.vis-opt { color: var(--text); border-color: var(--border); }
.vis-opt { display: grid; grid-template-columns: 16px auto 1fr; align-items: center; gap: 8px; font-size: 13px; }
.vis-opt small { color: var(--muted); font-size: 11px; text-align: right; }
.vis-opt.vis-private .ico { color: #f0a35e; } .vis-opt.vis-public .ico { color: #8fb6ff; } .vis-opt.vis-team .ico { color: #bba6ff; }
.btn.vis-opt.current { border-color: var(--accent); cursor: default; opacity: 1; }
.folder-more { display: block; width: 100%; text-align: left; background: none; border: none; border-top: 1px solid var(--border);
  color: var(--accent); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; padding: 14px 18px 16px 80px;
  border-radius: 0 0 16px 16px; }
.folder-more:hover { background: var(--panel2); }
.folder:not(.show-all) > .projects > li.over { display: none; }
/* While filtering, show matches inside collapsed folders and hide empty-folder hints. */
.filtering .folder.collapsed > .projects { display: flex; }
.filtering .folder > .projects > li.over { display: flex; }
.filtering .folder-empty, .filtering .folder-more { display: none !important; }
@media (max-width: 640px) {
  .folder-head { padding: 14px 12px; gap: 8px; }
  .folder-toggle { gap: 10px; }
  .folder-icon { width: 38px; height: 38px; }
  .folder > .projects { padding: 0 12px 0 16px; }
  .folder > .folder-empty, .folder-more { padding-left: 16px; }
  .project-row { flex-wrap: wrap; }
  .project-row .drag-handle, .folder-handle, .folder-peek, .folder.collapsed .folder-peek { display: none; }
  .row-info { flex-basis: 100%; }
  .project-row .actions { flex-wrap: wrap; }
}
.menu-row select { flex: 1; min-width: 0; background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 5px 8px; color: var(--text); font: inherit; font-size: 12px; }
.folder-move { display: flex; flex-direction: column; gap: 6px; }
.folder-new[hidden] { display: none; }
/* Drag-and-drop ordering */
.drag-handle { cursor: grab; color: var(--muted); font-size: 16px; line-height: 1; padding: 2px 2px;
  margin-left: -4px; user-select: none; }
.drag-handle:active { cursor: grabbing; }
.project.dragging { opacity: .45; }
ul.sortable { min-height: 8px; }
.folder.drop-target { border-color: var(--accent); }
.folder.drop-target > .folder-head .folder-name { color: var(--accent); }
.folder-empty[hidden] { display: none; }

/* History page */
.history-page .route { margin-right: 4px; }
table.history { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 14px; }
table.history td { padding: 7px 8px; border-top: 1px solid var(--border); vertical-align: middle; }
table.history tr.autosave td { color: var(--muted); }
table.history td.when { white-space: nowrap; color: var(--muted); font-size: 13px; }
table.history td.who { white-space: nowrap; }
table.history td.what { width: 100%; }
table.history td.do { white-space: nowrap; text-align: right; }
table.history .sha { font-size: 11px; color: var(--muted); margin-left: 6px; }

/* Gallery */
.gallery-head { margin-bottom: 18px; }
.gallery-head h2 { margin-bottom: 6px; }
.gallery-head p { max-width: 680px; margin-top: 0; }
.gallery-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.vis-filter { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.vis-toggle { opacity: .55; }
.vis-toggle:hover { opacity: .85; }
.vis-toggle[aria-pressed="true"] { opacity: 1; border-color: #4a5162; background: var(--panel); }
.vis-toggle[aria-pressed="true"][data-vis="team"] { color: #9ec5ff; border-color: #2a4a5a; }
.vis-toggle[aria-pressed="true"][data-vis="public"] { color: #ffcf8f; border-color: #5a4a2a; }
.vis-toggle[aria-pressed="true"][data-vis="private"] { color: var(--text); }
.vis-toggle .n { color: var(--muted); font-weight: 400; margin-left: 2px; }
.gallery-filter { width: min(340px, 100%); background: var(--bg); border: 1px solid var(--border);
  border-radius: 10px; padding: 9px 12px; color: var(--text); font: inherit; font-size: 14px; }
.gallery-owner { background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 10px;
  padding: 9px 10px; font: inherit; max-width: 100%; }
.gallery-owner:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(197, 243, 106, .18); }
.gowner-link { color: inherit; text-decoration: underline dotted; }
.gowner-link:hover { color: var(--text); }
.gallery-filter:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(197, 243, 106, .18); }
.gallery-sub { margin: 22px 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.ggrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.gcard { background: var(--panel); border: 1px solid var(--border); border-radius: 16px;
  display: flex; flex-direction: column; }
.gpreview { display: block; position: relative; background: var(--bg); overflow: hidden;
  border-radius: 15px 15px 0 0; border-bottom: 1px solid var(--border); aspect-ratio: 1200 / 760; }
.gpreview img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.gpreview-fallback { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; letter-spacing: .4px; }
.gbody { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.gtitle { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gowner { font-size: 13px; }
.gowner .route { font-size: 12px; }
.gblurb { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.45; }
.gactions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: auto; padding-top: 6px; }
.gactions .menu { position: relative; display: inline-block; }
.gactions .menu-items { left: 0; right: auto; min-width: 260px; top: auto; bottom: calc(100% + 6px); }
.gactions .menu-item.transfer-form { border-bottom: 0; padding-bottom: 0; margin-bottom: 0; }
.gactions .menu-item.transfer-form input[type=text] { width: 100%; box-sizing: border-box; background: var(--bg);
  border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; color: var(--text); font: inherit; font-size: 13px; }
/* "Give me ideas" (/gallery/ideas): template cards, one category pill at a time. */
.ideas-link { margin: 10px 0 0; font-size: 13px; text-align: center; }
.cat-toggle[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); }
.icard .gtitle strong { font-size: 15px; }
/* No image from Tower: a cover in the same 1200x760 frame, the idea's icon on a gradient. */
.icover { position: absolute; inset: 0; display: grid; place-items: center; font-size: 64px; font-weight: 700;
  color: rgba(255, 255, 255, .92); text-shadow: 0 2px 12px rgba(0, 0, 0, .25); }
.icover-0 { background: linear-gradient(135deg, #2b5876, #4e4376); }
.icover-1 { background: linear-gradient(135deg, #134e5e, #71b280); }
.icover-2 { background: linear-gradient(135deg, #614385, #516395); }
.icover-3 { background: linear-gradient(135deg, #8e5b2f, #c0743c); }
.icover-4 { background: linear-gradient(135deg, #1f4037, #3a7b6a); }
.icover-5 { background: linear-gradient(135deg, #3a1c71, #a0446d); }
.btn.star.on { color: #ffd166; border-color: #5a4a2a; }
.btn.star:hover { color: #ffd166; }
.star-mark { color: #ffd166; margin-right: 4px; }
.team h3 a, .card h3 a { color: inherit; }
.card h3 a:hover { color: var(--accent); }

/* Admin: top projects by page views */
.grid .num { text-align: right; font-variant-numeric: tabular-nums; }
.h-note { font-weight: 400; font-size: .85em; }
