/* Main Directus dashboard only; the offline demo keeps its existing appearance. */
.directus-dashboard [hidden] { display: none !important; }
.directus-dashboard .content { max-width: 1460px; margin-inline: auto; }
.directus-dashboard .dd-skip { position: absolute; top: -80px; left: 16px; z-index: 100; background: white; color: var(--navy); padding: 12px; border: 2px solid var(--navy); }
.directus-dashboard .dd-skip:focus { top: 8px; }
.directus-dashboard .dd-notice { min-height: 42px; }
.directus-dashboard .dd-notice:empty { display: none; }
.directus-dashboard .dd-error { background: var(--danger-50); color: #862d25; border-color: #dba89e; }
.directus-dashboard .dd-success { background: var(--ok-50); color: #1b6142; border-color: #a5cdb8; }
.directus-dashboard .dd-kicker { color: var(--muted); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; margin: 0 0 7px; }
.directus-dashboard .dd-metrics { margin-bottom: 24px; }
.directus-dashboard .dd-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.directus-dashboard .dd-identity { cursor: default; max-width: 260px; }
.directus-dashboard .dd-identity:hover { background: transparent; }
.directus-dashboard .dd-identity .who { display: block; }
.directus-dashboard .dd-identity b { overflow-wrap: anywhere; }
.directus-dashboard .dd-login { max-width: 460px; margin: 38px auto; }
.directus-dashboard .dd-login .card-body { padding: 30px; }
.directus-dashboard .dd-login h1 { margin-bottom: 12px; }
.directus-dashboard fieldset { border: 0; padding: 0; margin: 18px 0; min-width: 0; display: grid; gap: 16px; }
.directus-dashboard label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; min-width: 0; }
.directus-dashboard input:not([type="checkbox"]), .directus-dashboard select { font: inherit; color: var(--text); min-width: 0; min-height: 42px; width: 100%; padding: 9px 11px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: white; }
.directus-dashboard input:disabled, .directus-dashboard select:disabled { background: var(--surface-2); }
.directus-dashboard .dd-check { display: flex; align-items: center; gap: 9px; align-self: end; min-height: 42px; }
.directus-dashboard .dd-check input { width: 18px; height: 18px; accent-color: var(--navy); }
.directus-dashboard .dd-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 16px; }
.directus-dashboard .dd-editor { border: 1px solid #9cbeca; margin-bottom: 24px; }
.directus-dashboard .dd-editor .card-head { background: #f0f7fa; }
.directus-dashboard .dd-editor h2 { margin: 0; }
.directus-dashboard .dd-draft { font-size: 12px; color: #7e4c11; background: #fff3de; padding: 4px 8px; border-radius: 5px; }
.directus-dashboard .dd-conflict { border: 1px solid #d8b67f; background: #fffaf0; color: #61451c; padding: 16px; border-radius: 8px; margin-top: 18px; }
.directus-dashboard .dd-conflict h3 { margin: 0 0 8px; }
.directus-dashboard .dd-conflict .table-wrap { margin: 16px 0; }
.directus-dashboard .dd-pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 18px; font-size: 13px; color: var(--muted); }
.directus-dashboard .dd-text-button { border: 0; background: transparent; color: var(--navy); text-align: left; font: inherit; font-weight: 600; padding: 4px 0; cursor: pointer; }
.directus-dashboard .dd-text-button:hover { text-decoration: underline; }
.directus-dashboard .dd-wp { margin-top: 20px; }
.directus-dashboard .dd-task-name { display: block; min-width: 150px; }
.directus-dashboard .dd-scope { margin: 24px 0 10px; font-size: 12px; line-height: 1.6; }
.directus-dashboard .table-wrap { max-width: 100%; overflow: auto; }
.directus-dashboard table { width: 100%; border-collapse: collapse; text-align: left; }
.directus-dashboard table td, .directus-dashboard table th { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; overflow-wrap: anywhere; }
.directus-dashboard table th { color: var(--muted); font-size: 12px; font-weight: 600; }
.directus-dashboard table tr:last-child td { border-bottom: 0; }
.directus-dashboard table .num { text-align: right; font-variant-numeric: tabular-nums; }
.directus-dashboard table td:first-child { min-width: 220px; }
.directus-dashboard table td:not(:first-child) { min-width: 100px; }
.directus-dashboard .dd-conflict table td { max-width: 340px; white-space: pre-wrap; }
.directus-dashboard .dd-mobile-nav .group { display: none; }
.directus-dashboard .dd-project-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0; }
.directus-dashboard .dd-project-tabs [aria-pressed="true"] { background: var(--navy); color: white; }
.directus-dashboard .dd-mobile-nav a.active { color: var(--navy); font-weight: 650; }
.directus-dashboard :is(button, a, input, select, [tabindex]):focus-visible { outline: 3px solid #b45b13; outline-offset: 3px; }
@media (max-width: 900px) {
  .directus-dashboard .topbar { gap: 10px; min-height: var(--topbar-h); height: auto; padding-block: 8px; }
  .directus-dashboard .dd-identity .who { max-width: 150px; }
  .directus-dashboard .dd-identity .who span { display: none; }
  .directus-dashboard .dd-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .directus-dashboard .dd-mobile-nav { overflow-x: auto; justify-content: flex-start; }
  .directus-dashboard .dd-mobile-nav a { flex: 0 0 80px; min-width: 80px; text-align: center; }
  .directus-dashboard .dd-mobile-nav a span { white-space: normal; overflow-wrap: anywhere; max-width: 100%; }
}
@media (max-width: 600px) {
  .directus-dashboard .content { padding: 16px 12px 90px; }
  .directus-dashboard .topbar .sync-pill { display: none; }
  .directus-dashboard .topbar .title { font-size: 15px; }
  .directus-dashboard .dd-login { margin: 20px 0; }
  .directus-dashboard .dd-login .card-body { padding: 20px; }
  .directus-dashboard .card-head { flex-wrap: wrap; gap: 10px; }
  .directus-dashboard .dd-actions { width: 100%; }
  .directus-dashboard .dd-mobile-nav a { font-size: 11px; }
  .directus-dashboard .dd-mobile-nav .ico { width: 20px; height: 20px; }
  .directus-dashboard .dd-pagination .btn { padding: 7px 9px; }
}
.dd-diagnostics { margin:20px 0; padding:16px; border:1px solid #d5dce3; border-radius:12px; background:#fff; overflow-wrap:anywhere; }
.dd-diagnostics summary { cursor:pointer; font-weight:650; }
.dd-diagnostics li { margin-bottom:12px; }
.dd-diagnostics p { margin:8px 0; }
.dd-table-wrap { max-width:100%; overflow-x:auto; }

/* Assisted planning: scoped to its real controller, including narrow/zoomed layouts. */
.directus-dashboard [data-assisted-root] { min-width: 0; overflow-wrap: anywhere; }
.directus-dashboard [data-assisted-root] .btn { max-width: 100%; white-space: normal; text-align: center; margin: 4px 6px 4px 0; }
.directus-dashboard [data-assisted-root] h3 { margin-top: 24px; }
.directus-dashboard [data-assisted-root] .ap-card { padding: 16px; margin: 12px 0; min-width: 0; }
.directus-dashboard [data-assisted-root] .ap-card li { margin-block: 10px; }
.directus-dashboard [data-assisted-root] .ap-form { margin: 20px 0; min-width: 0; }
.directus-dashboard [data-assisted-root] .ap-form h3 { margin-top: 0; }
.directus-dashboard [data-assisted-root] .ap-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; min-width: 0; padding: 0; border: 0; }
.directus-dashboard [data-assisted-root] .ap-fields > label { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.directus-dashboard [data-assisted-root] .ap-fields > .ap-check { flex-direction: row; align-items: center; }
.directus-dashboard [data-assisted-root] .ap-fields .input { width: 100%; min-width: 0; max-width: 100%; box-sizing: border-box; }
.directus-dashboard [data-assisted-root] select[multiple] { min-height: 112px; }
.directus-dashboard [data-assisted-root] .ap-fields > h3,
.directus-dashboard [data-assisted-root] .ap-fields > p,
.directus-dashboard [data-assisted-root] .ap-actions { grid-column: 1 / -1; margin: 0; }
.directus-dashboard [data-assisted-root] .ap-actions { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 600px) {
  .directus-dashboard [data-assisted-root] .ap-fields { grid-template-columns: minmax(0, 1fr); }
  .directus-dashboard [data-assisted-root] .ap-form .card-body { padding: 16px; }
}

/* Long record names must wrap within content cards; topbar/navigation stay unchanged. */
.directus-dashboard .content .btn {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  white-space: normal;
  overflow-wrap: anywhere;
}
.directus-dashboard [data-reports-root],
.directus-dashboard [data-work-root] { min-width: 0; overflow-wrap: anywhere; }
.directus-dashboard [data-reports-root] label { min-width: 0; }
.directus-dashboard [data-reports-root] :is(input,select,textarea) { min-width: 0; max-width: 100%; box-sizing: border-box; }
.directus-dashboard [data-reports-root] table :is(th,td):first-child { min-width: 72px; width: 72px; }
.directus-dashboard [data-reports-root] table :is(th,td):nth-child(3) { min-width: 200px; }

.home-personal { margin-bottom: 24px; min-width: 0; overflow-wrap: anywhere; }
.home-personal-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 18px; align-items: start; }
.home-personal-section { min-width: 0; }
.home-width-4 { grid-column: span 4; }
.home-width-6 { grid-column: span 6; }
.home-width-8 { grid-column: span 8; }
.home-width-12 { grid-column: span 12; }
.home-accent-navy { --home-accent: #365273; }
.home-accent-teal { --home-accent: #208b82; }
.home-accent-amber { --home-accent: #ad7210; }
.home-personal-section > .card { border-top: 3px solid var(--home-accent); }
.home-density-compact .home-personal-grid { gap: 12px; }
.home-density-compact :is(.home-personal-list > li, .home-personal-pad) { padding: 12px; }
.home-personal :is(h2,h3,p) { margin: 0 0 8px; }
.home-personal .card-head { gap: 12px; flex-wrap: wrap; align-items: center; }
.home-personal .card-head h3 { flex: 1; }
.home-personal-list { list-style: none; padding: 0; margin: 0; }
.home-personal-list > li { display: flex; align-items: center; gap: 12px; padding: 16px; border-top: 1px solid var(--border, #d9e0e3); }
.home-personal-list > li > div { flex: 1; min-width: 0; }
.home-personal-list .btn { flex: 0 0 auto; min-height: 44px; }
.home-personal-note { white-space: pre-wrap; }
.home-personal-pad { padding: 16px; }
.home-personal-metrics { margin: 12px 0; }
.home-personal-metrics > div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; }
.home-personal-metrics dd { margin: 0; text-align: right; font-weight: 600; }
.home-personal-filters { display: flex; flex-wrap: wrap; gap: 12px; }
.home-personal-filters p { flex-basis: 100%; }
.home-personal label { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.home-personal select { max-width: 100%; min-height: 44px; }
.home-personal-progress progress { width: 100%; height: 16px; }
.home-editor { margin-bottom: 24px; overflow-wrap: anywhere; }
.home-editor :is(fieldset,label,details) { min-width: 0; }
.home-editor fieldset { border: 1px solid var(--border, #d9e0e3); padding: 16px; margin: 16px 0; border-radius: 8px; }
.home-editor label { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.home-editor label.home-editor-check { flex-direction: row; align-items: center; }
.home-editor :is(input,select,textarea) { max-width: 100%; min-width: 0; box-sizing: border-box; min-height: 44px; }
.home-editor input[type=checkbox] { min-height: 20px; width: 20px; height: 20px; flex: 0 0 auto; }
.home-editor-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 12px; }
.home-editor-sections { padding-left: 24px; }
.home-editor-sections > li { padding: 16px 0; border-top: 1px solid var(--border, #d9e0e3); }
.home-editor details { margin: 16px 0; }
.home-editor summary { cursor: pointer; padding: 12px 0; }
.home-editor .dd-actions { margin: 12px 0; }
.home-editor-comparison { padding: 16px; border: 1px solid var(--border, #d9e0e3); }
.home-editor [data-home-editor-preview] { margin: 20px 0; padding: 16px; border: 2px dashed var(--border, #d9e0e3); }
@media (max-width: 800px) { .home-personal-grid { grid-template-columns: minmax(0, 1fr); } .home-personal-section { grid-column: 1; } }
@media (max-width: 420px) { .home-personal-list > li { flex-wrap: wrap; } .home-personal-list > li > div { flex-basis: 100%; } }
