:root {
  color-scheme: light;
  --bg: #f7f6f1;
  --surface: #ffffff;
  --surface-soft: #efeee7;
  --ink: #17251f;
  --muted: #68716c;
  --line: #dcded8;
  --accent: #1f6d55;
  --accent-dark: #16513f;
  --accent-soft: #dfeee6;
  --note: #a56223;
  --note-soft: #f7e9d8;
  --danger: #a53d3d;
  --danger-soft: #fae8e6;
  --shadow-sm: 0 1px 2px rgba(22, 37, 31, 0.06), 0 8px 24px rgba(22, 37, 31, 0.05);
  --shadow-lg: 0 24px 70px rgba(22, 37, 31, 0.18);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 0%, rgba(31, 109, 85, 0.055), transparent 28rem),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

body.modal-open {
  overflow: hidden;
}

button,
input,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

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

svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid rgba(31, 109, 85, 0.28);
  outline-offset: 3px;
}

.page-shell {
  min-height: 100vh;
  min-height: 100dvh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  min-height: 72px;
  padding: 12px max(24px, env(safe-area-inset-left));
  border-bottom: 1px solid rgba(220, 222, 216, 0.85);
  background: rgba(247, 246, 241, 0.9);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.topbar--home {
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
  font-weight: 750;
  letter-spacing: 0.04em;
}

.brand__mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 11px;
  color: white;
  background: var(--accent);
}

.brand__mark svg {
  width: 21px;
  height: 21px;
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0.66rem 1rem;
  border: 1px solid transparent;
  border-radius: 11px;
  font-size: 0.92rem;
  font-weight: 680;
  line-height: 1.2;
  cursor: pointer;
  transition: transform 150ms ease, background-color 150ms ease, border-color 150ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:active:not(:disabled) {
  transform: translateY(0);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.button--primary {
  color: #fff;
  background: var(--accent);
  box-shadow: 0 7px 18px rgba(31, 109, 85, 0.18);
}

.button--primary:hover:not(:disabled) {
  background: var(--accent-dark);
}

.button--secondary {
  color: var(--ink);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.78);
}

.button--secondary:hover:not(:disabled) {
  border-color: #bbc2bd;
  background: #fff;
}

.button--ghost {
  border-color: transparent;
  background: transparent;
}

.button--ghost:hover {
  background: var(--surface-soft);
}

.button--danger {
  color: #fff;
  background: var(--danger);
}

.button--large {
  min-height: 50px;
  padding-inline: 1.3rem;
}

.button--compact {
  min-height: 40px;
  padding: 0.55rem 0.85rem;
  white-space: nowrap;
}

.button--block {
  width: 100%;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.15em;
}

.home-main,
.records-main {
  width: min(1100px, calc(100% - 48px));
  margin: 0 auto;
  padding: 70px 0 96px;
}

.home-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 36px;
}

.home-heading h1,
.records-heading h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: clamp(2.4rem, 5vw, 4rem);
  font-weight: 500;
  letter-spacing: -0.045em;
}

.home-heading p:not(.eyebrow),
.records-heading > p:last-child {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 1rem;
}

.article-total {
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: var(--accent);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
}

.article-total span {
  color: var(--muted);
  font-family: inherit;
  font-size: 0.82rem;
}

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

.article-card {
  display: flex;
  min-height: 265px;
  flex-direction: column;
  padding: 26px;
  overflow: hidden;
  border: 1px solid rgba(220, 222, 216, 0.9);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.87);
  box-shadow: var(--shadow-sm);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.article-card:hover {
  transform: translateY(-3px);
  border-color: #bec7c1;
  box-shadow: 0 18px 45px rgba(22, 37, 31, 0.09);
}

.article-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.article-card__date {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
}

.article-card__arrow {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  color: var(--accent);
  background: var(--accent-soft);
}

.article-card h2 {
  margin: 23px 0 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.48rem;
  line-height: 1.25;
}

.article-card__excerpt {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.98rem;
  line-height: 1.6;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.article-card__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: auto;
  padding-top: 20px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
}

.article-card__stats span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.article-card__stats svg {
  width: 16px;
  height: 16px;
  color: var(--accent);
}

.empty-state {
  display: flex;
  min-height: 420px;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  padding: 60px 24px;
  border: 1px dashed #cbd0cb;
  border-radius: 22px;
  text-align: center;
  background: rgba(255, 255, 255, 0.4);
}

.empty-state__art {
  display: grid;
  width: 84px;
  height: 84px;
  margin-bottom: 24px;
  place-items: center;
  border-radius: 24px;
  color: var(--accent);
  background: var(--accent-soft);
  transform: rotate(-3deg);
}

.empty-state__art svg {
  width: 40px;
  height: 40px;
}

.empty-state h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.75rem;
}

.empty-state p {
  max-width: 500px;
  margin: 12px 0 26px;
  color: var(--muted);
  line-height: 1.7;
}

.reader-topbar {
  display: grid;
  grid-template-columns: 1fr minmax(0, 420px) 1fr;
  gap: 20px;
}

.back-link {
  display: inline-flex;
  width: fit-content;
  min-height: 44px;
  align-items: center;
  gap: 7px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 660;
}

.back-link:hover {
  color: var(--ink);
}

.reader-topbar__title {
  align-self: center;
  overflow: hidden;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 600;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.records-link {
  justify-self: end;
}

.button-count {
  display: inline-grid;
  min-width: 23px;
  height: 23px;
  place-items: center;
  padding: 0 6px;
  border-radius: 999px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  font-size: 0.74rem;
}

.reader-main {
  width: min(860px, calc(100% - 56px));
  margin: 0 auto;
  padding: 78px 0 120px;
}

.reader-intro {
  margin-bottom: 58px;
  padding-bottom: 38px;
  border-bottom: 1px solid var(--line);
}

.reader-intro h1 {
  max-width: 780px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.4rem, 6vw, 4.4rem);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.reader-intro__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
  color: var(--muted);
  font-size: 0.84rem;
}

.article-text {
  color: #26332d;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.27rem, 2.05vw, 1.48rem);
  line-height: 1.92;
  letter-spacing: 0.003em;
  text-wrap: pretty;
}

.article-text p {
  margin: 0 0 1.42em;
}

.read-word {
  position: relative;
  display: inline;
  margin: 0 -0.01em;
  padding: 0.08em 0.01em 0.1em;
  border-radius: 0.2em;
  cursor: pointer;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  transition: background-color 120ms ease, color 120ms ease, box-shadow 120ms ease;
}

.read-word:hover {
  color: var(--accent-dark);
  background: rgba(31, 109, 85, 0.08);
}

.read-word.is-saved {
  color: #145541;
  background: linear-gradient(to top, rgba(96, 170, 133, 0.24) 0 35%, transparent 35%);
}

.read-word.is-saved:hover {
  background: rgba(96, 170, 133, 0.2);
}

.reader-end {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 75px;
  color: #959c98;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.reader-end span {
  width: 42px;
  height: 1px;
  background: var(--line);
}

.word-popover {
  position: fixed;
  z-index: 60;
  width: 320px;
  padding: 18px;
  border: 1px solid rgba(220, 222, 216, 0.95);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-lg);
  animation: pop-in 130ms ease-out;
}

.word-popover__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.word-popover__top strong {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.65rem;
  line-height: 1;
}

.word-popover__sentence {
  display: -webkit-box;
  margin: 15px 0 17px;
  overflow: hidden;
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.84rem;
  font-style: italic;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.saved-actions {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 10px;
}

.saved-badge {
  align-self: flex-start;
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  font-size: 0.72rem;
  font-weight: 750;
}

.selection-bar {
  position: fixed;
  z-index: 50;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(22px, env(safe-area-inset-bottom));
  left: max(20px, env(safe-area-inset-left));
  display: flex;
  width: min(650px, calc(100% - 40px));
  min-height: 58px;
  align-items: center;
  gap: 14px;
  margin: 0 auto;
  padding: 8px 10px 8px 18px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 15px;
  color: #fff;
  background: #203129;
  box-shadow: 0 18px 55px rgba(22, 37, 31, 0.28);
  animation: rise-in 160ms ease-out;
}

.selection-bar__text {
  flex: 1;
  overflow: hidden;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.86rem;
  font-style: italic;
  opacity: 0.8;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-button {
  display: inline-grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transition: color 150ms ease, background-color 150ms ease;
}

.icon-button:hover {
  color: var(--ink);
  background: var(--surface-soft);
}

.icon-button--danger:hover {
  color: var(--danger);
  background: var(--danger-soft);
}

.icon-button--inverse {
  color: rgba(255, 255, 255, 0.66);
}

.icon-button--inverse:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.records-main {
  width: min(980px, calc(100% - 48px));
}

.topbar__spacer {
  flex: 1;
}

.records-heading {
  margin-bottom: 64px;
}

.record-section + .record-section {
  margin-top: 76px;
}

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

.section-heading h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.65rem;
}

.section-heading p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.87rem;
}

.count-pill {
  display: inline-grid;
  min-width: 36px;
  height: 30px;
  place-items: center;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  font-size: 0.8rem;
  font-weight: 750;
}

.count-pill--note {
  color: #86501c;
  background: var(--note-soft);
}

.record-list {
  display: grid;
  gap: 12px;
}

.record-card {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 1px 2px rgba(22, 37, 31, 0.035);
}

.record-card__main {
  min-width: 0;
  flex: 1;
}

.record-card__title-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 12px;
}

.record-card h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.42rem;
}

.meaning {
  color: var(--accent-dark);
  font-size: 0.98rem;
  font-weight: 650;
}

.placeholder {
  color: #9aa09c;
  font-size: 0.78rem;
}

.record-card blockquote {
  margin: 13px 0 0;
  padding-left: 14px;
  border-left: 2px solid #b7d2c3;
  color: #59625d;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.94rem;
  font-style: italic;
  line-height: 1.65;
}

.teacher-note {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 15px 0 0;
  color: var(--ink);
  font-size: 0.88rem;
  line-height: 1.6;
}

.teacher-note span,
.record-label {
  flex: 0 0 auto;
  margin: 0;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 780;
  letter-spacing: 0.08em;
}

.card-actions {
  display: flex;
  gap: 2px;
}

.note-card blockquote {
  margin-top: 8px;
  border-color: #e1bd96;
}

.record-label--note {
  margin-top: 20px;
  color: var(--note);
}

.note-content {
  margin: 7px 0 0;
  font-size: 0.94rem;
  line-height: 1.65;
}

.record-empty {
  padding: 34px;
  border: 1px dashed #cbd0cb;
  border-radius: 15px;
  color: var(--muted);
  text-align: center;
  background: rgba(255, 255, 255, 0.3);
}

.record-empty h3 {
  margin: 0;
  color: var(--ink);
  font-size: 0.94rem;
}

.record-empty p {
  margin: 6px 0 0;
  font-size: 0.83rem;
}

.modal-layer {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: max(22px, env(safe-area-inset-top)) max(22px, env(safe-area-inset-right)) max(22px, env(safe-area-inset-bottom)) max(22px, env(safe-area-inset-left));
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 26, 21, 0.48);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.modal {
  position: relative;
  display: flex;
  width: min(560px, 100%);
  max-height: min(800px, calc(100dvh - 44px));
  flex-direction: column;
  overflow: hidden;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: modal-in 170ms ease-out;
}

.modal--large {
  width: min(720px, 100%);
}

.modal--small {
  width: min(430px, 100%);
}

.modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 25px 27px 18px;
  border-bottom: 1px solid var(--line);
}

.modal__header h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.65rem;
  font-weight: 600;
}

.modal__body {
  min-height: 0;
  overflow: auto;
  padding: 24px 27px 27px;
  overscroll-behavior: contain;
}

.form-stack {
  display: grid;
  gap: 19px;
}

.field {
  display: grid;
  gap: 8px;
}

.field > span,
.quote-preview > span {
  color: #3d4842;
  font-size: 0.81rem;
  font-weight: 720;
}

.field small {
  margin-left: 4px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 500;
}

.field input,
.field textarea {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid #cfd3cf;
  border-radius: 10px;
  outline: 0;
  color: var(--ink);
  background: #fff;
  line-height: 1.55;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.field input {
  min-height: 46px;
}

.field textarea {
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(31, 109, 85, 0.12);
}

.field .readonly-field {
  color: var(--muted);
  background: #f5f5f1;
  cursor: default;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 5px;
}

.quote-preview {
  padding: 16px 18px;
  border-radius: 11px;
  background: #f4f5f1;
}

.quote-preview blockquote {
  margin: 8px 0 0;
  color: #59625d;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.93rem;
  font-style: italic;
  line-height: 1.62;
}

.confirm-content > p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.confirm-content .form-actions {
  margin-top: 22px;
}

.toast-host {
  position: fixed;
  z-index: 200;
  top: max(18px, env(safe-area-inset-top));
  left: 50%;
  pointer-events: none;
  transform: translateX(-50%);
}

.toast {
  padding: 11px 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  opacity: 0;
  color: #fff;
  background: #203129;
  box-shadow: 0 14px 40px rgba(22, 37, 31, 0.2);
  font-size: 0.86rem;
  font-weight: 650;
  transform: translateY(-8px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast--error {
  background: #7f2e2e;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(12px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes pop-in {
  from { opacity: 0; transform: translateY(4px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes rise-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 760px) {
  .topbar {
    min-height: 64px;
    padding: 9px 16px;
  }

  .topbar--home .brand__mark {
    width: 36px;
    height: 36px;
  }

  .home-main,
  .records-main {
    width: min(100% - 32px, 680px);
    padding: 48px 0 76px;
  }

  .home-heading {
    align-items: flex-start;
  }

  .article-grid {
    grid-template-columns: 1fr;
  }

  .article-card {
    min-height: 245px;
  }

  .reader-topbar {
    display: flex;
    justify-content: space-between;
    gap: 10px;
  }

  .reader-topbar__title {
    display: none;
  }

  .reader-main {
    width: min(100% - 38px, 700px);
    padding: 54px 0 100px;
  }

  .reader-intro {
    margin-bottom: 42px;
  }

  .article-text {
    font-size: 1.3rem;
    line-height: 1.9;
  }

  .record-card {
    padding: 20px;
  }
}

@media (max-width: 540px) {
  .brand > span:last-child,
  .back-link span,
  .records-link > span:not(.button-count),
  .topbar > .button > span {
    display: none;
  }

  .home-heading {
    margin-bottom: 27px;
  }

  .home-heading h1,
  .records-heading h1 {
    font-size: 2.55rem;
  }

  .home-heading p:not(.eyebrow) {
    max-width: 220px;
  }

  .article-total {
    font-size: 1.55rem;
  }

  .article-card {
    min-height: 230px;
    padding: 21px;
  }

  .empty-state {
    min-height: 380px;
  }

  .reader-main {
    width: calc(100% - 32px);
    padding-top: 42px;
  }

  .reader-intro h1 {
    font-size: 2.55rem;
  }

  .reader-intro__meta span:nth-child(2),
  .reader-intro__meta span:nth-child(3) {
    display: none;
  }

  .article-text {
    font-size: 1.18rem;
    line-height: 1.88;
  }

  .word-popover {
    top: auto !important;
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    left: 12px !important;
    width: auto;
    border-radius: 18px;
  }

  .selection-bar {
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    left: 12px;
    width: auto;
    padding-left: 13px;
  }

  .selection-bar__text {
    display: none;
  }

  .selection-bar .button {
    flex: 1;
  }

  .records-heading {
    margin-bottom: 48px;
  }

  .record-section + .record-section {
    margin-top: 58px;
  }

  .section-heading p {
    max-width: 250px;
  }

  .record-card {
    position: relative;
    display: block;
    padding: 20px;
  }

  .card-actions {
    margin: 16px -7px -7px 0;
    justify-content: flex-end;
  }

  .teacher-note {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .modal-layer {
    align-items: end;
    padding: 0;
  }

  .modal-backdrop {
    background: rgba(15, 26, 21, 0.48);
  }

  .modal,
  .modal--large,
  .modal--small {
    width: 100%;
    max-height: calc(100dvh - 20px);
    border-radius: 20px 20px 0 0;
  }

  .modal__header {
    padding: 21px 20px 16px;
  }

  .modal__body {
    padding: 20px 20px max(22px, env(safe-area-inset-bottom));
  }

  .form-actions .button {
    flex: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
