/* Quote workspace shares the light cards and accent line of tasks and projects. */
#quote-panel {
  --quote-ink: #16374c;
  --quote-muted: #7d92a5;
  --quote-line: #e8eff4;
  --quote-accent: #5466cf;
  width: min(1540px, calc(100vw - 48px));
  max-width: none;
  border-radius: 24px 0 0 24px;
  background: radial-gradient(circle at 92% 0%, #eef0ff, transparent 34%), #f3f8fb;
  color: var(--quote-ink);
  box-shadow: -18px 0 70px #102e4930;
}
#quote-panel::before, #quote-panel .panel-hero::before, #quote-panel .panel-hero::after { display: none; }
#quote-panel [hidden] { display: none !important; }
#quote-panel :is(button, select) { font-family: inherit; }
#quote-panel :is(button, select, [tabindex]):focus-visible { outline: 2px solid var(--quote-accent); outline-offset: 3px; }
#quote-panel > .panel-header { padding: 24px 24px 0; border: 0; background: transparent; }
#quote-panel .quote-workspace-hero { padding: 22px 28px; border: 1px solid #edf3f7; border-top: 5px solid var(--quote-accent); border-radius: 18px; color: var(--quote-ink); background: linear-gradient(135deg, #fff 70%, #f4f5ff); }
#quote-panel .panel-hero-top { align-items: center; gap: 24px; margin: 0; }
#quote-panel .quote-workspace-identity { min-width: 0; }
#quote-panel .panel-context-pill { color: var(--quote-muted); background: transparent; border: 0; padding: 0; margin-bottom: 5px; font-size: 11px; }
#quote-panel .quote-context-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--quote-accent); }
#quote-panel .panel-name { font-size: 25px; line-height: 1.4; font-weight: 800; color: var(--quote-ink); overflow-wrap: anywhere; }
#quote-panel .panel-sub { color: var(--quote-muted); font-size: 13px; margin-top: 4px; }
#quote-panel #qp-company { color: var(--quote-accent); font-size: 15px; font-weight: 800; line-height: 1.5; overflow-wrap: anywhere; }
#quote-panel .quote-workspace-actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
#quote-panel .quote-primary-action { display: inline-flex; align-items: center; justify-content: center; gap: 14px; min-height: 44px; padding: 10px 20px; border: 0; border-radius: 10px; background: var(--quote-accent); box-shadow: 0 5px 14px #5466cf22; color: #fff; font-size: 13px; font-weight: 700; cursor: pointer; }
#quote-panel .quote-primary-action:hover { background: #4253b6; }
#quote-panel .panel-close-btn { width: 34px; height: 34px; border: 1px solid var(--quote-line); border-radius: 50%; background: #fff; color: #7291a2; flex-shrink: 0; }
#quote-panel .panel-close-btn:hover { background: #eef1fc; color: var(--quote-ink); }
#quote-panel .panel-hero-stats { display: flex; flex-wrap: wrap; gap: 12px 24px; padding-top: 18px; margin-top: 20px; border-top: 1px solid var(--quote-line); }
#quote-panel .panel-hero-stat { display: flex; flex-direction: column-reverse; align-items: flex-start; justify-content: center; gap: 6px; flex: 1 1 130px; min-width: 0; padding: 0 0 0 18px; background: none; border: 0; border-inline-end: 1px solid var(--quote-line); border-radius: 0; }
#quote-panel .panel-hero-stat:last-child { border: 0; }
#quote-panel .panel-hero-stat-label { color: var(--quote-muted); font-size: 10px; font-weight: 500; }
#quote-panel .panel-hero-stat-val { width: 100%; color: var(--quote-ink); text-align: right; }
#quote-panel .quote-panel-number { font-size: 13px; font-variant-numeric: tabular-nums; }
#quote-panel .quote-panel-total { font-size: 23px; line-height: 1.2; }
#quote-panel .panel-mini-select { width: 100%; max-width: 100%; padding: 3px 0; background-color: transparent; color: var(--quote-accent); text-align: right; font-size: 13px; min-height: 28px; }
#quote-panel .quote-workspace-body { display: grid; grid-template-columns: minmax(260px, .95fr) minmax(300px, 1.12fr) minmax(280px, 1fr); align-items: start; align-content: start; gap: 20px; padding: 20px 24px 28px; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
#quote-panel .quote-workspace-card { min-width: 0; padding: 22px; background: #fff; border: 1px solid #edf3f7; border-radius: 16px; box-shadow: 0 3px 14px #23445b03; }
#quote-panel .quote-workspace-card h3 { font-size: 15px; line-height: 1.5; font-weight: 700; color: var(--quote-ink); margin: 0 0 16px; }
#quote-panel .quote-associations { grid-column: 1; grid-row: 1; }
#quote-panel .quote-details-section { grid-column: 1; grid-row: 2; }
#quote-panel .quote-services-section { grid-column: 2; grid-row: 1 / 3; }
#quote-panel #quote-linked-notes-panel { display: block; position: static; inset: auto; grid-column: 3; grid-row: 1 / 3; width: auto; height: auto; min-height: 0; max-height: none; overflow: visible; z-index: auto; animation: none; }
#quote-panel .quote-association-item { display: grid; gap: 6px; padding: 12px 0; border-top: 1px solid var(--quote-line); }
#quote-panel .quote-association-item:first-of-type { border-top: 0; padding-top: 0; }
#quote-panel .quote-project-links { display: grid; gap: 8px; font-size: 12px; color: var(--quote-muted); }
#quote-panel .quote-panel-link { display: block; font-size: 13px; line-height: 1.7; color: #4058bf; text-align: right; overflow-wrap: anywhere; }
#quote-panel .quote-panel-link:not(:disabled)::after { content: ' ↗'; font-size: 12px; }
#quote-panel .quote-panel-link:disabled { color: var(--quote-muted); cursor: default; font-weight: 500; text-decoration: none; }
#quote-panel .quote-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 14px; }
#quote-panel .quote-detail-item { min-width: 0; }
#quote-panel .quote-detail-item.wide { grid-column: 1 / -1; }
#quote-panel .quote-detail-label { font-size: 10px; font-weight: 500; color: var(--quote-muted); margin-bottom: 3px; }
#quote-panel .quote-detail-value { font-size: 12px; line-height: 1.75; color: var(--quote-ink); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
#quote-panel .quote-ltr-value { direction: ltr; text-align: right; unicode-bidi: isolate; }
#quote-panel .quote-panel-note { font-weight: 400; white-space: pre-wrap; }
#quote-panel .quote-billing-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid var(--quote-line); }
#quote-panel .quote-billing-summary > div { display: grid; gap: 7px; padding: 14px; background: #f5f7ff; border-radius: 10px; }
#quote-panel .quote-billing-summary span { color: #687f94; font-size: 11px; }
#quote-panel .quote-billing-summary strong { color: #4054ad; font-size: 22px; font-variant-numeric: tabular-nums; }
#quote-panel .quote-panel-service-card { padding: 16px; border-color: var(--quote-line); border-radius: 12px; }
#quote-panel .quote-panel-service-head { gap: 12px; }
#quote-panel .quote-panel-service-head > div { min-width: 0; }
#quote-panel .quote-panel-service-name { color: var(--quote-ink); font-size: 13px; overflow-wrap: anywhere; }
#quote-panel .quote-panel-service-desc { color: #667f92; font-size: 12px; line-height: 1.8; overflow-wrap: anywhere; }
#quote-panel .quote-panel-service-meta { gap: 6px; }
#quote-panel .quote-notes-sub { color: var(--quote-muted); font-size: 11px; line-height: 1.6; margin: -8px 0 12px; overflow-wrap: anywhere; }
#quote-panel .task-note-list { border: 0; border-radius: 0; }
#quote-panel .task-note-item { padding: 16px 0; border-color: var(--quote-line); }
#quote-panel .task-note-title { color: var(--quote-ink); font-size: 12px; }
#quote-panel .task-note-time { color: #91a6b6; font-size: 10px; font-weight: 500; }
#quote-panel .task-note-text { color: #667f92; font-size: 12px; line-height: 1.85; overflow-wrap: anywhere; }
#quote-panel > .panel-actions { flex-shrink: 0; padding: 12px 24px; background: #fff; border-top: 1px solid var(--quote-line); }
#quote-panel .task-panel-toolbar { justify-content: space-between; }
#page-quotes #quotes-workspace-documents table { min-width: 1280px; }
#page-quotes #quotes-table-body .quote-state-cell { white-space: nowrap; }
body.quote-related-drawer-open #panel-backdrop { z-index: 350; }
body.quote-related-drawer-open #task-panel.open { z-index: 380; }
body.quote-related-drawer-open #panel-backdrop.task-panel-active { z-index: 370; }
[data-quote-related-layer].open { z-index: 360 !important; }
#quote-panel.quote-drawer-underlay { filter: brightness(.96); }
@media (max-width: 1150px) {
  #quote-panel .quote-workspace-body { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
  #quote-panel #quote-linked-notes-panel { grid-column: 2; grid-row: 3; }
  #quote-panel .quote-services-section { grid-row: 1 / 3; }
}
@media (max-width: 760px) {
  #quote-panel > .panel-header { padding: 0; }
  #quote-panel .quote-workspace-hero { border-radius: 0; padding: 14px 16px; }
  #quote-panel .panel-hero-top { align-items: flex-start; gap: 12px; }
  #quote-panel .panel-name { font-size: 20px; }
  #quote-panel .quote-workspace-actions { gap: 6px; flex-direction: column-reverse; }
  #quote-panel .quote-primary-action { padding: 8px; font-size: 11px; }
  #quote-panel .panel-hero-stats { gap: 10px; padding-top: 12px; margin-top: 14px; }
  #quote-panel .panel-hero-stat { flex-basis: calc(50% - 10px); padding: 0; border: 0; }
  #quote-panel .quote-workspace-body { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 12px; }
  #quote-panel .quote-workspace-card, #quote-panel #quote-linked-notes-panel { grid-column: 1; grid-row: auto; padding: 18px; }
  #quote-panel .quote-details-section { order: 2; }
  #quote-panel #quote-linked-notes-panel { order: 3; }
  #quote-panel .quote-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #quote-panel > .panel-actions { padding: 10px 16px max(10px, env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
  #quote-panel, #quote-panel * { animation: none !important; transition: none !important; }
}

/* The pricebook keeps item details, supplier economics and clauses in one workspace. */
#pricebook-panel { --pricebook-ink: #16374c; --pricebook-muted: #718a9a; --pricebook-line: #e8eff4; --pricebook-accent: #009fba; width: min(1440px, calc(100vw - 48px)); max-width: none; border-radius: 24px 0 0 24px; background: radial-gradient(circle at 92% 0%, #eaf9fc, transparent 34%), #f3f8fb; color: var(--pricebook-ink); box-shadow: -18px 0 70px #102e4930; }
#pricebook-panel::before, #pricebook-panel .panel-hero::before, #pricebook-panel .panel-hero::after { display: none; }
#pricebook-panel :is(button, select) { font-family: inherit; }
#pricebook-panel :is(button, [tabindex]):focus-visible { outline: 2px solid var(--pricebook-accent); outline-offset: 3px; }
#pricebook-panel > .panel-header { padding: 24px 24px 0; border: 0; background: transparent; }
#pricebook-panel .pricebook-workspace-hero { padding: 22px 28px; border: 1px solid #edf3f7; border-top: 5px solid var(--pricebook-accent); border-radius: 18px; color: var(--pricebook-ink); background: linear-gradient(135deg, #fff 70%, #f0fbfd); }
#pricebook-panel .panel-hero-top { align-items: center; gap: 24px; margin: 0; }
#pricebook-panel .pricebook-workspace-identity { min-width: 0; }
#pricebook-panel .panel-context-pill { color: var(--pricebook-muted); background: transparent; border: 0; padding: 0; margin-bottom: 5px; font-size: 11px; }
#pricebook-panel .pricebook-context-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--pricebook-accent); }
#pricebook-panel .panel-name { margin: 0; color: var(--pricebook-ink); font-size: 25px; line-height: 1.4; font-weight: 800; overflow-wrap: anywhere; }
#pricebook-panel .panel-sub { color: var(--pricebook-muted); font-size: 13px; margin-top: 4px; }
#pricebook-panel .pricebook-workspace-actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
#pricebook-panel .pricebook-primary-action { display: inline-flex; align-items: center; justify-content: center; gap: 14px; min-height: 44px; padding: 10px 20px; border: 0; border-radius: 10px; background: var(--pricebook-accent); box-shadow: 0 5px 14px #009fba22; color: #fff; font-size: 13px; font-weight: 700; cursor: pointer; }
#pricebook-panel .pricebook-primary-action:hover { background: #008299; }
#pricebook-panel .panel-close-btn { width: 34px; height: 34px; border: 1px solid var(--pricebook-line); border-radius: 50%; background: #fff; color: #7291a2; flex-shrink: 0; }
#pricebook-panel .panel-close-btn:hover { color: var(--pricebook-ink); background: #f0f9fc; }
#pricebook-panel .panel-hero-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; padding-top: 18px; margin-top: 20px; border-top: 1px solid var(--pricebook-line); }
#pricebook-panel .panel-hero-stat { display: flex; flex-direction: column-reverse; align-items: flex-start; justify-content: center; gap: 6px; min-width: 0; padding: 0 0 0 18px; border: 0; border-inline-end: 1px solid var(--pricebook-line); background: none; border-radius: 0; }
#pricebook-panel .panel-hero-stat:last-child { border: 0; }
#pricebook-panel .panel-hero-stat-label { font-size: 11px; color: var(--pricebook-muted); font-weight: 500; }
#pricebook-panel .panel-hero-stat-val { color: var(--pricebook-ink); font-size: 23px; line-height: 1.3; text-align: right; font-variant-numeric: tabular-nums; }
#pricebook-panel #pbp-kind { font-size: 16px; }
#pricebook-panel #pbp-usage { color: #0089a1; }
#pricebook-panel .pricebook-workspace-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.1fr); align-items: start; align-content: start; gap: 20px; padding: 20px 24px 28px; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
#pricebook-panel .pricebook-workspace-card { min-width: 0; padding: 22px; background: #fff; border: 1px solid #edf3f7; border-radius: 16px; box-shadow: 0 3px 14px #23445b03; }
#pricebook-panel .pricebook-workspace-card h3 { font-size: 15px; line-height: 1.5; font-weight: 700; color: var(--pricebook-ink); margin: 0 0 18px; }
#pricebook-panel #pricebook-supplier-panel { display: block; position: static; inset: auto; width: auto; height: auto; min-height: 0; max-height: none; overflow: visible; z-index: auto; animation: none; }
#pricebook-panel .detail-grid { gap: 20px 16px; }
#pricebook-panel .detail-cell { padding: 0; border: 0; background: transparent; min-width: 0; }
#pricebook-panel .detail-cell-label { color: var(--pricebook-muted); font-size: 11px; font-weight: 500; margin-bottom: 5px; }
#pricebook-panel .detail-cell-val { color: var(--pricebook-ink); font-size: 13px; line-height: 1.75; overflow-wrap: anywhere; }
#pricebook-panel .pricebook-ltr-value { direction: ltr; text-align: right; unicode-bidi: isolate; font-variant-numeric: tabular-nums; }
#pricebook-panel .pricebook-panel-note { font-weight: 400; white-space: pre-wrap; line-height: 1.85; overflow-wrap: anywhere; }
#pricebook-panel .pricebook-usage-note { padding: 14px; margin-top: 22px; border: 1px solid #d9eff4; border-radius: 10px; background: #f2fbfd; color: #397084; font-size: 11px; line-height: 1.8; }
#pricebook-panel .pricebook-section-sub { font-size: 11px; line-height: 1.7; color: var(--pricebook-muted); margin: -10px 0 18px; }
#pricebook-panel .pricebook-supplier-stack { gap: 16px; }
#pricebook-panel .pricebook-supplier-card { padding: 15px; border-color: var(--pricebook-line); border-radius: 11px; background: #fbfdfe; }
#pricebook-panel .pricebook-supplier-value { font-size: 16px; color: var(--pricebook-ink); }
#pricebook-panel .pricebook-supplier-kpis { gap: 12px; }
#pricebook-panel .pricebook-supplier-kpi { min-width: 0; padding: 14px; border-color: var(--pricebook-line); border-radius: 10px; background: #fff; }
#pricebook-panel .pricebook-supplier-kpi-value { font-size: 19px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
#pricebook-panel :is(.pricebook-supplier-label, .pricebook-supplier-kpi-label) { font-size: 11px; color: var(--pricebook-muted); }
#pricebook-panel :is(.pricebook-supplier-meta, .pricebook-supplier-kpi-meta) { color: #6c8497; font-size: 11px; line-height: 1.8; }
#pricebook-panel .pricebook-supplier-profit { font-size: 23px; }
#pricebook-panel .pricebook-panel-clauses { gap: 0; }
#pricebook-panel .pricebook-panel-clause { padding: 17px 0; border: 0; border-top: 1px solid var(--pricebook-line); border-radius: 0; }
#pricebook-panel .pricebook-panel-clause:first-child { border: 0; padding-top: 0; }
#pricebook-panel .pricebook-panel-clause h4 { margin: 0 0 7px; color: var(--pricebook-ink); font-size: 13px; line-height: 1.7; }
#pricebook-panel .pricebook-panel-clause .pricebook-panel-note { color: #667f92; font-size: 12px; }
#pricebook-panel .pricebook-clauses-empty { padding: 24px 16px; border: 1px dashed #dce8ef; border-radius: 11px; color: var(--pricebook-muted); font-size: 12px; line-height: 1.8; text-align: center; background: #fbfdfe; }
#pricebook-panel > .panel-actions { flex-shrink: 0; padding: 12px 24px; background: #fff; border-top: 1px solid var(--pricebook-line); }
#pricebook-panel .task-panel-toolbar { justify-content: space-between; }
@media (max-width: 1100px) {
  #pricebook-panel .pricebook-workspace-body { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  #pricebook-panel .pricebook-clauses-section { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  #pricebook-panel > .panel-header { padding: 0; }
  #pricebook-panel .pricebook-workspace-hero { padding: 14px 16px; border-radius: 0; }
  #pricebook-panel .panel-hero-top { align-items: flex-start; gap: 12px; }
  #pricebook-panel .panel-name { font-size: 20px; }
  #pricebook-panel .pricebook-workspace-actions { gap: 6px; flex-direction: column-reverse; }
  #pricebook-panel .pricebook-primary-action { padding: 8px 10px; font-size: 11px; gap: 6px; }
  #pricebook-panel .panel-hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 14px; padding-top: 14px; }
  #pricebook-panel .panel-hero-stat { border: 0; padding: 0; }
  #pricebook-panel .panel-hero-stat-val { font-size: 21px; }
  #pricebook-panel .pricebook-workspace-body { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 12px; }
  #pricebook-panel .pricebook-workspace-card { padding: 18px; grid-column: 1; }
  #pricebook-panel > .panel-actions { padding: 10px 16px max(10px, env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
  #pricebook-panel, #pricebook-panel * { animation: none !important; transition: none !important; }
}

/* Task and project workspaces follow the lead drawer's shared visual language. */
:is(#task-panel, #project-panel) {
  --record-ink: #16374c;
  --record-muted: #7d92a5;
  --record-line: #e8eff4;
  --record-cyan: var(--record-accent);
  --record-accent: #0aa68c;
  --record-accent-deep: #07866f;
  --record-tint: #edf9f5;
  --record-accent-border: #bce8dd;
  --record-accent-shadow: #0aa68c30;
  --record-accent-shadow-strong: #0aa68c45;
  width: min(1640px, calc(100vw - 48px));
  max-width: none;
  background: radial-gradient(circle at 92% 0%, var(--record-tint), transparent 34%), #f3f8fb;
  color: var(--record-ink);
  border-radius: 24px 0 0 24px;
  box-shadow: -18px 0 70px #102e4930;
  text-align: right;
}
#project-panel {
  --record-accent: #5968d8;
  --record-accent-deep: #4352bb;
  --record-tint: #f1f2ff;
  --record-accent-border: #cdd2f8;
  --record-accent-shadow: #5968d830;
  --record-accent-shadow-strong: #5968d845;
}
:is(#task-panel, #project-panel)::before,
:is(#task-panel, #project-panel) .task-notes-panel::before { display: none; }
:is(#task-panel, #project-panel) *,
:is(#task-panel, #project-panel) *::before,
:is(#task-panel, #project-panel) *::after { box-sizing: border-box; }
:is(#task-panel, #project-panel) [hidden] { display: none !important; }
:is(#task-panel, #project-panel) :is(button, select, input, textarea) { font-family: inherit; }
:is(#task-panel, #project-panel) :is(button, select, input, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--record-cyan);
  outline-offset: 3px;
}
:is(#task-panel, #project-panel) > .panel-header { padding: 24px 24px 0; background: transparent; border: 0; flex-shrink: 0; }
:is(#task-panel, #project-panel) .record-hero {
  padding: 24px 28px 18px;
  background: linear-gradient(135deg, #fff 0%, #fff 70%, var(--record-tint) 150%);
  border: 1px solid #edf3f7;
  border-top: 5px solid var(--record-accent);
  border-radius: 18px;
  color: var(--record-ink);
  box-shadow: 0 4px 18px #23445b04;
  overflow: visible;
}
:is(#task-panel, #project-panel) .record-hero::before,
:is(#task-panel, #project-panel) .record-hero::after { display: none; }
:is(#task-panel, #project-panel) .panel-hero-top { align-items: center; gap: 24px; margin-bottom: 0; }
:is(#task-panel, #project-panel) .record-identity { min-width: 0; }
:is(#task-panel, #project-panel) .panel-context-pill { padding: 0; border: 0; background: none; color: #8299a8; font-size: 11px; gap: 6px; margin-bottom: 3px; }
:is(#task-panel, #project-panel) .record-context-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--record-accent); }
:is(#task-panel, #project-panel) .panel-name { font-size: 25px; line-height: 1.35; color: var(--record-ink); font-weight: 800; overflow-wrap: anywhere; }
:is(#task-panel, #project-panel) .panel-sub { color: var(--record-muted); font-size: 13px; overflow-wrap: anywhere; }
#project-panel #pp-client { color: var(--record-accent); font-size: 15px; font-weight: 800; line-height: 1.5; }
:is(#task-panel, #project-panel) .panel-assignment-trail { display:flex; flex-wrap:wrap; align-items:center; gap:4px; direction:rtl; color:var(--record-muted); font-size:11px; font-weight:600; }
:is(#task-panel, #project-panel) .panel-assignment-date { color:#6d879a; }
:is(#task-panel, #project-panel) .panel-assignment-separator { color:#b4c3ce; }
:is(#task-panel, #project-panel) .panel-assignment-origin { color:var(--record-ink); }
:is(#task-panel, #project-panel) .panel-assignment-arrow { margin:0 2px; color:#00a7ba; font-weight:900; direction:ltr; }
#task-panel .task-customer-attribution { margin-top: 5px; font-size: 12px; line-height: 1.5; }
#task-panel #tp-linked-customer-name { color: var(--record-accent-deep); border:0; padding:0; background:transparent; font:inherit; font-size: 15px; font-weight: 800; line-height: 1.5; cursor:pointer; text-decoration:underline; text-decoration-thickness:1px; text-underline-offset:3px; }
#task-panel #tp-linked-customer-name:hover:not(:disabled) { color:var(--record-accent); }
#task-panel #tp-linked-customer-name:disabled { cursor:default; text-decoration:none; }
:is(#task-panel, #project-panel) .record-hero-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
:is(#task-panel, #project-panel) :is(.record-primary-action, .record-secondary-action) {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 44px; border-radius: 10px; padding: 10px 20px; font-size: 13px; font-weight: 700;
  cursor: pointer; transition: background .16s, box-shadow .16s;
}
:is(#task-panel, #project-panel) .record-primary-action { color: #fff; background: linear-gradient(110deg, var(--record-accent-deep), var(--record-accent)); border: 1px solid transparent; box-shadow: 0 5px 14px var(--record-accent-shadow); }
:is(#task-panel, #project-panel) .record-primary-action:hover { background: var(--record-accent-deep); box-shadow: 0 6px 20px var(--record-accent-shadow-strong); }
:is(#task-panel, #project-panel) .record-secondary-action { color: var(--record-accent-deep); background: var(--record-tint); border: 1px solid var(--record-accent-border); }
:is(#task-panel, #project-panel) .record-secondary-action:hover { background: #fff; }
#project-panel .project-actions-wrap .record-secondary-action { width: 100%; }
#project-panel .project-actions-wrap .lead-quote-menu { right: auto; left: 0; min-width: 200px; max-width: calc(100vw - 48px); }
#project-panel #project-actions-menu:popover-open { position: fixed; inset: auto; margin: 0; overflow-y: auto; overscroll-behavior: contain; color: var(--record-ink); }
#project-panel .project-actions-wrap [role="menuitem"] { min-height: 40px; font-family: inherit; }
#project-panel .project-actions-wrap [role="menuitem"]:focus-visible { outline: 2px solid var(--record-accent); outline-offset: -2px; background: var(--record-tint); }
#project-panel .project-actions-wrap [role="menuitem"]:disabled { opacity: .45; cursor: not-allowed; }
:is(#task-panel, #project-panel) :is(.record-primary-action, .record-secondary-action) svg { width: 19px; height: 19px; flex-shrink: 0; }
:is(#task-panel, #project-panel) .panel-close-btn { width: 34px; height: 34px; border: 1px solid var(--record-line); border-radius: 50%; background: #fff; color: #7291a2; flex-shrink: 0; }
:is(#task-panel, #project-panel) .panel-close-btn:hover { background: #edf7fa; color: var(--record-ink); }
:is(#task-panel, #project-panel) .panel-hero-stats { display: flex; flex-wrap: wrap; align-items: stretch; gap: 12px; border-top: 1px solid var(--record-line); padding-top: 16px; margin-top: 20px !important; }
:is(#task-panel, #project-panel) .panel-hero-stat { display: flex; flex-direction: column-reverse; align-items: flex-start; justify-content: center; gap: 4px; background: transparent; border: 0; border-inline-end: 1px solid var(--record-line); border-radius: 0; padding: 0 0 0 24px; min-width: 130px; }
:is(#task-panel, #project-panel) .panel-hero-stat:last-child { border-inline-end: 0; }
:is(#task-panel, #project-panel) .panel-hero-stat-val { width: 100%; color: var(--record-ink); text-align: right; }
:is(#task-panel, #project-panel) .panel-hidden-date-input { inset: 0; width: 100%; height: 100%; box-sizing: border-box; }
:is(#task-panel, #project-panel) .panel-hero-stat-label { font-size: 10px; font-weight: 500; color: var(--record-muted); }
:is(#task-panel, #project-panel) .panel-hero-stat-meta { color: var(--record-muted); }
:is(#task-panel, #project-panel) .panel-mini-select { color: var(--record-ink); text-align: right; font-size: 13px; padding: 3px 0; min-height: 28px; background: transparent; max-width: 100%; }
#task-panel #tp-status-val, #project-panel #pp-status-val { color: #008c96; font-weight: 800; }
#task-panel .task-due-trigger { border: 0; border-radius: 5px; padding: 3px 0; min-height: 28px; background: transparent; font: inherit; font-size: 13px; font-weight: 700; line-height: 1.4; font-variant-numeric: tabular-nums; cursor: pointer; }
#task-panel .task-due-trigger:hover:not(:disabled) { color: var(--record-accent-deep); }
#task-panel .task-due-trigger:disabled { cursor: default; }
#task-panel .task-due-popover { display: none; box-sizing: border-box; width: 260px; max-width: calc(100vw - 24px); padding: 16px; border: 1px solid var(--record-line); border-radius: 12px; color: var(--record-ink); background: #fff; box-shadow: 0 12px 36px #16374c26; direction: rtl; text-align: right; }
#task-panel .task-due-popover:popover-open { display: block; position: fixed; inset: auto; margin: 0; max-height: calc(100dvh - 24px); overflow-y: auto; }
#task-panel .task-due-popover.fallback-open { display: block; position: absolute; top: 100%; inset-inline-end: 0; margin-top: 8px; z-index: 10; }
#task-panel .task-due-editor-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; font-size: 13px; }
#task-panel .task-due-editor-close { border: 0; border-radius: 6px; width: 28px; height: 28px; padding: 0; background: var(--record-tint); color: var(--record-accent-deep); font: inherit; font-size: 20px; cursor: pointer; }
#task-panel .task-due-editor-fields { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 10px; width: 100%; }
#task-panel .task-due-editor-fields label { display: grid; gap: 6px; min-width: 0; color: var(--record-muted); font-size: 11px; }
#task-panel .task-due-editor-fields input { width: 100%; min-width: 0; min-height: 36px; box-sizing: border-box; border: 1px solid #c9dce5; border-radius: 6px; padding: 5px 7px; color: var(--record-ink); background: #fff; font-family: inherit; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; direction: ltr; text-align: right; }
#task-panel .task-due-editor-hint { margin-top: 10px; font-size: 10px; color: var(--record-muted); }
#task-panel .task-due-editor-fields input:focus { outline: 2px solid rgba(0, 184, 166, .25); outline-offset: 1px; border-color: #00a998; }
#task-panel .task-due-editor-fields input:disabled { opacity: .6; cursor: not-allowed; background: #f3f7f9; }
@media (max-width: 1024px) {
  #task-panel .task-due-editor-fields { grid-template-columns: minmax(0, 1fr); }
}
#task-panel .task-timing-stat { flex-direction: column; align-items: stretch; justify-content: center; gap: 5px; min-width: 220px; }
#task-panel .task-timing-row { display: flex; align-items: baseline; gap: 7px; min-height: 20px; white-space: nowrap; }
#task-panel .task-timing-label { flex: 0 0 auto; color: var(--record-muted); font-size: 10px; font-weight: 600; }
#task-panel .task-timing-value { color: var(--record-ink); font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
:is(#task-panel, #project-panel) .panel-hero-stat.due-reached-pulse { border-radius: 7px; }
:is(#task-panel, #project-panel) .record-workspace-body {
  display: grid; grid-template-columns: minmax(280px, .95fr) minmax(280px, 1fr) minmax(280px, 1fr);
  gap: 20px; padding: 20px 24px 28px; overflow-y: auto; overscroll-behavior: contain;
  align-content: start; align-items: start; min-height: 0; scrollbar-width: thin; scrollbar-color: #d4e1e9 transparent;
}
:is(#task-panel, #project-panel) :is(.panel-section, .record-journey-card, .task-notes-panel) {
  min-width: 0; margin: 0; background: #fff; border: 1px solid #edf3f7; border-radius: 16px;
  box-shadow: 0 3px 14px #23445b03;
}
:is(#task-panel, #project-panel) :is(.panel-section-title, h2) { font-size: 15px; font-weight: 700; line-height: 1.5; color: var(--record-ink); letter-spacing: normal; text-transform: none; }
:is(#task-panel, #project-panel) h2 { margin: 0; }
:is(#task-panel, #project-panel) .panel-section-title::after { display: none; }
:is(#task-panel, #project-panel) .record-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
:is(#task-panel, #project-panel) .record-heading-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #e2f9f4; color: #00b59c; font-size: 20px; }
:is(#task-panel, #project-panel) .record-stage-chip { color: #009ca8; background: #e5f9f6; padding: 4px 10px; font-size: 11px; border-radius: 20px; }
:is(#task-panel, #project-panel) .record-progress-section { grid-column: 1; grid-row: 1; padding: 14px 22px; align-self: stretch; }
#project-panel .record-progress-section { grid-row: 1 / 3; }
:is(#task-panel, #project-panel) .record-progress-overview { display: flex; align-items: center; gap: 16px; }
:is(#task-panel, #project-panel) .record-progress-ring { --record-progress: 0%; display: grid; place-items: center; width: 96px; height: 96px; flex: 0 0 96px; border-radius: 50%; background: conic-gradient(from 0deg, #00bda7 var(--record-progress), #edf3f7 0); }
:is(#task-panel, #project-panel) .record-progress-ring > div { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 82px; height: 82px; background: #fff; border-radius: 50%; }
:is(#task-panel, #project-panel) .record-progress-ring :is(strong, .project-progress-value), #task-panel #tp-progress-pct { font-size: 26px; font-weight: 800; line-height: 1.5; color: var(--record-ink); }
:is(#task-panel, #project-panel) .record-progress-caption { font-size: 10px; color: var(--record-muted); }
:is(#task-panel, #project-panel) .record-progress-detail { flex: 1; min-width: 0; }
:is(#task-panel, #project-panel) .task-progress-wrap { background: transparent; border: 0; border-radius: 0; padding: 0; margin: 0; box-shadow: none; }
:is(#task-panel, #project-panel) .task-progress-label { font-size: 11px; color: var(--record-muted); margin-bottom: 9px; }
:is(#task-panel, #project-panel) .task-progress-bar { background: #edf3f7; height: 5px !important; box-shadow: none; }
:is(#task-panel, #project-panel) .task-progress-bar .progress-fill { background: linear-gradient(90deg, #00bfba, #00a8d5); box-shadow: none; animation: none; }
#task-panel .task-health-inline-toggle { font-size: 11px; color: var(--record-muted); margin-top: 12px; }
#task-panel .lead-health-btn { border: 1px solid #cedee6; color: #8099a7; width: 24px; height: 24px; background: #fff; box-shadow: none; }
#task-panel .lead-health-btn.active { background: #e0f8f0; border-color: #a8e8d7; color: #00a987; }
#task-panel .task-progress-dates { border-top: 1px solid var(--record-line); padding-top: 12px; margin-top: 16px; }
#task-panel .task-progress-date-label { color: #8ca2b3; font-size: 10px; }
#task-panel .task-progress-date-value { color: var(--record-ink); font-size: 12px; }
:is(#task-panel, #project-panel) .record-details-section { grid-column: 1; grid-row: 2 / 4; padding: 22px; }
#task-panel .record-details-section { grid-row: 2; }
#project-panel .record-details-section { grid-row: 3; }
:is(#task-panel, #project-panel) .detail-grid { gap: 0 14px; }
:is(#task-panel, #project-panel) .detail-cell { background: none; border: 0; border-radius: 0; padding: 14px 0; min-width: 0; }
:is(#task-panel, #project-panel) .detail-cell.wide { border-bottom: 1px solid var(--record-line); }
:is(#task-panel, #project-panel) .detail-cell-label { color: #8ca2b3; font-size: 10px; margin-bottom: 8px; }
:is(#task-panel, #project-panel) .detail-cell-val { color: var(--record-ink); font-size: 12px; overflow-wrap: anywhere; }
:is(#task-panel, #project-panel) .editable-desc:hover { background: #f1f9fc; }
:is(#task-panel, #project-panel) .task-owner-select { border-color: #e0ebf2; background: #fbfdfe; border-radius: 7px; padding-inline: 8px; }
:is(#task-panel, #project-panel) .record-hero .task-owner-select { border: 0; background: transparent; padding-inline: 0; font-weight: 700; }
:is(#task-panel, #project-panel) .task-notes-panel {
  position: static; width: auto; max-width: none; height: auto; max-height: none;
  inset: auto; z-index: auto; overflow: visible; animation: none;
}
#task-panel #task-notes-panel.open,
#project-panel :is(#project-notes-panel, #project-tasks-panel).open { z-index: auto; }
#task-panel #task-notes-panel { grid-column: 3; grid-row: 2; align-self: stretch; }
#project-panel #project-tasks-panel { grid-column: 2; grid-row: 2; align-self: stretch; }
#project-panel #project-notes-panel { grid-column: 3; grid-row: 2; align-self: stretch; }
:is(#task-panel, #project-panel) .task-notes-panel-header { padding: 20px 22px 16px; background: none; border-bottom: 1px solid var(--record-line); flex-shrink: 0; min-height: 78px; }
:is(#task-panel, #project-panel) .notes-context-pill { display: none; }
:is(#task-panel, #project-panel) .task-notes-panel-title { color: var(--record-ink); font-size: 15px; font-weight: 700; }
:is(#task-panel, #project-panel) .task-notes-panel-sub { font-size: 10px; color: #8ca2b3; margin-top: 4px; }
:is(#task-panel, #project-panel) .task-notes-panel-add { width: 30px; height: 30px; flex-basis: 30px; border: 1px solid #d9edf5; border-radius: 9px; background: #f0faff; color: #009dc9; box-shadow: none; font-size: 23px; font-weight: 400; }
:is(#task-panel, #project-panel) .task-notes-panel-add:hover { background: #dff6ff; box-shadow: none; transform: none; filter: none; }
:is(#task-panel, #project-panel) .task-notes-panel-body { padding: 0 20px 16px; overflow: visible; flex: initial; }
#task-panel #task-notes-list, #project-panel :is(#project-notes-list, #project-tasks-list) { max-height: 440px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #d4e1e9 transparent; }
:is(#task-panel, #project-panel) .task-note-list { border: 0; border-radius: 0; }
:is(#task-panel, #project-panel) .task-notes-box { background: none; border: 0; padding: 12px 0; margin: 0; }
:is(#task-panel, #project-panel) .task-note-item { padding: 16px 0; border-color: var(--record-line); }
:is(#task-panel, #project-panel) .task-note-title { font-size: 12px; color: var(--record-ink); }
:is(#task-panel, #project-panel) .task-note-text { font-size: 12px; line-height: 1.85; color: #667f92; }
:is(#task-panel, #project-panel) .task-note-time { color: #91a6b6; font-size: 10px; font-weight: 500; }

#project-panel #project-notes-panel .task-note-title {
    color: #17384d;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.5;
}

#project-panel #project-notes-panel .task-note-text {
    color: #3f5f73;
    font-size: 13px;
    line-height: 1.9;
}

#project-panel #project-notes-panel .task-note-time {
    color: #607b8e;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.55;
}
:is(#task-panel, #project-panel) .task-note-actions :is(.icon-action, .task-note-menu-trigger) { width: 25px; height: 25px; border-color: #e8eff4; background: #fff; color: #7291a2; }
:is(#task-panel, #project-panel) .task-note-actions .icon-action { font-size: 11px; }
:is(#task-panel, #project-panel) .task-note-actions :is(.icon-action, .task-note-menu-trigger):hover { background: #f4fafd; }
#task-panel .task-context-note { padding-inline: 12px; border-right-width: 2px; box-shadow: none; }
#project-panel .project-task-section { gap: 0; }
#project-panel .project-task-section-title { padding: 5px 0; font-weight: 500; }
#project-panel .project-task-card { padding: 16px 2px; border: 0; border-bottom: 1px solid var(--record-line); border-radius: 0; background: transparent; }
#project-panel .project-task-card:hover { background: #f6fbfd; box-shadow: none; }
#project-panel .project-task-title { font-size: 12px; font-weight: 600; line-height: 1.5; }
#project-panel .project-task-card .badge { font-size: 9px; }
#project-panel .project-task-meta { gap: 8px; }
:is(#task-panel, #project-panel) .record-journey-card { grid-column: 2 / 4; grid-row: 1; padding: 14px 26px 18px; align-self: stretch; }
#project-panel .record-journey-card { align-self: start; }
:is(#task-panel, #project-panel) .record-journey { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); list-style: none; padding: 14px 0 12px; margin: 0; }
:is(#task-panel, #project-panel) .record-journey li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; min-width: 0; }
:is(#task-panel, #project-panel) .record-journey li:not(:last-child)::after { content: ''; position: absolute; top: 20px; right: calc(50% + 28px); width: calc(100% - 56px); height: 1px; background: #e0eaf1; }
:is(#task-panel, #project-panel) .record-step-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: #f0f6fa; color: #94acbc; margin-bottom: 4px; }
:is(#task-panel, #project-panel) .record-step-icon svg { width: 18px; height: 18px; }
:is(#task-panel, #project-panel) .record-journey strong { font-size: 12px; font-weight: 600; }
:is(#task-panel, #project-panel) .record-journey small { font-size: 10px; color: #8ea3b3; }
:is(#task-panel, #project-panel) .record-journey .is-past .record-step-icon { background: #e2f7fb; color: #00a3cc; }
:is(#task-panel, #project-panel) .record-journey .is-current .record-step-icon { background: linear-gradient(140deg, #00bad2, #00bd99); color: #fff; box-shadow: 0 5px 16px #00bca622; }
:is(#task-panel, #project-panel) .record-journey .is-current small { color: #00a58f; }
:is(#task-panel, #project-panel) .record-journey .is-waiting-client { --waiting-accent: #8c5304; --waiting-tint: #fff2db; --waiting-border: #f4d7a3; --waiting-glow: #d99b3b2b; }
:is(#task-panel, #project-panel) .record-journey .is-waiting-supplier { --waiting-accent: #086f88; --waiting-tint: #e5f7fc; --waiting-border: #b7e4ef; --waiting-glow: #1ca9c329; }
:is(#task-panel, #project-panel) .record-journey .is-current.is-waiting .record-step-icon { background: var(--waiting-accent); box-shadow: 0 0 0 4px var(--waiting-tint), 0 5px 14px var(--waiting-glow); }
:is(#task-panel, #project-panel) .record-journey .is-current .record-waiting-badge { display: inline-flex; align-items: center; justify-content: center; max-width: 100%; min-height: 22px; box-sizing: border-box; padding: 3px 8px; border: 1px solid var(--waiting-border); border-radius: 999px; background: var(--waiting-tint); color: var(--waiting-accent); font-size: 10px; font-weight: 700; line-height: 1.25; text-wrap: balance; }
#project-panel .project-progress-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
#project-panel .project-progress-card { min-width: 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
#project-panel .project-progress-title { font-size: 11px; color: var(--record-muted); font-weight: 500; }
#project-panel .project-progress-value { font-size: 21px; color: var(--record-ink); }
#project-panel .project-progress-head { gap: 8px; flex-wrap: wrap; }
#project-panel .project-progress-meta { font-size: 10px; line-height: 1.5; color: var(--record-muted); }
#project-panel #pp-hours-card { border-top: 1px solid var(--record-line); margin-top: 18px; padding-top: 18px; gap: 10px; }
#project-panel .project-hours-card-title { font-size: 12px; font-weight: 700; color: var(--record-ink); }
#project-panel .project-hours-card-period { color: var(--record-muted); font-size: 10px; }
#project-panel .project-hours-card-icon { width: 30px; height: 30px; border-radius: 50%; background: #e6f9fb; color: #00a3bd; box-shadow: none; }
#project-panel .project-hours-row-label { font-size: 10px; color: var(--record-muted); font-weight: 500; }
#project-panel .project-hours-row-value { font-size: 11px; color: var(--record-ink); font-weight: 700; }
#project-panel .project-hours-track { height: 14px; background: #e4e8ee; box-shadow: none; }
#project-panel .project-hours-combined .project-hours-fill { flex: 0 0 auto; border-radius: 0; }
#project-panel .project-hours-fill.total { background: #10b981; }
#project-panel .project-hours-fill.month { background: #2196e3; }
#project-panel .project-hours-usage { font-size: 12px; font-weight: 700; color: var(--record-ink); margin: 3px 0 5px; }
#project-panel .project-hours-legend { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 5px; }
#project-panel .project-hours-legend-label { display: flex; align-items: baseline; gap: 5px; font-size: 10px; color: var(--record-muted); line-height: 1.5; }
#project-panel .project-hours-legend strong { display: block; font-size: 12px; color: var(--record-ink); margin-top: 4px; }
#project-panel .project-hours-dot { width: 8px; height: 8px; display: inline-block; border-radius: 50%; flex: 0 0 auto; }
#project-panel .project-hours-dot.total { background: #10b981; }
#project-panel .project-hours-dot.month { background: #2196e3; }
#project-panel .project-hours-dot.remaining { background: #c5cdd8; }
#project-panel #pp-hours-meta.is-over { color: #b42318; font-weight: 700; }
#project-panel #pp-hours-retry[hidden] { display: none; }
#project-panel .project-hours-axis { color: #8ca2b3; font-size: 9px; font-weight: 500; }
:is(#task-panel, #project-panel) .record-attachments-section { grid-column: 2 / 4; grid-row: 3; padding: 20px 22px; }
#task-panel .record-attachments-section { grid-column: 2; grid-row: 2; }
#task-panel .attachments-toolbar { flex-wrap: wrap; }
#task-panel .attachments-list { grid-template-columns: minmax(0, 1fr); }
:is(#task-panel, #project-panel) .attachments-toolbar { gap: 14px; }
:is(#task-panel, #project-panel) .attachments-subtext { font-size: 11px; color: var(--record-muted); }
:is(#task-panel, #project-panel) .attachments-toolbar .btn-secondary { background: #f0faff; border-color: #d9edf5; color: #009dc9; font-size: 12px; border-radius: 9px; }
:is(#task-panel, #project-panel) .attachment-card { background: #fbfdfe; border-color: #e1eef4; box-shadow: none; }
:is(#task-panel, #project-panel) .panel-actions { grid-column: 1; grid-row: 4; padding: 0; background: none; border: 0; }
#task-panel .panel-actions { grid-row: 3; }
:is(#task-panel, #project-panel) .panel-actions .task-panel-toolbar { justify-content: flex-start; }
:is(#task-panel, #project-panel) .panel-actions :is(.icon-action, .task-panel-action-menu-trigger) { background: #fff; border-color: #dfe9ef; color: #7291a2; }
:is(#task-panel, #project-panel) .panel-actions .icon-action.danger { color: #a5767d; border-color: #e6dce0; }
#task-panel.task-read-only .record-edit-action,
#project-panel.project-read-only .record-edit-action { display: none; }
@media (min-width: 1200px) {
  :is(#task-panel, #project-panel) .record-hero { display: grid; grid-template-columns: minmax(200px, 1fr) minmax(390px, 1.5fr) auto; align-items: center; gap: 24px; padding: 22px 28px; }
  :is(#task-panel, #project-panel) .panel-hero-top { display: contents; }
  :is(#task-panel, #project-panel) .record-identity { grid-column: 1; grid-row: 1; }
  :is(#task-panel, #project-panel) .record-hero-actions { grid-column: 3; grid-row: 1; display: grid; grid-template-columns: 1fr auto; gap: 8px; }
  :is(#task-panel, #project-panel) .record-primary-action { grid-column: 1 / -1; }
  :is(#task-panel, #project-panel) .record-secondary-action { min-height: 34px; padding: 6px 12px; }
  :is(#task-panel, #project-panel) .panel-close-btn { justify-self: end; }
  :is(#task-panel, #project-panel) .panel-hero-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-column: 2; grid-row: 1; border: 0; border-inline-end: 1px solid var(--record-line); padding: 0 0 0 24px; margin: 0 !important; gap: 16px; align-items: stretch; min-height: 48px; }
  :is(#task-panel, #project-panel) .panel-hero-stat { width: auto; min-width: 0; padding: 0; flex: auto; border: 0; }
  #task-panel .record-hero { grid-template-columns: minmax(200px, 1fr) minmax(560px, 1.8fr) auto; }
  #task-panel .panel-hero-stats { grid-template-columns: minmax(210px, 1.35fr) repeat(4, minmax(0, 1fr)); }
  #task-panel .task-timing-stat { min-width: 0; }
  /* Match the action separator, centered in each field gap without covering controls. */
  :is(#task-panel, #project-panel) .panel-hero-stats > .panel-hero-stat + .panel-hero-stat::before { content: ''; position: absolute; inset-block: 0; inset-inline-start: -8px; width: 1px; background: var(--record-line); pointer-events: none; }
}
@media (min-width: 1500px) {
  :is(#task-panel, #project-panel) .record-workspace-body { grid-template-columns: minmax(340px, .95fr) minmax(0, 1fr) minmax(0, 1fr); }
}
@media (max-width: 1150px) {
  :is(#task-panel, #project-panel) { width: calc(100vw - 24px); }
  :is(#task-panel, #project-panel) .record-workspace-body { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
  #task-panel #task-notes-panel { grid-column: 2; grid-row: 2; }
  #task-panel .record-details-section { grid-column: 1; grid-row: 2 / 4; }
  #task-panel .record-attachments-section { grid-column: 2; grid-row: 3; }
  #task-panel .panel-actions { grid-row: 4; }
  :is(#task-panel, #project-panel) .record-journey-card { grid-column: 2; grid-row: 1; padding: 14px 18px 18px; }
  :is(#task-panel, #project-panel) .record-journey strong { font-size: 10px; }
  #project-panel .record-progress-section { grid-column: 1; grid-row: 1 / 4; }
  #project-panel .record-details-section { grid-column: 1; grid-row: 4; }
  #project-panel #project-tasks-panel { grid-column: 2; grid-row: 2; }
  #project-panel #project-notes-panel { grid-column: 2; grid-row: 3; }
  #project-panel .record-attachments-section { grid-column: 2; grid-row: 4; }
  #project-panel .panel-actions { grid-column: 1; grid-row: 5; }
  :is(#task-panel, #project-panel) :is(.record-primary-action, .record-secondary-action) { padding: 10px 13px; }
  :is(#task-panel, #project-panel) .panel-name { font-size: 22px; }
}
@media (max-width: 760px) {
  :is(#task-panel, #project-panel) { width: 100vw; border-radius: 0; overflow-y: auto; overscroll-behavior: contain; }
  :is(#task-panel, #project-panel) > .panel-header { padding: 12px 12px 0; }
  :is(#task-panel, #project-panel) .record-hero { padding: 16px; border-radius: 12px; }
  :is(#task-panel, #project-panel) .panel-hero-top { flex-wrap: wrap; gap: 12px; }
  :is(#task-panel, #project-panel) .record-identity { padding-inline-end: 44px; width: 100%; }
  :is(#task-panel, #project-panel) .panel-name { font-size: 21px; }
  :is(#task-panel, #project-panel) .record-hero-actions { width: 100%; gap: 8px; }
  :is(#task-panel, #project-panel) :is(.record-primary-action, .record-secondary-action) { flex: 1; min-height: 38px; font-size: 12px; padding: 8px; }
  :is(#task-panel, #project-panel) .panel-close-btn { position: absolute; top: 0; left: 0; }
  :is(#task-panel, #project-panel) .panel-hero-stats { gap: 8px; margin-top: 12px !important; padding-top: 10px; }
  :is(#task-panel, #project-panel) .panel-hero-stat { min-width: 0; width: calc(50% - 4px); flex: 0 0 calc(50% - 4px); padding: 0; border: 0; }
  :is(#task-panel, #project-panel) .panel-hero-stat-label { font-size: 9px; }
  :is(#task-panel, #project-panel) .panel-mini-select { font-size: 12px; }
  :is(#task-panel, #project-panel) .record-workspace-body { grid-template-columns: minmax(0, 1fr); padding: 12px; gap: 12px; overflow: visible; flex: 0 0 auto; }
  :is(#task-panel, #project-panel) .record-workspace-body > :is(.panel-section, .record-journey-card, .task-notes-panel, .panel-actions) { grid-column: 1; grid-row: auto; }
  #task-panel #task-notes-panel, #project-panel :is(#project-tasks-panel, #project-notes-panel) { grid-column: 1; grid-row: auto; }
  :is(#task-panel, #project-panel) .record-journey-card { order: 0; }
  :is(#task-panel, #project-panel) .record-progress-section { order: 1; padding: 14px 18px; }
  :is(#task-panel, #project-panel) .record-details-section { order: 2; padding: 18px; }
  #project-panel #project-tasks-panel { order: 3; }
  #task-panel #task-notes-panel, #project-panel #project-notes-panel { order: 4; }
  :is(#task-panel, #project-panel) .record-attachments-section { order: 5; padding: 18px; }
  :is(#task-panel, #project-panel) .panel-actions { order: 6; }
  :is(#task-panel, #project-panel) .attachments-toolbar { flex-wrap: wrap; }
  #task-panel #task-notes-list, #project-panel :is(#project-notes-list, #project-tasks-list) { max-height: none; overflow: visible; }
}
@media (prefers-reduced-motion: reduce) {
  :is(#task-panel, #project-panel), :is(#task-panel, #project-panel) *,
  :is(#task-panel, #project-panel) *::before, :is(#task-panel, #project-panel) *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
