.rsah-app,
.rsah-app * {
  box-sizing: border-box;
}

.rsah-app {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 18px;
  background: #f5efe7;
  color: #181818;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  overflow-x: hidden;
}

.rsah-hero,
.rsah-card,
.rsah-tile,
.rsah-app-tile {
  border: 2px solid #dfd3c6;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 12px 24px rgba(44, 30, 20, 0.06);
}

.rsah-hero {
  padding: 24px;
  margin-bottom: 18px;
  background: #f1eae1;
}

.rsah-brand {
  color: #93481f;
  font-weight: 900;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 12px;
  margin-bottom: 12px;
}

.rsah-hero h1,
.rsah-card h2 {
  margin: 0 0 8px 0;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.05;
}

.rsah-hero h1 {
  font-size: clamp(34px, 8vw, 56px);
}

.rsah-hero p {
  margin: 0 0 18px;
  font-size: 18px;
  color: #6f7885;
}

.rsah-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #b8d9c5;
  color: #1f7244;
  border-radius: 999px;
  padding: 10px 18px;
  background: #f7fffa;
  font-size: 14px;
}

.rsah-pill-warning {
  border-color: #d7c29a;
  color: #93481f;
  background: #fff8e8;
}

.rsah-card {
  padding: 22px;
  margin-bottom: 18px;
}

.rsah-card p {
  color: #6f7885;
  font-size: 16px;
  line-height: 1.55;
}

.rsah-login form p {
  margin: 14px 0;
}

.rsah-login label {
  display: block;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
  color: #5e636b;
}

.rsah-login input[type="text"],
.rsah-login input[type="password"] {
  width: 100%;
  min-height: 54px;
  border: 2px solid #dfd3c6;
  border-radius: 16px;
  padding: 12px 16px;
  font-size: 18px;
  margin-top: 8px;
}

.rsah-login input[type="submit"],
.rsah-tile,
.rsah-app-tile em {
  appearance: none;
  border: 0;
  border-radius: 18px;
  background: #93481f;
  color: #fff;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.rsah-login input[type="submit"] {
  width: 100%;
  padding: 18px 20px;
  font-size: 16px;
}

.rsah-tile {
  width: 100%;
  display: block;
  text-align: left;
  padding: 22px;
  margin: 0 0 18px;
  cursor: pointer;
}

.rsah-tile strong,
.rsah-tile small {
  display: block;
}

.rsah-tile strong {
  font-size: 18px;
}

.rsah-tile small {
  margin-top: 8px;
  color: rgba(255,255,255,0.78);
  line-height: 1.45;
  font-size: 14px;
}

.rsah-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.rsah-app-tile {
  display: flex;
  flex-direction: column;
  min-height: 210px;
  padding: 20px;
  color: inherit;
  text-decoration: none !important;
  overflow: hidden;
}

.rsah-app-tile span {
  color: #93481f;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.rsah-app-tile strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
  line-height: 1.05;
  margin-bottom: 12px;
}

.rsah-app-tile small {
  display: block;
  color: #6f7885;
  line-height: 1.45;
  font-size: 15px;
  flex: 1 1 auto;
}

.rsah-app-tile em {
  display: block;
  text-align: center;
  padding: 14px 16px;
  margin-top: 18px;
  font-style: normal;
  font-size: 12px;
}

.rsah-disabled {
  opacity: 0.55;
}

.rsah-admin-link a {
  display: inline-block;
  color: #93481f;
  font-weight: 800;
}

.rsah-alert {
  border-color: #c1272d;
}

@media (max-width: 640px) {
  .rsah-app {
    width: 100vw;
    max-width: 100vw;
    margin: 0;
    padding: 14px;
  }
  .rsah-grid {
    grid-template-columns: 1fr;
  }
}


/* v0.1.1: Strong mobile containment for themes that render shortcode pages too wide. */
html:has(.rsah-app),
body:has(.rsah-app) {
  max-width: 100% !important;
  overflow-x: hidden !important;
}

body.rsah-app-page {
  max-width: 100% !important;
  overflow-x: hidden !important;
}

body.rsah-app-page .site,
body.rsah-app-page .site-content,
body.rsah-app-page .content-area,
body.rsah-app-page .entry-content,
body.rsah-app-page .wp-site-blocks,
body.rsah-app-page main,
body.rsah-app-page article,
body.rsah-app-page .container,
body.rsah-app-page .wrap {
  max-width: 100% !important;
  overflow-x: hidden !important;
}

.rsah-app {
  isolation: isolate;
  max-width: min(760px, calc(100vw - 24px));
  min-width: 0;
  overflow-x: clip;
}

.rsah-app *,
.rsah-app *::before,
.rsah-app *::after {
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: normal;
}

.rsah-app a,
.rsah-app button,
.rsah-app input,
.rsah-app textarea,
.rsah-app select {
  max-width: 100% !important;
}

.rsah-app-tile,
.rsah-tile,
.rsah-login input[type="submit"] {
  white-space: normal;
  text-align: center;
}

.rsah-app-tile strong,
.rsah-app-tile small,
.rsah-app-tile em,
.rsah-tile strong,
.rsah-tile small {
  overflow-wrap: anywhere;
  white-space: normal;
}

@media (max-width: 640px) {
  .rsah-app {
    width: calc(100vw - 24px) !important;
    max-width: calc(100vw - 24px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 12px;
    padding-right: 12px;
  }

  .rsah-hero,
  .rsah-card,
  .rsah-tile,
  .rsah-app-tile {
    border-radius: 20px;
  }

  .rsah-hero,
  .rsah-card {
    padding: 18px;
  }

  .rsah-hero h1 {
    font-size: clamp(30px, 11vw, 46px);
  }

  .rsah-app-tile {
    min-height: auto;
  }

  .rsah-app-tile strong {
    font-size: clamp(24px, 8vw, 34px);
  }
}

/* v0.1.4: BlackJax hard mobile shell + compact launcher. */
.rsah-shell,
.rsah-shell * {
  box-sizing: border-box !important;
}

.rsah-shell {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin: 0 auto !important;
  padding: 0 !important;
  overflow-x: hidden !important;
  contain: layout style;
}

.rsah-app-page,
.rsah-app-page #page,
.rsah-app-page .site,
.rsah-app-page .site-content,
.rsah-app-page .content-area,
.rsah-app-page .entry-content,
.rsah-app-page .wp-site-blocks,
.rsah-app-page .wp-block-post-content,
.rsah-app-page .wp-block-group,
.rsah-app-page main,
.rsah-app-page article,
.rsah-app-page .container,
.rsah-app-page .wrap {
  max-width: 100% !important;
  min-width: 0 !important;
  overflow-x: hidden !important;
}

.rsah-shell .rsah-app {
  width: min(760px, 100%) !important;
  max-width: min(760px, 100%) !important;
  min-width: 0 !important;
  margin: 0 auto !important;
  overflow-x: hidden !important;
}

.rsah-shell .rsah-hero,
.rsah-shell .rsah-card,
.rsah-shell .rsah-tile,
.rsah-shell .rsah-app-tile,
.rsah-shell .rsah-grid {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  overflow-x: hidden !important;
}

.rsah-shell .rsah-app-tile,
.rsah-shell .rsah-tile {
  overflow-wrap: anywhere !important;
  word-break: normal !important;
}

@media (max-width: 782px) {
  body.rsah-app-page {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  .rsah-shell {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
  }

  .rsah-shell .rsah-app {
    width: min(calc(var(--rsah-device-width, 100vw) - 20px), 100%) !important;
    max-width: min(calc(var(--rsah-device-width, 100vw) - 20px), 100%) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding: 12px !important;
  }

  .rsah-shell .rsah-hero {
    padding: 18px !important;
    border-radius: 22px !important;
  }

  .rsah-shell .rsah-hero h1 {
    font-size: clamp(34px, 12vw, 48px) !important;
    line-height: 0.98 !important;
  }

  .rsah-shell .rsah-hero p {
    font-size: 18px !important;
  }

  .rsah-shell .rsah-install {
    padding: 16px 14px !important;
    border-radius: 18px !important;
  }

  .rsah-shell .rsah-install strong {
    font-size: 16px !important;
    letter-spacing: 0.12em !important;
  }

  .rsah-shell .rsah-install small {
    font-size: 12px !important;
    line-height: 1.35 !important;
  }

  .rsah-shell .rsah-card {
    padding: 18px !important;
    border-radius: 22px !important;
  }

  .rsah-shell .rsah-card h2 {
    font-size: clamp(28px, 9vw, 40px) !important;
  }

  .rsah-shell .rsah-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .rsah-shell .rsah-app-tile {
    min-height: 0 !important;
    padding: 18px !important;
    border-radius: 20px !important;
  }

  .rsah-shell .rsah-app-tile strong {
    font-size: clamp(24px, 8vw, 34px) !important;
  }

  .rsah-shell .rsah-app-tile small {
    font-size: 15px !important;
    line-height: 1.35 !important;
  }

  .rsah-shell .rsah-app-tile em {
    padding: 14px 10px !important;
    font-size: 11px !important;
    letter-spacing: 0.12em !important;
  }
}

.rsah-standalone-page {
  margin: 0;
  min-height: 100vh;
  background: #f5efe7;
}

.rsah-install-url {
  margin: -8px 0 18px;
  text-align: center;
  font-size: 12px;
  overflow-wrap: anywhere;
  color: #6f7885;
}

.rsah-install-url a {
  color: #93481f;
  font-weight: 800;
}
