/* #024 v285 responsive Minimal layout — never change formal #048/#054/Frozen assets. */
#bf-calendar-redmine-host{display:flex;flex-direction:column;align-items:stretch;min-width:0!important;height:auto!important;min-height:0!important;overflow:visible!important}
#bf-calendar-redmine-host>.bone-calendar__selected-day-below{position:relative!important;inset:auto!important;left:auto!important;top:auto!important;width:100%!important;max-width:100%!important;box-sizing:border-box!important;margin:10px 0 0!important;z-index:auto!important}
#bf024-calendar-action-row{position:relative;display:flex;gap:6px;flex-wrap:wrap;align-items:center;margin:10px 0 8px;padding:9px;border:1px solid #afc3d9;border-radius:8px;background:#f5f9ff;box-sizing:border-box;max-width:100%;min-width:0}
#bf024-calendar-action-row .bone-calendar__manager-buttons{display:flex!important;flex-wrap:wrap!important;width:100%;height:auto!important;gap:6px}
#bf024-calendar-action-row button{box-sizing:border-box;min-height:38px;max-width:100%;white-space:normal;word-break:keep-all;border:1px solid #849eba;border-radius:6px;padding:6px 9px;cursor:pointer;background:#fff;color:#163551;font:600 12px/1.35 system-ui,Meiryo,sans-serif}
.bf024-formal054-layout{align-items:start;box-sizing:border-box!important}
.bf024-report-board{min-width:0!important;max-width:100%;box-sizing:border-box}
.bf024-report-accordion{min-width:0;max-width:100%}
.bf024-report-accordion-summary{cursor:pointer;list-style:disclosure-closed inside;padding:10px 8px;border:1px solid #b4c8dd;border-radius:7px;background:#e5effb;color:#132f48;overflow-wrap:anywhere}
.bf024-report-accordion[open]>.bf024-report-accordion-summary{list-style-type:disclosure-open;margin-bottom:8px}
.bf024-report-accordion-summary>.bf024-report-title{display:inline;font-weight:700;font-size:clamp(14px,2.1vw,19px);vertical-align:middle}
.bf024-report-accordion-content{min-width:0;max-width:100%}
.bf024-mobile-fit-toggle{display:none;border:1px solid #497bb0;border-radius:6px;background:#f3f9ff;color:#17446d;font:700 12px system-ui,Meiryo,sans-serif;padding:7px 10px;margin:5px 0 9px;cursor:pointer}
@media (max-width: 900px){
 .bf024-formal054-layout{display:flex!important;flex-direction:column!important;width:100%;min-width:0;padding:8px!important;gap:12px!important}
 #bf-calendar-redmine-host,#bf024-calendar-formal054-host{width:100%;max-width:100%;min-width:0!important}
 .bf024-report-heading-main,.bf024-report-heading-settings{gap:6px!important}
 .bf024-report-heading-main .bf024-report-print-actions{margin-left:0!important}
 .bf024-report-worktypes-table{min-width:740px}
}
@media (max-width:680px){
 html,body{max-width:100%;margin:0!important}
 .bf024-formal054-layout{padding:5px!important;gap:8px!important}
 .bf024-report-board{padding:7px!important;border-radius:7px!important;width:100%!important}
 #bf-calendar-redmine-host{padding:0!important}
 #bf-calendar-redmine-host>.bone-calendar{max-width:100%!important;min-width:0!important;width:100%!important;box-sizing:border-box!important}
 #bf-calendar-redmine-host>.bone-calendar__selected-day-below{padding:8px!important}
 #bf024-calendar-action-row{padding:6px;gap:4px}
 #bf024-calendar-action-row button{min-height:36px;padding:5px 7px;font-size:11px}
 .bf024-mobile-fit-toggle{display:inline-flex}
 .bf024-report-table-scroll[data-mobile-fit="true"]{overflow-x:hidden!important;width:100%;max-width:100%}
 .bf024-report-table[data-mobile-fit="true"]{min-width:0!important;max-width:100%!important;width:100%!important}
 .bf024-report-table[data-mobile-fit="true"] .bone-table__root,
 .bf024-report-table[data-mobile-fit="true"] .bone-table__table{min-width:0!important;max-width:100%!important;width:100%!important;table-layout:fixed!important}
 .bf024-report-table[data-mobile-fit="true"] [data-column-key="timeline"]{min-width:0!important;padding:1px!important}
 .bf024-report-table[data-mobile-fit="true"] [data-column-key="timeline"] .bone-table__cell-content{min-height:56px!important;min-width:0!important;width:100%!important}
 .bf024-report-table[data-mobile-fit="true"] .bone-table__table th,
 .bf024-report-table[data-mobile-fit="true"] .bone-table__table td{box-sizing:border-box!important;min-width:0!important;padding:2px!important;overflow:hidden!important;font-size:10px!important}
 .bf024-report-table[data-mobile-fit="true"] td[data-column-key="income"],
 .bf024-report-table[data-mobile-fit="true"] td[data-column-key="expense"]{padding:1px!important}
 .bf024-report-table[data-mobile-fit="true"] .bone-display-timeline{min-width:0!important;max-width:100%!important;width:100%!important}
 .bf024-report-totals{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:5px!important}
 .bf024-report-total{padding:6px!important}
 .bf024-report-total strong{font-size:15px!important}
 .bf024-report-worktypes-heading{font-size:12px!important;white-space:normal!important}
 .bf024-report-selection{margin-top:10px}
 .bf024-report-heading select{min-width:0!important;width:100%!important;max-width:100%!important}
 .bf024-report-heading-main,.bf024-report-heading-settings{width:100%;align-items:stretch;flex-wrap:wrap!important}
 .bf024-report-print-actions{width:100%;flex-wrap:wrap!important}
 .bf024-report-heading-main .bf024-report-print-actions .bf024-report-print-button{flex:1 1 auto}
 .bf024-report-table-scroll{touch-action:pan-x pan-y;overscroll-behavior-x:contain}
 .bf024-report-table .bone-display-timeline__item{touch-action:none}
}
@media print{#bf024-calendar-action-row,.bf024-mobile-fit-toggle{display:none!important}.bf024-report-accordion-content{display:block!important}}

/* v284: selected day has a real slot. It MUST not overlap action row or report. */
#bf024-selected-day-slot{position:relative!important;display:block;box-sizing:border-box;width:100%;min-width:0;max-width:100%;height:auto;overflow:visible;clear:both}
#bf024-selected-day-slot>.bone-calendar__selected-day-below{position:relative!important;display:block;inset:auto!important;left:auto!important;top:auto!important;right:auto!important;bottom:auto!important;transform:none!important;width:100%!important;max-width:100%!important;box-sizing:border-box!important;margin:10px 0 0!important;z-index:auto!important}
#bf024-selected-day-slot>.bone-calendar__selected-day-below[hidden]{display:none!important}
#bf-calendar-redmine-host>#bf024-calendar-formal054-host{position:relative!important;display:block!important;float:none!important;clear:both!important;min-width:0!important;width:100%!important;max-width:100%!important;box-sizing:border-box!important;margin-top:10px}
.bf024-report-accordion-content{overflow:visible!important}
/* The #048/#054 timeline stays visible outside the settings accordion. */
.bf024-report-table-scroll{position:relative;display:block;clear:both}
@media(max-width:900px){
 .bf024-formal054-layout{display:block!important;box-sizing:border-box!important;width:100%!important;max-width:100%!important;min-width:0!important}
 #bf-calendar-redmine-host{height:auto!important;min-height:0!important;width:100%!important;min-width:0!important;max-width:100%!important;overflow:visible!important;display:flex!important;flex-direction:column!important;isolation:auto!important}
 #bf024-calendar-action-row{order:3}
 #bf024-selected-day-slot{order:2}
 #bf-calendar-redmine-host>.bone-calendar{order:1}
 #bf-calendar-redmine-host>#bf024-calendar-formal054-host{order:4}
}
@media(max-width:680px){
 /* Plain numbers replace #029 voucher grids in small-screen report only. */
 .bf024-report-table[data-mobile-plain-money="true"] td[data-column-key="income"],
 .bf024-report-table[data-mobile-plain-money="true"] td[data-column-key="expense"]{text-align:right!important;font-variant-numeric:tabular-nums;white-space:nowrap!important;padding:2px!important;font-size:11px!important}
 .bf024-report-table[data-mobile-plain-money="true"] td[data-column-key="income"] .bone-table__cell-content,
 .bf024-report-table[data-mobile-plain-money="true"] td[data-column-key="expense"] .bone-table__cell-content{justify-content:flex-end!important;text-align:right!important;white-space:nowrap!important;overflow:hidden!important;min-width:0!important}
}
@media print{#bf024-selected-day-slot{break-inside:avoid}}

/* v285: actual mobile calendar/selection/timeline must participate in the SAME
   single-column full viewport grid. This removes the inherited 280/340px sidebar. */
@media(max-width:900px){
 html,body{width:100%!important;min-width:0!important;overflow-x:clip!important}
 .bf024-formal054-layout{display:grid!important;grid-template-columns:minmax(0,1fr)!important;grid-auto-flow:row!important;gap:8px!important;width:100%!important;max-width:100%!important;min-width:0!important;margin:0!important;padding:6px!important}
 #bf-calendar-redmine-host{display:contents!important}
 .bf024-formal054-layout>.bone-calendar,.bf024-formal054-layout>#bf024-calendar-formal054-host,
 #bf024-calendar-formal054-host,#bf024-selected-day-slot,#bf024-calendar-action-row,
 #bf-calendar-redmine-host>.bone-calendar{grid-column:1!important;box-sizing:border-box!important;width:100%!important;max-width:100%!important;min-width:0!important;justify-self:stretch!important;align-self:stretch!important}
 #bf-calendar-redmine-host>.bone-calendar{min-height:auto!important}
 .bf024-report-board,.bf024-report-table-scroll{box-sizing:border-box!important;min-width:0!important;width:100%!important;max-width:100%!important}
}
/* v285 SQLite controls / management panel */
#bf024-sqlite-controls{display:block!important;padding:0!important;overflow:hidden;max-width:100%;min-width:0;box-sizing:border-box;border:1px solid #abc2da;border-radius:12px!important;background:#f4f8fe!important;box-shadow:0 2px 9px #12345510}
#bf024-sqlite-controls .bf024-db-heading{display:flex;justify-content:space-between;align-items:center;gap:8px;flex-wrap:wrap;padding:11px 13px;background:#e6f0fc;border-bottom:1px solid #c2d5e9}
.bf024-db-label{display:flex;gap:10px;align-items:center;color:#173b5c}
.bf024-db-label strong{display:block;font-size:15px!important}.bf024-db-label small{display:block;color:#53718d;font-size:11px}
.bf024-db-symbol{display:grid;place-items:center;background:#2b5c8c;color:white;width:33px;height:33px;border-radius:9px;font-weight:800}
#bf024-sqlite-status.bf024-db-status{display:inline-block!important;max-width:100%;min-width:0!important;margin:0!important;border-radius:99px;border:1px solid #a7bdd3;background:#fff;color:#23425d;padding:6px 12px;overflow-wrap:anywhere;font-size:12px!important}
#bf024-sqlite-status.bf024-db-status[data-state=connected]{border-color:#82bc97;background:#eaf7ee;color:#195937}
#bf024-sqlite-status.bf024-db-status[data-state=error]{border-color:#de9999;background:#fff0f0;color:#8d1e26}
.bf024-db-actions{display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding:11px 13px}
#bf024-sqlite-controls .bf024-db-actions button{min-height:38px;padding:7px 12px!important}
#bf024-sqlite-controls .bf024-db-actions #bf024-sqlite-save{background:#205c94;color:#fff;border-color:#205c94}
.bf024-db-manage{border-top:1px solid #c2d5e9;padding:10px 13px 13px;background:#f9fbff}
.bf024-db-manage-label{display:block;color:#315579;font-size:12px;font-weight:700;margin:0 0 7px}
#bf024-sqlite-management-nav{display:flex;flex-wrap:wrap;gap:7px;align-items:center}
#bf024-sqlite-management-nav button{min-height:39px;white-space:normal;border-radius:7px;border:1px solid #7d9fbe;padding:7px 10px;background:#fff;color:#173b5c;font:650 12px/1.4 system-ui,Meiryo,sans-serif;cursor:pointer}
#bf024-sqlite-management-nav button:hover{background:#e4f0fc}
#bf024-restore-dialog,#bf024-management-dialog{box-sizing:border-box;max-width:calc(100vw - 18px);padding:0;border:1px solid #91acc7;border-radius:12px;box-shadow:0 20px 65px #06162988}
#bf024-restore-dialog::backdrop,#bf024-management-dialog::backdrop{background:rgba(5,16,29,.65)}
#bf024-restore-dialog{width:min(560px,calc(100vw - 18px));padding:0 0 18px;color:#17344f;background:#f7faff}
#bf024-restore-dialog p{padding:0 18px;font-size:13px;line-height:1.65}
#bf024-restore-dialog .bf024-sqlite-restore-label{display:block;margin:0 18px;cursor:pointer}
#bf024-restore-dialog input[type=file]{display:block;width:100%;max-width:100%;margin-top:8px}
#bf024-management-dialog{width:min(1240px,calc(100vw - 18px));height:min(91dvh,920px);max-height:calc(100dvh - 18px);background:#eff5fc;overflow:hidden}
#bf024-management-frame{display:block;border:0;background:white;width:100%;height:calc(100% - 51px);min-width:0}
.bf024-dialog-bar{display:flex;justify-content:space-between;align-items:center;gap:8px;min-height:51px;box-sizing:border-box;background:#173956;color:#fff;padding:8px 12px}
.bf024-dialog-bar h2{font:bold 15px/1.4 system-ui,Meiryo,sans-serif;margin:0;color:inherit}
.bf024-dialog-bar button{border:1px solid #a3bddd;background:#f5faff;color:#173956;border-radius:6px;min-height:35px;padding:6px 12px;font-weight:700;cursor:pointer}
@media(max-width:680px){
 .bf024-db-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))!important}
 .bf024-db-actions button{width:100%!important;min-width:0!important;white-space:normal!important}
 #bf024-sqlite-management-nav{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
 #bf024-sqlite-management-nav button{width:100%;min-width:0;min-height:42px;font-size:11px}
 .bf024-db-heading{align-items:stretch}
 #bf024-sqlite-status.bf024-db-status{width:100%}
 #bf024-management-dialog{width:100vw;max-width:100vw;height:100dvh;max-height:100dvh;border-radius:0;margin:0}
}
@media print{#bf024-sqlite-controls,.bf024-management-dialog,.bf024-small-dialog{display:none!important}}
@media(max-width:900px){html,body{box-sizing:border-box!important}}

/* v318 rebuild: native manager controls remain inside Calendar footer on all viewports. */
#bf-calendar-redmine-host .bone-calendar__footer{display:flex;flex-wrap:wrap;gap:6px;min-width:0;align-items:center}
#bf-calendar-redmine-host .bone-calendar__manager-buttons{display:flex;flex:1 1 100%;min-width:0;max-width:100%;flex-wrap:wrap;gap:6px;justify-content:flex-start}
#bf-calendar-redmine-host .bone-calendar__manager-open{min-height:40px;white-space:normal;overflow-wrap:anywhere}
@media(max-width:680px){
 #bf-calendar-redmine-host .bone-calendar__manager-open{min-height:44px;padding:8px 10px;font-size:12px}
 #bf024-sqlite-management-nav button{min-height:44px}
}
