/* p3ts / brighter together
   Source presentation layer. Loaded after styles.css; the game and its geometry
   remain authoritative. Every rule is gated by successful UI enhancement. */
#app { --p3ts-presentation-ready: 1; }
#app.p3ts-bright {
  --p-paper: #fff;
  --p-wash: #f5f8ff;
  --p-ink: #20232c;
  --p-muted: #536078;
  --p-blue: #126ee1;
  --p-blue-soft: #eaf3ff;
  --p-line: #dce4ef;
  --p-shadow: 0 14px 42px #263f641a;
  --p-round: 24px;
  --p-font: 'Avenir Next', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --ink: var(--p-ink);
  --ink2: var(--p-wash);
  --cream: var(--p-ink);
  --muted: var(--p-muted);
  --amber: var(--p-blue);
  --line: var(--p-line);
  --serif: var(--p-font);
  --shadow: var(--p-shadow);
  font-family: var(--p-font);
  color: var(--p-ink);
  background: var(--p-paper);
  height: 100dvh;
  min-width: 320px;
  width: 100%;
}
#app.p3ts-bright *, #app.p3ts-bright *::before, #app.p3ts-bright *::after { box-sizing: border-box; }
#app.p3ts-bright [hidden] { display: none !important; }
#app.p3ts-bright button, #app.p3ts-bright input, #app.p3ts-bright select, #app.p3ts-bright textarea, #app.p3ts-bright summary { font: inherit; }
#app.p3ts-bright button { cursor: pointer; }
#app.p3ts-bright button:disabled { cursor: not-allowed; opacity: .58; }
#app.p3ts-bright :is(button, a, input, select, textarea, summary, canvas):focus-visible { outline: 3px solid #135dbb; outline-offset: 4px; }
#app.p3ts-bright .app-shell { height: 100%; display: grid; grid-template-rows: 68px minmax(0, 1fr) auto; }
#app.p3ts-bright .topbar { display: flex; align-items: center; gap: 24px; padding: 0 30px; background: #fff; border-bottom: 1px solid var(--p-line); z-index: 40; position: relative; }
#app.p3ts-bright .brand { border: 0; background: transparent; padding: 0; width: 118px; min-width: 118px; height: 48px; line-height: 1; }
#app.p3ts-bright .brand > .p3ts-wordmark { display: block; width: 118px; height: 43px; }
#app.p3ts-bright .brand-divider { display: none; }
#app.p3ts-bright .district-switch { order: 3; margin-left: auto; display: flex; align-items: center; gap: 9px; min-height: 44px; padding: 9px 13px; border: 1px solid var(--p-line); border-radius: 999px; background: #f8faff; color: var(--p-muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
#app.p3ts-bright .district-navigation { display: flex; align-items: center; gap: 8px; margin-left: auto; }
#app.p3ts-bright .district-navigation > .nav-item,
#app.p3ts-bright .district-menu > summary { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; min-width: 76px; max-width: none; width: auto; margin: 0; padding: 10px 16px; border-radius: 999px; color: var(--p-muted); background: transparent; font-size: 13px; font-weight: 650; border: 0; line-height: 1; white-space: nowrap; text-decoration: none; cursor: pointer; list-style: none; }
#app.p3ts-bright .district-navigation > .nav-item { flex-direction: row; }
#app.p3ts-bright .district-navigation > .nav-item > svg { width: 20px; height: 20px; flex-shrink: 0; }
#app.p3ts-bright .district-menu { position: relative; }
#app.p3ts-bright .district-menu > summary::-webkit-details-marker { display: none; }
#app.p3ts-bright .district-menu > summary::marker { content: ''; }
#app.p3ts-bright .district-menu[open] > summary, #app.p3ts-bright .district-navigation > .nav-item.active { color: var(--p-blue); background: var(--p-blue-soft); box-shadow: none; }
#app.p3ts-bright .district-menu > summary:hover, #app.p3ts-bright .district-navigation > .nav-item:hover { background: #f0f5fc; color: var(--p-ink); }
#app.p3ts-bright .district-menu[open] > summary > svg { transform: rotate(180deg); }
#app.p3ts-bright .district-menu-panel { position: absolute; top: calc(100% + 16px); right: 0; width: 354px; max-height: calc(100dvh - 128px); overflow: auto; overscroll-behavior: contain; padding: 16px; border: 1px solid var(--p-line); border-radius: var(--p-round); background: #fff; box-shadow: var(--p-shadow); scrollbar-width: thin; }
#app.p3ts-bright .nav-rail { display: block; height: auto; min-height: 0; border: 0; padding: 0; background: transparent; }
#app.p3ts-bright .nav-rail > div:first-child { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
#app.p3ts-bright .nav-rail .nav-item { display: flex; flex-direction: row; justify-content: flex-start; gap: 10px; width: 100%; max-width: none; min-height: 49px; padding: 10px; border: 0; border-radius: 12px; background: transparent; color: var(--p-ink); font-size: 12px; line-height: 1.4; text-align: left; }
#app.p3ts-bright .nav-rail .nav-item svg { width: 20px; height: 20px; color: var(--p-blue); }
#app.p3ts-bright .nav-rail .nav-item.active, #app.p3ts-bright .nav-rail .nav-item:hover { background: var(--p-blue-soft); box-shadow: none; }
#app.p3ts-bright .nav-bottom { display: flex; flex-direction: row; border-top: 1px solid var(--p-line); margin-top: 10px; padding-top: 7px; }
#app.p3ts-bright .rail-paw { display: none; }
#app.p3ts-bright .topbar-actions { display: flex; align-items: center; justify-content: space-between; margin: 8px 0 0; gap: 8px; padding: 12px 0; border-top: 1px solid var(--p-line); }
#app.p3ts-bright .topbar-actions > .icon-button { display: inline-flex; }
#app.p3ts-bright .icon-button, #app.p3ts-bright .profile-button { display: inline-flex; align-items: center; justify-content: center; border: 0; min-width: 44px; width: 44px; min-height: 44px; height: 44px; border-radius: 50%; padding: 8px; background: var(--p-wash); color: var(--p-muted); }
#app.p3ts-bright .icon-button:hover { background: var(--p-blue-soft); color: var(--p-blue); }
#app.p3ts-bright .coin-balance { border: 1px solid var(--p-line); min-height: 44px; display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 999px; color: var(--p-ink); background: #fff9e8; font-size: 13px; font-variant-numeric: tabular-nums; }
#app.p3ts-bright .district-preview { padding: 10px 0 0; border-top: 1px solid var(--p-line); }
#app.p3ts-bright .district-preview h2 { font-size: 12px; font-weight: 650; margin: 0 0 10px; color: var(--p-muted); }
#app.p3ts-bright .view-selector { position: static; display: flex; gap: 4px; width: fit-content; padding: 4px; border: 1px solid var(--p-line); background: var(--p-wash); border-radius: 12px; }
#app.p3ts-bright .view-selector button { min-height: 44px; padding: 8px 12px; border: 0; border-radius: 9px; background: transparent; font-size: 12px; color: var(--p-muted); }
#app.p3ts-bright .view-selector [aria-pressed='true'] { background: #fff; color: var(--p-blue); box-shadow: 0 1px 5px #263f6412; }
#app.p3ts-bright .view-selector span { color: var(--p-muted); font-size: 11px; }
#app.p3ts-bright .app-layout { display: block; min-height: 0; min-width: 0; }
#app.p3ts-bright .world-stage { position: relative; height: 100%; overflow: hidden; isolation: isolate; background: #eaf3fa; }
/* Never tint, replace or resize the collision map independently of Scene. */
#app.p3ts-bright .world-stage canvas { display: block; width: 100%; height: 100%; touch-action: none; }
#app.p3ts-bright .world-heading { position: absolute; top: 20px; left: 24px; max-width: 50%; padding: 10px 14px; border: 1px solid #ffffffa8; background: #fffffff0; border-radius: 14px; text-shadow: none; pointer-events: none; }
#app.p3ts-bright .world-live { display: flex; align-items: center; gap: 7px; font-size: 10px; line-height: 1.4; letter-spacing: .1em; color: var(--p-muted); }
#app.p3ts-bright .world-live i { width: 6px; height: 6px; border-radius: 50%; background: var(--p-blue); box-shadow: none; }
#app.p3ts-bright .world-heading h1 { font: 750 19px/1.3 var(--p-font); letter-spacing: -.5px; margin: 0; color: var(--p-ink); }
#app.p3ts-bright .world-heading h1 span { color: var(--p-blue); }
#app.p3ts-bright .world-heading > p, #app.p3ts-bright .world-live { display: none; }
#app.p3ts-bright .welcome-note { position: absolute; top: 92px; left: 24px; bottom: auto; width: 260px; padding: 20px; border: 1px solid #ffffffd9; border-radius: 26px; background: #fffffffa; box-shadow: var(--p-shadow); backdrop-filter: none; }
#app.p3ts-bright .welcome-note h2 { margin: 0 0 20px; font: 750 24px/1.2 var(--p-font); letter-spacing: -.7px; color: var(--p-ink); }
#app.p3ts-bright .welcome-note .welcome-close { position: absolute; top: 8px; right: 8px; display: grid; place-items: center; min-width: 36px; width: 36px; min-height: 36px; border: 0; border-radius: 50%; background: transparent; color: var(--p-muted); }
#app.p3ts-bright .welcome-note > .button { margin: 0; width: 100%; }
#app.p3ts-bright .district-release-note { margin-top: 15px; }
#app.p3ts-bright .district-release-note > summary { min-height: 36px; padding: 8px 0; cursor: pointer; font-size: 12px; color: var(--p-muted); }
#app.p3ts-bright .district-release-note p { margin: 8px 0; color: var(--p-muted); font-size: 12px; line-height: 1.65; }
#app.p3ts-bright .world-atmosphere { position: absolute; top: 28px; right: 30px; left: auto; display: flex; gap: 7px; }
#app.p3ts-bright .time-pill, #app.p3ts-bright .atmosphere-button { min-height: 44px; height: 44px; background: #fffffff2; border: 1px solid #ffffffcc; box-shadow: 0 4px 15px #263f6412; color: var(--p-muted); backdrop-filter: none; }
#app.p3ts-bright .time-pill { font-size: 12px; padding: 0 15px; gap: 8px; border-radius: 999px; }
#app.p3ts-bright .time-pill svg { color: var(--p-blue); }
#app.p3ts-bright .atmosphere-button { width: 44px; border-radius: 50%; }
#app.p3ts-bright .world-labels button { min-height: 38px; font-size: 12px; padding: 8px 11px; border: 1px solid #ffffffd9; background: #fffffff2; color: var(--p-ink); border-radius: 12px; box-shadow: 0 4px 16px #18365324; backdrop-filter: none; }
#app.p3ts-bright .world-labels button svg { color: var(--p-blue); }
#app.p3ts-bright .world-labels button:hover, #app.p3ts-bright .world-labels .is-destination { background: var(--p-blue-soft); border-color: #8bb8f5; color: #145bad; }
#app.p3ts-bright .pet-inspector { position: absolute; top: 92px; right: 30px; width: 292px; max-height: calc(100% - 220px); overflow-y: auto; padding: 20px; border: 1px solid #ffffffd9; border-radius: 24px; background: #fffffff7; box-shadow: var(--p-shadow); color: var(--p-ink); backdrop-filter: none; scrollbar-width: thin; }
#app.p3ts-bright .eyebrow-label, #app.p3ts-bright .pet-role, #app.p3ts-bright .thought-caption, #app.p3ts-bright .little-plan > span, #app.p3ts-bright .little-plan p, #app.p3ts-bright .friend-row { color: var(--p-muted); font-size: 12px; line-height: 1.5; }
#app.p3ts-bright .pet-profile h2 { font: 750 26px/1.15 var(--p-font); letter-spacing: -.6px; color: var(--p-ink); }
#app.p3ts-bright .pet-status { font-size: 12px; color: #28664f; }
#app.p3ts-bright .avatar { background: #edf4ff; border: 1px solid var(--p-line); }
#app.p3ts-bright .avatar.large { width: 68px; height: 68px; border-radius: 20px; background: #f7f9fd; }
#app.p3ts-bright .avatar img { width: 100%; height: 100%; object-fit: contain; }
#app.p3ts-bright .pet-thought { background: #f5f8ff; border: 1px solid var(--p-line); border-radius: 14px; padding: 12px; }
#app.p3ts-bright .pet-thought > span:first-child { color: #4956a2; }
#app.p3ts-bright .need { font-size: 12px; color: var(--p-muted); }
#app.p3ts-bright .need-value { font-size: 12px; color: var(--p-ink); }
#app.p3ts-bright .need-track { height: 6px; background: #e4ebf5; }
#app.p3ts-bright .need-track i { background: #559c78; }
#app.p3ts-bright .need-track.appetite i { background: #cd9742; }
#app.p3ts-bright .need-track.company i { background: #be6ca0; }
#app.p3ts-bright .need-track.joy i { background: #448ddd; }
#app.p3ts-bright .care-button { min-height: 60px; color: var(--p-ink); background: #f7faff; border: 1px solid var(--p-line); border-radius: 14px; }
#app.p3ts-bright .care-button small { font-size: 11px; color: var(--p-muted); background: #e7edf6; }
#app.p3ts-bright .emote-open { min-height: 44px; font-size: 12px; color: var(--p-blue); }
#app.p3ts-bright .little-plan { border-color: var(--p-line); }
#app.p3ts-bright .little-plan strong { font-size: 13px; }
#app.p3ts-bright .friend-row .avatar { border-color: #fff; background: #edf4ff; }
#app.p3ts-bright .show-companion { position: absolute; top: 92px; right: 30px; min-height: 44px; width: auto; padding: 11px 17px; border: 1px solid #ffffffc9; background: #fff; color: var(--p-ink); border-radius: 999px; font-size: 12px; box-shadow: var(--p-shadow); }
#app.p3ts-bright .emote-popover { top: 92px; right: 338px; background: #fff; color: var(--p-ink); border: 1px solid var(--p-line); border-radius: 20px; box-shadow: var(--p-shadow); }
#app.p3ts-bright .emote-choice { min-height: 64px; background: #f5f8ff; color: var(--p-ink); border-color: var(--p-line); border-radius: 12px; }
#app.p3ts-bright .emote-choice span { font-size: 11px; color: var(--p-muted); }
#app.p3ts-bright .world-tools { position: absolute; left: 30px; bottom: 50px; display: flex; align-items: center; gap: 2px; padding: 5px; border: 1px solid #ffffffca; background: #fffffff5; box-shadow: var(--p-shadow); border-radius: 18px; backdrop-filter: none; }
#app.p3ts-bright .world-tools > span { display: none; }
#app.p3ts-bright .tool-button { min-width: 42px; width: 42px; min-height: 44px; height: 44px; border: 0; border-radius: 12px; color: var(--p-muted); background: transparent; }
#app.p3ts-bright .tool-button:hover { color: var(--p-blue); background: var(--p-blue-soft); }
#app.p3ts-bright .companion-dock { bottom: 50px; border: 1px solid #ffffffc9; border-radius: 18px; background: #fffffff5; box-shadow: var(--p-shadow); backdrop-filter: none; }
#app.p3ts-bright .dock-label { font-size: 10px; color: var(--p-muted); }
#app.p3ts-bright .companion-dock > button { min-height: 44px; font-size: 12px; color: var(--p-muted); border-radius: 12px; }
#app.p3ts-bright .companion-dock > button.active { background: var(--p-blue-soft); box-shadow: none; color: #155fba; }
#app.p3ts-bright .companion-dock small, #app.p3ts-bright .companion-dock strong { color: var(--p-muted); font-size: 11px; }
#app.p3ts-bright .follow-button { position: absolute; right: 30px; bottom: 55px; min-height: 44px; border: 1px solid #ffffffc9; border-radius: 999px; background: #fff; color: var(--p-ink); font-size: 12px; padding: 11px 16px; box-shadow: var(--p-shadow); backdrop-filter: none; }
#app.p3ts-bright .world-instructions, #app.p3ts-bright .engine-status { bottom: 12px; padding: 6px 9px; border-radius: 8px; background: #ffffffed; color: var(--p-muted); font-size: 11px; line-height: 1.45; text-shadow: none; }
#app.p3ts-bright .engine-status { max-width: min(54%, 620px); right: 24px; overflow-wrap: anywhere; }
#app.p3ts-bright .engine-status[data-status='error'] { color: #a32232; background: #fff1f2; }
#app.p3ts-bright .engine-status[data-status='ready']:not(.paused) { display: none; }
#app.p3ts-bright .world-instructions { left: 24px; }
#app.p3ts-bright .app-footer { min-height: 40px; max-height: 30dvh; overflow-y: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 26px; background: #fff; color: var(--p-muted); font-size: 11px; border-top: 1px solid var(--p-line); }
#app.p3ts-bright .app-footer b, #app.p3ts-bright .app-footer button { color: var(--p-muted); font-size: 11px; }
#app.p3ts-bright #save-status { min-width: 0; overflow-wrap: anywhere; }
#app.p3ts-bright .little-story { background: #fff; border: 1px solid var(--p-line); border-radius: 18px; color: var(--p-ink); box-shadow: var(--p-shadow); }
#app.p3ts-bright .little-story strong { font: 700 15px/1.4 var(--p-font); }
#app.p3ts-bright .little-story small, #app.p3ts-bright .little-story > div > span { color: var(--p-muted); font-size: 11px; }

/* All existing panels retain their native dialog and original feature DOM. */
#app.p3ts-bright .panel-dialog { margin: auto; width: min(760px, calc(100vw - 48px)); max-height: calc(100dvh - 48px); padding: 0; border: 1px solid var(--p-line); border-radius: 28px; background: #fff; color: var(--p-ink); box-shadow: 0 26px 100px #122e4e33; }
#app.p3ts-bright .panel-dialog.wide { width: min(1120px, calc(100vw - 48px)); }
#app.p3ts-bright .panel-dialog[open] { display: flex; flex-direction: column; }
#app.p3ts-bright .panel-dialog::backdrop { background: #1d365565; backdrop-filter: blur(5px); }
#app.p3ts-bright .panel-header { display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; gap: 12px; padding: 16px 26px; border-bottom: 1px solid var(--p-line); background: #fff; }
#app.p3ts-bright .panel-brand { display: inline-block; padding-right: 18px; border-right: 1px solid var(--p-line); }
#app.p3ts-bright .panel-brand .p3ts-wordmark { display: block; width: 74px; height: 29px; }
#app.p3ts-bright #panel-title { font-size: 14px; line-height: 1.45; font-weight: 650; color: var(--p-muted); }
#app.p3ts-bright .panel-body { padding: 30px 34px 36px; overflow-y: auto; overscroll-behavior: contain; scrollbar-color: #b7c9e3 transparent; min-height: 0; }
#app.p3ts-bright .section-intro { margin: 0 0 26px; }
#app.p3ts-bright .section-intro h2 { font: 800 38px/1.12 var(--p-font); letter-spacing: -1.2px; margin: 12px 0 15px; color: var(--p-ink); }
#app.p3ts-bright .section-intro > p { color: var(--p-muted); font-size: 14px; line-height: 1.7; }
#app.p3ts-bright .section-kicker { font-size: 11px; color: var(--p-muted); letter-spacing: .1em; }
#app.p3ts-bright .button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 12px 18px; border: 1px solid transparent; border-radius: 999px; font-size: 13px; font-weight: 650; line-height: 1.4; }
#app.p3ts-bright .button.primary { color: #fff; background: var(--p-blue); border-color: transparent; }
#app.p3ts-bright .button.primary:hover:not(:disabled) { background: #0d5cc4; box-shadow: 0 5px 18px #126ee128; }
#app.p3ts-bright .button.secondary, #app.p3ts-bright .button.tiny, #app.p3ts-bright .button.pet-choice { color: var(--p-ink); background: #f7faff; border-color: var(--p-line); font-size: 13px; }
#app.p3ts-bright .button.subtle { color: var(--p-blue); }
#app.p3ts-bright .button.danger { background: #fff0f1; border-color: #edb5bc; color: #982434; }
#app.p3ts-bright .button:hover:not(:disabled), #app.p3ts-bright .care-button:hover:not(:disabled) { border-color: #aecbf0; }
#app.p3ts-bright :is(input, select, textarea) { color: var(--p-ink); background: #fff; border: 1px solid #b7c5d9; border-radius: 12px; font-size: 14px; line-height: 1.5; min-height: 44px; padding: 10px 12px; max-width: 100%; }
#app.p3ts-bright textarea { width: 100%; resize: vertical; }
#app.p3ts-bright option { background: #fff; color: var(--p-ink); }
#app.p3ts-bright input[type='checkbox'] { min-width: 24px; min-height: 24px; accent-color: var(--p-blue); }
#app.p3ts-bright input[type='range'] { accent-color: var(--p-blue); }
#app.p3ts-bright input::placeholder, #app.p3ts-bright textarea::placeholder { color: #69758a; }
#app.p3ts-bright :is(.companion-card, .place-card, .memory-card, .shop-item, .quest-item, .neighbors-grid > button, .studio-card) { background: #fff; border: 1px solid var(--p-line); border-radius: 20px; color: var(--p-ink); box-shadow: 0 5px 20px #263f6407; }
#app.p3ts-bright :is(.companion-copy h3, .place-card h3, .shop-item h3, .quest-main h3, .settings-section h3, .neighborhood-list-heading h3, .furniture-shelf h3, .memory-copy h3) { font-family: var(--p-font); color: var(--p-ink); font-size: 24px; font-weight: 750; letter-spacing: -.5px; line-height: 1.25; }
#app.p3ts-bright :is(.companion-copy .bio, .place-card p, .shop-item p, .quest-main p, .memory-copy > p, .furniture-shelf > p, .settings-note, .gentle-note) { font-size: 13px; color: var(--p-muted); line-height: 1.7; }
#app.p3ts-bright .companion-art { background: #f3f7fd; }
#app.p3ts-bright .companion-copy > p:first-child { font-size: 11px; color: #4c607e; }
#app.p3ts-bright .interest-tags span { background: #f4f7ff; border-color: #dce5f5; color: var(--p-muted); font-size: 11px; padding: 5px 8px; border-radius: 999px; }
#app.p3ts-bright .neighbors-grid strong { font-size: 13px; }
#app.p3ts-bright .neighbors-grid small, #app.p3ts-bright .neighborhood-list-heading > span { font-size: 12px; color: var(--p-muted); }
#app.p3ts-bright .place-card-icon, #app.p3ts-bright .quest-icon { background: var(--p-blue-soft); border-color: #dae6f7; color: var(--p-blue); }
#app.p3ts-bright .visit-state { color: var(--p-muted); font-size: 11px; }
#app.p3ts-bright .destination-story h2 { color: var(--p-ink); font-weight: 800; }
#app.p3ts-bright .destination-story > p:not(.section-kicker) { font-size: 14px; line-height: 1.7; color: var(--p-muted); }
#app.p3ts-bright .tabs { border-color: var(--p-line); }
#app.p3ts-bright .tab, #app.p3ts-bright .activity-tab { min-height: 44px; font-size: 13px; color: var(--p-muted); border-color: var(--p-line); }
#app.p3ts-bright .tab.active, #app.p3ts-bright .activity-tab.active { background: var(--p-blue-soft); color: var(--p-blue); border-color: #b9d5fa; }
#app.p3ts-bright .memory-copy > small, #app.p3ts-bright .memory-footer { font-size: 12px; color: var(--p-muted); }
#app.p3ts-bright .market-balance { color: var(--p-ink); border-color: var(--p-line); }
#app.p3ts-bright .market-balance strong { color: var(--p-ink); }
#app.p3ts-bright .market-balance > span, #app.p3ts-bright .market-balance small { color: var(--p-muted); font-size: 12px; }
#app.p3ts-bright .buy-button, #app.p3ts-bright .reward-button { min-height: 44px; font-size: 13px; background: var(--p-blue-soft); color: #135dbb; border: 1px solid #c5dcfb; }
#app.p3ts-bright .buy-button > span, #app.p3ts-bright .reward-button > span, #app.p3ts-bright .quest-reward > span, #app.p3ts-bright .quest-progress small { font-size: 11px; color: var(--p-muted); }
#app.p3ts-bright .setting-row, #app.p3ts-bright .setting-row strong { font-size: 14px; color: var(--p-ink); border-color: var(--p-line); }
#app.p3ts-bright .setting-row small { font-size: 12px; color: var(--p-muted); line-height: 1.6; }
#app.p3ts-bright .room-name { color: var(--p-ink); font-size: 32px; font-weight: 750; }
#app.p3ts-bright .home-top p, #app.p3ts-bright .theme, #app.p3ts-bright .shelf-item > span { font-size: 12px; color: var(--p-muted); }
#app.p3ts-bright .shelf-item { background: var(--p-wash); border-color: var(--p-line); border-radius: 14px; }
#app.p3ts-bright .selected-item-tools { color: var(--p-ink); background: #f5f8ff; border-color: var(--p-line); }
#app.p3ts-bright :is(.arcade-copy h3, .garden-copy h3, .fishing-copy h3, .about-body h2) { color: var(--p-ink); font-family: var(--p-font); font-weight: 800; }
#app.p3ts-bright :is(.arcade-copy > p:not(.game-status), .garden-copy > p:not(.game-status), .fishing-copy > p:not(.game-status), .about-body p) { color: var(--p-muted); font-size: 14px; line-height: 1.75; }
#app.p3ts-bright .arcade-scores strong { color: var(--p-ink); }
#app.p3ts-bright .arcade-scores span, #app.p3ts-bright .game-status, #app.p3ts-bright .engine-facts span { color: var(--p-muted); font-size: 12px; }
/* Dark in-world game/room imagery is deliberately not globally inverted. */
#app.p3ts-bright .studio { color: var(--p-ink); }
#app.p3ts-bright .studio-header h2 { font: 800 38px/1.12 var(--p-font); letter-spacing: -1px; }
#app.p3ts-bright .studio h3 { font: 750 24px/1.25 var(--p-font); letter-spacing: -.4px; color: var(--p-ink); }
#app.p3ts-bright .studio p, #app.p3ts-bright .studio-field, #app.p3ts-bright .studio-summary, #app.p3ts-bright .studio-footer { color: var(--p-muted); font-size: 14px; line-height: 1.7; }
#app.p3ts-bright .studio-tag { color: #5b657c; font-size: 11px; }
#app.p3ts-bright .studio-notice, #app.p3ts-bright .studio-gate, #app.p3ts-bright .studio-empty { background: #f4f7fc; color: var(--p-muted); border: 1px solid var(--p-line); border-radius: 14px; font-size: 13px; line-height: 1.7; }
#app.p3ts-bright .studio-tabs { border-color: var(--p-line); gap: 8px; }
#app.p3ts-bright .studio-tabs [aria-pressed='true'] { background: var(--p-blue-soft); color: var(--p-blue); border-color: #bdd7fa; }
#app.p3ts-bright .studio-status { color: #265f4a; }
#app.p3ts-bright .wallet-recovery .settings-note, #app.p3ts-bright .wallet-recovery .gentle-note { color: var(--p-muted); font-size: 13px; }
#app.p3ts-bright .wallet-recovery a, #app.p3ts-bright .studio a { color: #115dbb; text-decoration: underline; text-underline-offset: 3px; }
#app.p3ts-bright .update-notice { z-index: 80; left: 50%; bottom: 56px; transform: translateX(-50%); max-height: calc(100dvh - 36px); overflow: auto; border: 1px solid #abcaf2; border-radius: 22px; background: #fff; color: var(--p-ink); box-shadow: 0 12px 65px #123b7040; }
#app.p3ts-bright .update-notice p { font-size: 14px; line-height: 1.6; }
#app.p3ts-bright .engine-error { position: absolute; z-index: 30; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(430px, calc(100% - 32px)); max-height: calc(100% - 32px); overflow: auto; padding: 28px; background: #fff; color: var(--p-ink); border: 1px solid #dcb9c1; border-radius: 24px; box-shadow: var(--p-shadow); }
#app.p3ts-bright .engine-error strong { font: 750 25px/1.25 var(--p-font); }
#app.p3ts-bright .engine-error p { font-size: 14px; line-height: 1.7; color: var(--p-muted); overflow-wrap: anywhere; }
#app.p3ts-bright .toast { background: #fff; border: 1px solid var(--p-line); color: var(--p-ink); font-size: 13px; line-height: 1.6; box-shadow: var(--p-shadow); }
#app.p3ts-bright .toast.error { border-color: #dfa3ad; color: #982434; }
#app.p3ts-bright .skip-link { background: #fff; color: #135dbb; }

@media (max-width: 1120px) and (min-width: 741px) {
  #app.p3ts-bright .companion-dock { left: 30px; transform: none; bottom: 50px; }
  #app.p3ts-bright .world-tools { bottom: 115px; }
  #app.p3ts-bright .welcome-note { width: 280px; }
  #app.p3ts-bright .pet-inspector { width: 266px; }
  #app.p3ts-bright .emote-popover { right: 305px; }
}
@media (max-height: 760px) and (min-width: 741px) {
  #app.p3ts-bright .welcome-note { top: 165px; max-height: calc(100% - 300px); overflow: auto; padding: 22px; }
  #app.p3ts-bright .welcome-note h2 { font-size: 28px; }
  #app.p3ts-bright .world-heading { top: 18px; }
  #app.p3ts-bright .pet-inspector { top: 82px; max-height: calc(100% - 175px); }
}
@media (max-width: 740px) {
  #app.p3ts-bright .app-shell { grid-template-rows: 56px minmax(0, 1fr) auto; }
  #app.p3ts-bright .topbar { gap: 10px; padding: 0 18px; }
  #app.p3ts-bright .brand, #app.p3ts-bright .brand > .p3ts-wordmark { width: 82px; min-width: 82px; height: 34px; }
  #app.p3ts-bright .district-switch { font-size: 12px; min-height: 44px; gap: 5px; padding: 8px 11px; }
  #app.p3ts-bright .district-navigation { position: fixed; left: 12px; right: 12px; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 4px; background: #fffffff7; border: 1px solid #e4ebf4; border-radius: 22px; box-shadow: 0 6px 35px #1c3b6529; }
  #app.p3ts-bright .district-navigation > .nav-item, #app.p3ts-bright .district-menu > summary { height: 46px; min-height: 46px; min-width: 0; width: 100%; padding: 10px 8px; gap: 7px; font-size: 12px; }
  #app.p3ts-bright .district-navigation > .nav-item, #app.p3ts-bright .district-menu { min-width: 0; }
  #app.p3ts-bright .district-menu { position: static; }
  #app.p3ts-bright .district-menu-panel { left: 0; right: 0; width: 100%; top: auto; bottom: calc(100% + 10px); max-height: calc(100dvh - 136px - env(safe-area-inset-bottom, 0px)); }
  #app.p3ts-bright .world-heading { top: 12px; left: 12px; padding: 10px 12px; max-width: calc(100% - 120px); width: auto; border-radius: 14px; }
  #app.p3ts-bright .world-heading h1 { font-size: 16px; margin: 0; }
  #app.p3ts-bright .world-heading > p { font-size: 11px; max-width: 280px; }
  #app.p3ts-bright .world-live { font-size: 9px; }
  #app.p3ts-bright .world-atmosphere { top: 12px; right: 12px; left: auto; }
  #app.p3ts-bright .time-pill { min-height: 44px; height: 44px; font-size: 11px; padding: 0 11px; }
  #app.p3ts-bright .time-pill > i, #app.p3ts-bright #season-label { display: none; }
  #app.p3ts-bright .atmosphere-button { min-height: 40px; height: 40px; width: 40px; }
  #app.p3ts-bright .welcome-note { left: 12px; right: 12px; top: auto; bottom: calc(128px + env(safe-area-inset-bottom, 0px)); width: auto; max-height: calc(100% - 205px); overflow: auto; padding: 16px; border-radius: 20px; }
  #app.p3ts-bright .welcome-note h2 { font-size: 20px; margin: 0 28px 12px 0; }
  #app.p3ts-bright .welcome-note .welcome-close { min-height: 36px; min-width: 36px; }
  #app.p3ts-bright .district-release-note > summary { font-size: 11px; }
  #app.p3ts-bright .world-stage:has(.pet-inspector:not([hidden])) .welcome-note { display: none; }
  #app.p3ts-bright .show-companion { top: auto; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); right: 12px; width: auto; min-width: 44px; height: 44px; padding: 10px 14px; font-size: 12px; }
  #app.p3ts-bright .pet-inspector { top: auto; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); left: 12px; right: 12px; width: auto; max-height: min(440px, calc(100% - 150px)); padding: 14px 16px; border-radius: 22px; display: flex; flex-direction: column; overscroll-behavior: contain; }
  #app.p3ts-bright .pet-inspector .inspector-top { order: 0; margin-bottom: 2px; }
  #app.p3ts-bright .pet-inspector .pet-profile { order: 1; margin: 0 0 10px; gap: 10px; }
  #app.p3ts-bright .pet-inspector .avatar.large { width: 44px; height: 44px; border-radius: 14px; }
  #app.p3ts-bright .pet-inspector .pet-profile h2 { font-size: 22px; }
  #app.p3ts-bright .pet-inspector .needs { order: 2; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; margin: 0 0 12px; }
  #app.p3ts-bright .pet-inspector .need { grid-template-columns: 1fr auto; gap: 4px; font-size: 11px; }
  #app.p3ts-bright .pet-inspector .need-track { grid-row: 2; grid-column: 1 / -1; }
  #app.p3ts-bright .pet-inspector .need-value { grid-row: 1; grid-column: 2; font-size: 11px; }
  #app.p3ts-bright .pet-inspector .care-actions { order: 3; margin: 0; }
  #app.p3ts-bright .pet-inspector .care-button { min-height: 44px; flex-direction: row; gap: 6px; font-size: 12px; }
  #app.p3ts-bright .pet-inspector .pet-thought { order: 4; padding: 8px 10px; margin: 10px 0 0; }
  #app.p3ts-bright .pet-inspector .pet-thought > span:first-child { font-size: 16px; }
  #app.p3ts-bright .pet-inspector .emote-open { order: 5; min-height: 44px; margin: 0; }
  #app.p3ts-bright .pet-inspector .settings-note { order: 6; margin: 4px 0; }
  #app.p3ts-bright .world-stage:has(.pet-inspector:not([hidden])) .world-tools { visibility: hidden; }
  #app.p3ts-bright .pet-inspector .little-plan, #app.p3ts-bright .pet-inspector .friend-row { display: none; }
  #app.p3ts-bright .pet-inspector .pet-role, #app.p3ts-bright .pet-status { font-size: 12px; }
  #app.p3ts-bright .emote-popover { top: auto; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); right: 12px; width: calc(100% - 24px); max-height: calc(100% - 150px); z-index: 15; }
  #app.p3ts-bright .world-tools { left: 12px; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); padding: 0; border-radius: 14px; }
  #app.p3ts-bright .world-tools > span { margin: 0 1px; }
  #app.p3ts-bright .tool-button { min-width: 44px; width: 44px; min-height: 44px; height: 44px; }
  #app.p3ts-bright .companion-dock { display: none; } /* Same resident actions remain in Explore > Residents. */
  #app.p3ts-bright .follow-button { right: 18px; bottom: 100px; font-size: 0; min-width: 44px; width: 44px; height: 44px; padding: 10px; }
  #app.p3ts-bright .world-instructions { display: none; } /* Canvas still announces keyboard controls. */
  #app.p3ts-bright .engine-status { bottom: calc(128px + env(safe-area-inset-bottom, 0px)); left: 12px; right: auto; max-width: calc(100% - 24px); font-size: 10px; }
  #app.p3ts-bright .world-stage:has(.pet-inspector:not([hidden])) .engine-status[data-status='ready'], #app.p3ts-bright .world-stage:has(.pet-inspector:not([hidden])) .little-story { display: none; }
  #app.p3ts-bright .app-footer { display: none; }
  #app.p3ts-bright .app-footer.has-save-error { position: fixed; z-index: 45; left: 12px; right: 12px; bottom: calc(72px + env(safe-area-inset-bottom, 0px)); min-height: 44px; display: flex; background: #fff1f2; color: #a32232; padding: 12px; border-radius: 12px; }
  #app.p3ts-bright .app-footer > span:first-child, #app.p3ts-bright .app-footer > button { display: none; }
  #app.p3ts-bright .little-story { left: 18px; right: 18px; bottom: 170px; }
  #app.p3ts-bright .panel-dialog, #app.p3ts-bright .panel-dialog.wide { width: calc(100vw - 16px); max-height: calc(100dvh - 16px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)); border-radius: 23px; }
  #app.p3ts-bright .panel-header { padding: 12px 16px; gap: 8px; }
  #app.p3ts-bright .panel-brand { padding-right: 10px; }
  #app.p3ts-bright .panel-brand .p3ts-wordmark { width: 61px; height: 24px; }
  #app.p3ts-bright #panel-title { font-size: 12px; }
  #app.p3ts-bright .panel-body { padding: 18px 16px 24px; }
  #app.p3ts-bright .section-intro h2, #app.p3ts-bright .studio-header h2 { font-size: 26px; }
  #app.p3ts-bright .companion-grid { grid-template-columns: 1fr; }
  #app.p3ts-bright .place-grid, #app.p3ts-bright .neighbors-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #app.p3ts-bright .place-card h3 { font-size: 19px; }
  #app.p3ts-bright .activity-tabs, #app.p3ts-bright .tabs { overflow-x: auto; max-width: 100%; }
  #app.p3ts-bright .tab, #app.p3ts-bright .activity-tab { font-size: 12px; white-space: nowrap; flex-shrink: 0; }
  #app.p3ts-bright .setting-row { align-items: flex-start; gap: 12px; }
  #app.p3ts-bright .setting-row select { min-width: 0; max-width: 145px; font-size: 13px; }
  #app.p3ts-bright .setting-row input[type='range'] { max-width: 120px; }
  #app.p3ts-bright .studio-grid { grid-template-columns: 1fr; }
  #app.p3ts-bright .studio-tabs { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 8px; }
  #app.p3ts-bright .studio-tabs .button { flex-shrink: 0; }
  #app.p3ts-bright .studio-summary { overflow-wrap: anywhere; }
  #app.p3ts-bright .update-notice { width: calc(100vw - 24px); bottom: calc(190px + env(safe-area-inset-bottom, 0px)); z-index: 35; max-height: calc(100dvh - 300px); flex-direction: column; align-items: stretch; padding: 20px; }
  #app.p3ts-bright .toast-stack { bottom: calc(125px + env(safe-area-inset-bottom, 0px)); width: calc(100vw - 32px); }
  #app.p3ts-bright .panel-dialog .toast-stack { bottom: 14px; }
}
@media (max-height: 460px) and (min-width: 741px) {
  #app.p3ts-bright .app-shell { grid-template-rows: 62px minmax(0, 1fr) auto; }
  #app.p3ts-bright .world-heading { top: 12px; left: 18px; padding: 10px 13px; }
  #app.p3ts-bright .world-heading h1 { font-size: 23px; }
  #app.p3ts-bright .world-heading > p { display: none; }
  #app.p3ts-bright .world-atmosphere { top: 12px; right: 18px; left: auto; }
  #app.p3ts-bright .welcome-note { left: 18px; top: 110px; max-height: calc(100% - 184px); padding: 14px 18px; }
  #app.p3ts-bright .welcome-note h2 { font-size: 20px; }
  #app.p3ts-bright .pet-inspector, #app.p3ts-bright .emote-popover { top: 68px; max-height: calc(100% - 122px); }
  #app.p3ts-bright .show-companion { top: 65px; }
  #app.p3ts-bright .district-menu-panel { max-height: calc(100dvh - 110px); }
  #app.p3ts-bright .world-tools { bottom: 35px; }
  #app.p3ts-bright .companion-dock { display: none; }
  #app.p3ts-bright .follow-button { bottom: 38px; }
  #app.p3ts-bright .world-instructions { display: none; }
  #app.p3ts-bright .engine-status { bottom: 4px; font-size: 10px; }
}
@media (prefers-reduced-motion: no-preference) {
  #app.p3ts-bright .district-navigation, #app.p3ts-bright .welcome-note { animation: p3ts-arrive 240ms ease-out both; }
  #app.p3ts-bright :is(.button, .nav-item, .tool-button, summary) { transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease; }
}
@keyframes p3ts-arrive { from { opacity: .4; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  #app.p3ts-bright *, #app.p3ts-bright *::before, #app.p3ts-bright *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
html.reduced-motion #app.p3ts-bright *, html.reduced-motion #app.p3ts-bright *::before, html.reduced-motion #app.p3ts-bright *::after { animation: none !important; transition: none !important; }
@media (forced-colors: active) {
  #app.p3ts-bright :is(.button, .nav-item, .district-menu > summary, .tool-button, .world-labels button, .icon-button) { border: 1px solid ButtonText; }
  #app.p3ts-bright .district-navigation > .nav-item.active { outline: 2px solid Highlight; }
  #app.p3ts-bright .district-menu-panel, #app.p3ts-bright .panel-dialog { border: 2px solid CanvasText; }
}

/* Keep the supplied raster wordmark at its original proportions. */
#app.p3ts-bright .p3ts-wordmark { object-fit: contain; }

/* Studio appearances are local plan choices, independent of native pet slots. */
#app.p3ts-bright .studio-gallery { min-width: 0; }
#app.p3ts-bright .studio-gallery > h3 { margin: 28px 0 10px; font-size: 30px; font-weight: 800; letter-spacing: -.7px; }
#app.p3ts-bright .studio-family-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 28px; }
#app.p3ts-bright .studio-family-filters .button { min-height: 44px; padding: 10px 15px; border-radius: 999px; font-size: 13px; }
#app.p3ts-bright .studio-family-filters [aria-pressed='true'] { color: #fff; background: var(--p-blue); border-color: var(--p-blue); }
#app.p3ts-bright .studio-gallery-title { margin: 30px 0 16px; color: var(--p-ink); font-size: 20px; font-weight: 750; }
#app.p3ts-bright .studio-appearance-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
#app.p3ts-bright .studio-appearance-card { display: flex; flex-direction: column; min-width: 0; padding: 16px; border: 2px solid var(--p-line); border-radius: 22px; background: var(--p-paper); overflow-wrap: anywhere; }
#app.p3ts-bright .studio-appearance-card.is-selected { border-color: var(--p-blue); background: var(--p-blue-soft); }
#app.p3ts-bright .studio-appearance-card > img { display: block; width: 100%; height: 175px; object-fit: contain; margin: 0 0 16px; }
#app.p3ts-bright .studio-appearance-copy > span { color: var(--p-muted); font-size: 11px; font-weight: 650; line-height: 1.4; }
#app.p3ts-bright .studio-appearance-copy h4 { color: var(--p-ink); font-size: 24px; font-weight: 800; line-height: 1.2; margin: 6px 0 10px; letter-spacing: -.5px; }
#app.p3ts-bright .studio-appearance-copy p { margin: 0 0 12px; color: var(--p-muted); font-size: 13px; line-height: 1.6; }
#app.p3ts-bright .studio-appearance-copy .studio-appearance-quote { color: var(--p-ink); font-weight: 650; }
#app.p3ts-bright .studio-appearance-card > .button { width: 100%; min-width: 0; min-height: 46px; margin-top: auto; padding: 11px 8px; color: var(--p-blue); background: var(--p-blue-soft); font-size: 14px; font-weight: 750; white-space: normal; }
#app.p3ts-bright .studio-appearance-card > [aria-pressed='true'] { color: #fff; background: var(--p-blue); }
#app.p3ts-bright .studio-plan-look { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin: 24px 0; padding: 16px; border: 1px solid var(--p-line); border-radius: 18px; background: var(--p-wash); }
#app.p3ts-bright .studio-plan-look > img { width: 72px; height: 72px; object-fit: contain; }
#app.p3ts-bright .studio-plan-look > div { flex: 1; min-width: 100px; overflow-wrap: anywhere; }
#app.p3ts-bright .studio-plan-look span { display: block; margin-bottom: 6px; color: var(--p-muted); font-size: 12px; }
#app.p3ts-bright .studio-plan-look strong { color: var(--p-ink); font-size: 22px; line-height: 1.25; }
#app.p3ts-bright .studio-pet > div { min-width: 0; overflow-wrap: anywhere; }
#app.p3ts-bright .studio-pet > .studio-portrait { object-fit: contain; flex-shrink: 0; }
@media (max-width: 1050px) {
  #app.p3ts-bright .studio-appearance-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 740px) {
  #app.p3ts-bright .studio-appearance-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  #app.p3ts-bright .studio-appearance-card { padding: 12px 10px; border-radius: 18px; }
  #app.p3ts-bright .studio-appearance-card > img { height: 135px; margin-bottom: 12px; }
  #app.p3ts-bright .studio-appearance-copy h4 { font-size: 22px; }
  #app.p3ts-bright .studio-appearance-copy p { font-size: 12px; }
  #app.p3ts-bright .studio-appearance-card > .button { font-size: 13px; }
  #app.p3ts-bright .studio-plan-look > .button { width: 100%; }
}

/* Secondary world controls use the existing menu and original action buttons. */
#app.p3ts-bright .district-world-controls { border-top: 1px solid var(--p-line); margin-top: 12px; padding-top: 12px; }
#app.p3ts-bright .district-world-controls h2 { font-size: 12px; color: var(--p-muted); margin: 0 0 8px; }
#app.p3ts-bright .district-world-controls > div { display: grid; grid-template-columns: repeat(4, 44px); gap: 6px; }
#app.p3ts-bright .district-world-controls :is(.tool-button,.atmosphere-button,.follow-button) { position: static; width: 44px; min-width: 44px; height: 44px; min-height: 44px; padding: 10px; border: 1px solid var(--p-line); border-radius: 12px; background: var(--p-wash); box-shadow: none; }
#app.p3ts-bright .district-world-controls .follow-button span { display: none; }
#app.p3ts-bright .district-world-controls .follow-button { font-size: 0; }
@media (max-width: 740px) and (max-height: 480px) {
  #app.p3ts-bright .pet-inspector { left: auto; width: min(340px, 60%); top: 8px; max-height: calc(100% - 82px); }
  #app.p3ts-bright .welcome-note { right: auto; width: 250px; bottom: 76px; max-height: calc(100% - 132px); }
}

/* Settings keeps controls aligned without inheriting the old compact form layout. */
#app.p3ts-bright .settings-view { display: grid; gap: 18px; width: 100%; max-width: 560px; min-width: 0; margin: 0 auto; }
#app.p3ts-bright .settings-view .settings-section { min-width: 0; margin: 0; padding: 0 0 16px; border-bottom: 1px solid var(--p-line); }
#app.p3ts-bright .settings-view .settings-section h3 { margin: 0 0 8px; font-size: 18px; font-weight: 750; line-height: 1.3; letter-spacing: -.2px; }
#app.p3ts-bright .settings-view .setting-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; min-width: 0; min-height: 52px; padding: 4px 0; border: 0; font-size: 14px; line-height: 1.4; }
#app.p3ts-bright .settings-view .setting-row > :first-child { min-width: 0; }
#app.p3ts-bright .settings-view .setting-row > span:first-child { gap: 10px; }
#app.p3ts-bright .settings-view .setting-row strong { font-size: 14px; font-weight: 650; line-height: 1.4; }
#app.p3ts-bright .settings-view .setting-row small { margin-top: 3px; font-size: 12px; line-height: 1.45; }
#app.p3ts-bright .settings-view .setting-row svg { flex-shrink: 0; width: 18px; height: 18px; color: var(--p-muted); }
#app.p3ts-bright .settings-view .setting-row select { width: 156px; min-width: 0; max-width: 100%; min-height: 44px; padding: 9px 12px; border-radius: 10px; font-size: 14px; }

/* The native, labelled checkbox supplies semantics and a 52 by 44px target. */
#app.p3ts-bright .settings-view input[type='checkbox'][role='switch'] { appearance: none; -webkit-appearance: none; position: relative; flex-shrink: 0; width: 52px; min-width: 52px; height: 44px; min-height: 44px; margin: 0; padding: 0; border: 0; border-radius: 12px; background: transparent; cursor: pointer; }
#app.p3ts-bright .settings-view input[type='checkbox'][role='switch']::before { content: ''; position: absolute; top: 8px; left: 2px; right: 2px; height: 28px; border: 1px solid #b6c2d3; border-radius: 999px; background: #cad4e1; transition: background-color 160ms ease, border-color 160ms ease; }
#app.p3ts-bright .settings-view input[type='checkbox'][role='switch']::after { content: ''; position: absolute; top: 12px; left: 6px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px #20232c33; transition: transform 160ms ease; }
#app.p3ts-bright .settings-view input[type='checkbox'][role='switch']:checked::before { border-color: var(--p-blue); background: var(--p-blue); }
#app.p3ts-bright .settings-view input[type='checkbox'][role='switch']:checked::after { transform: translateX(20px); }
#app.p3ts-bright .settings-view input[type='checkbox'][role='switch']:focus-visible { outline: 3px solid #135dbb; outline-offset: 2px; }
#app.p3ts-bright .settings-view input[type='checkbox'][role='switch']:disabled { opacity: .58; cursor: not-allowed; }

#app.p3ts-bright .settings-view .setting-volume { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; min-width: 0; padding: 4px 0; font-size: 14px; line-height: 1.4; }
#app.p3ts-bright .settings-view .setting-volume input[type='range'] { display: block; width: 100%; max-width: none; min-width: 0; min-height: 44px; margin: 0; padding: 0; border: 0; background: transparent; }
#app.p3ts-bright .settings-view .setting-time { display: grid; grid-template-columns: minmax(0, 1fr); align-items: stretch; gap: 8px; min-width: 0; padding: 8px 0 0; font-size: 14px; line-height: 1.4; }
#app.p3ts-bright .settings-view .time-buttons { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; min-width: 0; }
#app.p3ts-bright .settings-view .time-buttons > .button { width: 100%; min-width: 0; min-height: 44px; margin: 0; padding: 8px 6px; border-radius: 10px; font-size: 12px; font-weight: 650; line-height: 1.3; white-space: normal; }
#app.p3ts-bright .settings-view .time-buttons > [aria-pressed='true'] { border-color: var(--p-blue); color: var(--p-blue); background: var(--p-blue-soft); }
#app.p3ts-bright .settings-view p { margin: 0; color: var(--p-muted); font-size: 13px; line-height: 1.55; overflow-wrap: anywhere; }

#app.p3ts-bright .settings-view .settings-details { min-width: 0; border: 1px solid var(--p-line); border-radius: 12px; background: var(--p-wash); }
#app.p3ts-bright .settings-view .settings-details > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 10px 12px; border-radius: 12px; color: var(--p-ink); font-size: 14px; font-weight: 650; line-height: 1.4; cursor: pointer; list-style: none; }
#app.p3ts-bright .settings-view .settings-details > summary::-webkit-details-marker { display: none; }
#app.p3ts-bright .settings-view .settings-details > summary::marker { content: ''; }
#app.p3ts-bright .settings-view .settings-details > summary > svg { flex-shrink: 0; width: 16px; height: 16px; color: var(--p-muted); transition: transform 160ms ease; }
#app.p3ts-bright .settings-view .settings-details[open] > summary { margin-bottom: 12px; border-bottom: 1px solid var(--p-line); border-radius: 12px 12px 0 0; }
#app.p3ts-bright .settings-view .settings-details[open] > summary > svg { transform: rotate(180deg); }
#app.p3ts-bright .settings-view .settings-details > :not(summary) { margin: 0 12px 12px; }
#app.p3ts-bright .settings-view .settings-shortcuts { display: grid; gap: 8px; color: var(--p-ink); font-size: 13px; line-height: 1.45; }
#app.p3ts-bright .settings-view .settings-shortcuts > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; }
#app.p3ts-bright .settings-view .settings-shortcuts dt { min-width: 0; }
#app.p3ts-bright .settings-view .settings-shortcuts dd { margin: 0; color: var(--p-muted); }
#app.p3ts-bright .settings-view .settings-backup-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; min-width: 0; }
#app.p3ts-bright .settings-view .settings-backup-actions > .button { width: 100%; min-width: 0; min-height: 44px; padding: 10px 8px; border-radius: 10px; font-size: 12px; line-height: 1.4; white-space: normal; }
#app.p3ts-bright .settings-view .settings-danger { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; padding-top: 12px; border-top: 1px solid var(--p-line); }
#app.p3ts-bright .settings-view .settings-danger button { display: inline-flex; align-items: center; justify-content: center; min-width: 0; max-width: 100%; min-height: 44px; margin: 0; padding: 10px 12px; border: 1px solid #edb5bc; border-radius: 10px; color: #982434; background: #fff0f1; font-size: 12px; font-weight: 650; line-height: 1.4; white-space: normal; }
@media (max-width: 480px) {
  #app.p3ts-bright .settings-view { gap: 16px; }
  #app.p3ts-bright .settings-view .setting-row select { width: 136px; }
}
@media (forced-colors: active) {
  #app.p3ts-bright .settings-view input[type='checkbox'][role='switch'] { forced-color-adjust: none; }
  #app.p3ts-bright .settings-view input[type='checkbox'][role='switch']::before { border-color: ButtonText; background: Canvas; }
  #app.p3ts-bright .settings-view input[type='checkbox'][role='switch']::after { background: ButtonText; box-shadow: none; }
  #app.p3ts-bright .settings-view input[type='checkbox'][role='switch']:checked::before { border-color: Highlight; background: Highlight; }
  #app.p3ts-bright .settings-view input[type='checkbox'][role='switch']:checked::after { background: HighlightText; }
  #app.p3ts-bright .settings-view input[type='checkbox'][role='switch']:focus-visible { outline-color: Highlight; }
  #app.p3ts-bright .settings-view :is(.settings-details, .time-buttons > .button, .settings-backup-actions > .button, .settings-danger button) { border-color: ButtonText; }
  #app.p3ts-bright .settings-view .time-buttons > [aria-pressed='true'] { outline: 2px solid Highlight; outline-offset: -3px; }
}
