:root {
    --bg: #f3f4f6;
    --surface: #ffffff;
    --primary: #cc0000;
    --text: #1f2937;
    --text-light: #6b7280;
    --border-color: #e5e7eb;
}

body,
html {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.env-banner {
    flex: 0 0 auto;
    padding: 8px 16px;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.35;
    background: #fef3c7;
    color: #92400e;
    border-bottom: 1px solid #f59e0b;
}

.app-header {
    flex: 0 0 auto;
    background: var(--surface);
    padding: 15px 20px;
    font-size: 1.2rem;
    font-weight: bold;
    border-bottom: 1px solid var(--border-color);
    z-index: 10;
}
.app-header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}
.selected-date-display {
    font-size: 0.9rem;
    color: var(--primary);
    font-weight: normal;
}

.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 15px;
    gap: 15px;
    width: 100%;
    box-sizing: border-box;
}

.view-content {
    display: none;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    gap: 15px;
}
.view-content.active {
    display: flex;
}

.scroll-area {
    flex: 1;
    overflow-y: auto;
    scrollbar-width: none;
}
.scroll-area::-webkit-scrollbar {
    display: none;
}

#loading-workouts,
#loading-docs,
#loading-library,
#loading-all-workouts,
.empty-state,
.error-ui {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
}
.rest-day-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-light);
    font-style: italic;
}
.rest-day-icon {
    font-size: 3rem;
    margin-bottom: 10px;
    opacity: 0.5;
}

.workouts-feed {
    flex: 1;
    overflow-y: auto;
    scroll-snap-type: y proximity;
    scrollbar-width: none;
    scroll-behavior: auto;
    display: flex;
    flex-direction: column;
}
.workouts-feed.is-positioning {
    visibility: hidden;
}
.workouts-feed::-webkit-scrollbar {
    display: none;
}

.day-slide {
    flex: 0 0 auto;
    min-height: 100%;
    width: 100%;
    scroll-snap-align: start;
    padding-bottom: 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.search-container {
    flex: 0 0 auto;
    margin-bottom: 10px;
}
.search-input {
    width: 100%;
    padding: 12px 15px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    font-size: 1rem;
    box-sizing: border-box;
    outline: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.filters-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 0 0 auto;
    margin-bottom: 10px;
}
.filter-row {
    display: flex;
    gap: 10px;
}
.filter-row-full {
    width: 100%;
}
.filter-row-full .filter-input {
    width: 100%;
}
.filter-input {
    width: 100%;
    padding: 12px 15px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    font-size: 0.95rem;
    box-sizing: border-box;
    outline: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    background: var(--surface);
    color: var(--text);
}
select.filter-input {
    appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%236b7280" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M6 9l6 6 6-6"/></svg>');
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

#view-workouts .filters-grid.workouts-filters {
    gap: 6px;
    margin-bottom: 8px;
}
#view-workouts .workout-active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
#view-workouts .workout-active-filters:empty {
    display: none;
}
#view-workouts .workout-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px 4px 2px 8px;
    font-size: 0.72rem;
    font-weight: 500;
    line-height: 1.35;
    color: var(--text);
    background: #eef2f6;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    max-width: 100%;
}
#view-workouts .workout-filter-chip-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 200px;
}
#view-workouts .workout-filter-chip-remove {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--text-light);
    font-size: 1rem;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
#view-workouts .workout-filter-chip-remove:hover {
    color: var(--primary);
    background: rgba(204, 0, 0, 0.08);
}
#view-workouts .workouts-filters .filter-input {
    padding: 7px 10px;
    font-size: 0.8rem;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
#view-workouts .workouts-filters select.filter-input {
    background-position: right 8px center;
    padding-right: 30px;
    background-size: 14px;
}
#view-workouts .workouts-filters .filter-row {
    gap: 8px;
}

#view-library .search-container {
    margin-bottom: 8px;
}
#view-library .search-input {
    padding: 7px 10px;
    font-size: 0.8rem;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.workout-card {
    background: var(--surface);
    border-radius: 12px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    border: 1px solid var(--border-color);
}
.card-header {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid var(--border-color);
}
.workout-id {
    background: var(--primary);
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
}
.workout-title {
    padding: 12px 15px;
    font-weight: bold;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-grow: 1;
    background: #f9fafb;
    color: #333;
}
.workout-title-label {
    flex: 1;
    min-width: 0;
}
.card-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.custom-notice-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 8px;
    border: 1px solid #fdba74;
    background: #fff7ed;
    color: #c2410c;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition:
        background 0.2s,
        border-color 0.2s,
        transform 0.1s;
}
.custom-notice-btn svg {
    width: 22px;
    height: 22px;
    display: block;
}
.custom-notice-btn:hover {
    background: #ffedd5;
    border-color: #fb923c;
}
.custom-notice-btn:active {
    transform: scale(0.98);
}
.share-btn {
    flex-shrink: 0;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--surface);
    color: var(--primary);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition:
        background 0.2s,
        border-color 0.2s;
}
.share-btn:hover {
    background: #fdeeee;
    border-color: rgba(204, 0, 0, 0.35);
}
.share-btn:active {
    transform: scale(0.98);
}
.custom-notice-dialog {
    border: none;
    border-radius: 16px;
    padding: 0;
    margin: auto;
    max-width: min(420px, calc(100vw - 32px));
    width: calc(100% - 32px);
    background: var(--surface);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.22);
}
.custom-notice-dialog::backdrop {
    background: rgba(15, 23, 42, 0.45);
}
.custom-notice-dialog-panel {
    padding: 20px;
}
.custom-notice-dialog-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 14px;
    font-size: 1.05rem;
    font-weight: 700;
    color: #c2410c;
}
.custom-notice-dialog-title svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}
.custom-notice-dialog-body {
    white-space: pre-wrap;
    line-height: 1.55;
    font-size: 0.95rem;
    color: var(--text);
    max-height: min(50vh, 320px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.custom-notice-dialog-close {
    margin-top: 18px;
    width: 100%;
    box-sizing: border-box;
}
@media (max-width: 480px) {
    .custom-notice-dialog {
        width: calc(100% - 24px);
        max-width: none;
        margin: auto auto 12px;
        border-radius: 14px;
    }
    .custom-notice-dialog-panel {
        padding: 18px 16px 16px;
    }
}
.card-meta {
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid var(--border-color);
    background: #f3f4f6;
    font-size: 0.85rem;
}
@media (min-width: 400px) {
    .card-meta {
        flex-direction: row;
    }
}
.meta-item {
    flex: 1;
    padding: 10px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}
@media (min-width: 400px) {
    .meta-item {
        border-bottom: none;
        border-right: 1px solid var(--border-color);
    }
    .meta-item:last-child {
        border-right: none;
    }
}
.meta-label {
    color: var(--text-light);
    font-size: 0.65rem;
    margin-bottom: 3px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.meta-value {
    font-weight: bold;
}
.card-body {
    padding: 15px;
    line-height: 1.6;
}

.accordion-details {
    margin-top: 15px;
}
.accordion-summary {
    background: #fdf2f2;
    color: var(--primary);
    padding: 12px;
    border-radius: 8px;
    font-weight: bold;
    text-align: center;
    cursor: pointer;
    font-size: 0.9rem;
    list-style: none;
    border: 1px solid rgba(204, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}
.accordion-summary::before {
    content: '▼';
    margin-right: 8px;
    font-size: 0.8rem;
}
.accordion-content {
    background: #f9fafb;
    padding: 15px;
    border-radius: 8px;
    border: 1px dashed #ccc;
    font-size: 0.9rem;
    margin-top: 10px;
}

.workout-movements {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}
.movements-title {
    font-size: 0.75rem;
    color: var(--text-light);
    text-transform: uppercase;
    font-weight: bold;
    margin-bottom: 10px;
}
.movements-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.movement-tag {
    background: #f3f4f6;
    color: var(--text);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    text-decoration: none;
    border: 1px solid #d1d5db;
    transition: 0.2s;
    font-weight: 500;
}
.movement-tag:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.workout-tags {
    margin-top: 12px;
}
.tags-title {
    font-size: 0.75rem;
    color: var(--text-light);
    text-transform: uppercase;
    font-weight: bold;
    margin-bottom: 8px;
}
.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.workout-tag {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.workout-list-item {
    background: var(--surface);
    border-radius: 12px;
    margin-bottom: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}
.workout-list-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    cursor: pointer;
    transition: background 0.2s;
}
.workout-list-header:hover {
    background: #f9fafb;
}
.workout-list-id {
    font-size: 1.1rem;
    background: var(--primary);
    color: white;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    flex-shrink: 0;
    font-weight: bold;
}
.workout-list-info {
    flex-grow: 1;
    min-width: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.workout-list-primary {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}
.workout-list-pattern {
    font-weight: bold;
    font-size: 0.95rem;
    margin-bottom: 4px;
    color: var(--text);
}
.workout-list-duration {
    font-size: 0.8rem;
    color: var(--text-light);
}
.workout-list-author-chip {
    display: inline-flex;
    align-items: center;
    max-width: 42%;
    padding: 4px 10px;
    font-size: 0.72rem;
    font-weight: 500;
    line-height: 1.35;
    color: var(--text);
    background: #eef2f6;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 1;
}
.workout-list-chevron {
    color: var(--text-light);
    font-size: 0.9rem;
    transition: transform 0.3s;
    margin-left: auto;
}
.workout-list-item.open .workout-list-chevron {
    transform: rotate(180deg);
}
.workout-list-details {
    display: none;
    border-top: 1px solid var(--border-color);
    background: #fafafa;
}
#view-workouts .workout-list-details .card-body {
    padding: 10px 12px;
    line-height: 1.5;
}
#view-workouts .workout-list-details .accordion-details {
    margin-top: 10px;
}
#view-workouts .workout-list-details .accordion-summary {
    padding: 8px;
    font-size: 0.85rem;
}
#view-workouts .workout-list-details .accordion-content {
    padding: 10px;
    font-size: 0.85rem;
    margin-top: 8px;
}
.workout-list-header-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}
.workout-list-item.open .workout-list-header-tags {
    display: none;
}
#view-workouts .workout-list-details .workout-list-card-body .workout-movements {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}
#view-workouts .workout-list-details .workout-list-card-body .movements-title {
    margin-bottom: 8px;
}
#view-workouts .workout-list-details .workout-list-card-body .movement-tag {
    padding: 4px 10px;
    font-size: 0.78rem;
}
#view-workouts .workout-list-details .workout-list-card-body .workout-tags {
    margin-top: 10px;
}
#view-workouts .workout-list-details .workout-list-card-body .workout-tag {
    padding: 2px 7px;
    font-size: 0.68rem;
}
#view-workouts .workout-list-details table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    margin: 8px 0;
}
#view-workouts .workout-list-details th,
#view-workouts .workout-list-details td {
    border: 1px solid var(--border-color);
    padding: 6px 8px;
    vertical-align: top;
}
#view-workouts .workout-list-details p {
    margin: 0.45em 0;
}
#view-workouts .workout-list-details ul,
#view-workouts .workout-list-details ol {
    margin: 0.45em 0;
    padding-left: 1.25em;
}
@media (max-width: 479px) {
    #view-workouts .workout-list-details .card-body {
        padding: 8px 10px;
    }
    #view-workouts .workout-list-details table {
        font-size: 0.8rem;
        margin: 6px 0;
    }
    #view-workouts .workout-list-details th,
    #view-workouts .workout-list-details td {
        padding: 5px 6px;
    }
}

.library-item {
    background: var(--surface);
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
    transition: background 0.2s;
}
.library-item:hover {
    background: #f9fafb;
}
.planning-week {
    margin-bottom: 20px;
    padding: 12px;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}
.planning-week-intro {
    margin-bottom: 12px;
}
.planning-week-title {
    margin: 0 0 4px;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
}
.planning-week-subtitle {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.4;
    color: var(--text-light);
}
.planning-week-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}
.planning-week-label {
    flex: 1 1 8rem;
    min-width: 0;
    font-weight: 600;
    font-size: 0.95rem;
    text-align: center;
}
#planning-week-pick {
    flex: 0 0 auto;
    margin-left: auto;
    padding: 6px 12px;
    font-size: 0.8rem;
}
.planning-week-days {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.planning-day-row {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid var(--border-color);
}
.planning-day-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.planning-day-name {
    flex: 0 0 3.2rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text);
}
.planning-day-movements {
    flex: 1;
    min-width: 0;
}
.planning-day-movements .movements-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.planning-day-movements .movement-tag {
    padding: 2px 8px;
    font-size: 0.72rem;
    border-radius: 999px;
}
.planning-day-movements .planning-tags-list {
    margin-top: 4px;
}
.planning-day-movements .workout-tag {
    padding: 2px 6px;
    font-size: 0.65rem;
}
.planning-day-empty {
    font-size: 0.85rem;
    color: var(--text-light);
    font-style: italic;
}
.planning-day-loading {
    padding: 16px;
    text-align: center;
    color: var(--text-light);
    font-size: 0.9rem;
}
.planning-docs-title {
    margin: 0 0 10px;
    max-width: 480px;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
}
#docs-container {
    max-width: 480px;
}
.plan-card {
    background: var(--surface);
    border-radius: 8px;
    padding: 6px 10px;
    margin-bottom: 5px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.plan-icon {
    font-size: 0.6rem;
    background: #fdeeee;
    color: var(--primary);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    flex-shrink: 0;
    font-weight: bold;
}
.plan-info {
    flex-grow: 1;
    display: flex;
    align-items: baseline;
    gap: 6px;
    min-width: 0;
}
.plan-title {
    flex: 1;
    min-width: 0;
    font-weight: 600;
    font-size: 0.85rem;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.plan-subtitle {
    display: none;
}
.plan-link-btn {
    flex-shrink: 0;
    color: var(--text-light);
    font-size: 0.8rem;
}
.planning-week-dialog {
    border: none;
    border-radius: 16px;
    padding: 0;
    margin: auto;
    max-width: min(360px, calc(100vw - 32px));
    width: calc(100% - 32px);
    background: var(--surface);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.22);
}
.planning-week-dialog::backdrop {
    background: rgba(15, 23, 42, 0.45);
}
.planning-week-dialog-panel {
    padding: 18px 16px 16px;
}
.planning-week-dialog-title {
    margin: 0 0 14px;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
}
.planning-cal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-weight: bold;
}
.planning-cal-month {
    flex: 1;
    text-align: center;
    font-size: 0.95rem;
}
.planning-cal-day-names {
    margin-bottom: 4px;
}
.planning-week-dialog-close {
    margin-top: 14px;
    width: 100%;
    box-sizing: border-box;
}
.calendar-container {
    flex: 0 0 auto;
    background: var(--surface);
    border-radius: 12px;
    padding: 12px;
    border: 1px solid var(--border-color);
    transition: opacity 0.3s ease;
}
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-weight: bold;
}

.calendar-month-label {
    cursor: pointer;
    transition: color 0.2s;
    user-select: none;
}
.calendar-month-label:hover {
    color: var(--primary);
}

.btn-nav {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
}
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    text-align: center;
}
.day-name {
    font-size: 0.7rem;
    color: var(--text-light);
    font-weight: bold;
    text-transform: uppercase;
}
.calendar-day {
    position: relative;
    padding: 6px 0 12px 0;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: 0.2s;
}
.calendar-day:hover {
    background: #f3f4f6;
}
.calendar-day.today {
    border: 1px solid var(--primary);
    font-weight: bold;
    border-radius: 50%;
}
.calendar-day.selected {
    background: var(--primary) !important;
    color: white !important;
    font-weight: bold;
    border-radius: 50%;
}

.workout-dot {
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 5px;
    height: 5px;
    background-color: var(--primary);
    border-radius: 50%;
}
.calendar-day.selected .workout-dot {
    background-color: white;
}

.calendar-expand-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px 0 4px 0;
    margin-top: 5px;
    cursor: pointer;
    border-top: 1px solid var(--border-color);
}
.calendar-handle {
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background-color: #d1d5db;
    transition:
        background-color 0.2s,
        width 0.2s;
}
.calendar-expand-btn:hover .calendar-handle {
    background-color: var(--primary);
    width: 46px;
}

.site-footer {
    flex: 0 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem 1rem;
    padding: 6px 12px;
    font-size: 0.7rem;
    background: var(--surface);
    border-top: 1px solid var(--border-color);
}
.site-footer a {
    color: var(--text-light);
    text-decoration: none;
}
.site-footer a:hover {
    color: var(--primary);
}

.bottom-nav {
    flex: 0 0 auto;
    background: var(--surface);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    padding: 6px 0;
    padding-bottom: max(6px, env(safe-area-inset-bottom));
}
.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-light);
    font-size: 0.65rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    background: none;
    gap: 2px;
    flex: 1;
}
.nav-item.active {
    color: var(--primary);
}
.nav-icon {
    font-size: 1rem;
}

.main-wrapper:has(> #view-plan.active) {
    gap: 10px;
}
#view-plan.active {
    gap: 10px;
}
#view-plan .day-slide {
    padding-bottom: 12px;
}
#view-plan .calendar-container {
    padding: 8px;
}
#view-plan .calendar-header {
    margin-bottom: 6px;
}
#view-plan .calendar-grid {
    gap: 3px;
}
#view-plan .calendar-day {
    padding: 4px 0 8px;
    font-size: 0.82rem;
}
#view-plan .btn-nav {
    font-size: 1.25rem;
}
#view-plan .calendar-expand-btn {
    padding: 8px 0 2px;
    margin-top: 3px;
}
#view-plan .workout-dot {
    width: 4px;
    height: 4px;
}
#view-plan .workout-card {
    margin-bottom: 10px;
}
#view-plan .workout-id {
    font-size: 1.2rem;
    padding: 10px 12px;
    min-width: 44px;
}
#view-plan .workout-title {
    font-size: 0.95rem;
    padding: 8px 12px;
}
#view-plan .share-btn {
    padding: 6px 10px;
    font-size: 0.8rem;
}
#view-plan .custom-notice-btn {
    width: 36px;
    height: 36px;
}
#view-plan .custom-notice-btn svg {
    width: 20px;
    height: 20px;
}
#view-plan .card-meta {
    font-size: 0.78rem;
    padding-top: 4px;
}
#view-plan .meta-item {
    padding: 6px 8px;
}
#view-plan .meta-label {
    font-size: 0.6rem;
    margin-bottom: 2px;
}
#view-plan .card-body {
    padding: 10px 12px;
    line-height: 1.5;
}
#view-plan .accordion-details {
    margin-top: 10px;
}
#view-plan .accordion-summary {
    padding: 8px;
    font-size: 0.85rem;
}
#view-plan .accordion-content {
    padding: 10px;
    font-size: 0.85rem;
    margin-top: 8px;
}
#view-plan .workout-movements {
    margin-top: 12px;
    padding-top: 10px;
}
#view-plan .movements-title {
    margin-bottom: 8px;
}
#view-plan .movement-tag {
    padding: 4px 10px;
    font-size: 0.78rem;
}
#view-plan .workout-tags {
    margin-top: 10px;
}
#view-plan .workout-tag {
    padding: 2px 7px;
    font-size: 0.68rem;
}
#view-plan .rest-day-icon {
    font-size: 2.25rem;
    margin-bottom: 8px;
}
#view-plan .rest-day-state {
    font-size: 0.9rem;
}

@media (max-width: 479px) {
    .main-wrapper:has(> #view-plan.active) {
        gap: 8px;
    }
    #view-plan.active {
        gap: 8px;
    }
    #view-plan .card-body {
        padding: 8px 10px;
    }
    #view-plan .meta-item {
        padding: 5px 6px;
    }
}

@media (min-width: 800px) {
    .app-header-inner,
    .main-wrapper {
        max-width: 1000px;
        margin: 0 auto;
    }
    .bottom-nav {
        justify-content: center;
        gap: 28px;
    }
    #view-plan.active {
        flex-direction: row;
        align-items: stretch;
    }
    .workouts-feed {
        margin-right: 15px;
    }
    .calendar-container {
        width: 350px;
        align-self: stretch;
        display: flex;
        flex-direction: column;
    }
    .calendar-expand-btn {
        display: none;
    }
    .calendar-month-label {
        pointer-events: none;
        cursor: default;
    }
}
