/* =========================================================
   CharacterCounter.COM — July 2026 Test CSS
   File name: index.css
   Refactored version: same HTML, less duplicated CSS.
========================================================= */

/* ---------------------------------------------------------
   Design tokens
--------------------------------------------------------- */
:root {
  --light-color: #3d3d3d;
  --light-color-alt: rgba(0, 0, 0, .6);
  --primary-background-color: #ffffff;
  --secondary-background-color: #f1f1f1;
  --transparent-light-color: rgba(0, 0, 0, .1);

  --blue: #4285F4;
  --blue-dark: #1A73E8;
  --green: #1e7b1e;
  --red: #d52d2b;
  --border-color: #d9d9d9;
  --soft-border-color: #e6e6e6;
  --white: #ffffff;
  --black: #000000;

  --font-family: Helvetica, Arial, sans-serif;
  --font-size-sm: 1.6rem;
  --font-size-md: 2.4rem;

  --gap: 2rem;
  --margin-sm: 2rem;
  --item-min-height-sm: 8.5rem;

  --top-title-h: 56px;
  --top-value-h: 48px;
  --bottom-title-h: 50px;
  --bottom-value-h: 40px;

  --textarea-default-height: 370px;
  --textarea-min-height: 80px;
  --textarea-max-height: 1200px;

  --card-radius: 14px;
  --card-shadow: 0 6px 18px rgba(0, 0, 0, .06);
}

/* ---------------------------------------------------------
   Base
--------------------------------------------------------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 62.5%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  font-family: var(--font-family);
  font-size: var(--font-size-sm);
  color: var(--light-color-alt);
  background: var(--primary-background-color);
  letter-spacing: 1px;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--blue-dark);
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
}

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

input,
textarea,
select {
  font-size: 1.6rem;
  font-family: var(--font-family);
}

button {
  border: 0;
  background: transparent;
}

button,
select {
  cursor: pointer;
}

p {
  line-height: 1.65;
}

/* ---------------------------------------------------------
   Layout helpers
--------------------------------------------------------- */
.container {
  max-width: 160rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.d-grid {
  display: grid;
}

.place-items-center {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.section {
  padding-block: 5rem;
}

.icon-svg {
  display: block;
  flex: 0 0 auto;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------------------------------------------------------
   Header
--------------------------------------------------------- */
.header {
  position: fixed;
  inset: 0 0 auto;
  width: 100%;
  z-index: 999;
  background: var(--primary-background-color);
}

.header.activated {
  box-shadow: 0 1px .5rem var(--transparent-light-color);
}

.navbar {
  min-height: 56px;
  padding-block: .8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: var(--font-size-md);
  color: var(--light-color);
  line-height: 1;
}

.logo-link,
.logo-picture {
  display: inline-flex;
  align-items: center;
}

.logo-picture img {
  display: block;
  height: 40px;
  width: auto;
}

.list {
  display: flex;
  align-items: center;
  gap: var(--gap);
}

.list-link {
  color: var(--light-color-alt);
  font-size: 1.6rem;
  line-height: 1.2;
  font-weight: 400;
  letter-spacing: 1px;
}

.list-link.current {
  color: var(--light-color-alt);
  font-weight: 400;
}

.list-link:hover,
.btn:hover {
  color: var(--light-color);
}

.btn {
  cursor: pointer;
}

.list-right {
  gap: 1.2rem;
}

.menu {
  position: absolute;
  top: 6.5rem;
  right: 1.5rem;
  width: 23rem;
  padding: 1.5rem;
  background: var(--secondary-background-color);
  opacity: 0;
  transform: scale(0);
  transform-origin: top right;
  transition: opacity .25s ease-in, transform .25s ease-in;
}

.menu > .list {
  flex-direction: column;
  align-items: stretch;
}

.menu .list-link {
  display: block;
  padding: .8rem 0;
}

.menu.activated {
  opacity: 1;
  transform: scale(1);
  box-shadow: 1px 1px 1rem var(--transparent-light-color);
}

.close-menu-icon,
.menu-toggle-icon.activated .open-menu-icon {
  display: none;
}

.menu-toggle-icon.activated .close-menu-icon {
  display: block;
}

@media (min-width: 1024px) {
  .menu {
    position: static;
    width: initial;
    padding: initial;
    background: transparent;
    opacity: 1;
    transform: scale(1);
  }

  .menu > .list {
    flex-direction: row;
    align-items: center;
  }

  .screen-lg-hidden {
    display: none;
  }
}

/* ---------------------------------------------------------
   Shared form styles
--------------------------------------------------------- */
.form-container-inner {
  margin: auto;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  text-align: center;
}

.form {
  display: flex;
  justify-content: center;
}

.form-input,
.form-btn {
  display: inline-block;
  outline: none;
  border: 2px solid var(--secondary-background-color);
  padding: 1.5rem;
  color: var(--light-color-alt);
  font-family: var(--font-family);
}

.form-input {
  width: 100%;
  border-right: 0;
  background: var(--primary-background-color);
}

.form-btn {
  width: 8rem;
  margin-left: -.5rem;
  border-left: 0;
  background: var(--secondary-background-color);
  text-transform: uppercase;
}

.form-btn:hover {
  background: #e6e6e6;
}

/* ---------------------------------------------------------
   Hero
--------------------------------------------------------- */
.counter-hero-shell {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr;
  padding-top: 9rem;
  padding-bottom: 2rem;
}

.counter-hero {
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  padding: 0 1.5rem;
  text-align: center;
}

.main-title {
  margin-bottom: 1rem;
  font-family: var(--font-family);
  font-size: 4rem;
  line-height: 1.15;
  color: var(--light-color);
  font-weight: 700;
}

.main-description {
  max-width: 80rem;
  margin: 0 auto;
  font-family: var(--font-family);
  font-size: 1.8rem;
  line-height: 1.45;
  color: var(--light-color-alt);
  font-weight: 300;
}

@media (min-width: 992px) {
  .counter-hero-shell {
    grid-template-columns: repeat(4, 1fr) 305px;
  }

  .counter-hero {
    grid-column: 1 / 5;
  }
}

@media (min-width: 1150px) {
  .counter-hero-shell {
    grid-template-columns: 1fr 200px 200px 200px 200px 1fr 305px;
  }

  .counter-hero {
    grid-column: 2 / 6;
    max-width: 820px;
  }
}

@media (max-width: 768px) {
  .counter-hero-shell {
    padding-top: 8rem;
    padding-bottom: 1.5rem;
  }

  .counter-hero {
    padding: 0 .5rem;
  }

  .main-title {
    font-size: 3.2rem;
  }

  .main-description {
    max-width: 64rem;
    font-size: 1.6rem;
  }
}

/* ---------------------------------------------------------
   Counter: shared element groups
--------------------------------------------------------- */
.text-box {
  background: var(--secondary-background-color);
  padding-bottom: 6rem;
}

.parent {
  background: var(--secondary-background-color);
  margin-bottom: 3rem;
}

.parent > div,
.parent > aside {
  min-width: 0;
}

.metric-label,
.parent :is(
  .div1, .div2, .div3, .div4,
  .div11, .div12, .div13, .div14,
  .div24, .div25, .div26, .div27,
  .div33, .div34, .div35, .div36,
  .div42, .div43, .div44, .div45,
  .div51, .div52, .div53, .div54
) {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: normal;
  word-break: normal;
  overflow: hidden;
  color: var(--light-color-alt);
  font-weight: 400;
  letter-spacing: .5px;
  background: var(--white);
  border: 1px solid var(--border-color);
  border-bottom: 0;
  box-shadow: none;
  position: relative;
  z-index: 1;
}

.metric-value,
.parent :is(
  #div5, #div6, #div7, #div8,
  #div15, #div16, #div17, #div18,
  #div28, #div29, #div30, #div31,
  #div37, #div38, #div39, #div40,
  #div46, #div47, #div48, #div49,
  #div55, #div56, #div57, #div58
) {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  line-height: 1;
  padding: 0 10px;
  background: var(--white);
  border: 1px solid var(--border-color);
  border-top: 0;
  box-shadow: none;
  position: relative;
  z-index: 1;
}

.parent :is(.div1, .div2, .div3, .div4) {
  min-height: var(--top-title-h);
  padding: 0 10px;
  font-size: 1.95rem;
  line-height: 1.15;
}

.parent :is(.div1, .div2, .div4) {
  font-size: 2.4rem;
}

.div3 {
  padding-top: 5px;
}

.parent :is(
  .div11, .div12, .div13, .div14,
  .div24, .div25, .div26, .div27,
  .div33, .div34, .div35, .div36,
  .div42, .div43, .div44, .div45,
  .div51, .div52, .div53, .div54
) {
  min-height: var(--bottom-title-h);
  padding: 2px 12px;
  font-size: 1.9rem;
  line-height: 1.2;
}

.parent :is(#div5, #div6, #div7, #div8) {
  min-height: var(--top-value-h);
  padding-top: 4px;
  padding-bottom: 6px;
}

.parent :is(
  #div15, #div16, #div17, #div18,
  #div28, #div29, #div30, #div31,
  #div37, #div38, #div39, #div40,
  #div46, #div47, #div48, #div49,
  #div55, #div56, #div57, #div58
) {
  min-height: var(--bottom-value-h);
  padding-top: 5px;
  padding-bottom: 6px;
}

.parent :is(
  #characterOutput,
  #wordOutput,
  #spaceOutput,
  #letterOutput,
  #sentenceOutput,
  #pageOutput,
  #charactersRemaining,
  #charactersWithoutSpacesOutput,
  #readingTimeOutput,
  #speakingTimeOutput,
  #averageWordLengthOutput,
  #paragraphOutput,
  #lineOutput,
  #uniqueWordOutput,
  #wordsPerSentenceOutput,
  #uniqueCharacterOutput,
  #emojiOutput,
  #symbolOutput,
  #numberOutput,
  #twitterLimitOutput,
  #smsLimitOutput,
  #instagramLimitOutput,
  #linkedinLimitOutput
) {
  max-width: 100%;
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 2.3rem;
  line-height: 1.1;
  color: var(--blue);
  text-align: center;
  transform: translateY(-1px);
  font-weight: 400;
  letter-spacing: .5px;
}

.parent :is(#characterOutput, #wordOutput) {
  font-size: 2.8rem;
}

#charactersRemaining {
  font-weight: 600;
}

#charactersRemaining.within-limit,
.textarea-character-status.within-limit {
  color: var(--green);
}

#charactersRemaining.over-limit,
.textarea-character-status.over-limit {
  color: var(--red);
}

.platform-limit-value.over-limit :is(
  #twitterLimitOutput,
  #smsLimitOutput,
  #instagramLimitOutput,
  #linkedinLimitOutput
) {
  color: var(--red);
  font-weight: 600;
}

.div24 {
  font-size: 1.56rem;
  line-height: 1.22;
  overflow: visible;
}

.div27 {
  line-height: 1.28;
  transform: translateY(-1px);
  overflow: visible;
  padding-top: 1px;
  padding-bottom: 4px;
}

/* ---------------------------------------------------------
   Textarea
--------------------------------------------------------- */
.textarea-wrapper {
  position: relative;
  width: 100%;
  height: auto;
  min-height: 0;
}

.textarea-actions {
  position: absolute;
  right: 41px;
  bottom: 16px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 8px;
}

.textarea-action {
  padding: 6px 11px;
  border: 1px solid #d9d9d9;
  border-radius: 999px;
  font-family: var(--font-family);
  font-size: 1.3rem;
  line-height: 1;
  font-weight: 400;
  letter-spacing: .5px;
  color: var(--blue);
  background: rgba(255, 255, 255, .94);
  cursor: pointer;
  box-shadow: none;
  transition: background .2s ease, color .2s ease, border-color .2s ease, opacity .2s ease;
}

.textarea-action:hover {
  background: #f1f1f1;
  color: var(--blue-dark);
  border-color: #cfcfcf;
}

.textarea-action:disabled {
  opacity: .75;
  cursor: default;
}

textarea {
  display: block;
  width: 100%;
  height: var(--textarea-default-height);
  min-height: var(--textarea-min-height);
  max-height: var(--textarea-max-height);
  padding: 10px;
  border: 5px solid var(--light-color-alt);
  border-radius: 15px;
  outline: none;
  resize: vertical;
  overflow: auto;
  white-space: initial;
  background: var(--white);
  color: var(--black);
  font-family: var(--font-family);
  font-size: 1.6rem;
  box-shadow: none;
}

textarea:focus {
  border-color: var(--black);
  box-shadow: none;
}

textarea::placeholder {
  color: var(--light-color-alt);
}

.clearButton,
.copyButton {
  text-transform: none;
  text-decoration: none;
}

.metric-title-stack {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transform: translateY(2px);
}

.metric-title-main,
.metric-title-note {
  display: block;
  width: 100%;
  text-align: center;
}

.metric-title-main {
  line-height: 1.15;
  white-space: nowrap;
}

.metric-title-note {
  margin-top: 3px;
  font-size: 1.35rem;
  line-height: 1.1;
  font-weight: 400;
  color: rgba(0, 0, 0, .52);
}

.metric-limit-input {
  width: 100%;
  max-width: 155px;
  height: 34px;
  padding: 4px 8px;
  border: 1px solid #cfcfcf;
  border-radius: 7px;
  outline: none;
  background: var(--white);
  color: var(--light-color);
  font-size: 1.45rem;
  line-height: 1.1;
  text-align: center;
}

.metric-limit-input::placeholder {
  color: rgba(0, 0, 0, .45);
}

.metric-limit-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(66, 133, 244, .16);
}

.div9,
.div19 {
  position: relative;
  z-index: 1;
}

.div9 {
  align-self: start;
}

.div9 form {
  display: block;
  height: auto;
  min-height: 0;
}

.div19,
.parent :is(.div22, .div23, .div32, .div41, .div50, .div59) {
  background: transparent;
}

.parent :is(.div22, .div23, .div32, .div41, .div50, .div59) {
  position: relative;
  z-index: 0;
  pointer-events: none;
}

/* ---------------------------------------------------------
   Sidebar
--------------------------------------------------------- */
.sidebar {
  background: transparent;
}

.sidebar-inner {
  width: 100%;
  min-width: 300px;
}

.sidebar-widget {
  width: 100%;
  padding: 1.6rem;
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--card-shadow);
}

.sidebar-title {
  margin-bottom: 1rem;
  color: var(--light-color);
  font-size: 1.8rem;
  line-height: 1.25;
  font-weight: 700;
}

.sidebar-links {
  display: flex;
  flex-direction: column;
  gap: .8rem;
}

.sidebar-links a {
  color: var(--blue-dark);
  font-size: 1.5rem;
  line-height: 1.35;
  font-weight: 600;
}

.sidebar-links a:hover {
  text-decoration: underline;
}

/* ---------------------------------------------------------
   Textarea meta row
--------------------------------------------------------- */
.textarea-meta-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: .45rem;
}

.textarea-meta-box {
  display: flex;
  align-items: center;
  min-height: 36px;
}

.textarea-checkbox-box {
  flex: 0 1 auto;
  justify-content: flex-start;
  max-width: 340px;
  padding: .7rem 1.1rem;
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 10px;
}

.textarea-status-box {
  flex: 0 1 auto;
  justify-content: flex-end;
  margin-left: auto;
  padding: .15rem 8px 0 0;
  text-align: right;
  background: transparent;
  border: 0;
}

.limit-include-spaces {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  color: var(--light-color-alt);
  font-size: 1.45rem;
  line-height: 1.35;
  font-weight: 400;
  letter-spacing: .5px;
  cursor: pointer;
  user-select: none;
}

.limit-include-spaces input {
  width: 17px;
  height: 17px;
  accent-color: var(--blue);
  cursor: pointer;
}

.textarea-character-status {
  color: var(--light-color-alt);
  font-size: 1.55rem;
  line-height: 1.35;
  font-weight: 400;
  letter-spacing: .5px;
  text-align: right;
}

/* ---------------------------------------------------------
   Mobile counter grid
--------------------------------------------------------- */
@media (min-width: 0) {
  .parent {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows:
      var(--top-title-h) 48px
      auto
      var(--top-title-h) 48px
      var(--top-title-h) 48px
      var(--bottom-title-h) 42px
      var(--bottom-title-h) 42px
      var(--bottom-title-h) 42px
      var(--bottom-title-h) 42px;
    grid-column-gap: 0;
    grid-row-gap: 0;
  }

  .div1 { grid-area: 1 / 1 / 2 / 2; }
  #div5 { grid-area: 2 / 1 / 3 / 2; }

  .div9 {
    grid-area: 3 / 1 / 4 / 2;
    margin: 10px 0;
    box-shadow: none;
  }

  .div3 { grid-area: 4 / 1 / 5 / 2; }
  #div7 { grid-area: 5 / 1 / 6 / 2; }

  .div4 { grid-area: 6 / 1 / 7 / 2; }
  #div8 { grid-area: 7 / 1 / 8 / 2; }

  .div2 { grid-area: 8 / 1 / 9 / 2; }
  #div6 { grid-area: 9 / 1 / 10 / 2; }

  .div11 { grid-area: 10 / 1 / 11 / 2; }
  #div15 { grid-area: 11 / 1 / 12 / 2; }

  .div24 { grid-area: 12 / 1 / 13 / 2; }
  #div28 { grid-area: 13 / 1 / 14 / 2; }

  .div12 { grid-area: 14 / 1 / 15 / 2; }
  #div16 { grid-area: 15 / 1 / 16 / 2; }

  .parent :is(
    .div13, .div14, .div25, .div26, .div27,
    .div33, .div34, .div35, .div36,
    .div42, .div43, .div44, .div45,
    .div51, .div52, .div53, .div54,
    #div17, #div18, #div29, #div30, #div31,
    #div37, #div38, #div39, #div40,
    #div46, #div47, #div48, #div49,
    #div55, #div56, #div57, #div58,
    .div19, .div32, .div41, .div50, .div59
  ) {
    display: none;
  }

  .div22 {
    grid-area: 1 / 1 / 3 / 2;
  }

  .div23 {
    grid-area: 4 / 1 / 16 / 2;
  }
}

/* ---------------------------------------------------------
   Tablet / desktop counter grid
--------------------------------------------------------- */
@media (min-width: 768px) {
  .parent {
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows:
      var(--top-title-h) var(--top-value-h)
      auto
      var(--bottom-title-h) var(--bottom-value-h)
      var(--bottom-title-h) var(--bottom-value-h)
      var(--bottom-title-h) var(--bottom-value-h)
      var(--bottom-title-h) var(--bottom-value-h)
      var(--bottom-title-h) var(--bottom-value-h);
  }

  .div1 { grid-area: 1 / 1 / 2 / 2; }
  .div2 { grid-area: 1 / 2 / 2 / 3; }
  .div3 { grid-area: 1 / 3 / 2 / 4; }
  .div4 { grid-area: 1 / 4 / 2 / 5; }

  #div5 { grid-area: 2 / 1 / 3 / 2; }
  #div6 { grid-area: 2 / 2 / 3 / 3; }
  #div7 { grid-area: 2 / 3 / 3 / 4; }
  #div8 { grid-area: 2 / 4 / 3 / 5; }

  .div9 {
    grid-area: 3 / 1 / 4 / 5;
    margin: 10px 0 0;
  }

  .div11 { grid-area: 4 / 1 / 5 / 2; }
  .div24 { grid-area: 4 / 2 / 5 / 3; }
  .div12 { grid-area: 4 / 3 / 5 / 4; }
  .div42 { grid-area: 4 / 4 / 5 / 5; }

  #div15 { grid-area: 5 / 1 / 6 / 2; }
  #div28 { grid-area: 5 / 2 / 6 / 3; }
  #div16 { grid-area: 5 / 3 / 6 / 4; }
  #div46 { grid-area: 5 / 4 / 6 / 5; }

  .div51 { grid-area: 6 / 1 / 7 / 2; }
  .div52 { grid-area: 6 / 2 / 7 / 3; }
  .div53 { grid-area: 6 / 3 / 7 / 4; }
  .div54 { grid-area: 6 / 4 / 7 / 5; }

  #div55 { grid-area: 7 / 1 / 8 / 2; }
  #div56 { grid-area: 7 / 2 / 8 / 3; }
  #div57 { grid-area: 7 / 3 / 8 / 4; }
  #div58 { grid-area: 7 / 4 / 8 / 5; }

  .div14 { grid-area: 8 / 1 / 9 / 2; }
  .div33 { grid-area: 8 / 2 / 9 / 3; }
  .div13 { grid-area: 8 / 3 / 9 / 4; }
  .div35 { grid-area: 8 / 4 / 9 / 5; }

  #div18 { grid-area: 9 / 1 / 10 / 2; }
  #div37 { grid-area: 9 / 2 / 10 / 3; }
  #div17 { grid-area: 9 / 3 / 10 / 4; }
  #div39 { grid-area: 9 / 4 / 10 / 5; }

  .div25 { grid-area: 10 / 1 / 11 / 2; }
  .div26 { grid-area: 10 / 2 / 11 / 3; }
  .div27 { grid-area: 10 / 3 / 11 / 4; }
  .div34 { grid-area: 10 / 4 / 11 / 5; }

  #div29 { grid-area: 11 / 1 / 12 / 2; }
  #div30 { grid-area: 11 / 2 / 12 / 3; }
  #div31 { grid-area: 11 / 3 / 12 / 4; }
  #div38 { grid-area: 11 / 4 / 12 / 5; }

  .div36 { grid-area: 12 / 1 / 13 / 2; }
  .div43 { grid-area: 12 / 2 / 13 / 3; }
  .div44 { grid-area: 12 / 3 / 13 / 4; }
  .div45 { grid-area: 12 / 4 / 13 / 5; }

  #div40 { grid-area: 13 / 1 / 14 / 2; }
  #div47 { grid-area: 13 / 2 / 14 / 3; }
  #div48 { grid-area: 13 / 3 / 14 / 4; }
  #div49 { grid-area: 13 / 4 / 14 / 5; }

  .parent :is(
    .div13, .div14, .div24, .div25, .div26, .div27,
    .div33, .div34, .div35, .div36,
    .div42, .div43, .div44, .div45,
    .div51, .div52, .div53, .div54,
    #div17, #div18, #div28, #div29, #div30, #div31,
    #div37, #div38, #div39, #div40,
    #div46, #div47, #div48, #div49,
    #div55, #div56, #div57, #div58
  ) {
    display: flex;
  }

  .div22 { grid-area: 1 / 1 / 3 / 5; }
  .div23 { grid-area: 4 / 1 / 6 / 5; }
  .div59 { grid-area: 6 / 1 / 8 / 5; }
  .div32 { grid-area: 8 / 1 / 10 / 5; }
  .div41 { grid-area: 10 / 1 / 12 / 5; }
  .div50 { grid-area: 12 / 1 / 14 / 5; }

  .metric-limit-input {
    max-width: 150px;
  }

  .div3 {
    overflow: visible;
    z-index: 2;
  }

  .div3 .metric-title-stack {
    transform: translate(-4px, 2px);
  }

  .parent :is(
    .div11, .div12, .div13, .div14,
    .div24, .div25, .div26, .div27,
    .div33, .div34, .div35, .div36,
    .div42, .div43, .div44, .div45,
    .div51, .div52, .div53, .div54,
    #div15, #div16, #div17, #div18,
    #div28, #div29, #div30, #div31,
    #div37, #div38, #div39, #div40,
    #div46, #div47, #div48, #div49,
    #div55, #div56, #div57, #div58
  ) {
    margin-left: 3px;
    margin-right: 3px;
  }

  .parent :is(
    .div11, .div12, .div13, .div14,
    .div24, .div25, .div26, .div27,
    .div33, .div34, .div35, .div36,
    .div42, .div43, .div44, .div45,
    .div51, .div52, .div53, .div54
  ) {
    margin-top: 6px;
    font-size: 1.8rem;
    line-height: 1.2;
    padding: 2px 10px;
  }

  .parent :is(
    #div15, #div16, #div17, #div18,
    #div28, #div29, #div30, #div31,
    #div37, #div38, #div39, #div40,
    #div46, #div47, #div48, #div49,
    #div55, #div56, #div57, #div58
  ) {
    margin-bottom: 6px;
  }

  .parent :is(.div1, .div2, .div3, .div4) {
    font-size: 1.72rem;
    line-height: 1.12;
    padding: 2px 8px;
  }

  .parent :is(.div1, .div2, .div4) {
    font-size: 2.3rem;
  }

  .parent .div24 {
    font-size: 1.54rem;
    line-height: 1.22;
    overflow: visible;
  }

  .parent .div27 {
    line-height: 1.28;
    transform: translateY(-1px);
    overflow: visible;
    padding-top: 1px;
    padding-bottom: 4px;
  }

  .parent .div36 {
    font-size: 1.55rem;
  }

  .parent .div42 {
    font-size: 1.62rem;
  }

  .parent :is(.div51, .div52, .div53, .div54) {
    font-size: 1.75rem;
  }
}

@media (min-width: 992px) {
  .parent {
    grid-template-columns: repeat(4, 1fr) 305px;
  }

  .div19 {
    grid-area: 1 / 5 / 14 / 6;
    display: block;
    width: 305px;
    min-width: 300px;
    min-height: 600px;
    height: auto;
    margin: 0 0 0 5px;
    align-self: stretch;
    overflow: visible;
    background: transparent;
  }
}

@media (min-width: 1150px) {
  .parent {
    grid-template-columns: 1fr 200px 200px 200px 200px 1fr 305px;
  }

  .parent :is(
    #characterOutput,
    #wordOutput,
    #spaceOutput,
    #letterOutput,
    #sentenceOutput,
    #pageOutput,
    #charactersRemaining,
    #charactersWithoutSpacesOutput,
    #readingTimeOutput,
    #speakingTimeOutput,
    #averageWordLengthOutput,
    #paragraphOutput,
    #lineOutput,
    #uniqueWordOutput,
    #wordsPerSentenceOutput,
    #uniqueCharacterOutput,
    #emojiOutput,
    #symbolOutput,
    #numberOutput,
    #twitterLimitOutput,
    #smsLimitOutput,
    #instagramLimitOutput,
    #linkedinLimitOutput
  ) {
    font-size: 2.7rem;
  }

  .parent :is(#characterOutput, #wordOutput) {
    font-size: 2.95rem;
  }

  .div1 { grid-area: 1 / 2 / 2 / 3; }
  .div2 { grid-area: 1 / 3 / 2 / 4; }
  .div3 { grid-area: 1 / 4 / 2 / 5; }
  .div4 { grid-area: 1 / 5 / 2 / 6; }

  #div5 { grid-area: 2 / 2 / 3 / 3; }
  #div6 { grid-area: 2 / 3 / 3 / 4; }
  #div7 { grid-area: 2 / 4 / 3 / 5; }
  #div8 { grid-area: 2 / 5 / 3 / 6; }

  .div9 { grid-area: 3 / 2 / 4 / 6; }

  .div11 { grid-area: 4 / 2 / 5 / 3; }
  .div24 { grid-area: 4 / 3 / 5 / 4; }
  .div12 { grid-area: 4 / 4 / 5 / 5; }
  .div42 { grid-area: 4 / 5 / 5 / 6; }

  #div15 { grid-area: 5 / 2 / 6 / 3; }
  #div28 { grid-area: 5 / 3 / 6 / 4; }
  #div16 { grid-area: 5 / 4 / 6 / 5; }
  #div46 { grid-area: 5 / 5 / 6 / 6; }

  .div51 { grid-area: 6 / 2 / 7 / 3; }
  .div52 { grid-area: 6 / 3 / 7 / 4; }
  .div53 { grid-area: 6 / 4 / 7 / 5; }
  .div54 { grid-area: 6 / 5 / 7 / 6; }

  #div55 { grid-area: 7 / 2 / 8 / 3; }
  #div56 { grid-area: 7 / 3 / 8 / 4; }
  #div57 { grid-area: 7 / 4 / 8 / 5; }
  #div58 { grid-area: 7 / 5 / 8 / 6; }

  .div14 { grid-area: 8 / 2 / 9 / 3; }
  .div33 { grid-area: 8 / 3 / 9 / 4; }
  .div13 { grid-area: 8 / 4 / 9 / 5; }
  .div35 { grid-area: 8 / 5 / 9 / 6; }

  #div18 { grid-area: 9 / 2 / 10 / 3; }
  #div37 { grid-area: 9 / 3 / 10 / 4; }
  #div17 { grid-area: 9 / 4 / 10 / 5; }
  #div39 { grid-area: 9 / 5 / 10 / 6; }

  .div25 { grid-area: 10 / 2 / 11 / 3; }
  .div26 { grid-area: 10 / 3 / 11 / 4; }
  .div27 { grid-area: 10 / 4 / 11 / 5; }
  .div34 { grid-area: 10 / 5 / 11 / 6; }

  #div29 { grid-area: 11 / 2 / 12 / 3; }
  #div30 { grid-area: 11 / 3 / 12 / 4; }
  #div31 { grid-area: 11 / 4 / 12 / 5; }
  #div38 { grid-area: 11 / 5 / 12 / 6; }

  .div36 { grid-area: 12 / 2 / 13 / 3; }
  .div43 { grid-area: 12 / 3 / 13 / 4; }
  .div44 { grid-area: 12 / 4 / 13 / 5; }
  .div45 { grid-area: 12 / 5 / 13 / 6; }

  #div40 { grid-area: 13 / 2 / 14 / 3; }
  #div47 { grid-area: 13 / 3 / 14 / 4; }
  #div48 { grid-area: 13 / 4 / 14 / 5; }
  #div49 { grid-area: 13 / 5 / 14 / 6; }

  .div20 { grid-area: 1 / 1 / 14 / 2; }
  .div21 { grid-area: 1 / 6 / 14 / 7; }

  .div19 {
    grid-area: 1 / 7 / 14 / 8;
    width: 305px;
    min-width: 300px;
    min-height: 600px;
    height: auto;
    align-self: stretch;
  }

  .div22 { grid-area: 1 / 2 / 3 / 6; }
  .div23 { grid-area: 4 / 2 / 6 / 6; }
  .div59 { grid-area: 6 / 2 / 8 / 6; }
  .div32 { grid-area: 8 / 2 / 10 / 6; }
  .div41 { grid-area: 10 / 2 / 12 / 6; }
  .div50 { grid-area: 12 / 2 / 14 / 6; }
}

/* ---------------------------------------------------------
   Mobile sizing polish
--------------------------------------------------------- */
@media (max-width: 767.98px) {
  .parent :is(.div1, .div3, .div4) {
    min-height: var(--top-title-h);
    padding: 2px 12px;
    font-size: 2.15rem;
    line-height: 1.12;
  }

  .parent :is(.div1, .div4) {
    font-size: 2.65rem;
  }

  .parent :is(.div2, .div11, .div12, .div24) {
    min-height: var(--bottom-title-h);
    padding: 2px 12px;
    font-size: 2rem;
    line-height: 1.12;
  }

  .parent .div24 {
    font-size: 1.8rem;
    line-height: 1.18;
    overflow: visible;
  }

  .parent :is(
    #characterOutput,
    #wordOutput,
    #spaceOutput,
    #letterOutput,
    #charactersWithoutSpacesOutput,
    #charactersRemaining
  ) {
    font-size: 2.6rem;
  }

  .parent #characterOutput {
    font-size: 3rem;
  }

  .metric-title-main {
    white-space: nowrap;
  }

  .metric-title-note {
    font-size: 1.38rem;
  }

  .metric-limit-input {
    max-width: 220px;
    height: 36px;
    font-size: 1.55rem;
  }

  .textarea-meta-row {
    align-items: center;
    gap: .65rem;
    margin-top: .35rem;
  }

  .textarea-checkbox-box {
    max-width: none;
    width: auto;
    flex: 0 1 auto;
    padding: .65rem 1rem;
  }

  .textarea-status-box {
    flex: 1 1 100%;
    justify-content: center;
    margin-left: 0;
    min-height: 24px;
    padding: .05rem 8px 0 0;
    text-align: center;
  }

  .textarea-character-status {
    width: 100%;
    text-align: center;
  }
}

/* ---------------------------------------------------------
   Section titles
--------------------------------------------------------- */
.section-title {
  position: relative;
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto 4rem;
  padding-bottom: .8rem;
  font-family: var(--font-family);
  font-size: 2.8rem;
  line-height: 1.25;
  color: var(--light-color);
  font-weight: 700;
  letter-spacing: 1px;
  text-align: center;
}

.section-title::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: var(--blue);
}

.section-title::after {
  display: none;
}

.counter-features,
.character-examples,
.common-limits {
  background: var(--white);
}

.related-tools,
.newsletter {
  background: var(--primary-background-color);
}

/* ---------------------------------------------------------
   Tables
--------------------------------------------------------- */
.common-limits-content,
.related-tools-content {
  max-width: 86rem;
  margin: 0 auto;
  text-align: center;
}

.common-limits-content > p,
.examples-content > p,
.related-tools-content p {
  max-width: 80rem;
  margin: 0 auto 2.5rem;
  font-size: 1.8rem;
  line-height: 1.65;
  font-weight: 300;
  text-align: center;
}

.common-limits-table-wrap,
.feature-table-wrap {
  margin: 0 auto;
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--card-radius);
  background: var(--white);
  box-shadow: var(--card-shadow);
}

.common-limits-table-wrap {
  max-width: 82rem;
}

.feature-table-wrap {
  max-width: 95rem;
}

.common-limits-table,
.feature-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1.6rem;
}

.common-limits-table th,
.common-limits-table td,
.feature-table th,
.feature-table td {
  border-bottom: 1px solid var(--soft-border-color);
  text-align: left;
  vertical-align: top;
}

.common-limits-table th,
.common-limits-table td {
  padding: 1.4rem 1.6rem;
  vertical-align: middle;
}

.feature-table th,
.feature-table td {
  padding: 1.5rem;
}

.common-limits-table th,
.feature-table th {
  background: #f7f7f7;
  color: var(--light-color);
  font-weight: 700;
}

.common-limits-table tr:last-child td,
.feature-table tr:last-child td {
  border-bottom: 0;
}

.common-limits-table td:first-child,
.feature-table td:first-child {
  color: var(--light-color);
  font-weight: 700;
}

.common-limits-table td:last-child {
  color: var(--blue-dark);
  font-weight: 700;
}

.feature-table td:first-child {
  white-space: nowrap;
}

@media (max-width: 520px) {
  .common-limits-table {
    font-size: 1.45rem;
  }

  .common-limits-table th,
  .common-limits-table td {
    padding: 1.15rem 1.2rem;
  }
}

/* ---------------------------------------------------------
   Examples
--------------------------------------------------------- */
.examples-content {
  max-width: 100rem;
  margin: 0 auto;
}

.examples-content a,
.related-tools-content a,
.about2 a,
.character-counter-guide .about2 a {
  color: var(--blue-dark);
  font-weight: 700;
}

.examples-content a:hover,
.related-tools-content a:hover,
.about2 a:hover,
.character-counter-guide .about2 a:hover {
  text-decoration: underline;
}

.examples-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.4rem;
  margin-bottom: 2.5rem;
}

.example-card {
  padding: 1.8rem;
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
}

.example-card h3 {
  margin-bottom: 1rem;
  color: var(--light-color);
  font-size: 1.9rem;
  line-height: 1.25;
}

.example-card code {
  display: block;
  margin-bottom: 1.2rem;
  padding: 1rem;
  color: #111;
  background: #f7f7f7;
  border: 1px solid var(--soft-border-color);
  border-radius: 8px;
  font-size: 1.55rem;
  white-space: pre-wrap;
}

.example-card p {
  margin-bottom: .7rem;
  font-size: 1.5rem;
  line-height: 1.5;
}

.example-card p:last-child {
  margin-bottom: 0;
}

@media (min-width: 700px) {
  .examples-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1100px) {
  .examples-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ---------------------------------------------------------
   Popular tools
--------------------------------------------------------- */
.popular-tags-container {
  gap: 1.2rem;
}

.popular-tags-container .article {
  min-height: var(--item-min-height-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  box-shadow: var(--card-shadow);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.popular-tags-container .article:hover {
  transform: translateY(-2px);
  border-color: var(--blue);
  box-shadow: 0 8px 18px rgba(0, 0, 0, .08);
}

.popular-tags-container .article-image {
  display: none;
}

.tag-name {
  width: 100%;
  min-height: var(--item-min-height-sm);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blue-dark);
  background: transparent;
  font-family: var(--font-family);
  font-size: 1.7rem;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
}

.popular-tags-container .article:hover .tag-name {
  color: var(--blue-dark);
}

@media (min-width: 700px) {
  .popular-tags-container,
  .footer-container {
    grid-template-columns: repeat(2, 1fr);
  }

  .tag-name {
    font-size: 1.75rem;
  }
}

@media (min-width: 1024px) {
  .popular-tags-container {
    grid-template-columns: repeat(3, 1fr);
  }

  .footer-container {
    grid-template-columns: repeat(5, 1fr);
  }

  .tag-name {
    font-size: 1.8rem;
  }
}

/* ---------------------------------------------------------
   Related tools
--------------------------------------------------------- */
.related-tools-content {
  max-width: 90rem;
}

.related-tools-list {
  max-width: 90rem;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.related-tools-list li a {
  display: block;
  padding: 1.2rem 1.5rem;
  color: var(--blue-dark);
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-weight: 600;
  text-align: center;
  transition: background .2s, box-shadow .2s;
}

.related-tools-list li a:hover {
  background: #f7f7f7;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .08);
}

@media (min-width: 520px) {
  .related-tools-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 900px) {
  .related-tools-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ---------------------------------------------------------
   About / guide
--------------------------------------------------------- */
.about-us {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
}

.about1,
.about3 {
  display: none;
}

.about2 {
  grid-area: 1 / 1 / 2 / 2;
  max-width: 80ch;
  margin: 0 auto;
  padding: 5px;
}

.about2 p {
  margin-bottom: 1.6rem;
  font-size: 1.8rem;
  line-height: 1.7;
  font-weight: 300;
}

.about2 a {
  font-weight: 600;
}

.character-counter-guide {
  background: linear-gradient(180deg, #ffffff 0%, #f7f9fc 100%);
}

.character-counter-guide .about-us {
  display: block;
}

.character-counter-guide .about1,
.character-counter-guide .about3 {
  display: none;
}

.character-counter-guide .about2 {
  max-width: 920px;
  margin: 0 auto;
  padding: 3rem;
  background: var(--white);
  border: 1px solid var(--soft-border-color);
  border-radius: 18px;
  box-shadow: var(--card-shadow);
}

.character-counter-guide .about2 h2 {
  position: relative;
  margin: 3.2rem 0 1.2rem;
  padding: 1.2rem 1.4rem;
  color: var(--light-color);
  background: #f8fbff;
  border-left: 5px solid var(--blue);
  border-radius: 10px;
  font-size: 2.6rem;
  line-height: 1.3;
}

.character-counter-guide .about2 h2:first-child {
  margin-top: 0;
}

.character-counter-guide .about2 h3 {
  margin: 2.4rem 0 1rem;
  padding-bottom: .6rem;
  color: var(--light-color);
  border-bottom: 1px solid var(--soft-border-color);
  font-size: 2.1rem;
  line-height: 1.35;
}

.character-counter-guide .about2 p {
  margin-bottom: 1.7rem;
  font-size: 1.85rem;
  line-height: 1.75;
  font-weight: 300;
}

.character-counter-guide .about2 h3 + p {
  padding: 1.4rem 1.5rem;
  background: #fafafa;
  border: 1px solid var(--soft-border-color);
  border-radius: 10px;
}

@media (min-width: 992px) {
  .about-us {
    grid-template-columns: 1fr 750px 1fr;
  }

  .about1 {
    grid-area: 1 / 1 / 2 / 2;
    display: block;
  }

  .about2 {
    grid-area: 1 / 2 / 2 / 3;
  }

  .about3 {
    grid-area: 1 / 3 / 2 / 4;
    display: block;
  }
}

@media (max-width: 768px) {
  .character-counter-guide .about2 {
    padding: 2rem 1.5rem;
    border-radius: 14px;
  }

  .character-counter-guide .about2 h2 {
    padding: 1rem 1.2rem;
    font-size: 2.3rem;
  }

  .character-counter-guide .about2 h3 {
    font-size: 2rem;
  }

  .character-counter-guide .about2 p {
    font-size: 1.7rem;
  }
}

/* ---------------------------------------------------------
   Newsletter
--------------------------------------------------------- */
.newsletter {
  padding-bottom: 6rem;
  background: #f8f9fb;
}

.newsletter .form-container-inner {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 3rem 2rem;
  gap: .7rem;
  background: var(--white);
  border: 1px solid var(--soft-border-color);
  border-radius: 18px;
  box-shadow: var(--card-shadow);
}

.newsletter-title {
  margin-bottom: .5rem;
  color: var(--light-color);
  font-size: 2.8rem;
  line-height: 1.25;
}

.newsletter-description {
  max-width: 48rem;
  margin: 0 auto 2.2rem;
  color: var(--light-color-alt);
  font-size: 1.65rem;
  line-height: 1.6;
  font-weight: 300;
}

.newsletter .form {
  width: 100%;
  max-width: 720px;
  margin-inline: auto;
}

.newsletter .form-input {
  flex: 1 1 auto;
  min-width: 0;
  background: var(--white);
}

.newsletter .form-btn {
  flex: 0 0 auto;
  width: 7rem;
  margin-left: -0.5rem;
}

.newsletter-status {
  margin-top: .4rem;
  min-height: 0;
  font-size: 1.4rem;
  line-height: 1.3;
}

.newsletter-status.success {
  color: var(--green);
}

.newsletter-status.error {
  color: var(--red);
}

.newsletter-privacy {
  margin-top: .3rem;
  font-size: 1.3rem;
  line-height: 1.3;
  opacity: .75;
}

@media (min-width: 900px) {
  .newsletter .form {
    max-width: 820px;
  }
}

/* ---------------------------------------------------------
   Footer
--------------------------------------------------------- */
.footer {
  background: var(--secondary-background-color);
}

.footer-container {
  gap: var(--gap);
}

.company-data {
  display: flex;
  flex-direction: column;
  order: 1;
}

.company-data .logo {
  font-size: 2.3rem;
}

.company-description {
  max-width: 75%;
  margin-block: var(--margin-sm);
  line-height: 1.6;
}

.copyright-notice {
  opacity: .8;
}

.footer-list {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .8rem;
}

.footer-title {
  margin-bottom: var(--margin-sm);
  color: var(--light-color);
  font-size: var(--font-size-sm);
  text-transform: uppercase;
}

@media (min-width: 1024px) {
  .company-data {
    grid-column: span 2;
    order: 0;
  }

  .company-description {
    max-width: 85%;
  }

  .copyright-notice {
    margin-top: auto;
  }
}

/* ---------------------------------------------------------
   Rendering performance
   Lets browser skip below-the-fold rendering until needed.
--------------------------------------------------------- */
.common-limits,
.character-counter-guide,
.character-examples,
.counter-features,
.popular-tags,
.related-tools,
.about,
.newsletter,
.footer {
  content-visibility: auto;
  contain-intrinsic-size: auto 900px;
}

/* ---------------------------------------------------------
   Final responsive polish
--------------------------------------------------------- */
@media (max-width: 768px) {
  .text-box {
    padding-bottom: 4rem;
  }

  .parent {
    margin-bottom: 3rem;
  }

  .textarea-actions {
    right: 37px;
    bottom: 14px;
    gap: 6px;
  }

  .textarea-action {
    padding: 5px 9px;
    font-size: 1.2rem;
  }

  textarea {
    padding: 10px;
  }

  .section {
    padding-block: 4rem;
  }

  .section-title {
    margin-bottom: 3.5rem;
    font-size: 2.4rem;
  }

  .company-description {
    max-width: 100%;
  }
}

@media (max-width: 600px) {
  .form {
    width: 100%;
  }

  .form-container-inner {
    width: calc(100% - 3rem);
  }

  .main-title {
    font-size: 3rem;
  }

  .feature-table {
    font-size: 1.5rem;
  }

  .feature-table th,
  .feature-table td {
    padding: 1.2rem;
  }
}

@media (max-width: 420px) {
  .container {
    padding: 0 1rem;
  }

  .logo-picture img {
    max-width: 150px;
  }

  .section-title {
    font-size: 2.2rem;
  }

  .newsletter .form {
    flex-direction: row;
  }

  .newsletter .form-container-inner {
    padding: 2.4rem 1.4rem;
  }

  .newsletter-title {
    font-size: 2.4rem;
  }

  .newsletter .form-btn {
    width: 5.6rem;
  }
}