/* Removed invalid Google Font import for Malgun Gothic */

html, body {
    min-height: 100%;
    min-height: 100dvh;
    margin: 0;
    padding: 0;
    font-family: 'Malgun Gothic', sans-serif;
    background-color: #f0f0f0;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 30px 0;
    user-select: none;
    overflow-x: hidden; /* 가로 스크롤 전면 차단 */
}

.container {
    width: 95%;
    max-width: 600px;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    overflow: hidden;
    min-height: 550px;
    display: flex;
    flex-direction: column;
    position: relative;
    box-sizing: border-box;
    align-self: stretch; /* 5,6페이지처럼 내용이 적어도 세로 공간 확보 */
}

.top-bar {
    background-color: #2c3e50;
    color: white;
    padding: 15px 25px;
    font-size: 20px;
    font-weight: bold;
}

.content {
    padding: 30px 20px;
    flex: 1;
    display: none;
    flex-direction: column;
}

.main-title {
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 25px;
    color: #2c3e50;
    text-align: left;
    white-space: nowrap;
    letter-spacing: -0.5px;
}

.input-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 25px;
    gap: 8px;
}

.input-col {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 25px;
    gap: 10px;
}

.input-col .label {
    flex: none;
    width: 100%;
}

.label {
    font-size: 16px;
    font-weight: bold;
    flex: none;
    width: 100%;
    color: #34495e;
}

.input-field {
    flex: 1;
    width: 100%;
    min-width: 0; /* 브라우저 기본 최소 너비로 인한 가로 늘어남 방지 */
    padding: 14px;
    font-size: 16px;
    font-family: inherit;
    border: 2.5px solid #2c3e50;
    border-radius: 10px;
    outline: none;
    box-sizing: border-box;
}

.date-row, .time-row {
    display: flex;
    width: 100%;
    gap: 10px;
}

.date-row input, .time-row input {
    flex: 1;
    padding: 12px 15px;
    font-size: 16px;
    border: 1px solid #bdc3c7;
    border-radius: 8px;
    box-sizing: border-box;
}

.btn-group {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: auto;
    padding-top: 20px;
}

.btn {
    flex: 1;
    padding: 14px;
    font-size: 18px;
    font-weight: bold;
    font-family: inherit;
    border-radius: 10px;
    cursor: pointer;
    border: none;
}

.btn-blue {
    background-color: #00a0e9;
    color: white;
}

.btn-white {
    background-color: #ffffff;
    color: #222;
    border: 1px solid #222;
}

.btn-green {
    background-color: #27ae60;
    color: white;
}

.radio-group {
    display: flex;
    gap: 20px;
    margin-top: 10px;
}

.radio-label {
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.radio-label input[type="radio"] {
    width: 20px;
    height: 20px;
}

.canvas-container {
    flex: 1;
    border: 2px dashed #bdc3c7;
    border-radius: 12px;
    background: #fafafa;
    position: relative;
    width: 100%;
}

canvas {
    width: 100%;
    height: 180px;
    border-radius: 12px;
    touch-action: none;
}

.activity-list {
    flex: 1;
    max-height: 50vh;
    overflow-y: auto;
    margin-bottom: 20px;
    padding: 10px;
    background: #f0f3f5;
    border-radius: 12px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    align-content: start;
}

.clear-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #ff4d4d;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px;
    font-size: 16px;
    z-index: 20;
    cursor: pointer;
}

/* PDF Template (Hidden from normal UI) */
#pdfContainer {
    display: none;
    position: absolute;
    top: -9999px;
    left: -9999px;
    background: white;
    width: 1200px; /* 가로를 더 늘림 */
}

/* PDF 렌더링을 위한 래퍼 (상하 여백 적용) */
#pdfContentWrapper {
    padding: 30px 40px; /* 위아래, 양옆 여백 */
    box-sizing: border-box;
    width: 100%;
}

.pdf-table {
    width: 100%;
    border-collapse: collapse;
    border: 2px solid black;
    text-align: center;
    font-size: 14px;
    color: black;
}

.pdf-table th, .pdf-table td {
    border: 1px solid black;
    padding: 8px 4px;
    word-break: break-all;
    vertical-align: middle;
}

.pdf-table th {
    background-color: #f0f0f0;
    font-weight: bold;
}

#pRows tr { page-break-inside: avoid; }

/* Hide scrollbars globally for a native app feel */
::-webkit-scrollbar {
    display: none;
}
html, body, .container {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

/* Time Select compact styling to prevent layout breaking on narrow screens */
.time-select {
    padding: 8px !important;
    font-size: 14px !important;
    text-align: center;
    min-width: 0;
}



/* Time Select: PC 기본값만 설정, 모바일은 위 미디어쿼리에서 제어 */
.time-select {
    text-align: center;
    min-width: 0;
    width: auto;
    flex: 1;
}
