/* Center the toggle */
.myplugin-switch-wrap {
    margin: 10px 0 16px;
    display: flex;
    justify-content: center;
}

/* Toggle shell */
.myplugin-toggle {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    cursor: pointer;
    user-select: none;
    position: relative;
}

/* Visually hide the checkbox but keep it accessible/focusable */
.myplugin-toggle .myplugin-switch-input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    overflow: hidden;
    white-space: nowrap;
}

/* Track + thumb */
.myplugin-toggle .track {
    position: relative;
    width: 56px;
    height: 28px;
    border-radius: 999px;
    background: #ccd0d4;
    transition: background .2s;
}

.myplugin-toggle .thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    transition: left .2s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .2);
}

/* States */
.myplugin-toggle .myplugin-switch-input:checked + .track {
    background: #20A2DC;
}

/* WP blue */
.myplugin-toggle .myplugin-switch-input:checked + .track .thumb {
    left: 31px;
}

/* Focus ring (keyboard users) */
.myplugin-toggle .myplugin-switch-input:focus + .track {
    box-shadow: 0 0 0 3px rgba(34, 113, 177, .35);
    outline: none;
}

/* Screens (unchanged) */
.myplugin-screens {
    margin-top: 8px;
}

.myplugin-screen {
    min-height: 180px;
    border-radius: 8px;
    padding: 16px;
    color: #fff;
}

.myplugin-screen-blue {
    background: rgba(255, 255, 255, 0.1);
}

.myplugin-screen-red {
    background: rgba(255, 255, 255, 0.1);
}

.myplugin-screen h4 {
    margin: 0 0 .5rem;
    color: #fff;
}

/* Hide helper */
.myplugin-screen.is-hidden {
    display: none !important;
}

.myplugin-title {
    margin: 0 0 24px; /* increased space between "program" and the switch */
    text-align: center;
    font-size: 32px !important;
    font-weight: 600 !important;
    color: #FFD64F !important;
}

/* Switch row centered + spaced */
.myplugin-switch-wrap {
    margin: 10px 0 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px; /* space between labels and toggle */
}

/* Labels */
.myplugin-switch-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .02em;
    color: #fff;
    text-transform: uppercase; /* extra safety even though we used uppercase text */
    line-height: 1;
    user-select: none;
    white-space: nowrap;
}

.myplugin-company-card .logo-wrap {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.myplugin-company-card img {
    max-width: 100%;
    max-height: 80px;
    object-fit: contain;
}

.myplugin-logo-placeholder {
    width: 100%;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    color: #334155;
    font-weight: 700;
    font-size: 28px;
    border-radius: 6px;
}

/* Events wrapper under each company card */
.myplugin-events-wrap {
    margin-top: 12px;
    background: #20A2DC; /* requested color */
    color: #fff;
    border-radius: 8px;
    padding: 12px;
}

/* Each event row */
.myplugin-event-item {
    padding: 6px 0;
}

/* Time + title */
.myplugin-event-time {
    font-weight: 600;
    line-height: 1.2;
}

.myplugin-event-title {
    line-height: 1.2;
}

/* Divider between events */
.myplugin-event-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.45);
    margin: 8px 0;
}

.myplugin-event-item:last-child .myplugin-event-divider {
    display: none;
}

/* Logo card (unchanged name) */
.myplugin-company-card {
    background: #fff;
    border-radius: 8px 8px 0 0;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    margin-bottom: 4px;
}

.myplugin-events-wrap {
    /* remove previous margin-top if you had it */
    margin-top: 0;
    background: #20A2DC;
    color: #fff;
    border-radius: 0 0 8px 8px;
    padding: 12px;
}

/* Event row: time left, info icon right */
.myplugin-event-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.myplugin-event-time {
    flex: 1 1 auto;
}

/* Info button (circle “i”) */
.myplugin-info-btn {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.85);
    background: transparent;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
}

.myplugin-info-btn.has-registration {
    outline: 3px solid rgb(255, 214, 79);
    outline-offset: 2px;
}

.myplugin-info-btn:hover {
    background: rgba(255, 255, 255, 0.12);
}

.myplugin-info-btn:focus {
    outline: 3px solid rgba(255, 255, 255, 0.35);
    outline-offset: 2px;
}

/* Modal overlay + dialog */
.myplugin-modal.is-hidden {
    display: none !important;
}

.myplugin-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
}

.myplugin-modal-dialog {
    position: relative;
    width: min(640px, 92vw);
    height: 50vh; /* <-- 30% of page (viewport) height */
    max-height: 90vh; /* safety cap */
    background: #fff;
    color: #111;
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, .35);
    padding: 20px 16px 16px;

    display: flex; /* so content can scroll inside */
    flex-direction: column;
}

/* Close “X” */
.myplugin-modal-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 34px;
    height: 34px;
    border: none;
    background: transparent;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    border-radius: 6px;
}

.myplugin-modal-close:hover {
    background: rgba(17, 24, 39, .06);
}

.myplugin-modal-close:focus {
    outline: 3px solid rgba(34, 113, 177, .35);
    outline-offset: 2px;
}

/* Make modal content scroll if it overflows */
.myplugin-modal-body {
    margin-top: 8px;
    overflow: auto;
    flex: 1 1 auto;
}

/* --- Modal content layout --- */
.myplugin-modal-header {
    display: flex;
    align-items: center;
    justify-content: flex-start; /* badge on the left */
    gap: 8px;
}

/* Generic badge */
.myplugin-badge {
    display: inline-block;
    font-weight: 800 !important;
    font-size: 14px; /* was 12px */
    line-height: 1;
    padding: 8px 12px; /* was 6px 10px */
    border-radius: 999px;
    letter-spacing: .02em;
    text-transform: uppercase;
    user-select: none;
}

/* Time badge (left, top row) */
.myplugin-badge-time {
    background: #e6f3fb;
    color: #0b5b7d;
    border: 1px solid #b6d7ec;
}

/* Title: black + keep size/spacing */
.myplugin-modal-title {
    margin: 12px 0 8px;
    font-weight: 700 !important;
    text-transform: uppercase;
    font-size: clamp(18px, 3.2vw, 22px);
    line-height: 1.2;
    color: #194e83 !important;
}

/* Description */
.myplugin-modal-desc {
    margin: 0 0 12px;
    color: #1f2937;
}

/* Divider */
.myplugin-modal-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 12px 0;
}

/* Footer row: logo (left) + optional registration badge (right) */
.myplugin-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

/* Company logo in modal */
.myplugin-modal-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 30%;
}

.myplugin-modal-logo img {
    width: auto;
    max-width: 45vw;
    height: auto;
    object-fit: contain;
}

/* Placeholder if no logo */
.myplugin-modal-logo .logo-placeholder {
    width:90px;            /* was 60px */
    height:64px;           /* was 44px */
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    color: #334155;
    border-radius: 6px;
    font-weight: 700;
    font-size:22px;        /* was 18px */
}

/* Registration badge-link (only if URL present) */
.myplugin-badge-link {
    background: #20A2DC;
    color: #fff !important;
    border: 1px solid #1991c3;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 12px;
    letter-spacing: .03em;
    text-transform: uppercase;
    white-space: nowrap;
}

.myplugin-badge-link:hover {
    filter: brightness(0.95);
}

.myplugin-badge-link:focus {
    outline: 3px solid rgba(32, 162, 220, .35);
    outline-offset: 2px;
}

body.myplugin-modal-open { overflow: hidden; }

/* Dialog stays a column layout */
.myplugin-modal-dialog{
    position: relative;
    width: min(640px, 92vw);
    height: 50vh;
    max-height: 90vh;
    background: #fff;
    color: #111;
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(0,0,0,.35);
    padding: 20px 16px 16px;
    display: flex;
    flex-direction: column;
    z-index: 100000;
}

/* Scrollable content area */
.myplugin-modal-body{
    flex: 1 1 auto;
    min-height: 0;       /* important for overflow within flex */
    overflow: auto;
    margin-top: 8px;
}

/* Divider just above footer (stays near bottom) */
.myplugin-modal-divider{
    height: 1px;
    background: #e5e7eb;
    margin: 10px 0;
    flex: 0 0 auto;
}

/* Footer pinned to bottom */
.myplugin-modal-footer{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex: 0 0 auto;
    margin-top: auto;  /* pushes footer to the bottom */
}

.myplugin-company-grid{ display:block !important; column-gap:12px; column-count:1; }
@media (min-width: 768px){  .myplugin-company-grid{ column-count: 3; } }
@media (min-width: 1024px){ .myplugin-company-grid{ column-count: 4; } }
/* was 1440px — set to 1280px so your 1348px viewport shows 5 columns */
@media (min-width: 1280px){ .myplugin-company-grid{ column-count: 5; } }

.myplugin-company-cell{
    break-inside: avoid; -webkit-column-break-inside: avoid;
    display: inline-block; width:100%;
    margin: 0 0 16px;     /* original vertical spacing */
    gap: 12px; flex-direction: column;
}

/* Day buttons (top of the Blue screen) */
.myplugin-daybar{
    display:flex; justify-content:center; align-items:center;
    gap:8px; margin: 6px 0 12px;
}
.myplugin-daybtn{
    appearance:none;border:1px solid rgba(255,255,255,.6);
    background: transparent; color:#fff; font-weight:700;
    padding:6px 10px; border-radius:999px; cursor:pointer;
    line-height:1; font-size:13px; letter-spacing:.02em;
}
.myplugin-daybtn:hover{ background: rgba(255,255,255,.12); }
.myplugin-daybtn.is-active{
    background:#20A2DC; border-color:#1991c3;
}

/* Hide helper already used elsewhere */
.myplugin-screen.is-hidden, .is-hidden{ display:none !important; }

/* ===== RED view: timetable ===== */
.myplugin-timetable{
    /* two columns: left (companies) + right (timeline) */
    --side: 30%;
    --row-h: 78px;            /* row height */
    display: grid;
    grid-template-columns: var(--side) 1fr;
    gap: 8px 16px;
    margin-top: 8px;
}
@media (min-width: 1024px){
    .myplugin-timetable{ --side: 15%; }
}

/* Top hour scale (sits above the rows in the right column) */
.myplugin-tt-hours{
    grid-column: 2 / 3;
    position: relative;
    height: 28px;
}
.myplugin-tt-hour{
    position: absolute;
    top: 0;
    transform: translateX(-50%);
    font-weight: 800;
    font-size: 12px;
    color: #ffd9e1;          /* readable on red background */
    white-space: nowrap;
    z-index: 1000;
}

/* Company name/logo column (left) */
.myplugin-tt-side-cell{
    grid-column: 1 / 2;
    height: var(--row-h);
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background: #ff6f61;     /* sample brand color; tweak if needed */
    color: #fff;
    border-radius: 8px;
    overflow: hidden;
}
.myplugin-tt-side-cell img{
    max-height: 48px; max-width: 180px; object-fit: contain;
}
.myplugin-tt-side-title{
    font-weight: 800; font-size: 18px;
}

/* Timeline track per company (right) */
.myplugin-tt-main-cell{
    grid-column: 2 / 3;
    height: var(--row-h);
    position: relative;
    background: rgba(255,255,255,0.08);
    border-radius: 8px;
    overflow: hidden;
}

/* Hour guide lines inside each track */
.myplugin-tt-vline{
    position: absolute;
    top: 0; bottom: 0; width: 1px;
    background: rgba(255,255,255,0.35);
}

/* Event block */
.myplugin-tt-event{
    position: absolute;
    top: 6px; bottom: 6px;
    border-radius: 8px;
    background: #20A2DCFF;
    color: #fff;
    padding: 10px 12px 8px 12px;
    min-width: 68px;         /* ensures visibility for very short events */
    display: flex;
    flex-direction: column;
}
.myplugin-tt-event-time{ font-weight: 800; font-size: 12px; line-height: 1; }
.myplugin-tt-event-title{ margin-top: 6px; font-weight: 700; font-size: 13px; line-height: 1.2; }

/* Info button inside the event (top-right) */
.myplugin-tt-event .myplugin-info-btn{
    position: absolute; top: 6px; right: 6px;
    border-color: rgba(255,255,255,0.85);
}

/* Keep using the same modal styles you already added */

/* ===== Make company logos bigger, white wrapper, centered ===== */

/* BLUE view (cards) */
.myplugin-company-card{
    background:#fff;               /* already white, keep it explicit */
    display:flex; align-items:center; justify-content:center;
}
.myplugin-company-card img{
    max-height: 96px;              /* was ~80px: slightly bigger */
    max-width: 240px;
    width:auto; height:auto;
    object-fit:contain;
}
.myplugin-logo-placeholder{
    height: 96px;                  /* scale placeholder to match */
    font-size: 32px;
}

/* RED view (left company column) */
.myplugin-tt-side-cell{
    background:#fff;               /* white wrapper */
    color:#111;
    display:flex; align-items:center; justify-content:center; /* centered */
    padding: 12px;
    border-radius:8px;
}
.myplugin-tt-side-cell img{
    max-height: 72px;              /* a bit bigger */
    max-width: 240px;
    width:auto; height:auto;
    object-fit:contain;
    display:block;
}
.myplugin-tt-side-title{
    color:#111;
    font-weight:800; font-size:18px;
    text-align:center;
}

/* Red timetable: horizontal scrolling */
.myplugin-tt-hours,
.myplugin-tt-main-cell{
    overflow-x: auto;   /* horizontal scroll */
    overflow-y: hidden;
    scrollbar-gutter: stable;
}

/* Inner rails that get a computed width (hours * 25%) */
.myplugin-tt-hours-inner{ position: relative; height: 28px; }
.myplugin-tt-track{ position: relative; height: var(--row-h); }

/* (Keep your existing .myplugin-tt-hour and .myplugin-tt-vline styles) */

/* Hide scrollbars (but keep scroll) for the timetable header + rows */
.myplugin-tt-hours,
.myplugin-tt-main-cell{
    /* already overflow-x:auto from earlier */
    -ms-overflow-style: none;   /* IE/Edge */
    scrollbar-width: none;      /* Firefox */
    scrollbar-gutter: auto;     /* don't reserve gutter when hidden */
    -webkit-overflow-scrolling: touch; /* smooth iOS scrolling */
}
.myplugin-tt-hours::-webkit-scrollbar,
.myplugin-tt-main-cell::-webkit-scrollbar{
    width: 0;
    height: 0;
    display: none;              /* Chrome/Safari */
}

/* Mobile tweaks: logos smaller on small screens */
@media (max-width: 767px){
    /* BLUE view cards */
    .myplugin-company-card img{
        max-height: 64px;      /* was 96px */
        max-width: 180px;      /* was 240px */
    }
    .myplugin-logo-placeholder{
        height: 64px;          /* was 96px */
        font-size: 24px;       /* was 32px */
    }

    /* RED view left column */
    .myplugin-tt-side-cell img{
        max-height: 48px;      /* was 72px */
        max-width: 160px;      /* was 240px */
    }
    .myplugin-tt-side-title{
        font-size: 16px;       /* a bit smaller text fallback */
    }

    /* (Optional) make each timetable row a little shorter on mobile */
    .myplugin-timetable{ --row-h: 64px; } /* was 78px */
}

/* When Isotope runs, turn off CSS columns */
.myplugin-screen-blue .myplugin-company-grid.has-isotope{
    column-count: initial !important;
    column-width: initial !important;
    position: relative;
}

/* Column widths controlled by the sizer (1/3/4/5 columns) */
.myplugin-grid-sizer,
.myplugin-company-cell{ width: 100%; }          /* mobile: 1 col */

@media (min-width: 768px){
    .myplugin-grid-sizer,
    .myplugin-company-cell{ width: 31%; }    /* 3 cols */
}
@media (min-width: 1024px){
    .myplugin-grid-sizer,
    .myplugin-company-cell{ width: 23%; }         /* 4 cols */
}
@media (min-width: 1280px){
    .myplugin-grid-sizer,
    .myplugin-company-cell{ width: 18%; }         /* 5 cols */
}

/* Optional: small gutter via margins handled by Isotope’s `gutter` */

/* Controls row: day buttons (left) + centered switch (middle) + spacer (right) */
.myplugin-controls{
    display: grid;
    grid-template-columns: 1fr auto 1fr;  /* left | center | right */
    align-items: center;
    gap: 16px;
    margin: 8px 0 16px;
}

/* Day bar stays on the SAME ROW; scrolls horizontally if it overflows */
.myplugin-daybar{
    justify-self: start;
    display: flex;
    align-items: center;
    gap: 10px;
    overflow-x: auto;          /* no wrapping */
    white-space: nowrap;
    max-width: 100%;
    padding: 4px 0;
    height: auto;
}

/* BIGGER day buttons */
.myplugin-daybtn{
    appearance: none;
    border: 2px solid rgba(255,255,255,.85);
    background: transparent;
    color: #fff;
    font-weight: 800;
    letter-spacing: .02em;
    font-size: 14px;           /* was smaller */
    line-height: 1;
    padding: 10px 16px;        /* larger hit area */
    border-radius: 999px;
    cursor: pointer;
    transition: background .15s ease, transform .06s ease;
}
.myplugin-daybtn:hover{ background: rgba(255,255,255,.12); }
.myplugin-daybtn:active{ transform: translateY(1px); }
.myplugin-daybtn.is-active{
    background: #20A2DC;
    border-color: #1991c3;
    color: #fff;
}

/* Keep the switch centered and on the same row */
.myplugin-switch-wrap{
    justify-self: center;
    white-space: nowrap;       /* prevents its labels from wrapping */
}

/* Optional: hide scrollbar visuals for the day bar while keeping scroll */
.myplugin-daybar{
    -ms-overflow-style: none;     /* IE/Edge */
    scrollbar-width: none;        /* Firefox */
}
.myplugin-daybar::-webkit-scrollbar{ display: none; }

/* Desktop/tablet: already side-by-side via grid */

/* Mobile: stack — buttons on top, switch below */
@media (max-width: 768px){
    .myplugin-controls{
        grid-template-columns: 1fr;       /* single column */
        grid-template-rows: auto auto;    /* daybar, then switch */
        justify-items: center;
        gap: 10px;
        margin: 8px 0 14px;
    }
    .myplugin-daybar{
        justify-self: stretch;            /* full width */
        padding: 2px 0;
    }
    .myplugin-switch-wrap{
        justify-self: center;
        white-space: nowrap;
    }
    /* hide the right spacer on mobile */
    .myplugin-controls > [aria-hidden="true"]{ display: none; }
}

/* Red timetable: 30-minute slots */
.myplugin-component { --slot-w: 320px; }             /* 8 slots (=4h) fill 100% */
@media (max-width: 767px){
    .myplugin-component { --slot-w: 230px; }           /* 30 min = 100px on mobile */
}

/* rails width = number of 30-min segments */
.myplugin-tt-hours-inner,
.myplugin-tt-track{
    width: calc(var(--segments) * var(--slot-w));
}

/* ===== Red timetable: overlapping events in lanes ===== */
.myplugin-timetable{
    --lane-h: 78px;          /* height of one sub-row/event */
    --lane-gap: 8px;         /* vertical gap between lanes */
}

/* Mobile: a bit shorter per lane (optional) */
@media (max-width: 767px){
    .myplugin-timetable{ --lane-h: 64px; }
}

/* Track height grows with number of lanes set via --lanes */
.myplugin-tt-track{
    position: relative;
    height: calc(var(--lanes) * var(--lane-h) + (var(--lanes) - 1) * var(--lane-gap));
}

/* Left company cell matches track height */
.myplugin-tt-side-cell{
    /*height: calc(var(--lanes) * var(--lane-h) + (var(--lanes) - 1) * var(--lane-gap));*/
    display: flex; align-items: center; justify-content: center;
}

/* Each event sits on its lane */
.myplugin-tt-event{
    position: absolute;
    top: calc(var(--lane) * (var(--lane-h) + var(--lane-gap)));
    height: var(--lane-h);
    /* existing left/width (percent) continue to work */
}

/* ------------------------------------------------------------------ */

/* --- Lane sizing defaults (never collapse if CSS var missing) --- */
.myplugin-timetable{
    --lanes: 1;
    --lane-h: 78px;   /* one sub-row height */
    --lane-gap: 8px;  /* vertical gap between sub-rows */
}

/* Each row's main cell should expand to the lane stack height */
.myplugin-tt-main-cell{
    position: relative;
    overflow: visible; /* don't clip events */
    height: auto;      /* override any fixed row height */
    min-height: calc(var(--lanes,1) * var(--lane-h)
    +  (var(--lanes,1) - 1) * var(--lane-gap));
}

/* Left logo cell must match the same height */
.myplugin-tt-side-cell{
    /*height: auto;*/
    /*min-height: calc(var(--lanes,1) * var(--lane-h)*/
    /*+  (var(--lanes,1) - 1) * var(--lane-gap));*/
    display: flex; align-items: center; justify-content: center;
}

/* Track height = lanes; keep events above lines/background */
.myplugin-tt-track{
    position: relative;
    overflow: visible;
    height: calc(var(--lanes,1) * var(--lane-h)
    +  (var(--lanes,1) - 1) * var(--lane-gap));
    z-index: 1;
}
.myplugin-tt-vline{
    position: absolute;
    z-index: 1;
}
.myplugin-tt-event{
    position: absolute;
    top: calc(var(--lane,0) * (var(--lane-h) + var(--lane-gap)));
    height: var(--lane-h);
    box-sizing: border-box;
    z-index: 2;
}

/* If your timetable uses CSS Grid, make rows auto-height */
.myplugin-timetable{ grid-auto-rows: auto; align-items: stretch; }

/* ---------------------------------------------------------- */

/* --- Red timetable: horizontal scroll containers --- */
.myplugin-tt-hours,
.myplugin-tt-main-cell{
    overflow-x: auto;                 /* enable horizontal scroll */
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-width: none;            /* Firefox hide */
    cursor: grab;                     /* mouse drag UX */
}
.myplugin-tt-hours::-webkit-scrollbar,
.myplugin-tt-main-cell::-webkit-scrollbar{ display: none; } /* WebKit hide */
.myplugin-tt-hours.is-dragging,
.myplugin-tt-main-cell.is-dragging{ cursor: grabbing; }

/* The wide content inside these scrollers must actually be wider than the viewport */
.myplugin-tt-hours-inner,
.myplugin-tt-track{
    width: calc(var(--segments) * var(--slot-w));  /* already set; keep it */
}

/* Row background must not block scrolling */
.myplugin-tt-main-cell{ position: relative; }

/* Lanes (from earlier) — keep these; important bits repeated for clarity */
.myplugin-timetable{ --lanes: 1; --lane-h: 78px; --lane-gap: 8px; }
.myplugin-tt-main-cell{
    min-height: calc(var(--lanes,1) * var(--lane-h) + (var(--lanes,1) - 1) * var(--lane-gap));
}
.myplugin-tt-side-cell{
    /*min-height: calc(var(--lanes,1) * var(--lane-h) + (var(--lanes,1) - 1) * var(--lane-gap));*/
    display:flex; align-items:center; justify-content:center;
}
.myplugin-tt-track{
    position: relative;
    overflow: visible; /* allow events to extend within row */
    height: calc(var(--lanes,1) * var(--lane-h) + (var(--lanes,1) - 1) * var(--lane-gap));
    z-index: 1;
}
.myplugin-tt-vline{
    position:absolute;
    z-index:1;
}
.myplugin-tt-event{
    position:absolute;
    z-index:2;
    top: calc(var(--lane,0) * (var(--lane-h) + var(--lane-gap)));
    height: var(--lane-h);
    box-sizing: border-box;
}

/* Mobile: make the ÎNREGISTRARE button smaller */
@media (max-width: 767px){
    .myplugin-modal-footer .myplugin-badge-link{
        font-size: 12px;        /* smaller text */
        padding: 6px 10px;      /* tighter padding */
        border-radius: 8px;     /* slightly smaller shape */
        line-height: 1.1;
    }
}

/* Remove on-click/press animation for the info button */
.myplugin-info-btn{
    transition: none !important;       /* no animated transitions */
    animation: none !important;
    -webkit-tap-highlight-color: transparent; /* no mobile ripple */
}
.myplugin-info-btn:hover,
.myplugin-info-btn:active{
    transform: none !important;        /* stop scale/translate effects */
    box-shadow: none !important;
    background: none !important;
}

/* Keep an accessible focus style (adjust if you like) */
.myplugin-info-btn:focus-visible{
    outline: 2px solid rgba(255,255,255,.6);
    outline-offset: 2px;
}

/* Edge fixes: keep the first fully inside on the left,
   and the last fully inside on the right */
.myplugin-tt-hours-inner .myplugin-tt-hour:first-child{
    left: 0 !important;
    transform: none !important;          /* align by left edge */
}

.myplugin-tt-hours-inner .myplugin-tt-hour:last-child{
    transform: translateX(-100%) !important; /* align by right edge */
}

/* Use gap only when lanes > 1 */
.myplugin-tt-main-cell,
.myplugin-tt-side-cell,
.myplugin-tt-track{
    min-height: calc(
            var(--lanes,1) * var(--lane-h)
            + max(calc(var(--lanes,1) - 1), 0) * var(--lane-gap)
    );
    height: calc(
            var(--lanes,1) * var(--lane-h)
            + max(calc(var(--lanes,1) - 1), 0) * var(--lane-gap)
    );
}

/* Mobile-only company dropdown */
.myplugin-mobile-filter{ display: none; }
@media (max-width: 768px){
    .myplugin-mobile-filter{
        display: block;
        margin: 8px 0 12px;
    }
    /* hide the header/logo inside each card on mobile */
    .myplugin-screen-blue .myplugin-company-card{ display: none; }
}

/* Dropdown styling */
.myplugin-mobile-filter .mf-toggle{
    display: inline-flex; align-items: center; gap: 10px;
    padding: 8px 12px; border-radius: 999px;
    border: 2px solid rgba(255,255,255,.85);
    background: transparent; color: #fff; font-weight: 700;
}
.myplugin-mobile-filter .mf-thumb{
    width: 28px; height: 28px; border-radius: 50%; overflow: hidden;
    display: inline-flex; align-items: center; justify-content: center;
    background: #fff;
}
.myplugin-mobile-filter .mf-thumb img{ width: 100%; height: 100%; object-fit: contain; }
.myplugin-mobile-filter .mf-initial{ color: #194E83; font-weight: 800; }

.myplugin-mobile-filter .mf-caret{ opacity: .85; }

/* Menu */
.myplugin-mobile-filter .mf-menu{
    margin-top: 8px; padding: 6px; border-radius: 12px;
    background: rgba(0,0,0,.25);
    backdrop-filter: blur(4px);
    max-height: 50vh; overflow: auto;
    display: grid; grid-template-columns: 1fr; gap: 4px;
}
.myplugin-mobile-filter .mf-menu[hidden]{ display: none; }
.myplugin-mobile-filter .mf-option{
    width: 100%; display: flex; align-items: center; gap: 10px;
    padding: 8px; border-radius: 10px; background: rgba(255,255,255,.08);
    color: #fff;
}
.myplugin-mobile-filter .mf-name{ overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Mobile-only */
@media (max-width: 768px){
    .myplugin-mobile-filter{
        display: block;
        margin: 8px 0 12px;
        position: relative;      /* create stacking context */
        z-index: 40;             /* above grid items */
    }
}

/* Menu should overlay content, not push it or hide behind grid */
.myplugin-mobile-filter .mf-menu{
    position: absolute;        /* overlay under the toggle */
    top: 100%;
    left: 0;
    right: 0;
    z-index: 41;
    margin-top: 6px;
    background: rgba(0,0,0,.45);
    backdrop-filter: blur(4px);
    border-radius: 12px;
    padding: 8px;
    max-height: 55vh;
    overflow: auto;
    box-shadow: 0 8px 24px rgba(0,0,0,.35);
}
.myplugin-mobile-filter .mf-menu[hidden]{ display: none; }

/* Keep grid items below the menu */
.myplugin-screen-blue .myplugin-company-grid,
.myplugin-screen-blue .myplugin-company-cell{ position: relative; z-index: 1; }

/* (As before) hide card header/logo on mobile */
@media (max-width: 768px){
    .myplugin-screen-blue .myplugin-company-card{ display: none; }
}

/* Visually hide but keep accessible */
.sr-only{
    position:absolute !important;
    width:1px; height:1px;
    padding:0; margin:-1px;
    overflow:hidden; clip:rect(0 0 1px 1px);
    white-space:nowrap; border:0;
}

/* Hide label next to the current logo on mobile */
@media (max-width: 768px){
    .myplugin-mobile-filter .mf-label{ display:none; }
}

/* Remove list bullets & default spacing */
.myplugin-mobile-filter .mf-menu{
    list-style: none;
    margin: 6px 0 0;
    padding: 8px;
}

/* Logo-only grid (auto-fill squares) */
.myplugin-mobile-filter .mf-menu{
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
    gap: 8px;
}

/* Each option is a square tile with full-bleed logo */
.myplugin-mobile-filter .mf-option{
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;      /* square */
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: #fff;         /* white tile for logo contrast */
    overflow: hidden;
    cursor: pointer;
}

/* The logo fills the tile */
.myplugin-mobile-filter .mf-option .mf-thumb{
    display: block;
    width: 100%; height: 100%;
}
.myplugin-mobile-filter .mf-option .mf-thumb img{
    width: 100%; height: 100%;
    object-fit: contain;      /* keep logo aspect ratio */
}
.myplugin-mobile-filter .mf-option .mf-initial{
    display: flex; align-items: center; justify-content: center;
    width: 100%; height: 100%;
    font-weight: 800; color: #194E83;
}

/* Focus ring for accessibility */
.myplugin-mobile-filter .mf-option:focus-visible{
    outline: 3px solid #20A2DC; outline-offset: 2px;
}

/* Ensure dropdown overlays grid (from earlier) */
.myplugin-mobile-filter{ position: relative; z-index: 40; }
.myplugin-mobile-filter .mf-menu{ position: absolute; top: 100%; left: 0; right: 0; z-index: 41; }

/* Size knob for the mobile toggle */
.myplugin-mobile-filter{ --mf-size: 80px; } /* adjust as you like */

/* Mobile-only: logo fills the entire toggle button; white background */
@media (max-width: 768px){
    .myplugin-mobile-filter .mf-toggle{
        width: 100%;
        height: var(--mf-size);
        padding: 0;
        border: 0;
        border-radius: 12px;
        background: #fff;                 /* white background */
        position: relative;
        overflow: hidden;                  /* crop oversize logos */
        display: inline-block;
    }

    /* hide the text label so the logo can use the full area */
    .myplugin-mobile-filter .mf-label{ display: none; }

    /* make the logo fill the whole button */
    .myplugin-mobile-filter .mf-toggle .mf-thumb{
        position: absolute; inset: 0;
        width: 100%; height: 100%;
    }
    .myplugin-mobile-filter .mf-toggle .mf-thumb img{
        width: 100%; height: 100%;
        object-fit: contain;               /* keeps logo aspect ratio */
        display: block;
    }
    .myplugin-mobile-filter .mf-toggle .mf-initial{
        display: flex; align-items: center; justify-content: center;
        width: 100%; height: 100%;
        font-weight: 800; color: #194E83;
        background: #fff;
    }

    /* optional: keep a small caret overlay; remove if you don't want it */
    .myplugin-mobile-filter .mf-toggle .mf-caret{
        position: absolute;
        right: 10px;
        top: 50%;
        transform: translateY(-50%);   /* vertically centered */
        font-size: 24px;               /* ~2x bigger (was ~12px) */
        line-height: 1;
        padding: 4px 8px;              /* keep if you use the pill background */
        border-radius: 999px;
        background: rgba(0,0,0,.45);
        color: #fff;
    }
}

/* seam color you can tweak */
.myplugin-timetable{ --seam-color: rgba(255,255,255,.7); }

/* draw a 1–2px vertical seam on the *left* edge of an event that touches a previous one */
.myplugin-tt-event.is-touching-prev::before{
    content:"";
    position:absolute;
    left:-1px;                 /* tiny overlap so it’s always visible */
    top:2px; bottom:2px;
    width:2px;
    background: var(--seam-color);
    border-radius: 1px;
    pointer-events: none;
    z-index: 3;                /* above grid lines and the event bg */
}

/* Shared row height formula (no extra gap when lanes = 1) */
.myplugin-tt-side-cell,
.myplugin-tt-main-cell,
.myplugin-tt-track{
    --row-h: calc(
            var(--lanes,1) * var(--lane-h)
            + max(calc(var(--lanes,1) - 1), 0) * var(--lane-gap)
    );
}

/* Track: exact height */
.myplugin-tt-track{
    height: var(--row-h);
    overflow: visible;
}

/* Main cell: exact height (not min-height) so it matches the track */
.myplugin-tt-main-cell{
    height: var(--row-h);
    overflow-x: auto;    /* your horizontal scrolling */
    overflow-y: hidden;
    position: relative;
}

/* Side (logo) cell: exact height and prevent content from pushing it */
.myplugin-tt-side-cell{
    height: var(--row-h);
    overflow: hidden;            /* clip any overflow */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;                  /* remove extra padding if any */
    box-sizing: border-box;
}

/* Constrain logo/title inside the side cell */
.myplugin-tt-side-cell img{
    display: block;              /* avoid baseline gap */
    max-height: calc(100% - 12px);
    max-width: calc(100% - 12px);
    object-fit: contain;
}
.myplugin-tt-side-title{
    margin: 0;
    line-height: 1.15;
    max-height: 100%;
    overflow: hidden;
}

/* Red timetable: 1 hour slot width */
.myplugin-component{
    --hour-w: 320px !important;   /* 1h = 320px */
    --slot-w: var(--hour-w) !important; /* alias for older rules that used --slot-w */
}

/* Ensure rails use the hour width variable */
.myplugin-tt-hours-inner,
.myplugin-tt-track{
    width: calc(var(--segments) * var(--hour-w));
}

/* Adjust if your theme header is taller/shorter */
.myplugin-component{ scroll-margin-top: 80px; }

/* If you want the scroll to animate (many themes already do this) */
html:where(:not(.reduce-motion)) { scroll-behavior: smooth; }


