@import url('https://fonts.googleapis.com/css2?family=Pixelify+Sans:wght@400;500;600;700&family=Silkscreen:wght@400;700&display=swap');

/* PERNOCTALIAN.SPACE — crisp little pixel-diary refresh */
:root {
  color-scheme: light;
  --bg: #edf5f2;
  --paper: #fbfdfb;
  --paper-deep: #e4efeb;
  --ink: #354a46;
  --muted-ink: #627873;
  --accent: #4f9c91;
  --accent-dark: #315f59;
  --accent-soft: #d5eee7;
  --border: #8eb9ae;
  --shadow: #315f5933;
  --pink: #e7bfc9;
  --pixel-font: "Silkscreen", "Courier New", monospace;
  --body-font: "Pixelify Sans", "Courier New", monospace;
  --hard-shadow: 5px 5px 0 var(--shadow);
  --small-shadow: 3px 3px 0 var(--shadow);
}

html[data-theme="mint"] {
  color-scheme: light;
  --bg: #edf5f2; --paper: #fbfdfb; --paper-deep: #e4efeb;
  --ink: #354a46; --muted-ink: #627873; --accent: #4f9c91;
  --accent-dark: #315f59; --accent-soft: #d5eee7; --border: #8eb9ae;
  --shadow: #315f5933;
}
html[data-theme="rose"] {
  color-scheme: light;
  --bg: #f7edf0; --paper: #fffafb; --paper-deep: #f2dfe5;
  --ink: #59404a; --muted-ink: #806570; --accent: #c77991;
  --accent-dark: #81495d; --accent-soft: #f4d8e1; --border: #d9a6b5;
  --shadow: #81495d30;
}
html[data-theme="lilac"] {
  color-scheme: light;
  --bg: #f0edf8; --paper: #fcfbff; --paper-deep: #e5def3;
  --ink: #48415e; --muted-ink: #706985; --accent: #8d7db5;
  --accent-dark: #5a4c82; --accent-soft: #e1daf1; --border: #b5a9d2;
  --shadow: #5a4c8230;
}
html[data-theme="butter"] {
  color-scheme: light;
  --bg: #fbf5df; --paper: #fffdf4; --paper-deep: #f3eac5;
  --ink: #554a32; --muted-ink: #796d50; --accent: #b19346;
  --accent-dark: #74602d; --accent-soft: #f2e7b9; --border: #d2bd79;
  --shadow: #74602d30;
}
html[data-theme="ocean"] {
  color-scheme: light;
  --bg: #e9f1f8; --paper: #fbfdff; --paper-deep: #dce8f2;
  --ink: #344958; --muted-ink: #607887; --accent: #5787a5;
  --accent-dark: #365a72; --accent-soft: #d4e5f0; --border: #9bbbd0;
  --shadow: #365a7230;
}
html[data-theme="evil"] {
  color-scheme: dark;
  --bg: #080608; --paper: #151013; --paper-deep: #211015;
  --ink: #f6e9eb; --muted-ink: #b58a91; --accent: #cf092c;
  --accent-dark: #ff334f; --accent-soft: #360b14; --border: #741024;
  --shadow: #000000b8;
}

*, *::before, *::after { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; scrollbar-color: var(--accent) var(--accent-soft); }
body {
  min-width: 320px; margin: 0; padding: 74px 20px 36px; color: var(--ink);
  background-color: var(--bg);
  background-image: radial-gradient(color-mix(in srgb, var(--accent) 25%, transparent) 1.2px, transparent 1.4px);
  background-size: 18px 18px;
  font: 16px/1.55 var(--body-font);
  transition: background-color .2s ease, color .2s ease;
}
img, iframe, video { max-width: 100%; }
a { color: var(--accent-dark); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
button, input, select { font: inherit; }
button, select { color: var(--ink); background: var(--paper); border: 2px solid var(--border); border-radius: 3px; box-shadow: 3px 3px 0 var(--shadow); }
button { padding: 7px 10px; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease; }
button:hover, select:hover { background: var(--accent-soft); }
button:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--shadow); }
button:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--shadow); }
:focus-visible { outline: 3px dashed var(--accent); outline-offset: 3px; }

.site-shell { width: min(1000px, 100%); margin: 0 auto; }
.theme-switcher {
  position: absolute; z-index: 1200; top: 8px; right: 10px; left: auto; display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; color: var(--ink); background: var(--paper); border: 2px solid var(--border);
  box-shadow: var(--small-shadow); font: 10px/1.4 var(--pixel-font);
}
.theme-switcher label { color: var(--accent-dark); }
.theme-switcher select { max-width: 130px; padding: 4px 6px; font: 11px var(--body-font); }

.site-header {
  position: relative; isolation: isolate; margin: 0 0 22px; padding: 25px 24px 16px; text-align: center;
  background: var(--paper); border: 2px solid var(--border); box-shadow: var(--hard-shadow);
}
.site-header::before { content: ""; position: absolute; z-index: -1; inset: 7px; border: 1px dashed var(--border); pointer-events: none; }
.site-logo { display: inline-block; color: var(--accent-dark); font: clamp(18px, 3.3vw, 30px)/1.5 var(--pixel-font); text-decoration: none; letter-spacing: -1px; }
.site-logo:hover { color: var(--accent); }
.sparkle { color: var(--pink); }
.site-tagline { margin: 5px 0 12px; color: var(--muted-ink); font-size: 14px; }
.header-status { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 13px; padding-top: 10px; border-top: 1px dashed var(--border); font-size: 12px; }
#status-clock, .weather-station { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; background: var(--accent-soft); border: 1px solid var(--border); }
.weather-icon { color: var(--accent-dark); }
.weather-station strong { color: var(--accent-dark); }
.visitor-weather { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 3px 8px; max-width: 100%; padding: 4px 8px; background: var(--paper-deep); border: 1px dashed var(--border); font-size: 11px; }
.visitor-weather button { padding: 3px 7px; font-size: 11px; }
.visitor-weather p { margin: 0; }
.visitor-weather small { color: var(--muted-ink); font-size: 10px; }
.weather-credit { font-size: 10px; }

.intro-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(220px, .8fr); gap: 16px; margin-bottom: 25px; align-items: stretch; }
.panel, .feed-section, .guestbook-panel {
  min-width: 0; color: var(--ink); background: var(--paper); border: 2px solid var(--border); box-shadow: var(--hard-shadow);
  transition: transform .18s ease, box-shadow .18s ease, background-color .2s ease;
}
.panel:hover, .feed-section:hover, .guestbook-panel:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--shadow); }
.welcome-panel, .visitor-panel { padding: 15px 18px; }
h2, .widget-title { color: var(--accent-dark); }
.panel h2, .widget-title { margin: 0 0 10px; font: 12px/1.7 var(--pixel-font); }
.welcome-panel h2 { padding-bottom: 8px; border-bottom: 2px solid var(--accent-soft); }
.welcome-panel p { margin: 9px 0; }
.reminder { padding: 3px 11px; border-left: 3px solid var(--pink); }
.reminder p:first-child { margin-top: 5px; }
.reminder p:last-child { margin-bottom: 5px; }
.visitor-panel { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.visitor-frame { display: block; width: 300px; max-width: 100%; height: 100px; border: 0; }
.muted-text { margin: 5px 0 0; color: var(--muted-ink); font-size: 12px; }
.legacy-link { display: inline-block; padding: 1px 5px; color: var(--accent-dark); background: var(--accent-soft); border: 1px dashed var(--border); text-decoration: none; }

main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "diary tv" "photos guestbook" "universe playlist"; gap: 20px; align-items: stretch; }
.feed-grid, .lower-grid, .lower-widgets { display: contents; }
.feed-grid > .feed-section:nth-child(1) { grid-area: diary; }
.feed-grid > .feed-section:nth-child(2) { grid-area: tv; }
.photos-section { grid-area: photos; }
.guestbook-section { grid-area: guestbook; min-width: 0; display: flex; flex-direction: column; }
.extras-panel { grid-area: universe; }
.music-panel { grid-area: playlist; }
.feed-section { display: flex; flex-direction: column; min-width: 0; padding: 12px; }
.section-heading-row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 10px; min-height: 35px; margin: 0 0 8px; padding: 0 2px 7px; border-bottom: 2px solid var(--accent-soft); }
.section-heading { margin: 0; color: var(--accent-dark); font: 11px/1.6 var(--pixel-font); }
.section-kicker { color: var(--muted-ink); font-size: 11px; }
.feed-frame { display: block; width: 100%; height: 480px; border: 1px solid var(--border); background: var(--paper); }
.photos-frame { height: 380px; }
.widget-title { padding-bottom: 8px; border-bottom: 2px solid var(--accent-soft); }
.guestbook-section > .widget-title { margin: 0 0 8px; }
.guestbook-panel { flex: 1; min-height: 360px; padding: 10px; }
.guestbook-frame { display: block; width: 100%; height: 100%; min-height: 340px; border: 1px solid var(--border); background: var(--paper); }
.extras-panel, .music-panel { padding: 14px; }
.eight-ball-prompt, .music-label, .music-footer { color: var(--muted-ink); font-size: 12px; }
.eight-ball-prompt { margin: 0 0 10px; }
.eight-ball-form { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.eight-ball-form input { flex: 1 1 180px; min-width: 0; padding: 8px 9px; color: var(--ink); background: var(--paper); border: 2px solid var(--border); border-radius: 2px; }
.eight-ball-form button { font: 9px var(--pixel-font); }
.eight-ball { display: grid; place-items: center; min-height: 80px; margin-top: 13px; padding: 10px; background: var(--accent-soft); border: 1px dashed var(--border); text-align: center; }
.eight-ball-window { max-width: 100%; padding: 7px 12px; background: var(--paper); border: 1px solid var(--border); box-shadow: 2px 2px 0 var(--shadow); }
.eight-ball output { color: var(--accent-dark); font: 10px/1.8 var(--pixel-font); }
.music-label { margin: -3px 0 8px; }
.spotify-frame { overflow: hidden; padding: 5px; background: var(--paper-deep); border: 1px solid var(--border); }
.spotify-frame iframe { display: block; width: 100%; max-width: 100%; }
.music-footer { margin: 8px 0 0; }

.site-footer { margin: 24px auto 0; padding: 17px; color: var(--muted-ink); background: var(--paper); border: 2px solid var(--border); box-shadow: var(--small-shadow); text-align: center; font-size: 12px; }
.site-footer p { margin: 3px 0; }
.site-footer a { display: inline-block; margin-top: 6px; }

.postit-sidebar { position: fixed; z-index: 1100; right: 17px; bottom: 15px; width: min(245px, calc(100vw - 30px)); }
.postit-card { color: var(--ink); background: var(--paper); border: 2px solid var(--border); box-shadow: var(--hard-shadow); }
.postit-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 9px; background: var(--accent-soft); border-bottom: 1px solid var(--border); font: 9px var(--pixel-font); }
.postit-heading a { color: var(--accent-dark); text-decoration: none; }
.postit-heading button { min-width: 27px; padding: 0 5px; font-size: 17px; line-height: 1.2; }
.postit-content { height: 220px; padding: 7px; }
.postit-content iframe { display: block; width: 100%; height: 100%; border: 1px solid var(--border); }
.postit-card.is-collapsed .postit-content { display: none; }
#music-toggle, .back-top { position: fixed; z-index: 1150; bottom: 15px; padding: 7px 10px; color: var(--accent-dark); background: var(--paper); border: 2px solid var(--border); box-shadow: var(--small-shadow); font: 9px var(--pixel-font); text-decoration: none; }
#music-toggle { left: 15px; }
.back-top { right: 15px; }
.musicbox { display: none; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* Diary and TV can expand into a focused reading view on desktop. */
.spotlight-placeholder { visibility: hidden; }
.spotlight-active { position: fixed !important; z-index: 1002 !important; max-width: none !important; max-height: 100vh !important; margin: 0 !important; overflow: auto; transform: none !important; box-shadow: 0 0 0 2px var(--border), 0 18px 60px #0005 !important; transition: width .3s ease, height .3s ease, top .3s ease, left .3s ease !important; }
.spotlight-active .feed-frame { width: 100% !important; height: calc(100vh - 60px) !important; }
body.spotlight-open::before { content: ""; position: fixed; z-index: 1000; inset: 0; background: #10151b66; backdrop-filter: blur(5px); }
/* Keep the tab row (including palette.exe) behind the spotlight overlay. */
body.spotlight-open .spotlight-tabs { position: relative; z-index: 999; }

@media (max-width: 760px) {
  body { padding: 82px 13px 30px; }
  .intro-grid { grid-template-columns: minmax(0, 1fr); }
  main { grid-template-columns: minmax(0, 1fr); grid-template-areas: "diary" "tv" "photos" "guestbook" "universe" "playlist"; gap: 15px; }
  .feed-frame { height: 410px; }
  .photos-frame { height: 340px; }
  .guestbook-panel { min-height: 320px; }
  .guestbook-frame { min-height: 300px; }
  .theme-switcher { padding: 6px; }
  .site-header { padding: 22px 13px 13px; }
  .postit-sidebar { right: 10px; bottom: 15px; width: min(220px, calc(100vw - 20px)); }
}
@media (max-width: 450px) {
  body { padding-right: 10px; padding-left: 10px; }
  .site-logo { font-size: clamp(14px, 5vw, 21px); }
  .site-tagline { font-size: 12px; }
  .header-status { gap: 5px; font-size: 11px; }
  .visitor-weather { width: 100%; }
  .section-heading-row { align-items: flex-start; flex-direction: column; gap: 2px; }
  .feed-frame { height: 360px; }
  .photos-frame { height: 300px; }
  .postit-content { height: 190px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* Palette-matched custom cursors */
:root {
  --site-cursor: url("https://cdn.cursors-4u.net/previews/cute-polka-dotted-green-bow-tie-ribbon-9f6cfb1b-32.webp") 32 32;
}
html[data-theme="rose"] {
  --site-cursor: url("https://cdn.cursors-4u.net/css-previews/colorful-rose-5e81d196-css.webp") 0 0;
}
html[data-theme="lilac"] {
  --site-cursor: url("https://cdn.cursors-4u.net/previews/purple-design-pointer-fff0529c-32.webp") 32 32;
}
html[data-theme="butter"] {
  --site-cursor: url("https://cdn.cursors-4u.net/previews/butter-08f44c53-32.webp") 32 32;
}
html[data-theme="ocean"] {
  --site-cursor: url("https://cdn.cursors-4u.net/previews/cool-blue-outer-glow-pointer-4e42efa9-32.webp") 36 35;
}
html[data-theme="evil"] {
  --site-cursor: url("https://cdn.cursors-4u.net/previews/devil-16b16f86-32.webp") 38 33;
}
body, body * { cursor: var(--site-cursor), auto !important; }
a, button, select, label[for] { cursor: var(--site-cursor), pointer !important; }
input, textarea, [contenteditable="true"] { cursor: text !important; }

/* Desktop: fixed-screen dashboard; the diary/TV cards provide the spotlight view. */
@media (min-width: 761px) and (min-height: 650px) {
  html, body { height: 100%; overflow: hidden; }
  body { height: 100dvh; padding-top: 66px; padding-bottom: 30px; }
  .site-shell {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    gap: 10px;
    height: 100%;
    min-height: 0;
  }
  .site-header { margin: 0; padding: 14px 20px 10px; }
  .site-logo { font-size: clamp(18px, 2vw, 25px); }
  .site-tagline { margin: 2px 0 7px; font-size: 12px; }
  .header-status { padding-top: 6px; gap: 4px 9px; }
  .intro-grid { min-height: 0; margin: 0; gap: 10px; }
  .welcome-panel, .visitor-panel { padding: 9px 13px; overflow: auto; }
  .welcome-panel p { margin: 5px 0; }
  main {
    min-height: 0;
    grid-template-rows: repeat(3, minmax(0, 1fr));
    gap: 10px;
    overflow: hidden;
  }
  main > .feed-section, main > .guestbook-section,
  main > .extras-panel, main > .music-panel { min-height: 0; overflow: hidden; }
  .feed-section { padding: 8px; }
  .section-heading-row { min-height: 25px; margin-bottom: 4px; padding-bottom: 4px; }
  .feed-frame, .photos-frame { flex: 1 1 0; height: 0; min-height: 0; }
  .guestbook-section > .widget-title { flex: 0 0 auto; }
  .guestbook-panel { flex: 1 1 0; min-height: 0; padding: 6px; overflow: auto; }
  .guestbook-frame { min-height: 0; height: 100%; }
  .extras-panel, .music-panel { padding: 9px; }
  .eight-ball { min-height: 44px; margin-top: 5px; padding: 6px; }
  .eight-ball-form { gap: 5px; }
  .eight-ball-form input { padding: 5px 7px; }
  .music-footer { margin-top: 4px; }
  .site-footer { margin: 0; padding: 6px 10px; }
  .site-footer p { display: inline; margin: 0 8px; }
  .spotlight-active { max-height: 100dvh !important; }
  .spotlight-active .feed-frame { height: calc(100dvh - 60px) !important; min-height: 0 !important; }
}

/* Keep small screens usable instead of squeezing every panel into one viewport. */
@media (max-width: 760px), (max-height: 649px) {
  html, body { height: auto; overflow: auto; }
  .site-shell { display: block; height: auto; }
}

/* Clickable section labels act like tabs for the spotlight view. */
.spotlight-tab {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  margin: 0;
  padding: 4px 8px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-bottom: 3px solid var(--accent);
  border-radius: 3px 3px 0 0;
  box-shadow: 2px 2px 0 var(--shadow);
  font: 10px/1.6 var(--pixel-font);
  text-align: left;
}
.spotlight-tab:hover, .spotlight-tab[aria-expanded="true"] {
  color: var(--paper);
  background: var(--accent);
  border-color: var(--accent-dark);
}
.section-heading-row .spotlight-tab { margin-bottom: -5px; }
.guestbook-section > .spotlight-tab { margin: 0 0 8px; }
.extras-panel > .spotlight-tab, .music-panel > .spotlight-tab { margin-bottom: 5px; }
.spotlight-close {
  position: fixed;
  z-index: 10003;
  top: 10px;
  right: 12px;
  padding: 6px 10px;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--border);
  box-shadow: 3px 3px 0 var(--shadow);
  font: 9px var(--pixel-font);
}
.spotlight-active { max-height: 100dvh !important; }
.spotlight-active .feed-frame,
.spotlight-active .photos-frame { height: calc(100dvh - 60px) !important; min-height: 0 !important; }
.spotlight-active .guestbook-panel { height: calc(100dvh - 85px); min-height: 0; flex: 1 1 auto; }
.spotlight-active .guestbook-frame { height: 100%; min-height: 0; }
.spotlight-active .spotify-frame iframe { height: min(65dvh, 560px) !important; }
.spotlight-active .eight-ball { min-height: 120px; }
@media (max-width: 760px) {
  .spotlight-tab { max-width: 100%; font-size: 9px; }
  .spotlight-close { top: 8px; right: 8px; }
}

/* These four sections appear as tabs until opened. */
.photos-section:not(.spotlight-active) > .photos-frame,
.photos-section:not(.spotlight-active) .section-kicker,
.guestbook-section:not(.spotlight-active) > .guestbook-panel,
.extras-panel:not(.spotlight-active) > :not(.spotlight-tab),
.music-panel:not(.spotlight-active) > :not(.spotlight-tab) {
  display: none !important;
}
.photos-section:not(.spotlight-active),
.extras-panel:not(.spotlight-active),
.music-panel:not(.spotlight-active) {
  align-self: start !important;
  width: fit-content;
  max-width: 100%;
  height: auto !important;
  min-height: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  transform: none !important;
}
.photos-section:not(.spotlight-active) .section-heading-row {
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.photos-section:not(.spotlight-active):hover,
.extras-panel:not(.spotlight-active):hover,
.music-panel:not(.spotlight-active):hover {
  box-shadow: none !important;
  transform: none !important;
}

/* Compact spotlights: width is set to about half the screen by the script. */
.spotlight-active.photos-section .photos-frame {
  flex: none !important;
  width: 100% !important;
  height: min(55dvh, 440px) !important;
}
.spotlight-active.guestbook-section {
  display: flex !important;
  flex-direction: column;
}
.spotlight-active.guestbook-section .guestbook-panel {
  flex: none !important;
  width: 100%;
  height: min(58dvh, 460px) !important;
  min-height: 0 !important;
  overflow: auto;
}
.spotlight-active.guestbook-section .guestbook-frame {
  height: 100% !important;
  min-height: 0 !important;
}
.spotlight-active.extras-panel,
.spotlight-active.music-panel {
  display: flex !important;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  overflow: auto;
}
.spotlight-active.photos-section { gap: 8px; }
.spotlight-active.photos-section .photos-frame { min-width: 0; max-width: 100%; }
.spotlight-active.music-panel { justify-content: flex-start; }
.spotlight-active.music-panel .spotify-frame { width: 100%; min-width: 0; box-sizing: border-box; }
.spotlight-active.music-panel .spotify-frame iframe { width: 100% !important; max-width: 100%; }
.spotlight-active.music-panel .spotify-frame iframe {
  height: 352px !important;
}
.spotlight-active.extras-panel .eight-ball { min-height: 100px; }
@media (max-width: 760px) {
  .spotlight-active.photos-section .photos-frame { height: min(48dvh, 360px) !important; }
  .spotlight-active.guestbook-section .guestbook-panel { height: min(52dvh, 380px) !important; }
  .spotlight-active.music-panel .spotify-frame iframe { height: 300px !important; }
}

/* One horizontal spotlight-tab strip across the desktop page. */
.spotlight-tabs {
  grid-area: tabbar;
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
  padding: 3px 4px 7px;
  scrollbar-width: thin;
}
.spotlight-tabs .spotlight-tab { flex: 0 0 auto; white-space: nowrap; }
.spotlight-tabs .theme-switcher {
  position: static;
  top: auto;
  right: auto;
  left: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  width: auto;
  margin: 0;
  padding: 4px 8px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-bottom: 3px solid var(--accent);
  border-radius: 3px 3px 0 0;
  box-shadow: 2px 2px 0 var(--shadow);
  font: 10px/1.6 var(--pixel-font);
  transform: none;
}
.spotlight-tabs .theme-switcher label { color: inherit; white-space: nowrap; }
.spotlight-tabs .theme-switcher select {
  width: auto;
  max-width: 100px;
  padding: 0;
  color: inherit;
  background: transparent;
  border: 0;
  font: inherit;
  cursor: pointer;
}
.spotlight-tabs .theme-switcher select option {
  color: var(--ink);
  background: var(--paper);
}
.spotlight-tabs .theme-switcher:hover,
.spotlight-tabs .theme-switcher:focus-within {
  color: var(--paper);
  background: var(--accent);
  border-color: var(--accent-dark);
}
main {
  grid-template-areas:
    "tabbar tabbar"
    "diary tv"
    "photos guestbook"
    "universe playlist";
  grid-template-rows: auto repeat(3, minmax(0, 1fr));
}
@media (min-width: 761px) and (min-height: 650px) {
  main { grid-template-rows: auto repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .spotlight-tabs {
    flex-wrap: wrap;
    overflow: visible;
    padding-bottom: 5px;
  }
  main {
    grid-template-areas:
      "tabbar"
      "diary"
      "tv"
      "photos"
      "guestbook"
      "universe"
      "playlist";
    grid-template-rows: auto;
  }
}

/* Keep the four requested sections as tabs until their spotlight opens. */
.photos-section:not(.spotlight-active) .section-heading-row,
.photos-section:not(.spotlight-active) > .photos-frame,
.guestbook-section:not(.spotlight-active) > *,
.extras-panel:not(.spotlight-active) > :not(.spotlight-tab),
.music-panel:not(.spotlight-active) > :not(.spotlight-tab) {
  display: none !important;
}
.photos-section:not(.spotlight-active),
.extras-panel:not(.spotlight-active),
.music-panel:not(.spotlight-active) {
  align-self: start !important;
  width: 0;
  height: 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  transform: none !important;
}

/* Put the tab strip immediately after the header, then use the last row for Diary and TV. */
body { padding-top: 18px; }
.site-shell { grid-template-rows: auto auto auto minmax(0, 1fr) auto; gap: 7px; }
.site-header { margin-bottom: 0; }
.spotlight-tabs {
  grid-area: auto;
  width: 100%;
  margin: 0;
  padding: 2px 4px 5px;
}
main {
  grid-template-areas:
    "photos guestbook"
    "universe playlist"
    "diary tv";
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 9px;
  min-height: 0;
}
@media (min-width: 761px) and (min-height: 650px) {
  body { padding-top: 18px; padding-bottom: 24px; }
  .site-shell { grid-template-rows: auto auto auto minmax(0, 1fr) auto; gap: 7px; }
  main { grid-template-rows: auto auto minmax(0, 1fr); }
  .feed-section { min-height: 0; }
  .feed-frame { min-height: 0; }
}
@media (max-width: 760px) {
  body { padding-top: 18px; }
  .site-shell { display: block; height: auto; }
  .spotlight-tabs { margin: 7px 0 10px; }
  main {
    grid-template-areas:
      "photos"
      "guestbook"
      "universe"
      "playlist"
      "diary"
      "tv";
    grid-template-rows: auto;
  }
}

/* Phone and tablet: show every section in the normal scroll layout, without spotlights. */
@media (max-width: 1024px) {
  html, body { height: auto !important; overflow: auto !important; }
  body { padding-top: 18px !important; }
  /* Touch screens can leave :hover stuck; keep TV Babble steady and inside its column. */
  #tv-section {
    width: 100%;
    min-width: 0;
    overflow: hidden;
  }
  #tv-section:hover {
    transform: none;
    box-shadow: var(--hard-shadow);
  }
  #tv-section .feed-frame {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
  .theme-switcher {
    position: static;
    width: fit-content;
    margin: 0 auto 8px;
    transform: none;
  }
  .site-shell { display: block !important; height: auto !important; min-height: 0; }
  .spotlight-tabs {
    display: flex !important;
    flex-wrap: wrap;
    justify-content: center;
    overflow: visible;
    margin: 0 0 8px;
    padding: 0;
  }
  .spotlight-tabs .spotlight-tab { display: none !important; }
  .intro-grid { grid-template-columns: minmax(0, 1fr); }
  main {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "diary" "tv" "photos" "guestbook" "universe" "playlist";
    grid-template-rows: auto;
    gap: 15px;
    overflow: visible;
  }
  .photos-section:not(.spotlight-active),
  .extras-panel:not(.spotlight-active),
  .music-panel:not(.spotlight-active) {
    width: auto !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 12px !important;
    overflow: visible !important;
    background: var(--paper) !important;
    border: 2px solid var(--border) !important;
    box-shadow: var(--hard-shadow) !important;
  }
  .photos-section:not(.spotlight-active) .section-heading-row,
  .photos-section:not(.spotlight-active) .section-kicker,
  .photos-section:not(.spotlight-active) > .photos-frame,
  .guestbook-section:not(.spotlight-active) > *,
  .extras-panel:not(.spotlight-active) > :not(.spotlight-tab),
  .music-panel:not(.spotlight-active) > :not(.spotlight-tab) {
    display: revert !important;
  }
  .photos-section:not(.spotlight-active) .section-heading-row { display: flex !important; }
  .photos-section:not(.spotlight-active) > .photos-frame {
    width: 100%;
    height: 340px;
  }
  .guestbook-section:not(.spotlight-active) > .guestbook-panel {
    display: block !important;
    min-height: 320px;
  }
  .guestbook-section:not(.spotlight-active) .guestbook-frame {
    height: 300px;
    min-height: 300px;
  }
}
