/* Shared Relay refinement: white surfaces, fine dividers, system typography. */
@layer relay-apple {
 [data-task-prototype] {--tp-ui-font:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif!important;--tp-line:#dedede!important;--tp-text:#242424!important;--tp-muted:#737373!important;}
 [data-task-prototype] :is(button,input,select,textarea) {font-family:var(--tp-ui-font)!important;}
 [data-task-prototype] .tp-request-id-value {font-size:24px!important;font-weight:650!important;letter-spacing:-.65px!important;line-height:1.2!important;}
 [data-task-prototype] .tp-next-action h3 {font-size:18px!important;line-height:1.35!important;font-weight:600!important;letter-spacing:-.35px!important;}
 [data-task-prototype] :is(.tp-operational-signals dt,.tp-next-action-label) {font-size:10px!important;line-height:1.4!important;letter-spacing:.045em!important;font-weight:500!important;}
 [data-task-prototype] .tp-operational-signals dd {font-size:18px!important;font-weight:600!important;letter-spacing:-.35px!important;font-variant-numeric:tabular-nums!important;line-height:1.4!important;}
 [data-task-prototype] .tp-operational-signals small {font-size:11px!important;line-height:1.5!important;}
 [data-task-prototype] :is(.tp-case-context dt,.tp-case-context dd) {font-size:12px!important;line-height:1.5!important;}
 [data-task-prototype] .tp-case-context dt {color:#737373!important;font-weight:400!important;}
 [data-task-prototype] .tp-case-context dd {font-weight:500!important;}
 [data-task-prototype] :is(.tp-workspace-tabs > button,.wp-side-tabs > button) {font-size:12px!important;letter-spacing:-.1px!important;font-weight:400!important;}
 [data-task-prototype] :is(.tp-workspace-tabs > button,.wp-side-tabs > button).is-current {font-weight:600!important;}
 [data-task-prototype] .tp-message-row {padding:16px!important;}
 [data-task-prototype] .tp-message-row strong {font-size:13px!important;line-height:1.45!important;font-weight:600!important;letter-spacing:-.1px!important;}
 [data-task-prototype] .tp-message-row small {font-size:12px!important;line-height:1.5!important;}
 [data-task-prototype] .tp-message-copy {padding:20px!important;font-size:13px!important;line-height:1.6!important;}
 [data-task-prototype] [data-message-detail] > header:first-child h4 {font-size:18px!important;line-height:1.35!important;font-weight:600!important;letter-spacing:-.3px!important;}
 [data-task-prototype] :is(.tp-primary,.tp-secondary) {min-height:36px!important;padding:8px 14px!important;font-size:12px!important;line-height:18px!important;font-weight:500!important;border-radius:6px!important;}
 [data-task-prototype] :is(.tp-icon,.material-symbols-outlined) {font-variation-settings:'FILL' 0,'wght' 350,'GRAD' 0,'opsz' 20!important;}
 [data-task-prototype] button svg {stroke-width:1.5!important;}
 [data-task-prototype] button:focus-visible {outline:2px solid #606060!important;outline-offset:2px!important;}
 [data-task-prototype] .tp-loading-placeholder {color:transparent!important;background:transparent!important;}
 @media(max-width:700px) {
  [data-task-prototype] .tp-message-copy {padding:16px!important;}
  [data-task-prototype] .tp-request-id-value {font-size:22px!important;}
 }
}

@layer relay-apple {
 [data-task-prototype] :is(.draft-conversation-summary,.draft-call-summary).communication-summary-disclosure {
  background:#f5f5f5!important;border:1px solid #e2e2e2!important;border-radius:8px!important;
  box-shadow:none!important;margin:8px 20px 16px!important;padding:0!important;overflow:hidden!important;
  width:auto!important;min-width:0!important;box-sizing:border-box!important;
 }
 [data-task-prototype] .communication-summary-disclosure > summary {
  padding:12px 16px!important;background:#f5f5f5!important;min-height:44px!important;box-sizing:border-box!important;
 }
 [data-task-prototype] .communication-summary-disclosure[open] > summary {border-bottom:1px solid #e2e2e2!important;}
 [data-task-prototype] .communication-summary-disclosure > ul {
  margin:0!important;padding:12px 16px 14px 34px!important;font-size:13px!important;line-height:1.6!important;
 }
 [data-task-prototype] .communication-summary-disclosure h5 {font-size:13px!important;font-weight:600!important;letter-spacing:-.1px!important;}
 [data-task-prototype] .tp-next-action .tp-primary {background:#171717!important;color:#fff!important;border:1px solid #171717!important;box-shadow:none!important;}
 [data-task-prototype] .tp-next-action .tp-primary:is(:hover,:focus-visible) {background:#303030!important;}
 [data-task-prototype] .tp-channel-icon {background:transparent!important;color:#343434!important;border-radius:0!important;}
}

@layer relay-apple {
 @media(max-width:700px) {
  [data-task-prototype] :is(.draft-conversation-summary,.draft-call-summary).communication-summary-disclosure {margin-inline:16px!important;}
 }
}

@layer relay-apple {
 [data-task-prototype] .relay-outline-icon {display:block!important;width:20px!important;height:20px!important;flex:none!important;fill:none!important;stroke:currentColor!important;stroke-width:1.5!important;}
 [data-task-prototype] :is(.tp-channel-icon,.tp-icon,.relay-component-icon):has(> .relay-outline-icon) {display:inline-flex!important;align-items:center!important;justify-content:center!important;font-size:0!important;line-height:1!important;}
}

/* Tab arrows live in body rather than inside the prototype. Keep native UI cursor. */
@layer relay-apple {
 body:has([data-task-prototype]) > .wp-tab-scroll,
 body:has([data-task-prototype]) > .wp-tab-scroll * {cursor:pointer!important;}
 body:has(> .wp-tab-scroll:hover) > .cursor-trail {display:none!important;}
}

@layer relay-apple {
 [data-task-prototype] .tp-comment-unread-count {
  display:inline-flex!important;align-items:center!important;justify-content:center!important;flex:0 0 20px!important;
  width:20px!important;height:20px!important;min-width:20px!important;max-width:20px!important;
  padding:0!important;box-sizing:border-box!important;border:1px solid #174f86!important;border-radius:50%!important;
  background:transparent!important;color:#174f86!important;font:500 11px/1 var(--tp-ui-font)!important;
 }
 [data-task-prototype] .tp-comment-unread-count[hidden] {display:none!important;}
 [data-task-prototype] :is(.tp-ticket-comments,.tp-request-comments-panel,.inv-internal-comment-view,.is-comments-context) {background:#fff!important;}
 [data-task-prototype] .tp-ticket-comments .draft-chat-message {background:#f3f3f3!important;border-color:#e5e5e5!important;}
 [data-task-prototype] .tp-ticket-comments .draft-chat-message.is-outgoing {background:#ebebed!important;}
 [data-task-prototype] .tp-comments-skeleton {display:block!important;padding:0!important;gap:0!important;background:#fff!important;}
 [data-task-prototype] .tp-comments-skeleton[hidden] {display:none!important;}
 [data-task-prototype] .tp-comments-skeleton-feed {display:flex!important;flex-direction:column!important;gap:16px!important;padding:16px!important;list-style:none!important;margin:0!important;}
 [data-task-prototype] .tp-comments-skeleton-feed > .draft-chat-entry {display:flex!important;flex-direction:column!important;align-items:flex-start!important;align-self:flex-start!important;gap:4px!important;max-width:85%!important;width:auto!important;margin:0!important;padding:0!important;border:0!important;}
 [data-task-prototype] .tp-comments-skeleton-feed > .draft-chat-entry.is-outgoing {align-self:flex-end!important;align-items:flex-end!important;}
 [data-task-prototype] .tp-comments-skeleton-feed :is(.draft-chat-author,.draft-chat-message p) {
  color:transparent!important;border-radius:3px!important;
  background:linear-gradient(90deg,#e9e9e9 25%,#f5f5f5 50%,#e9e9e9 75%)!important;
  background-size:200% 100%!important;animation:tp-comment-shimmer 1.3s linear infinite;
 }
 [data-task-prototype] .tp-comments-skeleton-feed .draft-chat-message-meta {visibility:hidden!important;}
 @media(prefers-reduced-motion:reduce) {
  [data-task-prototype] .tp-comments-skeleton-feed * {animation:none!important;}
 }
}
@layer relay-apple {
 [data-task-prototype] .tp-ticket-comments .draft-chat-message-meta {height:18px!important;min-height:18px!important;max-height:18px!important;line-height:18px!important;align-items:center!important;}
}

@layer relay-apple {
 [data-task-prototype] :is(.draft-conversation-summary,.draft-call-summary).communication-summary-disclosure {border:0!important;box-shadow:none!important;}
 [data-task-prototype] .communication-summary-disclosure[open] > summary {border-bottom:1px solid #dedede!important;}
}

@layer relay-apple {
 [data-task-prototype] .tp-comments-unread-dot {display:inline-block!important;flex:0 0 6px!important;width:6px!important;height:6px!important;min-width:6px!important;padding:0!important;margin-left:6px!important;border:0!important;border-radius:50%!important;background:#b44b37!important;vertical-align:middle!important;}
 [data-task-prototype] .tp-comments-unread-dot[hidden] {display:none!important;}
}
/* Request identity: small copyable identifier above the actual request title. */
@layer relay-apple {
 [data-task-prototype] .tp-case-context > .tp-identity-block {display:flex!important;flex-direction:column!important;align-items:flex-start!important;justify-content:center!important;gap:8px!important;}
 [data-task-prototype] .tp-case-context > .tp-identity-block .tp-request-id {
  position:relative!important;display:inline-grid!important;grid-template-columns:max-content!important;
  width:max-content!important;min-width:0!important;min-height:0!important;height:auto!important;
  margin:-1px!important;padding:1px!important;gap:0!important;border:0!important;border-radius:2px!important;transform:none!important;
 }
 [data-task-prototype] .tp-case-context > .tp-identity-block .tp-request-id-value {font-size:12px!important;line-height:1.2!important;font-weight:500!important;letter-spacing:0!important;color:#737373!important;margin:0!important;padding:0!important;}
 [data-task-prototype] .tp-case-context > .tp-identity-block .tp-request-id-feedback {position:absolute!important;inset:1px!important;width:auto!important;justify-content:flex-start!important;gap:3px!important;font-size:11px!important;letter-spacing:0!important;}
 [data-task-prototype] .tp-case-context > .tp-identity-block .tp-request-id:is(:hover,:focus-visible,.is-copied) {background:#ededed!important;color:#292929!important;box-shadow:none!important;transform:none!important;}
 [data-task-prototype] .tp-case-context > .tp-identity-block .tp-identity-context-trigger {display:flex!important;flex-direction:column!important;align-items:flex-start!important;gap:8px!important;min-width:0!important;}
 [data-task-prototype] .tp-case-context > .tp-identity-block .tp-identity-context-trigger > span:first-child {font-size:24px!important;font-weight:600!important;line-height:1.2!important;letter-spacing:-.6px!important;overflow-wrap:anywhere!important;}
 @media(max-width:700px) {
  [data-task-prototype] .tp-case-context > .tp-identity-block .tp-identity-context-trigger > span:first-child {font-size:22px!important;}
 }
}

@layer relay-apple {
 [data-task-prototype] .tp-request-id-feedback .tp-icon,
 [data-task-prototype] .tp-request-id-feedback svg {width:12px!important;height:12px!important;flex:0 0 12px!important;}
}

@layer relay-apple {
 [data-task-prototype] .tp-request-summary-screen {background:#fff!important;overflow:auto!important;min-width:0!important;}
 [data-task-prototype] .tp-request-summary-screen[hidden] {display:none!important;}
 [data-task-prototype] .tp-request-summary-content {padding:24px!important;max-width:760px!important;box-sizing:border-box!important;}
 [data-task-prototype] .tp-summary-copy {font:500 12px/1.4 var(--tp-ui-font)!important;background:transparent!important;color:#737373!important;border:0!important;padding:1px!important;}
 [data-task-prototype] .tp-request-summary-content h2 {font:600 24px/1.25 var(--tp-ui-font)!important;margin:8px 0 24px!important;overflow-wrap:anywhere!important;}
 [data-task-prototype] .tp-request-summary-content dl > div {display:grid!important;grid-template-columns:minmax(0,150px) minmax(0,1fr)!important;gap:16px!important;padding:12px 0!important;border-bottom:1px solid #e5e5e5!important;}
 [data-task-prototype] .tp-request-summary-content dt {color:#737373!important;}
 [data-task-prototype] .tp-request-summary-content dd {margin:0!important;overflow-wrap:anywhere!important;}
 [data-task-prototype] .tp-summary-scope {font-size:12px!important;color:#737373!important;margin-top:24px!important;line-height:1.5!important;}
 @media(max-width:480px){[data-task-prototype] .tp-request-summary-content {padding:20px!important;}[data-task-prototype] .tp-request-summary-content dl > div {grid-template-columns:minmax(0,1fr) minmax(0,1.2fr)!important;}}
}
/* Chat titles include participant metadata: they cannot use a fixed 60px header. */
@layer relay-apple {
 [data-task-prototype] [data-message-detail]:has(> .draft-chat-history) {display:flex!important;flex-direction:column!important;overflow-y:auto!important;overflow-x:hidden!important;min-width:0!important;}
 [data-task-prototype] [data-message-detail]:has(> .draft-chat-history) > header:first-child {
  position:static!important;height:auto!important;min-height:60px!important;max-height:none!important;flex:0 0 auto!important;
  align-items:flex-start!important;flex-wrap:wrap!important;padding:16px 20px!important;gap:12px!important;
 }
 [data-task-prototype] [data-message-detail]:has(> .draft-chat-history) > header:first-child > div {flex:1 1 240px!important;min-width:0!important;}
 [data-task-prototype] [data-message-detail]:has(> .draft-chat-history) > header:first-child h4 {white-space:normal!important;overflow-wrap:anywhere!important;margin:0!important;}
 [data-task-prototype] .draft-chat-participant-roles {margin:8px 0 0!important;font-size:12px!important;line-height:1.5!important;color:#737373!important;overflow-wrap:anywhere!important;}
 [data-task-prototype] [data-message-detail] > .draft-chat-history {
  flex:0 0 auto!important;height:auto!important;min-height:0!important;max-height:none!important;overflow:visible!important;
  display:flex!important;flex-direction:column!important;gap:16px!important;padding:16px 0!important;
 }
 [data-task-prototype] [data-message-detail]:has(> .draft-chat-history) > :is(.communication-inline-info,.communication-summary-disclosure,.draft-chat-compose) {flex-shrink:0!important;}
 [data-task-prototype] [data-message-detail] > .draft-chat-compose {position:static!important;min-width:0!important;box-sizing:border-box!important;}
 [data-task-prototype] [data-message-detail] .draft-chat-entry {flex-shrink:0!important;min-width:0!important;}
}

/* Jira-style SLA readout: neutral duration, clock state, no status-chip fill. */
@layer relay-apple {
 [data-task-prototype] .draft-response-chip {
  background:transparent!important;border:0!important;border-radius:0!important;box-shadow:none!important;
  color:#292929!important;justify-content:flex-start!important;gap:6px!important;padding:5px 0!important;
  font-variant-numeric:tabular-nums!important;
 }
 [data-task-prototype] .draft-response-chip[data-tone=soon] {color:#8a5800!important;}
 [data-task-prototype] .draft-response-chip[data-tone=overdue] {color:#b42318!important;}
 [data-task-prototype] .tp-sla-clock {flex:0 0 16px!important;width:16px!important;height:16px!important;}
 [data-task-prototype] .draft-response-chip.tp-loading-placeholder > * {visibility:hidden!important;}
 [data-task-prototype] .draft-response-chip:focus-visible {outline:2px solid #606060!important;outline-offset:2px!important;}
}

@layer relay-apple {
 [data-task-prototype] .communication-summary-action {flex:none!important;margin:12px 20px 16px!important;min-width:0!important;}
 [data-task-prototype] button.tp-summary-trigger {display:inline-flex!important;align-items:center!important;gap:8px!important;min-height:36px!important;padding:8px 12px!important;border:1px solid #767676!important;border-radius:6px!important;background:#fff!important;color:#292929!important;font:500 13px/18px var(--tp-ui-font)!important;box-shadow:none!important;}
 [data-task-prototype] button.tp-summary-trigger:hover:not(:disabled) {background:#f3f3f3!important;}
 [data-task-prototype] button.tp-summary-trigger:disabled {opacity:1!important;color:#676767!important;border-color:#dedede!important;background:#f5f5f5!important;cursor:progress!important;}
 [data-task-prototype] .tp-summary-status {position:absolute!important;width:1px!important;height:1px!important;overflow:hidden!important;clip-path:inset(50%)!important;}
 @media(max-width:700px) {[data-task-prototype] .communication-summary-action {margin-inline:16px!important;}}
}

@layer relay-apple {
 [data-task-prototype] .tp-request-empty-files {padding:24px!important;color:#737373!important;font:400 13px/1.5 var(--tp-ui-font)!important;}
}
@layer relay-apple {
 [data-task-prototype] {min-width:0!important;max-width:100%!important;box-sizing:border-box!important;}
 [data-task-prototype].is-focus-mode {max-width:none!important;}
 @media(max-width:1100px) {body:has([data-task-prototype]) > .cursor-trail {display:none!important;}}
}

@layer relay-apple {
 [data-task-prototype] [data-panel=files].is-request-files-empty {grid-template-columns:minmax(220px,320px) minmax(0,1fr)!important;}
 [data-task-prototype] .is-request-files-empty > :is(.tp-validation-sidebar,.tp-file-selection-splitter,.tp-adaptive-file-details),
 [data-task-prototype] .is-request-files-empty :is([data-file-info-toggle],.tp-files-info-toggle,.tp-file-filter-toolbar) {display:none!important;}
 [data-task-prototype] .is-request-files-empty > .tp-document-preview {grid-column:2!important;display:grid!important;place-items:center!important;background:#fff!important;}
 [data-task-prototype] .is-request-files-empty .tp-request-empty-files {max-width:360px!important;text-align:center!important;}
 @media(max-width:700px){
  [data-task-prototype] .tp-created-work-screen > .inv-header {flex-wrap:wrap!important;}
  [data-task-prototype] .tp-created-work-screen > .inv-header > div {min-width:0!important;max-width:100%!important;}
  [data-task-prototype] .tp-created-heading {flex-wrap:wrap!important;min-width:0!important;}
  [data-task-prototype] .tp-created-heading h2 {overflow-wrap:anywhere!important;min-width:0!important;max-width:100%!important;}
  [data-task-prototype] .tp-created-work-screen .inv-columns {grid-template-columns:minmax(0,1fr)!important;}
  [data-task-prototype] [data-panel=files].is-request-files-empty {grid-template-columns:minmax(0,1fr)!important;}
  [data-task-prototype] .is-request-files-empty > .tp-document-preview {grid-column:1!important;}
 }
}
@layer relay-apple {
 html:has([data-task-prototype].is-focus-mode),body:has([data-task-prototype].is-focus-mode) {overflow-x:clip!important;}
 @media(max-width:480px){
  [data-task-prototype] .tp-created-topbar > .tp-created-fullscreen {width:148px!important;min-width:0!important;padding:8px 6px!important;font-size:10px!important;}
 }
}
@layer relay-apple {
 [data-task-prototype] .communication-summary-action {box-sizing:border-box!important;}
 [data-task-prototype] .communication-summary-action > button.tp-summary-trigger {
  display:flex!important;width:100%!important;max-width:100%!important;box-sizing:border-box!important;
  justify-content:flex-start!important;min-height:44px!important;padding:12px 16px!important;border-radius:8px!important;
 }
}

@layer relay-apple {
 [data-task-prototype] .draft-audience-label {display:inline-flex!important;align-items:center!important;flex:none!important;min-height:20px!important;box-sizing:border-box!important;padding:2px 6px!important;border:1px solid #d2d2d2!important;border-radius:4px!important;background:#fff!important;color:#676767!important;font:500 11px/14px var(--tp-ui-font)!important;white-space:nowrap!important;}
 [data-task-prototype] .relay-chat-title-row {display:flex!important;align-items:center!important;flex-wrap:wrap!important;gap:8px!important;min-width:0!important;}
 [data-task-prototype] .relay-chat-title-row[hidden] {display:none!important;}
 [data-task-prototype] .relay-chat-title-row h4 {min-width:0!important;}
 [data-task-prototype] button[data-rename-chat] {display:inline-flex!important;align-items:center!important;justify-content:center!important;flex:none!important;width:32px!important;height:32px!important;min-height:32px!important;padding:6px!important;border:0!important;border-radius:6px!important;background:transparent!important;color:#606060!important;}
 [data-task-prototype] button[data-rename-chat]:hover {background:#eee!important;}
 [data-task-prototype] .relay-chat-rename-form {display:flex!important;align-items:flex-end!important;flex-wrap:wrap!important;gap:8px!important;}
 [data-task-prototype] .relay-chat-rename-form label {display:flex!important;flex:1 1 220px!important;flex-direction:column!important;gap:4px!important;font-size:12px!important;}
 [data-task-prototype] .relay-chat-rename-form input {min-width:0!important;width:100%!important;box-sizing:border-box!important;min-height:36px!important;padding:8px!important;border:1px solid #767676!important;background:#fff!important;color:#292929!important;font:400 14px/20px var(--tp-ui-font)!important;}
 [data-task-prototype] .relay-chat-rename-form button {min-height:36px!important;padding:8px 12px!important;border:1px solid #767676!important;border-radius:6px!important;background:#fff!important;color:#292929!important;}
 [data-task-prototype] .relay-chat-rename-form [role=alert]:not(:empty) {width:100%!important;color:#b42318!important;}
}
