/* ==========================================================================
   PALSTER DESIGN SYSTEM - DESIGN TOKENS
   Specification: Grant Networks, LLC / Meta Interface Architecture
   Official Brand Color: #047C80 (Palster Teal) / #06A6A3 bright on dark
   ========================================================================== */


:root {
  /* --- Brand Accent Primitives (Palster Authentic Teal) --- */
  --palster-brand-primary: #047C80;
  --palster-primary: var(--palster-brand-primary);
  --palster-brand-hover: #047C80;
  --palster-brand-pressed: #047C80;
  /* A fill under white text (5.00:1). Dark keeps --palster-brand-primary at
     #06A6A3 for text, which gives white only 3.00:1, so fills use this. */
  --palster-brand-fill: #047C80;
  --palster-brand-fill-hover: #04666A;
  --palster-brand-subtle: #E0F7FA;
  --palster-brand-translucent: rgba(4,124,128, 0.08);
  --palster-brand-translucent-hover: rgba(4,124,128, 0.15);
  --palster-brand-translucent-border: rgba(4,124,128, 0.22);
  --palster-brand-translucent-text: #047C80;
  /* Highlights (selected chips, active rows, hover washes, badges) are neutral:
     a grey wash with primary text, never a Lagoon tint with Lagoon text. */
  --palster-highlight-bg: rgba(0, 0, 0, 0.06);
  --palster-highlight-bg-hover: rgba(0, 0, 0, 0.09);
  --palster-highlight-text: #1D1D1F;
  --palster-highlight-border: rgba(0, 0, 0, 0.14);
  /* Loading skeletons, every one in the app: a bone the colour of a quiet
     highlight with one soft light passing over it, readable on a card and on
     the page alike. */
  --palster-skel: rgba(0, 0, 0, 0.06);
  --palster-skel-shine: rgba(0, 0, 0, 0.025);
  --palster-skel-bg: linear-gradient(100deg, var(--palster-skel) 40%, var(--palster-skel-shine) 50%, var(--palster-skel) 60%) var(--palster-skel);
  --palster-skel-anim: palster-skel 1.5s linear infinite;
  --palster-brand-gradient: linear-gradient(180deg, #058184 0%, #04666A 100%);
  --palster-brand-gradient-hover: linear-gradient(180deg, #058184 0%, #04666A 100%);
  --palster-story-gradient: linear-gradient(180deg, #058184 0%, #04666A 100%);

  /* --- Squircle Action Button Tokens (Palster Teal) --- */
  --palster-btn-natural: #047C80;
  --palster-btn-natural-hover: #047C80;
  --palster-btn-natural-pressed: #047C80;
  --palster-btn-natural-border: rgba(4,124,128, 0.30);
  --palster-btn-natural-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 1px 3px rgba(4,124,128, 0.22);

  /* --- Neutral Surface Colors (Apple macOS Clean Slate) --- */
  --palster-surface-wash: #F5F5F7;
  --palster-surface-card: rgba(255, 255, 255, 0.88);
  --palster-surface-hover: rgba(0, 0, 0, 0.04);
  --palster-surface-active: rgba(0, 0, 0, 0.08);
  --palster-surface-overlay: rgba(255, 255, 255, 0.94);
  /* Windows sit over text. Inside an element that has its own backdrop blur (a
     card, the top bar) a window's blur sees nothing, so 8% of the page showed
     through the old 0.92: 0.97 keeps the tint without the ghost text. */
  --palster-surface-modal: rgba(255, 255, 255, 0.97);
  --palster-surface-palneum-nav: #F5F5F7;

  /* --- Precision Hairline Border & Divider Tokens --- */
  --palster-border-subtle: rgba(0, 0, 0, 0.08);
  --palster-border-soft: rgba(0, 0, 0, 0.05);
  --palster-border-strong: rgba(0, 0, 0, 0.16);
  --palster-border-divider: rgba(0, 0, 0, 0.06);
  /* Timeline cards: one cool hairline and a soft lift, nothing inside it. */
  --palster-card-edge: rgba(15, 23, 42, 0.08);
  --palster-card-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 2px 10px rgba(15, 23, 42, 0.03);
  --palster-card-shadow-hover: 0 1px 2px rgba(15, 23, 42, 0.05), 0 8px 24px -4px rgba(15, 23, 42, 0.08);
  --palster-specular-top: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  --palster-specular-hairline: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 0 0 1px rgba(0, 0, 0, 0.06);

  /* --- Typography Colors (Psychologically Calibrated for High-Contrast Comfort) --- */
  --palster-text-primary: #1D1D1F;
  /* #6E6E73 fell to 4.4:1 on the grey washes of chosen rows and chips. */
  --palster-text-secondary: #636368;
  /* #86868B was 3.6:1 on white; small grey text needs 4.5:1 (WCAG 2.2 AA). */
  --palster-text-tertiary: #636368;
  --palster-text-inverse: #FFFFFF;
  --palster-text-brand: #047C80;
  /* Reaction colours colour text (the count beside a reacted button): 4.5:1 here and in dark. */
  --palster-reaction-like: #047C80;
  --palster-reaction-love: #BE123C;
  --palster-reaction-wow: #7C3AED;
  --palster-reaction-haha: #B45309;
  --palster-reaction-sad: #4F46E5;
  --palster-reaction-nah: #C2410C;

  /* --- Status Indicators --- */
  --palster-status-online: #10B981;
  --palster-status-alert: #EF4444;
  --palster-status-warning: #F59E0B;
  --palster-warning-text: #92400E;
  --palster-status-info: #0284C7;

  /* --- Chart & Analytics Tokens --- */
  --palster-chart-primary: #2563EB;
  --palster-chart-secondary: #38BDF8;
  --palster-chart-accent: #45BD62;
  --palster-chart-warning: #F7B125;
  --palster-chart-purple: #9333EA;

  /* --- Apple Spotlight Frosted Scrim --- */
  --palster-overlay-scrim: rgba(0, 0, 0, 0.45);
  --palster-overlay-light: rgba(255, 255, 255, 0.88);
  --palster-overlay-dark: rgba(0, 0, 0, 0.75);

  /* --- Spatial Grid (8px Base with 4px Half-Steps) --- */
  --palster-space-xxs: 2px;
  --palster-space-xs: 4px;
  --palster-space-sm: 8px;
  --palster-space-md: 12px;
  --palster-space-lg: 16px;
  --palster-space-xl: 20px;
  --palster-space-xxl: 24px;
  --palster-space-mega: 32px;

  /* --- Raycast & Apple Squircle Radii --- */
  --palster-radius-xs: 4px;
  --palster-radius-sm: 6px;
  --palster-radius-btn: 8px;
  --palster-radius-md: 8px;
  --palster-radius-dropdown: 12px;
  --palster-radius-lg: 12px;
  --palster-radius-card: 14px;
  --palster-radius-xl: 16px;
  --palster-radius-modal: 16px;
  --palster-radius-round: 24px;
  --palster-radius-full: 9999px;

  /* --- Raycast & Apple Ambient Diffusion Shadows --- */
  --palster-shadow-card: 0 1px 3px rgba(0, 0, 0, 0.05), 0 0 0 1px rgba(0, 0, 0, 0.04);
  --palster-shadow-card-hover: 0 8px 24px -4px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.06);
  --palster-shadow-dropdown-drop: 0 18px 48px -10px rgba(0, 0, 0, 0.14);
  --palster-shadow-dropdown: var(--palster-shadow-dropdown-drop), 0 0 0 1px var(--palster-card-edge);
  /* Windows: the drop alone for a window with its own border, the drop plus
     the card edge as a ring for one without. */
  --palster-shadow-modal-drop: 0 28px 72px -16px rgba(0, 0, 0, 0.22);
  --palster-shadow-modal: var(--palster-shadow-modal-drop), 0 0 0 1px var(--palster-card-edge);
  --palster-shadow-reaction: 0 6px 20px rgba(0, 0, 0, 0.14);
  --palster-shadow-tooltip: 0 4px 12px rgba(0, 0, 0, 0.12);
  --palster-shadow-nav: 0 1px 2px rgba(0, 0, 0, 0.05);

  /* --- Typography Scale & Native Apple / Inter Font Stacks --- */
  --palster-font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "SF Pro", "Inter", -system-ui, sans-serif;
  --palster-font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro", "Inter", -system-ui, sans-serif;
  --palster-font-family: var(--palster-font-sans);
  --palster-font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  /* --- Optical Letter-Spacing Tracking --- */
  --palster-tracking-display: -0.035em;
  --palster-tracking-tightest: -0.025em;
  --palster-tracking-tight: -0.015em;
  --palster-tracking-snug: -0.008em;
  --palster-tracking-body: -0.006em;
  --palster-tracking-mono: 0.025em;

  /* One title for every page (Palsenger, Spaces, Discover, Mart, Campfire,
     Notifications, Settings, Scenes): same size on phones and desktop. */
  --palster-page-title-size: 22px;
  --palster-page-title-weight: 700;
  --palster-page-title-tracking: -0.02em;
  --palster-page-title-leading: 1.2;

  /* --- Controls (2026-10-17): every button is drawn from this scale and
     reaches 44px under a finger through an invisible ::after centred on it
     (top/bottom: calc((100% - var(--palster-ctl-reach)) / 2)), never by being
     drawn 44 (invariant 5). Tab bars, FABs and the camera shutter keep their own. --- */
  --palster-ctl-h-xs: 24px;   /* inline actions inside a row: Reply, a count */
  --palster-ctl-h-sm: 28px;   /* chips, filters, segmented options */
  --palster-ctl-h: 32px;      /* every ordinary button */
  --palster-ctl-h-lg: 36px;   /* the one main action of a hero, dock or sheet */
  --palster-ctl-pad-x: 12px;
  --palster-ctl-pad-x-sm: 10px;
  --palster-ctl-font: 13px;
  --palster-ctl-font-sm: 12.5px;
  --palster-ctl-gap: 6px;
  --palster-ctl-icon: 16px;
  --palster-ctl-reach: 44px;

  --palster-type-title-large-size: 26px;
  --palster-type-title-large-lh: 32px;
  --palster-type-title-large-weight: 700;

  --palster-type-title-medium-size: 19px;
  --palster-type-title-medium-lh: 24px;
  --palster-type-title-medium-weight: 600;

  --palster-type-title-small-size: 16px;
  --palster-type-title-small-lh: 20px;
  --palster-type-title-small-weight: 600;

  --palster-type-body-regular-size: 14px;
  --palster-type-body-regular-lh: 20px;
  --palster-type-body-regular-weight: 400;

  --palster-type-body-dense-size: 13px;
  --palster-type-body-dense-lh: 18px;
  --palster-type-body-dense-weight: 400;

  --palster-type-caption-size: 12px;
  --palster-type-caption-lh: 16px;
  --palster-type-caption-weight: 400;

  --palster-type-badge-size: 11px;
  --palster-type-badge-lh: 15px;
  --palster-type-badge-weight: 600;

  /* --- Raycast & Spotlight Frosted Acrylic Glassmorphism Tokens --- */
  --palster-glass-bg: rgba(255, 255, 255, 0.86);
  --palster-glass-bg-subtle: rgba(255, 255, 255, 0.65);
  --palster-glass-border: rgba(0, 0, 0, 0.08);
  --palster-glass-border-subtle: rgba(0, 0, 0, 0.05);
  --palster-glass-blur: blur(28px) saturate(190%);
  --palster-glass-scrim-blur: blur(12px);
  --palster-glass-shadow: 0 20px 50px -12px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.06);
  --palster-glass-pill-shadow: 0 2px 8px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  --palster-glow-teal: 0 0 20px rgba(4,124,128, 0.18);
  --palster-glow-gold: 0 0 20px rgba(217, 119, 6, 0.18);

  /* --- Raycast Keycap Badges (<kbd>) --- */
  --palster-kbd-bg: rgba(0, 0, 0, 0.05);
  --palster-kbd-border: rgba(0, 0, 0, 0.12);
  --palster-kbd-color: var(--palster-text-secondary);
  --palster-kbd-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.15);

  /* --- Transitions & Apple Spring Curves --- */
  --palster-spring-modal: cubic-bezier(0.16, 1, 0.3, 1);
  --palster-spring-press: cubic-bezier(0.2, 0, 0, 1);
  --palster-motion-spring-modal: 240ms cubic-bezier(0.16, 1, 0.3, 1);
  --palster-motion-spring-press: 100ms cubic-bezier(0.2, 0, 0, 1);
  --palster-transition-fast: 140ms cubic-bezier(0.16, 1, 0.3, 1);
  --palster-transition-normal: 220ms cubic-bezier(0.16, 1, 0.3, 1);
  --palster-transition-spring: 240ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   DARK THEME OVERRIDES (Raycast macOS Window Tint)
   ========================================================================== */
[data-theme="dark"] {
  --palster-brand-primary: #06A6A3;
  --palster-brand-hover: #047C80;
  --palster-brand-pressed: #005257;
  --palster-brand-fill: #047C80;
  --palster-brand-fill-hover: #04666A;
  --palster-brand-subtle: rgba(6,166,163, 0.12);
  --palster-brand-translucent: rgba(6,166,163, 0.14);
  --palster-brand-translucent-hover: rgba(6,166,163, 0.22);
  --palster-brand-translucent-border: rgba(6,166,163, 0.28);
  --palster-brand-translucent-text: #06A6A3;
  --palster-highlight-bg: rgba(255, 255, 255, 0.10);
  --palster-highlight-bg-hover: rgba(255, 255, 255, 0.15);
  --palster-highlight-text: #F5F5F7;
  --palster-highlight-border: rgba(255, 255, 255, 0.18);
  --palster-skel: rgba(255, 255, 255, 0.07);
  --palster-skel-shine: rgba(255, 255, 255, 0.13);

  /* A fill under white text: #06A6A3 gave 3.00:1. */
  --palster-btn-natural: #047C80;
  --palster-btn-natural-hover: #04666A;
  --palster-btn-natural-pressed: #005257;
  --palster-btn-natural-border: rgba(6,166,163, 0.28);
  --palster-btn-natural-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 3px rgba(0, 0, 0, 0.35);

  --palster-surface-wash: #0D0E11;
  --palster-surface-card: rgba(26, 28, 34, 0.82);
  --palster-surface-hover: rgba(255, 255, 255, 0.06);
  --palster-surface-active: rgba(255, 255, 255, 0.10);
  --palster-surface-overlay: rgba(22, 23, 28, 0.94);
  --palster-surface-modal: rgba(22, 23, 28, 0.97);
  --palster-surface-palneum-nav: #121317;

  --palster-border-subtle: rgba(255, 255, 255, 0.12);
  --palster-border-soft: rgba(255, 255, 255, 0.08);
  --palster-border-strong: rgba(255, 255, 255, 0.22);
  --palster-border-divider: rgba(255, 255, 255, 0.07);
  --palster-card-edge: rgba(255, 255, 255, 0.08);
  --palster-card-shadow: 0 1px 2px rgba(0, 0, 0, 0.32);
  --palster-card-shadow-hover: 0 1px 2px rgba(0, 0, 0, 0.32), 0 12px 32px -6px rgba(0, 0, 0, 0.6);
  --palster-specular-top: inset 0 1px 0 rgba(255, 255, 255, 0.16);
  --palster-specular-hairline: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 0 0 1px rgba(255, 255, 255, 0.08);

  --palster-text-primary: #F5F5F7;
  --palster-text-secondary: #A8A8AD;
  /* #6E6E73 was 3.1-3.8:1 on the dark surfaces; #8E8E93 clears 4.5:1 on each. */
  --palster-text-tertiary: #98989E;
  --palster-text-inverse: #0D0E11;
  --palster-text-brand: #06A6A3;
  --palster-reaction-like: #06A6A3;
  --palster-reaction-love: #FB7185;
  --palster-reaction-wow: #A78BFA;
  --palster-reaction-haha: #F59E0B;
  --palster-reaction-sad: #818CF8;
  --palster-reaction-nah: #F97316;

  --palster-chart-primary: #38BDF8;
  --palster-chart-secondary: #38BDF8;
  --palster-chart-accent: #4ADE80;
  --palster-chart-warning: #FBBF24;
  --palster-warning-text: #F59E0B;
  --palster-chart-purple: #A855F7;

  --palster-overlay-scrim: rgba(0, 0, 0, 0.45);
  --palster-overlay-light: rgba(28, 30, 36, 0.88);

  --palster-shadow-card: 0 2px 8px -2px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.07);
  --palster-shadow-card-hover: 0 12px 32px -6px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.12);
  --palster-shadow-dropdown-drop: 0 22px 56px -12px rgba(0, 0, 0, 0.65);
  --palster-shadow-dropdown: var(--palster-shadow-dropdown-drop), 0 0 0 1px var(--palster-card-edge);
  --palster-shadow-modal-drop: 0 32px 80px -16px rgba(0, 0, 0, 0.75);
  --palster-shadow-modal: var(--palster-shadow-modal-drop), 0 0 0 1px var(--palster-card-edge);
  --palster-shadow-reaction: 0 6px 20px rgba(0, 0, 0, 0.55);
  --palster-shadow-nav: 0 2px 4px rgba(0, 0, 0, 0.4);

  --palster-glass-bg: rgba(22, 23, 27, 0.82);
  --palster-glass-bg-subtle: rgba(26, 28, 34, 0.60);
  --palster-glass-border: rgba(255, 255, 255, 0.12);
  --palster-glass-border-subtle: rgba(255, 255, 255, 0.07);
  --palster-glass-blur: blur(32px) saturate(210%);
  --palster-glass-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.10);
  --palster-glass-pill-shadow: 0 4px 16px -2px rgba(59, 130, 246, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  --palster-glow-teal: 0 0 24px rgba(6,166,163, 0.25);
  --palster-glow-gold: 0 0 24px rgba(245, 158, 11, 0.25);

  --palster-kbd-bg: rgba(255, 255, 255, 0.08);
  --palster-kbd-border: rgba(255, 255, 255, 0.15);
  --palster-kbd-color: var(--palster-text-secondary);
  --palster-kbd-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.3);
}

/* Up to 899px windows are sheets and full screens: solid, as the composer,
   comments and Palsenger's sheets already are. Frosted glass over a dark
   scrim turned them grey and let the page show through. */
@media (max-width: 899px) {
  :root { --palster-surface-modal: #FFFFFF; }
  [data-theme="dark"] { --palster-surface-modal: #16171C; }
}

/* One sweep for every skeleton: background-size 300% with the light in the
   middle third, the light crossing left to right. */
@keyframes palster-skel { from { background-position: 100% 0; } to { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) {
  :root { --palster-skel-anim: none; }
}

/* Global Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Android Chrome flashes a cyan box (rgba(51,181,229,.4)) over anything tapped;
   it is inherited, so one rule clears it everywhere. Presses show their own
   feedback (scale, wash). */
html {
  background-color: var(--palster-surface-wash);
  color-scheme: light dark;
  -webkit-tap-highlight-color: transparent;
}

html[data-theme="dark"] {
  color-scheme: dark;
}

html[data-theme="light"] {
  color-scheme: light;
}

/* A window is open over the page (js/page-lock.js): the page holds still where
   it is, and keeps its scrollbar's room so nothing shifts sideways. */
html.palster-page-locked {
  overflow: hidden !important;
  overscroll-behavior: none;
}
html.palster-page-locked-gutter {
  scrollbar-gutter: stable;
}

body {
  font-family: var(--palster-font-family);
  background-color: var(--palster-surface-wash);
  color: var(--palster-text-primary);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  /* A word too long for its line still breaks, but only once it truly can't
     fit: break-word never shrinks a box. (word-break: break-word did, and
     every squeezed button and label broke mid-word: "Delet/e", "Sa/ve".) */
  overflow-wrap: break-word;
}

/* Members' own words in a box sized to its content -- names, titles, places,
   taglines -- may break anywhere, so a long handle or a pasted link wraps
   instead of pushing the box wider than the screen. Fixed labels inside them
   stay whole. Found by putting 24- and 80-character words into every view at
   390px and 1440px, 2026-10-14. */
.dsc-row-title,
.dsc-card-title,
.dsc-pcard-name,
.dsc-post-name,
.sp-head-name,
.sp-post-title,
.sp-post-by,
.sp-post-topic,
.sp-level-text strong,
.scene-creator-name,
.cx-name,
.cx-meta,
.pf-handle,
.pf-meta-item > span,
.pg-line,
.ev-note,
.bento-passport-role,
.saved-item-card > div:first-child > div > span:first-of-type {
  overflow-wrap: anywhere;
  min-width: 0;
}

.dsc-tag,
.dsc-live-pill,
.sp-tag {
  white-space: nowrap;
}

input, button, textarea, select {
  font-family: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  border: none;
  background: none;
  cursor: pointer;
}

/* Custom Sleek Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--palster-border-subtle);
  border-radius: var(--palster-radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--palster-border-strong);
}

/* Universal Raycast & macOS Keycap Element */
kbd, .palster-kbd {
  font-family: var(--palster-font-mono);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: var(--palster-tracking-mono);
  color: var(--palster-kbd-color);
  background-color: var(--palster-kbd-bg);
  border: 1px solid var(--palster-kbd-border);
  box-shadow: var(--palster-kbd-shadow);
  border-radius: 5px;
  padding: 2px 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 20px;
  user-select: none;
  vertical-align: middle;
}

