/* Pilot palette: Wellbeing, Learn and Media only. Artwork remains untouched. */
:root {
 --module-water:#53BDD4; --module-water-blue:#3B94E0;
 --module-learn:#FACB8F; --module-learn-gold:#F6C47C;
 --module-media:#D5A1E5; --module-media-deep:#9648A9;
 --module-sleep:#BBA9E4; --module-sleep-deep:#8D7ACB;
 --semantic-success:#98D8C9; --action-lavender:#A88AF4;
}
#detail-view[data-module="wellbeing"],#detail-view[data-module="learn"],#detail-view[data-module="movies"] {--module-accent:var(--action-lavender);}
#detail-view[data-module="learn"] {--module-accent:var(--module-learn);}
#detail-view[data-module="movies"] {--module-accent:var(--module-media);}
#detail-view:is([data-module="wellbeing"],[data-module="learn"],[data-module="movies"]) .primary-button:not(.secondary),
#learning-content .ws-button:not(.secondary) {background:var(--action-lavender);color:#211B4C;}
#detail-view[data-module="learn"] .view-kicker,#detail-view[data-module="movies"] .view-kicker {color:var(--module-accent);}
#detail-view:is([data-module="learn"],[data-module="movies"]) :is(input,textarea,select):focus-visible {outline-color:var(--module-accent);}
.water-card {--metric-accent:var(--module-water);border-color:#53BDD459;}
.sleep-card {--metric-accent:var(--module-sleep);border-color:#BBA9E459;}
:is(.water-card,.sleep-card) .well-card-head :is(strong,b) {color:var(--metric-accent);}
:is(.water-card,.sleep-card) input:focus-visible {outline-color:var(--metric-accent);border-color:var(--metric-accent);}
.water-card .well-meter span {background:linear-gradient(90deg,var(--module-water-blue),var(--module-water));}
.sleep-card .well-meter span {background:linear-gradient(90deg,var(--module-sleep-deep),var(--module-sleep));}
.water-card .quick-actions .secondary {background:#53BDD418;color:var(--module-water);box-shadow:inset 0 0 0 1px #53BDD438;}
.water-card .quick-actions .secondary:is(:active,:focus-visible) {background:var(--module-water);color:#211B4C;outline-color:var(--module-water);}
#wellbeing-content[data-metric="water"] {--metric-accent:var(--module-water);--metric-deep:var(--module-water-blue);}
#wellbeing-content[data-metric="sleep"] {--metric-accent:var(--module-sleep);--metric-deep:var(--module-sleep-deep);}
#wellbeing-content[data-metric] .chart-day span {background:linear-gradient(180deg,var(--metric-accent),var(--metric-deep));}
#wellbeing-content[data-metric] .trend-stat strong {color:var(--metric-accent);}
#wellbeing-content[data-metric] .compact button:nth-child(-n+2)[aria-pressed="true"] {background:var(--metric-accent);color:#211B4C;}
.history-item .history-water {color:var(--module-water);}
.history-item .history-sleep {color:var(--module-sleep);}
#learning-content .ws-meter>div,#learning-content .ws-meter.study>div {background:linear-gradient(90deg,var(--module-learn-gold),var(--module-learn));}
#learning-content .ws-chip:is([aria-selected="true"],[aria-pressed="true"]) {background:var(--module-learn);color:#211B4C;}
#learning-content .learn-tag {background:#FACB8F16;color:var(--module-learn);}
#learning-content .ws-lesson .status:not(.done),#learning-content .ws-resource-type {background:#FACB8F16;color:var(--module-learn);}
#learning-content .ws-lesson .status.done,#learning-content .ws-saved {color:var(--semantic-success);}
#learning-content .ws-journal {border-left-color:var(--module-learn);}
#detail-view[data-module="movies"] .library-switch button[aria-pressed="true"] {background:var(--module-media);color:#211B4C;}
#detail-view[data-module="movies"] .list-item input {accent-color:var(--module-media);}
#detail-view[data-module="movies"] .list-item:has(input:checked) {box-shadow:inset 3px 0 #98D8C9;}
#detail-view:is([data-module="learn"],[data-module="movies"],[data-module="wellbeing"]) button:disabled {opacity:1;background:#37315C;color:#ADA3C7;cursor:default;}
.home-fit .calendar-day.active {color:#211B4C;}

/* Final local harmony pass: original-color tints, no new surface palette. */
.sleep-card {border-color:#8D7ACB80;box-shadow:inset 3px 0 #8D7ACB66,0 8px 20px #100b2d33;}
.sleep-card .well-meter {background:#BBA9E420;}
.sleep-card .well-card-head strong {color:#FCCE83;}
.sleep-card .well-card-head span {color:#BBA9E4;}
#learning-content .ws-course {border-color:#FACB8F32;}
#learning-content .ws-row strong {color:var(--module-learn);}
#learning-content .learn-tag {box-shadow:inset 0 0 0 1px #FACB8F30;}
#learning-content .ws-meter {background:#FACB8F20;}
#detail-view[data-module="movies"] .empty-state {border-color:#D5A1E559;box-shadow:inset 0 2px #D5A1E54D;}
#detail-view[data-module="movies"] .list-item {box-shadow:inset 2px 0 #D5A1E54D;}
.history-item .history-water,.history-item .history-sleep {color:#D0CCED;}
.history-water::before,.history-sleep::before {content:'\2022';display:inline-block;margin-right:7px;color:var(--module-water);}
.history-sleep::before {color:var(--module-sleep);}

/* Full surface system — local approval preview only. */
:root {
 --bg-primary:#332D75;
 --bg-secondary:#27235F;
 --surface-primary:#211B4C;
 --surface-elevated:#29245B;
 --surface-input:#251F55;
 --surface-navigation:#212052;
 --surface-disabled:#37315C;
 --accent-water:#53BDD4;
 --surface-water:#273157;
 --border-water:#53BDD459;
 --accent-learning:#FACB8F;
 --surface-learning:#372D53;
 --accent-media:#D5A1E5;
 --surface-media:#302658;
 --border-media:#D5A1E559;
 --accent-sleep:#BBA9E4;
 --surface-sleep:#292453;
 --border-sleep:#8D7ACB80;
 --accent-moon:#FCCE83;
 --accent-plan:#A88AF4;
 --surface-plan:#2C2459;
 --border-plan:#A88AF459;
 --semantic-success:#98D8C9;
 --semantic-warning:#FFD19A;
 --semantic-danger:#FF7778;
 --surface-danger:#332252;
 --text-primary:#FAF6FF;
 --text-secondary:#D0CCED;
 --text-muted:#ADA3C7;
 --border-default:#5F55AD;
 --border-learning:#FACB8F40;
}

#detail-view {color:var(--text-primary);}
#detail-view .view-description {color:var(--text-secondary);}
#detail-view :is(.ws-muted,.empty-state,.well-empty,.view-kicker) {color:var(--text-secondary);}
#detail-view :is(input,textarea,select) {background:var(--surface-input);}
#detail-view :is(input,textarea,select):focus-visible {outline-color:var(--module-accent,var(--accent-plan));}
#detail-view .primary-button:not(.secondary),#detail-view .ws-button:not(.secondary) {background:var(--accent-plan);color:var(--surface-primary);}
.water-card {background:var(--surface-water);border-color:var(--border-water);}
.sleep-card {background:var(--surface-sleep);border-color:var(--border-sleep);}
.water-card .well-card-head span {color:var(--accent-water);}
.water-card input:focus-visible {outline-color:var(--accent-water);}
.sleep-card input:focus-visible {outline-color:var(--accent-sleep);}
#learning-content :is(.ws-course,.ws-section,.ws-empty) {background:var(--surface-learning);border-color:var(--border-learning);}
#learning-content .ws-cover {background:linear-gradient(120deg,#FACB8F1F,#FACB8F08),#252047;}
#learning-content .ws-empty {box-shadow:inset 0 2px #FACB8F40;}
#detail-view[data-module="movies"] :is(.list-item,.empty-state) {background:var(--surface-media);border-color:var(--border-media);}
#detail-view[data-module="plan"] :is(.list-item,.empty-state) {background:var(--surface-plan);border-color:var(--border-plan);}
#detail-view[data-module="plan"] input {accent-color:var(--accent-plan);}
#detail-view[data-module="plan"] .list-item:has(input:checked) {box-shadow:inset 2px 0 var(--semantic-success);}
#wellbeing-content[data-metric="water"] :is(.well-chart,.trend-stat) {background:var(--surface-water);}
#wellbeing-content[data-metric="sleep"] :is(.well-chart,.trend-stat) {background:var(--surface-sleep);}
.history-item {background:var(--surface-primary);border-color:var(--border-default);}
#detail-view button:disabled {opacity:1;color:var(--text-muted);background:var(--surface-disabled);}
.dashboard-dialog,.ws-dialog {background:var(--surface-elevated);}
.dashboard-dialog[data-goal-kind="overdue"] .goal-entry {background:var(--surface-danger);border-color:#FF777840;}

#detail-view :is(button,a):focus-visible {outline-color:var(--module-accent,var(--accent-plan));}

/* Success overrides only completion indicators, never module surfaces/artwork. */
.well-card.is-achieved .well-card-head :is(b,span),
#learning-content .is-achieved,.history-item .is-achieved,
#today-goal-count.is-achieved,.goal-entry.is-achieved strong {color:var(--semantic-success);}
.well-meter.is-achieved span,#learning-content .ws-meter.is-achieved>div,
#wellbeing-content .chart-day.is-achieved span,#today-meter.is-achieved>div {background:var(--semantic-success);}
.history-item .is-achieved::before {color:var(--semantic-success);}
#water-fill.is-achieved,#sleep-fill.is-achieved {fill:var(--semantic-success);}
#water-value.is-achieved,#sleep-value.is-achieved {fill:#211B4C;}
#learning-content .completion-filter[aria-pressed="true"] {background:var(--semantic-success);color:#211B4C;}
#detail-view .list-item input:checked {accent-color:var(--semantic-success);}
.goal-entry[data-state="expired"] strong {color:var(--semantic-danger);}
.goal-entry[data-state="recovering"] strong {color:var(--semantic-warning);}
.sleep-live {display:grid;gap:8px;margin:11px 0;padding:11px;border-radius:14px;background:#8D7ACB14;border:1px solid #8D7ACB55;}
.sleep-live.active {background:#8D7ACB24;border-color:#BBA9E466;box-shadow:inset 3px 0 #BBA9E4;}
.sleep-live strong {font-size:12px;color:#BBA9E4;letter-spacing:.7px;}
.sleep-live span {font-size:11px;color:#D0CCED;}
.sleep-live .primary-button {width:100%;}
.wake-button {display:inline-flex;align-items:center;justify-content:center;gap:7px;}
.button-icon {width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;}
.sleep-edit {background:transparent;color:#BBA9E4;font-size:10px;text-align:left;padding:1px 0;}
.sleep-edit + .sleep-edit {margin-top:-4px;}
.rest-live-status {position:absolute;left:16px;top:48px;z-index:2;color:#FCCE83;background:#1E1849CC;border:1px solid #BBA9E44D;border-radius:999px;padding:2px 6px;font-size:8px;font-weight:800;letter-spacing:.2px;pointer-events:none;text-shadow:0 1px 3px #171340;}
.art-card.rest {position:relative;}

/* Local preview: Sleep auto-calc polish, Rest card active layout, Movies/Books identities. */
.art-card.rest {position:relative;overflow:hidden;}
.art-card.rest #sleep-value {font-weight:800;letter-spacing:-.1px;}
.rest-live-status {display:none;}
.art-card.rest.sleep-active .rest-live-status {
  display:block;
  position:absolute;
  left:8px;
  top:28px;
  width:84px;
  min-height:22px;
  z-index:3;
  padding:14px 0 0 0;
  color:#FCCE83;
  background:#2C2C67;
  border:0;
  box-shadow:none;
  border-radius:0;
  font-size:8px;
  line-height:1.1;
  font-weight:800;
  letter-spacing:.05px;
  pointer-events:none;
  text-shadow:none;
}
.art-card.rest.sleep-active .rest-live-status::before {content:'';position:absolute;left:0;right:0;top:0;height:13px;background:#2C2C67;}

#detail-view[data-module="movies"] {
  --movie-accent:#D5A1E5;
  --movie-glow:#EE75C8;
  --book-accent:#FACB8F;
  --book-ink:#F6C47C;
}
#detail-view[data-module="movies"]::before {
  content:'';
  position:fixed;
  inset:0;
  z-index:-1;
  pointer-events:none;
  background:radial-gradient(circle at 80% 16%,#D5A1E51E 0 18%,transparent 34%),radial-gradient(circle at 12% 78%,#9648A924 0 20%,transparent 38%);
}
#detail-view[data-module="movies"][data-library-kind="movies"] {
  --module-accent:var(--movie-accent);
}
#detail-view[data-module="movies"][data-library-kind="movies"]::after,
#detail-view[data-module="movies"][data-library-kind="books"]::after {
  content:'';
  display:block;
  height:96px;
  margin:4px 0 14px;
  border-radius:24px;
  border:1px solid #D5A1E538;
  background-repeat:no-repeat;
  background-size:cover;
  order:-1;
}
#detail-view[data-module="movies"][data-library-kind="movies"]::after {
  background:
    radial-gradient(circle at 82% 30%,#FCCE8350 0 3px,transparent 4px),
    radial-gradient(circle at 72% 68%,#FFFFFF70 0 2px,transparent 3px),
    linear-gradient(135deg,#302658,#211B4C 58%,#3D225F),
    repeating-linear-gradient(90deg,transparent 0 13px,#D5A1E529 13px 16px,transparent 16px 32px);
  box-shadow:inset 0 0 0 1px #EE75C830,0 14px 30px #130E2A38;
}
#detail-view[data-module="movies"][data-library-kind="movies"] .view-kicker {color:var(--movie-accent);}
#detail-view[data-module="movies"][data-library-kind="movies"] .library-switch button[aria-pressed="true"] {background:linear-gradient(135deg,#D5A1E5,#EE75C8);color:#211B4C;}
#detail-view[data-module="movies"][data-library-kind="movies"] :is(.list-item,.empty-state) {background:linear-gradient(135deg,#302658,#2A2153);border-color:#D5A1E559;box-shadow:inset 2px 0 #EE75C866;}
#detail-view[data-module="movies"][data-library-kind="movies"] .empty-state::before {content:'▻  ✦  ▭';display:block;margin-bottom:8px;color:#FCCE83;letter-spacing:6px;font-size:18px;}

#detail-view[data-module="movies"][data-library-kind="books"] {
  --module-accent:var(--book-accent);
}
#detail-view[data-module="movies"][data-library-kind="books"]::before {
  background:radial-gradient(circle at 78% 14%,#FACB8F24 0 18%,transparent 34%),radial-gradient(circle at 6% 82%,#F6C47C1B 0 18%,transparent 34%);
}
#detail-view[data-module="movies"][data-library-kind="books"]::after {
  border-color:#FACB8F40;
  background:
    radial-gradient(circle at 18% 30%,#FCCE8350 0 8px,transparent 9px),
    linear-gradient(135deg,#372D53,#252047 58%,#3A2B52),
    repeating-linear-gradient(90deg,#FACB8F2B 0 3px,transparent 3px 19px);
  box-shadow:inset 0 0 0 1px #FACB8F30,0 14px 30px #130E2A30;
}
#detail-view[data-module="movies"][data-library-kind="books"] .view-kicker {color:var(--book-accent);}
#detail-view[data-module="movies"][data-library-kind="books"] .library-switch button[aria-pressed="true"] {background:linear-gradient(135deg,#FACB8F,#F6C47C);color:#211B4C;}
#detail-view[data-module="movies"][data-library-kind="books"] :is(.list-item,.empty-state) {background:linear-gradient(135deg,#372D53,#2E284F);border-color:#FACB8F4D;box-shadow:inset 2px 0 #FACB8F80;}
#detail-view[data-module="movies"][data-library-kind="books"] .empty-state::before {content:'▰  ✧  ◜';display:block;margin-bottom:8px;color:#FACB8F;letter-spacing:6px;font-size:18px;}
#detail-view[data-module="movies"] .library-switch {position:relative;z-index:1;}
#detail-view[data-module="movies"] .item-list,#detail-view[data-module="movies"] .empty-state,#detail-view[data-module="movies"] .entry-form,#detail-view[data-module="movies"] .field-label {position:relative;z-index:1;}
.library-theme-card {position:relative;z-index:1;height:96px;margin:0 0 16px;border-radius:24px;overflow:hidden;border:1px solid #D5A1E538;background:#302658;box-shadow:0 14px 30px #130E2A38;}
.library-theme-card::before,.library-theme-card::after {content:'';position:absolute;inset:0;pointer-events:none;}
.library-theme-card.movies {border-color:#D5A1E545;background:linear-gradient(135deg,#302658,#211B4C 58%,#3D225F);}
.library-theme-card.movies::before {background:repeating-linear-gradient(90deg,transparent 0 13px,#D5A1E529 13px 16px,transparent 16px 32px);opacity:.55;}
.library-theme-card.movies::after {background:radial-gradient(circle at 78% 30%,#FCCE8370 0 3px,transparent 4px),radial-gradient(circle at 66% 68%,#FFFFFF85 0 2px,transparent 3px),radial-gradient(ellipse at 28% 63%,#EE75C845 0 18%,transparent 42%),linear-gradient(16deg,transparent 45%,#D5A1E552 46% 49%,transparent 50%);}
.library-theme-card.books {border-color:#FACB8F45;background:linear-gradient(135deg,#372D53,#252047 58%,#3A2B52);}
.library-theme-card.books::before {background:repeating-linear-gradient(90deg,#FACB8F2B 0 4px,transparent 4px 18px,#F6C47C30 18px 24px,transparent 24px 36px);opacity:.62;}
.library-theme-card.books::after {background:radial-gradient(circle at 16% 28%,#FCCE8365 0 9px,transparent 10px),radial-gradient(ellipse at 20% 55%,#FACB8F33 0 24%,transparent 48%),linear-gradient(110deg,transparent 56%,#FACB8F3A 57% 59%,transparent 60%);}
.library-theme-card[hidden] {display:none!important;}
#detail-view[data-module="movies"][data-library-kind="movies"]::after,
#detail-view[data-module="movies"][data-library-kind="books"]::after {display:none;}

/* Final local visual corrections before approval. */
.art-card.rest.sleep-active .rest-live-status {
  display:block;
  position:absolute;
  left:8px;
  top:29px;
  width:96px;
  min-height:38px;
  z-index:3;
  padding:15px 0 0 0;
  color:#FCCE83;
  background:#2C2C67;
  border:0;
  box-shadow:none;
  border-radius:0;
  font-size:8px;
  line-height:1.1;
  font-weight:800;
  letter-spacing:.05px;
  pointer-events:none;
  text-shadow:none;
}
.art-card.rest.sleep-active .rest-live-status::before {content:'';position:absolute;left:0;right:0;top:0;height:14px;background:#2C2C67;}
.art-card.rest #sleep-value {font-weight:850;letter-spacing:-.15px;}

.library-theme-card {height:104px;border-radius:24px;}
.library-theme-card.movies {
  border-color:#D5A1E54D;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 360 112'%3E%3Cdefs%3E%3ClinearGradient id='beam' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop stop-color='%23f48adf' stop-opacity='.45'/%3E%3Cstop offset='1' stop-color='%23d5a1e5' stop-opacity='.05'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect width='360' height='112' rx='24' fill='%23211b4c'/%3E%3Cpath d='M16 78 L142 38 L142 91 Z' fill='url(%23beam)'/%3E%3Ccircle cx='38' cy='76' r='18' fill='none' stroke='%23d5a1e5' stroke-opacity='.45' stroke-width='5'/%3E%3Ccircle cx='38' cy='76' r='7' fill='%23f48adf' fill-opacity='.35'/%3E%3Crect x='178' y='26' width='126' height='58' rx='8' fill='%23302658' stroke='%23d5a1e5' stroke-opacity='.36' stroke-width='2'/%3E%3Cpath d='M188 36h106M188 74h106' stroke='%23d5a1e5' stroke-opacity='.28' stroke-width='3'/%3E%3Cg fill='%23ffcE83' fill-opacity='.55'%3E%3Ccircle cx='323' cy='28' r='3'/%3E%3Ccircle cx='336' cy='58' r='2'/%3E%3Ccircle cx='308' cy='83' r='2.5'/%3E%3C/g%3E%3C/svg%3E") center/cover no-repeat,
    linear-gradient(135deg,#302658,#211B4C 58%,#3D225F);
  box-shadow:inset 0 0 0 1px #EE75C82E,0 14px 30px #130E2A38;
}
.library-theme-card.movies::before,.library-theme-card.movies::after {display:none;}
.library-theme-card.books {
  border-color:#FACB8F50;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 360 112'%3E%3Crect width='360' height='112' rx='24' fill='%23252047'/%3E%3Cpath d='M42 72c34-17 67-17 100 0v22c-33-16-66-16-100 0V72Z' fill='%23facb8f' fill-opacity='.30'/%3E%3Cpath d='M142 72c34-17 67-17 100 0v22c-33-16-66-16-100 0V72Z' fill='%23ffd19a' fill-opacity='.22'/%3E%3Cpath d='M142 72v25' stroke='%23facb8f' stroke-opacity='.42' stroke-width='3'/%3E%3Cpath d='M268 30h44v63h-44z' fill='%23facb8f' fill-opacity='.13'/%3E%3Cpath d='M278 30v63M290 30v63M302 30v63' stroke='%23facb8f' stroke-opacity='.28' stroke-width='3'/%3E%3Ccircle cx='64' cy='34' r='10' fill='%23fcce83' fill-opacity='.42'/%3E%3Cpath d='M64 45v28' stroke='%23fcce83' stroke-opacity='.35' stroke-width='4' stroke-linecap='round'/%3E%3Cg fill='%23facb8f' fill-opacity='.45'%3E%3Cpath d='M326 38l3 6 6 3-6 3-3 6-3-6-6-3 6-3 3-6Z'/%3E%3Ccircle cx='28' cy='82' r='2.5'/%3E%3C/g%3E%3C/svg%3E") center/cover no-repeat,
    linear-gradient(135deg,#372D53,#252047 58%,#3A2B52);
  box-shadow:inset 0 0 0 1px #FACB8F30,0 14px 30px #130E2A30;
}
.library-theme-card.books::before,.library-theme-card.books::after {display:none;}
#detail-view[data-module="movies"][data-library-kind="movies"] .library-switch button[aria-pressed="true"] {background:linear-gradient(135deg,#D5A1E5,#EE75C8);color:#211B4C;box-shadow:none;}
#detail-view[data-module="movies"][data-library-kind="books"] .library-switch button[aria-pressed="true"] {background:linear-gradient(135deg,#FACB8F,#F6C47C);color:#211B4C;box-shadow:0 0 0 2px #FACB8F50;}
#detail-view[data-module="movies"] .library-switch button[aria-pressed="false"] {background:#211B4C;color:#D0CCED;}

/* Local preview media refinement: real featured-style visuals with safe offline fallback. */
.library-theme-card {
  height:116px;
  border-radius:24px;
  overflow:hidden;
  isolation:isolate;
  background:#211B4C;
}
.library-theme-card::before,
.library-theme-card::after {display:none!important;}
.library-theme-image {
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
  transform:scale(1.012);
}
.library-theme-shade {
  position:absolute;
  inset:0;
  pointer-events:none;
}
.library-theme-title {
  position:absolute;
  left:16px;
  bottom:12px;
  z-index:2;
  max-width:72%;
  padding:5px 9px;
  border-radius:999px;
  font-size:10px;
  line-height:1;
  font-weight:850;
  letter-spacing:.5px;
  text-transform:uppercase;
  backdrop-filter:blur(8px);
}
.library-theme-card.movies {
  border-color:#EE75C852;
  background:linear-gradient(135deg,#302658,#211B4C 58%,#3D225F);
  box-shadow:inset 0 0 0 1px #EE75C82E,0 14px 30px #130E2A38;
}
.library-theme-card.movies .library-theme-shade {
  background:
    linear-gradient(90deg,#120C34A8 0%,#120C3440 42%,#EE75C818 100%),
    radial-gradient(circle at 82% 18%,#EE75C82E 0 18%,transparent 42%),
    linear-gradient(180deg,transparent 35%,#211B4C90 100%);
}
.library-theme-card.movies .library-theme-title {
  color:#F7D7F8;
  background:#211B4CB8;
  box-shadow:inset 0 0 0 1px #EE75C854;
}
.library-theme-card.books {
  border-color:#FACB8F5C;
  background:linear-gradient(135deg,#372D53,#252047 58%,#3A2B52);
  box-shadow:inset 0 0 0 1px #FACB8F36,0 14px 30px #130E2A30;
}
.library-theme-card.books .library-theme-shade {
  background:
    linear-gradient(90deg,#211B4C8F 0%,#372D5335 45%,#FACB8F18 100%),
    radial-gradient(circle at 16% 22%,#FACB8F36 0 16%,transparent 40%),
    linear-gradient(180deg,transparent 42%,#25204790 100%);
}
.library-theme-card.books .library-theme-title {
  color:#FFE2AF;
  background:#211B4CB2;
  box-shadow:inset 0 0 0 1px #FACB8F66;
}
#detail-view[data-module="movies"] .library-switch button[aria-pressed="false"] {background:#211B4C;color:#D0CCED;}

/* Local preview: accessible course actions and safe delete confirmation. */
.course-card-head,
.course-title-row {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
}
.course-card-head .ws-title,
.course-title-row .ws-title {margin:0;min-width:0;}
.course-actions-menu {position:relative;flex:0 0 auto;}
.course-actions-menu summary {
  list-style:none;
  cursor:pointer;
  border:1px solid #FACB8F38;
  background:#211B4C;
  color:#F2EAFE;
  border-radius:999px;
  min-width:38px;
  min-height:34px;
  padding:8px 12px;
  font-weight:850;
  text-align:center;
  box-shadow:0 8px 18px #130E2A30;
}
.course-actions-menu summary::-webkit-details-marker {display:none;}
.course-actions-menu[open] summary {background:#352C65;border-color:#FACB8F66;}
.course-actions-panel {
  position:absolute;
  right:0;
  top:calc(100% + 8px);
  z-index:8;
  display:grid;
  gap:8px;
  width:172px;
  padding:10px;
  border:1px solid #7F73D76B;
  border-radius:18px;
  background:#211B4C;
  box-shadow:0 18px 38px #130E2A78;
}
.course-actions-panel .ws-button {width:100%;justify-content:center;}
.ws-button.danger {
  background:linear-gradient(135deg,#FF7C88,#FF5F6D);
  color:#211B4C;
}
.ws-dialog .ws-button.danger {font-weight:850;}

/* Local preview: live media source labels and fallback state. */
.library-theme-source {
  position:absolute;
  right:14px;
  bottom:12px;
  z-index:2;
  max-width:34%;
  padding:5px 8px;
  border-radius:999px;
  font-size:9px;
  line-height:1;
  font-weight:800;
  color:#D0CCED;
  background:#120C3488;
  box-shadow:inset 0 0 0 1px #FFFFFF1F;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.library-theme-card.is-live .library-theme-source {color:#98D8C9;}
.library-theme-card.is-fallback .library-theme-source {color:#FCCE83;}
.library-theme-card.books.is-live .library-theme-image {
  object-fit:cover;
  object-position:center 38%;
}
.library-theme-card.books.is-live .library-theme-shade {
  background:
    linear-gradient(90deg,#211B4CD9 0%,#211B4C82 36%,#FACB8F20 100%),
    radial-gradient(circle at 80% 42%,#FACB8F42 0 18%,transparent 42%),
    linear-gradient(180deg,transparent 30%,#252047A8 100%);
}
.library-theme-card.movies.is-live .library-theme-shade {
  background:
    linear-gradient(90deg,#120C34C9 0%,#120C3450 44%,#EE75C818 100%),
    radial-gradient(circle at 78% 18%,#EE75C842 0 20%,transparent 46%),
    linear-gradient(180deg,transparent 30%,#211B4CA6 100%);
}

/* Local preview: keep media source labels available to assistive tech, hidden visually. */
.library-theme-source {
  position:absolute!important;
  width:1px!important;
  height:1px!important;
  padding:0!important;
  margin:-1px!important;
  overflow:hidden!important;
  clip:rect(0,0,0,0)!important;
  white-space:nowrap!important;
  border:0!important;
}
.library-theme-card.books.is-live .library-theme-image {
  object-fit:cover;
  object-position:center;
  filter:saturate(.9) contrast(.95) brightness(.85);
}

.app-credits {
  margin-top: 14px;
  color: rgba(255,255,255,.78);
}
.app-credits summary {
  cursor: pointer;
  color: rgba(255,255,255,.9);
  font-weight: 800;
}
.app-credits p {
  margin-top: 8px;
  font-size: .82rem;
  line-height: 1.5;
}

/* Local only: typography consistency pass based on the Home dashboard hierarchy. */
:root {
  --type-kicker: 10px;
  --type-page-title: clamp(24px, 6.1vw, 28px);
  --type-section-title: clamp(15px, 3.9vw, 17px);
  --type-card-title: clamp(17px, 4.8vw, 20px);
  --type-body: 13px;
  --type-helper: 11px;
  --type-button: 12px;
  --type-metric: clamp(20px, 5.6vw, 24px);
  --lh-tight: 1.18;
  --lh-title: 1.28;
  --lh-body: 1.58;
}

body,
body * { text-rendering: geometricPrecision; }

.greeting-text,
#view-title,
.learn-heading,
.ws-title,
.course-card h2,
.dashboard-dialog h2,
.ws-dialog h2 {
  letter-spacing: -0.035em;
  line-height: var(--lh-title);
}

.greeting-text {
  font-size: clamp(22px, 5.9vw, 27px);
  font-weight: 850;
}

.header-date,
.view-kicker,
.ws-cover .ws-cover-label,
.course-provider,
.well-card-head strong,
.library-theme-title,
.sleep-live strong {
  font-size: var(--type-kicker);
  line-height: 1.25;
  letter-spacing: 1.15px;
  font-weight: 800;
  text-transform: uppercase;
}

.view-panel h1,
#view-title {
  font-size: var(--type-page-title);
  font-weight: 850;
  margin: 0 0 10px;
}

.view-description,
.dashboard-dialog p,
.ws-dialog p,
.ws-muted,
.well-card-head span,
.well-empty,
.empty-state,
.status-text,
.snapshot-muted,
.learn-meta,
.ws-feedback {
  font-size: var(--type-body);
  line-height: var(--lh-body);
}

.view-description {
  max-width: 30rem;
  margin-bottom: 20px;
}

.primary-button,
.ws-button,
.learn-button,
.library-switch button,
.wellbeing-tabs button,
.quick-actions .primary-button,
.snapshot-actions .primary-button,
.course-actions-panel .ws-button,
.entry-form button{
  font-size: var(--type-button);
  line-height: 1.15;
  font-weight: 850;
  letter-spacing: -0.01em;
}

.field-label,
.well-field,
.ws-form label,
.learn-form label,
.dashboard-dialog label {
  font-size: var(--type-helper);
  line-height: 1.35;
  font-weight: 750;
  letter-spacing: .01em;
}

input,
textarea,
select,
.ws-form input,
.ws-form textarea,
.ws-form select,
.learn-form input,
.learn-form select,
.learn-form textarea,
.well-field input,
.field-label input,
#entry-input,
.ws-notes {
  font-size: var(--type-body);
  line-height: 1.4;
  font-weight: 650;
}

input::placeholder,
textarea::placeholder {
  color: #BEB6DB;
  font-weight: 600;
}

.list-item label,
.chapter-link,
.ws-lesson strong,
.ws-resource button,
.history-item span,
.snapshot-line,
.recovery-preview {
  font-size: var(--type-body);
  line-height: 1.45;
}

.list-item label,
.chapter-link,
.ws-lesson strong,
.ws-resource button,
.ws-title,
.course-card h2,
.learn-section h3,
.well-card-head b,
.trend-stat strong,
.library-theme-title {
  overflow-wrap: anywhere;
}

.ws-title,
.course-card h2,
.learn-heading {
  font-size: var(--type-card-title);
  font-weight: 850;
}

.ws-row,
.ws-muted,
.ws-lesson small,
.ws-resource small,
.chapter-link small,
.learn-feedback,
.sleep-live span,
.trend-stat small {
  font-size: var(--type-helper);
  line-height: 1.5;
}

.ws-section h3,
.learn-section h3,
.wellbeing-tabs + .well-card .well-card-head strong,
.day-snapshot h3 {
  font-size: var(--type-section-title);
  font-weight: 850;
  letter-spacing: -0.02em;
}

.well-card-head b,
.trend-stat strong,
.ws-clock {
  font-size: var(--type-metric);
  line-height: var(--lh-tight);
  font-weight: 850;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.well-card-head strong {
  letter-spacing: 1px;
}

.well-card-head span,
.trend-stat small,
.history-item span {
  color: var(--text-secondary);
}

.home-fit .quote-card blockquote {
  font-size: clamp(16px, 4.4vw, 18px);
  line-height: 1.36;
  font-weight: 780;
  letter-spacing: -0.028em;
}

.home-fit .calendar-header,
.goal-label,
.goal-label strong,
.goal-label small,
.calendar-day .day-label,
.calendar-day .day-number {
  line-height: 1.12;
}

.home-fit .calendar-header {
  font-size: 12px;
  font-weight: 800;
}

.goal-label strong {
  font-size: 13px;
  font-weight: 850;
  letter-spacing: -0.02em;
}

.goal-label small {
  font-size: 10.5px;
  font-weight: 650;
}

.calendar-day .day-label {
  font-size: 9.5px;
  font-weight: 850;
  letter-spacing: .15px;
}

.calendar-day .day-number {
  font-size: 20px;
  font-weight: 850;
  letter-spacing: -0.04em;
}

.library-theme-title {
  max-width: min(74%, 245px);
  line-height: 1.12;
  white-space: normal;
}

.library-switch {
  align-items: center;
}

.library-switch button,
.wellbeing-tabs button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.entry-form { align-items: end; }
.entry-form .primary-button { min-height: 44px; }
#entry-input { min-height: 44px; }
.empty-state { font-weight: 650; }

.dashboard-dialog h2,
.ws-dialog h2 {
  font-size: clamp(20px, 5.5vw, 24px);
  font-weight: 850;
}

.dashboard-dialog .primary-button,
.ws-dialog .ws-button {
  min-height: 42px;
  text-align: center;
}

@media (max-width: 370px) {
  :root {
    --type-page-title: 23px;
    --type-card-title: 17px;
    --type-body: 12.5px;
    --type-button: 11.5px;
  }
  .goal-label {gap:4px;}
  .goal-label small {font-size:10px;}
  .library-theme-title {max-width:78%;}
}

/* Local typography QA: keep keyboard focus accessible without a heavy text box on headings. */
#view-title:focus-visible,
.greeting-text:focus-visible {
  outline: 2px solid #B4A1FF;
  outline-offset: 5px;
  border-radius: 10px;
}
/* Local preview: customizable dashboard cards and expanded trackers. */
.card-hidden{display:none!important;}
#manage-cards-entry{margin-left:6px;}
.custom-dashboard-card{min-height:133px;border-radius:18px;padding:14px;background:linear-gradient(135deg,color-mix(in srgb,var(--card-accent) 34%,#241b55),#201947 62%);box-shadow:0 5px 6px #100c352e;color:white;text-decoration:none;display:flex;flex-direction:column;gap:5px;position:relative;overflow:hidden;}
.custom-dashboard-card::after{content:'';position:absolute;right:-24px;bottom:-24px;width:92px;height:92px;border-radius:50%;background:color-mix(in srgb,var(--card-accent) 28%,transparent);}
.custom-dashboard-card .cdc-icon{width:34px;height:34px;border-radius:13px;display:grid;place-items:center;background:#ffffff22;font-size:20px;}
.custom-dashboard-card strong{font-size:20px;line-height:1.1;z-index:1;}.custom-dashboard-card small{font-size:11px;color:#efeaff;z-index:1;}.custom-dashboard-card b{font-size:13px;z-index:1;}.cdc-meter{height:10px;background:#ffffff2c;border-radius:999px;overflow:hidden;margin-top:auto;z-index:1}.cdc-meter span{display:block;height:100%;background:var(--card-accent);border-radius:999px}.custom-dashboard-card.is-achieved .cdc-meter span{background:#98D8C9;}
.custom-feature-root{display:grid;gap:13px;margin-top:13px;}.feature-actions{display:flex;flex-wrap:wrap;gap:8px}.feature-card,.manage-row{border:1px solid #8b7add55;background:#231d50;border-radius:20px;padding:14px;color:white;box-shadow:0 8px 20px #100b2d26}.feature-card h2{margin:0 0 8px;font-size:18px}.feature-form{display:grid;gap:12px}.feature-form .primary-button{margin-top:2px}.field-label{display:grid;gap:7px}.field-label input,.field-label select{width:100%;box-sizing:border-box;border-radius:13px;border:1px solid #a88af4a0;background:#251f58;color:white;padding:11px 12px}.check-row{display:flex;gap:9px;align-items:center;font-size:13px;color:#e8e0ff}.manage-list{display:grid;gap:9px}.manage-row{display:grid;grid-template-columns:auto 1fr auto auto auto;gap:8px;align-items:center}.manage-row small{grid-column:2;color:#c9c1ee;font-size:11px}.drag-handle{color:#bba9e4}.mini-button{background:#3a3272;color:white;border-radius:999px;padding:7px 10px;font-size:12px}.mini-button.danger{background:#4b2448;color:#ffb7bd}.segmented{display:flex;gap:6px;background:#1b1642;border-radius:18px;padding:5px}.seg-button{flex:1;border-radius:14px;padding:10px 8px;background:transparent;color:#dcd3ff;font-weight:800}.seg-button.active{background:#a88af4;color:#211b4c}.feature-meter{height:13px;background:#443b7c;border-radius:999px;overflow:hidden}.feature-meter span{display:block;height:100%;background:#98d8c9;border-radius:999px}.metric-line{font-size:20px;font-weight:850;color:#fff;margin:8px 0}.exercise-row{display:grid;gap:9px;border-top:1px solid #ffffff12;padding-top:10px;margin-top:10px}.media-links{display:flex;flex-wrap:wrap;gap:6px}.media-link{color:#cdbdff;font-size:12px}.medicine-row .success{background:#98d8c9;color:#211b4c}.history-lite p{margin:6px 0;color:#d7d0f5;font-size:12px}.media-meta{display:grid;grid-template-columns:44px 1fr;gap:9px;margin:8px 0 0 30px;color:#eae4ff}.media-meta img{width:44px;height:62px;object-fit:cover;border-radius:8px;background:#302658}.media-meta strong{display:block;font-size:12px}.media-meta small{display:block;color:#bbb0e4;font-size:10px;line-height:1.35}.media-section-strip{display:flex;gap:7px;overflow:auto;margin:0 0 11px}.media-section-strip span{white-space:nowrap;border-radius:999px;background:#3b3274;color:#eadfff;padding:7px 10px;font-size:11px;font-weight:800}
@media(max-width:390px){.manage-row{grid-template-columns:auto 1fr auto auto}.manage-row .danger{grid-column:2/5}.custom-dashboard-card strong{font-size:18px}}
.feature-grid.two{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:10px 0;}
.feature-actions.spread{align-items:end;justify-content:space-between;}
.exercise-link-wrap{display:inline-flex;gap:4px;align-items:center;background:#ffffff12;border-radius:999px;padding:3px 4px 3px 8px;}
.media-meta-actions{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px;}
.media-section-strip button{white-space:nowrap;border-radius:999px;background:#3b3274;color:#eadfff;padding:7px 10px;font-size:11px;font-weight:800;border:0;}
.media-section-strip button.active{background:#d5a1e5;color:#201947;}
.custom-dashboard-card.activity .cdc-meter span{background:#53BDD4;}
.custom-dashboard-card.workout .cdc-meter span{background:#FACB8F;}

/* Decorative art only: original illustrated cards and grid geometry stay intact. */
.custom-dashboard-card.has-illustration::after{display:none;}
.custom-dashboard-card.has-illustration .cdc-icon{background:transparent;}
.custom-dashboard-card .cdc-illustration{position:absolute;top:3px;right:6px;width:76px;height:76px;object-fit:contain;pointer-events:none;user-select:none;}
.custom-dashboard-card.compact-illustration .cdc-illustration{width:48px;height:48px;top:1px;}
@media(max-width:360px){.custom-dashboard-card .cdc-illustration{width:48px;height:48px;top:1px;}}
.custom-dashboard-card.movement-illustration:not(.compact-illustration) .cdc-illustration{width:84px;height:84px;top:0;right:2px;}
@media(max-width:360px){.custom-dashboard-card.movement-illustration:not(.compact-illustration) .cdc-illustration{width:58px;height:58px;top:0;right:4px;}}
.custom-dashboard-card.has-illustration{--scene-a:#76d6df;--scene-b:#ac98df;background:radial-gradient(ellipse at 96% 0%,color-mix(in srgb,var(--scene-a) 35%,transparent),transparent 70%),linear-gradient(145deg,color-mix(in srgb,var(--scene-b) 34%,#241b55),#201947 82%);isolation:isolate;}
.custom-dashboard-card[data-artwork="airbike"]{--scene-a:#d876c3;--scene-b:#9363cd;}
.custom-dashboard-card[data-artwork="workout"]{--scene-a:#facb8f;--scene-b:#df93b7;}
.custom-dashboard-card[data-artwork="medicine"]{--scene-a:#98d8c9;--scene-b:#aa9cdb;}
.custom-dashboard-card[data-artwork="habit"]{--scene-a:#e8bd77;--scene-b:#aa78b0;}
.custom-dashboard-card[data-artwork="custom"]{--scene-a:#79cbdc;--scene-b:#b399e3;}
.custom-dashboard-card.has-illustration::before{content:'';position:absolute;z-index:-1;pointer-events:none;right:-10px;top:-12px;width:112px;height:108px;border-radius:44% 56% 64% 36%;background:radial-gradient(circle at 17% 30%,#fff8 0 1px,transparent 2px),radial-gradient(circle at 87% 64%,var(--scene-a) 0 2px,transparent 3px),linear-gradient(140deg,color-mix(in srgb,var(--scene-a) 28%,transparent),color-mix(in srgb,var(--scene-b) 12%,transparent));box-shadow:-17px 12px 0 -10px color-mix(in srgb,var(--scene-b) 20%,transparent);}
.custom-dashboard-card.has-illustration::after{display:block;content:'';position:absolute;z-index:-1;pointer-events:none;right:7px;top:73px;bottom:auto;width:76px;height:10px;border-radius:50%;background:color-mix(in srgb,var(--scene-b) 45%,#171139);box-shadow:0 3px 12px color-mix(in srgb,var(--scene-a) 18%,transparent);}
.custom-dashboard-card.compact-illustration::after{top:42px;width:47px;}
.custom-dashboard-card .cdc-illustration{z-index:0;}
@media(max-width:360px){.custom-dashboard-card.has-illustration::before{width:85px;height:75px;right:-9px;top:-11px}.custom-dashboard-card.has-illustration::after{top:49px;width:52px;}.custom-dashboard-card.compact-illustration::after{top:42px;width:43px;}}
.add-card-panel{background:radial-gradient(ellipse at 100% 0%,#8a69cd38,transparent 80%),#231d50;border-color:#a88af480;}
.add-card-panel h2{font-size:17px;line-height:1.35;}
.add-card-panel p{font-size:13px;line-height:1.55;color:#d5cdee;margin:0 0 14px;}
.add-card-panel .add-card-button{width:100%;min-height:46px;font-size:15px;font-weight:800;white-space:normal;}
/* Original Rest SVG pill is cloned into the existing meter + value layout slot. */
.custom-dashboard-card .cdc-meter{position:static;background:transparent;box-shadow:none;overflow:visible;}
.custom-dashboard-card .cdc-progress-pill{position:absolute;top:auto;bottom:0;left:0;display:block;width:100%;height:auto;overflow:visible;pointer-events:none;font-family:inherit;}
.custom-dashboard-card .cdc-pill-spacer{visibility:hidden;pointer-events:none;}
.custom-dashboard-card>strong,.custom-dashboard-card>small{visibility:hidden;}
@font-face{font-family:'Rounded Mplus 1c';src:url('fonts/RoundedMplus1c-ExtraBold.ttf') format('truetype');font-weight:800;font-style:normal;font-display:block;}
@font-face{font-family:'Rounded Mplus 1c';src:url('fonts/RoundedMplus1c-Medium.ttf') format('truetype');font-weight:500;font-style:normal;font-display:block;}
.custom-dashboard-card .cdc-heading{position:absolute;left:0;top:0;width:100%;height:auto;overflow:visible;pointer-events:none;z-index:2;}
.custom-dashboard-card .cdc-heading text,.custom-dashboard-card .cdc-heading tspan{font-family:'Rounded Mplus 1c';font-synthesis:none;}
.custom-dashboard-card.has-illustration .cdc-illustration,.custom-dashboard-card.has-illustration.movement-illustration .cdc-illustration{top:auto;bottom:24%;right:5%;width:34%;height:auto;aspect-ratio:1;}
.custom-dashboard-card.has-illustration.has-wrapped-heading .cdc-illustration{width:23%;}
.custom-dashboard-card.has-illustration::before{top:32%;right:-10px;height:50%;}
.custom-dashboard-card.has-illustration::after{top:auto;bottom:25%;right:7%;width:32%;}

/* Activity detail only; dashboard card geometry and other modules are untouched. */
.activity-screen .activity-date{font-size:12px;color:#d8cfee;gap:7px;}
.activity-screen .activity-date input{max-width:210px;min-height:42px;font-size:14px;}
.activity-screen .activity-modes{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));}
.activity-screen .activity-modes button{font-size:13px;padding:11px 5px;min-width:0;min-height:44px;}
.activity-screen .activity-detail{background:radial-gradient(ellipse at 100% 0%,#689bc12a,transparent 70%),#231d50;}
.activity-screen .activity-detail.airbike{background:radial-gradient(ellipse at 100% 0%,#c96eb12a,transparent 70%),#231d50;}
.activity-screen .activity-detail.rest{background:radial-gradient(ellipse at 100% 0%,#947cc93b,transparent 75%),#231d50;}
.activity-screen .activity-hero{display:grid;grid-template-columns:minmax(0,1fr) 98px;align-items:center;gap:8px;margin-bottom:14px;min-height:112px;}
.activity-screen .activity-hero img{display:block;width:98px;height:98px;object-fit:contain;}
.activity-screen .activity-hero h2{font-family:'Rounded Mplus 1c';font-weight:800;font-size:23px;line-height:1.25;margin:5px 0 7px;}
.activity-screen .activity-eyebrow{font-size:10px;font-weight:750;letter-spacing:1px;color:#bcaee1;}
.activity-screen .activity-helper{font-size:12px;line-height:1.6;color:#d3c9e9;margin:6px 0 10px;}
.activity-screen .activity-rest-moon{display:grid;place-items:center;width:90px;height:90px;border-radius:50%;background:#8b71c31a;}
.activity-screen .activity-rest-moon svg{width:62px;height:62px;}
.activity-screen .activity-rest-status{font-size:14px;font-weight:750;color:#ddcffb;margin:10px 0;}
.activity-screen .activity-retained{font-size:12px;line-height:1.6;color:#bdafdb;border-left:2px solid #9c88cc;padding-left:10px;}
.activity-screen .activity-progress-pill{position:relative;height:34px;border-radius:999px;overflow:hidden;background:white;border:1px solid white;color:#205b83;}
.activity-screen .activity-progress-fill{position:absolute;inset:1px auto 1px 1px;border-radius:999px;background:#9adbe5;width:0;}
.activity-screen .activity-progress-pill.is-achieved .activity-progress-fill{background:#98d8c9;}
.activity-screen .activity-progress-label{display:flex;align-items:center;position:relative;height:100%;padding:0 12px;font-size:14px;font-weight:800;z-index:1;}
.activity-screen .activity-session-status{font-size:12px;color:#c8bbe5;line-height:1.5;margin:12px 0 6px;}
.activity-screen .activity-clock{font-size:28px;font-weight:750;font-variant-numeric:tabular-nums;margin:4px 0 14px;line-height:1.25;}
.activity-screen .activity-clock:empty{display:none;}
.activity-screen .activity-controls{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;margin:14px 0;}
.activity-screen .activity-controls button{width:100%;min-width:0;min-height:43px;padding:10px 3px;font-size:13px;}
.activity-screen button:disabled{opacity:.38;cursor:default;}
.activity-screen .activity-disclosure{background:#ffffff06;border:1px solid #a88af42b;border-radius:14px;padding:12px;margin-top:17px;}
.activity-screen summary{font-size:13px;font-weight:750;cursor:pointer;color:#dfd2fa;line-height:1.5;}
.activity-screen summary::marker{color:#a88af4;}
.activity-screen details .feature-form{margin-top:15px;}
.activity-screen .field-label{font-size:12px;color:#d9ceed;}
.activity-screen .field-label input{font-size:14px;min-width:0;}
.activity-screen .activity-form-status{font-size:12px;line-height:1.5;color:#facb8f;margin:0;}
.activity-screen .activity-section-head{display:flex;align-items:center;justify-content:space-between;gap:9px;}
.activity-screen .activity-section-head h2{font-size:16px;margin:0;}
.activity-screen .activity-range{display:flex;gap:5px;flex-shrink:0;}
.activity-screen .activity-range button{font-size:11px;padding:7px 8px;min-height:34px;}
.activity-screen .activity-range .active{background:#a88af4;color:#211b4c;}
.activity-screen .activity-trend-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;margin-top:14px;}
.activity-screen .activity-trend-grid>div{display:flex;flex-direction:column;gap:7px;background:#ffffff06;border-radius:13px;padding:12px 7px;}
.activity-screen .activity-trend-grid strong{font-size:17px;line-height:1.3;color:#bce6eb;overflow-wrap:anywhere;}
.activity-screen .activity-trend-grid>div:last-child strong{color:#d7c6f6;}
.activity-screen .activity-trend-grid span{font-size:11px;color:#c0b4d7;}
.activity-screen .activity-history-day{padding:14px 0;border-top:1px solid #ffffff10;}
.activity-screen .activity-history-day:first-of-type{margin-top:13px;}
.activity-screen .activity-history-day:last-child{padding-bottom:0;}
.activity-screen .activity-history-day strong{font-size:13px;}
.activity-screen .activity-history-day p{font-size:12px;line-height:1.6;color:#d1c7e5;margin:8px 0;overflow-wrap:anywhere;}
.activity-screen .activity-history-rest{display:inline-block;border-radius:9px;background:#a88af41c;color:#ddcff9;font-size:11px;padding:6px 8px;margin:9px 0 2px;}
.activity-screen .activity-sessions summary{font-size:11px;color:#bcaee1;margin-top:8px;}
@media(max-width:350px){.activity-screen .activity-hero{grid-template-columns:minmax(0,1fr) 82px;}.activity-screen .activity-hero img{width:82px;height:82px;}.activity-screen .activity-modes button{font-size:12px;}.activity-screen .activity-trends .activity-section-head{flex-wrap:wrap;}}
@media(max-width:390px){.feature-grid.two{grid-template-columns:1fr}.feature-actions.spread{display:grid;grid-template-columns:1fr auto}}
#item-list .list-item .media-meta{grid-column:1/-1;margin-left:0;align-items:start;background:#ffffff0a;border-radius:14px;padding:9px;}
#item-list .list-item .media-meta:not(:has(img)){grid-template-columns:1fr;}
#item-list .list-item .media-meta-actions .mini-button{padding:6px 9px;}
.workout-day .exercise-row{grid-template-columns:auto 1fr;align-items:start;}
.workout-day .exercise-row>input[type="checkbox"]{grid-column:1;grid-row:1;margin-top:35px;inline-size:18px;block-size:18px;}
.workout-day .exercise-row>.field-label{grid-column:2;}
.workout-day .exercise-row>.media-links,.workout-day .exercise-row>.mini-button{grid-column:2;}
#item-list .list-item{display:grid!important;grid-template-columns:24px minmax(0,1fr) 34px!important;column-gap:10px;align-items:center;}
#item-list .list-item>label{min-width:0;overflow-wrap:normal;word-break:normal;}
#item-list .list-item>.remove-item{justify-self:end;}
#item-list .list-item .media-meta{grid-column:1/-1!important;width:100%;box-sizing:border-box;}
/* Local refinement: workout weekly planner, compact medicine and TV series. */
.weekly-planner .week-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:10px;}
.week-day{border:1px solid #ffffff18;background:#1d1745;border-radius:15px;padding:9px;display:grid;gap:6px;}
.week-day.done{border-color:#98d8c9;background:linear-gradient(135deg,#234e55,#211947);}
.week-day.repeat-warning{border-color:#facb8f;}
.week-day strong{font-size:13px;}
.week-day .field-label{font-size:10px;gap:4px;}
.week-day .field-label select,.week-day .field-label input{padding:8px 9px;border-radius:10px;font-size:12px;}
.week-day small,.week-day em{font-size:10px;color:#d9d0ff;line-height:1.2;}
.week-day em{color:#facb8f;font-style:normal;font-weight:800;}
.history-edit-row{display:grid;grid-template-columns:1.15fr 1fr .8fr;gap:8px;margin:9px 0;padding:8px;border-radius:14px;background:#ffffff0a;}
.medicine-compact-add{padding:10px;}
.medicine-row.compact{display:grid;gap:7px;}
.medicine-row.compact small{font-size:12px;color:#d9d0ff;font-weight:800;}
.medicine-row.compact.taken{border-color:#98d8c966;}
.medicine-row.compact.skipped{border-color:#ffb05f66;}
#show-tv{border:0;border-radius:18px;padding:11px 16px;background:#1b1642;color:#e9ddff;font-weight:800;}
#show-tv.active,body[data-media-mode="tv"] #show-tv{background:#d5a1e5;color:#201947;}
.series-progress{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;margin:7px 0;}
.series-progress .field-label{font-size:10px;gap:4px;}
.series-progress input,.series-progress select{padding:8px 9px!important;border-radius:10px!important;font-size:12px;}
@media(max-width:390px){.weekly-planner .week-grid,.history-edit-row,.series-progress{grid-template-columns:1fr;}}
#item-list .tv-item[hidden] { display:none !important; }
.tv-item .series-progress { grid-template-columns:repeat(2,minmax(0,1fr)); }
#library-switch[hidden], #library-theme-card[hidden], #detail-view:not([data-module="movies"]) .media-section-strip,
#plan-tabs[hidden], #office-calendar[hidden] { display:none !important; }
.plan-tabs {display:flex;gap:6px;background:#1B1642;padding:5px;border-radius:18px;margin:18px 0;}
.plan-tab {flex:1;min-height:42px;border-radius:14px;background:transparent;color:#DED7F3;font:inherit;font-size:13px;font-weight:750;padding:8px;}
.plan-tab.active {background:#A88AF4;color:#211B4C;}
.office-calendar {background:#231D50;border:1px solid #8B7ADD55;border-radius:22px;padding:12px;}
.office-month-nav {display:flex;align-items:center;gap:4px;margin:2px 0 18px;}
.office-month-nav h2 {flex:1;text-align:center;font-size:16px;line-height:1.3;margin:0;}
.office-month-nav button {padding:4px;min-width:29px;min-height:36px;font-size:21px;}
.office-grid {display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:5px;}
.office-weekday {text-align:center;font-size:10px;font-weight:700;color:#BDB5D7;padding-bottom:6px;}
.office-day {--office-accent:#797095;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;min-width:0;min-height:58px;border-radius:12px;border:1px solid color-mix(in srgb,var(--office-accent) 46%,transparent);background:color-mix(in srgb,var(--office-accent) 13%,#231D50);color:#F5F2FF;padding:5px 1px;font:inherit;}
.office-day:not([data-status="unassigned"]) {background:color-mix(in srgb,var(--office-accent) 28%,#231D50);border-color:color-mix(in srgb,var(--office-accent) 65%,transparent);}
.office-day strong {font-size:14px;}.office-day small {font-size:10px;font-weight:750;color:color-mix(in srgb,var(--office-accent) 85%,white);line-height:1.3;white-space:nowrap;letter-spacing:-.1px;}
.office-day.is-today {box-shadow:inset 0 0 0 1px #E2D9FF;}.office-day.is-today strong {text-decoration:underline;text-underline-offset:3px;}
.office-day.is-selected {outline:2px solid #A88AF4;outline-offset:1px;}
.office-counts {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px;margin-top:18px;}
.office-count {display:flex;flex-direction:column;align-items:center;gap:4px;border-radius:12px;padding:11px 2px;background:#FFFFFF06;border-top:2px solid var(--office-accent);}
.office-count strong {color:var(--office-accent);font-size:22px;}.office-count span {font-size:10px;color:#E8E1FA;}
.office-actions {display:flex;justify-content:space-between;gap:8px;margin-top:18px;}.office-note {font-size:11px;color:#BDB5D7;line-height:1.5;margin-bottom:0;}
#office-calendar .office-actions button {flex:0 0 auto;width:auto;max-width:none;white-space:nowrap;overflow:visible;text-overflow:clip;padding:9px 12px;font-size:12px;line-height:1.4;}
.office-status-options {display:grid;gap:9px;margin:18px 0;}.office-status-choice {border-radius:13px;padding:13px;border:1px solid var(--office-accent);background:#FFFFFF09;color:var(--office-accent);font:inherit;font-weight:750;}
@media(max-width:350px){.office-calendar{padding:8px}.office-grid{gap:2px}.office-day{min-height:54px;padding-inline:0}.office-day small{font-size:9.5px;letter-spacing:-.4px}.office-month-nav h2{font-size:14px}.office-month-nav button{min-width:25px}}
.custom-dashboard-card[data-artwork="books"]{--scene-a:#facb8f;--scene-b:#b399e3;}
.tracker-choice{display:block;text-decoration:none;color:inherit;margin-top:14px;}
.tracker-choice strong{font-size:18px;}
.tracker-choice.water-card strong{color:var(--water-accent,#72d3df);}
.tracker-choice.sleep-card strong{color:#c3aff3;}
#show-books[hidden],#library-switch[hidden]{display:none!important;}
.habits-screen{font-family:'Rounded Mplus 1c',sans-serif;color:#eee8fa;}
.habits-screen *{font-family:'Rounded Mplus 1c',sans-serif!important;}
.habit-toolbar{display:flex;gap:4px;background:#201c35;padding:5px;border-radius:16px;}
.habit-toolbar button{flex:1;border:0;background:transparent;font:inherit;font-size:12px;color:#c8bede;min-width:0;padding:9px 5px;border-radius:12px;}
.habit-toolbar button[aria-pressed=true]{background:#a88ae5;color:#1e1932;font-weight:800;}
.habit-nav{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:16px 0;}
.habit-nav strong{font-size:11px;text-align:center;}
.habit-add{width:100%;margin-bottom:16px;}
.habit-card{background:linear-gradient(135deg,#29243e,#211d34);border:1px solid #82709544;border-radius:20px;padding:16px;margin-bottom:13px;min-width:0;overflow:hidden;border-top:2px solid var(--habit-color,#b7a0ea);}
.habit-card h2{font-size:15px!important;margin:0;font-family:inherit!important;line-height:1.5;}
.habit-card-head{display:flex;align-items:center;justify-content:space-between;gap:8px;}
.habit-streak{font-size:10px;color:#d1bfdc;white-space:nowrap;}
.habit-summary{font-size:11px;color:#c5b9d9;line-height:1.7;margin:7px 0 12px;}
.habit-map-scroll{overflow-x:auto;overscroll-behavior-x:contain;padding:4px 0 12px;scrollbar-width:thin;scrollbar-color:#7a639e #211d34;}
.habit-map{width:max-content;min-width:100%;}
.habit-map:not(.is-weekly){width:calc(var(--map-width) + 28px);min-width:0;}
.habit-months{position:relative;width:var(--map-width);height:25px;color:#c9bddc;font-size:10px;line-height:18px;}
.habit-months span{position:absolute;white-space:nowrap;}
.habit-grid{display:flex;gap:3px;}
.habit-map.is-weekly .habit-grid{display:block;}
.habit-map.is-weekly .habit-week{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:6px;}
.habit-map.is-weekly .habit-cell{width:100%;height:auto;aspect-ratio:1;border-radius:7px;}
.habit-map.is-weekly button.habit-cell{color:#eee6fa;font-size:9px;}
.habit-map.is-weekly button.habit-cell.completed{color:#211a32;font-weight:800;}
.habit-week{display:flex;flex-direction:column;gap:3px;}
.habit-cell{display:inline-block;width:9px;height:9px;min-width:9px;padding:0;border:1px solid #80748e44;border-radius:2px;background:#3d364e;box-sizing:border-box;}
button.habit-cell{cursor:pointer;}
.habit-cell.completed{background:var(--habit-color,#b7a0ea);border-color:transparent;}
.habit-cell.partial{background:var(--habit-color,#b7a0ea);opacity:.58;}
.habit-cell.missed{background:#bc73886b;border-color:#be8196;}
.habit-cell.untracked{background:#3d364e;}
.habit-cell.unscheduled{background:transparent;border-style:dotted;opacity:.5;}
.habit-cell.rest{background:repeating-linear-gradient(45deg,#66587b 0 2px,#b3a5ce 2px 3px);border-color:#b3a5ce;}
.habit-legend{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 12px;font-size:11px;line-height:1.5;color:#d1c5e1;margin:4px 0 20px;padding:6px 0;}
.habit-legend span{display:flex;align-items:center;gap:8px;min-width:0;}
.habit-legend .habit-cell{flex-shrink:0;width:11px;height:11px;}
.habits-screen{padding-bottom:calc(88px + env(safe-area-inset-bottom));}
.habit-range{font-size:10px;color:#aa9cbe;line-height:1.7;margin:8px 0;}
.habit-actions{display:flex;flex-wrap:wrap;gap:7px;margin-top:9px;}
.habit-actions a{text-decoration:none;}
.habit-actions button,.habit-actions a{font-size:10px!important;min-height:30px;}
.habit-today-pill{border-radius:12px;background:#40364e;padding:10px;font-size:12px;}
.habit-today-pill.completed{color:#a2ddcd;}.habit-today-pill.rest{color:#d4c2ee;}
.habit-history{margin-top:14px;border-top:1px solid #83708d33;padding-top:12px;font-size:11px;}
.habit-history summary{cursor:pointer;}
.habit-history-row{display:block;width:100%;text-align:left;border:0;border-bottom:1px solid #83708d22;background:transparent;color:#cdc0de;padding:10px 0;font:inherit;line-height:1.6;}
.habit-dialog{max-width:min(92vw,420px);width:100%;max-height:85dvh;overflow:auto;box-sizing:border-box;}
.habit-dialog .feature-form{margin:0;}.habit-dialog input,.habit-dialog select{min-width:0;width:100%;box-sizing:border-box;}
.habit-weekdays{display:flex;flex-wrap:wrap;gap:10px;font-size:11px;}.habit-weekdays input{width:auto;display:block;}
.habit-weekdays[hidden]{display:none!important;}
.habit-color-swatches{border:0;margin:0;padding:0;display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:8px;}
.habit-color-swatches legend{font-size:12px;color:#d6c9e7;margin-bottom:10px;}
.habit-color-swatch{background:var(--swatch);border:2px solid transparent;border-radius:50%;aspect-ratio:1;width:100%;min-width:0;min-height:28px;color:#241e38;font-weight:900;font-size:14px;cursor:pointer;}
.habit-color-swatch[aria-pressed=true]{outline:2px solid #efe8ff;outline-offset:2px;}
.habit-color-swatch:focus-visible{outline:3px solid #f3c489;outline-offset:2px;}
.habit-custom-color{font-size:10px!important;}
.habit-custom-color input{height:30px;min-height:30px!important;padding:3px!important;}
.habit-more-colors summary{font-size:11px;color:#cdbde3;cursor:pointer;}
.habit-more-colors .habit-custom-color{margin-top:10px;}
.habit-dialog [role="alert"]:empty{display:none;}
.habit-scroll-hint{font-size:10px;color:#d1c0e7;margin:4px 0 8px;}
.habit-quick-complete{background:#b7a0ea!important;color:#20192e!important;font-weight:800;}
.habit-quick-complete:disabled{opacity:.45;}
@media(max-width:350px){.habit-color-swatches{grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.habit-color-swatch{width:34px;min-height:34px;justify-self:center}}
@media(max-width:350px){.habit-card{padding:12px}.habit-card h2{font-size:14px!important}.habit-streak{font-size:9px}}
.habit-dialog .habit-art-preview{width:88px;height:88px;object-fit:contain;justify-self:center;border-radius:16px;background:#3b3057;}
.habit-dialog .check-row{display:flex;align-items:center;justify-content:space-between;gap:12px;}
.habit-dialog .check-row input{width:20px;min-height:20px;height:20px;flex:0 0 20px;}
.habit-setup{display:grid;gap:12px;}.habit-setup h2,.habit-setup p{margin:0;}
/* Distinct new-card palettes; original art-card SVGs are deliberately untouched. */
.custom-dashboard-card.has-illustration{--palette-top:#384e66;--palette-base:#243449;background:radial-gradient(ellipse at 100% 0%,color-mix(in srgb,var(--scene-a) 24%,transparent),transparent 68%),linear-gradient(145deg,var(--palette-top),var(--palette-base) 90%);}
.custom-dashboard-card[data-artwork="books"]{--scene-a:#e8b56b;--scene-b:#ab7958;--palette-top:#684922;--palette-base:#3d2d21;}
.custom-dashboard-card[data-artwork="medicine"]{--scene-a:#91d6b8;--scene-b:#4b9e8b;--palette-top:#245647;--palette-base:#183c36;}
.custom-dashboard-card[data-artwork="workout"]{--scene-a:#e8b6a6;--scene-b:#c78ca4;--palette-top:#64404c;--palette-base:#402d3d;}
.custom-dashboard-card[data-artwork="activity"]{--scene-a:#8bbddf;--scene-b:#829ac8;--palette-top:#2e506d;--palette-base:#21394f;}
.custom-dashboard-card[data-artwork="airbike"]{--scene-a:#cb92cb;--scene-b:#9f6fbb;--palette-top:#613b67;--palette-base:#3b294f;}
.custom-dashboard-card[data-artwork="habit"]{--scene-a:#dec18b;--scene-b:#ac96bf;--palette-top:#5b4b53;--palette-base:#3a304b;}
.custom-dashboard-card[data-habit-card="true"]{--scene-a:var(--card-accent);--scene-b:color-mix(in srgb,var(--card-accent) 60%,#b9a4d3);--palette-top:color-mix(in srgb,var(--card-accent) 24%,#292337);--palette-base:color-mix(in srgb,var(--card-accent) 8%,#241e32);background:radial-gradient(ellipse at 100% 0%,color-mix(in srgb,var(--scene-a) 16%,transparent),transparent 68%),linear-gradient(145deg,var(--palette-top),var(--palette-base) 90%);}
.media-meta-actions .field-label{font-size:11px;margin:0;}.media-meta-actions select{max-width:155px;padding:7px;border-radius:12px;background:#30264e;color:#eee8fa;border:1px solid #a98fc266;}

/* Dedicated Sleep: local preview; original Rest dashboard artwork is untouched. */
.sleep-dashboard{--sleep-ink:#ece7fa;--sleep-muted:#bdb4d4;--sleep-line:#75628f55;--sleep-surface:#211d36;color:var(--sleep-ink);font-family:'Rounded Mplus 1c',sans-serif;}
.sleep-dashboard button,.sleep-dashboard input{font-family:inherit;}
.sleep-period-tabs{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));padding:5px;gap:3px;background:#1e1a32;border:1px solid var(--sleep-line);border-radius:18px;}
.sleep-period-tabs button{border:0;border-radius:13px;min-width:0;padding:10px 0;font-size:12px;color:#c7bddc;background:transparent;font-weight:700;}
.sleep-period-tabs button[aria-pressed=true]{background:#b49aea;color:#21182f;}
.sleep-date-nav{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:18px 0;}
.sleep-nav-arrow{width:36px;height:36px;flex-shrink:0;border:1px solid var(--sleep-line);border-radius:12px;background:#29233f;color:#e5d9fa;font-size:24px;}
.sleep-date-label{position:relative;text-align:center;font-size:13px;font-weight:700;min-width:0;}
.sleep-date-label input{display:block;width:100%;max-width:170px;margin:5px auto 0;padding:5px 8px!important;min-height:30px!important;border-radius:9px!important;font-size:11px!important;color-scheme:dark;}
.sleep-duration-card{padding:18px 14px 16px;border-radius:26px;background:radial-gradient(ellipse at 50% 30%,#5d47733b,transparent 72%),linear-gradient(145deg,#29223e,#201c32);border:1px solid var(--sleep-line);text-align:center;}
.sleep-ring{position:relative;width:220px;max-width:100%;aspect-ratio:1;margin:auto;}
.sleep-ring svg{width:100%;height:100%;transform:rotate(-90deg);}
.sleep-ring circle{fill:none;stroke-width:11;}
.sleep-ring-track{stroke:#453a58;}
.sleep-ring-fill{stroke:#b9a0ed;stroke-linecap:round;transition:stroke-dashoffset .4s;}
.sleep-duration-card.is-achieved .sleep-ring-fill{stroke:#98d8c9;}
.sleep-duration-card.is-achieved .sleep-ring-value{color:#a4dfd1;}
.sleep-ring-copy{position:absolute;inset:0;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:8px;}
.sleep-ring-caption{color:#c6b8dd;font-size:11px;letter-spacing:.7px;}
.sleep-ring-value{font-family:'Rounded Mplus 1c',sans-serif!important;font-size:31px!important;font-weight:800!important;line-height:1.2;letter-spacing:-1px;}
.sleep-ring-target{font-size:12px;color:#bfb3d2;}
.sleep-ring-status{font-size:12px;margin:5px 0 0;color:#c8bbda;line-height:1.6;}
.sleep-duration-card.is-achieved .sleep-ring-status{color:#a4dfd1;}
.sleep-panel,.sleep-dashboard .sleep-editor{margin-top:14px;padding:18px;border-radius:22px;border:1px solid var(--sleep-line);background:var(--sleep-surface);}
.sleep-dashboard h2{margin:0 0 13px;font-size:14px!important;line-height:1.5;font-weight:800;}
.sleep-muted{color:var(--sleep-muted);font-size:12px;line-height:1.7;margin:8px 0 0;}
.sleep-time-pair,.sleep-stat-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;}
.sleep-time-pair>div{background:transparent!important;border:0!important;padding:0!important;}
.sleep-dashboard .sleep-time-pair strong{font-size:18px!important;color:#e7def4;}
.sleep-timeline-line{height:9px;border-radius:20px;background:linear-gradient(90deg,#b29ad7,#8972b5);margin-top:17px;}
.sleep-stat-grid{margin-top:14px;}
.sleep-stat-grid>div{display:flex;flex-direction:column;gap:7px;background:#262038;padding:15px 12px;border:1px solid var(--sleep-line);border-radius:18px;min-width:0;}
.sleep-stat-grid span,.sleep-time-pair span{font-size:10px!important;color:var(--sleep-muted);line-height:1.5;}
.sleep-stat-grid strong{font-size:20px!important;color:#e3d5f6;line-height:1.4;}
.sleep-chart{display:flex;gap:8px;align-items:end;margin-top:18px;}
.sleep-chart-column{flex:1;min-width:0;display:flex;flex-direction:column;align-items:center;gap:7px;}
.sleep-chart-rail{height:112px;width:100%;display:flex;align-items:end;border-bottom:1px solid #75628f66;}
.sleep-chart-rail span{width:100%;max-width:26px;margin:0 auto;background:#b29adf;border-radius:7px 7px 2px 2px;}
.sleep-chart-rail span.is-achieved{background:#98d8c9;}
.sleep-chart-column small{font-size:9px!important;color:#b9accd;min-height:15px;white-space:nowrap;}
.sleep-chart.is-month{gap:3px;}
.sleep-insight small{display:block;margin-top:12px;font-size:10px;color:#968aa9;line-height:1.7;}
.sleep-history summary{font-size:13px;font-weight:800;cursor:pointer;}
.sleep-history .history-list{margin-top:12px;}
.sleep-history .history-item{width:100%;min-width:0;}
.sleep-dashboard .sleep-editor{box-shadow:none;}
.sleep-dashboard .sleep-editor .sleep-live{margin-top:0;}
.sleep-dashboard .sleep-editor .field-label{font-size:11px;}
@media(max-width:350px){.sleep-panel,.sleep-dashboard .sleep-editor{padding:14px}.sleep-ring{width:200px}.sleep-chart{gap:5px}.sleep-chart-column small{font-size:8px!important}.sleep-stat-grid>div{padding:12px 10px}.sleep-stat-grid strong{font-size:18px!important}}

.custom-dashboard-card[data-artwork="custom"]:not([data-habit-card]){--palette-top:#2a505a;--palette-base:#263044;}
.library-theme-card.supplied-media-banner{background:transparent;border:0;box-shadow:none;overflow:visible;}
.library-theme-card.supplied-media-banner .library-theme-image{width:auto;height:auto;max-width:100%;max-height:100%;margin:auto;object-fit:contain;object-position:center;transform:none;border:0;box-shadow:none;}
#detail-view[data-module="movies"] #item-list .list-item[hidden]{display:none!important;}
/* Profile drawer: account actions and existing dashboard controls share one menu. */
.profile-drawer{box-sizing:border-box;position:fixed;inset:0 0 0 auto;margin:0;width:min(370px,94vw);height:100dvh;max-height:100dvh;max-width:none;padding:0;border:1px solid #7965b54d;border-radius:26px 0 0 26px;background:linear-gradient(155deg,#30294c,#1d1932 65%);color:#f5f0ff;box-shadow:-16px 0 60px #08051266;overflow:hidden;font-family:inherit}
.profile-drawer[open]{display:flex;flex-direction:column;animation:profile-slide .24s ease-out}
.profile-drawer::backdrop{background:#08061499;backdrop-filter:blur(3px)}
.profile-drawer-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:calc(24px + env(safe-area-inset-top)) 22px 18px;border-bottom:1px solid #ac92e525;flex:none}
.profile-drawer-heading small{font-size:10px;letter-spacing:1.7px;color:#b6a2dc}.profile-drawer-heading h2{margin:3px 0 0;font-size:24px;line-height:1.3}
.profile-drawer-close{border:1px solid #ae93ef40;background:#a98cdd18;color:#eee5ff;border-radius:50%;width:38px;height:38px;font-size:26px;cursor:pointer;flex:none}
.profile-drawer-scroll{overflow-y:auto;overscroll-behavior:contain;padding:20px 18px calc(26px + env(safe-area-inset-bottom));min-height:0}
.profile-account{display:flex;flex-direction:column;gap:10px}.profile-account h2{font-size:17px;margin:0}.profile-account p{font-size:12px;line-height:1.65;margin:0 0 5px;overflow-wrap:anywhere}.profile-account .ws-button{box-sizing:border-box;max-width:100%;white-space:normal;text-align:left;min-height:42px}
.profile-quick{margin-top:24px;padding-top:18px;border-top:1px solid #ac92e525}.profile-quick h3{font-size:13px;color:#c9b5ef;margin:0 0 12px}
.profile-control{display:flex;align-items:center;gap:12px;width:100%;padding:12px 10px;margin:6px 0;background:#a88cd00c;border:1px solid #b59bdf20;border-radius:15px;color:inherit;text-align:left;font:inherit;cursor:pointer}
.profile-control:hover{background:#b699ee19}.profile-control-icon{display:grid;place-items:center;flex:0 0 36px;height:36px;border-radius:50%;background:linear-gradient(145deg,#9473d35c,#6350a738);color:#d4baff}.profile-control-icon svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}.profile-control strong{display:block;font-size:13px;line-height:1.4}.profile-control small{display:block;font-size:10px;line-height:1.6;color:#b9accf}
@keyframes profile-slide{from{transform:translateX(100%)}to{transform:translateX(0)}}
@media(prefers-reduced-motion:reduce){.profile-drawer[open]{animation:none}}
/* Compact account summary keeps the three quick controls within immediate reach. */
.profile-drawer-heading{padding-top:calc(18px + env(safe-area-inset-top));padding-bottom:14px}
.profile-account{gap:4px}.profile-account .profile-identity{font-size:12px;color:#d2c1ed;overflow-wrap:anywhere;margin:0}.profile-account [data-cloud-status]{font-size:11px;line-height:1.5;margin:0;color:#bcb0d1}
.profile-quick{margin-top:16px;padding-top:14px}.profile-control{padding:10px;margin:5px 0}
.profile-actions{margin-top:18px;border-top:1px solid #ac92e525;padding-top:14px}.profile-actions>summary{cursor:pointer;font-size:13px;font-weight:700;color:#d9c6fa;min-height:30px;line-height:30px}.profile-action-rows{display:flex;flex-direction:column;gap:3px;padding-top:8px}.profile-action-rows .ws-button{display:block;box-sizing:border-box;width:100%;min-height:40px;padding:10px 12px;text-align:left;font:inherit;font-size:12px;line-height:1.5;color:#eee5ff;border:0;border-bottom:1px solid #b49bd921;border-radius:8px;background:transparent;white-space:normal;cursor:pointer}.profile-action-rows .ws-button:hover{background:#ad8deb19}.profile-action-rows p{font-size:11px;line-height:1.6;color:#b9accf;margin:0 0 10px}
.profile-account .profile-sign-in{align-self:flex-start;width:auto;min-height:34px;margin:7px 0 0;padding:7px 13px;font-size:12px;line-height:1.5;border-radius:10px}
.profile-drawer .profile-account button.profile-sign-in{width:auto!important;min-height:34px;padding:7px 13px;font-size:12px;line-height:1.5;align-self:flex-start;text-align:left}
/* Approved drawer alignment grid; presentation only. */
.profile-drawer-heading{padding-left:18px;padding-right:18px;min-height:78px;box-sizing:border-box}
.profile-drawer-close{display:grid;place-items:center;width:44px;height:44px;min-width:44px;padding:0;border:0;border-radius:0;background:transparent;box-shadow:none;font-size:0;color:#eee5ff;position:relative}
.profile-drawer-close::before,.profile-drawer-close::after{content:'';position:absolute;width:17px;height:2px;border-radius:2px;background:currentColor;left:50%;top:50%;transform:translate(-50%,-50%) rotate(45deg)}
.profile-drawer-close::after{transform:translate(-50%,-50%) rotate(-45deg)}
.profile-drawer-close:focus-visible{outline:2px solid #c7a6ff;outline-offset:-4px;border-radius:8px}
.profile-drawer-scroll{padding-left:18px;padding-right:18px}
.profile-account h2,.profile-quick h3,.profile-actions>summary{margin-left:0;margin-right:0}
.profile-quick{display:flex;flex-direction:column;gap:8px;margin-top:16px;padding-top:16px}
.profile-quick h3{margin:0 0 4px;line-height:20px}
.profile-quick .profile-control{box-sizing:border-box;width:100%;min-height:62px;margin:0;padding:10px 12px;gap:12px;border:1px solid #b59bdf20;border-radius:15px;align-items:center}
.profile-control-icon{box-sizing:border-box;flex:0 0 36px;width:36px;height:36px}
.profile-control>span:last-child{display:flex;flex-direction:column;justify-content:center;min-width:0;gap:2px}
.profile-control strong{font-size:13px;line-height:18px;margin:0}.profile-control small{font-size:10px;line-height:15px;margin:0}
.profile-actions{margin-top:16px;padding-top:16px}.profile-actions>summary{min-height:44px;line-height:24px;padding:10px 0;box-sizing:border-box}
.profile-quick{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto repeat(3,minmax(62px,1fr))}
.profile-drawer #manage-cards-entry{margin:0}
.dashboard-arrange-bar{position:sticky;top:8px;z-index:25;display:flex;align-items:center;justify-content:space-between;padding:10px 14px;margin:12px 0;background:#30264eee;border:1px solid #b795ee66;border-radius:17px;color:#f6efff;font-size:13px;backdrop-filter:blur(12px)}.dashboard-arrange-bar[hidden]{display:none}.dashboard-arrange-bar small{display:block;font-size:10px;color:#c8b6e4}.dashboard-arrange-bar button{background:#b398ed;border:0;color:#241a3c;border-radius:12px;padding:10px 18px;font:inherit;font-weight:700;min-height:44px}.dashboard-arranging>[data-card-id]{touch-action:none;user-select:none;outline:1px solid #c4a6f877;outline-offset:2px;cursor:grab}.dashboard-arranging .arrange-placeholder{opacity:.25;outline:2px dashed #d0b9ff}.arrange-ghost{position:fixed!important;z-index:1000!important;pointer-events:none!important;margin:0!important;transform:scale(1.035) rotate(1deg);box-shadow:0 16px 35px #0008;opacity:.96;contain:layout}.arrange-announcement{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
@media(prefers-reduced-motion:reduce){.arrange-ghost{transform:none}}
.dashboard-arrange-bar{position:fixed;top:calc(10px + env(safe-area-inset-top));left:50%;transform:translateX(-50%);box-sizing:border-box;width:min(380px,calc(100vw - 24px));margin:0;z-index:90}
.mosaic-grid>[data-card-id]{-webkit-touch-callout:none;user-select:none}
.library-theme-card.books.supplied-media-banner .library-theme-image{border-radius:24px}
