/* Localized text layout; Chinese pages retain their existing layout. */
html:not(:lang(zh)) .nine-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
    html:not(:lang(zh)) .palace,html:not(:lang(zh)) .palace small,html:not(:lang(zh)) .fortune-star{min-width:0;overflow-wrap:anywhere}
    html:not(:lang(zh)) .person-item>span:not(.avatar){min-width:0;overflow-wrap:anywhere}
    html:not(:lang(zh)) .natal-info strong{letter-spacing:0;overflow-wrap:anywhere}
    @media(max-width:760px){
      html:not(:lang(zh)) .time-controls .time-field #target-date,html:not(:lang(zh)) .time-controls .time-field #target-hour,html:not(:lang(zh)) .time-controls .square{height:44px;min-height:44px;max-height:44px}
      html:not(:lang(zh)) .time-controls{grid-template-columns:26px minmax(130px,1fr) 76px 26px}
      html:not(:lang(zh)) .time-controls .now-button{grid-column:1/-1;width:100%;white-space:normal;height:auto;max-height:none;padding:8px;min-height:44px}
      html:not(:lang(zh)) .active-person{flex-wrap:wrap}
      html:not(:lang(zh)) .active-person>div{flex:1 1 100%}
      html:not(:lang(zh)) .active-person b{flex:1 1 100%;white-space:normal}
      html:not(:lang(zh)) .active-person span,html:not(:lang(zh)) .active-person button{white-space:normal}
      html:not(:lang(zh)) .grid-toggle .palace{flex-direction:column;gap:2px;padding:4px 1px;min-height:60px}
      html:not(:lang(zh)) .grid-toggle .palace small{max-width:100%;line-height:1.3}
    }

.i18n-lines{white-space:pre-line}

/* The add icon has its own span; translated button copy keeps the button's font. */
#add-person>span[data-i18n]{font:inherit;margin-right:0}
@media(max-width:500px){
  html:not(:lang(zh)) .charts{grid-template-columns:minmax(0,1fr)}
  html:not(:lang(zh)) .grid-toggle .palace small{overflow-wrap:normal;word-break:normal}
}
