/* Loaded last, only by the isolated local configuration. */
body[data-local-lab='true'] {
  --lab-ink: #f1e9d8;
  --lab-muted: #b8c1b5;
  --lab-gold: #e3c28d;
  --lab-line: #c1ad7e42;
  --lab-panel: #1c2823;
  --lab-radius: 22px;
}
body[data-local-lab='true']:is(.common-home, .server-body, .lab-shell) {
  color: var(--lab-ink);
  background: radial-gradient(ellipse at 12% 0%, #283d32 0, transparent 45%), #121b17;
}
body[data-local-lab='true'] :is(.lab-header, [data-lab-home], .lab-leaderboard) { box-sizing: border-box; }
body[data-local-lab='true'] :is(.lab-header, [data-lab-home], .lab-leaderboard) *,
body[data-local-lab='true'] :is(.lab-header, [data-lab-home], .lab-leaderboard) *::before,
body[data-local-lab='true'] :is(.lab-header, [data-lab-home], .lab-leaderboard) *::after { box-sizing: border-box; }
body[data-local-lab='true'] .lab-header.app-header {
  min-height: 78px;
  gap: 12px 20px;
  padding: 12px max(20px, calc((100vw - 1380px) / 2));
  border-bottom: 1px solid var(--lab-line);
  background: #142019f5;
  box-shadow: 0 6px 24px #08120b26;
}
body[data-local-lab='true'] .lab-header .brand-seal { width: 40px; height: 40px; border-radius: 13px; }
body[data-local-lab='true'] .lab-header .brand-button strong { font: 600 25px/1.1 Georgia, serif; letter-spacing: -.03em; }
body[data-local-lab='true'] .lab-header .app-nav { position: static; flex: none; order: 0; width: auto; gap: 4px; padding: 3px; border-radius: 13px; background: #0b160e75; }
body[data-local-lab='true'] .lab-header .nav-button { display: inline-flex; align-items: center; min-height: 44px; padding: 9px 12px; font-size: 14px; color: #bdc8bb; }
body[data-local-lab='true'] .lab-header .nav-button:is(.active, [aria-current='page']) { color: #f6e2b9; border-radius: 10px; background: #d5b57c19; }
body[data-local-lab='true'] .lab-header .portal-date { flex: 1; order: 0; min-width: 0; margin: 0; color: #b6c0b1; font: 500 14px/1.4 system-ui, sans-serif; text-align: right; text-transform: none; }
body[data-local-lab='true'] .lab-header .account-zone { margin-left: 0; }
body[data-local-lab='true'] .lab-header .profile-button { margin-top: 0 !important; }
body[data-local-lab='true'] .lab-header .news-link { font-size: 13px; }
body[data-local-lab='true'] :is(.lab-header, [data-lab-home], .lab-leaderboard) :is(a, button, summary, input, select):focus-visible { outline: 3px solid #f0ce8e; outline-offset: 4px; }
body[data-local-lab='true'] [data-lab-home] { max-width: 1380px; margin: auto; padding: clamp(22px, 4vw, 50px) 0 44px; }
body[data-local-lab='true'] .lab-home-heading { margin: 0; }
body[data-local-lab='true'] .lab-kicker { margin: 0 0 12px; color: var(--lab-gold); font: 650 11px/1.5 system-ui, sans-serif; letter-spacing: .16em; text-transform: uppercase; }
body[data-local-lab='true'] .lab-home-heading .world-sr-only { position:absolute; width:1px; height:1px; margin:-1px; padding:0; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
body[data-local-lab='true'] .lab-home-intro { margin: 14px 0 0; color: var(--lab-muted); font-size: 16px; line-height: 1.6; }
body[data-local-lab='true'] .lab-day-progress { display: grid; gap: 8px; min-width: 210px; padding: 16px 20px; border: 1px solid var(--lab-line); border-radius: 17px; background: #e3c28d06; color: var(--lab-muted); font: 13px/1.5 system-ui, sans-serif; }
body[data-local-lab='true'] .lab-day-progress strong { font-size: 16px; font-weight: 600; color: #e5d4ac; }
body[data-local-lab='true'] .lab-day-progress progress { width: 100%; height: 5px; accent-color: #dfbf87; border: 0; border-radius: 5px; background: #d5ba7f20; }
body[data-local-lab='true'] .lab-day-progress progress::-webkit-progress-bar { border-radius: 5px; background: #d5ba7f20; }
body[data-local-lab='true'] .lab-day-progress progress::-webkit-progress-value { border-radius: 5px; background: #dfbf87; }
body[data-local-lab='true'] .lab-section-title { margin: 0 0 17px; font: 500 clamp(22px, 2.4vw, 28px)/1.25 Georgia, serif; letter-spacing: -.02em; }
body[data-local-lab='true'] #home-view[data-lab-home] .world-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch; gap: 20px; margin: 0; }
body[data-local-lab='true'] #home-view[data-lab-home] [data-lab-card] { display: flex; flex-direction: column; min-width: 0; overflow: hidden; border: 1px solid #aa906248; border-radius: var(--lab-radius); background: linear-gradient(155deg, #26382b, #1a241d 80%); box-shadow: inset 0 1px 0 #f2d6a411, 0 12px 26px #06100b45; transition: border-color .18s, box-shadow .18s, transform .18s; }
body[data-local-lab='true'] #home-view[data-lab-home] [data-lab-card='gallery'] { border-color: #92bcb34d; background: linear-gradient(155deg, #223b37, #172927 80%); }
body[data-local-lab='true'] #home-view[data-lab-home] [data-lab-card='scriptorium'] { border-color: #8aafc45c; background: linear-gradient(155deg, #223444, #192631 80%); }
body[data-local-lab='true'] #home-view[data-lab-home] [data-lab-card='table'] { background: linear-gradient(155deg, #2b3028, #1c241f 80%); }
body[data-local-lab='true'] [data-lab-home] [data-lab-card]:focus-within { border-color: var(--lab-gold); box-shadow: inset 0 1px 0 #f2d6a411, 0 10px 30px #06100b66; }
body[data-local-lab='true'] [data-lab-card] .world-scene { position: relative; flex: none; min-height: 0; height: auto; aspect-ratio: 16 / 8.4; margin: 9px; border: 1px solid #efdab327; border-radius: 15px; overflow: hidden; }
body[data-local-lab='true'] [data-lab-card] .world-scene::after { content: ''; pointer-events: none; position: absolute; z-index: 4; inset: 5px; border: 1px solid #f7e5bd20; border-radius: 10px; }
body[data-local-lab='true'] [data-lab-card] .world-content { display: flex; flex: 1; flex-direction: column; min-width: 0; padding: 16px 23px 23px; }
body[data-local-lab='true'] [data-lab-card] .world-label span { color: #d0be99; font: 600 10px/1.4 system-ui, sans-serif; letter-spacing: .17em; }
body[data-local-lab='true'] [data-lab-card='gallery'] .world-label span { color: #b7d2c7; }
body[data-local-lab='true'] [data-lab-card='scriptorium'] .world-label span { color: #b8cede; }
body[data-local-lab='true'] [data-lab-card] .world-content h3 { min-height: 0; margin: 12px 0 0; color: #f2e6ce; font: 500 clamp(25px, 2.45vw, 33px)/1.15 Georgia, serif; letter-spacing: -.025em; }
body[data-local-lab='true'] [data-lab-card] .lab-world-description { margin: 11px 0 18px; color: #c3cbbd; font-size: 14px; line-height: 1.65; }
body[data-local-lab='true'] [data-lab-card] .world-content ul { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 18px; padding: 0; list-style: none; }
body[data-local-lab='true'] [data-lab-card] .world-content ul[hidden] { display: none; }
body[data-local-lab='true'] [data-lab-card] .world-content li { padding: 4px 7px; background: #f2d5aa08; border: 1px solid #e7d4a813; border-radius: 6px; color: #c3c9bb; font-size: 12px; line-height: 1.5; }
body[data-local-lab='true'] [data-lab-card] .world-footer { display: flex; align-items: center; gap: 10px; margin-top: auto; padding-top: 17px; border-top: 1px solid #c9b98b26; }
body[data-local-lab='true'] [data-lab-card] .world-footer strong { color: #c8ccb9; font: 500 12px/1.5 system-ui, sans-serif; }
body[data-local-lab='true'] .lab-world-enter.auberge-button { min-height: 44px; margin-left: auto; padding: 10px 14px; border: 1px solid #cfa97278; border-radius: 11px; background: #b3874a1c; color: #f4dbaf; box-shadow: inset 0 1px 0 #f5e4c00c; text-decoration: none; font: 600 13px/1.5 system-ui, sans-serif; }
body[data-local-lab='true'] [data-lab-card='gallery'] .lab-world-enter { background: #abc8b412; border-color: #a0c0ad6b; color: #dbead6; }
body[data-local-lab='true'] [data-lab-card='scriptorium'] .lab-world-enter { background: #8cb2cf12; border-color: #92bad07a; color: #d8e9f0; }
body[data-local-lab='true'] .lab-arrow { margin-left: 9px; font-size: 17px; }
body[data-local-lab='true'] .lab-applications { margin-top: 38px; }
body[data-local-lab='true'] .lab-section-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 5px 20px; margin-bottom: 17px; }
body[data-local-lab='true'] .lab-section-heading .lab-section-title { margin: 0; }
body[data-local-lab='true'] .lab-section-heading > p { margin: 0; color: var(--lab-muted); font-size: 14px; line-height: 1.5; }
body[data-local-lab='true'] .lab-app-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
body[data-local-lab='true'] #home-view[data-lab-home] .lab-app-grid [data-lab-card] { display: grid; grid-template-columns: 34% minmax(0, 1fr); }
/* The SVG's intrinsic ratio must not enlarge a narrow grid track over its text. */
body[data-local-lab='true'] #home-view[data-lab-home] .lab-app-grid .world-scene { margin: 9px 0 9px 9px; align-self: stretch; width: auto; min-width: 0; max-width: 100%; height: auto; aspect-ratio: auto; min-height: 160px; }
body[data-local-lab='true'] .lab-app-grid .scene-art { display: block; width: 100%; min-width: 0; max-width: 100%; height: 100%; object-fit: contain; }
body[data-local-lab='true'] .lab-app-grid .world-content { padding: 20px; }
body[data-local-lab='true'] .lab-app-grid .world-content h3 { margin: 0; font-size: 26px; }
@media (hover: hover) {
  body[data-local-lab='true'] [data-lab-home] [data-lab-card]:hover { transform: translateY(-3px); border-color: #d9c18c88; box-shadow: inset 0 1px 0 #f2d6a422, 0 18px 28px #06100b66; }
  body[data-local-lab='true'] .lab-world-enter:hover { background: #d1a46030; border-color: #f0cf95; }
}
@media (max-width: 1100px) {
  body[data-local-lab='true'] .lab-header.app-header { flex-wrap: wrap; gap: 8px 14px; }
  body[data-local-lab='true'] .lab-header .portal-date { order: 5; flex-basis: 100%; text-align: left; font-size: 13px; }
  body[data-local-lab='true'] .lab-header .account-zone { margin-left: auto; }
  body[data-local-lab='true'] [data-lab-card] .world-content { padding-inline: 18px; }
  body[data-local-lab='true'] .lab-app-grid .world-content { padding: 18px; }
}
@media (max-width: 800px) {
  body[data-local-lab='true'] #home-view[data-lab-home] .world-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body[data-local-lab='true'] .lab-app-grid { grid-template-columns: minmax(0, 1fr); }
  body[data-local-lab='true'] #home-view[data-lab-home] .lab-app-grid [data-lab-card] { grid-template-columns: 30% minmax(0, 1fr); }
}
@media (max-width: 600px) {
  body[data-local-lab='true'] .lab-header.app-header { gap: 8px; padding: 10px 16px; }
  body[data-local-lab='true'] .lab-header .brand-button strong { font-size: 22px; }
  body[data-local-lab='true'] .lab-header .brand-seal { width: 35px; height: 35px; }
  body[data-local-lab='true'] .lab-header .app-nav { order: 6; width: 100%; justify-content: stretch; }
  body[data-local-lab='true'] .lab-header .nav-button { flex: 1; justify-content: center; gap: 5px; padding: 9px 6px; font-size: 13px; white-space: normal; text-align: center; }
  body[data-local-lab='true'] .lab-header .portal-date { order: 5; flex-basis: auto; width: 100%; text-align: center; }
  body[data-local-lab='true'] .lab-header :is(.header-profile-name, .server-profile-name) { display: none; }
  body[data-local-lab='true'] .lab-header .news-link { display: none; }
  body[data-local-lab='true'] [data-lab-home] { padding-top: 24px; }
  body[data-local-lab='true'] .lab-home-heading { display: block; }
  body[data-local-lab='true'] .lab-home-intro { font-size: 15px; }
  body[data-local-lab='true'] .lab-day-progress { width: 100%; min-width: 0; margin-top: 20px; padding: 13px 16px; }
  body[data-local-lab='true'] #home-view[data-lab-home] .world-grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  body[data-local-lab='true'] [data-lab-card] .world-scene { aspect-ratio: 16 / 7.2; }
  body[data-local-lab='true'] [data-lab-card] .world-content h3 { font-size: 30px; }
  body[data-local-lab='true'] [data-lab-card] .world-content { padding: 14px 20px 20px; }
  body[data-local-lab='true'] .lab-applications { margin-top: 30px; }
  body[data-local-lab='true'] #home-view[data-lab-home] .lab-app-grid [data-lab-card] { grid-template-columns: 28% minmax(0, 1fr); }
  body[data-local-lab='true'] .lab-app-grid .world-content { padding: 17px; }
  body[data-local-lab='true'] .lab-app-grid .world-content h3 { font-size: 24px; }
  body[data-local-lab='true'] .lab-app-grid .world-content ul { margin: 10px 0 14px; }
  body[data-local-lab='true'] .lab-app-grid .world-content li { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  body[data-local-lab='true'] [data-lab-home] *, body[data-local-lab='true'] [data-lab-home] *::before, body[data-local-lab='true'] [data-lab-home] *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  body[data-local-lab='true'] [data-lab-home] [data-lab-card]:hover { transform: none; }
}

body[data-local-lab='true'] #home-view .home-score-card { display: none !important; }
