/* Phase 6: account shell, history, shortlist, save toggle, contractor profile and calendar. */
.acc-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 48px; padding-block: 48px 80px; align-items: start; }
.acc-side { position: sticky; top: 112px; display: grid; gap: 16px; }
.acc-nav { display: grid; gap: 4px; }
.acc-nav a { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 10px 12px; border-radius: 4px; font-size: 14px; }
.acc-nav a:hover { background: #f5f5f5; }
.acc-nav a[aria-current="page"] { background: #000; color: #fff; }
.acc-nav .tl-icon { width: 18px; height: 18px; }
.acc-user { font-size: 12px; line-height: 18px; color: #525252; border-top: 1px solid #e5e5e5; padding-top: 16px; overflow-wrap: anywhere; }
.acc-user span { color: #000; }
.acc-main { min-width: 0; }
.acc-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 16px 24px; margin-bottom: 24px; }
.acc-head h1 { font-size: clamp(30px, 3.4vw, 44px); font-weight: 450; letter-spacing: -.04em; line-height: 1.1; }
.acc-head p { max-width: 620px; margin-top: 12px; color: #525252; font-size: 16px; line-height: 1.6; }
.acc-muted { color: #525252; }
.acc-note { display: flex; gap: 12px; align-items: flex-start; margin: 0 0 20px; padding: 14px 16px; border: 1px solid #e5e5e5; background: #f5f5f5; font-size: 14px; line-height: 1.55; }
.acc-note .tl-icon { width: 18px; height: 18px; margin-top: 1px; flex-shrink: 0; }
.acc-note--plain { background: #fff; color: #525252; }
.acc-empty { padding: 48px 32px; border: 1px solid #e5e5e5; background: #f5f5f5; display: grid; justify-items: start; gap: 16px; }
.acc-empty h1, .acc-empty h2 { font-size: 28px; font-weight: 450; letter-spacing: -.03em; line-height: 1.2; }
.acc-empty p { max-width: 520px; color: #525252; font-size: 16px; line-height: 1.6; }
.acc-danger summary { list-style: none; cursor: pointer; }
.acc-danger summary::-webkit-details-marker { display: none; }
.acc-danger__body { margin-top: 8px; padding: 16px; max-width: 320px; background: #fff; border: 1px solid #e5e5e5; border-radius: 8px; display: grid; gap: 12px; font-size: 14px; }
.acc-danger__yes { background: #991b1b; border-color: #991b1b; }
.acc-danger__yes:hover { background: #7f1d1d; }

/* History: status is icon + text + colour, never colour alone */
.acc-table-wrap { overflow-x: auto; border: 1px solid #e5e5e5; }
.history-table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.55; }
.history-table th, .history-table td { text-align: left; vertical-align: top; padding: 14px 16px; border-bottom: 1px solid #e5e5e5; }
.history-table th { font-size: 12px; font-weight: 500; color: #525252; background: #f5f5f5; }
.history-table strong { font-weight: 500; }
.history-table time { white-space: nowrap; font-variant-numeric: tabular-nums; }
.history-table td a:not(.tl-button) { text-decoration: underline; text-underline-offset: 3px; }
.history-table td a:not(.tl-button):hover { color: #2b5fe3; }
.status-badge { display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 4px 8px; border: 1px solid; border-radius: 2px; font-size: 12px; line-height: 18px; white-space: nowrap; }
.status-badge .tl-icon { width: 14px; height: 14px; }
.status-badge--found { color: #166534; background: #eaf8ef; border-color: #b7e4c7; }
.status-badge--partial { color: #92400e; background: #fff7e6; border-color: #f5d9a8; }
.status-badge--no_category_in_city { color: #244fcc; background: #eaf0ff; border-color: #c7d5fb; }
.status-badge--none_match { color: #991b1b; background: #fdeded; border-color: #f5c2c2; }

/* Save toggle: state is carried by the button text, not by a glow */
.fav-form { margin: 0; flex: none; }
.fav-btn, .fav-login { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px 14px; border: 1px solid #737373; border-radius: 4px; background: #fff; color: #000; font-size: 14px; line-height: 20px; white-space: nowrap; cursor: pointer; }
.fav-btn:hover, .fav-login:hover { background: #f5f5f5; }
.fav-btn .tl-icon, .fav-login .tl-icon { width: 18px; height: 18px; }
.fav-btn.is-on { border-color: #2b5fe3; color: #244fcc; background: #eaf0ff; }
.fav-login { border-style: dashed; }

/* Shortlist */
.shortlist { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.shortlist-card { border: 1px solid #d4d4d4; padding: 20px; display: grid; gap: 12px; align-content: start; scroll-margin-top: 120px; }
.shortlist-card__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.shortlist-card h2 { font-size: 22px; font-weight: 500; letter-spacing: -.02em; line-height: 28px; overflow-wrap: anywhere; }
.shortlist-card h2 a:hover { text-decoration: underline; text-underline-offset: 4px; }
.shortlist-card__meta { font-size: 14px; color: #525252; }
.shortlist-card__price span { font-size: 12px; color: #525252; }
.shortlist-card__price strong { font-size: 22px; font-weight: 500; letter-spacing: -.03em; white-space: nowrap; }
.shortlist-card .tl-card-flags { padding: 0; }
.shortlist-card__link a { display: inline-flex; min-height: 44px; align-items: center; font-size: 14px; text-decoration: underline; text-underline-offset: 4px; }

/* Profile */
.prof-page { padding-block: 32px 80px; display: grid; gap: 24px; }
.prof-back { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; text-decoration: underline; text-underline-offset: 4px; }
.prof-head, .prof-section { border: 1px solid #e5e5e5; padding: 32px; scroll-margin-top: 110px; }
.prof-head { display: grid; gap: 24px; }
.prof-head__top { display: flex; align-items: flex-start; gap: 20px; }
.prof-head__title { flex: 1; min-width: 0; }
.prof-initial { width: 48px; height: 48px; display: grid; place-items: center; flex: none; font-size: 24px; background: #f5f5f5; border-radius: 4px; }
.prof-head h1 { font-size: clamp(32px, 4vw, 48px); font-weight: 450; letter-spacing: -.04em; line-height: 1.08; overflow-wrap: anywhere; }
.prof-meta { margin-top: 8px; font-size: 14px; color: #525252; }
.prof-price { display: grid; gap: 4px; padding: 16px 20px; background: #f5f5f5; border-block: 1px solid #e5e5e5; }
.prof-price span, .prof-price small { font-size: 12px; color: #525252; }
.prof-price strong { font-size: 28px; font-weight: 400; letter-spacing: -.03em; line-height: 34px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.prof-flags { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; font-size: 14px; line-height: 1.5; }
.prof-flags li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.prof-flags li > span:last-child { color: #525252; }
.prof-flags .badge { display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 4px 8px; border-radius: 2px; font-size: 12px; color: #92400e; background: #fff7e6; border: 1px solid #f5d9a8; }
.prof-flags .badge--synthetic { color: #000; background: #fff; border-color: #737373; }
.prof-flags .tl-icon { width: 14px; height: 14px; }
.prof-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid #e5e5e5; }
.prof-facts > div { padding: 16px 16px 0 0; }
.prof-facts > div + div { border-left: 1px solid #e5e5e5; padding-left: 16px; }
.prof-facts dt { font-size: 12px; color: #525252; }
.prof-facts dd { margin-top: 4px; font-size: 16px; }
.prof-facts small { display: block; margin-top: 4px; font-size: 12px; line-height: 18px; color: #525252; }
.prof-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.prof-actions p, .prof-note { font-size: 12px; line-height: 18px; color: #525252; }
.prof-more { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; font-size: 14px; }
.prof-more a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: underline; text-underline-offset: 4px; }
.prof-section { display: grid; gap: 16px; }
.prof-section h2 { font-size: 24px; font-weight: 450; letter-spacing: -.03em; line-height: 30px; }
.prof-description { max-width: 760px; font-size: 16px; line-height: 1.7; white-space: pre-line; }

/* Calendar: "busy" is hatching + a struck number, never colour alone */
.cal-selected { padding: 12px 16px; border: 1px solid; font-size: 16px; }
.cal-selected--free { color: #166534; background: #eaf8ef; border-color: #b7e4c7; }
.cal-selected--busy { color: #991b1b; background: #fdeded; border-color: #f5c2c2; }
.cal-selected--out { color: #525252; background: #f5f5f5; border-color: #e5e5e5; }
.cal-stats { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; font-size: 14px; line-height: 1.55; }
.cal-stats strong { font-weight: 500; }
.cal-stats span { color: #525252; }
.cal-legend { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 14px; }
.cal-legend li { display: flex; align-items: center; gap: 8px; }
.cal-swatch { display: inline-block; width: 18px; height: 18px; border-radius: 2px; border: 1px solid #d4d4d4; }
.cal-swatch--free { background: #eaf8ef; border-color: #86c79c; }
.cal-swatch--busy { background: repeating-linear-gradient(135deg, #f5c2c2 0 3px, #fff 3px 6px); }
.cal-swatch--out { background: #f5f5f5; border-style: dashed; }
.calendar { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.calendar__month { width: 100%; border-collapse: separate; border-spacing: 3px; table-layout: fixed; }
.calendar__month caption { text-align: left; font-size: 14px; font-weight: 500; padding: 0 3px 8px; }
.calendar__month caption span { font-weight: 400; color: #525252; }
.calendar__month th { font-size: 12px; font-weight: 400; color: #525252; padding-bottom: 4px; }
.calendar__month abbr { text-decoration: none; }
.cal-day { height: 36px; text-align: center; font-size: 13px; border-radius: 4px; font-variant-numeric: tabular-nums; }
.cal-day--free { background: #eaf8ef; color: #000; font-weight: 500; box-shadow: inset 0 0 0 1px #b7e4c7; }
.cal-day--busy { color: #525252; text-decoration: line-through; background: repeating-linear-gradient(135deg, #fdeded 0 4px, #fff 4px 8px); box-shadow: inset 0 0 0 1px #f5c2c2; }
.cal-day--out { color: #a3a3a3; background: #f5f5f5; }
.cal-day[aria-current="date"] { outline: 2px solid #2b5fe3; outline-offset: 1px; }
.cal-text summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-size: 14px; font-weight: 500; }
.cal-text p { font-size: 14px; line-height: 1.6; }

/* Flash fallback until phase 2's auth.css is merged (auth.css loads later and wins) */
.flash-wrap { padding-top: 24px; }
.flash { display: flex; align-items: flex-start; gap: 12px; margin: 0; padding: 16px 20px; border: 1px solid; font-size: 16px; line-height: 1.5; }
.flash > .tl-icon { width: 20px; height: 20px; margin-top: 2px; flex-shrink: 0; }
.flash--ok { color: #166534; background: #eaf8ef; border-color: #b7e4c7; }
.flash--info { color: #000; background: #eaf0ff; border-color: #c7d5fb; }
.flash--error { color: #991b1b; background: #fdeded; border-color: #f5c2c2; }

@media (forced-colors: active) { .cal-day--free { border: 1px solid CanvasText; } .status-badge, .fav-btn { border: 1px solid CanvasText; } }
@media (max-width: 1100px) { .calendar { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .acc-layout { grid-template-columns: minmax(0, 1fr); gap: 24px; padding-block: 32px 56px; }
  .acc-side { position: static; }
  .acc-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .acc-user { display: none; }
}
@media (max-width: 720px) {
  .prof-head, .prof-section { padding: 20px 16px; }
  .prof-head__top { flex-wrap: wrap; }
  .prof-head__top .fav-form, .prof-head__top .fav-login { flex-basis: 100%; }
  .prof-facts { grid-template-columns: 1fr; }
  .prof-facts > div + div { border-left: 0; padding-left: 0; border-top: 1px solid #e5e5e5; margin-top: 16px; }
  .history-table thead { display: none; }
  .history-table tr { display: block; padding: 8px 0; border-bottom: 1px solid #e5e5e5; }
  .history-table td { display: block; border: 0; padding: 6px 16px; }
  .history-table td[data-label]::before { content: attr(data-label); display: block; font-size: 12px; color: #525252; }
  .acc-empty { padding: 32px 20px; }
}
@media (max-width: 560px) { .calendar { grid-template-columns: minmax(0, 1fr); } .cal-day { height: 40px; font-size: 15px; } }
