*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; }
body { margin: 0; min-width: 280px; background: var(--hh-bg); color: var(--hh-text); font-family: var(--hh-font); font-size: 1rem; line-height: 1.6; }
a { color: var(--hh-primary); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--hh-focus); outline-offset: 3px; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { letter-spacing: -0.02em; line-height: 1.25; }
h1 { font-size: clamp(1.85rem, 2.8vw, 2.4rem); }
h2 { font-size: clamp(1.25rem, 2vw, 1.5rem); }
h3 { font-size: 1.2rem; }
.hh-container { width: min(var(--hh-content-width), calc(100% - 32px)); margin-inline: auto; }
.hh-skip { position: fixed; inset: -100px auto auto 12px; padding: 10px 14px; border-radius: 6px; background: var(--hh-gold); color: #102d43; z-index: 1000; }
.hh-skip:focus { top: 12px; }
.hh-header { background: var(--hh-surface); border-bottom: 1px solid var(--hh-border); }
.hh-header-inner { display: flex; gap: 16px; min-height: 78px; justify-content: space-between; align-items: center; }
.hh-brand { display: flex; align-items: center; gap: 12px; min-width: 0; color: inherit; text-decoration: none; border-radius: 10px; }
.hh-brand:hover .hh-brand-text strong { color: var(--hh-primary); }
.hh-brand-mark { display: grid; place-items: center; position: relative; width: 40px; height: 40px; flex: none; border-radius: 10px; background: var(--hh-text); color: var(--hh-surface); font-size: .85rem; font-weight: 750; }
.hh-brand-mark::after { content: ""; position: absolute; width: 8px; height: 8px; top: 4px; right: 4px; border-radius: 2px; background: var(--hh-gold); }
.hh-brand-text { display: flex; flex-direction: column; min-width: 0; }
.hh-brand-text strong { line-height: 1.2; font-size: 1.1rem; }
.hh-brand-text small { color: var(--hh-muted); font-size: .75rem; margin-top: 3px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.hh-header-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.hh-theme-toggle { display: flex; gap: 2px; align-items: center; }
.hh-icon-button { display: grid; place-items: center; min-width: 44px; min-height: 44px; border: 1px solid transparent; border-radius: var(--hh-radius-button); background: transparent; color: var(--hh-muted); font-size: 1.2rem; }
.hh-icon-button:hover, .hh-icon-button[aria-pressed='true'] { background: var(--hh-soft); border-color: var(--hh-border); color: var(--hh-primary); }
.hh-btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--hh-border); border-radius: var(--hh-radius-button); padding: 8px 15px; background: var(--hh-surface); color: var(--hh-text); font-size: .9375rem; font-weight: 650; text-decoration: none; }
.hh-btn:hover { filter: brightness(.97); }
.hh-btn-primary { background: var(--hh-primary); border-color: var(--hh-primary); color: var(--hh-button-foreground); }
.hh-btn-muted { background: var(--hh-bg); }
.hh-main { min-height: min(70vh, 720px); padding-top: 28px; padding-bottom: 40px; }
.hh-hero { margin: 0 0 26px; }
.hh-eyebrow { text-transform: uppercase; color: var(--hh-primary); font-weight: 700; font-size: .75rem; letter-spacing: .12em; }
.hh-hero h1 { margin: 8px 0 12px; }
.hh-hero p { max-width: 740px; color: var(--hh-muted); margin: 0; }
.hh-workspace { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(260px, 1fr); gap: 18px; }
.hh-card { min-width: 0; border-radius: var(--hh-radius-card); background: var(--hh-surface); border: 1px solid var(--hh-border); padding: 24px; box-shadow: var(--hh-shadow); }
.hh-card h2 { margin: 0 0 12px; }
.hh-muted { color: var(--hh-muted); }
.hh-caption { font-size: .875rem; color: var(--hh-muted); }
.hh-field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 24px; }
.hh-field { display: flex; flex-direction: column; gap: 6px; font-weight: 650; font-size: .9rem; }
.hh-field input { width: 100%; min-width: 0; min-height: 46px; border: 1px solid var(--hh-border); background: var(--hh-bg); border-radius: var(--hh-radius-sm); padding: 10px 12px; color: var(--hh-text); }
.hh-field input:focus { border-color: var(--hh-primary); }
.hh-actions { display: flex; gap: 12px; margin-top: 18px; }
.hh-result { background: var(--hh-soft); }
.hh-result-label { color: var(--hh-muted); font-size: .9rem; font-weight: 600; margin-top: 20px; }
.hh-result-number { font-family: var(--hh-font-mono); font-size: clamp(2rem, 4vw, 3rem); font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; color: var(--hh-primary); margin: 10px 0 24px; }
.hh-result-number span { font-family: var(--hh-font); font-size: 1.2rem; }
.hh-error { color: var(--hh-danger); font-weight: 600; font-size: .875rem; }
.hh-guide { margin-top: 20px; padding: 4px 0; max-width: 820px; }
.hh-guide h2 { margin-bottom: 8px; }
.hh-guide p { margin-bottom: 10px; }
.hh-footer { background: var(--hh-surface); border-top: 1px solid var(--hh-border); color: var(--hh-muted); font-size: .85rem; }
.hh-footer-inner { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; padding-block: 22px; }
@media (max-width: 800px) { .hh-workspace { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .hh-header-inner { padding-block: 12px; align-items: stretch; flex-direction: column; min-height: 0; }
  .hh-brand-text strong { font-size: 1.05rem; }
  .hh-header-actions { justify-content: space-between; gap: 6px; }
  .hh-main { padding-top: 24px; }
  .hh-card { padding: 18px; }
  .hh-field-grid { grid-template-columns: 1fr; gap: 12px; }
  .hh-footer-inner { flex-direction: column; gap: 8px; }
}
@media (min-width: 361px) and (max-width: 640px) {
  .hh-header-actions { justify-content: flex-end; gap: 6px; }
  .hh-lang { font-size: .84rem; padding-inline: 10px; }
}
@media (max-width: 360px) {
  .hh-brand-mark { width: 34px; height: 34px; border-radius: 8px; }
  .hh-lang { padding-inline: 10px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; } }


/* HappyHome Mobile Typography v1.1 — default components for every new app.
 * Feature-specific drawing annotations use dedicated app CSS and may stay smaller. */
@media (max-width: 767px) {
  body { font-size: 16px; line-height: 1.6; }
  h1, .hh-hero h1 { font-size: clamp(28px, 6vw, 32px); line-height: 1.2; }
  h2, .hh-card h2 { font-size: 21px; line-height: 1.3; }
  h3 { font-size: 18px; }
  .hh-hero p, .hh-guide p { font-size: 16px; }
  .hh-field, .hh-result-label { font-size: 15px; line-height: 1.5; }
  .hh-field input, select, textarea { font-size: 17px; min-height: 46px; }
  .hh-btn { font-size: 15px; min-height: 44px; }
  .hh-caption { font-size: 14px; line-height: 1.6; }
  .hh-eyebrow, .hh-brand-text small { font-size: 13px; letter-spacing: .08em; }
  .hh-card, .hh-field-grid > * { min-width: 0; }
}
