:root {
  color-scheme: dark;
  --background: #111318;
  --panel: #191c23;
  --panel-alt: #20242c;
  --border: #343944;
  --text: #f5f6f8;
  --muted: #abb1be;
  --accent: #ddfb83;
  --accent-ink: #172106;
  --danger: #ffb5ae;
  --radius: 14px;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 16px;
  background: var(--background);
  color: var(--text);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; line-height: 1.5; }
[hidden] { display: none !important; }
a { color: inherit; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .45; }
button, a, input, select, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
p, h1, h2, h3 { margin: 0; }
.sr-only { width: 1px; height: 1px; overflow: hidden; position: absolute; clip-path: inset(50%); white-space: nowrap; }

.shell, .header-inner { width: min(1180px, calc(100% - 64px)); margin-inline: auto; }
.site-header { border-bottom: 1px solid #292e38; background: #15171d; }
.header-inner { min-height: 70px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; }
.brand { display: inline-flex; justify-self: start; align-items: center; gap: 11px; text-decoration: none; font-weight: 750; font-size: 1.15rem; letter-spacing: -.04em; }
.brand-icon { width: 31px; height: 31px; border-radius: 10px; background: var(--accent); display: grid; place-items: center; }
.brand-icon::after { content: ""; border-left: 10px solid var(--accent-ink); border-block: 6px solid transparent; margin-left: 2px; }
.header-inner nav { display: flex; align-items: center; gap: 5px; }
.header-inner nav a { text-decoration: none; border-radius: 8px; padding: 7px 13px; font-size: .9rem; font-weight: 650; color: var(--muted); }
.header-inner nav a[aria-current], .header-inner nav a:hover { color: var(--text); background: var(--panel-alt); }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 9px; min-height: 41px; padding: 8px 14px; background: var(--panel-alt); color: var(--text); font-weight: 700; font-size: .9rem; line-height: 1.2; }
.button:not(:disabled):hover { background: #303641; border-color: #515a6a; }
.button.primary { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.button.primary:not(:disabled):hover { border-color: #ecffaa; background: #ecffaa; }
.key-button { justify-self: end; min-height: 35px; padding-inline: 12px; }
.key-indicator { position: relative; width: 8px; height: 8px; background: #8d95a4; border-radius: 50%; }
.key-set .key-indicator { background: var(--accent); }
.text-button { border: 0; padding: 3px 0; background: transparent; color: var(--accent); font-weight: 650; font-size: .875rem; }
.text-button:hover { text-decoration: underline; }

.hero { position: relative; isolation: isolate; overflow: hidden; margin-top: 34px; padding: 48px 52px 45px; min-height: 348px; border: 1px solid #39463a; border-radius: 22px; background: linear-gradient(115deg, #191f24 8%, #252e28 63%, #303b29 100%); }
.hero-content { max-width: 660px; position: relative; z-index: 1; }
.hero h1, .page-intro h1 { font-weight: 780; letter-spacing: -.075em; line-height: .97; font-size: clamp(3.45rem, 7vw, 5.5rem); }
.hero h1 span, .page-intro h1 span { color: var(--accent); }
.hero p, .page-intro p { margin-top: 16px; color: #c3c9ca; font-size: 1.04rem; }
.hero-art { position: absolute; inset: 0 0 0 36%; z-index: 0; overflow: hidden; background: radial-gradient(ellipse at 72% 47%, #819f525c, transparent 54%), repeating-linear-gradient(0deg, transparent 0 34px, #d0ed8810 34px 35px), repeating-linear-gradient(90deg, transparent 0 34px, #d0ed8810 34px 35px); mask-image: linear-gradient(90deg, transparent, #000 23%); }
.orbit { position: absolute; width: 560px; height: 295px; left: 68%; top: 51%; transform: translate(-50%, -50%) rotate(-23deg); border: 1px solid #d9fc8170; border-radius: 50%; box-shadow: 0 0 22px #d9fc810c; }
.orbit-mid { width: 457px; height: 225px; border-color: #d9fc8150; }
.orbit-inner { width: 344px; height: 158px; border-color: #d9fc8191; }
.orbit-core { position: absolute; width: 96px; height: 96px; left: 68%; top: 51%; transform: translate(-50%, -50%); border: 1px solid #efffcaa8; border-radius: 50%; background: radial-gradient(circle at 30% 25%, #f3ffbe, #c1e16c 31%, #738f49 69%, #455633); box-shadow: 0 0 64px #d5fa7c66, inset -9px -10px 20px #475b36; }
.orbit-satellite { position: absolute; width: 12px; height: 12px; left: 91%; top: 16%; background: #e5fe9b; border-radius: 50%; box-shadow: 0 0 19px #ddfb83aa; }
.orbit-satellite.second { width: 7px; height: 7px; left: 44%; top: 71%; opacity: .7; }
.search-bar { display: flex; align-items: center; gap: 12px; margin-top: 28px; max-width: 550px; padding: 6px 6px 6px 16px; border: 1px solid #59644e; border-radius: 12px; background: #14181a; }
.search-bar:focus-within { border-color: var(--accent); }
.search-bar input { width: 100%; min-width: 0; border: 0; background: none; color: var(--text); padding: 5px 0; height: 44px; outline: none; }
.search-bar .button { padding-inline: 23px; min-height: 44px; }
.search-icon { position: relative; flex: none; display: inline-block; width: 16px; height: 16px; border-radius: 50%; border: 1.7px solid currentColor; color: #b7bfc2; margin-right: 3px; }
.search-icon::after { position: absolute; content: ""; width: 7px; height: 1.7px; border-radius: 2px; background: currentColor; transform: rotate(45deg); right: -5px; bottom: -3px; }

.workspace, .community-layout, .docs-layout { display: grid; grid-template-columns: 255px minmax(0, 1fr); align-items: start; gap: 24px; margin-top: 28px; }
.filter-panel { border: 1px solid var(--border); background: var(--panel); border-radius: var(--radius); padding: 18px; display: grid; gap: 13px; min-width: 0; }
.filter-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.filter-heading h2 { display: inline-flex; align-items: center; gap: 9px; font-size: 1rem; overflow-wrap: anywhere; }
.filter-icon { display: inline-block; width: 15px; height: 13px; background: linear-gradient(currentColor,currentColor) 0 1px / 15px 1px no-repeat, linear-gradient(currentColor,currentColor) 3px 6px / 10px 1px no-repeat, linear-gradient(currentColor,currentColor) 6px 11px / 5px 1px no-repeat; color: var(--accent); }
label { display: grid; gap: 6px; font-size: .875rem; font-weight: 650; color: #dce0e8; min-width: 0; }
label input, label select { appearance: none; min-width: 0; min-height: 39px; width: 100%; padding: 7px 9px; border: 1px solid var(--border); border-radius: 7px; background: #12151a; color: var(--text); font-weight: 450; font-size: .92rem; }
input::placeholder { color: #929aa9; opacity: 1; }
label select { padding-right: 28px; background-image: linear-gradient(45deg, transparent 50%, #aab3c0 50%), linear-gradient(135deg, #aab3c0 50%, transparent 50%); background-position: calc(100% - 15px) 53%, calc(100% - 10px) 53%; background-size: 5px 5px; background-repeat: no-repeat; }
details { border-top: 1px solid var(--border); padding-top: 8px; }
summary { cursor: pointer; padding: 5px 0; color: #dce0e8; font-size: .88rem; font-weight: 650; }
.advanced-fields, .stack { display: grid; gap: 12px; padding-top: 9px; }
.paired-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
fieldset { border: 1px solid var(--border); border-radius: 8px; padding: 8px; margin: 0; display: grid; gap: 10px; min-width: 0; }
legend { color: var(--muted); font-size: .85rem; }
.button.apply { border-color: #4b5b39; background: #2a3425; color: var(--accent); }
.button.apply:not(:disabled):hover { background: #37442f; }

.results-area { min-width: 0; }
.results-heading { min-height: 59px; display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.results-heading h2 { font-size: 1.3rem; font-weight: 740; letter-spacing: -.035em; }
.results-heading p { margin-top: 2px; font-size: .92rem; color: var(--muted); overflow-wrap: anywhere; }
.empty-state { text-align: center; display: grid; justify-items: center; padding: 38px 16px 42px; border: 1px dashed #39414b; border-radius: var(--radius); background: radial-gradient(ellipse at 50% 0%, #252d2a72, transparent 75%), #16191f; }
.empty-mark { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 15px; border: 1px solid #465838; border-radius: 15px; background: #293627; }
.empty-mark .search-icon { color: var(--accent); }
.empty-state h3 { font-size: 1.16rem; letter-spacing: -.02em; }
.empty-state p { margin-top: 4px; color: var(--muted); font-size: .93rem; }
.quick-searches { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.quick-searches button, .quick-searches a { border: 1px solid var(--border); border-radius: 30px; padding: 6px 11px; background: var(--panel-alt); color: #e5e8ee; font-size: .84rem; text-decoration: none; }
.quick-searches button:hover, .quick-searches a:hover { color: var(--accent); border-color: #506443; }
.results-grid, .idea-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.result-card { min-width: 0; border: 1px solid var(--border); background: var(--panel); border-radius: var(--radius); overflow: hidden; }
.thumbnail { position: relative; display: block; aspect-ratio: 16 / 9; background: radial-gradient(ellipse at center, #414e3e, #222a28 70%); overflow: hidden; }
.thumbnail img { display: block; width: 100%; height: 100%; object-fit: cover; }
.resource-badge, .pill { display: inline-block; width: fit-content; font-size: .78rem; font-weight: 720; border-radius: 5px; color: var(--accent); background: #202815; padding: 3px 7px; }
.resource-badge { position: absolute; bottom: 8px; left: 8px; }
.card-content { padding: 12px; }
.card-content h3 { overflow-wrap: anywhere; font-size: .98rem; line-height: 1.33; }
.card-content h3 a { text-decoration: none; }
.card-content h3 a:hover { color: var(--accent); text-decoration: underline; }
.card-meta, .card-description { font-size: .84rem; color: var(--muted); margin-top: 6px; overflow-wrap: anywhere; }
.card-description { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 20px; color: var(--muted); font-size: .9rem; }
.notice { font-size: .9rem; color: var(--muted); margin-block: 8px 13px; overflow-wrap: anywhere; }
.notice.error { padding: 9px 12px; background: #372226; border: 1px solid #654247; border-radius: 8px; color: var(--danger); }

.site-footer { display: flex; justify-content: space-between; gap: 14px; padding-block: 17px; margin-top: 34px; border-top: 1px solid #292d37; font-size: .84rem; color: var(--muted); }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--accent); }
dialog { width: min(440px, calc(100% - 32px)); border: 1px solid #535d4e; border-radius: var(--radius); padding: 23px; background: var(--panel); color: var(--text); }
dialog::backdrop { background: #0c0e13b8; backdrop-filter: blur(4px); }
dialog h2 { font-size: 1.35rem; }
dialog p { color: var(--muted); margin: 7px 0 16px; }
.dialog-actions { display: flex; justify-content: end; align-items: center; gap: 9px; margin-top: 17px; }
.dialog-actions .text-button { margin-right: auto; }

.secondary-page { min-height: calc(100vh - 200px); }
.page-intro { margin-top: 34px; border: 1px solid #39463a; border-radius: 20px; background: radial-gradient(ellipse at 100% -15%, #526448, transparent 61%), #1e2526; padding: 36px 42px; }
.page-intro h1 { font-size: clamp(2.35rem, 6vw, 4.25rem); line-height: 1.05; }
.community-layout { grid-template-columns: 290px minmax(0, 1fr); }
.account-panel h2 { font-size: 1.13rem; }
.account-panel p { margin-top: 6px; font-size: .9rem; color: var(--muted); }
.switch-auth { margin-top: 11px; }
.idea-card, .doc-card { min-width: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); padding: 17px; }
.idea-card { display: grid; gap: 6px; text-decoration: none; overflow-wrap: anywhere; }
.idea-card:hover { border-color: #667949; background: #232a25; }
.idea-card strong { font-size: 1rem; }
.idea-card > span:not(.pill), .idea-card small { color: var(--muted); font-size: .87rem; }
.idea-card small { margin-top: 4px; }
.starter-heading { margin: 16px 0 11px; font-size: 1.02rem; }
.docs-layout { grid-template-columns: 210px minmax(0, 1fr); }
.section-nav { gap: 8px; }
.section-nav a { text-decoration: none; font-size: .9rem; color: var(--muted); }
.section-nav a:hover, .doc-card a { color: var(--accent); }
.docs-content { display: grid; gap: 14px; }
.doc-card { padding: 22px; scroll-margin-top: 20px; }
.doc-card h2 { font-size: 1.25rem; margin-bottom: 7px; }
.doc-card p, .doc-card ol, .doc-card dd { color: var(--muted); }
.doc-card ol { padding-left: 19px; margin: 0; }
.doc-card li + li { margin-top: 5px; }
.doc-card .quick-searches { justify-content: start; }
.filter-guide { display: grid; margin: 0; grid-template-columns: minmax(130px, .42fr) 1fr; gap: 9px 15px; }
.filter-guide dt { font-weight: 650; }
.filter-guide dd { margin: 0; }

@media (max-width: 1000px) {
  .results-grid, .idea-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .shell, .header-inner { width: calc(100% - 32px); }
  .header-inner { min-height: 63px; gap: 8px; }
  .header-inner nav a { padding: 7px 8px; }
  .hero { padding: 34px 24px; min-height: 0; margin-top: 22px; }
  .hero-art { inset-inline-start: 29%; opacity: .56; }
  .workspace, .community-layout, .docs-layout { grid-template-columns: 1fr; margin-top: 18px; gap: 17px; }
  .filter-panel:not(.account-panel) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filter-panel .filter-heading, .filter-panel details, .filter-panel .apply { grid-column: 1 / -1; }
  .page-intro { padding: 24px; margin-top: 22px; }
  .section-nav { display: flex; flex-wrap: wrap; gap: 8px 15px; }
  .account-panel { max-width: 440px; }
}
@media (max-width: 480px) {
  .header-inner { grid-template-columns: minmax(0, 1fr) auto; padding-block: 8px; }
  .header-inner nav { grid-column: 1 / -1; grid-row: 2; }
  .key-button { grid-column: 2; grid-row: 1; }
  .hero-content h1 { font-size: 3.3rem; }
  .hero p { max-width: 27ch; }
  .search-bar { padding-left: 10px; gap: 8px; }
  .search-bar .button { padding-inline: 12px; }
  .filter-panel:not(.account-panel) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .results-grid, .idea-grid, .filter-guide { grid-template-columns: 1fr; }
  .filter-guide { gap: 2px; }
  .filter-guide dd + dt { margin-top: 7px; }
}

.card-save { margin-top: 10px; min-height: 33px; padding: 5px 11px; }
.saved-feedback { color: var(--accent); }
#save-form { padding-top: 0; }
#save-form p { margin: 0; }
#save-form .dialog-actions { margin-top: 3px; }
#save-video-fields, #save-search-fields { padding: 0; border: 0; }
.save-detail { overflow-wrap: anywhere; }
.return-search { margin-top: 10px; width: 100%; }
.library-sections, .library-list { display: grid; gap: 10px; min-width: 0; }
.library-sections { gap: 24px; }
.library-group { margin-top: 16px; }
.library-group h3 { margin-bottom: 8px; font-size: 1rem; }
.playlist-create { margin-bottom: 12px; }
.collection-card { border: 1px solid var(--border); background: var(--panel); padding: 12px 14px; border-radius: 10px; overflow-wrap: anywhere; }
.collection-card summary { color: var(--text); font-size: .95rem; }
.collection-meta, .collection-card small { color: var(--muted); font-weight: 450; font-size: .85rem; }
.collection-meta { display: block; margin-left: 15px; }
.collection-card small { display: block; }
.collection-videos { display: grid; gap: 9px; margin: 8px 0 0; padding-left: 0; list-style: none; }
.collection-videos li, .saved-search { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.collection-videos li { padding-top: 8px; border-top: 1px solid var(--border); }
.collection-card a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.collection-card a:hover { color: var(--accent); }
.collection-card .text-button { flex: none; }
