/*
  65-holdings.css — v46.3 Holdings (design/holdings Main, Bastion, Facility,
  Turn, Review, Desktop). Dark screen, cream cards, brass accents. The
  facility sheet is 63's bottom sheet (.sh-sheet); the bastion page and the
  turn are the Modal drawn full height on a phone, as 64's project page is.
*/

.hd-screen { display: flex; flex-direction: column; gap: 10px; padding: 2px 0 24px; color: #231a10; }
.hd-screen button, #modal .hd-page button, #modal .bt-flow button { font: inherit; }

/* The turn banner */
.hd-banner { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; border: 1px solid #4a3a28; background: #2a1e15; color: #f1e4c4; }
.hd-banner.is-due { border-color: #c18a2a; background: #c18a2a; color: #1f1712; }
.hd-banner-text { flex: 1 1 auto; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hd-banner-text b { font-size: 16px; }
.hd-banner-text small { font-size: 13px; line-height: 1.35; opacity: .85; }
.hd-screen button.hd-take, #modal button.hd-take, #deskHead button.hd-take { flex-shrink: 0; min-height: 44px !important; padding: 0 18px; border: 0; border-radius: 12px; background: #1f1712; color: #f1e4c4; font-size: 15px; font-weight: 700; cursor: pointer; }
.hd-banner:not(.is-due) button.hd-take, #deskHead button.hd-take { background: #c18a2a; color: #1f1712; }
.hd-screen button.hd-take.is-quiet { background: transparent; border: 1px solid #6e5b40; color: #f1e4c4; }
.hd-screen button.hd-event { display: flex; align-items: center; gap: 8px; min-height: 44px !important; padding: 0 12px; border-radius: 12px; border: 1px solid #d9b46a; background: #f3d9a4; color: #3d2a0c; font-size: 14px; font-weight: 600; text-align: left; cursor: pointer; }

/* A bastion's card */
.hd-card { overflow: hidden; border-radius: 16px; border: 1px solid #ddd0ab; background: #efe4c3; }
.hd-screen button.hd-card-open { display: flex; flex-direction: column; width: 100%; min-height: 0 !important; padding: 0; border: 0; background: none; color: #231a10; text-align: left; cursor: pointer; }
.hd-pic { position: relative; display: block; height: 128px; background: #4e7466; }
.hd-pic img { width: 100%; height: 100%; object-fit: cover; }
.hd-pic-tag { position: absolute; left: 10px; bottom: 10px; padding: 3px 10px; border-radius: 999px; background: rgba(31, 23, 18, .78); color: #f1e4c4; font-size: 12px; font-weight: 700; }
.hd-card-body { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px 12px; }
.hd-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.hd-card-head b { font-size: 17px; }
.hd-card-head small { font-size: 13px; color: #5c4a30; }
.hd-figs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.hd-figs > span { display: flex; flex-direction: column; gap: 1px; padding: 8px 10px; border-radius: 10px; background: #f6efdc; }
.hd-figs b { font-size: 18px; font-variant-numeric: tabular-nums; }
.hd-figs small { font-size: 12px; color: #5c4a30; }
.hd-card-notes { font-size: 13px; line-height: 1.4; color: #5c4a30; }
.hd-empty { display: flex; flex-direction: column; gap: 4px; padding: 14px; font-size: 14px; color: #5c4a30; }
.hd-empty b { color: #231a10; font-size: 15px; }
.hd-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.hd-screen button.hd-btn { min-height: 48px !important; padding: 0 12px; border-radius: 14px; border: 1px solid #6e5b40; background: #2a1e15; color: #f1e4c4; font-size: 15px; font-weight: 600; cursor: pointer; }
.hd-screen button.hd-add { border-style: dashed; background: transparent; color: #e8c069; }

/* The bastion page */
#modal:has(.hd-page) .modal-head, #modal:has(.bt-flow) .modal-head { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.hd-page { display: flex; flex-direction: column; gap: 0; margin: -4px -4px 0; color: #231a10; }
.hd-page-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 2px 8px; font-size: 16px; font-weight: 700; }
.hd-page-head > :first-child { justify-self: start; }
.hd-page-head > :last-child { justify-self: end; }
#modal button.hd-link { min-height: 40px !important; padding: 0 4px; border: 0; background: none; box-shadow: none; color: #845c0f; font-size: 14px; font-weight: 600; cursor: pointer; }
#modal button.hd-link.hd-under { align-self: flex-start; margin-top: -2px; }
.hd-hero { position: relative; height: 170px; overflow: hidden; border-radius: 14px; background: #4e7466; }
.hd-hero img { width: 100%; height: 100%; object-fit: cover; }
.hd-hero-btns { position: absolute; right: 10px; bottom: 10px; display: flex; gap: 8px; }
#modal button.hd-hero-btn { min-height: 40px !important; padding: 0 14px; border: 0; border-radius: 999px; background: rgba(31, 23, 18, .82); box-shadow: none; color: #f1e4c4; font-size: 13px; font-weight: 700; cursor: pointer; }
.hd-page-body { display: flex; flex-direction: column; gap: 10px; padding: 12px 2px 0; }
#modal .hd-name { margin: 0; font-size: 22px; font-weight: 700; color: #231a10; }
.hd-sub { margin: -6px 0 0; font-size: 14px; color: #5c4a30; }
.hd-notes { font-size: 14px; line-height: 1.45; color: #3d2f1d; }
.hd-sec-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; font-size: 13px; color: #5c4a30; }
.hd-sec-head b { font-size: 15px; color: #231a10; }
.hd-facs { display: flex; flex-direction: column; gap: 8px; }
#modal button.hd-fac { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px !important; padding: 8px 12px; border-radius: 14px; border: 1px solid #ddd0ab; background: #efe4c3; box-shadow: none; color: #231a10; text-align: left; cursor: pointer; }
.hd-room { display: grid; place-items: center; flex-shrink: 0; width: 40px; height: 40px; border-radius: 12px; background: #845c0f; color: #f4ecd8; }
.hd-room.is-big { width: 48px; height: 48px; border-radius: 14px; }
.hd-fac-text { flex: 1 1 auto; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.hd-fac-text b { font-size: 15px; }
.hd-fac-text small { font-size: 13px; color: #5c4a30; }
.hd-tag { flex-shrink: 0; padding: 3px 10px; border-radius: 999px; border: 1px solid #b9a77f; font-size: 12px; font-weight: 700; color: #5c4a30; }
.hd-tag.is-on { border-color: #845c0f; background: #845c0f; color: #fbf7ec; }
.hd-tag.is-warn { border-color: #d9b46a; background: #f3d9a4; color: #6b4a10; }
.hd-chips { display: flex; flex-wrap: wrap; gap: 8px; }
#modal button.hd-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 40px !important; padding: 0 12px; border-radius: 999px; border: 1px solid #b9a77f; background: #f6efdc; box-shadow: none; color: #231a10; font-size: 14px; font-weight: 600; cursor: pointer; }
.hd-chip .cx-icon { color: #845c0f; }
.hd-none { font-size: 14px; color: #5c4a30; }
.hd-more { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.hd-page-foot { position: sticky; bottom: 0; padding: 12px 0 4px; background: linear-gradient(transparent, #f4ecd8 30%); }
#modal button.hd-take.is-wide { width: 100%; min-height: 52px !important; background: #c18a2a; color: #1f1712; }

/* The facility sheet */
.hd-fac-title { display: flex; align-items: center; gap: 12px; }
#modal .hd-fac-title h3 { margin: 0; font-size: 20px; font-weight: 700; color: #231a10; }
.hd-fac-title small { font-size: 13px; color: #5c4a30; }
.hd-facts { overflow: hidden; border-radius: 14px; border: 1px solid #ddd0ab; background: #efe4c3; }
.hd-fact { display: flex; justify-content: space-between; gap: 10px; padding: 11px 12px; border-bottom: 1px solid #ddd0ab; font-size: 14px; }
.hd-fact:last-child { border-bottom: 0; }
.hd-fact span { color: #5c4a30; }
.hd-fact b { text-align: right; }
.hd-locked { margin: 0; padding: 10px 12px; border-radius: 12px; background: #f3d9a4; font-size: 14px; color: #3d2a0c; }
.hd-opts { display: flex; flex-direction: column; gap: 8px; }
.hd-opt { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; border: 1px solid #ddd0ab; background: #f6efdc; }
.hd-opt-text { flex: 1 1 auto; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.hd-opt-text b { font-size: 15px; }
.hd-opt-text small { font-size: 13px; line-height: 1.35; color: #5c4a30; }
#modal button.hd-rules { align-self: flex-start; text-decoration: underline; }

/* The turn (Turn and Review boards) */
.bt-flow { display: flex; flex-direction: column; color: #231a10; }
.bt-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 2px 6px; }
#modal button.bt-cancel { justify-self: start; min-height: 40px !important; padding: 0 4px; border: 0; background: none; box-shadow: none; color: #845c0f; font-size: 15px; font-weight: 600; }
.bt-title { font-size: 16px; font-weight: 700; }
.bt-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 0 0 10px; padding: 0; list-style: none; }
.bt-steps li { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 700; color: #8a7a5c; }
.bt-steps li span { height: 4px; border-radius: 999px; background: #ddd0ab; }
.bt-steps li.is-done, .bt-steps li.is-now { color: #231a10; }
.bt-steps li.is-done span { background: #845c0f; }
.bt-steps li.is-now span { background: #c18a2a; }
.bt-body { display: flex; flex-direction: column; gap: 10px; }
.bt-help { margin: 0; font-size: 14px; line-height: 1.45; color: #3d2f1d; }
.bt-bastion, .bt-review { display: flex; flex-direction: column; gap: 10px; }
#modal .bt-bastion-name { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 4px 0 0; font-size: 17px; font-weight: 700; color: #231a10; }
.bt-fac { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 14px; border: 1px solid #ddd0ab; background: #efe4c3; }
.bt-fac.is-chosen { border-color: #c18a2a; }
.bt-fac-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.bt-fac-head b { font-size: 16px; }
.bt-fac-head small { font-size: 13px; color: #5c4a30; }
.bt-chips { display: flex; gap: 8px; }
#modal .bt-chips button { min-height: 40px !important; padding: 0 16px; border-radius: 999px; border: 1px solid #b9a77f; background: #f6efdc; box-shadow: none; color: #231a10; font-size: 14px; font-weight: 700; cursor: pointer; }
#modal .bt-chips button.is-on { border-color: #845c0f; background: #845c0f; color: #fbf7ec; }
#modal .bt-chips button[disabled] { opacity: .45; cursor: default; }
.bt-label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; color: #3d2f1d; }
#modal .bt-select { width: 100%; box-sizing: border-box; min-height: 48px; padding: 0 12px; border-radius: 12px; border: 1px solid #b9a77f; background: #fbf7ec; color: #231a10; font: inherit; font-size: 15px; font-weight: 400; }
#modal textarea.bt-select { min-height: 80px; padding: 10px 12px; }
.bt-yields { font-size: 13px; color: #5c4a30; }
.bt-locked { font-size: 13px; color: #8a5a10; }
.bt-note { padding: 10px 12px; border-radius: 12px; border: 1px dashed #b9a77f; font-size: 13px; line-height: 1.4; color: #5c4a30; }
.bt-rlines { overflow: hidden; border-radius: 14px; border: 1px solid #ddd0ab; background: #efe4c3; }
.bt-rline { display: flex; gap: 12px; padding: 12px; border-bottom: 1px solid #ddd0ab; font-size: 14px; }
.bt-rline:last-child { border-bottom: 0; }
.bt-rline b { flex: 0 0 96px; }
.bt-rline span { display: flex; flex-direction: column; gap: 2px; }
.bt-rline small { font-size: 13px; color: #5c4a30; }
.bt-event { display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: 14px; border: 1px solid #ddd0ab; background: #f6efdc; }
.bt-event b { font-size: 15px; }
.bt-event small { font-size: 13px; line-height: 1.4; color: #5c4a30; }
.bt-foot { position: sticky; bottom: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; padding: 12px 0 4px; background: linear-gradient(transparent, #f4ecd8 30%); }
#modal button.bt-back, #modal button.bt-next { min-height: 52px !important; border-radius: 14px; box-shadow: none; font-size: 16px; font-weight: 700; cursor: pointer; }
#modal button.bt-back { border: 1px solid #b9a77f; background: #fbf7ec; color: #231a10; }
#modal button.bt-next { border: 0; background: #c18a2a; color: #1f1712; }
.bt-who { width: 100%; }

@layer editor-pilot {
  @media (max-width: 699px) {
    .modal-backdrop.active:has(> #modal .hd-page), .modal-backdrop.active:has(> #modal .bt-flow) { align-items: stretch !important; padding: 0 !important; }
    #modal:has(.hd-page), #modal:has(.bt-flow) { width: 100% !important; max-width: none !important; max-height: none !important; min-height: 100% !important; margin: 0 !important; border-radius: 0 !important; }
  }
}

/* Desktop (design/holdings/Desktop): the turn sits in the page header */
#deskHead .hd-head-due { margin-right: 12px; font-size: 14px; color: #e6d7b5; }
@media (min-width: 900px) {
  .hd-screen { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); align-items: start; }
  .hd-screen > .hd-banner, .hd-screen > .hd-event, .hd-screen > .hd-links, .hd-screen > .hd-add { grid-column: 1 / -1; }
  .hd-links { max-width: 520px; }
  body.desk-shell .hd-screen > .hd-banner { display: none; }
}
/* The page drawn in place on a desktop: picture and figures left, facilities right */
.hd-desk { display: block !important; }
.hd-page.is-inline { margin: 0; color: #231a10; }
.hd-page.is-inline .hd-page-head, .hd-page.is-inline .hd-page-foot { display: none; }
.hd-page.is-inline .hd-name, .hd-page.is-inline .hd-sub { display: none; }
@media (min-width: 900px) {
  .hd-page.is-inline { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
  .hd-page.is-inline .hd-hero { height: 200px; }
  .hd-page.is-inline .hd-page-body { padding: 0; }
  .hd-page.is-inline .hd-sec-head { color: #bfae8c; }
  .hd-page.is-inline .hd-sec-head b { color: #f1e4c4; }
  .hd-page.is-inline .hd-notes, .hd-page.is-inline .hd-none { color: #e6d7b5; }
  .hd-page.is-inline .hd-hero-col { display: flex; flex-direction: column; gap: 12px; }
}
.hd-screen button.hd-link { min-height: 36px !important; padding: 0 4px; border: 0; background: none; color: #e8c069; font-size: 14px; font-weight: 600; cursor: pointer; }
.hd-screen button.hd-fac { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px !important; padding: 8px 12px; border-radius: 14px; border: 1px solid #ddd0ab; background: #efe4c3; color: #231a10; text-align: left; cursor: pointer; }
.hd-screen button.hd-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 40px !important; padding: 0 12px; border-radius: 999px; border: 1px solid #6e5b40; background: #2a1e15; color: #f1e4c4; font-size: 14px; font-weight: 600; cursor: pointer; }
.hd-screen .hd-chip .cx-icon { color: #e8c069; }
.hd-screen button.hd-hero-btn { min-height: 40px !important; padding: 0 14px; border: 0; border-radius: 999px; background: rgba(31, 23, 18, .82); color: #f1e4c4; font-size: 13px; font-weight: 700; cursor: pointer; }
/* The older boards folded under a bastion's page, as plain cream cards */
.hd-more details.compact-board { overflow: hidden; margin: 0; border-radius: 14px; border: 1px solid #ddd0ab; background: #efe4c3; box-shadow: none; }
.hd-more details.compact-board > summary { display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 0 12px; background: none; color: #231a10; font-size: 15px; font-weight: 700; text-shadow: none; }
.hd-more details.compact-board > summary .chip { border: 1px solid #b9a77f; background: #f6efdc; color: #5c4a30; box-shadow: none; }
.hd-more .board-body { padding: 0 12px 12px; background: none; }
