.profile-checkin {
    --checkin-accent: var(--accent-primary, #ef4444);
    --checkin-surface: var(--bg-secondary, #202025);
    --checkin-surface-raised: var(--bg-tertiary, #29292f);
    max-width: 1120px;
    position: relative;
    min-height: 520px;
    color: var(--text-primary, #fff);
}

.profile-checkin__header,
.profile-checkin__section-title,
.profile-checkin__editor-section > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.profile-checkin__header { margin-bottom: 1.25rem; }
.profile-checkin__header h2 { margin: .18rem 0 0; color: #fff; font-size: clamp(1.8rem, 4vw, 2.35rem); letter-spacing: -.035em; }
.profile-checkin__header p { margin: .35rem 0 0; color: var(--text-secondary); }
.profile-checkin__eyebrow,
.profile-checkin__section-title span,
.profile-checkin__editor-section > header span {
    color: var(--checkin-accent);
    font-size: .7rem;
    font-weight: 900;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.profile-checkin__view-toggle.ui.buttons { padding: 4px; border-radius: 13px; background: var(--checkin-surface); }
.profile-checkin__view-toggle.ui.buttons .button { border-radius: 10px !important; background: transparent; color: var(--text-secondary); box-shadow: none; }
.profile-checkin__view-toggle.ui.buttons .button.active { background: var(--checkin-accent); color: #fff; }
.profile-checkin__view-toggle.ui.buttons .button:hover:not(.active) { background: rgba(255,255,255,.06); color: #fff; }

.profile-checkin__loading,
.profile-checkin__summary-loading {
    display: flex;
    min-height: 180px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: .9rem;
    color: var(--text-secondary);
}
.profile-checkin__loading {
    position: absolute;
    inset: 88px 0 0;
    z-index: 20;
    min-height: 360px;
    border-radius: 18px;
    background: rgba(17,17,20,.86);
}
.profile-checkin__loading[hidden], .profile-checkin__summary-loading[hidden] { display: none !important; }
.profile-checkin__pane { display: none; }
.profile-checkin__pane.is-active { display: block; animation: profileCheckinFade var(--transition-base, .25s ease) both; }
.profile-checkin__pane[hidden] { display: none !important; }

.profile-checkin__month { display: flex; align-items: center; justify-content: center; gap: 1rem; margin: .8rem 0 1rem; }
.profile-checkin__month .ui.button { border-color: var(--border-light) !important; color: #fff !important; background: var(--checkin-surface) !important; transition: background var(--transition-fast) !important; }
.profile-checkin__month .ui.button:hover:not(:disabled) { background: var(--checkin-surface-raised) !important; }
.profile-checkin__month .ui.button:disabled { opacity: .3 !important; }
.profile-checkin__month strong { min-width: 170px; text-align: center; text-transform: capitalize; }

.profile-checkin__week {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
    padding: 8px;
    border: 1px solid var(--border-light);
    border-radius: 18px;
    background: var(--checkin-surface);
}
.profile-checkin__week button {
    min-height: 68px;
    border: 0;
    border-radius: 13px;
    background: transparent;
    color: var(--text-muted, #777782);
    cursor: pointer;
    transition: color var(--transition-fast), background var(--transition-fast);
}
.profile-checkin__week button:hover:not(:disabled):not(.is-active) { background: rgba(255,255,255,.055); color: #fff; }
.profile-checkin__week button.is-active { background: var(--checkin-accent); color: #fff; }
.profile-checkin__week button:disabled { opacity: .25; cursor: not-allowed; }
.profile-checkin__week span, .profile-checkin__week strong, .profile-checkin__week small { display: block; }
.profile-checkin__week span { font-size: .62rem; font-weight: 900; text-transform: uppercase; }
.profile-checkin__week strong { margin-top: 4px; color: inherit; font-size: 1.12rem; }
.profile-checkin__week small { min-height: 8px; margin-top: 2px; color: inherit; }

.profile-checkin__layout { display: grid; grid-template-columns: minmax(280px, .82fr) minmax(0, 1.18fr); gap: 1rem; margin-top: 1rem; }
.profile-checkin .ui.segment { margin: 0; border: 1px solid var(--border-light); border-radius: 18px; background: var(--checkin-surface); color: #fff; box-shadow: none; }
.profile-checkin__day { padding: 1.2rem !important; }
.profile-checkin__day-date { color: var(--text-secondary); text-transform: capitalize; }
.profile-checkin__day h3 { margin: .3rem 0 1rem; color: #fff; font-size: 1.45rem; }
.profile-checkin__day-empty { min-height: 88px; display: grid; place-items: center; padding: 1rem; border: 1px dashed var(--border-light); border-radius: 12px; color: var(--text-secondary); text-align: center; }
.profile-checkin__games { display: flex; flex-direction: column; gap: 8px; }
.profile-checkin__game { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 11px; background: rgba(0,0,0,.18); color: #fff; text-decoration: none; transition: background var(--transition-fast); }
.profile-checkin__game:hover { background: rgba(255,255,255,.06); color: #fff; }
.profile-checkin__game img { width: 42px; aspect-ratio: 264/374; border-radius: 6px; object-fit: cover; background: var(--checkin-surface-raised); }
.profile-checkin__game strong, .profile-checkin__game small { display: block; }
.profile-checkin__game small { margin-top: 2px; color: var(--text-secondary); }
.profile-checkin__edit.ui.button { width: 100%; margin-top: 1rem; border-radius: 12px; }

.profile-checkin__heatmap { padding: 1rem !important; }
.profile-checkin__section-title { margin-bottom: .9rem; }
.profile-checkin__section-title h3, .profile-checkin__editor-section > header h3 { margin: .12rem 0 0; color: #fff; font-size: 1.15rem; }
.profile-checkin__legend { display: flex; align-items: center; gap: 5px; color: var(--text-muted); font-size: .62rem; }
.profile-checkin__legend i { width: 10px; height: 10px; border-radius: 3px; background: rgba(255,255,255,.07); }
.profile-checkin__legend i:nth-of-type(2) { background: rgba(239,68,68,.3); }
.profile-checkin__legend i:nth-of-type(3) { background: rgba(239,68,68,.68); }
.profile-checkin__heat-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.profile-checkin__weekday { padding: .2rem 0; text-align: center; color: var(--text-muted); font-size: .64rem; font-weight: 900; }
.profile-checkin__cell { min-height: 62px; padding: 8px; border: 1px solid rgba(255,255,255,.06); border-radius: 11px; background: rgba(255,255,255,.025); color: #fff; text-align: left; cursor: pointer; transition: border-color var(--transition-fast), background var(--transition-fast); }
.profile-checkin__cell:hover:not(:disabled) { border-color: rgba(255,255,255,.18); }
.profile-checkin__cell.is-played { border-color: rgba(239,68,68,.32); background: rgba(239,68,68,.18); }
.profile-checkin__cell.is-heavy { background: rgba(239,68,68,.48); }
.profile-checkin__cell.is-rest { opacity: .58; }
.profile-checkin__cell.is-active { outline: 2px solid var(--checkin-accent); outline-offset: -2px; }
.profile-checkin__cell:disabled { opacity: .23; cursor: not-allowed; }
.profile-checkin__cell small { display: block; margin-top: 5px; color: var(--text-secondary); font-size: .64rem; }

.profile-checkin__stats { display: grid; grid-template-columns: 1.35fr repeat(3, 1fr); gap: 10px; }
.profile-checkin__stat { min-height: 128px; padding: 1.1rem; border: 1px solid var(--border-light); border-radius: 16px; background: var(--checkin-surface); }
.profile-checkin__stat.is-primary { background: linear-gradient(135deg, rgba(104,24,33,.88), rgba(48,20,24,.9)); border-color: rgba(239,68,68,.35); }
.profile-checkin__stat i { color: var(--checkin-accent); font-size: 1.2rem; }
.profile-checkin__stat strong { display: block; margin-top: .8rem; color: #fff; font-size: 1.8rem; }
.profile-checkin__stat span { color: var(--text-secondary); font-size: .75rem; }
.profile-checkin__ranking { margin-top: 1.25rem; }
.profile-checkin__rank { display: grid; grid-template-columns: 32px 52px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 9px; border-bottom: 1px solid var(--border-light); color: #fff; }
.profile-checkin__rank:last-child { border-bottom: 0; }
.profile-checkin__rank > strong:first-child { color: var(--text-muted); font-size: .75rem; }
.profile-checkin__rank img { width: 52px; aspect-ratio: 264/374; border-radius: 7px; object-fit: cover; }
.profile-checkin__bar { height: 5px; margin-top: 8px; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.09); }
.profile-checkin__bar i { display: block; height: 100%; border-radius: inherit; background: var(--checkin-accent); }
.profile-checkin__empty-summary { padding: 2rem; border: 1px dashed var(--border-light); border-radius: 14px; color: var(--text-secondary); text-align: center; }

.profile-checkin__modal.ui.modal, .profile-checkin__confirm.ui.modal {
    --checkin-accent: var(--accent-primary, #ef4444);
    --checkin-surface: var(--bg-secondary, #202025);
    --checkin-surface-raised: var(--bg-tertiary, #29292f);
    border-radius: 20px;
    background: #1c1c20;
    color: #fff;
}
.profile-checkin__modal.ui.modal > .header, .profile-checkin__confirm.ui.modal > .header { border-color: var(--border-light); background: transparent; color: #fff; }
.profile-checkin__modal.ui.modal > .header h2 { margin: .18rem 0 0; color: #fff; text-transform: capitalize; }
.profile-checkin__modal.ui.modal > .content, .profile-checkin__confirm.ui.modal > .content { background: transparent; color: #fff; }
.profile-checkin__modal.ui.modal > .actions, .profile-checkin__confirm.ui.modal > .actions { border-color: var(--border-light); background: transparent; }
.profile-checkin__modal.ui.modal > .actions, .profile-checkin__confirm.ui.modal > .actions { display:flex;align-items:center;gap:.75rem;padding:1rem 1.25rem; }
.profile-checkin__modal.ui.modal > .actions .button, .profile-checkin__confirm.ui.modal > .actions .button { margin:0!important;min-height:42px;border-radius:11px!important; }
.profile-checkin__modal.ui.modal > .actions .left.floated { margin-right:auto!important; }
.ui.dimmer.modals:has(.profile-checkin__confirm) { background:rgba(8,8,11,.82)!important; }
.profile-checkin__modal.ui.modal > .close { color: #fff; }
.profile-checkin__choices.ui.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 0 0 1.5rem; }
.profile-checkin__choices.ui.cards > .card { position: relative; width: auto !important; min-height: 96px; display: flex; flex-direction: row; align-items: center; gap: 12px; margin: 0 !important; padding: 1rem; border: 1px solid var(--border-light); border-radius: 15px; background: var(--checkin-surface); color: #fff; text-align: left; box-shadow: none; cursor: pointer; transition: border-color var(--transition-fast), background var(--transition-fast); }
.profile-checkin__choices.ui.cards > .card:hover { border-color: rgba(255,255,255,.18); }
.profile-checkin__choices.ui.cards > .card.is-active { border-color: var(--checkin-accent); background: rgba(239,68,68,.16); }
.profile-checkin__choice-icon { flex: 0 0 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.06); color: var(--checkin-accent); }
.profile-checkin__choices strong, .profile-checkin__choices small { display: block; }
.profile-checkin__choices strong { font-size: 1.02rem; }
.profile-checkin__choices small { margin-top: 3px; color: var(--text-secondary); font-weight: 400; }
.profile-checkin__choice-check { margin-left: auto !important; opacity: 0; color: var(--checkin-accent); }
.profile-checkin__choices .is-active .profile-checkin__choice-check { opacity: 1; }

.profile-checkin__editor-section + .profile-checkin__editor-section { margin-top: 1.65rem; }
.profile-checkin__editor-section > header { margin-bottom: .7rem; }
.profile-checkin__editor-section > header small { color: var(--text-muted); }
.profile-checkin__suggestions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .65rem; }
.profile-checkin__suggestion { position: relative; overflow: hidden; min-height: 148px; padding: 0; border: 1px solid var(--border-light); border-radius: 12px; background: var(--checkin-surface); color: #fff; cursor: pointer; text-align: left; transition: border-color var(--transition-fast); }
.profile-checkin__suggestion:hover { border-color: rgba(239,68,68,.48); }
.profile-checkin__suggestion img { width: 100%; aspect-ratio: 264/374; display: block; object-fit: cover; }
.profile-checkin__suggestion span { position: absolute; inset: auto 0 0; padding: 1.8rem .65rem .6rem; background: linear-gradient(transparent, rgba(0,0,0,.94)); font-size: .74rem; font-weight: 800; }
.profile-checkin__search.ui.input input { border-color: var(--border-light); border-radius: 12px; background: var(--checkin-surface); color: #fff; }
.profile-checkin__search.ui.input input:focus { border-color: var(--checkin-accent); }
.profile-checkin__results { max-height: 230px; overflow: auto; margin-top: .55rem !important; border-radius: 12px; background: var(--checkin-surface); }
.profile-checkin__results:empty { display: none; }
.profile-checkin__result.item { display: flex !important; align-items: center; gap: 11px; padding: .55rem .7rem !important; color: #fff !important; cursor: pointer; transition: background var(--transition-fast); }
.profile-checkin__result.item:hover { background: rgba(255,255,255,.055); }
.profile-checkin__result img, .profile-checkin__selected .item img { width: 42px !important; height: auto !important; aspect-ratio: 264/374; border-radius: 6px !important; object-fit: cover; }
.profile-checkin__result .content { flex: 1; color: #fff; font-weight: 800; }
.profile-checkin__result .plus.icon { color: var(--checkin-accent); }
.profile-checkin__selected { margin-top: .7rem !important; }
.profile-checkin__selected .item { display: grid !important; grid-template-columns: 42px minmax(0, 1fr) 158px 38px; align-items: center; gap: 10px; padding: .65rem 0 !important; }
.profile-checkin__selected .content { min-width: 0; color: #fff; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-checkin__duration { display: grid; grid-template-columns: 36px minmax(70px,1fr) 36px; align-items: stretch; min-height: 38px; overflow: hidden; border: 1px solid var(--border-light); border-radius: 10px; background: #151518; }
.profile-checkin__duration button { display: grid; place-items: center; padding: 0; border: 0; background: #2a2a30; color: var(--text-primary); cursor: pointer; }
.profile-checkin__duration button:hover { background: #34343b; }
.profile-checkin__duration button:first-child { border-right: 1px solid var(--border-light); }
.profile-checkin__duration button:last-child { border-left: 1px solid var(--border-light); }
.profile-checkin__duration button .icon { margin: 0 !important; }
.profile-checkin__duration output { display: grid; place-items: center; padding: 0 .35rem; color: #fff; font-size: .78rem; font-weight: 900; white-space: nowrap; }
.profile-checkin__remove.ui.button { color: #ff7b7f !important; }
.profile-checkin__editor-total { display: flex; justify-content: flex-end; margin-top: .6rem; color: var(--text-secondary); font-size: .8rem; font-weight: 800; }
.profile-checkin__editor-total.is-invalid { color: #ff7b7f; }
.profile-checkin__inline-empty { grid-column:1/-1;padding:.5rem 0;color:var(--text-secondary);text-align:left;line-height:1.55;background:transparent;border:0; }

@media (max-width: 620px) {
    .profile-checkin__choices.ui.cards { grid-template-columns: 1fr; }
    .profile-checkin__selected .item { grid-template-columns: 38px minmax(0,1fr) 132px 34px; gap: 7px; }
    .profile-checkin__duration { grid-template-columns: 32px minmax(62px,1fr) 32px; }
}

@keyframes profileCheckinFade { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 760px) {
    .profile-checkin__header { align-items: flex-start; flex-direction: column; }
    .profile-checkin__view-toggle { align-self: stretch; }
    .profile-checkin__view-toggle .button { flex: 1; }
    .profile-checkin__layout { grid-template-columns: 1fr; }
    .profile-checkin__stats { grid-template-columns: 1fr 1fr; }
    .profile-checkin__stat.is-primary { grid-column: 1 / -1; }
    .profile-checkin__cell { min-height: 50px; padding: 6px; }
    .profile-checkin__cell small { font-size: .58rem; }
    .profile-checkin__week button { min-height: 58px; }
    .profile-checkin__suggestions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .profile-checkin__modal.ui.modal > .actions { display: flex; flex-wrap: wrap; }
    .profile-checkin__modal.ui.modal > .actions .left.floated { width: 100%; margin: 0 0 .65rem !important; }
}

@media (max-width: 480px) {
    .profile-checkin__week, .profile-checkin__heat-grid { gap: 3px; padding-left: 3px; padding-right: 3px; }
    .profile-checkin__week button { min-height: 52px; padding: 4px 2px; }
    .profile-checkin__cell { min-height: 44px; padding: 5px; }
    .profile-checkin__cell small { display: none; }
    .profile-checkin__suggestions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .profile-checkin__selected .item { grid-template-columns: 36px minmax(0, 1fr) 104px 32px; gap: 7px; }
    .profile-checkin__result img, .profile-checkin__selected .item img { width: 36px !important; }
    .profile-checkin__rank { grid-template-columns: 24px 44px minmax(0, 1fr); }
    .profile-checkin__rank > strong:last-child { grid-column: 3; }
}

@media (prefers-reduced-motion: reduce) {
    .profile-checkin *, .profile-checkin *::before, .profile-checkin *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
