/* The selected C record layout: one scrolling sheet with labelled open rows. */
.directory-record-form.directory-form-fields { display: block; }
.directory-record-form > .directory-record-section { margin: 0 !important; }
.directory-record-form > .form-errors { margin-bottom: 24px !important; }
.directory-details-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; align-items: start; }
.directory-details-columns > section { min-width: 0; }
.directory-details-columns h3 { margin: 0 0 20px; font-size: 13px; font-weight: 600; line-height: 20px; }
.directory-field-stack > * + * { margin-top: 20px; }
.directory-field-stack > h3:first-child { margin-top: 0; }
.directory-record-values { margin: 0; }
.directory-record-values > div + div { border-top: 1px solid #e5e9e2; margin-top: 16px; padding-top: 16px; }
.directory-record-values dt { margin-bottom: 8px; font-size: 12px; font-weight: 500; color: #53614c; }
.directory-record-values dd { margin: 0; font-size: 13px; line-height: 20px; overflow-wrap: anywhere; }
.directory-record-appearance { display: flex; align-items: center; gap: 12px; margin-top: 20px; }
.directory-record-appearance .field-hint { margin: 0; }
.directory-secondary-edit { display: inline-block; font-size: 12px; font-weight: 400; line-height: 20px; color: #526549; text-decoration: none; }
.directory-secondary-edit:hover { text-decoration: underline; text-underline-offset: 3px; }
.directory-record-form [data-controller$="-brand"] { border: 0; border-radius: 0; padding: 0; }
.directory-record-form [data-controller$="-brand"] > div { display: block; }
.directory-record-form [data-controller$="-brand"] > div > div { border: 0; padding: 0; }
.directory-record-form [data-controller$="-brand"] > div > div + div { margin-top: 20px; }
.directory-record-footer { display: flex; justify-content: flex-end; align-items: center; gap: 12px; }
.directory-record-form .directory-assignment-editor { min-width: 0; border: 0; padding: 0; }
.directory-record-form .directory-assignment-editor [data-member-visibility-target$="List"]:not([hidden]) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; border: 0; }
.directory-record-form .directory-assignment-editor [data-member-visibility-target$="List"] > div { display: contents; }
.directory-record-form .directory-assignment-editor .who-member-row { padding: 8px 0; min-width: 0; }
.directory-record-form .directory-assignment-editor .who-member-row > span { overflow-wrap: anywhere; }
.directory-record-form input[type="number"], .detail-task-editor input[type="number"] { appearance: textfield; }
.directory-record-form input[type="number"]::-webkit-inner-spin-button,
.detail-task-editor input[type="number"]::-webkit-inner-spin-button,
.detail-task-editor input[type="number"]::-webkit-outer-spin-button,
.directory-record-form input[type="number"]::-webkit-outer-spin-button { appearance: none; margin: 0; }
@media (max-width: 640px) {
  .directory-details-columns { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .directory-record-form .directory-assignment-editor [data-member-visibility-target$="List"]:not([hidden]) { grid-template-columns: minmax(0, 1fr); }
}

.directory-record-identity { display:flex; gap:12px; align-items:center; }
.directory-state-hint { margin:12px 0 0; font-size:13px; font-weight:400; line-height:1.5; color:#526549; }
.detail-window-header:has(.directory-state-hint) { flex-wrap:wrap; }
.detail-window-header > .directory-state-hint { flex-basis:100%; }
.directory-person-footer { justify-content:flex-end; gap:12px; }
.directory-access-status { font-size:13px; color:#526549; }
.directory-person-sections .directory-details-columns > div { min-width:0; }
.directory-person-sections [disabled] :is(input,select,textarea) { cursor:text; }
.directory-person-sections .directory-record-section > .directory-section-body { min-width:0; }

.directory-appearance-picker > summary { cursor:pointer; list-style:none; margin-top:0; }
.directory-appearance-picker > summary::-webkit-details-marker { display:none; }
.directory-appearance-picker > summary .field-hint { display:block; }
.directory-appearance-picker[open] > [data-controller] { margin-top:20px; }
.directory-appearance-picker:not([open]) > .field-hint { display:block; margin-top:12px; }

/* Financial fields share the record's column width, including inside People details. */
.directory-record-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 20px;
  margin: 20px 0;
  align-items: start;
}
.directory-record-grid > * { min-width: 0; }
.directory-record-grid .field-input { width: 100%; min-width: 0; max-width: 100%; }
.directory-record-grid > strong,
.directory-record-grid strong { overflow-wrap: anywhere; }
/* The legacy assignment legend was full-width even when visually hidden. */
.resource-dialog .directory-assignment-editor > legend.sr-only {
  float: none;
  width: 1px;
  max-width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
}

/* New Client keeps its project action beside the section heading. */
.directory-related-create > .directory-section-heading { display:contents; }
.directory-related-create > .directory-section-heading > .directory-section-label { grid-column:1; grid-row:1; }
.directory-related-create > .directory-section-heading .detail-text-action { grid-column:2; grid-row:1; justify-self:end; align-self:start; position:relative; z-index:1; margin:0; text-align:right; }
.directory-related-create > .directory-section-body { grid-column:2; grid-row:1; }
@media (max-width:640px) {
  .directory-related-create > .directory-section-heading { grid-column:1; display:flex; align-items:center; justify-content:space-between; gap:16px; }
  .directory-related-create > .directory-section-body { grid-column:1; grid-row:auto; }
}

/* Saved records keep eligible actions together in the fixed footer. */
.directory-client-projects .detail-project-toolbar { justify-content:flex-end; }
.detail-window-footer > form { margin:0; }

/* All record overlays use the same quiet, left-aligned empty section. */
.directory-record-section p.detail-empty {
  padding:0!important;
  margin:0;
  text-align:left;
  font-family:var(--font-sans);
  font-size:14px;
  line-height:20px;
  font-weight:400;
  color:#686f64;
}
/* Follow live task rows as inline creation/removal updates the editor. */
.directory-record-section .detail-task-editor:not(.project-task-draft-editor):not(:has(:is(#open-tasks, #closed-tasks) > turbo-frame)) .task-columns { display:none; }

.directory-record-section .detail-task-editor #open-tasks:not(:has(> turbo-frame)) { min-width:0; }

.directory-client-appearance .field-hint { display:block; }

/* Empty Client View projects share the heading row, like New and Edit. */
.directory-client-projects:has(> .directory-section-body > p.detail-empty) > .directory-section-body { display:contents; }
.directory-client-projects:has(> .directory-section-body > p.detail-empty) > .directory-section-label { grid-column:1; grid-row:1; align-self:center; }
.directory-client-projects:has(> .directory-section-body > p.detail-empty) .detail-project-toolbar { grid-column:2; grid-row:1; justify-self:end; align-self:center; margin:0; position:relative; z-index:1; }
.directory-client-projects:has(> .directory-section-body > p.detail-empty) p.detail-empty { grid-column:2; grid-row:1; align-self:center; justify-self:start; }
@media (max-width:640px) {
  .directory-client-projects:has(> .directory-section-body > p.detail-empty) .detail-project-toolbar { grid-column:1; grid-row:1; }
  .directory-client-projects:has(> .directory-section-body > p.detail-empty) p.detail-empty { grid-column:1; grid-row:2; }
}

/* Client forms end at the same History-to-footer gap as saved View. */
.resource-dialog-content > form > .directory-client-form { margin-bottom:0; }

/* Project assignment presets share the section-heading row. */
.directory-project-assignments > .directory-assignment-heading { display:contents; }
.directory-assignment-heading > .directory-section-label { grid-column:1; grid-row:1; align-self:center; }
.directory-assignment-heading > [role="tablist"] { grid-column:2; grid-row:1; justify-self:end; }
.directory-project-assignments > .directory-assignment-editor { grid-column:2; grid-row:2; min-width:0; }
@media(max-width:650px) {
 .directory-project-assignments > .directory-assignment-heading { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:12px; grid-column:1; }
 .directory-project-assignments > .directory-assignment-editor { grid-column:1; grid-row:auto; }
}

.directory-person-projects { position:relative; }
.directory-person-project-picker-heading { position:absolute; top:0; right:0; }
.directory-person-projects [data-member-projects-target="heading"] { position:absolute; top:0; right:0; width:calc((100% - 32px) / 2); }
.directory-person-projects [data-member-projects-target="heading"][hidden], .directory-person-project-picker-heading [hidden] { display:none; }

.member-project-columns { display:grid; grid-template-columns:minmax(0,1fr); gap:32px; align-items:start; }
.member-project-columns[data-editor-open="true"] { grid-template-columns:repeat(2,minmax(0,1fr)); }
.member-project-columns > div { min-width:0; }
.member-project-available { display:block; width:100%; min-height:56px; padding:8px 0; text-align:left; border-radius:6px; color:#526549; }
.member-project-available:hover { background:#eef2e9; }
.member-project-available:focus-visible { outline:2px solid #526549; outline-offset:2px; }
@media(max-width:650px) { .member-project-columns[data-editor-open="true"] { grid-template-columns:minmax(0,1fr); gap:24px; } }
.directory-person-projects [data-controller="member-projects"] { position:relative; padding-top:44px; }
.directory-person-projects .member-project-columns { margin-top:0; }
.member-project-columns [data-member-projects-target="assigned"] li { min-height:56px; }
.member-project-columns [data-member-projects-target="search"] { height:44px; }
@media(max-width:650px) {
 .directory-person-projects [data-controller="member-projects"] { position:static; }
 .directory-person-projects .directory-person-project-picker-heading { top:26px; }
 .directory-person-projects [data-member-projects-target="heading"] { position:static; width:100%; margin-bottom:16px; }
}

.directory-client-projects .detail-row-actions { width:1%; text-align:right; padding-right:0; }
.detail-project-row-actions { display:flex; align-items:center; justify-content:flex-end; gap:4px; }
.detail-project-row-actions form { display:inline-flex; margin:0; }

/* Project identity shares one title row; its client remains beneath the name. */
.detail-window-name--project .detail-window-mark { display: grid; align-self: flex-start; }
.detail-window-name--project h2 { line-height: 31px; }

/* The assignment section and People costs section already supply the shared divider. */
.project-cost-divider { height:0; border:0; margin:24px 0 0; }
.directory-record-form:has(.project-people-costs) > .directory-form-related { border-top:0; }

/* Reserve all three action positions, including when deletion is unavailable. */
.detail-task-editor .task-row-actions { display:grid; grid-template-columns:repeat(3, 32px); gap:4px; justify-content:end; width:160px; }
.detail-task-editor .task-columns > span:last-child { width:160px; }
.detail-task-editor .task-row-actions .btn-quiet { width:32px; padding:6px; justify-content:center; }
.detail-task-editor .task-row-actions svg { flex-shrink:0; }
@media (max-width:720px) {
  .detail-task-editor .task-columns,
  .detail-task-editor :is(#open-tasks, #closed-tasks),
  .detail-task-editor [data-inline-row-target="row"] { min-width:520px; }
}

.directory-record-form .directory-client-projects td.num { font-family:var(--font-sans); font-variant-numeric:normal; }

.directory-project-editor .directory-record-identity { align-items:flex-start; }
.directory-project-editor .directory-record-identity h2 { line-height:31px; }
.directory-project-editor .directory-record-identity .detail-window-mark { display:grid; }
.directory-project-editor .directory-project-appearance > h3 { margin-bottom:6px; }
.directory-project-editor .directory-project-appearance > .directory-appearance-picker { margin-top:12px; }

/* Subheadings inside the Person Projects section share the record heading style. */
.directory-person-projects .directory-body-heading {
  font-size:13px;
  font-weight:600;
  color:#526549;
  line-height:1.6;
}

.directory-person-projects .directory-body-heading + .detail-table,
.directory-person-projects .directory-body-heading + .detail-empty { margin-top:12px; }

.person-rate-preview .directory-body-heading { margin:0 0 8px; color:#526549; font-size:13px; font-weight:600; }
.person-rate-preview .field-hint { line-height:1.6; }
.person-rate-estimates { margin:12px 0 0; display:grid; gap:8px; font-size:13px; }
.person-rate-estimates > div { display:flex; flex-wrap:wrap; justify-content:space-between; gap:4px 12px; }
.person-rate-estimates dt { color:#686f64; }
.person-rate-estimates dd { margin:0; font-weight:600; }

/* Keep the Project client subtitle's space when View becomes Edit. */
.directory-project-editor .resource-dialog-header { padding:25px 28px 20px; align-items:flex-start; }
.directory-project-editor [data-timecard-creation-target="status"] { visibility:hidden; }
@media(max-width:640px) { .directory-project-editor .resource-dialog-header { padding:20px; } }
