*, ::before, ::after {
  --tw-border-spacing-x: 0;
  --tw-border-spacing-y: 0;
  --tw-translate-x: 0;
  --tw-translate-y: 0;
  --tw-rotate: 0;
  --tw-skew-x: 0;
  --tw-skew-y: 0;
  --tw-scale-x: 1;
  --tw-scale-y: 1;
  --tw-pan-x:  ;
  --tw-pan-y:  ;
  --tw-pinch-zoom:  ;
  --tw-scroll-snap-strictness: proximity;
  --tw-gradient-from-position:  ;
  --tw-gradient-via-position:  ;
  --tw-gradient-to-position:  ;
  --tw-ordinal:  ;
  --tw-slashed-zero:  ;
  --tw-numeric-figure:  ;
  --tw-numeric-spacing:  ;
  --tw-numeric-fraction:  ;
  --tw-ring-inset:  ;
  --tw-ring-offset-width: 0px;
  --tw-ring-offset-color: #fff;
  --tw-ring-color: rgb(59 130 246 / 0.5);
  --tw-ring-offset-shadow: 0 0 #0000;
  --tw-ring-shadow: 0 0 #0000;
  --tw-shadow: 0 0 #0000;
  --tw-shadow-colored: 0 0 #0000;
  --tw-blur:  ;
  --tw-brightness:  ;
  --tw-contrast:  ;
  --tw-grayscale:  ;
  --tw-hue-rotate:  ;
  --tw-invert:  ;
  --tw-saturate:  ;
  --tw-sepia:  ;
  --tw-drop-shadow:  ;
  --tw-backdrop-blur:  ;
  --tw-backdrop-brightness:  ;
  --tw-backdrop-contrast:  ;
  --tw-backdrop-grayscale:  ;
  --tw-backdrop-hue-rotate:  ;
  --tw-backdrop-invert:  ;
  --tw-backdrop-opacity:  ;
  --tw-backdrop-saturate:  ;
  --tw-backdrop-sepia:  ;
  --tw-contain-size:  ;
  --tw-contain-layout:  ;
  --tw-contain-paint:  ;
  --tw-contain-style:  ;
}

::backdrop {
  --tw-border-spacing-x: 0;
  --tw-border-spacing-y: 0;
  --tw-translate-x: 0;
  --tw-translate-y: 0;
  --tw-rotate: 0;
  --tw-skew-x: 0;
  --tw-skew-y: 0;
  --tw-scale-x: 1;
  --tw-scale-y: 1;
  --tw-pan-x:  ;
  --tw-pan-y:  ;
  --tw-pinch-zoom:  ;
  --tw-scroll-snap-strictness: proximity;
  --tw-gradient-from-position:  ;
  --tw-gradient-via-position:  ;
  --tw-gradient-to-position:  ;
  --tw-ordinal:  ;
  --tw-slashed-zero:  ;
  --tw-numeric-figure:  ;
  --tw-numeric-spacing:  ;
  --tw-numeric-fraction:  ;
  --tw-ring-inset:  ;
  --tw-ring-offset-width: 0px;
  --tw-ring-offset-color: #fff;
  --tw-ring-color: rgb(59 130 246 / 0.5);
  --tw-ring-offset-shadow: 0 0 #0000;
  --tw-ring-shadow: 0 0 #0000;
  --tw-shadow: 0 0 #0000;
  --tw-shadow-colored: 0 0 #0000;
  --tw-blur:  ;
  --tw-brightness:  ;
  --tw-contrast:  ;
  --tw-grayscale:  ;
  --tw-hue-rotate:  ;
  --tw-invert:  ;
  --tw-saturate:  ;
  --tw-sepia:  ;
  --tw-drop-shadow:  ;
  --tw-backdrop-blur:  ;
  --tw-backdrop-brightness:  ;
  --tw-backdrop-contrast:  ;
  --tw-backdrop-grayscale:  ;
  --tw-backdrop-hue-rotate:  ;
  --tw-backdrop-invert:  ;
  --tw-backdrop-opacity:  ;
  --tw-backdrop-saturate:  ;
  --tw-backdrop-sepia:  ;
  --tw-contain-size:  ;
  --tw-contain-layout:  ;
  --tw-contain-paint:  ;
  --tw-contain-style:  ;
}

/*
! tailwindcss v3.4.19 | MIT License | https://tailwindcss.com
*/

/*
1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)
2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116)
*/

*,
::before,
::after {
  box-sizing: border-box;
  /* 1 */
  border-width: 0;
  /* 2 */
  border-style: solid;
  /* 2 */
  border-color: var(--gray-200);
  /* 2 */
}

::before,
::after {
  --tw-content: '';
}

/*
1. Use a consistent sensible line-height in all browsers.
2. Prevent adjustments of font size after orientation changes in iOS.
3. Use a more readable tab size.
4. Use the user's configured `sans` font-family by default.
5. Use the user's configured `sans` font-feature-settings by default.
6. Use the user's configured `sans` font-variation-settings by default.
7. Disable tap highlights on iOS
*/

html,
:host {
  line-height: 1.5;
  /* 1 */
  -webkit-text-size-adjust: 100%;
  /* 2 */
  -moz-tab-size: 4;
  /* 3 */
  -o-tab-size: 4;
     tab-size: 4;
  /* 3 */
  font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  /* 4 */
  font-feature-settings: normal;
  /* 5 */
  font-variation-settings: normal;
  /* 6 */
  -webkit-tap-highlight-color: transparent;
  /* 7 */
}

/*
1. Remove the margin in all browsers.
2. Inherit line-height from `html` so users can set them as a class directly on the `html` element.
*/

body {
  margin: 0;
  /* 1 */
  line-height: inherit;
  /* 2 */
}

/*
1. Add the correct height in Firefox.
2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655)
3. Ensure horizontal rules are visible by default.
*/

hr {
  height: 0;
  /* 1 */
  color: inherit;
  /* 2 */
  border-top-width: 1px;
  /* 3 */
}

/*
Add the correct text decoration in Chrome, Edge, and Safari.
*/

abbr:where([title]) {
  -webkit-text-decoration: underline dotted;
          text-decoration: underline dotted;
}

/*
Remove the default font size and weight for headings.
*/

h1,
h2,
h3,
h4,
h5,
h6 {
  font-size: inherit;
  font-weight: inherit;
}

/*
Reset links to optimize for opt-in styling instead of opt-out.
*/

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

/*
Add the correct font weight in Edge and Safari.
*/

b,
strong {
  font-weight: bolder;
}

/*
1. Use the user's configured `mono` font-family by default.
2. Use the user's configured `mono` font-feature-settings by default.
3. Use the user's configured `mono` font-variation-settings by default.
4. Correct the odd `em` font sizing in all browsers.
*/

code,
kbd,
samp,
pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  /* 1 */
  font-feature-settings: normal;
  /* 2 */
  font-variation-settings: normal;
  /* 3 */
  font-size: 1em;
  /* 4 */
}

/*
Add the correct font size in all browsers.
*/

small {
  font-size: 80%;
}

/*
Prevent `sub` and `sup` elements from affecting the line height in all browsers.
*/

sub,
sup {
  font-size: 75%;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}

sub {
  bottom: -0.25em;
}

sup {
  top: -0.5em;
}

/*
1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297)
2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016)
3. Remove gaps between table borders by default.
*/

table {
  text-indent: 0;
  /* 1 */
  border-color: inherit;
  /* 2 */
  border-collapse: collapse;
  /* 3 */
}

/*
1. Change the font styles in all browsers.
2. Remove the margin in Firefox and Safari.
3. Remove default padding in all browsers.
*/

button,
input,
optgroup,
select,
textarea {
  font-family: inherit;
  /* 1 */
  font-feature-settings: inherit;
  /* 1 */
  font-variation-settings: inherit;
  /* 1 */
  font-size: 100%;
  /* 1 */
  font-weight: inherit;
  /* 1 */
  line-height: inherit;
  /* 1 */
  letter-spacing: inherit;
  /* 1 */
  color: inherit;
  /* 1 */
  margin: 0;
  /* 2 */
  padding: 0;
  /* 3 */
}

/*
Remove the inheritance of text transform in Edge and Firefox.
*/

button,
select {
  text-transform: none;
}

/*
1. Correct the inability to style clickable types in iOS and Safari.
2. Remove default button styles.
*/

button,
input:where([type='button']),
input:where([type='reset']),
input:where([type='submit']) {
  -webkit-appearance: button;
  /* 1 */
  background-color: transparent;
  /* 2 */
  background-image: none;
  /* 2 */
}

/*
Use the modern Firefox focus style for all focusable elements.
*/

:-moz-focusring {
  outline: auto;
}

/*
Remove the additional `:invalid` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737)
*/

:-moz-ui-invalid {
  box-shadow: none;
}

/*
Add the correct vertical alignment in Chrome and Firefox.
*/

progress {
  vertical-align: baseline;
}

/*
Correct the cursor style of increment and decrement buttons in Safari.
*/

::-webkit-inner-spin-button,
::-webkit-outer-spin-button {
  height: auto;
}

/*
1. Correct the odd appearance in Chrome and Safari.
2. Correct the outline style in Safari.
*/

[type='search'] {
  -webkit-appearance: textfield;
  /* 1 */
  outline-offset: -2px;
  /* 2 */
}

/*
Remove the inner padding in Chrome and Safari on macOS.
*/

::-webkit-search-decoration {
  -webkit-appearance: none;
}

/*
1. Correct the inability to style clickable types in iOS and Safari.
2. Change font properties to `inherit` in Safari.
*/

::-webkit-file-upload-button {
  -webkit-appearance: button;
  /* 1 */
  font: inherit;
  /* 2 */
}

/*
Add the correct display in Chrome and Safari.
*/

summary {
  display: list-item;
}

/*
Removes the default spacing and border for appropriate elements.
*/

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;
}

/*
Reset default styling for dialogs.
*/

dialog {
  padding: 0;
}

/*
Prevent resizing textareas horizontally by default.
*/

textarea {
  resize: vertical;
}

/*
1. Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300)
2. Set the default placeholder color to the user's configured gray 400 color.
*/

input::-moz-placeholder, textarea::-moz-placeholder {
  opacity: 1;
  /* 1 */
  color: var(--gray-400);
  /* 2 */
}

input::placeholder,
textarea::placeholder {
  opacity: 1;
  /* 1 */
  color: var(--gray-400);
  /* 2 */
}

/*
Set the default cursor for buttons.
*/

button,
[role="button"] {
  cursor: pointer;
}

/*
Make sure disabled buttons don't get the pointer cursor.
*/

:disabled {
  cursor: default;
}

/*
1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14)
2. Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210)
   This can trigger a poorly considered lint error in some tools but is included by design.
*/

img,
svg,
video,
canvas,
audio,
iframe,
embed,
object {
  display: block;
  /* 1 */
  vertical-align: middle;
  /* 2 */
}

/*
Constrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14)
*/

img,
video {
  max-width: 100%;
  height: auto;
}

/* Make elements with the HTML hidden attribute stay hidden by default */

[hidden]:where(:not([hidden="until-found"])) {
  display: none;
}

:root {
  --header-height: 72px;
  --mobile-nav-height: 64px;
}

/* Design tokens: the only place literal colors, radii and elevations live.
     Tailwind utilities (tailwind.config.cjs) resolve to the same variables, so a
     brand change or a future [data-theme=dark] block overrides values here only.
     Price-direction colors (--color-up*, --color-down*) are intentionally absent:
     core/market-colors.js owns them because canvas charts need them too. */

:root {
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  --primary-50: #eff6ff;
  --primary-100: #dbeafe;
  --primary-200: #bfdbfe;
  --primary-300: #93c5fd;
  --primary-400: #60a5fa;
  --primary-500: #3b82f6;
  --primary-600: #2563eb;
  --primary-700: #1d4ed8;
  --primary-800: #1e40af;
  --primary-900: #1e3a8a;
  --danger-50: #fef2f2;
  --danger-100: #fee2e2;
  --danger-600: #dc2626;
  --danger-700: #b91c1c;
  --warning-50: #fffbeb;
  --warning-100: #fef3c7;
  --warning-200: #fde68a;
  --warning-300: #fcd34d;
  --warning-600: #d97706;
  --warning-700: #b45309;
  --warning-800: #92400e;
  --ai-50: #f5f3ff;
  --ai-200: #ddd6fe;
  --ai-700: #6d28d9;
  --surface: #ffffff;
  --page-background: #f5f7fb;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  --radius-2xl: 16px;
  --radius-3xl: 24px;
  --shadow-sm: 0 1px 4px #0f172a0d;
  --shadow-md: 0 8px 24px #0f172a14;
  --shadow-lg: 0 20px 64px #0f172a26;
  --shadow-up: 0 -4px 20px #0f172a12;
  --backdrop: #0f172a66;
  --backdrop-subtle: #0f172a0a;
  /* AI attention motion: read by core/ai-attention.js as well as the CSS below. */
  --ai-motion-enter: 180ms;
  --ai-motion-ring: 200ms;
  --ai-motion-scan: 1.6s;
  --ai-motion-settle: 320ms;
  --ai-motion-dim: 200ms;
  --ai-motion-dwell: 900ms;
  --ai-motion-fly: 560ms;
  --ai-motion-land: 260ms;
  --ai-dim: #0f172a24;
  --ai-ease: cubic-bezier(.16, 1, .3, 1);
  --ai-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

body {
  margin: 0;
  background: var(--page-background);
  color: var(--gray-900);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  letter-spacing: -.025em;
}

button, a, summary, input, select, textarea {
  -webkit-tap-highlight-color: transparent;
}

button, a, summary {
  touch-action: manipulation;
}

button {
  transition: background-color 150ms, border-color 150ms, color 150ms;
}

button:disabled {
  cursor: not-allowed;
}

:focus-visible {
  outline: 3px solid var(--primary-300);
  outline-offset: 3px;
}

input:not([type=checkbox]):not([type=radio]), select, textarea {
  border-color: var(--gray-300);
  border-radius: var(--radius-lg);
  background-color: var(--surface);
  color: var(--gray-900);
}

input::-moz-placeholder, textarea::-moz-placeholder {
  color: var(--gray-500);
}

input::placeholder, textarea::placeholder {
  color: var(--gray-500);
}

input:focus, select:focus, textarea:focus {
  border-color: var(--primary-600);
}

td, .numeric {
  font-variant-numeric: tabular-nums;
}

 .\!numeric {
  font-variant-numeric: tabular-nums !important;
}

summary {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.\!container {
  width: 100% !important;
}

.container {
  width: 100%;
}

@media (min-width: 640px) {
  .\!container {
    max-width: 640px !important;
  }

  .container {
    max-width: 640px;
  }
}

@media (min-width: 768px) {
  .\!container {
    max-width: 768px !important;
  }

  .container {
    max-width: 768px;
  }
}

@media (min-width: 1024px) {
  .\!container {
    max-width: 1024px !important;
  }

  .container {
    max-width: 1024px;
  }
}

@media (min-width: 1280px) {
  .\!container {
    max-width: 1280px !important;
  }

  .container {
    max-width: 1280px;
  }
}

@media (min-width: 1536px) {
  .\!container {
    max-width: 1536px !important;
  }

  .container {
    max-width: 1536px;
  }
}

.panel {
  border-radius: var(--radius-2xl);
  border-width: 1px;
  border-color: var(--gray-200);
  background-color: var(--surface);
}

.page-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

@media (max-width: 1023px) {
  .portfolio-actions form.page-heading label {
    flex: 1 1 100%;
  }
}

.page-title {
  font-size: 1.5rem;
  line-height: 2rem;
  font-weight: 700;
  color: var(--gray-900);
}

.page-description {
  margin-top: 0.25rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  line-height: 1.625;
  color: var(--gray-500);
}

.section-title {
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 600;
  color: var(--gray-800);
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
  background-color: var(--primary-600);
  padding-left: 1rem;
  padding-right: 1rem;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 600;
  --tw-text-opacity: 1;
  color: rgb(255 255 255 / var(--tw-text-opacity, 1));
}

.primary-button:hover {
  background-color: var(--primary-700);
}

.primary-button:disabled {
  opacity: 0.5;
}

.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
  border-width: 1px;
  border-color: var(--gray-200);
  background-color: var(--surface);
  padding-left: 0.75rem;
  padding-right: 0.75rem;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  color: var(--gray-700);
}

.secondary-button:hover {
  background-color: var(--gray-50);
}

.secondary-button:disabled {
  opacity: 0.5;
}

/* Buy/sell are presentation roles, not fixed red/green or profit/loss.
     The shared convention also colors candles, execution markers and events. */

.trade-button {
  border-radius: var(--radius-md);
  padding-left: 0.75rem;
  padding-right: 0.75rem;
  padding-top: 0.375rem;
  padding-bottom: 0.375rem;
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 600;
  --tw-text-opacity: 1;
  color: rgb(255 255 255 / var(--tw-text-opacity, 1));
}

.trade-button:disabled {
  opacity: 0.4;
}

.trade-button-buy {
  background: var(--color-up);
}

.trade-button-sell {
  background: var(--color-down);
}

.trade-button:hover:not(:disabled) {
  filter: brightness(.9);
}

.segmented {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border-radius: var(--radius-xl);
  background-color: var(--gray-100);
  padding: 0.25rem;
}

.segmented > button {
  min-height: 32px;
  border-radius: var(--radius-lg);
  border-width: 0px;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
  padding-top: 0.375rem;
  padding-bottom: 0.375rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.data-table th {
  white-space: nowrap;
  background-color: var(--gray-50);
  padding-left: 0.75rem;
  padding-right: 0.75rem;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 500;
  color: var(--gray-500);
}

.data-table td {
  border-bottom-width: 1px;
  border-color: var(--gray-100);
  padding-left: 0.75rem;
  padding-right: 0.75rem;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.data-table tbody tr:last-child td {
  border-bottom-width: 0px;
}

.data-table tbody tr {
  transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}

.data-table tbody tr:hover {
  background-color: var(--gray-50);
}

.metric-card {
  border-radius: var(--radius-xl);
  background-color: var(--gray-50);
  padding: 1rem;
}

.metric-label {
  display: block;
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 500;
  color: var(--gray-500);
}

.metric-value {
  margin-top: 0.5rem;
  display: block;
  font-size: 1.25rem;
  line-height: 1.75rem;
  font-weight: 600;
  --tw-numeric-spacing: tabular-nums;
  font-variant-numeric: var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction);
  letter-spacing: -0.025em;
}

.report-content h1 {
  margin-top: 1.5rem;
  margin-bottom: 1rem;
  font-size: 1.5rem;
  line-height: 2rem;
  font-weight: 700;
}

.report-content h2 {
  margin-top: 1.25rem;
  margin-bottom: 0.75rem;
  font-size: 1.25rem;
  line-height: 1.75rem;
  font-weight: 700;
}

.report-content h3 {
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  font-size: 1.125rem;
  line-height: 1.75rem;
  font-weight: 700;
}

.report-content p {
  margin-top: 0.75rem;
  margin-bottom: 0.75rem;
  line-height: 1.625;
  color: var(--gray-700);
}

.report-content ul {
  margin-top: 0.75rem;
  margin-bottom: 0.75rem;
  list-style-position: outside;
  list-style-type: disc;
  padding-left: 1.25rem;
  color: var(--gray-700);
}

.report-content ol {
  margin-top: 0.75rem;
  margin-bottom: 0.75rem;
  list-style-position: outside;
  list-style-type: decimal;
  padding-left: 1.25rem;
  color: var(--gray-700);
}

.report-content li {
  margin-bottom: 0.25rem;
}

.report-content table {
  margin-top: 1rem;
  margin-bottom: 1rem;
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.report-content th, .report-content td {
  border-width: 1px;
  border-color: var(--gray-200);
  padding-left: 0.75rem;
  padding-right: 0.75rem;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.report-content th {
  background-color: var(--gray-50);
  font-weight: 600;
}

.report-content a {
  color: var(--primary-600);
}

.report-content a:hover {
  text-decoration-line: underline;
}

.report-content strong {
  font-weight: 700;
  color: var(--gray-900);
}

.report-content em {
  font-style: italic;
  color: var(--gray-800);
}

.report-content hr {
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
  border-top-width: 1px;
  border-color: var(--gray-200);
}

.report-content blockquote {
  margin-top: 0.75rem;
  margin-bottom: 0.75rem;
  border-top-right-radius: 0.25rem;
  border-bottom-right-radius: 0.25rem;
  border-left-width: 4px;
  border-color: var(--gray-300);
  background-color: var(--gray-50);
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
  padding-left: 1rem;
  font-style: italic;
  color: var(--gray-600);
}

.report-content code {
  border-radius: 0.25rem;
  background-color: var(--gray-100);
  padding-left: 0.375rem;
  padding-right: 0.375rem;
  padding-top: 0.125rem;
  padding-bottom: 0.125rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--gray-800);
}

.report-content pre {
  margin-top: 1rem;
  margin-bottom: 1rem;
  overflow-x: auto;
  border-radius: var(--radius-lg);
  background-color: var(--gray-900);
  padding: 1rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.875rem;
  line-height: 1.25rem;
  line-height: 1.5;
  color: var(--gray-100);
}

.report-content pre code {
  border-radius: 0px;
  background-color: transparent;
  padding: 0px;
  font-size: 0.75rem;
  line-height: 1rem;
  color: inherit;
}

.report-content .markdown-diagram {
  margin-top: 1rem;
  margin-bottom: 1rem;
  border-radius: var(--radius-lg);
  border-width: 1px;
  border-color: var(--gray-200);
  background-color: var(--surface);
}

/* Inline previews fit the whole diagram (contain); the viewer is for detail.
     max-width and max-height together scale a replaced SVG proportionally. */

.report-content .diagram-canvas {
  overflow: auto;
  padding: 12px;
}

.report-content .diagram-canvas > svg {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(60vh, 520px);
  margin: 0 auto;
}

.report-content span[data-entity-type] {
  font-weight: 600;
}

.report-content .positive {
  font-weight: 600;
  color: var(--color-up);
}

.report-content .negative {
  font-weight: 600;
  color: var(--color-down);
}

.report-content .highlight {
  font-weight: 600;
  color: var(--primary-600);
}

.report-content .data_value {
  border-radius: 0.25rem;
  background-color: var(--gray-100);
  padding-left: 0.25rem;
  padding-right: 0.25rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--gray-800);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.pointer-events-none {
  pointer-events: none;
}

.visible {
  visibility: visible;
}

.collapse {
  visibility: collapse;
}

.static {
  position: static;
}

.fixed {
  position: fixed;
}

.absolute {
  position: absolute;
}

.relative {
  position: relative;
}

.sticky {
  position: sticky;
}

.inset-0 {
  inset: 0px;
}

.inset-y-0 {
  top: 0px;
  bottom: 0px;
}

.bottom-0 {
  bottom: 0px;
}

.left-auto {
  left: auto;
}

.right-0 {
  right: 0px;
}

.right-1\.5 {
  right: 0.375rem;
}

.top-0 {
  top: 0px;
}

.z-20 {
  z-index: 20;
}

.z-50 {
  z-index: 50;
}

.col-span-2 {
  grid-column: span 2 / span 2;
}

.m-0 {
  margin: 0px;
}

.m-3 {
  margin: 0.75rem;
}

.m-4 {
  margin: 1rem;
}

.mx-1 {
  margin-left: 0.25rem;
  margin-right: 0.25rem;
}

.mx-2 {
  margin-left: 0.5rem;
  margin-right: 0.5rem;
}

.mx-auto {
  margin-left: auto;
  margin-right: auto;
}

.-mr-2 {
  margin-right: -0.5rem;
}

.mb-1 {
  margin-bottom: 0.25rem;
}

.mb-1\.5 {
  margin-bottom: 0.375rem;
}

.mb-2 {
  margin-bottom: 0.5rem;
}

.mb-3 {
  margin-bottom: 0.75rem;
}

.mb-4 {
  margin-bottom: 1rem;
}

.mb-6 {
  margin-bottom: 1.5rem;
}

.mb-8 {
  margin-bottom: 2rem;
}

.ml-1 {
  margin-left: 0.25rem;
}

.ml-2 {
  margin-left: 0.5rem;
}

.ml-auto {
  margin-left: auto;
}

.mr-3 {
  margin-right: 0.75rem;
}

.mt-0 {
  margin-top: 0px;
}

.mt-1 {
  margin-top: 0.25rem;
}

.mt-2 {
  margin-top: 0.5rem;
}

.mt-3 {
  margin-top: 0.75rem;
}

.mt-4 {
  margin-top: 1rem;
}

.line-clamp-2 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.line-clamp-3 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.block {
  display: block;
}

.inline-block {
  display: inline-block;
}

.inline {
  display: inline;
}

.flex {
  display: flex;
}

.inline-flex {
  display: inline-flex;
}

.table {
  display: table;
}

.grid {
  display: grid;
}

.contents {
  display: contents;
}

.hidden {
  display: none;
}

.h-1 {
  height: 0.25rem;
}

.h-1\.5 {
  height: 0.375rem;
}

.h-3 {
  height: 0.75rem;
}

.h-32 {
  height: 8rem;
}

.h-40 {
  height: 10rem;
}

.h-48 {
  height: 12rem;
}

.h-5 {
  height: 1.25rem;
}

.h-6 {
  height: 1.5rem;
}

.h-full {
  height: 100%;
}

.h-px {
  height: 1px;
}

.max-h-32 {
  max-height: 8rem;
}

.max-h-64 {
  max-height: 16rem;
}

.max-h-full {
  max-height: 100%;
}

.min-h-0 {
  min-height: 0px;
}

.min-h-12 {
  min-height: 3rem;
}

.min-h-\[16rem\] {
  min-height: 16rem;
}

.min-h-\[18rem\] {
  min-height: 18rem;
}

.min-h-\[250px\] {
  min-height: 250px;
}

.min-h-\[32rem\] {
  min-height: 32rem;
}

.min-h-full {
  min-height: 100%;
}

.w-1\.5 {
  width: 0.375rem;
}

.w-16 {
  width: 4rem;
}

.w-3 {
  width: 0.75rem;
}

.w-5 {
  width: 1.25rem;
}

.w-full {
  width: 100%;
}

.w-px {
  width: 1px;
}

.min-w-0 {
  min-width: 0px;
}

.min-w-40 {
  min-width: 10rem;
}

.max-w-3xl {
  max-width: 48rem;
}

.max-w-5xl {
  max-width: 64rem;
}

.max-w-\[150px\] {
  max-width: 150px;
}

.max-w-\[85\%\] {
  max-width: 85%;
}

.max-w-md {
  max-width: 28rem;
}

.max-w-xl {
  max-width: 36rem;
}

.flex-1 {
  flex: 1 1 0%;
}

.flex-shrink-0 {
  flex-shrink: 0;
}

.shrink-0 {
  flex-shrink: 0;
}

.grow {
  flex-grow: 1;
}

.translate-y-full {
  --tw-translate-y: 100%;
  transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
}

.transform {
  transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
}

@keyframes pulse {
  50% {
    opacity: .5;
  }
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.cursor-pointer {
  cursor: pointer;
}

.resize-none {
  resize: none;
}

.resize {
  resize: both;
}

.grid-cols-1 {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

.grid-cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.flex-col {
  flex-direction: column;
}

.flex-wrap {
  flex-wrap: wrap;
}

.items-end {
  align-items: flex-end;
}

.items-center {
  align-items: center;
}

.items-baseline {
  align-items: baseline;
}

.justify-start {
  justify-content: flex-start;
}

.justify-end {
  justify-content: flex-end;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-1 {
  gap: 0.25rem;
}

.gap-1\.5 {
  gap: 0.375rem;
}

.gap-2 {
  gap: 0.5rem;
}

.gap-3 {
  gap: 0.75rem;
}

.gap-4 {
  gap: 1rem;
}

.gap-5 {
  gap: 1.25rem;
}

.gap-6 {
  gap: 1.5rem;
}

.space-y-2 > :not([hidden]) ~ :not([hidden]) {
  --tw-space-y-reverse: 0;
  margin-top: calc(0.5rem * calc(1 - var(--tw-space-y-reverse)));
  margin-bottom: calc(0.5rem * var(--tw-space-y-reverse));
}

.space-y-3 > :not([hidden]) ~ :not([hidden]) {
  --tw-space-y-reverse: 0;
  margin-top: calc(0.75rem * calc(1 - var(--tw-space-y-reverse)));
  margin-bottom: calc(0.75rem * var(--tw-space-y-reverse));
}

.space-y-4 > :not([hidden]) ~ :not([hidden]) {
  --tw-space-y-reverse: 0;
  margin-top: calc(1rem * calc(1 - var(--tw-space-y-reverse)));
  margin-bottom: calc(1rem * var(--tw-space-y-reverse));
}

.space-y-5 > :not([hidden]) ~ :not([hidden]) {
  --tw-space-y-reverse: 0;
  margin-top: calc(1.25rem * calc(1 - var(--tw-space-y-reverse)));
  margin-bottom: calc(1.25rem * var(--tw-space-y-reverse));
}

.space-y-6 > :not([hidden]) ~ :not([hidden]) {
  --tw-space-y-reverse: 0;
  margin-top: calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));
  margin-bottom: calc(1.5rem * var(--tw-space-y-reverse));
}

.overflow-auto {
  overflow: auto;
}

.overflow-hidden {
  overflow: hidden;
}

.overflow-x-auto {
  overflow-x: auto;
}

.overflow-y-auto {
  overflow-y: auto;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.whitespace-nowrap {
  white-space: nowrap;
}

.whitespace-pre-wrap {
  white-space: pre-wrap;
}

.break-words {
  overflow-wrap: break-word;
}

.rounded {
  border-radius: 0.25rem;
}

.rounded-full {
  border-radius: 9999px;
}

.rounded-lg {
  border-radius: var(--radius-lg);
}

.rounded-md {
  border-radius: var(--radius-md);
}

.rounded-xl {
  border-radius: var(--radius-xl);
}

.rounded-l-full {
  border-top-left-radius: 9999px;
  border-bottom-left-radius: 9999px;
}

.rounded-r-full {
  border-top-right-radius: 9999px;
  border-bottom-right-radius: 9999px;
}

.border {
  border-width: 1px;
}

.border-0 {
  border-width: 0px;
}

.border-b {
  border-bottom-width: 1px;
}

.border-l {
  border-left-width: 1px;
}

.border-r-0 {
  border-right-width: 0px;
}

.border-t {
  border-top-width: 1px;
}

.border-amber-100 {
  --tw-border-opacity: 1;
  border-color: rgb(254 243 199 / var(--tw-border-opacity, 1));
}

.border-amber-200 {
  --tw-border-opacity: 1;
  border-color: rgb(253 230 138 / var(--tw-border-opacity, 1));
}

.border-amber-300 {
  --tw-border-opacity: 1;
  border-color: rgb(252 211 77 / var(--tw-border-opacity, 1));
}

.border-gray-100 {
  border-color: var(--gray-100);
}

.border-gray-200 {
  border-color: var(--gray-200);
}

.border-gray-300 {
  border-color: var(--gray-300);
}

.border-indigo-200 {
  --tw-border-opacity: 1;
  border-color: rgb(199 210 254 / var(--tw-border-opacity, 1));
}

.border-primary-100 {
  border-color: var(--primary-100);
}

.border-primary-200 {
  border-color: var(--primary-200);
}

.border-primary-300 {
  border-color: var(--primary-300);
}

.border-primary-500 {
  border-color: var(--primary-500);
}

.border-red-200 {
  --tw-border-opacity: 1;
  border-color: rgb(254 202 202 / var(--tw-border-opacity, 1));
}

.bg-amber-50 {
  --tw-bg-opacity: 1;
  background-color: rgb(255 251 235 / var(--tw-bg-opacity, 1));
}

.bg-black\/40 {
  background-color: rgb(0 0 0 / 0.4);
}

.bg-down-soft {
  background-color: var(--color-down-soft);
}

.bg-gray-100 {
  background-color: var(--gray-100);
}

.bg-gray-200 {
  background-color: var(--gray-200);
}

.bg-gray-300 {
  background-color: var(--gray-300);
}

.bg-gray-50 {
  background-color: var(--gray-50);
}

.bg-gray-700 {
  background-color: var(--gray-700);
}

.bg-indigo-50 {
  --tw-bg-opacity: 1;
  background-color: rgb(238 242 255 / var(--tw-bg-opacity, 1));
}

.bg-indigo-500 {
  --tw-bg-opacity: 1;
  background-color: rgb(99 102 241 / var(--tw-bg-opacity, 1));
}

.bg-primary-100 {
  background-color: var(--primary-100);
}

.bg-primary-50 {
  background-color: var(--primary-50);
}

.bg-primary-600 {
  background-color: var(--primary-600);
}

.bg-red-50 {
  --tw-bg-opacity: 1;
  background-color: rgb(254 242 242 / var(--tw-bg-opacity, 1));
}

.bg-transparent {
  background-color: transparent;
}

.bg-up-soft {
  background-color: var(--color-up-soft);
}

.bg-white {
  --tw-bg-opacity: 1;
  background-color: rgb(255 255 255 / var(--tw-bg-opacity, 1));
}

.bg-white\/70 {
  background-color: rgb(255 255 255 / 0.7);
}

.bg-yellow-100 {
  --tw-bg-opacity: 1;
  background-color: rgb(254 249 195 / var(--tw-bg-opacity, 1));
}

.p-0 {
  padding: 0px;
}

.p-2 {
  padding: 0.5rem;
}

.p-3 {
  padding: 0.75rem;
}

.p-4 {
  padding: 1rem;
}

.p-5 {
  padding: 1.25rem;
}

.p-6 {
  padding: 1.5rem;
}

.p-8 {
  padding: 2rem;
}

.px-1 {
  padding-left: 0.25rem;
  padding-right: 0.25rem;
}

.px-1\.5 {
  padding-left: 0.375rem;
  padding-right: 0.375rem;
}

.px-2 {
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

.px-3 {
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

.px-4 {
  padding-left: 1rem;
  padding-right: 1rem;
}

.px-5 {
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

.px-6 {
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.py-0\.5 {
  padding-top: 0.125rem;
  padding-bottom: 0.125rem;
}

.py-1 {
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
}

.py-1\.5 {
  padding-top: 0.375rem;
  padding-bottom: 0.375rem;
}

.py-16 {
  padding-top: 4rem;
  padding-bottom: 4rem;
}

.py-2 {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.py-3 {
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.py-4 {
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.py-5 {
  padding-top: 1.25rem;
  padding-bottom: 1.25rem;
}

.py-6 {
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}

.py-8 {
  padding-top: 2rem;
  padding-bottom: 2rem;
}

.pb-0 {
  padding-bottom: 0px;
}

.pb-0\.5 {
  padding-bottom: 0.125rem;
}

.pb-1 {
  padding-bottom: 0.25rem;
}

.pb-2 {
  padding-bottom: 0.5rem;
}

.pb-3 {
  padding-bottom: 0.75rem;
}

.pb-4 {
  padding-bottom: 1rem;
}

.pb-6 {
  padding-bottom: 1.5rem;
}

.pl-2 {
  padding-left: 0.5rem;
}

.pr-5 {
  padding-right: 1.25rem;
}

.pt-2 {
  padding-top: 0.5rem;
}

.pt-4 {
  padding-top: 1rem;
}

.text-left {
  text-align: left;
}

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.font-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.font-sans {
  font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
}

.text-2xl {
  font-size: 1.5rem;
  line-height: 2rem;
}

.text-3xl {
  font-size: 1.875rem;
  line-height: 2.25rem;
}

.text-\[10px\] {
  font-size: 10px;
}

.text-\[11px\] {
  font-size: 11px;
}

.text-base {
  font-size: 1rem;
  line-height: 1.5rem;
}

.text-lg {
  font-size: 1.125rem;
  line-height: 1.75rem;
}

.text-sm {
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.text-xl {
  font-size: 1.25rem;
  line-height: 1.75rem;
}

.text-xs {
  font-size: 0.75rem;
  line-height: 1rem;
}

.font-bold {
  font-weight: 700;
}

.font-medium {
  font-weight: 500;
}

.font-normal {
  font-weight: 400;
}

.font-semibold {
  font-weight: 600;
}

.uppercase {
  text-transform: uppercase;
}

.tabular-nums {
  --tw-numeric-spacing: tabular-nums;
  font-variant-numeric: var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction);
}

.leading-relaxed {
  line-height: 1.625;
}

.leading-snug {
  line-height: 1.375;
}

.leading-tight {
  line-height: 1.25;
}

.tracking-wider {
  letter-spacing: 0.05em;
}

.text-amber-600 {
  --tw-text-opacity: 1;
  color: rgb(217 119 6 / var(--tw-text-opacity, 1));
}

.text-amber-700 {
  --tw-text-opacity: 1;
  color: rgb(180 83 9 / var(--tw-text-opacity, 1));
}

.text-amber-800 {
  --tw-text-opacity: 1;
  color: rgb(146 64 14 / var(--tw-text-opacity, 1));
}

.text-amber-900 {
  --tw-text-opacity: 1;
  color: rgb(120 53 15 / var(--tw-text-opacity, 1));
}

.text-cyan-700 {
  --tw-text-opacity: 1;
  color: rgb(14 116 144 / var(--tw-text-opacity, 1));
}

.text-down {
  color: var(--color-down);
}

.text-emerald-600 {
  --tw-text-opacity: 1;
  color: rgb(5 150 105 / var(--tw-text-opacity, 1));
}

.text-emerald-700 {
  --tw-text-opacity: 1;
  color: rgb(4 120 87 / var(--tw-text-opacity, 1));
}

.text-gray-400 {
  color: var(--gray-400);
}

.text-gray-500 {
  color: var(--gray-500);
}

.text-gray-600 {
  color: var(--gray-600);
}

.text-gray-700 {
  color: var(--gray-700);
}

.text-gray-800 {
  color: var(--gray-800);
}

.text-gray-900 {
  color: var(--gray-900);
}

.text-indigo-600 {
  --tw-text-opacity: 1;
  color: rgb(79 70 229 / var(--tw-text-opacity, 1));
}

.text-indigo-800 {
  --tw-text-opacity: 1;
  color: rgb(55 48 163 / var(--tw-text-opacity, 1));
}

.text-orange-600 {
  --tw-text-opacity: 1;
  color: rgb(234 88 12 / var(--tw-text-opacity, 1));
}

.text-primary-500 {
  color: var(--primary-500);
}

.text-primary-600 {
  color: var(--primary-600);
}

.text-primary-700 {
  color: var(--primary-700);
}

.text-primary-800 {
  color: var(--primary-800);
}

.text-purple-600 {
  --tw-text-opacity: 1;
  color: rgb(147 51 234 / var(--tw-text-opacity, 1));
}

.text-red-500 {
  --tw-text-opacity: 1;
  color: rgb(239 68 68 / var(--tw-text-opacity, 1));
}

.text-red-600 {
  --tw-text-opacity: 1;
  color: rgb(220 38 38 / var(--tw-text-opacity, 1));
}

.text-red-700 {
  --tw-text-opacity: 1;
  color: rgb(185 28 28 / var(--tw-text-opacity, 1));
}

.text-rose-600 {
  --tw-text-opacity: 1;
  color: rgb(225 29 72 / var(--tw-text-opacity, 1));
}

.text-rose-700 {
  --tw-text-opacity: 1;
  color: rgb(190 18 60 / var(--tw-text-opacity, 1));
}

.text-slate-600 {
  --tw-text-opacity: 1;
  color: rgb(71 85 105 / var(--tw-text-opacity, 1));
}

.text-up {
  color: var(--color-up);
}

.text-white {
  --tw-text-opacity: 1;
  color: rgb(255 255 255 / var(--tw-text-opacity, 1));
}

.text-yellow-600 {
  --tw-text-opacity: 1;
  color: rgb(202 138 4 / var(--tw-text-opacity, 1));
}

.text-yellow-800 {
  --tw-text-opacity: 1;
  color: rgb(133 77 14 / var(--tw-text-opacity, 1));
}

.underline {
  text-decoration-line: underline;
}

.decoration-dotted {
  text-decoration-style: dotted;
}

.underline-offset-2 {
  text-underline-offset: 2px;
}

.opacity-50 {
  opacity: 0.5;
}

.shadow-sm {
  --tw-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);
  box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
}

.shadow-xl {
  --tw-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);
  box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
}

.outline-none {
  outline: 2px solid transparent;
  outline-offset: 2px;
}

.ring {
  --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
  --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);
  box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
}

.ring-1 {
  --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
  --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);
  box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
}

.ring-primary-100 {
  --tw-ring-color: var(--primary-100);
}

.ring-sky-300 {
  --tw-ring-opacity: 1;
  --tw-ring-color: rgb(125 211 252 / var(--tw-ring-opacity, 1));
}

.blur {
  --tw-blur: blur(8px);
  filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
}

.filter {
  filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
}

.backdrop-blur {
  --tw-backdrop-blur: blur(8px);
  -webkit-backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);
  backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);
}

.transition {
  transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter;
  transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;
  transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-backdrop-filter;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}

.transition-colors {
  transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}

.ease-in {
  transition-timing-function: cubic-bezier(0.4, 0, 1, 1);
}

.ease-out {
  transition-timing-function: cubic-bezier(0, 0, 0.2, 1);
}

/* Temporary Web entry: a plain server-error screen, before the application mounts. */

.development-entry {
  min-height: 100dvh;
  padding: 32px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  color: var(--gray-500);
  text-align: center;
}

.development-entry-code {
  display: block;
  padding: 0;
  border: 0;
  background: none;
  font-size: 56px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -.04em;
  color: var(--gray-400);
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  touch-action: manipulation;
  cursor: default;
}

.development-entry h1 {
  margin: 18px 0 0;
  font-size: 17px;
  font-weight: 600;
  color: var(--gray-700);
}

.development-entry-description {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.8;
  color: var(--gray-500);
}

/* One responsive backtest workspace keeps form state and rule semantics shared
   between desktop and mobile; only the library's placement changes. */

/* Column gap replaces per-element top margins: hidden alert/notice regions drop
   out of the flow entirely, so the tab strip sits flush with the page top. */

.auto-page {
  max-width: 1760px;
  margin: auto;
  padding: 24px 32px 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  color: var(--gray-900);
}

.auto-workspace {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

/* Every tab pairs a left list with a right editor, matching the other feature
   pages. Columns are explicit so DOM order (editor first) stays logical. */

.auto-workspace > .auto-library {
  grid-column: 1;
  grid-row: 1;
}

.auto-workspace > .auto-main {
  grid-column: 2;
  grid-row: 1;
}

.auto-main {
  min-width: 0;
  display: grid;
  gap: 20px;
}

.auto-page .panel {
  padding: 24px;
}

.auto-page .panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.auto-tabs, .auto-actions, .auto-rule-row, .auto-rule-fields {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.auto-tabs {
  border-bottom: 1px solid var(--gray-200);
}

.auto-tabs > button {
  padding: 12px 18px;
  color: var(--gray-500);
  border-bottom: 2px solid transparent;
  font-size: 14px;
}

.auto-tabs > button[aria-current=page] {
  color: var(--primary-600);
  border-color: var(--primary-600);
  font-weight: 600;
}

.auto-form {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.auto-form-grid, .auto-slot-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.auto-field {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: var(--gray-600);
  font-size: 13px;
}

.auto-page input:not([type=checkbox]), .auto-page select, .auto-page textarea {
  min-width: 0;
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--gray-900);
  font-size: 14px;
}

.auto-page input:focus, .auto-page textarea:focus, .auto-page select:focus {
  outline: 2px solid var(--primary-200);
  outline-offset: 1px;
}

.auto-page input:disabled {
  background: var(--gray-50);
  color: var(--gray-400);
}

.auto-page input[type=checkbox] {
  accent-color: var(--primary-600);
  margin-right: 4px;
}

.auto-page .styled-select-trigger {
  width: 100%;
}

.auto-page summary {
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}

.auto-page details[open] > summary {
  margin-bottom: 16px;
}

.auto-muted, .auto-empty {
  font-size: 13px;
  line-height: 1.8;
  color: var(--gray-500);
  overflow-wrap: anywhere;
}

.auto-empty {
  padding: 24px 0;
}

.auto-notice, .auto-error {
  padding: 12px 16px;
  border-radius: var(--radius-xl);
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.auto-notice {
  background: var(--primary-50);
  color: var(--primary-700);
}

.auto-error {
  background: var(--danger-50);
  color: var(--danger-700);
}

.auto-library {
  max-height: 80vh;
  overflow-y: auto;
}

/* History keeps its title, filters and search fixed while only the run list
   scrolls, so the controls never leave the viewport on long histories. */

.auto-page .panel.auto-history {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.auto-history-head {
  display: grid;
  gap: 8px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--gray-100);
}

.auto-history-heading {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.auto-history-delete {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-inline-start: auto;
  padding: 4px 6px;
  border-radius: var(--radius-lg);
  color: var(--danger-600);
  font-size: 12px;
}

.auto-history-delete:not(:disabled):hover {
  background: var(--danger-50);
}

.auto-history-delete:disabled {
  color: var(--gray-400);
}

.auto-history-delete svg {
  width: 16px;
  height: 16px;
}

.auto-history-tools {
  display: flex;
  align-items: center;
  gap: 4px;
}

.auto-filter {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border-radius: var(--radius-lg);
  background: var(--gray-100);
}

.auto-filter > button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  padding: 0 4px;
  border-radius: var(--radius-md);
  color: var(--gray-500);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
}

.auto-filter > button:hover {
  color: var(--gray-800);
  background: var(--surface);
}

.auto-filter > button[aria-pressed=true] {
  background: var(--primary-600);
  color: #fff;
}

.auto-filter svg, .auto-icon-button svg {
  width: 15px;
  height: 15px;
}

.auto-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  color: var(--gray-500);
}

.auto-icon-button:hover {
  background: var(--gray-100);
  color: var(--gray-800);
}

.auto-icon-button.is-active {
  border-color: var(--primary-200);
  background: var(--primary-50);
  color: var(--primary-700);
}

.auto-page input.auto-history-search {
  width: 96px;
  flex: 1 1 76px;
  min-width: 76px;
  min-height: 30px;
  padding: 5px 8px;
  border-radius: var(--radius-lg);
  font-size: 12px;
}

.auto-history-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 16px 12px;
}

/* Two lines per run: the row owns the separator, the item owns the hit area. */

.auto-library-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 2px;
  padding: 2px 0 6px;
  border-bottom: 1px solid var(--gray-100);
}

.auto-history-row {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.auto-history-row .auto-history-check {
  margin-top: 12px;
}

.auto-page input.auto-history-check {
  width: 16px;
  height: 16px;
  margin-right: 0;
}

.auto-list-item {
  display: grid;
  gap: 2px;
  width: 100%;
  min-width: 0;
  padding: 8px;
  border-radius: var(--radius-lg);
  text-align: left;
  overflow-wrap: anywhere;
}

.auto-list-item:hover, .auto-list-item.is-selected {
  background: var(--primary-50);
}

.auto-list-item strong {
  font-size: 14px;
}

.auto-list-item small {
  color: var(--gray-500);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

/* Identity and result share the first line; the interval sits below them. */

.auto-list-heading {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
}

.auto-list-heading .auto-badge {
  margin-left: 0;
}

.auto-list-result {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.auto-list-result .auto-badge-ai {
  margin-left: 0;
}

.auto-list-return {
  font-size: 14px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.auto-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin-top: 4px;
  border-radius: var(--radius-lg);
  color: var(--gray-500);
}

.auto-delete:hover {
  color: var(--danger-600);
  background: var(--danger-50);
}

.auto-delete svg {
  width: 16px;
  height: 16px;
}

.auto-badge {
  margin-left: 10px;
  color: var(--gray-500);
  font-size: 11px;
  font-weight: 400;
}

.auto-badge-ai {
  margin-left: 6px;
  padding: 1px 5px;
  border-radius: var(--radius-sm);
  background: var(--primary-100);
  color: var(--primary-700);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}

.auto-slot {
  min-width: 0;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl);
  padding: 16px;
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.auto-slot h3, .auto-slot h4 {
  font-size: 14px;
  font-weight: 600;
}

.auto-rule {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl);
  padding: 12px;
  background: var(--gray-50);
  min-width: 0;
}

.auto-rule-row {
  justify-content: space-between;
  flex-wrap: nowrap;
}

.auto-rule-row > select, .auto-rule-row > .styled-select-trigger {
  max-width: calc(100% - 40px);
}

.auto-rule-children {
  display: grid;
  gap: 10px;
  border-left: 2px solid var(--gray-300);
  padding-left: 12px;
  width: 100%;
}

.auto-rule-fields {
  margin-top: 12px;
}

.auto-rule-fields:empty {
  display: none;
}

.auto-rule-fields > select, .auto-rule-fields > .styled-select-trigger {
  width: auto;
  flex: 1 1 140px;
}

.auto-inline-field {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--gray-600);
}

.auto-inline-field input {
  max-width: 120px;
}

.auto-inline-field select, .auto-inline-field .styled-select-trigger {
  width: auto;
}

.auto-remove {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-md);
  color: var(--gray-500);
  flex-shrink: 0;
}

.auto-remove:hover {
  background: var(--danger-100);
  color: var(--danger-700);
}

.auto-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.auto-metrics > div {
  display: grid;
  gap: 6px;
}

.auto-metrics span {
  color: var(--gray-500);
  font-size: 12px;
}

.auto-metrics strong {
  font-size: 20px;
  font-weight: 600;
}

.auto-chart {
  height: 300px;
  margin: 16px 0;
}

.auto-trading-details {
  margin: 16px 0;
}

.auto-trading-chart {
  height: 540px;
  margin: 12px 0;
}

.auto-chart-readout {
  min-height: 40px;
  font-size: 12px;
  color: var(--gray-500);
  font-variant-numeric: tabular-nums;
}

.auto-trades-scroll {
  overflow-x: auto;
  max-height: 320px;
}

.auto-trades {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
  font-size: 12px;
}

.auto-trades th, .auto-trades td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
}

.auto-legend {
  display: inline-block;
  height: 3px;
  width: 18px;
  vertical-align: middle;
}

.auto-legend.strategy {
  background: var(--primary-600);
}

.auto-legend.benchmark {
  background: var(--gray-400);
}

.auto-values {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
  font-size: 13px;
}

.auto-values > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.auto-values dt {
  color: var(--gray-500);
}

@media (max-width: 1023px) {
  .auto-page {
    padding: 16px 16px 20px;
  }

  .auto-workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .auto-workspace > .auto-library, .auto-workspace > .auto-main {
    grid-column: 1;
    grid-row: auto;
  }

  /* On a narrow screen the editor stays first; the list follows it. */

  .auto-workspace > .auto-main {
    order: -1;
  }

  .auto-page .panel {
    padding: 18px;
  }

  .auto-library {
    max-height: none;
  }

  .auto-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .auto-slot-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 560px) {
  .auto-form-grid, .auto-values {
    grid-template-columns: minmax(0, 1fr);
  }

  .auto-rule-children {
    padding-left: 7px;
  }

  .auto-rule {
    padding: 8px;
  }

  .auto-tabs > button {
    flex: 1;
    padding: 12px 8px;
  }
}

/* Shared overlays keep app typography/colors while native dialog supplies focus
   isolation and Escape dismissal. Mobile selections use thumb-friendly sheets. */

.app-dialog {
  color: var(--gray-900);
  background: var(--surface);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-3xl);
  box-shadow: var(--shadow-lg);
}

.app-dialog::backdrop {
  background: var(--backdrop);
}

/* Explicit centering survives the global CSS reset; native dialog still owns
   focus isolation and keeps the same compact card on desktop and mobile. */

.auth-error {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(336px, calc(100vw - 40px));
  height: -moz-fit-content;
  height: fit-content;
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  padding: 30px 24px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-3xl);
  background: var(--surface);
  color: var(--gray-900);
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.auth-error::backdrop {
  background: var(--backdrop);
  -webkit-backdrop-filter: blur(3px);
          backdrop-filter: blur(3px);
}

.auth-error h2 {
  font-size: 16px;
  line-height: 1.5;
  font-weight: 650;
  letter-spacing: .01em;
}

.auth-error p {
  max-width: 240px;
  margin: 8px auto 0;
  font-size: 13px;
  line-height: 1.7;
  color: var(--gray-500);
}

.auth-error button {
  min-height: 40px;
  margin-top: 22px;
}

.account-button[aria-busy="true"]::before {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 7px;
  vertical-align: -2px;
  border: 2px solid var(--primary-50);
  border-top-color: var(--primary-600);
  border-radius: 50%;
  animation: auth-spin .8s linear infinite;
}

@keyframes auth-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .account-button[aria-busy="true"]::before {
    animation: none;
  }
}

.app-confirm-dialog {
  width: min(440px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 24px;
  overflow-y: auto;
}

.app-confirm-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 16px;
  border-radius: var(--radius-2xl);
  background: var(--primary-50);
  color: var(--primary-600);
}

.app-confirm-icon svg {
  width: 24px;
  height: 24px;
}

.app-confirm-dialog h2 {
  font-size: 18px;
  font-weight: 650;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.app-confirm-dialog p {
  margin-top: 10px;
  color: var(--gray-500);
  font-size: 14px;
  line-height: 1.8;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.app-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

.app-dialog-actions button {
  min-height: 42px;
}

.app-dialog-danger .app-confirm-icon {
  color: var(--danger-600);
  background: var(--danger-50);
}

.app-dialog-danger [data-dialog-confirm] {
  background: var(--danger-600);
}

.app-dialog-danger [data-dialog-confirm]:hover {
  background: var(--danger-700);
}

.styled-select-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 100%;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--gray-900);
  text-align: left;
  font-size: 14px;
  line-height: 1.4;
  vertical-align: middle;
}

.styled-select-trigger:hover:not(:disabled), .styled-select-trigger[aria-expanded=true] {
  border-color: var(--primary-400);
  background: var(--gray-50);
}

.styled-select-trigger:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.styled-select-trigger svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: var(--gray-500);
}

.styled-select-label {
  display: block;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.app-select-dialog {
  position: fixed;
  inset: auto;
  margin: 0;
  padding: 0;
  max-width: calc(100vw - 24px);
  max-height: min(360px, calc(100dvh - 24px));
  border-radius: var(--radius-xl);
}

.app-select-dialog[open] {
  display: flex;
  flex-direction: column;
}

.app-select-dialog::backdrop {
  background: var(--backdrop-subtle);
}

.app-select-heading {
  display: none;
}

.app-select-options {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px;
  outline: none;
}

.app-select-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 40px;
  padding: 10px 12px;
  border-radius: var(--radius-lg);
  text-align: left;
  font-size: 13px;
  line-height: 1.5;
  color: var(--gray-600);
}

.app-select-option > span:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.app-select-option[aria-selected=true] {
  background: var(--primary-50);
  color: var(--primary-700);
  font-weight: 600;
}

.app-select-option:hover:not(:disabled), .app-select-option.is-highlighted {
  background: var(--gray-100);
}

.app-select-option[aria-selected=true].is-highlighted {
  background: var(--primary-100);
}

.app-select-option:disabled {
  opacity: .4;
}

.app-select-check {
  flex-shrink: 0;
  width: 16px;
  color: var(--primary-600);
}

.app-select-group {
  padding: 12px 12px 6px;
  color: var(--gray-500);
  font-size: 11px;
  font-weight: 600;
}

.graph-filters .styled-select-trigger, .graph-chain-picker .styled-select-trigger {
  min-width: 0;
  width: 100%;
}

.graph-chain-picker > label {
  min-width: 0;
}

@media (max-width: 1023px) {
  .app-confirm-dialog {
    position: fixed;
    inset: auto 0 0;
    width: 100%;
    max-width: 560px;
    max-height: calc(100dvh - env(safe-area-inset-top) - 24px);
    margin: 0 auto;
    padding: 24px 20px calc(20px + env(safe-area-inset-bottom));
    border-bottom: 0;
    border-radius: var(--radius-3xl) var(--radius-3xl) 0 0;
  }

  .app-dialog-actions button {
    flex: 1;
    min-height: 46px;
  }

  .app-select-dialog {
    inset: auto 0 0 !important;
    width: 100% !important;
    max-width: 560px;
    max-height: min(70dvh, 560px);
    margin: 0 auto;
    padding-bottom: env(safe-area-inset-bottom);
    border-bottom: 0;
    border-radius: var(--radius-3xl) var(--radius-3xl) 0 0;
  }

  .app-select-dialog::backdrop {
    background: var(--backdrop);
  }

  .app-select-heading {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--gray-100);
  }

  .app-select-heading h2 {
    min-width: 0;
    font-size: 16px;
    font-weight: 600;
    overflow-wrap: anywhere;
  }

  .app-select-heading button {
    flex-shrink: 0;
    font-size: 12px;
  }

  .app-select-options {
    padding: 10px;
  }

  .app-select-option {
    min-height: 48px;
    padding: 12px 14px;
    font-size: 14px;
  }
}

/* The inline preview fits the whole diagram; the viewer hands the same SVG to
   the pan/zoom library for wheel, pinch and drag input. */

.diagram-expand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 8px;
  border-top: 1px solid var(--gray-200);
  color: var(--primary-700);
  font-size: 12px;
  font-weight: 600;
}

.diagram-expand:hover {
  background: var(--primary-50);
}

.diagram-viewer {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--surface);
  color: var(--gray-900);
}

.diagram-viewer[open] {
  display: block;
}

.diagram-viewer::backdrop {
  background: var(--backdrop);
}

/* Only the two escape hatches stay visible; the diagram owns the rest of the screen. */

.diagram-viewer-actions {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: flex;
  gap: 8px;
}

.diagram-viewer-actions button {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--gray-700);
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.diagram-viewer-actions button:hover {
  background: var(--gray-100);
}

.diagram-viewer-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--gray-50);
}

.diagram-viewer-canvas {
  width: 100%;
  height: 100%;
}

.diagram-viewer-canvas > svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* Bound expanded suggestions too, so long questions cannot crowd out the answer. */

.related-questions > summary {
  list-style: none;
}

.related-questions > summary::-webkit-details-marker {
  display: none;
}

.related-questions-collapse, .related-questions[open] .related-questions-expand {
  display: none;
}

.related-questions[open] .related-questions-collapse {
  display: inline;
}

.related-questions[open] .related-questions-arrow {
  transform: rotate(180deg);
}

.related-questions-list {
  max-height: min(10rem, 25dvh);
  overflow-y: auto;
}

.related-questions-expand, .related-questions-collapse {
  color: var(--primary-600);
  font-weight: 700;
}

.chat-session + .chat-session {
  border-top: 1px solid var(--gray-200);
}

.chat-session {
  border-radius: 0;
}

.chat-delete-session {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-width: 44px;
  min-height: 44px;
  margin-right: 4px;
  border-radius: var(--radius-lg);
  color: var(--gray-500);
}

.chat-delete-session:hover:not(:disabled) {
  color: var(--danger-600);
  background: var(--danger-50);
}

.chat-delete-session:disabled {
  opacity: .4;
  cursor: not-allowed;
}

/* Mobile controls share one row. Suggestions float above it; multiline input
   grows upward within the flex workspace, leaving the answer independently scrollable. */

.chat-dock {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 8px 0;
  border-top: 1px solid var(--gray-200);
}

.chat-dock .related-questions {
  position: static;
  margin: 0;
  min-width: 0;
}

.chat-dock .related-questions > summary {
  min-height: 42px;
  padding: 8px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-xl);
  background: var(--surface);
}

.chat-dock .related-questions-arrow {
  flex-shrink: 0;
}

.chat-dock .related-questions-list {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 2px);
  max-height: min(14rem, 35dvh);
  padding: 12px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-2xl);
  background: var(--surface);
  box-shadow: var(--shadow-up);
  z-index: 10;
}

.chat-dock .related-questions-list > span {
  width: 100%;
}

.chat-dock [data-related-question] {
  flex: 1;
  overflow-wrap: anywhere;
}

.chat-compact-form {
  flex: 1;
  min-width: 0;
}

.chat-dock .chat-input-surface {
  gap: 4px;
  padding: 4px;
  border-radius: var(--radius-xl);
}

.chat-dock textarea {
  line-height: 24px;
  padding: 4px 6px;
  min-height: 32px;
  font-size: 16px;
  border-radius: var(--radius-md);
}

/* The two AI surfaces share this icon-only control; input text stays readable. */

.chat-input-surface [data-chat-submit] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  padding: 0;
}

.chat-input-surface textarea::-moz-placeholder {
  font-size: 12px;
}

.chat-input-surface textarea::placeholder {
  font-size: 12px;
}

.chat-dock [data-chat-submit] {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-lg);
}

.chat-input-expand {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 32px;
  height: 34px;
  border-radius: var(--radius-lg);
  color: var(--primary-600);
}

.chat-input-expand[aria-expanded=true] svg {
  transform: rotate(180deg);
}

.chat-open-input {
  display: flex;
  align-items: center;
  gap: 2px;
  min-height: 42px;
  padding: 8px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-xl);
  color: var(--primary-600);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  background: var(--surface);
}

.chat-open-input svg {
  transform: rotate(-90deg);
}

.chat-dock[data-mode=related] .related-questions {
  flex: 1;
}

.chat-dock[data-mode=related] .chat-compact-form {
  display: none;
}

.chat-dock[data-mode=input] .chat-open-input {
  display: none;
}

.chat-dock[data-mode=input] .related-questions > summary {
  width: 40px;
  padding: 8px;
  justify-content: center;
}

.chat-dock[data-mode=input] .related-questions > summary > span:not(.related-questions-arrow) {
  display: none;
}

.chat-dock[data-mode=input] .related-questions-arrow {
  margin: 0;
}

.chat-dock .related-questions > summary {
  font-size: 12px;
  gap: 4px;
}

.chat-collapsed-hint {
  animation: chat-border-hint 2.4s ease-in-out infinite;
}

@keyframes chat-border-hint {
  0%, 100% {
    border-color: var(--gray-300);
  }

  50% {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 2px #3b82f61a;
  }
}

/* One visual foundation for Web and the packaged Android pages. The shell owns
   viewport space; feature views use its available height instead of 100vh. */

.app-shell {
  min-height: 100dvh;
  padding-top: env(safe-area-inset-top);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 45;
  height: var(--header-height);
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--gray-200);
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  font-size: 23px;
  font-weight: 750;
  letter-spacing: -.055em;
}

.brand-mark {
  position: relative;
  display: grid;
  place-content: center;
  width: 34px;
  height: 36px;
  border-radius: var(--radius-xl);
  color: white;
  background: var(--primary-600);
  font-size: 24px;
  font-weight: 750;
  letter-spacing: -.05em;
}

.brand-mark > span {
  position: absolute;
  width: 5px;
  height: 5px;
  background: var(--primary-300);
  right: 6px;
  bottom: 7px;
  border-radius: 1px;
}

.brand-caption {
  display: block;
  font-size: 10px;
  line-height: 1.4;
  font-weight: 500;
  color: var(--gray-500);
  letter-spacing: .025em;
}

.desktop-navigation {
  display: flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
  flex: 1;
}

.desktop-navigation a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 10px;
  border-radius: var(--radius-lg);
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-500);
  white-space: nowrap;
}

.desktop-navigation svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.desktop-navigation a:hover {
  background: var(--gray-100);
  color: var(--gray-900);
}

.desktop-navigation a[aria-current=page] {
  color: var(--primary-700);
  background: var(--primary-50);
  font-weight: 650;
}

.app-account {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.account-name {
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  color: var(--gray-500);
}

.preference-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1px;
  height: 34px;
  min-width: 36px;
  padding: 0 8px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  color: var(--gray-600);
  font-size: 12px;
  font-weight: 600;
}

.account-button {
  padding: 8px 12px;
  border-radius: var(--radius-lg);
  background: var(--primary-600);
  color: white;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.account-button.is-signed-in {
  border: 1px solid var(--gray-200);
  background: var(--surface);
  color: var(--gray-600);
}

.preference-button:hover, .account-button.is-signed-in:hover {
  background: var(--gray-100);
}

.app-content {
  min-width: 0;
  outline: none;
}

/* Credits belong at the end of chart content and scroll with it; no shell space
   is reserved, and expanding the notice never overlays charts or navigation. */

.chart-attribution {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 16px 0 4px;
  padding: 6px 0;
  color: var(--gray-500);
  font-size: 10px;
  line-height: 16px;
}

.chart-attribution a, .chart-notices > summary {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.chart-attribution a:hover, .chart-notices > summary:hover {
  color: var(--primary-600);
}

.chart-notices > summary {
  cursor: pointer;
  list-style: none;
}

.chart-notices > summary::-webkit-details-marker {
  display: none;
}

.chart-notices[open] {
  flex-basis: 100%;
  text-align: center;
}

.chart-notice-panel {
  width: min(360px, 100%);
  margin: 8px auto 0;
  padding: 12px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl);
  background: var(--surface);
  font-size: 11px;
  line-height: 1.6;
  text-align: left;
}

.chart-notice-panel p {
  margin-bottom: 6px;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

/* Scope native overscroll suppression to pages with our shared mobile gesture. */

html.pull-refresh-enabled, .pull-refresh-enabled .app-content [class*="overflow-y-auto"] {
  overscroll-behavior-y: contain;
}

.pull-refresh-indicator {
  position: fixed;
  top: calc(var(--header-height) + env(safe-area-inset-top) + 8px);
  left: 50%;
  z-index: 44;
  transform: translate(-50%, var(--pull-offset, 0px));
  display: flex;
  align-items: center;
  gap: 8px;
  width: -moz-max-content;
  width: max-content;
  max-width: calc(100vw - 32px);
  border: 1px solid var(--primary-200);
  border-radius: 999px;
  padding: 9px 14px;
  background: var(--primary-50);
  box-shadow: var(--shadow-md);
  color: var(--primary-700);
  font-size: 13px;
  pointer-events: none;
}

.pull-refresh-indicator[hidden] {
  display: none;
}

.pull-refresh-indicator::before {
  content: '↓';
  font-size: 17px;
}

.pull-refresh-indicator[data-state="release"]::before {
  content: '↑';
}

.pull-refresh-indicator[data-state="loading"]::before {
  content: '';
  width: 14px;
  height: 14px;
  border: 2px solid var(--primary-200);
  border-top-color: var(--primary-600);
  border-radius: 50%;
  animation: pull-refresh-spin .8s linear infinite;
}

.pull-refresh-indicator[data-state="failed"] {
  color: var(--warning-700);
  border-color: var(--warning-300);
  background: var(--warning-50);
}

@keyframes pull-refresh-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .pull-refresh-indicator[data-state="loading"]::before {
    animation: none;
  }
}

.mobile-navigation {
  display: none;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 12px;
  z-index: 100;
  transform: translateY(-150%);
  border-radius: var(--radius-lg);
  padding: 10px 16px;
  background: var(--gray-900);
  color: white;
}

.skip-link:focus {
  transform: translateY(0);
}

.workspace {
  height: calc(100dvh - var(--header-height) - env(safe-area-inset-top));
  min-height: 420px;
}

.market-workspace {
  display: grid;
  grid-template-columns: 208px minmax(0,1fr) 260px;
  gap: 16px;
  padding: 20px;
}

.market-panel {
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 52px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--gray-200);
}

/* The stock list scrolls independently; its header must not clip search results. */

.market-stock-panel {
  position: relative;
  z-index: 2;
  overflow: visible;
}

.stock-search {
  position: relative;
  width: clamp(150px, 24vw, 280px);
  min-width: 0;
  font-weight: 400;
}

.stock-search input {
  width: 100%;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--gray-900);
  font-size: 12px;
}

.stock-search input:focus {
  outline: 2px solid var(--primary-200);
  outline-offset: 1px;
}

.stock-search-results {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 40;
  width: min(360px, calc(100vw - 32px));
  max-height: min(360px, 60dvh);
  overflow-y: auto;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  color: var(--gray-700);
  text-align: left;
}

.stock-search-results > p {
  padding: 14px;
  font-size: 12px;
}

.stock-search-results > button {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  padding: 11px 14px;
  border-bottom: 1px solid var(--gray-100);
  text-align: left;
}

.stock-search-results > button:hover, .stock-search-results > button:focus-visible {
  background: var(--primary-50);
  outline: none;
}

.stock-search-identity, .stock-search-quote {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  font-size: 12px;
}

.stock-search-identity > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stock-search-identity small {
  color: var(--gray-500);
  font-size: 11px;
}

.stock-search-quote {
  flex-shrink: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.mobile-market-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.mobile-market-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-page-header .stock-search {
  width: clamp(144px, 43vw, 240px);
  flex-shrink: 0;
}

.market-center {
  display: grid;
  grid-template-rows: minmax(190px, 34%) minmax(0,1fr);
  gap: 16px;
  min-width: 0;
  min-height: 0;
}

.market-details {
  display: grid;
  grid-template-columns: minmax(220px,.8fr) minmax(0,1.6fr);
  gap: 16px;
  min-height: 0;
}

.market-chart {
  min-height: 0;
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.market-chart canvas {
  border-radius: var(--radius-lg);
}

.market-chart-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

/* Classes own appearance; IDs and data attributes remain JS hooks. Component
   modifiers express layout differences without depending on child order or on
   utility classes that happen to be present in the template. */

.market-profile-panel {
  padding: 20px;
}

.stock-profile-title {
  margin-bottom: 4px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.4;
}

.stock-profile-quote {
  margin-bottom: 16px;
  font-size: 30px;
  line-height: 1.2;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.035em;
}

.stock-profile-section-title {
  padding-bottom: 4px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--gray-200);
  font-weight: 600;
  color: var(--gray-700);
}

.market-profile-panel .stock-profile-title {
  font-size: 19px;
}

.market-profile-panel .stock-profile-section-title {
  padding-bottom: 8px;
}

.market-industry-list .market-industry-row[aria-pressed=true] {
  border-left: 3px solid var(--primary-600);
  padding-left: 13px;
}

.market-list-header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--gray-200);
  background: var(--gray-50);
  color: var(--gray-500);
  font-size: 12px;
}

.market-list-header-with-filter {
  gap: 4px;
  padding-inline: 10px;
}

.market-constituents-filter {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.market-constituents-filter input {
  accent-color: var(--primary-600);
}

[data-market-sort] {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  min-height: 32px;
  color: var(--gray-600);
  white-space: nowrap;
}

[data-market-sort]:hover, [data-market-sort]:focus-visible {
  color: var(--primary-700);
}

.market-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  border-bottom: 1px solid var(--gray-100);
  text-align: left;
  font-size: 13px;
}

button.market-list-row:hover {
  background: var(--gray-50);
}

button.market-list-row[aria-pressed=true] {
  background: var(--primary-50);
}

.commodity-disclosure {
  display: none;
}

.macro-workspace {
  display: grid;
  grid-template-columns: minmax(0,1fr) 300px;
  gap: 20px;
  padding: 24px;
  overflow: hidden;
}

.macro-main {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
}

.macro-events {
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.macro-controls {
  border: 1px solid var(--gray-200);
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 8px;
}

.macro-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-2xl);
  background: var(--surface);
}

.macro-index-card {
  padding: 16px;
}

.macro-group-card {
  padding: 20px;
}

.insights-workspace {
  display: grid;
  grid-template-columns: minmax(300px,.85fr) minmax(0,1.6fr);
  gap: 20px;
  padding: 24px;
}

/* Use a bounded bottom sheet so date selection stays comfortable on small screens. */

.report-date-sheet {
  position: fixed;
  inset: auto 0 0;
  margin: 0 auto;
  width: 100%;
  max-width: 560px;
  max-height: 70dvh;
  padding: 0;
  border: 1px solid var(--gray-200);
  border-bottom: 0;
  border-radius: var(--radius-3xl) var(--radius-3xl) 0 0;
  background: var(--surface);
  color: var(--gray-900);
  box-shadow: var(--shadow-up);
}

.report-date-sheet::backdrop {
  background: var(--backdrop);
}

.report-date-sheet-body {
  display: flex;
  flex-direction: column;
  max-height: 70dvh;
  padding-bottom: env(safe-area-inset-bottom);
}

.report-date-sheet-handle {
  width: 36px;
  height: 4px;
  flex-shrink: 0;
  margin: 12px auto 20px;
  border-radius: 99px;
  background: var(--gray-300);
}

.report-date-options {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px;
}

.report-date-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 48px;
  margin-bottom: 4px;
  padding: 12px 16px;
  border-radius: var(--radius-xl);
  text-align: left;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.report-date-option:hover {
  background: var(--gray-50);
}

.report-date-option[aria-current=date] {
  background: var(--primary-50);
  color: var(--primary-700);
  font-weight: 600;
}

.news-panel, .report-panel {
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.report-toolbar {
  min-height: 65px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--gray-200);
}

.report-reader {
  flex: 1;
  overflow-y: auto;
  padding: 28px clamp(20px, 4vw, 64px);
}

.report-reader > * {
  max-width: 1040px;
  margin-left: auto;
  margin-right: auto;
}

.report-content {
  line-height: 1.8;
  overflow-wrap: anywhere;
  overflow-x: auto;
}

.report-content table {
  display: table;
  max-width: 100%;
}

.report-content pre {
  overflow-wrap: normal;
}

.news-feed {
  background: var(--gray-50);
}

.news-card {
  padding: 16px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl);
  background: var(--surface);
}

.news-card-compact {
  padding: 12px;
}

.chat-workspace {
  padding: 0;
}

.chat-root {
  height: 100%;
  background: var(--surface);
  overflow: hidden;
}

/* Disclosure controls share placement across chat and simulation. Closing a
   desktop history releases its column; mobile lists overlay the reading area.
   Only the chevron button toggles the disclosure — the summary row is inert. */

.workspace-history {
  position: relative;
  flex-shrink: 0;
  width: 224px;
  min-width: 0;
  align-self: stretch;
  background: var(--gray-50);
  border-right: 1px solid var(--gray-200);
}

.workspace-history > details > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 56px;
  padding: 16px 96px 16px 14px;
  color: var(--gray-600);
  font-size: 13px;
  font-weight: 600;
  list-style: none;
  pointer-events: none;
}

.workspace-history > details > summary::-webkit-details-marker {
  display: none;
}

.workspace-history-label {
  min-width: 0;
  white-space: nowrap;
}

.workspace-history-new {
  position: absolute;
  top: 10px;
  right: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 36px;
  min-height: 36px;
  padding: 6px;
  border: 1px solid var(--primary-100);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--primary-600);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.workspace-history-new:hover {
  background: var(--primary-50);
}

.workspace-history-new:disabled {
  cursor: not-allowed;
  opacity: .5;
}

.workspace-history-new > span[aria-hidden] {
  font-size: 20px;
  line-height: 20px;
}

.workspace-history-new-label {
  display: none;
}

.workspace-history-toggle {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--gray-500);
  transition: color 150ms, background-color 150ms;
}

.workspace-history-toggle:hover {
  color: var(--primary-700);
  background: var(--primary-50);
}

.workspace-history-chevron {
  flex-shrink: 0;
  transition: transform .15s;
}

/* The chevron reads as a direction: down/up on mobile, toward/away from the
   released column on desktop. */

.workspace-history-mobile:has(> details[open]) .workspace-history-chevron {
  transform: rotate(180deg);
}

.workspace-history:not(.workspace-history-mobile) .workspace-history-chevron {
  transform: rotate(-90deg);
}

.workspace-history:not(.workspace-history-mobile):has(> details[open]) .workspace-history-chevron {
  transform: rotate(90deg);
}

.workspace-history-list {
  max-height: calc(100dvh - 180px);
  overflow-y: auto;
}

/* Collapsed: a compact vertical rail card anchored to the workspace corner —
   expand chevron, upright label, "+" — instead of a tall empty column. */

.workspace-history:not(.workspace-history-mobile):has(> details:not([open])) {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 46px;
  min-height: 0;
  align-self: flex-start;
  margin: 14px 0 0 14px;
  padding: 8px 0;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.workspace-history:not(.workspace-history-mobile):has(> details:not([open])) > details {
  width: 100%;
}

.workspace-history:not(.workspace-history-mobile):has(> details:not([open])) > details > summary {
  flex-direction: column;
  justify-content: flex-start;
  gap: 6px;
  min-height: 0;
  padding: 4px 0;
}

.workspace-history:not(.workspace-history-mobile):has(> details:not([open])) .workspace-history-toggle {
  position: static;
  order: -1;
  width: 30px;
  height: 30px;
  border: 0;
  background: transparent;
}

.workspace-history:not(.workspace-history-mobile):has(> details:not([open])) .workspace-history-label {
  display: block;
  writing-mode: vertical-rl;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .18em;
  color: var(--gray-400);
}

.workspace-history:not(.workspace-history-mobile):has(> details:not([open])) .workspace-history-new {
  position: static;
}

.chat-scroll {
  background: var(--surface);
}

.chat-assistant-bubble {
  max-width: 92%;
  background: var(--gray-50);
  padding: 20px;
  border-radius: var(--radius-2xl);
}

.chat-user-bubble {
  border-radius: var(--radius-2xl) var(--radius-2xl) var(--radius-md) var(--radius-2xl);
}

.chat-form {
  background: var(--surface);
  margin-top: 8px;
}

.chat-input-surface {
  border: 1px solid var(--gray-200);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius-xl);
}

.chat-input-surface:focus-within {
  border-color: var(--primary-500);
}

.simulation-page {
  min-height: calc(100dvh - var(--header-height) - env(safe-area-inset-top));
  max-width: 1880px;
  margin: auto;
  padding: 24px;
}

/* Credits follow all session content and reach the page bottom on short sessions. */

.simulation-page > .chart-attribution {
  margin-top: auto;
}

.simulation-grid {
  display: grid;
  grid-template-columns: auto minmax(0,1fr);
  align-items: start;
  gap: 20px;
}

.simulation-history {
  align-self: start;
  overflow: hidden;
}

.simulation-assets {
  min-width: 0;
  border-top: 1px solid var(--gray-200);
}

.simulation-assets > summary {
  padding: 14px 16px;
  color: var(--gray-600);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.simulation-assets-body {
  padding: 0 16px 16px;
}

.simulation-main {
  min-width: 0;
  overflow: hidden;
}

.simulation-session-header {
  padding: 16px;
}

.simulation-tabs {
  display: flex;
  align-items: stretch;
  gap: 6px;
  margin: 12px 16px 0;
  padding: 5px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl);
  background: var(--gray-100);
  font-size: 13px;
  overflow-x: auto;
}

.simulation-tabs button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex: 1;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  color: var(--gray-600);
  font-weight: 600;
  white-space: nowrap;
  transition: background-color .15s, color .15s;
}

.simulation-tabs button:hover {
  background: var(--surface);
  color: var(--primary-700);
}

.simulation-tabs button[aria-pressed=true] {
  border-color: var(--primary-200);
  background: var(--surface);
  color: var(--primary-700);
  box-shadow: var(--shadow-sm);
}

.simulation-tabs [data-isim-chart-tab=ai] {
  color: var(--ai-700);
}

.simulation-tabs [data-isim-chart-tab=ai][aria-pressed=true] {
  border-color: var(--ai-200);
  background: var(--ai-50);
  color: var(--ai-700);
}

/* Only the small AI glyph breathes; labels and prices remain stable to read. */

.simulation-ai-indicator {
  animation: simulation-ai-pulse 2.6s ease-in-out infinite;
}

.simulation-tabs [data-isim-chart-tab=ai][aria-pressed=true] .simulation-ai-indicator {
  animation: none;
}

@keyframes simulation-ai-pulse {
  0%, 100% {
    opacity: 1;
  }

  50% {
    opacity: .4;
  }
}

@media (prefers-reduced-motion: reduce) {
  .simulation-ai-indicator {
    animation: none;
  }
}

/* The full shared report stays readable on narrow screens without omitting facts. */

.simulation-summary {
  min-width: 0;
  margin: 12px;
  padding: 16px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl);
  background: var(--surface);
}

.simulation-summary-content {
  font-size: 14px;
}

.simulation-summary-content h2 {
  margin-top: 0;
  font-size: 17px;
}

.simulation-summary-content h3 {
  font-size: 15px;
}

.simulation-summary-content table {
  display: block;
  width: 100%;
  overflow-x: auto;
}

.simulation-summary-content th, .simulation-summary-content td {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* Summary visuals consume the shared semantic model. Labels may move for
   readability; price ticks and oscillator positions retain their true scale. */

.market-summary {
  min-width: 0;
  font-size: 14px;
}

.summary-as-of {
  margin-bottom: 10px;
  color: var(--gray-500);
  font-size: 11px;
}

.summary-facts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  align-items: start;
  gap: 12px;
}

.summary-card {
  position: relative;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl);
  background: var(--surface);
}

.summary-card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.summary-card h3 {
  margin: 0;
  color: var(--gray-700);
  font-size: 13px;
  font-weight: 700;
}

.summary-help > summary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--gray-300);
  border-radius: 50%;
  color: var(--gray-500);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.summary-help > summary::-webkit-details-marker {
  display: none;
}

.summary-help[open] > summary {
  border-color: var(--primary-300);
  background: var(--primary-50);
  color: var(--primary-700);
}

/* Keep the short help inside its card width even on narrow WebViews. */

.summary-help-content {
  position: absolute;
  top: 46px;
  left: 12px;
  right: 12px;
  z-index: 20;
  max-height: min(20rem, 50dvh);
  overflow-y: auto;
  padding: 12px;
  border: 1px solid var(--primary-100);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  color: var(--gray-600);
  font-size: 12px;
  line-height: 1.6;
}

.summary-help-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--gray-900);
}

.summary-help-heading button {
  min-width: 28px;
  min-height: 28px;
  color: var(--gray-500);
  font-size: 20px;
}

.summary-help-content p {
  margin-top: 8px;
}

.summary-help-content .summary-help-note {
  color: var(--gray-500);
  font-size: 11px;
}

.summary-indicators {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.market-summary.is-compact .summary-facts-grid {
  grid-template-columns: minmax(0,1fr);
}

/* Native scrolling changes presentation only: all three shared cards remain
   in the DOM, without carousel state or a second set of market facts. */

.market-summary.is-compact .summary-indicators {
  order: -1;
  display: flex;
  gap: 28px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  overscroll-behavior-x: contain;
  padding-bottom: 8px;
  scrollbar-width: thin;
}

.market-summary.is-compact .summary-indicators > .summary-card {
  flex: 0 0 calc(100% - 60px);
  scroll-snap-align: start;
}

/* Center decorative chevrons in each gap, not over the readings. Attaching
   them to all but the last card keeps native scrolling as the only state. */

.market-summary.is-compact .summary-indicators > .summary-card:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 50%;
  right: -22px;
  z-index: 1;
  width: 16px;
  height: 16px;
  border-left: 3px solid var(--primary-600);
  border-bottom: 3px solid var(--primary-600);
  transform: translateY(-50%) rotate(45deg);
  pointer-events: none;
  animation: simulation-ai-pulse 2.6s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .market-summary.is-compact .summary-indicators > .summary-card:not(:last-child)::after {
    animation: none;
  }
}

/* Fixed help escapes the horizontal scroller's clipping, while the existing
   native disclosure and view-scoped dismissal keep owning its interaction. */

.market-summary.is-compact .summary-indicators .summary-help-content {
  position: fixed;
  top: auto;
  bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom) + 12px);
  left: 16px;
  right: 16px;
  z-index: 50;
  max-width: 544px;
  margin-left: auto;
}

/* Hosts choose whether profile stays alongside the data or becomes a tab. */

.stock-detail {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.stock-detail .stock-detail-tabs {
  margin: 0 0 12px;
}

.stock-detail-body {
  min-width: 0;
  min-height: 0;
  flex: 1;
}

.stock-detail-chart {
  height: clamp(280px, 50dvh, 540px);
}

.structure-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-bottom: 10px;
  color: var(--gray-500);
  font-size: 11px;
}

.structure-legend:empty {
  display: none;
}

.structure-legend > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.price-structure {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-2xl);
  background: var(--surface);
}

.structure-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 12px;
}

.structure-heading h3 {
  color: var(--gray-900);
  font-size: 14px;
  font-weight: 650;
}

.structure-heading > span, .structure-asof {
  color: var(--gray-500);
  font-size: 11px;
}

.structure-overview {
  margin-top: 10px;
  color: var(--gray-700);
  font-size: 14px;
  line-height: 1.7;
}

.structure-asof {
  margin-top: 4px;
  line-height: 1.6;
}

.structure-trends {
  margin-top: 14px;
}

.structure-trend {
  padding: 12px 0;
  border-top: 1px solid var(--gray-100);
}

.structure-line-heading {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
}

.structure-line-heading h4, .structure-level > h4 {
  color: var(--gray-700);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.6;
}

.structure-swatch {
  display: inline-block;
  flex-shrink: 0;
  width: 22px;
  border-top: 2px var(--structure-style) var(--structure-color);
}

.structure-position {
  margin-left: auto;
  padding: 2px 7px;
  border-radius: var(--radius-md);
  background: var(--gray-100);
  color: var(--gray-600);
  font-size: 10px;
}

.structure-statement {
  margin-top: 8px;
  color: var(--gray-700);
  font-size: 13px;
  line-height: 1.7;
}

.structure-evidence {
  margin-top: 5px;
  color: var(--gray-500);
  font-size: 11px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.structure-levels {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(min(100%,200px),1fr));
  gap: 10px;
  margin-top: 12px;
}

.structure-level {
  min-width: 0;
  padding: 12px;
  border-radius: var(--radius-xl);
  background: var(--gray-50);
}

.structure-level-price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  margin-top: 8px;
  font-variant-numeric: tabular-nums;
}

.structure-level-price strong {
  color: var(--gray-900);
  font-size: 20px;
  font-weight: 650;
}

.structure-level-price span {
  color: var(--gray-500);
  font-size: 11px;
}

.structure-empty {
  margin-top: 10px;
  color: var(--gray-500);
  font-size: 12px;
  line-height: 1.7;
}

.structure-method {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--gray-100);
  color: var(--gray-500);
  font-size: 11px;
  line-height: 1.8;
}

.structure-method summary {
  width: -moz-fit-content;
  width: fit-content;
  color: var(--gray-600);
}

.structure-method p {
  margin-top: 8px;
  white-space: pre-line;
}

.market-chart > [data-desktop-stock-detail] {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.stock-detail .stock-detail-tabs {
  display: flex;
}

.ksimilarity-rules {
  margin: 8px 0;
  font-size: 12px;
  color: var(--gray-500);
}

.ksimilarity-rules p {
  margin-top: 8px;
}

.ksimilarity-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 12px 0;
  font-size: 12px;
}

.ksimilarity-controls select {
  max-width: 100%;
  padding: 6px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.ksimilarity-access {
  padding: 14px;
  margin: 12px 0;
  border: 1px solid var(--primary-200);
  border-radius: var(--radius-xl);
  background: var(--primary-50);
  font-size: 13px;
}

.ksimilarity-access p {
  margin-bottom: 10px;
}

.ksimilarity-example-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-500);
}

.ksimilarity-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 12px 0;
  color: var(--gray-500);
  font-size: 11px;
}

.ksimilarity-legend span::before {
  content: '';
  display: inline-block;
  width: 14px;
  height: 9px;
  margin-right: 5px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--color-up) 50%, var(--color-down) 50%);
}

.ksimilarity-legend span:nth-child(2)::before {
  background: linear-gradient(90deg, var(--color-up-muted) 50%, var(--color-down-muted) 50%);
}

.ksimilarity-legend small {
  flex-basis: 100%;
  font-size: inherit;
}

/* Every row keeps the same description width and plotting viewport, including
   the target's ten empty future slots; metadata never interrupts vertical comparison. */

.ksimilarity-comparison {
  --ksimilarity-description-width: clamp(84px, 22%, 136px);
}

.ksimilarity-card {
  display: grid;
  grid-template-columns: var(--ksimilarity-description-width) minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 12px 0;
  border-top: 1px solid var(--gray-200);
}

.ksimilarity-target {
  border-top: 0;
}

.ksimilarity-description {
  min-width: 0;
  overflow-wrap: anywhere;
}

.ksimilarity-description h3 {
  margin: 4px 0 12px;
  color: var(--gray-900);
  font-size: 15px;
  font-weight: 700;
}

.ksimilarity-caption, .ksimilarity-note, .ksimilarity-description dt {
  color: var(--gray-500);
  font-size: 10px;
  line-height: 1.5;
}

.ksimilarity-description dd {
  margin: 2px 0 10px;
  color: var(--gray-700);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.ksimilarity-description .ksimilarity-score {
  color: var(--gray-900);
  font-size: 14px;
  font-weight: 600;
}

.ksimilarity-chart {
  height: 180px;
  min-width: 0;
}

.summary-muted {
  margin: 6px 0;
  color: var(--gray-400);
  font-size: 10px;
}

.summary-current-price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 12px;
  margin-bottom: 14px;
  color: var(--gray-700);
  font-size: 12px;
}

.summary-latest-close, .summary-current-atr {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}

.summary-current-price strong {
  font-variant-numeric: tabular-nums;
}

.summary-signals {
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--gray-100);
}

.summary-signals h3 {
  margin-bottom: 8px;
  color: var(--gray-500);
  font-size: 12px;
  font-weight: 600;
}

.market-signal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.market-signal-tag {
  display: inline-flex;
  max-width: 100%;
  padding: 4px 10px;
  border: 1px solid var(--gray-200);
  border-radius: 999px;
  background: var(--gray-50);
  color: var(--gray-600);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.market-signal-tag[data-signal-direction=long] {
  border-color: var(--color-up-border);
  background: var(--color-up-soft);
  color: var(--color-up);
}

.market-signal-tag[data-signal-direction=short] {
  border-color: var(--color-down-border);
  background: var(--color-down-soft);
  color: var(--color-down);
}

.summary-latest-close strong {
  color: var(--gray-900);
  font-size: 25px;
  font-weight: 800;
}

.summary-current-atr strong {
  font-size: 14px;
}

.summary-current-atr small {
  color: var(--gray-500);
  font-size: 10px;
}

.price-axis {
  position: relative;
  min-width: 0;
}

.price-axis-line {
  stroke: var(--gray-300);
  stroke-width: 1.5;
}

/* Family colors are categorical; they do not encode bullish/bearish opinions. */

[data-price-family=ma] {
  --level-color: var(--primary-700);
}

[data-price-family=fib] {
  --level-color: #7c3aed;
}

[data-price-family=boll] {
  --level-color: #0e7490;
}

[data-price-family=pivot] {
  --level-color: var(--warning-700);
}

[data-price-family=extreme] {
  --level-color: var(--gray-500);
}

[data-price-family=current] {
  --level-color: var(--gray-900);
}

.price-axis-reference path {
  fill: none;
  stroke: var(--level-color);
  stroke-opacity: .65;
  stroke-width: 1;
}

.price-axis-reference circle {
  fill: var(--surface);
  stroke: var(--level-color);
  stroke-width: 1;
}

.price-axis-current path {
  fill: none;
  stroke: var(--level-color);
  stroke-width: 2;
}

.price-axis-current circle {
  fill: var(--level-color);
  stroke: var(--gray-200);
  stroke-width: 3;
}

.price-axis-label {
  position: absolute;
  left: 68px;
  right: 0;
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  -moz-column-gap: 6px;
       column-gap: 6px;
  align-items: center;
  min-height: 26px;
  transform: translateY(-50%);
  font-size: 10px;
  line-height: 13px;
  color: var(--gray-500);
}

.price-axis-label > span {
  grid-row: span 2;
  overflow-wrap: anywhere;
  color: var(--level-color);
}

.price-axis-label strong {
  text-align: right;
  font-size: 12px;
  color: var(--level-color);
  font-variant-numeric: tabular-nums;
}

.price-axis-label small {
  text-align: right;
  color: var(--gray-500);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.price-axis-label.is-current {
  border-radius: var(--radius-md);
  background: var(--gray-200);
  color: var(--gray-900);
  font-weight: 700;
}

.price-axis-label.is-current > span {
  font-size: 12px;
}

.price-axis-label.is-current strong {
  font-size: 14px;
  line-height: 14px;
  font-weight: 800;
}

.price-axis-label.is-current small {
  color: var(--gray-700);
}

.summary-nearest {
  display: grid;
  gap: 4px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--gray-100);
  font-size: 10px;
  color: var(--gray-500);
}

.summary-unavailable {
  margin-top: 10px;
  color: var(--gray-400);
  font-size: 10px;
}

.summary-unavailable > div {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-top: 6px;
}

.summary-meter + .summary-meter {
  margin-top: 18px;
}

.meter-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--gray-600);
}

.meter-heading strong {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  color: var(--gray-900);
}

.band-badge {
  display: inline-flex;
  padding: 1px 5px;
  border-radius: var(--radius-md);
  background: var(--gray-100);
  color: var(--gray-500);
  font-size: 10px;
  white-space: nowrap;
}

.band-low {
  background: var(--primary-50);
  color: var(--primary-600);
}

.band-middle {
  background: var(--gray-100);
  color: var(--gray-500);
}

.band-high {
  background: var(--warning-50);
  color: var(--warning-700);
}

.meter-track {
  position: relative;
  height: 10px;
  margin: 14px 0 0;
  border-radius: var(--radius-md);
  background: var(--gray-100);
}

.meter-zone {
  position: absolute;
  top: 0;
  height: 100%;
}

.zone-low {
  background: var(--primary-100);
}

.zone-middle {
  background: var(--gray-200);
}

.zone-high {
  background: var(--warning-200);
}

.zone-outside {
  background: var(--gray-100);
}

.meter-marker {
  position: absolute;
  top: calc(-5px + var(--lane,0) * 5px);
  width: 9px;
  height: 9px;
  transform: translateX(-50%);
  border: 1.5px solid var(--surface);
  border-radius: 50%;
  background: var(--primary-600);
  box-shadow: 0 0 0 1px var(--primary-600);
  z-index: 1;
}

.marker-dea, .marker-d {
  border-radius: 1px;
  background: var(--warning-600);
  box-shadow: 0 0 0 1px var(--warning-600);
  transform: translateX(-50%) rotate(45deg);
}

.marker-j {
  border-radius: 1px;
  background: #7c3aed;
  box-shadow: 0 0 0 1px #7c3aed;
}

.meter-ticks {
  position: relative;
  height: 18px;
  margin-top: 6px;
  font-size: 9px;
  color: var(--gray-400);
  font-variant-numeric: tabular-nums;
}

.meter-tick {
  position: absolute;
  transform: translateX(-50%);
}

.meter-tick:first-child {
  transform: none;
}

.meter-tick:last-child {
  transform: translateX(-100%);
}

.meter-legends {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 10px;
}

.marker-legend {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 11px;
}

.marker-legend strong {
  font-variant-numeric: tabular-nums;
}

.marker-legend small {
  font-size: 9px;
  color: var(--gray-500);
}

.legend-dif, .legend-k {
  color: var(--primary-600);
}

.legend-dea, .legend-d {
  color: var(--warning-700);
}

.legend-j {
  color: #7c3aed;
}

.summary-comparison {
  color: var(--gray-500);
  font-size: 11px;
}

.zero-line {
  position: absolute;
  left: 50%;
  top: -5px;
  height: 20px;
  border-left: 1px solid var(--gray-500);
  z-index: 1;
}

.macd-track {
  background: linear-gradient(to right,var(--warning-100) 50%,var(--primary-100) 50%);
}

.hist-heading {
  margin-top: 12px;
}

.macd-histogram {
  position: absolute;
  top: 0;
  height: 10px;
  min-width: 0;
  border-radius: 2px;
}

.hist-above {
  background: var(--primary-600);
}

.hist-below {
  background: var(--warning-600);
}

.summary-events {
  margin-top: 20px;
  border-top: 1px solid var(--gray-200);
  padding-top: 12px;
}

.summary-event-day {
  margin-top: 14px;
}

.summary-event-day h4 {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin: 0;
  font-size: 13px;
}

.summary-event-day h4 small {
  color: var(--gray-500);
  font-size: 11px;
  font-weight: 400;
}

.summary-event-day ul {
  margin-top: 6px;
}

/* Event emphasis follows the same side colors as operation buttons, not P&L. */

.summary-events .summary-trade-buy, .summary-events .summary-trade-buy strong {
  color: var(--color-up);
}

.summary-events .summary-trade-sell, .summary-events .summary-trade-sell strong {
  color: var(--color-down);
}

.simulation-candidate-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  min-width: 0;
}

.simulation-focus-strip {
  display: flex;
  flex: 1;
  min-width: 0;
  gap: 8px;
  overflow-x: auto;
}

.simulation-focus-chip {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  justify-content: center;
  min-height: 44px;
  padding: 6px 10px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  font-size: 13px;
  font-weight: 600;
}

.simulation-focus-chip small {
  font-size: 10px;
  font-weight: 400;
  color: var(--gray-500);
}

.simulation-focus-chip:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.simulation-focus-chip[aria-pressed=true] {
  border-color: var(--primary-500);
  background: var(--primary-50);
  color: var(--primary-700);
}

.simulation-candidate-toolbar .simulation-reroll {
  flex-shrink: 0;
  min-height: 44px;
  padding: 6px 10px;
  border: 1px solid var(--primary-100);
  border-radius: var(--radius-lg);
  background: var(--primary-50);
}

[data-isim-chart] {
  min-height: 320px;
}

[data-isim-ai-panel] {
  min-height: 460px;
  max-height: 720px;
}

.simulation-assets-body {
  display: grid;
  gap: 16px;
}

.simulation-positions, .simulation-asset-group {
  padding: 16px;
  border-radius: var(--radius-2xl);
}

.simulation-asset-group {
  border: 1px solid var(--gray-200);
  background: var(--surface);
}

.portfolio-page, .billing-page {
  max-width: 1600px;
  margin: auto;
  padding: 32px;
}

.portfolio-overview {
  display: grid;
  gap: 16px;
  padding: 20px;
}

.portfolio-summary {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 12px;
}

.portfolio-summary > .metric-card:nth-child(4) {
  background: var(--primary-50);
}

.portfolio-summary > .metric-card:nth-child(4) .metric-value {
  color: var(--primary-700);
}

.portfolio-actions {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 16px;
  align-items: start;
}

.portfolio-actions > details {
  padding: 18px 20px;
}

.portfolio-actions > details > summary {
  font-size: 14px;
  font-weight: 600;
}

.portfolio-actions > details[open] > summary {
  margin-bottom: 16px;
}

.portfolio-actions p {
  line-height: 1.7;
}

.portfolio-actions label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--gray-600);
}

.portfolio-actions input, .portfolio-actions select {
  width: 100%;
}

.portfolio-actions button {
  min-height: 40px;
  font-size: 13px;
}

.portfolio-holdings {
  overflow: hidden;
}

.portfolio-holdings .data-table {
  min-width: 900px;
}

.portfolio-holdings td:not(:first-child):not(:last-child), .portfolio-holdings th:not(:first-child):not(:last-child) {
  text-align: right;
  white-space: nowrap;
}

.portfolio-holdings td:last-child {
  white-space: nowrap;
}

.portfolio-holdings td:last-child button {
  min-height: 32px;
  font-size: 12px;
}

.portfolio-notice:empty {
  display: none;
}

.portfolio-notice {
  border: 1px solid var(--warning-200);
  border-radius: var(--radius-xl);
  background: var(--warning-50);
  color: var(--warning-800);
  padding: 12px 16px;
}

.billing-summary {
  padding: 24px;
}

.billing-summary [data-used], .billing-summary [data-remaining] {
  font-variant-numeric: tabular-nums;
  font-size: 30px;
  letter-spacing: -.035em;
}

.billing-summary [data-remaining] {
  color: var(--primary-700);
}

.plan-card {
  padding: 28px;
  border-radius: var(--radius-2xl);
  border: 1px solid var(--gray-200);
  background: var(--surface);
}

.plan-card[data-plan=PREMIUM] {
  border-top: 3px solid var(--primary-600);
  padding-top: 26px;
}

.plan-card button {
  min-height: 56px;
  padding: 12px 16px;
  border-radius: var(--radius-xl);
  border-color: var(--gray-200);
}

.plan-card button strong {
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.entity-drawer {
  border: 0;
  border-left: 1px solid var(--gray-200);
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

.entity-drawer::backdrop {
  background: var(--backdrop);
}

.entity-drawer > header {
  padding: 20px 24px;
}

.entity-drawer > div {
  padding: 24px;
}

@media (min-width: 1024px) and (max-width: 1399px) {
  .app-header {
    gap: 14px;
    padding: 0 16px;
  }

  .brand-caption, .desktop-navigation svg, .account-name {
    display: none;
  }

  .desktop-navigation a {
    padding: 9px 8px;
    font-size: 12px;
  }

  .market-workspace {
    grid-template-columns: 180px minmax(0,1fr);
  }

  .market-commodities {
    display: none;
  }

  .commodity-disclosure {
    display: block;
    margin: 12px;
    padding: 12px;
    font-size: 12px;
    background: var(--gray-50);
    border-radius: var(--radius-xl);
  }

  .simulation-grid {
    gap: 12px;
  }

  .simulation-history {
    width: 190px;
  }

  .simulation-page {
    padding: 20px;
  }

  .macro-workspace {
    grid-template-columns: minmax(0,1fr) 250px;
  }
}

@media (max-width: 1023px) {
  :root {
    --header-height: 0px;
  }

  .app-shell {
    padding-bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom));
  }

  .app-header {
    display: none;
  }

  .app-brand {
    font-size: 21px;
  }

  .brand-mark {
    width: 30px;
    height: 32px;
    font-size: 21px;
  }

  .brand-caption, .desktop-navigation, .account-name {
    display: none;
  }

  .app-account {
    gap: 8px;
  }

  .mobile-navigation {
    display: grid;
    grid-template-columns: repeat(5,minmax(0,1fr));
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 45;
    padding: 0 8px env(safe-area-inset-bottom);
    background: var(--surface);
    border-top: 1px solid var(--gray-200);
  }

  .mobile-navigation > a, .navigation-more > summary {
    display: flex;
    height: var(--mobile-nav-height);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    font-size: 10px;
    font-weight: 500;
    color: var(--gray-500);
    white-space: nowrap;
  }

  .mobile-navigation svg {
    width: 20px;
    height: 20px;
  }

  .mobile-navigation [aria-current=page], .navigation-more.is-current > summary {
    color: var(--primary-600);
    font-weight: 650;
  }

  .navigation-more > summary {
    list-style: none;
  }

  .navigation-more > summary::-webkit-details-marker {
    display: none;
  }

  .more-menu {
    position: absolute;
    right: 12px;
    bottom: calc(100% + 10px);
    width: min(280px,calc(100vw - 24px));
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-2xl);
    padding: 8px;
    background: var(--surface);
    box-shadow: var(--shadow-md);
  }

  .more-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border-radius: var(--radius-lg);
    font-size: 14px;
  }

  .more-menu a[aria-current=page] {
    background: var(--primary-50);
  }

  .more-menu {
    max-height: calc(100dvh - var(--mobile-nav-height) - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 24px);
    overflow-y: auto;
  }

  .more-account-tools {
    margin-top: 4px;
    padding: 8px 6px 6px;
    border-top: 1px solid var(--gray-200);
  }

  .more-account-tools .app-brand {
    padding: 8px;
    font-size: 20px;
  }

  .more-account-tools .app-account {
    margin: 8px 0 0;
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .more-account-tools .account-name {
    display: block;
    flex-basis: 100%;
    max-width: none;
    padding: 0 2px;
  }

  .more-account-tools .account-name:empty {
    display: none;
  }

  .workspace {
    height: calc(100dvh - var(--header-height) - var(--mobile-nav-height) - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    min-height: 0;
  }

  .mobile-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 56px;
    padding: 12px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--gray-200);
  }

  .mobile-page-header h1 {
    font-size: 17px;
    font-weight: 650;
  }

  .mobile-market-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--gray-200);
    background: var(--surface);
    color: var(--gray-600);
    border-radius: var(--radius-lg);
  }

  .market-list-card {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-xl);
    margin: 12px;
    overflow: hidden;
    background: var(--surface);
  }

  .mobile-stock-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 16px;
    border-bottom: 1px solid var(--gray-100);
    text-align: left;
  }

  .mobile-stock-row:active, .market-commodity-link:active {
    background: var(--gray-100);
  }

  .market-commodity-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: calc(100% - 24px);
    padding: 16px;
    margin: 12px;
    border: 1px solid var(--primary-100);
    border-radius: var(--radius-xl);
    background: var(--surface);
    text-align: left;
  }

  .mobile-chart-panel {
    margin: 12px;
    padding: 16px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-xl);
    background: var(--surface);
    height: 320px;
    display: flex;
    flex-direction: column;
  }

  .macro-controls {
    margin: 12px;
  }

  .macro-mobile-cards {
    padding: 12px 44px 12px 12px;
  }

  .macro-index-card {
    padding: 12px;
  }

  .macro-month-bar {
    position: fixed;
    right: 0;
    top: calc(var(--header-height) + 90px);
    bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom) + 16px);
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border: 1px solid var(--gray-200);
    border-right: 0;
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
    background: var(--surface);
  }

  .month-idx {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    flex: 1;
    min-height: 24px;
    font-size: 11px;
    font-weight: 700;
    color: var(--gray-500);
  }

  .month-idx.is-selected {
    color: var(--primary-600);
    background: var(--primary-100);
    border-radius: var(--radius-md);
  }

  .macro-events-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom));
    z-index: 30;
    max-height: 60vh;
    border-top: 1px solid var(--gray-200);
    border-radius: var(--radius-3xl) var(--radius-3xl) 0 0;
    background: var(--surface);
    box-shadow: var(--shadow-up);
    transition: transform 300ms;
  }

  .workspace-history-mobile {
    width: auto;
    margin: 0;
    overflow: visible;
    border: none;
    border-bottom: 1px solid var(--gray-200);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .workspace-history-mobile > details > summary {
    min-height: 52px;
    padding: 10px 132px 10px 0;
    font-size: 12px;
  }

  .workspace-history-mobile .workspace-history-list {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    z-index: 15;
    max-height: min(16rem, 35dvh);
    overflow-y: auto;
    padding: 8px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-xl);
    background: var(--surface);
    box-shadow: var(--shadow-md);
  }

  .workspace-history-mobile .workspace-history-new {
    top: 8px;
    right: 44px;
    padding: 6px 10px;
    font-size: 12px;
  }

  .workspace-history-mobile .workspace-history-toggle {
    top: 8px;
    right: 0;
  }

  .workspace-history-mobile .workspace-history-new-label {
    display: inline;
  }

  .chat-history-toolbar.workspace-history-mobile {
    margin: 0 16px;
  }

  .chat-assistant-bubble {
    max-width: 100%;
    padding: 14px;
  }

  .simulation-page {
    min-height: calc(100dvh - var(--header-height) - var(--mobile-nav-height) - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    padding: 16px;
    gap: 12px;
  }

  .simulation-grid {
    grid-template-columns: minmax(0,1fr);
    gap: 14px;
  }

  .simulation-main {
    order: 0;
  }

  /* Narrow account cards retain the full number, rather than clipping or abbreviating it. */

  .simulation-account {
    gap: 6px;
    padding-left: 12px;
    padding-right: 12px;
  }

  .simulation-account-metric {
    min-width: 0;
    padding: 8px;
  }

  .simulation-account-value {
    margin-top: 6px;
    font-size: 14px;
    line-height: 20px;
    overflow-wrap: anywhere;
  }

  .simulation-assets-body {
    padding: 0 12px 12px;
  }

  .simulation-summary {
    padding: 12px;
  }

  .simulation-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0,1fr));
    gap: 3px;
    padding: 4px;
    margin-left: 12px;
    margin-right: 12px;
    font-size: 11px;
    overflow: visible;
  }

  .simulation-tabs button {
    min-width: 0;
    min-height: 36px;
    padding: 6px 3px;
    gap: 3px;
    white-space: nowrap;
    line-height: 1.4;
  }

  [data-isim-chart] {
    min-height: 260px;
  }

  .portfolio-page, .billing-page {
    padding: 20px 16px;
  }

  .portfolio-overview {
    padding: 16px;
  }

  .portfolio-summary {
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 8px;
  }

  .portfolio-summary .metric-value {
    font-size: 18px;
    overflow-wrap: anywhere;
  }

  .portfolio-summary .metric-card {
    padding: 12px;
  }

  .portfolio-actions {
    grid-template-columns: minmax(0,1fr);
  }

  .portfolio-actions form {
    grid-template-columns: minmax(0,1fr);
  }

  .portfolio-actions form button {
    grid-column: auto;
  }

  .portfolio-actions form.flex label {
    flex: 1 1 100%;
  }

  .plan-card, .billing-summary {
    padding: 20px;
  }

  .entity-drawer > header {
    padding: 16px;
  }

  .entity-drawer > div {
    padding: 16px;
  }
}

/* Graph traversal owns no layout state: the same cards and selection serve both devices. */

.graph-workspace {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 20px;
  gap: 12px;
}

.graph-heading {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.graph-heading p, .graph-hint {
  font-size: 12px;
  line-height: 1.6;
  color: var(--gray-500);
}

.graph-heading > a {
  flex-shrink: 0;
  font-size: 12px;
}

.graph-controls {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto;
  align-items: end;
  gap: 12px;
  flex-shrink: 0;
}

.graph-toolbar, .graph-advanced {
  display: contents;
}

.graph-controls label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  color: var(--gray-600);
}

.graph-filters {
  display: flex;
  align-items: end;
  gap: 12px;
}

.graph-advanced-toggle, .graph-search-icon {
  display: none;
}

.graph-search {
  flex: 1;
  min-width: 100px;
}

.graph-controls input, .graph-controls select {
  min-width: 0;
  width: 100%;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 9px 10px;
  color: var(--gray-900);
  font-size: 13px;
}

.graph-chain-picker {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(280px, 1.3fr) minmax(240px, .7fr);
  gap: 12px;
  align-items: stretch;
}

.graph-hint {
  grid-column: 1 / -1;
}

.graph-chain-picker > label {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  color: var(--gray-600);
}

.graph-chain-picker select {
  min-width: 0;
  width: 100%;
  border: 1px solid var(--primary-200);
  border-radius: var(--radius-xl);
  background: var(--surface);
  padding: 11px 12px;
  color: var(--primary-900);
  font-size: 13px;
  font-weight: 600;
}

.graph-current {
  display: grid;
  grid-template-columns: auto minmax(0,1fr);
  align-content: center;
  -moz-column-gap: 10px;
       column-gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl);
  background: var(--gray-50);
}

.graph-current:empty {
  display: none;
}

.graph-current span {
  grid-row: 1 / 3;
  align-self: center;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--primary-100);
  color: var(--primary-700);
  font-size: 10px;
  white-space: nowrap;
}

.graph-current strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--gray-900);
  font-size: 12px;
}

.graph-current small {
  color: var(--gray-500);
  font-size: 10px;
}

.graph-scroll {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
}

[data-graph-status]:not(:empty) {
  margin-bottom: 12px;
  padding: 16px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl);
  background: var(--surface);
  font-size: 13px;
  color: var(--gray-500);
}

.graph-card {
  min-width: 0;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl);
  padding: 16px;
  background: var(--surface);
}

.graph-chain-card {
  width: min(100%, 1200px);
  margin: 0 auto;
}

.graph-root + .graph-root {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--gray-200);
}

.graph-entity {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  background: var(--gray-50);
  font-size: 13px;
  text-align: left;
  overflow-wrap: anywhere;
}

.graph-entity:hover {
  border-color: var(--primary-300);
}

.graph-entity small {
  color: var(--gray-500);
  font-size: 10px;
}

.graph-entity.selected {
  background: var(--primary-50);
  border-color: var(--primary-300);
  color: var(--primary-700);
}

.graph-entity.target {
  background: var(--primary-600);
  border-color: var(--primary-600);
  color: white;
}

.graph-entity.target small {
  color: var(--primary-100);
}

[data-graph-target]:not([hidden]) {
  padding: 1px 4px;
  border-radius: var(--radius-md);
  background: #ffffff26;
  font-size: 10px;
}

.graph-tags {
  margin-top: 8px;
  font-size: 11px;
  line-height: 1.6;
  color: var(--gray-500);
  overflow-wrap: anywhere;
}

.graph-tree {
  margin-top: 12px;
}

.graph-edge {
  margin-top: 12px;
  border-left: 2px solid var(--gray-200);
  padding: 2px 0 2px 12px;
}

.graph-edge.selected {
  border-left-color: var(--primary-500);
}

.graph-relation-label {
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--gray-600);
  overflow-wrap: anywhere;
}

.graph-relation-label > span {
  font-size: 10px;
  color: var(--gray-400);
}

.graph-edge.selected > .graph-relation-label {
  color: var(--primary-700);
}

.graph-evidence {
  margin-top: 8px;
  font-size: 11px;
  color: var(--gray-500);
  overflow-wrap: anywhere;
}

.graph-evidence summary, .graph-branch > summary {
  padding: 6px 0;
  cursor: pointer;
}

.graph-evidence > div {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  border-radius: var(--radius-md);
  background: var(--gray-50);
  line-height: 1.7;
}

.graph-evidence blockquote {
  color: var(--gray-700);
}

.graph-evidence a, .graph-branch > summary {
  color: var(--primary-600);
}

.graph-original, .graph-reference {
  font-size: 11px;
  line-height: 1.7;
  color: var(--gray-400);
}

.graph-reference {
  margin-top: 8px;
}

.graph-branch > summary {
  font-size: 11px;
}

.graph-more {
  display: block;
  margin: 16px auto;
}

.graph-more[hidden] {
  display: none;
}

.graph-selection {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  padding: 12px 16px;
  border: 1px solid var(--primary-100);
  border-radius: var(--radius-xl);
  background: var(--surface);
}

[data-graph-count] {
  font-size: 12px;
  color: var(--primary-700);
}

[data-graph-range] {
  margin-top: 4px;
  font-size: 10px;
  color: var(--gray-400);
}

.graph-selection-actions {
  display: flex;
  gap: 8px;
}

.graph-selection-counts {
  min-width: 0;
  font-variant-numeric: tabular-nums;
}

.graph-selection button {
  padding: 8px 10px;
  font-size: 12px;
}

.graph-selection-actions button {
  gap: 6px;
}

.graph-preview {
  width: min(720px, calc(100vw - 24px));
  max-height: 85dvh;
  padding: 0;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-2xl);
  background: var(--surface);
}

.graph-preview[open] {
  display: flex;
  flex-direction: column;
}

.graph-preview::backdrop {
  background: var(--backdrop);
}

.graph-preview header, .graph-preview footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  flex-shrink: 0;
}

.graph-preview header {
  border-bottom: 1px solid var(--gray-200);
}

.graph-preview h2 {
  font-size: 16px;
  font-weight: 650;
}

.graph-preview > p {
  padding: 12px 16px;
  font-size: 12px;
  color: var(--gray-500);
}

.graph-preview pre {
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.8;
  background: var(--gray-50);
}

.graph-preview footer {
  border-top: 1px solid var(--gray-200);
}

.graph-preview footer p {
  font-size: 12px;
  color: var(--warning-700);
}

.graph-preview footer button {
  flex-shrink: 0;
  font-size: 12px;
}

.graph-workspace :focus-visible {
  outline: 2px solid var(--primary-600);
  outline-offset: 3px;
}

@media (max-width: 1023px) {
  .graph-workspace {
    padding: 12px;
    gap: 8px;
  }

  .graph-heading p {
    display: none;
  }

  .graph-controls {
    display: block;
    position: relative;
  }

  .graph-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .graph-controls .graph-search {
    display: block;
    position: relative;
    min-width: 0;
  }

  .graph-search-label {
    display: none;
  }

  .graph-search input {
    height: 42px;
    padding: 10px 36px 10px 12px;
    font-size: 16px;
  }

  .graph-search input::-moz-placeholder {
    font-size: 12px;
  }

  .graph-search input::placeholder {
    font-size: 12px;
  }

  .graph-search input::-webkit-search-cancel-button {
    display: none;
  }

  .graph-search-icon {
    display: flex;
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    color: var(--gray-400);
    pointer-events: none;
  }

  .graph-advanced-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex-shrink: 0;
    min-height: 42px;
    padding: 9px 10px;
    font-size: 12px;
  }

  .graph-advanced-toggle svg {
    width: 14px;
    height: 14px;
  }

  .graph-advanced-toggle[aria-expanded=true] svg {
    transform: rotate(180deg);
  }

  .graph-advanced-toggle[aria-expanded=true], .graph-advanced-toggle.has-filter {
    border-color: var(--primary-300);
    background: var(--primary-50);
    color: var(--primary-700);
  }

  /* Filtering is transient UI over the graph, never another fixed block that
     reduces its reading area. Desktop keeps the same controls always visible. */

  .graph-advanced {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 20;
    max-height: min(60dvh, 420px);
    overflow-y: auto;
    padding: 12px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-2xl);
    background: var(--surface);
    box-shadow: var(--shadow-md);
  }

  .graph-advanced[data-open=true] {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .graph-filters {
    display: grid;
    grid-template-columns: minmax(0,1fr) minmax(0,1fr) auto;
    gap: 8px;
  }

  .graph-filters label {
    min-width: 0;
  }

  .graph-filters button {
    font-size: 12px;
  }

  .graph-chain-picker {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .graph-selection {
    padding: 6px 8px 6px 12px;
    gap: 8px;
  }

  [data-graph-count] {
    font-size: 11px;
    line-height: 1.5;
  }

  [data-graph-range] {
    display: none;
  }

  .graph-selection-actions {
    gap: 6px;
  }

  .graph-selection-actions button {
    justify-content: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    padding: 0;
  }

  .graph-selection-actions button > span {
    display: none;
  }

  .graph-preview footer {
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ---------------------------------------------------------------------------
   AI attention + floating assistant (desktop only).
   Visual language: instrument, not neon. One ink, one accent (primary), 1px
   hairlines, viewfinder corners instead of glows, mono for indices and entity
   keys, short expo-out motion. No gradients as decoration, no color washes.
   --------------------------------------------------------------------------- */

.ai-attention {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
}

/* The extracted card crosses the panel, so it sits on its own top layer. */

.ai-attention-flight {
  position: fixed;
  inset: 0;
  z-index: 71;
  pointer-events: none;
}

.ai-flight-box {
  position: absolute;
  border: 1px solid var(--primary-500);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: 0 1px 3px #0f172a24;
  transform-origin: center;
  will-change: transform, opacity;
}

.ai-flight-box::before, .ai-flight-box::after {
  content: "";
  position: absolute;
  width: 9px;
  height: 9px;
  border: 0 solid var(--primary-600);
}

.ai-flight-box::before {
  top: -1px;
  left: -1px;
  border-top-width: 1.5px;
  border-left-width: 1.5px;
}

.ai-flight-box::after {
  right: -1px;
  bottom: -1px;
  border-right-width: 1.5px;
  border-bottom-width: 1.5px;
}

/* The landing mark restates the chip boundary once, without travelling. */

.ai-flight-land {
  position: absolute;
  border: 1px solid var(--primary-500);
  border-radius: var(--radius-md);
  transform-origin: center;
}

/* Scrolled workspace bounds may pass behind the sticky header. */

.ai-shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  fill: var(--ai-dim);
  clip-path: inset(var(--header-height) 0 0);
}

/* Ring and workspace shade are separate: navigation/assistant never dim, and
   no business component gains a filter, opacity or stacking-context override. */

.ai-ring {
  position: absolute;
  top: 0;
  left: 0;
  overflow: hidden;
  border-radius: var(--radius-2xl);
  border: 1px solid color-mix(in srgb, var(--primary-500) 28%, transparent);
  --c: var(--primary-600);
  background:
    linear-gradient(var(--c), var(--c)) top left / 12px 1.5px, linear-gradient(var(--c), var(--c)) top left / 1.5px 12px,
    linear-gradient(var(--c), var(--c)) top right / 12px 1.5px, linear-gradient(var(--c), var(--c)) top right / 1.5px 12px,
    linear-gradient(var(--c), var(--c)) bottom left / 12px 1.5px, linear-gradient(var(--c), var(--c)) bottom left / 1.5px 12px,
    linear-gradient(var(--c), var(--c)) bottom right / 12px 1.5px, linear-gradient(var(--c), var(--c)) bottom right / 1.5px 12px;
  background-repeat: no-repeat;
}

/* Scan: a single 1px line with a short fading wake, sweeping top to bottom. */

.ai-ring-scan {
  position: absolute;
  inset: 0;
}

.ai-ring-scan::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 28px;
  transform: translateY(-28px);
  background: linear-gradient(to bottom, transparent, color-mix(in srgb, var(--primary-500) 7%, transparent));
  border-bottom: 1px solid color-mix(in srgb, var(--primary-500) 55%, transparent);
  animation: ai-scan var(--ai-motion-scan) var(--ai-ease) infinite;
}

.ai-ring.is-settled .ai-ring-scan {
  display: none;
}

@keyframes ai-scan {
  to {
    top: 100%;
  }
}

/* Auto-pilot frame around the workspace: hairline + one light pulse on the top edge. */

.ai-frame {
  position: absolute;
  z-index: 1;
  top: 0;
  left: 0;
  border: 1px solid color-mix(in srgb, var(--primary-500) 22%, transparent);
  border-radius: var(--radius-2xl);
}

.ai-frame::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 18%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary-500), transparent);
  animation: ai-edge 2.4s var(--ai-ease) infinite;
}

@keyframes ai-edge {
  from {
    left: 0;
  }

  to {
    left: 82%;
  }
}

.ai-frame-tag {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  height: 28px;
  padding: 0 4px 0 12px;
  border-radius: 999px;
  background: var(--gray-900);
  color: var(--gray-100);
  font-size: 12px;
  white-space: nowrap;
  pointer-events: auto;
  box-shadow: var(--shadow-md);
}

.ai-frame-tag .ai-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary-400);
  animation: ai-blink 1.2s ease-in-out infinite;
}

.ai-frame-tag kbd {
  font-family: var(--ai-mono);
  font-size: 10px;
  color: var(--gray-400);
}

.ai-frame-tag button {
  height: 22px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--gray-300);
  font-size: 11px;
}

.ai-frame-tag button:hover {
  background: color-mix(in srgb, var(--surface) 8%, transparent);
  color: var(--surface);
}

@keyframes ai-blink {
  50% {
    opacity: .25;
  }
}

/* Floating assistant */

.ai-assistant {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 70;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.ai-fab {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--gray-900);
  color: var(--surface);
  box-shadow: var(--shadow-md);
  transition: transform var(--ai-motion-enter) var(--ai-ease);
}

.ai-fab:hover {
  transform: translateY(-1px);
}

.ai-fab svg {
  width: 20px;
  height: 20px;
}

.ai-fab[data-busy="true"]::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1.5px solid transparent;
  border-top-color: var(--primary-500);
  animation: ai-spin 1s linear infinite;
}

.ai-fab[data-stage]:not([data-stage=""]):hover::before {
  content: attr(data-stage);
  position: absolute;
  right: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  padding: 6px 10px;
  border-radius: var(--radius-lg);
  background: var(--gray-900);
  color: var(--gray-100);
  font-size: 12px;
  white-space: nowrap;
}

@keyframes ai-spin {
  to {
    transform: rotate(360deg);
  }
}

.ai-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 384px;
  max-width: calc(100vw - 48px);
  max-height: min(64vh, 640px);
  overflow: hidden;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-2xl);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  transform-origin: bottom right;
  animation: ai-panel-in var(--ai-motion-enter) var(--ai-ease);
  transition: max-height var(--ai-motion-enter) var(--ai-ease);
}

.ai-panel[data-resized=true] {
  max-height: calc(100dvh - 104px);
}

.ai-panel.is-resizing {
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  transition: none;
}

.ai-resize-handle {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  width: 16px;
  height: 16px;
  padding: 0;
  color: var(--gray-400);
  cursor: nwse-resize;
  touch-action: none;
}

.ai-resize-handle::before {
  content: "";
  position: absolute;
  inset: 5px;
  border-top: 1px solid currentColor;
  border-left: 1px solid currentColor;
  border-radius: 1px;
}

.ai-resize-handle:hover, .ai-resize-handle:focus-visible, .is-resizing .ai-resize-handle {
  color: var(--primary-600);
}

.ai-resize-handle:focus-visible {
  outline: 2px solid var(--primary-300);
  outline-offset: -2px;
}

@keyframes ai-panel-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(.98);
  }
}

.ai-panel-head {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 8px;
  height: 40px;
  padding: 0 8px 0 14px;
  border-bottom: 1px solid var(--gray-100);
}

.ai-panel-title {
  font-family: var(--ai-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--gray-500);
}

.ai-panel-head .ai-icon-button {
  margin-left: auto;
}

.ai-icon-button {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-lg);
  color: var(--gray-500);
}

.ai-icon-button:hover {
  background: var(--gray-100);
  color: var(--gray-900);
}

.ai-icon-button svg {
  width: 16px;
  height: 16px;
}

.ai-trail {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 14px 16px;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 12px);
  mask-image: linear-gradient(to bottom, transparent, #000 12px);
}

.ai-trail > :not(.ai-trail-spacer) {
  flex-shrink: 0;
}

.ai-trail-spacer {
  flex: 1;
}

.ai-empty {
  color: var(--gray-400);
  font-size: 12px;
  line-height: 1.7;
}

.ai-question {
  align-self: flex-end;
  max-width: 88%;
  padding: 8px 12px;
  border-radius: var(--radius-xl);
  background: var(--gray-100);
  color: var(--gray-900);
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.ai-summary {
  align-self: flex-start;
  font-family: var(--ai-mono);
  font-size: 11px;
  color: var(--gray-500);
  letter-spacing: .02em;
}

.ai-summary:hover {
  color: var(--primary-600);
}

.ai-nodes {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ai-node {
  position: relative;
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  gap: 10px;
  animation: ai-node-in var(--ai-motion-enter) var(--ai-ease);
}

@keyframes ai-node-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

.ai-node::before {
  content: "";
  position: absolute;
  left: 6.5px;
  top: 14px;
  bottom: -12px;
  width: 1px;
  background: var(--gray-200);
}

.ai-node:last-of-type::before {
  display: none;
}

.ai-node-dot {
  position: relative;
  width: 7px;
  height: 7px;
  margin: 5px 0 0 3.5px;
  border-radius: 50%;
  background: var(--gray-300);
}

.ai-node[data-active="true"] .ai-node-dot {
  background: var(--primary-600);
}

.ai-node[data-active="true"] .ai-node-dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid var(--primary-400);
  animation: ai-ripple 1.6s var(--ai-ease) infinite;
}

@keyframes ai-ripple {
  from {
    opacity: .9;
    transform: scale(.6);
  }

  to {
    opacity: 0;
    transform: scale(1.5);
  }
}

.ai-node-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--gray-500);
}

.ai-node[data-active="true"] .ai-node-line {
  color: var(--gray-900);
}

.ai-node-index {
  flex-shrink: 0;
  font-family: var(--ai-mono);
  font-size: 10px;
  color: var(--gray-400);
}

.ai-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.ai-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 8px;
  overflow: hidden;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  background: var(--surface);
  font-family: var(--ai-mono);
  font-size: 10.5px;
  color: var(--gray-600);
}

.ai-chip:hover {
  border-color: var(--gray-300);
  color: var(--gray-900);
}

.ai-chip-mark {
  width: 5px;
  height: 5px;
  border-radius: 1px;
  background: var(--gray-300);
}

.ai-chip[data-status="running"] {
  border-color: color-mix(in srgb, var(--primary-500) 45%, transparent);
  color: var(--primary-700);
}

.ai-chip[data-status="running"] .ai-chip-mark {
  background: var(--primary-500);
  animation: ai-blink 1s ease-in-out infinite;
}

.ai-chip[data-status="running"]::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--primary-500) 10%, transparent), transparent);
  animation: ai-sweep 1.4s var(--ai-ease) infinite;
}

@keyframes ai-sweep {
  to {
    transform: translateX(100%);
  }
}

.ai-chip[data-status="done"] .ai-chip-mark {
  width: 7px;
  height: 4px;
  border-left: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  border-radius: 0;
  background: transparent;
  transform: rotate(-45deg);
}

.ai-chip[data-status="failed"] {
  color: var(--gray-400);
  text-decoration: line-through;
}

.ai-answer {
  padding-top: 12px;
  border-top: 1px solid var(--gray-100);
  font-size: 13px;
  line-height: 1.7;
  animation: ai-node-in var(--ai-motion-enter) var(--ai-ease);
}

.ai-answer-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
}

.ai-answer-meta a, .ai-related {
  height: 24px;
  padding: 0 9px;
  border: 1px solid var(--gray-200);
  border-radius: 999px;
  color: var(--gray-600);
  font-size: 11.5px;
  line-height: 22px;
}

.ai-answer-meta a:hover, .ai-related:hover {
  border-color: var(--primary-300);
  color: var(--primary-700);
}

.ai-error {
  color: var(--danger-600);
  font-size: 12px;
}

.ai-composer {
  flex-shrink: 0;
  border-top: 1px solid var(--gray-100);
  padding: 8px 8px 8px 12px;
}

.ai-composer-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.ai-composer textarea {
  flex: 1;
  min-width: 0;
  max-height: 120px;
  padding: 6px 0;
  border: 0;
  background: transparent;
  font-size: 13px;
  line-height: 1.6;
  resize: none;
  outline: none;
}

.ai-send {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--gray-900);
  color: var(--surface);
}

.ai-send:disabled {
  opacity: .3;
}

.ai-send svg {
  width: 14px;
  height: 14px;
}

.ai-composer-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
}

.ai-session.styled-select-trigger {
  min-width: 0;
  max-width: 210px;
  min-height: 26px;
  height: 26px;
  gap: 7px;
  padding: 0 8px;
  border-color: var(--gray-200);
  border-radius: var(--radius-md);
  background: var(--gray-50);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--gray-600);
}

.ai-session.styled-select-trigger:not(:disabled):is(:hover, [aria-expanded=true]) {
  border-color: var(--primary-300);
  background: var(--surface);
  color: var(--primary-700);
}

.ai-session.styled-select-trigger:focus-visible {
  outline: 2px solid var(--primary-200);
  outline-offset: 2px;
}

.ai-session.styled-select-trigger svg {
  width: 13px;
  height: 13px;
  transition: transform var(--ai-motion-enter) var(--ai-ease);
}

.ai-session.styled-select-trigger[aria-expanded=true] svg {
  transform: rotate(180deg);
}

.ai-hint {
  font-family: var(--ai-mono);
  font-size: 10px;
  color: var(--gray-400);
}

/* The same trail renders under chat and simulation answers; tighten it there. */

.chat-progress {
  margin-bottom: 12px;
  gap: 10px;
}

.chat-progress .ai-node-line {
  font-size: 12.5px;
}

.chat-progress .ai-chip {
  height: 20px;
  font-size: 10px;
}

/* Compact: the target sits under the panel, so only the live node and input remain. */

.ai-panel[data-compact="true"] {
  max-height: 168px;
}

.ai-panel[data-compact="true"] :is(.ai-resize-handle, .ai-panel-head, .ai-question, .ai-summary, .ai-node:not(:last-of-type), .ai-composer-meta) {
  display: none;
}

.ai-panel[data-compact="true"] .ai-trail {
  -webkit-mask-image: none;
  mask-image: none;
}

/* A new conversation has nothing to narrate yet: keep only the composer. */

.ai-panel[data-empty="true"] .ai-trail {
  display: none;
}

.ai-panel[data-empty="true"] .ai-composer {
  border-top: 0;
}

@media (max-width: 1023px) {
  .ai-assistant, .ai-attention, .ai-attention-flight {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ai-ring-scan, .ai-frame::before, .ai-chip::after {
    display: none;
  }
}

.backdrop\:bg-black\/40::backdrop {
  background-color: rgb(0 0 0 / 0.4);
}

.hover\:border-primary-300:hover {
  border-color: var(--primary-300);
}

.hover\:border-primary-400:hover {
  border-color: var(--primary-400);
}

.hover\:bg-gray-100:hover {
  background-color: var(--gray-100);
}

.hover\:bg-gray-200:hover {
  background-color: var(--gray-200);
}

.hover\:bg-gray-300:hover {
  background-color: var(--gray-300);
}

.hover\:bg-gray-50:hover {
  background-color: var(--gray-50);
}

.hover\:bg-gray-800:hover {
  background-color: var(--gray-800);
}

.hover\:bg-primary-100:hover {
  background-color: var(--primary-100);
}

.hover\:bg-primary-50:hover {
  background-color: var(--primary-50);
}

.hover\:text-primary-600:hover {
  color: var(--primary-600);
}

.hover\:text-primary-700:hover {
  color: var(--primary-700);
}

.hover\:text-red-600:hover {
  --tw-text-opacity: 1;
  color: rgb(220 38 38 / var(--tw-text-opacity, 1));
}

.hover\:underline:hover {
  text-decoration-line: underline;
}

.focus\:border-primary-500:focus {
  border-color: var(--primary-500);
}

.focus\:outline-none:focus {
  outline: 2px solid transparent;
  outline-offset: 2px;
}

.disabled\:cursor-not-allowed:disabled {
  cursor: not-allowed;
}

.disabled\:opacity-40:disabled {
  opacity: 0.4;
}

.disabled\:opacity-50:disabled {
  opacity: 0.5;
}

@media (min-width: 640px) {
  .sm\:grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .sm\:grid-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 768px) {
  .md\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .md\:grid-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
