:root {
  color-scheme: light;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --page: #f7f6ef;
  --paper: #fffef9;
  --ink: #293528;
  --muted: #656e5d;
  --line: #e5e5d9;
  --field: #354b30;
  --field-hover: #293e26;
  --field-soft: #edf1e5;
  --online: #4c8042;
  --amber: #9b641f;
  --danger: #963f34;
  --radius: 18px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100dvh; background: var(--page); color: var(--ink); }
h1, h2, h3, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .56; cursor: wait; }
:focus-visible { outline: 2px solid #627d48; outline-offset: 3px; }
.icon-library {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip-link {
  position: fixed;
  z-index: 3;
  inset: 8px auto auto 8px;
  transform: translateY(-200%);
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--field);
  color: white;
}
.skip-link:focus { transform: none; }
.icon {
  display: inline-block;
  flex: 0 0 auto;
  width: 19px;
  height: 19px;
  vertical-align: middle;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.farm-art {
  display: inline-block;
  flex: 0 0 auto;
  width: var(--art-size, 28px);
  height: var(--art-size, 28px);
  background: url("/images/farm-icons.webp") no-repeat;
  background-size: 400% 400%;
}
.art-sprout { background-position: 0 0; }
.art-farm { background-position: 33.3333% 0; }
.art-level { background-position: 66.6667% 0; }
.art-coins { background-position: 100% 0; }
.art-star { background-position: 0 33.3333%; }
.art-id { background-position: 33.3333% 33.3333%; }
.art-watering-can { background-position: 66.6667% 33.3333%; }
.art-shears { background-position: 100% 33.3333%; }
.art-bug { background-position: 0 66.6667%; }
.art-basket { background-position: 33.3333% 66.6667%; }
.art-seed { background-position: 66.6667% 66.6667%; }
.art-fertilizer { background-position: 100% 66.6667%; }
.art-task { background-position: 0 100%; }
.art-friends { background-position: 33.3333% 100%; }
.art-carrot { background-position: 66.6667% 100%; }
.art-envelope { background-position: 100% 100%; }

.site-header { border-bottom: 1px solid var(--line); background: var(--paper); }
.site-header-inner, .app { width: min(1280px, calc(100% - 88px)); margin-inline: auto; }
.site-header-inner {
  min-height: 70px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.brand, .modal-heading { display: flex; align-items: center; gap: 11px; }
.brand { font-family: "Songti SC", "Noto Serif CJK SC", SimSun, serif; font-size: 25px; font-weight: 800; letter-spacing: .06em; }
.brand-mark, .account-icon, .stat-icon, .modal-icon, .empty-mark {
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.brand-mark { --art-size: 30px; width: 39px; height: 39px; border-radius: 12px; background: #e9eee0; }
.connection, .hero-status, .status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
}
.connection { color: var(--muted); white-space: nowrap; }
.dot { flex: 0 0 7px; width: 7px; height: 7px; border-radius: 50%; background: #868c7f; }
.dot.online, .connection[data-state="online"] .dot { background: var(--online); }
.dot.connecting, .connection[data-state="connecting"] .dot { background: #b57628; }

.app { padding-block: 29px 48px; }
.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  min-height: 256px;
  overflow: hidden;
  border: 1px solid #e7dfc6;
  border-radius: 24px;
  background: #f7edcf;
}
.hero-art {
  position: absolute;
  z-index: -1;
  inset: 0 0 0 24%;
  background: url("/images/farm-hero.jpg") center 40% / cover no-repeat;
  mask-image: linear-gradient(90deg, transparent 0%, #000 44%);
}
.hero-copy { padding: 34px 5%; }
.hero h1 {
  color: #293f29;
  font-family: "Songti SC", "Noto Serif CJK SC", SimSun, serif;
  font-size: clamp(45px, 4.25vw, 66px);
  font-weight: 900;
  letter-spacing: .018em;
  line-height: 1.1;
}
.hero-copy > p { margin-top: 15px; color: #4f5842; font-size: 14px; line-height: 1.65; }
.hero-status {
  margin-top: 24px;
  min-height: 29px;
  padding: 4px 10px;
  border: 1px solid #e7ddbf;
  border-radius: 7px;
  background: #fcf8e8;
  color: var(--field);
  font-variant-numeric: tabular-nums;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(196px, 248px) minmax(0, 1fr);
  align-items: start;
  gap: 24px;
  margin-top: 28px;
}
.rail { padding: 17px 13px 13px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.rail-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 0 5px 14px; }
.rail-head h2 { font-size: 14px; font-weight: 700; }
.account-count {
  min-width: 24px;
  padding: 2px 5px;
  border-radius: 6px;
  background: #f1f1e9;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.account-list { display: grid; gap: 7px; }
.account {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 63px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--paper);
  text-align: left;
  transition: background 150ms, border-color 150ms;
}
.account:hover { border-color: #b8c4a5; }
.account.active { border-color: #d2ddc6; background: var(--field-soft); }
.account-icon { --art-size: 27px; width: 36px; height: 36px; border-radius: 9px; background: #e7eada; }
.account-name { display: block; overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.account-sub { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin-top: 3px; color: var(--muted); font-size: 11px; }
.account-sub .dot { width: 6px; height: 6px; flex-basis: 6px; }
.account-arrow { width: 13px; height: 13px; color: #647653; }
.rail-empty { padding: 4px 5px 8px; color: var(--muted); font-size: 13px; }

.detail { min-width: 0; }
.profile, .control, .placeholder-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}
.profile { overflow: hidden; }
.profile-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 89px;
  gap: 12px;
  padding: 16px 21px;
}
.profile-info { display: flex; align-items: center; gap: 12px; min-width: 0; }
.profile-info .account-icon { --art-size: 35px; width: 45px; height: 45px; border-radius: 12px; background: #e9eee0; }
.profile-name { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 9px; }
.profile-name h2 { font-size: 23px; font-weight: 700; line-height: 1.25; letter-spacing: -.025em; overflow-wrap: anywhere; }
.profile-meta { margin-top: 4px; color: var(--muted); font-size: 12px; }
.status { padding: 4px 8px; border-radius: 6px; color: var(--muted); background: #f0f0e9; white-space: nowrap; }
.status[data-state="online"] { background: #ecf3e5; color: #3d6235; }
.status[data-state="connecting"] { background: #fbefd9; color: #87551e; }
.profile-actions { display: grid; grid-template-columns: repeat(2, 1fr); flex-shrink: 0; gap: 8px; }
.profile-actions .button { height: 40px; min-width: 100px; white-space: nowrap; }

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  background: #fafaf3;
  border-top: 1px solid var(--line);
}
.stat {
  display: grid;
  grid-template-columns: auto minmax(0,1fr);
  align-items: center;
  gap: 10px;
  padding: 15px 17px;
  border-inline-start: 1px solid var(--line);
}
.stat:first-child { border-inline-start: 0; }
.stat-icon { --art-size: 30px; width: 37px; height: 37px; border-radius: 10px; background: #ecf0e2; }
.stat-icon.coins { background: #f5ecd6; }
.stat-icon.star { background: #f5e9db; }
.stat-icon.id { background: #eeeee7; }
.stat dt { color: var(--muted); font-size: 12px; }
.stat dd { margin: 2px 0 0; font: 700 21px/1.14 "Avenir Next", sans-serif; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat:last-child dd { font-size: 16px; }

.control { margin-top: 16px; min-width: 0; container-type: inline-size; }
.tabs {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(66px, 1fr);
  gap: 8px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: thin;
}
.tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  padding: 0 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 150ms, color 150ms;
}
.tab .icon { width: 17px; height: 17px; }
.tab .farm-art { --art-size: 20px; }
.tab:hover { color: var(--field); background: #f5f6ee; }
.tab[aria-selected="true"] { color: var(--field); background: var(--field-soft); }
.tab:focus-visible { outline-offset: -2px; }

@container (max-width: 600px) {
  .tab :is(.icon, .farm-art) { display: none; }
}

.settings-layout { display: grid; grid-template-columns: minmax(0, 1.27fr) minmax(0, 1fr); }
.settings-section { min-width: 0; padding: 20px 21px 22px; }
.params { border-inline-start: 1px solid var(--line); background: #fbfbf5; border-bottom-right-radius: var(--radius); }
.section-title { margin-bottom: 4px; font-size: 16px; font-weight: 700; }
.section-copy { color: var(--muted); font-size: 12px; line-height: 1.6; }
.switch-group { margin: 17px 0 0; padding: 0; border: 0; min-width: 0; }
.switch-group legend { margin-bottom: 7px; padding: 0; color: var(--muted); font-size: 12px; font-weight: 600; }
.switches { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px 12px; }
.switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  min-height: 40px;
  padding: 5px 8px;
  border: 1px solid #ecece1;
  border-radius: 8px;
  background: #fbfbf6;
  text-align: left;
  font-size: 12px;
  transition: background 150ms, border-color 150ms;
}
.switch:hover { border-color: #bccaaa; background: #f6f8f0; }
.switch-label { --art-size: 24px; display: flex; align-items: center; gap: 7px; }
.switch-track {
  position: relative;
  flex: 0 0 27px;
  width: 27px;
  height: 16px;
  border-radius: 10px;
  background: #d6d8cd;
  transition: background 150ms;
}
.switch-track::after {
  content: "";
  position: absolute;
  inset: 2px auto auto 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgb(41 53 40 / 15%);
  transition: transform 150ms;
}
.switch[aria-checked="true"] .switch-track { background: #517748; }
.switch[aria-checked="true"] .switch-track::after { transform: translateX(11px); }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 11px; margin: 17px 0 15px; }
.form-grid label { display: grid; gap: 6px; min-width: 0; font-size: 12px; font-weight: 600; color: #54614e; }
.form-grid .wide-field { grid-column: 1 / -1; }
.form-grid input {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 7px 9px;
  border: 1px solid #dddfd2;
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.form-grid input::placeholder { color: #757a6c; }
.form-grid input[aria-invalid="true"] { border-color: var(--danger); }
.field-message { color: var(--danger); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }

.farm-workspace { padding: 19px 21px 22px; }
.farm-panel-head, .farm-tools, .farm-summary, .farm-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.farm-panel-head { justify-content: space-between; margin-bottom: 15px; }
.farm-panel-head .section-title { margin-bottom: 0; }
.farm-tools .button { min-height: 34px; }
.farm-summary, .farm-filters { margin-bottom: 10px; }
.farm-run-count { margin-bottom: 4px; }
.farm-chip { display: inline-flex; gap: 6px; align-items: center; border-radius: 6px; background: #eeefe7; color: #5a6355; padding: 4px 7px; font-size: 11px; }
.farm-chip[data-land-state="ready"] { background: #e7efdd; color: #3d6235; }
.farm-chip[data-land-state="growing"] { background: #f8ecd4; color: #754e20; }
.farm-chip[data-land-state="dead"] { background: #f6e9e4; color: var(--danger); }
.farm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 130px), 1fr)); gap: 9px; margin-top: 12px; }
.farm-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfbf4;
  padding: 10px;
  color: var(--ink);
  font-size: 13px;
  overflow-wrap: anywhere;
}
.farm-tile[data-land-state="ready"] { border-color: #d2dec4; background: #f1f5e9; }
.farm-tile[data-land-state="locked"] { background: #f4f3eb; color: var(--muted); }
.farm-tile:has(input:checked) { border-color: var(--field); box-shadow: inset 0 0 0 1px var(--field); }
.farm-tile-top { display: flex; align-items: center; justify-content: space-between; align-self: stretch; min-height: 20px; gap: 5px; }
.farm-tile small, .farm-task small { color: var(--muted); font-size: 11px; }
.farm-tile .farm-art { --art-size: 32px; }
.inventory-art {
  display: block;
  width: 32px;
  height: 32px;
  background: url("/images/inventory-icons.webp") 0 0 / 200% 200% no-repeat;
}
.inventory-art img { display: block; object-fit: contain; visibility: hidden; }
.inventory-art.has-image { background: none; }
.inventory-art.has-image img { visibility: visible; }
.farm-tile input { width: 15px; height: 15px; margin: 0; accent-color: var(--field); }
.farm-tile .button { min-height: 30px; margin-top: auto; padding-inline: 8px; font-size: 11px; }
.farm-filter { padding: 6px 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); font-size: 12px; }
.farm-filter[aria-pressed="true"] { border-color: var(--field); color: white; background: var(--field); }
.farm-task-list { display: grid; gap: 8px; }
.farm-task { display: flex; justify-content: space-between; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.farm-task > div { display: grid; justify-items: start; gap: 7px; min-width: 0; overflow-wrap: anywhere; }
.farm-task strong { font-size: 14px; }
.farm-task .button { flex-shrink: 0; }
.farm-task progress { width: min(200px, 100%); height: 8px; accent-color: var(--field); }
.farm-empty { margin-top: 8px; padding: 17px 13px; border: 1px dashed var(--line); border-radius: 9px; color: var(--muted); font-size: 13px; }

.log-panel { padding: 20px 21px; }
.log-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 12px; }
.log {
  min-height: 170px;
  max-height: 390px;
  overflow: auto;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f9faf3;
}
.log-line {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: baseline;
  gap: 8px;
  padding: 7px 0;
  color: #364635;
  border-bottom: 1px solid #eaede1;
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.log-line time { color: var(--muted); font: 11px "SF Mono", Menlo, monospace; }
.log-line[data-level="warn"] { color: #855619; }
.log-line[data-level="error"] { color: var(--danger); }
.log-line:last-child { border-bottom: 0; }
.log-empty { padding: 21px 3px; color: var(--muted); font-size: 13px; }
.account-footer { display: flex; justify-content: flex-end; margin-top: 8px; }

.button, .icon-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 7px 12px;
  border: 1px solid #dfe2d5;
  border-radius: 9px;
  background: var(--paper);
  color: #435640;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.3;
  transition: background 150ms, border-color 150ms, transform 150ms;
}
.button .icon, .icon-button .icon { width: 16px; height: 16px; }
.button:not(:disabled):hover, .icon-button:not(:disabled):hover { border-color: #bdc9b4; background: #f1f4eb; }
.button:not(:disabled):active, .icon-button:not(:disabled):active { transform: translateY(1px); }
.button.primary { border-color: var(--field); background: var(--field); color: #fffef3; }
.button.primary:not(:disabled):hover { border-color: var(--field-hover); background: var(--field-hover); }
.button.danger { border-color: transparent; background: transparent; color: var(--danger); }
.button.danger:not(:disabled):hover { border-color: #ead6d0; background: #f9ede9; }
.button.danger-solid { border-color: var(--danger); background: var(--danger); color: #fffaf6; }
.button.danger-solid:not(:disabled):hover { border-color: #783126; background: #783126; }
.icon-button { width: 36px; min-height: 36px; padding: 0; }
#add-account { width: 100%; min-height: 40px; margin-bottom: 9px; }

.placeholder-card { padding: 38px 24px 42px; text-align: center; }
.placeholder-card h2 { margin-top: 13px; font-size: 20px; }
.placeholder-card p { margin-top: 8px; color: var(--muted); font-size: 13px; line-height: 1.65; }
.placeholder-card .button { margin-top: 17px; }
.empty-mark { --art-size: 42px; width: 56px; height: 56px; margin: 0 auto; border-radius: 17px; background: var(--field-soft); color: #557446; }
.empty-mark .icon { width: 29px; height: 29px; }
.loading-line { display: block; width: 126px; height: 11px; margin: 0 auto 9px; border-radius: 5px; background: #e9ebdf; }
.loading-line + .loading-line { width: 88px; }

.notice {
  position: fixed;
  z-index: 2;
  inset: auto 24px 20px auto;
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: min(420px, calc(100% - 48px));
  padding: 11px 14px;
  border: 1px solid #cfdbc3;
  border-radius: 10px;
  background: #f1f6ea;
  color: #365636;
  box-shadow: 0 8px 28px rgb(51 68 41 / 11%);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.notice[data-state="error"] { border-color: #ead0c7; background: #fff4ed; color: var(--danger); }
.notice span { min-width: 0; }
.notice .button { flex-shrink: 0; white-space: nowrap; }

.modal {
  width: min(424px, calc(100% - 24px));
  max-height: calc(100dvh - 24px);
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 14px 65px rgb(27 43 26 / 18%);
}
.modal::backdrop { background: rgb(28 42 25 / 44%); }
.modal-layout { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; max-height: calc(100dvh - 26px); }
.modal-header, .modal-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 17px; }
.modal-header { border-bottom: 1px solid var(--line); }
.modal-heading h2 { font-size: 17px; }
.modal-icon { width: 37px; height: 37px; border-radius: 10px; background: var(--field-soft); color: var(--field); }
.modal-icon.danger-icon { background: #f8ebe6; color: var(--danger); }
.modal-body { min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 19px 17px; color: var(--muted); font-size: 14px; line-height: 1.65; }
.modal-body p { overflow-wrap: anywhere; }
.modal-footer { justify-content: flex-end; border-top: 1px solid var(--line); }
#delete-error { margin-top: 8px; }
.qr-body { text-align: center; }
.qr-stage {
  display: grid;
  place-items: center;
  width: min(226px, 100%);
  aspect-ratio: 1;
  margin: 0 auto 12px;
  padding: 10px;
  border: 1px dashed #cdd6bf;
  border-radius: 12px;
  background: #f3f5eb;
}
.qr-stage[data-state="ready"] { background: white; border-style: solid; }
.qr-stage[data-state="error"] { background: #fbf2ea; border-color: #e2cbb9; color: var(--danger); }
.qr-placeholder { width: 40px; height: 40px; color: #748268; }
.qr-stage[data-state="ready"] .qr-placeholder { display: none; }
#wx-qr { display: block; width: 100%; height: 100%; object-fit: contain; }
#wx-status { min-height: 1.65em; }
#wx-status[data-state="error"] { color: var(--danger); }

@media (max-width: 1100px) {
  .site-header-inner, .app { width: calc(100% - 48px); }
  .workspace { grid-template-columns: minmax(172px, 205px) minmax(0, 1fr); gap: 16px; }
  .switches { gap: 5px 6px; }
  .settings-section { padding-inline: 15px; }
  .stat { padding-inline: 11px; }
}
@media (max-width: 910px) {
  .settings-layout { grid-template-columns: 1fr; }
  .params { border-inline-start: 0; border-top: 1px solid var(--line); border-bottom-left-radius: var(--radius); }
  .stat { grid-template-columns: minmax(0, 1fr); gap: 5px; }
  .stat-icon { --art-size: 26px; width: 32px; height: 32px; border-radius: 8px; }
  .stat dd { font-size: 19px; }
}
@media (max-width: 680px) {
  .site-header-inner, .app { width: calc(100% - 28px); }
  .site-header-inner { min-height: 61px; gap: 8px; }
  .brand { gap: 7px; font-size: 22px; }
  .brand-mark { --art-size: 26px; width: 33px; height: 33px; border-radius: 9px; }
  .connection { font-size: 10px; }
  #add-account { min-height: 44px; }
  .app { padding-block: 15px 30px; }
  .hero { align-items: start; min-height: 258px; border-radius: 18px; }
  .hero-copy { padding: 19px 17px 106px; }
  .hero h1 { font-size: 43px; }
  .hero-copy > p { max-width: 20em; margin-top: 8px; font-size: 13px; }
  .hero-status { margin-top: 12px; }
  .hero-art { inset: 19% 0 0 0; background-position: 55% 57%; mask-image: linear-gradient(180deg, transparent 0%, #000 66%); }
  .workspace { grid-template-columns: 1fr; gap: 12px; margin-top: 15px; }
  .rail { padding: 12px 10px 10px; }
  .rail-head { padding: 0 1px 9px; }
  .account-list { grid-template-columns: repeat(auto-fit, minmax(min(100%, 156px), 1fr)); }
  .account { min-height: 53px; padding: 6px 7px; }
  .profile-head { flex-wrap: wrap; gap: 13px; padding: 13px; }
  .profile-name h2 { font-size: 20px; }
  .profile-actions .button { height: 44px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { grid-template-columns: auto minmax(0, 1fr); gap: 8px; padding: 10px; }
  .stat:nth-child(3) { border-inline-start: 0; }
  .stat:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .tabs { padding-inline: 10px; }
  .settings-section, .log-panel { padding: 15px 12px; }
  .button, .switch { min-height: 44px; }
  .notice { inset: auto 10px 10px 10px; max-width: none; }
}

@media (max-width: 520px) {
  .tabs { padding: 7px 9px; gap: 6px; }
  .tab { min-height: 39px; padding-inline: 7px; font-size: 12px; }
  .farm-workspace { padding: 13px 11px 16px; }
  .farm-tools { gap: 5px; }
  .farm-tools .button { min-height: 44px; padding-inline: 8px; }
}

.farm-tools.bag-tools .button { min-height: 34px; padding: 4px 9px; }

.header-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 10px 14px; }
.license-expiry { color: var(--muted); font-size: 12px; }
.license-signout.button { min-height: 33px; padding: 4px 10px; font-size: 12px; }
.access-panel { display: grid; justify-items: center; padding-block: clamp(40px, 9vh, 100px); }
.access-card { width: min(100%, 430px); overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: var(--paper); }
.access-art { display: block; height: 150px; background: url("/images/farm-hero.jpg") 70% 55% / cover no-repeat; }
.access-body { padding: clamp(20px, 5vw, 32px); }
.access-body h1 { margin: 0 0 18px; font-size: 25px; }
#access-form { display: grid; gap: 10px; }
#access-form label { color: var(--muted); font-size: 13px; font-weight: 700; }
#access-form input {
  min-height: 43px;
  width: 100%;
  padding-inline: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
}
.access-status { margin: 9px 0 0; font-size: 13px; color: var(--muted); }
.access-status:empty { display: none; }
#access-retry { margin-top: 10px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
