:root {
  color-scheme: light;
  --msr-bg: #f6f8f5;
  --msr-panel: #ffffff;
  --msr-panel-2: #edf3f0;
  --msr-text: #14211c;
  --msr-muted: #60736b;
  --msr-line: #d8e4de;
  --msr-accent: #24784f;
  --msr-accent-2: #c84f3b;
  --msr-accent-3: #286f93;
  --msr-warm: #f2d28b;
  --msr-shadow: 0 18px 58px rgba(24, 38, 33, 0.1);
}

* {
  box-sizing: border-box;
}

.msr-body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, #fbfdfb 0, var(--msr-bg) 320px),
    var(--msr-bg);
  color: var(--msr-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.msr-body a {
  color: inherit;
  text-decoration: none;
}

.msr-header,
.msr-main,
.msr-footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.msr-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 20px 0;
}

.msr-brand,
.msr-nav,
.msr-account,
.msr-actions,
.msr-tags,
.msr-card-stats,
.msr-inline-actions {
  display: flex;
  align-items: center;
}

.msr-brand {
  gap: 10px;
  font-size: 1.15rem;
  font-weight: 850;
}

.msr-brand-mark {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background:
    linear-gradient(145deg, var(--msr-accent), #174f39);
  color: white;
  font-size: 0.86rem;
  font-weight: 900;
}

.msr-nav {
  gap: 18px;
  color: var(--msr-muted);
  font-weight: 650;
}

.msr-nav a,
.msr-footer a,
.msr-account a {
  border-radius: 6px;
}

.msr-nav a:hover,
.msr-footer a:hover,
.msr-account a:hover {
  color: var(--msr-accent);
}

.msr-account {
  gap: 12px;
  color: var(--msr-muted);
}

.msr-account form {
  margin: 0;
}

.msr-main {
  padding: 18px 0 52px;
}

.msr-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 34px 0 46px;
  border-top: 1px solid var(--msr-line);
  color: var(--msr-muted);
}

.msr-footer p {
  margin: 8px 0 0;
  max-width: 620px;
  line-height: 1.55;
}

.msr-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: flex-end;
}

.msr-footer-disclaimer {
  font-size: 0.9rem;
}

.msr-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.03fr) minmax(320px, 0.97fr);
  align-items: center;
  min-height: 540px;
  gap: 36px;
}

.msr-hero h1,
.msr-page-heading h1,
.msr-detail-hero h1,
.msr-auth h1 {
  margin: 0;
  font-size: clamp(2.4rem, 5vw, 4.55rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.msr-hero h1 {
  max-width: 820px;
  font-size: clamp(2.35rem, 4.2vw, 3.85rem);
  line-height: 1.08;
}

.msr-hero p,
.msr-page-heading p,
.msr-detail-hero p {
  max-width: 720px;
  color: var(--msr-muted);
  font-size: 1.08rem;
  line-height: 1.7;
}

.msr-kicker {
  margin: 0 0 12px;
  color: var(--msr-accent);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.msr-actions {
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.msr-button,
.msr-form button,
.msr-inline-actions button,
.msr-viewer-toolbar button {
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--msr-accent);
  color: white;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  min-height: 42px;
  padding: 10px 17px;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.msr-button:hover,
.msr-form button:hover,
.msr-inline-actions button:hover,
.msr-viewer-toolbar button:hover {
  transform: translateY(-1px);
}

.msr-button:not(.msr-button-ghost):hover,
.msr-account a.msr-button:hover {
  background: #1d6845;
  border-color: #1d6845;
  color: white;
}

.msr-button-small {
  min-height: 34px;
  padding: 7px 12px;
}

.msr-button-ghost,
.msr-viewer-toolbar button,
.msr-inline-actions button {
  background: white;
  border-color: var(--msr-line);
  color: var(--msr-text);
}

.msr-link-button {
  border: 0;
  background: transparent;
  color: var(--msr-muted);
  cursor: pointer;
  font: inherit;
  padding: 0;
}

.msr-hero-stage {
  min-height: 420px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(36, 120, 79, 0.14), rgba(40, 111, 147, 0.16)),
    #eef4f0;
  box-shadow: var(--msr-shadow);
  overflow: hidden;
  position: relative;
}

.msr-cube-grid {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 10px;
  inset: 50px;
  position: absolute;
  transform: rotateX(58deg) rotateZ(42deg);
  transform-style: preserve-3d;
}

.msr-cube-grid span {
  aspect-ratio: 1;
  background: hsl(calc(92 + var(--h) * 18), 36%, 48%);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 8px 8px 0 rgba(20, 38, 30, 0.18);
}

.msr-section {
  margin-top: 56px;
}

.msr-section-heading,
.msr-detail-hero,
.msr-viewer-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
}

.msr-section-heading h2,
.msr-panel h2,
.msr-feature-grid h2 {
  margin: 0;
  font-size: 1.45rem;
}

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

.msr-card,
.msr-panel,
.msr-form,
.msr-stat-panel {
  background: var(--msr-panel);
  border: 1px solid var(--msr-line);
  border-radius: 8px;
  box-shadow: 0 12px 34px rgba(24, 38, 33, 0.055);
  min-width: 0;
}

.msr-card {
  overflow: hidden;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.msr-card:hover {
  border-color: rgba(36, 120, 79, 0.35);
  box-shadow: var(--msr-shadow);
  transform: translateY(-2px);
}

.msr-card-image {
  display: block;
  aspect-ratio: 16 / 10;
  background: var(--msr-panel-2);
}

.msr-card-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.msr-card-body,
.msr-panel,
.msr-form,
.msr-stat-panel {
  padding: 18px;
}

.msr-card-meta,
.msr-card-stats,
.msr-muted {
  color: var(--msr-muted);
}

.msr-card-meta,
.msr-card-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.86rem;
}

.msr-card h3 {
  margin: 10px 0 8px;
  font-size: 1.1rem;
}

.msr-card p {
  color: var(--msr-muted);
  display: -webkit-box;
  line-height: 1.5;
  margin: 0 0 12px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.msr-tags {
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}

.msr-tags a {
  background: #e5eee9;
  border-radius: 999px;
  color: #236244;
  font-size: 0.82rem;
  font-weight: 750;
  padding: 6px 10px;
}

.msr-empty,
.msr-success,
.msr-validation {
  border-radius: 8px;
  padding: 16px;
}

.msr-empty {
  background: var(--msr-panel-2);
  color: var(--msr-muted);
  grid-column: 1 / -1;
}

.msr-success {
  background: #e0f4e7;
  color: #236240;
  margin-bottom: 16px;
}

.msr-validation {
  color: #8e2d21;
  background: #fff0ed;
}

.msr-band {
  background:
    linear-gradient(135deg, rgba(36, 120, 79, 0.08), rgba(40, 111, 147, 0.08)),
    #eef4f0;
  border: 1px solid var(--msr-line);
  border-radius: 8px;
  padding: 28px;
}

.msr-feature-grid,
.msr-detail-grid,
.msr-viewer-layout {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.msr-feature-grid p {
  color: var(--msr-muted);
  line-height: 1.6;
}

.msr-page-heading {
  padding: 44px 0 24px;
}

.msr-page-heading h1,
.msr-detail-hero h1,
.msr-auth h1 {
  font-size: clamp(2.1rem, 5vw, 4.3rem);
}

.msr-filter-bar {
  display: grid;
  grid-template-columns: 1fr 180px 180px auto;
  gap: 12px;
  margin: 18px 0;
}

.msr-form {
  display: grid;
  gap: 16px;
  max-width: 760px;
}

.msr-form label {
  display: grid;
  gap: 7px;
  color: var(--msr-muted);
  font-weight: 750;
}

.msr-form input,
.msr-form textarea,
.msr-form select,
.msr-filter-bar input,
.msr-filter-bar select {
  width: 100%;
  border: 1px solid var(--msr-line);
  border-radius: 8px;
  background: white;
  color: var(--msr-text);
  font: inherit;
  min-height: 44px;
  padding: 10px 12px;
}

.msr-drop-zone {
  border: 1px dashed #9fb5a8;
  border-radius: 8px;
  background: #f7fbf8;
  color: var(--msr-muted);
  display: grid;
  gap: 10px;
  min-width: 0;
  overflow: hidden;
  padding: 18px;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.msr-drop-zone strong {
  color: var(--msr-text);
  font-size: 1rem;
}

.msr-file-name {
  display: block;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.msr-file-button {
  align-items: center;
  background: white;
  border: 1px solid var(--msr-line);
  border-radius: 8px;
  color: var(--msr-text);
  cursor: pointer;
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
  min-height: 42px;
  max-width: 100%;
  overflow: hidden;
  padding: 9px 12px;
  position: relative;
}

.msr-file-button input[type="file"] {
  cursor: pointer;
  height: 100%;
  inset: 0;
  opacity: 0;
  position: absolute;
  width: 100%;
}

.msr-drop-zone.is-dragging {
  background: #e4f3e9;
  border-color: var(--msr-accent);
  color: #255f40;
}

.msr-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.msr-policy-note {
  background: #f7faf8;
  border: 1px solid var(--msr-line);
  border-radius: 8px;
  color: var(--msr-muted);
  line-height: 1.6;
  margin: 0;
  padding: 14px;
}

.msr-legal-heading {
  max-width: 860px;
}

.msr-legal-content {
  max-width: 900px;
}

.msr-legal-content h2 {
  font-size: 1.24rem;
  margin: 28px 0 10px;
}

.msr-legal-content h2:first-child {
  margin-top: 0;
}

.msr-legal-content p {
  color: var(--msr-muted);
  line-height: 1.72;
  margin: 0 0 14px;
}

.msr-legal-content a {
  color: var(--msr-accent);
  font-weight: 750;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.msr-auth {
  display: grid;
  place-items: center;
  min-height: 64vh;
}

.msr-auth .msr-form {
  width: min(460px, 100%);
}

.msr-detail-hero {
  align-items: stretch;
  padding: 38px 0 24px;
}

.msr-stat-panel {
  display: grid;
  min-width: 280px;
  align-content: center;
  gap: 12px;
}

.msr-stat-panel span {
  color: var(--msr-muted);
}

.msr-stat-panel strong {
  color: var(--msr-text);
  display: block;
  font-size: 1.2rem;
}

.msr-viewer-shell {
  background: #eef5f1;
  border-radius: 8px;
  overflow: hidden;
}

.msr-viewer-toolbar {
  align-items: center;
  background: #101814;
  color: white;
  padding: 12px;
}

.msr-viewer-canvas {
  background: #eef5f1;
  display: block;
  width: 100%;
  height: min(68vh, 680px);
  min-height: 420px;
}

.msr-viewer-shell:fullscreen {
  border-radius: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  height: 100vh;
  width: 100vw;
}

.msr-viewer-shell:fullscreen .msr-viewer-canvas {
  height: 100%;
  min-height: 0;
}

.msr-detail-grid {
  grid-template-columns: 0.9fr 1.1fr;
  margin-top: 22px;
}

.msr-definition-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 18px;
}

.msr-definition-list dt {
  color: var(--msr-muted);
  font-weight: 800;
}

.msr-definition-list dd {
  margin: 0;
}

.msr-table {
  border-collapse: collapse;
  width: 100%;
}

.msr-table th,
.msr-table td {
  border-bottom: 1px solid var(--msr-line);
  padding: 11px 8px;
  text-align: left;
  vertical-align: top;
}

.msr-table th {
  color: var(--msr-muted);
  font-size: 0.86rem;
}

.msr-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.msr-pagination a {
  border: 1px solid var(--msr-line);
  border-radius: 8px;
  padding: 8px 12px;
}

.msr-pagination .is-active {
  background: var(--msr-accent);
  color: white;
}

.msr-tag-cloud {
  margin: 16px 0 26px;
}

.msr-viewer-layout {
  grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
  align-items: start;
}

.msr-viewer-layout .msr-viewer-shell {
  min-width: 0;
}

.msr-viewer-layout > .msr-panel {
  overflow: hidden;
}

.msr-viewer-help {
  border-top: 1px solid var(--msr-line);
  color: var(--msr-muted);
  margin-top: 16px;
  padding-top: 16px;
}

.msr-viewer-help h3 {
  color: var(--msr-text);
  font-size: 1rem;
  margin: 0 0 10px;
}

.msr-viewer-help dl {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px 12px;
  margin: 0;
}

.msr-viewer-help dt {
  color: var(--msr-text);
  font-weight: 800;
  min-width: 0;
}

.msr-viewer-help dd {
  margin: 0;
  min-width: 0;
}

.msr-inline-actions {
  flex-wrap: wrap;
  gap: 6px;
}

.msr-ai-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.msr-ai-chat {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.msr-ai-workspace {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.msr-ai-status {
  align-items: center;
  background: var(--msr-panel-2);
  border-radius: 8px;
  color: var(--msr-muted);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
}

.msr-ai-status strong {
  color: var(--msr-text);
}

.msr-ai-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.msr-ai-actions .msr-button {
  width: 100%;
}

.msr-ai-progress {
  background: #edf5f0;
  border: 1px solid var(--msr-line);
  border-radius: 8px;
  padding: 14px;
}

.msr-progress-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--msr-muted);
  margin-bottom: 10px;
}

.msr-progress-label strong {
  color: var(--msr-text);
}

.msr-progress-bar {
  background: #d8e5dd;
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}

.msr-progress-bar span {
  animation: msr-progress-slide 1.15s ease-in-out infinite;
  background: linear-gradient(90deg, var(--msr-accent), var(--msr-accent-3));
  border-radius: inherit;
  display: block;
  height: 100%;
  width: 42%;
}

@keyframes msr-progress-slide {
  0% {
    transform: translateX(-110%);
  }
  100% {
    transform: translateX(250%);
  }
}

.msr-badge {
  background: #e0f4e7;
  border-radius: 999px;
  color: #236240;
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 800;
  margin-left: 8px;
  padding: 4px 8px;
}

.msr-provider-edit {
  box-shadow: none;
  margin: 8px 0;
  max-width: 100%;
  padding: 0;
}

.msr-pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}

.msr-pricing-card {
  background: var(--msr-panel);
  border: 1px solid var(--msr-line);
  border-radius: 8px;
  box-shadow: 0 10px 36px rgba(30, 47, 38, 0.06);
  display: grid;
  gap: 16px;
  padding: 22px;
}

.msr-pricing-card.is-featured {
  border-color: rgba(47, 125, 79, 0.5);
  box-shadow: 0 20px 60px rgba(47, 125, 79, 0.13);
}

.msr-pricing-card h2 {
  margin: 0;
}

.msr-pricing-card p {
  color: var(--msr-muted);
  line-height: 1.6;
  margin: 0;
}

.msr-price {
  color: var(--msr-text);
  font-size: 2rem;
  font-weight: 850;
}

.msr-price span {
  color: var(--msr-muted);
  font-size: 0.95rem;
  font-weight: 650;
}

.msr-pricing-card ul {
  color: var(--msr-muted);
  line-height: 1.8;
  margin: 0;
  padding-left: 20px;
}

.msr-pricing-card form {
  align-self: end;
  margin: 0;
}

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

.msr-credit-cost-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 16px 0 18px;
}

.msr-credit-cost-panel div {
  background: var(--msr-panel);
  border: 1px solid var(--msr-line);
  border-radius: 8px;
  box-shadow: 0 10px 36px rgba(30, 47, 38, 0.06);
  padding: 20px;
}

.msr-credit-cost-panel span,
.msr-credit-cost-panel small {
  color: var(--msr-muted);
  display: block;
}

.msr-credit-cost-panel strong {
  color: var(--msr-text);
  display: block;
  font-size: 2.2rem;
  line-height: 1;
  margin: 10px 0;
}

@media (max-width: 900px) {
  .msr-header {
    grid-template-columns: 1fr;
  }

  .msr-nav,
  .msr-account {
    flex-wrap: wrap;
  }

  .msr-hero,
  .msr-card-grid,
  .msr-feature-grid,
  .msr-detail-grid,
  .msr-viewer-layout,
  .msr-ai-layout,
  .msr-pricing-grid,
  .msr-credit-grid,
  .msr-credit-cost-panel {
    grid-template-columns: 1fr;
  }

  .msr-ai-actions {
    grid-template-columns: 1fr;
  }

  .msr-filter-bar {
    grid-template-columns: 1fr;
  }

  .msr-detail-hero,
  .msr-section-heading,
  .msr-footer {
    align-items: start;
    flex-direction: column;
  }

  .msr-footer nav {
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .msr-header,
  .msr-main,
  .msr-footer {
    width: min(100% - 20px, 1180px);
  }

  .msr-hero {
    min-height: auto;
    padding: 28px 0;
  }

  .msr-hero-stage {
    min-height: 280px;
  }

  .msr-form-grid {
    grid-template-columns: 1fr;
  }

  .msr-viewer-canvas {
    min-height: 330px;
  }
}
