/* Shared component finish, loaded after page layouts on every document.
   Palette, typography and geometry values belong to tokens.css. */
/* Native CSS interpretation of Magic UI's Shimmer Button / Shine Border patterns:
   https://magicui.design/docs/components/shimmer-button
   https://magicui.design/docs/components/shine-border
   Cues repeat while an action is available; no runtime dependency. */
@property --journey-angle{syntax:"<angle>";initial-value:0deg;inherits:false}
.journey-shimmer,.journey-shine{position:relative}
.journey-shimmer::before,.journey-shine::before{
  content:"";position:absolute;inset:-1px;border-radius:inherit;padding:2px;
  pointer-events:none;
  -webkit-mask:linear-gradient(currentColor 0 0) content-box,linear-gradient(currentColor 0 0);
  -webkit-mask-composite:xor;
  mask:linear-gradient(currentColor 0 0) content-box,linear-gradient(currentColor 0 0);
  mask-composite:exclude;
}
.journey-shimmer::before{
  background:conic-gradient(from var(--journey-angle),transparent 0% 65%,var(--cue-cool) 76%,var(--cue-glint) 85%,var(--cue-warm) 94%,transparent);
  animation:journey-orbit 2.8s linear infinite;opacity:.95;
}
.journey-shine::before{
  padding:1px;opacity:.65;background:linear-gradient(115deg,var(--cue-warm),transparent 30% 45%,var(--cue-cool) 55%,var(--cue-glint) 65%,transparent 80%,var(--cue-warm));
  background-size:250% 250%;background-position:100% 50%;animation:journey-border 3.8s ease-in-out infinite alternate;
}
.journey-circle-cue::before,.journey-circle-cue .journey-shimmer::before{animation-delay:.65s}
.journey-on-intent::before{animation:none;opacity:0}
.journey-on-intent:is(:hover,:focus-visible)::before{animation:journey-orbit 2.8s linear infinite;opacity:.95}
.journey-shimmer:is(:disabled,[aria-disabled="true"],[aria-busy="true"])::before{display:none;animation:none}
@keyframes journey-orbit{to{--journey-angle:360deg}}
@keyframes journey-border{from{background-position:0% 50%}to{background-position:100% 50%}}
@media(prefers-reduced-motion:reduce){
  .journey-shimmer::before,.journey-shine::before,
  .journey-on-intent:is(:hover,:focus-visible)::before{animation:none}
}
@media(forced-colors:active){.journey-shimmer::before,.journey-shine::before{display:none}}

.workspace body{color:var(--text-body);background-color:var(--surface-page)}
.workspace :is(.btn,.primary,.secondary,.back){font-family:var(--font-interface)}
.workspace .btn,.workspace .ui-compact .btn,.workspace .maagal-game :is(.primary,.secondary,.back){border-radius:var(--radius-pill);box-shadow:none}
.workspace .btn-primary,.workspace .ui-compact .btn-primary,.workspace .maagal-game .primary{
  background:var(--action-primary);border-color:var(--action-primary);color:var(--text-on-primary);box-shadow:var(--elevation-workspace-action)
}
.workspace .btn-primary:hover:not(:disabled),.workspace .maagal-game .primary:hover:not(:disabled){background:var(--action-primary-hover);color:var(--text-on-primary)}
.workspace :is(.btn-secondary,.btn-tertiary),.workspace .ui-compact :is(.btn-secondary,.btn-tertiary),.workspace .maagal-game :is(.secondary,.back){background:var(--surface-card);border-color:var(--border-strong);color:var(--text-body)}
.workspace :is(.btn-secondary,.btn-tertiary):hover:not(:disabled),.workspace .maagal-game :is(.secondary,.back):hover:not(:disabled){background:var(--surface-card-mist)}
.workspace .btn:disabled,.workspace .maagal-game :is(.primary,.secondary):disabled{background:var(--action-disabled);color:var(--action-disabled-text);box-shadow:none;cursor:not-allowed}
.workspace .btn:active{transform:none}
.workspace :is(.card,.empty-state),.workspace .ui-compact :is(.card,.empty-state){border:1px solid var(--border-subtle);border-radius:var(--radius-workspace-panel);box-shadow:var(--elevation-workspace)}
.workspace .card .card,.workspace .ui-compact .card .card{border-radius:var(--radius-workspace-inset);box-shadow:none}
.workspace :is(.input,.select,.textarea,.select-trigger),.workspace .ui-compact :is(.input,.select,.textarea,.select-trigger){border-color:var(--border-strong);border-radius:var(--radius-workspace-control);background:var(--surface-card);color:var(--text-body)}
.workspace :is(.input,.select,.textarea):focus{border-color:var(--focus-ring)}
.workspace :is(button,a,input,textarea,select,summary,[tabindex]):focus-visible{outline:3px solid var(--focus-ring);outline-offset:3px}
.workspace :is(.modal,.auth-modal,.admin-modal.ui-compact,.tour-pop),.workspace .ui-compact .modal{border:1px solid var(--border-subtle);border-radius:var(--radius-workspace-panel);background:var(--surface-card);color:var(--text-body)}
.workspace :is(.select-menu,.panel-menu){border-radius:var(--radius-workspace-inset)}
.workspace :is(.select-option,.panel-menu-item),.workspace .ui-compact :is(.select-option,.panel-menu-item){border-radius:var(--radius-workspace-control)}
.workspace :is(.panel-link,.panel-sublink){border-radius:var(--radius-workspace-control)}
.workspace :is(.panel-link,.panel-sublink).is-current{background:var(--selection-surface);color:var(--selection-text)}
.workspace .panel-avatar-face{background:var(--selection-surface);color:var(--selection-text)}
.workspace .tour-spot{border-radius:var(--radius-workspace-control);box-shadow:0 0 0 9999px var(--scrim-overlay),0 0 0 2px var(--focus-ring)}
.workspace :is(.cal-filter-chip,.cal-view-toggle button,.admin-view-tab,.segmented button){border-radius:var(--radius-pill)}
.workspace :is(.cal-filter-chip,.cal-view-toggle button,.admin-view-tab)[aria-pressed="true"],.workspace .segmented button[aria-pressed="true"]{background:var(--selection-surface);border-color:var(--selection-border);color:var(--selection-text)}
.workspace :is(.cal-view-toggle,.admin-view-switch,.segmented){border-radius:var(--radius-workspace-inset);background:var(--surface-card-mist);padding:4px;gap:4px}
.workspace .b-gold{background:var(--selection-surface);color:var(--selection-text);border-color:var(--border-subtle)}

/* Common page introduction: the same illustrated heading used by card tools. */
.workspace-heading{display:flex;align-items:center;gap:var(--space-lg);min-width:0}
.workspace-heading>.ic{flex:none;width:48px;height:48px}
.workspace-heading h1{margin:0;font:var(--text-ui-page-title);letter-spacing:-.025em}
.workspace-heading p{margin:var(--space-xs) 0 0;color:var(--text-muted);font:var(--text-ui-body)}

/* Calendar: a paper schedule and a separate, readable booking panel. */
.workspace .calendar-page{padding-block:var(--space-xl);}
.workspace .calendar-page-head{gap:var(--space-lg);margin-bottom:var(--space-lg)}
.workspace .calendar-page-head h1{max-width:32ch}
.workspace .calendar-zone{flex-wrap:wrap}
.workspace .calendar-page .cal-toolbar{gap:var(--space-md);margin-bottom:var(--space-lg)}
.workspace .cal-wrap{gap:var(--space-lg);grid-template-columns:minmax(0,1fr) minmax(270px,310px)}
.workspace .cal-grid-card{padding:var(--space-md);overflow:hidden}
.workspace .cal-agenda{padding-inline:var(--space-xs)}
.workspace .cal-agenda-day{padding-block:var(--space-md)}
.workspace .cal-agenda-event{padding:var(--space-md);border-radius:var(--radius-workspace-control)}
.workspace .cal-agenda-event:hover,.workspace .cal-agenda-event.sel{border-color:var(--selection-border);box-shadow:0 0 0 1px var(--selection-border)}
.workspace .cal-agenda-event.sel{border-inline-start:4px solid var(--selection-border)}
.workspace .cal-agenda-day.is-today>header strong{color:var(--selection-border)}
.workspace .calendar-page .cal-ev,.workspace .admin-schedule-scroll .cal-ev{border-radius:var(--radius-workspace-control);border-color:var(--border-strong)}
.workspace .calendar-page .cal-ev.sel{border-color:var(--selection-border);box-shadow:inset 4px 0 0 var(--selection-border)}
.workspace .cal-detail{padding:var(--space-lg)}
.workspace .cal-detail :is(.btn,.row){overflow-wrap:normal;word-break:normal}
.workspace .cal-detail .btn{white-space:normal;min-height:var(--touch-target-min)}

/* Workshops keep their publishing rules; the layout shares the workspace. */
.workspace.workshops-active #wk-root{gap:var(--space-xl);padding-block:var(--space-xl)}
.workspace.workshops-active .workshops-hero .hero2-in{padding:var(--space-xl);border-radius:var(--radius-workspace-panel);box-shadow:var(--elevation-workspace);grid-template-columns:minmax(0,1fr) minmax(200px,260px)!important}
.workspace.workshops-active .workshops-hero .hero2-copy{gap:var(--space-md)}
.workspace.workshops-active .workshops-hero .stack-sm{padding:var(--space-lg);border:1px solid var(--border-subtle);border-radius:var(--radius-workspace-inset);background:var(--surface-card-mist);gap:var(--space-sm)}
.workspace.workshops-active .workshops-section .card{padding:var(--space-xl)}
.workspace.workshops-active .workshops-section .grid-2{gap:var(--space-xl)}
.workspace.workshops-active .workshops-section .grid-3{gap:var(--space-lg)}
.workspace.workshops-active .workshops-empty .card{padding:var(--space-xl)!important;background:var(--study-comfortable-surface)}
.workspace.workshops-active .workshops-cta .cband-in{padding:var(--space-xl);background:var(--surface-card);border:1px solid var(--border-subtle);border-radius:var(--radius-workspace-panel);color:var(--text-body);box-shadow:var(--elevation-workspace)}
.workspace.workshops-active .workshops-cta :is(.headline,.intro){color:var(--text-body)}

/* Account and staff workspaces, including editors and administrative tables. */
.workspace :is(.profile-page,.admin-page){padding-block:var(--space-xl)}
.workspace .admin-console-head{align-items:flex-start;gap:var(--space-xl);padding-bottom:var(--space-lg);margin-bottom:var(--space-lg)}
.workspace .admin-console-actions{flex-wrap:wrap;gap:var(--space-sm)}
.workspace .admin-view-switch{flex-wrap:wrap}
.workspace .admin-overview{gap:var(--space-md);margin-bottom:var(--space-xl)}
.workspace :is(.insight-metric,.insight-card){border:1px solid var(--border-subtle);border-radius:var(--radius-workspace-inset);padding:var(--space-lg);background:var(--surface-card);box-shadow:var(--elevation-workspace)}
.workspace .admin-overview .insight-metric:first-child{background:var(--study-comfortable-surface)}
.workspace .admin-toolbar{margin-block:var(--space-lg)}
.workspace.admin-active .admin-table-scroll{border-radius:var(--radius-workspace-inset)}
.workspace.admin-active .admin-table td:last-child .btn{min-height:var(--touch-target-compact);padding-inline:var(--space-sm)}
.workspace .admin-modal.ui-compact{padding:var(--space-xl)}
.workspace .admin-modal .segmented button{border-radius:var(--radius-pill)}
.workspace .auth-modal .tabs{border-radius:var(--radius-workspace-inset)}
.workspace .auth-modal .tabs button{border-radius:var(--radius-pill)}
.workspace .auth-modal .tabs button[aria-selected="true"]{background:var(--selection-surface);border-color:var(--selection-border);color:var(--selection-text);box-shadow:none}
.workspace .admin-schedule-scroll .cal-ev{background:var(--selection-surface);color:var(--selection-text)}
.workspace :is(.typing-text-editor,.video-example-card){border-radius:var(--radius-workspace-panel);box-shadow:var(--elevation-workspace)}
.workspace .admin-modal-head{padding-bottom:var(--space-md);margin-bottom:var(--space-lg)}
.workspace .admin-modal :is(.preset-panel,.insight-card){border-radius:var(--radius-workspace-inset)}
.admin-weekdays{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:var(--space-xs)}
.admin-weekday{min-height:var(--touch-target-min);padding:var(--space-xs);border:1px solid var(--border-strong);border-radius:var(--radius-pill);background:var(--surface-card);color:var(--text-body);font:var(--text-ui-supporting);cursor:pointer}
.admin-weekday[aria-pressed="true"]{border-color:var(--selection-border);background:var(--selection-surface);color:var(--selection-text);font-weight:600}
.workspace .profile-tabs a{border-radius:var(--radius-pill)}
.workspace .profile-tabs a.active{background:var(--selection-surface);color:var(--selection-text);border-color:var(--selection-border)}

/* Games retain instructional tiles and Hebrew typography; their surrounding
   panels, library, settings, results and recording editors share site chrome. */
.workspace .maagal-game :is(.exercise-card,.typing-library,.typing-play,.letter-card,.friend-card,.welcome,.keyboard-invite,.knowledge-panel,.game-choice,.r-board,.game-audio-editor,.typing-dialog){border:1px solid var(--border-subtle);border-radius:var(--radius-workspace-panel);background:var(--surface-card);box-shadow:var(--elevation-workspace)}
.workspace .maagal-game :is(.passage-card,.full-text,.alphabet-explore,.game-audio-take,.typing-settings){border-radius:var(--radius-workspace-inset)}
.workspace .maagal-game .game-choice{padding:var(--space-xl);gap:var(--space-lg)}
.workspace .maagal-game .game-choice-typing{border-top:1px solid var(--border-subtle)}
.workspace .maagal-game .game-choice-typing .game-art{background:var(--study-standard-surface)}
.workspace .maagal-game .game-choice:not(.game-choice-typing) .game-art{background:var(--study-recall-surface)}
.workspace .maagal-game .game-start{min-height:var(--touch-target-min);padding-inline:var(--space-xl)}
.workspace .maagal-game .r-board{overflow:hidden}
.workspace .maagal-game .r-steps{background:var(--surface-card-mist)}
.workspace .maagal-game .r-steps [aria-current]>span{background:var(--selection-surface);border-color:var(--selection-border)}
.workspace .maagal-game .typing-dialog{padding:var(--space-xl)}
.workspace .not-found-card{padding:var(--space-xl);font-family:var(--font-interface)}
.workspace .not-found-card h1{font:var(--text-ui-page-title)}
.workspace .gate-card{background:var(--surface-card);border:1px solid var(--border-subtle);border-radius:var(--radius-workspace-panel);box-shadow:var(--elevation-workspace);color:var(--text-body)}
.workspace .gate-card h1{font:var(--text-ui-page-title);color:var(--text-heading)}
.workspace .gate-card p{font:var(--text-ui-body);color:var(--text-body)}
.workspace .gate-card .gate-hook{font:var(--text-ui-supporting);color:var(--text-muted);letter-spacing:0;text-transform:none}
.workspace.guest-stage body{background:var(--surface-page);color:var(--text-body)}
.workspace.guest-stage :is(.gstage-brand,.gstage-brand:hover,.gstage-brand b,.gstage-help,.mfoot-bar){color:var(--text-body)}
.workspace.guest-stage .gstage-help a{color:var(--text-link)}

@media(max-width:1100px){
  .workspace .cal-wrap{grid-template-columns:minmax(0,1fr)}
  .workspace .admin-console-head{flex-wrap:wrap}
}
@media(max-width:1024px){
  /* Keep the shine on its card when the booking panel stops being sticky. */
  .workspace .calendar-page #cal-detail.journey-shine{position:relative!important;top:auto!important}
}
@media(max-width:860px){
  .workspace.workshops-active .workshops-hero .hero2-in{grid-template-columns:1fr!important}
  .workspace.workshops-active .workshops-section .grid-2{grid-template-columns:1fr!important}
  .workspace.workshops-active .workshops-hero .stack-sm{border-inline-start:1px solid var(--border-subtle)}
  .workspace .cal-detail{padding:var(--space-lg)}
}
@media(max-width:600px){
  .workspace-heading{gap:var(--space-md);align-items:flex-start}
  .workspace-heading>.ic{width:40px;height:40px}
  .workspace :is(.calendar-page,.profile-page,.admin-page){padding-block:var(--space-lg)}
  .workspace .admin-console-actions{width:100%}
  .workspace .admin-view-switch{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));width:100%}
  .workspace .admin-view-tab{white-space:normal;min-height:var(--touch-target-min)}
  .workspace .admin-modal.ui-compact{padding:var(--space-lg)}
  .admin-weekdays{grid-template-columns:repeat(4,minmax(0,1fr))}
  .workspace.workshops-active :is(.workshops-hero .hero2-in,.workshops-section .card,.workshops-cta .cband-in){padding:var(--space-lg)}
  .workspace.workshops-active .workshops-cta .cband-in{align-items:stretch}
  .workspace.workshops-active .workshops-cta .btn{width:100%;white-space:normal}
  .workspace .maagal-game .typing-dialog{padding:var(--space-lg)}
}
@media(forced-colors:active){
  .workspace :is(.panel-link,.panel-sublink).is-current{outline:2px solid Highlight;outline-offset:-2px}
  .workspace :is(.cal-filter-chip,.cal-view-toggle button,.admin-view-tab)[aria-pressed="true"]{outline:2px solid Highlight;outline-offset:-2px}
}

/* Ended occurrences stay readable as history, without live booking colours. */
.workspace .cal-ev.past,
.workspace .cal-agenda-event.past,
.home-event.past,
.admin-schedule-card .cal-ev.past {
  background: var(--surface-sunken);
  color: var(--text-body);
  border-color: var(--border-subtle);
  box-shadow: none;
  opacity: 1;
  filter: grayscale(1);
}
.workspace .cal-ev.past:hover,
.workspace .cal-agenda-event.past:hover,
.admin-schedule-card .cal-ev.past:hover { filter: grayscale(1); }

/* Mobile width:auto used to collapse the unpadded week arrows to a sliver. */
.workspace .cal-week-nav .cal-nav-arrow {
  min-width: var(--touch-target-min);
  min-height: var(--touch-target-min);
  flex-shrink: 0;
}

.circle-instructor{display:flex;align-items:center;gap:8px;min-width:0;margin-block:6px;color:var(--text-body);font:var(--text-ui-caption);text-align:start}
.circle-portrait{display:grid;place-items:center;flex:0 0 28px;width:28px;height:28px;overflow:hidden;border-radius:50%;background:var(--surface-card-gold);color:var(--text-heading);border:1px solid var(--border-subtle);font-weight:600}
.circle-portrait img{display:block;width:100%;height:100%;object-fit:cover}
.circle-instructor-name{min-width:0;overflow-wrap:anywhere;line-height:1.35}
.circle-instructor-large{font:var(--text-ui-body-strong);gap:12px;margin-block:12px}
.circle-instructor-large .circle-portrait{flex-basis:48px;width:48px;height:48px}
.circle-overview{display:grid;gap:16px}
.circle-copy h3{font:var(--text-ui-body-strong);color:var(--text-heading);margin-block:0 6px}
.circle-copy p,.circle-copy li{font:var(--text-ui-supporting);color:var(--text-body);overflow-wrap:anywhere;white-space:pre-line}
.circle-copy ul{padding-inline-start:20px;margin:0}
.circle-copy li+li{margin-top:5px}
.circle-copy .circle-note{border-inline-start:3px solid var(--selection-border);padding-inline-start:12px}
.circle-preview{position:fixed;z-index:1000;width:340px;max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px);overflow:auto;overscroll-behavior:contain;padding:18px;background:var(--surface-card);color:var(--text-body);border:1px solid var(--border-strong);border-radius:var(--radius-workspace-control);box-shadow:var(--elevation-overlay);text-align:start}
.circle-preview-title{display:block;font:var(--text-ui-card-title);color:var(--text-heading);overflow-wrap:anywhere}
.circle-preview-meta{font:var(--text-ui-caption);color:var(--text-muted);margin-top:12px}
.home-event .circle-topic{font-weight:600;overflow-wrap:anywhere}
.home-event .circle-instructor{flex-wrap:wrap;gap:5px}
.home-event .circle-instructor-name{flex:1 1 40px}
.home-event.is-cancelled .circle-instructor{text-decoration:none}
.calendar-page .cal-agenda-event .circle-instructor,.calendar-page .cal-ev .circle-instructor{display:flex;align-items:center;white-space:normal}
.calendar-page .cal-agenda-event .circle-portrait,.calendar-page .cal-ev .circle-portrait{display:grid;place-items:center}
.calendar-page .cal-ev .circle-instructor{gap:4px;margin-block:3px;line-height:1.25}
.calendar-page .cal-ev .circle-portrait{flex-basis:24px;width:24px;height:24px}
.calendar-page .cal-ev .circle-instructor-name{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}
.calendar-page .cal-ev.is-short{grid-template-rows:auto auto;column-gap:4px;row-gap:0;align-content:center}
.calendar-page .cal-ev.is-short .circle-instructor{grid-column:1 / -1;margin:0;font-size:12px}
.calendar-page .cal-ev.is-short .circle-portrait{flex-basis:18px;width:18px;height:18px;font-size:10px}
.calendar-page .cal-ev.is-two .circle-instructor{margin-block:2px}
.calendar-page .cal-ev:not(.is-short):not(.is-two) .cal-ev-title{white-space:normal;line-height:1.3}
.calendar-page .cal-detail-head h2{overflow-wrap:anywhere}
