/* Growth diary styles, scoped to keep the existing account controls intact. */
#historyCard { --paper:#fffdf9; --page:#fff8ee; --ink:#443428; --muted:#7c6754; --peach:#f8ecd9; --line:#e7d9c7; --green:#2f6a51; --mint:#e8f2e9; --gold:#f0bf42; --white:#fff; color:var(--ink); background:var(--page); }
#historyCard .growth-layout { display:grid; grid-template-columns:minmax(270px,.85fr) minmax(0,1.3fr); gap:28px; }
#historyCard .growth-diary { min-width:0; }
#historyCard .growth-diary > h3 { margin-bottom:14px; }
#historyCard button { font:inherit; cursor:pointer; min-height:44px; }
#historyCard button:disabled { cursor:default; }
#historyCard [hidden] { display:none !important; }
#historyCard .primary, #historyCard .secondary { padding:10px 14px; border-radius:13px; font-weight:650; }
#historyCard .primary { background:var(--green); color:white; border:1px solid var(--green); }
#historyCard .secondary { background:var(--paper); color:var(--ink); border:1px solid var(--line); }
#historyCard :focus-visible { outline:3px solid var(--green); outline-offset:3px; }
#historyCard .periods { display:flex; flex-wrap:wrap; gap:7px; }
#historyCard .period-btn { padding:8px 13px; border-radius:11px; background:transparent; border:1px solid var(--line); color:var(--muted); }
#historyCard .period-btn.active { background:var(--green); color:white; border-color:var(--green); }
#historyCard .growth-filter-fields { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
#historyCard .growth-filter-fields label { min-width:0; }
#historyCard select { width:100%; }
#historyCard .no-activity-entry { padding:16px; display:flex; align-items:center; gap:12px; }
#historyCard .no-activity-entry > span { font-size:27px; }
#historyCard .no-activity-entry p { color:var(--muted); font-size:12px; margin-top:4px; }
input:disabled, select:disabled { background:#eee9e2; border-color:#ded7cd; color:#7c6754; -webkit-text-fill-color:#7c6754; opacity:1; cursor:not-allowed; }
#growth-type-help { margin-top:10px; font-size:13px; color:#7c6754; line-height:1.6; }
#historyCard .collection { padding: 25px 23px 22px; border-radius: 24px; background: var(--peach); }
#historyCard .row { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
#historyCard .star-count { font: 750 25px/1.4 "Avenir Next", system-ui, sans-serif; font-variant-numeric: tabular-nums; }
#historyCard .star-count small { font: 13px/1.4 "PingFang SC", sans-serif; font-weight: 500; }
#historyCard #star-count { display: inline-block; }
#historyCard .milestone-label { font-size: 13px; color: var(--muted); margin-top: 5px; }
#historyCard .collect-button { width: 100%; margin-top: 13px; }
#historyCard .collect-button:disabled { color: var(--green); border-color: transparent; background: var(--paper); }
#historyCard .collection-footnote { margin-top: 12px; color: var(--muted); text-align: center; font-size: 12px; }
#historyCard .exchange-panel { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 17px; }
#historyCard .exchange-rate { color: var(--green); font-size: 14px; font-weight: 650; margin-top: 5px; }
#historyCard .exchange-available { color: var(--muted); font-size: 13px; margin-top: 8px; }
#historyCard .exchange-button { width: 100%; margin-top: 12px; }
#historyCard .exchange-button:disabled { color: var(--muted); background: var(--paper); border-color: transparent; }
#historyCard .exchange-records { margin-top: 15px; color: var(--muted); font-size: 13px; }
#historyCard .exchange-records summary { min-height: 44px; padding: 10px 0; }
#historyCard .exchange-entry { padding: 11px 0; border-top: 1px solid var(--line); }
#historyCard .exchange-entry strong { color: var(--ink); font-weight: 650; }
#historyCard .exchange-entry p + p { margin-top: 5px; }
#historyCard .exchange-entry .secondary { margin-top: 9px; font-size: 13px; }
#historyCard .badge-section { margin-top: 23px; }
#historyCard .streak-summary { margin-bottom: 14px; padding: 15px; border-radius: 16px; background: var(--mint); }
#historyCard .streak-status { color: var(--green); font-size: 17px; font-weight: 700; }
#historyCard .streak-caption { margin-top: 6px; color: var(--muted); font-size: 12px; }
#historyCard .streak-progress { height: 7px; margin-top: 12px; border-radius: 9px; overflow: hidden; background: #d3e2d4; }
#historyCard .streak-progress span { display: block; height: 100%; width: 0; background: var(--green); border-radius: inherit; }
#historyCard .section-heading { margin-bottom: 13px; }
#historyCard .subtle { color: var(--muted); font-size: 13px; }
#historyCard .badge-grid { position: relative; isolation: isolate; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
#historyCard .badge-grid::before, #historyCard .badge-grid::after { content: ""; position: absolute; z-index: 1; top: 38px; left: calc((100% - 12px) / 6); width: calc((100% + 6px) * 2 / 3); height: 4px; border-radius: 4px; pointer-events: none; background: var(--line); }
#historyCard .badge-grid::after { background: var(--green); transform: scaleX(0); transform-origin: left; }
#historyCard .badge-grid[data-earned="2"]::after { transform: scaleX(.5); }
#historyCard .badge-grid[data-earned="3"]::after { transform: scaleX(1); }
#historyCard .badge { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 11px 3px; border: 0; border-radius: 16px; background: transparent; color: var(--ink); }
#historyCard .badge:hover, #historyCard .badge[aria-pressed="true"] { background: var(--peach); }
#historyCard .badge-icon { position: relative; z-index: 2; display: grid; place-items: center; width: 58px; height: 58px; margin: 0 auto 8px; border: 2px solid var(--line); border-radius: 50%; color: var(--muted); background: #efe7dc; font-size: 32px; }
#historyCard .badge-symbol { filter: grayscale(1); opacity: .3; }
#historyCard .badge-lock { position: absolute; inset: 0; display: grid; place-items: center; border-radius: inherit; background: #efe7dc33; font-size: 24px; }
#historyCard .badge.next .badge-icon { border-color: var(--gold); box-shadow: 0 0 0 4px #f0bf4226; }
#historyCard .badge.earned .badge-icon { border-color: var(--green); background: var(--mint); box-shadow: 0 0 0 4px #e8f2e9, 0 0 16px #f0bf4240; }
#historyCard .badge.earned .badge-symbol { filter: none; opacity: 1; }
#historyCard .badge-name { display: block; font-size: 12px; font-weight: 650; }
#historyCard .badge-status { display: block; font-size: 11px; margin-top: 3px; color: var(--muted); }
#historyCard .badge.earned .badge-status { color: var(--green); }
#historyCard .badge-detail { margin-top: 10px; color: var(--muted); font-size: 13px; min-height: 40px; }
#historyCard .rule-details { margin-top: 14px; color: var(--muted); font-size: 13px; }
#historyCard .rule-details summary { padding: 10px 0; min-height: 44px; }
#historyCard .rule-details ul { padding-left: 19px; margin: 5px 0 0; }
#historyCard .rule-details li { margin: 5px 0; }
#historyCard .list-summary { font-size: 13px; color: var(--muted); margin: 4px 0 12px; }
#historyCard #historyTable { max-height: min(60vh, 640px); max-height: min(60svh, 640px); overflow-y: auto; overscroll-behavior-y: contain; scrollbar-gutter: stable; scroll-padding-block: 52px 10px; padding: 0 6px 6px; margin: 0 -6px; }
#historyCard .day-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 20px 0 9px; padding: 8px 0; position: sticky; top: 0; z-index: 1; background: var(--page); }
#historyCard #historyTable > section:first-child .day-heading { margin-top: 0; }
#historyCard .day-heading h3 { font-size: 14px; }
#historyCard .day-stars { font-size: 12px; color: var(--green); }
#historyCard .day-list { display: grid; gap: 9px; }
#historyCard .entry { background: var(--paper); border: 1px solid var(--line); border-radius: 15px; overflow-wrap: anywhere; }
#historyCard .entry > summary { list-style: none; display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 15px 13px; min-height: 76px; }
#historyCard .entry > summary::-webkit-details-marker { display: none; }
#historyCard .entry-icon { font-size: 27px; text-align: center; }
#historyCard .entry-name { font-size: 15px; font-weight: 650; }
#historyCard .entry-sub { display: block; color: var(--muted); font-size: 12px; font-weight: 400; margin-top: 3px; }
#historyCard .entry-amount { text-align: right; font: 650 16px/1.4 "Avenir Next", system-ui, sans-serif; font-variant-numeric: tabular-nums; white-space: nowrap; }
#historyCard .entry-amount small { display: block; color: var(--muted); font: 11px/1.4 "PingFang SC", sans-serif; margin-bottom: 2px; }
#historyCard .entry-detail { padding: 0 16px 14px; border-top: 1px solid var(--line); font-size: 13px; }
#historyCard .entry-detail dl { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 6px 10px; margin: 12px 0; }
#historyCard .entry-detail dt { color: var(--muted); }
#historyCard .entry-detail dd { margin: 0; }
#historyCard .entry-detail .secondary { padding: 6px 12px; font-size: 13px; }
#historyCard .empty-state { padding: 27px 10px; text-align: center; color: var(--muted); }
#historyCard .empty-state p + p { margin-top: 8px; font-size: 13px; }
#historyCard .empty-state button { margin-top: 14px; }
#historyCard .parent-view { margin-top: 24px; border-top: 1px solid var(--line); }
#historyCard .parent-view > summary { min-height: 48px; padding: 14px 0; font-size: 14px; color: var(--muted); }
#historyCard .parent-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
#historyCard .parent-number { white-space: nowrap; font-variant-numeric: tabular-nums; }
#historyCard .parent-note { font-size: 12px; color: var(--muted); margin-top: 11px; }

@media(max-width:800px) { #historyCard .growth-layout { grid-template-columns:minmax(0,1fr); } }
@media(max-width:420px) { #historyCard { padding:20px 14px; } #historyCard .collection { padding:20px 15px; } #historyCard .entry > summary { grid-template-columns:28px minmax(0,1fr) auto; gap:6px; padding:14px 10px; } #historyCard .entry-amount { font-size:14px; } }
