/* ===================================================
   styles.css — WCAG 2.1 AA Accessible Stylesheet
   My Office Hours
   =================================================== */

/* ===== RESET & BASE ===== */

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #f0f2f5;
    color: #1a1a2e;
    min-height: 100vh;
    line-height: 1.5;
}

/* ===== SKIP NAVIGATION ===== */
/* WCAG 2.4.1 — Bypass Blocks */

.skip-link {
    position: absolute;
    top: -100%;
    left: 0;
    z-index: 10000;
    padding: 12px 24px;
    background: #1a1a2e;
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 0 0 8px 0;
    transition: top 0.15s ease;
}

.skip-link:focus {
    top: 0;
    outline: 3px solid #4ecdc4;
    outline-offset: 2px;
}

/* ===== VISUALLY HIDDEN (screen-reader only) ===== */
/* WCAG 1.3.1 — Info and Relationships */

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ===== OPTIONAL LABEL HELPER ===== */

.optional-label {
    font-weight: 400;
    font-style: italic;
    color: #595959;
}

/* ===== EMBED INSTRUCTIONS ===== */

.embed-instructions {
    font-size: 14px;
    color: #555;
    margin-bottom: 8px;
}

/* ===== TOOLBAR / BANNER ===== */

.toolbar {
    background: #252C26;
    color: #ffffff;
    padding: 10px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toolbar-logo {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: #ffffff;
}

.toolbar-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.toolbar-btn {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s, outline 0.15s;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.toolbar-btn:hover {
    background: rgba(255, 255, 255, 0.22);
}

/* WCAG 2.4.7 — Focus Visible */
.toolbar-btn:focus-visible {
    outline: 3px solid #4ecdc4;
    outline-offset: 2px;
}

.toolbar-btn.active-preview {
    background: #4ecdc4;
    color: #1a1a2e;
    border-color: #4ecdc4;
    font-weight: 600;
}

/* ===== CONTAINER ===== */

.container {
    max-width: 960px;
    margin: 24px auto;
    padding: 0 16px;
}

/* ===== PROFESSOR CARD ===== */

.prof-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    position: relative;
}

.prof-card.card-centered {
    text-align: center;
}

.prof-card.card-business {
    text-align: left;
    display: flex !important;
    flex-direction: row !important;
    gap: 24px;
    align-items: stretch;
    flex-wrap: nowrap;
}

.prof-card .prof-photo-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    flex-shrink: 0;
}

.prof-card .prof-photo {
    width: 230px;
    height: 230px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    transition: width 0.2s, height 0.2s;
}

.prof-card .prof-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.prof-card .prof-header {
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-bottom: 0;
}

.prof-card .prof-center-row {
    display: flex;
    flex-direction: row;
    gap: 24px;
    align-items: stretch;
}

.prof-card .prof-center {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.prof-card .prof-right {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
}

.prof-card.card-business.no-photo {
    text-align: center;
    min-height: 210px;
}

.prof-card.card-business.no-photo .prof-center-row {
    flex-direction: column;
    align-items: center;
}

.prof-card.card-business.no-photo .prof-center {
    align-items: center;
}

.prof-card.card-business.no-photo .prof-divider {
    margin-left: auto;
    margin-right: auto;
}

.prof-card.card-business.no-photo .prof-details {
    justify-content: center;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px;
    padding-left: 140px;
    padding-right: 140px;
}

.prof-card.card-business.no-photo .prof-right {
    position: absolute;
    bottom: 24px;
    right: 20px;
}

/* Name & identity */

.prof-card .prof-name {
    font-size: 42px;
    font-weight: 700;
    margin-bottom: 0;
    line-height: 1.2;
    margin-top: 0;
}

.prof-card .prof-name .prof-credentials-inline {
    font-weight: 400;
}

/* WCAG 1.4.3 — Contrast: #595959 on white = 5.9:1 */
.prof-card .prof-pronouns-line {
    font-size: 13px;
    font-style: italic;
    color: #595959;
    margin-top: -2px;
    margin-bottom: 6px;
    line-height: 1.4;
}

/* WCAG 1.4.3 — Contrast: #595959 on white = 5.9:1 */
.prof-card .prof-title {
    font-size: 13px;
    color: #595959;
    line-height: 1.4;
    margin-bottom: 1px;
}

.prof-card .prof-institution {
    font-size: 13px;
    color: #595959;
    margin-bottom: 10px;
    line-height: 1.4;
}

/* Divider */
.prof-card .prof-divider {
    width: 50px;
    height: 2px;
    margin-bottom: 10px;
}

/* Contact details */
.prof-card .prof-details {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12.5px;
    color: #444;
    line-height: 1.7;
}

.prof-card.card-centered .prof-details {
    justify-content: center;
    gap: 16px;
}

.prof-card.card-business .prof-details {
    flex-direction: column;
    gap: 0;
}

.prof-card .prof-detail-item {
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.7;
    width: fit-content;
}

.prof-card .prof-detail-item svg {
    flex-shrink: 0;
}

.prof-card .prof-details a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
}

.prof-card .prof-details a:hover {
    text-decoration: underline;
}

/* WCAG 2.4.7 — Focus Visible on links */
.prof-card .prof-details a:focus-visible {
    outline: 3px solid #2a9d94;
    outline-offset: 2px;
    border-radius: 3px;
}

/* Edit button */
.prof-card .edit-btn,
.calendar-wrapper .edit-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 12px;
    color: #595959;
    cursor: pointer;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.prof-card .edit-btn:hover,
.calendar-wrapper .edit-btn:hover {
    background: #f5f5f5;
    color: #333;
}

.prof-card .edit-btn:focus-visible,
.calendar-wrapper .edit-btn:focus-visible {
    outline: 3px solid #2a9d94;
    outline-offset: 2px;
}

/* ===== QR SECTION ===== */

.qr-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    position: relative;
    top: 2px;
}

.qr-section canvas {
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    cursor: pointer;
}

/* WCAG 1.4.3 — #595959 on white = 5.9:1 */
.qr-label {
    font-size: 11px;
    color: #595959;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
    width: 120px;
    line-height: 1.3;
}

.save-contact-link {
    background: none;
    border: none;
    padding: 0;
    font-size: 9px;
    color: #595959;
    cursor: pointer;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color 0.2s;
    display: none;
}

.save-contact-link:hover {
    color: #333;
    text-decoration: underline;
}

.save-contact-link:focus-visible {
    outline: 3px solid #2a9d94;
    outline-offset: 2px;
}

/* ===== CALENDAR WRAPPER ===== */

.calendar-wrapper {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
    position: relative;
}

.calendar-wrapper .edit-btn {
    z-index: 10;
    background: #ffffff;
}

.cal-semester-row {
    border-radius: 1px 1px 0 0;
    padding: 14px 20px 10px;
    text-align: center;
}

.cal-semester-label {
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 2px;
}

/* WCAG 1.4.3 — rgba(255,255,255,0.78) on dark bg: ensure JS-generated
   theme colors maintain 4.5:1. Bumped opacity for safety. */
.cal-semester-dates {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
    font-style: italic;
}

/* ===== CALENDAR GRID ===== */

.calendar {
    display: grid;
    border: 3px solid var(--theme-color, #252C26);
    border-radius: 8px;
    overflow: hidden;
    user-select: none;
}

.cal-header {
    color: #ffffff;
    font-weight: 600;
    font-size: 14px;
    padding: 10px 8px;
    text-align: center;
}

.cal-header.time-col {
    font-size: 12px;
}

.cal-time {
    background: #f8f9fa;
    font-size: 11px;
    color: #595959;
    padding: 0 4px;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding-top: 2px;
    border-right: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
    height: 52px;
}

.cal-cell {
    border-right: 1px solid #f0f0f0;
    border-bottom: 1px solid #e0e0e0;
    height: 52px;
    position: relative;
    cursor: pointer;
    transition: background 0.1s;
}

.cal-cell:last-child {
    border-right: none;
}

.cal-cell.drag-highlight {
    background: rgba(42, 157, 148, 0.2);
}

.cal-cell.preview-mode {
    cursor: default;
}

.drag-highlight-overlay {
    position: absolute;
    left: 0;
    right: 0;
    background: rgba(42, 157, 148, 0.25);
    border: 2px dashed rgba(42, 157, 148, 0.6);
    pointer-events: none;
    z-index: 5;
    border-radius: 3px;
}

/* ===== CALENDAR BLOCKS ===== */

.cal-block {
    position: absolute;
    border-radius: 4px;
    padding: 3px 6px 0 6px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    z-index: 10;
    overflow: hidden;
    line-height: 1.2;
    transition: opacity 0.15s;
}

.cal-block:hover {
    opacity: 0.85;
}

/* WCAG 2.4.7 — Focus Visible */
.cal-block:focus-visible {
    outline: 3px solid #1a1a2e;
    outline-offset: 2px;
    z-index: 15;
}

/* Fallback for browsers without :focus-visible */
.cal-block:focus {
    outline: 2px solid #333;
    outline-offset: 1px;
}

/* Remove double outline on browsers that support :focus-visible */
.cal-block:focus:not(:focus-visible) {
    outline: none;
}

.cal-block.focus-return:focus {
    outline: 3px solid #1a1a2e;
    outline-offset: 2px;
    z-index: 15;
}

.cal-block.highlighted {
    border-left-width: 6px !important;
    opacity: 1 !important;
}

.cal-block.faded {
    opacity: 1;
}

.cal-block .block-inner {
    overflow: hidden;
}

.cal-block .block-title {
    display: block;
}

.cal-block .block-time-label {
    display: block;
    font-weight: 400;
    font-size: 10px;
}

.cal-block .block-location {
    display: block;
    font-weight: 400;
    font-size: 10px;
}

.cal-block .block-location a {
    color: inherit;
    text-decoration: underline;
}

.cal-block .block-location a:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 1px;
    border-radius: 2px;
}

.cal-block .block-note {
    display: block;
    font-weight: 400;
    font-size: 10px;
    font-style: italic;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.resize-handle {
    position: absolute;
    left: 0;
    right: 0;
    height: 6px;
    cursor: ns-resize;
    z-index: 20;
}

.resize-handle-top {
    top: 0;
}

.resize-handle-bottom {
    bottom: 0;
}

/* ===== LEGEND ===== */

.legend {
    display: flex;
    justify-content: center;
    gap: 24px;
    padding: 12px;
    flex-wrap: wrap;
    list-style: none;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #555;
}

.legend-color {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    display: inline-block;
}

.holidays-footnote {
    text-align: center;
    font-size: 11px;
    color: #595959;
    padding: 4px 16px 8px;
    line-height: 1.5;
}

/* ===== BLOCK POPOVER ===== */

.block-popover {
    position: fixed;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    padding: 16px;
    z-index: 500;
    width: 260px;
    font-size: 13px;
    color: #333;
}

.block-popover .pop-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 6px;
    margin-top: 0;
    padding-right: 24px;
}

.block-popover .pop-type {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 8px;
}

.block-popover .pop-row {
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.block-popover .pop-row a {
    color: #0b5cad;
    text-decoration: underline;
}

.block-popover .pop-row a:focus-visible {
    outline: 3px solid #2a9d94;
    outline-offset: 2px;
    border-radius: 2px;
}

.block-popover .pop-close {
    position: absolute;
    top: 8px;
    right: 10px;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #595959;
    z-index: 510;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.block-popover .pop-close:hover {
    color: #333;
    background: #f0f0f0;
}

.block-popover .pop-close:focus-visible {
    outline: 3px solid #2a9d94;
    outline-offset: 2px;
}

.block-popover .pop-ics-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #2a9d94;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
    transition: background 0.15s;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.block-popover .pop-ics-btn:hover {
    background: #247d75;
}

.block-popover .pop-ics-btn:focus-visible {
    outline: 3px solid #1a1a2e;
    outline-offset: 2px;
}

/* ===== MODAL BASE ===== */

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 200;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: #ffffff;
    border-radius: 12px;
    padding: 28px;
    width: 420px;
    max-width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal[role="dialog"] {
    outline: none;
}

.modal h2 {
    font-size: 20px;
    margin-bottom: 20px;
    color: #1a1a2e;
}

.modal.has-sticky-actions {
    padding-bottom: 80px;
    position: relative;
}

.modal-actions-sticky {
    position: sticky;
    bottom: -28px;
    background: #ffffff;
    padding: 16px 28px;
    margin: 20px -28px -28px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 8px;
    border-radius: 0 0 12px 12px;
    z-index: 10;
}

/* ===== PROFESSOR MODAL ===== */

.prof-modal-inner {
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    width: 580px;
    max-width: 95vw;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.prof-modal-header {
    padding: 20px 28px 16px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.prof-modal-header h2 {
    margin: 0;
    font-size: 20px;
    color: #1a1a2e;
}

.prof-modal-header .modal-close-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #595959;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    min-width: 36px;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.prof-modal-header .modal-close-btn:hover {
    color: #333;
    background: #f0f0f0;
}

.prof-modal-header .modal-close-btn:focus-visible {
    outline: 3px solid #2a9d94;
    outline-offset: 2px;
}

.prof-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 28px;
}

.prof-modal-footer {
    padding: 16px 28px;
    border-top: 1px solid #eee;
    flex-shrink: 0;
    display: flex;
    gap: 8px;
    background: #ffffff;
    border-radius: 0 0 12px 12px;
}

/* ===== CALENDAR SETTINGS MODAL ===== */

.cal-modal-inner {
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    width: 580px;
    max-width: 95vw;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.cal-modal-header {
    padding: 20px 28px 16px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cal-modal-header h2 {
    margin: 0;
    font-size: 20px;
    color: #1a1a2e;
}

.cal-modal-header .modal-close-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #595959;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    min-width: 36px;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cal-modal-header .modal-close-btn:hover {
    color: #333;
    background: #f0f0f0;
}

.cal-modal-header .modal-close-btn:focus-visible {
    outline: 3px solid #2a9d94;
    outline-offset: 2px;
}

.cal-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 28px;
}

.cal-modal-footer {
    padding: 16px 28px;
    border-top: 1px solid #eee;
    flex-shrink: 0;
    display: flex;
    gap: 8px;
    background: #ffffff;
    border-radius: 0 0 12px 12px;
}

/* ===== SECTION DIVIDERS / FIELDSETS ===== */

.form-section {
    margin-bottom: 20px;
    border: none;
    padding: 0;
}

.form-section-header {
    font-size: 15px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid #eee;
}

/* When used as <legend> inside <fieldset> */
fieldset.form-section,
fieldset.form-group {
    border: none;
    padding: 0;
    margin: 0 0 20px 0;
}

fieldset.form-section > legend.form-section-header {
    width: 100%;
    font-size: 15px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid #eee;
}

/* ===== PHOTO UPLOAD ===== */

.photo-upload-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.photo-preview {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 3px solid #e0e0e0;
}

.photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-preview .photo-placeholder {
    font-size: 36px;
    color: #ccc;
}

.photo-actions {
    display: flex;
    gap: 8px;
}

.photo-btn {
    background: #f0f0f0;
    color: #555;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 12px;
    cursor: pointer;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.photo-btn:hover {
    background: #e0e0e0;
    color: #333;
}

.photo-btn:focus-visible {
    outline: 3px solid #2a9d94;
    outline-offset: 2px;
}

.photo-btn.photo-remove {
    color: #dc2626;
}

.photo-btn.photo-remove:hover {
    background: #fee2e2;
    border-color: #fca5a5;
}

.photo-size-hint {
    font-size: 11px;
    color: #595959;
}

/* ===== PHOTO CROP ===== */

.photo-crop-container {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.photo-crop-container.active {
    display: flex;
}

.photo-crop-viewport {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
    cursor: grab;
    border: 2px solid #ddd;
    background: #f0f0f0;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.photo-crop-viewport:active {
    cursor: grabbing;
}

.photo-crop-viewport img {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    -webkit-user-drag: none;
    user-select: none;
    -webkit-user-select: none;
}

.photo-crop-zoom {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 200px;
}

.photo-crop-zoom label {
    font-size: 11px;
    color: #595959;
    white-space: nowrap;
}

.photo-crop-zoom input[type="range"] {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: #ddd;
    border-radius: 2px;
    outline: none;
}

.photo-crop-zoom input[type="range"]:focus-visible {
    outline: 3px solid #2a9d94;
    outline-offset: 4px;
}

.photo-crop-zoom input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #595959;
    cursor: pointer;
}

.photo-crop-zoom input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #595959;
    cursor: pointer;
    border: none;
}

/* ===== PRINT TOGGLE ===== */

.print-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    padding: 2px 4px;
    border-radius: 4px;
    opacity: 0.5;
    transition: opacity 0.15s;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    flex-shrink: 0;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.print-toggle-btn:hover {
    opacity: 0.7;
}

.print-toggle-btn:focus-visible {
    outline: 3px solid #2a9d94;
    outline-offset: 2px;
    opacity: 1;
}

.print-toggle-btn.print-on {
    opacity: 0.5;
}

.print-toggle-btn.print-off {
    opacity: 0.5;
}

.print-toggle-btn.print-off::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 0;
    background: linear-gradient(to top right, transparent 43%, #888 43%, #888 57%, transparent 57%);
    pointer-events: none;
}

.form-group .print-toggle-inline {
    display: flex;
    align-items: center;
    gap: 6px;
}

.form-group .print-toggle-inline input {
    flex: 1;
}

.location-row-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}

.location-row-wrap .location-row {
    flex: 1;
}

.location-row-wrap > .print-toggle-btn {
    margin-top: 18px;
}

/* ===== FORM GROUPS ===== */

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    color: #333;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #ffffff;
}

/* WCAG 2.4.7 — Focus Visible with sufficient contrast */
.form-group input:focus-visible,
.form-group select:focus-visible,
.form-group textarea:focus-visible {
    outline: 3px solid #2a9d94;
    outline-offset: 1px;
    border-color: #2a9d94;
}

/* Fallback focus for older browsers */
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2a9d94;
    box-shadow: 0 0 0 3px rgba(42, 157, 148, 0.25);
}

.form-group input:focus:not(:focus-visible),
.form-group select:focus:not(:focus-visible),
.form-group textarea:focus:not(:focus-visible) {
    outline: none;
    border-color: #4ecdc4;
    box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.15);
}

/* ===== FORM ROWS ===== */

.time-row {
    display: flex;
    gap: 12px;
}

.time-row .form-group {
    flex: 1;
}

.name-row {
    display: flex;
    gap: 12px;
}

.name-row .form-group.name-title {
    flex: 0 0 80px;
}

.name-row .form-group.name-first {
    flex: 1;
}

.name-row .form-group.name-last {
    flex: 1;
}

.position-row {
    display: flex;
    gap: 12px;
}

.position-row .form-group {
    flex: 1;
}

.location-row {
    display: flex;
    gap: 12px;
}

.location-row .form-group.loc-building {
    flex: 2;
}

.location-row .form-group.loc-room {
    flex: 0 0 90px;
}

.location-row .form-group.loc-campus {
    flex: 1.5;
}

.semester-row {
    display: flex;
    gap: 12px;
}

.semester-row .form-group.sem-term {
    flex: 0 0 110px;
}

.semester-row .form-group.sem-year {
    flex: 0 0 90px;
}

.semester-row .form-group.sem-label {
    flex: 1;
}

.date-row {
    display: flex;
    gap: 12px;
}

.date-row .form-group {
    flex: 1;
}

/* ===== PRONOUN FIELD ===== */

.pronoun-group {
    margin-bottom: 14px;
}

.pronoun-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.pronoun-select-wrap {
    position: relative;
}

.pronoun-select-wrap select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    color: #333;
    background: #ffffff;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.pronoun-select-wrap select:focus-visible {
    outline: 3px solid #2a9d94;
    outline-offset: 1px;
    border-color: #2a9d94;
}

.pronoun-select-wrap select:focus {
    outline: none;
    border-color: #2a9d94;
    box-shadow: 0 0 0 3px rgba(42, 157, 148, 0.25);
}

.pronoun-select-wrap select:focus:not(:focus-visible) {
    outline: none;
    border-color: #4ecdc4;
    box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.15);
}

.pronoun-custom-wrap {
    display: flex;
    gap: 8px;
    align-items: center;
}

.pronoun-custom-wrap input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    color: #333;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.pronoun-custom-wrap input:focus-visible {
    outline: 3px solid #2a9d94;
    outline-offset: 1px;
    border-color: #2a9d94;
}

.pronoun-custom-wrap input:focus {
    outline: none;
    border-color: #2a9d94;
    box-shadow: 0 0 0 3px rgba(42, 157, 148, 0.25);
}

.pronoun-custom-wrap .pronoun-back-btn {
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #595959;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    flex-shrink: 0;
    min-width: 36px;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pronoun-custom-wrap .pronoun-back-btn:hover {
    background: #e0e0e0;
    color: #333;
}

.pronoun-custom-wrap .pronoun-back-btn:focus-visible {
    outline: 3px solid #2a9d94;
    outline-offset: 2px;
}

/* ===== DAY CHECKBOXES ===== */

.day-checkboxes {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.day-checkbox {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.15s;
    user-select: none;
}

.day-checkbox:focus-within {
    outline: 3px solid #2a9d94;
    outline-offset: 1px;
}

.day-checkbox.selected {
    background: #2a9d94;
    color: #ffffff;
    border-color: #2a9d94;
}

/* ===== TYPE OPTIONS ===== */

.form-type-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.type-option {
    padding: 6px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.15s;
    user-select: none;
}

.type-option:focus-visible {
    outline: 3px solid #2a9d94;
    outline-offset: 2px;
}

.type-option.selected {
    border-color: #333;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.2);
}

/* ===== SHOW NOTE TOGGLE ===== */

.show-note-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

.show-note-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #2a9d94;
    cursor: pointer;
}

.show-note-toggle input[type="checkbox"]:focus-visible {
    outline: 3px solid #2a9d94;
    outline-offset: 2px;
}

.show-note-toggle label {
    font-size: 12px;
    color: #555;
    cursor: pointer;
    font-weight: 400;
}

/* ===== ICS TOGGLE ===== */

.ics-toggle-section {
    margin-top: 14px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #eee;
}

.ics-toggle-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ics-toggle-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #2a9d94;
    cursor: pointer;
}

.ics-toggle-row input[type="checkbox"]:focus-visible {
    outline: 3px solid #2a9d94;
    outline-offset: 2px;
}

.ics-toggle-row label {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
}

.ics-toggle-desc {
    font-size: 12px;
    color: #595959;
    margin-top: 4px;
    line-height: 1.4;
}

.ics-toggle-warning {
    font-size: 12px;
    color: #92400e;
    background: #fef3c7;
    border: 1px solid #fde68a;
    border-radius: 6px;
    padding: 8px 10px;
    margin-top: 8px;
    line-height: 1.4;
}

.ics-toggle-nudge {
    font-size: 12px;
    color: #075985;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 6px;
    padding: 8px 10px;
    margin-top: 8px;
    line-height: 1.4;
}

.ics-title-suggest {
    font-size: 12px;
    color: #555;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 6px;
    padding: 8px 10px;
    margin-top: 8px;
    line-height: 1.4;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.ics-title-suggest .use-btn {
    background: #2a9d94;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.ics-title-suggest .use-btn:hover {
    background: #247d75;
}

.ics-title-suggest .use-btn:focus-visible {
    outline: 3px solid #1a1a2e;
    outline-offset: 2px;
}

.ics-disabled-msg {
    font-size: 12px;
    color: #595959;
    margin-top: 4px;
    font-style: italic;
}

/* ===== MODAL ACTIONS ===== */

.modal-actions {
    display: flex;
    gap: 8px;
    margin-top: 20px;
}

.modal-btn {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    /* WCAG 2.5.5 — Target Size: min 44×44 CSS px recommended */
    min-height: 44px;
}

/* WCAG 2.4.7 — Focus Visible */
.modal-btn:focus-visible {
    outline: 3px solid #1a1a2e;
    outline-offset: 2px;
}

.btn-save {
    background: #2a9d94;
    color: #ffffff;
}

.btn-save:hover {
    background: #247d75;
}

.btn-cancel {
    background: #f0f0f0;
    color: #333;
}

.btn-cancel:hover {
    background: #e0e0e0;
}

.btn-delete {
    background: #fee2e2;
    color: #b91c1c;
}

.btn-delete:hover {
    background: #fecaca;
}

/* ===== COLOR PICKER ===== */

.color-picker-group {
    margin-bottom: 16px;
}

.color-picker-group > label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.color-preset-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.color-swatch {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
    /* WCAG 2.5.5 — minimum target */
    min-width: 32px;
    min-height: 32px;
}

.color-swatch:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.color-swatch:focus-visible {
    outline: 3px solid #1a1a2e;
    outline-offset: 2px;
}

.color-swatch.active {
    border-color: #333;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.3);
}

.color-swatch .swatch-check {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 16px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.color-swatch.active .swatch-check {
    display: block;
}

.custom-color-toggle {
    background: none;
    border: none;
    color: #555;
    font-size: 13px;
    cursor: pointer;
    padding: 4px 0;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.custom-color-toggle:hover {
    color: #333;
}

.custom-color-toggle:focus-visible {
    outline: 3px solid #2a9d94;
    outline-offset: 2px;
}

.custom-color-section {
    display: none;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 16px;
    margin-top: 8px;
}

.custom-color-section.open {
    display: block;
}

.color-preview-bar {
    height: 36px;
    border-radius: 6px;
    margin-bottom: 12px;
    border: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.hue-slider-wrap {
    margin-bottom: 12px;
}

.hue-slider-wrap label {
    display: block;
    font-size: 12px;
    color: #555;
    margin-bottom: 4px;
}

.hue-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 20px;
    border-radius: 10px;
    background: linear-gradient(to right, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000);
    outline: none;
    cursor: pointer;
}

.hue-slider:focus-visible {
    outline: 3px solid #1a1a2e;
    outline-offset: 4px;
}

.hue-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #ffffff;
    border: 3px solid #333;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    cursor: pointer;
}

.hue-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #ffffff;
    border: 3px solid #333;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    cursor: pointer;
}

.brightness-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 20px;
    border-radius: 10px;
    outline: none;
    cursor: pointer;
}

.brightness-slider:focus-visible {
    outline: 3px solid #1a1a2e;
    outline-offset: 4px;
}

.brightness-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #ffffff;
    border: 3px solid #333;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    cursor: pointer;
}

.brightness-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #ffffff;
    border: 3px solid #333;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    cursor: pointer;
}

.hex-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.hex-row label {
    font-size: 12px;
    color: #555;
    margin: 0;
}

.hex-row input {
    width: 100px;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    font-family: 'Courier New', monospace;
}

.hex-row input:focus-visible {
    outline: 3px solid #2a9d94;
    outline-offset: 1px;
    border-color: #2a9d94;
}

.hex-row input:focus {
    outline: none;
    border-color: #2a9d94;
    box-shadow: 0 0 0 3px rgba(42, 157, 148, 0.25);
}

/* ===== TYPE MANAGER ===== */

.type-manager {
    margin-bottom: 16px;
}

.type-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.type-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 8px;
    transition: background 0.15s, box-shadow 0.15s;
}

.type-row.dragging {
    opacity: 0.5;
    background: #e0f7f5;
}

.type-row.drag-over-top {
    box-shadow: 0 -2px 0 0 #4ecdc4 inset;
}

.type-row.drag-over-bottom {
    box-shadow: 0 2px 0 0 #4ecdc4 inset;
}

.type-row-handle {
    cursor: grab;
    color: #999;
    font-size: 16px;
    user-select: none;
    padding: 0 4px;
    flex-shrink: 0;
}

.type-row-handle:active {
    cursor: grabbing;
}

.type-row-color {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
}

.type-row-color:hover {
    transform: scale(1.05);
}

.type-row-color:focus-visible {
    outline: 3px solid #1a1a2e;
    outline-offset: 2px;
}

.type-row-name {
    flex: 1;
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.type-row-name:focus-visible {
    outline: 3px solid #2a9d94;
    outline-offset: 2px;
    border-color: #2a9d94;
}

.type-row-name:focus {
    outline: 2px solid #2a9d94;
    outline-offset: 2px;
    border-color: #2a9d94;
}

.type-row-highlight {
    display: flex;
    align-items: center;
    gap: 3px;
    cursor: pointer;
    font-size: 11px;
    color: #555;
    user-select: none;
    flex-shrink: 0;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.15s;
}

.type-row-highlight:hover {
    background: #eee;
}

.type-row-highlight input {
    width: 14px;
    height: 14px;
    accent-color: #f59e0b;
    cursor: pointer;
}

.type-row-highlight input:focus-visible {
    outline: 3px solid #2a9d94;
    outline-offset: 2px;
}

.type-row-highlight span {
    white-space: nowrap;
}

.type-row-delete {
    background: none;
    border: none;
    color: #999;
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    min-width: 28px;
    min-height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.type-row-delete:hover {
    color: #b91c1c;
    background: #fee2e2;
}

.type-row-delete:focus-visible {
    outline: 3px solid #2a9d94;
    outline-offset: 2px;
}

.add-type-btn {
    background: none;
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 13px;
    color: #555;
    cursor: pointer;
    width: 100%;
    transition: all 0.15s;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    min-height: 44px;
}

.add-type-btn:hover {
    border-color: #2a9d94;
    color: #2a9d94;
}

.add-type-btn:focus-visible {
    outline: 3px solid #2a9d94;
    outline-offset: 2px;
}

.add-type-btn.hidden-btn {
    display: none;
}

.type-color-picker {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 300;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    padding: 12px;
    display: none;
    width: 200px;
}

.type-color-picker.open {
    display: block;
}

.type-color-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
}

.type-color-swatch {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 6px;
    border: 2px solid transparent;
    cursor: pointer;
    min-width: 28px;
    min-height: 28px;
}

.type-color-swatch:hover {
    transform: scale(1.1);
    border-color: #333;
}

.type-color-swatch:focus-visible {
    outline: 3px solid #1a1a2e;
    outline-offset: 2px;
}

.type-color-swatch.active {
    border-color: #333;
}

/* ===== SEGMENTED CONTROL ===== */

.segmented-control {
    display: flex;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 14px;
}

.segmented-btn {
    flex: 1;
    padding: 8px 16px;
    border: none;
    background: #ffffff;
    color: #555;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    text-align: center;
    min-height: 44px;
}

.segmented-btn:first-child {
    border-right: 1px solid #ddd;
}

.segmented-btn.active {
    background: #f0f0f0;
    color: #1a1a2e;
    font-weight: 700;
}

.segmented-btn:hover:not(.active) {
    background: #f8f8f8;
}

.segmented-btn:focus-visible {
    outline: 3px solid #2a9d94;
    outline-offset: -3px;
}

/* ===== CALENDAR HOURS ===== */

.cal-hours-row {
    display: flex;
    gap: 12px;
    margin-bottom: 14px;
}

.cal-hours-row .form-group {
    flex: 1;
}

/* ===== HOLIDAYS ===== */

.holidays-section {
    margin-bottom: 0;
}

.holiday-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    flex-wrap: nowrap;
}

.holiday-row input[type="date"] {
    width: 120px;
    min-width: 0;
    padding: 6px 4px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 12px;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    flex-shrink: 0;
}

.holiday-row input[type="date"]:focus-visible {
    outline: 3px solid #2a9d94;
    outline-offset: 1px;
    border-color: #2a9d94;
}

.holiday-row input[type="date"]:focus {
    outline: none;
    border-color: #2a9d94;
    box-shadow: 0 0 0 3px rgba(42, 157, 148, 0.25);
}

.holiday-row input[type="text"] {
    flex: 1;
    min-width: 0;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 12px;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.holiday-row input[type="text"]:focus-visible {
    outline: 3px solid #2a9d94;
    outline-offset: 1px;
    border-color: #2a9d94;
}

.holiday-row input[type="text"]:focus {
    outline: none;
    border-color: #2a9d94;
    box-shadow: 0 0 0 3px rgba(42, 157, 148, 0.25);
}

.holiday-row .holiday-delete {
    background: none;
    border: none;
    color: #999;
    font-size: 14px;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    flex-shrink: 0;
    min-width: 28px;
    min-height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.holiday-row .holiday-delete:hover {
    color: #b91c1c;
    background: #fee2e2;
}

.holiday-row .holiday-delete:focus-visible {
    outline: 3px solid #2a9d94;
    outline-offset: 2px;
}

.add-holiday-btn {
    background: none;
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 12px;
    color: #555;
    cursor: pointer;
    width: 100%;
    transition: all 0.15s;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    min-height: 40px;
}

.add-holiday-btn:hover {
    border-color: #2a9d94;
    color: #2a9d94;
}

.add-holiday-btn:focus-visible {
    outline: 3px solid #2a9d94;
    outline-offset: 2px;
}

/* ===== ADDITIONAL CONTACTS ===== */

.additional-contacts {
    margin-top: 16px;
}

.additional-contacts-label {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    display: block;
}

.contact-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.contact-row-type {
    width: 160px;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    flex-shrink: 0;
}

.contact-row-type:focus-visible {
    outline: 3px solid #2a9d94;
    outline-offset: 2px;
    border-color: #2a9d94;
}

.contact-row-type:focus {
    outline: 2px solid #2a9d94;
    outline-offset: 2px;
    border-color: #2a9d94;
}

.contact-row-value {
    flex: 1;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.contact-row-value:focus-visible {
    outline: 3px solid #2a9d94;
    outline-offset: 2px;
    border-color: #2a9d94;
}

.contact-row-value:focus {
    outline: 2px solid #2a9d94;
    outline-offset: 2px;
    border-color: #2a9d94;
}

.contact-row-delete {
    background: none;
    border: none;
    color: #999;
    font-size: 14px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    min-width: 28px;
    min-height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.contact-row-delete:hover {
    color: #b91c1c;
    background: #fee2e2;
}

.contact-row-delete:focus-visible {
    outline: 3px solid #2a9d94;
    outline-offset: 2px;
}

.add-contact-btn {
    background: none;
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 12px;
    color: #555;
    cursor: pointer;
    width: 100%;
    transition: all 0.15s;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    min-height: 40px;
}

.add-contact-btn:hover {
    border-color: #2a9d94;
    color: #2a9d94;
}

.add-contact-btn:focus-visible {
    outline: 3px solid #2a9d94;
    outline-offset: 2px;
}

.add-contact-btn.hidden-btn {
    display: none;
}

/* ===== QR TOGGLE (in prof modal) ===== */

.qr-toggle-section {
    margin-top: 16px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #eee;
}

.qr-toggle-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.qr-toggle-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #2a9d94;
    cursor: pointer;
}

.qr-toggle-row input[type="checkbox"]:focus-visible {
    outline: 3px solid #2a9d94;
    outline-offset: 2px;
}

.qr-toggle-row label {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
}

.qr-toggle-desc {
    font-size: 12px;
    color: #555;
    margin-top: 4px;
    line-height: 1.4;
}

.qr-notes-group {
    margin-top: 10px;
    display: none;
}

.qr-notes-group.open {
    display: block;
}

.qr-notes-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.qr-notes-group input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    color: #333;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.qr-notes-group input:focus-visible {
    outline: 3px solid #2a9d94;
    outline-offset: 1px;
    border-color: #2a9d94;
}

/* ===== QR LOGO UPLOAD ===== */

.qr-logo-group {
    margin-top: 10px;
    display: none;
}

.qr-logo-group.open {
    display: block;
}

.qr-logo-group > label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.field-hint {
    font-size: 12px;
    color: #595959;
    margin: 2px 0 0 0;
    line-height: 1.4;
}

.logo-upload-area {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.logo-preview-wrap {
    position: relative;
    display: inline-block;
}

.qr-logo-preview {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fafafa;
}

.logo-remove-btn {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #e74c3c;
    color: #fff;
    border: 2px solid #fff;
    font-size: 11px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.logo-remove-btn:hover {
    background: #c0392b;
}

.logo-remove-btn:focus-visible {
    outline: 3px solid #2a9d94;
    outline-offset: 2px;
}

.photo-upload-btn {
    background: #f0f0f0;
    color: #555;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 12px;
    cursor: pointer;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 36px;
}

.photo-upload-btn:hover {
    background: #e0e0e0;
    color: #333;
}

.photo-upload-btn:focus-visible {
    outline: 3px solid #2a9d94;
    outline-offset: 2px;
}

.form-group textarea:focus-visible {
    outline: 3px solid #2a9d94;
    outline-offset: 2px;
    border-color: #2a9d94;
}

.form-group textarea:focus {
    outline: 2px solid #2a9d94;
    outline-offset: 2px;
    border-color: #2a9d94;
    box-shadow: 0 0 0 3px rgba(42, 157, 148, 0.15);
}

/* ===== HOLIDAYS INLINE ===== */

.holidays-inline-section {
    margin-top: 16px;
    border-top: 1px solid #eee;
    padding-top: 14px;
}

.holidays-inline-label {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    display: block;
}

.holidays-inline-note {
    font-size: 11px;
    color: #595959;
    margin-bottom: 10px;
    font-style: italic;
    display: block;
}

/* ===== ACCORDION ===== */

.accordion-section {
    border: 1px solid #eee;
    border-radius: 8px;
    margin-bottom: 10px;
    overflow: hidden;
}

.accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #f8f9fa;
    cursor: pointer;
    user-select: none;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    transition: background 0.15s;
    border: none;
    width: 100%;
    text-align: left;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.accordion-header:hover {
    background: #f0f0f0;
}

.accordion-header:focus-visible {
    outline: 3px solid #2a9d94;
    outline-offset: -3px;
}

.accordion-header .acc-icon {
    margin-right: 8px;
}

.accordion-header .acc-chevron {
    font-size: 12px;
    transition: transform 0.2s;
    color: #595959;
}

.accordion-header .acc-chevron.open {
    transform: rotate(90deg);
}

.accordion-body {
    display: none;
    padding: 16px;
}

.accordion-body.open {
    display: block;
}

/* ===== EMBED CODE ===== */

.embed-code {
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 12px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    word-break: break-all;
    margin: 12px 0;
    color: #333;
}

/* ===== PRINT TIP ===== */

.print-tip {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 13px;
    color: #075985;
    line-height: 1.6;
    margin-bottom: 16px;
}

.print-tip ul {
    margin: 6px 0 0 8px;
    padding: 0;
    list-style: none;
}

.print-tip ul li {
    margin-bottom: 4px;
    padding-left: 4px;
}

/* ===== SOFT WARNING ===== */

.soft-warning {
    font-size: 12px;
    color: #92400e;
    background: #fef3c7;
    border: 1px solid #fde68a;
    border-radius: 6px;
    padding: 8px 10px;
    margin-top: 8px;
    line-height: 1.4;
}

.soft-warning ul {
    margin: 4px 0 0 12px;
    padding: 0;
    list-style: disc;
}

.soft-warning ul li {
    margin-bottom: 2px;
}

/* ===== TOUR ===== */

.tour-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 899;
    pointer-events: auto;
}

.tour-highlight {
    position: fixed;
    z-index: 901;
    border-radius: 8px;
    box-shadow: 0 0 0 4000px rgba(0, 0, 0, 0.4);
    pointer-events: none;
    transition: all 0.3s ease;
}

.tour-tooltip {
    position: fixed;
    z-index: 902;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
    padding: 16px 20px;
    width: 300px;
    pointer-events: auto;
    animation: tourFadeIn 0.3s ease;
}

.tour-tooltip .tour-step-indicator {
    font-size: 11px;
    color: #595959;
    margin-bottom: 6px;
    font-weight: 600;
}

.tour-tooltip .tour-text {
    font-size: 14px;
    color: #333;
    line-height: 1.5;
    margin-bottom: 14px;
}

.tour-tooltip .tour-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tour-tooltip .tour-skip {
    background: none;
    border: none;
    color: #555;
    font-size: 13px;
    cursor: pointer;
    padding: 4px 8px;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
}

.tour-tooltip .tour-skip:hover {
    color: #333;
}

.tour-tooltip .tour-skip:focus-visible {
    outline: 3px solid #2a9d94;
    outline-offset: 2px;
}

.tour-tooltip .tour-next {
    background: #2a9d94;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    transition: background 0.15s;
    min-height: 44px;
}

.tour-tooltip .tour-next:hover {
    background: #247d75;
}

.tour-tooltip .tour-next:focus-visible {
    outline: 3px solid #1a1a2e;
    outline-offset: 2px;
}

.tour-arrow {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #ffffff;
    transform: rotate(45deg);
    box-shadow: -2px -2px 4px rgba(0, 0, 0, 0.05);
}

@keyframes tourFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== TOAST ===== */

.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #1a1a2e;
    color: #ffffff;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 300;
    display: none;
    animation: slideUp 0.3s ease;
}

.toast.show {
    display: block;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ===== UTILITY ===== */

.hidden {
    display: none !important;
}

/* ===== REDUCED MOTION ===== */
/* WCAG 2.3.3 — Animation from Interactions */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ===== HIGH CONTRAST MODE ===== */
/* WCAG 1.4.11 — Non-text Contrast */

@media (forced-colors: active) {
    .toolbar {
        border-bottom: 2px solid ButtonText;
    }

    .toolbar-btn {
        border: 1px solid ButtonText;
    }

    .modal-btn {
        border: 1px solid ButtonText;
    }

    .cal-block {
        border: 2px solid ButtonText;
    }

    .color-swatch,
    .type-color-swatch {
        forced-color-adjust: none;
    }

    .color-preview-bar {
        forced-color-adjust: none;
    }

    .hue-slider {
        forced-color-adjust: none;
    }

    .brightness-slider {
        forced-color-adjust: none;
    }

    .legend-color {
        forced-color-adjust: none;
    }

    .prof-divider {
        forced-color-adjust: none;
    }
}

/* ===== RESPONSIVE: PROFESSOR CARD ===== */

@media screen and (max-width: 768px) {

    .prof-card.card-business {
        flex-wrap: wrap !important;
        gap: 16px;
    }

    .prof-card .prof-photo {
        width: 160px !important;
        height: 160px !important;
    }

    .prof-card .prof-center-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .prof-card .prof-right {
        flex-direction: row;
        align-items: center;
        gap: 12px;
        width: 100%;
        padding-top: 8px;
        border-top: 1px solid #eee;
        margin-top: 4px;
    }

    .prof-card .prof-right .qr-section {
        flex-direction: row;
        align-items: center;
        gap: 12px;
    }

    .prof-card .prof-right .qr-label {
        width: auto;
    }

    .prof-card.card-business.no-photo .prof-right {
        position: static;
        justify-content: center;
    }

    .prof-card.card-business.no-photo .prof-details {
        padding-left: 20px;
        padding-right: 20px;
    }
}

@media screen and (max-width: 540px) {

    .prof-card.card-business {
        flex-direction: column !important;
        align-items: center;
        text-align: center;
    }

    .prof-card .prof-photo {
        width: 140px !important;
        height: 140px !important;
    }

    .prof-card .prof-body {
        align-items: center;
    }

    .prof-card .prof-header {
        align-items: center;
        text-align: center;
    }

    .prof-card .prof-name {
        text-align: center;
        white-space: normal !important;
        font-size: 28px;
    }

    .prof-card .prof-center-row {
        align-items: center;
        width: 100%;
    }

    .prof-card .prof-center {
        align-items: center;
    }

    .prof-card .prof-divider {
        margin-left: auto;
        margin-right: auto;
    }

    .prof-card.card-business .prof-details {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px 16px;
    }

    .prof-card .prof-right {
        justify-content: center;
        border-top: 1px solid #eee;
        padding-top: 12px;
    }

    .prof-card .prof-right .qr-section {
        flex-direction: column;
        align-items: center;
    }

    .prof-card .prof-right .qr-label {
        width: 120px;
        text-align: center;
    }
}

@media screen and (max-width: 380px) {

    .prof-card {
        padding: 16px 12px;
    }

    .prof-card .prof-photo {
        width: 110px !important;
        height: 110px !important;
    }

    .prof-card .prof-name {
        font-size: 22px;
    }

    .prof-card .prof-details {
        font-size: 11.5px;
    }
}

/* ===== RESPONSIVE: TOOLBAR ===== */

@media screen and (max-width: 640px) {

    .toolbar {
        flex-wrap: wrap;
        gap: 8px;
        padding: 10px 12px;
    }

    .toolbar-actions {
        flex-wrap: wrap;
        gap: 6px;
    }

    .toolbar-btn {
        font-size: 12px;
        padding: 6px 10px;
    }
}

/* ===== RESPONSIVE: CALENDAR ===== */

@media screen and (max-width: 640px) {

    .calendar-wrapper {
        padding: 12px 8px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .calendar {
        min-width: 500px;
    }

    .cal-semester-label {
        font-size: 18px;
    }

    .cal-semester-dates {
        font-size: 12px;
    }
}

/* ===== RESPONSIVE: MODALS ===== */

@media screen and (max-width: 540px) {

    .prof-modal-inner,
    .cal-modal-inner {
        width: 100vw;
        max-width: 100vw;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }

    .modal {
        width: 95vw;
        max-height: 95vh;
    }

    .name-row {
        flex-wrap: wrap;
    }

    .name-row .form-group.name-title {
        flex: 0 0 100%;
    }

    .location-row {
        flex-wrap: wrap;
    }

    .location-row .form-group.loc-building {
        flex: 1 1 100%;
    }

    .location-row .form-group.loc-room {
        flex: 1;
    }

    .location-row .form-group.loc-campus {
        flex: 1;
    }

    .semester-row {
        flex-wrap: wrap;
    }

    .semester-row .form-group.sem-term,
    .semester-row .form-group.sem-year {
        flex: 1;
    }

    .semester-row .form-group.sem-label {
        flex: 1 1 100%;
    }
}

/* ===== PRINT STYLES ===== */

@media print {
    @page {
        margin: 0.5in;
        margin-top: 0.25in;
        margin-bottom: 0.25in;
    }

    body {
        background: white;
    }

    .toolbar {
        display: none !important;
    }

    .skip-link {
        display: none !important;
    }

    .container {
        margin: 0;
        padding: 0;
        max-width: 100%;
    }

    .prof-card {
        box-shadow: none;
        border: none;
        padding: 16px 0;
        margin-bottom: 12px;
    }

    .prof-card.card-business.no-photo .prof-right {
        right: 0;
    }

    .prof-card .edit-btn {
        display: none;
    }

    .prof-card .prof-name {
        font-size: inherit;
    }

    .prof-card .prof-credentials {
        font-size: 28pt;
    }

    .prof-card .prof-title {
        font-size: 10pt;
    }

    .prof-card .prof-institution {
        font-size: 10pt;
    }

    .prof-card .prof-details {
        font-size: 10pt;
    }

    .prof-card .prof-details a {
        color: #333;
        text-decoration: none;
    }

    .prof-card .prof-divider {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .print-hidden {
        display: none !important;
    }

    .prof-card .prof-photo {
        object-fit: cover !important;
        flex-shrink: 0 !important;
        border-radius: 50% !important;
    }

    .qr-label {
        display: block !important;
    }

    .qr-section {
        top: 2px;
    }

    .calendar-wrapper {
        box-shadow: none;
        padding: 0;
        overflow: visible;
    }

    .calendar-wrapper .edit-btn {
        display: none;
    }

    .cal-semester-row {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .cal-semester-label {
        font-size: 18pt;
    }

    .cal-semester-dates {
        font-size: 11pt;
    }

    .calendar {
        border: 3.8px solid var(--theme-color, #252C26);
        overflow: visible;
    }

    .cal-header {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        font-size: 12pt;
        padding: 8px;
    }

    .cal-time {
        font-size: 9pt;
    }

    .cal-cell {
        cursor: default;
    }

    .cal-cell:hover {
        background: transparent;
    }

    .cal-block {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        font-size: 9pt;
    }

    .cal-block .block-location {
        font-size: 8pt;
    }

    .cal-block .block-note {
        font-size: 8pt;
    }

    .legend {
        font-size: 11pt;
    }

    .legend-color {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .holidays-footnote {
        font-size: 9pt;
        color: #595959;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .prof-card .prof-detail-item svg {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}