/* ROSE OS runtime styles.
   Recreates the look of the dashboard runtime ROSE OS was built on:
   a Tailwind-style reset, the design tokens (values measured from the live
   dashboard in light and dark), and the few classes the runtime itself styles
   (#dash-root, .dash-select, .dash-skeleton). Page styles live in /page. */

/* ---------- fonts (closest open matches for Anthropic Sans / Serif) ---------- */
@import url("https://fonts.googleapis.com/css2?family=Inter:opsz,wght@14..32,300..800&family=Source+Serif+4:opsz,wght@8..60,300..800&display=swap");

/* ---------- reset (Tailwind preflight) ---------- */
*, ::before, ::after { box-sizing: border-box; border-width: 0; border-style: solid; border-color: var(--color-border-line); }
::before, ::after { --tw-content: ''; }
html, :host { line-height: 1.5; -webkit-text-size-adjust: 100%; -moz-tab-size: 4; tab-size: 4; font-family: var(--cds-font-sans); font-feature-settings: normal; font-variation-settings: normal; -webkit-tap-highlight-color: transparent; }
body { margin: 0; line-height: inherit; }
hr { height: 0; color: inherit; border-top-width: 1px; }
abbr:where([title]) { text-decoration: underline dotted; }
h1, h2, h3, h4, h5, h6 { font-size: inherit; font-weight: inherit; }
a { color: inherit; text-decoration: inherit; }
b, strong { font-weight: bolder; }
code, kbd, samp, pre { font-family: "SF Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace; font-feature-settings: normal; font-variation-settings: normal; font-size: 1em; }
small { font-size: 80%; }
sub, sup { font-size: 75%; line-height: 0; position: relative; vertical-align: baseline; }
sub { bottom: -0.25em; } sup { top: -0.5em; }
table { text-indent: 0; border-color: inherit; border-collapse: collapse; }
button, input, optgroup, select, textarea { font-family: inherit; font-feature-settings: inherit; font-variation-settings: inherit; font-size: 100%; font-weight: inherit; line-height: inherit; letter-spacing: inherit; color: inherit; margin: 0; padding: 0; }
button, select { text-transform: none; }
button, input:where([type='button']), input:where([type='reset']), input:where([type='submit']) { -webkit-appearance: button; background-color: transparent; background-image: none; }
:-moz-focusring { outline: auto; }
:-moz-ui-invalid { box-shadow: none; }
progress { vertical-align: baseline; }
::-webkit-inner-spin-button, ::-webkit-outer-spin-button { height: auto; }
[type='search'] { -webkit-appearance: textfield; outline-offset: -2px; }
::-webkit-search-decoration { -webkit-appearance: none; }
::-webkit-file-upload-button { -webkit-appearance: button; font: inherit; }
summary { display: list-item; }
blockquote, dl, dd, h1, h2, h3, h4, h5, h6, hr, figure, p, pre { margin: 0; }
fieldset { margin: 0; padding: 0; }
legend { padding: 0; }
ol, ul, menu { list-style: none; margin: 0; padding: 0; }
dialog { padding: 0; }
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { opacity: 1; color: var(--cds-text-muted); }
button, [role="button"] { cursor: pointer; }
:disabled { cursor: default; }
img, svg, video, canvas, audio, iframe, embed, object { display: block; vertical-align: middle; }
img, video { max-width: 100%; height: auto; }
[hidden]:where(:not([hidden='until-found'])) { display: none; }

/* ---------- tokens shared by both themes ---------- */
.cds-root {
  --cds-font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "PingFang SC", "PingFang TC", "Hiragino Sans", "Apple SD Gothic Neo", sans-serif;
  --cds-font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --font-anthropic-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-anthropic-serif: "Source Serif 4", ui-serif, Georgia, "Times New Roman", serif;
  --cds-font-size-caption: .75rem;
  --cds-font-size-footnote: .8125rem;
  --cds-font-size-body: .875rem;
  --cds-font-size-heading: .9375rem;
  --cds-font-size-title: 1.375rem;
  --cds-font-size-prose: 1rem;
  --cds-font-weight-regular: 400;
  --cds-font-weight-medium: 500;
  --cds-font-weight-semibold: 580;
  --cds-font-weight-bold: 600;
  --cds-gap-xs: .5rem; --cds-gap-sm: .75rem; --cds-gap-md: 1rem; --cds-gap-lg: 1.75rem; --cds-gap-xl: 2.5rem;
  --cds-pad-xs: .375rem; --cds-pad-sm: .5rem; --cds-pad-md: .75rem; --cds-pad-lg: 1rem; --cds-pad-xl: 1.5rem;
  --cds-radius: 6px;
  /* ROSE OS refresh (Nov 2026): one type scale, three radii, a 4px spacing grid.
     Pages move onto these as they're restyled; see the refresh canvas for the look. */
  --fs-xs: 12px;   /* meta, pills, labels */
  --fs-sm: 13px;   /* body */
  --fs-md: 14px;   /* row titles */
  --fs-lg: 16px;   /* section headings */
  --fs-xl: 20px;   /* detail titles (serif) */
  --fs-2xl: 28px;  /* page titles (serif) */
  --radius-sm: 6px;    /* controls */
  --radius-md: 10px;   /* cards */
  --radius-pill: 999px;
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 24px; --space-6: 32px;
  --cds-dur-fast: 60ms; --cds-dur-base: .2s; --cds-dur-slow: .45s;
  --cds-ease-out: cubic-bezier(.165, .84, .44, 1);
  --cds-shadow-sm: 0 1px 2px 0 #0000000d;
  --cds-shadow-md: 0 4px 6px -1px #0000001a, 0 2px 4px -2px #0000001a;
  --cds-shadow-lg: 0 10px 15px -3px #0000001a, 0 4px 6px -4px #0000001a;
  --cds-chart-status-critical: #d03b3b;
  --cds-chart-status-good: #0ca30c;
  --cds-chart-status-warning: #fab219;
  --cds-chart-status-serious: #ec835a;
}

/* ---------- light ---------- */
/* .rc-light / .rc-dark are the page's own theme switch (Auto / ☀︎ / ☾); they reuse the same palette. */
.cds-root, .cds-root[data-theme="light"], .rc-light {
  color-scheme: light;
  --color-bg: #F7F6F3;          /* page */
  --color-panel: #FFFFFF;       /* cards, selected tabs */
  --color-sunken: #F0EEE9;      /* wells, hovers, segmented controls */
  --color-border-line: #E5E2DA; /* dividers */
  --color-line-strong: #D4D0C6; /* control borders */
  --color-fg: #1C1B19;          /* text */
  --color-fg-2: #4F4C46;        /* secondary text */
  --color-fg-muted: #6B675F;    /* muted text, labels */
  --color-accent: #A8355A;      /* primary action, selected */
  --color-accent-fg: #FFFFFF;
  --color-accent-soft: #F7E8ED;
  --color-ok: #1E6F47;   --color-ok-bg: #E5F2EA;    /* done, on track */
  --color-warn: #8A5300; --color-warn-bg: #FBEFD9;  /* needs attention */
  --color-bad: #B42318;  --color-bad-bg: #FCEBE9;   /* overdue, urgent */
  --color-info: #2353B8; --color-info-bg: #E8EEFB;  /* in progress */
  --shadow-card: 0 1px 2px rgb(28 27 25 / 6%), 0 1px 1px rgb(28 27 25 / 4%);
  /* chart series (platforms, shows): told apart by lightness as well as hue */
  --series-1: #A8355A; --series-2: #2353B8; --series-3: #4F4C46; --series-4: #9A958B; --series-muted: #C9C5BC;
  --cds-surface-0: #F7F6F3; --cds-surface-1: #FBFAF8; --cds-surface-2: #fff; --cds-surface-3: #fff;
  --cds-surface-panel: #fff; --cds-surface-popover: #fff;
  --cds-text-primary: #1C1B19; --cds-text-secondary: #4F4C46; --cds-text-muted: #6B675F;
  --cds-text-success: #1E6F47; --cds-text-warning: #8A5300; --cds-text-danger: #B42318; --cds-text-accent: #2353B8;
  --cds-border: #E5E2DA;
  --cds-border-strong: #D4D0C6;
  --cds-shadow-popover: 0 8px 24px #0000001f, 0 2px 6px #00000014;
  --cds-chart-categorical-1: #2a78d6; --cds-chart-categorical-2: #eb6834; --cds-chart-categorical-3: #1baf7a; --cds-chart-categorical-4: #eda100;
  --cds-chart-categorical-5: #e87ba4; --cds-chart-categorical-6: #008300; --cds-chart-categorical-7: #6250d6; --cds-chart-categorical-8: #e34948;
  --cds-chart-muted: #c3c2b7; --cds-chart-reference: #898781; --cds-chart-reference-tint: hsl(45 3% 52% / 15%);
  --cds-chart-grid: hsl(0 0% 4% / 10%); --cds-chart-axis: #c3c2b7; --cds-chart-baseline: #c3c2b7;
}

/* ---------- dark ---------- */
.cds-root[data-theme="dark"], .rc-dark {
  color-scheme: dark;
  --color-bg: #121211;
  --color-panel: #1A1A18;
  --color-sunken: #222220;
  --color-border-line: #2C2B28;
  --color-line-strong: #3A3935;
  --color-fg: #EEEDE9;
  --color-fg-2: #C2BFB8;
  --color-fg-muted: #97938B;
  --color-accent: #E97F9D;
  --color-accent-fg: #1A0E12;
  --color-accent-soft: #3A1E28;
  --color-ok: #63C792;   --color-ok-bg: #15301F;
  --color-warn: #EBAE4A; --color-warn-bg: #33260E;
  --color-bad: #F2857A;  --color-bad-bg: #3B1A17;
  --color-info: #86A9F5; --color-info-bg: #18254A;
  --shadow-card: none;
  --series-1: #E97F9D; --series-2: #86A9F5; --series-3: #C2BFB8; --series-4: #6E6A62; --series-muted: #3A3935;
  --cds-surface-0: #121211; --cds-surface-1: #161615; --cds-surface-2: #1A1A18; --cds-surface-3: #222220;
  --cds-surface-panel: #1A1A18; --cds-surface-popover: #222220;
  --cds-text-primary: #EEEDE9; --cds-text-secondary: #C2BFB8; --cds-text-muted: #97938B;
  --cds-text-success: #63C792; --cds-text-warning: #EBAE4A; --cds-text-danger: #F2857A; --cds-text-accent: #86A9F5;
  --cds-border: #2C2B28;
  --cds-border-strong: #3A3935;
  --cds-shadow-popover: 0 8px 24px #00000052, 0 2px 6px #0003;
  --cds-chart-categorical-1: #3987e5; --cds-chart-categorical-2: #d95926; --cds-chart-categorical-3: #199e70; --cds-chart-categorical-4: #c98500;
  --cds-chart-categorical-5: #d55181; --cds-chart-categorical-6: #0ca30c; --cds-chart-categorical-7: #9085e9; --cds-chart-categorical-8: #e66767;
  --cds-chart-muted: #5f5e5a; --cds-chart-reference: #97958d; --cds-chart-reference-tint: hsl(48 4% 57% / 15%);
  --cds-chart-grid: hsl(0 0% 100% / 10%); --cds-chart-axis: #383835; --cds-chart-baseline: #383835;
}

/* ---------- page frame ---------- */
html.cds-root { background-color: var(--color-bg); }
body { background-color: var(--color-bg); color: var(--color-fg); font-size: 16px; line-height: 24px; }

#dash-root { color: var(--color-fg); font-size: 14px; line-height: 1.45; }
:where(#dash-root:not(:empty)) { padding: var(--dash-gutter, clamp(var(--cds-pad-md), 4%, var(--cds-pad-xl))); }
:where(#dash-root[data-dash-one-writer] a[href]:not([role])) { text-underline-offset: 0.15em; text-decoration: underline; }

.dash-select {
  appearance: none;
  border: 1px solid var(--color-border-line);
  border-radius: var(--cds-radius);
  background: var(--color-panel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 20 20'%3E%3Cpath fill='%23808080' d='M14.128 7.165a.502.502 0 0 1 .744.67l-4.5 5-.078.07a.5.5 0 0 1-.666-.07l-4.5-5-.06-.082a.501.501 0 0 1 .729-.656l.075.068L10 11.752z'/%3E%3C/svg%3E") no-repeat right .5em center;
  max-width: 100%;
  color: var(--color-fg);
  font: inherit;
  text-overflow: ellipsis;
  padding: 0.35em 2em 0.35em 0.75em;
}
.dash-select:disabled { opacity: 0.55; }

.dash-skeleton { -webkit-text-fill-color: transparent !important; }
.dash-skeleton, .dash-skeleton::before {
  background-image: linear-gradient(color-mix(in srgb, currentcolor 13%, transparent 87%) 0px, color-mix(in srgb, currentcolor 13%, transparent 87%) 0px) !important;
}
.dash-skeleton > * { visibility: hidden !important; }
.dash-skeleton:empty::before { content: ""; width: 3ch; display: inline-block; }
.dash-skeleton:not(:empty, :has(> :not(span, small, b, strong, em, i, sup, sub))) { background-image: none !important; }
.dash-skeleton:not(:empty, :has(> :not(span, small, b, strong, em, i, sup, sub)))::before {
  vertical-align: -0.1em; border-radius: .3em; width: 5ch; height: 0.9em; margin-inline-end: -1em;
  content: "" !important; display: inline-block !important;
}

/* ---------- app bar (stands in for the Claude viewer's top bar) ---------- */
.ros-bar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px; background: var(--color-bg); border-bottom: 1px solid var(--color-border-line); font-family: var(--cds-font-sans); font-size: 13px; color: var(--color-fg-muted); }
.ros-bar b { color: var(--color-fg); font-weight: 500; }
.ros-bar .sp { flex: 1; }
.ros-bar button { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 8px; color: var(--color-fg-muted); }
.ros-bar button:hover { background: var(--color-panel); color: var(--color-fg); }
.ros-bar .seg { display: inline-flex; border: 1px solid var(--color-border-line); border-radius: 8px; overflow: hidden; }
.ros-bar .seg button { border-radius: 0; height: 26px; padding: 0 8px; }
.ros-bar .seg button[aria-pressed="true"] { background: var(--color-panel); color: var(--color-fg); }
.ros-upd { display: inline-flex; align-items: center; gap: 2px; align-self: center; font-family: var(--cds-font-sans); font-size: 12px; color: var(--color-fg-muted); white-space: nowrap; }
.ros-upd .rf, .ros-out { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--color-fg-muted); cursor: pointer; }
.ros-upd .rf:hover, .ros-out:hover { background: var(--color-panel); color: var(--color-fg); }
.ros-out { align-self: center; flex: none; }
@media (max-width: 560px) { .ros-upd .upd { display: none; } }
.ros-err { position: fixed; right: 12px; bottom: 12px; z-index: 40; max-width: 420px; padding: 10px 12px; border-radius: 8px; background: var(--cds-surface-popover); box-shadow: var(--cds-shadow-popover); font: 12px/1.4 var(--cds-font-sans); color: var(--color-bad); white-space: pre-wrap; }
