* { box-sizing: border-box; }
body {
    font-family: Arial, sans-serif;
    background: #f3f3f3;
    margin: 0;
    padding: 0 10px;
    color: #222;
}
.container {
    max-width: 640px;
    margin: 30px auto;
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}
.container.wide { max-width: 1100px; }
h1, h2, h3 { text-align: center; }
h1 { margin-bottom: 4px; color: #b71c1c; }
h2 { margin-top: 28px; font-size: 1.2em; border-bottom: 2px solid #b71c1c; padding-bottom: 6px; }
.subtitle { text-align: center; color: #666; margin-top: 0; }
.small { font-size: 0.85em; color: #666; }
.muted { color: #999; }
.nowrap { white-space: nowrap; }

form { margin-top: 10px; }
form.inline { margin: 8px 0; }
label { display: block; font-weight: bold; }
input[type="text"], input[type="password"] {
    padding: 8px;
    width: 100%;
    margin: 6px 0 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1em;
}
button {
    padding: 8px 14px;
    background: #007BFF;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95em;
}
button:hover { background: #0056b3; }
.btn-wide { width: 100%; padding: 10px; }
.btn-secondary { background: #6c757d; }
.btn-secondary:hover { background: #545b62; }
button.btn-red { background-color: #dc3545; }
button.btn-red:hover { background-color: #a71d2a; }

.box { padding: 12px 14px; border-radius: 8px; margin: 12px 0; }
.box.info  { background: #e8f1fb; border: 1px solid #b6d4f2; }
.box.ok    { background: #e7f6ea; border: 1px solid #a8dbb3; }
.box.warn  { background: #fff7e0; border: 1px solid #f0d17a; }
.box.error { background: #fde8e8; border: 1px solid #f2b0b0; }
.box h3 { margin-top: 0; }

.topbar {
    display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px;
    font-size: 0.9em; padding-bottom: 10px; border-bottom: 1px solid #eee;
}
a { color: #007BFF; }

.slot {
    border: 1px solid #ddd; border-radius: 8px;
    padding: 12px; margin: 10px 0; background: #fafafa;
}
.slot-mine { border-color: #28a745; background: #f1faf3; }
.slot-head { display: flex; justify-content: space-between; align-items: center; }
.slot-time { font-size: 1.15em; font-weight: bold; }
.slot-meet { color: #555; }
.slot-count {
    background: #b71c1c; color: white; border-radius: 20px;
    padding: 4px 10px; font-weight: bold; font-size: 0.9em;
}
.slot-people { margin: 10px 0 4px; display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
    display: inline-flex; align-items: center; gap: 4px;
    background: #eee; border-radius: 14px; padding: 4px 10px; font-size: 0.9em;
}
.chip-me { background: #28a745; color: white; font-weight: bold; }
.chip-form { margin: 0; display: inline; }
.chip-x {
    background: none; color: #dc3545; padding: 0 2px; font-size: 1.1em; line-height: 1;
}
.chip-x:hover { background: none; color: #a71d2a; }
.badge { color: #28a745; font-weight: bold; margin-right: 8px; }
.add-form { display: flex; gap: 6px; align-items: center; }
.add-form input[type="text"] { margin: 0; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; margin-top: 10px; }
th, td { border: 1px solid #ccc; padding: 6px 8px; text-align: left; font-size: 0.88em; vertical-align: top; }
th { background-color: #f0f0f0; }
tr.row-red td { background: #fff1f1; }
tr.row-green td { background: #f2fbf4; }

/* Grafik: każda msza w osobnej kolumnie, pogrupowane po dniach */
.container.wide { max-width: 1500px; }
.days { display: flex; gap: 16px; align-items: flex-start; }
.day-col { flex: var(--n) 1 0; min-width: 0; }
.day-col h2 { margin-top: 18px; }
.day-slots {
    display: grid;
    grid-template-columns: repeat(var(--n), minmax(0, 1fr));
    gap: 10px;
}
.day-slots .slot { margin: 0; display: flex; flex-direction: column; min-height: 100%; }
.day-slots .slot-head { flex-direction: column; align-items: flex-start; gap: 6px; }
.day-slots .slot-people { flex-direction: column; align-items: stretch; flex: 1; }
.day-slots .chip { justify-content: space-between; }
.day-slots form { margin-top: 8px; }
.day-slots form button { width: 100%; }
.day-slots .chip-form button.chip-x { width: auto; }
.day-slots .badge { display: block; margin-bottom: 6px; }
.day-slots .add-form { flex-direction: column; align-items: stretch; }

/* Węższe ekrany: dni jeden pod drugim, msze po 2–3 w rzędzie */
@media (max-width: 1100px) {
    .days { flex-direction: column; align-items: stretch; }
    .day-slots { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
}
@media (max-width: 480px) {
    .day-slots { grid-template-columns: 1fr; }
}
