/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Navbar ── */
.navbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    background: #1a6fc4;
    border-radius: 0 0 10px 10px;
}
.navbar-brand {
    font-size: 15px;
    font-weight: bold;
    color: #fff;
    text-decoration: none;
    white-space: nowrap;
    text-align: center;
    padding-bottom: 6px;
}
.navbar-links {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.navbar-links a { color: #fff; text-decoration: none; font-size: 13px; opacity: 0.9; white-space: nowrap; }
.navbar-links a:hover { opacity: 1; text-decoration: underline; }
.navbar-links a.danger { color: #ffaaaa; }
.navbar-links-left  { display: flex; gap: 12px; align-items: center; }
.navbar-links-right { display: flex; gap: 12px; align-items: center; }

/* ── Search bar ── */
.search-bar { margin-bottom: 16px; }
.search-bar form { display: flex; gap: 8px; align-items: center; flex-wrap: nowrap; }
.search-bar input {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    flex: 1;
    min-width: 0;
}

/* ── Page wrapper ── */
.page {
    max-width: 1200px;
    margin: 16px auto;
    padding-top: var(--page-top-padding, 0px);
    padding-right: 12px;
    padding-left: 12px;
}
.page > * + * { margin-top: 14px; }
.page-sticky-anchor {
    display: block;
    width: 100%;
    height: 0;
}
.page-sticky-top {
    display: grid;
    width: 100%;
    grid-template-columns: minmax(280px, .95fr) minmax(420px, 1.35fr);
    gap: 12px;
    padding-top: 4px;
    align-items: start;
}
.page-sticky-top.is-floating {
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 11010;
    width: min(1200px, calc(100vw - 24px));
    pointer-events: none;
}
.page-sticky-top.is-floating > * { pointer-events: auto; }
.page-sticky-top.is-compact {
    gap: 6px;
}
.workspace-panel {
    position: relative;
}
.workspace-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px 0;
}
.workspace-panel-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: #6a5c84;
}

/* ── Card ── */
.card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,.1);
    padding: 18px;
    margin-bottom: 16px;
}
.card h2 { font-size: 15px; color: #333; margin-bottom: 14px; line-height: 1.3; }

/* ── Flash messages ── */
.msg-success { color: #1a7a3a; background: #e6f4ea; border-radius: 5px; padding: 8px 12px; margin-bottom: 12px; font-size: 13px; }
.msg-error   { color: #b00020; background: #fdecea; border-radius: 5px; padding: 8px 12px; margin-bottom: 12px; font-size: 13px; }

/* ── Forms ── */
.form-group { margin-bottom: 12px; }
.form-group label { display: block; font-size: 12px; color: #666; margin-bottom: 4px; }
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 14px;
    font-family: Arial, sans-serif;
    background: #fafafa;
    transition: border-color .2s;
    appearance: none;
    -webkit-appearance: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { outline: none; border-color: #1a6fc4; background: #fff; }
input[type="password"]::placeholder { color: #ccc; }

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-family: Arial, sans-serif;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
    white-space: nowrap;
    touch-action: manipulation;
}
.btn:hover {
    transform: translateY(-1px);
}
.btn-primary  { background: #1a6fc4; color: #fff; }
.btn-primary:hover  { background: #155a9e; }
.btn-danger   { background: #e74c3c; color: #fff; }
.btn-danger:hover   { background: #c0392b; }
.btn-dark     { background: #555; color: #fff; }
.btn-dark:hover     { background: #333; }
.btn-outline  { background: #fff; color: #1a6fc4; border: 1px solid #1a6fc4; }
.btn-outline:hover  { background: #e8f0fb; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
input:disabled { opacity: 0.45; cursor: not-allowed; background: #eee; }

/* ── Upload block ── */
.upload-block {
    background: #fff;
    border-radius: 12px;
    padding: 0 12px 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin: 18px 0;
}
.upload-block #upload-display {
    padding: 4px 2px 0;
    min-height: 24px;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    color: #333;
    line-height: 1.2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
}
.upload-block #upload-body {
    padding: 12px 2px 0;
    background: transparent;
}
.upload-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.upload-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.upload-section-primary {
    gap: 12px;
}
.upload-section-label {
    font-size: 12px;
    font-weight: 700;
    color: #607080;
}
.upload-limits-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid rgba(26, 111, 196, .12);
    border-radius: 10px;
    background: rgba(248, 251, 255, .72);
    color: #3a4a5a;
    text-align: left;
    cursor: pointer;
    box-sizing: border-box;
    min-width: 0;
    overflow: hidden;
}
.upload-limits-toggle-title {
    flex: 0 0 auto;
    font-size: 12px;
    font-weight: 700;
    color: #607080;
    white-space: nowrap;
}
.upload-limits-toggle-summary {
    min-width: 0;
    flex: 1 1 auto;
    font-size: 12px;
    color: #3a4a5a;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.upload-limits-toggle-icon {
    flex: 0 0 auto;
    color: #1a6fc4;
    font-size: 14px;
}
.upload-limits-panel {
    margin-top: 8px;
}
.upload-display-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
}
.upload-toggle-icon {
    color: #1a6fc4;
    font-size: 18px;
}
.upload-row { display: flex; gap: 12px; flex-wrap: wrap; }
.upload-row .form-group { flex: 1; min-width: 130px; margin: 0; }
.upload-row-primary {
    display: grid;
    grid-template-columns: minmax(148px, 180px) minmax(0, 1fr);
    gap: 12px;
    align-items: end;
}
.upload-date-group,
.upload-photo-group {
    min-width: 0;
}
.upload-audio-row { display: flex; align-items: center; gap: 8px; margin-bottom: 0; flex-wrap: wrap; }
.upload-limit-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 0;
}
.upload-limit-item {
    min-height: 54px;
    padding: 10px 12px;
    border: 1px solid #d7e1ec;
    border-radius: 8px;
    background: #f8fbff;
    color: #3a4a5a;
    font-size: 13px;
    line-height: 1.45;
}
.upload-limit-item strong {
    display: block;
    margin-bottom: 2px;
    color: #1f2d3d;
    font-size: 13px;
}
.upload-limit-item span {
    display: block;
    margin-bottom: 3px;
    color: #607080;
    font-size: 12px;
}
.upload-limit-toggle {
    margin-top: 8px;
    margin-left: 4px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #1a6fc4;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.upload-limit-toggle:hover {
    text-decoration: underline;
}
.upload-limit-details {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(26, 111, 196, .12);
}
.upload-limit-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.upload-limit-entry {
    padding: 8px 9px;
    border-radius: 6px;
    background: rgba(255, 255, 255, .72);
    border: 1px solid rgba(26, 111, 196, .08);
    font-size: 12px;
    line-height: 1.45;
}
.upload-limit-entry strong {
    display: inline;
    margin: 0;
    font-size: 12px;
}
.upload-limit-entry span {
    margin-top: 2px;
    margin-bottom: 0;
}
.upload-limit-item.is-warning {
    border-color: #f0c36a;
    background: #fff7e8;
    color: #8a5a08;
}
.upload-limit-item.is-blocked {
    border-color: #efb0b0;
    background: #fff3f3;
    color: #9b1c1c;
}
.upload-note-group {
    margin-top: 0;
}
.upload-audio-controls {
    margin-top: 0;
    padding: 10px 12px;
    border: 1px solid rgba(26, 111, 196, .12);
    border-radius: 10px;
    background: rgba(248, 251, 255, .72);
}
.upload-status-group {
    display: flex;
    gap: 10px;
    margin: 0;
    flex-wrap: wrap;
}
.upload-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    cursor: pointer;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid #ddd;
    background: #f8f9fa;
    color: #555;
    transition: all .2s ease;
    white-space: nowrap;
}
.upload-status-pill input {
    margin: 0;
}
.upload-status-pill-neutral {
    border-color: rgba(102, 92, 120, .18);
    background: rgba(248, 249, 252, .95);
}
.upload-status-pill-refused {
    border: 1px solid rgba(217, 74, 118, .35);
    background: rgba(253, 236, 242, .98);
    color: #c03967;
    font-weight: 600;
}
.upload-status-pill-postponed {
    border: 1px solid rgba(217, 145, 24, .35);
    background: rgba(254, 245, 228, .98);
    color: #c67d12;
    font-weight: 600;
}
@media (max-width: 480px) {
    .upload-form {
        gap: 12px;
    }
    .upload-row-primary {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .upload-status-group {
        gap: 6px;
    }
    .upload-status-pill {
        gap: 5px;
        padding: 6px 9px;
        font-size: 12px;
    }
    .upload-limits-toggle {
        padding: 9px 10px;
        gap: 6px;
    }
    .upload-limits-toggle-title,
    .upload-limits-toggle-summary {
        font-size: 11px;
    }
    .upload-limits-toggle-title {
        max-width: 72px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}
.upload-submit-btn {
    width: 100%;
    margin-top: 2px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
}
.audio-status { font-size: 12px; color: #888; }
@media (max-width: 640px) {
    .upload-limit-summary {
        grid-template-columns: 1fr;
    }
    .upload-row-primary {
        grid-template-columns: 1fr;
    }
}
.upload-submit-state {
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid #d7e6f7;
    border-radius: 8px;
    background: #f5f9ff;
    color: #234;
}
.upload-submit-spinner {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid rgba(26,111,196,.18);
    border-top-color: #1a6fc4;
    flex-shrink: 0;
    animation: upload-spin .8s linear infinite;
}
.upload-submit-copy {
    flex: 1;
    min-width: 0;
}
.upload-submit-title {
    font-size: 13px;
    font-weight: 600;
    color: #1a3557;
}
.upload-submit-text {
    margin-top: 2px;
    font-size: 12px;
    color: #5a6b7d;
}
.upload-submit-progress {
    min-width: 42px;
    text-align: right;
    font-size: 12px;
    font-weight: 600;
    color: #1a6fc4;
}
@keyframes upload-spin {
    to { transform: rotate(360deg); }
}

/* ── Client note card ── */
.client-note-card {
    display: block;
    width: 100%;
    border: none;
    border-radius: 12px;
    background: #e8f0fb;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(26,111,196,.1);
    margin-bottom: 10px;
    transition: padding .18s ease, box-shadow .18s ease, border-radius .18s ease;
}
.client-note-display {
    padding: 6px 14px 12px;
    min-height: 42px;
    cursor: text;
    font-size: 13px;
    color: #444;
    line-height: 1.5;
}
.client-note-placeholder {
    color: #8b84a0;
}
.client-note-form-wrap {
    display: none;
}
.client-note-form {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 10px 14px;
}
.client-note-textarea {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid #c8d8f0;
    border-radius: 8px;
    font-size: 13px;
    font-family: Arial, sans-serif;
    background: #fff;
    resize: none;
    min-height: 36px;
    max-height: 76px;
    color: #222;
    line-height: 1.45;
}
.client-note-textarea::placeholder {
    color: #888;
}
.client-note-textarea:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.7);
}
.btn-save-note {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    background: #1a6fc4;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background .2s;
}
.btn-save-note:hover {
    background: #155a9e;
}
.btn-save-note:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(74, 144, 217, 0.3);
}

/* Галерея последних заметок */
.gallery-grid {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    gap: 12px;
    margin-top: 8px;
    padding-bottom: 8px;
    scroll-behavior: smooth;
}

.gallery-grid::-webkit-scrollbar {
    height: 6px;
}

.gallery-grid::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.gallery-grid::-webkit-scrollbar-thumb {
    background: #1a6fc4;
    border-radius: 3px;
}

.gallery-item {
    position: relative;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    width: 168px;
    min-height: 188px;
}

.gallery-content {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    height: 138px;
}

.gallery-date-top {
    padding: 10px 11px;
    font-size: 14px;
    color: #fff;
    background: rgba(26, 111, 196, 0.9);
    text-align: center;
    font-weight: bold;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    line-height: 1.25;
    min-height: 42px;
    box-sizing: border-box;
}

.gallery-date-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex: 1;
    justify-content: flex-start;
    text-align: left;
}

.gallery-actions {
    display: flex;
    gap: 4px;
    align-items: center;
}

.gallery-edit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: rgba(255,255,255,0.3);
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    transition: background 0.2s;
    color: #fff;
}

.gallery-edit-btn:hover {
    background: rgba(255,255,255,0.5);
}

.gallery-edit-btn-bottom {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(24, 31, 46, 0.78);
    color: #fff;
    border-radius: 999px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.2s, transform 0.2s, box-shadow .2s;
    z-index: 10;
    border: 1px solid rgba(255,255,255,.14);
    box-shadow: 0 4px 12px rgba(0,0,0,.18);
}

.gallery-edit-btn-bottom:hover {
    background: rgba(24, 31, 46, 0.92);
    transform: scale(1.1);
}

.gallery-delete-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: rgba(255,255,255,.18);
    border-radius: 999px;
    font-size: 11px;
    cursor: pointer;
    transition: background 0.2s;
    color: #fff;
    border: 1px solid rgba(255,255,255,.14);
}

.gallery-delete-btn:hover {
    background: rgba(231, 76, 60, .92);
}

.gallery-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.gallery-img {
    width: 100%;
    height: 138px;
    object-fit: cover;
    display: block;
}

.gallery-audio-icon {
    width: 100%;
    height: 138px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: #fff;
}

.gallery-audio-flag-icon {
    width: 100%;
    height: 138px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    color: #fff;
}

.gallery-text-note {
    width: 100%;
    height: 138px;
    padding: 14px 12px;
    box-sizing: border-box;
    font-size: 12px;
    line-height: 1.55;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    overflow-y: auto;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    word-break: break-word;
    text-align: left;
}

.gallery-flag-icon {
    width: 100%;
    height: 138px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    color: #fff;
}

.gallery-birthday-card .gallery-content {
    background: linear-gradient(135deg, #ffb6d5 0%, #ffd86f 100%);
}

.gallery-birthday-icon {
    width: 100%;
    height: 138px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 58px;
    color: #fff;
    text-shadow: 0 3px 10px rgba(120, 62, 12, .24);
}

.gallery-status-badges {
    position: absolute;
    top: 6px;
    left: 6px;
    right: 34px;
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    z-index: 9;
    pointer-events: none;
}

.gallery-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 7px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    background: rgba(24, 32, 44, .72);
    backdrop-filter: blur(6px);
}

.gallery-status-badge-refused {
    background: rgba(217, 74, 118, .92);
}

.gallery-status-badge-postponed {
    background: rgba(217, 145, 24, .92);
}

.gallery-note-preview {
    padding: 6px 8px;
    font-size: 11px;
    color: #333;
    background: #f8f9fa;
    border-top: 1px solid #eee;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
    display: none;
}

.gallery-note-text {
    position: absolute;
    bottom: 8px;
    left: 42px;
    right: auto;
    background: rgba(255, 255, 255, 0.96);
    padding: 6px 8px;
    border-radius: 999px;
    font-size: 10px;
    color: #333;
    width: fit-content;
    max-width: calc(100% - 52px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    z-index: 5;
    line-height: 1.2;
    box-shadow: 0 6px 16px rgba(0,0,0,.14);
}
.gallery-note-text-clickable,
.gallery-text-note-clickable {
    cursor: pointer;
}
.gallery-audio-player.is-missing {
    opacity: .5;
    cursor: not-allowed;
}
.gallery-item-birthday .gallery-date-top {
    background: linear-gradient(135deg, rgba(176, 84, 167, .96), rgba(228, 161, 59, .96));
}
.gallery-item-photo .gallery-content,
.gallery-item-audio .gallery-content,
.gallery-item-text .gallery-content,
.gallery-item-flag .gallery-content,
.gallery-item-birthday .gallery-content {
    background-color: rgba(255,255,255,.84);
}
.gallery-item-photo .gallery-content,
.gallery-item-text .gallery-content {
    background: transparent;
}
.gallery-birthday-card .gallery-date-top,
.gallery-item-birthday .gallery-date-top {
    min-height: 42px;
    padding: 10px 11px;
}

.recent-gallery {
    background: #fff;
    border-radius: 12px;
    padding: 18px 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin: 24px 0;
}
.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.section-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #333;
}
.section-empty-state {
    text-align: center;
    color: #888;
    font-size: 13px;
    padding: 20px;
}

/* ── Year nav ── */
.year-nav { display: flex; justify-content: center; align-items: center; gap: 14px; margin-bottom: 20px; }
.year-nav span { font-size: 17px; font-weight: bold; color: #333; letter-spacing: .01em; min-width: 84px; text-align: center; }
.year-nav-btn {
    min-width: 108px;
    padding-inline: 14px;
}

/* ── Calendar ── */
.calendar-wrap {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
}
.calendar-month-card {
    position: relative;
    overflow: visible;
    padding: 10px;
    border-radius: 16px;
    background: rgba(255,255,255,.82);
    border: 1px solid rgba(217,197,251,.74);
    box-shadow: 0 10px 26px rgba(84, 33, 140, .08);
}
.calendar-month-card.is-tooltip-open {
    z-index: 12;
}
.calendar-table {
    border-collapse: collapse;
    width: 228px;
    margin-bottom: 0;
    font-size: 12px;
}
.calendar-table th, .calendar-table td {
    border: 1px solid #ddd;
    padding: 5px 4px;
    text-align: center;
    position: relative;
    vertical-align: middle;
    width: 48px;
    min-width: 48px;
    max-width: 48px;
    height: 44px;
    box-sizing: border-box;
}
.calendar-table th { background: #e8f0fb; color: #1a6fc4; font-size: 11px; font-weight: 700; }
.calendar-table td { cursor: pointer; }
.calendar-month-title {
    padding: 10px 6px;
    font-size: 15px !important;
    font-weight: 700;
    color: #4a3967 !important;
    background: transparent !important;
    border: none !important;
}
.calendar-month-title.is-current-year {
    font-weight: 800;
    color: #26183d !important;
}
.calendar-weekday {
    font-weight: 700;
    color: #7d5cb6 !important;
    font-size: 12px !important;
}
.calendar-weekday.is-muted {
    font-weight: 500;
    opacity: .86;
}
.calendar-day-label {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 4px 5px;
    box-sizing: border-box;
    pointer-events: none;
    white-space: nowrap;
    z-index: 1;
}
.calendar-day-number {
    display: inline-block;
    min-width: 1.2em;
    text-align: left;
    line-height: 1.1;
}
.calendar-birthday-inline {
    position: absolute;
    left: 4px;
    bottom: 3px;
    font-size: 10px;
    line-height: 1;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,.18));
}
.calendar-media-indicators {
    position: absolute;
    right: 4px;
    bottom: 3px;
    display: inline-flex;
    align-items: center;
    gap: 1px;
    z-index: 2;
    pointer-events: none;
}
.calendar-media-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: rgba(255,255,255,.18);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
    font-size: 8px;
    line-height: 1;
    backdrop-filter: blur(4px);
}
.today .calendar-media-indicator,
.has-photo .calendar-media-indicator,
.has-note .calendar-media-indicator,
.has-refused .calendar-media-indicator,
.has-postponed .calendar-media-indicator {
    background: rgba(255,255,255,.22);
}
.has-birthday .calendar-media-indicator {
    background: rgba(255,255,255,.54);
    color: #7b2f4b;
    box-shadow: inset 0 0 0 1px rgba(123,47,75,.14);
}
.calendar-table td:not(.has-photo):hover { background: #e8f0fb; }
.has-photo, .has-note { background: #1a6fc4; color: #fff; }
.has-refused  { background: #e74c3c !important; color: #fff !important; }
.has-postponed { background: #f39c12 !important; color: #fff !important; }
.flag-indicator {
    font-size: 11px;
    position: absolute;
    line-height: 1;
    z-index: 2;
}
.calendar-flag-left {
    right: 18px;
    top: 2px;
}
.calendar-flag-right {
    right: 2px;
    top: 2px;
}
.flag-indicator.refused { color: #ff6b6b; }
.flag-indicator.postponed { color: #ffd93d; }
.flag-indicator.birthday { color: #ff69b4; }
.has-photo.today, .has-note.today { background: #c2d8f5; color: #1a6fc4; box-shadow: inset 0 0 0 2px #1a6fc4; }
.has-refused.has-postponed.today { box-shadow: inset 0 0 0 2px rgba(255,255,255,.92); }
.has-birthday { background: #ffd1dc !important; }
.has-birthday.has-photo, .has-birthday.has-note { background: #ffd1dc !important; color: #333 !important; }
.has-birthday.today { box-shadow: inset 0 0 0 2px #e74c3c; }
.has-birthday.today.has-photo, .has-birthday.today.has-note { box-shadow: inset 0 0 0 2px #e74c3c, inset 0 0 0 4px #1a6fc4; }
.today    { background: #c2d8f5; font-weight: bold; color: #1a6fc4; }
.weekend  { color: #e74c3c; }
.selected { box-shadow: inset 0 0 0 3px #27ae60; }
.has-photo.selected, .has-note.selected { background: #1a6fc4; color: #fff; box-shadow: inset 0 0 0 3px #27ae60; }

/* ── Tooltip ── */
.photo-preview-tooltip {
    display: none;
    position: fixed;
    background: linear-gradient(180deg, rgba(31,24,47,.97), rgba(22,18,34,.97));
    padding: 14px;
    border-radius: 18px;
    z-index: 12020;
    white-space: normal;
    box-shadow: 0 18px 42px rgba(12,10,24,.34);
    border: 1px solid rgba(196, 174, 240, .16);
    flex-direction: column;
    gap: 12px;
    width: min(560px, calc(100vw - 24px));
    max-height: 60vh;
    overflow: hidden;
    pointer-events: auto;
}
.tp-scroll {
    display: flex;
    flex-direction: column !important;
    gap: 8px;
    overflow-x: hidden;
    overflow-y: auto;
    width: 100%;
    max-height: calc(60vh - 50px);
    scrollbar-width: none;
}
.tp-scroll::-webkit-scrollbar { display: none; }
.tp-close {
    display: block;
    align-self: flex-end;
    background: linear-gradient(135deg, rgba(111,34,182,.96), rgba(138,43,226,.96));
    color: #fff;
    border-radius: 999px;
    padding: 9px 14px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    z-index: 12021;
    flex-shrink: 0;
    box-shadow: 0 8px 22px rgba(18,12,35,.24);
    border: 1px solid rgba(255,255,255,.12);
    transition: background .2s, transform .18s ease, box-shadow .18s ease;
}
.tp-close:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(18,12,35,.3);
}
.tp-item {
    display: block;
    width: 100%;
    flex-shrink: 0;
    padding: 10px;
    border-radius: 16px;
    background: rgba(255,255,255,.045);
    border: 1px solid rgba(255,255,255,.06);
}
.tp-img-wrap { position: relative; width: 100%; display: block; }
.tp-img-wrap img {
    width: 100%;
    height: auto !important;
    max-height: none !important;
    border-radius: 12px;
    cursor: pointer;
    display: block;
}
.tp-btn {
    position: absolute;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 12px;
    line-height: 28px;
    text-align: center;
    cursor: pointer;
    z-index: 10;
    color: #fff;
    box-shadow: 0 6px 16px rgba(0,0,0,.18);
    border: 1px solid rgba(255,255,255,.12);
}
.tp-btn-delete { top: 8px; left: 8px;  background: rgba(217, 74, 118, .94); }
.tp-btn-edit   { bottom: 8px; left: 8px; background: rgba(24, 31, 46, .82); }
.tp-note {
    width: 100%;
    font-size: 13px;
    color: #f2ecff;
    margin-top: 8px;
    word-break: break-word;
    overflow-wrap: anywhere;
    text-align: left;
    max-height: 124px;
    overflow-y: auto;
    line-height: 1.5;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.05);
}
.tp-audio-wrap {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 72px;
    background: rgba(255,255,255,.08);
    border-radius: 12px;
    gap: 8px;
    padding: 12px 12px 12px 44px;
    cursor: pointer;
    user-select: none;
}
.tp-audio-wrap:hover { background: rgba(255,255,255,.15); }
.tp-audio-wrap,
.gallery-audio-player {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    width: 100%;
    min-height: 58px;
    height: auto;
    padding: 10px 12px 10px 44px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,.14);
    background: linear-gradient(135deg, rgba(31,42,56,.96), rgba(22,29,38,.96));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 3px 10px rgba(0,0,0,.12);
    cursor: pointer;
    user-select: none;
    box-sizing: border-box;
    transition: background .18s, border-color .18s, box-shadow .18s;
}
.gallery-audio-player {
    min-height: 120px;
    height: 100%;
    flex: 1;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}
.tp-audio-wrap:hover,
.gallery-audio-player:hover {
    background: linear-gradient(135deg, rgba(39,52,68,.98), rgba(27,36,47,.98));
    border-color: rgba(255,255,255,.24);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 4px 14px rgba(0,0,0,.18);
    transform: none;
}
.tp-audio-playing,
.gallery-audio-player.gallery-audio-playing {
    background: linear-gradient(135deg, #195f52, #20384d);
    border-color: rgba(79,220,176,.45);
}
.gallery-audio-center {
    display: contents;
}
.tp-audio-icon,
.gallery-audio-icon,
.gallery-audio-center .gallery-audio-icon {
    font-size: 26px;
    line-height: 1;
    margin: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.12);
    flex: 0 0 40px;
}
.gallery-audio-player.gallery-audio-playing .gallery-audio-icon::after {
    content: ' ▐▐';
    font-size: 12px;
}
.tp-audio-status,
.gallery-audio-status,
.gallery-audio-center .gallery-audio-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
    margin-left: auto;
    padding: 0;
    border-radius: 50%;
    background: rgba(255,255,255,.14);
    border: 1px solid rgba(255,255,255,.18);
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    word-break: normal;
}
.tp-audio-playing .tp-audio-status,
.gallery-audio-player.gallery-audio-playing .gallery-audio-status {
    background: rgba(255,255,255,.2);
    border-color: rgba(79,220,176,.5);
    color: #eafff8;
}
.gallery-audio-player.gallery-audio-playing .gallery-audio-icon::after {
    content: none;
}
.photo-note { display: none; }

/* ── Auth / Profile card ── */
.auth-card, .profile-card {
    max-width: 480px;
    margin: 24px auto;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,.1);
    padding: 24px;
}
.auth-card h2, .profile-card h2 {
    text-align: center;
    margin-bottom: 18px;
    font-size: 20px;
    color: #1a6fc4;
}
.profile-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 12px;
}
.profile-form-grid .form-group { margin-bottom: 0; }
.profile-form-grid .form-group.full { grid-column: 1 / -1; }
.auth-switch { text-align: center; margin-top: 16px; font-size: 14px; color: #666; line-height: 1.5; }
.auth-switch a { color: #1a6fc4; cursor: pointer; text-decoration: underline; }
.back-link { display: block; text-align: center; margin-top: 14px; font-size: 14px; color: #1a6fc4; text-decoration: none; }
.back-link:hover { text-decoration: underline; }

/* Landing */
.landing-page {
    max-width: 1120px;
    margin: 0 auto;
    padding: 24px 16px 48px;
}
.landing-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, .9fr);
    gap: 18px;
    align-items: stretch;
    padding: 20px 0 8px;
}
.landing-hero-copy,
.landing-hero-panel,
.landing-link-card,
.landing-cta {
    background: #fff;
    border: 1px solid #dce5f0;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.landing-hero-copy {
    padding: 24px;
}
.landing-eyebrow {
    display: inline-block;
    margin-bottom: 10px;
    font-size: 12px;
    font-weight: 700;
    color: #1a6fc4;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.landing-hero-copy h1 {
    font-size: 38px;
    line-height: 1.08;
    color: #1f2933;
    margin-bottom: 12px;
}
.landing-hero-copy p,
.landing-cta p {
    font-size: 16px;
    line-height: 1.65;
    color: #4d5965;
    max-width: 640px;
}
.landing-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}
.landing-hero-panel {
    padding: 18px;
    display: grid;
    gap: 12px;
}
.landing-stat {
    padding: 14px;
    border-radius: 8px;
    background: #f5f9ff;
    border: 1px solid #d7e6f7;
}
.landing-stat strong,
.landing-link-card strong {
    display: block;
    color: #1f2933;
    font-size: 15px;
    margin-bottom: 6px;
}
.landing-stat span,
.landing-link-card span {
    display: block;
    color: #5a6b7d;
    font-size: 13px;
    line-height: 1.5;
}
.landing-section {
    margin-top: 24px;
}
.landing-section h2,
.landing-cta h2 {
    font-size: 22px;
    color: #1f2933;
    margin-bottom: 12px;
}
.landing-links {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}
.landing-link-card {
    padding: 16px;
    text-decoration: none;
}
.landing-link-card:hover {
    border-color: #1a6fc4;
    box-shadow: 0 0 0 2px rgba(26,111,196,.08);
}
.landing-cta {
    margin-top: 24px;
    padding: 22px 24px;
}

/* Services / public pricing */
.services-page { max-width: 980px; margin: 0 auto; padding: 24px 16px 40px; }
.services-hero { padding: 22px 0 18px; }
.services-back { display: inline-block; margin-bottom: 12px; color: #1a6fc4; text-decoration: none; font-size: 13px; }
.services-home-link { margin-left: 14px; }
.services-hero h1 { font-size: 32px; line-height: 1.1; margin-bottom: 12px; color: #1f2933; }
.services-hero p, .services-note p { font-size: 16px; line-height: 1.65; color: #4d5965; max-width: 760px; }
.services-section { margin-top: 24px; }
.services-section h2 { font-size: 22px; color: #1f2933; margin-bottom: 14px; }
.services-feature-grid, .services-pricing-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.services-feature, .services-price-card { border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; padding: 18px; }
.services-feature strong, .services-price-card h3 { display: block; font-size: 16px; color: #1a6fc4; margin-bottom: 10px; }
.services-feature span { display: block; font-size: 14px; line-height: 1.55; color: #56616d; }
.services-price { font-size: 24px; font-weight: 700; color: #1f2933; margin-bottom: 12px; }
.services-price-card ul { margin: 0; padding-left: 18px; color: #56616d; font-size: 14px; line-height: 1.7; }
.services-price-card-active { border-color: #1a6fc4; box-shadow: 0 0 0 2px rgba(26,111,196,.12); }
.services-pay-form { margin-top: 14px; }
.services-pay-form .btn { width: 100%; text-align: center; }
.services-note { border-top: 1px solid #e2e8f0; padding-top: 18px; }
.legal-page { max-width: 860px; }
.legal-section { border-top: 1px solid #e2e8f0; padding-top: 18px; }
.legal-section p { color: #4d5965; font-size: 15px; line-height: 1.65; margin: 0 0 10px; }
.legal-section a, .services-note a { color: #1a6fc4; text-decoration: none; }
.legal-section a:hover, .services-note a:hover { text-decoration: underline; }
.legal-updated { font-weight: 700; color: #1f2933 !important; }
.contacts-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.contact-card span { word-break: break-word; }

/* Theme refresh */
:root {
    --theme-primary: BlueViolet;
    --theme-primary-dark: #6f22b6;
    --theme-primary-ink: #3f2469;
    --theme-primary-soft: #f3ebff;
    --theme-primary-soft-2: #ebe0ff;
    --theme-border: #d9c5fb;
    --theme-surface: rgba(255,255,255,.88);
    --theme-surface-strong: #ffffff;
    --theme-text: #241b33;
    --theme-muted: #665c78;
    --theme-shadow: 0 16px 40px rgba(84, 33, 140, .12);
    --theme-shadow-soft: 0 8px 24px rgba(84, 33, 140, .08);
    --theme-success: #1f9d74;
    --theme-danger: #d94a76;
    --theme-warning: #d99118;
    --theme-accent: #3d9be9;
}

body {
    font-family: Arial, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(138,43,226,.10), transparent 28%),
        radial-gradient(circle at top right, rgba(61,155,233,.10), transparent 24%),
        linear-gradient(180deg, #faf7ff 0%, #f4f0fb 52%, #eef2f8 100%);
    color: var(--theme-text);
    font-size: 14px;
    -webkit-text-size-adjust: 100%;
    overflow-x: hidden;
}

.navbar {
    position: static;
    background: transparent;
}

.navbar-inner {
    background: linear-gradient(135deg, var(--theme-primary-dark) 0%, var(--theme-primary) 52%, #6d66ff 100%);
    box-shadow: 0 14px 36px rgba(92, 41, 150, .24);
}

.navbar-brand {
    letter-spacing: .02em;
}

.navbar-links a {
    color: rgba(255,255,255,.96);
}

.navbar-links a.danger {
    color: #ffe3ef;
}

.search-bar input,
.form-group input,
.form-group select,
.form-group textarea {
    border-color: var(--theme-border);
    background: rgba(255,255,255,.88);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.6);
}

.form-group label {
    color: var(--theme-muted);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--theme-primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(138,43,226,.10);
}

.card,
.upload-block,
.recent-gallery,
.auth-card,
.profile-card,
.landing-hero-copy,
.landing-hero-panel,
.landing-link-card,
.landing-cta,
.services-feature,
.services-price-card,
.legal-section,
.contact-card {
    background: var(--theme-surface);
    border: 1px solid rgba(217,197,251,.78);
    box-shadow: var(--theme-shadow-soft);
}

.card h2,
.year-nav span,
.landing-hero-copy h1,
.services-hero h1,
.services-section h2,
.landing-section h2,
.landing-cta h2,
.landing-stat strong,
.landing-link-card strong,
.services-price,
.legal-updated {
    color: var(--theme-text) !important;
}


.btn-primary {
    background: linear-gradient(135deg, var(--theme-primary-dark) 0%, var(--theme-primary) 100%);
    box-shadow: 0 10px 20px rgba(138,43,226,.20);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #63209f 0%, #933ef0 100%);
}

.btn-outline {
    color: var(--theme-primary);
    border-color: rgba(138,43,226,.34);
    background: rgba(255,255,255,.76);
}

.btn-outline:hover {
    background: var(--theme-primary-soft);
    border-color: var(--theme-primary);
}

.btn-dark {
    background: linear-gradient(135deg, #584274 0%, #3f3155 100%);
}

.btn-danger {
    background: linear-gradient(135deg, #d55b83 0%, #c93a68 100%);
}

input:disabled {
    background: rgba(235,224,255,.40);
}

.upload-block #upload-display,
.upload-submit-title,
.landing-eyebrow,
.services-feature strong,
.services-price-card h3,
.services-back,
.legal-section a,
.services-note a,
.back-link,
.auth-switch a,
.footer-links a {
    color: var(--theme-primary) !important;
}

.upload-submit-state,
.landing-stat {
    border-color: rgba(138,43,226,.18);
    background: linear-gradient(180deg, rgba(243,235,255,.95), rgba(255,255,255,.92));
}

.upload-submit-spinner {
    border-color: rgba(138,43,226,.16);
    border-top-color: var(--theme-primary);
}

.upload-submit-text,
.landing-stat span,
.landing-link-card span,
.services-feature span,
.services-price-card ul,
.services-hero p,
.services-note p,
.legal-section p,
.auth-switch,
.audio-status {
    color: var(--theme-muted);
}

.client-note-card {
    background: linear-gradient(180deg, rgba(243,235,255,.96), rgba(255,255,255,.88));
    box-shadow: var(--theme-shadow-soft);
}

.page-sticky-top .client-note-card,
.page-sticky-top .upload-block {
    margin: 0;
}
.page-sticky-top.is-floating .client-note-card,
.page-sticky-top.is-floating .upload-block {
    box-shadow: 0 14px 34px rgba(84, 33, 140, .16);
}
.page-sticky-top.is-compact .client-note-card {
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(84, 33, 140, .10);
}
.page-sticky-top.is-compact .upload-block {
    padding: 0 8px 8px;
    border-radius: 8px;
}
.page-sticky-top.is-compact .upload-block #upload-display {
    min-height: 20px;
    margin-bottom: 2px;
    font-size: 12px;
    line-height: 1.05;
}
.page-sticky-top.is-compact .workspace-panel-head {
    padding: 8px 10px 0;
}
.page-sticky-top.is-compact .workspace-panel-title {
    font-size: 10px;
}
.page-sticky-top.is-compact #client-note-display {
    padding: 4px 10px 10px !important;
    min-height: 24px !important;
    font-size: 11px !important;
    line-height: 1.3 !important;
}
.page-sticky-top.is-compact .client-note-form {
    padding: 8px 10px;
}
.page-sticky-top.is-compact .client-note-textarea {
    min-height: 32px;
}
.page-sticky-top.is-compact .btn-save-note {
    width: 32px;
    height: 32px;
}

.client-note-textarea {
    border-color: rgba(138,43,226,.22);
}

.btn-save-note {
    background: linear-gradient(135deg, var(--theme-primary-dark), var(--theme-primary));
}

.btn-save-note:hover,
.tp-close:hover {
    background: linear-gradient(135deg, #63209f, #933ef0);
}

.gallery-grid::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--theme-primary), #6d66ff);
}

.gallery-item {
    background: rgba(255,255,255,.92);
    border: 1px solid rgba(217,197,251,.78);
    box-shadow: var(--theme-shadow-soft);
}

.gallery-item:hover {
    box-shadow: var(--theme-shadow);
}

.gallery-date-top {
    background: linear-gradient(135deg, rgba(111,34,182,.96), rgba(138,43,226,.94));
}
.gallery-content {
    background: rgba(255,255,255,.8);
}
.gallery-item-photo .gallery-content,
.gallery-item-text .gallery-content {
    background: transparent !important;
    align-items: stretch;
    justify-content: stretch;
    padding: 0;
    line-height: 0;
}
.gallery-birthday-card .gallery-date-top,
.gallery-item-birthday .gallery-date-top {
    min-height: 42px;
    padding: 10px 11px;
    box-sizing: border-box;
    justify-content: flex-start;
}
.gallery-birthday-card .gallery-date-label,
.gallery-item-birthday .gallery-date-label {
    flex: 1 1 auto;
}
.gallery-item-text .gallery-text-note {
    width: 100%;
    height: 100%;
    min-height: 100%;
    margin: 0;
    display: block;
}
.gallery-item-photo .gallery-img {
    width: 100%;
    height: 138px;
    margin: 0;
    display: block;
    object-fit: cover;
}

.gallery-edit-btn-bottom {
    background: linear-gradient(135deg, var(--theme-accent), #6d66ff);
}

.gallery-edit-btn-bottom:hover {
    background: linear-gradient(135deg, #318ad3, #5d57ea);
}

.gallery-audio-icon {
    background: linear-gradient(135deg, #7f4ce0 0%, #b24cff 100%);
}

.gallery-audio-flag-icon,
.gallery-flag-icon {
    background: linear-gradient(135deg, #7a57ff 0%, #d95bd9 100%);
}

.gallery-text-note {
    background: linear-gradient(135deg, #5d46ae 0%, #8a2be2 100%);
}

.gallery-note-preview,
.gallery-note-text {
    color: var(--theme-text);
    background: rgba(255,255,255,.94);
}

.calendar-table {
    border-radius: 10px;
    overflow: hidden;
}

.calendar-table th,
.calendar-table td {
    border-color: rgba(138,43,226,.12);
}

.calendar-table th {
    background: linear-gradient(180deg, rgba(243,235,255,.96), rgba(234,224,255,.92));
    color: var(--theme-primary);
}

.calendar-table td {
    background: rgba(255,255,255,.72);
}

.calendar-table td:not(.has-photo):not(.has-note):not(.has-refused):not(.has-postponed):not(.has-birthday):hover {
    background: var(--theme-primary-soft);
}

.calendar-table td.has-photo,
.calendar-table td.has-note {
    background: linear-gradient(135deg, var(--theme-primary-dark), var(--theme-primary));
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.18);
}

.calendar-table td.has-refused {
    background: var(--theme-danger) !important;
}

.calendar-table td.has-postponed {
    background: var(--theme-warning) !important;
}

.calendar-table td.has-refused.has-postponed.today {
    box-shadow: inset 0 0 0 2px rgba(255,255,255,.92), 0 0 0 2px rgba(138,43,226,.22);
}

.calendar-table td.has-photo.today,
.calendar-table td.has-note.today {
    background: linear-gradient(135deg, #5f1ea4, #8a2be2);
    color: #fff;
    box-shadow: inset 0 0 0 2px rgba(255,255,255,.92), 0 0 0 2px rgba(138,43,226,.28);
}

.today {
    background: var(--theme-primary-soft-2);
    color: var(--theme-primary);
    box-shadow: inset 0 0 0 2px rgba(138,43,226,.55);
}

.weekend {
    color: var(--theme-danger);
}

.selected,
.has-photo.selected,
.has-note.selected {
    box-shadow: inset 0 0 0 3px var(--theme-success);
}

.flag-indicator.refused {
    color: #ff8eae;
}

.flag-indicator.postponed {
    color: #ffd36a;
}

.flag-indicator.birthday {
    color: #ff87d0;
}

.photo-preview-tooltip {
    background: linear-gradient(180deg, rgba(33,25,51,.97), rgba(26,20,40,.97));
    border: 1px solid rgba(179,145,235,.18);
}

.tp-close {
    background: linear-gradient(135deg, var(--theme-primary-dark), var(--theme-primary));
}

.tp-btn-edit {
    background: linear-gradient(135deg, var(--theme-primary-dark), var(--theme-primary));
}

.tp-audio-wrap,
.gallery-audio-player {
    border-color: rgba(194,169,240,.22);
    background: linear-gradient(135deg, rgba(67,49,100,.96), rgba(37,28,58,.98));
}

.tp-audio-wrap:hover,
.gallery-audio-player:hover {
    background: linear-gradient(135deg, rgba(78,58,116,.98), rgba(48,36,74,.98));
}

.tp-audio-playing,
.gallery-audio-player.gallery-audio-playing {
    background: linear-gradient(135deg, #4a2d7e, #2e7b8f);
}

.landing-link-card:hover,
.services-price-card-active {
    border-color: var(--theme-primary);
    box-shadow: 0 0 0 2px rgba(138,43,226,.10), var(--theme-shadow-soft);
}

.services-feature strong,
.services-price-card h3,
.auth-card h2,
.profile-card h2 {
    color: var(--theme-primary);
}

.services-note,
.legal-section,
.page-footer {
    border-top-color: rgba(138,43,226,.16);
}

.footer-links a:hover,
.services-back:hover,
.back-link:hover,
.legal-section a:hover,
.services-note a:hover {
    color: var(--theme-primary-dark);
}

/* ── Footer ── */
.page-footer {
    margin-top: 40px;
    padding: 20px 0;
    border-top: 1px solid #ddd;
    text-align: center;
}
.footer-links {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}
.footer-links a {
    color: #1a6fc4;
    text-decoration: none;
    font-size: 14px;
}
.footer-links a:hover {
    text-decoration: underline;
}

/* ── Tablet ── */
@media (max-width: 768px) {
    body { font-size: 13.5px; }
    .page {
        max-width: 100%;
        padding-left: 16px;
        padding-right: 16px;
    }
    .page-sticky-top {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .card {
        padding: 16px;
    }
    .navbar-inner {
        padding: 6px 10px;
    }
}

/* ── Mobile ── */
@media (max-width: 600px) {
    body { font-size: 13px; }

    .navbar { padding: 6px 12px; }
    .navbar-brand { font-size: 14px; }
    .navbar-links-left, .navbar-links-right { gap: 8px; }
    .navbar-links a { font-size: 12px; }

    .page {
        margin: 10px auto;
        padding-top: var(--page-top-padding, 0px);
        padding-right: 12px;
        padding-left: 12px;
    }
    .page > * + * { margin-top: 10px; }
    .page-sticky-top {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .page-sticky-top.is-floating {
        top: 8px;
        gap: 8px;
        width: calc(100vw - 24px);
        max-height: calc(100dvh - 16px);
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        pointer-events: auto;
    }
    .page-sticky-top.is-compact { gap: 6px; }
    .page-sticky-top.is-floating .upload-block,
    .page-sticky-top.is-floating .client-note-card {
        min-height: 0;
    }
    .card { padding: 14px; }

    .search-bar input { max-width: 100%; }

    .upload-row { flex-direction: column; gap: 0; }
    .upload-row .form-group { min-width: 100%; }
    .upload-block { max-width: 540px; margin-left: auto; margin-right: auto; }
    .client-note-card { max-width: 540px; margin-left: auto; margin-right: auto; }

    .calendar-wrap {
        display: block;
        width: 100%;
        margin: 0;
        padding: 0;
    }
    .calendar-month-card + .calendar-month-card {
        margin-top: 12px;
    }
    .year-nav {
        width: 100%;
        max-width: 100%;
        gap: 8px;
        padding: 0;
    }
    .year-nav span {
        min-width: 0;
        flex: 0 1 auto;
    }
    .year-nav-btn {
        flex: 1 1 0;
        min-width: 0;
        padding-inline: 10px;
    }
    .calendar-month-card {
        display: block;
        width: 100%;
        max-width: 540px;
        margin: 0 auto;
        padding: 8px;
        box-sizing: border-box;
        overflow: hidden;
        border-radius: 12px;
    }
    .calendar-table {
        width: 100% !important;
        max-width: 100%;
        font-size: 11px;
        table-layout: fixed;
        margin: 0;
    }
    .calendar-table th, .calendar-table td {
        padding: 3px 2px;
        width: auto;
        min-width: 0;
        max-width: none;
        height: 32px;
    }
    .calendar-month-title {
        padding: 12px 6px !important;
    }

    .year-nav { gap: 8px; }
    .year-nav span { font-size: 15px; }
    .calendar-month-title { font-size: 14px !important; }

    .auth-card, .profile-card { margin: 16px auto; padding: 20px 16px; border-radius: 14px; }
    .landing-page { padding: 16px 12px 32px; }
    .landing-hero { grid-template-columns: 1fr; gap: 12px; }
    .landing-hero-copy { padding: 18px; }
    .landing-hero-copy h1 { font-size: 30px; }
    .landing-links { grid-template-columns: 1fr; }
    .landing-cta { padding: 18px; }

    .navbar-inner {
        box-shadow: 0 8px 20px rgba(92, 41, 150, .18);
    }
    .btn-primary {
        box-shadow: 0 4px 12px rgba(138,43,226,.15);
    }
    .btn { padding: 9px 14px; font-size: 13px; }

    .photo-preview-tooltip { max-width: calc(100vw - 16px); width: calc(100vw - 16px); }
    .tp-item { width: 100%; }
    .tp-img-wrap { width: 100%; }
    .tp-img-wrap img { width: 100%; height: auto; }
    .tp-audio-wrap { width: 100%; min-height: 60px; }
    .tp-note { width: 100%; }
    .services-page { padding: 16px 12px 28px; }
    .services-hero h1 { font-size: 26px; }
    .services-feature-grid, .services-pricing-grid { grid-template-columns: 1fr; }
    .contacts-grid { grid-template-columns: 1fr; }
}
