@layer vendor, foundation, priority;
@layer foundation {
  /* Source: style.css */
  :root {
    --forest: #173d32;
    --forest-2: #245343;
    --sage: #dfe8dc;
    --mint: #edf3eb;
    --cream: #f8f7f1;
    --paper: #fffefb;
    --ink: #1c3029;
    --muted: #728078;
    --line: #e6e9e1;
    --amber: #dfaa55;
    --red: #b34d43;
    --shadow: 0 12px 36px rgba(23, 61, 50, 0.08);
    --radius: 18px;
    font-family:
      ui-sans-serif,
      system-ui,
      -apple-system,
      BlinkMacSystemFont,
      "Segoe UI",
      sans-serif;
    color: var(--ink);
    background: var(--cream);
    font-synthesis: none;
    text-rendering: optimizeLegibility;
  }
  * {
    box-sizing: border-box;
  }
  body {
    margin: 0;
    min-width: 320px;
    min-height: 100vh;
    background: var(--cream);
  }
  button,
  input,
  select,
  textarea {
    font: inherit;
  }
  button {
    color: inherit;
    cursor: pointer;
  }
  button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
  }
  a {
    color: inherit;
    text-decoration: none;
  }
  .boot {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--muted);
    font-weight: 600;
  }
  
  .shell {
    min-height: 100vh;
  }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 248px;
    background: var(--forest);
    color: #f9f8ef;
    padding: 25px 17px 15px;
    display: flex;
    flex-direction: column;
    z-index: 4;
  }
  .brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 9px;
  }
  
  .brand b {
    display: block;
    font-size: 18px;
    font-family: Georgia, serif;
    letter-spacing: -0.3px;
  }
  .brand small {
    display: block;
    font-size: 9px;
    letter-spacing: 2.1px;
    color: #afc3b5;
    margin-top: 2px;
  }
  .operation {
    margin: 28px 8px 16px;
    padding: 11px 12px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 11px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: #d4e0d7;
  }
  
  .sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  .nav-item {
    height: 46px;
    display: flex;
    align-items: center;
    gap: 13px;
    width: 100%;
    border: 0;
    background: transparent;
    color: #c4d3c9;
    border-radius: 11px;
    padding: 0 12px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    transition: 0.16s;
  }
  .nav-item i {
    font-style: normal;
    width: 21px;
    text-align: center;
    font-size: 18px;
    font-weight: 500;
  }
  .nav-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
  }
  .nav-item.active {
    background: #e8eee4;
    color: var(--forest);
  }
  
  
  
  
  
  
  
  
  .main {
    margin-left: 248px;
    min-height: 100vh;
  }
  .topbar {
    height: 70px;
    padding: 0 clamp(24px, 4vw, 60px);
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 254, 251, 0.8);
  }
  
  
  
  .content {
    max-width: 1440px;
    margin: 0 auto;
    padding: 38px clamp(24px, 4vw, 60px) 70px;
  }
  .page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 22px;
    margin-bottom: 27px;
  }
  .page-heading h1 {
    font:
      700 clamp(28px, 3.2vw, 38px)/1.12 Georgia,
      serif;
    letter-spacing: -0.8px;
    margin: 7px 0 8px;
    color: var(--forest);
  }
  .page-heading p {
    margin: 0;
  }
  .eyebrow {
    display: block;
    font-size: 9px;
    line-height: 1.35;
    font-weight: 800;
    letter-spacing: 1.8px;
    color: #7e9081;
  }
  .muted {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
  }
  .small-copy {
    font-size: 11px;
    margin: 1px 0;
  }
  .heading-actions {
    display: flex;
    gap: 9px;
    align-items: center;
    flex-wrap: wrap;
  }
  .button {
    min-height: 44px;
    padding: 0 16px;
    border-radius: 11px;
    border: 1px solid transparent;
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    transition:
      background 0.16s,
      border 0.16s,
      transform 0.16s;
    white-space: nowrap;
  }
  .button:hover:not(:disabled) {
    transform: translateY(-1px);
  }
  .button-primary {
    background: var(--forest);
    color: white;
    box-shadow: 0 4px 10px rgba(23, 61, 50, 0.1);
  }
  .button-primary:hover {
    background: #245342;
  }
  .button-secondary {
    background: #fffefb;
    border-color: #dce3d9;
    color: var(--forest);
  }
  .button-secondary:hover,
  .button-quiet:hover {
    border-color: #a9b9a9;
    background: #f3f6f0;
  }
  .button-quiet {
    background: transparent;
    color: #5b6e61;
    border-color: transparent;
  }
  .button.full {
    width: 100%;
  }
  .text-button {
    border: 0;
    background: none;
    color: var(--forest-2);
    font-size: 12px;
    font-weight: 700;
    padding: 7px 2px;
  }
  .text-button:hover {
    text-decoration: underline;
  }
  .icon-button {
    width: 40px;
    height: 40px;
    display: inline-grid;
    place-items: center;
    border: 0;
    background: transparent;
    border-radius: 10px;
    color: #587062;
    font-size: 18px;
  }
  .icon-button:hover {
    background: var(--mint);
  }
  
  .quick-action {
    height: 54px;
    min-width: 154px;
    border: 1px solid var(--line);
    background: var(--paper);
    border-radius: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 2px 4px rgba(23, 61, 50, 0.02);
  }
  .quick-action:hover {
    border-color: #bccbbd;
    box-shadow: var(--shadow);
  }
  .quick-action > span {
    width: 28px;
    height: 28px;
    border-radius: 9px;
    background: var(--mint);
    color: var(--forest);
    display: grid;
    place-items: center;
    font-size: 18px;
  }
  .quick-action > b {
    margin-left: auto;
    color: #829187;
    font-size: 16px;
  }
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  .panel {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 23px;
    box-shadow: 0 2px 5px rgba(23, 61, 50, 0.025);
    min-width: 0;
  }
  .panel h2 {
    font:
      700 19px/1.25 Georgia,
      serif;
    color: var(--forest);
    margin: 6px 0 0;
    letter-spacing: -0.2px;
  }
  .panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 17px;
  }
  
  
  
  .event-row b {
    font-size: 12px;
  }
  .event-row small {
    display: block;
    color: #89938c;
    font-size: 10px;
    margin-top: 4px;
  }
  
  .record-dot {
    flex: 0 0 31px;
    width: 31px;
    height: 31px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: #edf2e9;
    color: #53735d;
    font-weight: 700;
  }
  .task-list {
    border-top: 1px solid #eff0eb;
  }
  
  .picker input,
  .check-row input {
    accent-color: var(--forest);
    width: 18px;
    height: 18px;
  }
  
  
  
  
  .event-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 0;
    border-top: 1px solid #eff0eb;
  }
  .event-row > span:last-child {
    min-width: 0;
  }
  .date-block {
    flex: 0 0 43px;
    height: 47px;
    border-radius: 9px;
    background: #f5efe2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #675838;
  }
  .date-block b {
    font:
      700 17px Georgia,
      serif;
  }
  .date-block small {
    font-size: 8px;
    letter-spacing: 1px;
  }
  .stat-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: #e3e8df;
    border: 1px solid #e3e8df;
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 17px;
  }
  .stat-strip > div {
    background: #f2f4ed;
    padding: 13px 17px;
  }
  .stat-strip span,
  .stat-strip b {
    display: block;
  }
  .stat-strip span {
    font-size: 10px;
    color: #77857b;
    font-weight: 600;
  }
  .stat-strip b {
    font:
      700 20px Georgia,
      serif;
    color: var(--forest);
    margin-top: 5px;
  }
  .cattle-panel {
    padding: 0;
    overflow: hidden;
  }
  .cattle-tools {
    padding: 16px;
    display: flex;
    gap: 9px;
    align-items: center;
    border-bottom: 1px solid var(--line);
    flex-wrap: wrap;
  }
  .searchbox {
    height: 43px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 11px;
    border: 1px solid #dfe4dc;
    background: #fff;
    border-radius: 10px;
    flex: 1;
    min-width: 210px;
    color: #8a998f;
  }
  .searchbox > span {
    font-size: 21px;
  }
  .searchbox input {
    border: 0;
    outline: 0;
    min-width: 0;
    flex: 1;
    font-size: 12px;
  }
  .searchbox kbd {
    font-size: 9px;
    background: #f2f4ef;
    padding: 4px 6px;
    border-radius: 4px;
    color: #89958c;
  }
  .cattle-tools select,
  .modal select,
  .preset-step select {
    min-height: 43px;
    border: 1px solid #dfe4dc;
    background: #fff;
    border-radius: 10px;
    padding: 0 30px 0 10px;
    color: #475d50;
    font-size: 11px;
    max-width: 190px;
  }
  .table-wrap {
    overflow: auto;
  }
  table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
  }
  th {
    text-align: left;
    background: #fafaf7;
    color: #849187;
    text-transform: uppercase;
    font-size: 9px;
    letter-spacing: 1px;
    padding: 13px 12px;
    font-weight: 800;
  }
  td {
    padding: 12px;
    border-top: 1px solid #eff0eb;
    font-size: 11px;
    color: #57665d;
  }
  tbody tr {
    cursor: pointer;
  }
  tbody tr:hover {
    background: #fbfcf8;
  }
  td:first-child,
  th:first-child {
    padding-left: 19px;
  }
  td:last-child,
  th:last-child {
    padding-right: 17px;
  }
  .animal-cell {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .animal-cell b,
  .animal-cell small {
    display: block;
  }
  .animal-cell b {
    color: #32493b;
    font-size: 12px;
  }
  .animal-cell small {
    margin-top: 3px;
    color: #8d9890;
    font-size: 10px;
  }
  .animal-avatar {
    width: 36px;
    height: 36px;
    border-radius: 11px;
    background: #efe7d8;
    display: grid;
    place-items: center;
    font-size: 18px;
  }
  .animal-avatar.large {
    width: 62px;
    height: 62px;
    font-size: 31px;
    border-radius: 17px;
  }
  .status {
    display: inline-flex;
    padding: 5px 8px;
    border-radius: 20px;
    background: #e9f1e8;
    color: #497257;
    font-size: 9px;
    font-weight: 800;
    text-transform: capitalize;
  }
  .status-sold {
    background: #f7eee0;
    color: #956c28;
  }
  .status-deceased,
  .status-removed {
    background: #f5e9e7;
    color: #9f5049;
  }
  .status-archived {
    background: #eceeeb;
    color: #6e7971;
  }
  .empty-state {
    padding: 50px 24px;
    text-align: center;
    color: var(--muted);
  }
  
  .empty-state h3 {
    font:
      700 19px Georgia,
      serif;
    color: var(--forest);
    margin: 6px 0;
  }
  .empty-state p {
    max-width: 390px;
    margin: 0 auto 18px;
    font-size: 12px;
    line-height: 1.6;
  }
  .work-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(260px, 0.8fr);
    gap: 15px;
  }
  
  
  
  .preset-list {
    margin: 5px 0 16px;
  }
  .preset-row {
    width: 100%;
    border: 0;
    border-top: 1px solid #dce5dc;
    padding: 12px 3px;
    background: none;
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
  }
  .preset-row > span:first-child {
    width: 31px;
    height: 31px;
    display: grid;
    place-items: center;
    background: white;
    border-radius: 9px;
    color: var(--forest);
  }
  .preset-row > span:nth-child(2) {
    flex: 1;
  }
  .preset-row b,
  .preset-row small {
    display: block;
  }
  .preset-row b {
    font-size: 11px;
  }
  .preset-row small {
    font-size: 9px;
    color: var(--muted);
    margin-top: 3px;
  }
  .preset-row i {
    font-style: normal;
    color: var(--muted);
  }
  .record-list {
    border-top: 1px solid #eef0eb;
  }
  
  
  
  
  
  
  
  .pasture-overview {
    padding: 0;
    overflow: hidden;
    margin-bottom: 16px;
  }
  .pasture-map {
    height: 210px;
    position: relative;
    overflow: hidden;
    background: #dce5d2;
  }
  
  
  
  
  .pasture-cards {
    padding: 15px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
  }
  .pasture-card {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 14px;
    background: #fff;
  }
  
  
  
  
  
  .pasture-card h3 {
    font:
      700 17px Georgia,
      serif;
    color: var(--forest);
    margin: 12px 0 4px;
  }
  .pasture-card p {
    min-height: 15px;
    margin: 0;
    font-size: 10px;
    color: #87928a;
  }
  
  
  
  
  .group-card {
    padding: 0;
    overflow: hidden;
  }
  
  
  
  
  
  .group-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
  }
  .group-heading h2 {
    margin: 5px 0 0;
  }
  
  
  .wide {
    grid-column: 1/-1;
  }
  .finance-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
  }
  
  
  
  
  
  
  
  
  .finance-strip b {
    font-size: 18px;
  }
  .finance-columns {
    margin-top: 15px;
  }
  .settings-panel {
    padding: 0 22px;
  }
  .settings-section {
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 1px solid #eff0eb;
  }
  .settings-section:last-child {
    border: 0;
  }
  .settings-section h2 {
    font:
      700 16px Georgia,
      serif;
    margin: 0 0 5px;
    color: var(--forest);
  }
  .settings-section p {
    margin: 0;
    font-size: 11px;
  }
  
  
  
  
  
  .more-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .more-link {
    display: flex;
    align-items: center;
    gap: 13px;
    min-height: 82px;
    text-align: left;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: var(--paper);
    padding: 14px;
  }
  .more-link:hover {
    border-color: #bdcbbd;
    box-shadow: var(--shadow);
  }
  .more-icon {
    flex: 0 0 43px;
    height: 43px;
    background: var(--mint);
    border-radius: 12px;
    display: grid;
    place-items: center;
    color: var(--forest);
    font-size: 21px;
  }
  .more-link span:nth-child(2) {
    flex: 1;
  }
  .more-link b,
  .more-link small {
    display: block;
  }
  .more-link b {
    font:
      700 15px Georgia,
      serif;
    color: var(--forest);
  }
  .more-link small {
    font-size: 10px;
    color: var(--muted);
    margin-top: 5px;
  }
  .more-link i {
    font-style: normal;
    color: #839087;
  }
  .feature-panel {
    padding: 4px 22px;
  }
  .feature-row {
    min-height: 68px;
    border-bottom: 1px solid #eff0eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    position: relative;
  }
  .feature-row:last-child {
    border: 0;
  }
  .feature-row b,
  .feature-row small {
    display: block;
  }
  .feature-row b {
    font-size: 12px;
  }
  .feature-row small {
    font-size: 10px;
    color: var(--muted);
    margin-top: 4px;
  }
  .feature-row input {
    position: absolute;
    right: 0;
    opacity: 0;
    width: 46px;
    height: 28px;
    z-index: 2;
    cursor: pointer;
  }
  .toggle {
    width: 42px;
    height: 24px;
    background: #d9dfd7;
    border-radius: 14px;
    position: relative;
    transition: 0.2s;
    flex: 0 0 42px;
  }
  .toggle:after {
    content: "";
    position: absolute;
    left: 3px;
    top: 3px;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 1px 4px #0002;
    transition: 0.2s;
  }
  .feature-row input:checked + .toggle {
    background: var(--forest-2);
  }
  .feature-row input:checked + .toggle:after {
    transform: translateX(18px);
  }
  
  .check-row {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 43px;
    font-size: 12px;
    color: #43594b;
  }
  .below-link {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 5px;
  }
  .bottom-nav {
    display: none;
  }
  .modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10;
    background: rgba(19, 39, 31, 0.5);
    backdrop-filter: blur(4px);
    display: grid;
    place-items: center;
    padding: 20px;
  }
  .modal {
    width: min(560px, 100%);
    max-height: min(90vh, 850px);
    background: var(--paper);
    border-radius: 20px;
    box-shadow: 0 24px 80px #10291f40;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modal-in 0.16s ease-out;
  }
  @keyframes modal-in {
    from {
      opacity: 0.6;
      transform: translateY(7px) scale(0.99);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }
  .modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 23px 16px;
    border-bottom: 1px solid #eff0eb;
  }
  .modal-head h2 {
    font:
      700 22px Georgia,
      serif;
    color: var(--forest);
    margin: 5px 0 0;
  }
  .modal-body {
    padding: 19px 23px;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 13px;
  }
  .modal-body > label,
  .modal-body label:not(.check-row):not(.picker-row):not(.feature-row) {
    display: flex;
    flex-direction: column;
    gap: 7px;
    font-size: 11px;
    font-weight: 700;
    color: #53675a;
  }
  .modal input:not([type="checkbox"]):not([type="hidden"]),
  .modal textarea {
    min-height: 43px;
    width: 100%;
    padding: 10px 11px;
    border: 1px solid #dfe4dc;
    border-radius: 9px;
    background: #fff;
    color: var(--ink);
    outline: 0;
    font-size: 12px;
    font-weight: 400;
  }
  .modal textarea {
    resize: vertical;
    min-height: 65px;
  }
  .modal input:focus,
  .modal textarea:focus,
  .modal select:focus {
    border-color: #88a28d;
    box-shadow: 0 0 0 3px #dae6d9;
  }
  .modal-foot {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    padding: 13px 23px max(15px, env(safe-area-inset-bottom));
    border-top: 1px solid #eff0eb;
    background: #fffefb;
  }
  .form-divider {
    border-top: 1px solid #e9ece5;
    padding-top: 13px;
    margin-top: 3px;
    color: #708076;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    font-size: 9px;
    font-weight: 800;
  }
  .picker {
    border: 1px solid #e4e8e1;
    border-radius: 12px;
    padding: 10px 11px;
    margin: 0;
    min-width: 0;
  }
  .picker legend {
    font-size: 11px;
    font-weight: 700;
    color: #53675a;
    padding: 0 4px;
  }
  .picker-tools {
    display: flex;
    gap: 16px;
    margin-bottom: 5px;
  }
  .picker-tools .text-button {
    font-size: 10px;
  }
  .picker-list {
    max-height: 190px;
    overflow: auto;
  }
  .picker-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 43px;
    border-top: 1px solid #f0f1ed;
  }
  .picker-row b,
  .picker-row small {
    display: block;
  }
  .picker-row b {
    font-size: 11px;
  }
  .picker-row small {
    font-size: 9px;
    color: var(--muted);
    margin-top: 3px;
  }
  
  
  
  .profile-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    border: 1px solid #e9ede6;
    border-radius: 12px;
    overflow: hidden;
  }
  .detail-cell {
    padding: 12px;
    border-right: 1px solid #e9ede6;
    border-bottom: 1px solid #e9ede6;
    min-width: 0;
  }
  .detail-cell small,
  .detail-cell b {
    display: block;
  }
  .detail-cell small {
    font-size: 9px;
    color: #829087;
    margin-bottom: 5px;
  }
  .detail-cell b {
    font-size: 11px;
    overflow-wrap: anywhere;
  }
  .profile-actions {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
    margin-top: 13px;
  }
  .profile-actions .button {
    font-size: 10px;
    padding: 0 11px;
  }
  .profile-history h3 {
    font:
      700 16px Georgia,
      serif;
    margin: 20px 0 8px;
    color: var(--forest);
  }
  .history-item {
    display: flex;
    gap: 9px;
    align-items: center;
    padding: 9px 0;
    border-top: 1px solid #eff0eb;
  }
  .history-item b,
  .history-item small {
    display: block;
  }
  .history-item b {
    font-size: 10px;
  }
  .history-item small {
    font-size: 9px;
    color: var(--muted);
    margin-top: 4px;
  }
  .action-list {
    display: grid;
    gap: 8px;
  }
  .action-tile {
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
    border: 1px solid var(--line);
    background: white;
    border-radius: 12px;
    padding: 12px;
    font-size: 19px;
    color: var(--forest);
  }
  .action-tile:hover {
    background: var(--mint);
  }
  .action-tile span b,
  .action-tile span small {
    display: block;
  }
  .action-tile span b {
    font-size: 12px;
  }
  .action-tile span small {
    font-size: 10px;
    color: var(--muted);
    margin-top: 4px;
  }
  .profile-history .muted {
    font-size: 11px;
  }
  .step-card {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px;
    background: #f5f6f1;
    border-radius: 10px;
  }
  .step-number {
    width: 24px;
    height: 24px;
    border-radius: 8px;
    background: #e0e9dd;
    display: grid;
    place-items: center;
    font-size: 10px;
    font-weight: 800;
    color: var(--forest);
  }
  .step-card b,
  .step-card small {
    display: block;
  }
  .step-card b {
    font-size: 11px;
  }
  .step-card small {
    font-size: 9px;
    color: var(--muted);
    margin-top: 3px;
  }
  .callout {
    padding: 11px;
    background: #f8f3e7;
    color: #79663e;
    font-size: 10px;
    line-height: 1.5;
    border-radius: 9px;
    margin: 0;
  }
  .profit-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 13px 0;
  }
  .profit-summary > div {
    background: #f4f6f0;
    padding: 11px;
    border-radius: 10px;
  }
  .profit-summary small,
  .profit-summary b {
    display: block;
  }
  .profit-summary small {
    font-size: 9px;
    color: var(--muted);
  }
  .profit-summary b {
    font-size: 13px;
    color: var(--forest);
    margin-top: 5px;
  }
  
  .draw-map {
    height: 160px;
    border: 1px solid #d9e3d7;
    border-radius: 12px;
    overflow: hidden;
    cursor: crosshair;
  }
  
  
  
  
  
  .map-search {
    display: flex;
    gap: 8px;
  }
  .map-search input {
    flex: 1;
  }
  .map-status {
    font-size: 10px;
    color: #76857a;
    min-height: 15px;
  }
  .preset-step {
    display: grid;
    grid-template-columns: 120px 1fr 1fr;
    gap: 7px;
  }
  .preset-step input {
    min-width: 0;
  }
  .toast {
    position: fixed;
    left: 50%;
    bottom: 25px;
    z-index: 30;
    padding: 12px 17px;
    background: var(--forest);
    color: white;
    border-radius: 11px;
    box-shadow: 0 8px 24px #122e2444;
    font-size: 12px;
    font-weight: 600;
    opacity: 0;
    transform: translate(-50%, 10px);
    pointer-events: none;
    transition: 0.2s;
    max-width: min(90vw, 500px);
  }
  .toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
  }
  .toast.error {
    background: #963f38;
  }
  
  
  
  
  
  
  
  
  
  
  
  
  
  .text-button[data-auth-toggle] {
    padding: 0;
  }
  
  
  
  
  
  
  
  
  
  
  .fence {
    position: absolute;
    z-index: 1;
    bottom: 19%;
    right: 3%;
    color: #596d52;
    font-size: 25px;
    letter-spacing: 11px;
    transform: rotate(-4deg);
    opacity: 0.8;
  }
  
  
  
  @media (max-width: 1050px) {
    .sidebar {
      width: 218px;
    }
    .main {
      margin-left: 218px;
    }
    .content {
      padding-left: 27px;
      padding-right: 27px;
    }
    
    
    .stat-strip > div {
      padding: 12px;
    }
    .work-layout {
      grid-template-columns: 1fr;
    }
    
    
    
    
    .preset-list {
      margin: 0;
    }
  }
  @media (max-width: 760px) {
    body {
      background: #f8f8f3;
    }
    .sidebar {
      display: none;
    }
    .main {
      margin: 0;
      padding-bottom: 76px;
    }
    .topbar {
      height: 59px;
      padding: 0 17px;
      background: #fffefb;
    }
    
    
    
    
    
    
    .content {
      padding: 25px 16px 28px;
    }
    .page-heading {
      align-items: flex-start;
      flex-direction: column;
      gap: 15px;
      margin-bottom: 20px;
    }
    .page-heading h1 {
      font-size: 32px;
    }
    .heading-actions {
      width: 100%;
    }
    .heading-actions .button {
      flex: 1;
      padding: 0 10px;
    }
    
    .quick-action {
      height: 49px;
      min-width: 0;
      padding: 0 9px;
      gap: 7px;
      font-size: 10px;
    }
    .quick-action > span {
      width: 26px;
      height: 26px;
    }
    .quick-action > b {
      font-size: 14px;
    }
    
    
    
    
    
    .finance-columns {
      grid-template-columns: 1fr;
      gap: 10px;
    }
    
    .panel {
      padding: 17px;
      border-radius: 15px;
    }
    .panel h2 {
      font-size: 18px;
    }
    .panel-head {
      margin-bottom: 13px;
    }
    .content > .panel + .panel {
      margin-top: 12px;
    }
    .stat-strip {
      grid-template-columns: repeat(2, 1fr);
      margin-bottom: 12px;
    }
    .stat-strip > div {
      padding: 11px 13px;
    }
    .stat-strip b {
      font-size: 18px;
    }
    .cattle-panel {
      padding: 0;
    }
    .cattle-tools {
      padding: 11px;
      gap: 7px;
    }
    .searchbox {
      flex-basis: 100%;
      min-width: 100%;
    }
    .searchbox kbd {
      display: none;
    }
    .cattle-tools select {
      flex: 1;
      max-width: none;
      min-width: 100px;
    }
    .cattle-tools .button {
      height: 39px;
      min-height: 39px;
    }
    .table-wrap table {
      min-width: 650px;
    }
    .bottom-nav {
      height: calc(62px + env(safe-area-inset-bottom));
      display: flex;
      align-items: stretch;
      position: fixed;
      inset: auto 0 0;
      z-index: 6;
      background: rgba(255, 254, 251, 0.97);
      border-top: 1px solid #e4e9e1;
      padding: 5px 4px env(safe-area-inset-bottom);
      box-shadow: 0 -6px 20px #1b43310a;
    }
    .bottom-nav button {
      flex: 1;
      border: 0;
      background: transparent;
      color: #7b8b80;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 2px;
      min-width: 0;
    }
    .bottom-nav button i {
      font-size: 18px;
      font-style: normal;
      line-height: 1;
    }
    .bottom-nav button span {
      font-size: 8px;
      font-weight: 700;
    }
    .bottom-nav button.active {
      color: var(--forest);
    }
    .bottom-nav button.active i {
      background: #e9f0e6;
      width: 37px;
      height: 25px;
      border-radius: 12px;
      display: grid;
      place-items: center;
    }
    .bottom-nav button.active span {
      color: var(--forest);
    }
    .modal-backdrop {
      padding: 0;
      align-items: end;
    }
    .modal {
      width: 100%;
      max-height: 93vh;
      border-radius: 20px 20px 0 0;
      padding-bottom: env(safe-area-inset-bottom);
    }
    .modal-head {
      padding: 17px 18px 13px;
    }
    .modal-head h2 {
      font-size: 20px;
    }
    .modal-body {
      padding: 16px 18px;
      gap: 12px;
    }
    .modal-foot {
      padding: 11px 18px max(12px, env(safe-area-inset-bottom));
    }
    .modal-foot .button {
      flex: 1;
    }
    .profile-actions .button {
      flex: 1;
    }
    .pasture-map {
      height: 165px;
    }
    .pasture-cards {
      padding: 10px;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
    }
    .pasture-card {
      padding: 11px;
    }
    .pasture-card h3 {
      font-size: 15px;
    }
    
    
    .more-grid {
      grid-template-columns: 1fr;
    }
    
    
    
    
    
    .preset-list {
      margin: 5px 0 12px;
    }
    
    
    
    .settings-panel {
      padding: 0 14px;
    }
    .settings-section {
      min-height: 88px;
      gap: 9px;
    }
    .settings-section h2 {
      font-size: 14px;
    }
    .settings-section p {
      font-size: 10px;
    }
    .settings-section .button {
      font-size: 9px;
      padding: 0 9px;
      min-height: 39px;
    }
    
    .profit-summary {
      grid-template-columns: repeat(2, 1fr);
    }
    .preset-step {
      grid-template-columns: 1fr;
    }
    
    
    
    
    
    
    .toast {
      bottom: calc(75px + env(safe-area-inset-bottom));
      font-size: 11px;
    }
    .below-link {
      flex-direction: column;
    }
    .page-heading .muted {
      max-width: 450px;
    }
    .profile-grid {
      grid-template-columns: 1fr 1fr;
    }
  }
  @media (max-width: 380px) {
    .content {
      padding-left: 12px;
      padding-right: 12px;
    }
    .page-heading h1 {
      font-size: 29px;
    }
    .button {
      font-size: 10px;
    }
    .heading-actions .button {
      white-space: normal;
    }
    .quick-action {
      font-size: 9px;
    }
    .quick-action > span {
      width: 23px;
      height: 23px;
    }
    .panel {
      padding: 14px;
    }
    .pasture-cards {
      grid-template-columns: 1fr;
    }
    .modal-body {
      padding-left: 14px;
      padding-right: 14px;
    }
    .profile-actions {
      display: grid;
      grid-template-columns: 1fr 1fr;
    }
  }
  .offline-banner {
    padding: 7px 16px;
    background: #f6eddc;
    color: #80673b;
    text-align: center;
    font-size: 10px;
    font-weight: 700;
  }
  .map-canvas {
    border-radius: 12px;
  }
  .map-tools {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    padding: 7px 3px;
  }
  .map-tools button {
    min-height: 36px;
    border: 1px solid #dfe5dc;
    background: #fff;
    border-radius: 8px;
    padding: 0 9px;
    color: #375543;
    font-size: 10px;
    font-weight: 700;
  }
  .map-instruction {
    font-size: 10px;
    color: #76857a;
    margin: 3px 0;
  }
  .coordinate-search {
    align-items: end;
  }
  .coordinate-search > label {
    flex: 1;
    min-width: 90px;
  }
  .coordinate-search .button {
    align-self: flex-end;
  }
  .multi-row {
    display: grid;
    grid-template-columns: 26px 1fr 1fr;
    gap: 7px;
    align-items: center;
  }
  .multi-row > b {
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    background: #eef3eb;
    border-radius: 7px;
    font-size: 10px;
    color: #59715f;
  }
  .picker-row > span {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .picker-row .animal-avatar {
    width: 29px;
    height: 29px;
    flex: 0 0 29px;
    border-radius: 8px;
    font-size: 14px;
  }
  .animal-avatar {
    background-repeat: no-repeat;
    background-color: #efe7d8;
    background-position: center;
    background-size: cover;
  }
  .animal-avatar.large {
    background-color: #efe7d8;
  } /* Shared workflow editors and smallest phone widths. */
  body {
    min-width: 280px;
  }
  .setup-checklist {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border: 1px solid #dce3d9;
    border-radius: 14px;
    background: #edf2e8;
    margin-bottom: 22px;
  }
  .setup-checklist span {
    flex: 1;
    min-width: 160px;
    color: #5e6c62;
  }
  .search-result {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 52px;
    width: 100%;
    text-align: left;
    border: 0;
    border-bottom: 1px solid #e6e9e1;
    background: transparent;
    padding: 10px;
  }
  .search-result small {
    display: block;
    color: #647368;
  }
  
  
  
  
  .profile-section {
    padding: 20px 0;
    border-top: 1px solid #e4e8df;
  }
  .profile-section h3 {
    margin-bottom: 10px;
  }
  
  .picker-search {
    width: 100%;
    margin-bottom: 8px;
  }
  .picker .picker-row[hidden] {
    display: none !important;
  }
  .allocation-editor,
  .animal-override,
  .optional-dates {
    padding: 12px 0;
    border-top: 1px solid #e4e8df;
  }
  summary {
    cursor: pointer;
    min-height: 44px;
    display: flex;
    align-items: center;
    font-weight: 600;
  }
  #allocation-rows {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .step-override {
    padding: 12px;
    border: 1px solid #e3e8df;
    border-radius: 10px;
    margin: 10px 0;
  }
  .preset-management {
    margin-top: 22px;
  }
  .preset-manage-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    border-top: 1px solid #e4e8df;
  }
  .herd-section td {
    background: #edf2e8;
    font-weight: 700;
    color: #2c4635;
  }
  .map-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px;
  }
  .map-tools button {
    min-height: 44px;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #dbe2d7;
    background: #fafbf7;
  }
  .draw-map {
    min-height: 300px;
    overflow: hidden;
  }
  .map-instruction {
    padding: 10px;
    font-size: 13px;
  }
  .leaflet-container {
    z-index: 0;
  }
  .check-row .icon-button {
    margin-left: auto;
  }
  .check-row .icon-button + .icon-button {
    margin-left: 0;
  }
  .modal-body details[hidden] {
    display: none !important;
  }
  .modal-body .feature-row {
    justify-content: space-between;
  }
  .modal-body .feature-row span {
    text-align: left;
  }
  .profit-summary {
    flex-wrap: wrap;
  }
  .profit-summary > div {
    min-width: 130px;
  }
  
  @media (max-width: 600px) {
    
    
    
    .preset-step {
      flex-direction: column;
      align-items: stretch;
    }
    .preset-step input,
    .preset-step select {
      width: 100%;
    }
    .multi-row input:last-child {
      grid-column: 2;
    }
    
    
    
    
    .cattle-tools {
      gap: 8px;
    }
    .cattle-tools select {
      min-height: 44px;
    }
    
  }
  @media (max-width: 360px) {
    #allocation-rows {
      grid-template-columns: 1fr;
    }
    
  }
  .cattle-mobile-list {
    display: none;
  }
  .mobile-animal {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 8px;
    border-top: 1px solid #e4e9df;
  }
  .mobile-animal-info {
    flex: 1;
    min-width: 0;
  }
  .mobile-animal-info b,
  .mobile-animal-info small {
    display: block;
    overflow-wrap: anywhere;
  }
  .mobile-animal-info small {
    color: #65766a;
    font-size: 12px;
    line-height: 1.5;
  }
  .select-hit {
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .select-hit input {
    width: 23px;
    height: 23px;
  }
  .cattle-mobile-list .animal-avatar {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
  }
  .topbar {
    overflow: hidden;
  }
  @media (max-width: 640px) {
    .cattle-panel .table-wrap {
      display: none;
    }
    .cattle-mobile-list {
      display: block;
    }
    .cattle-tools {
      display: flex;
      flex-wrap: wrap;
    }
    .cattle-tools .searchbox {
      width: 100%;
      flex: 1 0 100%;
    }
    .cattle-tools select {
      flex: 1 1 120px;
      min-width: 0;
    }
    .cattle-panel {
      overflow: hidden;
    }
    .stat-strip {
      overflow: auto;
    }
    .stat-strip > div {
      min-width: 80px;
    }
    .profile-actions {
      flex-wrap: wrap;
    }
    
    .mobile-animal {
      cursor: pointer;
    }
  }
  @media (max-width: 360px) {
    .cattle-mobile-list .animal-avatar {
      width: 38px;
      height: 48px;
    }
    .mobile-animal {
      gap: 7px;
    }
    .select-hit {
      min-width: 34px;
    }
  }
  .coordinate-search {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .coordinate-search > label {
    min-width: 0;
  }
  .coordinate-search input {
    width: 100%;
    min-width: 0;
  }
  .coordinate-search .button {
    grid-column: 1/-1;
  }
  .map-search > input {
    min-width: 0;
    flex: 1;
    width: 0;
  }
  .modal-body {
    overflow-x: hidden;
  }
  .mobile-herd-section {
    font-size: 13px;
    color: #375543;
    margin: 18px 4px 6px;
  }
  .setup-steps {
    display: grid;
    gap: 8px;
    flex: 1;
    min-width: 180px;
  }
  .setup-steps button {
    text-align: left;
    min-height: 44px;
  } /* Usability pass: quieter summaries, progressive filters, stable dialogs. */
  :root {
    --radius: 16px;
    --shadow: 0 5px 22px rgba(23, 61, 50, 0.045);
  }
  button:focus-visible,
  a:focus-visible,
  summary:focus-visible {
    outline: 3px solid #a9bc90;
    outline-offset: 3px;
  }
  input:focus,
  select:focus,
  textarea:focus {
    border-color: #63846f;
    box-shadow: 0 0 0 3px #edf3eb;
  }
  body.modal-open {
    overflow: hidden;
  }
  .shell[inert] {
    pointer-events: none;
  }
  .modal-head .eyebrow {
    display: none;
  }
  .modal-head h2 {
    font-size: 25px;
    outline: none;
  }
  .modal-backdrop {
    backdrop-filter: blur(3px);
  }
  .modal {
    max-height: 90dvh;
  }
  .modal-body {
    overscroll-behavior: contain;
  }
  .modal-body label {
    font-size: 13px;
  }
  .modal-body input,
  .modal-body select,
  .modal-body textarea {
    font-size: 16px;
    min-height: 46px;
  }
  .modal-body input[type="checkbox"] {
    min-height: 20px;
  }
  .modal-foot {
    gap: 12px;
  }
  .modal-foot .button {
    min-height: 46px;
  }
  .form-error {
    padding: 12px 14px;
    border-radius: 10px;
    background: #fff0ec;
    color: #91443b;
    line-height: 1.5;
    font-size: 14px;
    margin: 0 0 18px;
  }
  .topbar {
    height: 62px;
  }
  .page-heading {
    margin-bottom: 22px;
  }
  .page-heading h1 {
    font-size: 32px;
  }
  .page-heading p {
    font-size: 14px;
    max-width: 48ch;
  }
  .eyebrow {
    font-size: 10px;
    letter-spacing: 1.3px;
  }
  .muted {
    line-height: 1.55;
  }
  .button {
    min-height: 44px;
    font-size: 13px;
  }
  .icon-button {
    min-width: 44px;
    min-height: 44px;
  }
  .content {
    padding-top: 28px;
  }
  .panel {
    box-shadow: none;
  }
  
  
  
  
  
  
  .quick-action {
    flex: 1;
    min-width: 120px;
    min-height: 50px;
    padding: 12px;
  }
  .quick-action span:last-child {
    display: none;
  }
  
  .panel-head {
    padding: 20px;
  }
  .panel-head h2 {
    font-size: 21px;
  }
  
  .event-row small {
    font-size: 12px;
  }
  .sidebar {
    overflow-y: auto;
  }
  
  .nav-item {
    min-height: 44px;
  }
  
  .cattle-tools {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
  }
  .cattle-tools .searchbox {
    flex: 1;
    min-width: 0;
  }
  .herd-filters {
    flex: 0 0 auto;
    border: none;
  }
  .herd-filters > summary {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0 14px;
    min-height: 46px;
    font-size: 13px;
    background: var(--paper);
    list-style: none;
  }
  .herd-filters > summary::after {
    content: "⌄";
    margin-left: 12px;
  }
  .herd-filters[open] > summary::after {
    content: "⌃";
  }
  .herd-filters .filter-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--paper);
    margin-top: 8px;
  }
  .herd-filters[open] {
    flex: 1;
  }
  .filter-grid select {
    width: 100%;
    min-width: 0;
    font-size: 13px;
    min-height: 44px;
  }
  .selection-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    background: #e9f0e5;
    border: 1px solid #cedec4;
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 14px;
    font-size: 13px;
  }
  .selection-bar > b {
    margin-right: auto;
  }
  .cattle-panel th {
    font-size: 11px;
  }
  .cattle-panel td {
    font-size: 13px;
  }
  .mobile-animal {
    min-height: 86px;
  }
  .mobile-animal small {
    font-size: 12px;
  }
  .below-link {
    font-size: 12px;
  }
  .profile-section summary,
  .profile-history summary {
    font-size: 15px;
  }
  .profile-grid {
    margin-bottom: 16px;
  }
  .profile-section {
    padding: 16px 0;
  }
  .profile-section p {
    font-size: 14px;
  }
  .picker-tools {
    display: flex;
    gap: 16px;
  }
  .picker-list {
    max-height: 230px;
  }
  .picker-row {
    min-height: 52px;
  }
  .picker-row small {
    font-size: 12px;
  }
  @media (max-width: 1100px) {
    
    .cattle-tools {
      flex-wrap: wrap;
    }
    .cattle-tools .searchbox {
      flex: 1 1 60%;
    }
    .herd-filters[open] {
      flex: 1 1 100%;
    }
  }
  @media (max-width: 640px) {
    .page-heading {
      align-items: flex-start;
      gap: 14px;
      flex-wrap: wrap;
    }
    .page-heading h1 {
      font-size: 30px;
    }
    .page-heading p {
      font-size: 13px;
    }
    .heading-actions {
      gap: 8px;
      flex-wrap: wrap;
    }
    
    
    .quick-action {
      min-width: 100px;
      padding: 10px;
    }
    .cattle-tools {
      padding: 12px;
      gap: 8px;
    }
    .cattle-tools .searchbox {
      flex: 1 1 60%;
    }
    .herd-filters[open] {
      flex: 1 1 100%;
    }
    .selection-bar {
      padding: 12px;
      gap: 8px;
    }
    .selection-bar > b {
      width: 100%;
      font-size: 13px;
    }
    .modal {
      max-height: 94dvh;
      border-radius: 18px;
    }
    .modal-head {
      padding: 18px;
    }
    .modal-head h2 {
      font-size: 24px;
    }
    
    
    .mobile-animal .select-hit {
      min-width: 44px;
      min-height: 44px;
      display: grid;
      place-items: center;
    }
    .bottom-nav {
      padding-bottom: max(8px, env(safe-area-inset-bottom));
    }
    
    .sidebar {
      display: none;
    }
    
    
    .setup-checklist {
      gap: 8px;
    }
    .setup-steps {
      min-width: 0;
      width: 100%;
    }
  }
  .modal-head,
  .modal-foot {
    flex: 0 0 auto;
  }
  #modal-form {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
  }
  .modal-body {
    flex: 1;
    min-height: 0;
  }
  .modal .modal-body input:not([type="checkbox"]):not([type="hidden"]),
  .modal .modal-body select,
  .modal .modal-body textarea {
    font-size: 16px;
  }
  .modal .modal-body label:not(.picker-row):not(.feature-row) {
    font-size: 13px;
  }
  .modal select {
    width: 100%;
    max-width: none;
  }
  .quick-action > b {
    display: none;
  }
  .picker-chooser {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0 12px;
  }
  .picker-chooser > summary {
    font-size: 14px;
    min-height: 48px;
  }
  .picker-chooser .picker {
    border: none;
    padding: 0;
    margin: 0 0 12px;
  }
  .pasture-editor {
    width: min(960px, 100%);
  }
  .pasture-editor .modal-body {
    gap: 12px;
  }
  .pasture-editor .draw-map {
    flex-shrink: 0;
  }
  .map-tools button[aria-pressed="true"] {
    background: #173d32;
    color: white;
    border-color: #173d32;
  }
  .boundary-point {
    background: transparent;
    border: 0;
  }
  .boundary-point span {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border: 3px solid white;
    background: #173d32;
    color: #fff;
    border-radius: 50%;
    font: 700 11px system-ui;
    box-shadow: 0 1px 6px #0009;
    cursor: grab;
  }
  .boundary-point span:active {
    cursor: grabbing;
  }
  
  
  
  
  
  
  
  
  .pasture-editor .map-canvas {
    touch-action: none;
  }
  .pasture-editor details > label {
    margin: 12px 0;
  }
  
  @media (max-width: 640px) {
    
    .pasture-editor .map-tools {
      margin: 0;
      gap: 6px;
    }
    .pasture-editor .map-tools button {
      font-size: 12px;
      padding: 6px 9px;
    }
  }
  .pasture-editor .map-instruction {
    font-size: 12px;
    margin: 0;
    padding: 8px 10px;
  } /* Keep the ranch map central, with a quick return to the complete boundary view. */
  .pasture-overview {
    padding: 0;
    overflow: hidden;
  }
  .pasture-map {
    min-height: 0;
  }
  .pasture-map .map-canvas {
    width: 100%;
  }
  .overview-map-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    background: var(--paper);
    font-size: 12px;
    color: var(--muted);
  }
  .overview-map-tools button {
    min-height: 44px;
    padding: 8px 15px;
    border: 1px solid #cfdbce;
    border-radius: 10px;
    background: white;
    color: var(--forest);
    font-weight: 700;
  }
  
  .pasture-remove-area {
    border-top: 1px solid #e0e5df;
    padding-top: 14px;
    display: flex;
    gap: 10px;
    align-items: center;
  }
  .pasture-remove-area small {
    color: var(--muted);
  }
  .removed-pastures {
    margin-top: 16px;
  }
  .removed-pastures summary {
    cursor: pointer;
    font-weight: 700;
    min-height: 44px;
  }
  .removed-pastures .event-row {
    justify-content: space-between;
  }
  .address-results {
    border: 1px solid #d6dfd3;
    border-radius: 10px;
    background: white;
    overflow: auto;
    max-height: 245px;
    padding: 5px;
    margin-top: 6px;
    width: 100%;
    color: #536451;
    font-size: 13px;
  }
  .address-results[hidden] {
    display: none;
  }
  .address-results button {
    display: block;
    width: 100%;
    text-align: left;
    min-height: 48px;
    padding: 10px 12px;
    background: white;
    color: var(--forest);
    border: 0;
    border-radius: 6px;
    white-space: normal;
    line-height: 1.4;
  }
  .address-results button:hover,
  .address-results button:focus {
    background: #eef3e9;
    outline: 2px solid #748d69;
    outline-offset: -2px;
  }
  .address-empty {
    margin: 0;
    padding: 11px 12px;
    color: var(--muted);
    line-height: 1.45;
  }
  .map-search:has(.address-results) {
    flex-wrap: wrap;
  }
  .map-search .address-results {
    flex-basis: 100%;
  }
  .map-tools button:disabled {
    opacity: 0.4;
    cursor: default;
  }
  @media (max-width: 760px) {
    .overview-map-tools {
      padding: 10px;
      align-items: flex-start;
    }
    .overview-map-tools span {
      max-width: 125px;
      font-size: 11px;
    }
    .pasture-remove-area {
      align-items: flex-start;
      flex-direction: column;
    }
    
  }
  .boundary-acreage {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px 14px;
    background: #edf3e8;
    padding: 10px 12px;
    color: var(--forest);
    border-radius: 0 0 10px 10px;
  }
  .boundary-acreage strong {
    font-size: 18px;
  }
  .boundary-acreage small {
    font-size: 11px;
    color: #596b54;
  }
  .pasture-size {
    font-size: 14px;
    font-weight: 700;
    color: var(--forest);
    margin: 10px 0;
  }
  .pasture-size-detail {
    font-size: 24px;
    margin: 0;
  }
  .pasture-size-detail small {
    display: block;
    font-size: 12px;
    font-weight: 400;
    margin-top: 5px;
    color: var(--muted);
  }
  .boundary-acreage {
    border-radius: 0;
    padding: 8px 12px;
  } /* SVG pasture selection should highlight the boundary, not its rectangular bounds. */
  .pasture-map path.leaflet-interactive {
    -webkit-tap-highlight-color: transparent;
  }
  .pasture-map path.leaflet-interactive:focus-visible {
    stroke: #f3ce76;
    stroke-width: 5;
  } /* A roomy map editor with a fixed Save footer; scroll the body on smaller screens. */
  .modal.pasture-editor {
    width: min(1200px, calc(100vw - 32px));
    height: 94dvh;
    max-height: 94dvh;
  }
  .pasture-editor .modal-body {
    overflow-y: auto;
  }
  
  .pasture-address-search {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px;
  }
  .pasture-address-search > label {
    grid-column: 1/-1;
    font-weight: 600;
  }
  .pasture-address-search input {
    min-width: 0;
    width: 100%;
  }
  .pasture-address-search .address-results {
    grid-column: 1/-1;
    grid-row: 3;
  }
  .address-results button small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
  }
  .existing-pasture-label {
    background: #173d32cc;
    border: 0;
    color: #fff;
    box-shadow: none;
    font-size: 11px;
    padding: 4px 7px;
  }
  .existing-pasture-label:before {
    display: none;
  }
  @media (max-width: 760px) {
    .modal.pasture-editor {
      height: 96dvh;
      max-height: 96dvh;
      width: calc(100vw - 16px);
    }
    .pasture-address-search .button {
      padding: 8px 12px;
    }
  }
  @media (min-width: 761px) {
    .pasture-editor .modal-body {
      display: grid;
      grid-template-columns: 280px minmax(0, 1fr);
      align-items: stretch;
      overflow: hidden;
    }
    .pasture-editor-fields {
      overflow: auto;
      padding-right: 8px;
      display: flex;
      flex-direction: column;
      gap: 12px;
    }
    .pasture-editor .draw-map {
      display: flex;
      flex-direction: column;
      min-height: 0;
    }
    .pasture-editor .map-canvas {
      min-height: 0;
      flex: 1;
    }
    .pasture-editor .map-tools {
      margin: 0;
      gap: 5px;
      padding: 8px;
    }
    .pasture-editor .map-tools button {
      font-size: 12px;
      padding: 7px 9px;
    }
    .pasture-editor .boundary-acreage {
      font-size: 12px;
    }
    .pasture-editor .modal-head {
      padding: 14px 20px;
    }
    .pasture-editor .modal-head h2 {
      font-size: 24px;
    }
    .pasture-editor .map-instruction {
      min-height: 46px;
    }
    .pasture-editor .pasture-address-search {
      grid-template-columns: 1fr;
    }
    .pasture-address-search .address-results {
      grid-row: auto;
    }
    .pasture-editor-fields input {
      width: 100%;
    }
  }
  @media (max-width: 760px) {
    .pasture-editor-fields {
      display: flex;
      flex-direction: column;
      gap: 12px;
    }
    
    .pasture-editor .modal-body {
      display: flex;
    }
    .pasture-editor .draw-map {
      min-height: 0;
    }
  }
  @media (min-width: 761px) {
    .modal.pasture-editor {
      height: 98dvh;
      max-height: 98dvh;
    }
    .pasture-editor .modal-head {
      padding: 10px 20px;
    }
    .pasture-editor .map-instruction {
      min-height: 34px;
    }
  }
  @media (max-width: 760px) {
    .pasture-editor-fields {
      display: contents;
    }
    .pasture-editor-fields > details,
    .pasture-editor-fields > .pasture-remove-area {
      order: 2;
    }
    .pasture-editor .draw-map {
      order: 1;
    }
    .pasture-editor .map-tools {
      flex-wrap: nowrap;
      gap: 4px;
      padding: 7px 3px;
      margin: 0;
    }
    .pasture-editor .map-tools button {
      font-size: 11px;
      padding: 6px 7px;
      min-width: 0;
      flex: 1;
    }
    .pasture-editor .boundary-acreage strong {
      font-size: 15px;
    }
  } /* Home dashboard: one clear hierarchy, compact data, and quiet surfaces. */
  
  
  
  
  
  .home-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 0 0 29px;
  }
  .home-actions .quick-action {
    min-width: 0;
    min-height: 46px;
    height: 46px;
    flex: 0 0 auto;
    padding: 0 13px;
    border-color: #e2e7de;
    background: var(--paper);
    box-shadow: none;
    border-radius: 11px;
    font-size: 12px;
  }
  .home-actions .quick-action:hover {
    box-shadow: 0 5px 16px rgba(23, 61, 50, 0.07);
    border-color: #c7d3c5;
  }
  .home-actions .quick-action > span {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    font-size: 16px;
  }
  .home-actions .quick-action > b {
    font-size: 14px;
  }
  
  .home-section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 11px;
  }
  .home-section-heading h2 {
    font:
      700 19px/1.25 Georgia,
      serif;
    color: var(--forest);
    margin: 4px 0 0;
  }
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  @media (max-width: 760px) {
    
    
    
    .home-actions {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 8px;
      margin-bottom: 24px;
    }
    .home-actions .quick-action {
      width: 100%;
      justify-content: flex-start;
      padding: 0 10px;
      font-size: 11px;
    }
    .home-actions .quick-action > b {
      margin-left: auto;
    }
    
    
    
    
    
    
    
    
    .home-calendar .text-button {
      font-size: 11px;
    }
  }
  @media (max-width: 380px) {
    
    .home-actions .quick-action {
      font-size: 10px;
      padding: 0 8px;
    }
    
    
    
  }
  
  
  
  
  
  
  
  
  
  
  
  
  
   /* Ranch landmarks and map placement mode. */
  .overview-map-tools {
    flex-wrap: wrap;
  }
  .overview-map-tools .map-placement-status {
    flex: 1 1 180px;
    min-width: 140px;
  }
  .overview-map-tools button[aria-pressed="true"] {
    background: #173d2b;
    color: #fff;
    border-color: #173d2b;
  }
  .overview-map-tools button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
  }
  .ranch-map-marker span {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #173d2b;
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    box-shadow: 0 2px 7px #15271966;
  }
  .ranch-map-marker.marker-water span {
    background: #247a93;
  }
  .ranch-map-marker.marker-gate span {
    background: #8b6a31;
  }
  .ranch-map-marker.marker-fence span {
    background: #31593a;
  }
  .ranch-map-marker.marker-hazard span {
    background: #a43d2d;
  }
  .ranch-map-marker.marker-note span {
    background: #526777;
  }
  
  
  @media (max-width: 760px) {
    .overview-map-tools .map-placement-status {
      order: 3;
      flex: 1 1 100%;
      max-width: none;
      min-width: 0;
    }
  }
  .import-review {
    margin-top: 12px;
  }
  .import-review-summary {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    background: #f1f3ed;
    border-radius: 8px;
  }
  .import-review-table,
  .report-preview-table {
    max-height: 38vh;
    overflow: auto;
    margin-top: 10px;
    border: 1px solid #dfe5dc;
    border-radius: 8px;
  }
  .import-review-table table,
  .report-preview-table table {
    min-width: 620px;
    width: 100%;
    border-collapse: collapse;
  }
  .import-review-table th,
  .import-review-table td,
  .report-preview-table th,
  .report-preview-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #e5e9e1;
    text-align: left;
    font-size: 12px;
    vertical-align: top;
  }
  .import-review-table th,
  .report-preview-table th {
    position: sticky;
    top: 0;
    background: #f5f4ed;
    z-index: 1;
  }
  .import-ready {
    color: #24613b;
    font-weight: 700;
  }
  .report-preset-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 0;
    border-top: 1px solid #e6e9e1;
  }
  .report-preset-row > span {
    display: grid;
    gap: 4px;
  }
  .report-preset-row small {
    color: var(--muted);
  }
  .report-field-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px 12px;
  }
  .report-preset-filters {
    margin-top: 12px;
  }
  .bulk-measurements {
    display: grid;
    gap: 8px;
    margin-top: 12px;
  }
  .measurement-row {
    display: grid;
    grid-template-columns: minmax(100px, 1.2fr) repeat(3, minmax(72px, 1fr));
    gap: 8px;
    align-items: end;
    padding: 10px;
    border: 1px solid #e1e5dd;
    border-radius: 8px;
  }
  .measurement-row > span {
    display: grid;
    gap: 4px;
    padding-bottom: 9px;
  }
  .measurement-row small {
    color: var(--muted);
  }
  .measurement-row label {
    font-size: 11px;
  }
  .measurement-row input {
    min-width: 0;
    width: 100%;
  }
  @media (max-width: 760px) {
    .report-preset-row {
      align-items: flex-start;
      flex-direction: column;
    }
    .measurement-row {
      grid-template-columns: 1fr 1fr;
    }
    .measurement-row > span {
      grid-column: 1/-1;
    }
    .report-field-options {
      grid-template-columns: 1fr;
    }
  } /* Source: redesign.css */ /* Template-driven Cattle Command theme. Layout adapts while domain workflows stay intact. */
  :root {
    --forest: #12382d;
    --forest-2: #244e39;
    --cream: #f6f4ee;
    --paper: #fffefa;
    --ink: #17231d;
    --muted: #77817a;
    --line: #e7e7df;
    --radius: 9px;
    --shadow: 0 3px 12px #172e2008;
    font-family: Arial, Helvetica, sans-serif;
  }
  body {
    background: var(--cream);
  }
  button,
  input,
  select,
  textarea {
    font-family: inherit;
  }
  h1,
  h2,
  h3 {
    color: var(--ink);
  }
  .sidebar {
    width: 174px;
    padding: 18px 9px 12px;
    background: linear-gradient(145deg, #14382b, #092b22);
    border-right: 1px solid #173b2c;
  }
  .brand {
    padding: 0 9px 23px;
    gap: 8px;
  }
  .brand b {
    font:
      700 12px Georgia,
      serif;
    letter-spacing: 1px;
  }
  .brand small {
    font:
      700 10px Georgia,
      serif;
    color: #f4eddb;
    letter-spacing: 1px;
  }
  
  
  
  .sidebar nav {
    gap: 4px;
  }
  .nav-item {
    height: 42px;
    padding: 0 12px;
    font-size: 12px;
    font-weight: 500;
    gap: 10px;
    border-radius: 5px;
    color: #e8eadd;
  }
  .nav-item.active {
    background: #355439;
    color: #fff6df;
    box-shadow: inset 2px 0 #d2ba7a;
  }
  .nav-item i {
    display: inline-flex;
    width: 17px;
  }
  .nav-item svg,
  .bottom-nav svg {
    width: 18px;
    height: 18px;
  }
  
  
  
  
  
  
  .main {
    margin-left: 174px;
  }
  .topbar {
    height: 57px;
    padding: 0 28px;
    background: #fffefa;
    border-color: #e8e6de;
    gap: 20px;
  }
  .header-search {
    width: min(500px, 60%);
    border: 0;
    background: #f2f3ed;
    border-radius: 5px;
    height: 32px;
    display: flex;
    align-items: center;
    gap: 9px;
    color: #859087;
    padding: 0 10px;
    text-align: left;
  }
  .header-search svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
  }
  .header-search span {
    font-size: 11px;
    flex: 1;
  }
  .header-search kbd {
    font: 9px Arial;
    color: #869288;
  }
  
  
  
  .header-mobile-search {
    display: none;
  }
  .content {
    max-width: 1500px;
    padding: 28px 28px 50px;
  }
  .page-heading {
    margin-bottom: 20px;
    align-items: center;
    gap: 16px;
  }
  .page-heading h1 {
    font:
      700 27px/1.2 Arial,
      Helvetica,
      sans-serif;
    letter-spacing: -0.6px;
    margin: 0 0 6px;
  }
  .page-heading .eyebrow {
    display: none;
  }
  .page-heading p {
    font-size: 12px;
  }
  .eyebrow {
    font-size: 9px;
    letter-spacing: 0.9px;
  }
  .button {
    min-height: 36px;
    border-radius: 6px;
    font-size: 11px;
    padding: 0 13px;
    gap: 6px;
    font-weight: 600;
    box-shadow: none;
  }
  .button-primary {
    background: linear-gradient(#173e31, #0d2f25);
    border: 1px solid #244b3b;
    box-shadow: 0 1px 2px #17342825;
  }
  .button-secondary {
    background: #fffefa;
    border-color: #e0e4da;
  }
  .icon-button {
    border-radius: 5px;
    width: 34px;
    height: 34px;
  }
  .text-button {
    font-size: 11px;
  }
  .panel {
    border-radius: 9px;
    padding: 19px;
    box-shadow: 0 2px 7px #24392104;
  }
  .panel h2,
  .home-section-heading h2 {
    font:
      700 15px/1.3 Arial,
      Helvetica,
      sans-serif;
    color: var(--ink);
  }
  .panel-head {
    margin-bottom: 14px;
  }
  .panel-head .eyebrow {
    display: none;
  }
  .dashboard-hero {
    position: relative;
    min-height: 215px;
    background:
      linear-gradient(180deg, #faf7eece 0%, #faf7ee65 30%, transparent 65%),
      url("/static/assets/flat-pasture.png") center 61% / cover;
    border-radius: 8px;
    padding: 24px;
    align-items: flex-start;
    margin-bottom: 14px;
    overflow: hidden;
  }
  .dashboard-hero h1 {
    font-size: 27px;
    color: #122419;
  }
  .dashboard-hero .eyebrow {
    letter-spacing: 0;
    font-weight: 400;
    font-size: 12px;
    color: #33452e;
    margin-top: 5px;
    order: 1;
  }
  .dashboard-hero > div {
    display: flex;
    flex-direction: column;
  }
  .dashboard-hero .button {
    min-width: 110px;
  }
  
  .home-actions {
    margin-bottom: 14px;
    gap: 8px;
  }
  .home-actions .quick-action {
    height: 36px;
    min-height: 36px;
    border-radius: 6px;
    font-size: 11px;
    padding: 0 11px;
  }
  .home-actions .quick-action > span {
    width: 21px;
    height: 21px;
    background: transparent;
    font-size: 15px;
  }
  
  
  
  
  
  
  
  
  
  
  
  .record-dot {
    background: #edf1e7;
    border-radius: 50%;
    width: 29px;
    flex-basis: 29px;
    height: 29px;
  }
  
  
  .setup-checklist {
    background: #eeefe5;
    border-radius: 8px;
    border-color: #e0e4d8;
    font-size: 11px;
    margin-bottom: 16px;
  }
  .cattle-panel {
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
  }
  .cattle-tools {
    padding: 0 0 15px;
    border: 0;
    gap: 12px;
  }
  .searchbox {
    height: 37px;
    border-radius: 6px;
    border-color: #e2e5db;
    background: #fffefa;
  }
  .searchbox input {
    font-size: 11px;
    background: transparent;
  }
  
  .herd-filters {
    border-radius: 6px;
  }
  .herd-filters summary {
    font-size: 11px;
  }
  .table-wrap {
    border: 1px solid #e7e7df;
    border-radius: 8px;
    background: #fffefa;
  }
  th {
    background: #f7f7f1;
    font-size: 9px;
    padding: 13px 12px;
    letter-spacing: 0.6px;
    font-weight: 600;
  }
  td {
    font-size: 11px;
    padding: 10px 12px;
    line-height: 1.4;
    color: #48584d;
  }
  td b {
    color: #25382b;
    font-size: 11px;
  }
  tbody tr:hover {
    background: #f4f6ee;
  }
  .animal-avatar {
    width: 44px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 4px;
    border: 1px solid #e6e3d8;
  }
  .animal-cell {
    gap: 10px;
  }
  .animal-cell b {
    font-size: 11px;
  }
  .status {
    padding: 3px 7px;
    font-size: 9px;
    border-radius: 12px;
    background: #dcebdd;
    color: #306840;
  }
  .status-sold,
  .status-archived {
    background: #e5e7e1;
    color: #68746b;
  }
  .work-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  
  
  .preset-row {
    width: auto;
    min-width: 170px;
    border: 1px solid #e1e6d8;
    border-radius: 6px;
    padding: 9px;
    background: #fffefa;
  }
  .stat-strip {
    background: transparent;
    border: 0;
    gap: 13px;
    border-radius: 0;
  }
  .stat-strip > div {
    background: #fffefa;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
  }
  .stat-strip b {
    font: 700 23px Arial;
    color: #17231d;
  }
  .stat-strip span {
    font-weight: 400;
  }
  .finance-columns {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  .finance-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .finance-strip b {
    font-size: 22px;
  }
  
  .preset-management {
    margin-top: 16px;
  }
  
  .group-card {
    border-radius: 8px;
    overflow: hidden;
  }
  
  
  
  
  
  
  .group-heading h2 {
    font: 700 13px Arial;
    line-height: 1.4;
    margin: 0;
  }
  .group-heading .eyebrow {
    display: none;
  }
  
  
  
  .settings-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 15px;
  }
  .settings-tile {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fffefa;
    display: flex;
    align-items: center;
    text-align: left;
    gap: 13px;
    min-height: 106px;
    padding: 18px;
  }
  .settings-tile:hover {
    border-color: #bac7ad;
    background: #fcfdf7;
  }
  .settings-tile-icon {
    height: 41px;
    width: 41px;
    flex: 0 0 41px;
    border-radius: 50%;
    background: #eef1e7;
    color: #1e4433;
    display: grid;
    place-items: center;
    font-size: 21px;
  }
  .settings-tile b {
    font-size: 12px;
    display: block;
  }
  .settings-tile small {
    font-size: 10px;
    display: block;
    color: var(--muted);
    margin-top: 5px;
    line-height: 1.4;
  }
  .settings-panel {
    margin-top: 20px;
  }
  .settings-section {
    min-height: 72px;
  }
  .settings-section h2 {
    font: 700 13px Arial;
  }
  
  .feature-panel {
    border-radius: 8px;
  }
  .more-link {
    border-radius: 8px;
    min-height: 77px;
  }
  .more-link b {
    font: 700 14px Arial;
  }
  .more-icon {
    border-radius: 50%;
  }
  .calendar-panel {
    padding: 18px;
  }
  .calendar-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
  }
  .calendar-toolbar h2 {
    margin: 0 12px;
    font-size: 15px;
  }
  
  .calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }
  .calendar-weekdays > div,
  .calendar-weekdays > span {
    text-align: center;
    font-size: 10px;
    color: var(--muted);
    padding: 12px;
  }
  .calendar-day {
    min-height: 105px;
    padding: 9px;
    border-right: 1px solid var(--line);
    border-top: 1px solid var(--line);
    font-size: 11px;
  }
  .calendar-day:nth-child(7n) {
    border-right: 0;
  }
  .calendar-day.today {
    background: #f3f5e9;
  }
  
  .calendar-event {
    display: block;
    max-width: 100%;
    width: 100%;
    font-size: 9px;
    font-weight: 600;
    padding: 6px 5px;
    text-align: left;
    border: 0;
    border-radius: 4px;
    background: #dfead9;
    color: #254a32;
    margin-top: 5px;
    white-space: normal;
    line-height: 1.3;
  }
  .calendar-event:nth-of-type(2n) {
    background: #f2e4bc;
  }
  .calendar-event:nth-of-type(3n) {
    background: #dbe9ec;
  }
  .calendar-toolbar .button.active {
    background: #edf2e6;
    border-color: #b8c8af;
  }
  .pasture-overview {
    grid-template-columns: 230px minmax(0, 1fr);
    gap: 0;
    background: #fffefa;
    align-items: stretch;
  }
  .pasture-cards {
    grid-column: 1;
    grid-row: 1;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 0;
    max-height: 680px;
    overflow: auto;
  }
  .pasture-map {
    grid-column: 2;
    grid-row: 1;
    border-left: 1px solid var(--line);
  }
  .pasture-card {
    border: 0;
    border-bottom: 1px solid #e9e9df;
    border-radius: 0;
    padding: 12px 6px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 5px;
  }
  .pasture-card h3 {
    font: 700 12px Arial;
    margin: 0;
    grid-row: 1;
  }
  .pasture-card h3 .text-button {
    font-size: 12px;
    text-align: left;
  }
  
  
  
  .pasture-card p {
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    max-width: 190px;
    font-size: 10px;
  }
  .pasture-size {
    margin: 0;
    font-size: 11px;
    color: #637160;
    font-weight: 400;
  }
  
  
  .overview-map-tools {
    padding: 8px 10px;
    font-size: 10px;
  }
  .overview-map-tools button {
    min-height: 32px;
    font-size: 10px;
    border-radius: 5px;
    padding: 5px 10px;
  }
  
  
  
  
  .leaflet-tooltip {
    border-radius: 5px;
  }
  .removed-pastures summary {
    font-size: 12px;
  }
  .map-search input {
    border-radius: 5px;
  }
  .boundary-acreage {
    background: #edf2e5;
  }
  .modal-backdrop {
    background: #15291d6b;
    backdrop-filter: blur(3px);
    padding: 22px;
  }
  .modal {
    border-radius: 9px;
    max-height: 90dvh;
    width: min(570px, 100%);
    box-shadow: 0 12px 55px #0d241e44;
    border: 1px solid #e3e3d9;
  }
  .modal-head {
    padding: 15px 20px 12px;
  }
  .modal-head h2 {
    font: 700 20px Arial;
    letter-spacing: -0.3px;
    margin: 0;
    color: #15241b;
  }
  .modal-body {
    padding: 18px 20px;
    gap: 12px;
  }
  .modal-body label:not(.check-row):not(.picker-row):not(.feature-row) {
    font-size: 11px;
    font-weight: 500;
    gap: 5px;
    color: #5b665b;
  }
  .modal input:not([type="checkbox"]):not([type="hidden"]),
  .modal textarea,
  .modal select {
    min-height: 36px;
    font-size: 12px;
    border-radius: 5px;
    border-color: #e1e4da;
    background: #fff;
  }
  .modal select {
    max-width: none;
    width: 100%;
  }
  .modal-foot {
    padding: 12px 20px;
    background: #fffefa;
  }
  .modal-foot .button {
    min-height: 37px;
  }
  .modal:has(.animal-form-layout),
  .modal:has(.animal-profile-summary) {
    width: min(740px, 100%);
  }
  .animal-form-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 230px;
    gap: 25px;
  }
  .animal-form-fields {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .animal-form-portrait {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: center;
    background: #f4f5ee;
    border: 1px solid #e3e6d8;
    border-radius: 6px;
    padding: 10px;
    align-self: start;
  }
  .animal-form-portrait .animal-avatar.large,
  .animal-profile-portrait .animal-avatar.large {
    width: 100%;
    height: auto;
    aspect-ratio: 1.25;
    border-radius: 4px;
    background-color: #e9ead9;
  }
  .animal-form-portrait > b {
    font-size: 12px;
  }
  .animal-form-portrait p {
    font-size: 10px;
    color: #69765d;
    margin: 0;
  }
  .animal-form-portrait small {
    font-size: 10px;
    color: #8a9285;
    line-height: 1.5;
  }
  .animal-profile-summary {
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr);
    gap: 22px;
  }
  .animal-profile-portrait {
    min-width: 0;
  }
  .animal-profile-portrait small {
    font-size: 9px;
    color: #8a9285;
    display: block;
    margin-top: 6px;
    line-height: 1.4;
  }
  .animal-profile-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px 18px;
  }
  .animal-profile-facts .detail-cell {
    background: transparent;
    border: 0;
    padding: 4px 0;
  }
  .detail-cell small {
    font-size: 10px;
  }
  .detail-cell b {
    font-size: 11px;
  }
  .animal-profile-overview h3 {
    font: 700 13px Arial;
    border-bottom: 1px solid #e4e6dc;
    padding: 13px 0 9px;
    margin: 0;
  }
  .animal-profile-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
  }
  .profile-stat {
    background: #f5f6ef;
    border: 1px solid #e7e9de;
    border-radius: 6px;
    padding: 13px;
  }
  .profile-stat small,
  .profile-stat b,
  .profile-stat span {
    display: block;
    font-size: 10px;
    line-height: 1.5;
  }
  .profile-stat b {
    font-size: 13px;
    color: #23442e;
  }
  .profile-actions {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
  }
  .profile-actions .button {
    font-size: 10px;
    min-height: 33px;
  }
  .profile-section h3,
  .profile-history summary {
    font: 700 13px Arial;
  }
  .picker {
    border-radius: 6px;
    background: #fdfdf9;
  }
  .picker-chooser > summary {
    border-radius: 5px;
    font-size: 12px;
  }
  .profile-section {
    font-size: 11px;
  }
  .modal.pasture-editor {
    width: min(1200px, calc(100vw - 40px));
    height: 91dvh;
    max-height: 91dvh;
  }
  .pasture-editor .modal-head h2 {
    font-size: 20px;
  }
  .pasture-editor .modal-body {
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 18px;
  }
  .pasture-editor .map-tools {
    background: #fafbf5;
    border-bottom: 1px solid #e1e4d5;
  }
  .pasture-editor .map-tools button {
    border-radius: 5px;
  }
  .pasture-editor .draw-map {
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #dce1d1;
  }
  .pasture-remove-area .button {
    color: #b24a3c;
  }
  .address-results {
    border-radius: 6px;
  }
  .address-results button {
    font-size: 12px;
  }
  .optional-dates {
    border-radius: 5px;
  }
  
  
  
  
  
  
  
  
  
  @media (min-width: 1500px) {
    .content {
      padding: 34px 42px 60px;
    }
    .topbar {
      padding: 0 42px;
    }
    .sidebar {
      width: 188px;
    }
    .main {
      margin-left: 188px;
    }
    .dashboard-hero {
      min-height: 250px;
    }
    
  }
  @media (max-width: 1050px) and (min-width: 761px) {
    .sidebar {
      width: 144px;
    }
    .main {
      margin-left: 144px;
    }
    .brand b {
      font-size: 10px;
    }
    .brand small {
      font-size: 9px;
    }
    .content {
      padding: 24px 20px;
    }
    
    .settings-grid {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .pasture-overview {
      grid-template-columns: 185px minmax(0, 1fr);
    }
    
  }
  @media (max-width: 760px) {
    .sidebar {
      display: none;
    }
    .main {
      margin-left: 0;
    }
    .topbar {
      height: 60px;
      padding: 0 16px;
      gap: 10px;
    }
    
    
    
    .header-search {
      display: none;
    }
    .header-mobile-search {
      display: inline-flex;
      align-items: center;
      justify-content: center;
    }
    .header-mobile-search svg {
      width: 19px;
      height: 19px;
    }
    
    .content {
      padding: 20px 15px 95px;
    }
    .page-heading {
      align-items: flex-start;
      margin-bottom: 18px;
      gap: 12px;
    }
    .page-heading h1 {
      font-size: 25px;
    }
    .page-heading p {
      font-size: 11px;
    }
    .page-heading .heading-actions {
      gap: 6px;
    }
    .heading-actions .button {
      font-size: 10px;
      min-height: 40px;
      padding: 0 11px;
    }
    .button {
      min-height: 42px;
    }
    .dashboard-hero {
      min-height: 230px;
      padding: 19px;
      flex-direction: column;
      gap: 18px;
      background-position: 65% 60%;
      justify-content: space-between;
    }
    .dashboard-hero h1 {
      font-size: 25px;
      max-width: 300px;
    }
    .dashboard-hero .button {
      min-width: 0;
      width: auto;
      align-self: flex-start;
      min-height: 42px;
    }
    .home-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 7px;
      margin-bottom: 14px;
    }
    .home-actions .quick-action {
      height: 40px;
      min-height: 40px;
      padding: 0 9px;
      flex: 1;
      font-size: 10px;
      min-width: 105px;
    }
    .home-actions .quick-action > b {
      display: none;
    }
    
    
    
    
    
    
    
    .panel {
      padding: 16px;
    }
    .cattle-panel {
      padding: 0;
    }
    .cattle-tools {
      gap: 8px;
      padding-bottom: 12px;
    }
    .searchbox {
      min-width: 160px;
    }
    .mobile-animal {
      border-radius: 6px;
      padding: 13px 11px;
      gap: 10px;
      background: #fffefa;
    }
    .mobile-animal .animal-avatar {
      width: 56px;
      height: 43px;
    }
    .mobile-animal-info b {
      font-size: 12px;
    }
    
    
    
    .group-heading h2 {
      font-size: 12px;
    }
    
    .settings-grid {
      grid-template-columns: 1fr 1fr;
      gap: 10px;
    }
    .settings-tile {
      min-height: 114px;
      padding: 13px;
      flex-direction: column;
      align-items: flex-start;
      gap: 9px;
    }
    .settings-tile b {
      font-size: 11px;
    }
    .settings-tile small {
      font-size: 9px;
    }
    .settings-tile-icon {
      width: 31px;
      height: 31px;
      flex-basis: 31px;
      font-size: 18px;
    }
    .settings-section {
      gap: 12px;
      min-height: 90px;
    }
    .settings-section .button {
      white-space: normal;
      text-align: center;
      font-size: 10px;
    }
    .stat-strip,
    .finance-strip {
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 9px;
    }
    .stat-strip > div {
      padding: 13px;
    }
    .stat-strip b {
      font-size: 21px;
    }
    .finance-columns {
      grid-template-columns: 1fr;
    }
    .pasture-overview {
      flex-direction: column;
    }
    .pasture-map {
      border-left: 0;
      order: 0;
    }
    .pasture-cards {
      order: 1;
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      max-height: none;
      gap: 10px;
      padding: 12px;
    }
    .pasture-card {
      border: 1px solid #e1e4d7;
      border-radius: 6px;
      padding: 12px;
    }
    .pasture-card p {
      max-width: 100%;
    }
    
    
    
    
    .overview-map-tools span {
      max-width: 160px;
    }
    .overview-map-tools button {
      min-height: 40px;
    }
    .bottom-nav {
      height: 68px;
      background: #fffefaf5;
      border-top: 1px solid #e3e6db;
      backdrop-filter: blur(10px);
      padding-bottom: env(safe-area-inset-bottom);
    }
    .bottom-nav button {
      color: #738069;
    }
    .bottom-nav button.active {
      color: #21472e;
      background: #edf2e5;
      border-radius: 7px;
    }
    .bottom-nav i {
      display: inline-flex;
      align-items: center;
      justify-content: center;
    }
    .bottom-nav svg {
      width: 21px;
      height: 21px;
    }
    .bottom-nav span {
      font-size: 10px;
    }
    .modal-backdrop {
      padding: 12px;
    }
    .modal {
      border-radius: 9px;
      max-height: 92dvh;
    }
    .modal-head {
      padding: 15px 17px 12px;
    }
    .modal-body {
      padding: 16px 17px;
    }
    .modal-foot {
      padding: 12px 17px max(14px, env(safe-area-inset-bottom));
    }
    .modal input:not([type="checkbox"]):not([type="hidden"]),
    .modal select {
      min-height: 44px;
      font-size: 16px;
    }
    .modal textarea {
      font-size: 16px;
    }
    .animal-form-layout {
      grid-template-columns: minmax(0, 1fr);
      gap: 14px;
    }
    .animal-form-portrait {
      display: none;
    }
    .animal-profile-summary {
      grid-template-columns: 110px minmax(0, 1fr);
      gap: 13px;
    }
    .animal-profile-facts {
      grid-template-columns: 1fr;
      gap: 1px;
    }
    .animal-profile-facts .detail-cell {
      padding: 3px 0;
    }
    .animal-profile-facts .detail-cell small {
      font-size: 9px;
    }
    .animal-profile-facts .detail-cell b {
      font-size: 11px;
    }
    .animal-profile-stats {
      grid-template-columns: 1fr;
      gap: 7px;
    }
    .profile-stat {
      padding: 10px;
    }
    .profile-actions .button {
      min-height: 42px;
      flex: 1;
      white-space: normal;
    }
    .modal.pasture-editor {
      width: calc(100vw - 16px);
      height: 95dvh;
      max-height: 95dvh;
    }
    .pasture-editor .modal-body {
      display: flex;
      padding: 12px;
      gap: 12px;
    }
    .pasture-editor .map-tools button {
      min-height: 39px;
      font-size: 10px;
    }
    .calendar-toolbar {
      flex-wrap: wrap;
      gap: 5px;
    }
    .calendar-toolbar h2 {
      font-size: 13px;
      margin: 0 6px;
    }
    
    .calendar-day {
      min-height: 78px;
      padding: 5px 3px;
      font-size: 9px;
    }
    .calendar-event {
      font-size: 8px;
      padding: 5px 3px;
    }
    .calendar-panel {
      padding: 11px;
    }
    .calendar-weekdays > div,
    .calendar-weekdays > span {
      font-size: 9px;
      padding: 9px 3px;
    }
    
  }
  @media (prefers-reduced-motion: reduce) {
    *,
    *:before,
    *:after {
      animation: none !important;
      transition: none !important;
      scroll-behavior: auto !important;
    }
  }
  .page-subtitle {
    font-size: 12px;
    color: #77817a;
    margin: 0;
  }
  
  
  
  
  
  .presets-disclosure {
    margin-top: 16px;
    border: 1px solid #e4e7db;
    border-radius: 7px;
    background: #fafbf5;
    padding: 14px 18px;
  }
  .presets-disclosure > summary {
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    min-height: 24px;
  }
  
  .calendar-navigation {
    display: flex;
    align-items: center;
    gap: 5px;
  }
  .segmented-control {
    margin-left: auto;
    display: flex;
    border: 1px solid #e1e5d8;
    border-radius: 6px;
    overflow: hidden;
  }
  .segmented-control button {
    background: #fffefa;
    border: 0;
    padding: 8px 14px;
    font-size: 11px;
  }
  .segmented-control button.active {
    background: #eef2e5;
    color: #1f462f;
    box-shadow: inset 0 0 0 1px #c4d0b7;
  }
  .calendar-days {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    border-bottom: 1px solid var(--line);
    border-left: 1px solid var(--line);
  }
  .calendar-day.is-today {
    background: #f2f5e9;
  }
  .calendar-day.is-today > .calendar-day-number {
    background: #234b34;
    color: white;
    border-radius: 50%;
    display: inline-grid;
    place-items: center;
    width: 21px;
    height: 21px;
  }
  .calendar-day.outside-month {
    color: #aeb5a4;
    background: #fafaf5;
  }
  
  
  
  
  .settings-account {
    margin-top: 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .settings-account b,
  .settings-account small {
    display: block;
    font-size: 12px;
  }
  .settings-account small {
    font-size: 10px;
    color: var(--muted);
    margin-top: 5px;
  }
  .cattle-panel td:nth-child(2) {
    font-weight: 600;
    color: #253b2c;
  }
  .cattle-panel td:nth-child(3) {
    width: 65px;
  }
  
  @media (max-width: 1050px) and (min-width: 761px) {
    .pasture-overview {
      grid-template-columns: 185px minmax(0, 1fr);
    }
  }
  @media (max-width: 760px) {
    .calendar-toolbar {
      align-items: flex-start;
    }
    .calendar-navigation {
      flex-wrap: wrap;
    }
    .calendar-navigation .button {
      min-height: 36px;
    }
    .segmented-control button {
      min-height: 36px;
      padding: 7px 10px;
    }
    .presets-disclosure {
      padding: 13px;
    }
    .settings-account {
      padding: 14px;
    }
  }
  .pasture-name-label {
    background: #fffef5;
    color: #24372a;
    border: 1px solid #e1dbc3;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 600;
    box-shadow: 0 1px 4px #0e301d20;
  }
  .pasture-name-label:before {
    display: none;
  }
  .group-card {
    padding: 0;
  }
  
  .group-card .group-heading .icon-button {
    height: 26px;
  }
  
  .animal-form-portrait {
    border-color: #e3e6d8;
  }
  .modal input[type="checkbox"],
  table input[type="checkbox"] {
    accent-color: #244b32;
  }
  .calendar-day {
    overflow-wrap: anywhere;
  }
  
  .settings-tile-icon svg,
  .more-icon svg {
    width: 22px;
    height: 22px;
  }
  .quick-action > span svg {
    width: 17px;
    height: 17px;
  } /* Selected gold slab-serif monogram with a thin white outline. */
  
   /* Source: features.css */ /* Optional ranch tools follow the same quiet, mobile-first visual language. */
  .feature-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    font-size: 12px;
    color: var(--muted, #6c756d);
  }
  .feature-metrics b {
    display: block;
    margin-top: 5px;
    color: var(--ink, #18372c);
    font-size: 17px;
  }
  .weight-chart {
    width: 100%;
    height: 100px;
    color: #315a44;
    margin: 12px 0;
  }
  .withdrawal-alert {
    border-left: 3px solid #bf903e;
    background: #fff6df;
    padding: 10px 12px;
    color: #77591d;
    border-radius: 5px;
    font-size: 13px;
  }
  .today-task-panel {
    margin-top: 18px;
    padding: 18px;
  }
  .today-task-panel > summary {
    font-weight: 600;
    cursor: pointer;
  }
  .task-feature-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 12px 0;
    border-bottom: 1px solid #e9e9e1;
  }
  .task-feature-row small {
    display: block;
    color: #778176;
    margin-top: 4px;
  }
  .task-feature-row > div {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
  }
  .task-feature-row b {
    font-size: 13px;
  }
  
  .report-card {
    padding: 22px;
  }
  .report-card h2 {
    font-size: 17px;
    margin-bottom: 20px;
  }
  .report-card .profile-actions {
    margin: 0;
  }
  .treatment-fields {
    padding: 12px;
    background: #f7f6f1;
    border-radius: 7px;
  }
  .treatment-fields summary {
    margin-bottom: 12px;
    cursor: pointer;
  }
  .chute-modal .modal-foot button[type="submit"] {
    min-height: 60px;
    width: 100%;
    font-size: 19px;
  }
  .chute-animal {
    display: flex;
    align-items: center;
    gap: 18px;
  }
  .chute-skip {
    width: 100%;
    min-height: 52px;
    margin-top: 18px;
  }
  .chute-modal .step-card > div {
    width: 100%;
  }
  @media (max-width: 760px) {
    .feature-metrics {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    
    .task-feature-row {
      align-items: flex-start;
      flex-direction: column;
    }
    .task-feature-row button {
      min-height: 44px;
    }
    .today-task-panel {
      padding: 14px;
    }
  }
  .cattle-panel .withdrawal-alert {
    display: inline-block;
    font-size: 9px;
    padding: 3px 5px;
    margin: 4px 0 0 5px;
    border-left-width: 2px;
  }
  .sync-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }
  .sync-status[hidden] {
    display: none;
  } /* Source: ux.css */ /* Shared interaction rules. Load after the existing theme; reuse its brand tokens. */
  :root {
    --ux-space-1: 4px;
    --ux-space-2: 8px;
    --ux-space-3: 12px;
    --ux-space-4: 16px;
    --ux-space-6: 24px;
    --ux-radius: var(--radius, 9px);
    --ux-secondary: #536359;
    --ux-border: #c9d1c7;
    --ux-focus: #9c772e;
    --ux-danger: #963e35;
  }
  .searchbox:focus-within,
  .header-search:focus-visible {
    outline: 3px solid var(--forest);
    outline-offset: 2px;
  }
  .context-actions {
    display: flex;
    align-items: center;
    gap: var(--ux-space-2);
    flex-wrap: wrap;
    padding: var(--ux-space-3) var(--ux-space-4);
    background: var(--mint);
    border-block: 1px solid var(--ux-border);
    color: var(--forest);
  }
  .context-actions > strong {
    margin-right: auto;
    font-size: 13px;
  }
  .context-actions button {
    min-height: 44px;
  }
  .context-actions .button-secondary {
    background: var(--paper);
  }
  .active-filters,
  .saved-view-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    min-width: 0;
  }
  
  .filter-chip {
    min-height: 40px;
    border: 1px solid var(--ux-border);
    border-radius: 20px;
    background: var(--paper);
    padding: 8px 13px;
    color: var(--ux-secondary);
    font-size: 12px;
    font-weight: 600;
    white-space: normal;
    text-align: center;
  }
  .filter-chip.active,
  .filter-chip[aria-pressed="true"] {
    background: var(--forest);
    color: #fff;
    border-color: var(--forest);
  }
  .active-filters {
    padding: 0 16px 12px;
    color: var(--forest);
    font-size: 12px;
  }
  .active-filters:empty {
    display: none;
  }
  .active-filters button {
    min-height: 40px;
  }
  .saved-view-controls {
    padding: 0 16px 12px;
  }
  .saved-view-controls select {
    max-width: 100%;
    min-width: 0;
    min-height: 44px;
  }
  .saved-view-controls button {
    min-height: 44px;
  }
  
  
  .search-result {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 56px;
    width: 100%;
    border: 0;
    border-bottom: 1px solid var(--line);
    background: transparent;
    padding: 10px;
    text-align: left;
    border-radius: var(--ux-radius);
    color: var(--ink);
    white-space: normal;
  }
  .search-result:hover,
  .search-result[aria-selected="true"] {
    background: var(--mint);
  }
  .search-result > span {
    min-width: 0;
  }
  .search-result b,
  .search-result small {
    display: block;
    overflow-wrap: anywhere;
  }
  .search-result small {
    margin-top: 4px;
    color: var(--ux-secondary);
  }
  
  
  
  
  
  
  
  
  
  
  .modal [aria-invalid="true"] {
    border: 2px solid var(--ux-danger);
    background: #fffaf8;
  }
  .toast-undo {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: min(560px, calc(100vw - 32px));
    white-space: normal;
  }
  .toast-undo button {
    min-height: 44px;
    padding: 8px 12px;
    border: 1px solid currentColor;
    border-radius: 5px;
    background: transparent;
    color: inherit;
    font-weight: 700;
    flex-shrink: 0;
  }
  .page-skeleton {
    display: grid;
    gap: 16px;
    min-width: 0;
  }
  .skeleton-row,
  .skeleton-card {
    background: linear-gradient(90deg, var(--line), var(--mint), var(--line));
    background-size: 200% 100%;
    animation: ux-loading 1.6s ease-in-out infinite;
    border-radius: var(--ux-radius);
    min-height: 54px;
  }
  .skeleton-card {
    min-height: 136px;
  }
  .page-skeleton .skeleton-heading {
    width: 55%;
    height: 34px;
    min-height: 34px;
  }
  .page-skeleton[hidden] {
    display: none;
  }
  @keyframes ux-loading {
    0%,
    100% {
      background-position: 100% 0;
    }
    50% {
      background-position: 0 0;
    }
  }
  
  
  
  
  
  
  
  
  
  .task-completed {
    background: transparent;
    color: var(--ux-secondary);
  }
  .task-completed b {
    font-weight: 400;
  }
  .task-completed .status {
    background: var(--mint);
    color: var(--ux-secondary);
  }
  .sale-review {
    border: 1px solid var(--ux-border);
    border-radius: var(--ux-radius);
    background: var(--cream);
    padding: 16px;
    margin-bottom: 16px;
  }
  .sale-review dl {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px 16px;
    margin: 0;
  }
  .sale-review dt {
    color: var(--ux-secondary);
    font-size: 12px;
  }
  .sale-review dd {
    margin: 0;
    text-align: right;
    font-size: 14px;
    font-weight: 600;
    overflow-wrap: anywhere;
  }
  .sale-review p {
    font-size: 13px;
    line-height: 1.6;
  }
  
  
  .cattle-panel tbody tr:hover {
    background: var(--mint);
  }
  .cattle-panel tbody tr:has(input[type="checkbox"]:checked) {
    background: #e5eddf;
    box-shadow: inset 3px 0 var(--forest);
  }
  @media (max-width: 760px) {
    .context-actions {
      position: sticky;
      bottom: calc(66px + env(safe-area-inset-bottom));
      z-index: 3;
      padding: 12px;
      box-shadow: 0 -3px 12px #12382d12;
    }
    .context-actions > strong {
      flex-basis: 100%;
    }
    .context-actions .button {
      flex: 1;
      white-space: normal;
      padding-inline: 10px;
    }
    .filter-chip {
      min-height: 44px;
    }
    
    
    
    
    .saved-view-controls > * {
      max-width: 100%;
    }
    .toast-undo {
      align-items: center;
    }
    .sale-review {
      padding: 12px;
    }
    
    .page-skeleton {
      gap: 12px;
    }
  }
  @media (prefers-reduced-motion: reduce) {
    .skeleton-row,
    .skeleton-card {
      animation: none;
      background: var(--line);
    }
  }
  
  .toast {
    display: flex;
    align-items: center;
    gap: 16px;
  }
  .toast-undo {
    border: 1px solid currentColor;
    min-height: 44px;
    padding: 6px 14px;
    background: transparent;
    border-radius: 6px;
    font-weight: 700;
  }
  .ux-field-marker {
    font-size: 0.75rem;
    color: #45564b;
    font-weight: 400;
    margin-left: 6px;
  }
  .ux-field-error {
    color: #922d24;
    font-size: 0.85rem;
    margin: 5px 0;
  }
  .ux-error-summary {
    border: 2px solid #a63c31;
    padding: 12px;
    border-radius: 8px;
    color: #80251d;
  }
  .ux-error-summary a {
    color: inherit;
    text-decoration: underline;
  }
  
  
  
  .task-completed {
    opacity: 1;
    color: var(--ux-secondary);
  }
   /* Cattle cards keep the table's actions and selection model on phones. */
  .page-more,
  .saved-view-disclosure {
    position: relative;
    font-size: 12px;
  }
  .page-more > button {
    display: block;
    min-height: 44px;
  }
  .saved-view-disclosure {
    padding: 0 16px 12px;
  }
  .saved-view-disclosure > summary {
    padding: 10px 0;
    min-height: 44px;
    cursor: pointer;
    color: var(--ink);
  }
  .saved-view-disclosure .saved-view-controls {
    padding: 8px 0 0;
  }
  .cattle-group-heading th {
    text-transform: none;
    font-size: 12px;
    color: var(--forest);
    background: var(--mint);
  }
  .cattle-responsive table {
    white-space: normal;
  }
  .cattle-responsive td {
    overflow-wrap: anywhere;
  }
  .cattle-responsive .animal-cell {
    min-width: 110px;
  }
  
  .cattle-responsive th:first-child input,
  .cattle-selection input {
    width: 20px;
    height: 20px;
    accent-color: var(--forest);
  }
  @media (max-width: 1100px) {
    .cattle-panel .cattle-mobile-list {
      display: none;
    }
    .cattle-panel .table-wrap.cattle-responsive {
      display: block;
      border: 0;
      overflow: visible;
    }
    .cattle-responsive table {
      display: block;
      min-width: 0;
      white-space: normal;
    }
    .cattle-responsive thead {
      display: block;
      padding: 8px 16px;
    }
    .cattle-responsive thead tr {
      display: block;
    }
    .cattle-responsive thead th {
      display: none;
    }
    .cattle-responsive thead th:first-child {
      display: flex;
      align-items: center;
      gap: 8px;
      background: transparent;
      padding: 0;
      min-height: 44px;
    }
    .cattle-responsive thead th:first-child:after {
      content: "Select all shown";
      font-size: 12px;
      text-transform: none;
      letter-spacing: 0;
    }
    .cattle-responsive tbody {
      display: block;
      padding: 0 12px 12px;
    }
    .cattle-responsive tbody tr[data-open-animal] {
      position: relative;
      display: grid;
      grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
      gap: 8px;
      border: 1px solid var(--ux-border);
      border-radius: var(--ux-radius);
      margin-bottom: 10px;
      padding: 14px 12px;
    }
    .cattle-responsive td {
      display: block;
      border: 0;
      font-size: 12px;
      min-width: 0;
    }
    .cattle-responsive td[data-label]:not([data-label="Animal"]):before {
      content: attr(data-label);
      display: block;
      font-size: 10px;
      color: var(--ux-secondary);
      margin-bottom: 3px;
    }
    .cattle-responsive td[data-label="Animal"] {
      grid-column: 1/-1;
      min-height: 44px;
    }
    .cattle-responsive td.cattle-selection {
      position: absolute;
      top: 14px;
      left: 12px;
      display: flex;
      align-items: center;
      justify-content: center;
      min-width: 44px;
      min-height: 44px;
    }
    .cattle-responsive td.cattle-row-controls {
      grid-column: 1/-1;
      border-top: 1px solid var(--line);
    }
    
    .cattle-responsive .animal-avatar {
      width: 44px;
      height: 44px;
      flex-shrink: 0;
    }
    .cattle-responsive .cattle-group-heading {
      display: block;
      margin: 10px 0;
    }
    .cattle-responsive .cattle-group-heading th {
      display: block;
      border-radius: 5px;
      padding: 10px;
    }
    .cattle-panel:has(+ #selection-bar.has-selection) {
      margin-bottom: 180px;
    }
    #selection-bar.has-selection {
      position: fixed;
      bottom: calc(66px + env(safe-area-inset-bottom));
      left: 8px;
      right: 8px;
      z-index: 5;
    }
    #selection-bar .context-actions {
      position: static;
      border: 1px solid var(--ux-border);
      border-radius: var(--ux-radius);
    }
    #selection-bar .context-actions > strong {
      flex-basis: auto;
      margin-right: 0;
    }
    #selection-bar .context-actions .button {
      flex: 0 1 auto;
    }
    #selection-bar .context-actions .text-button {
      min-height: 44px;
    }
    
    .filter-chip {
      max-width: 100%;
      overflow-wrap: anywhere;
    }
  }
  
  .toast {
    display: flex;
    align-items: center;
    gap: 16px;
  }
  .toast-undo {
    border: 1px solid currentColor;
    min-height: 44px;
    padding: 6px 14px;
    background: transparent;
    border-radius: 6px;
    font-weight: 700;
  }
  .ux-field-marker {
    font-size: 0.75rem;
    color: #45564b;
    font-weight: 400;
    margin-left: 6px;
  }
  .ux-field-error {
    color: #922d24;
    font-size: 0.85rem;
    margin: 5px 0;
  }
  .ux-error-summary {
    border: 2px solid #a63c31;
    padding: 12px;
    border-radius: 8px;
    color: #80251d;
  }
  .ux-error-summary a {
    color: inherit;
    text-decoration: underline;
  }
  
  
  
  .task-completed {
    opacity: 1;
    color: var(--ux-secondary);
  }
  
  .sale-review-facts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .sale-review-facts > div {
    padding: 10px;
    background: #fff;
    border-radius: 6px;
  }
  .sale-review-facts dt {
    font-size: 0.8rem;
    color: #45564b;
  }
  .sale-review-facts dd {
    margin: 4px 0;
    font-weight: 700;
  }
  [hidden] {
    display: none !important;
  } /* The checkbox itself fills its cell so gloves and touch do not require precision. */
  .cattle-responsive .cattle-selection input {
    width: 44px;
    height: 44px;
    margin: 0;
  }
  .cattle-responsive .cattle-selection {
    cursor: pointer;
  }
  @media (max-width: 760px) {
    .cattle-responsive thead th:first-child input {
      width: 44px;
      height: 44px;
      margin: 0;
    }
    .icon-button,
    .header-mobile-search,
    .pasture-editor .map-tools button,
    .profile-actions .button {
      min-width: 44px;
      min-height: 44px;
    }
  }
  .cattle-responsive .select-hit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    margin: 0;
  }
  .context-actions button {
    min-width: 44px;
  }
  @media (min-width: 761px) and (max-width: 1100px) {
    #selection-bar.has-selection {
      left: 158px;
      bottom: 16px;
    }
    .cattle-responsive tbody tr[data-open-animal] {
      grid-template-columns: repeat(4, minmax(0, 1fr));
    }
    .cattle-responsive td[data-label="Animal"],
    .cattle-responsive td.cattle-row-controls {
      grid-column: 1/-1;
    }
  }
}
