:root {
  color-scheme: light;
  --paper: #ffffff;
  --surface: #ffffff;
  --ink: #15202b;
  --muted: #566674;
  --line: #dce4eb;
  --accent: #543abc;
  font: 16px/1.4 system-ui, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
a { color: inherit; }
button, input { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #1582bd; outline-offset: 4px; }
.wrap { width: min(1080px, calc(100% - 40px)); margin-inline: auto; }
.masthead { border-bottom: 1px solid var(--line); background: var(--surface); }
.masthead-inner { display: flex; align-items: center; justify-content: space-between; min-height: 55px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; text-decoration: none; }
.brand-icon { display: grid; place-items: center; width: 33px; aspect-ratio: 1; background: var(--accent); color: #d1eafa; border-radius: 10px; font-size: 22px; }
.nav-link { text-underline-offset: 5px; }
.main-nav { display: flex; gap: clamp(8px, 2vw, 24px); }
.main-nav a { padding: 8px; border-radius: 8px; text-decoration: none; font-weight: 600; }
.main-nav a[aria-current], #blog-link[aria-current] { color: var(--accent); background: #e2f1fa; }
#blog-link { padding: 8px; border-radius: 8px; }
.main-nav svg { display: none; }
.home-search-wrap { margin-block: 16px 20px; }
.home-search { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
.home-search button { min-height: 44px; padding-inline: 10px; border: 0; border-radius: 9px; background: transparent; color: var(--accent); }
.home-category-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; overflow: hidden; border-radius: 12px; background: var(--line); }
.home-category-list a { display: flex; align-items: center; justify-content: space-between; gap: 4px; min-height: 52px; padding: 8px 10px; background: var(--surface); text-decoration: none; overflow-wrap: anywhere; }
.home-category-list strong { font-weight: 600; }
.home-category-list span { color: var(--accent); font-size: 1.25rem; }
.section-line { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.section-line h2 { margin: 0; font-size: 1.15rem; }
.section-line a, .featured-channel > a { color: var(--accent); font-weight: 600; text-decoration: none; }
.featured-channel { margin-block: 16px; padding: 12px; border-radius: 13px; background: #e1f0fa; }
.featured-channel > h2 { margin: 0 0 5px; font-size: 1.15rem; }
.featured-channel #home-featured, .featured-channel #home-featured .card { background: transparent; }
.featured-channel #home-featured .card { padding-inline: 0; }
.avatar:has(img) { position:relative; overflow:hidden; }
.avatar > img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; border-radius:inherit; }
.avatar-choice { border:1px solid var(--line); border-radius:14px; padding:12px; }
.channel-form .avatar-choice label { display:flex; align-items:center; gap:8px; min-height:42px; }
.channel-form .avatar-choice input[type=radio] { width:auto; min-height:0; }
#avatar-preview { border-radius:12px; margin-top:8px; }
.featured-channel .avatar { flex-basis: 52px; }
.featured-channel > p { margin: 4px 0 9px; color: var(--muted); }
.featured-channel > a { display: block; border-top: 1px solid #cbdde9; padding-top: 9px; }
.page { min-height: 35vh; margin-top: 16px; }
.page h1 { margin: 0 0 12px; font-size: clamp(24px, 5vw, 36px); letter-spacing: -.045em; line-height: 1.1; overflow-wrap: anywhere; }
.page > .nav-link { display: inline-block; margin-bottom: 12px; }
.collection + .collection { margin-top: 32px; }
.primary-button { background: var(--accent); color: #fff; border-color: var(--accent); }
.channel-form { display: grid; gap: 12px; max-width: 580px; padding: 16px; margin: 0 0 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.channel-form h3 { margin: 0; }
.channel-form label { display: grid; gap: 4px; font-weight: 600; }
.channel-form :is(input, select, textarea) { width: 100%; min-height: 44px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); font: inherit; }
.profile-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.submission-status { align-self: start; padding: 4px 9px; border-radius: 8px; background: #fdf0da; color: #80500e; font-size: .82rem; font-weight: 700; }
.submission-status[data-state="added"] { background: #e1f2e8; color: #205540; }
.submission-status[data-state="cancelled"] { background: #ecf0f3; color: var(--muted); }
#my-channels-empty p { margin: 0; }
.collection h2 { margin: 0 0 10px; font-size: clamp(22px, 4vw, 28px); line-height: 1.2; }
.muted { max-width: 65ch; margin: 0 0 16px; color: var(--muted); }
.toolbar { display: grid; gap: 16px; }
.search { display: flex; align-items: center; gap: 14px; min-height: 44px; padding: 0 12px; border-radius: 10px; background: #e5ebf0; border: 1px solid transparent; }
.search:focus-within { outline: 3px solid #1582bd; outline-offset: 2px; }
.search input { flex: 1; min-width: 0; border: 0; padding-block: 12px; background: transparent; color: var(--ink); outline: none; }
.search-icon { width: 15px; height: 15px; border: 2px solid var(--muted); border-radius: 50%; position: relative; margin-right: 4px; }
.search-icon::after { content: ""; position: absolute; width: 7px; height: 2px; background: var(--muted); right: -5px; bottom: -2px; transform: rotate(45deg); }
#storage-status { margin: 0; color: var(--muted); font-size: .875rem; }
button { border: 1px solid var(--line); border-radius: 999px; padding: 7px 15px; background: #fff; color: var(--ink); font-weight: 600; }
button:hover { border-color: var(--accent); }
button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.results { display: flex; justify-content: space-between; color: var(--muted); font-size: .875rem; }
.results { align-items: baseline; gap: 8px; margin: 16px 0 8px; }
.cards { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 0; margin: 0; }
.card { display: flex; flex-direction: column; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px; overflow-wrap: anywhere; }
.card-header { display: flex; align-items: center; gap: 12px; }
.avatar { flex: 0 0 44px; aspect-ratio: 1; display: grid; place-items: center; border-radius: 12px; background: var(--tile); color: var(--ink); font-weight: 800; font-size: 21px; }
.card h3 { margin: 0; font-size: 1.12rem; line-height: 1.2; }
.card-title-link { text-decoration: none; }
.card-title-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.category { color: var(--muted); font-size: .8rem; }
.card p { margin: 0; color: var(--muted); }
.card-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; }
.channel-link { color: var(--accent); text-underline-offset: 4px; }
.card .view-count { font-weight: 700; color: var(--accent); }
.favorite { flex: 0 0 44px; min-height: 44px; padding: 0; font-size: 1.25rem; }
.segments { display: flex; padding: 3px; border-radius: 12px; background: #e1ebf2; gap: 2px; }
.segments button { flex: 1; min-height: 42px; padding: 5px 8px; border: 0; border-radius: 9px; background: transparent; font-size: .9rem; }
.segments button[aria-pressed="true"] { color: #fff; background: var(--accent); }
.cards.compact-list { grid-template-columns: 1fr; gap: 0; overflow: hidden; border-radius: 12px; background: var(--surface); }
.compact-card { padding: 8px 10px; gap: 7px; border: 0; border-radius: 0; }
.compact-card + .compact-card { border-top: 1px solid var(--line); }
.compact-card .card-header { gap: 9px; }
.compact-card .avatar { flex-basis: 44px; border-radius: 50%; }
.compact-card .card-header > div { flex: 1; min-width: 0; }
.compact-card .card-header h3 { font-size: 1rem; }
.favorite, .preview-toggle { display: grid; place-items: center; flex: 0 0 44px; width: 44px; min-height: 44px; padding: 0; border-radius: 8px; border-color: transparent; background: transparent; color: var(--accent); }
.favorite::before, .preview-toggle::before { content: ""; width: 21px; height: 21px; background: var(--action-icon) center / contain no-repeat; }
.favorite { --action-icon: url("assets/bookmark.svg"); }
.favorite[aria-pressed="true"] { --action-icon: url("assets/bookmark-filled.svg"); color: var(--accent); background: #e0f0fb; border-color: transparent; }
.preview-toggle { --action-icon: url("assets/chevron-down.svg"); }
.preview-toggle[aria-expanded="true"]::before { transform: rotate(180deg); }
.preview-panel { padding: 10px; border-radius: 10px; background: #e9f4fa; }
.preview-panel p { color: var(--ink); }
.telegram-action { display: block; text-align: center; margin-top: 10px; padding: 10px; border-radius: 9px; background: var(--accent); color: #fff; font-weight: 700; text-decoration: none; }
mark { color: inherit; background: #d1eafa; border-radius: 3px; }
.recommendation-panel { margin-top: 14px; }
.recommendation-panel > h2 { font-size: 1rem; color: var(--muted); }
#new-title { scroll-margin-top: 12px; }
.rank-frame { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface); }
.rank-table { width: 100%; border-collapse: collapse; text-align: left; }
.rank-table th, .rank-table td { padding: 10px 8px; }
.rank-table th { border-bottom: 1px solid var(--line); color: var(--accent); font-size: .875rem; }
.rank-table tbody tr + tr { border-top: 1px solid var(--line); }
.rank-table td:first-child { width: 1%; }
.rank-name { font-weight: 750; overflow-wrap: anywhere; }
.rank-identity { display: flex; align-items: center; gap: 8px; }
.rank-identity .avatar { flex-basis: 36px; border-radius: 50%; font-size: 17px; }
.rank-name .category { display: block; font-weight: 400; }
.rank-table th:last-child, .rank-views { text-align: right; white-space: nowrap; }
.rank-views { font-weight: 750; }
.rank-number { display: inline-block; min-width: 26px; text-align: center; padding: 2px 5px; border-radius: 7px; background: #e4f2fb; font-weight: 750; }
.rank-note { margin: 7px 0 16px; font-size: .8rem; }
.more-channels, #propose-channel { min-height: 44px; color: var(--accent); border: 0; background: transparent; border-radius: 0; }
.more-channels { display: block; width: 100%; padding-inline: 12px; border-top: 1px solid var(--line); background: var(--surface); border-radius: 0 0 12px 12px; text-align: left; }
#new-panel .compact-list:has(+ .more-channels:not([hidden])) { border-radius: 12px 12px 0 0; }
.profile-group { padding: 12px; border-radius: 14px; background: var(--surface); }
.profile-group + .profile-group { margin-top: 14px; }
.profile-group .section-line { align-items: center; }
#propose-channel { padding: 0; text-align: right; }
.profile-group .muted { font-size: .85rem; }
.submission-groups { display: grid; gap: 12px; }
.submission-group > h3 { margin: 0; padding: 8px 0; color: var(--muted); font-size: .85rem; }
.submission-group ul { list-style: none; margin: 0; padding: 0; }
.submission-group li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 8px; padding: 9px 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; }
.submission-group .submission-status { grid-row: 2; justify-self: start; }
.submission-group li > h3 { grid-column: 1; grid-row: 1; }
.submission-group li > p { grid-column: 1; grid-row: 3; font-size: .85rem; }
.submission-group .profile-actions { grid-column: 2; grid-row: 1 / span 3; justify-content: center; align-items: flex-end; flex-direction: column; margin: 0; gap: 0; }
.submission-group .profile-actions button { min-height: 44px; padding: 4px; border: 0; color: var(--accent); font-size: .87rem; }
.submission-group .profile-actions button + button { color: #b33b3a; }
.empty { border: 1px dashed var(--line); border-radius: 16px; padding: 24px; }
.empty p { margin-top: 0; }
.articles { display: grid; gap: 12px; max-width: 700px; }
.article { padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.article summary { cursor: pointer; font-weight: 700; }
.article p { margin: 10px 0 0; color: var(--muted); }
.footer { margin-block: 24px 0; padding: 0 0 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
.footer-about summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; padding-inline: 4px; list-style: none; cursor: pointer; color: var(--ink); font-weight: 600; }
.footer-about summary::-webkit-details-marker { display: none; }
.footer-about summary::after { content: ""; flex: 0 0 14px; height: 14px; background: url("assets/chevron-down.svg") center / contain no-repeat; }
.footer-about[open] summary::after { transform: rotate(180deg); }
.footer-quote { margin: 0; padding: 10px 12px; border-inline-start: 3px solid var(--accent); border-radius: 0 8px 8px 0; background: #f6f4fb; }
.footer-quote p { max-width: 65ch; margin: 0; }
.footer-quote p + p { margin-top: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 760px) {
  body { padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px)); }
  html { scroll-padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px)); }
  .main-nav {
    position: fixed;
    z-index: 2;
    inset: auto max(8px, env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    max-width: 560px;
    margin-inline: auto;
    display: grid;
    grid-template-columns: 1fr 1fr minmax(max-content, 1fr) 1fr;
    gap: 2px;
    padding: 4px;
    border: 1px solid var(--line);
    background: white;
    box-shadow: 0 5px 20px rgb(25 75 115 / 16%);
  }
  .main-nav a { display: grid; justify-items: center; align-content: center; min-height: 52px; padding: 3px 0; font-size: .75rem; line-height: 1.2; }
  .main-nav svg { display: block; width: 22px; height: 22px; margin-bottom: 4px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
  .main-nav a { border-radius: 14px; padding-inline: 4px; }
  .main-nav a[aria-current] path:only-child { fill: currentColor; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 490px) {
  .wrap { width: calc(100% - 28px); }
  .cards { grid-template-columns: 1fr; }
}
#blog-link { color: var(--accent); }
@media (max-width: 760px) {
  .main-nav a { color: var(--muted); }
  .main-nav a[aria-current] { color: white; background: #1046c8; }
}

/* Directory layout inspired by the compact Spaces grid. */
.wrap { width: min(1240px, calc(100% - 36px)); }
[data-page] { scroll-margin-top: 104px; }
.directory-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 24px 0 16px; }
.directory-heading h1 { margin: 0; font-size: clamp(1.6rem, 4vw, 2.1rem); line-height: 1.1; letter-spacing: -.035em; }
.directory-heading p { margin: 0; color: var(--muted); }
.directory-submit { display: inline-flex; align-items: center; min-height: 40px; border: 1px solid #e8e6ed; border-radius: 999px; padding: 0 12px; margin-left: auto; background: #f8f7fb; color: var(--ink); font-size: .87rem; font-weight: 600; text-decoration: none; }
.directory-submit:hover { border-color: var(--accent); }
.home-search-wrap { margin-block: 0 12px; }
.home-search { gap: 0; padding: 3px; border: 1px solid #e5e5eb; border-radius: 999px; box-shadow: 0 2px 5px #2118320c; }
.home-search .search { background: transparent; border-radius: 999px; }
.home-search button { border-radius: 999px; min-height: 40px; background: #f3f1fb; }
.home-categories { padding: 0 0 14px; border-bottom: 1px solid #efedf3; }
.home-category-list { display: flex; flex-wrap: wrap; gap: 7px; background: transparent; overflow: visible; }
.home-category-list a { min-height: 40px; padding: 5px 10px; border: 1px solid #e7e6ec; border-radius: 999px; font-size: .87rem; }
.home-category-list a:hover { border-color: var(--accent); }
.home-category-list a span { line-height: 1; }
.home-featured, .home-latest { margin-top: 22px; }
#home-latest + p { text-align:center; }
.home-featured .section-line, .home-latest .section-line { align-items: center; margin-bottom: 12px; }
.section-line .section-tag { background: #f4f2f8; border-radius: 999px; padding: 6px 11px; font-size: .9rem; }
.section-line a { font-size: .87rem; }
#catalog .toolbar { gap: 10px; }
#catalog .search { border-color: #e4e5ec; background: #fafafd; }
.filter-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: stretch; }
.filter-trigger { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-width: 48px; padding: 0 12px; border: 1px solid #d9d0f3; border-radius: 10px; background: #f6f2ff; color: var(--accent); }
.filter-trigger img { width: 21px; height: 21px; }
.filter-badge { display: grid; place-items: center; min-width: 19px; height: 19px; border-radius: 50%; background: var(--accent); color: #fff; font-size: .72rem; }
.filter-dialog { position: fixed; inset: var(--filter-top, 12px) var(--filter-right, 12px) auto auto; width: min(360px, calc(100% - 24px)); max-height: calc(100dvh - var(--filter-top, 12px) - 12px); margin: 0; padding: 0; overflow: auto; overscroll-behavior: contain; border: 1px solid #e4dfee; border-radius: 16px; background: #fff; color: var(--ink); box-shadow: 0 14px 35px #21183222; }
.filter-dialog::backdrop { background: transparent; }
.filter-dialog form { display: grid; gap: 12px; padding: 12px 16px 16px; }
.filter-dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.filter-dialog-header h2 { margin: 0; font-size: 1.16rem; }
.filter-dialog-header button { width: 44px; height: 44px; margin-inline-end: -5px; padding: 0; border: 0; border-radius: 8px; background: transparent; font-size: 1.4rem; }
.filter-options { display: grid; gap: 10px; }
.filter-options fieldset { min-width: 0; margin: 0; padding: 3px 0 6px; border: 0; border-bottom: 1px solid var(--line); }
.filter-options legend { padding: 0; font-size: .95rem; font-weight: 700; }
.filter-options label { display: flex; align-items: center; gap: 8px; min-height: 32px; padding: 3px 2px; font-size: .9rem; cursor: pointer; }
.filter-options input { width: 17px; height: 17px; margin: 0; accent-color: var(--accent); }
.filter-dialog-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.filter-dialog-actions button { min-height: 44px; border-radius: 9px; }
#filter-reset { background: transparent; border: 0; color: var(--muted); }
@media (max-width: 760px) {
  .filter-trigger { position: relative; padding-inline: 9px; }
  .filter-trigger-label { display: none; }
  .filter-badge { position: absolute; right: -4px; top: -5px; }
  .filter-dialog { inset: auto 0 0; width: 100%; max-width: none; max-height: min(91dvh, 680px); padding-bottom: env(safe-area-inset-bottom, 0px); border-radius: 18px 18px 0 0; }
  .filter-dialog::before { content: ""; display: block; width: 30px; height: 4px; margin: 8px auto 0; border-radius: 4px; background: #d0c9de; }
  .filter-dialog::backdrop { background: #17102c66; }
  .filter-options label { min-height: 34px; }
}
.cards.space-grid { --space-columns: 4; grid-template-columns: repeat(var(--space-columns), minmax(0, 1fr)); gap: 14px; align-items: start; }
.ad-banner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  min-height: 72px;
  padding: 10px 13px;
  border: 1px solid var(--banner-edge, #d8c9f4);
  border-radius: 10px;
  background: var(--banner-bg, #f3effc);
  color: var(--banner-ink, #543abc);
}
.ad-banner :is(strong, :is(.ad-link,.editorial-feature-link)) { grid-column: 2; font-size: clamp(1rem, 2vw, 1.4rem); line-height: 1.2; text-align: center; overflow-wrap: anywhere; }
.ad-banner :is(.ad-link,.editorial-feature-link) { font-weight: 700; text-underline-offset: 3px; }
.ad-label { justify-self: start; border: 1px solid var(--banner-edge, #ded2f3); border-radius: 999px; padding: 3px 8px; background: var(--banner-chip, #eae1fa); font-size: .73rem; font-weight: 600; }
.ad-banner-inline { margin-block: 14px; }
.ad-banner-grid { grid-column: 1 / -1; }
.space-card {
  --card-start: #244ba9;
  --card-end: #5132b0;
  display: grid;
  position: relative;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto 1fr auto;
  min-height: 178px;
  gap: 6px 3px;
  padding: 12px;
  border: 1px solid #ffffff24;
  border-radius: 12px;
  background: linear-gradient(125deg, var(--card-start), var(--card-end));
  color: #fff;
  box-shadow: inset 0 1px #ffffff2d;
}
.space-card[data-topic="Кино"] { --card-start: #5020a3; --card-end: #713bf0; }
.space-card[data-topic="Юмор"] { --card-start: #924013; --card-end: #a62d62; }
.space-card[data-topic="Технологии"] { --card-start: #263295; --card-end: #5248d1; }
.space-card[data-topic="Путешествия"] { --card-start: #104d5d; --card-end: #167058; }
.space-card + .space-card { border-top: 1px solid #ffffff24; }
.space-topic { justify-self: start; align-self: center; border-radius: 5px; padding: 3px 7px; background: #19113938; font-size: .75rem; grid-column: 1; grid-row: 1; }
.space-card .card-header { display: contents; }
.space-card .card-header > div { grid-column: 1 / -1; grid-row: 2; }
.space-card .card-title-link { color: #fff; }
.space-card .card-title-link::after { content: ""; position: absolute; inset: 0; border-radius: 12px; }
.space-card .card-title-link:focus-visible::after { outline: 2px solid var(--accent); outline-offset: 3px; }
.space-card .card-header .avatar, .space-card .card-header .category { display: none; }
.space-card .space-description { grid-column: 1 / -1; grid-row: 3; color: #ffffffeb; font-size: .88rem; }
.space-card .space-meta { grid-column: 1 / -1; grid-row: 4; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 3px 10px; margin: 4px -12px -12px; padding: 7px 12px; border-radius: 0 0 11px 11px; background: #160d362f; color: #fff; font-size: .76rem; overflow-wrap: anywhere; }
.space-card .favorite { grid-column: 2; grid-row: 1; width: 44px; margin: -5px -3px -4px 0; justify-self: end; color: #fff; background: transparent; }
.space-card .favorite::before, .space-card .preview-toggle::before { filter: brightness(0) invert(1); }
.space-card .favorite[aria-pressed="true"] { background: #ffffff29; }
.space-card .preview-toggle { grid-column: 2; grid-row: 2; align-self: start; justify-self: end; width: 36px; min-height: 30px; margin-top: -5px; }
.space-card:has(.preview-toggle) .card-header > div { padding-right: 34px; }
.space-card .preview-panel { grid-column: 1 / -1; grid-row: 5; margin-top: 12px; background: #fff; }
.space-card :is(.favorite, .preview-toggle, .preview-panel) { position: relative; z-index: 1; }
.space-card .preview-panel p { color: var(--ink); }
.space-card mark { color: #211832; background: #fff0a8; }
.space-card :focus-visible { outline-color: #fff; outline-offset: 2px; }
.space-card .preview-panel :focus-visible { outline-color: var(--accent); }
.profile-group { border: 1px solid #e9e8ef; }
.profile-layout { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); align-items: start; gap: 16px; reading-flow: grid-rows; }
.profile-library { grid-column: 1; grid-row: 1; min-width: 0; }
.profile-ad { grid-column: 2; grid-row: 1; min-width: 0; padding: clamp(12px, 2.5vw, 22px); border: 1px solid #d9ccf3; border-radius: 14px; background: var(--surface); }
.profile-ad h2 { margin: 0; font-size: 1.2rem; }
.profile-ad #ad-draft-form { display: grid; gap: 10px; }
.profile-ad-placements { min-width: 0; margin: 0; padding: 0; border: 0; }
.profile-ad-placements legend, .profile-ad-field { font-size: .9rem; font-weight: 650; }
.profile-ad-placements label { display: flex; align-items: center; gap: 9px; min-height: 42px; padding: 5px 8px; border-radius: 8px; cursor: pointer; }
.profile-ad-placements label:has(:checked) { background: #f1eafc; }
.profile-ad-placements input { margin: 0; accent-color: var(--accent); }
.placement-price { margin-left: auto; color: var(--accent); white-space: nowrap; font-variant-numeric: tabular-nums; }
.profile-ad-field { display: grid; gap: 5px; min-width: 0; }
.profile-ad-field input { min-height: 44px; width: 100%; min-width: 0; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font-weight: 400; }
.profile-ad-colors { min-width: 0; margin: 0; padding: 0; border: 0; }
.profile-ad-colors legend { margin-bottom: 5px; font-size: .9rem; font-weight: 650; }
.profile-ad-swatches { display: grid; grid-template-columns: repeat(auto-fit, minmax(38px, 1fr)); gap: 6px; }
.profile-ad-swatches label { display: grid; position: relative; place-items: center; min-height: 44px; border: 1px solid var(--banner-edge); border-radius: 8px; background: var(--banner-chip); color: var(--banner-ink); cursor: pointer; }
.profile-ad-swatches input { position: absolute; inset: 0; margin: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.profile-ad-swatches label:has(input:checked) { border: 2px solid var(--banner-ink); }
.profile-ad-swatches label:has(input:checked)::after { content: "✓"; font-weight: 750; pointer-events: none; }
.profile-ad-swatches label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
[data-banner-color="lilac"] { --banner-bg: #f3effc; --banner-edge: #d8c9f4; --banner-ink: #543abc; --banner-chip: #eae1fa; }
[data-banner-color="blue"] { --banner-bg: #eaf4ff; --banner-edge: #adceef; --banner-ink: #1d4f83; --banner-chip: #cce7ff; }
[data-banner-color="mint"] { --banner-bg: #e9f8ee; --banner-edge: #a9d8bb; --banner-ink: #235d3e; --banner-chip: #caedd7; }
[data-banner-color="sand"] { --banner-bg: #fbf4e2; --banner-edge: #e0c88d; --banner-ink: #68501d; --banner-chip: #f2e2b6; }
[data-banner-color="peach"] { --banner-bg: #fff0e8; --banner-edge: #e9bdab; --banner-ink: #803e2d; --banner-chip: #f8d8c9; }
[data-banner-color="rose"] { --banner-bg: #fceef5; --banner-edge: #e1b2cb; --banner-ink: #7b355e; --banner-chip: #f3d5e6; }
.profile-ad-preview [data-banner-color] { background: var(--banner-bg); border-color: var(--banner-edge); color: var(--banner-ink); }
.profile-ad-preview p { margin: 0 0 5px; color: var(--muted); font-size: .82rem; }
.profile-ad-preview .ad-banner { grid-template-columns: minmax(0, 1fr); }
.profile-ad-preview .ad-banner strong { grid-column: 1; }
.profile-ad-terms { margin: 0; padding: 9px 11px; border-radius: 8px; background: #fff3d8; color: #704814; font-size: .86rem; }
.profile-ad-pay { min-height: 44px; border-radius: 8px; }
.profile-ad-pay:disabled { opacity: .65; cursor: not-allowed; }
.profile-ad .profile-ad-status { margin: 0; font-size: .82rem; }
#ad-order-history summary { cursor: pointer; font-size: .9rem; }
#ad-order-list { display: grid; gap: 6px; margin: 8px 0 0; padding: 0; list-style: none; }
#ad-order-list button { width: 100%; text-align: left; border-radius: 8px; }
.ad-payment-dialog { width: min(490px, calc(100% - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 1px solid var(--line); border-radius: 15px; color: var(--ink); background: var(--surface); }
.ad-payment-dialog::backdrop { background: #17102c66; }
.ad-payment-inner { padding: 14px clamp(12px, 4vw, 20px); }
.ad-payment-heading { align-items: center; margin-bottom: 0; }
.ad-payment-heading button { width: 44px; height: 44px; padding: 0; border: 0; border-radius: 8px; font-size: 1.35rem; }
#ad-invoice-placement { overflow-wrap: anywhere; }
#ad-payment-details { display: grid; gap: 8px; }
.ad-pay-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0; padding: 9px; background: #f5f1fc; border-radius: 8px; }
.ad-pay-facts dt { color: var(--muted); font-size: .83rem; }
.ad-pay-facts dd { margin: 0; font-weight: 700; }
.ad-copy { justify-self: start; min-height: 38px; padding: 4px; border: 0; border-radius: 8px; color: var(--accent); }
.ad-hash-details summary { cursor: pointer; margin-bottom: 5px; color: var(--muted); }
#ad-check-payment { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; border-radius: 8px; }
#ad-check-payment:disabled { opacity: .75; }
.ad-spinner { width: 15px; height: 15px; border: 2px solid #ffffff7a; border-top-color: #fff; border-radius: 50%; animation: ad-spin .7s linear infinite; }
@keyframes ad-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ad-spinner { animation: none; } }
#ad-payment-status:empty { display: none; }
@media (max-width: 760px) {
  .profile-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .profile-ad, .profile-library { grid-column: auto; grid-row: auto; }
}
@media (min-width: 1041px) { .space-card { height: 100%; } }
@media (max-width: 1040px) { .cards.space-grid { --space-columns: 3; } }
@media (max-width: 820px) { .cards.space-grid { --space-columns: 2; } }
@media (max-width: 520px) {
  .wrap { width: calc(100% - 24px); }
  .cards.space-grid { --space-columns: 1; gap: 10px; }
  .ad-banner { grid-template-columns: auto minmax(0, 1fr); gap: 8px; padding-inline: 10px; }
  .directory-heading p { order: 3; flex-basis: 100%; font-size: .85rem; }
  .directory-heading { gap: 5px 8px; }
  .directory-submit { min-height: 40px; }
  .space-card { min-height: 150px; }
  .home-search .search { gap: 10px; padding-inline: 10px; }
  .home-search input { font-size: .9rem; }
}

/* Resource detail page. */
#channel { --entity-ink: #13271e; --entity-muted: #4b6356; --entity-line: #dbe8df; margin-top: 18px; color: var(--entity-ink); }
#channel:focus-within :focus-visible { outline-color: #258246; }
.entity-hero {
  padding: clamp(14px, 3vw, 30px);
  background: linear-gradient(125deg, #f1f7f3, #e7f2eb);
  border: 1px solid var(--entity-line);
  border-radius: 18px 18px 0 0;
}
.entity-path { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 10px; margin-bottom: clamp(18px, 4vw, 38px); color: var(--entity-muted); font-size: .85rem; }
.entity-path a { text-decoration: none; }
.entity-path a:hover { text-decoration: underline; }
.entity-header { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(174px, 226px); gap: clamp(10px, 2vw, 24px); align-items: center; }
.entity-header:has(#entity-avatar[hidden]) { grid-template-columns: minmax(0, 1fr); }
.entity-header .avatar { width: clamp(57px, 8vw, 94px); border-radius: 21%; font-size: clamp(26px, 5vw, 44px); }
.entity-kicker, .entity-handle { color: var(--entity-muted); margin: 0; }
.entity-kicker { font-size: .78rem; font-weight: 650; }
.entity-identity h1 { margin: 5px 0 9px; font-size: clamp(24px, 4vw, 43px); }
.entity-handle { overflow-wrap: anywhere; font-size: .9rem; }
.entity-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; align-items: stretch; }
.entity-open { grid-column: 1 / -1; display: grid; place-items: center; min-height: 44px; margin: 0; padding: 6px 10px; color: #102318; background: #49d17a; border-radius: 10px; font-weight: 750; text-decoration: none; text-align: center; }
.entity-open:hover { background: #65dd90; }
.entity-actions :is(.entity-save, .entity-share) { min-height: 44px; width: auto; display: flex; align-items: center; justify-content: center; gap: 5px; padding: 6px; border: 1px solid var(--entity-line); border-radius: 9px; background: #fff; color: var(--entity-ink); font-size: .85rem; }
.entity-save::before { width: 15px; height: 15px; }
.entity-actions .entity-save[aria-pressed="true"] { background: #d6efde; }
.entity-share-status { grid-column: 1 / -1; margin: 0; font-size: .8rem; color: var(--entity-muted); }
.entity-share-status:empty { display: none; }
.entity-share-input { grid-column: 1 / -1; width: 100%; min-height: 38px; padding: 4px 7px; border-radius: 6px; border: 1px solid var(--entity-line); }
.entity-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: clamp(16px, 3vw, 28px) 0 0; padding-top: 16px; border-top: 1px solid var(--entity-line); }
.entity-stats > div { padding-left: 12px; border-left: 1px solid var(--entity-line); }
.entity-stats > div:first-child { padding-left: 0; border: 0; }
.entity-stats dt, .entity-facts dt { color: var(--entity-muted); font-size: .8rem; }
.entity-stats dd { margin: 4px 0 0; font-weight: 750; font-size: clamp(.92rem, 2vw, 1.25rem); }
.entity-sections { display: flex; flex-wrap: wrap; gap: 12px; padding-inline: 14px; background: #f7f9f7; border: 1px solid var(--entity-line); border-top: 0; }
.entity-sections button { min-height: 44px; padding: 5px 2px; border: 0; border-radius: 0; background: transparent; color: #25633b; font-size: .86rem; }
.entity-sections button:hover { text-decoration: underline; text-underline-offset: 4px; }
.entity-content { display: grid; grid-template-columns: minmax(0, 2.25fr) minmax(0, 1fr); align-items: start; gap: 14px; margin-top: 16px; }
.entity-panel { min-width: 0; padding: clamp(12px, 2vw, 22px); border: 1px solid var(--entity-line); border-radius: 13px; background: #fff; overflow-wrap: anywhere; }
.entity-panel h2 { margin: 0 0 9px; font-size: 1.14rem; scroll-margin-top: 14px; }
.entity-panel p { margin: 0; color: var(--entity-muted); }
.entity-description { --description-lines: 6; max-height: calc(var(--description-lines) * 1lh); overflow: hidden; white-space: pre-line; }
.entity-description.is-expanded { max-height: none; }
.entity-description-toggle { min-height: 44px; margin-top: 4px; padding: 2px 0; border: 0; border-radius: 0; background: transparent; color: #25633b; }
.entity-description-toggle:hover { text-decoration: underline; text-underline-offset: 3px; }
.entity-facts dl { margin: 0; }
.entity-facts dl > div { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 5px; padding-block: 8px; border-bottom: 1px solid var(--entity-line); }
.entity-facts dd { margin: 0; font-size: .85rem; }
.entity-facts .entity-footnote { margin-top: 10px; font-size: .79rem; }
.entity-related, #channel-note { margin-top: 14px; }
#channel-note { overflow-wrap:anywhere; }
#channel-bottom-banner { margin-top:16px; }
.main-nav .desktop-blog { display: none; }
@media (min-width: 761px) {
  .masthead-inner { gap: clamp(15px, 3vw, 36px); min-height: 60px; }
  .masthead-inner .brand { flex: none; }
  .masthead-inner #blog-link { display: none; }
  .main-nav { flex: 1; align-items: center; gap: clamp(5px, 1.2vw, 16px); }
  .main-nav a { white-space: nowrap; }
  .main-nav .desktop-blog { display: block; margin-inline-start: auto; }
  .main-nav a[aria-current] { background: transparent; text-decoration: underline 2px; text-underline-offset: 8px; }
  .main-nav .nav-profile { border: 1px solid var(--line); padding-inline: 13px; }
  .main-nav .nav-profile[aria-current] { border-color: var(--accent); text-decoration: none; }
}
@media (max-width: 680px) {
  .entity-description { --description-lines: 5; }
  .entity-header { grid-template-columns: auto minmax(0, 1fr); align-items: start; }
  .entity-actions { grid-column: 1 / -1; }
  .entity-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .entity-stats > div:nth-child(odd) { border: 0; padding-left: 0; }
  .entity-content { grid-template-columns: 1fr; gap: 10px; }
}
:root { --paper:#f5faff; --ink:#17344d; --muted:#536c80; --line:#d8e7f2; --accent:#096d9f; }
.wrap { width:min(1180px,calc(100% - 32px)); }
.masthead-inner { display:grid; grid-template-columns:auto minmax(140px,1fr) auto; gap:14px 24px; padding-top:14px; }
.brand-icon { border-radius:50%; background:#1689c1; color:white; transform:rotate(-16deg); }
.brand { font-size:1.16rem; }
.masthead .home-search-wrap { margin:0; max-width:620px; width:100%; justify-self:center; }
.home-search { background:#f4faff; border-color:var(--line); box-shadow:none; }
.home-search button, .directory-submit { background:#e3f3fe; color:var(--accent); border-color:#c7e3f4; padding-inline:18px; }
@media(min-width:761px){
 .main-nav { grid-column:1/-1; border-top:1px solid var(--line); padding:7px 0; }
 .main-nav a[aria-current] { background:#e7f5ff; text-decoration:none; border-radius:999px; }
}
#home .directory-heading { display:block; margin:28px 0 15px; }
#home .directory-heading h1 { font-size:clamp(24px,3vw,32px); letter-spacing:-.03em; }
#home .directory-heading p { margin-top:7px; }
.home-categories { border:0; padding:0; }
.home-title-row { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; gap:6px 16px; }
.home-title-row a { color:var(--accent); font-size:.875rem; }
#more-topics { display:none; }
.home-category-list { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:10px; }
@media (min-width:761px) {
  #home-topics a:is([href="/category/znamenitosti"], [href="#catalog/znamenitosti"]) { display:none; }
  #home-topics:has(> a:nth-child(11 of a:not([href$="/znamenitosti"]))) > #more-topics {
    display:flex; order:1; align-items:center; justify-content:center;
    border:1px solid var(--line); border-radius:18px; background:white;
    color:var(--accent); font:inherit; font-weight:600; cursor:pointer;
  }
  #home-topics:has(> a:nth-child(11 of a:not([href$="/znamenitosti"]))):has(#more-topics[aria-expanded="false"]) > a:nth-child(n+10 of a:not([href$="/znamenitosti"])) { display:none; }
  #home:has(#home-topics > a:nth-child(11 of a:not([href$="/znamenitosti"]))) .home-title-row a { display:none; }
}
.home-category-list a { flex-direction:column; align-items:flex-start; justify-content:center; gap:7px; min-height:78px; padding:12px 15px; border:1px solid var(--line); border-radius:18px; background:white; }
.topic-symbol { color:#1687bb; font-size:1.4rem; }
.directory-stats { display:flex; flex-wrap:wrap; gap:10px; margin:14px 0 20px; }
.directory-stats a { padding:8px 16px; border-radius:999px; border:1px solid var(--line); background:white; color:var(--muted); text-decoration:none; }
.directory-stats strong { color:var(--accent); }
.section-line .section-tag { padding:0; background:none; font-size:clamp(1.2rem,2.3vw,1.55rem); }
.cards.space-grid { align-items:stretch; }
.space-card, .space-card + .space-card { grid-template-columns:minmax(0,1fr) auto; border:1px solid var(--line); border-radius:20px; padding:14px; gap:8px; background:white; color:var(--ink); box-shadow:0 3px 14px #3377a00a; }
.space-card:hover { border-color:#84bedb; box-shadow:0 6px 20px #3377a018; }
.space-topic { color:var(--accent); background:#e8f6ff; border-radius:999px; }
.space-card .card-header { display:flex; grid-column:1/-1; grid-row:2; gap:10px; align-items:center; }
.space-card .card-header .avatar { display:grid; width:42px; flex:0 0 42px; border-radius:14px; background:#d9effc; color:var(--accent); }
.space-card .card-title-link { color:var(--ink); }
.space-card .space-description { color:var(--muted); }
.space-card .space-meta { background:#f2f9fe; color:var(--muted); border-radius:12px; margin:3px 0 0; padding:7px 10px; }
.space-card .favorite::before, .space-card .preview-toggle::before { filter:none; }
.space-card .favorite[aria-pressed="true"] { background:#dbefff; }
.space-card :focus-visible { outline-color:var(--accent); }
#channel { --entity-ink:var(--ink); --entity-muted:var(--muted); --entity-line:var(--line); }
.entity-hero { background:linear-gradient(115deg,#edf8ff,#dcedfa); border-radius:22px; }
.entity-open,.entity-open:hover { background:var(--accent); color:white; border-radius:999px; }
.entity-open { border:0; cursor:pointer; font-family:inherit; font-size:inherit; }
#telegram-choice {
  position:fixed; inset:0; margin:auto; width:min(390px,calc(100% - 32px)); max-height:calc(100dvh - 32px);
  padding:30px 22px 22px; overflow:auto; text-align:center; color:#153755;
  background:white; border:1px solid #d4e6f5; border-radius:22px; box-shadow:0 18px 70px #123b593d;
}
#telegram-choice::backdrop { background:#15355069; }
.choice-close { position:absolute; top:6px; right:6px; width:44px; height:44px; border:0; border-radius:50%; color:#506b80; background:transparent; font-size:26px; cursor:pointer; }
#choice-avatar .avatar { width:64px; height:64px; border-radius:50%; margin:0 auto 12px; }
.pack-overview { display:grid; gap:14px; margin-block:14px; }
.pack-overview > img,.pack-related-link img { border-radius:14px; }
.pack-overview p:empty { display:none; }
#pack-samples:not([hidden]) { display:flex; gap:8px; overflow-x:auto; min-width:0; padding:8px; background:#f1f8fd; border-radius:14px; }
#pack-samples img { flex:none; width:clamp(72px,14vw,88px); height:auto; aspect-ratio:1; }
@media (min-width: 701px) {
  #pack-samples:not([hidden]) { display:grid; grid-auto-flow:column; grid-auto-columns:minmax(0,1fr); }
  #pack-samples img { width:100%; height:clamp(100px,12vw,168px); object-fit:contain; }
}
.pack-related-link { display:flex; align-items:center; gap:12px; padding:10px 0; text-decoration:none; color:var(--ink); border-bottom:1px solid var(--line); }
.pack-related-link span { margin-left:auto; }
.pack-related-link:last-child { border-bottom:0; }
#choice-name { margin:0; font-size:1.4rem; line-height:1.2; overflow-wrap:anywhere; }
#choice-question { margin:7px 0 20px; color:#536c80; }
.choice-action { display:flex; align-items:center; justify-content:center; gap:9px; min-height:48px; border:1px solid #0874af; border-radius:12px; font-weight:700; text-decoration:none; }
.choice-action svg { width:22px; height:22px; }
#choice-app { color:white; background:#0874af; }
#choice-web { color:#086ca5; margin-top:8px; }
#choice-services { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; border-top:1px solid #deebf4; margin-top:16px; padding-top:14px; }
#choice-services > .choice-service { grid-column:span 2; }
#choice-services > .choice-service:nth-of-type(3n) { grid-column:2 / span 2; }
#choice-services:empty { display:none; }
.choice-service {
  --service-fill:#ffd3b0; --service-ink:#5d280e; --service-line:#eaa072;
  display:grid; grid-template-columns:16px minmax(0,1fr) 12px; align-items:center; gap:4px;
  padding:5px 7px; min-height:44px; border:1px solid var(--service-line); border-radius:10px;
  background:linear-gradient(110deg,var(--service-fill),#fff8 150%),var(--service-fill); color:var(--service-ink);
  text-align:left; font-size:.875rem; line-height:1.2; font-weight:650; text-decoration:none;
}
.choice-service:nth-of-type(even) { --service-fill:#dfccff; --service-ink:#43246e; --service-line:#b293dd; }
.service-heading { grid-column:1/-1; margin:0 0 2px; color:#36536b; font-size:.92rem; font-weight:650; text-align:left; }
.service-icon { font-size:15px; overflow:hidden; }
.service-name { overflow-wrap:anywhere; }
.service-arrow { font-size:14px; text-align:center; }
.choice-service { position:relative; }
#choice-services:has(.service-age) { row-gap:11px; }
.service-age { position:absolute; top:-7px; right:6px; padding:1px 5px; border:1px solid white; border-radius:8px; background:var(--service-ink); color:white; font-size:10px; line-height:13px; font-weight:700; white-space:nowrap; }
.choice-service:hover,.choice-service:focus-visible { border-color:var(--service-ink); box-shadow:0 2px 7px #2632491f; }
.choice-service:active { background:var(--service-fill); }
.entity-panel,.profile-ad,.profile-group,.recommendation-panel { background:white; border:1px solid var(--line); border-radius:20px; }
.recommendation-panel { padding:clamp(12px,2vw,22px); }
.filter-trigger,.profile-ad-placements label:has(:checked),.ad-pay-facts,.footer-quote { background:#eaf6fe; border-color:var(--line); }
.ad-banner:not([data-banner-color]) { --banner-edge:#c8e2f2; --banner-bg:#e8f6ff; --banner-ink:#13648e; --banner-chip:#d9efff; }
.ad-banner { border-radius:18px; }
#pack-banner { background:transparent; border:0; }
#pack-banner.photo-banner { display:block; padding:0; min-height:0; }
#pack-banner.photo-banner a, #pack-banner.photo-banner img { border-radius:18px; }
#channel { position:relative; }
#right-ad { display:none; }
@media (min-width:1600px) {
  #right-ad:not([hidden]) { display:grid; position:absolute; top:0; left:calc(100% + 20px); width:160px; height:600px; padding:12px; grid-template-columns:1fr; }
  #right-ad :is(strong,:is(.ad-link,.editorial-feature-link)) { grid-column:1; }
}
#catalog .photo-banner, #home .photo-banner, #channel .photo-banner, #right-ad.photo-banner { padding:0; border:0; overflow:hidden; display:block; }
#right-ad[hidden] { display:none; }
.photo-banner .ad-label { display:none; }
.photo-banner :is(.ad-link,.editorial-feature-link), .photo-banner img { display:block; width:100%; }
.photo-banner :is(.ad-link,.editorial-feature-link) { position:relative; }
:is(#home,#channel,#catalog) .photo-banner:not(#right-ad) :is(.ad-link,.editorial-feature-link) { aspect-ratio:2360/240; }
#right-ad.photo-banner :is(.ad-link,.editorial-feature-link) { height:100%; }
@media(max-width:700px) { :is(#home,#channel,#catalog) .photo-banner:not(#right-ad) :is(.ad-link,.editorial-feature-link) { aspect-ratio:4/1; } }
.photo-banner .creative-caption { position:absolute; inset:0; display:grid; place-items:center; }
.photo-banner img { position:relative; opacity:0; }
.photo-banner img.creative-loaded { opacity:1; }
.photo-banner :is(.ad-link,.editorial-feature-link):has(.creative-loaded) .creative-caption { visibility:hidden; }
:is(#home,#channel,#catalog) .photo-banner:not(#right-ad) img { aspect-ratio:2360/240; }
#right-ad.photo-banner img { aspect-ratio:160/600; }
@media(max-width:700px) { :is(#home,#channel,#catalog) .photo-banner:not(#right-ad) img { aspect-ratio:4/1; } }
#ad-artwork label { display:grid; gap:6px; margin-block:8px; }

@media(max-width:760px){
 .masthead-inner { grid-template-columns:1fr auto; padding-block:10px; gap:8px; }
 .masthead .home-search-wrap { grid-column:1/-1; grid-row:2; max-width:none; }
 .masthead .header-submit { display:none; }
 .home-category-list { grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; }
 .directory-stats, #catalog > .resource-tabs { flex-wrap:nowrap; overflow-x:auto; overscroll-behavior-x:contain; gap:8px; padding:2px; }
 .directory-stats a, #catalog > .resource-tabs a { flex:none; white-space:nowrap; }
 #more-topics:not([hidden]) { display:flex; flex-direction:column; justify-content:center; align-items:flex-start; gap:7px; min-height:69px; padding:9px; border:1px solid var(--line); border-radius:18px; background:white; color:var(--accent); font:inherit; font-size:.77rem; font-weight:600; }
 #more-topics::before { content:""; width:9px; height:9px; margin:0 0 3px 2px; border:solid currentColor; border-width:0 2px 2px 0; transform:rotate(45deg); }
 #more-topics[aria-expanded="true"]::before { transform:rotate(225deg); }
 #home:has(#more-topics:not([hidden])) .home-title-row a { display:none; }
 #home:has(#more-topics:not([hidden])[aria-expanded="false"]) .home-category-list a:nth-child(n+5) { display:none; }
 .home-category-list a { padding:9px; min-height:69px; font-size:.77rem; }
 .main-nav { z-index:4; border-radius:20px; }
}
.resource-tabs { display:flex; flex-wrap:wrap; gap:8px; margin-block:16px; }
.resource-tabs a { display:inline-flex; align-items:center; min-height:42px; padding:6px 16px; border:1px solid var(--line); border-radius:999px; background:white; text-decoration:none; }
.resource-tabs a[aria-current] { background:var(--accent); color:white; }
.directory-faq { margin-top:28px; }
.directory-faq details { border:1px solid var(--line); background:white; padding:12px 16px; border-radius:16px; margin:8px 0; }
.directory-faq summary { cursor:pointer; font-weight:600; }
.directory-faq p { max-width:75ch; }
.directory-faq a { color:var(--accent); }
.main-nav a.desktop-section { display:none; }
@media(min-width:761px){ .main-nav a.desktop-section { display:inline-flex; } }
.space-card:has(.preview-toggle) .card-header > div { padding-right:0; }
.space-card .card-header .favorite { flex:0 0 36px; }
.space-card .card-header .preview-toggle { flex:0 0 32px; align-self:center; margin:0; }
@media(min-width:821px) { .cards.space-grid:has(.preview-toggle) { --space-columns:3; } }
#profile { margin-top:24px; }
#profile-title { margin-bottom:18px; }
.profile-layout { grid-template-columns:205px minmax(0,1fr); gap:18px; }
.profile-menu { position:sticky; top:14px; grid-column:1; display:grid; align-content:start; gap:4px; padding:8px; background:#fff; border:1px solid var(--line); border-radius:18px; }
.profile-menu a { display:flex; align-items:center; gap:10px; min-height:46px; padding:8px 12px; color:var(--muted); font-weight:600; text-decoration:none; border-radius:12px; }
.profile-menu a[aria-current] { background:#e4f4ff; color:#075c89; }
.profile-menu a:hover { background:#eff8fe; }
.profile-menu small { margin-left:auto; min-width:18px; text-align:center; font-variant-numeric:tabular-nums; }
.profile-layout > [data-profile-panel] { grid-column:2; grid-row:1; min-width:0; padding:clamp(15px,2.5vw,26px); margin:0; }
#profile .profile-group + .profile-group { margin:0; }
#profile .section-line { flex-wrap:wrap; }
#profile #propose-channel { background:var(--accent); color:white; font-weight:650; padding:8px 14px; border-radius:12px; }
#profile .empty { background:#f5faff; padding:20px; }
#profile .empty p { margin-bottom:0; }
#profile .empty a { display:inline-block; margin-top:12px; color:var(--accent); }
#profile #ad-order-history { margin:12px 0; padding:12px; border:1px solid var(--line); border-radius:12px; }
@media(min-width:761px){
 #ad-draft-form { max-width:720px; }
 .profile-ad-placements { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; }
 .profile-ad-placements label { border:1px solid var(--line); align-items:center; flex-wrap:wrap; }
}
@media(max-width:760px){
 .profile-layout { grid-template-columns:minmax(0,1fr); gap:12px; }
 .profile-menu { position:static; grid-column:1; grid-row:1; grid-template-columns:repeat(3,minmax(0,1fr)); padding:4px; gap:2px; }
 .profile-menu a { min-width:0; justify-content:center; flex-wrap:wrap; align-content:center; gap:3px; font-size:.84rem; padding:5px 2px; }
 .profile-menu a svg { width:100%; height:17px; }
 .profile-menu small { min-width:0; margin:0; }
 .profile-layout > [data-profile-panel] { grid-row:2; grid-column:1; }
 .submission-group li { grid-template-columns:minmax(0,1fr); }
 .submission-group .profile-actions { grid-column:1; grid-row:auto; flex-flow:row wrap; justify-content:flex-start; gap:8px; }
}
.editorial-link { display:grid; gap:4px; color:var(--ink); text-decoration:none; }
.editorial-link small,.publication-body small { color:var(--accent); font-weight:650; }
.editorial-link:hover { border-color:var(--accent); }
.publication-body { max-width:76ch; padding:clamp(16px,4vw,32px); border:1px solid var(--line); border-radius:18px; background:white; overflow-wrap:anywhere; }
.publication-body p { white-space:pre-line; line-height:1.65; }
.publication-body li + li { margin-top:10px; }
.inline-resource-card { display:grid; gap:4px; border:1px solid #bfd9ea; border-left:4px solid #1680b2; border-radius:14px; padding:14px 17px; margin-block:12px; background:#f4faff; color:#17344d; text-decoration:none; }
.editorial-cover { display:block; width:100%; max-height:420px; object-fit:cover; border-radius:14px; margin:0 0 12px; }
.editorial-link .editorial-cover { max-height:210px; }
#catalog-pages:not([hidden]) { display: flex; justify-content: center; flex-wrap: wrap; align-items: center; gap: 4px; margin: 24px auto; }
#catalog-pages button { min-height: 40px; min-width: 32px; padding: 4px 8px; border: 1px solid #c8dfef; border-radius: 10px; color: #145278; background: white; cursor: pointer; }
#catalog-pages button[aria-current] { background: #096d9b; border-color: #096d9b; color: white; }
#catalog-pages button:disabled { opacity: .5; cursor: default; }
