* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f3f4f6;
    color: #111827;
}

.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* === ТОП === */
.tc-header {
    padding: 12px 20px;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tc-logo {
    font-weight: 700;
    color: #2563eb;
}

/* === ОСНОВНОЙ КОНТЕЙНЕР (как FuelCalc) === */
/*.tc-main {
    max-width: 420px;
    margin: 20px auto;
    padding: 0 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}*/
.tc-main {
    width: 420px;        /* фиксируем ширину */
    max-width: none;     /* отключаем адаптив */
    margin: 20px auto;   /* оставляем центровку */
    padding: 0 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* === КАРТОЧКИ (как FuelCalc) === */
.tc-card {
    width: 100%;
    max-width: 420px;
     /*min-width: 420px;  ВАЖНО! */; /* ВАЖНО! */
    box-sizing: border-box;
}

.tc-card {
    background: #ffffff;
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.06);
    border: 1px solid #e5e7eb;
}



/* === ТЕКСТЫ === */
.tc-shift {
    font-size: 20px;
    font-weight: 600;
}

.tc-shift.first { color: #16a34a; }
.tc-shift.second { color: #2563eb; }
.tc-shift.empty { color: #9ca3af; }

.tc-sub {
    margin-top: 4px;
    font-size: 14px;
    color: #6b7280;
}

/* === СТРОКИ === */
.tc-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tc-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.tc-label {
    min-width: 120px;
    font-size: 14px;
    color: #4b5563;
}

/* === ПОЛЯ === */
.tc-input {
    flex: 1;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid #d1d5db;
    font-size: 15px;
    background: #ffffff;
}

.tc-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.2);
}

/* === КНОПКИ === */
.tc-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tc-btn {
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: 0.15s;
}

.tc-btn-primary {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
}

.tc-btn-primary:hover {
    background: #1d4ed8;
}

.tc-btn-secondary {
    background: #ffffff;
    color: #374151;
    border-color: #d1d5db;
}

.tc-btn-secondary:hover {
    background: #f3f4f6;
}

.tc-btn-outline {
    width: 100%;
    background: #ffffff;
    color: #374151;
    border-color: #d1d5db;
    margin-top: 8px;
}

.tc-btn-outline:hover {
    background: #f3f4f6;
}

/* === РЕЗУЛЬТАТ === */
.tc-result {
    margin-top: 8px;
    padding: 10px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    text-align: center;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
}

.tc-result.first { color: #16a34a; }
.tc-result.second { color: #2563eb; }
.tc-result-empty { color: #9ca3af; }

/* === КАЛЕНДАРЬ === */
.hidden { display: none; }
.tc-calendar,
#yearCalendar {
    width: 100%;
    max-width: 420px;
     /*min-width: 420px;  ВАЖНО! */; /* ВАЖНО! */
    box-sizing: border-box;
}



.tc-calendar {
    margin-top: 12px;
    padding: 12px;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    background: #f9fafb;
}

.calendar-header {
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: #4b5563;
    margin-bottom: 8px;
}
.calendar-grid {
    width: 100%;
    max-width: 420px;
    /* /*min-width: 420px;  ВАЖНО! */;  ВАЖНО! */
    box-sizing: border-box;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}


.calendar-cell {
    min-height: 32px;
    border-radius: 8px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #4b5563;
}

.calendar-cell .day {
    font-weight: 600;
    margin-bottom: 2px;
}

.calendar-cell.first {
    border-color: #16a34a;
    color: #166534;
}

.calendar-cell.second {
    border-color: #2563eb;
    color: #1d4ed8;
}

.calendar-cell.empty {
    opacity: 0.4;
}

.calendar-cell.weekend {
    background: #fee2e2;
    border-color: #fecaca;
    color: #b91c1c;
}

/* === ГОД === */
.year-calendar-block {
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    padding: 10px;
    margin-bottom: 12px;
}

#yearCalendar {
    border: none;
    background: transparent;
    padding: 0;
}

/* === ФУТЕР === */
.tc-footer {
    margin-top: auto;
    padding: 12px 24px;
    font-size: 14px;
    color: #6b7280;
    border-top: 1px solid #e5e7eb;
    background: #ffffff;
}
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    width: 100%;
    box-sizing: border-box;
}

.calendar-cell {
    box-sizing: border-box;
    min-width: 0; /* ВАЖНО! */
}
/* === СТАБИЛИЗАЦИЯ КАЛЕНДАРЯ === */

/* Карточка фиксирована, но сетка должна подстраиваться */
.tc-card {
    width: 100%;
    max-width: 420px;
    box-sizing: border-box;
}

/* Календарь не должен иметь min-width */
.tc-calendar,
#yearCalendar {
    width: 100%;
    max-width: 420px;
    box-sizing: border-box;
}

/* Сетка должна сжиматься, а не растягиваться */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    width: 100%;
    box-sizing: border-box;
}

/* Ячейки должны иметь право сжиматься */
.calendar-cell {
    min-width: 0; /* КЛЮЧЕВОЕ */
    box-sizing: border-box;
}
