* {
    box-sizing: border-box;
}

html,
body {
    touch-action: manipulation;
}

button,
.btn,
.snippet-btn {
    touch-action: manipulation;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f5f7fb;
    color: #1f2937;
}

.container {
    max-width: 760px;
    margin: 0 auto;
    padding: 16px;
}

.page-header {
    margin-bottom: 20px;
}

.page-header h1 {
    margin: 0;
    font-size: 1.5rem;
}

.page-header a {
    color: inherit;
    text-decoration: none;
}

.card {
    background: #ffffff;
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.06);
}

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

.section-head h2 {
    margin: 0;
    font-size: 1.2rem;
}

.btn {
    display: inline-block;
    padding: 10px 14px;
    border-radius: 10px;
    background: #1d4ed8;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
}

.week-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.week-list-item + .week-list-item {
    margin-top: 12px;
}

.week-link {
    display: block;
    padding: 14px;
    border: 1px solid #dbe3ee;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    background: #fafcff;
}

.week-link span {
    color: #6b7280;
    font-size: 0.95rem;
}
.form-stack {
    display: grid;
    gap: 16px;
}

.form-group {
    display: grid;
    gap: 6px;
}

.form-group label {
    font-weight: 600;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #cfd8e3;
    border-radius: 10px;
    font: inherit;
    background: #fff;
}

.form-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-secondary {
    background: #64748b;
}

.alert {
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 16px;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
}
.inline-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.inline-row input[type="time"],
.inline-row input[type="number"] {
    flex: 1 1 140px;
    min-width: 120px;
}

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

.snippet-btn {
    border: 1px solid #cfd8e3;
    background: #f8fafc;
    color: #1f2937;
    border-radius: 999px;
    padding: 8px 12px;
    font: inherit;
    cursor: pointer;
}

.snippet-btn:hover {
    background: #eef4ff;
}
.date-group + .date-group {
    margin-top: 24px;
}

.date-group h3 {
    margin: 0 0 12px;
    font-size: 1.05rem;
    color: #334155;
}

.entry-list {
    display: grid;
    gap: 12px;
}

.entry-card {
    border: 1px solid #dbe3ee;
    border-radius: 12px;
    padding: 14px;
    background: #fafcff;
}

.entry-meta {
    margin-bottom: 10px;
}

.entry-note {
    line-height: 1.5;
}
.entry-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}
.entry-actions form {
    margin: 0;
}
.btn-small {
    padding: 8px 12px;
    font-size: 0.95rem;
}

.btn-danger {
    background: #b91c1c;
    border: none;
    color: #fff;
    cursor: pointer;
}
button.btn {
    border: none;
    cursor: pointer;
    font: inherit;
}
.section-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.week-row {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
}

.week-row form {
    margin: 0;
    flex-shrink: 0;
}

.week-row .week-link {
    flex: 1;
}
.alert-success {
    background: #dcfce7;
    color: #166534;
    margin-bottom: 16px;
} 
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.user-badge {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 999px;
    background: #eef2ff;
    color: #334155;
    font-size: 0.95rem;
    font-weight: 600;
}

.user-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.user-card {
    flex: 1 1 auto;
    min-width: 0;
}

.user-actions {
    flex: 0 0 140px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
}

.user-actions .btn,
.user-actions form,
.user-actions form button {
    width: 100%;
}

.user-actions form {
    margin: 0;
} 

.auth-card {
    max-width: 520px;
    margin: 0 auto;
} 
.form-group select {
    width: 100%;
	padding: 12px 14px;
    border: 1px solid #cfd8e3;
    border-radius: 10px;
    font: inherit;
    background: #fff;
}
#entry_date {
	width: 90%;
	max-width: 90%;
	min-width: 0;
	box-sizing: border-box;
}
.pdf-frame-wrap {
    margin-top: 16px;
    border: 1px solid #dbe3ee;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.pdf-frame {
    display: block;
    width: 100%;
    height: 82vh;
	min-height: 520px;
    border: 0;
    background: #fff;
}

.pdf-hint {
    margin-top: 10px;
    color: #64748b;
    font-size: 0.92rem;
    line-height: 1.4;
}
.pdf-subtitle {
    margin: 4px 0 0;
    color: #475569;
    line-height: 1.35;
}

input,
button,
textarea,
select {
    font-size: 16px;
} 
@media (max-width: 768px) {
    .pdf-frame {
        height: 88vh;
        min-height: 600px;
    }
	 .user-row {
        flex-direction: row;
        align-items: flex-start;
        gap: 16px;
    }
    .user-actions {
        flex: 0 0 150px;
	}      
} 

@media (max-width: 480px) {
    .inline-row {
        flex-wrap: wrap;
        align-items: stretch;
    }

    .inline-row input[type="time"],
    .inline-row input[type="number"] {
        flex: 1 1 100%;
        min-width: 0;
    }

    .inline-row .btn {
        flex: 1 1 calc(50% - 8px);
        text-align: center;
    
	}
	
    .section-actions {
        width: 100%;
    }

    .section-actions .btn {
        flex: 1 1 100%;
        text-align: center;
    }

    .topbar-actions {
        width: 100%;
    }

    .topbar-actions .btn {
        flex: 1 1 auto;
        text-align: center;
    }

    .snippet-list {
        gap: 10px;
    }

    .snippet-btn {
        max-width: 100%;
        white-space: normal;
        text-align: center;
        line-height: 1.25;
    }
	 .user-row {
        flex-direction: column;
    }
    .user-actions {
        flex: 1 1 auto;
        width: 100%;
    } 
} 