/* Work cards grow with their contents, independently of neighbouring sections. */
.work-detail {max-width:1380px;margin:0 auto;--work-gap:16px}
.work-detail .ticket-hero {margin-bottom:18px;gap:16px}
.work-detail .ticket-hero h1 {font-size:clamp(24px,2.2vw,32px);line-height:1.25;margin:0 0 8px}
.work-detail .ticket-hero .eyebrow {margin-bottom:8px}
.work-detail .ticket-subtitle {margin:0}
.work-detail .ticket-labels {gap:8px;align-items:center}
.work-detail .ticket-summary {display:flex;flex-wrap:wrap;align-items:flex-start;gap:10px;margin-bottom:18px}
.work-detail .ticket-stat {flex:0 1 auto;width:auto;min-height:0;padding:12px 14px;align-items:center;max-width:100%;border-radius:12px;box-shadow:none}
.work-detail .ticket-stat:nth-child(2) {flex:0 1 auto;max-width:520px}
.work-detail .ticket-stat:last-child {grid-column:auto}
.work-detail .ticket-stat small {margin-bottom:5px;font-size:10px}
.work-detail .ticket-stat .stat-icon {height:30px;width:30px;flex-shrink:0}
.work-detail .ticket-stat strong {font-size:13px}
.work-detail .work-people {display:flex;flex-wrap:wrap;align-items:center;gap:6px}
.work-people>.person-link {display:inline-flex;max-width:100%;padding:4px 8px 4px 4px;border:1px solid var(--border-soft);border-radius:8px;background:var(--surface-raised);font-size:12px}
.work-people .person-avatar {width:24px!important;height:24px!important;flex-shrink:0}
.work-people-more {position:relative;align-self:center}
.work-people-more>summary {display:grid;place-items:center;list-style:none;cursor:pointer;min-width:40px;min-height:36px;padding:5px 8px;border:1px solid var(--border);border-radius:8px;background:var(--surface-raised);font-size:12px;font-weight:650;color:var(--accent)}
.work-people-more>summary::-webkit-details-marker {display:none}
.work-people-list {position:absolute;top:calc(100% + 8px);left:0;width:260px;max-width:calc(100vw - 40px);max-height:240px;overflow:auto;display:grid;gap:10px;padding:14px;border:1px solid var(--border);border-radius:12px;background:var(--surface-raised);box-shadow:var(--shadow);z-index:12}
.work-layout.columns {grid-template-columns:minmax(0,1fr) minmax(320px,360px);gap:var(--work-gap);align-items:start}
.work-main,.work-aside {display:flex;flex-direction:column;gap:var(--work-gap);align-self:start;min-width:0}
.work-detail .ticket-card {margin:0;padding:18px;border-radius:13px;min-height:0;height:auto;flex:0 0 auto}
.work-detail .ticket-card:before {left:18px;right:18px}
.work-detail .section-heading {gap:9px;margin-bottom:14px;align-items:center}
.work-detail .section-heading h2 {font-size:15px;line-height:1.35;margin:0}
.work-detail .section-icon {width:28px;height:28px;border-radius:8px;flex-shrink:0}
.work-detail .section-icon .icon {width:17px;height:17px}
.work-detail .section-count {font-size:11px}
.work-detail .ticket-description {font-size:13px;line-height:1.7;min-height:0}
.work-detail .text {overflow-wrap:anywhere}
.work-detail .waiting-note {margin-top:14px;padding:12px 14px}
.work-detail .waiting-note p {margin:6px 0 0}
.work-detail .work-fields {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px 12px;align-items:start}
.work-detail .work-fields>.work-field {margin:0;min-width:0;font-size:12px}
.work-field-wide {grid-column:1/-1}
.work-detail .work-fields label,.work-detail [data-work-status-form]>p>label {font-size:12px;margin-bottom:6px}
.work-detail .work-fields .helptext {font-size:10px;line-height:1.5;margin:6px 0 0}
.work-detail .work-fields textarea {min-height:82px;font-size:12px}
.work-detail .work-fields input[type=date] {font-size:12px;padding-left:10px;padding-right:32px}
.work-detail .work-fields [data-date-deadline] {width:100%}
.work-detail .processing-card button {width:auto}
.work-detail .processing-card .form-actions {margin-top:16px;justify-content:flex-start}
.work-detail .form-actions {justify-content:flex-start;flex-wrap:wrap;gap:10px}
.work-detail .processing-card .deadline-clear {width:24px;min-height:24px}
.work-detail button,.work-detail .button {min-height:40px;font-size:12px}
.work-detail .action-card button {width:auto}
.work-detail .ui-select-trigger {min-height:40px;font-size:12px}
.work-detail form>p {margin:0 0 14px}
.work-detail form>p:last-of-type {margin-bottom:12px}
.work-detail .project-status-card textarea {min-height:82px}
.work-detail [hidden] {display:none!important}
.work-dates {margin-top:16px;padding-top:12px;border-top:1px solid var(--border-soft)}
.work-dates>summary,.work-link-editor>summary,.work-disclosure>summary {cursor:pointer;color:var(--muted);font-size:12px;min-height:32px;line-height:1.5}
.work-dates>summary:hover,.work-link-editor>summary:hover,.work-disclosure>summary:hover {color:var(--accent)}
.work-detail .ticket-dates {margin-top:10px;padding-top:0;border:0;gap:12px 24px}
.work-detail .ticket-dates strong {margin-top:3px}
.work-detail .work-history .section-heading {margin:0;list-style:none}
.work-disclosure>summary.section-heading:after {content:'⌄';margin-left:auto;font-size:17px;color:var(--muted);transition:transform .15s}
.work-disclosure[open]>summary.section-heading:after {transform:rotate(180deg)}
.work-disclosure>summary::-webkit-details-marker {display:none}
.work-detail .work-history .section-count {margin-left:0}
.work-detail .ticket-timeline {margin-top:18px;max-height:420px;overflow:auto;padding-right:8px}
.work-detail .timeline-event {padding-bottom:16px}
.work-detail .timeline-event strong {font-size:12px}
.work-detail .timeline-event small {font-size:10px}
.work-detail .timeline-event .change {font-size:11px}
.work-link-editor {margin-top:10px}
.work-link-editor[open]>summary {margin-bottom:12px}
.work-detail .work-project-link>p {margin:0;font-size:12px}
.work-detail .work-archive {padding:12px 18px}
.work-archive form {margin-top:12px}
.work-detail .checklist-progress {margin-bottom:12px}
.work-detail .checklist-row {padding:10px 0;gap:10px;align-items:center;grid-template-columns:32px minmax(0,1fr) 32px}
.work-detail .checklist-text {line-height:1.6;font-size:12px}
.work-detail .check-box {width:32px;height:32px;min-height:32px;padding:5px}
.work-detail .checklist-edit>summary {width:32px;height:32px}
.work-detail .checklist-add {margin-top:12px;padding-top:12px}
.work-detail .checklist-add>label {font-size:11px}
.work-detail .checklist-add input {height:40px}
.work-detail .checklist-add button {min-height:40px}
.work-detail .ticket-empty {padding:8px 0 12px;text-align:left}
.work-detail .ticket-empty p {margin:0 0 3px}
.work-detail .ticket-empty small {font-size:10px}
.work-detail .project-checklist {margin:12px 0}
.work-detail .project-step {padding:10px 12px}
.work-detail .project-step-main {gap:10px;align-items:center}
.work-detail .project-step-actions {gap:12px;margin-top:8px;margin-left:42px;align-items:center}
.work-detail .project-step-actions a,.work-detail .project-step-actions summary {min-height:28px;display:inline-flex;align-items:center}
.work-detail .project-checklist .ticket-empty {padding:12px}
.work-detail .project-plan-add {margin-top:12px;width:fit-content;max-width:100%}
.work-detail .project-plan-add>summary {justify-content:flex-start;min-height:40px;padding:9px 12px;font-size:12px}
.work-detail .project-plan-add[open] {width:100%}
.work-detail .project-plan-options {padding:10px}
.work-detail .project-plan-choice>summary,.work-detail .project-plan-new {padding:10px;gap:10px}
.work-detail .project-linked-ticket {padding:12px 0;align-items:center}
.work-detail .project-linked-ticket:first-child {padding-top:0;border:0}
.work-detail .project-linked-ticket:last-child {padding-bottom:0}
.work-detail .project-linked-ticket h3 {font-size:13px;margin:5px 0 8px}
.work-detail .project-linked-ticket form {flex-shrink:0}
.work-detail .project-linked-list>p {margin:0}
.work-detail .attachment-compose {display:grid;grid-template-columns:minmax(0,1fr) max-content;align-items:start;gap:12px;margin-top:12px}
.work-detail .attachment-compose .form-actions {margin:0;align-self:center}
.work-detail .attachment-compose .file-drop {min-height:52px;padding:9px 12px}
.work-detail .attachment-grid:empty {display:none}
.work-detail .attachment-grid {gap:8px}
.work-detail .attachment-compose .selected-files:empty {display:none}
.work-detail .attachment-card {padding:8px 10px}
.work-detail .attachment-info small {font-size:10px}
.work-detail .comment-thread {margin-bottom:12px}
.work-detail .ticket-comment {padding:12px 0;gap:10px}
.work-detail .comment-heading {gap:8px;flex-wrap:wrap}
.work-detail .comment-heading time {font-size:10px;white-space:nowrap}
.work-detail .ticket-comment p {font-size:12px;margin:6px 0 0;line-height:1.65}
.work-detail .comment-compose {padding:12px;margin-top:12px}
.work-detail .comment-compose textarea {min-height:80px;font-size:13px}
.work-detail .comment-compose>p {margin-bottom:10px}
.work-detail .comment-compose label {font-size:12px}
.work-detail .comment-compose .mention-help {margin:8px 0 10px;font-size:10px}
.work-detail .comment-compose .file-picker {max-width:460px;margin-top:10px}
.work-detail .comment-compose .file-drop {min-height:48px;padding:8px 10px}
.work-detail .comment-compose>.form-actions {margin-top:12px}
.work-detail .deadline-request-compose>summary {font-size:12px;min-height:40px}
.work-detail .deadline-request-history {margin-top:12px}
.work-detail .deadline-proposal {padding:12px 0}
.work-detail .deadline-proposal p {font-size:12px;margin:8px 0}
.work-detail .deadline-proposal-heading strong {font-size:12px}
@media(max-width:1100px) {
  .work-layout.columns {display:flex;flex-direction:column;gap:14px}
  .work-main,.work-aside {display:contents}
  .work-layout>.work-main>*,.work-layout>.work-aside>*,.work-layout>.ticket-card {width:100%;min-width:0;order:5}
  .work-layout .work-description {order:1}
  .work-layout .action-card,.work-layout .work-reopen {order:2}
  .work-layout .processing-card,.work-layout .project-status-card {order:3}
  .work-layout .deadline-requests {order:4}
  .work-layout #checklist,.work-layout .work-plan {order:5}
  .work-layout .work-linked {order:6}
  .work-layout #attachments {order:7}
  .work-layout .work-discussion {order:8}
  .work-layout .work-project-link {order:9}
  .work-layout .work-history {order:10}
  .work-layout .work-archive {order:11}
  .work-detail .ticket-stat:nth-child(2) {flex:0 1 auto}
}
@media(max-width:700px) {
  .work-detail {--work-gap:12px}
  .work-detail .ticket-card {padding:15px}
  .work-detail .ticket-summary {gap:8px;margin-bottom:14px}
  .work-detail .ticket-stat {padding:10px 12px}
  .work-detail .ticket-stat:nth-child(2) {flex-basis:100%;order:3}
  .work-detail .ticket-stat:first-child,.work-detail .ticket-stat:last-child {flex:1 1 140px}
  .work-detail .ticket-hero h1 {font-size:24px}
  .work-detail .ticket-labels {width:100%}
  .work-detail .ticket-hero {margin-bottom:14px}
  .work-detail button,.work-detail .button,.work-detail .ui-select-trigger {min-height:44px}
  .work-detail .processing-card .deadline-clear {min-height:24px}
  .work-detail .check-box {width:40px;height:40px;min-height:40px}
  .work-detail .checklist-row {grid-template-columns:40px minmax(0,1fr) 36px;gap:8px}
  .work-detail .checklist-edit>summary {height:40px;width:36px}
  .work-detail .project-step-main {align-items:flex-start}
  .work-detail .project-step-actions {margin-left:0;gap:8px 12px}
  .work-detail .project-step-actions a,.work-detail .project-step-actions summary {min-height:36px}
  .work-detail .attachment-compose {grid-template-columns:minmax(0,1fr)}
  .work-detail .attachment-compose .form-actions {justify-content:flex-end}
  .work-detail .project-linked-ticket {flex-direction:row;gap:10px}
  .work-detail .project-linked-ticket .danger-quiet {font-size:10px}
  .work-detail .work-people-list {position:static;margin-top:8px;max-width:100%;width:100%}
  .work-detail .work-people-more[open] {flex-basis:100%}
  .work-detail .work-fields {gap:12px 10px}
  .work-detail .work-dates>summary,.work-detail .work-link-editor>summary {min-height:40px;display:flex;align-items:center}
  .work-detail .work-disclosure>summary {min-height:40px}
  .work-detail .ticket-dates {gap:10px 18px}
}
@media(max-width:380px) {
  .work-detail .work-fields {grid-template-columns:minmax(0,1fr)}
  .work-detail .work-field-wide {grid-column:auto}
  .work-detail .ticket-stat:first-child,.work-detail .ticket-stat:last-child {flex-basis:100%}
  .work-detail .project-linked-ticket {align-items:flex-start;flex-direction:column}
  .work-detail .project-linked-ticket form {align-self:flex-end}
}

/* The native calendar widget is a block element, within its own field. */
.work-detail .work-field[data-work-field=deadline]{grid-column:1/-1;max-width:260px;width:100%}
.work-detail .processing-card .ui-select-trigger{width:100%}
.work-detail .work-field .errorlist{margin:6px 0 0}
.work-detail .work-field input[type=date]{padding:8px;font-variant-numeric:tabular-nums}
