:root {
  color-scheme: light;
  --bg: #f7f8fc;
  --ink: #21243b;
  --muted: #7a8299;
  --border: #e7e9f1;
  --card: #ffffff;
  --accent: #5756bd;
  --accent-dark: #4241a0;
  --shadow: 0 15px 45px rgba(51, 56, 99, .055);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .6; }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid #8781e09a; outline-offset: 2px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.shell { width: min(1370px, calc(100% - 44px)); margin: 0 auto; }
.topbar { min-height: 94px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-symbol { display: grid; place-items: center; font-size: 27px; background: #eeeaff; color: #5756bd; border-radius: 16px; width: 48px; height: 48px; }
.brand strong { display: block; font-size: 19px; letter-spacing: -.6px; line-height: 1.3; }
.brand small { color: var(--muted); display: block; font-size: 11px; font-weight: 600; letter-spacing: .8px; }
.header-controls { display: flex; align-items: center; gap: 13px; justify-content: flex-end; min-width: 0; flex-wrap: wrap; }
.language-switch { display: flex; align-items: center; gap: 3px; padding: 4px; border: 1px solid #e1e1f0; background: #f0f1f9; border-radius: 12px; flex-shrink: 0; }
.language-option { border: none; padding: 8px 12px; border-radius: 9px; background: transparent; color: #606781; font-size: 12px; font-weight: 750; }
.language-option:hover { background: #e9e9fa; }
.language-option.active { background: #fff; color: #4845a8; box-shadow: 0 2px 7px #262b4d17; }
.topbar-actions { display: flex; align-items: center; gap: 16px; }
.account-name { color: #626a83; font-size: 13px; overflow-wrap: anywhere; }
.btn { border: 0; border-radius: 12px; padding: 11px 17px; font-weight: 720; transition: .2s; white-space: nowrap; }
.btn-primary { color: white; background: var(--accent); box-shadow: 0 5px 13px #5756bd39; }
.btn-primary:hover:not(:disabled) { background: var(--accent-dark); transform: translateY(-1px); }
.btn-ghost { color: #565c7e; background: white; border: 1px solid var(--border); }
.btn-ghost:hover { background: #eeeffa; }
.btn-outline { color: #5756bd; background: #fff; border: 1px solid #d9d8f5; }
.btn-outline:hover { background: #f3f1ff; }
.full { width: 100%; }
.card, .auth-card { background: var(--card); border: 1px solid var(--border); border-radius: 21px; box-shadow: var(--shadow); }
.eyebrow { color: #7274b3; font-size: 11px; font-weight: 850; letter-spacing: 2px; }
.footer { text-align: center; padding: 32px 0 25px; font-size: 12px; color: #9a9eb0; }
.footer span { padding: 0 7px; }

/* Widok logowania */
.auth-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(350px, .9fr); gap: clamp(26px, 7vw, 110px); align-items: center; min-height: min(670px, calc(100vh - 165px)); padding: 25px 35px 34px; }
.welcome-panel h1 { font-size: clamp(39px, 4.5vw, 65px); line-height: 1.14; letter-spacing: -2.6px; margin: 17px 0 25px; }
.welcome-panel h1 em { font-style: normal; background: linear-gradient(105deg,#e65c49,#d8a932,#5cae69,#3c8acd,#9561c8); background-clip: text; -webkit-background-clip: text; color: transparent; }
.welcome-panel > p { font-size: 17px; line-height: 1.75; color: #687087; max-width: 525px; margin: 0 0 39px; }
.mood-stripes { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; max-width: 620px; }
.mood-stripe { display: flex; min-height: 162px; flex-direction: column; align-items: center; justify-content: center; border-radius: 19px; gap: 13px; box-shadow: 0 9px 19px #15223c0c; }
.mood-stripe span { font-size: clamp(29px, 3.2vw, 42px); filter: drop-shadow(0 4px 3px #00000009); }
.mood-stripe b { color: #fff; font-size: 14px; letter-spacing: .1px; }
.mood-stripe.angry { background: linear-gradient(145deg, #ff7155, #e64232); }
.mood-stripe.sad { background: linear-gradient(145deg, #55b0e8, #3276d5); }
.mood-stripe.fear { background: linear-gradient(145deg, #b98fdf, #8654ba); }
.mood-stripe.disgust { background: linear-gradient(145deg, #8ac75f, #3b9a58); }
.mood-stripe.joy { background: linear-gradient(145deg, #fbd956, #e4a91a); }
.privacy-note { margin-top: 30px; max-width: 570px; display: flex; gap: 11px; font-size: 13px; color: #727b8c; line-height: 1.65; }
.privacy-note span { font-size: 19px; }
.auth-card { padding: 30px; max-width: 475px; width: 100%; justify-self: center; }
.auth-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: #f2f3f9; border-radius: 13px; padding: 5px; margin-bottom: 28px; }
.auth-tab { background: transparent; border: none; border-radius: 10px; padding: 11px; color: #777e91; font-weight: 700; }
.auth-tab.active { background: white; color: var(--accent); box-shadow: 0 2px 7px #262b4d12; }
.auth-card h2 { font-size: clamp(21px, 2.1vw, 28px); letter-spacing: -.7px; margin: 0 0 7px; }
.auth-card > p { margin: 0 0 24px; font-size: 13px; }
.auth-card form label { display: block; color: #42465f; font-weight: 700; font-size: 13px; margin: 16px 0 7px; }
.auth-card form input { width: 100%; border: 1px solid #dce0e9; border-radius: 11px; color: #20243b; background: white; padding: 13px 14px; outline: none; }
.auth-card form input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px #5756bd1b; }
.auth-card #auth-submit { margin-top: 24px; padding: 14px; }
.form-error { color: #ba3030; border-radius: 10px; background: #fff0ef; padding: 10px 12px; font-size: 12px; line-height: 1.5; }
.security-info { display: flex; gap: 12px; margin-top: 23px; padding: 14px; background: #f5f6fc; border-radius: 12px; }
.security-info > span { font-size: 21px; }
.security-info p { font-size: 11px; color: #697086; line-height: 1.65; margin: 0; }
.security-info strong { color: #505775; }

/* Widok zalogowany */
.dashboard-intro { display: flex; justify-content: space-between; gap: 15px; align-items: center; padding: 12px 0 17px; }
.dashboard-intro h1 { margin: 4px 0; font-size: clamp(24px, 3vw, 34px); letter-spacing: -1.1px; }
.dashboard-intro h1 span { font-size: .75em; }
.dashboard-intro p { color: var(--muted); margin: 0; }
.sync-pill { padding: 10px 14px; border-radius: 50px; font-size: 12px; font-weight: 750; max-width: 420px; text-align: center; background: #f0f9f4; color: #27845c; border: 1px solid #d3f0df; }
.sync-pending { background: #fffbef; color: #a98227; border-color: #f2e2a5; }
.sync-error { background: #fff1ee; color: #b63f36; border-color: #ffcfc6; }
.app-tabs { display: flex; gap: 8px; align-items: center; margin: 18px 0 22px; flex-wrap: wrap; }
.view-tab { border: none; background: transparent; color: #686f87; padding: 12px 17px; font-size: 14px; font-weight: 720; border-radius: 11px; }
.view-tab.active { color: #5756bd; background: #eae9fb; }
.btn-refresh { margin-left: auto; font-size: 12px; }
.daily-layout { display: grid; grid-template-columns: minmax(275px, 315px) minmax(0, 1fr); gap: 20px; align-items: start; }
.calendar-card { padding: 20px; }
.calendar-heading { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 22px; }
.calendar-heading h2 { font-size: 16px; letter-spacing: -.3px; text-transform: capitalize; margin: 0; }
.icon-btn { display: grid; place-items: center; width: 33px; height: 33px; border: 1px solid #eceef5; border-radius: 10px; background: #f6f7fb; color: #5a6177; font-size: 24px; line-height: 1; }
.icon-btn:hover { background: #eae9fb; }
.calendar-weekdays, .calendar-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; text-align: center; }
.calendar-weekdays { margin-bottom: 10px; color: #9096a9; font-size: 11px; font-weight: 800; }
.calendar-day { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-width: 0; aspect-ratio: 1; border: 1px solid transparent; border-radius: 9px; background: transparent; color: #626980; font-size: 12px; font-weight: 650; }
.calendar-day:hover { background: #f1f0ff; }
.calendar-day.is-today { border-color: #aaa7e7; }
.calendar-day.is-selected { background: #5556bc; color: white; box-shadow: 0 4px 10px #4546a536; }
.calendar-day.is-selected:hover { background: #4849ac; }
.calendar-dots { display: flex; height: 4px; gap: 2px; justify-content: center; }
.calendar-dots i { width: 4px; height: 4px; display: block; border-radius: 99px; }
.calendar-day.is-selected .calendar-dots i { box-shadow: 0 0 1px 1px #ffffff9c; }
.today-btn { margin: 20px 0 0; padding: 9px; font-size: 12px; }
.calendar-help { margin-top: 24px; padding-top: 19px; border-top: 1px solid var(--border); color: #8b91a3; font-size: 11px; line-height: 1.6; }
.calendar-help b { display: block; color: #646b83; }
.month-summary { margin-top: 11px; font-size: 11px; font-weight: 730; color: #6664ad; }
.day-card { padding: clamp(20px, 2.4vw, 30px); }
.day-header { display: flex; justify-content: space-between; align-items: start; gap: 15px; border-bottom: 1px solid var(--border); padding-bottom: 20px; margin-bottom: 24px; }
.day-header h2 { margin: 4px 0 6px; font-size: clamp(18px, 2vw, 24px); letter-spacing: -.5px; }
.day-header p { margin: 0; font-size: 12px; }
.day-header-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.btn-clear-day { border: 0; background: transparent; color: #b97171; font-weight: 700; font-size: 11px; padding: 7px 2px; white-space: nowrap; }
.btn-clear-day:hover { text-decoration: underline; }
.count-pill { flex-shrink: 0; border: 1px solid #e2e0fb; background: #f2f0ff; color: #6661b5; border-radius: 99px; padding: 6px 12px; font-size: 12px; font-weight: 800; }
.search-label { display: block; font-size: 13px; color: #434a62; font-weight: 780; margin-bottom: 8px; }
.search-wrap { display: flex; align-items: center; border: 1px solid #e3e5ef; border-radius: 12px; padding: 0 14px; margin-bottom: 24px; background: #fafbfe; }
.search-wrap:focus-within { border-color: #8883d2; }
.search-wrap > span { font-size: 24px; color: #8990a6; }
.search-wrap input { background: transparent; width: 100%; border: none; outline: none; padding: 12px; font-size: 13px; color: var(--ink); }
.feeling-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.feeling-group { min-width: 0; padding: 15px; border-radius: 15px; border: 1px solid color-mix(in srgb, var(--group-color) 25%, #fff); background: color-mix(in srgb, var(--group-color) 8%, #fff); }
.feeling-group:nth-child(5) { grid-column: 1 / -1; }
.group-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 15px; }
.group-title-left { display: flex; align-items: center; gap: 9px; }
.group-emoji { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 9px; background: #ffffffbb; font-size: 19px; }
.group-title h3 { color: #343c50; font-size: 15px; letter-spacing: -.25px; margin: 0; }
.group-count { display: grid; place-items: center; min-width: 27px; height: 27px; padding: 0 7px; border-radius: 8px; font-size: 12px; font-weight: 850; color: var(--group-color); background: #ffffffc5; }
.chips { display: flex; gap: 7px; flex-wrap: wrap; }
.chip { text-align: left; border-radius: 8px; border: 1px solid color-mix(in srgb, var(--group-color) 19%, #fff); background: #fff; color: #454b60; padding: 6px 9px; font-size: 12px; line-height: 1.35; transition: background .15s, transform .15s; }
.chip:hover { transform: translateY(-1px); border-color: var(--group-color); }
.chip.selected { background: var(--group-color); color: white; border-color: var(--group-color); font-weight: 750; box-shadow: 0 2px 5px #00000012; }
.no-results { color: var(--muted); margin: 10px 0; }
.note-block { margin-top: 26px; padding-top: 24px; border-top: 1px solid var(--border); }
.note-heading { display: flex; gap: 10px; justify-content: space-between; align-items: center; flex-wrap: wrap; margin-bottom: 9px; }
.note-heading label { font-weight: 800; color: #414760; font-size: 14px; }
.note-heading small { color: #8589a7; font-size: 11px; }
#day-note { display: block; width: 100%; resize: vertical; border: 1px solid #e1e4ee; border-radius: 12px; background: #fcfcff; padding: 13px 15px; color: #2a3044; font-size: 13px; line-height: 1.6; min-height: 120px; }
#day-note:focus { border-color: #8883d2; outline: none; }
.note-hint { color: #9ba0b0; font-size: 11px; margin: 9px 0 0; }

/* Statystyki */
.week-toolbar { padding: 14px 20px; display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }
.week-navigation { display: flex; gap: 12px; align-items: center; }
.week-navigation h2 { margin: 0; font-size: 17px; }
.stat-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 17px; margin-bottom: 18px; }
.stat-tile { padding: 21px; }
.stat-title { font-size: 12px; font-weight: 760; color: #8489a0; }
.stat-value { font-size: clamp(20px, 2.8vw, 29px); font-weight: 850; margin: 9px 0 3px; letter-spacing: -.75px; overflow-wrap: anywhere; }
.stat-tile p { color: #999eaf; font-size: 12px; margin: 0; }
.analytics-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.analytics-card { padding: 24px; }
.analytics-card h3 { margin: 0 0 22px; font-size: 17px; letter-spacing: -.4px; }
.donut-layout { display: flex; align-items: center; gap: clamp(15px, 3vw, 33px); }
.donut { width: min(185px, 43%); aspect-ratio: 1; border-radius: 50%; background: #e7ebf2; display: grid; place-items: center; flex-shrink: 0; }
.donut-center { width: 65%; height: 65%; border-radius: 100%; display: flex; align-items: center; justify-content: center; flex-direction: column; background: white; box-shadow: 0 0 12px #00000007; }
.donut-center b { font-size: 31px; line-height: 1.2; }
.donut-center span { font-size: 11px; color: #9197ac; }
.donut-legend { min-width: 0; flex: 1; }
.legend-row { display: flex; align-items: center; justify-content: space-between; gap: 5px; padding: 7px 0; font-size: 12px; color: #596077; }
.legend-row span { display: inline-flex; align-items: center; gap: 7px; }
.legend-row i { display: inline-block; width: 9px; height: 9px; border-radius: 99px; }
.legend-row b { color: #3b4057; font-size: 11px; white-space: nowrap; }
.daily-bars { display: grid; gap: 15px; }
.daily-bar-row { display: grid; grid-template-columns: 52px minmax(0, 1fr) 20px; gap: 8px; align-items: center; }
.daily-bar-label { font-size: 12px; color: #767e93; white-space: nowrap; }
.daily-bar-track { height: 17px; background: #f1f2f7; border-radius: 5px; overflow: hidden; }
.daily-bar-stack { display: flex; height: 100%; overflow: hidden; border-radius: 5px; }
.daily-bar-segment { height: 100%; min-width: 1px; }
.daily-bar-row b { font-size: 12px; color: #72798c; text-align: right; }
.top-feelings { display: grid; gap: 13px; }
.ranking-row { display: grid; grid-template-columns: minmax(90px, 170px) minmax(0, 1fr) 20px; align-items: center; gap: 13px; }
.ranking-row > span { font-size: 12px; color: #50566d; overflow-wrap: anywhere; }
.ranking-track { height: 13px; background: #f1f2f7; border-radius: 10px; overflow: hidden; }
.ranking-fill { height: 100%; border-radius: 10px; }
.ranking-row strong { font-size: 12px; text-align: right; color: #5f677d; }

@media (max-width: 1120px) {
  .auth-layout { padding: 30px 0; gap: 25px; }
  .feeling-grid { grid-template-columns: 1fr; }
  .feeling-group:nth-child(5) { grid-column: auto; }
  .donut-layout { flex-wrap: wrap; justify-content: center; }
  .donut { width: 150px; }
  .donut-legend { min-width: 160px; }
}
@media (max-width: 800px) {
  .shell { width: min(100% - 26px, 650px); }
  .topbar { min-height: 77px; padding: 12px 0; flex-wrap: wrap; }
  .auth-layout { grid-template-columns: 1fr; gap: 32px; padding: 22px 0 14px; }
  .welcome-panel h1 { font-size: clamp(36px, 8vw, 51px); }
  .welcome-panel > p { font-size: 15px; margin-bottom: 22px; }
  .mood-stripe { min-height: 100px; gap: 5px; border-radius: 13px; }
  .mood-stripe span { font-size: 27px; }
  .mood-stripe b { font-size: 10px; }
  .privacy-note { margin-top: 18px; }
  .auth-card { max-width: none; }
  .daily-layout { grid-template-columns: 1fr; }
  .calendar-card { max-width: none; }
  .calendar-day { aspect-ratio: auto; min-height: 40px; font-size: 14px; }
  .feeling-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feeling-group:nth-child(5) { grid-column: 1 / -1; }
  .analytics-grid { grid-template-columns: 1fr; }
  .donut-layout { flex-wrap: nowrap; }
  .stat-tiles { gap: 9px; }
  .stat-tile { padding: 14px; }
  .stat-value { font-size: 20px; }
}
@media (max-width: 570px) {
  .topbar-actions { gap: 5px; }
  .header-controls { width: 100%; justify-content: space-between; }
  .language-option { font-size: 11px; padding: 8px 10px; }
  .brand strong { font-size: 17px; }
  .brand small { letter-spacing: .15px; }
  .account-name { max-width: 105px; font-size: 10px; }
  .topbar .btn { font-size: 11px; padding: 9px 11px; }
  .dashboard-intro { display: block; }
  .dashboard-intro p { font-size: 13px; }
  .sync-pill { display: inline-block; margin-top: 12px; }
  .app-tabs { gap: 4px; }
  .view-tab { font-size: 12px; padding: 10px; }
  .btn-refresh { margin-left: 0; padding: 9px 11px; }
  .day-card { padding: 17px; }
  .day-header { display: block; }
  .day-header-actions { justify-content: flex-start; margin-top: 13px; }
  .count-pill { display: inline-block; }
  .feeling-grid { grid-template-columns: 1fr; }
  .feeling-group:nth-child(5) { grid-column: auto; }
  .chips { gap: 6px; }
  .chip { font-size: 12px; }
  .week-toolbar { flex-wrap: wrap; }
  .week-navigation h2 { font-size: 14px; }
  .stat-tiles { grid-template-columns: 1fr; }
  .stat-value { font-size: 23px; }
  .donut-layout { flex-wrap: wrap; }
  .donut { width: 175px; }
  .donut-legend { width: 100%; }
  .ranking-row { grid-template-columns: minmax(95px, 130px) minmax(0, 1fr) 20px; gap: 7px; }
  .footer { font-size: 10px; }
}
/* Żółty kolor radości wymaga ciemnego tekstu dla czytelności. */
.group-joy .chip.selected { color: #352c0b; }
.mood-stripe.joy b { color: #49330b; }

/* Rozszerzone statystyki: wszystkie wizualizacje renderowane lokalnie. */
.context-panel { margin-top: 26px; border: 1px solid #e8e7f6; background: #fafaff; border-radius: 16px; padding: 18px 19px; }
.context-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.context-heading h3 { font-size: 15px; margin: 0; letter-spacing: -.2px; }
.context-lock { color: #83849b; font-size: 11px; }
.context-panel label { display: block; font-size: 12px; font-weight: 760; color: #505672; margin-bottom: 8px; }
.context-select { max-width: 300px; width: 100%; display: block; background: #fff; color: var(--ink); border: 1px solid #dfe1ee; border-radius: 10px; padding: 10px 12px; margin-bottom: 16px; font: inherit; font-size: 13px; }
.context-select:focus-visible { outline: 3px solid #8781e09a; outline-offset: 2px; }
.context-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.context-tag { color: #626889; background: #fff; border: 1px solid #dedff1; border-radius: 9px; padding: 7px 11px; font-size: 12px; font-weight: 650; }
.context-tag:hover { background: #f0efff; }
.context-tag.selected { border-color: #5e59bb; background: #eeedff; color: #4743a5; }
.context-hint { margin: 12px 0 0; font-size: 11px; color: #8b90a5; }
.extra-stat-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 0; }
.extra-stat-tiles .stat-tile { min-width: 0; background: linear-gradient(140deg, #fff 65%, #fafaff); }
.stat-value-small { font-size: clamp(15px, 1.7vw, 21px); line-height: 1.3; min-height: 33px; overflow-wrap: anywhere; }
.section-divider { padding: 10px 2px 18px; }
.section-divider h2 { font-size: clamp(20px, 2.3vw, 25px); letter-spacing: -.7px; margin: 0 0 5px; }
.section-divider p { margin: 0; color: #858aa0; font-size: 12px; }
.insight-card { margin-bottom: 18px; background: linear-gradient(115deg, #fff, #fcfaff); }
.insight-card h3 { margin-bottom: 15px; }
.insights-list { display: grid; gap: 9px; }
.insight-note { display: flex; gap: 10px; align-items: flex-start; background: #f6f4ff; border-radius: 12px; padding: 12px 14px; }
.insight-icon { color: #7064d1; font-size: 17px; line-height: 1.45; }
.insight-note p { margin: 0; color: #535a75; font-size: 13px; }
.card-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 17px; }
.card-heading h3 { margin: 0; }
.mini-nav { display: flex; align-items: center; gap: 7px; }
.mini-nav strong { font-size: 12px; font-weight: 750; min-width: 118px; text-align: center; text-transform: capitalize; }
.mini-nav .icon-btn { width: 28px; height: 28px; font-size: 19px; }
.emotion-heatmap { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.heatmap-weekday { font-size: 11px; text-align: center; color: #8f94a7; margin-bottom: 2px; }
.heatmap-day { display: grid; place-items: center; aspect-ratio: 1.25; min-height: 30px; font-size: 12px; border-radius: 8px; background: #f1f2f7; color: #a5aabb; font-weight: 740; }
.heatmap-has-data { color: #fff; text-shadow: 0 1px 2px #0006; }
.mini-legend { display: flex; flex-wrap: wrap; gap: 6px 11px; margin-top: 15px; }
.mini-legend-item { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: #777e91; }
.mini-legend-dot { width: 9px; height: 9px; border-radius: 99px; display: inline-block; }
.chart-hint { font-size: 11px; color: #9296a8; margin: -12px 0 17px; line-height: 1.55; }
.emotion-heatmap + .mini-legend + .chart-hint { margin: 12px 0 0; }
.balance-content + .chart-hint { margin: 15px 0 0; }
.compact-list { display: grid; gap: 12px; }
.analytics-empty { color: #9a9eaf; font-size: 12px; margin: 7px 0; }
.analytics-row { min-width: 0; }
.analytics-row-main { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.analytics-row-name { color: #5d657b; font-size: 12px; overflow-wrap: anywhere; min-width: 0; }
.analytics-row-value { color: #40475f; font-weight: 750; font-size: 12px; white-space: nowrap; }
.analytics-row-subtitle { display: block; font-size: 10px; color: #a2a6b5; margin: 2px 0 4px; }
.analytics-row-track { margin-top: 7px; background: #f0f1f6; height: 9px; border-radius: 99px; overflow: hidden; }
.analytics-row-fill { display: block; height: 100%; background: #7873c9; border-radius: 99px; }
.metric-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.mini-metric { background: #f8f9fd; border: 1px solid #eef0f6; padding: 12px; border-radius: 12px; min-width: 0; }
.mini-metric-title { display: block; font-size: 11px; color: #787e94; }
.mini-metric-value { font-size: 22px; font-weight: 850; line-height: 1.4; display: block; color: #343a56; overflow-wrap: anywhere; }
.mini-metric-note { display: block; color: #9aa0b1; font-size: 10px; }
.balance-content { display: grid; gap: 15px; }
.balance-track { height: 23px; display: flex; border-radius: 8px; background: #eef0f6; overflow: hidden; }
.balance-track span { display: block; height: 100%; }
.balance-joy { background: #e9b91c; }
.balance-other { background: #9da4b8; }
.balance-content .chart-hint { margin: 0; }
.analytics-stack { height: 15px; border-radius: 6px; background: #f1f2f7; display: flex; overflow: hidden; min-width: 0; }
.analytics-stack-piece { height: 100%; min-width: 1px; }
.pattern-row { display: grid; align-items: center; grid-template-columns: 73px minmax(0, 1fr) 95px; gap: 9px; }
.pattern-row-info strong { font-size: 12px; display: block; color: #596075; }
.pattern-row-info small { font-size: 9px; display: block; color: #999eaf; }
.pattern-group { font-size: 11px; text-align: right; color: #72798c; overflow-wrap: anywhere; }
.period-row { display: grid; grid-template-columns: 105px minmax(0, 1fr); gap: 10px; align-items: center; }
.context-stat-row { border-bottom: 1px solid #f0f1f6; padding-bottom: 9px; }
.context-stat-row:last-child { border-bottom: 0; }
.context-stat-detail { margin: 5px 0 0; color: #a0a4b4; font-size: 10px; }

@media (max-width: 1120px) {
  .extra-stat-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 570px) {
  .extra-stat-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .extra-stat-tiles .stat-tile { padding: 13px; }
  .stat-value-small { font-size: 15px; }
  .analytics-card { padding: 17px; }
  .analytics-card h3 { font-size: 16px; }
  .heatmap-day { min-height: 27px; }
  .pattern-row { grid-template-columns: 60px minmax(0,1fr) 75px; gap: 5px; }
  .pattern-group { font-size: 10px; }
  .context-panel { padding: 14px; }
}

.heatmap-day.heatmap-joy { color: #44330d; text-shadow: none; }
.heatmap-day:focus-visible { outline: 3px solid #6762c9; outline-offset: 2px; }
