@charset "UTF-8";

*, *::before, *::after { box-sizing: border-box; }
body {
    margin: 0; padding: 0;
    font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
    background-color: #fafafa; color: #333;
    overscroll-behavior-y: none; 
}
body.modal-open { overflow: hidden; }

/* ヘッダー */
header {
    background-color: #fff; border-bottom: 4px solid #d3000f;
    padding: 10px 15px; display: flex; justify-content: space-between; align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.header-left { display: flex; align-items: center; }
.header-left img.logo { height: 40px; }
.header-clock {
    font-size: 0.95rem; font-weight: bold; color: #333;
    font-variant-numeric: tabular-nums; text-align: right; line-height: 1.3;
}

/* メインコンテナ */
.container { max-width: 600px; margin: 0 auto; padding: 20px; }
h2 {
    font-size: 1.1rem; color: #111; border-left: 4px solid #d3000f;
    padding-left: 10px; margin-top: 0; margin-bottom: 15px;
}

/* ログイン画面用 */
.login-box {
    background: #fff; padding: 30px 20px; border-radius: 12px;
    border: 1px solid #e0e0e0; box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    text-align: center; margin-top: 40px;
}
.login-logo { height: 50px; margin-bottom: 20px; }

/* 6桁パスコードの枠デザイン */
.passcode-wrapper {
    display: flex; justify-content: center; gap: 8px; margin-bottom: 20px;
}
.passcode-box {
    width: 45px; height: 55px; font-size: 1.5rem; font-weight: bold; text-align: center;
    border: 2px solid #ccc; border-radius: 8px; background: #fff; color: #333;
    -webkit-appearance: none; -moz-appearance: textfield; margin: 0; padding: 0;
}
.passcode-box:focus { border-color: #d3000f; outline: none; box-shadow: 0 0 5px rgba(211,0,15,0.3); }

/* ビューワリスト */
.menu-list { list-style: none; padding: 0; margin: 0; }
.menu-list li { margin-bottom: 12px; }
.menu-item {
    display: flex; flex-direction: column; background: #fff; padding: 15px 20px;
    border-radius: 8px; border: 1px solid #e0e0e0; text-decoration: none; color: #333;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02); transition: all 0.2s ease;
    cursor: pointer;
}
.menu-item:hover, .menu-item:active { border-color: #d3000f; background-color: #fff9f9; }
.menu-title { font-size: 1.05rem; font-weight: bold; color: #000; margin-bottom: 5px; word-break: break-all; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.menu-date { font-size: 0.8rem; color: #888; }

/* 本日更新バッジ */
.badge-today {
    background-color: #d3000f; color: #fff; font-size: 0.75rem; font-weight: bold;
    padding: 3px 8px; border-radius: 4px; white-space: nowrap;
}

/* ボタン共通 */
.btn {
    background-color: #333; color: #fff; border: none; padding: 12px 24px;
    border-radius: 6px; font-size: 1rem; font-weight: bold; cursor: pointer; width: 100%;
}
.btn:hover, .btn:active { background-color: #555; }

/* 管理画面用 */
.drop-zone { border: 2px dashed #ccc; border-radius: 8px; padding: 40px 20px; text-align: center; background-color: #fff; margin-bottom: 25px; cursor: pointer; }
.drop-zone.dragover { background-color: #fff0f1; border-color: #d3000f; }
#fullscreen-drop-overlay { display: none; position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(211, 0, 15, 0.15); border: 6px dashed #d3000f; z-index: 9999; justify-content: center; align-items: center; pointer-events: none; }
#fullscreen-drop-overlay .overlay-box { background: #fff; padding: 30px 40px; border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,0.15); text-align: center; color: #d3000f; font-size: 1.2rem; font-weight: bold; }
.admin-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
.admin-table th, .admin-table td { padding: 12px 15px; text-align: left; border-bottom: 1px solid #eee; }
.admin-table th { background-color: #333; color: #fff; font-size: 0.9rem; }
.admin-table td { word-break: break-all; }
.btn-danger { background-color: #d3000f; width: auto; padding: 6px 12px; font-size: 0.85rem; }
.btn-danger:hover { background-color: #b0000c; }
.status-msg { padding: 12px; margin-bottom: 20px; border-radius: 6px; font-weight: bold; font-size: 0.95rem; text-align: center; }
.status-success { background-color: #e6f4ea; color: #137333; border: 1px solid #dadce0; }
.status-error { background-color: #fce8e6; color: #c5221f; border: 1px solid #dadce0; }

/* ⬇️ 劇的解決：PDF閲覧用全画面モーダル（スマホの上下バーに食い込まない設定） */
#pdf-modal {
    display: none; position: fixed; 
    top: 0; left: 0; right: 0; bottom: 0; /* 💡高さ計算をやめて、画面の上下左右にピタッとくっつける */
    background-color: #f5f5f5; z-index: 10000; flex-direction: column;
}
.modal-header {
    background-color: #333; color: #fff; padding: 10px 15px;
    display: flex; justify-content: space-between; align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3); z-index: 10001;
    /* 💡 iPhoneの上の安全地帯（ノッチ部分）を考慮 */
    padding-top: calc(10px + env(safe-area-inset-top)); 
}
.modal-title { font-size: 1rem; font-weight: bold; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 15px; }
.btn-close-modal {
    background-color: #d3000f; color: #fff; border: none;
    padding: 8px 16px; border-radius: 4px; font-size: 0.95rem; font-weight: bold;
    cursor: pointer; display: flex; align-items: center; gap: 5px;
}
.btn-close-modal:active { background-color: #b0000c; }

.modal-body {
    flex: 1; width: 100%; display: flex; flex-direction: column; position: relative; background-color: #fff;
}
.iframe-wrapper {
    flex: 1; width: 100%; position: relative; -webkit-overflow-scrolling: touch;
}
.iframe-wrapper iframe {
    width: 100%; height: 100%; border: none; display: block; position: absolute; top: 0; left: 0; z-index: 1;
}

.modal-footer {
    background-color: #333; color: #fff; padding: 12px 15px;
    display: flex; justify-content: space-between; align-items: center;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.3); z-index: 10001; 
    /* 💡 iPhoneの下の安全地帯（ホームバー部分）を考慮して余白を広げる */
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
}
.page-btn {
    background-color: #555; color: #fff; border: none; padding: 10px 20px;
    border-radius: 6px; font-size: 1rem; font-weight: bold; cursor: pointer;
}
.page-btn:active { background-color: #777; }
.page-btn:disabled { background-color: #222; color: #666; cursor: not-allowed; }
.page-counter { font-size: 1.1rem; font-weight: bold; font-variant-numeric: tabular-nums; }

/* ローディング全体を中央に配置する箱 */
.loading-container {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    text-align: center; z-index: 10;
    width: 90%; max-width: 400px;
}
.loading-spinner {
    display: inline-block; width: 50px; height: 50px;
    border: 5px solid #e0e0e0; border-top: 5px solid #d3000f;
    border-radius: 50%; animation: spin 1s linear infinite; margin-bottom: 15px;
}
.loading-text { font-size: 0.95rem; font-weight: bold; color: #555; line-height: 1.6; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }