:root {
  --green: #315c49;
  --green-light: #edf3ed;
  --ink: #283d34;
  --muted: #778077;
  --cream: #f8f7f2;
  --line: #e4e7de;
  --yellow: #f1ddb0;
  --orange: #cc8352
}

* {
  box-sizing: border-box
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif
}

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

button,
a,
input,
textarea,
select {
  -webkit-tap-highlight-color: transparent
}

button {
  cursor: pointer
}

button:disabled {
  opacity: .55;
  cursor: wait
}

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

button:focus-visible,
a:focus-visible {
  outline: 3px solid #b0c8ac;
  outline-offset: 3px
}

.shell {
  display: flex;
  max-width: 1600px;
  margin: auto;
  min-height: 100vh
}

.sidebar {
  width: 240px;
  flex-shrink: 0;
  border-right: 1px solid var(--line);
  padding: 36px 24px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: #fbfcf8
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 30px;
  font-weight: 750;
  letter-spacing: 3px
}

.brand-icon {
  font-size: 48px;
  line-height: 1;
  color: var(--green)
}

.brand small {
  display: block;
  letter-spacing: 2px;
  font-size: 9px;
  font-weight: 600;
  margin-top: -3px;
  color: var(--muted)
}

.family-card {
  margin: 35px 0 28px;
  padding: 16px 12px;
  border: 1px solid var(--line);
  border-radius: 15px;
  font-size: 13px
}

.family-card small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 5px
}

.avatars {
  display: flex;
  margin-bottom: 12px
}

.avatars span {
  background: #eadfcb;
  border: 3px solid #fff;
  border-radius: 50%;
  font-size: 21px;
  width: 38px;
  height: 38px;
  text-align: center
}

.avatars span+span {
  margin-left: -7px;
  background: #e4ead8
}

nav {
  display: grid;
  gap: 9px
}

nav button {
  border: 0;
  background: transparent;
  border-radius: 10px;
  color: #68746a;
  text-align: left;
  padding: 13px 16px;
  font-weight: 600
}

nav button span {
  display: inline-block;
  width: 31px;
  font-size: 21px;
  vertical-align: middle
}

nav button.active {
  color: var(--green);
  background: var(--green-light)
}

.sidebar-bottom {
  margin-top: auto;
  padding: 24px 14px 4px
}

.sidebar-bottom p {
  font-size: 19px;
  line-height: 1.7;
  font-weight: 500
}

.sidebar-bottom small {
  color: #9aa194;
  font-size: 11px
}

.tiny-tag,
.pill {
  display: inline-block;
  font-size: 11px;
  padding: 4px 10px;
  background: var(--green-light);
  color: var(--green);
  border-radius: 20px
}

.tiny-tag {
  background: #f2eddf;
  color: #8c7950
}

main {
  padding: 0 42px;
  flex: 1;
  min-width: 0
}

.topbar {
  height: 85px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px
}

.topbar>div {
  display: flex;
  gap: 18px;
  align-items: center
}

.icon-button {
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  width: 31px;
  height: 31px;
  color: var(--green)
}

#save-state.warning {
  color: #ad6436
}

#app {
  padding-top: 32px;
  min-height: 76vh
}

.heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 25px
}

.eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--green);
  margin-bottom: 8px
}

h1 {
  font-size: 30px;
  line-height: 1.35;
  letter-spacing: -.5px;
  margin: 0 0 10px;
  font-weight: 700
}

h2 {
  font-size: 21px;
  line-height: 1.4;
  margin: 0 0 12px
}

h3 {
  font-size: 16px;
  margin: 0 0 10px
}

p {
  margin: 0 0 12px
}

.subtle {
  color: var(--muted);
  font-size: 13px
}

.course-select {
  max-width: 230px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  color: var(--ink)
}

.hero {
  background: #eaf0e5;
  border: 1px solid #dce6d5;
  border-radius: 20px;
  padding: 28px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
  margin-bottom: 24px;
  gap: 20px
}

.hero .pill {
  background: #fff9;
  margin-bottom: 14px
}

.hero h2 {
  font-size: 28px;
  margin: 0 0 5px
}

.hero .english {
  color: #7b8b72;
  font-size: 16px;
  letter-spacing: .5px
}

.hero p {
  color: #64765e;
  font-size: 13px;
  margin: 12px 0 20px
}

.illustration {
  width: 200px;
  flex-shrink: 0
}

.button {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 10px 17px;
  display: inline-flex;
  gap: 9px;
  align-items: center;
  justify-content: center;
  color: var(--green);
  font-weight: 600;
  font-size: 13px;
  min-height: 42px
}

.button.primary {
  background: var(--green);
  border-color: var(--green);
  color: white
}

.button.soft {
  background: var(--green-light);
  border-color: #dde6d7
}

.button.small {
  font-size: 12px;
  padding: 7px 12px;
  min-height: 35px
}

.button.danger {
  color: #a5644b
}

.button.text {
  background: transparent;
  border: 0;
  padding-left: 0;
  padding-right: 0
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 26px 0 14px
}

.section-title h2 {
  font-size: 17px;
  margin: 0
}

.section-title span {
  font-size: 11px;
  color: var(--muted)
}

.grid-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px
}

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 23px
}

.activity-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 220px
}

.card-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #eff2ea;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 23px;
  margin-bottom: 16px
}

.child-card .card-icon {
  background: #faf0de
}

.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 7px
}

.card-meta span {
  font-size: 11px;
  color: #8c9687
}

.card p {
  font-size: 13px;
  color: var(--muted)
}

.activity-card .button {
  align-self: flex-start;
  margin-top: auto
}

.skill-tags {
  display: flex;
  gap: 7px;
  margin: 5px 0 20px
}

.skill-tags span {
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 5px;
  background: #f6f7f2;
  color: #829078
}

.progress-card {
  margin-top: 24px;
  display: flex;
  align-items: center;
  gap: 24px
}

.progress-card h3 {
  margin: 0 0 4px
}

.progress-card p {
  margin: 0;
  font-size: 12px
}

.week-dots {
  display: flex;
  gap: 8px;
  margin-left: auto
}

.day-dot {
  width: 35px;
  height: 35px;
  background: #f3f4ee;
  border: 1px solid transparent;
  border-radius: 50%;
  color: #8a9585;
  font-size: 11px
}

.day-dot.current {
  border-color: var(--green);
  background: #eff4e9;
  color: var(--green);
  font-weight: bold
}

.day-dot.completed {
  background: var(--green);
  color: white
}

.day-dot.skipped {
  background: #efeadf;
  color: #9b896f
}

.day-dot.paused {
  background: #f5e7cb;
  color: #986d26
}

.note {
  display: flex;
  gap: 12px;
  background: #f3f0e6;
  border: 1px solid #eae4d5;
  border-radius: 12px;
  padding: 15px 18px;
  margin: 18px 0;
  color: #8a7859;
  font-size: 12px
}

.lesson-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px
}

.tabs-inline {
  display: flex;
  gap: 5px;
  background: #f4f5ef;
  padding: 4px;
  border-radius: 8px
}

.tabs-inline button {
  border: 0;
  background: none;
  padding: 5px 10px;
  color: var(--muted);
  font-size: 12px;
  border-radius: 5px
}

.tabs-inline button.active {
  background: #fff;
  color: var(--green);
  box-shadow: 0 1px 3px #0001
}

.passage {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 21px;
  line-height: 1.9;
  color: #334737;
  margin: 18px 0
}

.translation {
  background: #f7f8f4;
  padding: 14px 16px;
  border-radius: 10px;
  font-size: 13px;
  color: #71816c
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 15px 0
}

.speed {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 12px;
  color: var(--muted)
}

.speed input {
  accent-color: var(--green)
}

.vocab {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px
}

.vocab button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 8px 11px;
  font-size: 13px;
  color: var(--green);
  text-align: left
}

.vocab small {
  display: block;
  color: var(--muted);
  font-size: 11px
}

.check-row {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  margin: 12px 0;
  color: #61745c
}

.check-row input {
  width: 17px;
  height: 17px;
  accent-color: var(--green)
}

textarea,
input[type=text],
input[type=password],
input[type=number] {
  width: 100%;
  padding: 12px;
  border: 1px solid #dfe4d8;
  background: #fbfcf9;
  border-radius: 9px;
  color: var(--ink);
  outline: none
}

textarea:focus,
input:focus,
select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 2px #315c4910
}

textarea {
  resize: vertical;
  min-height: 125px;
  line-height: 1.7
}

.writing {
  font-family: Georgia, serif;
  font-size: 18px
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px
}

.form-grid label {
  font-size: 12px;
  color: var(--muted)
}

.form-grid input {
  margin-top: 5px
}

.feedback-field {
  margin-bottom: 17px
}

.feedback-field>span {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600
}

.choices {
  display: flex;
  gap: 8px;
  flex-wrap: wrap
}

.choices button {
  padding: 8px 13px;
  background: #f8f9f4;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #778270;
  font-size: 12px
}

.choices button.selected {
  background: var(--green-light);
  border-color: #8ca883;
  color: var(--green)
}

.step-list {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: step
}

.step-list li {
  position: relative;
  padding: 0 0 20px 40px;
  font-size: 14px;
  counter-increment: step
}

.step-list li:before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 26px;
  height: 26px;
  line-height: 26px;
  text-align: center;
  border-radius: 50%;
  background: var(--green-light);
  color: var(--green);
  font-size: 12px
}

.phrase {
  border-top: 1px solid var(--line);
  padding: 16px 0;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  align-items: center
}

.phrase .en {
  font: 20px/1.6 Georgia, serif
}

.phrase .zh {
  font-size: 12px;
  color: var(--muted)
}

.phrase-actions {
  display: flex;
  gap: 6px
}

.phrase-actions button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  width: 34px;
  height: 34px;
  color: var(--green)
}

.recorder audio {
  width: 100%;
  max-width: 420px
}

.recorder .status {
  font-size: 12px;
  color: var(--muted)
}

.recording {
  color: #b5684b !important
}

.status-banner {
  font-size: 13px;
  margin-bottom: 16px;
  padding: 12px 15px;
  border-radius: 9px;
  background: #f3eddc;
  color: #8d794b
}

.finish-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap
}

.finish-bar>div {
  display: flex;
  gap: 8px;
  flex-wrap: wrap
}

.week-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px
}

.stat {
  background: #fff;
  border: 1px solid var(--line);
  padding: 20px;
  border-radius: 13px
}

.stat strong {
  display: block;
  font: 32px/1.3 Georgia, serif;
  color: var(--green)
}

.stat small {
  color: var(--muted);
  font-size: 12px
}

.history-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--line)
}

.history-item:last-child {
  border-bottom: 0
}

.history-head {
  display: flex;
  justify-content: space-between;
  gap: 10px
}

.history-head button {
  background: none;
  border: 0;
  text-align: left;
  padding: 0;
  color: var(--ink);
  font-weight: 600
}

.history-item p {
  margin-top: 8px;
  font-size: 12px;
  white-space: pre-wrap
}

.history-item small {
  font-size: 11px;
  color: var(--muted)
}

.ai-result {
  border-left: 3px solid #8ca883;
  background: #f3f6ed;
  margin: 15px 0;
  padding: 16px
}

.ai-result .corrected {
  font: 18px/1.8 Georgia, serif;
  white-space: pre-wrap
}

.ai-result li {
  font-size: 12px;
  margin: 6px 0
}

.empty {
  color: var(--muted);
  font-size: 13px;
  padding: 12px 0
}

.loading {
  padding: 60px 0;
  color: var(--muted)
}

footer {
  border-top: 1px solid var(--line);
  margin-top: 34px;
  padding: 24px 0;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 11px;
  color: #929989
}

footer span {
  font-size: 9px;
  letter-spacing: 1px
}

#toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 20px;
  background: #293f35;
  color: white;
  border-radius: 12px;
  z-index: 20;
  max-width: 90vw;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s
}

#toast.show {
  opacity: 1
}

dialog {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 30px;
  max-width: 400px;
  width: 90%;
  color: var(--ink)
}

dialog::backdrop {
  background: #24352b66
}

dialog label {
  font-size: 13px
}

dialog input {
  margin: 8px 0
}

#login-error {
  color: #b5684b;
  font-size: 12px
}

details summary {
  cursor: pointer;
  color: var(--green);
  font-size: 13px
}

details {
  margin-top: 18px
}

.saved-badge {
  color: var(--green);
  font-size: 11px
}

.full {
  grid-column: 1/-1
}

.favorite-row {
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
  display: flex;
  justify-content: space-between;
  gap: 12px
}

.favorite-row .en {
  font: 17px/1.7 Georgia, serif
}

.favorite-row small {
  color: var(--muted)
}

@media(min-width:1250px) {
  main {
    padding: 0 55px
  }

  .hero {
    padding: 32px 38px
  }

  .illustration {
    width: 230px
  }

  .card {
    padding: 26px
  }

  #app {
    max-width: 1040px;
    margin: auto
  }
}

@media(max-width:1000px) {
  .sidebar {
    width: 190px;
    padding: 28px 16px
  }

  .family-card {
    padding: 12px 9px
  }

  main {
    padding: 0 24px
  }

  .hero {
    padding: 24px
  }

  .illustration {
    width: 150px
  }

  .progress-card {
    gap: 14px;
    flex-wrap: wrap
  }

  .week-dots {
    margin-left: 0
  }

  h1 {
    font-size: 27px
  }

  .grid-two {
    gap: 14px
  }
}

@media(max-width:700px) {
  .shell {
    display: block
  }

  .sidebar {
    height: auto;
    width: 100%;
    position: sticky;
    z-index: 10;
    padding: 12px 16px 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    background: #fbfcf8f5;
    backdrop-filter: blur(12px)
  }

  .brand {
    font-size: 22px;
    gap: 8px
  }

  .brand-icon {
    font-size: 31px
  }

  .brand small {
    font-size: 7px;
    letter-spacing: 1px
  }

  .family-card,
  .sidebar-bottom {
    display: none
  }

  nav {
    display: flex;
    gap: 3px;
    margin-top: 10px;
    justify-content: space-between
  }

  nav button {
    padding: 10px 8px;
    border-radius: 8px 8px 0 0;
    font-size: 12px;
    flex: 1;
    text-align: center;
    white-space: nowrap
  }

  nav button span {
    width: 20px;
    font-size: 16px;
    margin-right: 2px
  }

  main {
    padding: 0 17px
  }

  .topbar {
    height: 48px;
    font-size: 10px
  }

  .topbar>div {
    gap: 8px
  }

  #app {
    padding-top: 22px
  }

  .heading {
    margin-bottom: 18px;
    display: block
  }

  .heading .course-select {
    width: 100%;
    max-width: none;
    margin-top: 8px;
    font-size: 12px;
    padding: 8px
  }

  h1 {
    font-size: 26px
  }

  .hero {
    padding: 22px 20px;
    border-radius: 16px;
    position: relative;
    min-height: 225px;
    gap: 8px
  }

  .hero h2 {
    font-size: 24px
  }

  .hero .english {
    font-size: 13px
  }

  .hero p {
    max-width: 220px;
    font-size: 12px
  }

  .illustration {
    width: 118px;
    position: absolute;
    right: 5px;
    bottom: 12px;
    opacity: .85;
    pointer-events: none
  }

  .hero>div {
    z-index: 1
  }

  .hero .button {
    font-size: 12px
  }

  .grid-two {
    grid-template-columns: 1fr
  }

  .activity-card {
    min-height: 190px
  }

  .card {
    padding: 20px
  }

  .progress-card {
    margin-top: 18px
  }

  .week-dots {
    gap: 7px;
    width: 100%;
    justify-content: space-between
  }

  .day-dot {
    width: 33px;
    height: 33px
  }

  .section-title {
    margin: 22px 0 12px
  }

  .section-title span {
    font-size: 10px
  }

  .passage {
    font-size: 19px;
    line-height: 1.85
  }

  .lesson-top {
    flex-wrap: wrap
  }

  .stats {
    gap: 8px
  }

  .stat {
    padding: 14px 10px
  }

  .stat strong {
    font-size: 28px
  }

  .stat small {
    font-size: 10px
  }

  .form-grid {
    gap: 10px
  }

  .finish-bar {
    align-items: stretch
  }

  .finish-bar>div {
    width: 100%
  }

  .finish-bar .button.primary {
    width: 100%
  }

  footer {
    font-size: 10px
  }

  footer span {
    display: none
  }

  .phrase .en {
    font-size: 18px
  }

  .phrase-actions {
    flex-shrink: 0
  }

  .subtle {
    font-size: 12px
  }

  .note {
    padding: 13px;
    font-size: 11px
  }

  .tabs-inline button {
    padding: 5px 8px
  }

  .course-select {
    font-size: 12px
  }

  .favorite-row .en {
    font-size: 16px
  }
}

@media(prefers-reduced-motion:reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important
  }
}

@media (max-width: 360px) {
  nav button { padding: 10px 4px; min-width: 0; font-size: 11px; }
  nav button span { display: none; }
  .section-title { gap: 10px; }
}

#speech-controls audio { width: 100%; max-width: 480px; display: block; margin: 12px 0; }

.learning-panel{margin-bottom:18px}.learning-panel label{display:block;margin:14px 0}.learning-panel input{width:100%;margin-top:8px}.learning-panel details,#transcript{margin:14px 0}.selected{background:#deeddc!important;border-color:#477653!important}.week-tabs{flex-wrap:wrap}summary{cursor:pointer;color:#416750}
@media(max-width:700px){nav button{padding:10px 3px;min-width:0;font-size:11px}nav button span{display:none}}
.learning-panel input{padding:12px;border:1px solid #d9e1d5;border-radius:10px;font:inherit;background:#fafcf8}.passage{white-space:pre-wrap}

@media(max-width:700px){nav{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:3px}nav button{border-radius:8px}}
@media print{.sidebar,.topbar,footer,.heading select,.finish-bar,.actions,.tabs-inline,#toast{display:none!important}.shell,main,.grid-two{display:block!important}main{padding:0!important}.card{box-shadow:none;border:0;break-inside:auto}.passage,.translation{font-size:12pt}body{background:white}details{display:block}details>*{display:block!important}}

[hidden]{display:none!important}#login-dialog{max-height:90dvh;overflow:auto}#login-dialog input{width:100%;box-sizing:border-box}#login-dialog details{margin-top:16px}#account-name{font-size:13px;overflow-wrap:anywhere}#auth-toggle{margin-top:10px}#login-error{color:#a43d32}

#login-dialog label{display:block;margin-top:10px}#login-dialog .button{min-height:42px}#auth-toggle{display:block;width:100%}

/* Let content shrink to its column and keep iOS form focus at normal scale. */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
.shell, #app, .grid-two > *, .form-grid > *, .stats > * { min-width: 0; }
.grid-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.phrase > div:first-child, .favorite-row > div:first-child { min-width: 0; overflow-wrap: anywhere; }
.passage, .translation, .corrected, .history-item p { overflow-wrap: anywhere; }
@media (max-width: 700px) {
  .shell, .sidebar, main { width: 100%; max-width: 100%; }
  .sidebar { padding-top: max(12px, env(safe-area-inset-top)); }
  main { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  .topbar { height: auto; min-height: 76px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 10px 0; font-size: 12px; }
  #breadcrumb { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar > div { min-width: 0; width: 100%; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
  #account-name { flex: 1 1 60px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #account-name:empty { display: none; }
  #logout-button, #save-state, .icon-button { flex-shrink: 0; white-space: nowrap; }
  #logout-button { padding: 6px 8px; }
  #save-state { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
  nav button { font-size: 13px; min-height: 44px; }
  .grid-two { grid-template-columns: minmax(0, 1fr); }
  .heading .course-select, input:not([type=checkbox]):not([type=radio]), textarea, select { font-size: 16px; min-width: 0; max-width: 100%; }
  .heading .eyebrow { letter-spacing: 1.5px; overflow-wrap: anywhere; }
  .phrase { gap: 10px; }
  .phrase > div:first-child { flex: 1; }
  .phrase-actions { flex-shrink: 0; }
  .section-title, .history-head { flex-wrap: wrap; gap: 8px; }
  .actions, .tabs-inline { flex-wrap: wrap; }
  .button { max-width: 100%; overflow-wrap: anywhere; }
  #login-dialog { width: calc(100% - 32px); max-width: 400px; max-height: calc(100dvh - 32px); padding: 24px; overscroll-behavior: contain; }
  footer { padding-bottom: max(20px, env(safe-area-inset-bottom)); }
}

/* Family brand: a house with one large and one small speech bubble. */
.brand { font-size: 23px; letter-spacing: 0; gap: 9px; }
.brand-logo { width: 42px; height: 42px; flex-shrink: 0; }
.brand small { font-size: 11px; letter-spacing: 2px; margin-top: 4px; }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; color: var(--green); font-size: 23px; font-weight: 750; }
.auth-brand img { width: 48px; height: 48px; flex-shrink: 0; }
.auth-brand small { display: block; margin-top: 5px; font-size: 12px; font-weight: 400; color: var(--muted); }
@media (max-width: 700px) { .brand { font-size: 22px; } .brand-logo { width: 38px; height: 38px; } .brand small { font-size: 10px; } }
