/* Calendar redesign: loaded after the existing detail and report styles. */
:root { --primary: #bb5437; --primary-soft: #fcf0eb; --bg: #f6f7f9; --text: #202733; --muted: #737c8b; --border: #e9ecf0; --shadow: 0 3px 16px #26344605; }
body { background: var(--bg); font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; font-variant-numeric: tabular-nums; }
button, input, summary { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: default; }
button:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid #bb5437; outline-offset: 3px; }
.app { width: min(100%, 680px); padding: 0 18px calc(98px + env(safe-area-inset-bottom)); }
.topbar { min-height: 62px; }
.topbar::before { background: #fffffff2; border-bottom-color: #edf0f3; }
.topbar h1 { font-size: 18px; letter-spacing: -.5px; }
.panel { border: 1px solid #edf0f3; border-radius: 20px; box-shadow: var(--shadow); }
.bottom-nav { grid-template-columns: repeat(4, 1fr); width: min(100%, 680px); padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); border: 0; border-top: 1px solid #e9ecf0; background: #fffffff5; box-shadow: 0 -4px 24px #20273304; }
.bottom-nav button { min-height: 52px; border-radius: 12px; gap: 4px; }
.bottom-nav button[aria-current="page"], .bottom-nav button[data-active="true"] { color: #b84b2f; background: #fcf0eb; }
.bottom-nav strong { font-size: 12px; font-weight: 600; }
.bottom-nav span { font-size: 23px; }
.bottom-nav svg { width: 22px; height: 22px; }
.event-month-label select { min-height: 36px; border: 1px solid #edf0f3; border-radius: 9px; background: #f6f7f9; color: #5d6876; font-size: 12px; padding: 6px 9px; max-width: 105px; }
.event-home { display: grid; gap: 22px; padding-top: 10px; }
.event-welcome { display: flex; justify-content: space-between; align-items: center; padding: 6px 2px 0; }
.eyebrow { color: #7a665e; font-size: 12px; letter-spacing: .06em; }
.event-welcome h2 { font-size: 25px; line-height: 1.5; margin: 4px 0 0; letter-spacing: -.8px; }
.welcome-mark { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: #bb5437; background: #f9e8df; font-size: 28px; }
.home-search { display: flex; align-items: center; gap: 8px; padding: 7px 8px 7px 16px; background: white; border: 1px solid #e6e9ee; border-radius: 16px; }
.home-search > span { font-size: 26px; color: #828a98; }
.home-search input { min-width: 0; flex: 1; width: 100%; border: 0; background: transparent; padding: 8px 0; font-size: 14px; box-shadow: none; }
.home-search button { border: 0; background: #fcf0eb; color: #a8472e; border-radius: 10px; min-height: 40px; padding: 0 14px; font-size: 13px; font-weight: 600; }
.event-shortcuts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.event-shortcuts > button { display: flex; align-items: center; gap: 10px; text-align: left; background: white; border: 1px solid #edf0f3; border-radius: 16px; padding: 14px 12px; color: #28313e; }
.event-shortcuts strong { display: block; font-size: 14px; font-weight: 650; }
.event-shortcuts small { display: block; color: #79818e; margin-top: 5px; font-size: 11px; line-height: 1.5; }
.event-shortcuts > button > span:last-child { margin-left: auto; color: #959da8; }
.shortcut-icon { flex: 0 0 32px; display: grid; place-items: center; height: 36px; color: #b85439; background: #fdf2ec; border-radius: 10px; font-size: 22px; }
.calendar-panel { padding: 18px 14px 14px; background: #fff; border: 1px solid #edf0f3; border-radius: 22px; box-shadow: var(--shadow); }
.calendar-heading, .agenda-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 15px; }
.calendar-heading h2, .agenda-heading h2 { margin: 0; font-size: 18px; font-weight: 650; }
.calendar-heading button, .agenda-heading button { background: none; border: 0; color: #a84931; padding: 8px 0 8px 8px; font-size: 12px; min-height: 36px; }
.calendar-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-bottom: 18px; }
.calendar-month-controls { display: flex; align-items: center; min-width: 0; }
.calendar-month-controls > button { width: 32px; min-height: 40px; border: 0; background: transparent; color: #677080; font-size: 23px; }
.calendar-month-controls label { min-width: 0; }
.calendar-month-controls input { width: 142px; padding: 8px 2px; border: 0; background: #fff; font: inherit; font-size: 14px; font-weight: 600; color: #303947; }
.calendar-mode { display: flex; padding: 3px; border-radius: 10px; background: #f3f4f6; flex-shrink: 0; }
.calendar-mode button { padding: 7px 11px; min-height: 34px; font-size: 12px; border: 0; border-radius: 8px; color: #747c8a; background: transparent; }
.calendar-mode button[aria-pressed="true"] { background: #fff; color: #353e4b; box-shadow: 0 1px 4px #20273312; }
.calendar-week, .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; text-align: center; }
.calendar-week { margin-bottom: 9px; color: #8a919c; font-size: 12px; }
.calendar-grid { row-gap: 6px; }
.calendar-day { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px; width: 100%; min-height: 43px; border: 1px solid transparent; border-radius: 12px; background: transparent; color: #293340; font-size: 15px; font-weight: 500; }
.calendar-day i { width: 4px; height: 4px; border-radius: 100%; }
.calendar-day i.has-events { background: #c26a4d; }
.calendar-day.is-today { border-color: #cb8168; }
.calendar-day.is-selected { background: #293b3c; color: white; }
.calendar-day.is-selected i.has-events { background: #f1b79c; }
.calendar-day:hover { background: #fcf0eb; color: #96452e; }
.calendar-legend { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 14px; border-top: 1px solid #f0f1f3; margin-top: 14px; padding-top: 12px; font-size: 10px; color: #7b8390; }
.calendar-legend span { display: flex; gap: 5px; align-items: center; }
.calendar-legend i { width: 5px; height: 5px; border-radius: 50%; background: #c26a4d; }
.calendar-legend b { width: 10px; height: 10px; border-radius: 4px; border: 1px solid #cb8168; }
.agenda-heading > span { background: #eeeae3; color: #826749; padding: 4px 10px; border-radius: 8px; font-size: 12px; }
.agenda-list, .home-following { display: grid; gap: 12px; }
.home-following .agenda-heading { margin-bottom: 0; }
.agenda-card { background: #fff; border: 1px solid #edf0f3; border-radius: 18px; overflow: hidden; }
.agenda-card-main { display: grid; text-align: left; width: 100%; padding: 17px; background: transparent; border: 0; gap: 8px; color: #222d3a; }
.agenda-card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: #79818e; font-size: 11px; }
.agenda-card-main strong { font-size: 16px; line-height: 1.65; margin: 3px 0; font-weight: 650; }
.agenda-meta { font-size: 12px; line-height: 1.6; color: #707b88; }
.agenda-actions { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid #f0f1f3; margin: 0 17px; }
.agenda-actions button { border: 0; background: transparent; min-height: 46px; color: #92523d; font-size: 12px; }
.agenda-actions button + button { border-left: 1px solid #f0f1f3; }
.agenda-actions button:disabled { color: #747e88; }
.agenda-empty { background: #fff; border: 1px solid #edf0f3; padding: 24px 20px; border-radius: 18px; text-align: center; }
.agenda-empty strong { font-size: 14px; color: #556070; font-weight: 600; }
.agenda-empty p { color: #818997; font-size: 12px; line-height: 1.8; margin: 8px 0; }
.agenda-empty button { padding: 9px 16px; min-height: 40px; border: 1px solid #edd4c7; background: #fff9f5; border-radius: 10px; color: #a34e35; font-size: 12px; }
.home-analysis { border: 1px solid #e9ecf0; border-radius: 18px; background: #fff; padding: 15px; scroll-margin-top: 78px; }
.home-analysis > summary { display: flex; justify-content: space-between; gap: 12px; align-items: center; cursor: pointer; list-style: none; font-size: 14px; font-weight: 600; min-height: 32px; }
.home-analysis > summary span:last-child { font-size: 11px; font-weight: 400; color: #818a97; }
.home-analysis[open] > summary { margin-bottom: 15px; }
.home-data-note { color: #818996; font-size: 11px; line-height: 1.8; padding: 0 8px; margin: 0; text-align: center; }
#view-competitions .search-shell { border-radius: 18px; padding: 16px; }
.directory-disclosure { margin: 10px 0; }
.directory-disclosure > summary { cursor: pointer; padding: 12px 6px; color: #697685; font-size: 12px; min-height: 44px; }
.directory-disclosure > summary span { color: #8a929d; margin-left: 8px; font-size: 11px; }
#view-competitions .filter-actions { display: flex; flex-wrap: wrap; gap: 7px; }
#view-competitions .filter-trigger { border-radius: 9px; background: #f6f7f9; min-height: 36px; border: 1px solid #edf0f3; }
#view-competitions .filter-trigger.active { background: #e8f4ef; border-color: #b7d9ca; color: #08634e; box-shadow: none; }
#view-competitions .filter-trigger.active::after { color: #08634e; }
#view-competitions .filter-trigger:focus-visible { outline: 2px solid #087760; outline-offset: 2px; }
#view-competitions .competition-card { padding: 20px; border-radius: 18px; border: 1px solid #ebedf1; background: white; box-shadow: var(--shadow); }
#view-competitions .competition-card-title { font-size: 17px; line-height: 1.6; }
#view-competitions .competition-card-meta { font-size: 12px; line-height: 1.7; }
#view-competitions .competition-card-summary { margin-top: 14px; padding-top: 12px; border-top: 1px solid #f1f2f4; font-size: 12px; }
.my-hero.panel { background: #fff; border-radius: 22px; color: #263442; padding: 24px; }
.my-hero.guest .my-hero-actions button:last-child { background: #b4573a; border-color: #b4573a; }
.my-hero button { min-height: 40px; background: #fcf0eb; border-color: #efd8cd; }
.account-view-tag { color: #99624a; border-color: #e8d7cd; background: #fcf4ef; font-weight: 500; }
.my-stat-grid { gap: 9px; }
.my-stat { background: #fff; border: 1px solid #eef0f3; border-radius: 15px; padding: 15px 6px; }
.my-stat strong { color: #b5573b; }
.points-intro { padding: 30px 9px 20px; }
.points-intro h2 { margin: 8px 0; font-size: 30px; letter-spacing: -1px; }
.points-intro p, .points-empty p, .points-guide p { color: #788391; font-size: 13px; line-height: 1.9; }
.points-empty { text-align: center; padding: 30px 24px; }
.points-symbol { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 20px; background: #fcf0eb; color: #b96549; border-radius: 20px; font-size: 30px; }
.points-empty h3, .points-guide h3 { font-size: 18px; font-weight: 650; }
.points-empty button, .points-guide button { border: 1px solid #ecd0c4; border-radius: 12px; padding: 12px 18px; color: #9f4b31; background: #fdf3ee; min-height: 44px; font-size: 13px; }
.points-guide { padding: 22px; }
.points-guide > div { border-top: 1px solid #edf0f3; padding: 16px 0 5px; }
.points-guide strong { font-size: 14px; }
.points-controls { padding: 16px; }
.points-filter-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.points-controls label > span { display: block; font-size: 11px; color: #737e8d; margin-bottom: 6px; }
.points-controls select { width: 100%; min-width: 0; min-height: 42px; padding: 8px 7px; font: inherit; font-size: 13px; border: 1px solid #e9ecf0; border-radius: 9px; background: #f7f8fa; color: #263442; }
.points-week-label { display: block; margin: 15px 0; }
.points-controls .home-search { padding: 5px 6px 5px 12px; }
.points-clear { min-height: 38px; border: 0; background: transparent; color: #a84931; font-size: 12px; margin-top: 7px; }
.points-results h3 { font-size: 16px; margin: 0; }
.points-results { margin-top: 8px; }
.points-list { display: grid; gap: 10px; }
.points-row { display: grid; grid-template-columns: 34px minmax(0,1fr) auto; align-items: center; gap: 13px; padding: 18px 14px; background: #fff; border: 1px solid #edf0f3; border-radius: 17px; }
.points-rank { font-size: 21px; font-weight: 650; text-align: center; color: #7b8492; }
.points-top-1 { background: #fffaf0; border-color: #f3e5c9; }
.points-top-2 { background: #f4f9fb; border-color: #e0edf3; }
.points-top-3 { background: #fff5f0; border-color: #f4e1d5; }
.points-top-1 .points-rank { color: #ac7b2f; }
.points-top-2 .points-rank { color: #608499; }
.points-top-3 .points-rank { color: #ad7860; }
.points-person strong { display: block; font-size: 17px; font-weight: 650; }
.points-person > span { display: block; color: #76818e; font-size: 12px; line-height: 1.6; margin: 6px 0 2px; overflow-wrap: anywhere; }
.points-person button { display: block; border: 0; color: #9a543d; background: transparent; padding: 7px 0 0; font-size: 11px; min-height: 28px; }
.points-value { text-align: right; }
.points-value strong { display: block; font-size: 23px; letter-spacing: -.6px; }
.points-value small { display: block; margin-top: 5px; font-size: 10px; color: #7b8590; }
.points-pagination { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 20px 0; font-size: 12px; color: #778391; }
.points-pagination button { min-height: 42px; padding: 8px 18px; border: 1px solid #e6e9ee; border-radius: 10px; color: #a64e34; background: #fff; }
.points-pagination button:disabled { opacity: .4; color: #7b8590; }
.points-source-note { font-size: 11px; line-height: 1.9; color: #7b8590; }
.points-source-note a { color: #9b5339; }
.points-warning { background: #fff4df; color: #875d26; font-size: 12px; line-height: 1.8; padding: 12px; border-radius: 12px; }
.points-loading { text-align: center; padding: 35px 18px; }
.points-loading p { color: #7b8590; font-size: 12px; }
.points-loading-dot { display: block; width: 24px; height: 24px; border: 2px solid #f1ded4; border-top-color: #b96549; border-radius: 50%; margin: 0 auto 16px; animation: points-spin 1s linear infinite; }
@keyframes points-spin { to { transform: rotate(360deg); } }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 380px) {
  .app { padding-left: 12px; padding-right: 12px; }
  .calendar-panel { padding-left: 10px; padding-right: 10px; }
  .calendar-month-controls input { width: 119px; font-size: 12px; }
  .calendar-month-controls > button { width: 25px; }
  .calendar-mode button { padding: 7px 9px; }
  .event-shortcuts { gap: 8px; }
  .event-shortcuts > button { gap: 7px; padding: 12px 9px; }
  .event-shortcuts > button > span:last-child { display: none; }
  .shortcut-icon { flex-basis: 28px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }
@media print { .bottom-nav { display: none !important; } }
/* Competition discovery: one search, direct choices, secondary controls folded. */
#view-competitions .database-overview[hidden],
#view-competitions .directory-disclosure[hidden],
#view-competitions .filter-trigger[hidden],
#view-competitions .discovery-reset[hidden] { display: none !important; }
#view-competitions .search-shell { padding: 16px; border-radius: 18px; }
#view-competitions .discovery-search-field { display: flex; align-items: center; gap: 8px; background: #f1f5f7; border: 1px solid transparent; border-radius: 24px; padding: 0 12px; }
#view-competitions .discovery-search-field:focus-within { border-color: #6fa69d; box-shadow: 0 0 0 3px #e8f3f0; }
#view-competitions .discovery-search-field svg { flex: 0 0 20px; color: #6b7c88; }
#view-competitions .discovery-search-field input { border: 0; background: transparent; box-shadow: none; padding: 12px 0; min-width: 0; min-height: 44px; font-size: 15px; }
#view-competitions .discovery-search-field input:focus { outline: 0; box-shadow: none; }
.discovery-filter-caption { font-size: 11px; color: #89939c; margin: 14px 0 8px; }
.discovery-quick-filters { display: grid; gap: 11px; margin-top: 0; }
.discovery-filter-row { display: grid; grid-template-columns: 32px minmax(0, 1fr); align-items: start; gap: 9px; }
.discovery-filter-label { color: #6b7681; font-size: 13px; font-weight: 600; line-height: 34px; }
.discovery-filter-options { display: flex; flex-wrap: wrap; gap: 7px; }
#view-competitions .discovery-chip { min-height: 34px; padding: 6px 13px; border: 1px solid #e5ebef; border-radius: 20px; color: #415361; background: #f3f6f8; font: inherit; font-size: 13px; cursor: pointer; line-height: 20px; }
#view-competitions .discovery-chip[aria-pressed="true"] { color: #fff; background: #08786a; border-color: #08786a; font-weight: 600; }
#view-competitions .discovery-chip:hover { border-color: #76a59d; }
#view-competitions .discovery-chip:focus-visible { outline: 3px solid #8abbb1; outline-offset: 2px; }
#view-competitions .discovery-more { border-style: dashed; color: #637584; background: #fff; }
.discovery-advanced { border-top: 1px solid #eef1f3; margin-top: 16px; }
.discovery-advanced > summary { cursor: pointer; padding: 13px 0 2px; color: #526471; font-size: 13px; min-height: 40px; }
.discovery-advanced > summary span { font-size: 11px; color: #85909a; margin-left: 8px; }
.discovery-advanced .filter-actions { padding: 12px 0 4px; }
#view-competitions .discovery-reset { border: 0; background: transparent; color: #9d523b; padding: 9px 0 0; font-size: 12px; cursor: pointer; min-height: 36px; }
.competition-follow-fold { border-bottom: 1px solid #e8edef; }
.competition-follow-fold > .panel { margin-top: 6px; }
@media (min-width: 700px) { .discovery-filter-row { grid-template-columns: 44px minmax(0, 1fr); } }
