/* Keep the native sidebar stable when Vue replaces a page or a short viewport
   needs to scroll. These rules do not change menu order or desktop width. */
aside.sidebar {
  max-width: 100vw;
}

aside.sidebar .sidebar-nav {
  min-height: 0;
  overflow-x: hidden;
  overflow-anchor: none;
  overscroll-behavior-y: contain;
  scroll-behavior: auto;
}

aside.sidebar > .sidebar-header,
aside.sidebar > .mt-auto {
  flex-shrink: 0;
}

aside.sidebar .sidebar-link {
  transition-property: color, background-color, border-color, box-shadow;
}

.jre-native-hidden {
  display: none !important;
}

.jre-root {
  --jre-ink: #0d2429;
  --jre-ink-soft: #2e4a50;
  --jre-muted: #526a6f;
  --jre-paper: #ffffff;
  --jre-paper-hover: #fcfffe;
  --jre-stub: #f4faf9;
  --jre-stub-hover: #eaf6f4;
  --jre-surface: #f2f9f8;
  --jre-line: #d6e7e5;
  --jre-line-strong: #b4d4d0;
  --jre-edge: #c4dedb;
  --jre-tide: #0d9488;
  --jre-tide-deep: #0f766e;
  --jre-tide-hover: #0b5f58;
  --jre-tide-soft: #e3f5f3;
  --jre-ring: #0d9488;
  --jre-shadow: 0 1px 2px rgba(13, 36, 41, 0.04), 0 6px 18px -12px rgba(13, 36, 41, 0.1);
  --jre-shadow-hover: 0 4px 10px rgba(13, 148, 136, 0.1), 0 14px 28px -12px rgba(13, 36, 41, 0.15);
  --jre-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Cascadia Code", monospace;
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 4px 0 16px;
  color: var(--jre-ink);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.jre-root *,
.jre-root *::before,
.jre-root *::after {
  box-sizing: border-box;
}

.jre-root :is(a, button, summary):focus-visible {
  outline: 2px solid var(--jre-ring);
  outline-offset: 2px;
}

/* Header */
.jre-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin: 0 0 18px;
}

.jre-heading {
  min-width: 0;
}

.jre-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
  font-family: var(--jre-mono);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.1em;
  color: var(--jre-tide-deep);
}

.jre-eyebrow-mark {
  width: 12px;
  height: 2px;
  border-radius: 1px;
  background: var(--jre-tide);
  flex-shrink: 0;
}

.jre-heading h1 {
  margin: 0 0 5px;
  font-size: 27px;
  font-weight: 800;
  line-height: 1.24;
  letter-spacing: -0.025em;
  color: var(--jre-ink);
}

.jre-subtitle {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--jre-muted);
}

.jre-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.jre-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.jre-btn-icon {
  flex-shrink: 0;
}

.jre-btn-primary {
  background: var(--jre-tide-deep);
  border: 1px solid var(--jre-tide-deep);
  color: #ffffff;
  box-shadow: 0 4px 12px -4px rgba(15, 118, 110, 0.38);
}

.jre-btn-primary:hover {
  background: var(--jre-tide-hover);
  border-color: var(--jre-tide-hover);
  transform: translateY(-1px);
}

.jre-btn-primary:active {
  transform: translateY(0);
}

.jre-btn-arrow {
  transition: transform 0.18s ease;
}

.jre-btn-primary:hover .jre-btn-arrow {
  transform: translateX(2px);
}

.jre-btn-secondary {
  background: var(--jre-paper);
  border: 1px solid var(--jre-line-strong);
  color: var(--jre-ink-soft);
}

.jre-btn-secondary:hover {
  background: var(--jre-surface);
  border-color: var(--jre-tide);
  color: var(--jre-tide-deep);
}

/* Flow Rail */
.jre-flow-card {
  margin: 0 0 22px;
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--jre-surface);
  border: 1px solid var(--jre-line);
}

.jre-flow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.jre-flow-step {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  flex: 1 1 0;
}

.jre-step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--jre-paper);
  border: 1px solid var(--jre-line-strong);
  color: var(--jre-tide-deep);
  font-family: var(--jre-mono);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
}

.jre-step-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.jre-step-text strong {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--jre-ink);
}

.jre-step-text span {
  font-size: 12px;
  line-height: 1.4;
  color: var(--jre-muted);
}

.jre-flow-sep {
  display: flex;
  align-items: center;
  color: var(--jre-line-strong);
  flex-shrink: 0;
}

/* Catalog Section */
.jre-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
}

.jre-section-head h2 {
  margin: 0;
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--jre-ink);
}

.jre-section-note {
  font-size: 12px;
  line-height: 1.45;
  color: var(--jre-muted);
}

.jre-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

/* Precision Voucher Card */
.jre-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  background: var(--jre-paper);
  border: 1px solid var(--jre-line);
  border-bottom-color: var(--jre-edge);
  box-shadow: var(--jre-shadow);
  color: inherit;
  text-decoration: none;
  overflow: hidden;
  min-width: 0;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.jre-card:hover,
.jre-card:focus-visible {
  background: var(--jre-paper-hover);
  border-color: var(--jre-tide);
  box-shadow: var(--jre-shadow-hover);
  transform: translateY(-2px);
}

.jre-card:active {
  transform: translateY(0);
}

.jre-voucher-face {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 20px 16px;
  flex: 1 1 auto;
  min-width: 0;
}

.jre-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.jre-card-unit {
  font-family: var(--jre-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--jre-muted);
}

/* 6-bar proportional tier gauge */
.jre-meter {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.jre-meter-bar {
  display: block;
  width: 8px;
  height: 4px;
  border-radius: 1.5px;
  background: var(--jre-line);
  transition: background-color 0.2s ease;
}

.jre-meter-bar.is-on {
  background: var(--jre-line-strong);
}

.jre-card:hover .jre-meter-bar.is-on,
.jre-card:focus-visible .jre-meter-bar.is-on {
  background: var(--jre-tide);
}

.jre-card-heading {
  margin: 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.jre-card-label {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--jre-ink-soft);
}

.jre-card-usd {
  display: inline-block;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  white-space: nowrap;
}

.jre-usd-sign {
  position: relative;
  top: -0.48em;
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
  color: var(--jre-tide-deep);
  margin-right: 2px;
}

.jre-usd-num {
  font-size: 36px;
  font-weight: 800;
  line-height: 0.96;
  letter-spacing: -0.035em;
  color: var(--jre-ink);
}

/* Perforated Voucher Stub */
.jre-voucher-stub {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  background: var(--jre-stub);
  border-top: 1px dashed var(--jre-line-strong);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.jre-voucher-stub::before,
.jre-voucher-stub::after {
  content: "";
  position: absolute;
  top: -2.5px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--jre-line-strong);
  transition: background-color 0.2s ease;
}

.jre-voucher-stub::before {
  left: 6px;
}

.jre-voucher-stub::after {
  right: 6px;
}

.jre-card:hover .jre-voucher-stub,
.jre-card:focus-visible .jre-voucher-stub {
  background: var(--jre-stub-hover);
  border-color: var(--jre-tide);
}

.jre-card:hover .jre-voucher-stub::before,
.jre-card:hover .jre-voucher-stub::after,
.jre-card:focus-visible .jre-voucher-stub::before,
.jre-card:focus-visible .jre-voucher-stub::after {
  background: var(--jre-tide);
}

.jre-stub-price {
  display: flex;
  align-items: baseline;
  gap: 7px;
  min-width: 0;
}

.jre-price-label {
  font-size: 11.5px;
  line-height: 1.2;
  color: var(--jre-muted);
}

.jre-price-val {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  color: var(--jre-ink);
}

.jre-stub-cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 11px;
  border-radius: 8px;
  background: var(--jre-paper);
  border: 1px solid var(--jre-line-strong);
  color: var(--jre-tide-deep);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.jre-stub-ext {
  transition: transform 0.18s ease;
}

.jre-card:hover .jre-stub-cta,
.jre-card:focus-visible .jre-stub-cta {
  background: var(--jre-tide-deep);
  border-color: var(--jre-tide-deep);
  color: #ffffff;
}

.jre-card:hover .jre-stub-ext,
.jre-card:focus-visible .jre-stub-ext {
  transform: translate(1px, -1px);
}

/* Guidance & Native Collapsible Disclosure */
.jre-guidance {
  margin-top: 20px;
  padding: 14px 18px;
  border-radius: 12px;
  background: var(--jre-surface);
  border: 1px solid var(--jre-line);
}

.jre-notice-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.jre-notice-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: var(--jre-tide-soft);
  color: var(--jre-tide-deep);
  flex-shrink: 0;
  margin-top: 1px;
}

.jre-notice-text {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--jre-ink-soft);
}

.jre-notice-text strong {
  color: var(--jre-ink);
  font-weight: 600;
}

.jre-details {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--jre-line);
}

.jre-details-summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--jre-tide-deep);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

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

.jre-details-chevron {
  transition: transform 0.18s ease;
}

.jre-details[open] .jre-details-chevron {
  transform: rotate(90deg);
}

.jre-details-list {
  margin: 8px 0 0;
  padding: 0 0 0 18px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--jre-muted);
}

.jre-details-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 10px;
}

.jre-text-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 34px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--jre-muted);
  text-decoration: none;
}

.jre-text-link:hover {
  color: var(--jre-tide-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.jre-text-link-strong {
  color: var(--jre-tide-deep);
}

/* Dark Mode */
.dark .jre-root {
  --jre-ink: #eaf5f4;
  --jre-ink-soft: #bfd5d8;
  --jre-muted: #90adb2;
  --jre-paper: #132234;
  --jre-paper-hover: #172a40;
  --jre-stub: #0f1c2b;
  --jre-stub-hover: #132838;
  --jre-surface: #10242d;
  --jre-line: #233a49;
  --jre-line-strong: #325563;
  --jre-edge: #1c3242;
  --jre-tide: #2dd4bf;
  --jre-tide-deep: #0f766e;
  --jre-tide-hover: #0d9488;
  --jre-tide-soft: #13353c;
  --jre-ring: #5eead4;
  --jre-shadow: 0 2px 6px rgba(0, 0, 0, 0.24), 0 10px 22px -12px rgba(0, 0, 0, 0.36);
  --jre-shadow-hover: 0 6px 16px rgba(0, 0, 0, 0.36), 0 16px 32px -12px rgba(45, 212, 191, 0.14);
}

.dark .jre-eyebrow,
.dark .jre-step-badge,
.dark .jre-btn-secondary:hover,
.dark .jre-usd-sign,
.dark .jre-stub-cta,
.dark .jre-notice-icon,
.dark .jre-details-summary,
.dark .jre-text-link:hover,
.dark .jre-text-link-strong {
  color: var(--jre-tide);
}

.dark .jre-btn-primary {
  box-shadow: 0 6px 16px -6px rgba(13, 148, 136, 0.45);
}

.dark .jre-card:hover .jre-stub-cta,
.dark .jre-card:focus-visible .jre-stub-cta {
  color: #ffffff;
}

/* Responsive Tablet */
@media (max-width: 960px) {
  .jre-header {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }

  .jre-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
}

@media (max-width: 820px) {
  .jre-flow {
    gap: 8px;
  }

  .jre-flow-sep {
    display: none;
  }

  .jre-step-text span {
    display: none;
  }
}

/* Responsive Mobile (375px Compact Horizontal Voucher Ledger) */
@media (max-width: 600px) {
  .jre-root {
    padding: 0 0 12px;
  }

  .jre-header {
    margin-bottom: 14px;
    gap: 12px;
  }

  .jre-heading h1 {
    font-size: 24px;
  }

  .jre-subtitle {
    font-size: 13px;
  }

  .jre-header-actions {
    width: 100%;
    flex-wrap: wrap;
    gap: 8px;
  }

  .jre-btn {
    flex: 1 1 136px;
    min-height: 42px;
    padding: 9px 12px;
    font-size: 13px;
  }

  .jre-flow-card {
    padding: 9px 12px;
    margin-bottom: 16px;
  }

  .jre-flow {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .jre-flow-step {
    gap: 6px;
    justify-content: center;
  }

  .jre-step-badge {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    font-size: 10px;
  }

  .jre-step-text strong {
    font-size: 12px;
    white-space: nowrap;
  }

  .jre-section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    margin-bottom: 10px;
  }

  .jre-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  /* Switch voucher cards to horizontal ledger orientation on mobile */
  .jre-card {
    flex-direction: row;
    align-items: stretch;
    border-radius: 12px;
  }

  .jre-voucher-face {
    justify-content: space-between;
    gap: 8px;
    padding: 12px 14px;
  }

  .jre-card-unit {
    font-size: 10px;
  }

  .jre-meter-bar {
    width: 5px;
    height: 3.5px;
  }

  .jre-card-heading {
    align-items: baseline;
    justify-content: flex-start;
    gap: 8px;
  }

  .jre-card-label {
    font-size: 12px;
  }

  .jre-usd-sign {
    top: -0.44em;
    font-size: 13px;
  }

  .jre-usd-num {
    font-size: 26px;
  }

  .jre-voucher-stub {
    width: 122px;
    flex-shrink: 0;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 7px;
    padding: 10px 12px;
    border-top: 0;
    border-left: 1px dashed var(--jre-line-strong);
  }

  .jre-voucher-stub::before {
    top: 5px;
    left: -2.5px;
    right: auto;
  }

  .jre-voucher-stub::after {
    top: auto;
    bottom: 5px;
    left: -2.5px;
    right: auto;
  }

  .jre-stub-price {
    gap: 5px;
    justify-content: flex-end;
  }

  .jre-price-label {
    font-size: 10.5px;
  }

  .jre-price-val {
    font-size: 15px;
  }

  .jre-stub-cta {
    padding: 5px 10px;
    font-size: 11.5px;
  }

  .jre-guidance {
    margin-top: 16px;
    padding: 12px 14px;
  }

  .jre-notice-text {
    font-size: 12px;
  }
}

@media (max-width: 340px) {
  .jre-flow {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }

  .jre-flow-step {
    justify-content: flex-start;
  }

  .jre-card {
    flex-direction: column;
  }

  .jre-voucher-stub {
    width: auto;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    border-left: 0;
    border-top: 1px dashed var(--jre-line-strong);
  }

  .jre-voucher-stub::before,
  .jre-voucher-stub::after {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .jre-root *,
  .jre-root *::before,
  .jre-root *::after {
    animation: none !important;
    transition: none !important;
  }

  .jre-btn-primary:hover,
  .jre-card:hover,
  .jre-card:focus-visible,
  .jre-card:hover .jre-stub-ext,
  .jre-card:focus-visible .jre-stub-ext,
  .jre-btn-primary:hover .jre-btn-arrow {
    transform: none;
  }
}
