@font-face {
  font-family: "Ma Shan Zheng";
  src: url("assets/fonts/MaShanZheng-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
:root {
  font-family:
    system-ui,
    -apple-system,
    "PingFang SC",
    "Microsoft YaHei",
    sans-serif;
  color: #fff9ec;
  background: #292e30;
  --shade: 0.35;
  --serif:
    "Noto Serif CJK SC", "Songti SC", "STSong", "SimSun", serif;
  --poem-font:
    "Ma Shan Zheng", "Kaiti SC", "Kaiti TC", "KaiTi", "STKaiti", var(--serif);
  color-scheme: dark;
}
:root:lang(zh-TW) {
  font-family:
    system-ui, -apple-system, "PingFang TC", "Microsoft JhengHei", sans-serif;
  --serif:
    "Noto Serif CJK TC", "Songti TC", "PMingLiU", serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-width: 320px;
}
body[data-poem-font="serif"] {
  --poem-font: var(--serif);
}
body[data-poem-font="sans"] {
  --poem-font:
    system-ui, -apple-system, "PingFang SC", "PingFang TC", "Microsoft YaHei",
    "Microsoft JhengHei", sans-serif;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.45;
  cursor: wait;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid #e8c798;
  outline-offset: 5px;
}
button {
  color: inherit;
}
svg.icon {
  height: 21px;
  width: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.icon-definitions {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
.landscape {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 78% 18%, #c5bd8a26, transparent 55%),
    linear-gradient(135deg, #293e38, #526459 70%, #72755d);
}
#art,
#background-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0;
  transition: opacity 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}
#art.loaded,
#background-video.loaded {
  opacity: 1;
}
body[data-background="art"] #art.loaded {
  animation: background-drift 28s ease-in-out 1.2s infinite alternate both;
}
@keyframes background-drift {
  from {
    transform: scale(1.01) translate3d(-0.2%, -0.1%, 0);
  }
  to {
    transform: scale(1.04) translate3d(0.4%, 0.25%, 0);
  }
}
.background-loading {
  position: fixed;
  left: 24px;
  bottom: 12px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: #fff9ec80;
  font-size: 11px;
  letter-spacing: 0.08em;
  pointer-events: none;
}
.background-loading[hidden] {
  display: none;
}
.background-loading:not([hidden]) {
  animation: background-loading-appear 0.3s ease 0.4s both;
}
.background-loading-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  animation: background-loading-pulse 1.6s ease-in-out infinite;
}
@keyframes background-loading-appear {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes background-loading-pulse {
  0%,
  100% {
    opacity: 0.3;
  }
  50% {
    opacity: 1;
  }
}
.veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      90deg,
      rgba(9, 18, 24, calc(var(--shade) + 0.2)) 0%,
      rgba(9, 18, 24, var(--shade)) 48%,
      rgba(9, 18, 24, calc(var(--shade) * 0.55)) 100%
    ),
    linear-gradient(
      0deg,
      rgba(7, 14, 19, 0.5),
      transparent 28%,
      transparent 75%,
      rgba(7, 14, 19, 0.22)
    );
}
.grain {
  position: absolute;
  inset: 0;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.7' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' opacity='.8' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
}
.page {
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 42px 64px 38px;
}
.masthead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 13px;
}
.seal {
  background: #9a443a;
  color: #fff3df;
  font-family: var(--serif);
  font-size: 25px;
  border-radius: 3px;
  width: 40px;
  height: 44px;
  display: grid;
  place-items: center;
  box-shadow:
    inset 0 0 0 4px #9a443a,
    inset 0 0 0 5px #dfb6a4;
  transform: rotate(-3deg);
}
.brand-name {
  font-family: var(--serif);
  font-size: 24px;
  letter-spacing: 0.23em;
  display: block;
}
.brand-subtitle {
  display: block;
  font-size: 10px;
  letter-spacing: 0.18em;
  margin-top: 5px;
  opacity: 0.8;
}
.almanac {
  background: none;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 6px 10px;
  margin-right: -10px;
  text-align: right;
  font-size: 12px;
  letter-spacing: 0.12em;
  line-height: 1.9;
  text-shadow: 0 1px 12px #152025;
}
.almanac:hover {
  background: #fff9ec0d;
  border-color: #fff9ec25;
}
.almanac-line {
  display: block;
  opacity: 0.82;
}
.dot {
  margin: 0 10px;
}
.poetry {
  align-self: center;
  padding: 48px 0 64px 3.2vw;
  max-width: 1000px;
  animation: arrive 0.8s ease both;
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 13px;
  font-size: 12px;
  letter-spacing: 0.22em;
  opacity: 0.86;
  margin-bottom: 27px;
}
.rule {
  width: 28px;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}
h1 {
  font-family: var(--poem-font);
  font-weight: 400;
  font-size: clamp(30px, 3.4vw, 58px);
  line-height: 1.68;
  letter-spacing: 0.16em;
  margin: 0;
  text-shadow: 0 2px 20px #14202370;
}
h1 span {
  display: block;
}
.byline {
  font-family: var(--poem-font);
  font-size: 14px;
  letter-spacing: 0.14em;
  opacity: 0.83;
  margin: 25px 0 0;
}
.reading-link {
  border: 0;
  background: none;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  letter-spacing: 0.1em;
  margin-top: 28px;
  opacity: 0.75;
  transition: opacity 0.2s;
}
.reading-link:hover {
  opacity: 1;
}
.reading-link .icon {
  width: 17px;
}
.inline-meaning {
  max-width: 580px;
  font-size: 14px;
  line-height: 1.9;
  opacity: 0.9;
  margin-top: 20px;
  font-weight: 300;
}
.footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
}
.clock-wrap {
  min-height: 83px;
}
.clock {
  font-size: 54px;
  font-weight: 200;
  letter-spacing: 0.025em;
  font-variant-numeric: tabular-nums;
  display: block;
  line-height: 1.1;
}
.clock-wrap > span {
  display: block;
  font-size: 10px;
  letter-spacing: 0.18em;
  margin-top: 10px;
  opacity: 0.75;
}
.tools {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #16232629;
  border: 1px solid #fff6e42b;
  border-radius: 30px;
  padding: 7px 11px;
  backdrop-filter: blur(14px);
}
.tool {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 0;
  background: transparent;
  border-radius: 22px;
  font-size: 12px;
  letter-spacing: 0.08em;
  padding: 10px 14px;
  min-height: 40px;
  transition: background 0.2s;
}
.tool:hover {
  background: #fff9ed1a;
}
.tool[aria-pressed="true"] {
  color: #f3b7a3;
}
.tool[aria-pressed="true"] .icon {
  fill: #f3b7a322;
}
.icon-only {
  padding: 10px;
  width: 40px;
}
.tool-divider {
  height: 18px;
  width: 1px;
  background: #fff5df30;
  margin: 0 5px;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 120px;
  transform: translateX(-50%);
  padding: 12px 22px;
  background: #172429e8;
  backdrop-filter: blur(15px);
  border: 1px solid #ffffff20;
  border-radius: 30px;
  font-size: 13px;
  z-index: 5;
  max-width: 90vw;
  text-align: center;
  margin: 0;
}
.sheet {
  color: #353d36;
  background: #f9f5eb;
  max-height: 85svh;
  width: min(540px, calc(100vw - 32px));
  border: 1px solid #e2ddcf;
  border-radius: 16px;
  padding: 30px 35px;
  box-shadow: 0 30px 100px #0005;
  overflow-y: auto;
  color-scheme: light;
}
.sheet::backdrop {
  background: #1121246e;
  backdrop-filter: blur(7px);
}
.sheet[open] {
  animation: arrive 0.25s ease;
}
.sheet-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}
.sheet-kicker {
  font-size: 11px;
  color: #7e8172;
  letter-spacing: 0.12em;
}
.close {
  background: none;
  border: 0;
  padding: 6px;
  color: #73786b;
  border-radius: 50%;
  display: flex;
}
.close:hover {
  background: #e9e5d9;
}
.sheet h2 {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 400;
  letter-spacing: 0.08em;
  margin: 22px 0 10px;
}
.sheet-byline {
  font-size: 12px;
  color: #7f8275;
  letter-spacing: 0.08em;
  margin: 0 0 23px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.calendar-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 22px 0 18px;
}
.calendar-selects {
  display: flex;
  flex: 1;
  justify-content: center;
  gap: 8px;
}
.calendar-toolbar button {
  border: 1px solid #deded1;
  background: transparent;
  border-radius: 7px;
  min-height: 36px;
  padding: 5px 9px;
  color: #455848;
  font-size: 13px;
}
.custom-select,
.calendar-toolbar .custom-select {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border-color: #dddccd;
  border-radius: 9px;
  background: #f2f1e7;
  color: #455848;
  font-size: 13px;
  min-height: 36px;
  border: 1px solid #dddccd;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  transition:
    background 0.15s,
    border-color 0.15s;
}
.custom-select[aria-expanded="true"] {
  background: #e9eddf;
  border-color: #8b9c7b;
}
.custom-select:focus-visible {
  outline-color: #9cad86;
  outline-offset: 3px;
}
.custom-select:hover {
  background: #eeeee3;
}
.setting-row .custom-select {
  flex-shrink: 0;
  max-width: 150px;
  font-size: 12px;
}
html:lang(en) .brand-name,
html:lang(en) .brand-subtitle,
html:lang(en) .almanac,
html:lang(en) .clock-wrap > span,
html:lang(en) .sheet-byline,
html:lang(en) .sheet-kicker {
  letter-spacing: 0.02em;
}
html:lang(en) .calendar-detail p {
  line-height: 1.6;
}
html:lang(en) .clock-wrap {
  min-width: 0;
}
html:lang(en) .clock-wrap > span {
  max-width: 140px;
  line-height: 1.5;
}
.custom-select-arrow {
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  opacity: 0.6;
  transition: transform 0.15s;
}
[aria-expanded="true"] .custom-select-arrow {
  transform: translateY(1px) rotate(225deg);
}
.custom-select-menu {
  position: fixed;
  inset: auto;
  margin: 0;
  padding: 8px;
  border: 1px solid #dcdccd;
  border-radius: 12px;
  background: #fbf8ef;
  color: #455848;
  box-shadow:
    0 12px 32px #273c302b,
    0 2px 6px #273c300d;
  color-scheme: light;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #bdc5ad transparent;
}
.custom-select-menu:popover-open {
  display: grid;
  grid-template-columns: repeat(var(--select-columns), minmax(0, 1fr));
  gap: 4px;
}
.custom-select-option {
  display: grid;
  place-items: center;
  min-height: 36px;
  padding: 8px 4px;
  border: 1px solid transparent;
  border-radius: 7px;
  font:
    12px/1.4 system-ui,
    sans-serif;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.custom-select-option.is-active {
  background: #e9eddf;
  border-color: #d0d9c2;
}
.custom-select-option[aria-selected="true"] {
  background: #455848;
  color: #fff9ec;
  border-color: #455848;
}
.calendar-toolbar button:hover:not(:disabled) {
  background: #eeeee3;
}
.calendar-toolbar .calendar-nav {
  font-size: 24px;
  line-height: 1;
  min-width: 34px;
  flex-shrink: 0;
}
#calendar-today {
  margin-left: auto;
}
.calendar-toolbar button:disabled,
.calendar-day:disabled {
  cursor: default;
}
.calendar-weekdays,
.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}
.calendar-weekdays {
  text-align: center;
  font-size: 11px;
  color: #878878;
  padding-bottom: 10px;
}
.calendar-weekdays span:nth-last-child(-n + 2) {
  color: #a27161;
}
.calendar-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  position: relative;
  min-height: 54px;
  min-width: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 6px 0;
  background: none;
  color: #353d36;
}
.calendar-day:hover:not(:disabled):not([aria-pressed="true"]) {
  background: #eeeee3;
}
.calendar-day.outside-month {
  opacity: 0.4;
}
.calendar-number {
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}
.calendar-lunar {
  font-size: 10px;
  color: #7f8275;
  white-space: nowrap;
}
.calendar-day.has-term .calendar-lunar {
  color: #507058;
}
.calendar-day.is-today {
  border-color: #9bab8c;
}
.calendar-day.is-today::after {
  content: "";
  position: absolute;
  top: 4px;
  right: 5px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #8c5141;
}
.calendar-day[aria-pressed="true"] {
  background: #455848;
  color: #fff9ec;
  opacity: 1;
}
.calendar-day[aria-pressed="true"] .calendar-lunar {
  color: #e2e4d2;
}
.calendar-day[aria-pressed="true"]::after {
  background: #e8c798;
}
.calendar-detail {
  border-top: 1px solid #deded1;
  margin-top: 18px;
  padding-top: 18px;
}
.calendar-detail-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.calendar-detail p {
  margin: 0;
  font-size: 14px;
}
#calendar-selected-lunar {
  margin-top: 10px;
  font-size: 12px;
  color: #7f8275;
}
.calendar-tag {
  padding: 3px 7px;
  border-radius: 4px;
  background: #e7ebdf;
  color: #507058;
  font-size: 10px;
}
.calendar-terms {
  margin: 18px 0 0;
  font-size: 12px;
  color: #566b55;
  line-height: 1.8;
}
.reading-verse {
  font-family: var(--poem-font);
  font-size: 21px;
  line-height: 1.9;
  letter-spacing: 0.08em;
  padding: 18px 0 23px;
  border-bottom: 1px solid #deded1;
  white-space: pre-line;
  color: #455848;
}
.sheet section {
  margin-top: 23px;
}
.sheet h3 {
  font-size: 11px;
  letter-spacing: 0.14em;
  color: #878878;
  font-weight: 500;
  margin: 0 0 10px;
}
.sheet section p {
  font-size: 14px;
  line-height: 1.9;
  margin: 0;
}
.original {
  background: #eeeee3;
  border-radius: 8px;
  padding: 18px 20px;
}
.original p {
  font-family: var(--poem-font);
  white-space: pre-line;
}
.sheet-foot {
  border-top: 1px solid #deded1;
  margin-top: 28px;
  padding-top: 17px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 10px;
  color: #868979;
}
.sheet-foot a {
  color: #566b55;
  text-underline-offset: 4px;
}
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 19px 0;
  border-bottom: 1px solid #deded1;
  cursor: pointer;
}
.setting-row strong {
  display: block;
  font-size: 14px;
  font-weight: 500;
}
.setting-row small {
  display: block;
  font-size: 11px;
  color: #818678;
  margin-top: 6px;
  line-height: 1.5;
}
.setting-row select {
  border: 1px solid #d8dbc9;
  border-radius: 7px;
  padding: 8px;
  background: #f9f7ef;
  color: #455848;
  font-size: 12px;
}
.switch {
  appearance: none;
  flex-shrink: 0;
  width: 38px;
  height: 22px;
  background: #d1d6c8;
  border-radius: 12px;
  position: relative;
  cursor: pointer;
  margin: 0;
  transition: background 0.2s;
}
.switch:after {
  content: "";
  width: 16px;
  height: 16px;
  border-radius: 50%;
  position: absolute;
  top: 3px;
  left: 3px;
  background: #fffdf6;
  transition: transform 0.2s;
  box-shadow: 0 1px 4px #0002;
}
.switch:checked {
  background: #657e62;
}
.switch:checked:after {
  transform: translateX(16px);
}
input[type="range"] {
  width: 130px;
  accent-color: #657e62;
  cursor: pointer;
}
.privacy-note {
  font-size: 11px;
  line-height: 1.9;
  color: #838779;
  margin: 23px 0 0;
}
.library-list {
  display: grid;
  gap: 10px;
  max-height: 46svh;
  overflow-y: auto;
}
.saved-quote {
  width: 100%;
  display: flex;
  align-items: center;
  text-align: left;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid #deded1;
  background: #f4f1e6;
  border-radius: 9px;
  padding: 16px 17px;
  color: #43523f;
}
.saved-quote:hover {
  background: #e8eddf;
}
.saved-quote strong {
  display: block;
  font-family: var(--poem-font);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.7;
}
.saved-quote small {
  font-size: 11px;
  display: block;
  color: #828576;
  margin-top: 5px;
}
.empty-library {
  font-family: var(--serif);
  text-align: center;
  line-height: 2;
  padding: 40px 10px;
  color: #8a8f7e;
}
.large-text h1 {
  font-size: clamp(36px, 4.2vw, 72px);
}
[hidden] {
  display: none !important;
}
@keyframes arrive {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (min-width: 1700px) {
  .page {
    padding: 50px 80px;
  }
  .poetry {
    padding-left: 5vw;
  }
}
@media (max-width: 800px) {
  .page {
    padding: 28px 30px;
  }
  .poetry {
    padding: 40px 0 50px;
  }
  .footer {
    align-items: flex-end;
  }
  .clock {
    font-size: 44px;
  }
  .tools {
    gap: 2px;
    padding: 5px 7px;
  }
  .tool {
    padding: 9px 10px;
  }
  .tool span {
    display: none;
  }
  .tool-divider {
    margin: 0 3px;
  }
  h1 {
    font-size: clamp(28px, 5vw, 42px);
  }
  .large-text h1 {
    font-size: clamp(32px, 6vw, 50px);
  }
  .brand-subtitle {
    font-size: 9px;
  }
}
@media (max-width: 480px) {
  .page {
    padding: 23px 22px;
  }
  .masthead {
    gap: 10px;
  }
  .brand {
    gap: 9px;
  }
  .seal {
    width: 33px;
    height: 38px;
    font-size: 22px;
  }
  .brand-name {
    font-size: 21px;
  }
  .brand-subtitle {
    letter-spacing: 0.06em;
  }
  .almanac {
    font-size: 10px;
    letter-spacing: 0.02em;
  }
  .poetry {
    padding: 45px 0;
  }
  h1 {
    font-size: 27px;
    letter-spacing: 0.07em;
  }
  .large-text h1 {
    font-size: 32px;
  }
  .byline {
    font-size: 11px;
    letter-spacing: 0.05em;
  }
  .clock {
    font-size: 36px;
  }
  .clock-wrap {
    min-height: 66px;
  }
  .clock-wrap > span {
    font-size: 9px;
    letter-spacing: 0.02em;
  }
  .tools {
    gap: 0;
    padding: 4px;
  }
  .tool {
    padding: 8px;
    min-height: 36px;
  }
  .tool .icon {
    width: 18px;
    height: 18px;
  }
  .icon-only {
    width: 34px;
  }
  .footer {
    gap: 8px;
  }
  .sheet {
    padding: 24px;
  }
  .inline-meaning {
    font-size: 12px;
  }
  .sheet-foot {
    font-size: 9px;
  }
  .toast {
    bottom: 106px;
  }
}
@media (max-width: 360px) {
  .calendar-toolbar {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 34px;
  }
  .calendar-selects {
    gap: 4px;
  }
  .calendar-toolbar .custom-select {
    padding-inline: 8px;
    gap: 8px;
  }
  #calendar-today {
    grid-column: 1 / -1;
    justify-self: end;
  }
}
@media (max-height: 650px) {
  .page {
    padding-top: 25px;
    padding-bottom: 25px;
  }
  .poetry {
    padding-top: 24px;
    padding-bottom: 28px;
  }
  h1 {
    font-size: 35px;
    line-height: 1.5;
  }
  .eyebrow {
    margin-bottom: 15px;
  }
  .byline {
    margin-top: 15px;
  }
  .reading-link {
    margin-top: 15px;
  }
  .clock {
    font-size: 40px;
  }
  .clock-wrap {
    min-height: 65px;
  }
  .inline-meaning {
    margin-top: 12px;
  }
  .large-text h1 {
    font-size: 42px;
  }
}
@media (hover: hover) and (pointer: fine) {
  .brand,
  .almanac,
  .reading-link,
  .clock-wrap,
  .tools {
    opacity: 0.45;
    transition: opacity 0.2s ease;
  }
  :is(.brand, .almanac, .reading-link, .clock-wrap, .tools):is(
    :hover,
    :focus-within
  ) {
    opacity: 1;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation: none !important;
    transition: none !important;
  }
}

.content-source {
  font-size: 10px;
  letter-spacing: 0.06em;
  opacity: 0.72;
  margin: 12px 0 0;
  max-width: 650px;
  line-height: 1.6;
}
.long-verse h1 {
  font-size: clamp(24px, 2.7vw, 42px);
  letter-spacing: 0.08em;
  overflow-wrap: anywhere;
}
@media (max-width: 800px) {
  .long-verse h1 {
    font-size: clamp(23px, 4vw, 32px);
  }
}
@media (max-height: 650px) {
  .long-verse h1 {
    font-size: 28px;
  }
}

.api-settings {
  padding-bottom: 16px;
  border-bottom: 1px solid #deded1;
}
.api-url-label {
  display: block;
  margin: 16px 0 8px;
  font-size: 13px;
}
#api-url {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  padding: 10px;
  border: 1px solid #d8dbc9;
  border-radius: 7px;
  background: #f9f7ef;
  color: #455848;
  font-size: 12px;
}
#api-provider {
  max-width: 55%;
}
#save-api {
  padding: 9px 14px;
  margin-top: 12px;
  background: #455848;
  color: #fffdf4;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
}
#save-api:disabled {
  opacity: 0.6;
  cursor: wait;
}
#api-status {
  overflow-wrap: anywhere;
}

#background-video {
  position: absolute;
  inset: 0;
}
/* Both media layers share the viewport while a video loads over its poster. */
#background-video { position: absolute; inset: 0; }
#media-button[aria-pressed="true"] { background: #fff9ed26; }
@media (max-width: 520px) { #media-button { font-size: 12px; padding-inline: 8px; } }
@media (max-width: 520px) {
  .footer { flex-direction: column; align-items: stretch; gap: 18px; }
  .tools { align-self: flex-end; flex-shrink: 0; opacity: 1; }
}
/* Keep controls crisp over moving artwork, including mobile compositors. */
.tools { backdrop-filter: none; background: #162326b3; opacity: 1; }
