:root {
  --tools-ink: #254e70;
  --tools-text: #496270;
  --tools-coral: #FF66B6;
  --tools-coral-dark: #e54da6;
  --tools-accent: #FF6B6B;
  --tools-accent-dark: #e15b5b;
  --tools-mint: #eaf6f2;
  --tools-sky: #E3F2FD;
  --tools-blush: #fff0f6;
  --tools-paper: #ffffff;
  --tools-border: #dce7eb;
  --tools-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
  --tools-shadow-lg: 0 12px 28px rgba(37, 78, 112, 0.09);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body.tools-page {
  margin: 0;
  padding: 0;
  background: var(--tools-sky);
  color: var(--tools-text);
  font-family: "DM Sans", Arial, sans-serif;
  line-height: 1.6;
}

body.tools-page--ja {
  font-family: "Noto Sans JP", "DM Sans", "Hiragino Sans", "Yu Gothic", Meiryo, sans-serif;
  line-height: 1.72;
}

body.tools-page--ko {
  font-family: "Noto Sans KR", "DM Sans", "Malgun Gothic", Arial, sans-serif;
  line-height: 1.68;
}

body.tools-page--tw {
  font-family: "Noto Sans TC", "DM Sans", "Microsoft JhengHei", Arial, sans-serif;
  line-height: 1.72;
}

body.tools-page--cn {
  font-family: "Noto Sans SC", "DM Sans", "Microsoft YaHei", Arial, sans-serif;
  line-height: 1.72;
}

.tools-page h1,
.tools-page h2,
.tools-page h3 {
  margin: 0;
  color: var(--tools-ink);
  font-family: "Nunito", Arial, sans-serif;
  line-height: 1.18;
}

.tools-page--ja h1,
.tools-page--ja h2,
.tools-page--ja h3 {
  font-family: "Noto Sans JP", "Nunito", "Hiragino Sans", "Yu Gothic", Meiryo, sans-serif;
  letter-spacing: 0;
}

.tools-page--ko h1,
.tools-page--ko h2,
.tools-page--ko h3 {
  font-family: "Noto Sans KR", "Nunito", "Malgun Gothic", Arial, sans-serif;
  letter-spacing: 0;
}

.tools-page--tw h1,
.tools-page--tw h2,
.tools-page--tw h3 {
  font-family: "Noto Sans TC", "Nunito", "Microsoft JhengHei", Arial, sans-serif;
  letter-spacing: 0;
}

.tools-page--cn h1,
.tools-page--cn h2,
.tools-page--cn h3 {
  font-family: "Noto Sans SC", "Nunito", "Microsoft YaHei", Arial, sans-serif;
  letter-spacing: 0;
}

.tools-page a {
  color: var(--tools-ink);
}

.tools-shell {
  width: min(1160px, calc(100% - 2rem));
  margin: 0 auto;
}

/* ===== HEADER SECTION ===== */
.tools-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--tools-border);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
}

.tools-header__inner {
  min-height: 68px;
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.tools-brand {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.55rem;
  color: var(--tools-ink);
  font-family: "Nunito", Arial, sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
  text-decoration: none;
}

.tools-brand img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
}

.tools-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  gap: 0.2rem;
}

.tools-nav a {
  padding: 0.56rem 0.76rem;
  border-radius: 8px;
  font-size: 0.94rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--tools-text);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.tools-nav a:hover,
.tools-nav a:focus-visible,
.tools-nav a[aria-current="page"] {
  background: var(--tools-blush);
  color: var(--tools-coral-dark);
}

.tools-home-link {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0.52rem 0.82rem;
  border: 1px solid var(--tools-border);
  border-radius: 8px;
  background: #fff;
  color: var(--tools-ink);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.tools-home-link:hover,
.tools-home-link:focus-visible {
  border-color: #bdd5dd;
  background: var(--tools-sky);
}

/* ===== MAIN CONTENT ===== */
.tools-main {
  padding: clamp(1.5rem, 4vw, 3rem) 0;
}

/* Quick Start Guide */
.tools-quick-start {
  max-width: 600px;
  margin: 0 auto 2rem;
  padding: clamp(1rem, 2.5vw, 1.5rem);
  background: rgba(255, 255, 255, 0.9);
  border-radius: 18px;
  box-shadow: var(--tools-shadow-lg);
  text-align: center;
}

.tools-quick-start h2,
.tools-quick-start p {
  margin: 0.2rem 0;
  color: var(--tools-text);
}

/* Moved from inline <style> in interactive-tools.html */
/* Scoped to pages using the tools stylesheet */
.tools-page #nowPlayingLabel {
  transition: opacity 0.3s ease-in-out;
  font-size: 1.1rem;
  margin-top: 0.5rem;
  color: #254E70;
  font-weight: 500;
  min-height: 1.4em;
}

.tools-page .sound-btn {
  background: var(--tools-coral);
  color: white;
  padding: 0.6rem 1.2rem;
  margin: 0.3rem;
  border: none;
  border-radius: 20px;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.2s;
}
.tools-page .sound-btn:hover { transform: scale(1.05); }

.tools-page {
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', sans-serif;
  background: var(--tools-sky);
  color: #254E70;
}
.tools-page h2, .tools-page h3 { text-align: center; color: #254E70; }

.tools-page section {
  padding: 3rem 1.5rem;
  max-width: 600px;
  margin: auto;
  background: var(--tools-paper);
  border-radius: 20px;
  box-shadow: var(--tools-shadow);
  margin-top: 2rem;
}

.tools-page .quick-start {
  max-width: 600px;
  margin: 5.5rem auto 0;
  padding: 1.2rem 1.2rem;
  background: rgba(255,255,255,0.9);
  border-radius: 18px;
  box-shadow: 0 8px 18px rgba(0,0,0,0.06);
  text-align: center;
}
.tools-page .quick-start p { margin: 0.2rem 0; color: #555; line-height: 1.45; }
.tools-page .quick-start .flow { margin-top: 0.6rem; font-size: 1.02rem; color: #254E70; font-weight: 600; }

.tools-page button {
  background-color: var(--tools-coral);
  color: white;
  border: none;
  padding: 0.7rem 1.4rem;
  border-radius: 25px;
  font-size: 1rem;
  cursor: pointer;
  margin: 0.5rem;
}

.tools-page #mood-story-builder button {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  border: none;
  border-radius: 8px;
  background: var(--tools-accent);
  color: white;
  cursor: pointer;
  transition: background 0.3s ease;
}
.tools-page #mood-story-builder button:hover { background: var(--tools-accent-dark); }

.tools-page .story-card:hover { transform: scale(1.02); transition: transform 0.3s ease; }

.tools-page .bubble-box {
  background: var(--tools-blush);
  border: 2px dashed var(--tools-accent);
  padding: 1rem;
  border-radius: 20px;
  margin-top: 1rem;
  transition: transform 0.3s ease;
  text-align: left;
}
.tools-page .bubble-box:hover { transform: scale(1.03); box-shadow: 0 4px 15px rgba(255, 107, 107, 0.15); }

.tools-page .tiny-note { font-size: 0.85rem; color: #888; text-align: center; margin-top: 1.2rem; }

@media (max-width: 600px) {
  .tools-page .sound-btn { font-size: 0.9rem; padding: 0.6rem 1rem; }
  .tools-page #nowPlayingLabel { font-size: 1rem; }
  .tools-page .quick-start { margin-top: 5.8rem; }
}

.tools-quick-start p {
  line-height: 1.45;
}

.tools-quick-start .flow {
  margin-top: 0.6rem;
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  color: var(--tools-ink);
  font-weight: 600;
}

.tools-quick-start .tiny-note {
  font-size: 0.85rem;
  color: #888;
  margin-top: 1.2rem;
}

/* Section Container */
.tools-section {
  padding: clamp(1.5rem, 3vw, 2.5rem);
  max-width: 600px;
  margin: 2rem auto;
  background: var(--tools-paper);
  border-radius: 20px;
  box-shadow: var(--tools-shadow-lg);
}

.tools-section h2 {
  text-align: center;
  margin-bottom: 1rem;
  font-size: clamp(1.4rem, 3vw, 1.8rem);
}

.tools-section h3 {
  text-align: center;
  margin-bottom: 0.75rem;
  font-size: clamp(1.2rem, 2.5vw, 1.5rem);
}

.tools-section > p {
  text-align: center;
  margin-bottom: 1.5rem;
  color: var(--tools-text);
}

/* ===== BUTTON STYLES ===== */
button,
.tools-btn {
  background-color: var(--tools-coral);
  color: white;
  border: none;
  padding: 0.7rem 1.4rem;
  border-radius: 25px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  margin: 0.5rem;
  transition: background-color 0.3s ease, transform 0.2s ease;
  text-decoration: none;
  display: inline-block;
}

button:hover,
.tools-btn:hover {
  background-color: var(--tools-coral-dark);
  transform: translateY(-2px);
}

button:active,
.tools-btn:active {
  transform: translateY(0);
}

.sound-btn {
  background: var(--tools-coral);
  color: white;
  padding: 0.6rem 1.2rem;
  margin: 0.3rem;
  border: none;
  border-radius: 20px;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.3s ease;
}

.sound-btn:hover {
  transform: scale(1.05);
  background-color: var(--tools-coral-dark);
}

/* Mood Story Builder Buttons */
#mood-story-builder button {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  border: none;
  border-radius: 8px;
  background: var(--tools-accent);
  color: white;
  cursor: pointer;
  transition: background 0.3s ease;
}

#mood-story-builder button:hover {
  background: var(--tools-accent-dark);
}

/* ===== INTERACTIVE COMPONENTS ===== */

/* Parent Tip Bubble */
.bubble-box {
  background: var(--tools-blush);
  border: 2px dashed var(--tools-accent);
  padding: 1rem;
  border-radius: 20px;
  margin-top: 1.5rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-align: left;
}

.bubble-box:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 15px rgba(255, 107, 107, 0.15);
}

.bubble-box strong {
  color: var(--tools-ink);
  display: block;
  margin-bottom: 0.5rem;
}

.bubble-box p {
  margin: 0.5rem 0 0;
  color: var(--tools-text);
  font-size: 0.95rem;
}

/* Now Playing Label */
#nowPlayingLabel {
  transition: opacity 0.3s ease-in-out;
  font-size: 1.1rem;
  margin-top: 0.5rem;
  color: var(--tools-ink);
  font-weight: 500;
  min-height: 1.4em;
}

/* Breathing Circle */
#breathing-circle {
  width: 150px;
  height: 150px;
  margin: 2rem auto;
  border-radius: 50%;
  background: #A7E5F3;
  transition: all 4s ease-in-out;
}

#breathing-text {
  text-align: center;
  font-size: 1.4rem;
  color: var(--tools-ink);
  margin: 1rem 0;
}

/* Drawing Canvas Section */
.tools-canvas-controls {
  text-align: center;
  margin: 1.5rem 0;
}

.tools-canvas-controls > div {
  margin: 1rem 0;
}

#drawingCanvas {
  display: block;
  margin: 1.5rem auto;
  border: 1px solid var(--tools-border);
  border-radius: 12px;
  background: #fffbea;
  max-width: 100%;
  height: auto;
}

.tools-color-picker {
  text-align: center;
  margin: 1rem 0;
}

.tools-color-picker input[type="color"] {
  margin: 0 0.5rem;
  cursor: pointer;
  width: 50px;
  height: 40px;
  border: 1px solid var(--tools-border);
  border-radius: 8px;
}

.tools-eraser-controls {
  text-align: center;
  margin-top: 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.tools-eraser-controls label {
  color: var(--tools-ink);
  font-weight: 600;
}

.tools-eraser-controls input[type="range"] {
  cursor: pointer;
  min-width: 150px;
}

/* Email Section */
.tools-email-section {
  text-align: center;
  margin-top: 1.5rem;
  padding: 1rem;
  background: var(--tools-blush);
  border-radius: 12px;
}

.tools-email-section p {
  font-size: 0.9rem;
  color: var(--tools-text);
  max-width: 320px;
  margin: 0 auto 1rem;
}

#send-email {
  background: #FF6086;
  padding: 0.6rem 1.2rem;
  font-weight: bold;
}

#send-email:hover {
  background: #e54da6;
}

.tools-email-section .tiny-note {
  font-size: 0.8rem;
  color: #999;
  margin-top: 0.5rem;
}

/* Story Output */
#storyOutput {
  max-width: 600px;
  margin: 1.5rem auto;
  background: var(--tools-paper);
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

#storyOutput h3 {
  color: var(--tools-ink);
  margin-bottom: 1rem;
}

#storyOutput p {
  color: var(--tools-text);
  margin-bottom: 1.5rem;
}

/* ===== STORY CARDS ===== */
.story-card {
  max-width: 320px;
  margin: 2rem auto;
  padding: 1rem;
  background: #e0f7ff;
  border-radius: 16px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  text-align: center;
  transition: transform 0.3s ease;
}

.story-card:hover {
  transform: scale(1.02);
}

.story-card img {
  width: 100%;
  max-width: 180px;
  border-radius: 12px;
  margin: 0 auto;
}

.story-card h4 {
  margin: 1rem 0 0.5rem;
  color: var(--tools-ink);
  font-size: clamp(1.1rem, 2vw, 1.3rem);
}

.story-card p {
  font-size: 0.95rem;
  color: var(--tools-text);
  margin-bottom: 1rem;
}

.story-card a {
  display: inline-block;
  margin-top: 0.8rem;
  background: var(--tools-accent);
  color: white;
  padding: 0.6rem 1.2rem;
  border-radius: 20px;
  font-weight: bold;
  text-decoration: none;
  transition: background-color 0.3s ease;
}

.story-card a:hover {
  background: var(--tools-accent-dark);
}

.story-card:nth-child(2) {
  background: #ffe4f0;
}

/* ===== FOOTER ===== */
.tools-footer {
  padding: 1.35rem 1rem 2.2rem;
  border-top: 1px solid var(--tools-border);
  color: #6c8491;
  text-align: center;
  font-size: 0.9rem;
}

/* ===== RESPONSIVE DESIGN ===== */

@media (max-width: 920px) {
  .tools-header__inner {
    flex-wrap: wrap;
    padding: 0.55rem 0;
  }

  .tools-nav {
    order: 3;
    flex: 1 0 100%;
    justify-content: flex-start;
    gap: 0.1rem;
    overflow-x: auto;
  }

  .tools-home-link {
    margin-left: auto;
  }

  .tools-shell {
    width: min(100% - 1.5rem, 600px);
  }

  .tools-section {
    margin: 1.5rem auto;
  }

  #drawingCanvas {
    width: 100%;
    max-width: 400px;
  }
}

@media (max-width: 600px) {
  .tools-shell {
    width: min(100% - 1.25rem, 460px);
  }

  .tools-header__inner {
    gap: 0.55rem;
  }

  .tools-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.1rem;
  }

  .tools-nav a {
    display: grid;
    place-items: center;
    min-height: 48px;
    padding: 0.4rem 0.18rem;
    font-size: 0.84rem;
    line-height: 1.25;
    text-align: center;
  }

  .tools-brand span {
    display: none;
  }

  .tools-home-link {
    padding: 0.48rem 0.62rem;
  }

  .tools-main {
    padding: 1rem 0;
  }

  .tools-section {
    padding: 1.25rem 1rem;
    margin: 1rem auto;
  }

  .tools-section h2 {
    font-size: 1.3rem;
    margin-bottom: 0.75rem;
  }

  .tools-section h3 {
    font-size: 1.1rem;
  }

  button,
  .tools-btn {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    margin: 0.35rem;
  }

  .sound-btn {
    font-size: 0.9rem;
    padding: 0.6rem 1rem;
  }

  #nowPlayingLabel {
    font-size: 1rem;
  }

  #breathing-circle {
    width: 120px;
    height: 120px;
  }

  #breathing-text {
    font-size: 1.2rem;
  }

  #drawingCanvas {
    width: 100%;
    max-width: 100%;
    height: auto;
  }

  .tools-canvas-controls {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  .tools-eraser-controls {
    flex-direction: column;
    gap: 0.5rem;
  }

  .tools-eraser-controls input[type="range"] {
    width: 100%;
    max-width: 200px;
  }

  .tools-email-section {
    padding: 0.75rem;
  }

  .tools-email-section p {
    font-size: 0.85rem;
  }

  #storyOutput {
    padding: 1rem;
  }

  .story-card {
    max-width: 100%;
    margin: 1rem auto;
  }

  .tools-quick-start {
    margin: 0 auto 1.5rem;
    padding: 1rem;
  }
}

@media (max-width: 380px) {
  .tools-shell {
    width: calc(100% - 0.5rem);
  }

  button,
  .tools-btn {
    padding: 0.5rem 0.8rem;
    font-size: 0.85rem;
  }


/* Utilities added for interactive-tools.html adjustments */
.tools-top-link {
  position: fixed;
  top: 15px;
  right: 15px;
  z-index: 1000;
  background: #E6E6FA;
  border: 2px solid #D8BFD8;
  border-radius: 30px;
  padding: 0.5rem 1rem;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.tools-top-link__home {
  text-decoration: none;
  color: #5A3E8A;
  font-weight: bold;
  font-size: 0.95rem;
}
.text-center { text-align: center; }
.center-gap { margin: 1rem 0; }
.muted { color: #999; font-size: 0.9rem; }
.help-text { font-size: 0.9rem; color: #555; margin-top: 0.5rem; }
.send-email-btn { background: #FF6086; color: white; padding: 0.6rem 1.2rem; border-radius:20px; font-weight:bold; border:none; cursor:pointer; }

.mood-options { display:flex; flex-wrap:wrap; justify-content:center; gap:1rem; margin: 1.5rem 0; }
.story-output { max-width: 600px; margin: auto; background: white; padding: 1.5rem; border-radius: 12px; box-shadow: 0 4px 12px rgba(0,0,0,0.08); display:none; }
  .tools-section {
    padding: 1rem;
    margin: 0.75rem auto;
  }
}

/* ===== Interactive tools redesign ===== */
body.tools-page {
  min-height: 100vh;
  background:
    radial-gradient(ellipse 80% 60% at 8% 16%, rgba(175, 109, 255, 0.34), transparent 67%),
    radial-gradient(ellipse 74% 58% at 88% 10%, rgba(20, 184, 166, 0.24), transparent 62%),
    radial-gradient(ellipse 70% 62% at 42% 90%, rgba(255, 100, 180, 0.24), transparent 66%),
    linear-gradient(180deg, #f7eaff 0%, #f7fbff 52%, #ffffff 100%);
  color: var(--tools-text);
  font-family: "DM Sans", Arial, sans-serif;
}

.tools-page button,
.tools-page .tools-btn {
  margin: 0;
}

.tools-header {
  border-bottom: 1px solid rgba(220, 231, 235, 0.9);
  box-shadow: 0 8px 24px rgba(37, 78, 112, 0.08);
}

.tools-nav {
  justify-content: flex-end;
}

.tools-main {
  padding: clamp(1.2rem, 3vw, 2.2rem) 0 clamp(2.8rem, 6vw, 4.5rem);
}

.tools-page .tools-hero,
.tools-page .tools-workspace,
.tools-page .story-library {
  max-width: none;
  margin-inline: auto;
  padding: clamp(1rem, 3vw, 1.4rem);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.tools-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.58fr);
  gap: clamp(1rem, 3vw, 2rem);
  align-items: stretch;
  padding: clamp(1rem, 3vw, 1.4rem);
}

.tools-hero__copy,
.tools-hero__panel,
.tool-card,
.story-card {
  border: 1px solid rgba(220, 231, 235, 0.82);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 20px 48px rgba(37, 78, 112, 0.12);
  backdrop-filter: blur(12px);
}

.tools-hero__copy {
  padding: clamp(1.5rem, 4vw, 3rem);
  border-radius: 26px;
}

.tools-kicker {
  margin: 0 0 0.45rem;
  color: #d84c85;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tools-hero h1 {
  max-width: 780px;
  font-size: clamp(2.2rem, 5vw, 4.4rem);
  line-height: 1.02;
}

.tools-hero__copy > p:not(.tools-kicker) {
  max-width: 690px;
  margin: 1rem 0 0;
  color: #3f5f71;
  font-size: clamp(1rem, 1.5vw, 1.18rem);
}

.tools-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.4rem;
}

.tools-hero__actions a,
.tools-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.68rem 1rem;
  border: 0;
  border-radius: 10px;
  background: #254e70;
  color: #fff !important;
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none;
  transition: background-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.tools-hero__actions a:hover,
.tools-hero__actions a:focus-visible,
.tools-btn:hover,
.tools-btn:focus-visible {
  background: #173e5c;
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(37, 78, 112, 0.18);
}

.tools-btn--secondary {
  background: #eef7fa;
  color: #254e70 !important;
}

.tools-btn--secondary:hover,
.tools-btn--secondary:focus-visible {
  background: #dff0f6;
}

.tools-btn--mail {
  background: #cf596a;
}

.tools-btn--mail:hover,
.tools-btn--mail:focus-visible {
  background: #9d3547;
}

.tools-hero__panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(1.2rem, 3vw, 2rem);
  border-radius: 24px;
  background:
    radial-gradient(ellipse 80% 60% at 5% 40%, rgba(175, 109, 255, 0.46), transparent 67%),
    radial-gradient(ellipse 70% 60% at 45% 45%, rgba(255, 100, 180, 0.34), transparent 67%),
    linear-gradient(45deg, #254e70 0%, #4f7d96 100%);
  color: #fff;
}

.tools-hero__panel span {
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tools-hero__panel ol {
  display: grid;
  gap: 0.8rem;
  margin: 1.1rem 0 0;
  padding-left: 1.2rem;
  font-size: clamp(1rem, 1.5vw, 1.1rem);
  font-weight: 800;
}

.tools-workspace {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1rem, 2.5vw, 1.4rem);
  margin-top: 0.8rem;
}

.tool-card {
  position: relative;
  overflow: hidden;
  padding: clamp(1.2rem, 3vw, 1.6rem);
  border-radius: 22px;
}

.tool-card::before {
  position: absolute;
  inset: 0 0 auto;
  height: 7px;
  background: var(--card-accent, #14b8a6);
  content: "";
}

.tool-card--calm {
  --card-accent: #14b8a6;
}

.tool-card--draw {
  --card-accent: #ec4899;
  grid-row: span 2;
}

.tool-card--story {
  --card-accent: #10b981;
}

.tool-card__header {
  margin-bottom: 1rem;
}

.tool-card__header h2,
.story-library h2 {
  text-align: left;
  font-size: clamp(1.45rem, 2vw, 2rem);
}

.tool-card__header p:not(.tools-kicker) {
  margin: 0.45rem 0 0;
  color: var(--tools-text);
}

.sound-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.tools-page .sound-btn,
.tools-page #mood-story-builder button {
  min-height: 46px;
  margin: 0;
  border-radius: 10px;
  background: #eef7fa;
  color: #254e70;
  font-weight: 800;
  box-shadow: none;
}

.tools-page .sound-btn:hover,
.tools-page .sound-btn:focus-visible,
.tools-page #mood-story-builder button:hover,
.tools-page #mood-story-builder button:focus-visible {
  background: #dff2f7;
  transform: translateY(-1px);
}

.tools-page .sound-btn--quiet {
  background: #fff2f4;
  color: #9d3547;
}

#nowPlayingLabel {
  margin: 0.8rem 0 0;
  color: #254e70;
  font-weight: 800;
  text-align: center;
}

.breathing-stage {
  display: grid;
  justify-items: center;
  margin-top: 1.2rem;
  padding: 1rem;
  border-radius: 18px;
  background:
    radial-gradient(125% 125% at 50% 10%, #ffffff 40%, rgba(20, 184, 166, 0.26) 100%);
}

#breathing-circle {
  width: clamp(126px, 14vw, 164px);
  height: clamp(126px, 14vw, 164px);
  margin: 0.7rem auto 1rem;
  border: 10px solid rgba(255, 255, 255, 0.86);
  background:
    radial-gradient(circle at 35% 30%, #ffffff 0%, #baf7ef 35%, #14b8a6 100%);
  box-shadow: 0 16px 36px rgba(20, 184, 166, 0.26);
}

#breathing-text {
  margin: 0 0 0.9rem;
  font-weight: 900;
}

.drawing-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 0.44fr);
  gap: 1rem;
  align-items: start;
}

.drawing-panel {
  padding: 0.7rem;
  border: 1px solid #dbe7ec;
  border-radius: 18px;
  background: #fffaf1;
}

#drawingCanvas {
  display: block;
  width: 100%;
  max-width: none;
  aspect-ratio: 1 / 0.72;
  height: auto;
  margin: 0;
  border: 0;
  border-radius: 12px;
  background: #fffbea;
  touch-action: none;
}

.drawing-controls {
  display: grid;
  gap: 0.65rem;
}

.color-control,
.range-control {
  display: grid;
  gap: 0.35rem;
  color: var(--tools-ink);
  font-weight: 800;
}

.color-control input[type="color"] {
  width: 100%;
  height: 44px;
  padding: 0.18rem;
  border: 1px solid var(--tools-border);
  border-radius: 10px;
  background: #fff;
}

.range-control input[type="range"] {
  width: 100%;
}

.tools-note {
  margin: 0.1rem 0 0;
  color: #607786;
  font-size: 0.9rem;
}

.bubble-box {
  margin-top: 1rem;
  border: 1px solid rgba(236, 72, 153, 0.22);
  border-left: 5px solid var(--card-accent, #ec4899);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: none;
}

.bubble-box:hover {
  transform: none;
}

.mood-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  margin: 1rem 0;
}

.mood-options button {
  display: grid;
  gap: 0.25rem;
  place-items: center;
  min-height: 86px !important;
  padding: 0.75rem 0.4rem !important;
  font-size: 1.55rem !important;
}

.mood-options button span {
  font-size: 0.88rem;
}

.mood-options button.is-selected {
  background:
    radial-gradient(125% 125% at 50% 90%, #ffffff 40%, rgba(236, 72, 153, 0.28) 100%) !important;
  outline: 3px solid rgba(236, 72, 153, 0.22);
}

.story-output {
  display: none;
  max-width: none;
  margin: 1rem 0 0;
  padding: 1rem;
  border: 1px solid #e3eef4;
  border-radius: 14px;
  background: #fff;
  box-shadow: none;
}

.story-output h3 {
  text-align: left;
}

.story-output__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.story-library {
  padding: clamp(1.2rem, 3vw, 1.4rem);
  margin-top: 0.8rem;
}

.story-library__head {
  margin-bottom: 1rem;
}

.story-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.story-card {
  display: grid;
  grid-template-columns: 142px minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
  max-width: none;
  margin: 0;
  padding: 1rem;
  border-radius: 20px;
  text-align: left;
}

.story-card--sky {
  background:
    radial-gradient(125% 125% at 50% 10%, #ffffff 40%, rgba(20, 184, 166, 0.2) 100%);
}

.story-card--blush {
  background:
    radial-gradient(125% 125% at 50% 90%, #ffffff 40%, rgba(236, 72, 153, 0.18) 100%);
}

.story-card:hover {
  transform: translateY(-2px);
}

.story-card img {
  width: 100%;
  max-width: 142px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 16px;
  background: #fff;
}

.story-card h3 {
  margin: 0 0 0.45rem;
  text-align: left;
}

.story-card p {
  margin: 0 0 0.8rem;
}

.story-card .tools-btn {
  display: inline-flex;
  width: max-content;
  margin: 0;
  background: #254e70;
  color: #fff !important;
  border-radius: 10px;
}

@media (max-width: 920px) {
  .tools-hero,
  .tools-workspace,
  .story-grid {
    grid-template-columns: 1fr;
  }

  .tool-card--draw {
    grid-row: auto;
  }
}

@media (max-width: 720px) {
  .drawing-layout,
  .story-card {
    grid-template-columns: 1fr;
  }

  .sound-grid,
  .mood-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .story-card img {
    max-width: 190px;
  }
}

@media (max-width: 460px) {
  .tools-hero {
    padding-inline: 0.6rem;
  }

  .tools-hero__actions,
  .story-output__actions {
    display: grid;
  }

  .tools-hero__actions a,
  .tools-btn {
    width: 100%;
  }

  .sound-grid,
  .mood-options {
    grid-template-columns: 1fr;
  }
}

/* Localized interactive pages still use older markup; this layer gives them the same redesigned feel. */
body.tools-page--localized {
  min-height: 100vh !important;
  background:
    radial-gradient(ellipse 80% 60% at 8% 16%, rgba(175, 109, 255, 0.34), transparent 67%),
    radial-gradient(ellipse 74% 58% at 88% 10%, rgba(20, 184, 166, 0.24), transparent 62%),
    radial-gradient(ellipse 70% 62% at 42% 90%, rgba(255, 100, 180, 0.24), transparent 66%),
    linear-gradient(180deg, #f7eaff 0%, #f7fbff 52%, #ffffff 100%) !important;
  color: var(--tools-text) !important;
  font-family: "DM Sans", Arial, sans-serif !important;
}

body.tools-page--localized .site-header {
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: none !important;
  min-height: 68px !important;
  margin: 0 !important;
  padding: 0.7rem max(1rem, calc((100vw - 1160px) / 2)) !important;
  border-bottom: 1px solid rgba(220, 231, 235, 0.9) !important;
  background: rgba(255, 255, 255, 0.96) !important;
  box-shadow: 0 8px 24px rgba(37, 78, 112, 0.08) !important;
}

body.tools-page--localized .site-branding {
  gap: 0.55rem !important;
  color: var(--tools-ink) !important;
  font-family: "Nunito", Arial, sans-serif !important;
  font-weight: 900 !important;
}

body.tools-page--localized .site-branding img {
  width: 40px !important;
  height: 40px !important;
  border-radius: 8px !important;
}

body.tools-page--localized .site-title {
  font-size: clamp(1rem, 2vw, 1.16rem) !important;
  font-weight: 900 !important;
}

body.tools-page--localized .nav-links {
  justify-content: flex-end !important;
  gap: 0.2rem !important;
  flex-wrap: wrap !important;
}

body.tools-page--localized .nav-links a {
  min-height: 40px !important;
  padding: 0.52rem 0.72rem !important;
  border-radius: 8px !important;
  color: var(--tools-text) !important;
  font-size: 0.94rem !important;
  font-weight: 800 !important;
  text-decoration: none !important;
}

body.tools-page--localized .nav-links a:hover,
body.tools-page--localized .nav-links a:focus-visible {
  background: var(--tools-blush) !important;
  color: var(--tools-coral-dark) !important;
}

.localized-tools-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(240px, 0.52fr);
  gap: clamp(1rem, 3vw, 2rem);
  width: min(1160px, calc(100% - 2rem));
  margin: clamp(1.1rem, 3vw, 2rem) auto 0;
}

.localized-tools-hero__copy,
.localized-tools-hero__panel {
  border: 1px solid rgba(220, 231, 235, 0.82);
  border-radius: 26px;
  box-shadow: 0 20px 48px rgba(37, 78, 112, 0.12);
  backdrop-filter: blur(12px);
}

.localized-tools-hero__copy {
  padding: clamp(1.5rem, 4vw, 3rem);
  background: rgba(255, 255, 255, 0.9);
}

.localized-tools-hero__copy h1 {
  margin: 0;
  color: var(--tools-ink);
  font-family: "Nunito", Arial, sans-serif;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1.04;
}

.localized-tools-hero__copy p {
  max-width: 680px;
  margin: 1rem 0 0;
  color: #3f5f71;
  font-size: clamp(1rem, 1.5vw, 1.16rem);
}

.localized-tools-hero__panel {
  display: grid;
  align-content: center;
  gap: 0.6rem;
  padding: clamp(1.2rem, 3vw, 2rem);
  background:
    radial-gradient(ellipse 80% 60% at 5% 40%, rgba(175, 109, 255, 0.46), transparent 67%),
    radial-gradient(ellipse 70% 60% at 45% 45%, rgba(255, 100, 180, 0.34), transparent 67%),
    linear-gradient(45deg, #254e70 0%, #4f7d96 100%);
  color: #fff;
  font-weight: 800;
}

.localized-tools-hero__panel span {
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

body.tools-page--localized > section:not(.localized-tools-hero) {
  position: relative !important;
  width: min(1160px, calc(100% - 2rem)) !important;
  max-width: none !important;
  margin: 1rem auto 0 !important;
  padding: clamp(1.2rem, 3vw, 1.65rem) !important;
  overflow: hidden !important;
  border: 1px solid rgba(220, 231, 235, 0.82) !important;
  border-radius: 22px !important;
  background: rgba(255, 255, 255, 0.9) !important;
  box-shadow: 0 20px 48px rgba(37, 78, 112, 0.12) !important;
  backdrop-filter: blur(12px);
}

body.tools-page--localized > section:not(.localized-tools-hero)::before {
  position: absolute;
  inset: 0 0 auto;
  height: 7px;
  background: var(--localized-card-accent, #14b8a6);
  content: "";
}

body.tools-page--localized #calm-corner {
  --localized-card-accent: #14b8a6;
}

body.tools-page--localized #mood-story-builder {
  --localized-card-accent: #10b981;
}

body.tools-page--localized > section:nth-of-type(3) {
  --localized-card-accent: #ec4899;
}

body.tools-page--localized > section:not(.localized-tools-hero) h2 {
  margin: 0 0 0.7rem !important;
  color: var(--tools-ink) !important;
  font-family: "Nunito", Arial, sans-serif !important;
  font-size: clamp(1.45rem, 2vw, 2rem) !important;
  text-align: left !important;
}

body.tools-page--localized > section:not(.localized-tools-hero) > p {
  margin: 0 0 1rem !important;
  color: var(--tools-text) !important;
  text-align: left !important;
}

body.tools-page--localized .sound-btn,
body.tools-page--localized .stop-btn,
body.tools-page--localized #mood-story-builder button,
body.tools-page--localized button {
  min-height: 44px !important;
  margin: 0.25rem !important;
  padding: 0.68rem 1rem !important;
  border: 0 !important;
  border-radius: 10px !important;
  background: #eef7fa !important;
  color: #254e70 !important;
  font-weight: 900 !important;
  line-height: 1.2 !important;
  box-shadow: none !important;
}

body.tools-page--localized button:hover,
body.tools-page--localized button:focus-visible {
  background: #dff2f7 !important;
  transform: translateY(-1px) !important;
}

body.tools-page--localized #mood-story-builder button.is-selected {
  background: linear-gradient(135deg, #fff0f6, #e9fbff) !important;
  border-color: rgba(255, 107, 135, 0.45) !important;
  box-shadow: 0 18px 38px rgba(255, 107, 135, 0.22) !important;
}

body.tools-page--localized #send-email {
  background: #cf596a !important;
  color: #fff !important;
}

body.tools-page--localized #breathing-circle {
  width: clamp(126px, 14vw, 164px) !important;
  height: clamp(126px, 14vw, 164px) !important;
  border: 10px solid rgba(255, 255, 255, 0.86) !important;
  background:
    radial-gradient(circle at 35% 30%, #ffffff 0%, #baf7ef 35%, #14b8a6 100%) !important;
  box-shadow: 0 16px 36px rgba(20, 184, 166, 0.26) !important;
}

body.tools-page--localized #breathing-text,
body.tools-page--localized #nowPlayingLabel {
  color: var(--tools-ink) !important;
  font-weight: 900 !important;
}

body.tools-page--localized #drawingCanvas {
  display: block !important;
  width: min(100%, 720px) !important;
  height: auto !important;
  aspect-ratio: 1 / 0.72 !important;
  margin: 1rem auto !important;
  border: 0 !important;
  border-radius: 16px !important;
  background: #fffbea !important;
  box-shadow: inset 0 0 0 1px #dbe7ec, 0 10px 24px rgba(37, 78, 112, 0.08) !important;
  touch-action: none;
}

body.tools-page--localized #storyOutput {
  max-width: none !important;
  margin: 1rem 0 0 !important;
  border: 1px solid #e3eef4 !important;
  border-radius: 14px !important;
  background: #fff !important;
  box-shadow: none !important;
  text-align: left !important;
}

body.tools-page--localized .story-card {
  display: grid !important;
  grid-template-columns: 142px minmax(0, 1fr) !important;
  gap: 1rem !important;
  align-items: center !important;
  width: min(1160px, calc(100% - 2rem)) !important;
  max-width: none !important;
  margin: 1rem auto 0 !important;
  padding: 1rem !important;
  border: 1px solid rgba(220, 231, 235, 0.82) !important;
  border-radius: 20px !important;
  background:
    radial-gradient(125% 125% at 50% 10%, #ffffff 40%, rgba(20, 184, 166, 0.2) 100%) !important;
  box-shadow: 0 20px 48px rgba(37, 78, 112, 0.12) !important;
  text-align: left !important;
}

body.tools-page--localized .story-card:nth-of-type(even) {
  background:
    radial-gradient(125% 125% at 50% 90%, #ffffff 40%, rgba(236, 72, 153, 0.18) 100%) !important;
}

body.tools-page--localized .story-card img {
  width: 100% !important;
  max-width: 142px !important;
  aspect-ratio: 1 !important;
  object-fit: cover !important;
  border-radius: 16px !important;
  background: #fff !important;
}

body.tools-page--localized .story-card h4 {
  margin: 0 0 0.45rem !important;
  color: var(--tools-ink) !important;
  font-family: "Nunito", Arial, sans-serif !important;
  font-size: 1.22rem !important;
}

body.tools-page--localized .story-card .btn,
body.tools-page--localized .story-card .choice-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 44px !important;
  margin-top: 0.3rem !important;
  padding: 0.68rem 1rem !important;
  border-radius: 10px !important;
  background: #254e70 !important;
  color: #fff !important;
  font-weight: 900 !important;
  text-decoration: none !important;
}

@media (max-width: 820px) {
  .localized-tools-hero,
  body.tools-page--localized .story-card {
    grid-template-columns: 1fr !important;
  }

  body.tools-page--localized .site-header {
    align-items: flex-start !important;
    flex-direction: column !important;
  }
}

@media (max-width: 520px) {
  .localized-tools-hero,
  body.tools-page--localized > section:not(.localized-tools-hero),
  body.tools-page--localized .story-card {
    width: min(100% - 1rem, 460px) !important;
  }
}
