:root {
  --responsive-rail: 78px;
  --responsive-bottom-nav: 66px;
  --responsive-safe-bottom: env(safe-area-inset-bottom, 0px);
  --responsive-safe-top: env(safe-area-inset-top, 0px);
  --responsive-page-pad: clamp(16px, 2.4vw, 34px);
}

html,
body,
#app {
  width: 100%;
  min-width: 0;
  min-height: 100%;
  height: auto;
}

html {
  scrollbar-gutter: stable;
}

body {
  overflow-x: hidden;
  overflow-y: auto;
}

body.has-modal {
  overflow: hidden;
}

.app-frame,
.primary-layout,
.secondary-layout {
  width: 100%;
  min-height: var(--app-vh, 100vh);
  height: auto;
  margin: 0;
}

.primary-layout {
  align-items: stretch;
}

.main-column,
.grass-area-shell .secondary-layout,
.v4-home-shell .main-column,
.v4-page-shell .main-column,
.forest-3d-column {
  min-height: var(--app-vh, 100vh);
  height: auto;
}

.sidebar,
.v4-home-shell .sidebar,
.forest-3d-shell .sidebar,
.v4-page-shell .sidebar {
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: var(--app-vh, 100vh);
  max-height: var(--app-vh, 100vh);
  overflow-y: auto;
}

.topbar,
.v4-home-shell .topbar,
.v4-page-shell .topbar,
.secondary-topbar {
  position: relative;
  z-index: 20;
}

.v4-home-shell .main-column,
.v4-page-shell .main-column,
.forest-3d-column,
.grass-area-shell .secondary-layout {
  overflow: visible;
}

.v4-home-content {
  min-height: max(610px, calc(var(--app-vh, 100vh) - 170px));
  overflow: visible;
}

.v4-home-stage {
  min-height: inherit;
}

.v4-home-render-shell {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #f2ede2;
}

.v4-mobile-home-preview,
.v4-mobile-photo,
.v4-mobile-detail-actions,
.responsive-editor-tabs,
.responsive-save-dock,
.mobile-welcome {
  display: none;
}

.v4-home-scene-wash {
  pointer-events: none;
}

.content,
.v4-search-page,
.v4-settings-page {
  min-height: 0;
}

.v4-search-page,
.v4-settings-page {
  height: auto;
  overflow: visible;
}

.v4-search-body,
.v4-settings-body {
  min-height: 0;
}

.v4-search-results,
.v4-settings-col {
  overflow: visible;
}

.grass-area-c {
  height: auto;
  min-height: calc(var(--app-vh, 100vh) - 88px);
}

.grass-recent-list {
  overflow: visible;
}

.forest-3d-page {
  min-height: calc(var(--app-vh, 100vh) - 86px);
}

.content.v4-detail-page {
  min-height: calc(var(--app-vh, 100vh) - 88px);
}

.v4-paper,
.v4-paper-body,
.v4-paper-mid {
  min-height: 0;
}

.v4-paper-body {
  overflow: visible;
}

.grass-area-canvas,
.forest-area-canvas,
.v4-home-canvas {
  touch-action: pan-y;
  overscroll-behavior: contain;
}

html[data-webgl="unsupported"] canvas {
  display: none !important;
}

html[data-webgl="unsupported"] .grass-area-loading,
html[data-webgl="unsupported"] .forest-area-loading,
html[data-webgl="unsupported"] .v4-home-loading {
  display: none !important;
}

.grass-stage-frame,
.forest-stage-frame,
.forest-3d-stage,
.v4-home-stage {
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.grass-area-shell:not(.water-area-shell) .grass-stage-frame {
  background-image: url("./assets/design-preview/grass-scene-background.png");
}

.water-area-shell .grass-stage-frame {
  background-image: url("./assets/design-preview/duck-scene-background.png");
}

.forest-3d-stage {
  background-image: url("./assets/design-preview/forest-scene-background.png");
}

.button,
.v4-btn,
.nav-item,
.icon-button,
.v4-icon-btn,
.v4-look-chip {
  min-height: 44px;
}

.icon-button,
.v4-icon-btn {
  min-width: 44px;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
[role="button"]:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(157, 85, 57, 0.48);
  outline-offset: 2px;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@media (max-width: 1199px) {
  .sidebar,
  .v4-home-shell .sidebar,
  .forest-3d-shell .sidebar,
  .v4-page-shell .sidebar {
    flex: 0 0 var(--responsive-rail);
    width: var(--responsive-rail);
    padding: 18px 10px;
    align-items: center;
  }

  .brand {
    justify-content: center;
    padding: 0;
  }

  .brand > span:last-child,
  .primary-nav .nav-item > span,
  .sidebar-footer {
    display: none;
  }

  .primary-nav {
    width: 100%;
    margin-top: 26px;
  }

  .nav-item {
    justify-content: center;
    width: 100%;
    min-height: 50px;
    padding: 0;
  }

  .v4-home-shell .primary-nav,
  .forest-3d-shell .primary-nav,
  .v4-page-shell .primary-nav {
    margin-top: 26px;
  }

  .v4-home-shell .nav-item,
  .forest-3d-shell .nav-item,
  .v4-page-shell .nav-item {
    height: 50px;
    padding: 0;
  }

  .topbar,
  .v4-home-shell .topbar,
  .v4-page-shell .topbar,
  .forest-3d-shell .topbar {
    height: 76px;
    flex-basis: 76px;
    padding: 0 20px;
  }

  .topbar-left,
  .v4-home-shell .topbar-left {
    min-width: 0;
  }

  .farm-identity {
    min-width: 0;
    gap: 8px;
  }

  .farm-identity strong {
    overflow: hidden;
    max-width: 220px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .v4-home-shell .primary-topbar-search,
  .forest-3d-shell .primary-topbar-search,
  .v4-page-shell .search-field--wide {
    width: min(340px, 42vw);
  }

  .v4-search-page,
  .v4-settings-page {
    min-height: calc(var(--app-vh, 100vh) - 76px);
    padding: 22px;
  }

  .v4-search-body,
  .v4-settings-body {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    gap: 14px;
  }

  .v4-rail {
    display: none;
  }

  .v4-search-col,
  .v4-settings-col {
    overflow: visible;
  }

  .v4-search-results {
    overflow: visible;
  }

  .v4-searchbar {
    position: sticky;
    z-index: 12;
    top: calc(var(--responsive-safe-top) + 8px);
    box-shadow: 0 10px 24px rgba(96, 79, 50, 0.14);
  }

  .v4-page-head {
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 18px;
  }

  .v4-page-head-side {
    flex-wrap: wrap;
  }

  .v4-area-option {
    min-height: 146px;
    grid-template-columns: 86px minmax(0, 1fr) 54px;
    padding: 14px 12px;
  }

  .v4-area-option::before {
    left: 98px;
  }

  .v4-area-animal-wrap {
    width: 86px;
  }

  .v4-area-animal {
    width: 88px;
    height: 112px;
  }

  .v4-area-title {
    font-size: 27px;
    white-space: nowrap;
  }

  .v4-area-count strong {
    font-size: 22px;
  }

  .v4-area-link {
    font-size: 11px;
  }

  .grass-area-c {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    gap: 16px;
    min-height: 0;
    height: auto;
    padding: 16px;
  }

  .grass-stage-frame {
    order: -1;
    min-height: clamp(300px, 50vh, 500px);
    margin: 0;
    border-radius: 22px;
  }

  .grass-notebook {
    min-height: 0;
    overflow: visible;
    padding: 22px;
    background: rgba(252, 248, 239, 0.98);
    border: 1px solid rgba(95, 91, 72, 0.13);
    border-radius: 22px;
  }

  .grass-recent-list {
    overflow: visible;
  }

  .grass-sidebar-actions {
    position: sticky;
    z-index: 10;
    bottom: calc(10px + var(--responsive-safe-bottom));
    padding-top: 12px;
    background: linear-gradient(180deg, rgba(252, 248, 239, 0), rgba(252, 248, 239, 0.98) 28%);
  }

  .forest-3d-column {
    overflow: visible;
  }

  .forest-3d-page {
    display: flex;
    min-height: 0;
    flex-direction: column;
    gap: 16px;
    padding: 18px;
  }

  .forest-3d-summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .forest-3d-summary-actions {
    flex-wrap: wrap;
  }

  .forest-3d-stage {
    min-height: clamp(300px, 48vh, 480px);
    border-radius: 22px;
  }

  .forest-3d-bottom {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

  .forest-recent-grid {
    grid-template-columns: 1fr;
  }

  .content.v4-detail-page {
    min-height: calc(var(--app-vh, 100vh) - 76px);
    padding: 18px;
    overflow: visible;
  }

  .v4-detail-grid {
    display: flex;
    min-height: 0;
    flex-direction: column;
    gap: 16px;
  }

  .v4-paper {
    min-height: 0;
    padding: 28px;
    border-radius: 24px;
  }

  .v4-detail-side {
    display: none;
  }

  .v4-mobile-photo {
    position: relative;
    display: flex;
    min-height: 240px;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin: 20px 0 4px;
    background: #f5ecd9;
    border: 1px solid rgba(125, 106, 77, 0.14);
    border-radius: 22px;
  }

  .v4-mobile-photo .animal-hero-img {
    width: min(82%, 340px);
    height: 230px;
    object-fit: contain;
  }

  .v4-mobile-detail-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
  }

  .v4-paper-title {
    font-size: clamp(30px, 5vw, 38px);
  }

  .v4-paper-text {
    font-size: 15px;
    line-height: 1.95;
  }

  .v4-editor-page {
    display: flex;
    min-height: calc(var(--app-vh, 100vh) - 76px);
    height: auto;
    flex-direction: column;
    gap: 16px;
    overflow: visible;
    padding: 18px;
  }

  .v4-editor-page .editor-main,
  .v4-editor-page .appearance-panel {
    min-height: 0;
    height: auto;
    overflow: visible;
  }

  .v4-editor-page .editor-main {
    padding: 24px;
  }

  .v4-editor-page .appearance-panel {
    padding: 24px;
  }

  .v4-editor-page .appearance-preview {
    max-width: 420px;
  }

  .editor-topbar-save,
  .detail-topbar-action {
    display: none;
  }

  .overlay {
    z-index: 120;
    align-items: flex-end;
    padding: 0;
  }

  .modal,
  .modal--large,
  .modal--small {
    width: 100%;
    max-height: min(88dvh, 780px);
    overflow-y: auto;
    border-radius: 24px 24px 0 0;
    padding-bottom: var(--responsive-safe-bottom);
  }

  .drawer-overlay {
    align-items: flex-end;
  }

  .drawer {
    width: 100%;
    max-height: 90dvh;
    border-left: 0;
    border-radius: 24px 24px 0 0;
    padding-bottom: var(--responsive-safe-bottom);
  }

  .modal-actions {
    position: sticky;
    bottom: 0;
    flex-wrap: wrap;
    padding: 12px 20px calc(12px + var(--responsive-safe-bottom));
    background: rgba(255, 253, 247, 0.98);
    border-top: 1px solid rgba(95, 91, 72, 0.12);
  }
}

@media (max-width: 767px) {
  .farm-welcome {
    position: fixed;
    width: 100vw;
    height: var(--app-vh, 100dvh);
    overflow: hidden;
    background: #0d161f;
  }

  .farm-welcome .stage {
    display: none;
  }

  .farm-welcome .mobile-welcome {
    /* 背景图按 cover 铺满时，画面实际显示宽度 = max(视口宽, 视口高 × 1170/2532)。
       start 牌等元素的尺寸/位置都按这个宽度换算，才能和背景图保持同一比例。 */
    --welcome-art-w: max(100vw, calc(var(--app-vh, 100dvh) * 0.462085));
    position: absolute;
    inset: 0;
    display: block;
    overflow: hidden;
    color: #fff8e8;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
  }

  .farm-welcome .mobile-welcome--day {
    background-image: url("./assets/welcome-mobile/day.png");
  }

  .farm-welcome .mobile-welcome--night {
    background-image: url("./assets/welcome-mobile/night.png");
  }

  .mobile-welcome-brand {
    position: absolute;
    top: calc(18px + var(--responsive-safe-top));
    left: 18px;
    padding: 8px 13px;
    color: #6b422c;
    background: rgba(255, 250, 238, 0.9);
    border: 1px solid rgba(106, 59, 33, 0.16);
    border-radius: 999px;
    box-shadow: 0 8px 20px rgba(20, 30, 28, 0.12);
    font-family: "STKaiti", "KaiTi", "Microsoft YaHei UI", sans-serif;
    font-size: 14px;
    font-weight: 700;
  }

  .mobile-welcome--night .mobile-welcome-brand {
    color: #fff0c9;
    background: rgba(16, 35, 47, 0.82);
    border-color: rgba(255, 240, 201, 0.24);
  }

  .mobile-welcome-theme {
    position: absolute;
    top: calc(18px + var(--responsive-safe-top));
    right: 18px;
    min-width: 96px;
    min-height: 44px;
    padding: 0 14px;
    color: #5d4d3c;
    background: rgba(255, 250, 239, 0.92);
    border: 1px solid rgba(106, 59, 33, 0.18);
    border-radius: 999px;
    box-shadow: 0 8px 20px rgba(20, 30, 28, 0.12);
    font-size: 12px;
    font-weight: 700;
  }

  .mobile-welcome--night .mobile-welcome-theme {
    color: #fff0c9;
    background: rgba(16, 35, 47, 0.84);
    border-color: rgba(255, 240, 201, 0.24);
  }

  .mobile-welcome-start {
    /* 背景画面里本身已经画好了 start 牌，这里只留一块透明的点击区，
       位置与大小按画面显示宽度等比换算，避免出现第二层按钮或外框卡片 */
    position: absolute;
    top: calc(50% + var(--welcome-art-w, 100vw) * 0.039);
    left: 50.3%;
    display: block;
    width: calc(var(--welcome-art-w, 100vw) * 0.22);
    min-height: 48px;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    transform: translate(-50%, -50%);
    cursor: pointer;
  }

  .mobile-welcome-start img {
    display: none;
  }

  .mobile-welcome-note {
    position: absolute;
    right: 22px;
    bottom: calc(34px + var(--responsive-safe-bottom));
    left: 22px;
    display: flex;
    align-items: center;
    flex-direction: column;
    gap: 7px;
    padding: 18px;
    color: #fff8e8;
    text-align: center;
    text-shadow: 0 2px 12px rgba(6, 14, 20, 0.35);
  }

  .mobile-welcome-note strong {
    font-family: "STKaiti", "KaiTi", "Microsoft YaHei UI", sans-serif;
    font-size: 24px;
    letter-spacing: 0.04em;
  }

  .mobile-welcome-note span {
    color: rgba(255, 248, 232, 0.82);
    font-size: 12px;
  }

  .sidebar,
  .v4-home-shell .sidebar,
  .forest-3d-shell .sidebar,
  .v4-page-shell .sidebar {
    position: fixed;
    z-index: 90;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    display: block;
    width: 100%;
    height: calc(var(--responsive-bottom-nav) + var(--responsive-safe-bottom));
    max-height: none;
    padding: 6px 8px calc(6px + var(--responsive-safe-bottom));
    overflow: visible;
    background: rgba(252, 249, 242, 0.97);
    border-top: 1px solid rgba(95, 91, 72, 0.16);
    border-right: 0;
    box-shadow: 0 -12px 28px rgba(73, 66, 49, 0.1);
    backdrop-filter: blur(18px);
  }

  .sidebar .brand,
  .sidebar .sidebar-footer {
    display: none;
  }

  .primary-nav,
  .v4-home-shell .primary-nav,
  .forest-3d-shell .primary-nav,
  .v4-page-shell .primary-nav {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    margin: 0;
  }

  .nav-item,
  .v4-home-shell .nav-item,
  .forest-3d-shell .nav-item,
  .v4-page-shell .nav-item {
    display: flex;
    height: 54px;
    min-height: 54px;
    flex-direction: column;
    gap: 2px;
    justify-content: center;
    border-radius: 12px;
    font-size: 10px;
  }

  .nav-item > span {
    display: block;
  }

  .sidebar ~ .main-column {
    min-height: calc(var(--app-vh, 100vh) - var(--responsive-bottom-nav));
    padding-bottom: calc(var(--responsive-bottom-nav) + var(--responsive-safe-bottom));
  }

  .has-secondary-nav .sidebar {
    display: none;
  }

  .has-secondary-nav .main-column {
    min-height: var(--app-vh, 100vh);
    padding-bottom: 0;
  }

  .topbar,
  .v4-home-shell .topbar,
  .v4-page-shell .topbar,
  .forest-3d-shell .topbar,
  .secondary-topbar {
    height: auto;
    min-height: 66px;
    flex: 0 0 auto;
    padding: max(8px, var(--responsive-safe-top)) 14px 8px;
  }

  .farm-identity .label,
  .shortcut,
  .v4-topbar-tag {
    display: none;
  }

  .farm-identity strong {
    max-width: 46vw;
    font-size: 17px;
  }

  .primary-topbar-search {
    width: 44px !important;
    min-width: 44px;
    justify-content: center;
    padding: 0 !important;
  }

  .primary-topbar-search > span {
    display: none;
  }

  .v4-page-shell .search-field--wide {
    display: none;
  }

  .secondary-title {
    min-width: 0;
    gap: 8px;
  }

  .secondary-title-copy {
    min-width: 0;
  }

  .secondary-title-copy strong {
    overflow: hidden;
    font-size: 20px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .secondary-actions {
    flex: 0 0 auto;
    gap: 6px;
  }

  .secondary-actions .button {
    min-width: 44px;
    padding: 0 11px;
    font-size: 12px;
  }

  .grass-header-signature {
    display: none;
  }

  .v4-home-content {
    min-height: 0;
  }

  .v4-home-stage {
    position: relative;
    display: flex;
    min-height: 0;
    flex-direction: column;
    gap: 14px;
    overflow: visible;
    padding: 18px 14px 22px;
    background: #f2ede2;
  }

  .v4-home-render-shell {
    position: relative;
    inset: auto;
    width: 100%;
    min-height: 235px;
    flex: 0 0 auto;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #e8dfcd;
    border: 1px solid rgba(125, 106, 77, 0.18);
    border-radius: 20px;
    box-shadow: 0 14px 28px rgba(96, 79, 50, 0.12);
  }

  .v4-mobile-home-preview {
    position: absolute;
    inset: 0;
    display: block;
    overflow: hidden;
    background: #e8dfcd;
  }

  .v4-mobile-home-preview img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .v4-home-canvas {
    position: absolute;
    z-index: 2;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    touch-action: pan-y;
  }

  .v4-home-scene-wash {
    z-index: 3;
    display: block;
    background: linear-gradient(180deg, rgba(250, 247, 239, 0.12), rgba(250, 247, 239, 0) 40%);
  }

  .v4-scene-tip {
    display: none;
  }

  .v4-home-loading {
    z-index: 4;
  }

  .v4-home-heading {
    position: static;
    width: auto;
    padding: 18px;
    background: rgba(253, 250, 242, 0.94);
    border: 1px solid rgba(125, 106, 77, 0.14);
    border-left: 3px solid rgba(63, 93, 69, 0.46);
    border-radius: 18px;
  }

  .v4-home-title-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .v4-home-title-row h1 {
    font-size: 32px;
  }

  .v4-home-meta {
    flex-direction: column;
    gap: 4px;
  }

  .v4-home-meta span {
    padding: 0;
    border: 0;
  }

  .v4-area-dock {
    position: static;
    display: grid;
    width: 100%;
    grid-template-columns: 1fr;
    gap: 14px;
    margin: 0;
  }

  .v4-area-option {
    min-height: 140px;
    grid-template-columns: 92px minmax(0, 1fr) 62px;
    padding: 14px;
    border-radius: 22px;
  }

  .v4-area-option::before {
    left: 105px;
  }

  .v4-area-animal-wrap {
    width: 92px;
  }

  .v4-area-animal {
    width: 94px;
    height: 118px;
  }

  .v4-area-link {
    justify-content: flex-start !important;
    min-width: 0;
    min-height: 44px;
    margin-left: 105px;
    overflow: hidden;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .v4-area-link svg {
    flex: 0 0 auto;
  }

  .v4-area-dock .v4-overview-number {
    margin-left: 0;
  }

  .v4-page-head {
    flex-direction: column;
    margin-bottom: 16px;
  }

  .v4-page-head-side {
    width: 100%;
  }

  .v4-search-page,
  .v4-settings-page {
    min-height: calc(var(--app-vh, 100vh) - 66px - var(--responsive-bottom-nav));
    padding: 16px;
  }

  .v4-searchbar {
    top: calc(var(--responsive-safe-top) + 4px);
    height: 56px;
    padding: 0 10px 0 14px;
    border-radius: 15px;
  }

  .v4-searchbar-hint,
  .v4-searchbar-sep {
    display: none;
  }

  .v4-searchbar input {
    font-size: 16px;
  }

  .v4-searchbar input::placeholder {
    font-size: 14px;
  }

  .v4-result {
    grid-template-columns: 52px minmax(0, 1fr);
    padding: 10px;
  }

  .v4-result-thumb {
    width: 52px;
    height: 52px;
  }

  .v4-tiles {
    grid-template-columns: 1fr;
  }

  .v4-danger-row {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  /* 农场身份：农场名始终在框内左侧垂直居中，不因窄屏被顶到上沿 */
  .v4-id-field {
    align-items: center;
    flex-wrap: nowrap;
    gap: 8px;
    padding-left: 14px;
  }

  .grass-area-c {
    padding: 12px;
  }

  .grass-stage-frame {
    min-height: 300px;
    border-radius: 18px;
  }

  .grass-stage-hint,
  .forest-stage-hint {
    display: none;
  }

  .grass-notebook {
    padding: 18px;
    border-radius: 18px;
  }

  .grass-heading-row h1 {
    font-size: 34px;
  }

  .grass-resident-card {
    grid-template-columns: 78px minmax(0, 1fr);
  }

  .grass-resident-card img {
    width: 78px;
    height: 76px;
  }

  .grass-sidebar-actions {
    bottom: calc(var(--responsive-bottom-nav) + 10px + var(--responsive-safe-bottom));
  }

  .grass-sidebar-actions .button {
    flex: 1;
  }

  .forest-3d-page {
    min-height: calc(var(--app-vh, 100vh) - 66px - var(--responsive-bottom-nav));
    padding: 14px;
  }

  .forest-3d-heading h1 {
    font-size: 34px;
  }

  .forest-3d-stage {
    min-height: 300px;
    border-radius: 18px;
  }

  .forest-3d-bottom {
    display: none;
  }

  .content.v4-detail-page {
    min-height: calc(var(--app-vh, 100vh) - 66px);
    padding: 12px;
  }

  .v4-paper {
    padding: 22px 18px;
    border-radius: 20px;
  }

  .v4-paper-title {
    font-size: 30px;
  }

  .v4-paper-meta {
    flex-wrap: wrap;
    row-gap: 4px;
  }

  .v4-mobile-photo {
    min-height: 210px;
  }

  .v4-mobile-photo .animal-hero-img {
    height: 195px;
  }

  .v4-paper-text {
    font-size: 15px;
    line-height: 1.9;
  }

  .v4-paper-foot,
  .v4-mobile-detail-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .v4-mobile-detail-actions .button {
    width: 100%;
  }

  .v4-editor-page {
    min-height: calc(var(--app-vh, 100vh) - 66px);
    padding: 12px 12px calc(82px + var(--responsive-safe-bottom));
  }

  .responsive-editor-tabs {
    position: sticky;
    z-index: 15;
    top: calc(var(--responsive-safe-top) + 4px);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    padding: 4px;
    background: rgba(246, 241, 229, 0.96);
    border: 1px solid rgba(125, 106, 77, 0.14);
    border-radius: 14px;
    backdrop-filter: blur(14px);
  }

  .responsive-editor-tabs button {
    min-height: 44px;
    background: transparent;
    border: 0;
    border-radius: 10px;
    color: #747b72;
    font-weight: 700;
  }

  .responsive-editor-tabs button.is-active {
    color: #9d5539;
    background: #fffaf0;
    box-shadow: 0 3px 10px rgba(96, 79, 50, 0.1);
  }

  .v4-editor-page[data-editor-tab="content"] [data-editor-pane="content"],
  .v4-editor-page[data-editor-tab="appearance"] [data-editor-pane="appearance"] {
    display: flex;
  }

  .v4-editor-page[data-editor-tab="content"] [data-editor-pane="appearance"],
  .v4-editor-page[data-editor-tab="appearance"] [data-editor-pane="content"] {
    display: none;
  }

  .v4-editor-page .editor-main,
  .v4-editor-page .appearance-panel {
    padding: 18px;
    border-radius: 18px;
  }

  .v4-editor-page .editor-fields {
    min-height: 360px;
  }

  .v4-editor-page .textarea--large {
    min-height: 250px;
  }

  .v4-editor-page .editor-footer .form-actions-right {
    display: none;
  }

  .responsive-save-dock {
    position: fixed;
    z-index: 35;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: calc(70px + var(--responsive-safe-bottom));
    padding: 10px 14px calc(10px + var(--responsive-safe-bottom));
    background: rgba(252, 249, 242, 0.98);
    border-top: 1px solid rgba(95, 91, 72, 0.16);
    box-shadow: 0 -10px 24px rgba(73, 66, 49, 0.1);
    backdrop-filter: blur(18px);
  }

  .responsive-save-dock > span {
    color: #7d837a;
    font-size: 11px;
  }

  .responsive-save-dock .button {
    min-width: 132px;
  }

  .v4-look-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .modal-header,
  .drawer-header {
    padding-top: 20px;
  }

  .modal-body {
    padding: 10px 20px 18px;
  }

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

  .drawer-list {
    padding-bottom: 12px;
  }

  .v4-row {
    grid-template-columns: 50px minmax(0, 1fr);
  }

  .v4-row .v4-reclaim {
    grid-column: 1 / -1;
    width: 100%;
    min-height: 44px;
  }

  input,
  textarea {
    font-size: 16px;
  }
}

@media (max-width: 419px) {
  .v4-area-link-secondary {
    display: none;
  }
}

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

@media (forced-colors: active) {
  .nav-item.is-active,
  .responsive-editor-tabs button.is-active {
    outline: 2px solid ButtonText;
  }
}
