body { min-height: 100vh; display: flex; flex-direction: column; }
.page { width: 100%; flex: 1; min-width: 0; }
.topbar { background: #fff; border-top: 3px solid #236e52; padding: 12px 24px; gap: 20px; z-index: 10; display: grid; grid-template-columns: auto minmax(0,1fr) auto; }
.brand { flex-shrink: 0; min-width: 0; }
.brand-icon { width: 61.2px; height: 61.2px; flex-shrink: 0; object-fit: contain; }
.topbar .brand { margin-right: auto; }
.brand-copy { display: grid; line-height: 1.3; gap: 3px; min-width: 0; }
.brand-copy strong { font-size: 22px; font-weight: 800; }
.brand-copy small { font-size: 12px; font-weight: 400; color: var(--muted); overflow-wrap: anywhere; }
.topbar .main-navigation { flex-wrap: wrap; gap: 4px; justify-content: center; }
.topbar .main-navigation .nav-link { font-weight: 750; font-size: 12px; padding: 12px 10px; color: #474e48; border-radius: 4px; }
.topbar .main-navigation .nav-link:hover { background: #f0f5f2; color: #174d37; }
.topbar .main-navigation .nav-link--active { background: #edf5f0; color: #174d37; }
.topbar .main-navigation .nav-link--active::after { bottom: 0; left: 10px; right: 10px; background: #c13d45; }
.topbar .icon-button { margin-left: 5px; flex-shrink: 0; }
.site-footer { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; color: var(--muted); font-size: 13px; padding: 22px 16px; border-top: 1px solid var(--line); background: #fff; }
.corporate-logo { display: block; object-fit: contain; flex-shrink: 0; }
.corporate-logo--header { width: 88px; height: 78.3px; justify-self: end; }
.corporate-logo--footer { width: 110px; height: 97.9px; }
.login-corporate-header { display: flex; justify-content: flex-end; padding: 16px 24px 0; }
.settings-navigation { flex-wrap: wrap; gap: 12px 24px; }
.settings-email-group { flex: 1 1 240px; }
.settings-tab { max-width: 100%; overflow-wrap: anywhere; }
.page .list-header, .page .detail-header, .page .dashboard-header { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; align-items: center; gap: 16px; width: 100%; }
.page .list-header > *, .page .detail-header > *, .page .dashboard-header > * { min-width: 0; max-width: 100%; }
.page .list-header h1, .page .detail-header h1, .page .dashboard-header h1 { margin: 0 auto; max-width: 100%; font-size: 32px; line-height: 1.18; overflow-wrap: anywhere; text-align: center; }
.page .list-actions, .page .quick-actions { justify-content: center; flex-wrap: wrap; max-width: 100%; }
.page .list-search { max-width: 100%; }
.page .list-search input { min-width: 0; }
.period-control { display: grid; gap: 4px; font-size: 12px; font-weight: 650; text-align: left; min-width: 140px; }
.period-control select { min-height: 40px; font-size: 14px; }
.pipeline-period-form, .pipeline-search { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; justify-content: center; }
.period-range { color: var(--muted); font-size: 13px; margin: 6px 0 14px; }
.pipeline-panel .panel-heading { flex-wrap: wrap; }
.pipeline-panel .pipeline-grid { grid-template-columns: repeat(auto-fit,minmax(125px,1fr)); }
.ninja-board { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(235px, 1fr); }
.task-status-tabs { justify-content: center; }
.task-cards { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
.task-card { background: #fff; padding: 18px; border: 1px solid var(--line); border-radius: 6px; min-width: 0; overflow-wrap: anywhere; }
.task-card p { margin: 8px 0; }
.task-card .panel-heading { align-items: start; }
.task-card strong { min-width: 0; }
.task-toggle { width: 36px; height: 36px; min-height: 36px; padding: 4px; flex-shrink: 0; }
.task-editor .form-grid { grid-template-columns: 1fr; text-align: left; }
.task-table .task-editor { min-width: 190px; }
.task-table .task-editor input, .task-table .task-editor select { width: 100%; }
.knowledge-layout { display: grid; grid-template-columns: 210px minmax(0,1fr); gap: 28px; }
.knowledge-categories { display: flex; flex-direction: column; align-self: start; gap: 4px; border-right: 1px solid var(--line); padding-right: 16px; }
.knowledge-categories a { font-size: 14px; padding: 10px 12px; border-radius: 4px; overflow-wrap: anywhere; }
.knowledge-categories a:hover, .knowledge-categories [aria-current] { background: #eaf2ed; color: #1a553c; font-weight: 700; }
.knowledge-options { min-width: 0; }
.knowledge-options h2 { font-size: 20px; }
.knowledge-options .panel-heading { flex-wrap: wrap; }
.knowledge-add, .knowledge-option-form { display: grid; grid-template-columns: minmax(0,1fr) 90px auto; align-items: end; gap: 12px; margin: 0; }
.knowledge-add { padding: 18px 0; border-bottom: 2px solid var(--line); }
.knowledge-add label, .knowledge-option-form label { display: grid; min-width: 0; gap: 4px; font-size: 12px; color: var(--muted); }
.knowledge-add input, .knowledge-option-form input { width: 100%; min-width: 0; }
.knowledge-list { list-style: none; padding: 0; margin: 0; }
.knowledge-list > li { display: flex; gap: 14px; align-items: end; padding: 14px 0; border-bottom: 1px solid var(--line); }
.knowledge-option-form { flex: 1; min-width: 0; }
.knowledge-list > li > form:last-child:not(:first-child) { margin: 0 0 4px; }
.auth-panel { margin-top: 24px; scroll-margin-top: 180px; }
.auth-row { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,2fr) auto; gap: 20px; align-items: center; padding: 15px 0; border-bottom: 1px solid var(--line); }
.auth-row strong { overflow-wrap: anywhere; }
.auth-row .toggle-field { display: flex; flex-direction: row; gap: 8px; align-items: center; font-size: 14px; }
.auth-row input { width: 18px; height: 18px; flex-shrink: 0; }
.login-shell { flex: 1; min-height: 0; padding: 40px 20px; }
.login-body .login-brand { max-width: 100%; }
.login-panel h1 { font-size: 32px; text-align: center; }
.login-panel .eyebrow { text-align: center; }
.login-panel .brand-copy { font-size: 14px; }
.brand-icon--login { width: 75.6px; height: 75.6px; }
@media (max-width: 1180px) {
  .topbar { grid-template-columns: minmax(0,1fr) auto; }
  .topbar .brand { grid-column: 1; grid-row: 1; }
  .topbar > .corporate-logo { grid-column: 2; grid-row: 1; }
  .topbar .main-navigation { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 800px) {
  .topbar { position: relative; padding: 12px; gap: 12px; }
  .corporate-logo--header { width: 64px; height: 56.9px; }
  .corporate-logo--footer { width: 100px; height: 89px; }
  .task-cards { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .knowledge-layout { grid-template-columns: 1fr; gap: 18px; }
  .knowledge-categories { flex-direction: row; flex-wrap: wrap; border: 0; padding: 0; gap: 4px; }
  .knowledge-categories a { padding: 8px 10px; font-size: 12px; border: 1px solid var(--line); }
  .auth-row { grid-template-columns: minmax(0,1fr); gap: 10px; }
}
@media (max-width: 540px) {
  .page { padding: 24px 16px 40px; }
  .topbar .main-navigation .nav-link { padding: 10px 8px; font-size: 11px; }
  .page .list-header h1, .page .detail-header h1, .page .dashboard-header h1 { font-size: 28px; }
  .task-cards { grid-template-columns: 1fr; }
  .list-actions, .list-search { width: 100%; }
  .page .list-actions { gap: 12px; }
  .list-search { display: flex; }
  .pipeline-search { display: grid; grid-template-columns: minmax(0,1fr) auto; width: 100%; }
  .pipeline-search .period-control { grid-column: 1 / -1; }
  .pipeline-search input { min-width: 0; width: 100%; }
  .knowledge-add, .knowledge-option-form { grid-template-columns: minmax(0,1fr) 66px; gap: 8px; }
  .knowledge-add button, .knowledge-option-form button { grid-column: 1 / -1; justify-self: start; }
  .ninja-board { grid-template-columns: none; grid-auto-columns: minmax(230px, 85%); }
  .page .panel-heading { gap: 10px; }
}
