:root {
  --bg-color-light: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%); 
  --text-color-light: #B80C49;
  --bg-color-dark: linear-gradient(135deg,  #404040 0%, #333232 100%);
  --text-color-dark: #f5f5f5;
  --card-bg-light: rgba(255, 255, 255, 0.9);
  --card-bg-dark: rgba(255, 255, 255, 0.08); /* elevation tint: lighter than the backdrop */
  --glass-bg-light: rgba(255, 255, 255, 0.1);
  --glass-bg-dark: rgba(255, 255, 255, 0.05);
  --text-secondary-light: #666;
  --text-secondary-dark: #b0b3c1;
  --shadow-light: 0 8px 32px rgba(0, 0, 0, 0.1);
  --shadow-dark: 0 8px 32px rgba(0, 0, 0, 0.3);
  --border-light: rgba(184, 12, 73, 0.2);
  --border-dark: rgba(255, 255, 255, 0.1);  /* subtle 1px light edge */
}


@font-face {
  font-family: 'Squarcle';
  src: url('Squarcle.woff2') format('woff2'),
  font-weight: normal;
  font-style: Regular;
}


* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Squarcle', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-color-light);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    transition: background 0.3s ease;
}

body.dark-mode {
    background: var(--bg-color-dark);
}

.company-logo {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    animation: fadeInLeft 0.8s ease-out;
}



.company-logo img {
	content: url('logo.png');
    max-width: 75px;
    max-height: 75px;
    object-fit: contain;
}
body.dark-mode .company-logo img {
  content: url('logodark.png');
}

.company-logo.placeholder {
    color: var(--text-color-light);
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.2;
}

.datetime-widget {

    padding: 15px;
    text-align: center;
    animation: fadeInRight 0.8s ease-out;
    transition: all 0.3s ease;

}


body.dark-mode .weather-widget {
	color: var(--text-color-dark);
}


.time-display {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-color-light);
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(184, 12, 73, 0.1);
    transition: color 0.3s ease;
}

body.dark-mode .time-display {
    color: var(--text-color-dark);
    text-shadow: 0 2px 4px rgba(245, 245, 245, 0.1);
}

.date-display {
    font-size: 0.95rem;
    color: var(--text-secondary-light);
    font-weight: 500;
    transition: color 0.3s ease;
}

body.dark-mode .date-display {
    color: var(--text-secondary-dark);
}

.toggle-switch {
    width: 50px;
    height: 25px;
    background-color: #ccc;
    border-radius: 25px;
    position: relative;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

body.dark-mode .toggle-switch {
    background-color: #555;
}

.toggle-switch::before {
    content: "";
    width: 21px;
    height: 21px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: 0.3s;
}

body.dark-mode .toggle-switch::before {
    background: #f5f5f5;
}

.toggle-switch.active {
    background-color: #4caf50;
}

.toggle-switch.active::before {
    transform: translateX(25px);
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.container {
    max-width: 800px;
    width: 100%;
    text-align: center;
}

.logo {
    font-size: 2.4rem;
	font-family: "Squarcle", sans-serif;
    font-weight: 300;
    color: #B80C49;
    margin-bottom: 0.25rem;
    text-shadow: 0 2px 4px rgba(184, 12, 73, 0.1);
    animation: fadeInUp 0.8s ease-out;
    transition: color 0.3s ease;
}	

body.dark-mode .logo {
    color: var(--text-color-dark);
}

.logo2 {
    font-size: 1.7rem;
	font-family: "Squarcle", sans-serif;
    font-weight: 300;
    color: #B80C49;
    margin-bottom: 0.25rem;
    text-shadow: 0 2px 4px rgba(184, 12, 73, 0.1);
    animation: fadeInUp 0.8s ease-out;
    transition: color 0.3s ease;
}	

body.dark-mode .logo2 {
    color: var(--text-color-dark);
}

.sublogo {
    font-size: 1rem;
	font-family: "Squarcle", sans-serif;
    font-weight: 300;
    color: #780830;
    margin-bottom: 2rem;
    text-shadow: 0 2px 4px rgba(184, 12, 73, 0.1);
    animation: fadeInUp 0.8s ease-out;
    transition: color 0.3s ease;
}	

body.dark-mode .sublogo {
    color: var(--text-color-dark);
}
.search-container {
    margin-bottom: 2rem;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.search-box {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.search-input {
    width: 100%;
    padding: 15px 50px 15px 20px;
    font-size: 1.1rem;
    border: 2px solid transparent;
    border-radius: 50px;
    outline: none;
    background: var(--card-bg-light);
    /* backdrop-filter removed: confirmed in the field as a source of
       unclipped "ghost square" GPU artefacts in dark mode (Jun 2026) */
    box-shadow: var(--shadow-light);
    transition: all 0.3s ease;
    color: #333;
}

body.dark-mode .search-input {
    background: var(--card-bg-dark);
    box-shadow: var(--shadow-dark);
    color: var(--text-color-dark);
}

.search-input::placeholder {
    color: var(--text-secondary-light);
    transition: color 0.3s ease;
}

body.dark-mode .search-input::placeholder {
    color: var(--text-secondary-dark);
}

.search-input:focus {
    border-color: #B80C49;
    box-shadow: 0 8px 32px rgba(184, 12, 73, 0.2);
    transform: translateY(-2px);
}

body.dark-mode .search-input:focus {
    border-color: var(--text-color-dark);
    box-shadow: 0 8px 32px rgba(245, 245, 245, 0.1);
}

.search-button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, #B80C49, #d91456);
    border: none;
    border-radius: 50px;
    padding: 10px 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-button:hover {
    background: linear-gradient(135deg, #d91456, #B80C49);
    transform: translateY(-50%) scale(1.05);
}

body.dark-mode .search-button {
    background: linear-gradient(135deg, #FFFFFF, #d9d4d4);

}
body.dark-mode .search-button:hover {
    background: linear-gradient(135deg, #d9d4d4, #FFFFFF);
}

.search-button svg {
    width: 20px;
    height: 20px;
    fill: white;
}

body.dark-mode .search-button svg {
    width: 20px;
    height: 20px;
    fill: black;
}

/* Announcements Section Styling */
#announcements-section {
    margin-bottom: 2rem;
    animation: slideInFromTop 0.8s ease-out 0.3s both;
    opacity: 0;
}

#announcements-section.show {
    opacity: 1;
}

#announcements-section h2 {
    font-size: 1.5rem;
	font-family:"calibri light", sans-serif;
    color: var(--text-color-light);
    margin-bottom: 0.2rem;
    font-weight: 600;
    transition: color 0.3s ease;
}

body.dark-mode #announcements-section h2 {
    color: var(--text-color-dark);
}

#announcements {
    padding: 0rem;
    transition: all 0.3s ease;
}



#announcements p {
    font-size: 1rem;
    color: #333;
    line-height: 1.6;
    margin-bottom: 0rem;
    padding: 0.3rem 0;
    transition: color 0.3s ease;
}

body.dark-mode #announcements p {
    color: var(--text-color-dark);
}

#announcements p:last-child {
    margin-bottom: 0;
    border-bottom: none;
}

.bookmarks {
    display: grid;
    animation: fadeInUp 0.8s ease-out 0.5s both;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1.2rem;
    max-width: 900px;
    margin: 0 auto;
        }
        
        @media (min-width: 769px) {
            .bookmarks {
                grid-template-columns: repeat(4, 1fr);
            }
        }
        
        @media (max-width: 768px) {
            .bookmarks {
                grid-template-columns: repeat(2, 1fr);
            }
        }


.bookmark-card {
    background: var(--card-bg-light);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 1.2rem 1rem;
    text-decoration: none;
    color: #333;
    box-shadow: var(--shadow-light);
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

body.dark-mode .bookmark-card {
    background: var(--card-bg-dark);
    box-shadow: var(--shadow-dark);
    color: var(--text-color-dark);
}

.bookmark-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #B80C49, #d91456, #e91e63);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

body.dark-mode .bookmark-card::before {
    background: linear-gradient(90deg, var(--text-color-dark), #ffffff, #f0f0f0);
}

.bookmark-card:hover::before {
    transform: translateX(0);
}

.bookmark-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 48px rgba(184, 12, 73, 0.2);
    border-color: rgba(184, 12, 73, 0.2);
}

body.dark-mode .bookmark-card:hover {
    box-shadow: 0 16px 48px rgba(245, 245, 245, 0.1);
    border-color: var(--border-dark);
}

.bookmark-icon {
    width: 40px;
    height: 40px;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, #B80C49, #d91456);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

body.dark-mode .bookmark-icon {
    background: linear-gradient(135deg, var(--text-color-dark), #ffffff);
}

.bookmark-card:hover .bookmark-icon {
    transform: scale(1.1) rotate(5deg);
}

.bookmark-icon svg {
    width: 24px;
    height: 24px;
    fill: white;
}

body.dark-mode .bookmark-icon svg {
    fill: #2b2d42;
}

.bookmark-title {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
    transition: color 0.3s ease;
}

body.dark-mode .bookmark-title {
    color: var(--text-color-dark);
}

.bookmark-description {
    font-size: 0.9rem;
    color: var(--text-secondary-light);
    line-height: 1.3;
    transition: color 0.3s ease;
}

body.dark-mode .bookmark-description {
    color: var(--text-secondary-dark);
}

.footer {
    margin-top: 3rem;
    color: var(--text-secondary-light);
    font-size: 0.9rem;
    animation: fadeInUp 0.8s ease-out 0.7s both;
    transition: color 0.3s ease;
}

body.dark-mode .footer {
    color: var(--text-secondary-dark);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 768px) {
    .logo {
        font-size: 2.2rem;
    }
    
    .company-logo {
        width: 60px;
        height: 60px;
        top: 15px;
        left: 15px;
    }
    
    .company-logo img {
        max-width: 45px;
        max-height: 45px;
    }
    
    .datetime-widget {
        max-width: 200px;
    }
    
    .bookmarks {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 1rem;
    }
    
    .bookmark-card {
        padding: 1.5rem 0.5rem;
    }

    #announcements-section h2 {
        font-size: 1.3rem;
    }

    #announcements {
        padding: 1rem;
    }

}
/* ===== Copilot launcher button (added) ===== */
/* Lays the search box + Copilot button in a centred row without
   altering the original .search-box / .search-container rules. */
.search-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.search-row .search-box {
    flex: 0 1 600px; /* keep the original bar width, allow shrink on mobile */
    margin: 0;       /* cancel the inherited auto side-margins, which in a flex
                        row absorb free space and push the button to the edge */
}

.copilot-button {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    text-decoration: none;
    box-shadow:
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.copilot-button:hover {
    transform: scale(1.05);
}

.copilot-button img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

body.dark-mode .copilot-button {
    box-shadow:;
}

/* ============================================================
   M365 personalisation additions: greeting, next-meeting,
   weather. Kept in their own block so they're easy to find /
   remove and don't touch the original rules above.
   ============================================================ */

/* --- Personalised greeting --- */
.greeting {
    font-size: 1.55rem;
    font-weight: 300;
    color: var(--text-color-light);
    margin-bottom: 1.4rem;
    text-shadow: 0 2px 4px rgba(184, 12, 73, 0.08);
    animation: fadeInUp 0.8s ease-out 0.15s both;
    transition: color 0.3s ease;
}

.greeting #greetingName {
    font-weight: 600;
}

body.dark-mode .greeting {
    color: var(--text-color-dark);
    text-shadow: none;
}

@media (max-width: 768px) {
    .greeting {
        font-size: 1.3rem;
        margin-bottom: 1.1rem;
    }
}

/* --- Weather widget text --- */
.weather-widget .weather-temp {
    font-size: 1.3rem;
    font-weight: 600;
    line-height: 1.1;
}

.weather-widget .weather-desc {
    font-size: 0.8rem;
    color: var(--text-secondary-light);
}

body.dark-mode .weather-widget .weather-desc {
    color: var(--text-secondary-dark);
}

/* ============================================================
   Widget rail v2
   ------------------------------------------------------------
   Optional cards on the right, toggled via the "Add widgets"
   panel. Replaces the old fixed next-meeting card. The rail is
   independently scrollable so a fully-loaded set of widgets
   never collides with the page content.
   ============================================================ */

[hidden] { display: none !important; }

.rightcontainer {
    position: fixed;
    top: 20px;
    right: 20px;
    bottom: 20px;
    width: 264px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 2px 6px 2px 2px;
    scrollbar-width: thin;
    scrollbar-color: rgba(184, 12, 73, 0.3) transparent;
    z-index: 50;
}

.rightcontainer::-webkit-scrollbar { width: 5px; }
.rightcontainer::-webkit-scrollbar-track { background: transparent; }
.rightcontainer::-webkit-scrollbar-thumb {
    background: rgba(184, 12, 73, 0.3);
    border-radius: 3px;
}
body.dark-mode .rightcontainer {
    scrollbar-color: rgba(245, 245, 245, 0.25) transparent;
}
body.dark-mode .rightcontainer::-webkit-scrollbar-thumb {
    background: rgba(245, 245, 245, 0.25);
}

/* --- Card shell shared by every widget --- */
.widget {
    text-align: center;
    padding: 14px 16px;
    border-radius: 16px;
    background: var(--card-bg-light);
    /* No backdrop-filter: the backdrop is a flat gradient, so blur
       added nothing visible but risked ghost-square GPU artefacts
       alongside view transitions and corner-shape clipping. */
    box-shadow: var(--shadow-light);
    border: 1px solid var(--border-light);
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.3s ease;
}

.widget:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 36px rgba(184, 12, 73, 0.14);
}

body.dark-mode .widget {
    background: var(--card-bg-dark);
    box-shadow: var(--shadow-dark);
    border: 1px solid var(--border-dark);
}

/* Date/time keeps its original frameless look */
.widget.datetime-widget {
    background: transparent;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    padding: 8px;
}
.widget.datetime-widget:hover { transform: none; box-shadow: none; }
body.dark-mode .widget.datetime-widget {
    background: transparent;
    border: none;
    box-shadow: none;
}

/* Entrance: each card eases in, gently staggered down the rail */
.widget-in { animation: widgetIn 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.rightcontainer .widget:nth-child(2).widget-in { animation-delay: 0.06s; }
.rightcontainer .widget:nth-child(3).widget-in { animation-delay: 0.12s; }
.rightcontainer .widget:nth-child(4).widget-in { animation-delay: 0.18s; }
.rightcontainer .widget:nth-child(5).widget-in { animation-delay: 0.24s; }
.rightcontainer .widget:nth-child(6).widget-in { animation-delay: 0.30s; }

@keyframes widgetIn {
    from { opacity: 0; transform: translateY(10px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* --- Shared widget typography --- */
.w-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-color-light);
    margin-bottom: 6px;
}
body.dark-mode .w-label { color: var(--text-color-dark); }

.w-empty {
    font-size: 0.8rem;
    color: var(--text-secondary-light);
}
body.dark-mode .w-empty { color: var(--text-secondary-dark); }

.w-join {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    color: #fff;
    background: linear-gradient(135deg, #B80C49, #d91456);
    padding: 6px 14px;
    border-radius: 50px;
    margin-top: 2px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.w-join:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(184, 12, 73, 0.3);
}
body.dark-mode .w-join {
    background: linear-gradient(135deg, #f5f5f5, #d9d4d4);
    color: #2b2d42;
}

/* --- Today's schedule --- */
.sched-count {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
}
body.dark-mode .sched-count { color: var(--text-color-dark); }

.sched-next {
    font-size: 0.85rem;
    color: var(--text-secondary-light);
    margin: 3px 0 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
body.dark-mode .sched-next { color: var(--text-secondary-dark); }

.day-track { margin: 12px 2px 0; }

.day-track-bar {
    position: relative;
    height: 10px;
    border-radius: 5px;
    background: rgba(184, 12, 73, 0.10);
    overflow: visible;
}
body.dark-mode .day-track-bar { background: rgba(245, 245, 245, 0.12); }

.dt-busy {
    position: absolute;
    top: 0;
    bottom: 0;
    background: rgba(184, 12, 73, 0.45);
    border-radius: 5px;
}
body.dark-mode .dt-busy { background: rgba(245, 245, 245, 0.45); }

.dt-focus {
    position: absolute;
    top: 0;
    bottom: 0;
    background: linear-gradient(135deg, #B80C49, #d91456);
    box-shadow: 0 0 8px rgba(217, 20, 86, 0.45);
    border-radius: 5px;
}
body.dark-mode .dt-focus {
    background: linear-gradient(135deg, #f06292, #d91456);
}

.dt-now {
    position: absolute;
    top: -3px;
    bottom: -3px;
    width: 2px;
    background: #333;
    border-radius: 1px;
}
body.dark-mode .dt-now { background: #f5f5f5; }

.day-track-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.65rem;
    color: var(--text-secondary-light);
    margin-top: 4px;
}
body.dark-mode .day-track-labels { color: var(--text-secondary-dark); }

.sched-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 0.78rem;
    color: var(--text-secondary-light);
    margin-top: 8px;
}
body.dark-mode .sched-meta { color: var(--text-secondary-dark); }

/* --- Document lists (Continue working / Shared with you) --- */
.w-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: left;
}

.w-item {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    padding: 6px 8px;
    border-radius: 10px;
    transition: background 0.2s ease, transform 0.2s ease;
}
.w-item:hover { background: rgba(184, 12, 73, 0.07); transform: translateX(2px); }
body.dark-mode .w-item:hover { background: rgba(245, 245, 245, 0.08); }

.w-badge {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.w-item-text { min-width: 0; display: flex; flex-direction: column; }

.w-item-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
body.dark-mode .w-item-title { color: var(--text-color-dark); }

.w-item-sub {
    font-size: 0.7rem;
    color: var(--text-secondary-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
body.dark-mode .w-item-sub { color: var(--text-secondary-dark); }

/* --- Service status --- */
.status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.82rem;
    color: #333;
    padding: 3px 4px;
}
body.dark-mode .status-row { color: var(--text-color-dark); }

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.status-dot.ok      { background: #27ae60; }
.status-dot.warn    { background: #f39c12; }
.status-dot.unknown { background: #9aa0a6; }
.status-dot.down {
    background: #e74c3c;
    animation: pulseDot 1.6s ease-in-out infinite;
}

@keyframes pulseDot {
    0%, 100% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.5); }
    50%      { box-shadow: 0 0 0 5px rgba(231, 76, 60, 0); }
}

.status-note {
    font-size: 0.65rem;
    color: var(--text-secondary-light);
    margin-top: 6px;
}
body.dark-mode .status-note { color: var(--text-secondary-dark); }

/* --- Add widgets button + panel --- */
.add-widgets {
    display: flex;
    justify-content: center;
    padding: 2px 0;
}

.add-widgets-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-color-light);
    background: var(--glass-bg-light);
    border: 1px dashed var(--border-light);
    border-radius: 50px;
    padding: 8px 16px;
    cursor: pointer;
    transition: all 0.25s ease;
}
.add-widgets-btn:hover {
    border-style: solid;
    background: rgba(184, 12, 73, 0.08);
    transform: translateY(-1px);
}
.add-widgets-btn:focus-visible {
    outline: 2px solid #B80C49;
    outline-offset: 2px;
}
body.dark-mode .add-widgets-btn {
    color: var(--text-color-dark);
    border-color: var(--border-dark);
    background: var(--glass-bg-dark);
}
body.dark-mode .add-widgets-btn:hover { background: rgba(245, 245, 245, 0.08); }

.awb-plus { font-size: 1rem; line-height: 1; }

.widget-panel {
    background: var(--card-bg-light);
    border: 1px solid var(--border-light);
    border-radius: 14px;
    box-shadow: var(--shadow-light);
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    animation: widgetIn 0.25s ease both;
}
body.dark-mode .widget-panel {
    background: var(--card-bg-dark);
    border-color: var(--border-dark);
    box-shadow: var(--shadow-dark);
}

.widget-panel-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 0.82rem;
    font-weight: 500;
    color: #333;
}
body.dark-mode .widget-panel-row { color: var(--text-color-dark); }

/* Re-brand the existing toggle switch (now used in the panel) */
.toggle-switch.active { background: linear-gradient(135deg, #B80C49, #d91456); }
.toggle-switch:focus-visible { outline: 2px solid #B80C49; outline-offset: 2px; }

.toggle-switch.small { width: 38px; height: 20px; }
.toggle-switch.small::before { width: 16px; height: 16px; }
.toggle-switch.small.active::before { transform: translateX(18px); }

/* --- Skeleton shimmer while Graph data loads --- */
.skel {
    display: block;
    height: 12px;
    border-radius: 6px;
    margin: 5px 0;
    background: linear-gradient(90deg,
        rgba(184, 12, 73, 0.08) 25%,
        rgba(184, 12, 73, 0.18) 50%,
        rgba(184, 12, 73, 0.08) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s linear infinite;
}
body.dark-mode .skel {
    background: linear-gradient(90deg,
        rgba(255, 255, 255, 0.07) 25%,
        rgba(255, 255, 255, 0.16) 50%,
        rgba(255, 255, 255, 0.07) 75%);
    background-size: 200% 100%;
}

@keyframes shimmer {
    from { background-position: 200% 0; }
    to   { background-position: -200% 0; }
}

/* --- Rail responsiveness ---
/* Below the width where the fixed rail collides with the centred
   content, drop it rather than stacking it above the page. */
@media (max-width: 1366px) {
    .rightcontainer { display: none; }
}

/* --- Reduced motion: keep it calm for users who ask for it --- */
@media (prefers-reduced-motion: reduce) {
    .widget-in, .widget-panel, .skel, .status-dot.down, .w-join.live { animation: none !important; }
    .widget.schedule-widget.live::before,
    .widget.schedule-widget.live::after { display: none; }
    .widget.schedule-widget.live { border-color: rgba(184, 12, 73, 0.55); }
    .widget, .w-item, .w-join, .add-widgets-btn { transition: none; }
    .widget:hover, .w-item:hover, .w-join:hover, .add-widgets-btn:hover { transform: none; }
}

/* ============================================================
   Modernisation pass
   ============================================================ */

/* Superellipse corners on card surfaces (Chromium 139+).
   Unsupported browsers keep the standard border-radius. Applied
   only to surfaces WITHOUT backdrop-filter: squircle clipping of a
   live blur region is new compositor territory and a suspected
   source of unclipped "ghost square" artefacts on some GPUs. */
.widget, .widget-panel {
    corner-shape: squircle;
}

/* Fixed-width numerals: the clock and schedule times no longer
   micro-shift as digits change. */
.time-display, .sched-next, .sched-meta, .day-track-labels {
    font-variant-numeric: tabular-nums;
}

/* View Transitions respect reduced motion. Kept as its own rule:
   browsers without these selectors would drop a combined rule. */
@media (prefers-reduced-motion: reduce) {
    ::view-transition-group(*),
    ::view-transition-old(*),
    ::view-transition-new(*) {
        animation: none !important;
    }
}

/* ============================================================
   Schedule live state, clickable status, rooms, weather rain
   ============================================================ */

/* "Join now" during a live meeting: gentle attention pulse */
.w-join.live { animation: joinPulse 2s ease-in-out infinite; }
body.dark-mode .w-join.live { animation-name: joinPulseDark; }

@keyframes joinPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(217, 20, 86, 0.45); }
    50%      { box-shadow: 0 0 0 6px rgba(217, 20, 86, 0); }
}
@keyframes joinPulseDark {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245, 245, 245, 0.35); }
    50%      { box-shadow: 0 0 0 6px rgba(245, 245, 245, 0); }
}

/* Status rows are now links to the relevant status page */
a.status-row {
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.2s ease;
}
a.status-row:hover { background: rgba(184, 12, 73, 0.07); }
body.dark-mode a.status-row:hover { background: rgba(245, 245, 245, 0.08); }

/* Meeting rooms: state-tinted rows with a Free/Busy chip and a
   mini 4-hour availability track (free = green base, bookings =
   red blocks), echoing the schedule widget's day-track language */
.room-row {
    text-align: left;
    padding: 8px 10px 9px;
    border-radius: 10px;
}
.room-row.free    { background: rgba(39, 174, 96, 0.07); }
.room-row.busy    { background: rgba(231, 76, 60, 0.07); }
.room-row.unknown { background: rgba(150, 150, 150, 0.09); }

.room-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.room-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
body.dark-mode .room-name { color: var(--text-color-dark); }

.room-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 2px 9px;
    border-radius: 50px;
}
.room-chip::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}
.room-chip.free    { color: #1e8e50; background: rgba(39, 174, 96, 0.14); }
.room-chip.busy    { color: #c0392b; background: rgba(231, 76, 60, 0.14); }
.room-chip.unknown { color: #777e87; background: rgba(150, 150, 150, 0.16); }
body.dark-mode .room-chip.free    { color: #5fd38f; }
body.dark-mode .room-chip.busy    { color: #ff8a7a; }
body.dark-mode .room-chip.unknown { color: #b8bcc4; }

.room-track {
    position: relative;
    height: 6px;
    border-radius: 3px;
    background: rgba(39, 174, 96, 0.18);
    overflow: hidden;
    margin: 8px 0 5px;
}
body.dark-mode .room-track { background: rgba(95, 211, 143, 0.22); }

.rt-busy {
    position: absolute;
    top: 0;
    bottom: 0;
    background: rgba(231, 76, 60, 0.55);
}
body.dark-mode .rt-busy { background: rgba(255, 138, 122, 0.6); }

.room-foot {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.7rem;
    color: var(--text-secondary-light);
}
body.dark-mode .room-foot { color: var(--text-secondary-dark); }

.room-horizon {
    flex-shrink: 0;
    font-size: 0.62rem;
    opacity: 0.75;
}

/* Weather: rain forecast line */
.weather-rain {
    font-size: 0.75rem;
    color: var(--text-secondary-light);
    margin-top: 4px;
}
body.dark-mode .weather-rain { color: var(--text-secondary-dark); }

/* ============================================================
   Live meeting border beam
   ------------------------------------------------------------
   While a joinable meeting is in progress, a crimson light
   segment travels around the schedule card border as a
   "you should be in this meeting" notice. Built from an
   animated conic-gradient masked to the border ring; browsers
   without @property support degrade to a static accent ring.
   ============================================================ */

@property --beam-angle {
    syntax: "<angle>";
    initial-value: 0deg;
    inherits: false;
}

.widget.schedule-widget { position: relative; }

.widget.schedule-widget.live::before,
.widget.schedule-widget.live::after {
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: 18px;
    corner-shape: squircle;
    padding: 2px;
    background: conic-gradient(from var(--beam-angle),
        transparent 0turn 0.72turn,
        rgba(184, 12, 73, 0.35) 0.84turn,
        #B80C49 0.92turn,
        #ff5c8d 0.97turn,
        transparent 1turn);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    animation: beamSpin 3.5s linear infinite;
    pointer-events: none;
}

/* Soft glow trailing the beam */
.widget.schedule-widget.live::after {
    inset: -3px;
    padding: 3px;
    filter: blur(7px);
    opacity: 0.75;
}

@keyframes beamSpin {
    to { --beam-angle: 360deg; }
}

/* ============================================================
   Commute widget
   Single-line rows: dot, name, right-aligned status. Fuller
   detail lives in the row tooltip.
   ============================================================ */
.commute-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 4px;
    font-size: 0.82rem;
    color: #333;
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.2s ease;
}
.commute-row:hover { background: rgba(184, 12, 73, 0.07); }
body.dark-mode .commute-row { color: var(--text-color-dark); }
body.dark-mode .commute-row:hover { background: rgba(245, 245, 245, 0.08); }

.commute-name {
    font-weight: 600;
    white-space: nowrap;
}

.commute-val {
    margin-left: auto;
    font-size: 0.72rem;
    text-align: right;
    color: var(--text-secondary-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
body.dark-mode .commute-val { color: var(--text-secondary-dark); }

.commute-refresh {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: inherit;
    text-decoration: underline;
    cursor: pointer;
}

/* ============================================================
   Drag-to-reorder handles on the widget rail
   ============================================================ */
.widget { position: relative; } /* anchors the handle */

/* Date/time is pinned: flex order keeps it at the top of the
   rail regardless of DOM order or any previously saved order. */
.widget.datetime-widget { order: -1; }

.w-drag {
    position: absolute;
    top: 6px;
    left: 8px;
    z-index: 2;
    font-size: 0.85rem;
    line-height: 1;
    color: var(--text-secondary-light);
    cursor: grab;
    opacity: 0;
    transition: opacity 0.15s ease;
    user-select: none;
}
.widget:hover .w-drag { opacity: 0.6; }
.w-drag:hover { opacity: 1 !important; }
.w-drag:active { cursor: grabbing; }
body.dark-mode .w-drag { color: var(--text-secondary-dark); }

.widget.dragging {
    opacity: 0.45;
    box-shadow: none;
}
