.communication-page,
.communication-page body {
  overflow-x: clip;
}

.communication-app {
  width: calc(100% - 56px);
  max-width: 1104px;
  margin: 0 auto;
  padding: 18px 0 44px;
  box-sizing: border-box;
  font: 18px/1.5 Arial, Helvetica, sans-serif;
}

.communication-heading {
  padding: 30px;
  border-radius: 20px;
  background: #e8f1eb;
}

.communication-kicker {
  margin: 0 0 8px;
  color: #477365;
  font-size: 15px;
  font-weight: bold;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.communication-heading h1 {
  margin: 0 0 10px;
  color: #204c43;
  font-size: 38px;
  line-height: 1.2;
}

.communication-heading > p:not(.communication-kicker):not(.selected-message) {
  max-width: 760px;
  color: #52645e;
}

.speech-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 18px 0;
}

.speech-controls button {
  min-height: 48px;
  padding: 10px 18px;
  border: 1px solid #286a58;
  border-radius: 24px;
  background: #286a58;
  color: #fff;
  font-size: 17px;
  font-weight: bold;
}

.speech-controls button:disabled {
  border-color: #9bab9f;
  background: #9bab9f;
  cursor: default;
}

#stop-speech {
  border-color: #658275;
  background: transparent;
  color: #315a4c;
}

#speech-status {
  color: #49635c;
  font-size: 15px;
}

.selected-message {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 100;
  box-sizing: border-box;
  min-height: 54px;
  margin: 0 0 10px;
  padding: 12px 16px;
  border-left: 4px solid #d0804e;
  border-radius: 8px;
  background: #fffdf8;
  color: #204c43;
  font-size: 22px;
  font-weight: bold;
  box-shadow: 0 6px 20px rgba(32, 76, 67, 0.18);
}

.phrase-nav {
  display: flex;
  flex-wrap: nowrap;
  gap: 5px;
  margin: 14px 0 8px;
  padding: 2px 0 6px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

.phrase-nav a {
  display: inline-block;
  flex: 0 0 auto;
  min-height: 36px;
  padding: 5px 10px;
  border-radius: 22px;
  background: #e8f1eb;
  color: #285d4f;
  font-size: 14px;
  font-weight: bold;
  line-height: 26px;
  white-space: nowrap;
  text-decoration: none;
}

.phrase-section {
  margin-top: 30px;
  scroll-margin-top: 80px;
}

.phrase-section h2 {
  margin-bottom: 14px;
  color: #204c43;
  font-size: 25px;
}

.phrase-section h2 span {
  display: inline-block;
  width: 38px;
  color: #bd7a4d;
  text-align: center;
}

.phrase-grid {
  display: flex;
  flex-wrap: wrap;
  margin: -7px;
}

.phrase-card {
  display: flex;
  flex: 1 1 22%;
  align-items: center;
  min-width: 195px;
  min-height: 112px;
  gap: 13px;
  margin: 7px;
  padding: 16px;
  border: 1px solid rgba(38, 77, 65, 0.08);
  border-radius: 16px;
  color: #263d36;
  font-size: 19px;
  font-weight: bold;
  text-align: left;
  cursor: pointer;
}

.phrase-card:hover {
  border-color: #91b6a2;
  box-shadow: 0 5px 15px rgba(39, 68, 57, 0.1);
}

.phrase-symbol {
  display: inline-flex;
  flex: 0 0 44px;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.7);
  color: #39705e;
  font-size: 28px;
}

.tone-green {
  background: #e6f2ec;
}

.tone-blue {
  background: #e9f1f5;
}

.tone-peach {
  background: #f7eee5;
}

.tone-lilac {
  background: #efedf5;
}

.communication-note {
  margin-top: 34px;
  padding: 20px 22px;
  border-left: 5px solid #cf8a55;
  border-radius: 8px;
  background: #f7eee5;
  color: #564d45;
  font-size: 16px;
}

.communication-footer {
  padding: 20px;
  background: #214e43;
  color: #ecf4ef;
  font: 15px/1.5 Arial, Helvetica, sans-serif;
  text-align: center;
}

.communication-footer a {
  color: #fff;
}

@media (max-width: 760px) {
  .communication-app {
    width: calc(100% - 40px);
    padding: 10px 0 30px;
  }

  .communication-heading {
    padding: 22px 18px;
  }

  .communication-heading h1 {
    font-size: 32px;
  }

  .phrase-card {
    flex-basis: 100%;
    min-width: 0;
    min-height: 76px;
  }

  .selected-message {
    top: 0;
    min-height: 48px;
    padding: 10px 12px;
    font-size: 19px;
  }

  .phrase-nav {
    gap: 4px;
    margin: 10px 0 6px;
  }

  .phrase-nav a {
    min-height: 34px;
    padding: 4px 8px;
    font-size: 13px;
  }
}
