/*
 * Grace Smart Monday stability layer
 *
 * This file is intentionally small and loaded last on the Monday pages. It
 * owns the interaction safety rules that used to be scattered across several
 * late override blocks: card visibility, hover scaling, and SVG arrow state.
 */

/* Keep the SVG suite inside its layout box while allowing the card to scale. */
html body .services-suite-frame,
html body .services-suite-svg {
  position: relative;
  overflow: visible;
}

/* Launch design tokens: one predictable hierarchy across home and service
   pages. Component files may still own layout, while these values own scale. */
:root {
  --gss-title-page: clamp(2.35rem, 4.6vw, 4.8rem);
  --gss-title-section: clamp(2rem, 3.5vw, 3.65rem);
  --gss-title-card: clamp(1.12rem, 1.55vw, 1.42rem);
  --gss-copy: clamp(.96rem, 1.08vw, 1.08rem);
  --gss-radius-section: 28px;
  --gss-radius-card: 20px;
  --gss-border-light: #e2e7f5;
}

html body .hero-copy h1,
html body .service-preview-hero h1 {
  font-size: var(--gss-title-page) !important;
  line-height: 1.04 !important;
  letter-spacing: -.035em !important;
}

html body .section-title h2,
html body .services-title h2,
html body .journey h2,
html body .reviews h2,
html body .contact h2 {
  font-size: var(--gss-title-section) !important;
  line-height: 1.08 !important;
  letter-spacing: -.025em !important;
}

html body .service-module h3,
html body .detail-card h3,
html body .process-step h3,
html body .guide-step-list article h3 {
  font-size: var(--gss-title-card) !important;
  line-height: 1.22 !important;
}

html body .service-module p,
html body .detail-card p,
html body .process-step p,
html body .guide-step-list article p {
  font-size: var(--gss-copy) !important;
}

/* Reduce box-inside-box styling. */
html body .service-module,
html body .detail-card,
html body .process-step,
html body .guide-step-list article {
  border-width: 1px !important;
  border-color: var(--gss-border-light) !important;
  border-radius: var(--gss-radius-card) !important;
  box-shadow: none !important;
}

html body .services-suite-frame {
  border-radius: var(--gss-radius-section) !important;
}

/* Keep the Journey artwork aligned with the Founder section on desktop. */
@media (min-width: 981px) {
  html body .journey {
    width: min(1060px, calc(100% - 48px)) !important;
    max-width: 1060px !important;
  }
}

@media (max-width: 760px) {
  :root {
    --gss-title-page: clamp(2rem, 10vw, 2.65rem);
    --gss-title-section: clamp(1.72rem, 8vw, 2.25rem);
    --gss-title-card: clamp(1.02rem, 4.8vw, 1.2rem);
    --gss-copy: clamp(.9rem, 4vw, 1rem);
    --gss-radius-section: 22px;
    --gss-radius-card: 17px;
  }

  /* Preserve the original side-by-side phone composition while allowing
     both columns to shrink inside the viewport without overlapping. */
  html body .calculator .section-title h2 {
    font-size: clamp(1.55rem, 6vw, 2.1rem) !important;
  }

  html body .calculator .calc-panel {
    grid-template-columns: minmax(0, 1fr) minmax(0, .92fr) !important;
    gap: 8px !important;
    width: 100% !important;
    padding: 10px !important;
    overflow: hidden !important;
    align-items: stretch !important;
  }

  html body .calculator .calc-intro,
  html body .calculator .lhdn-video-frame {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
  }

  html body .calculator .lhdn-video-frame *,
  html body .calculator .calc-intro * {
    min-width: 0 !important;
  }

  html body .calculator .guide-benefit-list li {
    font-size: .62rem !important;
    line-height: 1.22 !important;
  }

  html body .calculator .guide-step-list article p {
    font-size: .56rem !important;
    line-height: 1.28 !important;
    overflow-wrap: anywhere !important;
  }

  html body .calculator .guide-step-list strong {
    font-size: .66rem !important;
  }

  html body .calculator .calc-panel .primary {
    min-height: 34px !important;
    font-size: .7rem !important;
  }
}

/* Quotation document type is a compact label/value row at every viewport.
   Older mobile rules moved the value beneath the label, which made the
   quotation look unnecessarily tall and inconsistent with the other rows. */
html body.modern-lhdn-page .result-box.result-document {
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: center !important;
}

html body.modern-lhdn-page .result-box.result-document .result-label {
  white-space: nowrap !important;
}

html body.modern-lhdn-page .result-box.result-document .result-value {
  grid-column: 2 !important;
  text-align: right !important;
  white-space: nowrap !important;
}

/* The panel headers already identify the calculator and quotation. Remove
   the redundant section title so calculator links land directly at the
   blue/green divider and the two-panel workspace. */
html body.modern-lhdn-page .lhdn-calculator-preview > .section-title {
  display: none !important;
}

/* Desktop founder block: reduce the oversized image column and keep the copy
   in a narrower readable measure so the card does not become mostly blank. */
@media (min-width: 981px) {
  html body .founder {
    width: min(1120px, calc(100% - 32px)) !important;
    max-width: 1120px !important;
    grid-template-columns: 293px minmax(0, 1fr) !important;
    gap: clamp(28px, 3vw, 44px) !important;
    padding: clamp(24px, 3vw, 42px) !important;
    align-items: center !important;
    overflow: hidden !important;
  }

  html body .founder > img {
    width: 293px !important;
    min-width: 0 !important;
    height: 440px !important;
    max-height: 440px !important;
    object-fit: cover !important;
    object-position: center center !important;
    justify-self: center !important;
  }

  html body .founder > div {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 700px !important;
    overflow-wrap: anywhere !important;
  }
}

/* Extra-wide desktop: keep the portrait and copy visually balanced instead
   of allowing the copy column to absorb every spare pixel. */
@media (min-width: 1200px) {
  html body .founder {
    width: min(1060px, calc(100% - 48px)) !important;
    max-width: 1060px !important;
    grid-template-columns: 320px minmax(0, 620px) !important;
    justify-content: center !important;
    gap: 38px !important;
    padding: 34px !important;
  }

  html body .founder > img {
    width: 320px !important;
    height: 480px !important;
    max-height: 480px !important;
  }

  html body .founder > div {
    max-width: 620px !important;
  }

  html body[data-theme="dark"] .founder > div h2 {
    max-width: 560px !important;
    font-size: clamp(1.85rem, 2.15vw, 2.3rem) !important;
    line-height: 1.12 !important;
  }

  html body[data-theme="dark"] .founder > div p {
    max-width: 560px !important;
    font-size: 1rem !important;
    line-height: 1.65 !important;
  }
}

@media (min-width: 761px) and (max-width: 980px) {
  html body .founder {
    width: min(920px, calc(100% - 32px)) !important;
    max-width: calc(100% - 32px) !important;
    grid-template-columns: 270px minmax(0, 1fr) !important;
    overflow: hidden !important;
  }

  html body .founder > img {
    width: 270px !important;
    min-width: 0 !important;
    height: 405px !important;
    object-fit: cover !important;
    object-position: center center !important;
    justify-self: center !important;
  }

  html body .founder > div {
    width: 100% !important;
    min-width: 0 !important;
  }
}

/* Desktop quotation polish: keep the document label on one line and make
   the rental summary slightly quieter than the quotation rows. */
@media (min-width: 901px) {
  /* Balance the calculator header against the quotation header without
     changing the shared panel height or the mobile presentation. */
  html body.modern-lhdn-page .monday-calculator-icon {
    width: 56px !important;
    height: 56px !important;
    min-width: 56px !important;
    border-radius: 12px !important;
  }

  html body.modern-lhdn-page .monday-calculator-head h3 {
    font-size: clamp(1.28rem, 1.6vw, 1.72rem) !important;
  }

  html body.modern-lhdn-page .monday-calculator-head p {
    font-size: 0.94rem !important;
  }

  html body.modern-lhdn-page .monday-calculator-form .monday-calculate-button {
    width: calc(100% - 56px) !important;
    margin-left: 28px !important;
    margin-right: 28px !important;
    box-sizing: border-box !important;
  }

  html body.modern-lhdn-page .monday-result-context p {
    font-size: 0.94rem !important;
    line-height: 1.2 !important;
  }

  html body.modern-lhdn-page .result-box.result-document .result-label {
    white-space: nowrap !important;
    font-size: 0.86rem !important;
    line-height: 1.1 !important;
  }
}

/* Desktop calculator fields: keep the labels and entered values refined and
   readable without changing the calculator's dimensions or mobile styling. */
@media (min-width: 761px) {
  html body.modern-lhdn-page .monday-calculator-form .field > label,
  html body.modern-lhdn-page .monday-calculator-form .calc-input-shell input,
  html body.modern-lhdn-page .monday-calculator-form .calc-input-shell select,
  html body.modern-lhdn-page .monday-calculator-form .salary-choice span {
    font-weight: 550 !important;
  }
}

/* Footer legal note: keep the independence statement directly below the
   copyright on desktop and mobile, with enough room to wrap on small screens. */
html body .monday-footer {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 7px !important;
  text-align: center !important;
  white-space: normal !important;
}

html body .monday-footer .footer-independent-note {
  display: block !important;
  max-width: 760px;
  margin: 0 !important;
  color: inherit !important;
  font-size: 0.72rem !important;
  font-weight: 400 !important;
  line-height: 1.45 !important;
  white-space: normal !important;
}

html body footer:not(.monday-footer) .footer-independent-note {
  display: block;
  width: 100%;
  margin-top: 6px;
  color: inherit;
  font-size: 0.72rem;
  font-weight: 400;
  line-height: 1.45;
  text-align: center;
}

@media (max-width: 760px) {
  html body.modern-lhdn-page .monday-footer,
  html body.home-page .monday-footer,
  html body .monday-footer {
    width: calc(100% - 12px) !important;
    max-width: 720px !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    gap: 2px !important;
    text-align: left !important;
  }

  html body .monday-footer .footer-independent-note {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100%;
    font-size: clamp(0.46rem, 1.9vw, 0.62rem) !important;
    font-weight: 400 !important;
    line-height: 1.25 !important;
    text-align: left !important;
    white-space: nowrap !important;
  }

  html body.modern-lhdn-page .monday-footer small.footer-independent-note,
  html body.home-page .monday-footer small.footer-independent-note,
  html body footer small.footer-independent-note {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
    font-size: clamp(0.4rem, 1.65vw, 0.54rem) !important;
    font-weight: 400 !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    text-align: left !important;
  }
}

/* Keep the two desktop header actions on one shared height. */
@media (min-width: 761px) {
  html body .monday-nav .nav-actions .calculator-nav-button,
  html body .monday-nav .nav-actions .whatsapp-nav-button[href*="wa.me"] {
    height: 36px !important;
    min-height: 36px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    box-sizing: border-box !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
}

/* Compact phone header action; keep the calculator button as light as the
   original header control instead of letting inherited padding make it bulky. */
@media (max-width: 760px) {
  html body .monday-nav .nav-actions .calculator-nav-button {
    height: 28px !important;
    min-height: 28px !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    box-sizing: border-box !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
  }
}

/* Keep the single-line state metric vertically centered beside the two-line
   metrics without changing the shared pill height. */
html body .trusted > div > strong:last-child {
  display: inline-flex !important;
  align-self: stretch !important;
  height: 100% !important;
  box-sizing: border-box !important;
  align-items: center !important;
  justify-content: center !important;
}

html body .services-suite-svg #cards > g {
  transform-box: fill-box !important;
  transform-origin: center center !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/* Arrows and status dots stay attached to their card; they never animate on
   card hover or focus. This prevents the Utilities/Admin drift bug. */
html body .services-suite-svg #cards > g > path:last-child,
html body .services-suite-svg #cards > g > circle:last-of-type {
  animation: none !important;
  transform: none !important;
  transform-box: fill-box !important;
  transform-origin: center center !important;
}

/* Desktop uses deliberate hover feedback only. No auto-floating animation. */
@media (min-width: 761px) and (hover: hover) and (pointer: fine) {
  html body .services-suite-frame:not(.suite-zoom-active) .services-suite-svg #cards > g {
    animation: none !important;
    transform: scale(1) !important;
    transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1), filter 220ms ease !important;
  }

  html body .services-suite-frame:has(.suite-link-lhdn:hover) #LHDN-Stamping,
  html body .services-suite-frame:has(.suite-link-ssm:hover) #SSM-Registration,
  html body .services-suite-frame:has(.suite-link-tax:hover) #Taxation-\&-Accounting,
  html body .services-suite-frame:has(.suite-link-licence:hover) #Business-License-\&-Signboard,
  html body .services-suite-frame:has(.suite-link-tenancy:hover) #Draft-Tenancy-Agreement,
  html body .services-suite-frame:has(.suite-link-utilities:hover) #Utilities-Registration,
  html body .services-suite-frame:has(.suite-link-admin:hover) #Admin-Support {
    transform: scale(1.035) !important;
    filter: drop-shadow(0 18px 24px rgba(31, 38, 85, 0.14)) !important;
  }
}

/* Touch users get the intentional left-to-right spotlight, but no hover-only
   transforms or horizontal page overflow. */
@media (max-width: 760px) {
  html body .services-suite-section,
  html body .services-suite-frame {
    max-width: 100%;
  }

  html body .services-suite-section {
    overflow-x: clip;
  }
}

@media (prefers-reduced-motion: reduce) {
  html body .services-suite-svg #cards > g,
  html body .services-suite-svg #cards > g > path:last-child,
  html body .services-suite-svg #cards > g > circle:last-of-type {
    animation: none !important;
    transition: none !important;
  }
}

/* Desktop LHDN quotation: tighten the first result row so the document type
   content sits closer to the context banner above. Mobile keeps its existing
   spacing and sizing. */
@media (min-width: 761px) {
  html body.modern-lhdn-page .monday-results-head {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: nowrap !important;
  }

  html body.modern-lhdn-page .monday-results-head > div {
    flex: 1 1 auto !important;
    min-width: 0 !important;
  }

  html body.modern-lhdn-page .monday-results-head .monday-pdf-button {
    flex: 0 0 auto !important;
    align-self: center !important;
    margin: 0 !important;
  }

  html body.modern-lhdn-page .monday-results-card .monday-result-context {
    min-height: 44px !important;
    margin-top: 8px !important;
    padding-top: 8px !important;
    padding-bottom: 8px !important;
  }

  html body.modern-lhdn-page .monday-results-card .monday-result-context {
    margin-bottom: 0 !important;
  }

  html body.modern-lhdn-page .monday-results-card .result-box.result-document {
    min-height: 40px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }
}
/* Taxation & Accounting: three service groups with consistent list rhythm. */
body.modern-lhdn-page[data-service="tax"] .module-grid[hidden] {
  display: none !important;
}

body.modern-lhdn-page[data-service="tax"] .detail-layout.has-no-modules {
  display: block;
  width: 100%;
  grid-template-columns: minmax(0, 1fr);
}

body.modern-lhdn-page[data-service="tax"] .detail-layout.has-no-modules .detail-card {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: clamp(22px, 2.6vw, 34px);
}

body[data-service="tax"] .detail-card ul.package-feature-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
}

body[data-service="tax"] .detail-card li.package-feature-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 22px;
  border: 1px solid #e1e4f2;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(24, 27, 52, 0.055);
}

body[data-service="tax"] .detail-card li.package-feature-card::before {
  display: none;
}

body[data-service="tax"] .package-feature-card > strong {
  display: block;
  margin-bottom: 14px;
  color: #202644;
  font-size: 1.08rem;
  font-weight: 675;
  line-height: 1.3;
}

body[data-service="tax"] .package-feature-card > span {
  position: relative;
  display: block;
  padding-left: 18px;
  color: #626b85;
  font-size: 0.92rem;
  line-height: 1.5;
}

body[data-service="tax"] .package-feature-card > span + span {
  margin-top: 9px;
}

body[data-service="tax"] .package-feature-card > span::before {
  content: "";
  position: absolute;
  top: 0.58em;
  left: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2d66f6;
}

body[data-theme="dark"][data-service="tax"] .detail-card li.package-feature-card {
  border-color: #46527f;
  background: #1d2547;
  box-shadow: none;
}

body[data-theme="dark"][data-service="tax"] .package-feature-card > strong {
  color: #f6f7ff;
}

body[data-theme="dark"][data-service="tax"] .package-feature-card > span {
  color: #d8ddf2;
}

@media (max-width: 980px) {
  body[data-service="tax"] .detail-card ul.package-feature-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  body[data-service="tax"] .detail-card li.package-feature-card {
    padding: 18px;
  }

  body[data-service="tax"] .package-feature-card > strong {
    font-size: 1rem;
  }

  body[data-service="tax"] .package-feature-card > span {
    font-size: 0.88rem;
  }
}
