:root{
  --bg:#07111f;
  --panel:#0f1b2d;
  --panel-2:#14243a;
  --ink:#e5edf8;
  --muted:#97a6ba;
  --line:#263a56;
  --accent:#3b82f6;
  --accent-2:#1d4ed8;
  --success:#16a34a;
  --danger:#dc2626;
  --paper:#fffdf7;
  --paper-ink:#111827;
  --paper-line:#111827;
  --paper-muted:#4b5563;
}
*{box-sizing:border-box}
body{margin:0;font-family:Segoe UI,Roboto,Arial,sans-serif;background:linear-gradient(160deg,#06101f,#0b1729 45%,#111827);color:var(--ink)}
a{color:inherit;text-decoration:none}
.app-header{height:64px;display:flex;align-items:center;gap:18px;padding:0 18px;background:rgba(7,17,31,.96);border-bottom:1px solid var(--line);position:sticky;top:0;z-index:20;backdrop-filter:blur(10px)}
.brand{display:flex;align-items:center;gap:10px;font-weight:800;white-space:nowrap}.brand-mark{background:#1e40af;border-radius:12px;padding:8px}.main-nav{display:flex;gap:8px;overflow-x:auto;flex:1}.main-nav a{padding:9px 12px;border-radius:12px;color:#cbd5e1}.main-nav a:hover{background:#17263e;color:white}.sync-chip{border:1px solid #24405f;background:#0b1728;color:#cbd5e1;border-radius:999px;padding:8px 12px;white-space:nowrap}
main{min-height:calc(100vh - 64px)}
.page-shell{padding:24px;max-width:1400px;margin:0 auto}.page-title-row{display:flex;justify-content:space-between;gap:16px;align-items:flex-start;margin-bottom:18px}.page-title-row.compact{align-items:center}.page-title-row h1{margin:0;font-size:34px}.page-title-row p{margin:6px 0 0;color:var(--muted)}
.card{background:rgba(15,27,45,.96);border:1px solid var(--line);border-radius:20px;box-shadow:0 16px 40px rgba(0,0,0,.25);padding:18px}.card-title{font-weight:800;font-size:20px;margin-bottom:12px}.dashboard-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}.quick-actions{display:flex;flex-wrap:wrap;gap:10px}.stat-row{display:flex;justify-content:space-between;border-bottom:1px solid var(--line);padding:9px 0}.stat-row:last-child{border-bottom:0}.muted{color:var(--muted)}.hint{font-size:13px;color:var(--muted)}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;border:0;border-radius:12px;background:var(--accent);color:white;padding:10px 14px;font-weight:700;cursor:pointer}.btn:hover{background:var(--accent-2)}.btn.secondary{background:#243754;color:#e5edf8}.btn.secondary:hover{background:#304765}.btn.ghost{background:transparent;border:1px solid #334968;color:#cbd5e1}.btn.success{background:var(--success)}.btn.danger{background:var(--danger)}.btn.small{padding:7px 10px;border-radius:10px;font-size:13px}.btn:disabled{opacity:.45;cursor:not-allowed}.toolbar-row{display:flex;gap:8px;align-items:center}.wrap{flex-wrap:wrap}.icon-btn{border:1px solid #32445e;background:#16243a;color:#e5edf8;border-radius:10px;padding:8px 10px;cursor:pointer}
input,select,textarea{font:inherit;border:1px solid #38506f;background:#0a1424;color:var(--ink);border-radius:10px;padding:10px;width:100%}textarea{resize:vertical}label{display:flex;flex-direction:column;gap:6px;color:#d8e2ef;font-weight:650;margin-bottom:12px}.form-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:10px}.form-card h3{margin:0 0 14px}.settings-shell{display:grid;grid-template-columns:280px 1fr;gap:18px;padding:20px;max-width:1600px;margin:auto}.settings-menu{position:sticky;top:84px;height:max-content}.settings-menu h2{margin-top:0}.settings-menu nav{display:flex;flex-direction:column;gap:6px;margin-top:12px}.settings-menu a{padding:10px 12px;border-radius:12px;color:#dbe7f6}.settings-menu a:hover{background:#1b2c46}.settings-content{min-width:0}.settings-section{margin-bottom:24px;scroll-margin-top:84px}.settings-section h2{font-size:26px}.settings-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.switch-line,.check-line{flex-direction:row;align-items:center;justify-content:space-between;background:#0b1728;border:1px solid #243954;border-radius:12px;padding:10px 12px}.check-line{justify-content:flex-start}.switch-line input,.check-line input{width:auto}.switch-line i{width:44px;height:24px;background:#475569;border-radius:999px;position:relative;flex:none}.switch-line i:before{content:"";position:absolute;width:18px;height:18px;background:white;border-radius:50%;top:3px;left:3px;transition:.2s}.switch-line input{display:none}.switch-line input:checked + i{background:#2563eb}.switch-line input:checked + i:before{left:23px}.save-toast{background:#064e3b;border:1px solid #10b981;color:#dcfce7;border-radius:12px;padding:10px 14px}.storage-summary{display:flex;flex-direction:column;gap:8px;background:#0b1728;border:1px solid #263a56;border-radius:14px;padding:12px;margin-bottom:12px}.danger-zone{border-color:#7f1d1d}
/* Logbook */
.logbook-app{display:grid;grid-template-columns:280px 1fr;height:calc(100vh - 64px);overflow:hidden}.logbook-sidebar{background:#0b1728;border-right:1px solid var(--line);padding:16px;overflow:auto}.sidebar-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px}.book-area{display:flex;flex-direction:column;min-width:0;overflow:hidden}.book-topbar{display:flex;justify-content:space-between;gap:12px;align-items:center;padding:12px 16px;background:#0d1a2d;border-bottom:1px solid var(--line)}.book-status{padding:8px 18px;color:#cbd5e1;background:#0a1424;border-bottom:1px solid #1d314b;font-size:14px}.book-scroll{flex:1;overflow:auto;padding:22px;touch-action:pan-x pan-y;background:radial-gradient(circle at center,#27364d,#111827 62%,#070d18)}.book-spread{display:flex;justify-content:center;align-items:flex-start;gap:0;transform-origin:top center;transition:.2s}.book-spread.single .log-page:nth-child(2){display:none}.book-nav{display:flex;justify-content:center;align-items:center;gap:20px;padding:12px;background:#0b1728;border-top:1px solid var(--line)}
.log-page-wrap{position:relative}.log-page{width:816px;min-height:1056px;background:var(--paper);color:var(--paper-ink);padding:28px 30px 24px;border-radius:8px;box-shadow:0 22px 50px rgba(0,0,0,.42),inset 0 0 35px rgba(103,84,55,.08);border:1px solid #d8d2c1;position:relative;transform:scale(var(--page-scale, .78));transform-origin:top center;margin:0 -70px}.log-page.left{border-radius:10px 3px 3px 10px}.log-page.right{border-radius:3px 10px 10px 3px}.log-page.left:after{content:"";position:absolute;right:-2px;top:0;bottom:0;width:20px;background:linear-gradient(90deg,rgba(0,0,0,.08),rgba(255,255,255,.2),rgba(0,0,0,.12));pointer-events:none}.log-page.right:before{content:"";position:absolute;left:-2px;top:0;bottom:0;width:20px;background:linear-gradient(90deg,rgba(0,0,0,.12),rgba(255,255,255,.15),rgba(0,0,0,.05));pointer-events:none}.log-page.selected{box-shadow:0 0 0 4px rgba(59,130,246,.35),0 28px 60px rgba(0,0,0,.5)}.page-corner{position:absolute;width:54px;height:54px;bottom:0;cursor:pointer;z-index:3}.left .page-corner.prev{left:0;background:linear-gradient(135deg,rgba(0,0,0,.12) 0,transparent 50%)}.right .page-corner.next{right:0;background:linear-gradient(315deg,rgba(0,0,0,.12) 0,transparent 50%)}.printed-title{text-align:center;border:2px solid var(--paper-line);font-weight:900;letter-spacing:.05em;padding:6px;margin-bottom:6px;font-size:21px}.paper-row{display:grid;grid-template-columns:1.6fr 1.2fr .8fr;gap:6px;margin-bottom:6px}.paper-field{border-bottom:1.5px solid var(--paper-line);display:flex;align-items:flex-end;gap:5px;min-height:28px;font-size:10px;text-transform:uppercase;font-weight:800;color:#111}.paper-field input{border:0;background:transparent;color:#111;border-radius:0;padding:0 2px;font-size:13px;min-width:0}.paper-field label{font-size:9px;color:#111;margin:0;white-space:nowrap}.paper-section-title{background:#e7e5df;border:2px solid var(--paper-line);font-weight:900;text-align:center;padding:4px;font-size:12px;letter-spacing:.04em;margin-top:6px}.conditions-grid{display:grid;grid-template-columns:repeat(6,1fr);border-left:1.5px solid #111;border-top:1.5px solid #111}.conditions-grid .paper-box{border-right:1.5px solid #111;border-bottom:1.5px solid #111;padding:3px;font-size:8px;text-transform:uppercase;font-weight:800}.conditions-grid input{border:0;border-bottom:1px solid #111;background:transparent;border-radius:0;color:#111;padding:2px;font-size:12px}.dive-block{border:2px solid #111;margin-top:7px;position:relative}.dive-block.unused:after{content:"";position:absolute;inset:4px;background:linear-gradient(to bottom right,transparent calc(50% - 1px),rgba(120,0,0,.65) 50%,transparent calc(50% + 1px));pointer-events:none}.dive-title{background:#111;color:white;font-weight:900;text-align:center;padding:4px;font-size:12px;letter-spacing:.08em}.dive-grid{display:grid;grid-template-columns:1.05fr .95fr;gap:0}.dive-profile{border-right:1.5px solid #111;padding:5px}.dive-checks{padding:5px}.mini-table{width:100%;border-collapse:collapse;font-size:8px;text-transform:uppercase;font-weight:800}.mini-table td,.mini-table th{border:1px solid #111;padding:3px;vertical-align:middle}.mini-table th{background:#eee;text-align:center}.paper-input{border:0!important;border-bottom:1px solid #111!important;background:transparent!important;color:#111!important;border-radius:0!important;padding:0!important;font-size:12px!important;height:20px}.box-field{display:inline-flex;gap:1px;vertical-align:middle}.box-field input{width:18px;height:22px;border:1px solid #111!important;background:white!important;color:#111!important;border-radius:0!important;text-align:center;padding:0!important;font-size:12px!important;font-weight:800}.check-group{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:3px;margin-bottom:5px}.check-group.three{grid-template-columns:repeat(3,1fr)}.check-title{grid-column:1/-1;font-weight:900;font-size:8px;text-transform:uppercase;border-bottom:1px solid #111}.paper-check{display:flex;align-items:center;gap:3px;font-size:8px;text-transform:uppercase;font-weight:800;color:#111}.paper-check input{appearance:none;width:13px;height:13px;border:1.5px solid #111;background:#fff;border-radius:0;padding:0;flex:none}.paper-check input:checked{background:#bfdbfe;box-shadow:inset 0 0 0 2px white}.paper-check input:checked:after{content:"✓";font-size:11px;line-height:11px;display:block;text-align:center;color:#111}.line-area{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:5px}.line-box label{font-size:8px;font-weight:900;text-transform:uppercase;color:#111;margin:0}.lined-text{width:100%;min-height:44px;border:0!important;border-radius:0!important;background:repeating-linear-gradient(to bottom,transparent 0,transparent 20px,#111 21px)!important;color:#111!important;padding:0 2px!important;font-size:12px!important;line-height:21px!important;resize:none}.signature-section{display:grid;grid-template-columns:1.4fr .9fr;margin-top:8px;border:2px solid #111}.signature-left,.signature-right{padding:6px}.signature-left{border-right:1.5px solid #111}.sig-line{height:46px;border-bottom:1.5px solid #111;display:flex;align-items:center}.sig-line img{max-height:42px;max-width:100%}.sig-label{font-size:9px;font-weight:900;text-transform:uppercase}.timestamp-box{border:1.5px solid #111;padding:5px;min-height:46px;font-size:10px;font-weight:900}.lock-note{font-size:8px;margin-top:4px;text-transform:uppercase}.locked-label{display:inline-block;margin-top:4px;border:1.5px solid #111;background:#e5e7eb;padding:3px 6px;font-size:9px;font-weight:900}.page-number{text-align:center;font-size:10px;margin-top:8px}.log-page input:disabled,.log-page textarea:disabled{opacity:1;-webkit-text-fill-color:#111}.log-page.view-mode input:not(:checked),.log-page.view-mode textarea{pointer-events:none}.modal-backdrop{position:fixed;inset:0;background:rgba(0,0,0,.72);display:flex;align-items:center;justify-content:center;z-index:80;padding:20px}.modal-card{background:#0f1b2d;border:1px solid #375170;border-radius:20px;padding:20px;width:min(620px,100%);box-shadow:0 20px 60px rgba(0,0,0,.5)}.warning-note{background:#422006;border:1px solid #f59e0b;color:#fde68a;padding:10px;border-radius:12px}.signature-choice{display:flex;align-items:center;gap:10px;margin:8px 0;color:var(--muted)}#signaturePad{background:#fff;border:2px dashed #334155;border-radius:12px;width:100%;touch-action:none}
/* Calendar */
.calendar-layout{display:grid;grid-template-columns:1fr 360px;gap:16px}.calendar-top{display:flex;justify-content:space-between;align-items:center}.calendar-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:6px}.calendar-day,.calendar-head{min-height:94px;border:1px solid #263a56;border-radius:12px;padding:8px;background:#0b1728}.calendar-head{min-height:0;text-align:center;font-weight:800;color:#cbd5e1}.calendar-day.today{outline:2px solid #60a5fa}.calendar-day strong{display:block;margin-bottom:6px}.day-icons{display:flex;gap:4px;flex-wrap:wrap}.side-panel{background:#0f1b2d;border:1px solid var(--line);border-radius:20px;padding:18px;height:max-content;position:sticky;top:84px}.panel-actions{display:grid;gap:8px;margin-top:16px}
@media(max-width:1100px){.dashboard-grid,.settings-grid,.calendar-layout{grid-template-columns:1fr}.settings-shell{grid-template-columns:1fr}.settings-menu{position:static}.logbook-app{grid-template-columns:1fr}.logbook-sidebar{position:fixed;z-index:70;inset:64px auto 0 0;width:290px;transform:translateX(-105%);transition:.2s}.logbook-sidebar.open{transform:translateX(0)}.book-topbar{flex-direction:column;align-items:flex-start}.log-page{margin:0;transform:scale(var(--page-scale,.62))}.book-spread{gap:12px}.book-spread.open-book{flex-wrap:wrap}}
@media print{body{background:white}.app-header,.logbook-sidebar,.book-topbar,.book-status,.book-nav{display:none!important}.logbook-app{display:block;height:auto}.book-scroll{padding:0;overflow:visible;background:white}.book-spread{display:block;transform:none}.log-page{box-shadow:none!important;border:0!important;border-radius:0!important;transform:none!important;margin:0!important;width:8.5in;min-height:11in;background:white}.log-page:before,.log-page:after,.page-corner{display:none!important}.log-page:not(.selected){display:none}}
/* Pay Tracker depth pay patch */
.pay-entry-card{margin-top:16px}.pay-entry-list-card{margin-top:16px}.pay-card-head{display:flex;justify-content:space-between;gap:12px;align-items:flex-start;margin-bottom:14px}.pay-card-head h2,.pay-card-head h3{margin:0 0 4px}.pay-card-head.compact{margin-bottom:10px}.pay-entry-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.pay-entry-grid .wide{grid-column:1/-1}.depth-pay-box{background:#0b1728;border:1px solid #263a56;border-radius:16px;padding:14px}.depth-pay-layout{display:grid;grid-template-columns:minmax(240px,.75fr) 1fr;gap:16px}.depth-table-title{font-weight:800;margin-bottom:8px;color:#dbe7f6}.depth-pay-table{width:100%;border-collapse:collapse;overflow:hidden;border-radius:12px}.depth-pay-table th,.depth-pay-table td{border:1px solid #263a56;padding:10px;text-align:left}.depth-pay-table th{background:#14243a;color:#dbe7f6}.depth-pay-table td{background:#0a1424}.depth-pay-table .active-depth-row td{background:#064e3b;color:#dcfce7}.depth-result{margin-top:12px;padding:10px;border:1px solid #263a56;border-radius:12px;background:#0a1424;color:#cbd5e1;font-weight:700}.depth-result.success{border-color:#16a34a;color:#dcfce7;background:#052e22}.pay-entry-list{display:grid;gap:10px}.pay-entry-row{display:flex;justify-content:space-between;gap:12px;align-items:center;border:1px solid #263a56;background:#0b1728;border-radius:14px;padding:12px}.pay-entry-total{text-align:right;display:flex;flex-direction:column;gap:4px;white-space:nowrap}.pay-entry-total span{color:var(--muted);font-size:13px}@media(max-width:800px){.pay-entry-grid,.depth-pay-layout{grid-template-columns:1fr}.pay-entry-row{align-items:flex-start;flex-direction:column}.pay-entry-total{text-align:left}}

/* Theme setting */
body.theme-light{
  --bg:#eef2f7;
  --panel:#ffffff;
  --panel-2:#f7fafc;
  --ink:#0f172a;
  --muted:#475569;
  --line:#d8e1ec;
  background:#eef2f7;
  color:var(--ink);
}
body.theme-light .app-header{background:rgba(255,255,255,.96);border-bottom-color:#d8e1ec}
body.theme-light .main-nav a{color:#334155}
body.theme-light .main-nav a:hover{background:#eaf1fa;color:#0f172a}
body.theme-light .sync-chip{background:#f8fafc;color:#334155;border-color:#cbd5e1}
body.theme-light .card,
body.theme-light .settings-menu,
body.theme-light .side-panel,
body.theme-light .modal-card{background:#ffffff;border-color:#d8e1ec;color:#0f172a;box-shadow:0 12px 30px rgba(15,23,42,.08)}
body.theme-light input,
body.theme-light select,
body.theme-light textarea{background:#ffffff;color:#0f172a;border-color:#cbd5e1}
body.theme-light label{color:#0f172a}
body.theme-light .switch-line,
body.theme-light .check-line,
body.theme-light .storage-summary,
body.theme-light .depth-pay-box,
body.theme-light .pay-entry-row{background:#f8fafc;border-color:#d8e1ec;color:#0f172a}
body.theme-light .btn.secondary{background:#e2e8f0;color:#0f172a}
body.theme-light .btn.ghost{border-color:#cbd5e1;color:#334155}
body.theme-light .book-topbar,
body.theme-light .book-status,
body.theme-light .book-nav,
body.theme-light .logbook-sidebar{background:#ffffff;color:#0f172a;border-color:#d8e1ec}
body.theme-light .book-scroll{background:radial-gradient(circle at center,#d9e3ee,#eef2f7 62%,#e2e8f0)}
body.theme-light .calendar-day,
body.theme-light .calendar-head{background:#ffffff;border-color:#d8e1ec;color:#0f172a}

/* Settings auto-save + Pay Profiles */
.settings-card-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:12px}.settings-card-head h3{margin:0}.settings-card-head p{margin:4px 0 0}.autosave-pill,.autosave-status{display:inline-flex;align-items:center;width:max-content;max-width:100%;border:1px solid #263a56;background:#0b1728;color:#cbd5e1;border-radius:999px;padding:6px 10px;font-size:12px;font-weight:800;margin-top:6px}.autosave-pill[data-mode="saved"],.autosave-status[data-mode="saved"]{background:#052e22;border-color:#16a34a;color:#dcfce7}.autosave-pill[data-mode="saving"],.autosave-status[data-mode="saving"]{background:#1e293b;border-color:#60a5fa;color:#dbeafe}.autosave-pill[data-mode="error"],.autosave-status[data-mode="error"]{background:#450a0a;border-color:#dc2626;color:#fee2e2}body.theme-light .autosave-pill,body.theme-light .autosave-status{background:#f8fafc;border-color:#cbd5e1;color:#334155}body.theme-light .autosave-pill[data-mode="saved"],body.theme-light .autosave-status[data-mode="saved"]{background:#dcfce7;border-color:#22c55e;color:#14532d}body.theme-light .autosave-pill[data-mode="saving"],body.theme-light .autosave-status[data-mode="saving"]{background:#dbeafe;border-color:#3b82f6;color:#1e3a8a}body.theme-light .autosave-pill[data-mode="error"],body.theme-light .autosave-status[data-mode="error"]{background:#fee2e2;border-color:#dc2626;color:#7f1d1d}.pay-profile-actions{margin:8px 0 12px}.pay-profile-editor{margin-top:12px}.pay-profile-editor[hidden],#dayRateFields[hidden],#hourlyRateFields[hidden]{display:none}.depth-settings-head{display:flex;justify-content:space-between;align-items:center;gap:12px;margin:14px 0 8px}.depth-settings-head h4{margin:0}.depth-settings-table-wrap{overflow-x:auto}.settings-depth-table{width:100%;border-collapse:collapse}.settings-depth-table th,.settings-depth-table td{border:1px solid #263a56;padding:7px;text-align:left}.settings-depth-table th{background:#14243a;color:#dbe7f6}.settings-depth-table input{padding:7px;border-radius:8px}.settings-depth-table .btn{width:auto;min-width:34px}body.theme-light .settings-depth-table th,body.theme-light .settings-depth-table td{border-color:#d8e1ec}body.theme-light .settings-depth-table th{background:#f1f5f9;color:#0f172a}.pay-source-note{background:#0b1728;border:1px solid #263a56;color:#cbd5e1;border-radius:12px;padding:10px;margin:10px 0}body.theme-light .pay-source-note{background:#e8f2ff;border-color:#dbeafe;color:#0f172a}.pay-source-note a{text-decoration:underline;color:inherit}

/* Screenshot-style Add Work / Pay Entry */
.pay-page{max-width:1180px}.pay-page .current-pay-card{margin-bottom:12px}.pay-work-card,.saved-entries-card{background:#ffffff;color:#00152b;border-radius:14px;padding:18px;border:1px solid #e2e8f0;box-shadow:0 12px 30px rgba(15,23,42,.08);margin-bottom:14px}.theme-dark .pay-work-card,.theme-dark .saved-entries-card{background:#f8fafc;color:#00152b}.screenshot-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}.screenshot-head h2,.saved-entries-card h2{margin:0 0 12px;color:#00152b}.pay-screenshot-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.pay-screenshot-grid label{color:#00152b;font-weight:500;font-size:12px;margin:0}.pay-screenshot-grid input,.pay-screenshot-grid select{height:34px;background:#fff;color:#00152b;border:1px solid #cbd6e2;border-radius:7px;padding:7px 10px;font-size:12px}.pay-notes-field{grid-column:span 1}.pay-totals-box{margin-top:14px;background:#eafff5;border:1px solid #7deccc;border-radius:9px;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;padding:12px}.pay-totals-box div{display:flex;flex-direction:column;gap:3px}.pay-totals-box span{font-size:12px;color:#0f3b47}.pay-totals-box strong{font-size:16px;color:#00152b}.pay-save-btn{margin-top:12px;width:276px;max-width:100%;height:28px;border:0;border-radius:7px;background:#158174;color:#fff;font-weight:800;cursor:pointer}.pay-save-btn:hover{background:#0f766e}.saved-table-wrap{overflow-x:auto}.saved-entries-table{width:100%;border-collapse:collapse;font-size:12px}.saved-entries-table th{background:#f5f7fa;color:#334155;text-align:left;border-bottom:1px solid #d8e1ec;padding:9px 8px}.saved-entries-table td{border-bottom:1px solid #d8e1ec;padding:9px 8px;color:#00152b}.delete-entry-btn{background:#bd261d;color:#fff;border:0;border-radius:7px;padding:8px 12px;font-weight:800;cursor:pointer}.delete-entry-btn:hover{background:#991b1b}.pay-work-card[hidden]{display:none!important}@media(max-width:900px){.pay-screenshot-grid{grid-template-columns:1fr}.pay-totals-box{grid-template-columns:repeat(2,minmax(0,1fr))}.pay-save-btn{width:100%}}@media(max-width:600px){.pay-totals-box{grid-template-columns:1fr}.saved-entries-table{font-size:11px}}

/* Logbook digital book view / list view update */
.hidden{display:none!important}.full-width{width:100%;margin:8px 0 14px}.sidebar-subtitle{display:block;font-size:12px;color:var(--muted);font-weight:600;margin-top:2px}.view-switcher{display:grid;grid-template-columns:1fr;gap:7px;margin-bottom:10px}.view-tab{border:1px solid #263a56;background:#101e33;color:#dbe7f6;border-radius:12px;padding:10px 12px;font-weight:850;text-align:left;cursor:pointer}.view-tab:hover,.view-tab.active{background:#1d4ed8;border-color:#60a5fa;color:white}.side-section-title{font-weight:900;text-transform:uppercase;letter-spacing:.05em;font-size:12px;color:#cbd5e1;margin:14px 0 8px;border-top:1px solid #263a56;padding-top:12px}.page-list{display:grid;gap:8px}.side-page-item{border:1px solid #263a56;background:#0f1b2d;color:#dbe7f6;border-radius:12px;padding:10px;text-align:left;cursor:pointer;display:grid;gap:4px}.side-page-item strong{font-size:13px}.side-page-item span{font-size:12px;color:#cbd5e1;line-height:1.25}.side-page-item em{font-style:normal;font-size:10px;color:#8fb5e8;font-weight:850;text-transform:uppercase}.side-page-item:hover,.side-page-item.active{border-color:#60a5fa;box-shadow:0 0 0 2px rgba(96,165,250,.18);background:#152641}.book-view-panel{display:flex;flex-direction:column;min-height:0;flex:1}.list-view-panel{flex:1;overflow:auto;padding:20px;background:radial-gradient(circle at center,#27364d,#111827 62%,#070d18)}.list-view-card{background:rgba(15,27,45,.96);border:1px solid var(--line);border-radius:20px;padding:18px;box-shadow:0 16px 40px rgba(0,0,0,.25)}.list-head-row{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:12px}.list-head-row h2{margin:0}.list-head-row p{margin:4px 0 0;color:var(--muted)}.logbook-list-table-wrap{overflow-x:auto;border:1px solid #263a56;border-radius:16px}.logbook-list-table{width:100%;border-collapse:collapse;font-size:13px}.logbook-list-table th{background:#14243a;color:#dbe7f6;text-align:left;padding:11px 10px;white-space:nowrap}.logbook-list-table td{border-top:1px solid #263a56;padding:10px;color:#dbe7f6;white-space:nowrap}.logbook-list-table tbody tr{cursor:pointer}.logbook-list-table tbody tr:hover,.logbook-list-table tbody tr.selected-row{background:#17263e}.page-status-pill{display:inline-flex;border-radius:999px;padding:4px 8px;font-size:10px;font-weight:900;text-transform:uppercase;border:1px solid #334968}.page-status-pill.draft{color:#dbeafe;background:#172554;border-color:#1d4ed8}.page-status-pill.locked{color:#dcfce7;background:#052e22;border-color:#16a34a}.empty-list-note,.empty-book-message,.empty-table-cell{color:var(--muted);padding:16px;text-align:center}.book-page-header{display:grid;grid-template-columns:1fr 58px;gap:6px;align-items:stretch;margin-bottom:6px}.book-page-header .printed-title{margin-bottom:0}.page-id-box{border:2px solid var(--paper-line);font-size:9px;font-weight:900;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center;background:#f3f0e8}.page-id-box strong{font-size:18px}.contractor-row{grid-template-columns:1.35fr 1.45fr .7fr}.profile-drawing{height:126px;border:1.5px solid #111;background:linear-gradient(#fbfaf5,#f7f2e8);position:relative;margin-bottom:5px;overflow:hidden}.profile-drawing:before{content:"";position:absolute;left:0;right:0;top:27px;border-top:2px solid #111}.surface-line span{position:absolute;right:6px;top:8px;font-size:9px;font-weight:900}.descent-line{position:absolute;left:38px;top:27px;width:92px;border-top:2px solid #111;transform:rotate(62deg);transform-origin:left center}.bottom-line{position:absolute;left:92px;right:132px;bottom:34px;border-top:2px solid #111}.bottom-line span{position:absolute;top:-16px;left:15%;font-size:8px;font-weight:900;background:#f7f2e8;padding:0 3px}.ascent-line{position:absolute;right:88px;bottom:34px;width:94px;border-top:2px solid #111;transform:rotate(-58deg);transform-origin:right center}.deco-step{position:absolute;border-top:2px solid #111;border-left:2px solid #111}.deco-one{right:52px;top:52px;width:42px;height:22px}.deco-two{right:22px;top:32px;width:30px;height:20px}.profile-label{position:absolute;background:#fffdf7;border:1px solid #111;padding:2px 3px;font-size:8px;font-weight:900;display:flex;align-items:center;gap:3px}.profile-depth{left:10px;bottom:10px}.profile-left-surface{left:6px;top:6px}.profile-left-bottom{left:102px;bottom:9px}.profile-label .box-field input{width:13px;height:15px;font-size:9px}.profile-time-table{margin-top:4px}.schedule-box{border:1px solid #111;padding:4px;margin:3px 0 5px}.schedule-box label{font-size:8px;font-weight:900;text-transform:uppercase;color:#111;margin:0}.compact-line-area{gap:5px}.work-area{padding:5px;border-top:1.5px solid #111}.daily-notes-area{min-height:36px!important}body.theme-light .view-tab{background:#f8fafc;color:#0f172a;border-color:#cbd5e1}body.theme-light .view-tab:hover,body.theme-light .view-tab.active{background:#2563eb;color:white;border-color:#3b82f6}body.theme-light .side-section-title{color:#334155;border-color:#d8e1ec}body.theme-light .side-page-item{background:#f8fafc;color:#0f172a;border-color:#d8e1ec}body.theme-light .side-page-item span{color:#475569}body.theme-light .side-page-item em{color:#1d4ed8}body.theme-light .side-page-item:hover,body.theme-light .side-page-item.active{background:#e8f2ff;border-color:#3b82f6}body.theme-light .list-view-panel{background:radial-gradient(circle at center,#d9e3ee,#eef2f7 62%,#e2e8f0)}body.theme-light .list-view-card{background:#ffffff;border-color:#d8e1ec;color:#0f172a}body.theme-light .logbook-list-table-wrap{border-color:#d8e1ec}body.theme-light .logbook-list-table th{background:#f1f5f9;color:#0f172a}body.theme-light .logbook-list-table td{border-color:#d8e1ec;color:#0f172a}body.theme-light .logbook-list-table tbody tr:hover,body.theme-light .logbook-list-table tbody tr.selected-row{background:#e8f2ff}@media(max-width:900px){.book-page-header{grid-template-columns:1fr}.page-id-box{display:none}.list-head-row{flex-direction:column}.logbook-list-table{font-size:12px}.profile-drawing{display:none}.dive-grid{grid-template-columns:1fr}.dive-profile{border-right:0;border-bottom:1.5px solid #111}}

/* Closely matched commercial diving RECORD OF DIVE page */
.record-of-dive-page{
  width:720px!important;
  min-height:930px!important;
  padding:24px 28px 20px!important;
  background:#fffef9!important;
  color:#111!important;
  font-family:Arial, Helvetica, sans-serif!important;
  font-size:11px!important;
  line-height:1.06!important;
  border-radius:7px!important;
}
.record-of-dive-page *{box-sizing:border-box}.record-of-dive-page label{margin:0;color:#111;font-weight:400;display:inline-flex;gap:3px;align-items:center;flex-direction:row}.record-of-dive-page input,.record-of-dive-page textarea{color:#111;background:transparent;border-radius:0}.record-header{display:grid;grid-template-columns:1.05fr 1.18fr 1fr;gap:12px;align-items:start;margin-bottom:6px}.date-line{display:flex;align-items:center;gap:7px;white-space:nowrap;font-size:12px;padding-top:16px}.book-line-field{display:inline-flex;align-items:flex-end;border-bottom:2px solid #111;min-width:115px;height:18px}.book-line-field.date-entry{min-width:108px}.book-line-field.signature-entry{min-width:190px}.book-line-field.other-type-line{width:95%;margin-left:5px;margin-top:5px}.book-line-field input{border:0!important;padding:0 2px!important;height:16px!important;font-size:12px!important;width:100%;min-width:0}.record-title-wrap{text-align:left}.record-title{text-align:center;font-weight:900;font-size:17px;letter-spacing:.01em;margin-bottom:8px}.diver-signature-line{display:flex;gap:8px;align-items:center;font-size:12px;white-space:nowrap}.reference-right-lines{display:grid;gap:18px;padding-top:20px}.ruled-input{display:grid;grid-template-columns:auto 1fr;gap:7px;align-items:end;min-height:20px}.ruled-input label{white-space:nowrap;font-size:12px}.ruled-input input,.ruled-input textarea{border:0!important;border-bottom:2px solid #111!important;padding:0 2px!important;height:18px!important;font-size:12px!important;resize:none;overflow:hidden}.textarea-line{align-items:start}.textarea-line textarea{height:22px!important;line-height:18px;background:repeating-linear-gradient(to bottom, transparent 0, transparent 17px, #111 17px, #111 19px)!important;border-bottom:0!important;min-height:auto!important}.record-top-grid{display:grid;grid-template-columns:1fr;margin-bottom:5px}.condition-stack{display:grid;gap:2px}.reference-check-group{display:flex;align-items:center;gap:11px;flex-wrap:wrap;font-size:10.5px;min-height:21px}.reference-check-group strong{font-size:12px;min-width:150px}.reference-check-group input,.single-reference-check input,.type-of-dive-box input{appearance:none;width:10px!important;height:10px!important;border:1.5px solid #111!important;background:#fff!important;border-radius:0!important;padding:0!important;min-width:10px}.reference-check-group input:checked,.single-reference-check input:checked,.type-of-dive-box input:checked{background:linear-gradient(45deg,transparent 40%,#111 40%,#111 60%,transparent 60%),linear-gradient(-45deg,transparent 40%,#111 40%,#111 60%,transparent 60%)!important}.reference-dive-grid{display:grid;grid-template-columns:1.23fr repeat(3,1fr);border-left:2px solid #111;border-top:2px solid #111;margin:8px 0 8px}.dive-row-label,.reference-dive-column{border-right:2px solid #111;border-bottom:2px solid #111}.dive-row-label{padding:7px 7px 5px;font-size:10px;display:grid;align-content:start;gap:4px}.dive-row-label b{font-size:11px}.dive-row-label span{display:block}.reference-dive-column{padding:6px 5px;min-height:102px}.reference-dive-title{text-align:center;font-weight:900;font-size:12px;margin-bottom:6px}.dive-data-line{display:flex;align-items:center;justify-content:center;gap:4px;min-height:21px;font-size:10px;white-space:nowrap}.dive-data-line span,.dive-data-line b{font-size:10px;font-weight:700}.box-field{display:inline-flex;gap:1px;vertical-align:middle}.box-field input{width:15px!important;height:17px!important;border:1px solid #111!important;background:#fff!important;border-radius:0!important;text-align:center;padding:0!important;font-size:10px!important;font-weight:700}.surface-label,.small-row{min-height:54px}.saturation-label,.saturation-row{min-height:90px}.reference-lower-grid{display:grid;grid-template-columns:1fr 146px;gap:12px;align-items:start}.reference-lines{display:grid;gap:2px}.reference-lines .ruled-input label{font-size:12px}.type-of-dive-box{border:2px solid #111;padding:10px 10px 8px;min-height:145px;font-size:12px;margin-top:8px}.type-of-dive-box .box-title{font-weight:500;margin-bottom:7px}.type-of-dive-box label{display:flex;gap:5px;margin-bottom:2px}.penetration-row{display:grid;grid-template-columns:auto 1fr;align-items:end;gap:12px}.single-reference-check{white-space:nowrap;font-size:12px}.approved-section{margin-top:9px}.approved-title{font-weight:900;font-size:12px;margin-bottom:2px}.approved-section .ruled-input{min-height:20px}.signature-date-row{display:grid;grid-template-columns:1fr 110px;gap:18px;align-items:end;margin-top:8px}.signature-line-box{display:grid;grid-template-columns:auto 1fr;gap:8px;align-items:end}.signature-line-box label{font-size:12px}.signature-display{height:34px;border-bottom:2px solid #111;position:relative;overflow:visible}.signature-display img{max-height:42px;max-width:100%;object-fit:contain;position:absolute;left:0;bottom:-2px}.reference-page-number{text-align:center;font-weight:800;font-size:13px;margin-top:10px}.reference-locked-label{display:inline-block;margin-top:4px}.record-of-dive-page .page-corner{opacity:.08}.record-of-dive-page.selected{box-shadow:0 0 0 4px rgba(59,130,246,.35),0 28px 60px rgba(0,0,0,.55),inset 0 0 35px rgba(103,84,55,.08)!important}.record-of-dive-page input:disabled,.record-of-dive-page textarea:disabled{opacity:1!important;-webkit-text-fill-color:#111;cursor:pointer}.record-of-dive-page.view-mode input:not([type="checkbox"]):disabled,.record-of-dive-page.view-mode textarea:disabled{color:#111}.record-of-dive-page.edit-mode{box-shadow:0 0 0 4px rgba(34,197,94,.28),0 28px 60px rgba(0,0,0,.55)!important}.record-of-dive-page.locked:before{content:"SIGNED / LOCKED";position:absolute;top:10px;right:18px;border:2px solid #111;padding:3px 7px;font-weight:900;font-size:10px;background:rgba(255,255,255,.9)}
@media(max-width:900px){.record-of-dive-page{width:720px!important}.record-header{grid-template-columns:1fr}.reference-right-lines{padding-top:0;gap:5px}.reference-lower-grid{grid-template-columns:1fr}.type-of-dive-box{max-width:180px}.book-scroll{padding:14px!important}}
@media print{.app-header,.logbook-sidebar,.book-topbar,.book-status,.book-nav{display:none!important}.logbook-app{display:block;height:auto}.book-area,.book-view-panel,.book-scroll{display:block;overflow:visible;background:#fff!important;height:auto}.book-spread{display:block!important;transform:none!important}.log-page{transform:none!important;margin:0 auto 18px!important;box-shadow:none!important;border:0!important;page-break-after:always}.log-page.blank-page{display:none!important}}

/* Logbook functional fillable update */
.logbook-app.sidebar-collapsed{grid-template-columns:0 1fr}
.logbook-app.sidebar-collapsed .logbook-sidebar{padding:0;border-right:0;overflow:hidden;transform:translateX(-105%)}
.clean-topbar{justify-content:flex-start!important;gap:12px!important;min-height:52px}
.clean-topbar .topbar-title{font-weight:900;color:#dbe7f6;letter-spacing:.02em}.menu-toggle{font-size:18px;line-height:1}
.side-tool-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:14px}.side-tool-grid .wide{grid-column:1/-1}
.book-nav .page-arrow{min-width:42px;font-size:17px;font-weight:900}.book-nav #pageCounter{font-weight:900;color:#dbe7f6;min-width:120px;text-align:center}
.record-of-dive-page.fillable-mode input:not(:disabled),.record-of-dive-page.fillable-mode textarea:not(:disabled){cursor:text}.record-of-dive-page.fillable-mode input[type="checkbox"]:not(:disabled){cursor:pointer}.record-of-dive-page.fillable-mode input:focus,.record-of-dive-page.fillable-mode textarea:focus{outline:1.5px solid rgba(37,99,235,.65)!important;outline-offset:1px;background:rgba(219,234,254,.45)!important}.record-of-dive-page.fillable-mode .box-field input:focus{background:#eff6ff!important}
.record-of-dive-page.locked input,.record-of-dive-page.locked textarea{cursor:not-allowed!important}
body.theme-light .clean-topbar .topbar-title,body.theme-light .book-nav #pageCounter{color:#0f172a}
@media(max-width:1100px){.logbook-app.sidebar-collapsed .logbook-sidebar{position:fixed;width:290px}.logbook-sidebar.open{transform:translateX(0)}}

/* Logbook security/signature/letter print update */
.full-width{width:100%}
.signature-tools{display:grid;grid-template-columns:1fr auto;gap:10px;align-items:end;margin:10px 0 12px}
.signature-tools label{margin:0}
.signature-upload-label{grid-column:1/-1;background:#0b1728;border:1px dashed #475569;border-radius:12px;padding:10px;cursor:pointer}
.signature-upload-label input{margin-top:8px;background:#08111f}
.signature-upload-status{grid-column:1/-1;color:#cbd5e1;font-size:13px;background:#0b1728;border:1px solid #263a56;border-radius:10px;padding:8px}
body.theme-light .signature-upload-label,body.theme-light .signature-upload-status{background:#f8fafc;border-color:#cbd5e1;color:#334155}
#signaturePad{height:150px}
@media(max-width:700px){.signature-tools{grid-template-columns:1fr}.signature-tools .btn{width:100%}}

@page{size:letter portrait;margin:.25in}
@media print{
  html,body{width:8.5in!important;min-height:11in!important;background:white!important;overflow:visible!important}
  body.print-current-logbook-page .log-page:not(.print-target){display:none!important}
  body.print-current-logbook-page .book-spread{display:block!important;width:100%!important;margin:0!important;padding:0!important}
  body.print-current-logbook-page .book-scroll{padding:0!important;margin:0!important;background:white!important}
  body.print-current-logbook-page .log-page.print-target,
  body.print-current-logbook-page .record-of-dive-page.print-target{
    display:block!important;
    width:8in!important;
    height:10.5in!important;
    min-height:0!important;
    margin:0 auto!important;
    padding:.22in .26in .16in!important;
    transform:none!important;
    box-shadow:none!important;
    border:0!important;
    border-radius:0!important;
    overflow:hidden!important;
    page-break-before:auto!important;
    page-break-after:avoid!important;
    page-break-inside:avoid!important;
    break-before:auto!important;
    break-after:avoid!important;
    break-inside:avoid!important;
  }
  body.print-current-logbook-page .log-page.print-target:before,
  body.print-current-logbook-page .log-page.print-target:after,
  body.print-current-logbook-page .page-corner{display:none!important}
  body.print-current-logbook-page .log-page.print-target input,
  body.print-current-logbook-page .log-page.print-target textarea{font-size:10px!important}
}

/* Signature draw-window size controls */
.signature-adjust-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:10px 0 4px;color:#cbd5e1;font-size:13px}
.signature-adjust-row span{font-weight:800;margin-right:auto}
.signature-adjust-hint{margin:0 0 10px;color:#94a3b8;font-size:12px}
.signature-display img{height:42px;width:auto;max-width:100%;object-fit:contain;position:absolute;left:0;bottom:-2px}
body.theme-light .signature-adjust-row{color:#334155}
body.theme-light .signature-adjust-hint{color:#64748b}
@media(max-width:700px){.signature-adjust-row .btn{flex:1 1 30%}.signature-adjust-row span{width:100%;margin-right:0}}

/* Signature quality fix: sharp source canvas + slider sizing */
.improved-signature-controls{display:grid;grid-template-columns:auto 1fr auto auto auto;gap:10px;align-items:center}
.improved-signature-controls label{display:flex;align-items:center;gap:6px;margin:0;color:#cbd5e1;font-weight:800;white-space:nowrap}
.improved-signature-controls input[type="range"]{width:100%;accent-color:#60a5fa}
.improved-signature-controls #signatureSizeValue{color:#e2e8f0;min-width:42px;display:inline-block}
#signaturePad{height:150px;image-rendering:auto}
body.theme-light .improved-signature-controls label{color:#334155}
body.theme-light .improved-signature-controls #signatureSizeValue{color:#0f172a}
@media(max-width:700px){.improved-signature-controls{grid-template-columns:1fr}.improved-signature-controls .btn{width:100%}}

/* Signature crop/rotate workflow */
.signature-crop-editor{
  border:1px solid #263a56;
  background:#08111f;
  border-radius:14px;
  padding:10px;
  margin:10px 0 12px;
}
.signature-crop-header{
  display:grid;
  gap:3px;
  margin-bottom:8px;
}
.signature-crop-header strong{color:#e2e8f0;font-size:14px}
.signature-crop-header span{color:#94a3b8;font-size:12px;line-height:1.25}
#signatureCropCanvas{
  width:100%;
  height:260px;
  border:1px solid #334155;
  border-radius:10px;
  background:#0b1220;
  touch-action:none;
  cursor:crosshair;
}
.signature-crop-actions{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:8px;
}
.signature-preview-label{
  color:#cbd5e1;
  font-size:12px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.04em;
  margin:8px 0 5px;
}
body.theme-light .signature-crop-editor{background:#f8fafc;border-color:#cbd5e1}
body.theme-light .signature-crop-header strong{color:#0f172a}
body.theme-light .signature-crop-header span,body.theme-light .signature-preview-label{color:#475569}
body.theme-light #signatureCropCanvas{background:#e2e8f0;border-color:#cbd5e1}
@media(max-width:700px){
  #signatureCropCanvas{height:220px}
  .signature-crop-actions .btn{flex:1 1 45%}
}


/* Final signature size after crop/background cleanup */
.signature-final-size{
  display:grid;
  grid-template-columns:auto 1fr auto auto auto;
  align-items:center;
  gap:10px;
  margin:10px 0 6px;
  padding:9px 10px;
  border:1px solid #263a56;
  border-radius:12px;
  background:#0b1220;
}
.signature-final-size.hidden{display:none!important}
.signature-final-size label{margin:0;color:#cbd5e1;font-weight:900;font-size:13px;white-space:nowrap}
.signature-final-size input[type="range"]{width:100%;accent-color:#60a5fa}
.signature-final-size #signatureSizeValue{color:#e2e8f0;font-weight:900;min-width:44px;text-align:center}
body.theme-light .signature-final-size{background:#f8fafc;border-color:#cbd5e1}
body.theme-light .signature-final-size label{color:#334155}
body.theme-light .signature-final-size #signatureSizeValue{color:#0f172a}
@media(max-width:700px){
  .signature-final-size{grid-template-columns:1fr;align-items:stretch}
  .signature-final-size #signatureSizeValue{text-align:left}
  .signature-final-size .btn{width:100%}
}

/* Logbook bookshelf + scanned dives book update */
.logbook-app{grid-template-columns:310px 1fr}
.logbook-sidebar{transition:width .18s ease, padding .18s ease;z-index:8}
.logbook-menu-head{gap:10px;justify-content:flex-start;align-items:center}
.logbook-menu-head .menu-toggle{flex:none;width:40px;height:40px;font-size:20px;font-weight:900}
.sidebar-title-block{display:flex;flex-direction:column;min-width:0}.sidebar-title-block strong{font-size:16px}.sidebar-title-block span{font-size:12px;color:#94a3b8}
.sidebar-body{display:block}.book-control-group{margin-top:12px}.side-bottom-hint{margin-top:16px}.view-switcher{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:12px}.view-tab{border:1px solid #334968;background:#111f35;color:#dbe7f6;border-radius:12px;padding:9px 10px;font-weight:800;cursor:pointer}.view-tab.active,.btn.active{background:#1d4ed8;color:#fff;border-color:#3b82f6}.book-area{background:radial-gradient(circle at center,#27364d,#111827 62%,#070d18)}
.logbook-app.sidebar-collapsed{grid-template-columns:56px 1fr!important}.logbook-app.sidebar-collapsed .logbook-sidebar{padding:10px 7px!important;transform:none!important;overflow:hidden;border-right:1px solid var(--line)!important}.logbook-app.sidebar-collapsed .sidebar-body,.logbook-app.sidebar-collapsed .sidebar-title-block{display:none!important}.logbook-app.sidebar-collapsed .logbook-menu-head{margin:0;justify-content:center}.logbook-app.sidebar-collapsed .menu-toggle{width:40px;height:40px}
.bookshelf-panel{display:grid;grid-template-columns:repeat(2,minmax(240px,360px));gap:28px;align-content:center;justify-content:center;height:100%;padding:30px;overflow:auto}.bookshelf-card{background:rgba(15,27,45,.94);border:1px solid #263a56;border-radius:24px;padding:22px;box-shadow:0 18px 50px rgba(0,0,0,.32);cursor:pointer;transition:transform .15s ease,border-color .15s ease}.bookshelf-card:hover,.bookshelf-card:focus{transform:translateY(-4px);border-color:#60a5fa;outline:0}.bookshelf-card h2{margin:16px 0 6px}.bookshelf-card p{margin:0;color:#cbd5e1;line-height:1.45}.book-cover{height:320px;border-radius:12px 22px 22px 12px;box-shadow:inset 10px 0 18px rgba(0,0,0,.22),0 18px 35px rgba(0,0,0,.28);border:1px solid rgba(255,255,255,.18);display:flex;flex-direction:column;justify-content:space-between;padding:22px;text-align:center;color:#fff;position:relative;overflow:hidden}.book-cover:before{content:"";position:absolute;left:26px;top:0;bottom:0;width:2px;background:rgba(255,255,255,.2)}.dive-cover{background:linear-gradient(145deg,#152238,#0f3a5d 52%,#07111f)}.scans-cover{background:linear-gradient(145deg,#3b2414,#7c3f16 50%,#1f130c)}.cover-band{font-size:12px;letter-spacing:.14em;font-weight:900;opacity:.82}.cover-title{font-size:34px;font-weight:900;line-height:1.05;margin:auto 0}.cover-subtitle{font-size:13px;font-weight:800;opacity:.86}.scanned-book-panel{display:flex;flex-direction:column;height:100%;min-height:0}.scan-book-view{display:flex;flex-direction:column;height:100%;min-height:0}.scan-page-frame{flex:1;overflow:auto;padding:22px;display:flex;align-items:flex-start;justify-content:center}.scan-page{width:min(900px,100%);min-height:calc(100vh - 180px);background:#fffdf7;color:#111827;border-radius:10px;box-shadow:0 22px 55px rgba(0,0,0,.38);border:1px solid #d8d2c1;padding:18px}.scan-page-header{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;border-bottom:2px solid #111827;padding-bottom:10px;margin-bottom:14px}.scan-page-header h2{margin:0;font-size:22px}.scan-page-header p{margin:4px 0 0;color:#374151}.scan-page-header span{font-weight:900;border:2px solid #111827;padding:4px 8px}.scan-image-wrap{display:flex;justify-content:center;align-items:flex-start;background:#f3f4f6;border:1px solid #d1d5db;min-height:420px;overflow:auto}.scan-image-wrap img{max-width:100%;height:auto;display:block}.scan-page-notes{margin-top:12px;border-top:1px solid #111827;padding-top:8px;white-space:pre-wrap}.empty-scan-page{width:min(760px,100%);margin:auto;background:rgba(15,27,45,.94);border:1px dashed #475569;border-radius:22px;padding:32px;text-align:center;color:#dbe7f6}.scan-list-view{height:100%;overflow:auto;padding:22px}.scan-upload-label{background:#0b1728;border:1px dashed #475569;border-radius:12px;padding:10px;cursor:pointer}.scan-upload-label input{margin-top:8px;background:#08111f}.hidden{display:none!important}
body.theme-light .bookshelf-card,body.theme-light .empty-scan-page{background:#f8fafc;border-color:#cbd5e1;color:#0f172a}body.theme-light .bookshelf-card p{color:#475569}body.theme-light .view-tab{background:#f8fafc;color:#0f172a;border-color:#cbd5e1}body.theme-light .book-area{background:radial-gradient(circle at center,#dbeafe,#f8fafc 65%,#e2e8f0)}body.theme-light .scan-upload-label{background:#f8fafc;border-color:#cbd5e1}
@media(max-width:900px){.bookshelf-panel{grid-template-columns:1fr;padding:18px}.book-cover{height:260px}.cover-title{font-size:28px}.logbook-app{grid-template-columns:280px 1fr}.logbook-app.sidebar-collapsed{grid-template-columns:52px 1fr!important}}
@media print{.bookshelf-panel,.scanned-book-panel{display:none!important}}
.logbook-app.sidebar-collapsed .logbook-sidebar{width:56px!important;min-width:56px!important;position:relative!important}

/* Real open-book view + full-area page fit update */
.book-status{
  display:none!important;
}
.book-view-panel{
  height:100%;
  min-height:0;
  display:flex;
  flex-direction:column;
}
.book-scroll{
  flex:1;
  min-height:0;
  overflow:auto;
  padding:10px 14px 8px!important;
  display:flex;
  align-items:center;
  justify-content:center;
  touch-action:pan-y;
  cursor:grab;
  background:
    radial-gradient(circle at center,rgba(80,103,134,.22),rgba(13,23,38,.75) 55%,rgba(2,6,13,.98)),
    linear-gradient(155deg,#07111f,#142238 55%,#06101d)!important;
}
.book-scroll.swiping{cursor:grabbing;user-select:none}
.book-spread.real-open-book{
  --book-cover:#101a2c;
  position:relative;
  display:flex;
  align-items:stretch;
  justify-content:center;
  gap:0!important;
  width:max-content;
  max-width:none;
  padding:16px 18px 20px;
  border-radius:26px 26px 20px 20px;
  background:
    linear-gradient(90deg,rgba(0,0,0,.42),rgba(255,255,255,.08) 3%,transparent 8%,transparent 92%,rgba(255,255,255,.08) 97%,rgba(0,0,0,.42)),
    linear-gradient(145deg,#08111f,#15243a 48%,#07101d);
  box-shadow:
    0 32px 90px rgba(0,0,0,.62),
    0 0 0 2px rgba(148,163,184,.18),
    inset 0 0 0 4px rgba(0,0,0,.32),
    inset 0 0 38px rgba(255,255,255,.06);
  transform:none!important;
  transform-origin:center center;
}
.book-spread.real-open-book:before{
  content:"";
  position:absolute;
  left:50%;
  top:14px;
  bottom:18px;
  width:34px;
  transform:translateX(-50%);
  border-radius:50%;
  background:
    radial-gradient(ellipse at center,rgba(0,0,0,.46) 0%,rgba(0,0,0,.24) 38%,rgba(255,255,255,.09) 58%,rgba(0,0,0,.20) 78%,transparent 100%);
  box-shadow:
    inset 8px 0 18px rgba(0,0,0,.26),
    inset -8px 0 18px rgba(255,255,255,.08);
  pointer-events:none;
  z-index:3;
}
.book-spread.real-open-book:after{
  content:"";
  position:absolute;
  inset:10px 12px 14px;
  border-radius:22px;
  pointer-events:none;
  box-shadow:
    inset 13px 0 15px rgba(255,255,255,.12),
    inset -13px 0 15px rgba(255,255,255,.10),
    inset 0 -14px 18px rgba(0,0,0,.26);
  z-index:5;
}
.book-spread.real-open-book .log-page{
  transform:none!important;
  zoom:var(--page-scale,.78);
  margin:0!important;
  border:1px solid #d0c6ae!important;
  box-shadow:
    0 18px 44px rgba(0,0,0,.32),
    inset 0 0 28px rgba(116,89,52,.10)!important;
  z-index:2;
}
.book-spread.real-open-book .log-page.left{
  border-radius:15px 2px 2px 15px!important;
  transform-origin:right center!important;
}
.book-spread.real-open-book .log-page.right{
  border-radius:2px 15px 15px 2px!important;
  transform-origin:left center!important;
}
.book-spread.real-open-book .log-page.left:before{
  content:"";
  position:absolute;
  left:-12px;
  top:8px;
  bottom:8px;
  width:12px;
  border-radius:12px 0 0 12px;
  background:repeating-linear-gradient(to right,#f4efdf 0,#f4efdf 1px,#c9bea8 2px,#f9f4e7 4px);
  box-shadow:-4px 0 11px rgba(0,0,0,.26);
  pointer-events:none;
}
.book-spread.real-open-book .log-page.right:after{
  content:"";
  position:absolute;
  right:-12px;
  top:8px;
  bottom:8px;
  width:12px;
  border-radius:0 12px 12px 0;
  background:repeating-linear-gradient(to right,#c9bea8 0,#f9f4e7 2px,#f4efdf 4px);
  box-shadow:4px 0 11px rgba(0,0,0,.26);
  pointer-events:none;
}
.book-spread.real-open-book .log-page.left:after{
  width:44px!important;
  right:-1px!important;
  background:linear-gradient(90deg,rgba(0,0,0,.03),rgba(0,0,0,.17),rgba(255,255,255,.20),rgba(0,0,0,.18))!important;
  z-index:4;
}
.book-spread.real-open-book .log-page.right:before{
  width:44px!important;
  left:-1px!important;
  background:linear-gradient(90deg,rgba(0,0,0,.22),rgba(255,255,255,.18),rgba(0,0,0,.12),rgba(0,0,0,.03))!important;
  z-index:4;
}
.book-spread.real-open-book.single:before{
  display:none;
}
.book-spread.real-open-book.single .log-page.left,
.book-spread.real-open-book.single .log-page.right{
  border-radius:15px!important;
}
.book-nav{
  min-height:52px;
  padding:9px 12px!important;
  background:linear-gradient(180deg,#0b1728,#07111f)!important;
  box-shadow:0 -12px 28px rgba(0,0,0,.20);
}
.book-nav .page-arrow{
  min-width:46px;
  height:38px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
body.theme-light .book-scroll{
  background:
    radial-gradient(circle at center,rgba(191,219,254,.55),rgba(226,232,240,.88) 58%,rgba(203,213,225,.98)),
    linear-gradient(155deg,#dbeafe,#f8fafc 62%,#cbd5e1)!important;
}
body.theme-light .book-spread.real-open-book{
  background:
    linear-gradient(90deg,rgba(71,85,105,.28),rgba(255,255,255,.40) 3%,transparent 8%,transparent 92%,rgba(255,255,255,.42) 97%,rgba(71,85,105,.28)),
    linear-gradient(145deg,#d6dee9,#eef5ff 48%,#cbd5e1);
  box-shadow:0 30px 80px rgba(71,85,105,.35),0 0 0 2px rgba(100,116,139,.22),inset 0 0 0 4px rgba(255,255,255,.35);
}
@media(max-width:900px){
  .book-scroll{align-items:flex-start;justify-content:flex-start;padding:10px!important}
  .book-spread.real-open-book{padding:10px 12px 14px}
}
@media print{
  .book-spread.real-open-book{background:none!important;box-shadow:none!important;padding:0!important;display:block!important}
  .book-spread.real-open-book:before,.book-spread.real-open-book:after{display:none!important}
  .book-spread.real-open-book .log-page{zoom:1!important;box-shadow:none!important}
}


/* Final logbook polish: softer book center + true current-page letter print */
.book-spread.real-open-book:before{
  width:16px!important;
  top:18px!important;
  bottom:22px!important;
  background:linear-gradient(90deg,rgba(0,0,0,.10),rgba(255,255,255,.22) 42%,rgba(0,0,0,.08) 58%,rgba(255,255,255,.12))!important;
  box-shadow:inset 3px 0 8px rgba(0,0,0,.12),inset -3px 0 8px rgba(255,255,255,.10)!important;
  opacity:.55!important;
}
.book-spread.real-open-book .log-page.left:after{
  width:22px!important;
  right:-1px!important;
  background:linear-gradient(90deg,rgba(0,0,0,.02),rgba(0,0,0,.08),rgba(255,255,255,.16),rgba(0,0,0,.07))!important;
  opacity:.62!important;
}
.book-spread.real-open-book .log-page.right:before{
  width:22px!important;
  left:-1px!important;
  background:linear-gradient(90deg,rgba(0,0,0,.08),rgba(255,255,255,.16),rgba(0,0,0,.06),rgba(0,0,0,.02))!important;
  opacity:.62!important;
}
.book-spread.real-open-book:after{
  box-shadow:inset 8px 0 12px rgba(255,255,255,.08),inset -8px 0 12px rgba(255,255,255,.08),inset 0 -10px 14px rgba(0,0,0,.18)!important;
}
body.theme-light .book-spread.real-open-book:before{
  background:linear-gradient(90deg,rgba(71,85,105,.12),rgba(255,255,255,.50) 45%,rgba(71,85,105,.10) 58%,rgba(255,255,255,.28))!important;
  opacity:.60!important;
}

@page{size:8.5in 11in;margin:0}
@media print{
  html,body{width:8.5in!important;height:11in!important;margin:0!important;padding:0!important;background:#fff!important;overflow:hidden!important}
  body.print-current-logbook-page{background:#fff!important;-webkit-print-color-adjust:exact;print-color-adjust:exact}
  body.print-current-logbook-page .app-header,
  body.print-current-logbook-page .logbook-sidebar,
  body.print-current-logbook-page .book-status,
  body.print-current-logbook-page .book-nav,
  body.print-current-logbook-page .bookshelf-panel,
  body.print-current-logbook-page .list-view-panel,
  body.print-current-logbook-page .scanned-book-panel,
  body.print-current-logbook-page .modal-backdrop{display:none!important}
  body.print-current-logbook-page .app-shell,
  body.print-current-logbook-page main,
  body.print-current-logbook-page .logbook-app,
  body.print-current-logbook-page .book-area,
  body.print-current-logbook-page .book-view-panel,
  body.print-current-logbook-page .book-scroll,
  body.print-current-logbook-page .book-spread{
    display:block!important;
    position:static!important;
    width:8.5in!important;
    height:11in!important;
    min-height:11in!important;
    margin:0!important;
    padding:0!important;
    overflow:visible!important;
    background:#fff!important;
    box-shadow:none!important;
    border:0!important;
    transform:none!important;
  }
  body.print-current-logbook-page .book-spread.real-open-book,
  body.print-current-logbook-page .book-spread.real-open-book.open-book,
  body.print-current-logbook-page .book-spread.real-open-book.single{
    display:block!important;
    width:8.5in!important;
    height:11in!important;
    padding:0!important;
    border-radius:0!important;
    background:#fff!important;
    box-shadow:none!important;
  }
  body.print-current-logbook-page .book-spread.real-open-book:before,
  body.print-current-logbook-page .book-spread.real-open-book:after,
  body.print-current-logbook-page .log-page:before,
  body.print-current-logbook-page .log-page:after,
  body.print-current-logbook-page .page-corner{display:none!important}
  body.print-current-logbook-page .log-page{display:none!important}
  body.print-current-logbook-page .log-page.print-target,
  body.print-current-logbook-page .record-of-dive-page.print-target{
    display:block!important;
    position:fixed!important;
    left:0!important;
    top:0!important;
    width:8.5in!important;
    height:11in!important;
    min-height:11in!important;
    max-height:11in!important;
    margin:0!important;
    padding:28px 30px 24px!important;
    box-sizing:border-box!important;
    transform:none!important;
    zoom:1!important;
    color:#000!important;
    background:#fff!important;
    box-shadow:none!important;
    border:0!important;
    border-radius:0!important;
    overflow:hidden!important;
    page-break-before:avoid!important;
    page-break-after:avoid!important;
    page-break-inside:avoid!important;
    break-before:avoid!important;
    break-after:avoid!important;
    break-inside:avoid!important;
    -webkit-print-color-adjust:exact;
    print-color-adjust:exact;
  }
  body.print-current-logbook-page .record-of-dive-page.print-target.selected,
  body.print-current-logbook-page .record-of-dive-page.print-target.edit-mode,
  body.print-current-logbook-page .record-of-dive-page.print-target.locked{
    box-shadow:none!important;
  }
  body.print-current-logbook-page .record-of-dive-page.print-target input,
  body.print-current-logbook-page .record-of-dive-page.print-target textarea{
    color:#000!important;
    -webkit-text-fill-color:#000!important;
  }
}

/* Final print layout correction: keep the printed page in the same desktop/book layout */
@page{size:8.5in 11in;margin:0}
@media print{
  html,body{
    width:8.5in!important;
    height:11in!important;
    margin:0!important;
    padding:0!important;
    background:#fff!important;
    overflow:hidden!important;
  }
  body.print-current-logbook-page{
    background:#fff!important;
    -webkit-print-color-adjust:exact!important;
    print-color-adjust:exact!important;
  }
  body.print-current-logbook-page .app-header,
  body.print-current-logbook-page .logbook-sidebar,
  body.print-current-logbook-page .book-status,
  body.print-current-logbook-page .book-nav,
  body.print-current-logbook-page .bookshelf-panel,
  body.print-current-logbook-page .list-view-panel,
  body.print-current-logbook-page .scanned-book-panel,
  body.print-current-logbook-page .modal-backdrop,
  body.print-current-logbook-page .page-corner{
    display:none!important;
  }
  body.print-current-logbook-page .app-shell,
  body.print-current-logbook-page main,
  body.print-current-logbook-page .logbook-app,
  body.print-current-logbook-page .book-area,
  body.print-current-logbook-page .book-view-panel,
  body.print-current-logbook-page .book-scroll,
  body.print-current-logbook-page .book-spread,
  body.print-current-logbook-page .book-spread.real-open-book,
  body.print-current-logbook-page .book-spread.real-open-book.open-book,
  body.print-current-logbook-page .book-spread.real-open-book.single{
    display:block!important;
    position:static!important;
    width:8.5in!important;
    height:11in!important;
    min-height:11in!important;
    max-height:11in!important;
    margin:0!important;
    padding:0!important;
    overflow:hidden!important;
    background:#fff!important;
    border:0!important;
    border-radius:0!important;
    box-shadow:none!important;
    transform:none!important;
  }
  body.print-current-logbook-page .book-spread.real-open-book:before,
  body.print-current-logbook-page .book-spread.real-open-book:after,
  body.print-current-logbook-page .log-page:before,
  body.print-current-logbook-page .log-page:after{
    display:none!important;
    content:none!important;
  }
  body.print-current-logbook-page .log-page{
    display:none!important;
  }
  body.print-current-logbook-page .log-page.print-target,
  body.print-current-logbook-page .record-of-dive-page.print-target{
    display:block!important;
    position:fixed!important;
    left:.18in!important;
    top:.14in!important;
    width:720px!important;
    height:930px!important;
    min-height:930px!important;
    max-height:930px!important;
    margin:0!important;
    padding:24px 28px 20px!important;
    box-sizing:border-box!important;
    color:#000!important;
    background:#fffef9!important;
    border:0!important;
    border-radius:0!important;
    box-shadow:none!important;
    overflow:hidden!important;
    transform:scale(1.08)!important;
    transform-origin:top left!important;
    zoom:1!important;
    page-break-before:avoid!important;
    page-break-after:avoid!important;
    page-break-inside:avoid!important;
    break-before:avoid!important;
    break-after:avoid!important;
    break-inside:avoid!important;
    -webkit-print-color-adjust:exact!important;
    print-color-adjust:exact!important;
  }

  /* Override mobile/responsive rules that were forcing print into a stacked layout. */
  body.print-current-logbook-page .record-of-dive-page.print-target .record-header{
    display:grid!important;
    grid-template-columns:1.05fr 1.18fr 1fr!important;
    gap:12px!important;
    align-items:start!important;
    margin-bottom:6px!important;
  }
  body.print-current-logbook-page .record-of-dive-page.print-target .reference-right-lines{
    display:grid!important;
    gap:18px!important;
    padding-top:20px!important;
  }
  body.print-current-logbook-page .record-of-dive-page.print-target .reference-lower-grid{
    display:grid!important;
    grid-template-columns:1fr 146px!important;
    gap:12px!important;
    align-items:start!important;
  }
  body.print-current-logbook-page .record-of-dive-page.print-target .type-of-dive-box{
    max-width:none!important;
    width:auto!important;
    margin-top:8px!important;
  }
  body.print-current-logbook-page .record-of-dive-page.print-target .record-top-grid{
    display:grid!important;
    grid-template-columns:1fr!important;
  }
  body.print-current-logbook-page .record-of-dive-page.print-target .reference-dive-grid{
    display:grid!important;
    grid-template-columns:1.23fr repeat(3,1fr)!important;
  }
  body.print-current-logbook-page .record-of-dive-page.print-target .signature-date-row{
    display:grid!important;
    grid-template-columns:1fr 110px!important;
    gap:18px!important;
    align-items:end!important;
  }
  body.print-current-logbook-page .record-of-dive-page.print-target input,
  body.print-current-logbook-page .record-of-dive-page.print-target textarea{
    color:#000!important;
    -webkit-text-fill-color:#000!important;
  }
}

/* Letter print safety fix: default to 8.5 x 11 and keep page inside printable area */
@page{
  size: letter portrait;
  margin: 0.25in;
}
@media print{
  /* Do not let older print rules force the page into legal-size/cutoff dimensions. */
  html,
  body{
    width:auto!important;
    height:auto!important;
    min-width:0!important;
    min-height:0!important;
    margin:0!important;
    padding:0!important;
    overflow:visible!important;
    background:#fff!important;
    -webkit-print-color-adjust:exact!important;
    print-color-adjust:exact!important;
  }

  body.print-current-logbook-page .app-header,
  body.print-current-logbook-page .logbook-sidebar,
  body.print-current-logbook-page .book-status,
  body.print-current-logbook-page .book-nav,
  body.print-current-logbook-page .bookshelf-panel,
  body.print-current-logbook-page .list-view-panel,
  body.print-current-logbook-page .scanned-book-panel,
  body.print-current-logbook-page .modal-backdrop,
  body.print-current-logbook-page .page-corner,
  body.print-current-logbook-page .book-spread.real-open-book:before,
  body.print-current-logbook-page .book-spread.real-open-book:after,
  body.print-current-logbook-page .log-page:before,
  body.print-current-logbook-page .log-page:after{
    display:none!important;
    content:none!important;
  }

  body.print-current-logbook-page .app-shell,
  body.print-current-logbook-page main,
  body.print-current-logbook-page .logbook-app,
  body.print-current-logbook-page .book-area,
  body.print-current-logbook-page .book-view-panel,
  body.print-current-logbook-page .book-scroll,
  body.print-current-logbook-page .book-spread,
  body.print-current-logbook-page .book-spread.real-open-book,
  body.print-current-logbook-page .book-spread.real-open-book.open-book,
  body.print-current-logbook-page .book-spread.real-open-book.single{
    display:block!important;
    position:static!important;
    width:auto!important;
    height:auto!important;
    min-width:0!important;
    min-height:0!important;
    max-width:none!important;
    max-height:none!important;
    margin:0!important;
    padding:0!important;
    overflow:visible!important;
    background:#fff!important;
    border:0!important;
    border-radius:0!important;
    box-shadow:none!important;
    transform:none!important;
  }

  body.print-current-logbook-page .log-page{
    display:none!important;
  }

  body.print-current-logbook-page .log-page.print-target,
  body.print-current-logbook-page .record-of-dive-page.print-target{
    display:block!important;
    position:relative!important;
    left:auto!important;
    top:auto!important;
    right:auto!important;
    bottom:auto!important;
    /* Fits inside letter with 0.25in page margins so printer non-printable edges do not cut the form. */
    width:7.85in!important;
    height:10.15in!important;
    min-height:10.15in!important;
    max-height:10.15in!important;
    margin:0 auto!important;
    padding:0.22in 0.25in 0.18in!important;
    box-sizing:border-box!important;
    color:#000!important;
    background:#fffef9!important;
    border:0!important;
    border-radius:0!important;
    box-shadow:none!important;
    overflow:hidden!important;
    transform:none!important;
    zoom:1!important;
    page-break-before:avoid!important;
    page-break-after:avoid!important;
    page-break-inside:avoid!important;
    break-before:avoid!important;
    break-after:avoid!important;
    break-inside:avoid!important;
    -webkit-print-color-adjust:exact!important;
    print-color-adjust:exact!important;
  }

  /* Keep the desktop/book form layout in print. */
  body.print-current-logbook-page .record-of-dive-page.print-target .record-header{
    display:grid!important;
    grid-template-columns:1.05fr 1.18fr 1fr!important;
    gap:12px!important;
    align-items:start!important;
    margin-bottom:6px!important;
  }
  body.print-current-logbook-page .record-of-dive-page.print-target .reference-right-lines{
    display:grid!important;
    gap:18px!important;
    padding-top:20px!important;
  }
  body.print-current-logbook-page .record-of-dive-page.print-target .reference-lower-grid{
    display:grid!important;
    grid-template-columns:1fr 146px!important;
    gap:12px!important;
    align-items:start!important;
  }
  body.print-current-logbook-page .record-of-dive-page.print-target .type-of-dive-box{
    max-width:none!important;
    width:auto!important;
    margin-top:8px!important;
  }
  body.print-current-logbook-page .record-of-dive-page.print-target .record-top-grid{
    display:grid!important;
    grid-template-columns:1fr!important;
  }
  body.print-current-logbook-page .record-of-dive-page.print-target .reference-dive-grid{
    display:grid!important;
    grid-template-columns:1.23fr repeat(3,1fr)!important;
  }
  body.print-current-logbook-page .record-of-dive-page.print-target .signature-date-row{
    display:grid!important;
    grid-template-columns:1fr 110px!important;
    gap:18px!important;
    align-items:end!important;
  }
  body.print-current-logbook-page .record-of-dive-page.print-target input,
  body.print-current-logbook-page .record-of-dive-page.print-target textarea{
    color:#000!important;
    -webkit-text-fill-color:#000!important;
  }
}

/* Calendar linked day-view and modal update */
.calendar-card{
  background:linear-gradient(180deg,#10223a,#0c1a2d)!important;
  border-color:#355278!important;
  box-shadow:0 18px 45px rgba(0,0,0,.22);
}
.calendar-head{
  background:linear-gradient(180deg,#1e3a5f,#132a48)!important;
  color:#f8fbff!important;
  border-color:#4b6f9d!important;
  text-shadow:0 1px 1px rgba(0,0,0,.35);
}
.calendar-day{
  color:#dcecff!important;
  background:linear-gradient(180deg,#132a48,#0e2038)!important;
  border-color:#36567e!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.04),0 8px 18px rgba(0,0,0,.13);
  transition:.16s ease;
}
.calendar-day strong{
  color:#ffffff!important;
  font-size:15px;
  text-shadow:0 1px 2px rgba(0,0,0,.55);
}
.calendar-day:hover{
  border-color:#60a5fa!important;
  background:linear-gradient(180deg,#1b3f69,#123157)!important;
  transform:translateY(-1px);
}
.calendar-day.today{
  outline:2px solid #60a5fa!important;
  box-shadow:0 0 0 4px rgba(96,165,250,.14), inset 0 1px 0 rgba(255,255,255,.05);
}
.calendar-day.selected{
  border-color:#93c5fd!important;
  background:linear-gradient(180deg,#245c9a,#184a82)!important;
  box-shadow:0 0 0 3px rgba(59,130,246,.3),0 14px 26px rgba(0,0,0,.2);
}
.calendar-day.has-entries .day-icons span{
  background:#dbeafe;
  color:#0f2a4c;
  border:1px solid #93c5fd;
  border-radius:999px;
  padding:2px 6px;
  font-size:11px;
  font-weight:900;
}
.calendar-empty{min-height:94px}.calendar-day-panel{border-color:#355278!important;background:linear-gradient(180deg,#10223a,#0d1b2e)!important}.day-entry-list{display:grid;gap:8px}.entry-row{display:flex;gap:9px;align-items:flex-start;text-decoration:none;border:1px solid #314966;background:#101f35;color:#e5f1ff;border-radius:12px;padding:10px}.entry-row:hover{border-color:#60a5fa;background:#172d4a}.entry-row span{display:grid;gap:2px}.entry-row strong{color:#fff;font-size:13px}.entry-row small{color:#b9c9df;font-size:12px}.calendar-modal-backdrop{position:fixed;z-index:200;inset:0;background:rgba(2,6,23,.72);display:flex;align-items:flex-start;justify-content:center;padding:28px 16px;overflow:auto}.calendar-modal{width:min(980px,100%);background:#0f1b2d;border:1px solid #355278;border-radius:22px;box-shadow:0 30px 80px rgba(0,0,0,.45);padding:18px;color:#dbe7f6}.calendar-modal-head{display:flex;justify-content:space-between;gap:12px;align-items:flex-start;border-bottom:1px solid #263a56;padding-bottom:12px;margin-bottom:14px}.calendar-modal-head h2{margin:0}.calendar-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.calendar-form-grid label{display:grid;gap:5px;font-weight:800;font-size:12px;color:#cbd5e1}.calendar-form-grid input,.calendar-form-grid select,.calendar-form-grid textarea{width:100%;background:#08111f;border:1px solid #334968;border-radius:10px;color:#e5f1ff;padding:10px}.calendar-form-grid textarea{resize:vertical}.wide-field{grid-column:1/-1}.calendar-check-row{display:flex!important;grid-template-columns:auto 1fr;align-items:center;gap:8px}.calendar-check-row input{width:auto}.calendar-modal-actions{grid-column:1/-1;display:flex;gap:10px;justify-content:flex-end;margin-top:8px}.calendar-pay-work-card{display:grid;gap:12px}.calendar-pay-grid input,.calendar-pay-grid select{background:#08111f;color:#e5f1ff;border-color:#334968}.calendar-pay-totals{margin-top:0}.calendar-panel-actions .btn{width:100%}
body.theme-light .calendar-card{background:#ffffff!important;border-color:#cbd5e1!important}body.theme-light .calendar-head{background:#e8f2ff!important;color:#0f172a!important;border-color:#bfdbfe!important;text-shadow:none}body.theme-light .calendar-day{background:linear-gradient(180deg,#ffffff,#edf6ff)!important;color:#0f172a!important;border-color:#bfdbfe!important}body.theme-light .calendar-day strong{color:#0f172a!important;text-shadow:none}body.theme-light .calendar-day.selected{background:linear-gradient(180deg,#dbeafe,#bfdbfe)!important}body.theme-light .calendar-day-panel{background:#ffffff!important;border-color:#cbd5e1!important}body.theme-light .entry-row{background:#f8fafc;border-color:#cbd5e1;color:#0f172a}body.theme-light .entry-row strong{color:#0f172a}body.theme-light .entry-row small{color:#475569}body.theme-light .calendar-modal{background:#ffffff;color:#0f172a;border-color:#cbd5e1}body.theme-light .calendar-form-grid label{color:#334155}body.theme-light .calendar-form-grid input,body.theme-light .calendar-form-grid select,body.theme-light .calendar-form-grid textarea,body.theme-light .calendar-pay-grid input,body.theme-light .calendar-pay-grid select{background:#ffffff;color:#0f172a;border-color:#cbd5e1}
@media(max-width:720px){.calendar-form-grid{grid-template-columns:1fr}.calendar-modal-actions{justify-content:stretch;flex-direction:column}.calendar-layout{grid-template-columns:1fr}}

/* Stronger Letter-size print/export default. Browser/printer dialogs may still remember a driver setting, but the page CSS requests Letter portrait. */
@page{size:Letter portrait;margin:0!important}
@page :first{size:Letter portrait;margin:0!important}
@media print{
  html,body{width:8.5in!important;min-width:8.5in!important;max-width:8.5in!important;height:11in!important;min-height:11in!important;background:#fff!important;overflow:hidden!important}
  body.print-current-logbook-page{width:8.5in!important;height:11in!important;margin:0!important;padding:0!important}
  body.print-current-logbook-page .log-page.print-target,
  body.print-current-logbook-page .record-of-dive-page.print-target{
    width:8.0in!important;
    height:10.45in!important;
    min-height:10.45in!important;
    max-height:10.45in!important;
    margin:.18in auto 0 auto!important;
    overflow:hidden!important;
    transform:none!important;
    page-break-before:avoid!important;
    page-break-after:avoid!important;
    page-break-inside:avoid!important;
  }
}

/* Calendar same-tab day view + linked modal updates */
.calendar-stacked-layout{display:grid;gap:16px}
.calendar-stacked-layout.day-open .calendar-card{max-width:100%;padding:14px}
.calendar-stacked-layout.day-open .calendar-top{margin-bottom:8px}
.calendar-stacked-layout.day-open .calendar-grid{gap:5px}
.calendar-stacked-layout.day-open .calendar-day,.calendar-stacked-layout.day-open .calendar-empty{min-height:54px;border-radius:10px;padding:5px;text-align:left}
.calendar-stacked-layout.day-open .calendar-day strong{font-size:13px;margin-bottom:2px;color:#eff6ff}
.calendar-stacked-layout.day-open .day-icons{font-size:10px;line-height:1.2;gap:2px}
.calendar-day-detail-card{position:static!important;top:auto!important;height:auto!important;background:linear-gradient(180deg,#10223a,#0d1b2e)!important;border-color:#355278!important}
.day-panel-head{display:flex;justify-content:space-between;gap:14px;align-items:flex-start;margin-bottom:12px;border-bottom:1px solid #263a56;padding-bottom:12px}
.day-panel-head h3{margin:0 0 4px}.calendar-panel-actions{grid-template-columns:repeat(5,minmax(120px,1fr))}.calendar-panel-actions .btn{width:100%}
.calendar-pay-section{display:grid;gap:10px;background:rgba(15,31,53,.55);border:1px solid #263a56;border-radius:16px;padding:12px}.calendar-pay-section h3{margin:0;color:#e5f1ff;font-size:14px;letter-spacing:.02em}.calendar-pay-section .pay-screenshot-grid{margin:0}.record-dive-modal-mode{padding:12px 8px}.record-dive-modal-mode .calendar-modal{width:min(1180px,100%);padding:14px}.calendar-record-dive-form{display:grid;gap:12px}.calendar-record-dive-scroll{overflow:auto;max-height:calc(100vh - 170px);padding:10px;background:#111827;border:1px solid #263a56;border-radius:16px}.calendar-record-dive-page{margin:0 auto!important;transform:none!important;box-shadow:0 18px 45px rgba(0,0,0,.35)!important}.record-dive-actions{position:sticky;bottom:0;background:rgba(15,27,45,.96);padding-top:10px}.calendar-record-dive-page .page-corner{display:none!important}
body.theme-light .calendar-day-detail-card{background:#ffffff!important;border-color:#cbd5e1!important}body.theme-light .calendar-pay-section{background:#f8fafc;border-color:#cbd5e1}body.theme-light .calendar-pay-section h3{color:#0f172a}body.theme-light .calendar-record-dive-scroll{background:#e2e8f0;border-color:#cbd5e1}body.theme-light .record-dive-actions{background:rgba(255,255,255,.96)}body.theme-light .calendar-stacked-layout.day-open .calendar-day strong{color:#0f172a}
@media(max-width:900px){.calendar-panel-actions{grid-template-columns:1fr 1fr}.day-panel-head{flex-direction:column}.calendar-stacked-layout.day-open .calendar-day,.calendar-stacked-layout.day-open .calendar-empty{min-height:64px}.record-dive-modal-mode .calendar-modal{width:100%}.calendar-record-dive-scroll{max-height:calc(100vh - 190px)}}

/* Calendar weekly view + always-visible month entries */
.calendar-main-toolbar{flex-wrap:wrap}.segmented-control{display:flex;gap:6px;align-items:center}.segmented-control .btn.active{background:linear-gradient(180deg,#2563eb,#1d4ed8);color:#fff;border-color:#60a5fa}.calendar-filter-bar{display:flex;flex-wrap:wrap;gap:10px;margin:0 0 14px;background:#0f1b2d;border:1px solid #263a56;border-radius:16px;padding:10px 12px}.calendar-filter-bar label{display:flex;align-items:center;gap:6px;font-size:12px;font-weight:850;color:#cbd5e1}.calendar-filter-bar input{accent-color:#60a5fa}.calendar-view-pane.active{display:block}.calendar-day{min-height:136px;text-align:left;overflow:hidden}.calendar-day .day-summary-line{min-height:15px;font-size:10px;color:#93c5fd;font-weight:800;margin:-2px 0 5px}.day-entry-chips{display:grid;gap:3px;align-content:start}.calendar-chip{display:block;border:1px solid rgba(255,255,255,.12);border-radius:8px;padding:3px 5px;font-size:10px;line-height:1.12;font-weight:800;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.chip-dive,.week-dive,.entry-dive{background:rgba(14,165,233,.18)!important;border-color:rgba(56,189,248,.45)!important}.chip-pay,.week-pay,.entry-pay{background:rgba(34,197,94,.18)!important;border-color:rgba(74,222,128,.45)!important}.chip-per-diem,.week-per-diem,.entry-per_diem{background:rgba(234,179,8,.18)!important;border-color:rgba(250,204,21,.5)!important}.chip-appointment,.week-appointment,.entry-appointment{background:rgba(168,85,247,.18)!important;border-color:rgba(192,132,252,.5)!important}.chip-reminder,.week-reminder,.entry-reminder{background:rgba(249,115,22,.18)!important;border-color:rgba(251,146,60,.5)!important}.chip-empty{opacity:.42;background:rgba(148,163,184,.12)}.chip-more{background:rgba(148,163,184,.16)}.status-due{box-shadow:inset 4px 0 0 #ef4444}.status-upcoming{box-shadow:inset 4px 0 0 #60a5fa}.status-completed{opacity:.65;text-decoration:line-through;box-shadow:inset 4px 0 0 #22c55e}.selected-day-summary{display:flex;gap:8px;flex-wrap:wrap;margin:0 0 10px}.selected-day-summary span{border:1px solid #355278;background:#0b1728;border-radius:999px;padding:6px 9px;font-size:12px;font-weight:850}.weekly-calendar-shell{display:grid;grid-template-columns:230px 1fr;gap:16px;align-items:start}.weekly-month-sidebar{position:sticky;top:84px;padding:14px}.week-sidebar-head{display:grid;gap:4px;margin-bottom:10px}.week-month-days{display:grid;grid-template-columns:repeat(7,1fr);gap:5px}.week-month-day{border:1px solid #263a56;background:#08111f;color:#dbe7f6;border-radius:8px;min-height:34px;font-weight:850;cursor:pointer}.week-month-day:hover,.week-month-day.selected{background:#1d4ed8;border-color:#60a5fa;color:#fff}.week-month-day.today{outline:2px solid #60a5fa}.week-month-day.has-entries:after{content:"";display:block;width:5px;height:5px;margin:2px auto 0;border-radius:50%;background:#22c55e}.weekly-calendar-card{overflow:hidden;padding:0}.weekly-topbar{padding:16px 16px 12px;border-bottom:1px solid #263a56}.weekly-topbar h2{margin:0 0 4px}.weekly-grid{display:grid;grid-template-columns:72px repeat(7,minmax(120px,1fr));overflow:auto;max-height:calc(100vh - 250px);background:#08111f}.week-corner,.week-day-header,.week-time-label,.week-all-day-cell,.week-hour-cell{border-right:1px solid #263a56;border-bottom:1px solid #263a56}.week-corner,.week-time-label{background:#0f1b2d;color:#cbd5e1;font-size:11px;font-weight:900;padding:8px;text-align:center;position:sticky;left:0;z-index:2}.week-day-header{background:#10223a;color:#e5f1ff;padding:8px;min-height:76px;text-align:left;cursor:pointer;display:grid;gap:2px;align-content:start;position:sticky;top:0;z-index:3}.week-day-header strong{font-size:13px}.week-day-header span{font-size:15px;font-weight:900}.week-day-header small{font-size:10px;color:#b9c9df}.week-day-header.selected{background:#1d4ed8}.week-day-header.today{outline:2px solid #60a5fa;outline-offset:-2px}.all-day-label{min-height:58px}.week-all-day-cell{min-height:58px;background:#0d1b2e;padding:5px;display:grid;gap:4px;align-content:start}.week-hour-cell{min-height:52px;background:#0b1728;padding:4px;display:grid;gap:4px;align-content:start}.week-hour-cell.drop-target{background:#1d4ed8!important;box-shadow:inset 0 0 0 2px #bfdbfe}.week-item{border:1px solid rgba(255,255,255,.14);border-radius:9px;padding:5px 6px;font-size:11px;line-height:1.15;color:#e5f1ff;display:grid;gap:2px;cursor:default}.week-item[draggable="true"]{cursor:grab}.week-item strong{font-size:11px}.week-item span{font-size:11px}.week-item em{font-style:normal;font-size:9px;text-transform:uppercase;color:#cbd5e1}.calendar-day-panel.hidden{display:none!important}#prevWeek.hidden,#nextWeek.hidden{display:none!important}
body.theme-light .calendar-filter-bar{background:#ffffff;border-color:#cbd5e1}body.theme-light .calendar-filter-bar label{color:#334155}body.theme-light .calendar-day .day-summary-line{color:#1d4ed8}body.theme-light .calendar-chip{border-color:rgba(15,23,42,.12);color:#0f172a}body.theme-light .selected-day-summary span{background:#f8fafc;border-color:#cbd5e1;color:#0f172a}body.theme-light .week-month-day{background:#ffffff;border-color:#cbd5e1;color:#0f172a}body.theme-light .weekly-topbar,body.theme-light .week-corner,body.theme-light .week-time-label{border-color:#cbd5e1}body.theme-light .weekly-grid{background:#f8fafc}body.theme-light .week-corner,body.theme-light .week-time-label{background:#e2e8f0;color:#0f172a}body.theme-light .week-day-header{background:#e8f2ff;color:#0f172a;border-color:#cbd5e1}body.theme-light .week-day-header small{color:#475569}body.theme-light .week-all-day-cell{background:#f8fafc;border-color:#cbd5e1}body.theme-light .week-hour-cell{background:#ffffff;border-color:#e2e8f0}body.theme-light .week-item{color:#0f172a;border-color:rgba(15,23,42,.12)}
@media(max-width:980px){.weekly-calendar-shell{grid-template-columns:1fr}.weekly-month-sidebar{position:static}.weekly-grid{grid-template-columns:58px repeat(7,minmax(105px,1fr));max-height:70vh}.calendar-day{min-height:120px}.calendar-main-toolbar{justify-content:flex-start}}
@media(max-width:720px){.calendar-filter-bar{display:grid;grid-template-columns:1fr 1fr}.calendar-day{min-height:112px}.calendar-chip{font-size:9px}.weekly-grid{grid-template-columns:54px repeat(7,96px)}.week-month-days{grid-template-columns:repeat(7,1fr)}}

/* Calendar side-panel + icon monthly view update */
.calendar-workspace{
  display:grid;
  grid-template-columns:260px minmax(0,1fr) 330px;
  gap:14px;
  align-items:start;
  padding-top:8px;
}
.calendar-side-menu,
.calendar-details-panel{
  position:sticky;
  top:84px;
  max-height:calc(100vh - 104px);
  overflow:auto;
}
.calendar-side-menu{
  display:flex;
  flex-direction:column;
  gap:14px;
  padding:14px;
  transition:width .18s ease, padding .18s ease;
}
.calendar-side-head{
  display:flex;
  align-items:center;
  gap:10px;
  padding-bottom:10px;
  border-bottom:1px solid #263a56;
}
.calendar-menu-toggle{
  width:38px;
  height:38px;
  border-radius:12px;
  border:1px solid #355278;
  color:#e5f1ff;
  background:#0b1728;
  font-size:22px;
  font-weight:900;
  cursor:pointer;
}
.calendar-menu-toggle:hover{border-color:#60a5fa;background:#132a48}
.calendar-side-title{display:grid;gap:2px}
.calendar-side-title strong{font-size:15px;color:#eff6ff}
.calendar-side-title small{font-size:11px;color:#93a7bd}
.calendar-side-section{
  border:1px solid #263a56;
  border-radius:16px;
  padding:11px;
  background:rgba(8,17,31,.42);
}
.calendar-mini-title-row{
  display:grid;
  grid-template-columns:34px 1fr 34px;
  align-items:center;
  gap:6px;
  text-align:center;
  margin-bottom:10px;
}
.calendar-mini-title-row strong{font-size:13px;color:#e5f1ff}
.calendar-mini-days.week-month-days{
  grid-template-columns:repeat(7,1fr);
  gap:4px;
}
.calendar-mini-days .week-month-day{
  min-height:30px;
  border-radius:8px;
  font-size:12px;
}
.side-section-label{
  color:#93c5fd;
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:.08em;
  font-weight:900;
  margin-bottom:8px;
}
.calendar-side-views{display:grid;gap:9px}
.calendar-side-views .segmented-control{display:grid;grid-template-columns:1fr 1fr;gap:7px}
.calendar-side-views .btn{justify-content:center}
.full-width{width:100%}
.calendar-week-nav{display:grid;grid-template-columns:1fr 1fr;gap:7px}
.calendar-filter-section{
  margin-top:auto;
  display:grid;
  gap:8px;
}
.calendar-filter-section label{
  display:grid;
  grid-template-columns:auto auto 1fr;
  align-items:center;
  gap:8px;
  color:#dbe7f6;
  font-size:12px;
  font-weight:850;
  padding:7px 8px;
  border:1px solid rgba(148,163,184,.18);
  border-radius:10px;
  background:rgba(15,31,53,.48);
}
.calendar-filter-section input{accent-color:#60a5fa}
.filter-icon{width:22px;text-align:center;font-size:15px}
.calendar-main-stage{min-width:0}
.calendar-month-headline{justify-content:center!important;margin-bottom:10px}
.calendar-month-headline h2{margin:0;font-size:22px}
.calendar-card{min-height:calc(100vh - 118px)}
.calendar-grid{gap:7px!important}
.calendar-day{
  min-height:118px!important;
  display:grid;
  grid-template-rows:auto 1fr;
  gap:6px;
}
.calendar-day strong{
  margin:0!important;
  font-size:15px!important;
  line-height:1;
}
.month-icon-stack{
  display:flex!important;
  flex-wrap:wrap;
  align-content:flex-start;
  gap:4px!important;
  min-height:0;
}
.month-icon-pill{
  display:inline-flex!important;
  align-items:center;
  gap:3px;
  border-radius:999px!important;
  padding:3px 6px!important;
  font-size:11px!important;
  line-height:1!important;
  font-weight:900!important;
  max-width:100%;
  white-space:nowrap;
}
.month-icon-empty{
  opacity:.25;
  font-weight:900;
  font-size:12px;
}
.calendar-day .day-summary-line,
.calendar-day .calendar-chip:not(.month-icon-pill){display:none!important}
.calendar-details-panel{
  padding:14px;
  display:flex;
  flex-direction:column;
  gap:12px;
  background:linear-gradient(180deg,#10223a,#0d1b2e)!important;
  border-color:#355278!important;
}
.calendar-details-panel .day-panel-head{
  margin-bottom:0;
}
.calendar-detail-content{
  min-height:120px;
}
.calendar-details-panel .calendar-panel-actions{
  display:grid!important;
  grid-template-columns:1fr!important;
  margin-top:auto;
}
.calendar-details-panel .calendar-panel-actions .btn{width:100%}
.weekly-calendar-card{min-height:calc(100vh - 118px)}
.weekly-grid{max-height:calc(100vh - 210px)!important}
.calendar-workspace.calendar-side-collapsed{
  grid-template-columns:58px minmax(0,1fr) 330px;
}
.calendar-workspace.calendar-side-collapsed .calendar-side-menu{
  padding:10px;
  overflow:hidden;
}
.calendar-workspace.calendar-side-collapsed .calendar-side-title,
.calendar-workspace.calendar-side-collapsed .calendar-side-section{
  display:none!important;
}
.calendar-workspace.calendar-side-collapsed .calendar-side-head{
  border-bottom:0;
  padding-bottom:0;
  justify-content:center;
}
.calendar-workspace.calendar-side-collapsed .calendar-menu-toggle{
  width:38px;
  height:38px;
}
body.theme-light .calendar-side-menu,
body.theme-light .calendar-details-panel{background:#ffffff!important;border-color:#cbd5e1!important}
body.theme-light .calendar-side-head{border-color:#e2e8f0}
body.theme-light .calendar-menu-toggle{background:#f8fafc;color:#0f172a;border-color:#cbd5e1}
body.theme-light .calendar-side-title strong,
body.theme-light .calendar-mini-title-row strong{color:#0f172a}
body.theme-light .calendar-side-title small{color:#64748b}
body.theme-light .calendar-side-section{background:#f8fafc;border-color:#dbe3ee}
body.theme-light .calendar-filter-section label{background:#ffffff;border-color:#e2e8f0;color:#0f172a}
@media(max-width:1180px){
  .calendar-workspace{grid-template-columns:230px minmax(0,1fr);}
  .calendar-details-panel{position:static;grid-column:1/-1;max-height:none;}
  .calendar-workspace.calendar-side-collapsed{grid-template-columns:58px minmax(0,1fr)}
}
@media(max-width:820px){
  .calendar-workspace,
  .calendar-workspace.calendar-side-collapsed{grid-template-columns:1fr;}
  .calendar-side-menu,.calendar-details-panel{position:static;max-height:none;}
  .calendar-workspace.calendar-side-collapsed .calendar-side-section{display:none!important}
  .calendar-day{min-height:104px!important}
  .calendar-grid{gap:5px!important}
  .month-icon-pill{font-size:10px!important;padding:3px 5px!important}
}
.calendar-mini-days .mini-day-name{font-size:9px;font-weight:900;color:#93a7bd;text-align:center;padding-bottom:2px}.calendar-mini-days .mini-day-blank{min-height:30px}
body.theme-light .calendar-mini-days .mini-day-name{color:#64748b}

/* Calendar compact left-panel tools + entry details update */
.calendar-workspace{
  grid-template-columns:300px minmax(0,1fr)!important;
  gap:14px!important;
}
.calendar-workspace.calendar-side-collapsed{
  grid-template-columns:58px minmax(0,1fr)!important;
}
.calendar-side-menu{
  max-height:calc(100vh - 104px);
  overflow:auto;
}
.calendar-side-views{order:1}
.calendar-mini-month-section{order:2}
.calendar-tools-section{order:3}
.calendar-day-panel{order:4;margin-top:auto}
.calendar-mini-days.week-month-days{
  width:100%;
  max-width:100%;
  margin:0 auto;
  display:grid!important;
  grid-template-columns:repeat(7,minmax(0,1fr))!important;
  gap:3px!important;
  justify-items:stretch;
  align-items:stretch;
  box-sizing:border-box;
}
.calendar-mini-days .mini-day-name,
.calendar-mini-days .mini-day-blank,
.calendar-mini-days .week-month-day{
  min-width:0!important;
  width:100%!important;
  box-sizing:border-box!important;
}
.calendar-mini-days .mini-day-name{
  font-size:8px!important;
  letter-spacing:0!important;
  overflow:hidden;
}
.calendar-mini-days .week-month-day{
  min-height:27px!important;
  padding:0!important;
  border-radius:7px!important;
  font-size:11px!important;
  line-height:1!important;
}
.calendar-tools-section{
  display:grid;
  gap:6px;
}
.calendar-tool-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) 32px;
  align-items:center;
  gap:6px;
}
.calendar-tool-row label{
  display:grid;
  grid-template-columns:auto 22px minmax(0,1fr);
  align-items:center;
  gap:7px;
  color:#dbe7f6;
  font-size:12px;
  font-weight:850;
  padding:7px 8px;
  border:1px solid rgba(148,163,184,.18);
  border-radius:10px;
  background:rgba(15,31,53,.48);
  min-width:0;
}
.calendar-tool-row label span:last-child{
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.calendar-tool-row input{accent-color:#60a5fa}
.tool-add-btn{
  width:32px;
  height:32px;
  border-radius:10px;
  border:1px solid #355278;
  background:linear-gradient(180deg,#2563eb,#1d4ed8);
  color:white;
  font-weight:950;
  font-size:18px;
  line-height:1;
  cursor:pointer;
}
.tool-add-btn:hover{border-color:#93c5fd;filter:brightness(1.08)}
.calendar-day-panel{
  background:rgba(8,17,31,.42)!important;
  border-color:#263a56!important;
  padding:11px!important;
  display:grid;
  gap:10px;
  max-height:none;
}
.day-panel-head.compact{
  margin:0!important;
  padding-bottom:8px!important;
}
.day-panel-head.compact h3{font-size:15px!important;margin:0 0 2px!important}
.day-panel-head.compact p{font-size:11px!important;margin:0!important}
.calendar-detail-content{min-height:80px!important}
.day-entry-list{gap:6px!important}
.entry-row.calendar-entry-detail-trigger{
  width:100%;
  text-align:left;
  cursor:pointer;
  border:1px solid #314966;
  color:#e5f1ff;
}
.entry-row .entry-icon{width:22px;text-align:center;flex:0 0 22px}
.entry-row.calendar-entry-detail-trigger:hover{border-color:#60a5fa;background:#172d4a!important}
.month-icon-pill.dive-depth-pill{
  display:inline-grid!important;
  grid-template-columns:auto auto;
  align-items:center;
  justify-content:start;
  gap:3px!important;
}
.month-icon-symbol{display:inline-block;width:16px;text-align:center;line-height:1}
.month-icon-value{display:inline-block;line-height:1;white-space:nowrap}
.week-item{cursor:pointer!important}
.entry-detail-body{display:grid;gap:14px}
.entry-detail-body h3{margin:6px 0 0;color:#e5f1ff;font-size:15px}
.entry-detail-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.entry-detail-row{border:1px solid #263a56;background:#08111f;border-radius:10px;padding:9px;display:grid;gap:3px}
.entry-detail-row span{font-size:11px;color:#93a7bd;font-weight:850;text-transform:uppercase;letter-spacing:.05em}
.entry-detail-row strong{font-size:13px;color:#e5f1ff;word-break:break-word}
.entry-detail-card{border:1px solid #355278;background:#101f35;border-radius:14px;padding:10px;display:grid;gap:8px}
.entry-detail-card>strong{color:#bfdbfe}
.entry-detail-note{border:1px solid #263a56;background:#08111f;border-radius:12px;padding:12px;white-space:pre-wrap;margin:0;color:#dbe7f6}
body.theme-light .calendar-tool-row label,
body.theme-light .calendar-day-panel{background:#ffffff!important;border-color:#e2e8f0!important;color:#0f172a!important}
body.theme-light .entry-row.calendar-entry-detail-trigger{color:#0f172a;background:#f8fafc!important;border-color:#cbd5e1!important}
body.theme-light .entry-row.calendar-entry-detail-trigger:hover{background:#e8f2ff!important}
body.theme-light .entry-detail-body h3{color:#0f172a}
body.theme-light .entry-detail-row,
body.theme-light .entry-detail-card,
body.theme-light .entry-detail-note{background:#f8fafc;border-color:#cbd5e1;color:#0f172a}
body.theme-light .entry-detail-row strong{color:#0f172a}
@media(max-width:1180px){
  .calendar-workspace{grid-template-columns:280px minmax(0,1fr)!important}
  .calendar-workspace.calendar-side-collapsed{grid-template-columns:58px minmax(0,1fr)!important}
}
@media(max-width:820px){
  .calendar-workspace,
  .calendar-workspace.calendar-side-collapsed{grid-template-columns:1fr!important}
  .calendar-side-menu{position:static;max-height:none}
  .entry-detail-grid{grid-template-columns:1fr}
}
@media(min-width:821px){.calendar-side-menu{min-height:calc(100vh - 104px)}}

/* Calendar section collapse/edit polish */
.calendar-side-menu{justify-content:flex-start!important;align-content:start!important;gap:10px!important;}
.calendar-side-section{margin-top:0!important;}
.calendar-day-panel{margin-top:0!important;}
.calendar-section-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:8px;}
.calendar-section-head .side-section-label{margin-bottom:0!important;}
.calendar-section-head h3{margin:2px 0 0!important;font-size:15px!important;}
.calendar-section-toggle{width:25px;height:25px;min-width:25px;border-radius:7px;border:1px solid #355278;background:#0b1728;color:#e5f1ff;font-size:17px;font-weight:950;line-height:1;cursor:pointer;display:inline-grid;place-items:center;}
.calendar-section-toggle:hover{border-color:#60a5fa;background:#132a48;}
.calendar-side-section.section-collapsed{padding-bottom:9px!important;}
.calendar-side-section.section-collapsed .calendar-section-content{display:none!important;}
.calendar-collapsed-label{display:none;margin:0 0 10px;padding:10px 12px;border:1px solid #263a56;border-radius:14px;background:#0f1b2d;color:#e5f1ff;font-weight:950;letter-spacing:.02em;}
.calendar-workspace.calendar-side-collapsed .calendar-collapsed-label{display:block;}
.calendar-workspace.calendar-side-collapsed .calendar-side-title{display:grid!important;}
.calendar-workspace.calendar-side-collapsed .calendar-side-title strong{display:none!important;}
.calendar-workspace.calendar-side-collapsed .calendar-side-title small{display:none!important;}
.calendar-workspace.calendar-side-collapsed .calendar-side-head{justify-content:center!important;}
.calendar-labeled-grid label{display:grid!important;gap:5px!important;}
.calendar-labeled-grid .field-label{display:block;color:#bfdbfe!important;font-size:11px!important;font-weight:900!important;text-transform:uppercase;letter-spacing:.04em;line-height:1.1;}
.calendar-labeled-grid input::placeholder{color:#7f93ad;opacity:.9;}
.calendar-lock-note{border:1px solid #f59e0b;background:rgba(245,158,11,.12);color:#fde68a;border-radius:12px;padding:10px 12px;font-weight:850;}
.calendar-unlock-inline{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-right:auto;}
.calendar-unlock-inline input{height:38px;border-radius:10px;border:1px solid #334968;background:#08111f;color:#e5f1ff;padding:8px 10px;}
.calendar-record-dive-scroll input:disabled,
.calendar-record-dive-scroll textarea:disabled,
.calendar-record-dive-scroll select:disabled{opacity:.75;cursor:not-allowed;background:rgba(148,163,184,.15)!important;}
.calendar-record-dive-page .signature-display img{max-width:100%;max-height:100%;object-fit:contain;display:block;margin:0 auto;}
body.theme-light .calendar-section-toggle{background:#f8fafc;color:#0f172a;border-color:#cbd5e1;}
body.theme-light .calendar-collapsed-label{background:#ffffff;color:#0f172a;border-color:#cbd5e1;}
body.theme-light .calendar-labeled-grid .field-label{color:#1d4ed8!important;}
body.theme-light .calendar-lock-note{background:#fff7ed;color:#9a3412;border-color:#fdba74;}
body.theme-light .calendar-unlock-inline input{background:#ffffff;color:#0f172a;border-color:#cbd5e1;}
@media(max-width:820px){.calendar-collapsed-label{display:block}.calendar-workspace.calendar-side-collapsed .calendar-collapsed-label{display:block}}

/* Whole-app responsive + touchscreen foundation
   Desktop styles above stay as-is. These rules only help tablets/phones and touch screens. */
html{
  -webkit-text-size-adjust:100%;
  text-size-adjust:100%;
  scroll-behavior:smooth;
}
body{
  min-width:0;
  overscroll-behavior-y:none;
}
img,svg,video,canvas{max-width:100%}
table{max-width:100%}
button,a,input,select,textarea{touch-action:manipulation}
input,select,textarea{max-width:100%}
.table-scroll,.saved-table-wrap,.logbook-list-table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch}
.saved-entries-table,.logbook-list-table{min-width:760px}

@media (pointer:coarse){
  .btn,.icon-btn,.view-tab,.calendar-menu-toggle,.calendar-section-toggle,.tool-add-btn,.delete-entry-btn,.pay-save-btn,.main-nav a,.sync-chip{
    min-height:44px;
  }
  .btn.small,.icon-btn.page-arrow,.calendar-section-toggle,.tool-add-btn{min-width:44px}
  input,select,textarea{min-height:44px;font-size:16px}
  .pay-screenshot-grid input,.pay-screenshot-grid select{min-height:44px;height:44px;font-size:16px}
  label{gap:8px}
  .paper-check input{width:18px!important;height:18px!important}
  .box-field input{width:24px!important;height:28px!important}
  .calendar-day,.week-month-day,.week-day-header,.week-hour-cell,.entry-row{touch-action:manipulation}
}

@media (max-width:1100px){
  .page-shell{padding:18px;max-width:100%}
  .page-title-row{align-items:stretch;flex-direction:column}
  .page-title-row.compact{align-items:stretch}
  .page-title-row h1{font-size:30px}
  .card{padding:16px;border-radius:18px}
  .dashboard-grid{grid-template-columns:1fr}
  .settings-shell{padding:16px;grid-template-columns:1fr!important}
  .settings-menu{position:static!important}
  .settings-menu nav{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
  .settings-grid{grid-template-columns:1fr!important}
  .depth-pay-layout{grid-template-columns:1fr!important}
}

@media (max-width:820px){
  .app-header{
    height:auto;
    min-height:64px;
    flex-wrap:wrap;
    align-items:center;
    padding:10px 12px;
    gap:8px;
  }
  .brand{flex:1 1 auto;min-width:210px}
  .brand-mark{padding:7px;border-radius:10px}
  .main-nav{
    order:3;
    flex:1 0 100%;
    gap:6px;
    padding:2px 0 4px;
    margin:0 -2px;
    scroll-snap-type:x proximity;
  }
  .main-nav a{
    flex:0 0 auto;
    scroll-snap-align:start;
    padding:10px 12px;
    background:rgba(20,36,58,.72);
  }
  .sync-chip{padding:8px 10px}
  main{min-height:calc(100svh - 112px)}
  .page-shell{padding:14px}
  .page-title-row h1{font-size:26px}
  .quick-actions{display:grid;grid-template-columns:1fr;align-items:stretch}
  .quick-actions .btn{width:100%}
  .toolbar-row{align-items:stretch;flex-direction:column}
  .toolbar-row.wrap{flex-direction:row}
  .form-actions{display:grid;grid-template-columns:1fr;align-items:stretch}
  .form-actions .btn{width:100%}
  .settings-menu nav{grid-template-columns:1fr}
  .switch-line,.check-line{gap:12px;align-items:center}
}

@media (max-width:640px){
  .page-shell{padding:12px}
  .card{padding:14px;border-radius:16px}
  .page-title-row h1{font-size:24px}
  .page-title-row p{font-size:14px}
  .btn{width:100%;padding:12px 14px}
  .btn.small{padding:10px 12px}
  .icon-btn{padding:10px 12px}
  .card-title{font-size:18px}
  .stat-row{gap:12px;align-items:flex-start;flex-direction:column}
  .modal-backdrop,.calendar-modal-backdrop{padding:10px!important;align-items:flex-start!important}
  .modal-card,.calendar-modal{border-radius:16px!important;padding:14px!important;max-height:calc(100svh - 20px);overflow:auto}
  .calendar-modal-head{align-items:flex-start}
}

/* Pay/Entries responsive behavior */
@media (max-width:900px){
  .pay-page{padding-left:12px;padding-right:12px}
  .pay-card-head,.screenshot-head{align-items:stretch;flex-direction:column}
  .pay-screenshot-grid{grid-template-columns:1fr!important}
  .pay-screenshot-grid label{font-size:13px}
  .pay-totals-box{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px}
  .pay-save-btn{width:100%;min-height:44px}
  .saved-table-wrap{margin:0 -8px;padding:0 8px}
}
@media (max-width:560px){
  .pay-work-card,.saved-entries-card{padding:14px;border-radius:12px}
  .pay-totals-box{grid-template-columns:1fr!important}
  .pay-totals-box strong{font-size:18px}
}

/* Calendar responsive behavior */
@media (max-width:980px){
  .calendar-workspace,
  .calendar-workspace.calendar-side-collapsed{
    grid-template-columns:1fr!important;
    gap:12px!important;
    padding:12px!important;
  }
  .calendar-side-menu{
    position:relative!important;
    width:100%!important;
    max-height:none!important;
    min-height:0!important;
  }
  .calendar-workspace.calendar-side-collapsed .calendar-side-menu{
    width:100%!important;
  }
  .calendar-workspace.calendar-side-collapsed .calendar-side-section{display:none!important}
  .calendar-collapsed-label{display:block!important}
  .calendar-main-stage{min-width:0;width:100%}
  .calendar-card,.weekly-calendar-card{min-height:0!important}
  .calendar-grid{grid-template-columns:repeat(7,minmax(44px,1fr));gap:5px!important}
  .calendar-day{min-height:96px!important;padding:6px!important;border-radius:10px!important}
  .calendar-day strong{font-size:13px!important}
  .month-icon-stack{gap:3px!important}
  .month-icon-pill{font-size:10px!important;line-height:1.1;max-width:100%;overflow:hidden;text-overflow:ellipsis}
  .weekly-grid{
    overflow:auto!important;
    -webkit-overflow-scrolling:touch;
    max-height:70svh!important;
    grid-template-columns:54px repeat(7,minmax(92px,1fr))!important;
  }
  .week-day-header{min-height:64px!important;padding:6px!important}
  .week-hour-cell{min-height:58px!important}
  .calendar-form-grid{grid-template-columns:1fr!important}
  .calendar-modal-actions{display:grid!important;grid-template-columns:1fr!important}
}
@media (max-width:560px){
  .calendar-workspace,
  .calendar-workspace.calendar-side-collapsed{padding:8px!important}
  .calendar-side-menu{padding:10px!important;border-radius:14px!important}
  .calendar-grid{gap:4px!important}
  .calendar-day{min-height:82px!important;padding:4px!important}
  .calendar-head{font-size:11px;padding:6px 2px!important}
  .month-icon-pill{font-size:9px!important;padding:2px 3px!important}
  .calendar-tool-row{grid-template-columns:1fr 38px!important;gap:6px!important}
  .calendar-tool-row label{min-width:0;font-size:12px!important}
  .calendar-tool-row label span:last-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .calendar-detail-content{max-height:40svh;overflow:auto;-webkit-overflow-scrolling:touch}
}

/* Logbook and scanned-books responsive behavior */
@media (max-width:1100px){
  .logbook-app{grid-template-columns:1fr!important;height:calc(100svh - 64px)}
  .logbook-sidebar{
    position:fixed!important;
    z-index:90!important;
    inset:64px auto 0 0!important;
    width:min(320px,88vw)!important;
    max-width:88vw!important;
    transition:transform .2s ease!important;
  }
  .logbook-sidebar:not(.open){transform:translateX(-105%)!important}
  .logbook-sidebar.open{transform:translateX(0)!important}
  .logbook-app.sidebar-collapsed{grid-template-columns:1fr!important}
  .book-area{min-width:0;width:100%}
  .book-scroll{padding:14px!important;overflow:auto;-webkit-overflow-scrolling:touch;touch-action:pan-x pan-y}
  .book-spread{justify-content:flex-start!important;width:max-content;min-width:100%;gap:10px!important}
  .book-spread.open-book{flex-wrap:nowrap!important}
  .book-nav{position:sticky;bottom:0;z-index:25;gap:10px;padding:10px;overflow-x:auto}
  .bookshelf-panel{padding:16px!important;grid-template-columns:1fr!important}
  .scan-page-frame{max-width:100%;overflow:auto;-webkit-overflow-scrolling:touch}
}
@media (max-width:760px){
  .logbook-app{height:calc(100svh - 112px)}
  .logbook-sidebar{inset:112px auto 0 0!important}
  .book-status{font-size:12px;padding:8px 12px}
  .book-nav .page-arrow{min-width:44px}
  .book-nav #pageCounter{min-width:90px;font-size:13px}
  .record-of-dive-page,.log-page{transform:scale(var(--page-scale,.58))!important;transform-origin:top left!important;margin:0!important}
  .calendar-record-dive-scroll{max-height:70svh!important}
  .calendar-record-dive-page{transform:scale(.72)!important;transform-origin:top left!important;margin:0!important}
  .signature-tools,.signature-final-size,.improved-signature-controls{grid-template-columns:1fr!important}
  .signature-crop-actions{display:grid;grid-template-columns:1fr 1fr}
}
@media (max-width:520px){
  .record-of-dive-page,.log-page{transform:scale(var(--page-scale,.50))!important}
  .calendar-record-dive-page{transform:scale(.60)!important}
  .view-switcher{display:grid;grid-template-columns:1fr;gap:8px}
  .side-tool-grid{grid-template-columns:1fr!important}
}

/* Prefer the screen layout for desktop printing and preserve the existing letter print rules. */
@media print{
  .app-header,.calendar-side-menu,.calendar-collapsed-label,.calendar-modal-backdrop{display:none!important}
}

/* Mobile/tablet Logbook single-page viewer update */
@media (max-width: 820px){
  .logbook-app.mobile-logbook-mode{
    display:flex!important;
    flex-direction:column!important;
    grid-template-columns:1fr!important;
    height:calc(100svh - 112px)!important;
    overflow:hidden!important;
  }
  .logbook-app.mobile-logbook-mode .logbook-sidebar{
    position:relative!important;
    inset:auto!important;
    transform:none!important;
    width:100%!important;
    max-width:none!important;
    min-width:0!important;
    max-height:48svh!important;
    flex:0 0 auto!important;
    border-right:0!important;
    border-bottom:1px solid var(--line)!important;
    padding:10px 12px!important;
    overflow:auto!important;
    -webkit-overflow-scrolling:touch;
  }
  .logbook-app.mobile-logbook-mode.sidebar-collapsed .logbook-sidebar{
    width:100%!important;
    min-width:0!important;
    max-height:58px!important;
    padding:8px 12px!important;
    overflow:hidden!important;
  }
  .logbook-app.mobile-logbook-mode.sidebar-collapsed .sidebar-title-block{
    display:flex!important;
  }
  .logbook-app.mobile-logbook-mode.sidebar-collapsed .sidebar-body{
    display:none!important;
  }
  .logbook-app.mobile-logbook-mode .logbook-menu-head,
  .logbook-app.mobile-logbook-mode.sidebar-collapsed .logbook-menu-head{
    justify-content:flex-start!important;
    margin:0!important;
    gap:10px!important;
  }
  .logbook-app.mobile-logbook-mode .menu-toggle{
    width:44px!important;
    min-width:44px!important;
    height:44px!important;
  }
  .logbook-app.mobile-logbook-mode .sidebar-title-block strong{
    font-size:15px!important;
  }
  .logbook-app.mobile-logbook-mode .sidebar-title-block span{
    font-size:11px!important;
  }
  .logbook-app.mobile-logbook-mode .sidebar-body{
    padding-top:10px!important;
  }
  .logbook-app.mobile-logbook-mode .view-switcher{
    grid-template-columns:1fr 1fr!important;
  }
  .logbook-app.mobile-logbook-mode .book-area{
    flex:1 1 auto!important;
    min-height:0!important;
    width:100%!important;
  }
  .logbook-app.mobile-logbook-mode .book-view-panel{
    min-height:0!important;
  }
  .logbook-app.mobile-logbook-mode .book-scroll{
    align-items:flex-start!important;
    justify-content:flex-start!important;
    padding:12px!important;
    overflow:auto!important;
    -webkit-overflow-scrolling:touch;
    touch-action:none!important;
    cursor:grab;
    background:linear-gradient(145deg,#07111f,#101f36 55%,#06101d)!important;
  }
  .logbook-app.mobile-logbook-mode .book-scroll.swiping{
    cursor:grabbing;
  }
  .logbook-app.mobile-logbook-mode .book-spread.real-open-book,
  .logbook-app.mobile-logbook-mode .book-spread.real-open-book.open-book,
  .logbook-app.mobile-logbook-mode .book-spread.real-open-book.single{
    display:block!important;
    width:max-content!important;
    min-width:0!important;
    padding:0 0 12px 0!important;
    border-radius:0!important;
    background:transparent!important;
    box-shadow:none!important;
  }
  .logbook-app.mobile-logbook-mode .book-spread.real-open-book:before,
  .logbook-app.mobile-logbook-mode .book-spread.real-open-book:after,
  .logbook-app.mobile-logbook-mode .book-spread.real-open-book .log-page:before,
  .logbook-app.mobile-logbook-mode .book-spread.real-open-book .log-page:after{
    display:none!important;
  }
  .logbook-app.mobile-logbook-mode .book-spread.real-open-book .log-page{
    display:block!important;
    zoom:var(--page-scale,.52)!important;
    transform:none!important;
    transform-origin:top left!important;
    margin:0!important;
    border-radius:12px!important;
    box-shadow:0 18px 44px rgba(0,0,0,.40)!important;
    border:1px solid #d0c6ae!important;
  }
  .logbook-app.mobile-logbook-mode .book-spread.real-open-book .log-page.right,
  .logbook-app.mobile-logbook-mode .book-spread.real-open-book .blank-page{
    display:none!important;
  }
  .logbook-app.mobile-logbook-mode .log-page input:focus,
  .logbook-app.mobile-logbook-mode .log-page textarea:focus{
    outline:2px solid rgba(59,130,246,.85)!important;
    outline-offset:1px!important;
    background:rgba(219,234,254,.42)!important;
  }
  .logbook-app.mobile-logbook-mode .paper-check,
  .logbook-app.mobile-logbook-mode .reference-check-group label,
  .logbook-app.mobile-logbook-mode .type-of-dive-box label{
    min-height:30px;
    align-items:center;
  }
  .logbook-app.mobile-logbook-mode .book-nav{
    position:sticky!important;
    bottom:0!important;
    z-index:35!important;
    min-height:54px!important;
    padding:8px 10px!important;
    gap:8px!important;
    overflow-x:auto!important;
    -webkit-overflow-scrolling:touch;
    background:rgba(7,17,31,.96)!important;
    backdrop-filter:blur(8px);
  }
  .logbook-app.mobile-logbook-mode .book-nav .page-arrow{
    min-width:46px!important;
    height:42px!important;
  }
  .logbook-app.mobile-logbook-mode #pageCounter{
    font-size:13px!important;
    min-width:112px!important;
    text-align:center!important;
  }
  .logbook-app.mobile-logbook-mode .scan-page-frame{
    padding:12px!important;
  }
}

@media (max-width: 520px){
  .logbook-app.mobile-logbook-mode .logbook-sidebar{
    max-height:52svh!important;
  }
  .logbook-app.mobile-logbook-mode.sidebar-collapsed .logbook-sidebar{
    max-height:56px!important;
  }
  .logbook-app.mobile-logbook-mode .book-scroll{
    padding:8px!important;
  }
  .logbook-app.mobile-logbook-mode .book-nav{
    gap:6px!important;
  }
  .logbook-app.mobile-logbook-mode #pageCounter{
    min-width:96px!important;
  }
}

body.theme-light .logbook-app.mobile-logbook-mode .book-scroll{
  background:linear-gradient(145deg,#dbeafe,#f8fafc 62%,#dbeafe)!important;
}

/* Imports tab book layout */
.imports-app{
  display:grid;
  grid-template-columns:300px minmax(0,1fr);
  gap:18px;
  min-height:calc(100vh - 90px);
  padding:18px;
}
.imports-side-panel{
  background:rgba(15,27,45,.94);
  border:1px solid #263a56;
  border-radius:22px;
  padding:14px;
  overflow:auto;
  box-shadow:0 18px 48px rgba(0,0,0,.25);
}
.imports-side-head{display:flex;align-items:center;gap:10px;margin-bottom:14px}
.imports-side-head h2{margin:0;font-size:20px}.side-kicker{font-size:11px;text-transform:uppercase;letter-spacing:.12em;color:#93c5fd;font-weight:900}
.imports-main-area{
  min-width:0;
  background:radial-gradient(circle at center,#1e3a5f,#0f172a 70%,#060b14);
  border:1px solid #263a56;
  border-radius:28px;
  position:relative;
  overflow:hidden;
  min-height:calc(100vh - 126px);
}
.imports-status{position:absolute;top:12px;right:16px;z-index:3;background:rgba(15,23,42,.82);border:1px solid #334155;border-radius:999px;padding:7px 12px;font-size:13px;color:#dbeafe}
.imports-bookshelf{display:grid;grid-template-columns:repeat(2,minmax(240px,360px));gap:28px;align-content:center;justify-content:center;height:100%;padding:58px 30px 30px;overflow:auto}
.paystub-cover{background:linear-gradient(145deg,#143018,#166534 52%,#07111f)}
.imports-future-cover{background:linear-gradient(145deg,#312e81,#4f46e5 52%,#111827)}
.placeholder-book{opacity:.72;cursor:not-allowed}.placeholder-book:hover{transform:none;border-color:#263a56}
.imports-book-panel{height:100%;min-height:0;display:flex;flex-direction:column;padding-top:42px}.paystub-book-view{height:100%;min-height:0;display:flex;flex-direction:column}.paystub-page-frame{flex:1;overflow:auto;padding:22px;display:flex;align-items:flex-start;justify-content:center}.paystub-page{width:min(900px,100%);min-height:calc(100vh - 210px);background:#fffdf7;color:#111827;border-radius:10px;box-shadow:0 22px 55px rgba(0,0,0,.38);border:1px solid #d8d2c1;padding:18px}.paystub-pdf-frame{width:100%;height:min(72vh,760px);border:1px solid #d1d5db;background:#fff}.paystub-file-placeholder{min-height:420px;background:#f3f4f6;border:1px solid #d1d5db;display:flex;align-items:center;justify-content:center;flex-direction:column;text-align:center;color:#374151}.paystub-file-placeholder>div{font-size:58px}.paystub-list-view{height:100%;overflow:auto;padding:22px}.paystub-upload-label{background:#0b1728;border:1px dashed #475569;border-radius:12px;padding:10px;cursor:pointer}.paystub-upload-label input{margin-top:8px;background:#08111f}.import-upload-form textarea{resize:vertical}.form-status{font-size:13px;color:#bfdbfe;background:#0b1728;border:1px solid #263a56;border-radius:10px;padding:8px}.import-book-tools{display:flex;flex-direction:column;gap:10px}
body.theme-light .imports-side-panel{background:#f8fafc;border-color:#cbd5e1;color:#0f172a}body.theme-light .imports-main-area{background:radial-gradient(circle at center,#dbeafe,#f8fafc 68%,#e2e8f0)}body.theme-light .imports-status{background:rgba(248,250,252,.92);border-color:#cbd5e1;color:#0f172a}body.theme-light .paystub-upload-label,body.theme-light .form-status{background:#f8fafc;border-color:#cbd5e1;color:#334155}
@media (max-width:900px){.imports-app{grid-template-columns:1fr;padding:12px}.imports-side-panel{order:1}.imports-main-area{order:2;min-height:70vh}.imports-bookshelf{grid-template-columns:1fr;padding:54px 16px 18px}.imports-book-panel{padding-top:48px}.paystub-page-frame{padding:12px}.paystub-page{min-height:70vh}.paystub-pdf-frame{height:68vh}}
@media (max-width:640px){.imports-bookshelf .book-cover{height:230px}.imports-status{left:12px;right:12px;text-align:center}.imports-side-head h2{font-size:18px}.paystub-list-view{padding:12px}}

/* Imports bookshelf expansion + clean paystub page preview */
.imports-app.shelf-mode{
  grid-template-columns:minmax(0,1fr);
}
.imports-app.shelf-mode .imports-main-area{
  min-height:calc(100vh - 112px);
}
.imports-app.shelf-mode .imports-bookshelf{
  width:100%;
  height:100%;
  padding:70px 34px 34px;
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(230px,1fr));
  gap:28px;
  align-content:start;
  justify-content:stretch;
}
.imports-app.shelf-mode .bookshelf-card{
  min-width:0;
  width:100%;
  max-width:360px;
  justify-self:center;
}
.imports-app.shelf-mode .book-cover{
  min-height:330px;
}
.receipts-cover{background:linear-gradient(145deg,#5b2e12,#c2410c 52%,#1f130c)}
.job-docs-cover{background:linear-gradient(145deg,#0f2b46,#0369a1 52%,#07111f)}
.tickets-cover{background:linear-gradient(145deg,#3b1d4f,#9333ea 52%,#14091f)}
.certs-cover{background:linear-gradient(145deg,#1f2937,#64748b 52%,#0f172a)}
.invoices-cover{background:linear-gradient(145deg,#3f2f08,#ca8a04 52%,#1c1605)}
.dive-photos-cover{background:linear-gradient(145deg,#064e3b,#14b8a6 52%,#042f2e)}
.imports-bookshelf .placeholder-book{
  opacity:1;
  cursor:pointer;
}
.imports-bookshelf .placeholder-book:hover,
.imports-bookshelf .placeholder-book:focus{
  transform:translateY(-4px);
  border-color:#60a5fa;
}
.paystub-document-pages{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:22px;
  background:#e5e7eb;
  border:1px solid #d1d5db;
  padding:18px;
  overflow:auto;
  max-height:min(74vh,820px);
}
.paystub-document-page{
  position:relative;
  background:#fff;
  border:1px solid #d1d5db;
  box-shadow:0 10px 28px rgba(0,0,0,.22);
  padding:0;
  max-width:100%;
}
.paystub-document-page img{
  display:block;
  width:auto;
  max-width:100%;
  height:auto;
  background:#fff;
}
.paystub-document-page-label{
  position:absolute;
  top:8px;
  right:8px;
  z-index:1;
  background:rgba(255,255,255,.9);
  color:#111827;
  border:1px solid #d1d5db;
  border-radius:999px;
  padding:3px 8px;
  font-size:12px;
  font-weight:900;
}
.clean-paystub-image{
  background:#fff;
}
.clean-pdf-placeholder .muted-text{
  max-width:480px;
  color:#64748b;
  margin-top:0;
}
body.theme-light .paystub-document-pages{
  background:#e2e8f0;
  border-color:#cbd5e1;
}
@media (max-width:900px){
  .imports-app.shelf-mode .imports-bookshelf{
    grid-template-columns:repeat(auto-fit,minmax(190px,1fr));
    padding:64px 16px 18px;
    gap:18px;
  }
  .imports-app.shelf-mode .book-cover{min-height:270px}
  .paystub-document-pages{max-height:68vh;padding:10px;gap:14px}
}
@media (max-width:640px){
  .imports-app.shelf-mode .imports-bookshelf{
    grid-template-columns:1fr;
  }
  .imports-app.shelf-mode .bookshelf-card{max-width:330px}
}
.paystub-document-page .paystub-page-download{
  position:absolute;
  right:10px;
  bottom:10px;
  z-index:2;
  opacity:.92;
}
.paystub-document-page:hover .paystub-page-download,
.paystub-document-page:focus-within .paystub-page-download{opacity:1}
.clean-pdf-placeholder .secondary{margin-top:8px}

/* Paystubs/imports document viewer updates: accepted formats, save page, and page-only zoom */
.upload-label-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
}
.accepted-formats{
  color:#93c5fd;
  font-size:11px;
  font-weight:800;
  line-height:1.25;
}
body.theme-light .accepted-formats{color:#1d4ed8}
.paystub-document-page{
  width:100%;
  max-width:920px;
  overflow:hidden;
}
.document-zoom-surface{
  position:relative;
  width:100%;
  max-width:100%;
  background:#fff;
  overflow:hidden;
  touch-action:none;
}
.document-zoom-viewport{
  position:relative;
  width:100%;
  max-width:100%;
  overflow:hidden;
  background:#fff;
  cursor:zoom-in;
  touch-action:none;
  user-select:none;
}
.document-zoom-viewport.zoomed{cursor:grab}
.document-zoom-viewport.panning{cursor:grabbing}
.document-zoom-content{
  display:block;
  width:auto;
  max-width:100%;
  height:auto;
  margin:0 auto;
  background:#fff;
  transform-origin:center top;
  will-change:transform;
  user-select:none;
  -webkit-user-drag:none;
  touch-action:none;
}
.document-zoom-hint{
  position:absolute;
  left:10px;
  top:10px;
  z-index:4;
  background:rgba(15,23,42,.78);
  color:#e2e8f0;
  border:1px solid rgba(148,163,184,.55);
  border-radius:999px;
  padding:4px 9px;
  font-size:11px;
  font-weight:800;
  pointer-events:none;
  opacity:.78;
}
.document-zoom-reset{
  position:absolute;
  left:10px;
  bottom:10px;
  z-index:5;
  opacity:.9;
}
.paystub-page-actions{
  position:absolute;
  right:10px;
  bottom:10px;
  z-index:6;
  display:flex;
  flex-wrap:wrap;
  justify-content:flex-end;
  gap:8px;
}
.paystub-document-page .paystub-page-download{
  position:static;
  opacity:1;
}
.paystub-image-zoom .document-zoom-viewport,
.paystub-page-zoom .document-zoom-viewport{
  min-height:240px;
}
@media (max-width:700px){
  .paystub-page-actions{position:static;margin:10px;justify-content:center}
  .document-zoom-hint{position:static;border-radius:10px;margin:8px;font-size:10px;text-align:center}
  .document-zoom-reset{position:static;margin:8px auto 10px;display:block}
  .upload-label-row{align-items:flex-start;flex-direction:column;gap:4px}
}

/* Paystub book page quality/metadata/page controls polish */
.paystub-page-header{
  align-items:flex-start;
}
.paystub-page-top-right{
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:6px;
  min-width:150px;
}
.paystub-page-top-right > span{
  align-self:flex-end;
}
.paystub-detected-meta{
  color:#111827;
  font-size:12px;
  line-height:1.3;
  text-align:right;
  border:1px solid #d1d5db;
  background:#fff;
  padding:5px 7px;
  border-radius:6px;
}
.single-paystub-document-page{
  max-height:min(76vh,860px);
}
.paystub-document-page .document-zoom-content,
.clean-paystub-image .document-zoom-content{
  image-rendering:auto;
}
.clean-paystub-image{
  position:relative;
  overflow:hidden;
}
.clean-paystub-image .paystub-page-actions{
  right:14px;
  bottom:14px;
}
.paystub-page-actions .danger,
.logbook-list-table .danger{
  background:#b91c1c;
  border-color:#991b1b;
  color:#fff;
}
.paystub-page-actions .danger:hover,
.logbook-list-table .danger:hover{
  background:#dc2626;
}
@media (max-width:700px){
  .paystub-page-header{flex-direction:column}
  .paystub-page-top-right{align-items:flex-start;min-width:0}
  .paystub-detected-meta{text-align:left}
}

/* Clear upload/document viewer display fix
   The generated paystub/downloaded images were clear, but the viewer could look blurry
   because the page image was first squeezed into a small preview and then zoomed.
   These rules let the shared document viewer use the full source image and fit it cleanly. */
.document-zoom-surface[data-zoom-ready="true"]{
  background:#fff;
  overflow:hidden;
  isolation:isolate;
}
.document-zoom-surface[data-zoom-ready="true"] .document-zoom-viewport{
  position:relative;
  overflow:hidden;
  background:#fff;
  touch-action:none;
  overscroll-behavior:contain;
  contain:layout paint;
}
.document-zoom-surface[data-zoom-ready="true"] .document-zoom-content{
  position:absolute;
  max-width:none!important;
  width:var(--document-source-width, auto);
  height:var(--document-source-height, auto);
  margin:0!important;
  transform-origin:top center!important;
  image-rendering:auto!important;
  image-rendering:-webkit-optimize-contrast;
  backface-visibility:hidden;
  -webkit-backface-visibility:hidden;
  transform-style:preserve-3d;
}
.paystub-page-zoom.document-zoom-surface,
.paystub-image-zoom.document-zoom-surface,
.scanned-dive-zoom.document-zoom-surface{
  width:100%;
  max-width:100%;
  background:#fff;
}
.paystub-page-zoom .document-zoom-viewport,
.paystub-image-zoom .document-zoom-viewport,
.scanned-dive-zoom .document-zoom-viewport{
  width:100%;
  min-height:260px;
  border:0;
}
.paystub-document-page,
.clean-paystub-image,
.scan-image-wrap{
  background:#fff!important;
}
.paystub-document-page .document-zoom-content,
.clean-paystub-image .document-zoom-content,
.scan-image-wrap .document-zoom-content{
  filter:none!important;
}
.paystub-document-page .document-zoom-hint,
.clean-paystub-image .document-zoom-hint,
.scan-image-wrap .document-zoom-hint{
  opacity:.55;
}
.paystub-document-page:hover .document-zoom-hint,
.clean-paystub-image:hover .document-zoom-hint,
.scan-image-wrap:hover .document-zoom-hint{
  opacity:.88;
}

/* Imports/document viewer final fit + clean page display
   - Fit Width/Fit Page/100% controls
   - borderless document pages with a light blue shadow
   - pay period/pay date moved to the top-left
   - viewer resizes with the browser window and uses the full available area */
.imports-book-panel,
.paystub-book-view{
  min-height:0!important;
  height:100%!important;
}
.paystub-page-frame{
  width:100%!important;
  height:calc(100vh - 192px)!important;
  min-height:520px!important;
  overflow:auto!important;
  padding:16px!important;
  box-sizing:border-box!important;
  align-items:stretch!important;
  justify-content:center!important;
}
.paystub-page{
  width:100%!important;
  max-width:none!important;
  min-height:100%!important;
  display:flex!important;
  flex-direction:column!important;
  box-sizing:border-box!important;
  background:#fffdf7!important;
  border:0!important;
  border-radius:12px!important;
  box-shadow:0 12px 34px rgba(96,165,250,.18)!important;
  padding:14px!important;
}
.paystub-page-header{
  flex:0 0 auto!important;
  border-bottom:1px solid rgba(15,23,42,.18)!important;
  padding-bottom:8px!important;
  margin-bottom:10px!important;
}
.paystub-page-top-left{
  display:flex!important;
  flex-direction:column!important;
  align-items:flex-start!important;
  justify-content:flex-start!important;
  gap:4px!important;
  min-width:0!important;
}
.paystub-header-meta{
  color:#111827!important;
  font-size:13px!important;
  line-height:1.35!important;
  text-align:left!important;
  background:transparent!important;
  border:0!important;
  padding:0!important;
}
.paystub-header-meta strong{
  font-weight:900!important;
}
.paystub-header-meta.muted-meta{
  color:#64748b!important;
}
.paystub-password-line{
  margin:0!important;
  font-size:12px!important;
  color:#475569!important;
}
.paystub-page-top-right{
  min-width:auto!important;
  align-items:flex-end!important;
}
.paystub-page-top-right > span{
  border:0!important;
  background:#eff6ff!important;
  color:#0f172a!important;
  box-shadow:0 4px 14px rgba(96,165,250,.16)!important;
}
.paystub-detected-meta{
  display:none!important;
}
.paystub-document-pages,
.single-paystub-document-page{
  flex:1 1 auto!important;
  min-height:0!important;
  max-height:none!important;
  height:100%!important;
  width:100%!important;
  overflow:hidden!important;
  background:transparent!important;
  border:0!important;
  padding:0!important;
  gap:0!important;
  align-items:stretch!important;
}
.paystub-document-page,
.clean-paystub-image,
.scan-image-wrap{
  flex:1 1 auto!important;
  width:100%!important;
  max-width:none!important;
  min-height:0!important;
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
  overflow:hidden!important;
  padding:0!important;
}
.document-zoom-surface{
  height:100%!important;
  min-height:0!important;
  display:flex!important;
  flex-direction:column!important;
  background:transparent!important;
  overflow:hidden!important;
}
.document-zoom-toolbar{
  flex:0 0 auto!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:6px!important;
  flex-wrap:wrap!important;
  padding:4px 6px 8px!important;
  background:transparent!important;
}
.document-zoom-toolbar .btn.tiny{
  padding:5px 8px!important;
  border-radius:999px!important;
  font-size:11px!important;
}
.document-zoom-toolbar .btn.tiny.active{
  background:#2563eb!important;
  border-color:#1d4ed8!important;
  color:#fff!important;
}
.document-zoom-viewport{
  flex:1 1 auto!important;
  width:100%!important;
  max-width:100%!important;
  min-height:320px!important;
  background:transparent!important;
  border:0!important;
  border-radius:0!important;
  overflow:hidden!important;
}
.document-zoom-content{
  background:#fff!important;
  box-shadow:0 12px 32px rgba(59,130,246,.22)!important;
  border:0!important;
}
.paystub-page-zoom.document-zoom-surface,
.paystub-image-zoom.document-zoom-surface,
.scanned-dive-zoom.document-zoom-surface{
  background:transparent!important;
}
.paystub-page-zoom .document-zoom-viewport,
.paystub-image-zoom .document-zoom-viewport,
.scanned-dive-zoom .document-zoom-viewport{
  min-height:320px!important;
  background:transparent!important;
}
.document-zoom-hint{
  opacity:.40!important;
}
.document-zoom-surface:hover .document-zoom-hint,
.document-zoom-surface:focus-within .document-zoom-hint{
  opacity:.82!important;
}
.document-zoom-reset:not(.document-zoom-toolbar .document-zoom-reset){
  display:none!important;
}
.paystub-page-actions{
  right:12px!important;
  bottom:12px!important;
}
.scan-page-notes{
  flex:0 0 auto!important;
  margin-top:10px!important;
  border-top:1px solid rgba(15,23,42,.16)!important;
  padding-top:8px!important;
}
body.theme-light .paystub-page{
  box-shadow:0 12px 34px rgba(59,130,246,.18)!important;
}
body.theme-light .document-zoom-content{
  box-shadow:0 12px 32px rgba(37,99,235,.20)!important;
}
@media (min-width:1200px){
  .paystub-page-frame{height:calc(100vh - 176px)!important}
}
@media (max-width:900px){
  .paystub-page-frame{height:calc(var(--app-vh, 1vh) * 100 - 210px)!important;min-height:420px!important;padding:10px!important}
  .paystub-page{padding:10px!important}
  .document-zoom-viewport{min-height:280px!important}
}
@media (max-width:700px){
  .paystub-page-header{gap:8px!important}
  .paystub-page-top-right{align-items:flex-start!important}
  .document-zoom-toolbar{justify-content:flex-start!important;overflow-x:auto!important;flex-wrap:nowrap!important;padding:4px 0 8px!important}
  .paystub-page-actions{position:static!important;margin:8px 0 0!important;justify-content:center!important}
}
.document-zoom-surface > .document-zoom-reset{display:none!important}


/* Imports/document viewer toolbar cleanup + fit-window page view */
.document-zoom-hint{display:none!important}
.document-zoom-toolbar{
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:6px!important;
  flex-wrap:wrap!important;
  padding:2px 6px 8px!important;
}
.document-zoom-toolbar .zoom-percent{
  min-width:52px;
  text-align:center;
  font-size:12px;
  font-weight:900;
  color:#dbeafe;
  background:rgba(15,23,42,.82);
  border:1px solid rgba(96,165,250,.45);
  border-radius:999px;
  padding:5px 9px;
}
body.theme-light .document-zoom-toolbar .zoom-percent{
  color:#0f172a;
  background:#eff6ff;
  border-color:#bfdbfe;
}
.document-zoom-toolbar [data-document-fit]{display:none!important}
.document-zoom-toolbar .page-tool{
  min-width:34px!important;
  font-size:13px!important;
  line-height:1!important;
}
.paystub-book-view > .book-nav{display:none!important}
.paystub-page-frame{
  overflow:hidden!important;
  align-items:stretch!important;
}
.paystub-page{
  height:100%!important;
  min-height:0!important;
}
.paystub-document-page-label{display:none!important}
.paystub-page-top-right > span{
  white-space:nowrap!important;
}
.paystub-document-page,
.clean-paystub-image,
.scan-image-wrap{
  display:flex!important;
  flex-direction:column!important;
}
.document-zoom-surface{
  flex:1 1 auto!important;
}
.document-zoom-viewport{
  flex:1 1 auto!important;
}
.scan-page-notes:empty{display:none!important}
@media (max-width:700px){
  .document-zoom-toolbar{justify-content:center!important;overflow-x:auto!important;flex-wrap:nowrap!important}
  .document-zoom-toolbar .page-tool{min-width:38px!important}
}

/* ---------- CONFIRMED CHANGE SET: settings sidebar, pay periods, icons ---------- */
.settings-menu nav a.active{background:#2563eb;color:#ffffff;font-weight:900;}
.settings-section{display:none;}
.settings-section.active{display:block;}
.normal-period-options.hidden,.fixed-period-options.hidden{display:none!important;}
.current-period-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-top:10px;}
.current-period-grid div{background:#0b1728;border:1px solid #263a56;border-radius:14px;padding:12px;display:flex;flex-direction:column;gap:5px;}
.current-period-grid span{font-size:12px;color:#93a7bd;font-weight:800;text-transform:uppercase;letter-spacing:.04em;}
.current-period-grid strong{font-size:18px;color:#f8fafc;}
body.theme-light .current-period-grid div{background:#f8fafc;border-color:#d8e1ec;}
body.theme-light .current-period-grid span{color:#64748b;}
body.theme-light .current-period-grid strong{color:#0f172a;}
.pay-period-row{cursor:pointer;background:#eef9ff!important;font-weight:800;}
.pay-period-row td{border-top:2px solid #9bd2ff!important;border-bottom:2px solid #d8eaf8!important;}
.pay-period-row:hover{background:#dff2ff!important;}
.pay-entry-child td:first-child{padding-left:24px;}
.pay-entry-child{background:#fff!important;}
.period-toggle-cell{white-space:nowrap;}
.period-caret{display:inline-flex;width:22px;height:22px;border-radius:8px;background:#0f766e;color:#fff;align-items:center;justify-content:center;margin-right:6px;font-weight:900;}
.dive-helmet-icon{display:inline-block;width:1.15em;height:1.15em;vertical-align:-0.18em;object-fit:contain;}
.dive-helmet-icon.small{width:18px;height:18px;vertical-align:middle;}
.dive-helmet-icon.cover{width:82px;height:82px;margin:18px auto 4px;filter:drop-shadow(0 8px 18px rgba(0,0,0,.3));}
.book-cover.dive-cover{background:linear-gradient(145deg,#0b4ea2,#0e86d8 48%,#082f6b)!important;}
.entry-select-check{display:none;width:auto!important;margin-right:6px;}
.calendar-delete-mode .entry-select-check{display:inline-block;}
.calendar-day-toolbar{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:8px 0;}
.calendar-day-toolbar h3{margin:0;font-size:14px;}
.calendar-delete-selected,.calendar-filter-btn{width:34px;height:34px;border-radius:10px;border:1px solid #355278;background:#0b1728;color:#e5f1ff;font-weight:900;cursor:pointer;}
.calendar-delete-selected{display:none;background:#7f1d1d;border-color:#dc2626;}
.calendar-delete-mode .calendar-delete-selected{display:inline-grid;place-items:center;}
.calendar-filter-tags{display:flex;gap:5px;flex-wrap:wrap;margin:4px 0 8px;}
.calendar-filter-tag{border:1px solid #355278;background:#0b1728;border-radius:999px;padding:3px 7px;font-size:12px;}
.calendar-filter-form{display:grid;gap:12px;}
.calendar-filter-icon-row{display:flex;gap:10px;flex-wrap:wrap;align-items:center;}
.calendar-filter-icon-row label{display:inline-flex;flex-direction:row;align-items:center;gap:5px;width:auto;margin:0;background:#0b1728;border:1px solid #263a56;border-radius:12px;padding:8px 10px;}
.entry-delete-btn{margin-left:auto;border:0;border-radius:8px;background:#991b1b;color:#fff;font-weight:900;padding:6px 9px;cursor:pointer;}
.entry-detail-delete{background:#991b1b!important;color:#fff!important;}
@media(max-width:900px){.current-period-grid{grid-template-columns:repeat(2,minmax(0,1fr));}}
@media(max-width:600px){.current-period-grid{grid-template-columns:1fr;}}

/* ---------- PAY PROFILE LINKED SETTINGS UPDATE ---------- */
.settings-shell{
  max-width:none!important;
  width:100%!important;
  align-items:start;
}
.settings-content,.settings-section,.settings-grid{width:100%;}
.settings-grid{grid-template-columns:repeat(2,minmax(360px,1fr));}
.settings-section.active{display:block;}
.pay-profile-settings-card{grid-column:1 / -1;}
.pay-profile-two-column{
  display:grid;
  grid-template-columns:minmax(320px,.85fr) minmax(360px,1.15fr);
  gap:18px;
  align-items:start;
}
.pay-profile-main-fields,.pay-profile-depth-panel{
  background:rgba(11,23,40,.42);
  border:1px solid #263a56;
  border-radius:16px;
  padding:14px;
}
.pay-profile-main-fields h4,.pay-profile-depth-panel h4,.tax-exempt-box h4{margin:0 0 10px;color:#e5edf8;}
.settings-profile-panel{margin-top:14px;border-top:1px solid #263a56;padding-top:8px;}
.settings-profile-list{display:grid;gap:7px;}
.settings-profile-row{display:grid;grid-template-columns:1fr 38px;gap:6px;align-items:center;border:1px solid #263a56;background:#0b1728;border-radius:13px;padding:5px;}
.settings-profile-row.active{border-color:#60a5fa;box-shadow:0 0 0 2px rgba(96,165,250,.16);}
.settings-profile-row.locked{border-color:#dc2626;background:#2a1017;}
.settings-profile-row.locked .profile-side-select span{color:#fecaca;}
.profile-side-select{border:0;background:transparent;color:#dbe7f6;text-align:left;display:flex;flex-direction:column;gap:2px;cursor:pointer;min-width:0;padding:6px;}
.profile-side-select span{font-weight:850;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.profile-side-select em{font-style:normal;color:#93c5fd;font-size:10px;text-transform:uppercase;font-weight:900;}
.profile-lock-toggle{height:34px;width:34px;border-radius:10px;border:1px solid #334968;background:#16243a;color:#e5edf8;cursor:pointer;}
.profile-lock-toggle:hover{border-color:#60a5fa;}
.profile-edit-locked-note{background:#450a0a;border:1px solid #dc2626;color:#fee2e2;border-radius:12px;padding:10px;margin-bottom:12px;font-weight:800;}
.profile-locked{opacity:.72;}
.profile-locked input,.profile-locked select,.profile-locked textarea{cursor:not-allowed;}
.tax-exempt-box{border:1px solid #263a56;background:rgba(11,23,40,.42);border-radius:16px;padding:12px;margin-bottom:14px;}
.profile-linked-info-card{align-self:start;}
.optional-depth-field.hidden,.optional-travel-field.hidden{display:none!important;}
body.theme-light .pay-profile-main-fields,body.theme-light .pay-profile-depth-panel,body.theme-light .tax-exempt-box{background:#f8fafc;border-color:#d8e1ec;}
body.theme-light .pay-profile-main-fields h4,body.theme-light .pay-profile-depth-panel h4,body.theme-light .tax-exempt-box h4{color:#0f172a;}
body.theme-light .settings-profile-row{background:#f8fafc;border-color:#d8e1ec;}
body.theme-light .settings-profile-row.locked{background:#fee2e2;border-color:#dc2626;}
body.theme-light .profile-side-select{color:#0f172a;}
body.theme-light .settings-profile-row.locked .profile-side-select span{color:#7f1d1d;}
body.theme-light .profile-lock-toggle{background:#eef2f7;color:#0f172a;border-color:#cbd5e1;}
@media(max-width:1100px){
  .settings-shell{grid-template-columns:250px 1fr;}
  .pay-profile-two-column,.settings-grid{grid-template-columns:1fr;}
}
@media(max-width:760px){
  .settings-shell{grid-template-columns:1fr;padding:12px;}
  .settings-menu{position:relative;top:0;}
}

/* ---------- NEW CHANGES: dashboard date/time, draggable cards, Tax/W-4 columns, Imports Coming Soon ---------- */
.dashboard-title-row{align-items:center;gap:18px;}
.dashboard-title-actions{display:flex;align-items:center;gap:12px;flex-wrap:wrap;justify-content:flex-end;}
.dashboard-clock{padding:10px 14px;min-width:190px;text-align:right;border-radius:16px;}
.dashboard-clock span{display:block;color:#93a7bd;font-size:12px;font-weight:900;text-transform:uppercase;letter-spacing:.05em;}
.dashboard-clock strong{display:block;color:#f8fafc;font-size:20px;line-height:1.15;margin-top:2px;}
.dashboard-widget{position:relative;transition:transform .15s ease, box-shadow .15s ease, border-color .15s ease;}
.dashboard-widget.dragging{opacity:.55;transform:scale(.985);border-color:#60a5fa;}
.dashboard-card-tools{display:none;position:absolute;top:10px;right:10px;gap:5px;z-index:2;align-items:center;}
.dashboard-edit-mode .dashboard-card-tools{display:flex;}
.dashboard-edit-mode .dashboard-widget{padding-top:44px;cursor:grab;outline:1px dashed rgba(96,165,250,.4);outline-offset:-8px;}
.dashboard-edit-mode .dashboard-widget:active{cursor:grabbing;}
.drag-grip,.card-move-btn{height:28px;min-width:28px;border-radius:8px;border:1px solid #355278;background:#0b1728;color:#e5f1ff;font-weight:900;display:inline-grid;place-items:center;}
.drag-grip{padding:0 7px;cursor:grab;}
.card-move-btn{cursor:pointer;}
.card-move-btn:hover,.drag-grip:hover{border-color:#60a5fa;background:#14243a;}
body.theme-light .dashboard-clock{background:#f8fafc;border-color:#cbd5e1;}
body.theme-light .dashboard-clock span{color:#64748b;}
body.theme-light .dashboard-clock strong{color:#0f172a;}
body.theme-light .drag-grip,body.theme-light .card-move-btn{background:#f8fafc;color:#0f172a;border-color:#cbd5e1;}

.tax-w4-two-column{display:grid;grid-template-columns:minmax(320px,1fr) minmax(320px,1fr);gap:18px;align-items:start;width:100%;}
.tax-w4-column{background:rgba(11,23,40,.42);border:1px solid #263a56;border-radius:16px;padding:14px;min-width:0;}
.tax-w4-column h4{margin:0 0 12px;color:#e5edf8;}
#tax-w4-settings .settings-grid{grid-template-columns:1fr!important;}
#tax-w4-settings form{width:100%;}
body.theme-light .tax-w4-column{background:#f8fafc;border-color:#d8e1ec;}
body.theme-light .tax-w4-column h4{color:#0f172a;}

.coming-soon-cover:after{content:"";position:absolute;inset:0;background:linear-gradient(180deg,rgba(15,23,42,.05),rgba(15,23,42,.28));pointer-events:none;}
.coming-soon-badge{position:absolute;top:14px;right:14px;z-index:2;background:rgba(15,23,42,.88);border:1px solid rgba(255,255,255,.35);border-radius:999px;padding:5px 9px;font-size:11px;font-weight:900;text-transform:uppercase;letter-spacing:.06em;color:#dbeafe;}
.imports-bookshelf .placeholder-book{cursor:not-allowed!important;opacity:.82;}
.imports-bookshelf .placeholder-book:hover,.imports-bookshelf .placeholder-book:focus{transform:none!important;border-color:#475569!important;}
.imports-bookshelf .placeholder-book h2:after{content:" Coming Soon";font-size:11px;margin-left:8px;background:#1e3a8a;color:#dbeafe;border:1px solid #60a5fa;border-radius:999px;padding:3px 7px;vertical-align:middle;white-space:nowrap;}

@media(max-width:900px){
  .dashboard-title-row{align-items:flex-start;}
  .dashboard-title-actions{justify-content:flex-start;width:100%;}
  .dashboard-clock{text-align:left;min-width:0;flex:1 1 180px;}
  .tax-w4-two-column{grid-template-columns:1fr;}
}

/* ---------- ONLINE READY SETTINGS ---------- */
.online-settings-grid {
  grid-template-columns: repeat(2, minmax(340px, 1fr));
  align-items: start;
}
.settings-note-list {
  margin: 12px 0 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.55;
}
.online-status-card {
  min-height: 100%;
}
.storage-usage-rows {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}
.storage-summary.large {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
}
.storage-usage-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255,255,255,.045);
  border: 1px solid rgba(255,255,255,.08);
}
.storage-usage-row em {
  color: var(--muted);
  font-style: normal;
  font-size: .9rem;
}
.hidden {
  display: none !important;
}
@media (max-width: 900px) {
  .online-settings-grid {
    grid-template-columns: 1fr;
  }
  .storage-usage-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}


/* Online prep login / private hosting helpers */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.logout-link {
  color: var(--text-muted, #b8c7dc);
  text-decoration: none;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 999px;
  padding: 0.45rem 0.75rem;
  font-size: 0.9rem;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
}
.logout-link:hover { color: #fff; border-color: rgba(96, 165, 250, 0.7); }
.auth-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.25rem;
}
.auth-shell {
  width: min(440px, 100%);
}
.auth-card {
  background: rgba(15, 23, 42, 0.94);
  border: 1px solid rgba(96, 165, 250, 0.35);
  border-radius: 22px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.35);
  padding: 1.4rem;
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 1.2rem;
}
.auth-brand h1 {
  margin: 0;
  font-size: 1.35rem;
}
.auth-brand p {
  margin: 0.2rem 0 0;
  color: var(--text-muted, #b8c7dc);
}
.auth-form {
  display: grid;
  gap: 0.9rem;
}
.auth-form label {
  display: grid;
  gap: 0.35rem;
  font-weight: 700;
}
.auth-form input:not([type="checkbox"]) {
  min-height: 46px;
}
.auth-remember {
  display: flex !important;
  align-items: center;
  grid-template-columns: auto 1fr;
  font-weight: 600 !important;
}
.full-width { width: 100%; justify-content: center; }
.auth-error {
  background: rgba(239, 68, 68, 0.16);
  border: 1px solid rgba(239, 68, 68, 0.45);
  color: #fecaca;
  border-radius: 12px;
  padding: 0.75rem;
  margin-bottom: 1rem;
}
.auth-note {
  color: var(--text-muted, #b8c7dc);
  font-size: 0.9rem;
  line-height: 1.45;
  margin: 1rem 0 0;
}
@media (max-width: 720px) {
  .header-actions { margin-left: auto; }
  .logout-link { padding: 0.5rem 0.65rem; }
}

/* WorkProof branding / update center / offline status */
.brand{gap:10px}.brand-tagline{display:block;font-size:10px;color:#93c5fd;font-weight:700;letter-spacing:.02em;margin-top:2px}.brand > span:last-child{display:grid;line-height:1.05}.brand-mark{font-weight:900}
.offline-status-banner{position:fixed;z-index:300;left:50%;bottom:18px;transform:translateX(-50%) translateY(18px);max-width:min(720px,calc(100vw - 28px));background:#7c2d12;color:#ffedd5;border:1px solid #fb923c;border-radius:999px;padding:10px 16px;font-size:13px;font-weight:850;box-shadow:0 18px 45px rgba(0,0,0,.35);opacity:0;pointer-events:none;transition:.2s}.offline-status-banner.visible{opacity:1;transform:translateX(-50%) translateY(0)}
.update-protected-list{display:flex;flex-wrap:wrap;gap:8px;margin:8px 0 14px;color:#cbd5e1;font-size:12px}.update-protected-list span{border:1px solid #355278;background:#0b1728;border-radius:999px;padding:4px 8px;font-weight:850}.update-preview{margin-top:12px}.update-ready-box{border:1px solid #355278;background:#0b1728;border-radius:14px;padding:12px;display:grid;gap:6px}.update-ready-box details{margin-top:4px}.update-ready-box ul{max-height:180px;overflow:auto;margin:8px 0 0;padding-left:18px;color:#b9c9df;font-size:12px}.update-history-list{display:grid;gap:8px}.update-history-row{display:grid;gap:3px;border:1px solid #263a56;background:#0b1728;border-radius:12px;padding:10px}.update-history-row strong{text-transform:capitalize;color:#dbeafe}.update-history-row span,.update-history-row small{color:#b9c9df;font-size:12px}
body.theme-light .brand-tagline{color:#1d4ed8}body.theme-light .update-protected-list span,body.theme-light .update-ready-box,body.theme-light .update-history-row{background:#f8fafc;border-color:#cbd5e1;color:#0f172a}body.theme-light .update-history-row strong{color:#1d4ed8}body.theme-light .update-history-row span,body.theme-light .update-history-row small{color:#475569}

/* Calendar should fill available window space while keeping the existing controls. */
.calendar-page-shell.calendar-workspace{width:100%;max-width:none;min-height:calc((var(--app-vh,1vh) * 100) - 74px);align-items:stretch;padding:12px;grid-template-columns:minmax(236px,300px) minmax(0,1fr)}
.calendar-main-stage{min-width:0;min-height:calc((var(--app-vh,1vh) * 100) - 104px);display:flex;flex-direction:column}.calendar-view-pane.active{display:flex!important;flex:1;min-height:0}.calendar-view-pane.hidden{display:none!important}#monthViewPane.active .calendar-card{display:flex;flex-direction:column;flex:1;min-height:calc((var(--app-vh,1vh) * 100) - 112px);height:auto}.calendar-grid{flex:1;min-height:0;grid-auto-rows:minmax(88px,1fr)}.calendar-day,.calendar-empty{min-height:auto}.weekly-calendar-card{display:flex;flex-direction:column;flex:1;min-height:calc((var(--app-vh,1vh) * 100) - 112px)}.weekly-grid{flex:1;max-height:none}.calendar-side-menu{max-height:calc((var(--app-vh,1vh) * 100) - 96px);overflow:auto}.calendar-workspace.calendar-side-collapsed{grid-template-columns:74px minmax(0,1fr)}
@media(max-width:980px){.calendar-page-shell.calendar-workspace{grid-template-columns:1fr;padding:10px}.calendar-main-stage,#monthViewPane.active .calendar-card,.weekly-calendar-card{min-height:auto}.calendar-grid{grid-auto-rows:minmax(108px,auto)}.calendar-side-menu{max-height:none;position:static}}


/* WorkProof V1.1 updates */
.double-depth-check{display:flex!important;flex-direction:row!important;align-items:center!important;gap:8px!important;align-self:end;min-height:34px;padding:7px 10px;border:1px solid #cbd6e2;border-radius:7px;background:#fff;color:#00152b!important;font-size:12px;font-weight:700}.double-depth-check input{width:auto!important;height:auto!important;margin:0}.double-depth-check span{white-space:nowrap}.mark-unused-controls{grid-column:1/-1;display:flex;align-items:center;justify-content:center;gap:10px;border:1.5px solid #111;border-top:0;background:#fff7f7;color:#111;padding:4px 6px;font-size:8px;text-transform:uppercase;font-weight:900}.mark-unused-controls label{display:flex;flex-direction:row;align-items:center;gap:3px;color:#111;margin:0;font-size:8px}.mark-unused-controls input{appearance:none;width:13px;height:13px;border:1.5px solid #111;background:#fff;border-radius:0;padding:0}.mark-unused-controls input:checked{background:#fecaca;box-shadow:inset 0 0 0 2px #fff}.mark-unused-controls input:checked:after{content:"✓";font-size:11px;line-height:11px;display:block;text-align:center;color:#111}.reference-dive-column.marked-unused{position:relative}.reference-dive-column.marked-unused:after{content:"";position:absolute;inset:3px;background:linear-gradient(to bottom right,transparent calc(50% - 1.4px),rgba(185,28,28,.85) 50%,transparent calc(50% + 1.4px));pointer-events:none;z-index:3}.app-version-card{display:flex;flex-direction:column;gap:4px;background:#0b1728;border:1px solid #263a56;border-radius:14px;padding:12px;margin-bottom:12px}.app-version-card strong{color:#cbd5e1;font-size:12px;text-transform:uppercase;letter-spacing:.06em}.app-version-card span{font-size:26px;font-weight:900;color:#dbeafe}.app-version-card small{color:#93a4bb}.calendar-filter-form select[name="pay_period_filter"]{min-width:100%}body.theme-light .app-version-card{background:#f8fafc;border-color:#d8e1ec}.logbook-app,.imports-layout,.imports-workspace{height:calc(100vh - 64px);overflow:hidden}.book-scroll,.imports-main,.paystub-book-stage,.scan-image-wrap{overscroll-behavior:contain}

/* ---------- WorkProof V1.2 pay tracker update ---------- */
.pay-period-selector-card{position:relative;}
.pay-period-card-head{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;margin-bottom:12px;}
.pay-period-card-head h2{margin:0 0 10px;}
.pay-period-controls{display:flex;align-items:end;gap:10px;flex-wrap:wrap;}
.pay-period-controls label{display:flex;flex-direction:column;gap:4px;margin:0;font-size:12px;color:#93a7bd;font-weight:800;text-transform:uppercase;letter-spacing:.04em;}
.pay-period-controls select{min-width:190px;height:36px;border-radius:10px;border:1px solid #355278;background:#0b1728;color:#f8fafc;padding:6px 10px;font-weight:800;}
.pay-period-ytd-box{display:grid;grid-template-columns:repeat(2,minmax(110px,1fr));gap:10px;min-width:250px;}
.pay-period-ytd-box div{background:#081527;border:1px solid #2f4a6a;border-radius:14px;padding:10px 12px;display:flex;flex-direction:column;gap:4px;}
.pay-period-ytd-box span{font-size:12px;color:#93a7bd;font-weight:900;letter-spacing:.04em;}
.pay-period-ytd-box strong{font-size:18px;color:#dbeafe;}
.pay-period-detail-grid{grid-template-columns:repeat(6,minmax(0,1fr));}
body.theme-light .pay-period-controls label{color:#64748b;}
body.theme-light .pay-period-controls select{background:#fff;color:#0f172a;border-color:#cbd5e1;}
body.theme-light .pay-period-ytd-box div{background:#f8fafc;border-color:#d8e1ec;}
body.theme-light .pay-period-ytd-box span{color:#64748b;}
body.theme-light .pay-period-ytd-box strong{color:#0f172a;}
@media(max-width:1000px){.pay-period-card-head{flex-direction:column}.pay-period-ytd-box{width:100%;min-width:0}.pay-period-detail-grid{grid-template-columns:repeat(2,minmax(0,1fr));}}
@media(max-width:600px){.pay-period-controls{display:grid;grid-template-columns:1fr;width:100%;}.pay-period-controls select,.pay-period-controls .btn{width:100%;min-width:0}.pay-period-ytd-box{grid-template-columns:1fr}.pay-period-detail-grid{grid-template-columns:1fr;}}

/* ---------- WORKPROOF V1.3 PAY ENTRY PRESETS / EDIT / HIGHLIGHT ---------- */
.pay-presets-row{display:flex;align-items:end;gap:10px;flex-wrap:wrap;margin:0 0 12px;}
.pay-presets-row label{display:flex;flex-direction:column;gap:4px;margin:0;color:#00152b;font-size:12px;font-weight:800;text-transform:uppercase;letter-spacing:.04em;}
.pay-presets-row select{min-width:220px;height:34px;background:#fff;color:#00152b;border:1px solid #cbd6e2;border-radius:7px;padding:7px 10px;font-size:12px;font-weight:700;}
.pay-edit-status{font-size:12px;font-weight:800;color:#0f766e;min-height:20px;display:inline-flex;align-items:center;}
.saved-entry-actions{white-space:nowrap;display:flex;gap:6px;align-items:center;}
.edit-entry-btn{background:#1565c0;color:#fff;border:0;border-radius:7px;padding:8px 12px;font-weight:800;cursor:pointer;}
.edit-entry-btn:hover{background:#0f4d91;}
.last-pay-entry-highlight td{animation:workproofLastEntryPulse 2.6s ease-in-out 1;background:#fff3bf!important;box-shadow:inset 0 0 0 9999px rgba(255,243,191,.45);}
@keyframes workproofLastEntryPulse{0%{background:#fde047;}45%{background:#fff3bf;}100%{background:#fff7d6;}}
body.theme-dark .pay-presets-row label{color:#00152b;}
@media(max-width:700px){.pay-presets-row{display:grid;grid-template-columns:1fr;align-items:stretch}.pay-presets-row select,.pay-presets-row .btn{width:100%;min-width:0}.saved-entry-actions{flex-direction:column;align-items:stretch}.saved-entry-actions button{width:100%;}}

/* WorkProof V1.4 */
.saved-entries-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}.saved-entries-head h2{margin:0!important}.saved-entries-card.saved-entries-collapsed{padding-bottom:14px}.clock-button-row{display:flex!important;align-items:end;gap:8px;align-self:end;min-height:34px}.clock-button-row[hidden],.clock-button-row.hidden{display:none!important}.clock-hours-preview{font-size:12px;font-weight:800;color:#0f3b47;align-self:center}.optional-depth-field.hidden,.optional-per-diem-field.hidden,.optional-mileage-field.hidden,.optional-travel-field.hidden,.calendar-optional-depth-field.hidden,.calendar-optional-per-diem-field.hidden,.calendar-optional-mileage-field.hidden,.double-depth-check.hidden,.double-depth-check.optional-depth-field.hidden,.double-depth-check.calendar-optional-depth-field.hidden{display:none!important}.time-entry-field.hidden,.hours-worked-field.hidden,.calendar-time-entry-field.hidden,.calendar-hours-worked-field.hidden{display:none!important}.calendar-time-entry-field.clock-button-row{grid-column:span 1}.calendar-time-entry-field.clock-button-row .btn{width:auto;min-width:86px}.pay-totals-box .optional-per-diem-field[hidden],.pay-totals-box .calendar-optional-per-diem-field[hidden]{display:none!important}

/* V1.5 global app preference feature toggles */
.settings-subsection{border:1px solid var(--line);border-radius:14px;padding:12px;margin-top:12px;background:rgba(255,255,255,.03)}
.settings-subsection h4{margin:0 0 6px;font-size:14px;color:#e5efff}
body.theme-light .settings-subsection{background:#f8fafc}
body.theme-light .settings-subsection h4{color:#0f172a}


/* V1.6 Pay Entry warnings, OFF days, and date/day display */
.pay-entry-date-line{display:flex;align-items:center;gap:7px;white-space:nowrap}.pay-entry-day{color:#52647a;font-weight:700}.off-entry-badge{display:inline-flex;align-items:center;border:1px solid #b7791f;background:#fff7d6;color:#7a4c00;border-radius:999px;padding:2px 7px;font-size:10px;font-weight:900;letter-spacing:.04em}.pay-warning-backdrop{position:fixed;inset:0;z-index:320;background:rgba(2,6,23,.72);display:flex;align-items:center;justify-content:center;padding:18px}.pay-warning-modal{width:min(560px,100%);background:#fff;color:#00152b;border:1px solid #d8e1ec;border-radius:18px;box-shadow:0 28px 80px rgba(0,0,0,.38);padding:20px;display:flex;gap:14px}.pay-warning-icon{width:38px;height:38px;flex:0 0 38px;border-radius:50%;display:grid;place-items:center;background:#fff3cd;border:1px solid #e7b94e;color:#7a4c00;font-size:22px;font-weight:900}.pay-warning-copy{min-width:0;flex:1}.pay-warning-copy h2{margin:0 0 8px;color:#00152b}.pay-warning-copy p{margin:0;color:#334155;line-height:1.5;white-space:pre-line}.pay-warning-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:9px;margin-top:18px}.pay-warning-actions .btn{min-width:112px}.pay-warning-actions .warning-primary{background:#158174;color:#fff;border-color:#158174}.pay-warning-actions .warning-danger{background:#b42318;color:#fff;border-color:#b42318}@media(max-width:600px){.pay-warning-modal{padding:16px}.pay-warning-actions{display:grid;grid-template-columns:1fr}.pay-warning-actions .btn{width:100%}.pay-entry-date-line{white-space:normal;flex-wrap:wrap}}

/* WorkProof V1.61 Offline Mode */
.sync-chip.sync-pending{border-color:#d97706;background:#3b2607;color:#fde68a}
.sync-chip.sync-failed{border-color:#dc2626;background:#3f1010;color:#fecaca}
.sync-chip.sync-offline{border-color:#f59e0b;background:#422006;color:#ffedd5}
.offline-entry-badge{display:inline-flex;align-items:center;margin-left:8px;padding:2px 7px;border:1px solid #f59e0b;border-radius:999px;background:#422006;color:#fde68a;font-size:10px;font-weight:900;letter-spacing:.04em;white-space:nowrap}
.offline-pending-period{background:rgba(245,158,11,.12)!important}
.offline-pending-period td{border-top:1px solid rgba(245,158,11,.45);border-bottom:1px solid rgba(245,158,11,.25)}
.offline-pending-dot{color:#f59e0b;margin-right:7px}
.offline-change-note td{color:#fbbf24;font-size:12px;font-weight:750;padding:8px 14px}
body.theme-light .sync-chip.sync-pending{background:#fffbeb;color:#92400e;border-color:#f59e0b}
body.theme-light .sync-chip.sync-failed{background:#fef2f2;color:#991b1b;border-color:#ef4444}
body.theme-light .sync-chip.sync-offline{background:#fff7ed;color:#9a3412;border-color:#fb923c}
body.theme-light .offline-entry-badge{background:#fffbeb;color:#92400e}

/* WorkProof V1.62 Saved Entries: one dropdown per pay period */
.saved-period-dropdown-line{display:flex;align-items:center;justify-content:space-between;gap:14px;width:100%;padding:2px 0;}
.saved-period-dropdown-title{display:flex;align-items:center;gap:8px;min-width:0;}
.saved-period-dropdown-title strong{font-weight:900;}
.saved-period-dropdown-title>span:last-child{white-space:nowrap;}
.saved-period-dropdown-summary{display:flex;align-items:center;justify-content:flex-end;gap:10px;flex-wrap:wrap;font-size:12px;font-weight:800;}
.saved-period-dropdown-summary>span:not(.offline-entry-badge){background:rgba(255,255,255,.72);border:1px solid #c7deef;border-radius:999px;padding:4px 8px;white-space:nowrap;}
.pay-period-row .period-caret{display:inline-grid;place-items:center;width:22px;height:22px;border-radius:6px;background:#d7ecfb;border:1px solid #9bcce9;font-weight:950;flex:0 0 auto;}
@media (max-width:760px){.saved-period-dropdown-line{align-items:flex-start;flex-direction:column}.saved-period-dropdown-summary{justify-content:flex-start}.saved-period-dropdown-title>span:last-child{white-space:normal}}

/* WorkProof V1.62 Saved Entries alignment fix: pay-period totals use table columns */
.pay-period-row td{vertical-align:middle;}
.pay-period-row .period-toggle-cell{white-space:nowrap;}
.pay-period-row .saved-period-dropdown-title{display:flex;align-items:center;gap:8px;min-width:0;}
.pay-period-row .saved-period-dropdown-title>span:last-child{white-space:nowrap;}
.pay-period-row .pay-period-total-cell{white-space:nowrap;font-weight:900;}
@media (max-width:760px){.pay-period-row .saved-period-dropdown-title>span:last-child{white-space:normal;}}

/* V1.63: existing Calendar year view and non-work day management. */
.calendar-year-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin-top:16px}
.calendar-year-month{min-width:0;border:1px solid var(--border-color,#475569);border-radius:10px;padding:10px;background:var(--card-bg,transparent)}
.calendar-year-month h3{font-size:1rem;margin:0 0 10px;text-align:center}
.calendar-year-days{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:3px;text-align:center}
.calendar-year-weekday{font-size:.7rem;font-weight:700;opacity:.7;padding:3px 0}
.calendar-year-day{min-width:0;min-height:30px;border:1px solid transparent;border-radius:6px;background:transparent;color:inherit;cursor:pointer;font:inherit;font-size:.8rem;padding:3px 0}
.calendar-year-day.status-work{background:#2563eb26;border-color:#2563eb66}
.calendar-year-day.status-off{background:#64748b30;border-color:#64748b77}
.calendar-year-day.status-vacation{background:#16a34a30;border-color:#16a34a88}
.calendar-year-day.status-sick{background:#d9770630;border-color:#d9770688}
.calendar-year-day.leave-selected{background:#2563eb;color:#fff;border-color:#93c5fd;font-weight:700}
.calendar-year-day:disabled{opacity:.65;cursor:not-allowed}
.calendar-year-day:focus-visible{outline:3px solid #60a5fa;outline-offset:1px}
.calendar-year-day.leave-pending span{font-size:.65rem;margin-left:1px}
.calendar-leave-controls,.calendar-leave-actions{display:flex;gap:8px;align-items:end;flex-wrap:wrap}
.calendar-leave-controls label{flex:1;min-width:90px}
.calendar-leave-controls input{width:100%}
#calendarLeaveSection .calendar-section-content>label{display:block;margin:10px 0}
#calendarLeaveSection .calendar-section-content>label select,#calendarLeaveSection .calendar-section-content>label input{width:100%;margin-top:4px}
.chip-leave,.week-leave,.entry-leave{border-color:#64748b88;background:#64748b24}
.calendar-view-switch{display:flex;flex-wrap:wrap}
.calendar-view-switch .btn{flex:1;min-width:0}
.update-history-card details{margin:8px 0}
.update-history-card summary{cursor:pointer}
.update-history-card li{margin:5px 0}
@media(max-width:900px){.calendar-year-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:560px){.calendar-year-grid{grid-template-columns:1fr}.calendar-year-day{min-height:38px;font-size:.9rem}}

/* V1.64: compact day summaries beside the existing pay totals. */
.day-summary-grid,.day-totals-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(125px,1fr));gap:12px}
.day-summary-grid>div{display:flex;flex-direction:column;gap:5px;padding:12px;border:1px solid var(--border-color,#475569);border-radius:10px;min-width:0}
.day-summary-grid span{font-size:.85rem;opacity:.8}.day-summary-grid strong{font-size:1.4rem}
.pay-period-card-head{flex-wrap:wrap;gap:16px}.pay-period-ytd-box.day-totals-grid{flex:1 1 280px}
.beta-admin-table{width:100%;border-collapse:collapse}.beta-admin-table td,.beta-admin-table th{padding:10px;text-align:left;border-bottom:1px solid #64748b;vertical-align:top}
.beta-admin-actions{display:flex;gap:8px;flex-wrap:wrap}.beta-result{overflow-wrap:anywhere;white-space:pre-wrap}
.beta-admin-table-wrap{overflow-x:auto}.beta-account-status{font-size:.9rem;opacity:.8}


/* V1.65 Log Book section-entry helper. The printable Record of Dive page is unchanged. */
.dive-section-modal-card{width:min(820px,100%);max-height:calc(100vh - 40px);overflow:auto}
.dive-section-modal-head{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;margin-bottom:10px}.dive-section-modal-head h2{margin:0 0 4px}
.dive-section-status{display:flex;gap:7px;flex-wrap:wrap;margin:10px 0 14px}.dive-section-chip{border:1px solid #334968;background:#0a1424;color:#9fb2ca;border-radius:999px;padding:5px 9px;font-size:12px;font-weight:800}.dive-section-chip.has-data{border-color:#2f855a;background:#123524;color:#b8f7cf}
.dive-section-picker-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-bottom:14px}.dive-section-picker-grid label,.dive-section-field{display:grid;gap:5px;font-size:12px;font-weight:800;color:#cbd5e1}.dive-section-picker-grid select,.dive-section-field input{width:100%;background:#08111f;border:1px solid #334968;border-radius:10px;color:#e5f1ff;padding:10px}
.dive-section-form{border:1px solid #2b4261;background:#0b1728;border-radius:14px;padding:14px}.dive-section-group-title{font-size:15px;font-weight:900;color:#eef6ff;border-bottom:1px solid #2b4261;padding-bottom:9px;margin-bottom:12px}.dive-section-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.dive-section-grid.compact{grid-template-columns:minmax(180px,.7fr) 1.3fr}.dive-section-time-pair,.dive-section-time-triple{display:grid;gap:7px;border:1px solid #223851;border-radius:12px;padding:10px}.dive-section-time-pair{grid-template-columns:1fr 1fr}.dive-section-time-triple{grid-template-columns:repeat(3,1fr)}.dive-section-time-pair>span,.dive-section-time-triple>span{grid-column:1/-1;font-size:12px;font-weight:900;color:#cbd5e1}.dive-section-help{margin:10px 2px 0;color:#9fb2ca;font-size:12px}.dive-section-save-status{min-height:20px;margin-top:6px;color:#93c5fd;font-size:12px;font-weight:800}.dive-section-actions{justify-content:flex-end;margin-top:8px}
body.theme-light .dive-section-chip{background:#f3f6fa;color:#475569;border-color:#cbd5e1}body.theme-light .dive-section-chip.has-data{background:#ecfdf5;color:#166534;border-color:#86efac}body.theme-light .dive-section-picker-grid label,body.theme-light .dive-section-field{color:#334155}body.theme-light .dive-section-picker-grid select,body.theme-light .dive-section-field input{background:#fff;color:#0f172a;border-color:#cbd5e1}body.theme-light .dive-section-form{background:#f8fafc;border-color:#cbd5e1}body.theme-light .dive-section-group-title{color:#0f172a;border-color:#cbd5e1}body.theme-light .dive-section-time-pair,body.theme-light .dive-section-time-triple{border-color:#d8e1ec}body.theme-light .dive-section-time-pair>span,body.theme-light .dive-section-time-triple>span{color:#334155}
@media(max-width:700px){.dive-section-picker-grid,.dive-section-grid,.dive-section-grid.compact{grid-template-columns:1fr}.dive-section-time-pair,.dive-section-time-triple{grid-template-columns:repeat(2,minmax(0,1fr))}.dive-section-time-triple .dive-section-field:last-child{grid-column:1/-1}.dive-section-actions{display:grid;grid-template-columns:1fr}.dive-section-actions .btn{width:100%}}


/* V1.66 Log Book single-page viewer + bottom thumbnail navigation. */
.page-thumbnail-dock{
  flex:0 0 auto;
  border-top:1px solid #263a56;
  border-bottom:1px solid #17263e;
  background:linear-gradient(180deg,#0d1a2d,#08111f);
  padding:7px 12px 9px;
  box-shadow:0 -10px 24px rgba(0,0,0,.18);
}
.page-thumbnail-dock-head{display:flex;align-items:center;gap:10px;margin:0 2px 6px;color:#dbe7f6}
.page-thumbnail-dock-head strong{font-size:12px;text-transform:uppercase;letter-spacing:.07em}
.page-thumbnail-dock-head span{font-size:11px;color:#8fa4bf}
.page-thumbnail-strip{display:flex;gap:9px;overflow-x:auto;overflow-y:hidden;padding:2px 3px 5px;scroll-snap-type:x proximity;scrollbar-width:thin;scrollbar-color:#3b587b transparent}
.logbook-page-thumb{flex:0 0 auto;width:104px;border:1px solid #314966;background:#101d30;border-radius:10px;padding:5px;color:#dbe7f6;cursor:pointer;scroll-snap-align:center;display:grid;gap:4px;transition:transform .12s ease,border-color .12s ease,box-shadow .12s ease,background .12s ease}
.logbook-page-thumb:hover{transform:translateY(-2px);border-color:#60a5fa;background:#142944}
.logbook-page-thumb.active{border-color:#60a5fa;background:#173253;box-shadow:0 0 0 2px rgba(96,165,250,.22)}
.logbook-thumb-sheet{position:relative;width:72px;height:93px;margin:auto;background:#fffdf7;color:#111;border:1px solid #c8c0ad;border-radius:2px;padding:4px 4px 3px;display:flex;flex-direction:column;gap:2px;overflow:hidden;box-shadow:0 4px 10px rgba(0,0,0,.28);font-family:Arial,Helvetica,sans-serif}
.logbook-thumb-title{display:block;text-align:center;font-size:5px;font-weight:900;border:1px solid #111;padding:1px;line-height:1}
.logbook-thumb-meta{display:grid;grid-template-columns:1.2fr .8fr;gap:2px}.logbook-thumb-meta i,.logbook-thumb-rule{display:block;font-style:normal;font-size:4.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;border-bottom:1px solid #222;line-height:7px;min-height:7px}
.logbook-thumb-dives{display:grid;grid-template-columns:repeat(3,1fr);border:1px solid #222;min-height:25px}.logbook-thumb-dives i{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:2px;font-style:normal;border-right:1px solid #222;font-size:4px}.logbook-thumb-dives i:last-child{border-right:0}.logbook-thumb-dives b{font-size:4.4px}.logbook-thumb-dives em{font-style:normal;font-size:4px}
.logbook-thumb-lines{display:grid;gap:3px;flex:1;align-content:start;padding-top:1px}.logbook-thumb-lines i{display:block;border-bottom:1px solid #777;height:4px}
.logbook-thumb-page-no{display:block;text-align:center;font-size:4.5px;font-weight:800;line-height:5px}.thumb-lock{position:absolute;right:2px;bottom:2px;display:grid;place-items:center;width:9px;height:9px;border-radius:50%;background:#166534;color:#fff;font-size:6px;font-weight:900}
.logbook-thumb-caption{display:grid;line-height:1.05;text-align:center}.logbook-thumb-caption b{font-size:10px}.logbook-thumb-caption small{font-size:9px;color:#9fb2ca;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.empty-thumbnail-note{color:#8fa4bf;font-size:12px;padding:8px 4px}
.book-spread.real-open-book.single{padding:14px 16px 18px}.book-spread.real-open-book.single:after{inset:8px 9px 11px;border-radius:18px}.book-spread.real-open-book.single .log-page.left:after{display:none!important}.book-spread.real-open-book.single .log-page.left:before{display:block}
body.theme-light .page-thumbnail-dock{background:linear-gradient(180deg,#f8fafc,#e8eef6);border-color:#cbd5e1}body.theme-light .page-thumbnail-dock-head{color:#0f172a}body.theme-light .page-thumbnail-dock-head span{color:#64748b}body.theme-light .logbook-page-thumb{background:#fff;border-color:#cbd5e1;color:#0f172a}body.theme-light .logbook-page-thumb:hover,body.theme-light .logbook-page-thumb.active{background:#e8f2ff;border-color:#3b82f6}body.theme-light .logbook-thumb-caption small{color:#64748b}
@media(max-width:820px){
  .page-thumbnail-dock{padding:6px 8px 7px}
  .page-thumbnail-dock-head{display:none}
  .page-thumbnail-strip{gap:7px}
  .logbook-page-thumb{width:87px;padding:4px}
  .logbook-thumb-sheet{width:58px;height:75px}
  .logbook-thumb-caption b{font-size:9px}.logbook-thumb-caption small{font-size:8px}
}
@media print{.page-thumbnail-dock{display:none!important}}

/* V1.67 Log Book unified Add Dive form and single-sheet viewer. */
.unified-dive-modal-card{
  width:min(1080px,calc(100vw - 32px));
  max-height:calc(100vh - 28px);
  overflow:auto;
  padding:18px;
}
#diveEntryForm{display:grid;gap:14px}
.dive-entry-section{border:1px solid #2b4261;background:#0b1728;border-radius:14px;padding:14px;display:grid;gap:11px}
.dive-entry-section-title{font-size:15px;font-weight:900;color:#eef6ff;border-bottom:1px solid #2b4261;padding-bottom:8px}
.dive-entry-grid{display:grid;gap:10px}
.dive-entry-grid.two-col{grid-template-columns:repeat(2,minmax(0,1fr))}
.dive-entry-grid.conditions-grid{grid-template-columns:repeat(5,minmax(130px,1fr))}
.dive-entry-grid.dive-number-grid{grid-template-columns:repeat(4,minmax(140px,1fr))}
.dive-entry-section label,.dive-entry-dive-card label{display:grid;gap:5px;font-size:12px;font-weight:800;color:#cbd5e1}
.dive-entry-section input,.dive-entry-section select,.dive-entry-section textarea,.dive-entry-dive-card input{
  width:100%;background:#08111f;border:1px solid #334968;border-radius:9px;color:#e5f1ff;padding:9px 10px;font:inherit
}
.dive-entry-section textarea{resize:vertical;min-height:68px}
.all-dive-columns-form{display:grid;gap:12px}
.dive-entry-dive-card{border:1px solid #334968;background:#0a1424;border-radius:12px;padding:12px;display:grid;gap:10px}
.dive-entry-dive-head{display:flex;align-items:center;justify-content:space-between;gap:12px;border-bottom:1px solid #263a56;padding-bottom:8px}
.dive-entry-dive-head>strong{font-size:14px;color:#f8fbff}
.dive-entry-subtitle{font-size:12px;font-weight:900;color:#93c5fd;text-transform:uppercase;letter-spacing:.04em;margin-top:2px}
.dive-entry-check{display:flex!important;grid-auto-flow:column;justify-content:start;align-items:center;gap:7px!important}
.dive-entry-check input{width:auto!important;margin:0}
.dive-entry-check span{white-space:nowrap}
.dive-entry-right-align-note{margin:0;color:#b9c9dc}
.penetration-form-row{grid-template-columns:auto minmax(220px,1fr);align-items:end}
.dive-entry-save-status{min-height:20px;color:#93c5fd;font-weight:800;font-size:12px}
.dive-entry-actions{justify-content:flex-end;margin-top:0}

/* The existing Record of Dive stays visually and structurally unchanged;
   only its on-screen presentation is a single standalone sheet. */
.book-scroll{align-items:flex-start!important;overscroll-behavior:contain!important}
.book-spread.real-open-book.single{
  margin:0 auto!important;
  padding:16px 0 24px!important;
  background:none!important;
  box-shadow:none!important;
  border-radius:0!important;
}
.book-spread.real-open-book.single:before,
.book-spread.real-open-book.single:after,
.book-spread.real-open-book.single .log-page:before,
.book-spread.real-open-book.single .log-page:after{display:none!important}
.book-spread.real-open-book.single .log-page.left,
.book-spread.real-open-book.single .log-page.right{
  border-radius:2px!important;
  box-shadow:0 14px 34px rgba(0,0,0,.34),0 0 0 1px rgba(0,0,0,.10)!important;
}

body.theme-light .dive-entry-section{background:#f8fafc;border-color:#cbd5e1}
body.theme-light .dive-entry-section-title{color:#0f172a;border-color:#cbd5e1}
body.theme-light .dive-entry-dive-card{background:#fff;border-color:#cbd5e1}
body.theme-light .dive-entry-dive-head{border-color:#d8e1ec}
body.theme-light .dive-entry-dive-head>strong{color:#0f172a}
body.theme-light .dive-entry-subtitle{color:#1d4ed8}
body.theme-light .dive-entry-section label,body.theme-light .dive-entry-dive-card label{color:#334155}
body.theme-light .dive-entry-section input,body.theme-light .dive-entry-section select,body.theme-light .dive-entry-section textarea,body.theme-light .dive-entry-dive-card input{background:#fff;color:#0f172a;border-color:#cbd5e1}
body.theme-light .dive-entry-right-align-note{color:#475569}

@media(max-width:980px){
  .dive-entry-grid.conditions-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .dive-entry-grid.dive-number-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:640px){
  .unified-dive-modal-card{width:calc(100vw - 16px);max-height:calc(100svh - 16px);padding:12px}
  .dive-entry-grid.two-col,.dive-entry-grid.conditions-grid,.dive-entry-grid.dive-number-grid,.penetration-form-row{grid-template-columns:1fr}
  .dive-entry-dive-head{align-items:flex-start;flex-direction:column}
  .dive-entry-actions{display:grid;grid-template-columns:1fr}
  .dive-entry-actions .btn{width:100%}
}
@media print{
  .book-spread.real-open-book.single .log-page.left,
  .book-spread.real-open-book.single .log-page.right{box-shadow:none!important;border-radius:0!important}
}

/* V1.68 Log Book page management and viewer tools. The Record of Dive sheet itself is unchanged. */
.logbook-page-view-tools{
  flex:0 0 auto;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:12px;
  padding:8px 12px;
  background:#0b1728;
  border-bottom:1px solid #263a56;
}
.logbook-page-view-tools>strong{
  color:#cbd5e1;
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:.07em;
  white-space:nowrap;
}
.logbook-page-view-tools-actions{display:flex;align-items:center;justify-content:center;gap:7px;flex-wrap:wrap}
body.theme-light .logbook-page-view-tools{background:#fff;border-color:#d8e1ec}
body.theme-light .logbook-page-view-tools>strong{color:#475569}
@media(max-width:640px){
  .logbook-page-view-tools{justify-content:flex-start;overflow-x:auto;padding:7px 9px}
  .logbook-page-view-tools>strong{display:none}
  .logbook-page-view-tools-actions{flex-wrap:nowrap;justify-content:flex-start}
  .logbook-page-view-tools-actions .btn{white-space:nowrap}
}
@media print{.logbook-page-view-tools{display:none!important}}


/* V1.69 small-screen Log Book touch viewer.
   The Record of Dive sheet itself is unchanged. */
@media(max-width:820px){
  .logbook-app.mobile-logbook-mode .logbook-page-view-tools{display:none!important}
  .logbook-app.mobile-logbook-mode .page-thumbnail-dock{display:none!important}
  .logbook-app.mobile-logbook-mode .book-scroll{
    overscroll-behavior:none!important;
    scrollbar-width:none;
    -ms-overflow-style:none;
  }
  .logbook-app.mobile-logbook-mode .book-scroll::-webkit-scrollbar{display:none}
  .logbook-app.mobile-logbook-mode .book-nav{
    justify-content:center!important;
    min-height:42px!important;
    padding:5px 8px!important;
    overflow:hidden!important;
  }
  .logbook-app.mobile-logbook-mode .book-nav .page-arrow{display:none!important}
  .logbook-app.mobile-logbook-mode #pageCounter{
    display:inline-flex!important;
    align-items:center;
    justify-content:center;
    min-width:0!important;
    padding:6px 13px;
    border:1px solid #314966;
    border-radius:999px;
    background:#101d30;
    color:#dbe7f6!important;
    font-size:12px!important;
    font-weight:900;
    line-height:1;
    letter-spacing:.01em;
  }
  body.theme-light .logbook-app.mobile-logbook-mode #pageCounter{
    background:#fff;
    border-color:#cbd5e1;
    color:#0f172a!important;
  }
}


/* V1.70 Dashboard YTD hours + contextual phone uploads. */
.ytd-hours-card{margin:16px 0}
.ytd-hours-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.ytd-hours-grid>div{display:flex;align-items:center;justify-content:space-between;gap:14px;background:#0b1728;border:1px solid #263a56;border-radius:14px;padding:13px 14px}
.ytd-hours-grid span{color:#a8b8cc;font-size:12px;font-weight:850;text-transform:uppercase;letter-spacing:.04em}
.ytd-hours-grid strong{font-size:24px;color:#e5edf8}
body.theme-light .ytd-hours-grid>div{background:#f8fafc;border-color:#d8e1ec}
body.theme-light .ytd-hours-grid span{color:#64748b}
body.theme-light .ytd-hours-grid strong{color:#0f172a}
.phone-camera-upload{display:none;gap:6px;margin:0 0 12px}
.camera-upload-input{position:absolute!important;width:1px!important;height:1px!important;opacity:0!important;pointer-events:none!important}
.camera-upload-button{margin:0!important;cursor:pointer}
.phone-camera-upload .hint{margin:0}

/* V1.70 mobile Log Book fit cleanup.
   The Record of Dive itself stays exactly the same; only the surrounding viewer is made phone-safe.
   These class-based rules also cover mobile browsers that request a desktop-style viewport. */
.logbook-app.mobile-logbook-mode{
  display:flex!important;
  flex-direction:column!important;
  width:100%!important;
  max-width:100%!important;
  height:calc(100svh - var(--logbook-header-height,112px))!important;
  overflow:hidden!important;
  grid-template-columns:1fr!important;
}
.logbook-app.mobile-logbook-mode .logbook-sidebar{
  position:relative!important;
  inset:auto!important;
  transform:none!important;
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  max-height:58svh!important;
  flex:0 0 auto!important;
  border-right:0!important;
  border-bottom:1px solid var(--line)!important;
  padding:10px 12px!important;
  overflow:auto!important;
  overflow-x:hidden!important;
  -webkit-overflow-scrolling:touch;
}
.logbook-app.mobile-logbook-mode.sidebar-collapsed .logbook-sidebar{
  width:100%!important;
  min-width:0!important;
  max-height:58px!important;
  padding:7px 10px!important;
  overflow:hidden!important;
}
.logbook-app.mobile-logbook-mode .sidebar-title-block,
.logbook-app.mobile-logbook-mode.sidebar-collapsed .sidebar-title-block{display:flex!important;min-width:0!important}
.logbook-app.mobile-logbook-mode.sidebar-collapsed .sidebar-body{display:none!important}
.logbook-app.mobile-logbook-mode .logbook-menu-head,
.logbook-app.mobile-logbook-mode.sidebar-collapsed .logbook-menu-head{justify-content:flex-start!important;margin:0!important;gap:10px!important;min-width:0!important}
.logbook-app.mobile-logbook-mode .menu-toggle{width:44px!important;min-width:44px!important;height:44px!important;flex:0 0 44px!important}
.logbook-app.mobile-logbook-mode .sidebar-body{padding-top:10px!important;width:100%!important;min-width:0!important;overflow-x:hidden!important}
.logbook-app.mobile-logbook-mode .sidebar-body>*,
.logbook-app.mobile-logbook-mode .book-control-group,
.logbook-app.mobile-logbook-mode .book-control-group label,
.logbook-app.mobile-logbook-mode .book-control-group input,
.logbook-app.mobile-logbook-mode .book-control-group select,
.logbook-app.mobile-logbook-mode .book-control-group textarea,
.logbook-app.mobile-logbook-mode .book-control-group button{max-width:100%!important;min-width:0!important;box-sizing:border-box!important}
.logbook-app.mobile-logbook-mode .book-control-group input,
.logbook-app.mobile-logbook-mode .book-control-group select,
.logbook-app.mobile-logbook-mode .book-control-group textarea,
.logbook-app.mobile-logbook-mode .book-control-group .btn{width:100%!important}
.logbook-app.mobile-logbook-mode .view-switcher{grid-template-columns:repeat(2,minmax(0,1fr))!important;width:100%!important}
.logbook-app.mobile-logbook-mode .view-tab{min-width:0!important;white-space:normal!important;text-align:center!important}
.logbook-app.mobile-logbook-mode .book-area{flex:1 1 auto!important;min-height:0!important;min-width:0!important;width:100%!important;max-width:100%!important;overflow:hidden!important}
.logbook-app.mobile-logbook-mode .book-status{width:100%!important;max-width:100%!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}
.logbook-app.mobile-logbook-mode .book-view-panel{min-height:0!important;min-width:0!important;width:100%!important;overflow:hidden!important}
.logbook-app.mobile-logbook-mode .logbook-page-view-tools,
.logbook-app.mobile-logbook-mode .page-thumbnail-dock{display:none!important}
.logbook-app.mobile-logbook-mode .book-scroll{
  width:100%!important;
  min-width:0!important;
  max-width:100%!important;
  align-items:flex-start!important;
  justify-content:flex-start!important;
  padding:8px!important;
  overflow:auto!important;
  overflow-x:auto!important;
  -webkit-overflow-scrolling:touch;
  overscroll-behavior:none!important;
  touch-action:none!important;
  scrollbar-width:none;
  -ms-overflow-style:none;
  background:linear-gradient(145deg,#07111f,#101f36 55%,#06101d)!important;
}
.logbook-app.mobile-logbook-mode .book-scroll::-webkit-scrollbar{display:none}
.logbook-app.mobile-logbook-mode .book-spread.real-open-book,
.logbook-app.mobile-logbook-mode .book-spread.real-open-book.open-book,
.logbook-app.mobile-logbook-mode .book-spread.real-open-book.single{
  display:block!important;
  width:max-content!important;
  min-width:0!important;
  max-width:none!important;
  margin:0!important;
  padding:0 0 10px!important;
  background:transparent!important;
  box-shadow:none!important;
  border-radius:0!important;
}
.logbook-app.mobile-logbook-mode .book-spread.real-open-book:before,
.logbook-app.mobile-logbook-mode .book-spread.real-open-book:after,
.logbook-app.mobile-logbook-mode .book-spread.real-open-book .log-page:before,
.logbook-app.mobile-logbook-mode .book-spread.real-open-book .log-page:after{display:none!important}
.logbook-app.mobile-logbook-mode .book-spread.real-open-book .log-page{
  display:block!important;
  zoom:var(--page-scale,.48)!important;
  transform:none!important;
  transform-origin:top left!important;
  margin:0!important;
  border-radius:8px!important;
  box-shadow:0 14px 34px rgba(0,0,0,.36)!important;
  border:1px solid #d0c6ae!important;
}
.logbook-app.mobile-logbook-mode .book-spread.real-open-book .log-page.right,
.logbook-app.mobile-logbook-mode .book-spread.real-open-book .blank-page{display:none!important}

/* Undo older responsive rules that rearranged pieces inside the paper form.
   V1.70 keeps the Record of Dive's 720px sheet geometry unchanged and scales the whole sheet instead. */
.logbook-app.mobile-logbook-mode .record-of-dive-page{width:720px!important;min-height:930px!important;padding:24px 28px 20px!important}
.logbook-app.mobile-logbook-mode .record-header{grid-template-columns:1.05fr 1.18fr 1fr!important;gap:12px!important}
.logbook-app.mobile-logbook-mode .reference-right-lines{padding-top:20px!important;gap:18px!important}
.logbook-app.mobile-logbook-mode .reference-lower-grid{grid-template-columns:1fr 146px!important;gap:12px!important}
.logbook-app.mobile-logbook-mode .type-of-dive-box{max-width:none!important}

.logbook-app.mobile-logbook-mode .book-nav{
  position:sticky!important;
  bottom:0!important;
  z-index:35!important;
  justify-content:center!important;
  min-height:42px!important;
  padding:5px 8px!important;
  gap:6px!important;
  overflow:hidden!important;
  background:rgba(7,17,31,.96)!important;
  backdrop-filter:blur(8px);
}
.logbook-app.mobile-logbook-mode .book-nav .page-arrow{display:none!important}
.logbook-app.mobile-logbook-mode #pageCounter{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  min-width:0!important;
  max-width:100%!important;
  padding:6px 13px!important;
  border:1px solid #314966!important;
  border-radius:999px!important;
  background:#101d30!important;
  color:#dbe7f6!important;
  font-size:12px!important;
  font-weight:900!important;
  line-height:1!important;
}
body.theme-light .logbook-app.mobile-logbook-mode .book-scroll{background:linear-gradient(145deg,#dbeafe,#f8fafc 62%,#dbeafe)!important}
body.theme-light .logbook-app.mobile-logbook-mode #pageCounter{background:#fff!important;border-color:#cbd5e1!important;color:#0f172a!important}
@media(max-width:820px), (pointer:coarse){.phone-camera-upload{display:grid}}
@media(max-width:640px){.ytd-hours-grid{grid-template-columns:1fr}}

/* WorkProof V1.71 Log Book hotfix ----------------------------------------- */
.install-workproof-btn{border:1px solid #3b82f6;background:#16345d;color:#eff6ff;border-radius:10px;padding:8px 11px;font-weight:850;cursor:pointer}
.install-workproof-btn:hover{background:#1d4ed8}
.logbook-edit-mode-bar{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:9px 14px;border-bottom:1px solid #263a56;background:#0b1728;flex:0 0 auto}
.logbook-mode-buttons{display:flex;gap:7px;align-items:center}
.logbook-edit-mode-bar .btn.active{background:#166534;border-color:#22c55e;color:#fff}
#logbookModeLabel{font-size:12px;font-weight:850;color:#cbd5e1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.record-of-dive-page.view-mode input,.record-of-dive-page.view-mode textarea,.record-of-dive-page.view-mode select{pointer-events:none}
.record-of-dive-page.edit-mode input:not([type="checkbox"]),.record-of-dive-page.edit-mode textarea,.record-of-dive-page.edit-mode select{cursor:text}
.record-of-dive-page.edit-mode input:not([type="checkbox"]):focus,.record-of-dive-page.edit-mode textarea:focus,.record-of-dive-page.edit-mode select:focus{outline:1.5px solid rgba(22,163,74,.85)!important;outline-offset:1px;background:rgba(220,252,231,.55)!important}
.record-of-dive-page.edit-mode [data-single-choice],.record-of-dive-page.edit-mode [data-boolean-field]{cursor:pointer}
.record-of-dive-page.edit-mode [data-single-choice]:focus-visible,.record-of-dive-page.edit-mode [data-boolean-field]:focus-visible{outline:2px solid rgba(22,163,74,.9)!important;outline-offset:2px}
.record-of-dive-page .box-field input:disabled{cursor:default}
.record-of-dive-page.edit-mode .box-field input:not(:disabled){cursor:text;background:#fffef0!important}
@media(max-width:820px){
  .logbook-edit-mode-bar{padding:7px 8px;gap:7px;flex-wrap:wrap}
  .logbook-mode-buttons{width:100%;display:grid;grid-template-columns:repeat(3,1fr)}
  .logbook-mode-buttons .btn{width:100%;min-height:38px}
  #logbookModeLabel{width:100%;text-align:center}
  .install-workproof-btn{max-width:132px;white-space:normal;line-height:1.05}
}
@media print{
  .logbook-edit-mode-bar{display:none!important}
}


/* WorkProof V1.72 Log Book workspace cleanup ------------------------------ */
.logbook-app{grid-template-columns:1fr!important}
.logbook-sidebar{display:none!important}
.book-area{width:100%;max-width:100%}
.logbook-compact-toolbar{display:flex;align-items:center;gap:5px;flex-wrap:wrap;padding:5px 8px;background:#0b1728;border-bottom:1px solid #263a56;flex:0 0 auto}
.logbook-compact-toolbar .btn.small{min-height:28px;padding:4px 8px;font-size:11px;line-height:1}
.compact-logbook-btn{width:28px!important;height:28px!important;min-width:28px!important;padding:0!important;font-size:14px!important}
.compact-upload-btn{display:inline-flex!important;align-items:center!important;justify-content:center!important;cursor:pointer;margin:0!important}
.compact-upload-btn input{display:none!important}
.compact-scan-input{width:auto!important;min-width:110px;max-width:160px;height:28px!important;padding:3px 7px!important;font-size:11px!important}
.page-thumbnail-dock-head{position:relative;padding-right:28px}
.thumbnail-toggle-btn{margin-left:auto;width:24px;height:22px;min-width:24px;border:1px solid #3b587b;border-radius:6px;background:#101d30;color:#dbe7f6;font-size:13px;font-weight:900;line-height:1;cursor:pointer;padding:0}
.thumbnail-toggle-btn:hover{border-color:#60a5fa;background:#173052}
.page-thumbnail-dock.collapsed{padding:2px 7px!important;min-height:27px!important}
.page-thumbnail-dock.collapsed .page-thumbnail-dock-head{margin:0!important;min-height:22px!important;padding:0!important}
.page-thumbnail-dock.collapsed .page-thumbnail-dock-head strong,.page-thumbnail-dock.collapsed .page-thumbnail-dock-head span{display:none!important}
.page-thumbnail-dock.collapsed .page-thumbnail-strip{display:none!important}
.page-thumbnail-dock.collapsed .thumbnail-toggle-btn{margin-left:auto}
/* Every printed numeric cell remains a real, directly editable digit box. */
.record-of-dive-page.edit-mode .box-field input{pointer-events:auto!important;user-select:text!important;-webkit-user-select:text!important;touch-action:manipulation!important}
.record-of-dive-page.edit-mode .box-field input:focus{outline:2px solid rgba(22,163,74,.9)!important;outline-offset:1px!important;background:#fffbdc!important}
@media(max-width:820px){
  .logbook-compact-toolbar{padding:4px 6px;gap:4px;overflow-x:auto;flex-wrap:nowrap;scrollbar-width:none}
  .logbook-compact-toolbar::-webkit-scrollbar{display:none}
  .logbook-compact-toolbar .btn.small{white-space:nowrap;flex:0 0 auto}
  .scan-compact-toolbar .compact-scan-input{display:none!important}
  .page-thumbnail-dock{display:none!important}
}
@media print{.logbook-compact-toolbar,.thumbnail-toggle-btn{display:none!important}}


/* WorkProof V1.72.1 small-screen Log Book repair ------------------------- */
@media(max-width:820px), (pointer:coarse){
  .logbook-app.mobile-logbook-mode{
    width:100%!important;
    max-width:100vw!important;
    min-width:0!important;
  }
  .logbook-app.mobile-logbook-mode .book-area,
  .logbook-app.mobile-logbook-mode .book-view-panel,
  .logbook-app.mobile-logbook-mode .book-scroll{
    min-width:0!important;
    max-width:100%!important;
  }
  .logbook-app.mobile-logbook-mode .book-scroll{
    padding:8px!important;
    overflow:auto!important;
    touch-action:none!important;
  }
  /* Scale the entire paper as one object. This keeps all printed inputs and
     number boxes registered to the sheet instead of letting browser form
     controls drift outside the page at phone zoom levels. */
  .logbook-app.mobile-logbook-mode .book-spread.real-open-book,
  .logbook-app.mobile-logbook-mode .book-spread.real-open-book.open-book,
  .logbook-app.mobile-logbook-mode .book-spread.real-open-book.single{
    position:relative!important;
    width:var(--scaled-page-width,360px)!important;
    min-width:var(--scaled-page-width,360px)!important;
    max-width:none!important;
    height:var(--scaled-page-height,465px)!important;
    min-height:var(--scaled-page-height,465px)!important;
    overflow:visible!important;
    margin:0!important;
    padding:0!important;
  }
  .logbook-app.mobile-logbook-mode .book-spread.real-open-book .log-page{
    position:absolute!important;
    left:0!important;
    top:0!important;
    width:720px!important;
    min-width:720px!important;
    min-height:930px!important;
    zoom:1!important;
    transform:scale(var(--page-scale,.5))!important;
    transform-origin:top left!important;
    margin:0!important;
  }
  .logbook-app.mobile-logbook-mode .record-of-dive-page{
    width:720px!important;
    min-width:720px!important;
    max-width:720px!important;
    min-height:930px!important;
  }
  .logbook-app.mobile-logbook-mode .record-of-dive-page input,
  .logbook-app.mobile-logbook-mode .record-of-dive-page textarea,
  .logbook-app.mobile-logbook-mode .record-of-dive-page label,
  .logbook-app.mobile-logbook-mode .record-of-dive-page .box-field{
    box-sizing:border-box!important;
  }
}

/* WorkProof V1.73 - phone Record of Dive must remain desktop-exact ----------
   Global touch rules intentionally enlarge ordinary app controls to 44px.
   Those rules must NEVER resize controls printed inside the Record of Dive
   sheet. Keep the 720x930 desktop sheet geometry exact, then scale the whole
   paper in the viewer. */
@media(max-width:820px), (pointer:coarse){
  .logbook-app.mobile-logbook-mode .record-of-dive-page input,
  .logbook-app.mobile-logbook-mode .record-of-dive-page textarea,
  .logbook-app.mobile-logbook-mode .record-of-dive-page select{
    min-height:0!important;
    max-height:none;
    font-size:inherit;
    touch-action:manipulation;
  }

  /* Restore the exact desktop printed number-cell geometry. */
  .logbook-app.mobile-logbook-mode .record-of-dive-page .box-field{
    display:inline-flex!important;
    gap:1px!important;
    vertical-align:middle!important;
    flex-wrap:nowrap!important;
  }
  .logbook-app.mobile-logbook-mode .record-of-dive-page .box-field input{
    width:15px!important;
    min-width:15px!important;
    max-width:15px!important;
    height:17px!important;
    min-height:17px!important;
    max-height:17px!important;
    padding:0!important;
    margin:0!important;
    border:1px solid #111!important;
    border-radius:0!important;
    background:#fff!important;
    font-size:10px!important;
    line-height:15px!important;
    text-align:center!important;
  }

  /* Restore the exact desktop printed checkbox geometry. */
  .logbook-app.mobile-logbook-mode .record-of-dive-page .reference-check-group input,
  .logbook-app.mobile-logbook-mode .record-of-dive-page .single-reference-check input,
  .logbook-app.mobile-logbook-mode .record-of-dive-page .type-of-dive-box input{
    width:10px!important;
    min-width:10px!important;
    max-width:10px!important;
    height:10px!important;
    min-height:10px!important;
    max-height:10px!important;
    padding:0!important;
    margin:0!important;
    border:1.5px solid #111!important;
    border-radius:0!important;
    flex:0 0 10px!important;
  }

  /* Do not let phone rules reflow any part of the printed sheet. */
  .logbook-app.mobile-logbook-mode .record-header{
    grid-template-columns:1.05fr 1.18fr 1fr!important;
    gap:12px!important;
  }
  .logbook-app.mobile-logbook-mode .reference-right-lines{
    padding-top:20px!important;
    gap:18px!important;
  }
  .logbook-app.mobile-logbook-mode .reference-dive-grid{
    grid-template-columns:1.23fr repeat(3,1fr)!important;
  }
  .logbook-app.mobile-logbook-mode .reference-lower-grid{
    grid-template-columns:1fr 146px!important;
    gap:12px!important;
  }
  .logbook-app.mobile-logbook-mode .type-of-dive-box{
    max-width:none!important;
  }

  /* The visible paper and every descendant control share one transform. */
  .logbook-app.mobile-logbook-mode .book-spread.real-open-book .log-page.record-of-dive-page{
    width:720px!important;
    min-width:720px!important;
    max-width:720px!important;
    min-height:930px!important;
    transform:scale(var(--page-scale,.5))!important;
    transform-origin:top left!important;
    overflow:hidden!important;
  }
}


/* WorkProof V1.74 - always-edit Log Book + mobile actions/signing -------- */
/* View Mode is removed. Unsigned selected pages are directly editable;
   signed/locked pages remain protected by the existing lock workflow. */
.logbook-edit-mode-bar{display:none!important}

@media(max-width:820px), (pointer:coarse){
  /* Keep all key Log Book actions visible on phones instead of placing them
     off-screen in a horizontal scroller. */
  .logbook-app.mobile-logbook-mode .book-view-panel > .logbook-compact-toolbar{
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:4px!important;
    padding:5px 6px!important;
    overflow:visible!important;
    flex-wrap:initial!important;
  }
  .logbook-app.mobile-logbook-mode .book-view-panel > .logbook-compact-toolbar .btn.small,
  .logbook-app.mobile-logbook-mode .book-view-panel > .logbook-compact-toolbar .icon-btn{
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    min-height:32px!important;
    height:32px!important;
    padding:3px 4px!important;
    font-size:11px!important;
    line-height:1.05!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
  }
  .logbook-app.mobile-logbook-mode #bookshelfHomeBtn{font-size:14px!important}

  /* Signature dialog stays completely inside the phone viewport and scrolls
     internally when its crop/draw tools need more vertical room. */
  #signatureModal.modal-backdrop{
    align-items:flex-start!important;
    justify-content:center!important;
    padding:6px!important;
    overflow:hidden!important;
  }
  #signatureModal .signature-modal-card{
    width:calc(100vw - 12px)!important;
    max-width:620px!important;
    max-height:calc(100dvh - 12px)!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
    margin:0!important;
    padding:10px!important;
    border-radius:12px!important;
    box-sizing:border-box!important;
    -webkit-overflow-scrolling:touch;
  }
  #signatureModal .signature-modal-card h2{font-size:18px;margin:0 0 6px}
  #signatureModal .warning-note{padding:7px;margin:6px 0;font-size:12px}
  #signatureModal .signature-choice{gap:6px;margin:6px 0;flex-wrap:wrap}
  #signatureModal .signature-tools{gap:6px;margin:6px 0}
  #signatureModal .signature-upload-label,
  #signatureModal .signature-upload-status{padding:7px;font-size:11px}
  #signatureModal #signaturePad{height:110px!important;min-height:110px!important}
  #signatureModal #signatureCropCanvas{height:150px!important;max-width:100%!important}
  #signatureModal .signature-crop-editor{padding:7px!important;margin:6px 0!important}
  #signatureModal .signature-crop-actions{gap:5px!important}
  #signatureModal .signature-crop-actions .btn{min-height:34px!important;padding:5px 6px!important;font-size:11px!important}
  #signatureModal .signature-final-size{gap:6px!important;margin:6px 0!important;padding:7px!important}
  #signatureModal .signature-adjust-hint{margin:0 0 6px!important;font-size:11px!important}
  #signatureModal .modal-actions,
  #signatureModal .actions,
  #signatureModal .toolbar-row{
    display:grid!important;
    grid-template-columns:1fr 1fr!important;
    gap:6px!important;
  }
  #signatureModal .modal-actions .btn,
  #signatureModal .actions .btn,
  #signatureModal .toolbar-row .btn{width:100%!important;min-height:36px!important;padding:6px!important;font-size:11px!important}
  #signatureModal .toolbar-row #confirmSign{grid-column:1/-1!important;grid-row:1!important}
}

/* WorkProof V1.75 - consistent book workspace, desktop sign scroll,
   smooth mobile thumbnails, and phone Dive Log Edit Mode. */

/* Signature popup: the dialog scrolls internally on desktop and mobile while
   the page behind it stays fixed. */
#signatureModal.modal-backdrop{
  align-items:flex-start!important;
  overflow-y:auto!important;
  overscroll-behavior:contain;
  padding:16px!important;
}
#signatureModal .signature-modal-card{
  width:min(900px,100%)!important;
  max-height:calc(100dvh - 32px)!important;
  overflow-y:auto!important;
  overscroll-behavior:contain;
  scrollbar-gutter:stable;
  margin:auto!important;
}

/* Imports/Books use the same page-first workspace pattern as Dive Log Book. */
.imports-app{display:block!important;width:100%!important;max-width:100%!important;min-width:0!important;padding:0!important}
.imports-side-panel{display:none!important}
.imports-main-area{width:100%!important;max-width:100%!important;min-width:0!important;height:calc(100vh - var(--app-header-height,72px));min-height:0!important;display:flex!important;flex-direction:column!important;overflow:hidden!important}
.imports-status{flex:0 0 auto!important}
.imports-book-panel{padding-top:0!important;display:flex!important;flex-direction:column!important;min-height:0!important;flex:1 1 auto!important;overflow:hidden!important}
.imports-compact-toolbar{flex:0 0 auto!important}
.imports-options-panel{flex:0 0 auto;max-height:min(48vh,480px);overflow:auto;border-bottom:1px solid #263a56;background:#0b1728;padding:10px;overscroll-behavior:contain}
.imports-options-panel.hidden{display:none!important}
.imports-options-panel .import-book-tools{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;max-width:1100px;margin:0 auto}
.imports-options-panel .side-section-title{grid-column:1/-1}
.imports-options-panel .import-upload-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;grid-column:1/-1}
.imports-options-panel .import-upload-form > label,
.imports-options-panel .import-upload-form > .phone-camera-upload,
.imports-options-panel .import-upload-form > .form-status,
.imports-options-panel .import-upload-form > button{min-width:0}
.imports-options-panel .import-upload-form .paystub-upload-label,
.imports-options-panel .import-upload-form .phone-camera-upload,
.imports-options-panel .import-upload-form .form-status,
.imports-options-panel .import-upload-form > button,
.imports-options-panel .import-upload-form > label:has(textarea){grid-column:1/-1}
.paystub-book-view{min-height:0!important;flex:1 1 auto!important;display:flex!important;flex-direction:column!important}
.paystub-page-frame{min-height:0!important;flex:1 1 auto!important;padding:12px!important;background:radial-gradient(circle at center,#183351,#0a1424 72%)!important}
.paystub-list-view{min-height:0!important;flex:1 1 auto!important;padding:12px!important}
#paystubBookViewPanel > .book-nav{display:flex!important;flex:0 0 auto!important}
body.theme-light .imports-options-panel{background:#f8fafc;border-color:#cbd5e1}
body.theme-light .paystub-page-frame{background:radial-gradient(circle at center,#dbeafe,#f8fafc 68%,#e2e8f0)!important}

/* Phone Edit Mode exists only on small screens. Desktop remains direct-edit. */
.mobile-edit-toggle{display:none!important}
@media(max-width:820px), (pointer:coarse){
  .logbook-app.mobile-logbook-mode .mobile-edit-toggle{display:inline-flex!important}
  .logbook-app.mobile-logbook-mode .mobile-edit-toggle.active{background:#166534!important;border-color:#22c55e!important;color:#fff!important}
  .logbook-app.mobile-logbook-mode .record-of-dive-page.view-mode input,
  .logbook-app.mobile-logbook-mode .record-of-dive-page.view-mode textarea,
  .logbook-app.mobile-logbook-mode .record-of-dive-page.view-mode select,
  .logbook-app.mobile-logbook-mode .record-of-dive-page.view-mode label{pointer-events:none!important}
  .logbook-app.mobile-logbook-mode .record-of-dive-page.edit-mode input,
  .logbook-app.mobile-logbook-mode .record-of-dive-page.edit-mode textarea,
  .logbook-app.mobile-logbook-mode .record-of-dive-page.edit-mode select,
  .logbook-app.mobile-logbook-mode .record-of-dive-page.edit-mode label{pointer-events:auto!important}
  .logbook-app.mobile-logbook-mode .book-scroll.mobile-edit-active{touch-action:pan-y!important}

  /* Thumbnails remain available on phone and open/close without jumping the
     Record of Dive viewer. The strip collapses by height/opacity instead of
     disappearing from layout abruptly. */
  .logbook-app.mobile-logbook-mode .page-thumbnail-dock{
    display:flex!important;
    flex-direction:column!important;
    flex:0 0 auto!important;
    width:100%!important;
    max-width:100%!important;
    max-height:122px!important;
    min-height:28px!important;
    overflow:hidden!important;
    padding:4px 6px 5px!important;
    transition:max-height .18s ease,padding .18s ease!important;
  }
  .logbook-app.mobile-logbook-mode .page-thumbnail-dock-head{
    display:flex!important;
    min-height:22px!important;
    margin:0 0 3px!important;
    padding:0 0 0 2px!important;
    gap:6px!important;
  }
  .logbook-app.mobile-logbook-mode .page-thumbnail-dock-head strong{font-size:10px!important}
  .logbook-app.mobile-logbook-mode .page-thumbnail-dock-head span{display:none!important}
  .logbook-app.mobile-logbook-mode .thumbnail-toggle-btn{margin-left:auto!important;flex:0 0 24px!important}
  .logbook-app.mobile-logbook-mode .page-thumbnail-strip{
    display:flex!important;
    min-height:0!important;
    max-height:88px!important;
    opacity:1!important;
    transform:translateY(0)!important;
    transition:max-height .18s ease,opacity .14s ease,transform .18s ease!important;
    padding:2px 2px 4px!important;
    gap:6px!important;
  }
  .logbook-app.mobile-logbook-mode .page-thumbnail-dock.collapsed{
    max-height:28px!important;
    min-height:28px!important;
    padding:2px 6px!important;
  }
  .logbook-app.mobile-logbook-mode .page-thumbnail-dock.collapsed .page-thumbnail-dock-head{
    display:flex!important;
    margin:0!important;
  }
  .logbook-app.mobile-logbook-mode .page-thumbnail-dock.collapsed .page-thumbnail-dock-head strong{display:none!important}
  .logbook-app.mobile-logbook-mode .page-thumbnail-dock.collapsed .page-thumbnail-strip{
    display:flex!important;
    max-height:0!important;
    opacity:0!important;
    transform:translateY(-6px)!important;
    padding-top:0!important;
    padding-bottom:0!important;
    pointer-events:none!important;
  }

  /* Imports keeps the same compact, page-first treatment on phones. */
  .imports-main-area{height:calc(100dvh - var(--app-header-height,72px))!important}
  .imports-compact-toolbar{display:flex!important;overflow-x:auto!important;flex-wrap:nowrap!important;padding:4px 6px!important;gap:4px!important;scrollbar-width:none}
  .imports-compact-toolbar::-webkit-scrollbar{display:none}
  .imports-options-panel{max-height:56dvh!important;padding:7px!important}
  .imports-options-panel .import-book-tools,
  .imports-options-panel .import-upload-form{grid-template-columns:1fr!important}
  .paystub-page-frame{padding:8px!important}
}

@media print{
  .mobile-edit-toggle,.imports-compact-toolbar,.imports-options-panel{display:none!important}
}
body.signature-modal-open{overflow:hidden!important}

/* V1.77 Dive Supervisor Log Book */
.supervisor-cover{background:linear-gradient(145deg,#19324c,#0d1827 58%,#08111d);border-color:#456784}
.supervisor-record-page{width:720px!important;min-height:930px!important;padding:24px 28px 20px!important;background:#fffef9!important;color:#111!important;font-family:Arial,Helvetica,sans-serif!important;font-size:11px!important;line-height:1.1!important;border-radius:7px!important}
.supervisor-record-page *{box-sizing:border-box}.supervisor-record-page input,.supervisor-record-page textarea{color:#111;background:transparent;border-radius:0}.supervisor-record-title{text-align:center;font-size:17px;font-weight:700;margin:0 0 20px}.supervisor-top-lines{display:grid;gap:3px}.supervisor-top-lines .ruled-input label,.supervisor-lower-lines .ruled-input label,.supervisor-approved-block .ruled-input label,.supervisor-accumulated-row .ruled-input label{font-size:11px}.supervisor-inline-two{display:grid;grid-template-columns:1.6fr .8fr;gap:10px;align-items:end}.supervisor-page-no{border-bottom:2px solid #111;min-height:20px;padding:2px 0;font-size:11px}.supervisor-type-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap;font-size:11px;min-height:24px}.supervisor-type-row label{display:inline-flex;align-items:center;gap:3px;color:#111;margin:0}.supervisor-type-row input[type=checkbox]{appearance:none;width:14px!important;height:12px!important;border:1px solid #777!important;background:#fff!important;padding:0!important;border-radius:0!important}.supervisor-type-row input[type=checkbox]:checked{background:linear-gradient(45deg,transparent 40%,#111 40%,#111 60%,transparent 60%),linear-gradient(-45deg,transparent 40%,#111 40%,#111 60%,transparent 60%)!important}.supervisor-type-row .book-line-field{min-width:90px}
.supervisor-dive-table{display:grid;grid-template-columns:1.25fr repeat(3,1fr);margin:10px 0 9px}.supervisor-dive-labels,.supervisor-dive-column{display:grid;grid-template-rows:24px 36px 43px 34px 43px 43px 43px 48px;border-right:1px solid #bbb}.supervisor-dive-labels{border-right:0;font-size:10px}.supervisor-dive-labels span{display:flex;align-items:center;padding-right:6px}.supervisor-dive-column{padding:0 4px}.supervisor-dive-title{text-align:center;font-size:12px;padding-top:4px}.supervisor-dual-depth,.supervisor-time-pair,.supervisor-repetitive{display:flex;align-items:center;justify-content:center;gap:3px;flex-wrap:wrap;font-size:8px}.supervisor-dual-depth .book-line-field,.supervisor-time-pair .book-line-field,.supervisor-repetitive .book-line-field{min-width:0;width:42px;height:20px;border:1px solid #9a9a9a}.supervisor-dual-depth .book-line-field input,.supervisor-time-pair .book-line-field input,.supervisor-repetitive .book-line-field input{text-align:center;font-size:10px!important}.supervisor-single-time .book-line-field{width:48px}.supervisor-lower-lines{display:grid;gap:3px;margin-top:4px}.supervisor-lower-lines .textarea-line textarea{height:40px!important;line-height:18px!important}.supervisor-approved-block{margin-top:12px}.supervisor-approved-block>strong{display:block;margin-bottom:3px;font-size:11px}.supervisor-accumulated-row{display:grid;grid-template-columns:1fr 1fr;gap:22px;margin-top:16px}.supervisor-record-page .signature-display{height:30px}.supervisor-record-page.selected{box-shadow:0 0 0 4px rgba(59,130,246,.35),0 28px 60px rgba(0,0,0,.55),inset 0 0 35px rgba(103,84,55,.08)!important}.supervisor-record-page.edit-mode{box-shadow:0 0 0 4px rgba(34,197,94,.28),0 28px 60px rgba(0,0,0,.55)!important}.supervisor-record-page.locked:before{content:"SIGNED / LOCKED";position:absolute;top:10px;right:18px;border:2px solid #111;padding:3px 7px;font-weight:900;font-size:10px;background:rgba(255,255,255,.9)}.supervisor-record-page input:disabled,.supervisor-record-page textarea:disabled{opacity:1!important;-webkit-text-fill-color:#111}.supervisor-record-page .page-corner{opacity:.08}
@media(max-width:900px){.supervisor-record-page{width:720px!important}.supervisor-inline-two{grid-template-columns:1fr 1fr}.book-scroll{padding:14px!important}}

/* V1.78 Imports books: clean covers, Page/List views, thumbnails, icon actions. */
.hidden-file-input{position:absolute!important;width:1px!important;height:1px!important;opacity:0!important;pointer-events:none!important;overflow:hidden!important}
.import-action-icon{position:relative;display:inline-flex!important;align-items:center!important;justify-content:center!important;width:36px!important;min-width:36px!important;height:34px!important;padding:0!important;font-size:18px!important;cursor:pointer!important}
.imports-thumbnail-dock{flex:0 0 auto;padding:8px 10px 10px;border-top:1px solid #263a56;background:#0b1728}
.imports-thumbnail-strip{display:flex;gap:8px;overflow-x:auto;overflow-y:hidden;padding:2px 1px 4px;scroll-snap-type:x proximity;scrollbar-width:thin}
.import-page-thumb{width:78px;min-width:78px;border:1px solid #3b587b;border-radius:8px;background:#101d30;color:#dbe7f6;padding:4px;cursor:pointer;scroll-snap-align:start}
.import-page-thumb:hover,.import-page-thumb.active{border-color:#60a5fa;background:#173052;box-shadow:0 0 0 1px rgba(96,165,250,.25)}
.import-thumb-preview{height:76px;border-radius:5px;background:#eef2f7;display:flex;align-items:center;justify-content:center;overflow:hidden;color:#334155;font-size:28px}
.import-thumb-preview img{width:100%;height:100%;object-fit:contain;background:#fff}
.import-thumb-caption{text-align:center;font-size:11px;font-weight:800;padding-top:3px}
body.theme-light .imports-thumbnail-dock{background:#eef3f8;border-color:#cbd5e1}
body.theme-light .import-page-thumb{background:#fff;color:#0f172a;border-color:#cbd5e1}
body.theme-light .import-page-thumb:hover,body.theme-light .import-page-thumb.active{background:#e8f2ff;border-color:#3b82f6}
@media (max-width:640px){
  .imports-compact-toolbar .btn.small{white-space:nowrap}
  .import-action-icon{width:34px!important;min-width:34px!important;height:32px!important}
  .imports-thumbnail-dock{padding:6px 7px 8px}
  .import-page-thumb{width:68px;min-width:68px}
  .import-thumb-preview{height:66px}
}
@media print{.imports-thumbnail-dock,.imports-compact-toolbar{display:none!important}}

/* V1.79 Imports: one control line per book + chronological document pages. */
.imports-book-panel.hidden{display:none!important}
.imports-app:not(.shelf-mode) .imports-status{display:none!important}
.imports-compact-toolbar{display:flex!important;align-items:center!important;gap:6px!important;flex-wrap:nowrap!important;overflow-x:auto!important;overflow-y:hidden!important;padding:6px 8px!important;border-bottom:1px solid #263a56!important;background:#0b1728!important;scrollbar-width:thin;white-space:nowrap}
.imports-compact-toolbar>*{flex:0 0 auto!important}
.imports-compact-toolbar .compact-scan-input{min-width:160px!important}
.compact-date-input{width:142px!important;min-width:142px!important;height:34px!important;padding:5px 8px!important}
.compact-date-save{white-space:nowrap!important}
.imports-book-panel>.paystub-book-view,.imports-book-panel>.paystub-list-view,.imports-book-panel>.scan-book-view,.imports-book-panel>.scan-list-view{min-height:0!important;flex:1 1 auto!important}
body.theme-light .imports-compact-toolbar{background:#f8fafc!important;border-color:#cbd5e1!important}


/* V1.80 Imports: full-page viewer, collapsible thumbnails, bulk import. */
.imports-book-panel .paystub-page-frame,
.imports-book-panel .scan-page-frame{padding:0!important;overflow:hidden!important;align-items:stretch!important;justify-content:stretch!important}
.imports-book-panel .paystub-page,
.imports-book-panel .scan-page{width:100%!important;max-width:none!important;height:100%!important;min-height:0!important;display:flex!important;flex-direction:column!important;border-radius:0!important;margin:0!important;padding:12px 14px!important}
.imports-book-panel .paystub-page .document-zoom-surface,
.imports-book-panel .scan-page .document-zoom-surface,
.imports-book-panel .scan-page .scan-image-wrap{flex:1 1 auto!important;min-height:0!important;height:auto!important;overflow:hidden!important}
.imports-book-panel .document-zoom-surface{display:flex!important;flex-direction:column!important}
.imports-book-panel .document-zoom-viewport{flex:1 1 auto!important;min-height:0!important}
.imports-thumbnail-dock{display:flex;flex-direction:column;max-height:132px;min-height:30px;overflow:hidden;transition:max-height .18s ease,padding .18s ease}
.imports-thumbnail-dock-head{display:flex;align-items:center;gap:8px;min-height:24px;margin-bottom:4px}
.imports-thumbnail-dock-head strong{font-size:11px;text-transform:uppercase;letter-spacing:.06em;color:#93c5fd}
.imports-thumbnail-dock .thumbnail-toggle-btn{margin-left:auto;width:26px;height:24px;border:1px solid #355278;border-radius:8px;background:#132239;color:#e5f1ff;font-weight:900;cursor:pointer}
.imports-thumbnail-dock.collapsed{max-height:32px!important;padding-top:3px!important;padding-bottom:3px!important}
.imports-thumbnail-dock.collapsed .imports-thumbnail-dock-head{margin-bottom:0!important}
.imports-thumbnail-dock.collapsed .imports-thumbnail-strip{max-height:0!important;opacity:0!important;pointer-events:none!important;padding:0!important;overflow:hidden!important}
.imports-thumbnail-strip{max-height:96px;opacity:1;transition:max-height .18s ease,opacity .14s ease}
.bulk-import-icon{font-size:17px!important}
.bulk-import-status{display:inline-flex;align-items:center;max-width:260px;height:30px;padding:0 9px;border-radius:999px;border:1px solid #355278;background:#132239;color:#bfdbfe;font-size:11px;font-weight:800;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.bulk-import-status.working:before{content:"";width:10px;height:10px;border:2px solid #60a5fa;border-right-color:transparent;border-radius:50%;margin-right:6px;animation:wpImportSpin .7s linear infinite}
.bulk-import-status.has-errors{border-color:#b45309;color:#fde68a;background:#3a250b}
@keyframes wpImportSpin{to{transform:rotate(360deg)}}
body.theme-light .imports-thumbnail-dock .thumbnail-toggle-btn{background:#fff;color:#0f172a;border-color:#94a3b8}
body.theme-light .bulk-import-status{background:#eff6ff;color:#1e3a8a;border-color:#bfdbfe}
@media(max-width:700px){
  .imports-book-panel .paystub-page,.imports-book-panel .scan-page{padding:8px!important}
  .imports-thumbnail-dock{max-height:112px}
  .bulk-import-status{max-width:180px}
}


/* V1.81 Imports: larger automatic page fit. */
.imports-book-panel .paystub-page,
.imports-book-panel .scan-page{
  padding:8px 10px!important;
}
.imports-book-panel .paystub-page-header,
.imports-book-panel .scan-page-header{
  display:flex!important;
  align-items:flex-start!important;
  justify-content:space-between!important;
  gap:10px!important;
  padding:4px 0 6px!important;
  margin:0 0 4px!important;
  min-height:0!important;
}
.imports-book-panel .paystub-page-header h2,
.imports-book-panel .scan-page-header h2{
  margin:0!important;
  font-size:clamp(17px,1.45vw,22px)!important;
  line-height:1.12!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  max-width:min(72vw,1100px)!important;
}
.imports-book-panel .paystub-page-header p,
.imports-book-panel .scan-page-header p{
  margin:3px 0 0!important;
  font-size:12px!important;
  line-height:1.2!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  max-width:min(72vw,1100px)!important;
}
.imports-book-panel .paystub-page-header > span,
.imports-book-panel .scan-page-header > span{
  flex:0 0 auto!important;
  font-size:13px!important;
  padding:6px 9px!important;
}
.imports-book-panel .document-zoom-surface{
  position:relative!important;
}
.imports-book-panel .document-zoom-toolbar{
  position:absolute!important;
  z-index:6!important;
  top:5px!important;
  left:50%!important;
  transform:translateX(-50%)!important;
  padding:2px 4px!important;
  margin:0!important;
  background:rgba(8,17,29,.72)!important;
  border:1px solid rgba(96,165,250,.28)!important;
  border-radius:999px!important;
  backdrop-filter:blur(4px);
}
body.theme-light .imports-book-panel .document-zoom-toolbar{
  background:rgba(248,250,252,.90)!important;
  border-color:#bfdbfe!important;
}
.imports-book-panel .document-zoom-viewport{
  flex:1 1 auto!important;
  height:100%!important;
  min-height:0!important;
  padding-top:0!important;
}
@media(max-width:700px){
  .imports-book-panel .paystub-page-header h2,
  .imports-book-panel .scan-page-header h2{
    max-width:62vw!important;
    font-size:16px!important;
  }
  .imports-book-panel .paystub-page-header p,
  .imports-book-panel .scan-page-header p{
    max-width:62vw!important;
    font-size:11px!important;
  }
}


/* V1.82 – full-month readable calendar redesign */
.calendar-page-shell.calendar-workspace{grid-template-columns:minmax(235px,270px) minmax(0,1fr)!important;gap:14px}
.calendar-main-stage .calendar-card{border-radius:18px;padding:18px;box-shadow:0 8px 28px rgba(0,0,0,.12)}
.wp-month-toolbar{display:flex!important;align-items:center;justify-content:space-between!important;gap:12px;flex-wrap:wrap;margin-bottom:8px!important;text-align:left}
.wp-month-heading{display:grid;gap:3px}.wp-month-eyebrow{font-size:10px;letter-spacing:.13em;font-weight:800;color:#60a5fa}.wp-month-heading h2{font-size:26px!important;font-weight:800;letter-spacing:-.03em}
.wp-month-actions{display:flex;align-items:center;gap:6px;flex-wrap:wrap}.wp-month-actions .btn{min-height:34px}
.wp-month-legend{display:flex;gap:10px;flex-wrap:wrap;margin:2px 0 14px;font-size:11px;font-weight:700;color:#9fb2cd}
.wp-month-legend span{display:flex;align-items:center;gap:5px}.wp-month-legend span:before{content:'';display:inline-block;width:9px;height:9px;border-radius:3px;background:#4f8be8}
.wp-legend-work:before{background:#2563eb!important}.wp-legend-dive:before{background:#14b8a6!important}.wp-legend-supervisor:before{background:#a855f7!important}.wp-legend-schedule:before{background:#f97316!important}.wp-legend-event:before{background:#eab308!important}.wp-legend-leave:before{background:#64748b!important}
.calendar-main-stage .calendar-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:5px!important;grid-auto-rows:minmax(115px,1fr)!important}
.calendar-main-stage .calendar-head{font-size:11px;text-transform:uppercase;letter-spacing:.05em;text-align:center;font-weight:800;padding:8px 0;color:#9fb2cd}
.calendar-main-stage .calendar-day.wp-calendar-cell{display:flex;flex-direction:column;align-items:stretch;text-align:left;gap:7px;min-width:0;min-height:115px!important;padding:9px!important;border:1px solid #2b415d;border-radius:10px;background:#0d1d31;color:#e5edf8;overflow:hidden;cursor:pointer}
.calendar-main-stage .calendar-day.wp-calendar-cell:hover{border-color:#60a5fa;background:#142a46}
.calendar-main-stage .calendar-day.wp-calendar-cell.selected{outline:2px solid #3b82f6;outline-offset:-2px;border-color:#93c5fd}
.calendar-main-stage .calendar-day.wp-calendar-cell.today .wp-day-number{background:#2563eb;color:#fff;border-radius:50%}
.calendar-main-stage .calendar-day.wp-calendar-cell.wp-outside-month{opacity:.28}
.wp-day-number{width:26px;height:26px;display:grid;place-items:center;font-size:13px;flex:none;font-weight:800}
.wp-day-tags{display:grid;gap:4px;align-content:start;min-width:0}
.wp-month-tag{display:block;min-width:0;max-width:100%;border-radius:5px;padding:5px 6px;font-size:11px;line-height:1.2;font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#fff;text-align:left}
.wp-tag-work{background:#215cbd}.wp-tag-dive{background:#0b857e}.wp-tag-supervisor{background:#7e42ad}.wp-tag-leave{background:#576778}.wp-tag-schedule{background:#ae5617}.wp-tag-travel{background:#b45309}.wp-tag-event{background:#94720e}.wp-tag-appointment{background:#6e51ad}.wp-tag-reminder{background:#9b4b23}.wp-tag-per_diem{background:#267047}
.wp-month-overflow{font-size:10px;color:#93c5fd;text-align:left;font-weight:800}
.wp-supervisor-link{display:block;padding:12px;border:1px solid #8255ad;border-radius:10px;background:rgba(130,85,173,.16);color:inherit;text-decoration:none}
body.theme-light .calendar-main-stage .calendar-day.wp-calendar-cell{background:#fff;border-color:#dce4ee;color:#1e293b}
body.theme-light .calendar-main-stage .calendar-day.wp-calendar-cell:hover{background:#f3f7ff;border-color:#60a5fa}
body.theme-light .calendar-main-stage .calendar-head{color:#64748b}
body.theme-light .wp-month-legend{color:#475569}
@media(max-width:980px){.calendar-page-shell.calendar-workspace{grid-template-columns:1fr!important}.calendar-main-stage .calendar-grid{grid-auto-rows:minmax(105px,auto)!important}}
@media(max-width:650px){.calendar-main-stage .calendar-card{padding:8px!important}.wp-month-toolbar{gap:8px}.wp-month-heading h2{font-size:20px!important}.wp-month-legend{gap:7px;font-size:10px}.calendar-main-stage .calendar-grid{gap:3px!important;grid-auto-rows:minmax(83px,auto)!important}.calendar-main-stage .calendar-day.wp-calendar-cell{min-height:83px!important;padding:4px!important;gap:4px}.wp-day-number{font-size:11px;width:20px;height:20px}.wp-day-tags{gap:3px}.wp-month-tag{padding:3px;font-size:9px;white-space:normal;word-break:break-word;max-height:26px;line-height:1.1}.wp-month-overflow{font-size:9px}.calendar-main-stage .calendar-head{font-size:9px}.wp-month-actions .btn{min-height:30px;padding:5px}}

/* V1.83: no calendar sidebar, full-width calendar and selected-day panel */
.calendar-page-shell.calendar-workspace{display:block!important;width:100%;max-width:none!important}
.calendar-main-stage{width:100%;max-width:none!important;display:flex;flex-direction:column;gap:12px}
.calendar-inline-nav{display:flex;align-items:center;gap:14px;flex-wrap:wrap;padding:10px 12px;border:1px solid #334155;border-radius:12px;background:rgba(15,27,45,.7)}
.calendar-filter-top{display:flex;flex-wrap:wrap;gap:12px;font-size:12px}
.calendar-filter-top label{display:inline-flex;align-items:center;gap:4px;cursor:pointer}
.calendar-day-panel{width:100%;margin-top:8px!important;order:initial!important;padding:16px}
.calendar-day-panel .calendar-section-head{display:flex;justify-content:space-between;align-items:center;gap:12px}
.calendar-day-panel .calendar-section-content{display:block!important}
.calendar-bulk-leave{padding:12px 16px}.calendar-bulk-leave summary{cursor:pointer;font-weight:700}
.wp-tag-payday{background:#15803d!important;color:white!important}
.wp-legend-payday:before{background:#16a34a!important}
.calendar-main-stage .calendar-day.wp-calendar-cell.wp-payday-cell{border:2px solid #16a34a!important;background:linear-gradient(170deg,rgba(34,197,94,.12),transparent 75%),#0d1d31}
body.theme-light .calendar-main-stage .calendar-day.wp-calendar-cell.wp-payday-cell{background:#effdf4!important}
.wp-payday-entry{background:rgba(22,163,74,.12)!important;border-color:#16a34a!important;display:flex;flex-direction:column;gap:5px}
.wp-add-picker{display:grid;gap:18px;padding:12px}.wp-add-picker label{display:grid;gap:7px;font-weight:700}.wp-add-picker select{width:100%;padding:10px}
@media(max-width:650px){.calendar-inline-nav{padding:8px;gap:8px}.calendar-filter-top{gap:8px}.calendar-day-panel{padding:10px}.calendar-day-panel .calendar-section-head{flex-wrap:wrap}}

/* V1.84 calendar: compact weekday row, centered category filters, and popup day details */
.calendar-main-stage .calendar-head {min-height:24px!important;height:24px!important;padding:3px 2px!important;font-size:10px!important;line-height:16px!important;border-radius:6px!important;letter-spacing:.015em!important;align-self:stretch;}
.calendar-inline-nav {display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px;}
.calendar-filter-row {width:100%;display:flex;justify-content:center;align-items:center;}
.calendar-filter-top {display:flex;justify-content:center;align-items:center;flex-wrap:wrap;gap:8px 17px;margin:0 auto;}
.calendar-filter-top label {white-space:nowrap;display:inline-flex;align-items:center;gap:5px;}
.calendar-range-trigger {white-space:nowrap;}
.calendar-legacy-leave-controls[hidden]{display:none!important;}
.calendar-day-backdrop {position:fixed;inset:0;z-index:180;background:rgba(2,6,23,.72);display:flex;align-items:center;justify-content:center;padding:16px;overflow:auto;}
.calendar-day-backdrop.hidden{display:none!important;}
.calendar-day-popup {width:min(860px,100%);max-height:calc(100dvh - 32px);overflow:auto;border-radius:18px;box-shadow:0 28px 75px rgba(0,0,0,.4);}
.calendar-day-popup .calendar-day-panel {margin:0!important;padding:18px;width:100%;}
.calendar-day-popup-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;}
.calendar-day-popup .calendar-section-head{display:flex;align-items:center;justify-content:space-between;gap:12px;}
.calendar-day-popup .calendar-day-toolbar {margin-top:10px;}
@media(max-width:650px){.calendar-main-stage .calendar-head{height:21px!important;min-height:21px!important;padding:2px 0!important;font-size:9px!important;line-height:16px!important}.calendar-day-backdrop{padding:8px;align-items:center}.calendar-day-popup{max-height:calc(100dvh - 16px);border-radius:12px}.calendar-day-popup .calendar-day-panel{padding:12px}.calendar-filter-top{gap:8px 12px}.calendar-inline-nav{gap:8px}.calendar-range-trigger{font-size:12px}}
/* Weekday headings use their own short row; day cells retain their original height. */
.calendar-main-stage .calendar-grid {grid-template-rows:24px repeat(var(--calendar-week-count,5),minmax(115px,1fr))!important;}
@media(max-width:980px){.calendar-main-stage .calendar-grid{grid-template-rows:24px repeat(var(--calendar-week-count,5),minmax(105px,auto))!important;}}
@media(max-width:650px){.calendar-main-stage .calendar-grid{grid-template-rows:21px repeat(var(--calendar-week-count,5),minmax(83px,auto))!important;}}
