* { box-sizing: border-box; }

:root {
    font-family: Arial, Helvetica, sans-serif;
    color: #111827;
    background: #f3f4f6;
}

body {
    margin: 0;
    min-height: 100vh;
    background: #f3f4f6;
}

a { color: inherit; }

.app {
    width: min(100%, 720px);
    margin: 0 auto;
    padding: 18px;
}

.app-wide {
    width: min(100%, 980px);
}

.topbar,
.page-heading {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 18px;
}

.brand h1,
.page-heading h1 {
    margin: 0 0 4px;
    font-size: 27px;
}

.signed-in-name {
    padding: 8px 11px;
    border-radius: 999px;
    background: #e5e7eb;
    font-size: 13px;
    font-weight: 700;
}

.muted {
    color: #6b7280;
    font-size: 14px;
}

.card {
    background: #fff;
    border-radius: 18px;
    padding: 20px;
    margin-bottom: 14px;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
}

.card h2,
.card h3 {
    margin-top: 0;
}

.status {
    display: inline-block;
    background: #dcfce7;
    color: #166534;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 13px;
    font-weight: 700;
}

.nav-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.nav-card {
    display: block;
    text-decoration: none;
    background: #fff;
    border-radius: 16px;
    padding: 20px 12px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,.06);
    transition: transform .12s ease, box-shadow .12s ease;
}

.nav-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 16px rgba(0,0,0,.08);
}

.nav-icon {
    display: block;
    font-size: 27px;
    margin-bottom: 7px;
}

.button,
button {
    appearance: none;
    border: 0;
    border-radius: 12px;
    padding: 11px 15px;
    background: #111827;
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.button.secondary,
button.secondary {
    background: #e5e7eb;
    color: #111827;
}

.button.compact {
    padding: 8px 13px;
}

.logout-form { margin: 0; }

.form-card {
    max-width: 440px;
    margin: 8vh auto 0;
}

.field {
    margin-bottom: 16px;
}

.field.no-margin {
    margin-bottom: 0;
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    padding: 12px 13px;
    font: inherit;
    background: #fff;
    color: #111827;
}

textarea {
    resize: vertical;
    min-height: 110px;
}

input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #111827;
    outline-offset: 1px;
}

.error,
.success,
.notice {
    border-radius: 12px;
    padding: 11px 13px;
    margin-bottom: 16px;
}

.error {
    background: #fee2e2;
    color: #991b1b;
}

.success {
    background: #dcfce7;
    color: #166534;
}

.notice {
    background: #f3f4f6;
    color: #4b5563;
    border: 1px dashed #d1d5db;
}

.week-summary {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
}

.back-link {
    display: inline-block;
    margin-bottom: 8px;
    color: #374151;
    text-decoration: none;
}

.calendar-card {
    overflow: hidden;
}

.calendar-toolbar {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
}

.calendar-title {
    text-align: center;
    font-size: 22px;
    font-weight: 800;
}

.calendar-actions {
    margin: 14px 0;
    text-align: center;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.weekday-grid {
    border-top: 1px solid #e5e7eb;
    border-left: 1px solid #e5e7eb;
}

.weekday {
    text-align: center;
    padding: 9px 3px;
    font-size: 12px;
    font-weight: 800;
    color: #6b7280;
    border-right: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
}

.days-grid {
    border-left: 1px solid #e5e7eb;
}

.day-cell {
    min-height: 105px;
    padding: 8px;
    text-decoration: none;
    background: #fff;
    border-right: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
    position: relative;
    overflow: hidden;
}

.day-cell:hover {
    background: #f9fafb;
}

.day-cell.outside-month {
    background: #f9fafb;
    color: #9ca3af;
}

.day-cell.today {
    box-shadow: inset 0 0 0 2px #111827;
    z-index: 1;
}

.day-number {
    font-weight: 800;
    margin-bottom: 8px;
}

.empty-day {
    font-size: 20px;
    color: #d1d5db;
    line-height: 1;
}

.duty-chip,
.status-chip {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border-radius: 8px;
    padding: 5px 7px;
    font-size: 12px;
    font-weight: 800;
    background: #e5e7eb;
}

.status-rest .status-chip {
    background: #e0f2fe;
}

.status-sick .status-chip {
    background: #fee2e2;
}

.status-holiday .status-chip {
    background: #fef3c7;
}

.day-meta {
    margin-top: 6px;
    font-size: 11px;
    color: #4b5563;
}

.ot-meta {
    font-weight: 800;
}

.calendar-help {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
}

.day-form {
    padding: 0;
    overflow: hidden;
}

.form-section {
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.form-section h2 {
    margin: 0 0 16px;
    font-size: 18px;
}

.two-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.planned-duty-summary {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 12px;
    align-items: center;
    padding: 13px;
    border-radius: 12px;
    background: #f9fafb;
    font-size: 14px;
}

.planned-duty-summary strong,
.planned-duty-summary span {
    display: block;
}

.overtime-box {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    align-items: end;
    padding: 14px;
    border-radius: 14px;
    background: #f9fafb;
}

.overtime-box > div:first-child {
    display: grid;
    gap: 4px;
}

.overtime-box strong {
    font-size: 22px;
}

.overtime-box small {
    color: #6b7280;
}

.save-button {
    width: calc(100% - 40px);
    margin: 20px;
    padding: 14px 18px;
}

.mini-summary-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.money-total {
    font-size: 22px;
    font-weight: 800;
}

.page-note {
    text-align: center;
    margin: 16px 0 4px;
}

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

@media (max-width: 640px) {
    .calendar-card {
        padding: 12px;
    }

    .day-cell {
        min-height: 82px;
        padding: 6px;
    }

    .duty-chip,
    .status-chip {
        display: block;
        padding: 4px 5px;
        font-size: 10px;
    }

    .day-meta {
        font-size: 9px;
        margin-top: 4px;
    }

    .calendar-help {
        display: block;
    }

    .calendar-help strong {
        display: block;
        margin-bottom: 4px;
    }

    .planned-duty-summary {
        grid-template-columns: 1fr;
        gap: 5px;
    }
}

@media (max-width: 480px) {
    .app {
        padding: 14px;
    }

    .brand h1,
    .page-heading h1 {
        font-size: 24px;
    }

    .card {
        padding: 17px;
    }

    .calendar-card {
        padding: 8px;
        border-radius: 14px;
    }

    .calendar-title {
        font-size: 19px;
    }

    .weekday {
        font-size: 10px;
    }

    .day-cell {
        min-height: 72px;
        padding: 5px;
    }

    .day-number {
        font-size: 13px;
        margin-bottom: 5px;
    }

    .two-columns,
    .overtime-box {
        grid-template-columns: 1fr;
    }

    .form-section {
        padding: 17px;
    }

    .save-button {
        width: calc(100% - 34px);
        margin: 17px;
    }
}


/* Step 3 — duty administration/import */
.admin-nav {
    margin-top: 12px;
}

.admin-card {
    border: 1px solid #e5e7eb;
}

.admin-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.admin-toolbar h2 {
    margin: 0;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th,
.data-table td {
    text-align: left;
    padding: 10px 9px;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: top;
}

.data-table th {
    color: #6b7280;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.data-table tr:last-child td {
    border-bottom: 0;
}

.badge {
    display: inline-block;
    border-radius: 999px;
    padding: 4px 8px;
    background: #e5e7eb;
    font-size: 12px;
    font-weight: 700;
}

.badge.good {
    background: #dcfce7;
    color: #166534;
}

.badge.warn {
    background: #fef3c7;
    color: #92400e;
}

.import-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.import-grid .full {
    grid-column: 1 / -1;
}

.preview-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.preview-stat {
    padding: 12px;
    border-radius: 12px;
    background: #f9fafb;
}

.preview-stat strong {
    display: block;
    font-size: 20px;
    margin-bottom: 3px;
}

.warning-list {
    margin: 8px 0 0;
    padding-left: 20px;
}

.duty-sheet-link {
    display: inline-block;
    margin-top: 10px;
    font-weight: 700;
}

.admin-small {
    font-size: 12px;
    color: #6b7280;
}

@media (max-width: 640px) {
    .import-grid {
        grid-template-columns: 1fr;
    }

    .preview-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }
}


/* Step 4 — extras and bus notes */
.summary-link {
    color: inherit;
    text-decoration: none;
}

.summary-link:hover {
    box-shadow: 0 5px 16px rgba(0,0,0,.09);
}

.summary-right {
    text-align: right;
}

.bus-total {
    font-size: 20px;
    font-weight: 800;
}

.stack-list {
    display: grid;
}

.stack-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    padding: 14px 0;
    border-bottom: 1px solid #e5e7eb;
}

.stack-row:first-child {
    padding-top: 0;
}

.stack-row:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.stack-link {
    color: inherit;
    text-decoration: none;
}

.stack-actions {
    display: grid;
    justify-items: end;
    gap: 6px;
    white-space: nowrap;
}

.text-button {
    background: transparent;
    padding: 0;
    border-radius: 0;
    color: #4b5563;
    font-size: 12px;
}

.text-button.danger {
    color: #b91c1c;
}

.bus-card {
    padding: 0;
    overflow: hidden;
}

.bus-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.bus-number {
    font-size: 22px;
    font-weight: 800;
}

.bus-note-form,
.bus-history {
    padding: 18px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.bus-history {
    border-bottom: 0;
}

.bus-history h3 {
    margin: 0 0 12px;
    font-size: 16px;
}

.bus-note-form button {
    margin-top: 8px;
}

.note-item {
    padding: 12px 0;
    border-bottom: 1px solid #e5e7eb;
}

.note-item:first-child {
    padding-top: 0;
}

.note-item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.note-meta {
    color: #6b7280;
    font-size: 12px;
    margin-top: 6px;
}

.search-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
}

.chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.vehicle-chip {
    display: inline-block;
    padding: 7px 10px;
    border-radius: 999px;
    background: #f3f4f6;
    font-size: 13px;
    font-weight: 700;
}

@media (max-width: 560px) {
    .stack-row,
    .bus-header {
        gap: 10px;
    }

    .search-row {
        grid-template-columns: 1fr;
    }
}


/* Step 5 — My Hours */
.hours-week-card {
    padding: 14px;
}

.hours-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.hours-stat {
    display: grid;
    gap: 7px;
    margin-bottom: 14px;
}

.hours-stat strong {
    font-size: 24px;
}

.hours-stat small {
    color: #6b7280;
    line-height: 1.35;
}

.hours-day-link {
    display: grid;
    gap: 2px;
    color: inherit;
    text-decoration: none;
}

.hours-day-link span {
    color: #6b7280;
    font-size: 12px;
}

.hours-table td,
.hours-table th {
    white-space: nowrap;
}

.hours-table tfoot th {
    border-top: 2px solid #d1d5db;
    border-bottom: 0;
    background: #f9fafb;
}

@media (max-width: 820px) {
    .hours-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    .hours-summary-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .hours-stat {
        padding: 14px;
    }

    .hours-stat strong {
        font-size: 20px;
    }
}


/* Step 6 — pay rates and expected pay */
.pay-summary-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.pay-stat strong {
    font-size: 25px;
}

.highlight-stat {
    box-shadow: inset 0 0 0 2px #111827, 0 2px 12px rgba(0,0,0,.06);
}

.total-value-stat {
    background: #f9fafb;
}

.pay-table td,
.pay-table th {
    white-space: nowrap;
}

@media (max-width: 900px) {
    .pay-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    .pay-summary-grid {
        grid-template-columns: 1fr 1fr;
    }

    .pay-stat strong {
        font-size: 20px;
    }
}


/* Step 7 — Standby */
.standby-box {
    border: 1px solid #d1d5db;
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 16px;
    background: #f9fafb;
}

.standby-box[hidden] {
    display: none;
}

.standby-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.standby-summary > div {
    background: #fff;
    border-radius: 10px;
    padding: 10px;
    border: 1px solid #e5e7eb;
}

.standby-summary strong,
.standby-summary span {
    display: block;
}

.standby-summary strong {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 4px;
}

.standby-summary span {
    font-weight: 800;
}

.standby-finish {
    margin-top: 10px;
}

.standby-chip {
    background: #ede9fe;
    color: #5b21b6;
}

.standby-selected-summary {
    margin-top: 10px;
}

@media (max-width: 520px) {
    .standby-summary {
        grid-template-columns: 1fr;
    }
}


/* Step 8 — registration and account approval */
.auth-footer {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
    color: #6b7280;
    font-size: 14px;
}

.auth-footer a {
    color: #111827;
    font-weight: 700;
}

.nav-card {
    position: relative;
}

.nav-badge {
    display: inline-block;
    margin-top: 8px;
    padding: 4px 7px;
    border-radius: 999px;
    background: #fef3c7;
    color: #92400e;
    font-size: 11px;
    font-weight: 800;
}

.approval-list {
    display: grid;
}

.approval-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    padding: 16px 0;
    border-bottom: 1px solid #e5e7eb;
}

.approval-row:first-child {
    padding-top: 0;
}

.approval-row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.approval-person {
    display: grid;
    gap: 4px;
}

.approval-person a {
    color: #374151;
}

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

.approval-actions form,
.user-table form {
    margin: 0;
}

.danger-button {
    color: #991b1b !important;
}

.user-table td {
    vertical-align: middle;
}

@media (max-width: 640px) {
    .approval-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .approval-actions {
        width: 100%;
    }

    .approval-actions form {
        flex: 1;
    }

    .approval-actions button {
        width: 100%;
    }
}


/* Step 9 — profile + take-home estimate */
.profile-identity {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.profile-section-heading {
    margin-top: 28px !important;
}

.checkbox-field {
    display: flex;
    align-items: center;
    min-height: 74px;
}

.checkbox-field label {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0;
}

.checkbox-field input[type="checkbox"] {
    width: auto;
}

.privacy-card {
    border-left: 4px solid #111827;
}

.take-home-setup-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.take-home-card h2 {
    margin-bottom: 4px;
}

.deduction-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.deduction-grid > div {
    padding: 13px;
    border-radius: 12px;
    background: #f9fafb;
}

.deduction-grid span,
.take-home-total span {
    display: block;
    color: #6b7280;
    font-size: 12px;
    margin-bottom: 5px;
}

.deduction-grid strong {
    font-size: 18px;
}

.take-home-total {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.take-home-total > div {
    padding: 15px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.take-home-total strong {
    font-size: 22px;
}

.take-home-total .grand {
    background: #111827;
    color: #fff;
    border-color: #111827;
}

.take-home-total .grand span {
    color: #d1d5db;
}

.estimate-warning {
    margin-top: 14px;
    padding: 11px 13px;
    border-radius: 12px;
    background: #fef3c7;
    color: #92400e;
    font-size: 12px;
    line-height: 1.4;
}

@media (max-width: 760px) {
    .deduction-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .take-home-total {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .take-home-setup-card {
        align-items: flex-start;
        flex-direction: column;
    }

    .take-home-setup-card .button {
        width: 100%;
        text-align: center;
    }
}


/* Step 10 — Holiday & Sick */
.absence-selected-summary {
    margin-top: 10px;
}

.absence-chip {
    line-height: 1.2;
}

.holiday-chip {
    background: #dbeafe;
    color: #1e40af;
}

.sick-chip {
    background: #fee2e2;
    color: #991b1b;
}

#actual-work-section[hidden] {
    display: none;
}


/* Step 11 — UNO WhatsApp + email */
.uno-send-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.uno-send-card {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #f9fafb;
}

.uno-send-heading {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.uno-send-icon {
    font-size: 22px;
    line-height: 1;
}

.uno-share-button,
.uno-open-chat,
.uno-email-form button {
    width: 100%;
    text-align: center;
}

.uno-email-form {
    display: grid;
    gap: 10px;
}

.whatsapp-card {
    border-left: 4px solid #16a34a;
}

.email-card {
    border-left: 4px solid #2563eb;
}

@media (max-width: 720px) {
    .uno-send-grid {
        grid-template-columns: 1fr;
    }
}


/* Step 12 — News / Chat */
.news-app {
    max-width: 760px;
}

.news-composer {
    margin-bottom: 14px;
}

.news-composer-title,
.news-author {
    display: flex;
    align-items: center;
    gap: 10px;
}

.news-composer-title {
    margin-bottom: 12px;
}

.news-avatar {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #111827;
    color: #fff;
    font-size: 17px;
    font-weight: 800;
}

.news-avatar.small {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
    font-size: 13px;
}

.news-paste-zone {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 14px;
    padding: 13px;
    margin-bottom: 12px;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    background: #f8fafc;
}

.news-paste-zone:focus,
.news-paste-zone.has-picture {
    border-color: #111827;
    outline: none;
}

.news-paste-zone input[type="file"] {
    max-width: 240px;
}

.news-picture-preview {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
    padding: 10px;
    border-radius: 12px;
    background: #f3f4f6;
}

.news-picture-preview[hidden] {
    display: none;
}

.news-picture-preview img {
    width: 110px;
    height: 80px;
    object-fit: cover;
    border-radius: 9px;
}

.news-picture-preview > div {
    display: grid;
    gap: 7px;
    justify-items: start;
}

.news-feed {
    display: grid;
    gap: 14px;
}

.news-post {
    padding: 0;
    overflow: hidden;
}

.news-post-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 18px 8px;
}

.news-time {
    font-size: 12px;
    margin-top: 2px;
}

.news-post-body {
    padding: 8px 18px 14px;
    font-size: 15px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.news-photo-link {
    display: block;
    background: #f3f4f6;
}

.news-photo {
    display: block;
    width: 100%;
    max-height: 650px;
    object-fit: contain;
}

.news-comment-count {
    padding: 11px 18px;
    color: #6b7280;
    font-size: 13px;
    border-bottom: 1px solid #e5e7eb;
}

.news-comments {
    display: grid;
    gap: 9px;
    padding: 12px 18px 4px;
}

.news-comment {
    display: grid;
    justify-items: start;
}

.news-comment-bubble {
    min-width: 170px;
    max-width: 88%;
    padding: 9px 11px;
    border-radius: 14px;
    background: #f3f4f6;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.news-comment-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 3px;
}

.news-comment-time {
    margin: 3px 0 0 10px;
    font-size: 11px;
}

.tiny-button {
    font-size: 18px;
    line-height: 1;
}

.news-comment-form {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 8px;
    align-items: center;
    padding: 12px 18px 16px;
}

.news-comment-form input {
    min-width: 0;
    border-radius: 999px;
}

.news-comment-form button {
    white-space: nowrap;
}

.news-empty {
    text-align: center;
    padding: 34px 20px;
}

.news-empty-icon {
    font-size: 36px;
    margin-bottom: 8px;
}

.news-pagination {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
}

.news-pagination > :last-child {
    justify-self: end;
}

@media (max-width: 620px) {
    .news-paste-zone {
        grid-template-columns: 1fr;
    }

    .news-paste-zone input[type="file"] {
        max-width: 100%;
        width: 100%;
    }

    .news-comment-form {
        grid-template-columns: auto 1fr;
    }

    .news-comment-form button {
        grid-column: 2;
        width: 100%;
    }

    .news-pagination {
        grid-template-columns: 1fr 1fr;
    }

    .news-pagination .muted {
        display: none;
    }
}


/* Step 13 — Online users + private messages */
.messages-app,
.conversation-app {
    max-width: 760px;
}

.people-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.online-summary {
    color: #15803d;
    font-size: 13px;
    font-weight: 800;
}

.online-badge {
    background: #dcfce7;
    color: #166534;
}

.message-badge {
    background: #fee2e2;
    color: #991b1b;
}

.people-list {
    display: grid;
}

.person-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 14px 0;
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid #e5e7eb;
}

.person-row:first-child {
    padding-top: 0;
}

.person-row:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.person-row:hover .person-message-button {
    text-decoration: underline;
}

.person-avatar-wrap {
    position: relative;
    width: max-content;
}

.presence-dot {
    position: absolute;
    right: -1px;
    bottom: 0;
    width: 12px;
    height: 12px;
    border: 2px solid #fff;
    border-radius: 50%;
}

.presence-dot.online {
    background: #22c55e;
}

.presence-dot.offline {
    background: #9ca3af;
}

.person-main {
    min-width: 0;
}

.person-name-row {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}

.presence-text {
    margin-top: 2px;
    color: #6b7280;
    font-size: 12px;
}

.presence-text.is-online,
.conversation-person .is-online {
    color: #15803d;
    font-weight: 700;
}

.person-last-message {
    margin-top: 5px;
    overflow: hidden;
    color: #4b5563;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.person-side {
    display: grid;
    gap: 8px;
    justify-items: end;
}

.message-unread-count {
    min-width: 23px;
    height: 23px;
    padding: 0 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #111827;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
}

.person-message-button {
    color: #111827;
    font-size: 12px;
    font-weight: 800;
}

.conversation-topbar {
    display: grid;
    grid-template-columns: auto auto 1fr;
    gap: 10px;
    align-items: center;
    margin-bottom: 12px;
}

.conversation-back {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: #fff;
    color: #111827;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
    font-size: 20px;
    font-weight: 800;
}

.conversation-person {
    display: grid;
}

.conversation-person > span {
    margin-top: 2px;
    color: #6b7280;
    font-size: 12px;
}

.conversation-box {
    min-height: 420px;
    max-height: 68vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 9px;
    padding: 18px;
    scroll-behavior: smooth;
}

.conversation-empty {
    margin: auto;
    display: grid;
    justify-items: center;
    gap: 6px;
    text-align: center;
}

.conversation-empty > div:first-child {
    font-size: 36px;
}

.private-message {
    display: grid;
    max-width: 78%;
}

.private-message.mine {
    align-self: flex-end;
    justify-items: end;
}

.private-message.theirs {
    align-self: flex-start;
    justify-items: start;
}

.private-message-bubble {
    padding: 10px 13px;
    border-radius: 16px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.private-message.mine .private-message-bubble {
    background: #111827;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.private-message.theirs .private-message-bubble {
    background: #e5e7eb;
    color: #111827;
    border-bottom-left-radius: 4px;
}

.private-message-meta {
    margin-top: 3px;
    color: #6b7280;
    font-size: 10px;
}

.private-compose {
    position: sticky;
    bottom: 8px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: end;
    margin-top: 10px;
    padding: 10px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 3px 15px rgba(0, 0, 0, .10);
    backdrop-filter: blur(8px);
}

.private-compose textarea {
    min-height: 42px;
    max-height: 130px;
    resize: vertical;
    border-radius: 14px;
}

.private-compose button {
    height: 42px;
}

@media (max-width: 560px) {
    .person-row {
        grid-template-columns: auto 1fr;
    }

    .person-side {
        grid-column: 2;
        grid-row: 2;
        justify-items: start;
        display: flex;
        align-items: center;
    }

    .private-message {
        max-width: 88%;
    }

    .conversation-box {
        min-height: 58vh;
    }
}


/* Step 14 — password reset */
.forgot-password-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 7px;
    font-size: 13px;
}

.forgot-password-row a {
    color: #374151;
    font-weight: 700;
}

.password-help {
    margin-bottom: 16px;
    color: #4b5563;
    font-size: 14px;
    line-height: 1.45;
}

.password-reset-account {
    margin-bottom: 16px;
    padding: 12px;
    border-radius: 12px;
    background: #f3f4f6;
}

.password-profile-card {
    display: grid;
    gap: 14px;
}

.password-profile-card h2 {
    margin-bottom: 5px;
}

.password-profile-card form {
    margin: 0;
}


/* Step 15 — Commercial + TfL + full duty PDFs + day arrows */
.tfl-badge {
    background: #dbeafe;
    color: #1d4ed8;
}

.commercial-badge {
    background: #f3e8ff;
    color: #7e22ce;
}

.day-switcher {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding: 9px 12px;
}

.day-switcher a:first-child {
    justify-self: start;
}

.day-switcher a:nth-child(2) {
    justify-self: center;
}

.day-switcher a:last-child {
    justify-self: end;
}

.duty-service-field select {
    font-weight: 800;
}

.planned-duty-summary .badge {
    margin-left: 7px;
}

.tfl-duty-chip {
    background: #dbeafe;
    color: #1d4ed8;
}

.commercial-duty-chip {
    background: #f3e8ff;
    color: #7e22ce;
}

.duty-library-date {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto;
    align-items: end;
    gap: 12px;
    margin-bottom: 14px;
}

.duty-library-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 14px;
}

.duty-library-card {
    display: grid;
    gap: 14px;
    align-content: start;
}

.commercial-library-card {
    border-top: 4px solid #9333ea;
}

.tfl-library-card {
    border-top: 4px solid #2563eb;
}

.duty-library-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.duty-library-card-head h2 {
    margin-top: 8px;
    font-size: 18px;
}

.duty-library-icon {
    font-size: 26px;
}

.duty-library-meta {
    display: grid;
    gap: 4px;
    color: #4b5563;
    font-size: 13px;
}

.duty-pdf-button {
    width: 100%;
    text-align: center;
}

@media (max-width: 900px) {
    .duty-library-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .day-page-heading {
        align-items: flex-start;
    }

    .day-switcher {
        grid-template-columns: 1fr 1fr;
    }

    .day-switcher a:nth-child(2) {
        display: none;
    }

    .day-switcher a:last-child {
        justify-self: stretch;
    }

    .day-switcher a:first-child {
        justify-self: stretch;
    }

    .duty-library-date,
    .duty-library-grid {
        grid-template-columns: 1fr;
    }
}


/* Step 16 — simpler UNO contact buttons */
.uno-contact-button {
    width: 100%;
    text-align: center;
}

.uno-send-card .admin-small {
    line-height: 1.35;
}

/* Step 17 — rotating rota loader */
.rota-label-chip{background:#ede9fe;color:#5b21b6}
.rota-loader-form,.rota-preview-card,.rota-safety-card{margin-bottom:14px}
.rota-preview-weeks{display:grid;gap:14px}
.rota-preview-week{border:1px solid #e5e7eb;border-radius:14px;overflow:hidden}
.rota-preview-week-title{display:flex;justify-content:space-between;gap:10px;padding:11px 13px;background:#f3f4f6}
.rota-preview-days{display:grid;grid-template-columns:repeat(7,minmax(0,1fr))}
.rota-preview-day{min-height:92px;display:grid;align-content:start;gap:4px;padding:10px 8px;border-right:1px solid #e5e7eb}
.rota-preview-day:last-child{border-right:0}.rota-preview-day span,.rota-preview-day small{color:#6b7280;font-size:11px}
.rota-preview-day strong{font-size:13px}.rota-preview-day em{color:#92400e;font-size:10px;font-style:normal}.rota-preview-error{background:#fff7ed}
.rota-apply-form{margin-top:15px}.rota-safety-card{border-left:4px solid #111827}
.rota-admin-layout{display:grid;grid-template-columns:260px minmax(0,1fr);gap:14px;align-items:start}
.rota-pattern-list{position:sticky;top:12px}.rota-pattern-links{display:grid;margin-bottom:20px}
.rota-pattern-link{display:flex;justify-content:space-between;gap:10px;padding:10px 8px;border-bottom:1px solid #e5e7eb;color:#111827;text-decoration:none}
.rota-pattern-link.active{margin-left:-8px;margin-right:-8px;padding-left:16px;padding-right:16px;border-radius:10px;background:#111827;color:#fff}
.rota-pattern-link span:first-child{display:grid;gap:2px}.rota-pattern-link small{opacity:.72}.rota-new-pattern{display:grid;gap:8px;padding-top:8px}
.rota-active-toggle{display:flex;align-items:center;gap:7px;font-size:13px;font-weight:700}.rota-active-toggle input{width:auto}
.rota-token-help,.rota-lines-card,.rota-add-line-card{margin-top:14px}.rota-token-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px 14px;margin-top:10px;font-size:13px}
.rota-token-grid code{padding:2px 5px;border-radius:5px;background:#f3f4f6;font-weight:800}.rota-lines-wrap{margin-bottom:12px}
.rota-lines-table{min-width:1120px}.rota-lines-table input{min-width:62px;padding:7px 6px}.rota-order-input{width:66px}.rota-line-code-input{width:72px;font-weight:800}
.rota-cell-input{width:72px;text-align:center}.rota-note-input{min-width:190px!important}.rota-add-line-row{display:grid;grid-template-columns:1fr auto;gap:10px;align-items:end}
@media(max-width:900px){.rota-preview-days{grid-template-columns:1fr}.rota-preview-day{min-height:auto;grid-template-columns:50px 1fr auto;align-items:center;border-right:0;border-bottom:1px solid #e5e7eb}.rota-preview-day:last-child{border-bottom:0}.rota-preview-day em{grid-column:2/4}.rota-admin-layout{grid-template-columns:1fr}.rota-pattern-list{position:static}}
@media(max-width:600px){.rota-token-grid{grid-template-columns:1fr}.rota-add-line-row{grid-template-columns:1fr}}


/* Step 18 — automatic late allowance + office call */
.uno-send-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.phone-card {
    border-left: 4px solid #7c3aed;
}

.automatic-extra-badge {
    margin-left: 6px;
    background: #dcfce7;
    color: #166534;
}

.late-allowance-info {
    border-left: 4px solid #7c3aed;
}

@media (max-width: 900px) {
    .uno-send-grid {
        grid-template-columns: 1fr;
    }
}


/* Step 19 — Additional OT hours/minutes + bridging */
.additional-ot-field{display:grid;gap:8px}.ot-time-inputs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.ot-time-inputs label{display:grid;gap:4px;font-size:12px;font-weight:700}.ot-time-inputs input{width:100%}
.bridging-toggle{display:flex!important;align-items:center;gap:9px!important;margin-top:4px;padding:10px 11px;border:1px solid #d8b4fe;border-radius:10px;background:#faf5ff;cursor:pointer}
.bridging-toggle input{width:18px!important;height:18px;margin:0;flex:0 0 auto}.bridging-toggle span{font-size:13px;line-height:1.3}
.take-home-total small{display:block;margin-top:3px;font-size:10px;color:#6b7280}


/* Step 20 — Training / Other paid work */
.custom-work-box{display:grid;gap:12px;margin-top:12px;padding:14px;border:1px solid #c7d2fe;border-radius:12px;background:#f8faff}
.custom-payment-panel{display:grid;gap:8px;padding:11px;border:1px solid #e5e7eb;border-radius:10px;background:#fff}
.custom-work-chip{background:#dbeafe;color:#1e40af}
@media(max-width:520px){.custom-work-box{padding:11px}}


/* Step 20C — corrected mobile calendar duty numbers */
@media (max-width: 700px) {
    .day-cell .duty-chip {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 34px;
        max-width: 100%;
        padding-left: 7px;
        padding-right: 7px;
        overflow: visible;
        text-overflow: clip;
        white-space: nowrap;
    }

    .day-cell .duty-service-prefix {
        display: none !important;
    }

    .day-cell .duty-number {
        display: inline !important;
        overflow: visible;
        text-overflow: clip;
        white-space: nowrap;
        font-weight: 800;
    }

    .day-cell .tfl-duty-chip {
        background: #fee2e2;
        color: #b91c1c;
    }
}


/* Step 20D — make HTML hidden state authoritative on every browser */
[hidden] {
    display: none !important;
}


/* Step 21 — Work Rest + contract minimums */
.work-rest-box { margin-top:12px; padding:12px; border:1px solid #fecaca; border-radius:12px; background:#fff7f7; }
.work-rest-toggle { display:flex; align-items:flex-start; gap:10px; cursor:pointer; }
.work-rest-toggle input { width:19px; height:19px; margin-top:2px; flex:0 0 auto; }
.work-rest-toggle span { display:grid; gap:3px; }
.work-rest-toggle strong { color:#991b1b; }
.work-rest-toggle small,.contract-min-note { color:#6b7280; font-size:12px; line-height:1.35; }
.contract-min-note { margin-top:9px; padding-top:9px; border-top:1px solid #fee2e2; }
.work-rest-stat { border-color:#fecaca; }
.work-rest-inline,.calendar-work-rest { margin-top:3px; color:#b91c1c; font-size:10px; font-weight:800; }
.calendar-work-rest { white-space:nowrap; }
.contract-week-check { margin-bottom:12px; border-left:4px solid #16a34a; }
.contract-week-check.contract-warning { border-left-color:#d97706; }
@media(max-width:700px){ .calendar-work-rest{font-size:9px;} }
