/* The paper and frame layer. sketch.js draws each visible outline to size. */
:root { --paper: #fbf8f1; --ink: #2c302d; --line: #d8d9d1; }
html, body { background: var(--paper); }
body, .auth-screen { background: url("./paper-noise.svg") repeat, var(--paper) !important; background-size: 220px 220px; }
.site-header { background: #fbf8f1ed; }
.mobile-nav { background: #fbf8f1; }

.sketch-framed:not(.modal) { position: relative; }
.sketch-framed { border: 0 !important; border-radius: 0 !important; box-shadow: none !important; }
.sketch-framed > svg[data-sketch-outline] { position: absolute; inset: 0; width: 100%; height: 100%; display: block; overflow: visible; pointer-events: none; z-index: 2; }
.sketch-first { stroke: var(--sketch-line, #65736a); stroke-width: 1.7; }
.sketch-second { stroke: var(--sketch-line, #65736a); stroke-width: .8; opacity: .32; }

.streak-card, .calendar-card, .detail-card, .race-card, .analytics-card, .person-card, .stat-tile, .auth-card {
  --sketch-line: #8a968c;
  background: url("./paper-noise.svg") repeat, #fffdf8 !important;
  background-size: 220px 220px;
}
.streak-card { --sketch-line: #af917a; display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 104px; margin: -5px 0 18px; padding: 16px 22px; }
.streak-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.streak-icon { width: 34px; height: 42px; flex: 0 0 34px; object-fit: contain; }
.streak-copy { min-width: 0; }
.streak-copy h2 { margin: 0 0 3px; color: var(--ink); font: 700 19px/1.15 "DM Sans", sans-serif; letter-spacing: -.6px; }
.streak-copy p { margin: 0; color: #6e7067; font-size: 12px; line-height: 1.35; }
.streak-log { position: relative; flex: 0 0 auto; margin-left: 6px; padding: 7px 0 12px; border: 0; background: transparent; color: var(--ink); font-size: 12px; font-weight: 700; white-space: nowrap; }
.streak-log::after { content: ""; position: absolute; left: 0; right: 0; bottom: 1px; height: 7px; background: url("./brush-stroke.svg") center / 100% 100% no-repeat; }
.streak-week { display: flex; align-items: center; gap: 9px; flex: 0 0 auto; }
.streak-day { display: flex; flex-direction: column; align-items: center; gap: 5px; width: 24px; }
.streak-day-name { color: #72766f; font-size: 10px; font-weight: 600; }
.streak-mark { display: grid; place-items: center; width: 21px; height: 21px; border: 1.5px solid #a1aaa0; border-radius: 4px 5px 3px 6px; background: #fffdfa; color: #2f6f5f; font-size: 15px; font-weight: 700; line-height: 1; transform: rotate(-3deg); }
.streak-day:nth-child(2n) .streak-mark { border-radius: 5px 3px 6px 4px; transform: rotate(3deg); }
.streak-day.logged .streak-mark { border-color: #6e9c86; background: #e6f2e9; }
.streak-day.today:not(.logged) .streak-mark { border-color: #a9765d; border-style: dashed; }
.calendar-card { padding: 30px 30px 23px; }
.calendar-topline { margin-bottom: 28px; }
.calendar-card .legend { border-top: 0; margin-top: 22px; padding-top: 12px; }
.below-grid { margin-top: 22px; }
.detail-card { min-height: 180px; padding: 26px 30px 22px; }
.entry-item { border-bottom-style: dashed; }
.entry-item:last-child { border-bottom: 0; }

.overview-stats { gap: 15px; border: 0; margin-bottom: 24px; }
.stat-tile { min-height: 145px; padding: 22px !important; }
.stat-tile:first-child, .stat-tile:nth-child(3) { padding-left: 22px !important; }
.stat-tile.featured { --sketch-line: #668e7e; background: url("./paper-noise.svg") repeat, #eef5ed !important; background-size: 220px 220px; }
.analytics-grid { gap: 17px; }
.analytics-card { min-height: 230px; padding: 27px; }
.analytics-card.wide { min-height: 220px; }
.analytics-card p { margin-bottom: 20px; }
.donut:before { background: #fffdf8; }

.people-grid { gap: 17px; }
.person-card { padding: 27px 29px 29px; }
.person-card::before, .person-card::after { content: none; }
.people-grid + .race-card { margin-top: 18px; }
.race-card { padding: 27px 29px 30px; }

.button-primary, .button-secondary, .button-plain, .period-button, .icon-button, .profile-choice, .answer-option {
  --sketch-line: #4f5b53;
  background: url("./paper-noise.svg") repeat, #fffdf9 !important;
  background-size: 220px 220px;
}
.button-primary, .button-primary:hover { --sketch-line: #548b7a; background: url("./paper-noise.svg") repeat, #e4f2ec !important; background-size: 220px 220px; color: var(--ink) !important; }
.button-secondary, .button-plain { color: var(--ink); }
.button:hover, .profile-choice:hover, .period-button:hover, .icon-button:hover { transform: rotate(-.7deg); }
.auth-submit, .auth-submit:hover { background: transparent !important; }
.header-log { padding: 12px 18px; }
.period-button, .icon-button { background: #fffdf9 !important; }
.account-button { border: 1.6px solid #59635a; border-radius: 48% 52% 46% 54%; box-shadow: 1px 1px 0 #9da99e; transform: rotate(-6deg); }
.account-button:hover { transform: rotate(4deg); }

.profile-choice { padding: 14px 15px; margin-bottom: 9px; }
.profile-choices { gap: 4px; border: 0; }
.profile-choice:hover { background: #eff7f1 !important; }
.answer-option { padding: 14px; }
.answer-option:has(input:checked) { --sketch-line: #5f9b88; background: #edf6ef !important; }
.answer-no:has(input:checked) { --sketch-line: #b77568; background: #faeeea !important; }
.answer-option input { z-index: 1; }

.auth-card { padding: 38px 42px 39px; }
.brand-large { margin-bottom: 45px; }
.auth-form input, .modal input[type=date], .modal textarea {
  border: 0 !important;
  border-radius: 0 !important;
  background: url("./rough-field.svg") center / 100% 100% no-repeat, #fffdf9 !important;
  box-shadow: none !important;
  padding: 14px 17px;
}
.auth-form input:focus, .modal input:focus, .modal textarea:focus { outline: 2px solid #6ca999; outline-offset: 3px; }
.modal { --sketch-line: #4f5b53; background: transparent !important; }
.modal-content { margin: 4px; padding: 27px; border-radius: 8px; background: url("./paper-noise.svg") repeat, #fffdf8; background-size: 220px 220px; }
.modal-close { border: 1.4px solid #6f7971; border-radius: 52% 46% 50% 47%; transform: rotate(-8deg); }

.dot-day { border-radius: 3px 5px 4px 6px; box-shadow: inset 0 0 0 .7px #303c341a; }
.dot-day:nth-child(4n) { transform: rotate(-2deg); border-radius: 5px 3px 6px 3px; }
.dot-day:nth-child(7n) { transform: rotate(2deg); border-radius: 3px 6px 3px 5px; }
.dot-day:hover { transform: scale(1.15) rotate(-5deg); }
.dot-day.selected { box-shadow: inset 0 0 0 1px #2b3a30; outline: 2px solid #465b4b; outline-offset: 1px; }

@media (max-width: 720px) {
  .streak-card { align-items: stretch; flex-direction: column; gap: 9px; min-height: 0; padding: 14px 15px 12px; }
  .streak-main { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 9px; }
  .streak-icon { width: 28px; height: 36px; }
  .streak-copy h2 { font-size: 17px; }
  .streak-copy p { font-size: 11px; }
  .streak-log { margin-left: 0; }
  .streak-week { justify-content: space-between; padding-left: 40px; }
  .calendar-card { padding: 20px 14px 17px; }
  .calendar-card .legend { gap: 10px; }
  .detail-card { padding: 21px 18px; }
  .overview-stats { gap: 10px; }
  .stat-tile { min-height: 112px; padding: 16px !important; }
  .stat-tile:first-child, .stat-tile:nth-child(3) { padding-left: 16px !important; }
  .analytics-grid { gap: 13px; }
  .analytics-card { min-height: 0; padding: 22px; }
  .people-grid { gap: 13px; }
  .person-card, .race-card { padding: 22px; }
  .header-log { width: 36px; padding: 0; }
  .auth-card { padding: 28px 27px; }
  .modal-content { padding: 23px; }
}
@media (max-width: 390px) {
  .streak-main { grid-template-columns: 30px minmax(0, 1fr); }
  .streak-log { grid-column: 2; justify-self: start; }
}
