:root {
  --bg: #f6f3ef;
  --card: #ffffff;
  --border: #cfc6be;
  --text: #1c1816;
  --muted: #524844;
  --accent: #d94432;
  --accent-dark: #a62c1d;
  --accent-soft: #fdebe8;
  --mint: #1f8a7e;
  --mint-soft: #e3f5f2;
  --gold: #c7720e;
  --gold-soft: #fef3df;
}

* { box-sizing: border-box; }

html, body {
  touch-action: manipulation;
  overscroll-behavior-y: none;
}

button, a, input, textarea {
  touch-action: manipulation;
}

body {
  margin: 0;
  font-family: "Noto Sans JP", "Yu Gothic", "Meiryo", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.7;
  overflow-x: hidden;
}

.hidden { display: none !important; }

/* Responsive 2-column (PC: Main + Right Widget / Mobile: Main then Bottom Widget) */
.layout {
  max-width: 980px;
  margin: 0 auto;
  padding: 20px 16px 56px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 24px;
  align-items: start;
}

.main-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.pain-widget-col {
  position: sticky;
  top: 20px;
}

/* Header */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.brand-btn {
  border: none;
  background: none;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--text);
  font-family: inherit;
}

.brand-mark { font-size: 24px; }
.brand-picto { width: 36px; height: 36px; display: block; border-radius: 9px; }
.brand-btn h1 { margin: 0; font-size: 21px; font-weight: 900; }

.user-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.user-pill {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  background: #f2ebe6;
  padding: 4px 10px;
  border-radius: 999px;
}

.user-pill.is-member {
  background: var(--mint-soft);
  color: #19786e;
}

.ghost-btn,
.grad-btn,
.return-btn,
.submit-btn,
.grad-confirm-btn,
.back-btn {
  border-radius: 999px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 6px 12px;
}

.ghost-btn,
.back-btn {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
}

.grad-btn {
  border: 1px solid #f0cfa0;
  background: var(--gold-soft);
  color: #9c5908;
}

.return-btn {
  border: none;
  background: var(--accent);
  color: #fff;
  padding: 8px 14px;
}

.submit-btn {
  border: none;
  background: var(--accent);
  color: #fff;
  padding: 8px 18px;
  font-size: 13px;
}

.grad-confirm-btn {
  border: none;
  background: var(--gold);
  color: #fff;
  padding: 8px 18px;
  font-size: 13px;
}

/* Graduated Banner */
.grad-banner {
  background: var(--gold-soft);
  border: 1px solid #f2d2a2;
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.grad-banner p { margin: 2px 0 0; font-size: 12px; color: #7c5624; }

/* TOP View: 2 Doors */
.top-hero {
  padding: 6px 2px 0;
}

.top-lead {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

.door-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 14px;
}

.door-card {
  width: 100%;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  font-family: inherit;
  color: var(--text);
  transition: border-color 0.15s, transform 0.1s, box-shadow 0.15s;
}

.door-card:hover {
  border-color: var(--accent);
  box-shadow: 0 6px 20px rgba(228, 87, 69, 0.08);
  transform: translateY(-1px);
}

.door-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--accent-soft);
  display: grid;
  place-items: center;
  font-size: 26px;
  flex-shrink: 0;
}

.door-body { flex: 1; min-width: 0; }
.door-body h2 { margin: 0 0 4px; font-size: 17px; font-weight: 900; }
.door-body p { margin: 0 0 6px; font-size: 13px; color: var(--muted); }
.door-meta {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 9px;
  border-radius: 999px;
}

.door-arrow {
  font-size: 20px;
  font-weight: 900;
  color: var(--muted);
}

/* Subpage Bar */
.subpage-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.subpage-bar h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 900;
}

/* Timeline Composer & Stream */
.composer {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.kind-row { display: flex; gap: 6px; }
.kind-pill {
  border: 1px solid var(--border);
  background: #fdfbfa;
  color: var(--muted);
  padding: 4px 12px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.kind-pill.active { background: var(--text); border-color: var(--text); color: #fff; }

.composer textarea,
.modal-card textarea,
.modal-card input,
.new-topic-form input,
.bbs-reply-form textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
  background: #fdfbfa;
  color: var(--text);
  outline: none;
}

.composer textarea:focus,
.bbs-reply-form textarea:focus { border-color: var(--accent); background: #fff; }

.composer-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.composer-foot-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.char-meta { font-size: 12px; color: var(--muted); }

.word-builder {
  border-top: 1px dashed var(--border);
  padding-top: 10px;
}

.word-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.word-chip {
  border: 1px solid #dfd7d0;
  background: #fdfbfa;
  color: var(--text);
  border-radius: 999px;
  padding: 4px 10px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.word-chip:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.word-chip-clear {
  background: #f2ebe6;
  color: var(--muted);
}

.stream-wrap { display: flex; flex-direction: column; gap: 10px; }
.filter-row { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-tab {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--muted);
  padding: 5px 12px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.filter-tab.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

.stream { display: flex; flex-direction: column; gap: 10px; }
.entry { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 14px 16px; }
.entry.is-grad { background: #fffdf8; border-color: #f0d7ae; }
.entry-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.entry-author { font-weight: 700; color: var(--text); }
.entry-tag { padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.tag-pain { background: var(--accent-soft); color: var(--accent); }
.tag-tip { background: var(--mint-soft); color: #19786e; }
.tag-grad { background: var(--gold-soft); color: #9c5908; }
.tag-bot { background: #eef0f6; color: #4c5673; }

.entry-body { margin: 8px 0 10px; font-size: 15px; white-space: pre-wrap; word-break: break-word; }
.entry-body a { color: #1a66b3; text-decoration: underline; }
.aff-note-badge { display: inline-block; font-size: 11px; color: var(--muted); background: #f5f0ec; padding: 2px 8px; border-radius: 6px; margin-bottom: 8px; }
.bot-disclosure {
  font-size: 11px;
  line-height: 1.5;
  color: #6b7280;
  background: #f6f7fa;
  border-left: 3px solid #cbd5e1;
  padding: 6px 9px;
  border-radius: 6px;
  margin-bottom: 10px;
}

.entry-reacts { display: flex; gap: 6px; flex-wrap: wrap; }
.react-chip {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--muted);
  padding: 4px 10px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.react-chip.active { background: var(--mint-soft); border-color: var(--mint); color: #177067; }

/* Topic Chat (Modernized 2ch-style Inline Flowing Thread Index) */
.topic-list-pane {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 20px;
}

.topic-link-list {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  line-height: 2.35;
  word-break: break-word;
}

.topic-link-list li {
  display: inline;
  margin-right: 18px;
}

.topic-link-btn {
  display: inline;
  border: none;
  background: transparent;
  padding: 4px 3px;
  margin: 0;
  font-family: inherit;
  font-size: 15px;
  cursor: pointer;
  color: inherit;
  border-radius: 5px;
  text-decoration: none;
  transition: background 0.12s;
}

.topic-link-btn:hover {
  background: var(--accent-soft);
}

.topic-link-no {
  font-weight: 700;
  color: var(--muted);
  margin-right: 3px;
}

.topic-link-title {
  font-weight: 700;
  color: #1450a3;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.topic-link-count {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  margin-left: 3px;
}

.new-topic-form {
  display: flex;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}

.new-topic-form input { flex: 1; padding: 8px 10px; font-size: 13px; }

.bbs-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  font-size: 15px;
}

.bbs-title {
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  font-size: 18px;
  font-weight: 900;
  color: var(--text);
  line-height: 1.45;
}

.bbs-dl {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bbs-post-item {
  padding: 12px 14px;
  border-radius: 10px;
  background: #ffffff;
}

.bbs-post-item:nth-child(odd) {
  background: #f7f3ef;
}

.bbs-dl dt {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 6px;
}

.bbs-res-no {
  display: inline-block;
  color: #1450a3;
  text-decoration: underline;
  text-underline-offset: 2px;
  padding: 1px 4px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.bbs-res-no:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.bbs-res-name {
  color: var(--text);
  font-weight: 700;
}

.bbs-dl dd {
  margin: 0;
  padding-left: 2px;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.7;
}

.bbs-anchor {
  display: inline-block;
  background: #edf3fc;
  color: #2659a6;
  font-size: 13px;
  font-weight: 700;
  padding: 0 6px;
  border-radius: 6px;
}

.bbs-hr { border: none; border-top: 1px solid var(--border); margin: 16px 0 14px; }
.bbs-reply-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.bbs-hint { font-size: 12px; color: var(--muted); }

/* Persistent Pain Button Widget */
.mash-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mash-widget-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
}

.live-tag {
  font-size: 10px;
  font-weight: 900;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 7px;
  border-radius: 999px;
}

.part-row { display: flex; gap: 6px; }
.part-pill {
  flex: 1;
  border: 1px solid var(--border);
  background: #fdfbfa;
  color: var(--muted);
  padding: 4px 8px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.part-pill.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

.mash-stage { position: relative; }
.mash-btn {
  width: 100%;
  min-height: 112px;
  border: 2px solid #d74230;
  border-bottom: 6px solid var(--accent-dark);
  border-radius: 16px;
  background: linear-gradient(180deg, #ef6553 0%, var(--accent) 100%);
  color: #fff;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform 0.05s ease, border-bottom-width 0.05s ease;
}
.mash-btn:active { transform: translateY(4px); border-bottom-width: 2px; }
.mash-main { font-size: 28px; font-weight: 900; letter-spacing: 0.05em; line-height: 1.15; }
.mash-sub { font-size: 11px; opacity: 0.92; }

.float-pop {
  position: absolute;
  pointer-events: none;
  font-weight: 900;
  font-size: 14px;
  color: #fff;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  animation: popUp 0.72s ease-out forwards;
}
@keyframes popUp {
  0% { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, -52px); }
}

.mash-stats-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #faf7f5;
  border-radius: 12px;
  padding: 10px 12px;
  font-variant-numeric: tabular-nums;
}

.mash-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 12px;
  color: var(--muted);
}

.mash-stat-row strong {
  font-size: 18px;
  color: var(--text);
}

.mash-foot-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
}

.mash-foot-links {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* Context-aware Mini Widget below Pain Button */
.pain-widget-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.side-sub-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px 14px;
}

.side-sub-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  margin-bottom: 8px;
}

.mini-topic-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mini-topic-link {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
  width: 100%;
  border: none;
  background: transparent;
  padding: 3px 4px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 12px;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
  color: #1450a3;
}

.mini-topic-link:hover {
  background: var(--accent-soft);
}

.mini-topic-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.mini-topic-cnt {
  color: var(--muted);
  font-size: 11px;
  flex-shrink: 0;
}

.mini-tl-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mini-tl-form textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 13px;
  background: #fdfbfa;
  resize: vertical;
}

.btn-xs {
  align-self: flex-end;
  padding: 6px 14px;
  font-size: 12px;
}

/* Pain Rhythm Diary Modal & Chart with Clickable Balloons */
.modal-card.diary-modal-card {
  width: 100%;
  max-width: min(780px, calc(100vw - 24px));
  padding: 16px 18px;
}

.diary-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}

.diary-sub {
  margin: 2px 0 0 !important;
  font-size: 12px !important;
  color: var(--muted);
}

.diary-range-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 13px;
  flex-wrap: wrap;
}

.diary-guest-note {
  font-size: 12px;
  color: var(--muted);
  background: #faf6f3;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 7px 11px;
  margin-bottom: 12px;
}

.diary-chart-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 6px;
}

.diary-chart-stage {
  position: relative;
  min-width: 640px;
  height: 290px;
  padding: 120px 10px 30px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(180deg, #fffdfb 0%, #faf6f3 100%);
  display: grid;
  grid-template-columns: repeat(14, minmax(38px, 1fr));
  align-items: end;
  gap: 6px;
}

.diary-col {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
}

.diary-bar-count {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 3px;
  font-variant-numeric: tabular-nums;
}

.diary-bar {
  width: 20px;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, #ee6553 0%, var(--accent) 100%);
  min-height: 3px;
  transition: height 0.25s ease;
}

.diary-bar.is-zero {
  background: #e5dcd5;
}

.diary-date {
  position: absolute;
  bottom: -24px;
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* Stem line + Overlapping Clickable Balloon */
.diary-stem {
  position: absolute;
  width: 1.5px;
  background: #c9b9b0;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
}

.diary-balloon {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 136px;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid #dfb9b1;
  background: #ffffff;
  box-shadow: 0 3px 10px rgba(45, 25, 18, 0.1);
  font-size: 11px;
  line-height: 1.35;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.12s, box-shadow 0.12s, transform 0.12s;
}

.diary-balloon:hover {
  border-color: var(--accent);
}

.diary-balloon.is-front {
  border-color: var(--accent);
  background: #fff9f7;
  box-shadow: 0 8px 22px rgba(217, 68, 50, 0.22);
  transform: translateX(-50%) scale(1.04);
}

.diary-balloon-date {
  display: block;
  font-size: 9px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 2px;
}

.text-link {
  border: none;
  background: none;
  color: var(--accent);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}

.log-box { border-top: 1px solid var(--border); padding-top: 10px; }
.log-box-head { display: flex; justify-content: space-between; font-size: 11px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.log-items { max-height: 140px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; font-size: 11px; font-variant-numeric: tabular-nums; }
.log-item { display: flex; justify-content: space-between; background: #faf7f5; padding: 4px 7px; border-radius: 6px; }

/* Footer */
.foot {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  padding-top: 10px;
}

.share-box { margin-bottom: 12px; }
.share-btn {
  border: 1px solid #f0c2ba;
  background: #fff6f4;
  color: var(--accent);
  padding: 9px 18px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.share-btn:hover { background: var(--accent-soft); }
.no-ai-note { margin: 0 0 6px; }
.foot-links { margin: 0; }
.foot-links a { color: var(--muted); }

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(25, 18, 16, 0.55);
  display: grid;
  place-items: center;
  padding: 12px;
  z-index: 100;
}

.modal-card {
  width: 100%;
  min-width: 0;
  max-width: min(440px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  background: #fff;
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
}

.modal-card h2 { margin: 0 0 10px; font-size: 16px; }
.modal-card p { margin: 0 0 10px; font-size: 13px; }
.modal-sub { font-size: 12px !important; color: var(--muted); }
.rules-list { margin: 0 0 14px; padding-left: 18px; font-size: 13px; display: flex; flex-direction: column; gap: 8px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }

.welcome-card { text-align: center; padding: 24px 22px 20px; }
.welcome-emoji { font-size: 36px; margin-bottom: 6px; }
.welcome-card h2 { font-size: 18px; line-height: 1.45; margin-bottom: 14px; }
.welcome-points { text-align: left; background: #faf6f3; border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin-bottom: 16px; }
.welcome-points p { margin: 0 0 8px; font-size: 13px; line-height: 1.55; }
.welcome-points p:last-child { margin-bottom: 0; }
.welcome-enter-btn { width: 100%; border: none; border-radius: 999px; background: var(--accent); color: #fff; font-family: inherit; font-size: 15px; font-weight: 900; padding: 13px 20px; cursor: pointer; }

.welcome-acute-btn {
  width: 100%;
  margin-top: 8px;
  border: 1.5px solid #e6a8a0;
  border-radius: 999px;
  background: #fff7f5;
  color: #b42318;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 16px;
  cursor: pointer;
}

.welcome-acute-btn:hover {
  background: #fde8e4;
}

.acute-emoji {
  font-size: 46px;
  margin-bottom: 4px;
}

.acute-title {
  font-size: 30px !important;
  font-weight: 900;
  color: #c92014;
  margin: 0 0 12px !important;
  letter-spacing: 0.04em;
}

.acute-desc {
  font-size: 14px !important;
  line-height: 1.6;
  margin-bottom: 18px !important;
}

.hospital-btn {
  display: block;
  width: 100%;
  text-decoration: none;
  border-radius: 999px;
  background: #c92014;
  color: #fff;
  font-size: 16px;
  font-weight: 900;
  padding: 14px 20px;
  box-shadow: 0 6px 18px rgba(201, 32, 20, 0.28);
}

.hospital-btn:hover {
  background: #a8190f;
}

.acute-quick-links {
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
}

.acute-quick-links a {
  color: #1450a3;
  font-weight: 700;
}

.acute-back-link {
  display: inline-block;
  margin-top: 16px;
  color: var(--muted) !important;
}

/* External Link Interstitial & Sponsor Slot */
.ext-url-box {
  font-size: 12px;
  color: var(--muted);
  background: #f6f2ee;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 10px;
  word-break: break-all;
  margin-bottom: 12px;
}

.sponsor-slot {
  border: 1.5px dashed #dfb9b1;
  background: #fff9f7;
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 12px;
}

.sponsor-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  background: #f2ebe6;
  padding: 1px 7px;
  border-radius: 999px;
  margin-bottom: 8px;
}

.sponsor-sticker-ad {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  text-align: left;
  color: inherit;
}

.sponsor-thumb {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  flex-shrink: 0;
}

.sponsor-sticker-info {
  min-width: 0;
}

.sponsor-title {
  font-size: 13px;
  font-weight: 900;
  color: var(--accent);
  margin-bottom: 2px;
}

.sponsor-desc {
  margin: 0 !important;
  font-size: 11px !important;
  line-height: 1.45;
  color: var(--muted);
}

.ext-jump-btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.welcome-foot { margin-top: 12px; font-size: 12px; color: var(--muted); display: flex; justify-content: center; align-items: center; gap: 6px; flex-wrap: wrap; }

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #2a2220;
  color: #fff;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  z-index: 130;
}

/* Mobile: stack Pain Button Widget cleanly at the bottom */
@media (max-width: 820px) {
  .layout {
    grid-template-columns: 1fr;
    max-width: 640px;
  }
  .pain-widget-col {
    position: static;
  }
  .mash-main {
    font-size: 32px;
  }
}
