/*
  64-calendar.css — v46.2 Calendar and Crafting (design/calendar Main,
  Harptos, Events, Event, Crafting, Project, Desktop). Dark screen, cream
  cards, brass accents; the event sheet uses 63's bottom sheet (.sh-sheet).
*/

.cl-screen { display: flex; flex-direction: column; gap: 10px; padding: 2px 0 24px; color: #231a10; }
.cl-screen button, #modal .cl-project-page button, #modal .cl-event button { font: inherit; }
.cl-card { overflow: hidden; border-radius: 14px; border: 1px solid #ddd0ab; background: #efe4c3; color: #231a10; }
.cl-empty { padding: 14px 12px; margin: 0; font-size: 14px; color: #5c4a30; }
.cl-heading { margin: 4px 0 0; font-size: 15px !important; font-weight: 700; color: #f1e4c4; letter-spacing: 0; text-shadow: none; font-family: inherit; }
.cl-heading-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.cl-screen button.cl-link, #modal button.cl-link { min-height: 36px !important; padding: 0 2px; border: 0; background: none; box-shadow: none; color: #e8c069; font-size: 14px; font-weight: 600; cursor: pointer; }
#modal button.cl-link { color: #845c0f; }
.cl-tag { flex-shrink: 0; padding: 2px 10px; border-radius: 999px; border: 1px solid #b9a77f; background: #f6efdc; font-size: 12px; font-weight: 700; color: #5c4a30; }

/* The month */
.cl-month { padding: 10px 12px 12px; border-radius: 16px; border: 1px solid #ddd0ab; background: #efe4c3; color: #231a10; }
.cl-month-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.cl-screen button.cl-arrow { width: 44px; min-height: 44px !important; padding: 0; border: 0; background: none; color: #845c0f; font-size: 22px; cursor: pointer; }
.cl-screen button.cl-month-name { min-height: 44px !important; padding: 0 8px; border: 0; background: none; color: #231a10; font-size: 17px; font-weight: 700; cursor: pointer; }
.cl-grid { display: grid; grid-template-columns: repeat(var(--cols, 7), minmax(0, 1fr)); gap: 4px 6px; }
.cl-wd { padding: 2px 0 4px; text-align: center; font-size: 12px; font-weight: 700; color: #5c4a30; }
.cl-screen button.cl-day { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 40px !important; padding: 0; border: 1.5px solid transparent; border-radius: 10px; background: none; color: #231a10; cursor: pointer; }
.cl-num { font-size: 15px; font-variant-numeric: tabular-nums; }
.cl-day.is-past .cl-num { color: #8a7a5c; }
.cl-screen button.cl-day.is-today { border-color: #845c0f; background: #fbf7ec; font-weight: 700; }
.cl-marks { display: flex; gap: 2px; height: 4px; }
.cl-marks i, .cl-key i { display: block; width: 4px; height: 4px; border-radius: 999px; background: #845c0f; }
.cl-marks i.is-festival, .cl-key i.is-festival { width: 10px; border-radius: 2px; background: #c18a2a; }
.cl-key { display: flex; gap: 14px; margin-top: 8px; font-size: 12px; color: #5c4a30; }
.cl-key span { display: inline-flex; align-items: center; gap: 6px; }
.cl-key i { width: 6px; height: 6px; }
.cl-key i.is-festival { width: 12px; height: 4px; }
.cl-tenday { margin-top: 6px; }
.cl-row-label { margin: 0 0 2px 4px; font-size: 12px; font-weight: 700; color: #5c4a30; }
.cl-screen button.cl-festival-day { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px !important; padding: 8px 12px; border-radius: 14px; border: 1.5px solid #c18a2a; background: #f6efdc; color: #231a10; text-align: left; cursor: pointer; }
.cl-festival-day b { font-size: 15px; }
.cl-festival-day span { flex: 1 1 auto; font-size: 13px; color: #5c4a30; }
.cl-festival-day small { flex-shrink: 0; font-size: 13px; font-weight: 700; color: #845c0f; }
.cl-simple { text-align: center; }
.cl-simple-day { font-size: 28px; font-weight: 700; }
.cl-simple p { margin: 6px 0 0; font-size: 14px; color: #5c4a30; }

/* Rows: this month, events */
.cl-list { display: flex; flex-direction: column; gap: 8px; }
.cl-screen button.cl-row, #modal button.cl-row, .cl-row.is-static { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px !important; padding: 8px 12px; border-radius: 14px; border: 1px solid #ddd0ab; background: #efe4c3; color: #231a10; text-align: left; cursor: pointer; }
.cl-row.is-static { cursor: default; }
.cl-row.is-done { opacity: .72; }
.cl-badge { display: flex; flex-direction: column; align-items: center; justify-content: center; flex-shrink: 0; width: 40px; height: 44px; border-radius: 10px; border: 1px solid #c9b78f; background: #fbf7ec; line-height: 1; }
.cl-badge b { font-size: 17px; font-variant-numeric: tabular-nums; }
.cl-badge small { margin-top: 3px; font-size: 10px; font-weight: 700; color: #5c4a30; }
.cl-badge-day small { margin: 0 0 3px; text-transform: uppercase; }
.cl-row-text { flex: 1 1 auto; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.cl-row-text b { overflow: hidden; font-size: 15px; text-overflow: ellipsis; }
.cl-row-text small { font-size: 13px; color: #5c4a30; }

/* Events */
.cl-events-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cl-pills { display: flex; gap: 8px; }
.cl-pills button { min-height: 44px !important; padding: 0 16px; border-radius: 999px; border: 1px solid #6e5b40; background: transparent; color: #f1e4c4; font-size: 14px; font-weight: 600; cursor: pointer; }
.cl-pills button.is-on { border-color: #c18a2a; background: #c18a2a; color: #1f1712; }
.cl-screen button.cl-add { display: grid; place-items: center; width: 44px; height: 44px; min-height: 0 !important; padding: 0; border-radius: 12px; border: 1px solid #6e5b40; background: #2a1e15; color: #e8c069; cursor: pointer; }
.cl-screen button.cl-fest { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px !important; padding: 8px 12px; border: 0; border-bottom: 1px solid #ddd0ab; background: transparent; color: #231a10; text-align: left; cursor: pointer; }
.cl-fest:last-child { border-bottom: 0; }
.cl-fest > i { flex-shrink: 0; width: 12px; height: 4px; border-radius: 2px; background: #c18a2a; }
.cl-when { flex-shrink: 0; font-size: 13px; color: #5c4a30; }

/* The event sheet */
.cl-event-when { font-size: 13px; color: #5c4a30; }
#modal .cl-event-title { margin: -6px 0 0; font-size: 22px; font-weight: 700; color: #231a10; }
.cl-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cl-chip { padding: 3px 10px; border-radius: 999px; border: 1px solid #b9a77f; font-size: 13px; font-weight: 600; color: #3d2f1d; }
.cl-chip.is-dm { border-color: #c18a2a; background: #f3d9a4; }
.cl-chip.is-done { border-color: #9cbf8a; background: #e4ecd4; color: #2f6b3f; }
.cl-event-notes { font-size: 15px; line-height: 1.5; color: #231a10; }
.cl-connected { overflow: hidden; border-radius: 14px; border: 1px solid #ddd0ab; background: #efe4c3; }
.cl-connected-head { padding: 8px 12px 4px; font-size: 13px; font-weight: 700; color: #5c4a30; }
.cl-event-actions { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 8px; }
.cl-event-actions .cl-btn { white-space: nowrap; }
#modal .cl-btn, .cl-screen .cl-btn { min-height: 48px; padding: 0 10px; border-radius: 14px; border: 1px solid #b9a77f; background: #fbf7ec; box-shadow: none; color: #231a10; font-size: 15px; font-weight: 600; cursor: pointer; }
#modal .cl-btn.is-primary { border-color: #c18a2a; background: #c18a2a; color: #1f1712; }
#modal .cl-btn.is-danger { color: #8a2f20; }
#modal .cl-btn[disabled] { opacity: .45; cursor: default; }

/* Crafting */
.cl-craft-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cl-craft-sum { display: flex; flex-wrap: wrap; gap: 4px 12px; white-space: nowrap; font-size: 14px; color: #bfae8c; }
.cl-craft-sum b { font-size: 18px; color: #f1e4c4; }
.cl-craft-sum button { min-height: 32px !important; padding: 0; border: 0; background: none; color: #bfae8c; font-size: 14px; cursor: pointer; text-decoration: underline; text-decoration-color: #6e5b40; }
.cl-screen button.cl-new, #deskHead button.cl-head-btn { flex-shrink: 0; min-height: 44px !important; padding: 0 16px; border-radius: 12px; border: 0; background: #c18a2a; color: #1f1712; font-size: 15px; font-weight: 700; cursor: pointer; }
.cl-project { overflow: hidden; border-radius: 16px; border: 1px solid #ddd0ab; background: #efe4c3; }
.cl-project.is-ready { border: 1.5px solid #c18a2a; background: #f6efdc; }
.cl-screen button.cl-project-open { display: flex; flex-direction: column; gap: 6px; width: 100%; min-height: 0 !important; padding: 12px; border: 0; background: none; color: #231a10; text-align: left; cursor: pointer; }
.cl-project-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cl-project-head b { font-size: 16px; }
#modal .cl-project-head h3 { margin: 0; font-size: 22px; font-weight: 700; color: #231a10; }
.cl-project-open small { font-size: 13px; color: #5c4a30; }
.cl-days { display: flex; gap: 3px; }
.cl-days i { flex: 1 1 0; height: 10px; border-radius: 3px; background: #ddd0ab; }
.cl-days i.is-on { background: #845c0f; }
.cl-dayline { display: block; height: 10px; overflow: hidden; border-radius: 999px; background: #ddd0ab; }
.cl-dayline span { display: block; height: 100%; background: #845c0f; }
.cl-project-foot { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: #5c4a30; }
.cl-screen button.cl-claim, #modal button.cl-claim { display: block; width: calc(100% - 24px); min-height: 48px !important; margin: 0 12px 12px; border: 0; border-radius: 12px; background: #845c0f; box-shadow: none; color: #fbf7ec; font-size: 15px; font-weight: 700; cursor: pointer; }
#modal .cl-progress button.cl-claim { width: 100%; margin: 8px 0 0; }

/* The project page: a full cream sheet with Back and Edit */
#modal:has(.cl-project-page) .modal-head { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.cl-project-page { display: flex; flex-direction: column; gap: 12px; color: #231a10; }
.cl-page-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; margin: -4px 0 4px; font-size: 16px; font-weight: 700; }
.cl-page-head .cl-link:first-child { justify-self: start; }
.cl-page-head .cl-link:last-child { justify-self: end; }
.cl-project-sub { margin: -6px 0 0; font-size: 14px; color: #5c4a30; }
.cl-progress { display: flex; flex-direction: column; gap: 10px; padding: 12px; }
.cl-progress-head { display: flex; justify-content: space-between; font-size: 13px; color: #5c4a30; }
.cl-progress-head b { font-size: 16px; color: #231a10; }
.cl-progress-btns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.cl-auto { display: flex; align-items: center; gap: 10px; font-size: 14px; color: #3d2f1d; cursor: pointer; }
.cl-auto input { flex-shrink: 0; width: 22px; height: 22px; accent-color: #845c0f; }
.cl-fact { display: flex; justify-content: space-between; gap: 10px; padding: 12px; border-bottom: 1px solid #ddd0ab; font-size: 15px; }
.cl-fact:last-child { border-bottom: 0; }
.cl-fact span { color: #5c4a30; }
.cl-project-notes { margin: 0; font-size: 15px; line-height: 1.5; }
.cl-project-help { margin: 0; font-size: 13px; line-height: 1.45; color: #5c4a30; }

/* Desktop (design/calendar/Desktop) */
.cl-desk { display: grid; grid-template-columns: minmax(0, 1fr) 344px; align-items: start; gap: 16px; }
.cl-desk .cl-month { padding: 14px; }
.cl-desk .cl-month-name { font-size: 19px; }
.cl-nav-wide { color: #845c0f; font-weight: 600; }
.cl-nav-wide button { min-height: 36px !important; padding: 0; border: 0; background: none; color: #845c0f; font-weight: 600; cursor: pointer; }
.cl-desk .cl-grid { gap: 6px; }
.cl-desk .cl-wd { text-align: left; padding-left: 4px; }
.cl-desk button.cl-day { align-items: flex-start; justify-content: flex-start; min-height: 64px !important; padding: 6px 8px; border: 1px solid #ddd0ab; border-radius: 10px; background: #f6efdc; text-align: left; }
.cl-desk button.cl-day.has-marks { background: #e8dbb6; }
.cl-desk .cl-label { font-size: 12px; line-height: 1.2; color: #3d2f1d; }
.cl-side { display: flex; flex-direction: column; gap: 8px; }
.cl-screen button.cl-side-row { display: flex; flex-direction: column; gap: 2px; width: 100%; min-height: 0 !important; padding: 10px 14px; border-radius: 14px; border: 1px solid #ddd0ab; background: #efe4c3; color: #231a10; text-align: left; cursor: pointer; }
.cl-side-row b { font-size: 15px; }
.cl-side-row small { font-size: 13px; color: #5c4a30; }
.cl-side-row.is-ready { border: 1.5px solid #c18a2a; background: #f6efdc; }

/* The project page is a full page on a phone (the legacy layer pins dialogs; see 49 and 63) */
@layer editor-pilot {
  @media (max-width: 699px) {
    .modal-backdrop.active:has(> #modal .cl-project-page) { align-items: stretch !important; padding: 0 !important; }
    #modal:has(.cl-project-page) { width: 100% !important; max-width: none !important; max-height: none !important; min-height: 100% !important; margin: 0 !important; border-radius: 0 !important; }
  }
}
