/* Meadow Minds: shared look (same as the Styles file in the Meadow Minds script). */
  :root {
    --bg: #FBF7EE;          /* soft cream – easier on the eyes than white */
    --card: #FFFFFF;
    --ink: #1F2A30;         /* dark slate instead of pure black */
    --muted: #5E6B70;
    --line: #DCE8E5;
    --accent: #0F766E;      /* deep teal */
    --accent-soft: #E0F2EF;
    --accent-ink: #FFFFFF;
    --good: #3B8F2F;
    --good-soft: #E6F4E0;
    --bad: #C2410C;
    --bad-soft: #FDECE3;
    --warn: #B7791F;
    --warn-soft: #FFF4DB;
    --term: #FFF1A8;        /* highlighter yellow for key words */
    --term-ink: #4A3B00;
    --shadow: 0 2px 10px rgba(31, 42, 48, .08);
    --radius: 18px;
  }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      --bg: #141B1D; --card: #1E2829; --ink: #E8F1F0; --muted: #A3B5B4; --line: #2E3D3E;
      --accent: #4FD1C5; --accent-soft: #1D3B3A; --accent-ink: #0E1A1B;
      --good: #8BD66F; --good-soft: #243A1F; --bad: #FF9A6B; --bad-soft: #43271C;
      --warn: #F2C14E; --warn-soft: #3D3218; --term: #5A4D12; --term-ink: #FFF3B0;
      --shadow: 0 2px 10px rgba(0, 0, 0, .35);
    }
  }
  :root[data-theme="dark"] {
    --bg: #141B1D; --card: #1E2829; --ink: #E8F1F0; --muted: #A3B5B4; --line: #2E3D3E;
    --accent: #4FD1C5; --accent-soft: #1D3B3A; --accent-ink: #0E1A1B;
    --good: #8BD66F; --good-soft: #243A1F; --bad: #FF9A6B; --bad-soft: #43271C;
    --warn: #F2C14E; --warn-soft: #3D3218; --term: #5A4D12; --term-ink: #FFF3B0;
    --shadow: 0 2px 10px rgba(0, 0, 0, .35);
  }

  * { box-sizing: border-box; }
  html, body { margin: 0; padding: 0; }
  body {
    background: var(--bg);
    color: var(--ink);
    font-family: 'Lexend', 'Verdana', sans-serif;
    font-size: 19px;
    line-height: 1.6;
    letter-spacing: .02em;
    word-spacing: .08em;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
  }
  .wrap { max-width: 640px; margin: 0 auto; padding: 16px 16px 120px; }
  h1, h2, h3 { line-height: 1.25; margin: 0 0 8px; letter-spacing: 0; }
  h1 { font-size: 26px; font-weight: 700; }
  h2 { font-size: 22px; font-weight: 700; }
  h3 { font-size: 19px; font-weight: 600; }
  p { margin: 0 0 10px; }
  .muted { color: var(--muted); }
  .small { font-size: 15px; }
  .hidden { display: none !important; }

  /* Buttons */
  button { font: inherit; color: inherit; }
  .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 54px; padding: 12px 20px; border-radius: 14px; border: 2px solid transparent;
    background: var(--accent); color: var(--accent-ink); font-weight: 600; font-size: 18px;
    cursor: pointer; text-decoration: none; transition: transform .08s ease;
  }
  .btn:active { transform: scale(.97); }
  .btn.block { display: flex; width: 100%; }
  .btn.ghost { background: transparent; color: var(--accent); border-color: var(--accent); }
  .btn.soft { background: var(--accent-soft); color: var(--ink); }
  .btn.good { background: var(--good); color: #fff; }
  .btn[disabled] { opacity: .45; pointer-events: none; }
  .icon-btn {
    width: 48px; height: 48px; border-radius: 50%; border: none; background: var(--accent-soft);
    font-size: 22px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex: none;
  }

  /* Cards */
  .card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 14px; }
  .row { display: flex; align-items: center; gap: 12px; }
  .grow { flex: 1; min-width: 0; }
  .topbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
  .topbar .title { flex: 1; min-width: 0; font-weight: 600; font-size: 17px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  /* Progress bar */
  .bar { height: 12px; background: var(--line); border-radius: 99px; overflow: hidden; }
  .bar > i { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .4s ease; }
  .bar.good > i { background: var(--good); }

  /* Chips */
  .chip { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 14px; font-weight: 600; background: var(--accent-soft); color: var(--ink); white-space: nowrap; }
  .chip.good { background: var(--good-soft); color: var(--good); }
  .chip.bad { background: var(--bad-soft); color: var(--bad); }
  .chip.warn { background: var(--warn-soft); color: var(--warn); }

  /* Key words */
  .term {
    background: var(--term); color: var(--term-ink); border: none; border-bottom: 2px dotted var(--term-ink);
    border-radius: 4px; padding: 0 3px; margin: 0; cursor: pointer; font: inherit; line-height: inherit;
  }

  /* Bottom sheet */
  .sheet-bg { position: fixed; inset: 0; background: rgba(14, 26, 27, .45); z-index: 40; }
  .sheet {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; background: var(--card);
    border-radius: 22px 22px 0 0; padding: 22px 20px calc(22px + env(safe-area-inset-bottom));
    box-shadow: 0 -6px 30px rgba(0, 0, 0, .2); max-width: 640px; margin: 0 auto;
    animation: up .2s ease;
  }
  @keyframes up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }

  /* Toast */
  .toast {
    position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60;
    background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 12px; font-size: 16px;
    max-width: calc(100% - 32px); box-shadow: var(--shadow);
  }

  .center { text-align: center; }
  .spinner { width: 44px; height: 44px; border: 5px solid var(--accent-soft); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; margin: 60px auto 16px; }
  @keyframes spin { to { transform: rotate(360deg); } }
