/* Accelerated Core – Communication Board Maker. Builds on schedule.css (shared .abatc-vs styles). */

/* Word-type colors (Fitzgerald Key) */
.abatc-cb, .abatc-cb-print, .abatc-cb__talk, .abatc-cb__dialog {
	--t-people: #E3B100; --t-people-bg: #FFF7D6;
	--t-action: #2E9E4F; --t-action-bg: #E5F5EA;
	--t-describe: #2F6FD6; --t-describe-bg: #E6EEFB;
	--t-thing: #EA7A1A; --t-thing-bg: #FDEEDD;
	--t-social: #D64B93; --t-social-bg: #FCE7F2;
	--t-question: #7C4DDB; --t-question-bg: #EFE8FD;
	--t-no: #D93636; --t-no-bg: #FDE6E6;
}
:is(.abatc-cb, .abatc-cb-print, .abatc-cb__talk, .abatc-cb__dialog) .t-people { --c: var(--t-people); --bg: var(--t-people-bg); }
:is(.abatc-cb, .abatc-cb-print, .abatc-cb__talk, .abatc-cb__dialog) .t-action { --c: var(--t-action); --bg: var(--t-action-bg); }
:is(.abatc-cb, .abatc-cb-print, .abatc-cb__talk, .abatc-cb__dialog) .t-describe { --c: var(--t-describe); --bg: var(--t-describe-bg); }
:is(.abatc-cb, .abatc-cb-print, .abatc-cb__talk, .abatc-cb__dialog) .t-thing { --c: var(--t-thing); --bg: var(--t-thing-bg); }
:is(.abatc-cb, .abatc-cb-print, .abatc-cb__talk, .abatc-cb__dialog) .t-social { --c: var(--t-social); --bg: var(--t-social-bg); }
:is(.abatc-cb, .abatc-cb-print, .abatc-cb__talk, .abatc-cb__dialog) .t-question { --c: var(--t-question); --bg: var(--t-question-bg); }
:is(.abatc-cb, .abatc-cb-print, .abatc-cb__talk, .abatc-cb__dialog) .t-no { --c: var(--t-no); --bg: var(--t-no-bg); }
.abatc-cb.is-plain .abatc-cb__cell, .abatc-cb__talk.is-plain .abatc-cb__tcell, .abatc-cb__edpic.is-plain, .abatc-cb__talk.is-plain .abatc-cb__chip { --c: var(--vs-line, #CFE3DE); --bg: #fff; }

/* My boards + new board */
.abatc-cb__top { display: grid; gap: .75rem; }
.abatc-cb__boards .abatc-vs__label { margin-bottom: .45rem; }
.abatc-cb__boardchip[aria-pressed="true"] { background: var(--vs-deep); border-color: var(--vs-deep); color: #fff !important; }
.abatc-cb__new { background: #fff; border: 1px solid var(--vs-line); border-radius: var(--vs-r); padding: 1rem 1.1rem 1.1rem; }
.abatc-cb__new .abatc-vs__hint { margin: 0 0 .7rem; }
.abatc-cb__tpls { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; }
.abatc-cb .abatc-cb__tpl { display: grid; gap: .3rem; justify-items: start; text-align: left; border: 1.5px solid var(--vs-line); background: var(--vs-mist); border-radius: 14px; padding: .7rem .8rem; }
.abatc-cb__tpl:hover:not(:disabled) { border-color: var(--vs-sea); background: #fff; }
.abatc-cb__tplpics { display: flex; gap: 2px; min-height: 28px; align-items: center; }
.abatc-cb__tplplus { display: grid; place-items: center; width: 28px; height: 28px; border: 1.5px dashed var(--vs-line); border-radius: 8px; color: var(--vs-sea); font-weight: 800; }
.abatc-cb__tplname { font-weight: 700; color: var(--vs-deep); line-height: 1.2; }
.abatc-cb__tplsize { font-size: .82rem; color: var(--vs-muted); }

/* Library cards get a thin color edge so parents learn the code */
.abatc-cb .abatc-cb__libcard { box-shadow: inset 0 -4px 0 var(--c, transparent); }

/* Options */
.abatc-cb__select { border: 1.5px solid var(--vs-line); border-radius: 10px; padding: .45rem .6rem; font: inherit; font-size: .9rem; font-weight: 600; background: var(--vs-mist); color: var(--vs-ink); max-width: 100%; }
.abatc-cb__select:focus { border-color: var(--vs-sea); outline: none; box-shadow: 0 0 0 3px rgba(37, 157, 145, .2); }
.abatc-cb__options .abatc-vs__opt { display: grid; gap: .3rem; }
.abatc-cb__options .abatc-vs__label { margin: 0; }
.abatc-cb__voicenote, .abatc-cb__outside { background: #FFF7E0; border: 1px solid #F1D48A; color: #6B4E00; border-radius: 12px; padding: .6rem .85rem; margin: 0 0 1rem; font-size: .9rem; }
.abatc-cb__outside { margin: .75rem 0 0; }

/* Edit grid */
.abatc-cb__gridwrap { container-type: inline-size; }
.abatc-cb__grid { display: grid; gap: clamp(4px, 1.1cqw, 8px); }
.abatc-cb__row { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: inherit; }
.abatc-cb__cell {
	--cellw: calc((100cqw - (var(--cols) - 1) * 6px) / var(--cols));
	position: relative; aspect-ratio: 1 / 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2%;
	padding: 7% 5% 6%; border: clamp(2px, calc(var(--cellw) * .035), 4px) solid var(--c, var(--vs-line)); background: var(--bg, #fff);
	border-radius: clamp(8px, calc(var(--cellw) * .12), 16px); overflow: hidden; transition: transform .1s ease, box-shadow .12s ease;
}
.abatc-cb__cell:hover { transform: translateY(-1px); box-shadow: 0 6px 14px -8px rgba(22, 91, 84, .5); }
.abatc-cb__cell.is-empty { border: 2px dashed var(--vs-line); background: var(--vs-mist); }
.abatc-cb__cell.is-empty:hover { border-color: var(--vs-sea); }
.abatc-cb__cell.is-sel { outline: 3px solid var(--vs-deep); outline-offset: 2px; box-shadow: 0 0 0 7px rgba(37, 157, 145, .18); }
.abatc-cb__cell.is-over { outline: 3px dashed var(--vs-sea); outline-offset: 2px; }
.abatc-cb__cell[draggable="true"] { cursor: grab; }
.abatc-cb__plus { font-size: calc(var(--cellw) * .32); font-weight: 300; color: #9fb8b3; line-height: 1; }
.abatc-cb__pic { position: relative; flex: 1 1 0; min-height: 0; width: 100%; display: grid; place-items: center; }
.abatc-cb__pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.abatc-cb__pic.is-photo img { object-fit: cover; border-radius: 10%; }
.abatc-cb__pic.is-text { font-weight: 800; color: var(--vs-deep); font-size: clamp(.7rem, calc(var(--cellw) * .2), 1.6rem); line-height: 1.1; text-align: center; overflow-wrap: anywhere; }
.abatc-cb__w, .abatc-cb__w2 { flex: none; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.15; text-align: center; }
.abatc-cb__w { font-weight: 800; font-size: clamp(.6rem, calc(var(--cellw) * .15), 1.15rem); color: var(--vs-ink); }
.abatc-cb__w2 { font-weight: 600; font-size: clamp(.55rem, calc(var(--cellw) * .11), .9rem); color: var(--vs-muted); }
.abatc-cb__recdot { position: absolute; top: 5%; right: 5%; width: 9px; height: 9px; border-radius: 50%; background: #D93636; box-shadow: 0 0 0 2px #fff; }
.abatc-cb__recdot.is-live { position: static; display: inline-block; margin-right: .45rem; animation: abatc-cb-blink 1s infinite; }
@keyframes abatc-cb-blink { 50% { opacity: .25; } }

/* Square editor */
.abatc-cb__editor { margin-top: 1rem; border: 1.5px solid var(--vs-sea); border-radius: var(--vs-r); padding: 1rem; background: var(--vs-mist); scroll-margin: 90px; }
.abatc-cb__edhead { display: flex; justify-content: space-between; align-items: center; margin-bottom: .75rem; }
.abatc-cb__edhead .abatc-vs__h { font-size: 1.05rem; }
.abatc-cb__edmain { display: grid; grid-template-columns: 116px minmax(0, 1fr); gap: 1rem; align-items: start; }
.abatc-cb__edleft { display: grid; gap: .5rem; }
.abatc-cb__edpic { width: 116px; height: 116px; display: grid; place-items: center; padding: 12px; border: 4px solid var(--c, var(--vs-line)); background: var(--bg, #fff); border-radius: 16px; }
.abatc-cb__edpic img { width: 100%; height: 100%; object-fit: contain; }
.abatc-cb__edpic img.is-photo { object-fit: cover; border-radius: 8px; }
.abatc-cb__edtext { font-weight: 800; color: var(--vs-deep); text-align: center; overflow-wrap: anywhere; }
.abatc-cb .abatc-cb__change { padding: .5rem .7rem; font-size: .88rem; }
.abatc-cb__edright { display: grid; gap: .6rem; min-width: 0; }
.abatc-cb__edwords input { background: #fff; border-color: var(--vs-line); }
.abatc-cb__edright > .abatc-vs__label { margin: .15rem 0 -.25rem; }
.abatc-cb__types { display: flex; flex-wrap: wrap; gap: .35rem; }
.abatc-cb .abatc-cb__type { display: inline-flex; align-items: center; gap: .35rem; border: 1.5px solid var(--vs-line); background: #fff; border-radius: 999px; padding: .28rem .65rem .28rem .4rem; font-size: .82rem; font-weight: 600; color: var(--vs-muted) !important; }
.abatc-cb__type:hover { border-color: var(--c); }
.abatc-cb__type[aria-checked="true"] { border-color: var(--c); background: var(--bg); color: var(--vs-ink) !important; box-shadow: inset 0 0 0 1px var(--c); }
.abatc-cb__swatch { width: 14px; height: 14px; border-radius: 50%; background: var(--c); }
.abatc-cb__recrow { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; }
.abatc-cb__recrow .abatc-vs__btn { padding: .5rem .9rem; font-size: .9rem; }
.abatc-cb__recrow .abatc-vs__btn.is-rec { border-color: #D93636; color: #B42318 !important; background: #fff; }
.abatc-cb__edfoot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem; padding-top: .55rem; border-top: 1px solid var(--vs-line); }
.abatc-cb__move { display: flex; align-items: center; gap: 3px; }
.abatc-cb__move .abatc-vs__label { margin: 0 .4rem 0 0; }
.abatc-cb__move button { width: 2.2rem; height: 2.2rem; border: 1.5px solid var(--vs-line); background: #fff; border-radius: 8px; font-weight: 800; color: var(--vs-deep) !important; }
.abatc-cb__move button:hover:not(:disabled) { border-color: var(--vs-sea); }
.abatc-cb__remove:hover { color: #B42318 !important; }
.abatc-cb .abatc-cb__talkbtn { font-size: 1.05rem; }

@media (max-width: 520px) {
	.abatc-cb__edmain { grid-template-columns: 1fr; }
	.abatc-cb__edleft { grid-template-columns: 96px 1fr; align-items: center; }
	.abatc-cb__edpic { width: 96px; height: 96px; }
	.abatc-cb__options { gap: .7rem 1rem; }
	.abatc-cb__tpls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ------------------------------------------------------------ *
 * Talk mode (full screen)
 * ------------------------------------------------------------ */
html.abatc-cb-talking, html.abatc-cb-talking body { overflow: hidden !important; }
.abatc-cb__talk {
	position: fixed; inset: 0; z-index: 100000; display: flex; flex-direction: column; gap: 1.2vmin;
	padding: max(1.2vmin, env(safe-area-inset-top)) max(1.2vmin, env(safe-area-inset-right)) max(1.2vmin, env(safe-area-inset-bottom)) max(1.2vmin, env(safe-area-inset-left));
	background: #EEF3F2; color: #17332F; font-family: "Open Sauce Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	-webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: manipulation;
}
.abatc-cb__talk *, .abatc-cb__talk *::before, .abatc-cb__talk *::after { box-sizing: border-box; }
:where(.abatc-cb__talk) button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.abatc-cb__talk button:disabled { opacity: .35; cursor: default; }
.abatc-cb__talk :focus-visible { outline: 3px solid #165B54; outline-offset: 2px; }
.abatc-cb__talkbar { flex: none; display: flex; gap: 1vmin; height: clamp(56px, 13vmin, 120px); }
.abatc-cb__strip { flex: 1; min-width: 0; display: flex; align-items: center; gap: 1vmin; overflow-x: auto; overflow-y: hidden; border: 2px solid #CFE3DE; background: #fff; border-radius: 2vmin; padding: 1vmin; text-align: left; scrollbar-width: none; }
.abatc-cb__strip::-webkit-scrollbar { display: none; }
.abatc-cb__strip.is-say { animation: abatc-cb-say .5s ease; }
@keyframes abatc-cb-say { 30% { background: #E4F1EE; border-color: #259D91; } }
.abatc-cb__striphint { color: #7f9692; font-weight: 600; font-size: clamp(.85rem, 2.4vmin, 1.2rem); padding: 0 1vmin; }
.abatc-cb__chip { flex: none; height: 100%; min-width: clamp(44px, 10.5vmin, 98px); max-width: 26vmin; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2%; padding: .6vmin; border: 2px solid var(--c, #CFE3DE); background: var(--bg, #fff); border-radius: 1.4vmin; font-weight: 800; font-size: clamp(.6rem, 1.9vmin, 1rem); line-height: 1.1; text-align: center; overflow: hidden; }
.abatc-cb__chip img { flex: 1 1 0; min-height: 0; width: 80%; height: 0; object-fit: contain; }
.abatc-cb__chip img.is-photo { object-fit: cover; border-radius: 6px; }
.abatc-cb__chip span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.abatc-cb__tbtn { flex: none; width: clamp(52px, 12vmin, 110px); border: 2px solid #CFE3DE; background: #fff; border-radius: 2vmin; font-size: clamp(1.3rem, 5vmin, 2.6rem); font-weight: 800; color: #165B54 !important; display: grid; place-items: center; }
.abatc-cb__tbtn.is-say { background: #259D91; border-color: #259D91; color: #fff !important; }
.abatc-cb__tbtn:active:not(:disabled) { transform: scale(.96); }

.abatc-cb__talkgrid { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); grid-template-rows: repeat(var(--rows), minmax(0, 1fr)); gap: 1vmin; container-type: size; }
.abatc-cb__tcell {
	--cw: calc(100cqw / var(--cols)); --ch: calc(100cqh / var(--rows)); --cm: min(var(--cw), var(--ch));
	min-width: 0; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3%;
	padding: calc(var(--cm) * .07); border: max(3px, calc(var(--cm) * .04)) solid var(--c, #CFE3DE); background: var(--bg, #fff); border-radius: calc(var(--cm) * .12);
	transition: transform .08s ease; overflow: hidden;
}
.abatc-cb__tcell.is-empty { background: transparent; border: 0; }
.abatc-cb__tcell:active { transform: scale(.95); }
.abatc-cb__tcell.is-tap { animation: abatc-cb-tap .45s ease; }
@keyframes abatc-cb-tap { 25% { transform: scale(.93); box-shadow: 0 0 0 calc(var(--cm) * .06) var(--c, #259D91); } }
.abatc-cb__tcell .abatc-cb__pic { width: 100%; }
.abatc-cb__tcell .abatc-cb__pic.is-text { font-size: calc(var(--cm) * .2); }
.abatc-cb__tcell .abatc-cb__w { font-size: calc(var(--cm) * .14); color: #17332F; }
.abatc-cb__tcell .abatc-cb__w2 { font-size: calc(var(--cm) * .1); color: #4E6965; }

.abatc-cb__talkfoot { flex: none; display: flex; justify-content: space-between; align-items: center; gap: 1rem; min-height: 40px; }
.abatc-cb__switch { display: flex; gap: .35rem; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.abatc-cb__switch button { flex: none; border: 1.5px solid #CFE3DE; background: #fff; border-radius: 999px; padding: .4rem .9rem; font-weight: 700; font-size: .88rem; color: #165B54 !important; }
.abatc-cb__switch button[aria-pressed="true"] { background: #165B54; border-color: #165B54; color: #fff !important; }
.abatc-cb__talkctl { display: flex; gap: .4rem; margin-left: auto; flex: none; }
.abatc-cb__speaktoggle, .abatc-cb__exit { border: 1.5px solid #CFE3DE; background: #fff; border-radius: 999px; padding: .4rem .9rem; font-weight: 700; font-size: .85rem; color: #4E6965 !important; }
.abatc-cb__exit { position: relative; display: inline-flex; align-items: center; gap: .45rem; touch-action: none; }
.abatc-cb__exitring { width: 16px; height: 16px; border-radius: 50%; border: 2px solid #CFE3DE; background: conic-gradient(#259D91 var(--p, 0%), transparent 0); }
.abatc-cb__exit.is-holding .abatc-cb__exitring { animation: abatc-cb-hold .9s linear forwards; }
@property --p { syntax: "<percentage>"; inherits: false; initial-value: 0%; }
@keyframes abatc-cb-hold { to { --p: 100%; } }
@media (max-width: 600px) {
	.abatc-cb__talkfoot { flex-wrap: wrap; gap: .4rem; }
	.abatc-cb__speaktoggle, .abatc-cb__exit { padding: .35rem .7rem; font-size: .8rem; }
}

/* ------------------------------------------------------------ *
 * Printed board (shares .vsp-page rules from schedule.css)
 * ------------------------------------------------------------ */
.cbp-board .vsp-inner { padding: 5cqw 5cqw 3cqw; }
.vsp-landscape.cbp-board .vsp-inner { padding: 3.5cqw 3.5cqw 2cqw; }
.cbp-board .vsp-head { margin-bottom: 2.5cqw; }
.vsp-landscape.cbp-board .vsp-head { margin-bottom: 1.6cqw; }
.vsp-landscape.cbp-board .vsp-head h2 { font-size: 3.6cqw; }
.cbp-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); grid-template-rows: repeat(var(--rows), minmax(0, 1fr)); gap: 1.6cqw; container-type: size; }
.vsp-landscape .cbp-grid { gap: 1.1cqw; }
.cbp-cell {
	--cm: min(calc(100cqw / var(--cols)), calc(100cqh / var(--rows)));
	min-width: 0; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
	border: calc(var(--cm) * .045) solid var(--c, #CFE3DE); background: var(--bg, #fff); border-radius: calc(var(--cm) * .1); padding: calc(var(--cm) * .07) calc(var(--cm) * .05) calc(var(--cm) * .05); overflow: hidden;
}
.cbp-cell.is-empty { border: calc(var(--cm) * .02) dashed #CFE3DE; background: #fff; }
.cbp-cell .vsp-pic { flex: 1 1 0; min-height: 0; width: 100%; }
.cbp-cell .vsp-pic.is-photo { border-radius: calc(var(--cm) * .06); overflow: hidden; }
.cbp-cell .vsp-pic.is-text { font-size: calc(var(--cm) * .18); }
.cbp-cell .vsp-words { flex: none; padding-top: calc(var(--cm) * .03); text-align: center; width: 100%; font-size: calc(var(--cm) * .14); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cbp-cell .vsp-words:empty { padding: 0; }
.cbp-cell .vsp-en, .cbp-cell .vsp-fil { overflow: hidden; text-overflow: ellipsis; }
.cbp-plain .cbp-cell, .cbp-plain .cbp-card { --c: #CFE3DE; --bg: #fff; }
.cbp-strip { flex: none; display: flex; align-items: center; gap: 1.6cqw; margin-top: 2.4cqw; border: .4cqw solid #CFE3DE; border-radius: 2cqw; padding: 1.4cqw 1.6cqw; }
.vsp-landscape .cbp-strip { margin-top: 1.4cqw; padding: 1cqw 1.2cqw; gap: 1.1cqw; }
.cbp-striplabel { flex: none; font-weight: 800; color: var(--p-deep, #165B54); font-size: 2.6cqw; }
.vsp-landscape .cbp-striplabel { font-size: 1.8cqw; }
.cbp-slot { flex: 1; aspect-ratio: 1; max-height: 12cqw; border: .35cqw dashed #9fb8b3; border-radius: 1.4cqw; }
.vsp-landscape .cbp-slot { max-height: 7.5cqw; }
/* Cut-out cards: a colored frame inside each card */
.vsp-cards .cbp-card:not(.is-empty)::before { content: ""; position: absolute; inset: 1.6cqw; border: 1cqw solid var(--c, #CFE3DE); background: var(--bg, #fff); border-radius: 2.4cqw; z-index: 0; }
.vsp-cards .cbp-card > * { position: relative; z-index: 1; }
.vsp-cards .cbp-card { padding: 4.2cqw 3.6cqw 3.4cqw; }
.vsp-cards .cbp-card .vsp-words { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Icons */
.abatc-cb__ico { display: inline-grid; place-items: center; line-height: 0; }
.abatc-cb__ico svg { width: 1.15em; height: 1.15em; }
.abatc-vs__btn .abatc-cb__ico { margin-right: .4rem; vertical-align: -.15em; }
.abatc-cb__tbtn .abatc-cb__ico svg { width: .9em; height: .9em; }
.abatc-cb__speaktoggle { display: inline-flex; align-items: center; gap: .4rem; }
.abatc-cb__change { white-space: nowrap; }
