/* Shared workspace components: buttons, dialog buttons, table headers, pills and toast messages.
   Loaded after tokens.css and the shared base sheets, before the page sheets, so a page rule
   of the same specificity still wins. Rules keep their original order and selectors. */

/* From apple-ui-app.css */
#appShell.ui-workspace :where(.btn, .btn-outline) {
  min-width: 0;
  max-width: 100%;
  min-height: 38px;
  flex-shrink: 0;
  padding: 8px 12px;
  align-self: center;
  justify-content: center;
  border-radius: 10px;
  font-size: var(--type-body);
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
  font-weight: 650;
  box-shadow: none;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, transform 150ms ease;
}
#appShell.ui-workspace .btn {
  border-color: var(--ui-blue);
  background: var(--ui-blue);
  color: #ffffff;
}
#appShell.ui-workspace .btn-outline {
  border-color: var(--ui-line-strong);
  background: var(--ui-surface-solid);
  color: var(--ui-ink);
}
#appShell.ui-workspace thead th {

  color: var(--ui-ink-secondary);
  font-size: var(--type-caption);
  font-weight: 750;
  letter-spacing: 0.065em;
  text-transform: uppercase;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
#appShell.ui-workspace :where(.badge, .pill, .status-pill, .dashboard-beta-chip, .dashboard-howto-chip) {
  border-color: var(--ui-line);
  background: var(--ui-surface-muted);
  box-shadow: none;
  color: var(--ui-ink-secondary);
}
body.auth-ready[data-app-shell]:not(#_) .modal :where(.btn, .btn-outline), body.auth-ready #appShell.ui-workspace .modal :where(.btn, .btn-outline) {
  min-width: 0;
  max-width: 100%;
  min-height: 38px;
  padding: 8px 12px;
  font-size: var(--type-body,13px);
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
  justify-content: center;
  flex-shrink: 0;
  border-color: rgba(29, 29, 31, 0.14);
  background: var(--ui-grey-50);
  box-shadow: none;
  color: var(--ui-grey-800);
}
body.auth-ready[data-app-shell]:not(#_) .modal .btn, body.auth-ready #appShell.ui-workspace .modal .btn {
  border-color: var(--workspace-primary-fill);
  background: var(--workspace-primary-fill);
  color: var(--workspace-primary-ink);
}
body.auth-ready[data-app-shell]:not(#_) .modal .btn-outline.danger, body.auth-ready #appShell.ui-workspace .modal .btn-outline.danger {
  color: var(--workspace-danger-fill);
}
body.auth-ready[data-app-shell][data-app-theme="dark"]:not(#_) .modal :where(.btn, .btn-outline), body.auth-ready #appShell.ui-workspace[data-ui-theme="dark"] .modal :where(.btn, .btn-outline) {
  border-color: rgba(255, 255, 255, 0.14);
  background: var(--ui-grey-100);
  color: var(--ui-grey-800);
}
body.auth-ready[data-app-shell][data-app-theme="dark"]:not(#_) .modal .btn, body.auth-ready #appShell.ui-workspace[data-ui-theme="dark"] .modal .btn {
  border-color: var(--workspace-primary-fill);
  background: var(--workspace-primary-fill);
  color: var(--workspace-primary-ink);
}
body.auth-ready[data-app-shell][data-app-theme="dark"]:not(#_) #toast .toast, body.auth-ready #appShell.ui-workspace[data-ui-theme="dark"] #toast .toast {
  border-color: rgba(255, 255, 255, 0.16);
  background: var(--ui-raised);
  color: var(--ui-grey-900);
}
body.auth-ready[data-app-shell]:not(#_) .modal header :where(.toprow, .modal-close-wrap) > .btn, body.auth-ready #appShell.ui-workspace .modal header :where(.toprow, .modal-close-wrap) > .btn {
  border: 1px solid rgba(29, 29, 31, 0.12);
  background: var(--ui-grey-50);
  box-shadow: none;
  color: var(--ui-grey-600);
}
body.auth-ready[data-app-shell][data-app-theme="dark"]:not(#_) .modal header :where(.toprow, .modal-close-wrap) > .btn, body.auth-ready #appShell.ui-workspace[data-ui-theme="dark"] .modal header :where(.toprow, .modal-close-wrap) > .btn {
  border-color: rgba(255, 255, 255, 0.12);
  background: var(--ui-grey-100);
  color: var(--ui-grey-800);
}
body #toast .toast {
  width:max-content;min-width:0;max-width:calc(100vw - 32px);box-sizing:border-box;
  gap:14px;padding:16px 22px;margin:0;border:1px solid var(--ui-grey-200,#dce3ec);border-radius:14px;
  background:#fff;color:var(--ui-grey-900,#1c2738);box-shadow:0 12px 40px #17243826;
  font:var(--type-body,14px)/1.5 var(--workspace-font-sans,system-ui);backdrop-filter:none;
  -webkit-backdrop-filter:none;
}
body #toast .toast[hidden] {display:none}
#toast .toast-msg {max-width:390px;font-weight:700}
#toast .toast-icon {display:grid;place-items:center;flex:none;width:22px;height:22px;font-size:var(--type-section,18px);font-weight:700}
body.auth-ready[data-app-shell]:not(#_) #toast .toast, body.auth-ready #appShell.ui-workspace #toast .toast {
  border-radius: 14px;
  background:#fff;color:var(--ui-grey-900);border-color:var(--ui-grey-200);box-shadow:0 12px 40px #17243826;
  backdrop-filter:none;-webkit-backdrop-filter:none;
}
body[data-app-theme="dark"]:not(#_) #toast .toast, body #appShell[data-ui-theme="dark"] #toast .toast,
body.auth-ready[data-app-shell][data-app-theme="dark"]:not(#_) #toast .toast, body.auth-ready #appShell.ui-workspace[data-ui-theme="dark"] #toast .toast {
  background:var(--ui-grey-surface);color:var(--ui-grey-900);border-color:var(--ui-grey-300);
}
#appShell.ui-workspace thead th {
  border-color: var(--table-border);

  color: var(--table-header-text);
  box-shadow: none;
}

/* From customer-errors.css */
#toast .toast .toast-code{display:block;margin-top:2px;font-weight:400;font-size:var(--type-caption,12px);line-height:1.4;color:var(--ui-grey-600,#66758c)}
body[data-app-theme="dark"]:not(#_) #toast .toast .toast-code, body #appShell[data-ui-theme="dark"] #toast .toast .toast-code{color:var(--ui-grey-600)}
#toast .toast .toast-action{flex:none;min-height:34px;padding:7px 13px;border:1px solid var(--ui-grey-300,#c9d4e3);border-radius:9px;background:transparent;box-shadow:none;color:#1764d8;font:650 var(--type-body,13px)/1 var(--workspace-font-sans,system-ui);cursor:pointer;white-space:nowrap}
#toast .toast .toast-action:hover{background:var(--ui-grey-100,#eef4fd)}
body[data-app-theme="dark"]:not(#_) #toast .toast .toast-action:hover, body #appShell[data-ui-theme="dark"] #toast .toast .toast-action:hover{background:var(--ui-grey-200)}
@media (max-width:640px) {
body #toast .toast.has-action{flex-wrap:wrap}
body #toast .toast.has-action .toast-msg{flex:1 1 calc(100% - 80px)}
body #toast .toast.has-action .toast-action{order:3;margin-left:34px}
}

/* From workspace-utilities.css */
body[data-app-shell]:not(#_) .toast, body #appShell.ui-workspace .toast { border-radius:9px; padding:12px 16px; box-shadow:0 8px 24px #14223515; font-size:var(--type-body,12px); line-height:1.5; max-width:min(440px,calc(100vw - 32px)); overflow-wrap:anywhere; }
body[data-app-shell]:not(#_) .toast-icon, body #appShell.ui-workspace .toast-icon { width:22px; height:22px; border-radius:6px; display:grid; place-items:center; flex:none; }
body[data-app-shell]:not(#_) .toast-success, body #appShell.ui-workspace .toast-success { background:#edf8f3; color:#147d60; border:1px solid #cde8dc; }
body[data-app-shell]:not(#_) .toast-error, body #appShell.ui-workspace .toast-error { background:#fff0f0; color:#c13939; border:1px solid #f2d0d3; }
body[data-app-shell]:not(#_) .toast-warn, body #appShell.ui-workspace .toast-warn { background:#fff6e7; color:#98651c; border:1px solid #efdfbd; }
body[data-app-shell]:not(#_) .toast-info, body #appShell.ui-workspace .toast-info { background:#edf4ff; color:#1671ec; border:1px solid #d0e1fa; }
body[data-app-theme="dark"]:not(#_) .toast-success, body #appShell[data-ui-theme="dark"] .toast-success { background:#19362f; color:#75c9a8; border-color:#2a5146; }
body[data-app-theme="dark"]:not(#_) .toast-error, body #appShell[data-ui-theme="dark"] .toast-error { background:#3c252b; color:#ff6676; border-color:#66404a; }
body[data-app-theme="dark"]:not(#_) .toast-warn, body #appShell[data-ui-theme="dark"] .toast-warn { background:#382f21; color:#dfb575; border-color:#5f4e31; }
body[data-app-theme="dark"]:not(#_) .toast-info, body #appShell[data-ui-theme="dark"] .toast-info { background:#1d314b; color:#70aaff; border-color:#334d70; }
body[data-app-shell]:not(#_) .toast .toast-icon, body #appShell.ui-workspace .toast .toast-icon { color:inherit; }
/* Neutral notification surfaces; tone is carried by a compact icon, not a
   full colored panel. Match the white workspace surfaces in light mode. */
body[data-app-shell]:not(#_) #toast .toast, body #appShell.ui-workspace #toast .toast,
body.auth-ready[data-app-shell]:not(#_) #toast .toast, body.auth-ready #appShell.ui-workspace #toast .toast {
  width:max-content;max-width:calc(100vw - 32px);box-sizing:border-box;min-width:0;margin:0;padding:16px 22px;gap:14px;
  background:#fff;color:var(--ui-grey-900);border:1px solid var(--ui-grey-200);border-radius:14px;
  box-shadow:0 12px 40px #17243826;backdrop-filter:none;-webkit-backdrop-filter:none;
  font:var(--type-body,14px)/1.5 var(--workspace-font-sans,system-ui);
}
body #toast .toast[hidden] {display:none}
body #toast.toast-left {left:var(--toast-left);right:auto;transform:none;align-items:flex-start;max-width:calc(100vw - var(--toast-left) - 16px)}
body #toast .toast-msg {font-weight:700;max-width:390px}
body[data-app-theme="dark"]:not(#_) #toast .toast, body #appShell[data-ui-theme="dark"] #toast .toast,
body.auth-ready[data-app-shell][data-app-theme="dark"]:not(#_) #toast .toast, body.auth-ready #appShell.ui-workspace[data-ui-theme="dark"] #toast .toast {background:var(--ui-grey-surface);color:var(--ui-grey-900);border-color:#ffffff26}
body[data-app-shell]:not(#_) #toast .toast-icon, body #appShell.ui-workspace #toast .toast-icon {width:24px;height:24px;border-radius:50%;font-size:var(--type-body,13px);font-weight:700}
body[data-app-shell]:not(#_) #toast .toast-success .toast-icon, body #appShell.ui-workspace #toast .toast-success .toast-icon {color:#147d60;background:#eaf6f0}
body[data-app-shell]:not(#_) #toast .toast-error .toast-icon, body #appShell.ui-workspace #toast .toast-error .toast-icon {color:#c13939;background:#fff0f0}
body[data-app-shell]:not(#_) #toast .toast-warn .toast-icon, body #appShell.ui-workspace #toast .toast-warn .toast-icon {color:#98651c;background:#fff4e1}
body[data-app-shell]:not(#_) #toast .toast-info .toast-icon, body #appShell.ui-workspace #toast .toast-info .toast-icon {color:#1671ec;background:#e9f1ff}

/* From workspace-components.css */
/* Three button types. .btn is the one primary action in an area, .btn-outline is secondary,
   and .btn-quiet is a row action or a filter reset: blue text, no box. Red belongs on the
   confirm button of a dialog that asks before something is deleted or changed. The fill is
   its own token because no red token reaches dialogs, and the dark --ui-red is too light
   to carry white text. */
#appShell.ui-workspace .btn-quiet {display:inline-flex;align-items:center;justify-content:center;min-width:0;min-height:0;max-width:100%;margin:0;padding:3px 4px;border:0;border-radius:6px;background:none;box-shadow:none;color:var(--ui-blue);font:600 var(--type-body)/1.35 var(--ui-font-sans);letter-spacing:0;text-decoration:none;white-space:nowrap;transform:none;cursor:pointer}
#appShell.ui-workspace .btn-quiet:hover:not(:disabled) {background:var(--ui-blue-soft)}
#appShell.ui-workspace .btn-quiet:focus-visible {outline:2px solid var(--ui-blue);outline-offset:1px}
#appShell.ui-workspace .btn-quiet:disabled {opacity:.55;cursor:not-allowed}
@media (pointer:coarse) {
#appShell.ui-workspace .btn-quiet {min-height:44px;padding:3px 8px}
}
body.auth-ready[data-app-shell]:not(#_) .modal .btn.danger, body.auth-ready #appShell.ui-workspace .modal .btn.danger,
body.auth-ready[data-app-shell]:not(#_) .modal .btn.danger:hover, body.auth-ready #appShell.ui-workspace .modal .btn.danger:hover {border-color:var(--workspace-danger-fill);background:var(--workspace-danger-fill);color:#fff}
body.auth-ready[data-app-shell]:not(#_) .modal.workspace-dialog :is(.btn,.btn-outline), body.auth-ready #appShell.ui-workspace .modal.workspace-dialog :is(.btn,.btn-outline) {
  min-height:var(--workspace-control-height);border:1px solid var(--ui-line);
  border-radius:var(--workspace-control-radius);padding:9px 13px;
  background:var(--ui-surface);color:var(--ui-ink);box-shadow:none;
  font:600 var(--workspace-control-font)/1.5 var(--workspace-font-sans);
  white-space:normal;transform:none;
}
body.auth-ready[data-app-shell]:not(#_) .modal.workspace-dialog :is(.modal-actions,.u-modal-actions-end) .btn, body.auth-ready #appShell.ui-workspace .modal.workspace-dialog :is(.modal-actions,.u-modal-actions-end) .btn {
  background:var(--workspace-primary-fill);border-color:var(--workspace-primary-fill);color:var(--workspace-primary-ink);
}
body.auth-ready[data-app-shell]:not(#_) .modal.workspace-dialog header .toprow > .btn, body.auth-ready #appShell.ui-workspace .modal.workspace-dialog header .toprow > .btn {
  background:var(--ui-surface-muted);border-color:var(--ui-line);color:var(--ui-ink);
}
