/*
 * Platinum (Mac OS 8/9 Appearance Manager) as plain CSS for 71 CRM: the palette variables, base layer and every pt-* recipe of the
 * macos9-platinum-ui skill (assets/platinum.css, written for Tailwind v4 @utility) translated to ordinary classes with the SAME names.
 * Light only. No window frame (the striped title is the only chrome). 13px minimum. Hard shadows. 4px radius (8px max, dots 50%).
 *
 * Sections: 1 palette, 2 base, 3 shadow stack + surfaces, 4 controls, 5 data (list, chips, bars), 6 menus/overlays/dialog,
 *           7 layout kit (shell, nav, grid, KPI, caution band, tabs, form fields), 8 responsive, 9 motion.
 *
 * Variants Tailwind did in the class string (hover:, active:, aria-[current=page]:, disabled:) are written here as selectors on .pt-bevel:
 *   hover = #e8e8e8; pushed = :active, [aria-pressed="true"], [aria-current="page"], .is-on; disabled = :disabled, [aria-disabled="true"].
 * Compose as the skill says: class="pt-bevel pt-control pt-default-ring" (ONE default ring per view, only on the primary action).
 */

/* ---------------------------------------------------------------- 1. palette */
:root {
  --pt-grey: #dddddd;
  --pt-grey-dark: #cccccc;
  --pt-panel: #eeeeee;
  --pt-white: #ffffff;
  --pt-pressed: #b8b8b8;
  --pt-light: #ffffff;
  --pt-light-2: #eeeeee;
  --pt-mid: #aaaaaa;
  --pt-shade: #888888;
  --pt-dark: #555555;
  --pt-shadow: #777777;
  --pt-ink: #000000;
  --pt-ink-2: #333333;
  --pt-disabled: #777777;
  --pt-highlight: #9999cc;
  --pt-highlight-soft: #c8c8e8;
  --pt-stripe: #eef3fa;
  --pt-blue: #6699cc;
  --pt-blue-light: #99ccff;
  --pt-blue-dark: #336699;
  --pt-red: #cc0000;
  --pt-red-text: #a00000;
  --pt-green: #006600;
  --pt-amber: #e0a000;
  --pt-yellow-hover: #ffffee;
  --pt-hover: #e8e8e8;
  --pt-balloon: #ffffcc;
  --pt-dot-green: #339933;

  --pt-radius: 4px;
  --pt-radius-lg: 5px;
  --pt-radius-pill: 8px;
  --pt-control-h: 24px;
  --pt-touch: 44px;
  --pt-titlebar-h: 22px;
  --pt-font: Geneva, "Lucida Grande", Verdana, Tahoma, sans-serif;

  --pt-raise: inset 1px 1px 0 #fff, inset 2px 2px 0 #eee, inset -1px -1px 0 #888, inset -2px -2px 0 #aaa;
  --pt-press: inset 1px 1px 0 #555, inset 2px 2px 0 #888, inset -1px -1px 0 #eee;
  --pt-sunk: inset 1px 1px 0 #555, inset 2px 2px 0 #aaa, 1px 1px 0 #fff;
  --pt-panel-bevel: inset 1px 1px 0 #fff, inset -1px -1px 0 #aaa;
  --pt-drop: 2px 2px 0 #777;
  --pt-drop-lg: 3px 3px 0 #000;
  --pt-ring-default: 0 0 0 2px #ddd, 0 0 0 4px #000;
}

/* ---------------------------------------------------------------- 2. base */
* {
  border-color: var(--pt-ink);
  box-sizing: border-box;
}
html {
  background: var(--pt-grey);
  color-scheme: light;
}
body {
  margin: 0;
  min-height: 100vh;
  color: var(--pt-ink);
  font: 13px/1.35 var(--pt-font);
  background: repeating-linear-gradient(to bottom, #ddd 0 1px, #ccc 1px 2px);
}
a {
  color: var(--pt-ink);
}
small {
  font-size: 13px;
  font-weight: normal;
}
h1,
h2,
h3 {
  margin: 0;
  font-size: 13px;
}
::selection {
  background: var(--pt-highlight);
  color: var(--pt-ink);
}
::placeholder {
  color: var(--pt-ink-2);
  opacity: 1;
}
:focus-visible {
  outline: 2px solid var(--pt-ink);
  outline-offset: 2px;
}
button,
[role="button"] {
  cursor: default;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
[hidden] {
  display: none !important;
}

/* ---------------------------------------------------------------- 3. shadow stack + surfaces
 * Every surface shares one expression: box-shadow: var(--pt-inner), var(--pt-ring), var(--pt-drop-on).
 * pt-bevel / pt-pushed / pt-inset set --pt-inner, pt-default-ring sets --pt-ring, pt-shadow-hard(-lg) sets --pt-drop-on.
 */
.pt-stack,
.pt-shadow-hard,
.pt-shadow-hard-lg,
.pt-default-ring,
.pt-bevel,
.pt-btn,
.pt-pushed,
.pt-inset,
.pt-panel,
.pt-caution,
.pt-disabled,
.pt-check,
.pt-tab {
  box-shadow: var(--pt-inner, 0 0 #0000), var(--pt-ring, 0 0 #0000), var(--pt-drop-on, 0 0 #0000);
}
.pt-shadow-hard {
  --pt-drop-on: var(--pt-drop);
}
.pt-shadow-hard-lg {
  --pt-drop-on: var(--pt-drop-lg);
}
.pt-default-ring {
  --pt-ring: var(--pt-ring-default);
  margin: 4px;
  border-radius: var(--pt-radius-lg);
}
.pt-pinstripe {
  background: repeating-linear-gradient(to bottom, #ddd 0 1px, #ccc 1px 2px);
}
.pt-bevel,
.pt-btn {
  --pt-inner: var(--pt-raise);
  background: var(--pt-grey);
  color: var(--pt-ink);
  border: 1px solid var(--pt-ink);
  border-radius: var(--pt-radius);
}
button.pt-bevel:hover,
a.pt-bevel:hover,
[role="button"].pt-bevel:hover,
button.pt-btn:hover,
a.pt-btn:hover {
  background: var(--pt-hover);
}
.pt-pushed,
button.pt-bevel:active,
a.pt-bevel:active,
button.pt-btn:active,
a.pt-btn:active,
.pt-bevel[aria-pressed="true"],
.pt-bevel[aria-current="page"],
.pt-bevel.is-on,
.pt-btn[aria-pressed="true"],
.pt-btn[aria-current="page"] {
  --pt-inner: var(--pt-press);
  background: var(--pt-pressed);
}
.pt-bevel[aria-pressed="true"] > *,
.pt-bevel[aria-current="page"] > *,
.pt-bevel.is-on > *,
.pt-bevel:active > *,
.pt-btn:active > * {
  transform: translate(1px, 1px);
}
.pt-inset {
  --pt-inner: var(--pt-sunk);
  background: var(--pt-white);
  color: var(--pt-ink);
  border: 1px solid var(--pt-shade);
}
.pt-panel {
  --pt-drop-on: var(--pt-drop);
  background: var(--pt-panel);
  color: var(--pt-ink);
  border: 1px solid var(--pt-ink);
  border-radius: var(--pt-radius);
  overflow: hidden;
}
.pt-caution {
  --pt-drop-on: var(--pt-drop-lg);
  background: var(--pt-panel);
  color: var(--pt-ink);
  border: 2px solid var(--pt-ink);
  border-radius: var(--pt-radius);
  overflow: hidden;
}
.pt-titlebar {
  height: var(--pt-titlebar-h);
  margin: 0;
  line-height: 21px;
  text-align: center;
  font-size: 13px;
  font-weight: bold;
  color: var(--pt-ink);
  background-color: var(--pt-grey);
  background-image: repeating-linear-gradient(to bottom, #888 0 1px, #fff 1px 2px);
  background-size: 100% 12px;
  background-position: 0 5px;
  background-repeat: no-repeat;
  border-bottom: 1px solid var(--pt-ink);
  box-shadow: inset 0 1px 0 #fff;
}
.pt-titlebar > * {
  display: inline-block;
  padding: 0 12px;
  background: var(--pt-grey);
}
.pt-tabbody {
  background: var(--pt-panel);
  border: 1px solid var(--pt-ink);
  box-shadow: var(--pt-panel-bevel);
}
.pt-controlstrip {
  background: repeating-linear-gradient(to bottom, #ddd 0 1px, #ccc 1px 2px);
  border-top: 2px solid var(--pt-ink);
  box-shadow: inset 0 1px 0 #fff;
}

/* ---------------------------------------------------------------- 4. controls */
.pt-control,
.pt-btn {
  min-height: var(--pt-control-h);
  padding: 3px 16px;
  font: inherit;
  font-weight: bold;
  line-height: 1.35;
}
.pt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
}
.pt-field-text {
  min-height: var(--pt-control-h);
  padding: 3px 6px;
  font: inherit;
  line-height: 1.35;
}
textarea.pt-field-text {
  min-height: 72px;
  resize: vertical;
}
.pt-disabled,
.pt-bevel:disabled,
.pt-btn:disabled,
.pt-bevel[aria-disabled="true"],
.pt-btn[aria-disabled="true"] {
  --pt-inner: inset 1px 1px 0 #f4f4f4, inset -1px -1px 0 #bbb;
  color: var(--pt-disabled);
  text-shadow: 1px 1px 0 #fff;
  border-color: var(--pt-shade);
  background: var(--pt-grey);
  pointer-events: none;
}
.pt-tab {
  --pt-inner: inset 1px 1px 0 #fff, inset -1px 0 0 #888;
  margin-top: 3px;
  padding: 4px 16px;
  font: inherit;
  font-weight: bold;
  color: var(--pt-ink);
  background: var(--pt-grey-dark);
  border: 1px solid var(--pt-ink);
  border-bottom: 0;
  border-radius: 7px 7px 0 0;
}
.pt-tab-selected,
.pt-tab[aria-selected="true"] {
  margin-top: 0;
  padding-top: 7px;
  padding-bottom: 5px;
  background: var(--pt-panel);
}
.pt-check {
  --pt-inner: var(--pt-sunk);
  width: 16px;
  height: 16px;
  flex: none;
  background: var(--pt-white);
  border: 1px solid var(--pt-ink);
}
.pt-tri-up,
.pt-tri-down,
.pt-tri-right,
.pt-tri-left {
  display: inline-block;
  width: 0;
  height: 0;
  border: 5px solid transparent;
}
.pt-tri-up {
  border-width: 0 5px 8px;
  border-bottom-color: currentColor;
}
.pt-tri-down {
  border-width: 8px 5px 0;
  border-top-color: currentColor;
}
.pt-tri-right {
  border-width: 6px 0 6px 9px;
  border-left-color: currentColor;
}
.pt-tri-left {
  border-width: 6px 9px 6px 0;
  border-right-color: currentColor;
}

/* ---------------------------------------------------------------- 5. data: list view, chips, bars */
.pt-list {
  width: 100%;
  border-collapse: collapse;
  background: var(--pt-white);
  border: 1px solid var(--pt-ink);
}
.pt-list th {
  padding: 3px 8px;
  text-align: left;
  font-weight: bold;
  background: linear-gradient(#f2f2f2, #d4d4d4);
  border-right: 1px solid #777;
  border-bottom: 1px solid var(--pt-ink);
  box-shadow: inset 1px 1px 0 #fff;
}
.pt-list td {
  padding: 4px 8px;
  vertical-align: top;
}
.pt-list tbody tr:nth-child(even) {
  background: var(--pt-stripe);
}
.pt-list tbody tr[data-state="selected"],
.pt-list tbody tr[aria-selected="true"] {
  background: var(--pt-highlight);
}
.pt-list tbody tr[data-tone="bad"] td {
  color: var(--pt-red-text);
  font-weight: bold;
}
.pt-table-wrap {
  overflow-x: auto;
}
/* Under 768px a .pt-list.pt-list-stack table becomes stacked cards.
 * Cell markers: data-label="Header", data-title (first line), data-chip (status). */
@media (max-width: 767px) {
  table.pt-list.pt-list-stack {
    background: none;
    border: 0;
  }
  .pt-list-stack thead {
    display: none;
  }
  .pt-list-stack tbody,
  .pt-list-stack tr,
  .pt-list-stack td {
    display: block;
  }
  .pt-list-stack tbody tr,
  .pt-list-stack tbody tr:nth-child(even) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px 8px;
    margin: 0 0 8px;
    padding: 8px 10px;
    background: var(--pt-white);
    border: 1px solid var(--pt-ink);
    border-radius: var(--pt-radius);
    box-shadow: var(--pt-raise);
  }
  .pt-list-stack tbody tr:nth-child(even) {
    background: var(--pt-stripe);
  }
  .pt-list-stack tbody tr[data-state="selected"],
  .pt-list-stack tbody tr[aria-selected="true"] {
    background: var(--pt-highlight);
  }
  .pt-list-stack td {
    flex: 1 0 100%;
    order: 2;
    padding: 0;
    text-align: left;
  }
  .pt-list-stack td[data-label]::before {
    content: attr(data-label) ": ";
    font-weight: bold;
    color: var(--pt-ink-2);
  }
  .pt-list-stack td[data-title] {
    flex: 1 1 0;
    min-width: 0;
    order: 1;
    font-size: 15px;
  }
  .pt-list-stack td[data-chip] {
    flex: 0 0 auto;
    order: 1;
  }
  .pt-list-stack td[data-title]::before,
  .pt-list-stack td[data-chip]::before,
  .pt-list-stack td:empty {
    display: none;
  }
}
/* status chip: set the dot with style="--pt-dot: var(--pt-amber)" via CSSOM or one of the modifier classes below */
.pt-chip {
  display: inline-flex;
  align-items: center;
  padding: 0 7px 0 4px;
  font-weight: normal;
  white-space: nowrap;
  color: var(--pt-ink);
  background: var(--pt-white);
  border: 1px solid var(--pt-ink);
  border-radius: var(--pt-radius-pill);
}
.pt-chip::before {
  content: "";
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 5px;
  border: 1px solid var(--pt-ink);
  border-radius: 50%;
  background: var(--pt-dot, #999);
}
.pt-chip.is-red {
  --pt-dot: var(--pt-red);
}
.pt-chip.is-blue {
  --pt-dot: var(--pt-blue);
}
.pt-chip.is-amber {
  --pt-dot: var(--pt-amber);
}
.pt-chip.is-green {
  --pt-dot: var(--pt-dot-green);
}
.pt-chip.is-dark {
  --pt-dot: var(--pt-ink-2);
}
.pt-trough {
  display: block;
  height: 18px;
  padding: 2px;
  background: var(--pt-white);
  border: 1px solid var(--pt-shade);
  box-shadow: var(--pt-sunk);
}
.pt-fill {
  display: block;
  height: 100%;
  border: 1px solid var(--pt-ink);
  border-left: 0;
  background: repeating-linear-gradient(-45deg, #6699cc 0 7px, #99ccff 7px 14px);
}
.pt-barber {
  display: block;
  height: 100%;
  border: 1px solid var(--pt-ink);
  border-left: 0;
  background: linear-gradient(135deg, #6699cc 25%, #99ccff 25% 50%, #6699cc 50% 75%, #99ccff 75%);
  background-size: 20px 20px;
  animation: pt-pole 1s linear infinite;
}
.pt-bar {
  border: 1px solid var(--pt-ink);
  box-shadow: 2px 2px 0 var(--pt-shadow);
  background: linear-gradient(to right, #99ccff 0 3px, #6699cc 3px calc(100% - 3px), #336699 calc(100% - 3px));
}
.pt-bar-partial {
  background: repeating-linear-gradient(-45deg, #99ccff 0 5px, #6699cc 5px 10px);
}
.pt-bar-empty {
  height: 3px;
  background: none;
  border-style: dashed;
  box-shadow: none;
}
.pt-gridline {
  border-top: 1px dotted #666;
}
.pt-scroll-track {
  background-color: var(--pt-grey);
  background-image: repeating-conic-gradient(#fff 0% 25%, #ddd 0% 50%);
  background-size: 2px 2px;
  border: 1px solid var(--pt-ink);
}
.pt-scroll-thumb {
  background: var(--pt-grey);
  border: 1px solid var(--pt-ink);
  border-radius: 2px;
  box-shadow: var(--pt-raise);
}

/* ---------------------------------------------------------------- 6. menus, overlays, dialog */
.pt-menu {
  background: var(--pt-panel);
  color: var(--pt-ink);
  border: 1px solid var(--pt-ink);
  border-radius: 0;
  box-shadow: var(--pt-drop-lg);
}
.pt-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 18px 3px 24px;
  font-weight: normal;
}
.pt-menu-item[data-highlighted],
.pt-menu-item:focus {
  background: var(--pt-highlight);
  color: var(--pt-ink);
  outline: 0;
}
.pt-menu-item[data-disabled] {
  color: var(--pt-disabled);
  text-shadow: 1px 1px 0 #fff;
  pointer-events: none;
}
.pt-tooltip {
  background: var(--pt-balloon);
  color: var(--pt-ink);
  border: 1px solid var(--pt-ink);
  border-radius: 0;
  padding: 2px 6px;
  box-shadow: 2px 2px 0 var(--pt-shadow);
}
.pt-overlay {
  background-color: transparent;
  background-image: repeating-conic-gradient(rgb(0 0 0 / 0.45) 0% 25%, transparent 0% 50%);
  background-size: 2px 2px;
}
/* modal dialog: <div class="pt-overlay pt-dialog-backdrop"><div class="pt-caution pt-dialog" role="dialog" aria-modal="true">...</div></div> */
.pt-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}
.pt-dialog {
  width: min(480px, 100%);
  max-height: 100%;
  overflow: auto;
}
.pt-dialog-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 10px 10px;
}

/* ---------------------------------------------------------------- 7. layout kit */
.pt-page {
  min-height: 100vh;
  padding: 16px;
}
.pt-shell {
  max-width: 1248px;
  margin: 0 auto;
}
.pt-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}
.pt-brand {
  margin: 0;
  font-size: 24px;
  font-weight: bold;
}
.pt-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.pt-navbtn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 148px;
  padding: 6px 0;
  font-weight: bold;
  text-decoration: none;
}
.pt-main {
  display: grid;
  gap: 12px;
}
.pt-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(260px, 26.5%, 330px);
  gap: 12px;
}
.pt-body {
  padding: 10px;
}
.pt-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.pt-stack-v {
  display: grid;
  gap: 8px;
}
.pt-grow {
  flex: 1 1 0;
  min-width: 0;
}
.pt-muted {
  color: var(--pt-ink-2);
}
.pt-red {
  color: var(--pt-red);
}
.pt-red-text {
  color: var(--pt-red-text);
}
.pt-green {
  color: var(--pt-green);
}
.pt-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.pt-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.pt-kpi {
  display: flex;
  flex-direction: column;
  min-height: 44px;
  padding: 6px 10px 7px;
}
.pt-kpi b {
  font-size: 32px;
  line-height: 1.2;
}
.pt-kpi small {
  font-size: 15px;
}
.pt-caution-band {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px;
}
.pt-caution-count {
  font-size: 26px;
  font-weight: bold;
  color: var(--pt-red);
}
.pt-caution-rows {
  display: grid;
  flex: 1;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.pt-tabs {
  display: flex;
  gap: 2px;
  padding-left: 10px;
  flex-wrap: wrap;
}
.pt-info {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 4px 10px;
  margin-top: 12px;
}
.pt-info > * + *::before {
  content: "|";
  margin-right: 12px;
  color: var(--pt-dark);
}
/* labelled form field: <label class="pt-field"><span>Label</span><input class="pt-inset pt-field-text"></label> */
.pt-field {
  display: grid;
  gap: 4px;
  font-weight: bold;
}
.pt-field > input,
.pt-field > select,
.pt-field > textarea {
  font-weight: normal;
  width: 100%;
}
.pt-field-hint {
  font-weight: normal;
  color: var(--pt-ink-2);
}
.pt-form-error {
  margin: 0;
  padding: 6px 8px;
  color: var(--pt-red-text);
  font-weight: bold;
  background: var(--pt-white);
  border: 1px solid var(--pt-ink);
}
.pt-form-ok {
  margin: 0;
  padding: 6px 8px;
  color: var(--pt-green);
  font-weight: bold;
  background: var(--pt-white);
  border: 1px solid var(--pt-ink);
}

/* ---------------------------------------------------------------- 8. responsive */
@media (max-width: 1099px) {
  .pt-split {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 1023px) {
  :root {
    --pt-control-h: 44px;
  }
  .pt-page {
    padding: 12px;
  }
  .pt-nav .pt-navbtn {
    flex: 1 1 0;
    width: auto;
    min-height: 56px;
  }
  .pt-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .pt-tab,
  .pt-kpi,
  .pt-navbtn {
    min-height: 44px;
  }
}
@media (max-width: 767px) {
  body {
    font-size: 14px;
  }
  .pt-page {
    padding: 8px 8px calc(84px + env(safe-area-inset-bottom));
  }
  .pt-body {
    padding: 8px;
  }
  .pt-kpi b {
    font-size: 28px;
  }
  .pt-caution-band {
    flex-wrap: wrap;
  }
  .pt-caution-rows {
    grid-template-columns: 1fr;
  }
  .pt-caution-count {
    font-size: 24px;
  }
  .pt-info {
    gap: 2px 10px;
  }
  /* bottom control strip: put the nav in <nav class="pt-nav pt-nav-strip"> */
  .pt-nav-strip {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 10;
    gap: 4px;
    margin: 0;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: repeating-linear-gradient(to bottom, #ddd 0 1px, #ccc 1px 2px);
    border-top: 2px solid var(--pt-ink);
    box-shadow: inset 0 1px 0 #fff;
  }
  .pt-nav-strip .pt-navbtn {
    min-height: 52px;
    font-size: 13px;
    line-height: 1.15;
  }
  .pt-tabs {
    padding-left: 0;
    gap: 4px;
  }
  .pt-tabs .pt-tab {
    flex: 1;
    margin-top: 0;
    border-bottom: 1px solid var(--pt-ink);
    border-radius: 7px;
  }
}
@media (max-width: 479px) {
  .pt-brand {
    font-size: 22px;
  }
  .pt-kpis {
    grid-template-columns: 1fr;
  }
}

/* ---------------------------------------------------------------- 9. motion */
@keyframes pt-pole {
  to {
    background-position: 20px 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .pt-barber {
    animation: none;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
