/* Keep the weekly summary continuous; Actual keeps its grid. */
.department-picker{margin:12px 9px 0}
.department-picker select{display:block;width:100%;height:34px;padding:0 9px;font:inherit;font-size:12px;font-weight:500;color:#395d47;background:#fff;border:1px solid #d7e2da;border-radius:6px;cursor:pointer}
.department-picker select:hover{border-color:#a8c0b0}
.department-picker select:focus-visible{outline:2px solid #658d71;outline-offset:2px}
.sidebar>.strategy-list{margin-top:18px;flex:0 1 auto}
.add-strategy-button{display:flex;align-items:center;gap:7px;flex-shrink:0;margin:7px 9px 0;padding:9px 5px;font-size:12px;line-height:18px;color:#789080;text-align:left;border-radius:5px}
.add-strategy-button>span:first-child{display:flex}
.add-strategy-button svg{width:15px;height:15px;stroke-width:1.5}
.add-strategy-button:hover{color:#355f43;background:#eaf1ec}
/* Reserve the selected tab's menu space without changing tab geometry. */
.action-tab-item .action-tab{font-weight:500}
.action-tab-item[data-reorder-id]{padding-inline-end:31px}
.action-tab-item[data-reorder-id]>.entity-more{position:absolute;right:7px;top:50%;transform:translateY(-50%);margin-right:0}
@media(max-width:700px){.action-tab-item[data-reorder-id]{padding-inline-end:25px}.action-tab-item[data-reorder-id]>.entity-more{right:3px}}
.strategy-sheet-scroll{width:max-content;max-width:100%;margin-top:0}
.strategy-summary-table{width:calc(188px + var(--strategy-week-count,5)*112px);min-width:0;border-color:#d7e2da}
.strategy-summary-table>tbody>tr>th{width:76px;padding:4px 8px;font-size:10px;line-height:1.4;background:#eef4ef;color:#54715d;border-color:#d7e2da;vertical-align:top}
.strategy-summary-table>tbody>tr>td{border-color:#d7e2da}
.strategy-summary-table>tbody>tr>th.actual-label{padding-top:6px}
.strategy-summary-table textarea,.strategy-summary-table select{min-height:24px;height:24px;padding:4px 8px;font-size:11px;line-height:1.45;color:#496451}
.strategy-summary-table .actual-table th{height:27px;font-size:10px;background:#f2f6f3;border-color:#d7e2da}
.strategy-summary-table .actual-table td{border-color:#d7e2da}
.strategy-summary-table .actual-table tr>*:first-child{width:auto}
.strategy-summary-table .actual-table textarea{min-height:26px;height:26px;padding:4px 6px;font-size:11px;line-height:1.45;color:#3d624a}
.strategy-actions{width:calc(188px + var(--strategy-week-count,5)*112px);max-width:100%;margin-top:20px}
.strategy-actions h2{font-size:12px;margin-bottom:10px}
.strategy-action-list{gap:12px}
.action-rollup{border-radius:5px}
.action-rollup .strategy-action-link{padding:8px 10px;font-size:11px}
.action-rollup-content{padding:8px 10px 10px}
.action-rollup-content p{font-size:11px;line-height:1.45}
.action-performance{min-width:calc(76px + var(--strategy-week-count,5)*112px)}
.action-performance th,.action-performance td{padding:5px 6px;font-size:10px;line-height:1.45;height:26px}
.action-performance tr>*:first-child{width:76px}
.action-summary-card{margin:0 0 9px}
.action-summary-card h3{font-size:13px;font-weight:600;line-height:1.5;margin:0 0 9px;color:#304e3c}
.action-summary-title{text-align:left;font-size:inherit;font-weight:inherit;color:inherit;padding:0;line-height:inherit}
.action-summary-title:hover{color:#2b665c;text-decoration:underline}
.action-summary-scroll{width:100%;overflow-x:auto}
.action-summary-table{width:calc(188px + var(--strategy-week-count,5)*112px);table-layout:fixed;border-collapse:collapse;border:1px solid #d7e2da}
.action-summary-table>tbody>tr>th{width:76px;min-width:0;padding:6px 8px;font-size:10px;font-weight:500;line-height:1.5;color:#54715d;background:#e6eee8;border:1px solid #d7e2da;white-space:nowrap;vertical-align:top}
.action-summary-table>tbody>tr>td{min-width:0;max-width:none;padding:6px 8px;border:1px solid #d7e2da;vertical-align:top;white-space:normal}
.action-summary-table p{margin:0;min-height:16px;white-space:pre-wrap;overflow-wrap:anywhere;font-size:11px;line-height:1.55;color:#496451}
.action-summary-table>tbody>tr>td.actual-container{padding:0}
.action-summary-actual{width:100%;table-layout:fixed;border-collapse:collapse}
.action-summary-actual th,.action-summary-actual td{min-width:0;max-width:none;padding:5px 6px;text-align:center;font-size:10px;line-height:1.45;height:27px;white-space:pre-wrap;border-right:1px solid #d7e2da;border-bottom:1px solid #d7e2da}
.action-summary-actual th{font-weight:500;background:#f2f6f3;color:#54715d}
.action-summary-actual td{color:#3d624a}
.action-summary-actual tr>*:first-child{width:auto}
.action-summary-actual tr>*:last-child{border-right:0}
.action-summary-actual tbody td{border-bottom:0}
.original-sheet{text-decoration:none;white-space:nowrap;flex-shrink:0}
.original-sheet[hidden]{display:none}
.original-sheet:focus-visible{outline:2px solid #555;outline-offset:2px}
.solution-add+.detail-block{margin-top:16px}
.detail-block{min-width:0;position:relative}
.detail-preview[hidden],.detail-editor[hidden]{display:none}
.detail-preview .content-space{cursor:text;min-height:160px;padding:8px 0}
.detail-preview .content-space:focus-visible{outline:2px solid #555;outline-offset:4px}
.detail-open{border:0;background:#f2f2f2;color:#333;padding:6px 12px;border-radius:4px;cursor:pointer}
.detail-editor textarea{display:block;width:100%;box-sizing:border-box;min-height:280px;max-height:60vh;resize:vertical;font:inherit;line-height:1.8;white-space:pre-wrap;text-align:left;padding:12px;border:1px solid #aaa;border-radius:4px;background:#fff;color:#222}
.detail-actions{display:flex;gap:8px;margin-top:10px;position:sticky;bottom:8px;background:#fff;padding:8px 0}
@media(max-width:700px){.header-actions #retrySave{position:fixed;right:12px;bottom:48px;z-index:31;background:#fff;box-shadow:0 1px 5px #0001}.detail-editor textarea{min-height:180px;max-height:45vh}.detail-actions button,.detail-open{min-height:40px}}
.content-space{min-height:360px;white-space:pre-wrap;overflow-wrap:anywhere;font-size:13px;line-height:1.9;color:#3c4c40;border:0;background:transparent;padding:0;cursor:default}
.week-actual-table .weekly-summary-rows tr:not(:first-child)>*{border-top:0}
.week-actual-table .weekly-summary-rows tr:not(:last-child)>*{border-bottom:0}
.week-actual-table{width:calc(188px + var(--week-count,5)*112px)}
.week-actual-table tr>*:nth-child(2){width:auto}
.week-actual-table input,.strategy-summary-table .actual-table input{box-sizing:border-box;display:block;width:100%;min-width:0;height:26px;min-height:26px;max-height:26px;padding:4px 6px;margin:0;border:0;border-radius:0;outline:none;background:transparent;text-align:center;white-space:nowrap;font-size:11px;line-height:18px;color:#3d624a}
.week-actual-table input:focus,.strategy-summary-table .actual-table input:focus{background:#edf5ef;box-shadow:inset 0 0 0 1px #a5bfad}
.action-summary-actual tbody td{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;height:27px;max-height:27px;line-height:17px}
.week-controls{display:flex;flex-direction:column;align-items:flex-start;flex-shrink:0;gap:6px;margin-top:1px}
.week-size-buttons{display:flex;flex-direction:column;gap:2px}
.week-controls .icon-button{width:25px;height:25px;margin:0}
.week-controls .icon-button:disabled,.week-visibility-tools button:disabled{opacity:.4;cursor:default}
.week-visibility-tools{display:flex;gap:5px;margin:0 0 5px}
.week-visibility-tools button{padding:4px 7px;border:1px solid #d7e2da;border-radius:4px;background:#f7faf8;color:#54715d;font-size:10px;line-height:16px;white-space:nowrap}
.week-visibility-tools button:hover:not(:disabled){background:#edf4ef}
.week-visibility-tools button[hidden]{display:none}
.week-controls .week-visibility-tools{flex-direction:column;align-items:flex-start;margin:0}
.editable-field{display:block;position:relative;min-width:0}
.editable-field>.field-confirm{display:block;width:max-content;margin:4px 0 3px;padding:3px 10px;border:1px solid #9ebaab;border-radius:4px;background:#edf5ef;color:#315e43;font-size:11px;line-height:17px;cursor:pointer}
.strategy-summary-table .editable-field:not(.single-line)>.field-confirm{margin-left:8px}
.editable-field>.field-confirm:hover{background:#dfeee3}
.editable-field>.field-confirm[hidden],#retrySave[hidden]{display:none}
.editable-field.single-line{height:26px}
.single-line>.field-confirm{position:fixed;z-index:50;margin:0;box-shadow:0 2px 6px #315e4320}
.strategy-summary-layout{display:flex;align-items:flex-start;gap:6px;width:max-content;max-width:100%}
.strategy-summary-layout>.strategy-sheet-scroll{min-width:0;flex:0 1 auto;margin-top:0}
.strategy-week-tools{flex:none}
.strategy-week-tools .week-visibility-tools{margin:0}
.archive-page{max-width:920px}
.archive-page[hidden]{display:none}
.archive-page>h2{margin:0 0 22px;font-size:19px;line-height:1.4;color:#304e3c;font-weight:600}
.archive-entry{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:18px 0;border-top:1px solid #e3eae5}
.archive-copy{min-width:0}
.archive-kind{display:block;color:#85998b;font-size:10px;margin-bottom:5px}
.archive-entry h3{font-size:13px;line-height:1.6;color:#395b46;margin:0;font-weight:600;overflow-wrap:anywhere}
.archive-entry p{font-size:11px;line-height:1.7;color:#83968a;margin:5px 0 0;overflow-wrap:anywhere}
.archive-entry .restore-dependency{color:#a37c67}
.archive-entry button{flex-shrink:0;font-size:11px}
.archive-entry button:disabled{opacity:.4;cursor:default}
.archive-status{font-size:11px;line-height:1.6;color:#688e72;margin:12px 0 0}
.archive-status:empty{display:none}
.empty-archive{padding:45px 0;color:#91a196;font-size:12px;text-align:center;border-top:1px solid #e3eae5}
#openArchive[aria-current="page"]{background:#e8f1eb;color:#3d6950;border-color:#c7dacd}
.strategy-item{cursor:grab;touch-action:none;user-select:none}
.strategy-list.sorting,.strategy-row.dragging .strategy-item{cursor:grabbing}
.strategy-row.dragging{z-index:5;background:#e5eee8;box-shadow:0 2px 8px #375d3f22;opacity:.9;pointer-events:none}
.strategy-row.drop-before{box-shadow:inset 0 2px 0 #548162}
.strategy-row.drop-after{box-shadow:inset 0 -2px 0 #548162}
.solution-summary{margin-bottom:18px}
.solution-grid>.grid-row:first-child{border-top:1px solid #e2e9e4}
.text-add-button{display:flex;align-items:center;gap:6px;padding:8px 3px;font-size:12px;line-height:18px;color:#5e8069;border-radius:4px}
.text-add-button svg{width:15px;height:15px;stroke-width:1.5}
.text-add-button:hover{color:#315e43;background:#f1f6f2}
.solution-add{margin-top:8px}
.header-actions .save-status{position:static;display:block;font-size:11px;line-height:1.3;max-width:220px;color:#688174;white-space:normal}
.header-actions .save-status.error{color:#a14835}
.confirm-update{flex-shrink:0;border:1px solid #cbded1;background:#edf4ef;color:#2b665c;border-radius:7px;width:30px;height:30px}
.confirm-update.pending{background:#2b665c;color:white;border-color:#2b665c}
.confirm-update:disabled{opacity:.45;cursor:default}
.sync-loading{position:fixed;inset:0;z-index:1000;background:rgba(247,249,247,.96);display:flex;align-items:center;justify-content:center;flex-direction:column;gap:12px;color:#335347}
.sync-loading[hidden],.confirm-update[hidden]{display:none}
#conflictDialog{max-width:480px;width:calc(100% - 40px);line-height:1.65}
#conflictDialog h2{font-size:18px;margin:0 0 14px}
#conflictDialog p{font-size:14px;color:#657168}
@media(max-width:900px){.header-actions .save-status{max-width:110px;font-size:10px}.header-actions{gap:7px}}
@media(max-width:700px){.header-actions .save-status{position:fixed;top:auto;height:auto;right:12px;bottom:12px;z-index:30;max-width:calc(100vw - 24px);padding:5px 9px;border-radius:6px;background:#f0f5f1;box-shadow:0 1px 5px #0001}.header-actions .save-status:empty{display:none}}

/* Keep tabs flush with the top and the sidebar control at the far right. */
.action-tabs-bar{height:38px;padding:0 18px 0 14px}
.action-tab-item .action-tab{height:36px}
.action-tabs-bar>.header-actions{margin-bottom:3px}
.action-tabs-bar>.add-action{margin-bottom:3px}
.header-actions>.sidebar-toggle{margin:0;width:30px;height:30px}
@media(max-width:700px){.action-tabs-bar{padding-left:8px}.action-tabs-bar>.header-actions{margin-bottom:3px}.action-tabs-bar>.add-action{margin-bottom:3px}.header-actions>.sidebar-toggle{width:25px}}

#strategy-overview-tab{font-weight:700}

.action-tabs{scrollbar-width:none}
.action-tabs::-webkit-scrollbar{display:none}

/* Strategy summary child tabs; the finding canvas intentionally has no content. */
#strategyPanel>.strategy-subtabs{display:flex;align-items:center;gap:6px;margin:0 0 18px;border-bottom:1px solid #dfe7e1}
.strategy-subtab{position:relative;min-width:76px;min-height:40px;padding:10px 18px;color:#75877b;font-size:13px;font-weight:500;border-radius:5px 5px 0 0}
.strategy-subtab:hover{background:#f0f5f1;color:#375c46}
.strategy-subtab[aria-selected="true"]{color:#375c46;font-weight:700;background:#edf4ef}
.strategy-subtab[aria-selected="true"]::after{content:'';position:absolute;bottom:-1px;left:0;right:0;height:2px;background:#3e6750}
.strategy-subtab:focus-visible,.strategy-finding-canvas:focus-visible{outline:2px solid #7ca38b;outline-offset:2px}
#strategy-summary-panel[hidden],#strategy-finding-panel[hidden]{display:none}
.strategy-finding-canvas{min-height:calc(100dvh - 200px);background:#fff;border:1px solid #e2e9e4;border-radius:6px}
@media(max-width:700px){.strategy-subtab{min-width:68px;padding-inline:14px}.strategy-finding-canvas{min-height:calc(100dvh - 170px)}}
@media print{.strategy-subtabs{display:none!important}}

/* Strategy overview is a separate parent control beside the action tabs. */
.action-tab-item.strategy-overview-item{align-self:center;height:30px;margin:3px 14px 3px 0;border:1px solid #b8ccbf;border-radius:5px;background:#e5eee8}
.strategy-overview-item::after{content:'';position:absolute;right:-10px;top:4px;width:1px;height:20px;background:#cfdad3;pointer-events:none}
.action-tab-item.strategy-overview-item::before{display:none}
.strategy-overview-item #strategy-overview-tab{height:28px;color:#375c46;padding:0 13px;font-weight:700;border-radius:4px}
.action-tab-item.strategy-overview-item:hover{background:#d9e7de;border-color:#9bb8a5}
.action-tab-item.strategy-overview-item.active{background:#3e6750;border-color:#3e6750}
.strategy-overview-item.active #strategy-overview-tab{color:#fff}
.strategy-overview-item #strategy-overview-tab:focus-visible{outline:2px solid #7ca38b;outline-offset:3px}

.action-tabs-bar>.tab-scroll{width:24px;height:30px;margin:0 0 3px;border:1px solid #d4e0d8;background:#fff;color:#52755d;border-radius:4px}
.tab-scroll[hidden]{display:none}
.tab-scroll:disabled{opacity:.35;cursor:default}
.tab-scroll-back svg{transform:rotate(180deg)}
#toggleSidebar.sidebar-divider-toggle{position:fixed;z-index:26;left:229px;top:50%;transform:translateY(-50%);width:22px;height:46px;margin:0;border:1px solid #c8d6cd;border-radius:7px;background:#f5f8f6;color:#5d7b67;box-shadow:0 1px 4px #2648320c}
#toggleSidebar.sidebar-divider-toggle svg{width:14px;height:14px;stroke-width:1.6}
#toggleSidebar.sidebar-divider-toggle[aria-expanded="true"] svg{transform:rotate(180deg)}
#toggleSidebar.sidebar-divider-toggle:hover{background:#e5eee8;color:#2d5a40;border-color:#9fb8a8}
.sidebar-collapsed #toggleSidebar.sidebar-divider-toggle{left:0;border-radius:0 7px 7px 0}
@media(min-width:1600px){#toggleSidebar.sidebar-divider-toggle{left:249px}.sidebar-collapsed #toggleSidebar.sidebar-divider-toggle{left:0}}
@media(min-width:701px) and (max-width:1000px){#toggleSidebar.sidebar-divider-toggle{left:199px}.sidebar-collapsed #toggleSidebar.sidebar-divider-toggle{left:0}}
@media(max-width:700px){#toggleSidebar.sidebar-divider-toggle{left:0;border-radius:0 7px 7px 0}.sidebar-open #toggleSidebar.sidebar-divider-toggle{left:229px;border-radius:7px}}

/* Fit short names and cap long tabs, including the reserved menu area. */
.action-tabs{--tab-max-width:220px}
.action-tab-item{max-width:var(--tab-max-width)}
.action-tab-item .action-tab{width:max-content;min-width:0;max-width:100%;padding-inline:12px}
.action-tab-item .action-tab>span{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@media(max-width:700px){.action-tabs{--tab-max-width:180px}.action-tab-item .action-tab{padding-inline:10px}}

/* Highlight only the selected week heading, keeping Actual cells neutral. */
.week-actual-table .context-tab.active{background:#d6e6db;color:#28523b;font-weight:600}
.week-actual-table .context-tab.active:after{background:#477858}

.phase-week-label{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;min-width:38px;height:23px;padding:0 8px;border:1px solid #cbded1;border-radius:4px;background:#e8f1eb;color:#365d45;font-size:11px;font-weight:600;line-height:21px}

.archive-entry-actions{display:flex;align-items:center;gap:7px;flex-shrink:0}
.archive-entry-actions .archive-delete{color:#a36e63;border-color:#e2cec8}
.archive-entry-actions .archive-delete:hover{color:#8b4b3e;background:#fbf2ef}
#archiveDeleteDialog{width:420px;max-width:calc(100% - 32px)}
#archiveDeleteDialog h2{margin:0 0 18px;font-size:17px;color:#365642}
#archiveDeleteName{font-size:13px;font-weight:600;overflow-wrap:anywhere;margin:0 0 8px}
#archiveDeleteDetail{font-size:12px;line-height:1.7;color:#7d8980;margin:0}
#archiveDeleteDialog .danger-button{background:#9a594a;border-color:#9a594a;color:#fff}
#archiveDeleteDialog .danger-button:hover{background:#854a3d}

/* Six workflow phases are the default for every current and future strategy. */
@media(max-width:700px){#phaseTabs{flex-wrap:wrap;height:auto;overflow:visible;row-gap:0}}
/* Compact navigation; retain source-sheet node for existing sync handlers. */
#originalSheet{display:none!important}
.sidebar-footer{margin-top:auto;padding-top:14px;display:flex;gap:8px;flex-shrink:0;border-top:1px solid #e1e7e3}
.sidebar-footer .guide-button{flex:1;text-align:center}
.sidebar>.add-strategy-button{flex-shrink:0}
.action-tabs-bar{height:32px}
.action-tab-item .action-tab{height:28px;line-height:18px;padding-top:0;padding-bottom:0}
.action-tab-item.strategy-overview-item{height:28px;margin-top:1px;margin-bottom:1px}
.action-tabs-bar>.tab-scroll{height:28px;margin-bottom:1px}
.action-tabs-bar>.add-action{height:28px;margin-bottom:1px}
.action-tabs-bar>.header-actions{margin-bottom:1px}
.original-sheet[aria-disabled="true"]{color:#747c76;background:#f5f6f4;cursor:not-allowed}
@media(max-width:700px){.header-actions .original-sheet{white-space:normal;max-width:92px;font-size:10px;line-height:1.25;padding:4px 6px}}

/* Compact label-width action tabs; the label itself opens the menu. */
.action-tabs-bar{height:36px}
.action-tab-item[data-reorder-id]{padding-inline-end:0}
.action-tab-item[data-reorder-id]>.action-tab{height:32px;min-width:0;width:max-content;padding-inline:12px;line-height:18px}
