/* V359 — equal screen gutters and one visible outside frame.
   Intentional narrow 6px edge on BOTH sides for Tamil/English Horoscope,
   integrated Advanced, full Marriage Matching, and Nakshatra-only entry.
   Do not alter print, table grid/borders, charts, inputs, or control focus. */
@media screen {
  html body.smv-v12-theme main > :is(#english-horoscope,#tamil-horoscope) {
    box-sizing:border-box!important;
    width:min(100%,1192px)!important;
    max-width:1192px!important;
    min-width:0!important;
    margin-inline:auto!important;
    padding-inline:6px!important;
  }
  html body.smv-v12-theme main > :is(#english-horoscope,#tamil-horoscope) > .card {
    box-sizing:border-box!important;
    display:block;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    margin-inline:0!important;
    padding-inline:6px!important;
    border:1px solid var(--smv207-line,#e4d7bf)!important;
    border-radius:10px!important;
  }
  html body.smv-v12-theme main > #smvMarriageMatching {
    box-sizing:border-box!important;
    width:min(calc(100% - 12px),1180px)!important;
    max-width:1180px!important;
    min-width:0!important;
    margin-inline:auto!important;
    padding-inline:6px!important;
    border-left:1px solid var(--smv207-line,#e4d7bf)!important;
    border-right:1px solid var(--smv207-line,#e4d7bf)!important;
    border-radius:10px!important;
  }
  /* Do not stack the input-frame border with a second result frame. */
  html body.smv-v12-theme :is(#englishHoroscopeResult,#tamilHoroscopeResult),
  html body.smv-v12-theme #smvMarriageMatching :is(
    #mmNakshatraGate,#mmPublicChoice,#mmFullEntry,#mmManualEntry,
    #mmResult,#mmManualResult,.mm-results,.mm-full-results,.mm-v281-results
  ){
    box-sizing:border-box!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    margin-inline:0!important;
    padding-inline:0!important;
    border-inline:0!important;
    box-shadow:none!important;
  }
  /* Any generated child article in those reports is text on the SAME
     parent layer. Do not remove true charts, badge colours, table rules,
     chart labels or input borders. */
  html body.smv-v12-theme :is(#englishHoroscopeResult,#tamilHoroscopeResult)
  :is(.card,.adv-section,.smv-advanced-part,.smv-advanced-part-content,
      .phase1-module,.v5-module,.smv-fixed-text-section,
      .smv-v303-house,.smv-v254-subtopic),
  html body.smv-v12-theme #smvMarriageMatching
  :is(.mm-person-result,.mm-benefits,.mm-v281-topic-book,
      .mm-v281-character,.mm-v281-doshas,.mm-v281-character-final,
      .mm-v281-people>section,.mm-v281-dosha-person,
      .mm-front-porutham,.mm-front-dosha-summary,.mm-front-dosha-card,
      .mm-v281-house-note,.mm-v281-verdict,.mm-front-summary-note) {
    box-sizing:border-box!important;
    max-width:100%!important;
    min-width:0!important;
    margin-inline:0!important;
    padding-inline:0!important;
    border-inline:0!important;
    border-block:0!important;
    outline:0!important;
    box-shadow:none!important;
    background:transparent!important;
    background-image:none!important;
  }
  /* Prevent paragraph and long Tamil terms from creating an off-screen
     extra right edge. This intentionally does not select table cells. */
  html body.smv-v12-theme :is(#englishHoroscopeResult,#tamilHoroscopeResult,#smvMarriageMatching)
  :is(p,li,h2,h3,h4,h5) {
    max-width:100%;
    overflow-wrap:break-word;
  }
  /* Input selection is inside the ONE main matching border. These selectors
     affect containers only, preserving all button, radio, select and field borders. */
  html body.smv-v12-theme #smvMarriageMatching :is(
    #mmNakshatraGate,#mmPublicChoice,#mmFullEntry,#mmManualEntry,
    .mm-birth-grid,.mm-grid,.mm-gochar-date
  ) {
    box-sizing:border-box!important;
    min-width:0!important;
    max-width:100%!important;
    padding-inline:0!important;
    border-inline:0!important;
  }
  html body.smv-v12-theme #smvMarriageMatching
  :is(#mmFullEntry,#mmManualEntry) .mm-birth-grid fieldset {
    box-sizing:border-box!important;
    min-width:0!important;
    max-width:100%!important;
    padding-inline:0!important;
    border-inline:0!important;
  }
  /* Use a scroll wrapper, not a displaced document, for technical tables.
     Retain every actual table stroke and all chart lines. */
  html body.smv-v12-theme :is(#englishHoroscopeResult,#tamilHoroscopeResult,#smvMarriageMatching)
  :is(.adv-scroll,.adv-table-wrap,.data-table-wrap,.bhava-table-wrap,
      .mm-base-scroll,.smv-viii-table-scroll,.smv-tithi-table-scroll) {
    box-sizing:border-box!important;
    min-width:0!important;
    max-width:100%!important;
    margin-inline:0!important;
  }
}
@media screen and (max-width:640px){
  html body.smv-v12-theme main > :is(#english-horoscope,#tamil-horoscope) {
    padding-inline:6px!important;
  }
  html body.smv-v12-theme main > :is(#english-horoscope,#tamil-horoscope) > .card {
    padding:8px 6px!important;
    margin-inline:0!important;
  }
  html body.smv-v12-theme main > #smvMarriageMatching {
    width:calc(100% - 12px)!important;
    max-width:calc(100% - 12px)!important;
    margin:10px 6px 16px!important;
    padding:8px 6px!important;
  }
}
