/* ==========================================================================
   TBM AI — v3 디자인 (국내 핀테크/커머스 앱 문법: 회색 바탕 + 흰 카드, 단계형 입력)
   ========================================================================== */
:root {
    --gray-bg: #F2F4F6;
    --surface: #FFFFFF;
    --fill: #F2F4F6;
    --fill-strong: #E5E8EB;
    --line: #E5E8EB;
    --line-soft: #F2F4F6;

    --text: #191F28;
    --text-2: #4E5968;
    --text-3: #6B7684;
    --text-4: #B0B8C1;
    --red: #F04452;

    --brand: #3182F6;
    --brand-press: #1B64DA;
    --brand-soft: #E8F3FF;
    --brand-ink: #1B64DA;
    --navy: #1B2B44;
    --zalo: #0068FF;

    --r-card: 18px;
    --r-btn: 13px;
    --r-field: 12px;

    --ease: cubic-bezier(0.23, 1, 0.32, 1);
    --ease-sheet: cubic-bezier(0.32, 0.72, 0, 1);
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);

    /* script.js 인라인 스타일이 참조하는 변수 호환 */
    --border-light: var(--line);
    --text-sub: var(--text-2);
    --text-main: var(--text);
    --text-red: var(--red);
    --primary-color: var(--brand);
    --primary-lime: var(--brand);
}

/* ---------- 기본 ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
    -webkit-tap-highlight-color: transparent;
    -webkit-text-size-adjust: 100%;
    overscroll-behavior: none;
    background: var(--surface);
}
body {
    font-family: 'Pretendard Variable', 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    color: var(--text);
    background: var(--surface);
    font-size: 15px;
    line-height: 1.5;
    letter-spacing: -0.015em;
    word-break: keep-all;
    overflow-wrap: anywhere;
    -webkit-font-smoothing: antialiased;
    min-height: 100dvh;
    overscroll-behavior: none;
    /* 처음부터 보이게 둔다. 예전엔 opacity 0으로 숨겼다가 스크립트 신호로 보여줬는데,
       외부 CDN이 멈추면 신호가 오지 않아 아이폰 Safari에서 흰 화면에 갇혔음 */
}
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
button, a, label, [role="button"], .calendar-day {
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
::selection { background: var(--brand-soft); }
button:focus-visible, a:focus-visible, select:focus-visible, [role="button"]:focus-visible {
    outline: 3px solid var(--brand);
    outline-offset: 2px;
}

.tf-icon {
    font-family: Tossface, 'Apple Color Emoji', 'Segoe UI Emoji', sans-serif;
    font-size: 22px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.tf-lg { font-size: 36px; }
.tf-sm { font-size: 16px; }

.screen-container {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--surface);
}
.screen-gray { background: var(--gray-bg); }
.content { flex: 1; display: flex; flex-direction: column; }

/* ---------- 헤더 ---------- */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: calc(48px + var(--safe-top));
    padding: var(--safe-top) 14px 0 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: inherit;
}
/* 홈 헤더: 로고·인사 없이 언어 전환만 (오른쪽) */
#calendarScreen .app-header { justify-content: flex-end; }
#tabHome { padding-top: 4px; }
.screen-gray .app-header { background: rgba(242, 244, 246, 0.92); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
#mainScreen .app-header { padding-left: 8px; background: rgba(255, 255, 255, 0.94); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }

.brand { display: flex; align-items: center; gap: 6px; }
.brand-logo { width: 22px; height: 22px; border-radius: 6px; }
.brand-name { font-size: 17px; font-weight: 800; letter-spacing: -0.04em; }
.header-right { display: flex; align-items: center; gap: 10px; }

.icon-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    color: var(--text);
    transition: background 100ms var(--ease), transform 100ms var(--ease);
}
.icon-btn:active { background: var(--fill); transform: scale(0.94); }

.avatar-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--fill-strong);
    color: var(--text-3);
    font-size: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.avatar-btn::after { content: ''; position: absolute; inset: -5px; }
.avatar-btn:active { transform: scale(0.94); }

/* 작성 화면 헤더: 현재 단계 이름 + n/4 (가운데) */
#mainScreen .app-header { position: sticky; }
.step-head { position: absolute; left: 50%; transform: translateX(-50%); display: flex; align-items: baseline; gap: 6px; white-space: nowrap; pointer-events: none; }
.step-name { font-size: 16px; font-weight: 700; letter-spacing: -0.03em; color: var(--text); }
.step-count { font-size: 13px; font-weight: 600; color: var(--text-4); font-variant-numeric: tabular-nums; }
.step-count b { color: var(--text-3); font-weight: 600; }

/* 언어 전환: KR | VN 세그먼트 (체크박스 라벨이 전체를 덮어서 어디를 눌러도 전환) */
.lang-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 2px;
    border-radius: 999px;
    background: var(--fill-strong);
    font-size: 11px;
    font-weight: 700;
}
#mainScreen .lang-switch, .auth .lang-switch { background: var(--fill); }
.lang-switch > span {
    padding: 4px 8px;
    border-radius: 999px;
    color: var(--text-3);
    transition: background 150ms var(--ease), color 150ms var(--ease);
}
.lang-switch > span.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }
.lang-switch .switch { position: absolute; inset: -6px; cursor: pointer; }
.lang-switch .switch input { position: absolute; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.lang-switch .slider { display: none; }

/* ---------- 버튼 ---------- */
.btn-primary {
    width: 100%;
    min-height: 48px;
    padding: 0 18px;
    border-radius: var(--r-btn);
    background: var(--brand);
    color: #FFFFFF;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: transform 120ms var(--ease), background 120ms var(--ease);
}
.btn-primary:active { transform: scale(0.98); background: var(--brand-press); }
.btn-primary:disabled { background: var(--fill-strong); color: var(--text-4); }

.btn-secondary {
    min-height: 48px;
    padding: 0 14px;
    border-radius: var(--r-btn);
    background: var(--fill);
    color: var(--text);
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: transform 120ms var(--ease), background 120ms var(--ease);
}
.btn-secondary.zalo { color: var(--zalo); }
.btn-secondary:active { transform: scale(0.97); background: var(--fill-strong); }

.text-btn { font-size: 14px; font-weight: 700; color: var(--brand-ink); padding: 8px 4px; }
.link-btn { font-size: 13px; color: var(--text-3); padding: 8px; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- 입력 ---------- */
.input-group { position: relative; display: flex; flex-direction: column; }
.floating-label-group { flex-direction: column-reverse; gap: 8px; margin-bottom: 20px; }
.floating-label-group label { font-size: 14px; font-weight: 600; color: var(--text-2); }
.required { color: var(--red); font-size: 12px; font-weight: 600; margin-left: 2px; }
.field-label { display: block; font-size: 14px; font-weight: 600; color: var(--text-2); margin-bottom: 8px; }
.field-label-sub { font-size: 12px; font-weight: 500; color: var(--text-3); margin-left: 4px; }

input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="datetime-local"], textarea, select {
    width: 100%;
    height: 54px;
    padding: 0 16px;
    font: inherit;
    font-size: 17px;
    font-weight: 500;
    color: var(--text);
    background: var(--fill);
    border: 2px solid transparent;
    border-radius: var(--r-field);
    -webkit-appearance: none;
    appearance: none;
    caret-color: var(--brand);
    -webkit-user-select: auto;
    user-select: auto;
    transition: border-color 150ms var(--ease), background 150ms var(--ease);
}
textarea { height: auto; min-height: 132px; padding: 14px 16px; font-size: 16px; line-height: 1.6; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--text-4); font-weight: 400; }
input:focus, textarea:focus, select:focus { outline: none; background: var(--surface); border-color: var(--brand); }
input:disabled { color: var(--text-2); -webkit-text-fill-color: var(--text-2); opacity: 1; font-size: 16px; }
.input-error { border-color: var(--red) !important; animation: shake 0.3s var(--ease); }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.field-error { font-size: 13px; color: var(--red); margin-top: 6px; }
.field-error:empty { display: none; }
.login-error-msg { font-size: 14px; color: var(--red); }
.login-error-msg:empty { display: none; }

/* ---------- 로그인 ---------- */
.auth { padding: var(--safe-top) 24px calc(20px + var(--safe-bottom)); }
.auth-top { display: flex; justify-content: flex-end; padding-top: 12px; }
.auth-box { flex: 1; display: flex; flex-direction: column; padding-top: 40px; }
.auth-brand { display: flex; align-items: center; gap: 8px; margin-bottom: 28px; font-size: 18px; font-weight: 800; letter-spacing: -0.02em; color: var(--text); }
.auth-logo { width: 32px; height: 32px; border-radius: 10px; }
.auth-title { font-size: 26px; font-weight: 700; letter-spacing: -0.04em; line-height: 1.35; }
.auth-subtitle { font-size: 15px; line-height: 1.6; color: var(--text-3); margin-top: 8px; }
.auth-form { display: flex; flex-direction: column; gap: 10px; margin-top: 40px; }
/* 로그인 모드에선 버튼과 겹치는 '로그인' 표시를 숨기고, 회원가입 모드에서만 제목으로 노출 */
.auth-mode-title { display: none; }
.auth-mode-title.signup-mode { display: block; font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.auth-form .btn-primary { margin-top: 8px; }
.password-group input { padding-right: 52px; }
/* 입력칸 앞 아이콘 */
.has-icon .field-icon { position: absolute; left: 16px; top: 17px; width: 20px; height: 20px; color: var(--text-4); pointer-events: none; transition: color 150ms var(--ease); }
.has-icon input { padding-left: 46px; }
.has-icon:focus-within .field-icon { color: var(--brand); }
/* 브라우저 자동완성이 입력칸을 파랗게 칠하지 않도록 같은 회색 유지 */
.auth input:-webkit-autofill, .auth input:-webkit-autofill:hover {
    -webkit-box-shadow: 0 0 0 100px var(--fill) inset; -webkit-text-fill-color: var(--text); caret-color: var(--brand);
    transition: background-color 9999s;
}
.auth input:-webkit-autofill:focus { -webkit-box-shadow: 0 0 0 100px var(--surface) inset; }
.toggle-password {
    position: absolute;
    top: 5px;
    right: 4px;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    color: var(--text-3);
    font-size: 17px;
    display: flex;
    align-items: center;
    justify-content: center;
}
/* 회원가입 · 비밀번호 찾기: 로그인 버튼 바로 아래 한 줄 */
.auth-links { margin-top: 18px; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 4px 0; }
.auth-toggle { font-size: 14px; color: var(--text-3); display: flex; align-items: center; gap: 2px; }
.auth-links .text-btn { color: var(--brand-ink); }
#resetPasswordContainer { display: flex; align-items: center; }
/* 회원가입 중에는 비밀번호 찾기 숨김 */
.auth:has(.auth-mode-title.signup-mode) #resetPasswordContainer { display: none; }
#resetPasswordContainer::before { content: ""; width: 1px; height: 12px; background: var(--line); margin: 0 12px; }
.auth-links .link-btn { font-size: 14px; color: var(--text-3); text-decoration: none; padding: 8px 0; }

.face-upload-area {
    margin-top: 2px;
    height: 120px;
    border-radius: var(--r-btn);
    background: var(--fill);
    color: var(--text-3);
    font-size: 14px;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}
.face-upload-area i { font-size: 32px; }
.face-upload-area .face-preview-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.consent-row { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: 14px; font-weight: 600; cursor: pointer; }
.consent-row input { width: 20px; height: 20px; accent-color: var(--brand); flex-shrink: 0; }
.consent-detail { margin: 6px 0 0 30px; font-size: 12px; line-height: 1.55; color: var(--text-3); }

/* ---------- 홈 ---------- */
.home { padding-bottom: calc(18px + var(--safe-bottom)); }
.hello { padding: 6px 20px 14px; }
.today-label { font-size: 12px; color: var(--text-3); margin-bottom: 2px; }
.welcome-title { font-size: 20px; font-weight: 700; letter-spacing: -0.035em; line-height: 1.35; }
.welcome-title strong { font-weight: 700; }
.welcome-subtitle { font-size: 13px; color: var(--text-2); margin-top: 2px; }

.card {
    margin: 0 14px 10px;
    padding: 16px;
    border-radius: var(--r-card);
    background: var(--surface);
}
.card-label { font-size: 12px; font-weight: 600; color: var(--text-3); }

.today-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.today-text { flex: 1; min-width: 0; }
.today-headline { font-size: 17px; font-weight: 700; letter-spacing: -0.03em; margin-top: 1px; }
.today-chip {
    align-self: flex-start;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 8px;
    color: var(--brand-ink);
    background: var(--brand-soft);
    white-space: nowrap;
}
.today-chip.done { color: #0A7A4F; background: #E3F7EE; }

/* ---------- 선 아이콘 (Lucide 스타일) ---------- */
.ic { width: 22px; height: 22px; flex-shrink: 0; }
.icon-tile { flex-shrink: 0; display: inline-flex; color: var(--brand-ink); }
.icon-tile .ic { width: 28px; height: 28px; }

/* 홈 바로가기 타일 */
.shortcut-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 14px 10px; }
.shortcut-tile {
    display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
    padding: 14px; border-radius: 17px; background: var(--surface);
    text-align: left; transition: transform 120ms var(--ease), background 120ms var(--ease);
}
.shortcut-tile:active { transform: scale(0.97); background: var(--fill); }
.tile-icon { color: var(--brand-ink); margin-bottom: 6px; }
.tile-icon .ic { width: 24px; height: 24px; }
.shortcut-tile b { font-size: 16px; font-weight: 700; letter-spacing: -0.03em; }
.tile-sub { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }

/* 최근 회의 기록 */
.section-row { display: flex; align-items: baseline; justify-content: space-between; padding: 10px 18px 8px; }
.section-heading { font-size: 18px; font-weight: 700; letter-spacing: -0.03em; }
.link-more { font-size: 13px; font-weight: 600; color: var(--brand-ink); padding: 6px 2px; }
.recent-list { display: flex; flex-direction: column; gap: 8px; margin: 0 14px 14px; }
.recent-item {
    display: flex; flex-direction: column; align-items: stretch; gap: 4px; width: 100%;
    padding: 14px 16px; border-radius: 17px; background: var(--surface); text-align: left;
    transition: transform 120ms var(--ease), background 120ms var(--ease);
}
.recent-item:active { transform: scale(0.98); background: var(--fill); }
.recent-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.recent-top b { font-size: 16px; font-weight: 700; letter-spacing: -0.02em; min-width: 0; overflow-wrap: anywhere; }
.recent-badge { flex-shrink: 0; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 8px; background: var(--fill); color: var(--text-2); }
.recent-badge.pending { background: #FFF6E0; color: #7A5200; }
.recent-meta { font-size: 14px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.recent-sub { font-size: 13px; color: var(--text-3); }
.recent-empty { padding: 22px 18px; border-radius: 18px; background: var(--surface); font-size: 14px; color: var(--text-3); text-align: center; }

/* 탭 공통 */
.tab-panels { padding-bottom: calc(66px + var(--safe-bottom)); }
.tab-title { font-size: 22px; font-weight: 700; letter-spacing: -0.04em; padding: 8px 20px 12px; }
.tab-cta { padding: 2px 14px 14px; }
.tab-cta .btn-primary .ic { width: 20px; height: 20px; }

/* 내 정보 */
.me-profile { display: flex; align-items: center; gap: 12px; }
.me-list { list-style: none; padding: 4px; }
/* 구분선은 '보이는 항목' 사이에만 (숨겨진 항목 때문에 맨 위에 선이 생기지 않게) */
.me-list li:not([hidden]):not([style*="display: none"]) ~ li:not([hidden]):not([style*="display: none"]) { border-top: 1px solid var(--line-soft); }
.me-row { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 10px; border-radius: 12px; font-size: 15px; font-weight: 500; color: var(--text); }
.me-row:active { background: var(--fill); }
.me-row > .ic:first-child { color: var(--text-2); }
.me-label { flex: 1; }
.me-row .chev { width: 18px; height: 18px; color: var(--text-4); }
.me-list li.danger .me-row, .me-list li.danger .me-row > .ic:first-child { color: var(--red); }

/* 하단 탭바 */
.tab-bar {
    position: fixed; left: 50%; bottom: 0; z-index: 80;
    width: 100%; max-width: 480px; transform: translateX(-50%);
    display: grid; grid-template-columns: repeat(3, 1fr);
    padding: 4px 8px calc(4px + var(--safe-bottom));
    background: rgba(255, 255, 255, 0.96);
    -webkit-backdrop-filter: saturate(1.8) blur(16px); backdrop-filter: saturate(1.8) blur(16px);
    border-top: 1px solid var(--line);
}
.tab {
    min-height: 46px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    border-radius: 11px; color: var(--text-3); font-size: 11px; font-weight: 600;
    transition: color 120ms var(--ease), transform 120ms var(--ease);
}
.tab .ic { width: 22px; height: 22px; }
.tab.active { color: var(--brand); font-weight: 700; }
.tab:active { transform: scale(0.94); }

.sync-banner .ic { width: 18px; height: 18px; }
.sync-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 16px 12px;
    padding: 12px 16px;
    border-radius: 14px;
    background: #FFF6E0;
    color: #7A5200;
    font-size: 14px;
    font-weight: 600;
}

.calendar-card { padding: 14px 10px 12px; }
.calendar-header { display: flex; align-items: center; justify-content: space-between; padding: 0 6px 8px; }
.calendar-header h2 { font-size: 16px; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.calendar-nav { display: flex; gap: 2px; }
.calendar-nav button {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    color: var(--text-3);
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.calendar-nav button:active { background: var(--fill); }
.calendar-grid-header, .calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.calendar-grid-header { font-size: 12px; font-weight: 600; color: var(--text-3); text-align: center; padding-bottom: 4px; }
.calendar-grid-header div:first-child { color: #E5484D; }
.calendar-grid-header div:last-child { color: #3182F6; }
.calendar-day {
    position: relative;
    width: 36px;
    height: 36px;
    margin: 1px auto;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    color: var(--text);
    cursor: pointer;
    transition: background 120ms var(--ease), transform 120ms var(--ease);
}
.calendar-day:active { transform: scale(0.9); background: var(--fill); }
.calendar-day.sunday { color: #E5484D; }
.calendar-day.saturday { color: #3182F6; }
.calendar-day.past { color: var(--text-3); }
.calendar-day.past.has-record { color: var(--text); }
.calendar-day.other-month { color: var(--text-4); }
.calendar-day.today { background: var(--brand-soft); color: var(--brand-ink); font-weight: 700; }
.calendar-day.has-record::after {
    content: '';
    position: absolute;
    bottom: 4px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--brand);
}
.calendar-grid > .calendar-day.selected { background: var(--text); color: #FFFFFF; font-weight: 700; }
.calendar-grid > .calendar-day.selected::after { background: #FFFFFF; }
.calendar-hint { font-size: 12px; color: var(--text-3); text-align: center; padding-top: 8px; }

.ai-note { padding: 4px 28px 0; font-size: 12px; line-height: 1.55; color: var(--text-3); }

/* 조직/현장 선택 (enterprise-ui.js) */
.site-picker {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 0 20px 4px 24px;
}
.site-picker select {
    flex: 1;
    min-width: 0;
    height: 40px;
    padding: 0 28px 0 0;
    border: none;
    border-radius: 0;
    background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%234E5968' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 4px center;
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    text-overflow: ellipsis;
}
.site-picker select:focus { border: none; background-color: transparent; }
.site-picker p { flex-basis: 100%; font-size: 13px; color: var(--brand-ink); font-weight: 600; }
.site-picker p:empty { display: none; }
.scope-actions { display: flex; flex-wrap: wrap; gap: 6px; flex-basis: 100%; }
.scope-actions:not(:has(button:not([hidden]))) { display: none; }
.chip-btn {
    min-height: 36px;
    padding: 0 12px;
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    box-shadow: inset 0 0 0 1px var(--line);
}
.active-site { padding: 10px 20px 0; font-size: 13px; font-weight: 600; color: var(--text-3); }
.active-site:empty { display: none; }

/* ---------- TBM 작성 (단계형) ---------- */
/* 진행 표시: 헤더 아래 얇은 한 줄 (전체 폭) */
.stepper { position: sticky; top: calc(54px + var(--safe-top)); z-index: 99; height: 3px; background: var(--fill); }
.stepper-fill { height: 100%; background: var(--brand); transform-origin: left; transform: scaleX(0.25); transition: transform 420ms var(--ease); }

#tbmForm { flex: 1; display: flex; flex-direction: column; }
.step { flex: 1; padding: 28px 20px 24px; animation: stepIn 260ms var(--ease); }
@keyframes stepIn { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }
.step-title { font-size: 24px; font-weight: 700; letter-spacing: -0.04em; line-height: 1.38; }
.step-desc { font-size: 15px; color: var(--text-2); margin: 6px 0 28px; }

.photo-list { display: flex; flex-direction: column; }
.photo-row { display: flex; align-items: center; gap: 16px; padding: 10px 0; }
.photo-row + .photo-row { border-top: 1px solid var(--line-soft); }
.photo-row .upload-area {
    width: 76px;
    height: 76px;
    flex-shrink: 0;
}
.photo-text { flex: 1; min-width: 0; cursor: pointer; }
.photo-text label { display: block; font-size: 16px; font-weight: 600; color: var(--text); cursor: pointer; }
.photo-text p { font-size: 13px; color: var(--text-3); margin-top: 2px; }

.upload-area {
    position: relative;
    border-radius: 16px;
    background: var(--fill);
    color: var(--text-3);
    font-size: 12px;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    overflow: hidden;
    cursor: pointer;
    transition: background 120ms var(--ease), transform 120ms var(--ease);
}
.upload-area i { font-size: 20px; }
.upload-area:active { transform: scale(0.96); background: var(--fill-strong); }
.preview-img { width: 100%; height: 100%; object-fit: cover; }
/* script.js가 넣는 사진 오버레이를 작은 썸네일에 맞게 축소 */
.photo-row .photo-edit-badge { display: none !important; }
.photo-row .photo-remove-btn {
    width: 22px !important;
    height: 22px !important;
    top: 4px !important;
    right: 4px !important;
    box-shadow: none !important;
}
.photo-row .photo-remove-btn i { font-size: 10px !important; }

.risk-gallery { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.risk-gallery:empty { display: none; }
.upload-area.risk-add { flex-direction: row; height: 56px; gap: 6px; font-size: 15px; color: var(--text-2); }
.upload-area.risk-add i { font-size: 14px; }

.ai-fields { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: start; }
.count-group .field-label { display: block; font-size: 14px; font-weight: 600; color: var(--text-2); margin-bottom: 8px; }
.count-stepper { display: flex; align-items: center; height: 54px; border-radius: var(--r-field); background: var(--fill); overflow: hidden; }
.count-btn { width: 46px; height: 100%; font-size: 24px; font-weight: 500; color: var(--text-2); }
.count-btn:active { background: var(--fill-strong); }
.count-stepper select {
    width: 72px; height: 100%; padding: 0; border: none; border-radius: 0; background: transparent;
    text-align: center; text-align-last: center; font-size: 18px; font-weight: 700; color: var(--text);
    font-variant-numeric: tabular-nums;
}
.count-stepper select:focus { border: none; background: transparent; box-shadow: inset 0 0 0 2px var(--brand); }
.ai-fields .floating-label-group { margin-bottom: 16px; }
.record-container { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 12px 0 28px; }
.mic-btn-main {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: var(--brand);
    color: #FFFFFF;
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(49, 130, 246, 0.32);
    transition: transform 120ms var(--ease);
}
.mic-btn-main:active { transform: scale(0.94); }
.mic-btn-main.recording { background: var(--red); box-shadow: none; animation: pulse 1.6s ease-out infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(240, 68, 82, 0.45); } 100% { box-shadow: 0 0 0 18px rgba(240, 68, 82, 0); } }
.recording-status { font-size: 14px; color: var(--text-2); font-weight: 500; }

.bottom-actions {
    position: sticky;
    bottom: 0;
    z-index: 50;
    padding: 12px 20px calc(12px + var(--safe-bottom));
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #FFFFFF 14px);
}
.share-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }

/* ---------- 내 정보 (오른쪽 시트) ---------- */
.side-menu {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 1000;
    width: min(340px, 88vw);
    height: 100dvh;
    padding: var(--safe-top) 0 var(--safe-bottom);
    display: flex;
    flex-direction: column;
    background: var(--gray-bg);
    transform: translateX(100%);
    transition: transform 320ms var(--ease-sheet);
    overscroll-behavior: contain;
}
.side-menu.open { transform: none; }
.menu-header { display: flex; justify-content: flex-end; padding: 6px 8px 0; }
.menu-profile {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 4px 16px 12px;
    padding: 18px;
    border-radius: var(--r-card);
    background: var(--surface);
}
.menu-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--fill-strong);
    color: var(--text-3);
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.menu-avatar img { width: 100%; height: 100%; object-fit: cover; }
.menu-profile-text { min-width: 0; }
.menu-profile-text h3 { font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-profile-text p { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-list { list-style: none; margin: 0 16px; padding: 6px; border-radius: var(--r-card); background: var(--surface); }
.menu-list li a {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 52px;
    padding: 0 12px;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 500;
    transition: background 100ms var(--ease);
}
.menu-list li a:active { background: var(--fill); }
.menu-footer { margin-top: auto; padding: 16px 28px 12px; }
.menu-logout { font-size: 14px; color: var(--text-3); text-decoration: underline; text-underline-offset: 3px; }

.menu-overlay {
    position: fixed;
    inset: 0;
    z-index: 999;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transition: opacity 240ms var(--ease), visibility 240ms;
}
.menu-overlay.open { opacity: 1; visibility: visible; }

/* ---------- 바텀시트 공통 ---------- */
.sheet-handle { width: 36px; height: 4px; border-radius: 999px; background: var(--fill-strong); margin: 0 auto 6px; }
.record-modal-overlay, .logout-modal-overlay, .admin-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    transition: opacity 240ms var(--ease), visibility 240ms;
}
.record-modal-overlay.show, .logout-modal-overlay.show, .admin-popup-overlay.open { opacity: 1; visibility: visible; }
.admin-popup-overlay { display: none; }
.admin-popup-overlay.open { display: flex; }
.record-modal, .logout-modal, .admin-popup {
    position: relative;
    width: 100%;
    max-width: 480px;
    padding: 10px 20px calc(20px + var(--safe-bottom));
    border-radius: 24px 24px 0 0;
    background: var(--surface);
    transform: translateY(100%);
    transition: transform 360ms var(--ease-sheet);
}
.record-modal-overlay.show .record-modal, .logout-modal-overlay.show .logout-modal { transform: none; }
.admin-popup-overlay.open .admin-popup { transform: none; animation: sheetIn 360ms var(--ease-sheet); }
@keyframes sheetIn { from { transform: translateY(100%); } to { transform: none; } }
.record-modal-close, .admin-popup-close, .record-viewer-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    color: var(--text-3);
    font-size: 19px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 녹음 시트 */
.tbm-guide { padding: 10px 0 4px; }
.tbm-guide-title { font-size: 19px; font-weight: 700; letter-spacing: -0.03em; margin-bottom: 12px; }
.tbm-guide-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.tbm-guide-list li { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.tbm-guide-list .step-num {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--fill);
    color: var(--text-2);
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}
.record-modal-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--line-soft);
}
.record-mic-btn {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: var(--red);
    color: #FFFFFF;
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(240, 68, 82, 0.3);
}
.record-mic-btn.recording { background: var(--text); box-shadow: none; animation: pulse 1.6s ease-out infinite; }
.record-modal-status { font-size: 14px; color: var(--text-2); text-align: center; }
.record-modal-status.active { color: var(--red); font-weight: 700; }
.waveform { display: flex; align-items: center; justify-content: center; gap: 4px; height: 28px; opacity: 0; transition: opacity 200ms; }
.waveform.active { opacity: 1; }
.waveform .bar { width: 4px; height: 8px; border-radius: 2px; background: var(--red); animation: wave 0.9s ease-in-out infinite; }
.waveform .bar:nth-child(2) { animation-delay: 0.1s; }
.waveform .bar:nth-child(3) { animation-delay: 0.2s; }
.waveform .bar:nth-child(4) { animation-delay: 0.3s; }
.waveform .bar:nth-child(5) { animation-delay: 0.15s; }
.waveform .bar:nth-child(6) { animation-delay: 0.25s; }
.waveform .bar:nth-child(7) { animation-delay: 0.35s; }
.waveform .bar:nth-child(8) { animation-delay: 0.05s; }
@keyframes wave { 0%, 100% { height: 8px; } 50% { height: 24px; } }

/* 로그아웃 확인 */
.logout-modal { padding-top: 26px; }
.logout-modal-title { font-size: 20px; font-weight: 700; letter-spacing: -0.03em; }
.logout-modal-desc { font-size: 15px; color: var(--text-2); margin-top: 6px; }
.logout-modal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 24px; }
.logout-btn { min-height: 52px; border-radius: var(--r-btn); font-size: 16px; font-weight: 700; }
.logout-btn.cancel { background: var(--fill); color: var(--text); }
.logout-btn.confirm { background: var(--brand); color: #FFFFFF; }

/* 기록 상세 시트 */
.record-viewer-dialog { display: flex; flex-direction: column; max-height: 88dvh; padding: 10px 0 0; }
.record-viewer-header { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 60px 10px 20px; }
.record-viewer-title { font-size: 19px; font-weight: 700; letter-spacing: -0.03em; }
.record-viewer-close { top: -2px; right: 8px; }
#rvMultiSelector { flex-basis: 100%; }
#rvMultiSelector select { height: 46px; font-size: 15px; font-weight: 600; }
.record-viewer-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 2px 20px 16px; }
#rvSyncBadge { margin-bottom: 8px; }
.rv-row { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line-soft); }
.rv-row dt { font-size: 14px; color: var(--text-3); flex-shrink: 0; }
.rv-row dd { font-size: 15px; font-weight: 600; text-align: right; -webkit-user-select: text; user-select: text; }
.record-viewer-section-title { font-size: 15px; font-weight: 700; margin: 18px 0 8px; }
#rvSummary { padding: 14px 16px; border-radius: 14px; background: var(--fill); font-size: 14px; line-height: 1.65; white-space: pre-wrap; -webkit-user-select: text; user-select: text; }
.rv-photos { display: flex; flex-wrap: wrap; gap: 8px; }
.rv-photos img { width: 80px; height: 80px; object-fit: cover; border-radius: 12px; background: var(--fill); }
.rv-empty { font-size: 14px; color: var(--text-3); }
.record-viewer-actions { display: grid; grid-template-columns: 52px 1fr 1.6fr; gap: 8px; padding: 12px 20px calc(12px + var(--safe-bottom)); }
.record-viewer-action { min-height: 52px; border-radius: var(--r-btn); font-size: 15px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 6px; }
.record-viewer-action.secondary { background: var(--fill); color: var(--text); }
.record-viewer-action.zalo { background: var(--fill); color: var(--zalo); }
.record-viewer-action.download { background: var(--brand); color: #FFFFFF; font-size: 16px; }
.record-viewer-action:active { transform: scale(0.97); }

/* 관리자 문의 시트 */
.admin-popup h3 { font-size: 20px; font-weight: 700; letter-spacing: -0.03em; margin-top: 16px; }
/* 공지 카드 (홈 상단, 가로로 긴 한 줄) */
.notice-card {
    display: flex; align-items: center; gap: 10px; width: calc(100% - 28px); padding: 14px 16px; text-align: left;
    transition: transform 120ms var(--ease), background 120ms var(--ease);
}
.notice-card:active { transform: scale(0.98); background: var(--fill); }
.notice-label { flex-shrink: 0; font-size: 14px; font-weight: 700; color: var(--brand-ink); }
.notice-text { flex: 1; min-width: 0; font-size: 15px; font-weight: 500; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notice-card .chev { width: 18px; height: 18px; color: var(--text-4); }
.notice-dot { flex-shrink: 0; width: 7px; height: 7px; border-radius: 50%; background: var(--red); }
.notice-dot[hidden] { display: none; }
.notice-items { list-style: none; margin: 8px 0 4px; max-height: 60vh; overflow-y: auto; }
.notice-item { padding: 14px 2px; border-top: 1px solid var(--line-soft); animation: rise 380ms var(--ease) backwards; }
.notice-item:first-child { border-top: none; }
.notice-item:nth-child(2) { animation-delay: 50ms; }
.notice-item:nth-child(n+3) { animation-delay: 100ms; }
.notice-item b { display: block; font-size: 16px; font-weight: 700; letter-spacing: -0.02em; color: var(--text); }
.notice-item time { display: block; font-size: 12px; color: var(--text-3); margin-top: 2px; }
.notice-item p { font-size: 14px; line-height: 1.6; color: var(--text-2); margin-top: 8px; white-space: pre-line; word-break: break-word; }
.notice-empty { padding: 28px 0; text-align: center; font-size: 14px; color: var(--text-3); }
.admin-popup .popup-subtitle { font-size: 14px; color: var(--text-2); margin: 4px 0 12px; }
.contact-row { display: flex; align-items: center; gap: 14px; min-height: 60px; border-bottom: 1px solid var(--line-soft); cursor: pointer; }
.contact-row:last-child { border-bottom: none; cursor: default; }
.contact-row > i:first-child { width: 40px; height: 40px; border-radius: 12px; background: var(--fill); color: var(--text-2); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.contact-info { display: flex; flex-direction: column; min-width: 0; }
.contact-label { font-size: 12px; color: var(--text-3); }
.contact-value { font-size: 15px; font-weight: 600; }
.contact-copy { margin-left: auto; color: var(--text-3); }

/* ---------- 토스트 ---------- */
.custom-toast {
    position: fixed;
    left: 50%;
    bottom: calc(24px + var(--safe-bottom));
    z-index: 100001;
    width: calc(100% - 40px);
    max-width: 440px;
    padding: 13px 16px;
    border-radius: 14px;
    background: rgba(25, 31, 40, 0.95);
    color: #FFFFFF;
    font-size: 14px;
    font-weight: 600;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 10px);
    transition: opacity 200ms var(--ease), transform 260ms var(--ease);
}
.custom-toast.show { opacity: 1; transform: translate(-50%, 0); }
/* 하단 고정 버튼이 있는 화면에서는 버튼 바로 위에 띄운다 */
body:has(#mainScreen[style*="flex"]) .custom-toast { bottom: calc(90px + var(--safe-bottom)); }
body:has(#mainScreen[style*="flex"] #finalActions:not([hidden])) .custom-toast { bottom: calc(150px + var(--safe-bottom)); }

/* ---------- 위치 권한 차단 ---------- */
.location-blocker {
    position: fixed;
    inset: 0;
    z-index: 99999;
    flex-direction: column;
    padding: calc(64px + var(--safe-top)) 24px calc(20px + var(--safe-bottom));
    background: var(--surface);
}
.location-blocker-icon { width: 56px; height: 56px; border-radius: 16px; background: #FFF0F0; color: var(--red); font-size: 24px; display: flex; align-items: center; justify-content: center; margin-bottom: 20px; }
.location-blocker h2 { font-size: 24px; font-weight: 700; letter-spacing: -0.035em; }
.location-blocker h3 { font-size: 15px; font-weight: 500; color: var(--text-3); margin: 2px 0 20px; }
.location-blocker p { font-size: 15px; line-height: 1.65; color: var(--text-2); margin-bottom: 10px; }
.location-blocker p.sub { color: var(--text-3); }
.location-blocker button { margin-top: auto; width: 100%; min-height: 54px; border-radius: var(--r-btn); background: var(--brand); color: #FFFFFF; font-size: 17px; font-weight: 700; }

/* ---------- 넓은 화면 ---------- */
@media (min-width: 520px) {
    html, body { background: #E9ECEF; }
    .screen-container { box-shadow: 0 0 0 1px var(--line); }
}

@media (hover: hover) and (pointer: fine) {
    .icon-btn:hover, .calendar-nav button:hover, .menu-list li a:hover { background: var(--fill); }
    .calendar-day:hover:not(.selected) { background: var(--fill); }
    .btn-primary:hover { background: var(--brand-press); }
    .btn-secondary:hover, .upload-area:hover { background: var(--fill-strong); }
}

/* ---------- 부드러운 등장 효과 ----------
   화면(스크린)은 투명도만: transform을 쓰면 안의 하단 탭바(position: fixed)가 따라 움직인다.
   항목은 아래에서 살짝 올라오며 순서대로. backwards = 지연 시간 동안만 숨김, 끝나면 원래 상태 */
@keyframes fadeIn { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes logoPop { 0% { opacity: 0; transform: scale(0.6) rotate(-8deg); } 60% { transform: scale(1.08) rotate(3deg); } }

.screen-container { animation: fadeIn 280ms var(--ease); }

/* 로그인: 로고 → 제목 → 설명 → 입력 → 링크 순서 */
.auth-box > * { animation: rise 560ms var(--ease) backwards; }
.auth-box > :nth-child(2) { animation-delay: 70ms; }
.auth-box > :nth-child(3) { animation-delay: 140ms; }
.auth-box > :nth-child(4) { animation-delay: 210ms; }
.auth-box > :nth-child(n+5) { animation-delay: 280ms; }
.auth-logo { animation: logoPop 700ms var(--ease) 120ms backwards; }

/* 탭 전환: 카드들이 차례로 */
.tab-panel:not([hidden]) > * { animation: rise 420ms var(--ease) backwards; }
.tab-panel:not([hidden]) > :nth-child(2) { animation-delay: 50ms; }
.tab-panel:not([hidden]) > :nth-child(3) { animation-delay: 100ms; }
.tab-panel:not([hidden]) > :nth-child(4) { animation-delay: 150ms; }
.tab-panel:not([hidden]) > :nth-child(n+5) { animation-delay: 200ms; }
.recent-item { animation: rise 420ms var(--ease) backwards; }
.recent-item:nth-child(2) { animation-delay: 60ms; }
.recent-item:nth-child(3) { animation-delay: 120ms; }

/* 입력칸: 포커스 시 은은한 테두리 빛 */
input, textarea, select { transition: border-color 180ms var(--ease), background 180ms var(--ease), box-shadow 220ms var(--ease); }
input:focus, textarea:focus, select:focus { box-shadow: 0 0 0 4px var(--brand-soft); }
.has-icon:focus-within .field-icon { color: var(--brand); }

/* 누름 반응을 부드럽게 (내 정보 목록) */
.me-row { transition: background 160ms var(--ease), transform 160ms var(--ease); }
.me-row:active { transform: scale(0.99); }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}

/* ==========================================================================
   PDF 출력 양식 — 공식 서류 레이아웃이므로 리디자인 대상 아님 (기존 그대로)
   ========================================================================== */
.pdf-container {
    width: 210mm;
    min-height: 297mm;
    box-sizing: border-box;
    background: white;
    padding: 15mm 15mm 0; /* 아래 여백이 다음 장으로 넘어가 빈 페이지가 생기던 문제 방지 (페이지 여백은 PDF 옵션에서) */
    color: #000;
    font-family: inherit;
    /* printing ?�래???�존???�거 - ??�� ?�더링되?? 부�??�퍼???�해 ?�면??보이지 ?�음 */
}

.pdf-title {
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    text-decoration: underline;
    margin-bottom: 25px;
}

.site-name {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
}

.pdf-table {
    width: 100%;
    border-collapse: collapse;
    text-align: center;
    font-size: 13px;
}

.pdf-table th,
.pdf-table td {
    border: 1px solid #333;
    padding: 8px;
}

.pdf-table th {
    background: #f3f4f6;
}

.w-10 {
    width: 10%
}

.w-15 {
    width: 15%
}

.w-25 {
    width: 25%
}

.w-35 {
    width: 35%
}

.image-row td {
    height: 220px;
    position: relative;
    padding: 0;
    vertical-align: middle;
}

.image-row img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    max-height: 220px;
}

/* 참여??리더 ?�진: 조금 ?�게 */
.img-cell-small {
    height: 150px !important;
}
.img-cell-small img {
    max-height: 150px !important;
}

/* ?�업???�경 ?�진: ?�게 */
.img-cell-large {
    height: 150px !important;
}
.img-cell-large img {
    max-height: 150px !important;
}

.leader-col {
    padding: 0;
    vertical-align: top;
    height: 150px !important;
}

.leader-col img {
    display: block;
    width: 100%;
    height: 170px;
    object-fit: contain;
    border-bottom: 1px solid #333;
}

.leader-text {
    display: block;
    height: 30px;
    line-height: 30px;
    text-align: center;
    font-weight: bold;
    font-size: 14px;
}

.summary-header {
    background: #e5e7eb !important;
    text-align: center;
}
/* 제목+내용을 한 칸으로 묶음: 페이지가 바뀌어도 제목만 남지 않음 */
.pdf-table td.pdf-block-cell { padding: 0; }
.pdf-block-title { padding: 8px; font-weight: 700; border-bottom: 1px solid #333; }
.pdf-block { page-break-inside: avoid; break-inside: avoid; }

.summary-content {
    text-align: left;
    padding: 12px 16px;
}
/* PDF: 입력 화면용 표시([필수]·[자동 입력])는 공식 서류에서 숨김 */
#pdfOutput th span { display: none; }
/* 시간 칸 줄바꿈(시작~종료 / 진행 시간) */
#pdfTimeTd { white-space: pre-line; }

.pdf-summary-text {
    white-space: pre-wrap;
    line-height: 1.6;
    font-size: 13px;
    min-height: 72px; /* 내용이 짧아도 페이지 낭비 없도록 */
    /* ?�약 ?�션 최소 ?�이 ?��? */
}


#pdfRiskPhotos img {
    max-height: 110mm; /* 세로로 긴 사진 한 장이 페이지를 다 차지하지 않게 (비율 유지) */
    object-fit: contain;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
}


/* JavaScript 꺼짐 안내 (noscript) */
.nojs-banner {
    position: sticky; top: 0; z-index: 100000;
    margin: 0; padding: calc(14px + env(safe-area-inset-top, 0px)) 20px 16px;
    background: #FFF0F0; color: #8A1C24; font-size: 14px; line-height: 1.6;
    border-bottom: 1px solid #F8C9CD;
}
.nojs-banner b:first-child { display: block; font-size: 16px; margin-bottom: 4px; }
.nojs-vi { display: block; margin-top: 6px; color: #A8424B; font-size: 13px; }
