/* CGL facilities live: tiles, drawer and live panels. */

/* Tiles open in place: never jump to a full-width row. */
.facility.is-expanded, .facility.is-open { grid-column: auto; }
.facility.is-open, .life-item.is-open { border-color: var(--sea, #1d4842); box-shadow: var(--shadow, 0 6px 20px rgba(16,48,44,.12)); }
.facility.is-open:hover { transform: none; }

/* Drawer: full row directly below the clicked tile's row. */
.cgl-fl-drawer { grid-column: 1 / -1; list-style: none; margin: 0; padding: 9px 0 0; min-width: 0; }
.cgl-fl-drawer__in { position: relative; background: var(--surface, #fff); color: var(--ink, #10302c); border: 1px solid var(--line, #d9d4c7); border-radius: 12px; box-shadow: var(--shadow, 0 6px 20px rgba(16,48,44,.12)); padding: 1.15rem 1.25rem 1.1rem; }
.cgl-fl-drawer__in::before { content: ""; position: absolute; top: -8px; left: var(--caret, 2rem); width: 14px; height: 14px; background: inherit; border-left: 1px solid var(--line, #d9d4c7); border-top: 1px solid var(--line, #d9d4c7); transform: rotate(45deg); }
.cgl-fl-drawer .facility__panel { padding: 0; }
.cgl-fl-drawer .facility__ask { color: var(--muted, #55665f); }
.cgl-fl-drawer .facility__ask a { color: var(--ink, #10302c); }
.safe-list .cgl-fl-drawer__in { color: var(--ink, #10302c); }
/* Inline (one column) panels inside the dark Safe and peaceful band get a light card. */
.safe-item .cgl-fac-live:not(:empty) { background: var(--surface, #fff); color: var(--ink, #10302c); border-radius: 12px; padding: 1rem; margin-bottom: .6rem; }
.safe-item .cgl-fac-live .facility__ask, .safe-item .cgl-fac-live .cgl-fl-small { color: var(--muted, #55665f); }

/* Status chip on the tile. */
.cgl-fl-chip { display: inline-flex; align-items: center; gap: .35rem; margin: .3rem 0 0; padding: .12rem .55rem; border-radius: 999px; font-size: .8rem; font-weight: 600; line-height: 1.5; background: #eef0ec; color: #3d4a45; white-space: normal; }
.facility__label { min-width: 0; }
.facility__label .cgl-fl-chip { display: flex; width: fit-content; max-width: 100%; white-space: nowrap; }
.facility__toggle > .cgl-fl-chip { white-space: nowrap; margin: 0 .25rem 0 auto; }
.facility__toggle .facility__chev { flex: none; }
.cgl-fl-drawer--host { grid-column: 1 / -1; padding-top: 1.25rem; }
.cgl-fl-chip::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: currentColor; flex: none; }
.cgl-fl-chip--open, .cgl-fl-chip--green { background: #e3f3e6; color: #1e6b33; }
.cgl-fl-chip--closed, .cgl-fl-chip--red { background: #f8e4e1; color: #9b2c1f; }
.cgl-fl-chip--maint, .cgl-fl-chip--amber { background: #fbf0d6; color: #7a5300; }

/* Panel content. */
.cgl-fl-panel { font-size: 1rem; line-height: 1.5; }
.cgl-fl-panel > * + * { margin-top: 1rem; }
.cgl-fl-panel h4 { font-family: var(--sans, inherit); font-size: 1rem; font-weight: 700; margin: 0 0 .45rem; letter-spacing: 0; }
.cgl-fl-head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; }
.cgl-fl-head .cgl-fl-chip { margin: 0; font-size: .9rem; padding: .2rem .7rem; }
.cgl-fl-today { color: var(--muted, #55665f); }
.cgl-fl-example { display: inline-block; padding: .05rem .5rem; border-radius: 4px; background: var(--sand-soft, #f1e5c8); color: #6b5320; font-size: .75rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
.cgl-fl-note { display: flex; gap: .6rem; align-items: flex-start; padding: .7rem .85rem; border-radius: 8px; background: var(--sand-soft, #f1e5c8); }
.cgl-fl-note--warn { background: #fbe9e6; }
.cgl-fl-note .cgl-fl-i { flex: none; margin-top: .1rem; }
.cgl-fl-grid { display: grid; gap: 1rem 1.5rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.cgl-fl-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.cgl-fl-table th, .cgl-fl-table td { padding: .4rem .25rem; border-bottom: 1px solid var(--line, #e4e0d5); text-align: left; vertical-align: top; }
.cgl-fl-table th { font-weight: 600; }
.cgl-fl-table td.cgl-fl-price, .cgl-fl-table th.cgl-fl-price { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cgl-fl-table tr.is-today th, .cgl-fl-table tr.is-today td { background: #f4f7f3; font-weight: 600; }
.cgl-fl-table caption { text-align: left; font-weight: 700; padding-bottom: .3rem; }
.cgl-fl-tags { display: inline-flex; gap: .25rem; margin-left: .35rem; }
.cgl-fl-tags abbr { text-decoration: none; font-size: .7rem; font-weight: 700; padding: 0 .3rem; border-radius: 3px; background: #e3f3e6; color: #1e6b33; }
.cgl-fl-small { font-size: .85rem; color: var(--muted, #55665f); }
.cgl-fl-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.cgl-fl-list li { display: flex; gap: .55rem; align-items: flex-start; }
.cgl-fl-list .cgl-fl-i { flex: none; margin-top: .1rem; }
.cgl-fl-machines { display: flex; flex-wrap: wrap; gap: .45rem; list-style: none; margin: 0; padding: 0; }
.cgl-fl-machines li .cgl-fl-chip { margin: 0; }

/* Beach. */
.cgl-fl-light { display: flex; gap: .8rem; align-items: center; padding: .8rem 1rem; border-radius: 10px; }
.cgl-fl-light strong { font-size: 1.1rem; display: block; }
.cgl-fl-light--green { background: #e3f3e6; color: #174f27; }
.cgl-fl-light--amber { background: #fbf0d6; color: #5e4100; }
.cgl-fl-light--red { background: #f8e4e1; color: #7f2217; }
.cgl-fl-dot { width: 1.1rem; height: 1.1rem; border-radius: 50%; flex: none; background: currentColor; box-shadow: 0 0 0 4px rgba(255,255,255,.6); }
.cgl-fl-wx { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; margin: 0; padding: 0; }
.cgl-fl-wx li { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .7rem; border-radius: 999px; background: #eef3f1; font-weight: 600; font-size: .92rem; }
.cgl-fl-days { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; list-style: none; margin: 0; padding: 0; }
.cgl-fl-days li { padding: .6rem .5rem; border: 1px solid var(--line, #e4e0d5); border-radius: 8px; text-align: center; font-size: .88rem; }
.cgl-fl-days .cgl-fl-i { width: 28px; height: 28px; display: block; margin: .25rem auto; }
.cgl-fl-days b { display: block; }
.cgl-fl-tides { display: grid; gap: .4rem; }
.cgl-fl-tide-day { display: grid; grid-template-columns: 5.5rem 1fr; gap: .5rem; align-items: start; }
.cgl-fl-tide-day > span { font-weight: 600; }
.cgl-fl-tide-day ul { display: flex; flex-wrap: wrap; gap: .35rem; list-style: none; margin: 0; padding: 0; }
.cgl-fl-tide-day li { display: inline-flex; align-items: center; gap: .25rem; padding: .15rem .5rem; border-radius: 6px; background: #eef3f1; font-size: .88rem; font-variant-numeric: tabular-nums; }
.cgl-fl-tide-day li.is-high { background: #e1ecf5; }
.cgl-fl-tide-day li.is-past { opacity: .5; }
.cgl-fl-credits { font-size: .78rem; color: var(--muted, #55665f); border-top: 1px solid var(--line, #e4e0d5); padding-top: .6rem; }
.cgl-fl-i { vertical-align: middle; }

/* Team deck: two-sided cards (portrait front, story on the back), as on the Stratus demo. */
.cgl-fl-team { display: grid; gap: .9rem; }
.tfinder { display: flex; flex-wrap: wrap; gap: .45rem; }
.tchip { font: inherit; font-size: .85rem; font-weight: 500; padding: .45em 1em; min-height: 40px; border-radius: 99px; border: 1px solid var(--line, #d9d4c7); background: transparent; color: var(--ink, #10302c); cursor: pointer; transition: background .2s, border-color .2s, color .2s; }
.tchip:hover { border-color: var(--sea, #1d4842); }
.tchip.is-on { background: var(--sea, #1d4842); border-color: var(--sea, #1d4842); color: var(--sand-soft, #f1e5c8); font-weight: 600; }
.tfinder__hint { margin: 0; }
.cgl-fl-team { container-type: inline-size; }
.tgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(10px, 1.4vw, 18px); }
@container (min-width: 620px) { .tgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@container (min-width: 900px) { .tgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tcard { perspective: 1400px; aspect-ratio: 3 / 4; min-width: 0; transition: opacity .4s, transform .4s, filter .4s; }
.tcard.is-off { display: none; }
.tcard__in { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .8s cubic-bezier(.2,.75,.2,1); }
@media (hover: hover) {
	.tcard:hover .tcard__in { transform: rotateY(180deg); }
}
.tcard:focus-within .tcard__in, .tcard.is-flip .tcard__in { transform: rotateY(180deg); }
.tcard__f, .tcard__b { position: absolute; inset: 0; border-radius: 12px; overflow: hidden; -webkit-backface-visibility: hidden; backface-visibility: hidden; border: 1px solid rgba(16,48,44,.18); }
.tcard__f { background: var(--sea, #1d4842); }
.tcard__f > img, .tcard__f > svg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.tcard__f > img { filter: grayscale(1) contrast(1.04); transition: filter .5s, transform .8s; }
.tcard:hover .tcard__f > img { filter: none; transform: scale(1.04); }
.tcard__f::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 38%, rgba(16,48,44,.55) 66%, rgba(16,48,44,.95) 100%); }
.tcard__fb { position: absolute; left: 0; right: 0; bottom: 0; padding: 1rem 1.05rem; z-index: 2; color: #fff; }
.tcard__sec { display: block; font-size: .64rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--sand, #d8b676); margin-bottom: .35rem; }
.tcard__nm { font-family: var(--sans, inherit); font-size: 1.05rem; font-weight: 600; line-height: 1.2; margin: 0; color: inherit; letter-spacing: -.01em; }
.tcard__rl { margin: .2rem 0 0; font-size: .82rem; line-height: 1.35; opacity: .85; }
.tcard__fb .cgl-fl-example { margin-top: .45rem; }
.tcard__hint { position: absolute; top: .8rem; right: .8rem; z-index: 2; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; border: 1px solid rgba(241,229,200,.4); background: rgba(16,48,44,.45); color: var(--sand, #d8b676); }
.tcard__hint svg { width: 13px; height: 13px; }
.tcard__b { transform: rotateY(180deg); background: linear-gradient(155deg, var(--sea, #1d4842), var(--ink, #10302c)); color: #f4efe2; padding: 1.05rem 1.05rem 1rem; display: flex; flex-direction: column; border-color: rgba(216,182,118,.35); pointer-events: none; }
.tcard__b::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(90% 60% at 100% 0%, rgba(216,182,118,.18), transparent 62%); }
.tcard__since { font-size: .64rem; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; color: var(--sand, #d8b676); margin: 0 0 .5rem; }
.tcard__s { margin: .6rem 0 0; font-size: .86rem; line-height: 1.5; opacity: .88; }
.tcard__act { display: flex; align-items: center; gap: .5rem; margin-top: auto; padding-top: .8rem; position: relative; }
.tcard__btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 40px; padding: .5em .8em; border-radius: 99px; border: 0; background: var(--sand, #d8b676); color: var(--ink, #10302c); font: inherit; font-size: .8rem; font-weight: 600; cursor: pointer; }
.tcard__btn svg { width: 13px; height: 13px; }
.tcard__ic { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 10px; border: 1px solid rgba(241,229,200,.35); color: #f4efe2; }
.tcard__ic:hover, .tcard__ic:focus-visible { color: var(--sand, #d8b676); border-color: var(--sand, #d8b676); }
.tcard__ic svg { width: 17px; height: 17px; }
.tcard:focus-within .tcard__b, .tcard.is-flip .tcard__b { pointer-events: auto; }
@media (hover: hover) { .tcard:hover .tcard__b { pointer-events: auto; } .tcard:hover .tcard__f { pointer-events: none; } }
.tcard:focus-within .tcard__f, .tcard.is-flip .tcard__f { pointer-events: none; }
@media (max-width: 520px) {
	.tgrid { gap: 10px; }
	.tcard__fb { padding: .75rem .7rem; }
	.tcard__nm { font-size: .9rem; }
	.tcard__rl { font-size: .74rem; }
	.tcard__sec, .tcard__since { font-size: .56rem; letter-spacing: .1em; }
	.tcard__b { padding: .8rem .75rem .75rem; overflow-y: auto; }
	.tcard__s { font-size: .76rem; line-height: 1.42; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
	.tcard__btn { font-size: .72rem; padding: .45em .5em; min-height: 36px; }
	.tcard__ic { width: 36px; height: 36px; }
	.tcard__hint { width: 26px; height: 26px; top: .55rem; right: .55rem; }
}
@media (max-width: 340px) { .tgrid { grid-template-columns: 1fr; } .tcard { aspect-ratio: 4 / 3.6; } }
@media (prefers-reduced-motion: reduce) {
	.tcard__in { transition: none; }
	.tcard:hover .tcard__in, .tcard:focus-within .tcard__in, .tcard.is-flip .tcard__in { transform: none; }
	.tcard { aspect-ratio: auto; perspective: none; }
	.tcard__f { position: relative; aspect-ratio: 3 / 4; }
	.tcard__b { position: static; transform: none; backface-visibility: visible; margin-top: .5rem; pointer-events: auto; }
}
/* Full profile dialog. */
.cgl-fl-pdlg { border: 0; border-radius: 14px; padding: 0; width: min(860px, 92vw); max-height: 88vh; background: var(--surface, #fff); color: var(--ink, #10302c); box-shadow: 0 30px 80px rgba(16,48,44,.35); }
.cgl-fl-pdlg::backdrop { background: rgba(16,48,44,.7); backdrop-filter: blur(4px); }
.cgl-fl-pdlg__in { display: grid; grid-template-columns: 240px 1fr; gap: clamp(1.2rem, 3vw, 2.2rem); padding: clamp(1.2rem, 3vw, 2.2rem); overflow: auto; max-height: 88vh; }
.pdlg__ph { position: relative; border-radius: 12px; overflow: hidden; aspect-ratio: 3 / 4; background: var(--sea, #1d4842); align-self: start; }
.pdlg__ph > img, .pdlg__ph > svg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pdlg__nm { margin: 0; font-size: clamp(1.6rem, 3vw, 2.1rem); }
.pdlg__r { margin: .3rem 0 .6rem; color: var(--sea-2, #285a52); font-weight: 600; }
.pdlg__tx .tcard__since { color: #8a6a2a; }
.pdlg__tx p { line-height: 1.6; }
.cgl-fl-pdlg__x { position: absolute; top: .6rem; right: .7rem; z-index: 3; width: 44px; height: 44px; border-radius: 50%; font-size: 1.6rem; line-height: 1; border: 1px solid var(--line, #d9d4c7); background: #fff; color: var(--ink, #10302c); cursor: pointer; }
@media (max-width: 700px) { .cgl-fl-pdlg__in { grid-template-columns: 1fr; } .pdlg__ph { max-width: 180px; } }

@media (min-width: 900px) {
	.cgl-fl-drawer__in { padding: 1.4rem 1.6rem; }
	.cgl-fl-cols { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
	.cgl-fl-cols > * + * { margin-top: 0; }
}
@media (max-width: 480px) {
	.cgl-fl-days li { padding: .5rem .25rem; font-size: .82rem; }
	.cgl-fl-tide-day { grid-template-columns: 1fr; gap: .25rem; }
}
@media (prefers-reduced-motion: reduce) {
	.cgl-fl-drawer, .facility__panel { transition: none !important; }
}
