:root {
  --ink: #4a3429;
  --ink-soft: #806758;
  --paper: #fff6e8;
  --panel: rgba(255, 251, 242, 0.93);
  --panel-strong: rgba(255, 253, 247, 0.97);
  --night: #6f4b35;
  --night-2: #b97848;
  --line: rgba(164, 112, 75, 0.24);
  --line-light: rgba(255, 248, 232, 0.68);
  --accent: #e58b55;
  --accent-deep: #9d5b37;
  --violet: #6f8f70;
  --gold: #d8aa52;
  --mint: #6aa985;
  --paw: #c98960;
  --shadow: 0 24px 70px rgba(87, 52, 28, 0.22);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  position: relative;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: "M PLUS Rounded 1c", sans-serif;
  background-color: #f8d8ae;
  background-image:
    radial-gradient(circle at 14% 18%, rgba(255, 247, 220, 0.86), transparent 26%),
    radial-gradient(circle at 84% 8%, rgba(133, 172, 128, 0.34), transparent 24%),
    linear-gradient(145deg, #f3c68d 0%, #f8dfb8 40%, #f5b790 74%, #d98b68 100%),
    linear-gradient(90deg, rgba(104, 72, 45, 0.035) 1px, transparent 1px),
    linear-gradient(0deg, rgba(104, 72, 45, 0.035) 1px, transparent 1px);
  background-size: auto, auto, auto, 94px 94px, 94px 94px;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.24;
  background-image: url("data:image/svg+xml,%3Csvg width='360' height='360' viewBox='0 0 360 360' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%239b6241' fill-opacity='.58'%3E%3Cg transform='translate(36 42) rotate(-16)'%3E%3Cellipse cx='0' cy='20' rx='13' ry='16'/%3E%3Cellipse cx='-20' cy='0' rx='8' ry='11'/%3E%3Cellipse cx='-5' cy='-9' rx='8' ry='12'/%3E%3Cellipse cx='12' cy='-8' rx='8' ry='12'/%3E%3Cellipse cx='25' cy='4' rx='8' ry='11'/%3E%3C/g%3E%3Cg transform='translate(274 92) rotate(18) scale(.82)'%3E%3Cellipse cx='0' cy='20' rx='13' ry='16'/%3E%3Cellipse cx='-20' cy='0' rx='8' ry='11'/%3E%3Cellipse cx='-5' cy='-9' rx='8' ry='12'/%3E%3Cellipse cx='12' cy='-8' rx='8' ry='12'/%3E%3Cellipse cx='25' cy='4' rx='8' ry='11'/%3E%3C/g%3E%3Cg transform='translate(116 292) rotate(10) scale(.72)'%3E%3Cellipse cx='0' cy='20' rx='13' ry='16'/%3E%3Cellipse cx='-20' cy='0' rx='8' ry='11'/%3E%3Cellipse cx='-5' cy='-9' rx='8' ry='12'/%3E%3Cellipse cx='12' cy='-8' rx='8' ry='12'/%3E%3Cellipse cx='25' cy='4' rx='8' ry='11'/%3E%3C/g%3E%3C/g%3E%3Cg fill='none' stroke='%23a97b52' stroke-opacity='.32' stroke-width='2'%3E%3Cpath d='M176 54c24 20 47 19 70 0'/%3E%3Cpath d='M222 248c31-11 54-4 72 20'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 360px 360px;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.2;
  background-image:
    radial-gradient(circle at 18% 72%, rgba(255, 255, 255, 0.72), transparent 18%),
    radial-gradient(circle at 88% 72%, rgba(95, 139, 100, 0.34), transparent 20%);
}

button,
input,
select,
textarea {
  font: inherit;
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(1440px, calc(100% - 32px));
  max-width: 100%;
  margin: 0 auto;
  padding: 28px 0 40px;
}

.page-shell .row {
  min-width: 0;
  margin-right: 0;
  margin-left: 0;
}

.page-shell main,
.page-shell section,
.page-shell [class*="col-"] {
  min-width: 0;
}

.app-header {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 0 28px;
  color: #fffaf1;
}

.brand-mark {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 76px;
  height: 76px;
  color: #fff2d5;
  border: 1px solid rgba(255, 247, 228, 0.72);
  border-radius: 8px;
  background: linear-gradient(160deg, rgba(124, 80, 46, 0.38), rgba(255, 246, 222, 0.16));
  box-shadow: 0 18px 46px rgba(99, 55, 25, 0.24);
  backdrop-filter: blur(16px);
}

.brand-mark svg {
  width: 54px;
  height: 54px;
  filter: drop-shadow(0 6px 18px rgba(104, 60, 28, 0.24));
}

h1,
h2,
h3 {
  font-family: "Kiwi Maru", "M PLUS Rounded 1c", serif;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: clamp(2.05rem, 5vw, 4.1rem);
  font-weight: 500;
  line-height: 1.08;
  text-shadow: 0 10px 32px rgba(95, 55, 28, 0.28);
}

h2 {
  margin: 0;
  font-size: 1.42rem;
  font-weight: 500;
}

h3 {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 500;
}

.section-kicker {
  color: #fff2c9;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.panel-heading .section-kicker {
  color: var(--accent-deep);
}

.tool-panel,
.chart-band,
.chat-band {
  max-width: 100%;
  min-width: 0;
  border: 1px solid var(--line-light);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 253, 247, 0.96), rgba(255, 241, 220, 0.9)),
    var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.tool-panel {
  position: sticky;
  top: 20px;
  padding: 22px;
}

.chart-band,
.chat-band {
  padding: 24px;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
  margin-bottom: 18px;
}

.panel-heading > div,
.share-header-title > div {
  min-width: 0;
}

.panel-heading > i {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: #fffaf0;
  border: 1px solid rgba(255, 255, 255, 0.56);
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--gold), var(--violet));
  box-shadow: 0 12px 26px rgba(143, 86, 42, 0.24);
  font-size: 1.08rem;
}

.reading-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.reading-actions > i,
.share-modal-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: #fffaf0;
  border: 1px solid rgba(255, 255, 255, 0.56);
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--gold), var(--violet));
  box-shadow: 0 12px 26px rgba(143, 86, 42, 0.24);
  font-size: 1.08rem;
}

.form-label {
  color: var(--ink);
  font-weight: 800;
}

.required {
  color: var(--accent);
  font-size: 0.86rem;
  font-weight: 800;
}

.text-muted {
  color: var(--ink-soft) !important;
}

.form-control,
.form-select {
  width: 100%;
  max-width: 100%;
  min-height: 46px;
  color: var(--ink);
  border: 1px solid rgba(164, 112, 75, 0.28);
  border-radius: 8px;
  background-color: rgba(255, 253, 254, 0.94);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76);
}

.form-control::placeholder,
textarea::placeholder {
  color: rgba(128, 103, 88, 0.74);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 0.2rem rgba(229, 139, 85, 0.2);
}

.number-picker {
  display: grid;
  gap: 8px;
}

.date-picker {
  grid-template-columns: minmax(92px, 1.25fr) minmax(72px, 0.9fr) minmax(72px, 0.9fr);
}

.time-picker {
  grid-template-columns: 1fr 1fr;
}

.number-picker .form-select {
  padding-left: 12px;
  padding-right: 30px;
  font-weight: 800;
}

.btn {
  border-radius: 8px;
  font-weight: 800;
}

.btn-primary {
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, #f4a260, var(--accent) 48%, #7aa36b);
  box-shadow: 0 14px 30px rgba(165, 94, 48, 0.28);
}

.btn-primary:hover,
.btn-primary:focus {
  background: linear-gradient(135deg, #ffb073, #d87846 52%, #6d9360);
}

.btn-dark {
  border: 0;
  color: #fff8fc;
  background: linear-gradient(135deg, var(--accent-deep), #7b6a3c);
  box-shadow: 0 10px 24px rgba(105, 61, 32, 0.24);
}

.btn-outline-secondary {
  color: var(--accent-deep);
  border-color: rgba(164, 67, 105, 0.34);
  background: rgba(255, 255, 255, 0.42);
}

.btn-outline-secondary:hover {
  color: #fff;
  border-color: transparent;
  background: var(--accent-deep);
}

.btn-share {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  color: #fffaf0;
  border: 1px solid rgba(255, 246, 226, 0.84);
  background: linear-gradient(135deg, #be7747, #789c62);
  box-shadow: 0 12px 26px rgba(143, 86, 42, 0.2);
}

.btn-share:hover,
.btn-share:focus {
  color: #fff;
  background: linear-gradient(135deg, #d98a54, #688c58);
}

.btn-share:disabled {
  color: rgba(128, 103, 88, 0.76);
  border-color: rgba(164, 112, 75, 0.16);
  background: rgba(255, 253, 247, 0.55);
  box-shadow: none;
}

.empty-state {
  color: var(--ink-soft);
  border: 1px dashed rgba(164, 67, 105, 0.28);
  border-radius: 8px;
  padding: 22px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(255, 238, 208, 0.66)),
    rgba(255, 255, 255, 0.42);
}

.chart-result {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.profile-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
}

.profile-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  padding: 8px 12px;
  color: var(--ink);
  border: 1px solid rgba(164, 67, 105, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.profile-pill i {
  color: var(--mint);
}

.pillar-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
}

.pillar-card {
  min-width: 0;
  min-height: 168px;
  padding: 16px;
  border: 1px solid rgba(164, 67, 105, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(180deg, #fffdf8, #fff0dc),
    var(--panel-strong);
  box-shadow: 0 14px 34px rgba(126, 44, 84, 0.09);
}

.pillar-label {
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 800;
}

.pillar-main {
  margin: 8px 0 12px;
  font-family: "Kiwi Maru", "M PLUS Rounded 1c", serif;
  font-size: 2.1rem;
  font-weight: 500;
  color: var(--accent);
}

.pillar-meta {
  display: grid;
  gap: 4px;
  color: var(--ink-soft);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.element-bars {
  display: grid;
  gap: 8px;
}

.element-row {
  display: grid;
  grid-template-columns: 36px 1fr 28px;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.element-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(57, 38, 52, 0.1);
}

.element-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #e8844e, var(--gold), var(--mint));
}

.ai-output {
  max-width: 100%;
  min-width: 0;
  min-height: 280px;
  white-space: pre-wrap;
  line-height: 1.95;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.share-result {
  display: grid;
  gap: 12px;
  min-width: 0;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid rgba(164, 112, 75, 0.26);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 247, 226, 0.92), rgba(255, 239, 214, 0.68)),
    rgba(255, 253, 247, 0.9);
}

.share-result-title {
  margin: 0;
  color: var(--accent-deep);
  font-weight: 800;
}

.share-result-note,
.share-expires {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.share-url-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  min-width: 0;
}

.share-url-row .form-control {
  min-width: 0;
  font-size: 0.92rem;
}

.ai-output.rendered,
.message.assistant.rendered {
  white-space: normal;
}

.ai-output.rendered *,
.message.assistant.rendered * {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.ai-output h2,
.ai-output h3,
.ai-output h4,
.message.assistant h2,
.message.assistant h3,
.message.assistant h4 {
  margin: 1rem 0 0.55rem;
  color: var(--accent-deep);
  line-height: 1.55;
}

.ai-output h2,
.message.assistant h2 {
  position: relative;
  padding-left: 1.35rem;
  font-size: 1.28rem;
}

.ai-output h2::before,
.message.assistant h2::before {
  content: "🐾";
  position: absolute;
  left: 0;
  top: 0.04em;
  font-size: 0.95rem;
}

.ai-output h3,
.message.assistant h3 {
  font-size: 1.08rem;
}

.ai-output h4,
.message.assistant h4 {
  font-size: 1rem;
}

.ai-output p,
.message.assistant p {
  margin: 0.7rem 0;
}

.ai-output ul,
.ai-output ol,
.message.assistant ul,
.message.assistant ol {
  padding-left: 1.3rem;
  margin: 0.65rem 0 0.85rem;
}

.ai-output li,
.message.assistant li {
  margin: 0.28rem 0;
}

.ai-output strong,
.message.assistant strong {
  color: var(--accent-deep);
  font-weight: 800;
}

.ai-output code,
.message.assistant code {
  padding: 0.1rem 0.35rem;
  border-radius: 6px;
  color: #7b4c2e;
  background: rgba(255, 232, 196, 0.82);
}

.ai-output pre,
.message.assistant pre {
  padding: 12px;
  overflow: auto;
  border: 1px solid rgba(164, 112, 75, 0.24);
  border-radius: 8px;
  background: rgba(255, 248, 232, 0.82);
}

.ai-output hr,
.message.assistant hr {
  margin: 1.15rem 0;
  border-color: rgba(164, 112, 75, 0.24);
  opacity: 1;
}

.md-table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 1rem 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  border: 1px solid rgba(164, 112, 75, 0.28);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.78);
}

.md-table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
}

.md-table th,
.md-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(164, 112, 75, 0.18);
  vertical-align: top;
}

.md-table th {
  color: #fffaf0;
  background: linear-gradient(135deg, #b97848, #7aa36b);
  font-weight: 800;
  white-space: nowrap;
}

.md-table tr:last-child td {
  border-bottom: 0;
}

.conversation {
  display: grid;
  gap: 12px;
  max-width: 100%;
  min-width: 0;
}

.message {
  min-width: 0;
  max-width: 88%;
  padding: 13px 15px;
  border-radius: 8px;
  line-height: 1.75;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.message.user {
  justify-self: end;
  color: #fff;
  background: linear-gradient(135deg, #d97c48, #719964);
}

.message.assistant {
  justify-self: start;
  border: 1px solid rgba(164, 112, 75, 0.22);
  background: rgba(255, 253, 247, 0.9);
}

.followup-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  min-width: 0;
  margin-top: 14px;
}

.followup-form textarea {
  min-width: 0;
  resize: vertical;
}

.followup-form .btn {
  min-width: 92px;
}

.history-list {
  display: grid;
  gap: 8px;
  max-height: 320px;
  overflow: auto;
}

.history-item {
  width: 100%;
  padding: 10px 12px;
  color: var(--ink);
  border: 1px solid rgba(164, 112, 75, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
  text-align: left;
}

.history-item:hover {
  background: rgba(255, 241, 216, 0.86);
}

.history-item strong {
  display: block;
  color: var(--ink);
}

.history-item span {
  color: var(--ink-soft);
  font-size: 0.84rem;
}

.alert-area {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.alert {
  border-radius: 8px;
}

.disclaimer {
  color: rgba(255, 252, 238, 0.88);
  font-size: 0.9rem;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 38%, rgba(255, 238, 194, 0.3), transparent 28%),
    linear-gradient(145deg, rgba(89, 56, 33, 0.78), rgba(171, 101, 61, 0.74)),
    rgba(61, 42, 25, 0.74);
  backdrop-filter: blur(8px);
}

.loading-card {
  display: grid;
  place-items: center;
  gap: 16px;
  width: min(88vw, 380px);
  padding: 18px 18px 22px;
  color: #fff;
  border: 1px solid rgba(255, 246, 226, 0.54);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(146, 88, 50, 0.94), rgba(74, 47, 29, 0.96));
  box-shadow: 0 28px 90px rgba(83, 47, 22, 0.44);
}

.loading-oracle {
  display: block;
  width: min(100%, 300px);
  aspect-ratio: 1;
  object-fit: cover;
  border: 1px solid rgba(255, 246, 226, 0.48);
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(255, 220, 151, 0.24);
}

.loading-copy {
  display: grid;
  justify-items: center;
  gap: 4px;
  text-align: center;
}

.loading-card p {
  margin: 0;
}

.loading-title {
  font-family: "Kiwi Maru", "M PLUS Rounded 1c", serif;
  font-size: 1.45rem;
  font-weight: 500;
}

#loadingText {
  color: rgba(255, 250, 235, 0.92);
  font-size: 0.92rem;
  font-weight: 800;
}

.paw-progress {
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 7px;
  width: min(250px, 72vw);
  margin-top: 10px;
  padding: 11px 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 246, 226, 0.36);
  border-radius: 999px;
  background: rgba(255, 248, 232, 0.14);
}

.paw-progress span {
  position: relative;
  display: block;
  height: 22px;
  opacity: 0.34;
  transform: translateY(6px) scale(0.78) rotate(-12deg);
  animation: pawStep 1.9s ease-in-out infinite;
}

.paw-progress span::before,
.paw-progress span::after {
  content: "";
  position: absolute;
  left: 50%;
  background: #fff4d7;
  transform: translateX(-50%);
}

.paw-progress span::before {
  bottom: 1px;
  width: 16px;
  height: 13px;
  border-radius: 50% 50% 45% 45%;
}

.paw-progress span::after {
  top: 1px;
  width: 24px;
  height: 10px;
  background:
    radial-gradient(circle at 10% 60%, #fff4d7 0 4px, transparent 4.5px),
    radial-gradient(circle at 38% 24%, #fff4d7 0 4px, transparent 4.5px),
    radial-gradient(circle at 64% 24%, #fff4d7 0 4px, transparent 4.5px),
    radial-gradient(circle at 90% 60%, #fff4d7 0 4px, transparent 4.5px);
}

.paw-progress span:nth-child(2) {
  animation-delay: 0.16s;
}

.paw-progress span:nth-child(3) {
  animation-delay: 0.32s;
}

.paw-progress span:nth-child(4) {
  animation-delay: 0.48s;
}

.paw-progress span:nth-child(5) {
  animation-delay: 0.64s;
}

.paw-progress span:nth-child(6) {
  animation-delay: 0.8s;
}

.loading-stage {
  min-height: 1.4em;
  color: rgba(255, 243, 212, 0.82);
  font-size: 0.82rem;
}

.mobile-tabbar {
  display: none;
}

@keyframes pawStep {
  0%,
  100% {
    opacity: 0.25;
    transform: translateY(6px) scale(0.78) rotate(-12deg);
  }
  42% {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(6deg);
    filter: drop-shadow(0 4px 10px rgba(255, 236, 186, 0.35));
  }
}

.share-modal {
  position: fixed;
  inset: 0;
  z-index: 2100;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    radial-gradient(circle at 52% 38%, rgba(255, 239, 205, 0.32), transparent 26%),
    rgba(61, 42, 25, 0.72);
  backdrop-filter: blur(8px);
}

.share-modal-card {
  position: relative;
  width: min(92vw, 480px);
  padding: 24px;
  color: var(--ink);
  border: 1px solid rgba(255, 246, 226, 0.72);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 253, 247, 0.98), rgba(255, 241, 220, 0.94)),
    var(--panel-strong);
  box-shadow: 0 28px 90px rgba(83, 47, 22, 0.42);
}

.share-modal-icon {
  margin-bottom: 14px;
}

.share-modal-card h2 {
  margin-bottom: 10px;
}

.share-modal-card p {
  margin-bottom: 18px;
  color: var(--ink-soft);
  line-height: 1.8;
}

.share-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.share-page .page-shell {
  width: min(1160px, calc(100% - 32px));
}

.share-header {
  justify-content: space-between;
  min-width: 0;
}

.share-header-title {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.share-header-cta {
  flex: 0 0 auto;
  white-space: nowrap;
}

.share-status {
  margin-bottom: 18px;
}

.share-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
  margin-bottom: 18px;
}

.share-meta span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  max-width: 100%;
  padding: 8px 11px;
  color: var(--ink);
  border: 1px solid rgba(164, 112, 75, 0.22);
  border-radius: 999px;
  background: rgba(255, 253, 247, 0.72);
  font-size: 0.9rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.share-cta-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-width: 0;
  padding: 24px;
  color: var(--ink);
  border: 1px solid rgba(255, 246, 226, 0.72);
  border-radius: 8px;
  background:
    radial-gradient(circle at 12% 20%, rgba(255, 255, 255, 0.68), transparent 34%),
    linear-gradient(135deg, rgba(255, 253, 247, 0.96), rgba(255, 229, 195, 0.9));
  box-shadow: var(--shadow);
}

.share-cta-band .section-kicker {
  color: var(--accent-deep);
}

.share-cta-band h2 {
  margin-bottom: 6px;
}

.share-cta-band p:last-child {
  margin: 0;
  color: var(--ink-soft);
  overflow-wrap: anywhere;
}

@media (max-width: 1199.98px) {
  .tool-panel {
    position: static;
  }
}

@media (max-width: 767.98px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
  }

  body {
    padding-bottom: calc(88px + env(safe-area-inset-bottom));
  }

  input,
  select,
  textarea,
  .form-control,
  .form-select {
    font-size: 16px !important;
    line-height: 1.35;
  }

  .page-shell {
    width: min(calc(100dvw - 20px), 720px);
    max-width: calc(100% - 20px);
    padding-top: 16px;
    padding-bottom: 18px;
  }

  .app-header {
    gap: 12px;
  }

  .share-header {
    align-items: stretch;
    flex-direction: column;
  }

  .share-header-title {
    gap: 12px;
  }

  .share-header-cta {
    width: 100%;
  }

  .brand-mark {
    width: 58px;
    height: 58px;
  }

  .brand-mark svg {
    width: 44px;
    height: 44px;
  }

  .tool-panel,
  .chart-band,
  .chat-band {
    padding: 18px;
  }

  .mobile-tabbar {
    position: fixed;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    left: 10px;
    z-index: 1200;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    padding: 8px;
    border: 1px solid rgba(255, 246, 226, 0.72);
    border-radius: 18px;
    background:
      linear-gradient(180deg, rgba(255, 253, 247, 0.96), rgba(255, 238, 213, 0.94)),
      var(--panel-strong);
    box-shadow: 0 18px 42px rgba(82, 48, 28, 0.28);
    backdrop-filter: blur(16px);
  }

  .mobile-tab-button {
    display: grid;
    place-items: center;
    gap: 4px;
    min-width: 0;
    min-height: 56px;
    padding: 6px 4px;
    color: var(--ink-soft);
    border: 0;
    border-radius: 13px;
    background: transparent;
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1.1;
  }

  .mobile-tab-button i {
    font-size: 1.05rem;
  }

  .mobile-tab-button span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-tab-button.active {
    color: #fffaf0;
    background: linear-gradient(135deg, var(--accent), var(--gold), var(--violet));
    box-shadow: 0 10px 22px rgba(143, 86, 42, 0.22);
  }

  body[data-mobile-view="form"] .history-block,
  body[data-mobile-view="form"] .chart-band,
  body[data-mobile-view="form"] .chat-band,
  body[data-mobile-view="history"] .form-block,
  body[data-mobile-view="history"] .chart-band,
  body[data-mobile-view="history"] .chat-band,
  body[data-mobile-view="chart"] .app-section-profile,
  body[data-mobile-view="chart"] .chat-band,
  body[data-mobile-view="reading"] .app-section-profile,
  body[data-mobile-view="reading"] .chart-band {
    display: none;
  }

  body[data-mobile-view="history"] .history-block {
    margin-top: 0 !important;
  }

  .date-picker {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .pillar-grid {
    grid-template-columns: 1fr 1fr;
  }

  .followup-form {
    grid-template-columns: 1fr;
  }

  .followup-form .btn {
    min-height: 46px;
  }

  .reading-actions {
    align-items: flex-end;
    flex-direction: column-reverse;
    gap: 8px;
  }

  .btn-share {
    min-height: 38px;
    padding: 7px 10px;
  }

  .share-url-row {
    grid-template-columns: 1fr;
  }

  .share-modal-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .share-cta-band {
    align-items: stretch;
    flex-direction: column;
    padding: 18px;
  }

  .share-cta-band .btn {
    width: 100%;
  }

  .message {
    max-width: 100%;
  }
}

@media (max-width: 420px) {
  .date-picker {
    grid-template-columns: 1fr;
  }

  .pillar-grid {
    grid-template-columns: 1fr;
  }
}
