:root {
  color-scheme: light;
  --bg: #f6f8f1;
  --surface: #ffffff;
  --surface-soft: #edf3ed;
  --ink: #15251f;
  --muted: #60706a;
  --line: #d8e0d6;
  --green: #0f4f43;
  --green-2: #16725f;
  --gold: #f0be4d;
  --red: #b9414a;
  --amber: #d99224;
  --blue: #2f5c88;
  --shadow: 0 18px 45px rgba(21, 37, 31, 0.12);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(15, 79, 67, 0.09), transparent 300px),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(216, 224, 214, 0.9);
  background: rgba(246, 248, 241, 0.92);
  backdrop-filter: blur(14px);
}

.topbar-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  width: min(1180px, calc(100% - 32px));
  min-height: 76px;
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: var(--radius);
  background: var(--gold);
  box-shadow: 0 10px 25px rgba(15, 79, 67, 0.18);
}

.brand-mark svg {
  width: 36px;
  height: 36px;
}

.brand-mark img {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  object-fit: cover;
}

.brand-text {
  min-width: 0;
}

.brand-title {
  display: block;
  overflow: hidden;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-subtitle {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.9rem;
}

.nav-tabs {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.nav-tab {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  text-decoration: none;
  white-space: nowrap;
}

.nav-tab svg {
  width: 17px;
  height: 17px;
}

.nav-tab .horse-icon-image {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  object-fit: cover;
}

.nav-tab.active {
  color: #fff;
  background: var(--green);
}

.page {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.page-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: end;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--green-2);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.12;
}

h1 {
  font-size: clamp(2rem, 5vw, 4.2rem);
  max-width: 800px;
}

h2 {
  font-size: 1.45rem;
}

h3 {
  font-size: 1rem;
}

p {
  margin: 0;
}

.lede {
  max-width: 720px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.55;
}

.hero-band {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 22px;
  align-items: stretch;
  margin-bottom: 24px;
}

.hero-copy {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(260px, 1fr);
  gap: 18px;
  align-items: center;
  min-height: 260px;
  padding: clamp(20px, 4vw, 36px);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(15, 79, 67, 0.96), rgba(47, 92, 136, 0.9)),
    var(--green);
  color: #fff;
  box-shadow: var(--shadow);
}

.hero-text {
  min-width: 0;
}

.hero-copy .eyebrow,
.hero-copy .lede {
  color: rgba(255, 255, 255, 0.78);
}

.hero-photo {
  width: 100%;
  height: 100%;
  min-height: 220px;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: 0 20px 34px rgba(2, 18, 14, 0.22);
}

.today-panel {
  display: grid;
  min-height: 260px;
  gap: 14px;
  align-content: start;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.mini-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.mini-stat {
  min-height: 82px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.mini-stat strong {
  display: block;
  font-size: 1.6rem;
}

.mini-stat.warning {
  border-color: rgba(185, 65, 74, 0.45);
  background: rgba(185, 65, 74, 0.08);
}

.mini-stat span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
}

.home-photo-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.photo-mini {
  display: grid;
  min-height: 112px;
  grid-template-rows: 78px auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: center;
}

.photo-mini img {
  width: 100%;
  height: 78px;
  object-fit: cover;
}

.photo-mini span {
  display: grid;
  min-height: 34px;
  place-items: center;
  padding: 4px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
}

.tile-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.feature-tile,
.horse-card,
.slot-card,
.panel,
.appointment-item,
.duty-row {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(21, 37, 31, 0.08);
}

.feature-tile {
  display: grid;
  min-height: 210px;
  grid-template-rows: 116px 1fr;
  overflow: hidden;
  color: var(--ink);
  text-decoration: none;
}

.tile-thumb {
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--surface-soft);
}

.tile-thumb.image-thumb {
  position: relative;
  background: #d8e0d6;
}

.tile-thumb.image-thumb::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(180deg, transparent 45%, rgba(15, 79, 67, 0.16));
}

.tile-thumb.image-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tile-thumb.planner {
  background: linear-gradient(135deg, rgba(47, 92, 136, 0.2), rgba(240, 190, 77, 0.35));
}

.tile-thumb.checklist {
  background: linear-gradient(135deg, rgba(15, 79, 67, 0.18), rgba(185, 65, 74, 0.16), rgba(240, 190, 77, 0.32));
}

.tile-thumb.horses {
  background: linear-gradient(135deg, rgba(15, 79, 67, 0.2), rgba(47, 92, 136, 0.18));
}

.tile-thumb svg {
  width: min(88%, 150px);
  height: 96px;
}

.tile-body {
  padding: 18px;
}

.tile-body p {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.45;
}

.layout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
}

.panel {
  padding: 18px;
}

.panel-heading {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.icon-button,
.primary-button,
.secondary-button,
.danger-button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border-radius: var(--radius);
  font-weight: 750;
}

.icon-button {
  width: 40px;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--green);
}

.icon-button.danger {
  color: var(--red);
}

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

.secondary-button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--green);
}

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

.warning-button {
  background: var(--red);
}

.icon-button svg,
.primary-button svg,
.secondary-button svg,
.danger-button svg {
  width: 18px;
  height: 18px;
}

.month-title {
  min-width: 190px;
  text-align: center;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  overflow: hidden;
  border-radius: var(--radius);
}

.weekday,
.day-cell {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.weekday {
  padding: 10px 8px;
  background: var(--green);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
}

.day-cell {
  min-height: 116px;
  padding: 8px;
  background: #fff;
}

.day-cell.other-month {
  background: #f4f6f0;
  color: #94a19b;
}

.day-cell.today {
  box-shadow: inset 0 0 0 2px var(--gold);
}

.day-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.day-number {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-weight: 800;
}

.day-cell.today .day-number {
  background: var(--gold);
}

.day-add {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--green);
}

.day-events {
  display: grid;
  gap: 5px;
  margin-top: 8px;
}

.event-chip {
  overflow: hidden;
  padding: 5px 7px;
  border-left: 4px solid var(--blue);
  border-radius: 5px;
  background: #eef4fb;
  color: #1b3d5f;
  font-size: 0.78rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-chip.health {
  border-left-color: var(--red);
  background: #fbecef;
  color: #7e222b;
}

.event-chip.farrier {
  border-left-color: var(--green-2);
  background: #edf7f3;
  color: #155747;
}

.event-chip.yard {
  border-left-color: var(--amber);
  background: #fff5df;
  color: #785013;
}

.form-grid {
  display: grid;
  gap: 12px;
}

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

.field span,
.field label,
.field-title {
  color: var(--muted);
  font-size: 0.83rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  outline: none;
}

input,
select {
  min-height: 42px;
  padding: 0 12px;
}

textarea {
  min-height: 132px;
  resize: vertical;
  padding: 12px;
  line-height: 1.45;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--green-2);
  box-shadow: 0 0 0 4px rgba(22, 114, 95, 0.12);
}

.appointment-list,
.duty-list,
.horse-grid {
  display: grid;
  gap: 10px;
}

.appointment-item {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.appointment-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
}

.appointment-top strong {
  overflow-wrap: anywhere;
}

.appointment-meta {
  color: var(--muted);
  font-size: 0.86rem;
}

.reminder-note {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--green);
  font-size: 0.86rem;
  font-weight: 800;
}

.reminder-note svg {
  width: 16px;
  height: 16px;
}

.appointment-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.small-button {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 9px;
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--green);
  font-size: 0.82rem;
  font-weight: 800;
}

.small-button.delete {
  color: var(--red);
}

.small-button svg {
  width: 15px;
  height: 15px;
}

.date-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}

.status-panel {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.status-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  height: 34px;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
}

.status-segment {
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.status-segment.red {
  background: #ca4450;
}

.status-segment.amber {
  background: #d99224;
}

.status-segment.green {
  background: #16825f;
}

.status-segment.active {
  color: #fff;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.7);
}

.progress-note {
  color: var(--muted);
  font-size: 0.95rem;
}

.duty-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 58px;
  padding: 10px 12px;
}

.check-input {
  width: 24px;
  height: 24px;
  accent-color: var(--green);
}

.duty-title {
  overflow-wrap: anywhere;
  font-weight: 750;
}

.empty-state {
  display: grid;
  min-height: 160px;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.66);
  color: var(--muted);
  text-align: center;
}

.empty-state.compact {
  min-height: 88px;
  padding: 12px;
}

.stock-summary {
  display: grid;
  min-width: 170px;
  min-height: 82px;
  place-items: center;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(21, 37, 31, 0.08);
  text-align: center;
}

.stock-summary.warning {
  border-color: rgba(185, 65, 74, 0.45);
  background: rgba(185, 65, 74, 0.08);
}

.stock-summary strong {
  font-size: 2rem;
  line-height: 1;
}

.stock-summary span {
  color: var(--muted);
  font-size: 0.83rem;
  font-weight: 800;
}

.stock-alert {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid rgba(185, 65, 74, 0.34);
  border-radius: var(--radius);
  background: rgba(185, 65, 74, 0.08);
  color: var(--red);
}

.stock-alert.ok {
  border-color: rgba(22, 114, 95, 0.32);
  background: rgba(22, 114, 95, 0.08);
  color: var(--green);
}

.stock-alert svg {
  width: 40px;
  height: 40px;
}

.stock-alert strong,
.stock-alert span {
  display: block;
  overflow-wrap: anywhere;
}

.stock-alert strong {
  color: var(--ink);
}

.stock-list,
.stock-log {
  display: grid;
  gap: 12px;
}

.stock-card {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(21, 37, 31, 0.08);
}

.stock-card.low {
  border-color: rgba(185, 65, 74, 0.45);
}

.stock-card.at-minimum {
  border-color: rgba(217, 146, 36, 0.5);
}

.stock-card-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.stock-name-input {
  min-height: 36px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 1.2rem;
  font-weight: 850;
}

.stock-name-input:focus {
  box-shadow: none;
}

.stock-badge {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  margin-top: 4px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(22, 114, 95, 0.1);
  color: var(--green);
  font-size: 0.76rem;
  font-weight: 900;
}

.stock-badge.low {
  background: rgba(185, 65, 74, 0.12);
  color: var(--red);
}

.stock-badge.amber {
  background: rgba(217, 146, 36, 0.14);
  color: #8a5407;
}

.stock-field-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.stock-meter {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-soft);
}

.stock-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green-2);
}

.stock-card.low .stock-meter span {
  background: var(--red);
}

.stock-card.at-minimum .stock-meter span {
  background: var(--amber);
}

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

.stock-action-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.stock-action-form .secondary-button {
  min-width: 86px;
}

.stock-divider {
  height: 1px;
  margin: 18px 0;
  background: var(--line);
}

.compact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.stock-log-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.stock-log-row strong {
  overflow-wrap: anywhere;
}

.stock-log-row > span:last-child {
  grid-column: 2;
  color: var(--muted);
  font-size: 0.82rem;
}

.stock-log-type {
  align-self: start;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(185, 65, 74, 0.12);
  color: var(--red);
  font-size: 0.72rem;
  font-weight: 900;
}

.stock-log-type.added {
  background: rgba(22, 114, 95, 0.12);
  color: var(--green);
}

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

.horse-card,
.slot-card {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  min-height: 126px;
  padding: 14px;
  color: var(--ink);
  text-align: left;
  text-decoration: none;
}

.horse-card:hover,
.feature-tile:hover,
.nav-tab:hover,
.secondary-button:hover,
.icon-button:hover,
.small-button:hover {
  transform: translateY(-1px);
}

.horse-thumb {
  display: grid;
  width: 96px;
  height: 96px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.horse-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.horse-thumb svg {
  width: 58px;
  height: 58px;
}

.horse-thumb .horse-icon-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.horse-card strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.horse-card p,
.slot-card p {
  margin-top: 7px;
  color: var(--muted);
  line-height: 1.4;
}

.profile-layout {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.profile-photo {
  display: grid;
  gap: 12px;
}

.profile-photo-frame {
  display: grid;
  width: 100%;
  aspect-ratio: 1;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.profile-photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-photo-frame svg {
  width: 44%;
  height: 44%;
}

.profile-photo-frame .horse-icon-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-fields {
  display: grid;
  gap: 14px;
}

.certificate-panel {
  display: grid;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.qr-panel {
  display: grid;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.qr-card {
  display: grid;
  gap: 10px;
  justify-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  text-align: center;
}

.qr-print-heading {
  display: grid;
  gap: 3px;
}

.qr-print-heading strong {
  font-size: 1.05rem;
  overflow-wrap: anywhere;
}

.qr-print-heading span,
.qr-link {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.qr-link {
  width: 100%;
  overflow-wrap: anywhere;
}

.qr-code-svg {
  width: min(100%, 220px);
  height: auto;
  border: 8px solid #fff;
  box-shadow: 0 0 0 1px var(--line);
}

.certificate-card {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.certificate-preview {
  width: 100%;
  max-height: 260px;
  border-radius: 6px;
  object-fit: contain;
  background: #fff;
}

.certificate-file {
  display: grid;
  min-height: 126px;
  place-items: center;
  gap: 8px;
  padding: 16px;
  border-radius: 6px;
  background: #fff;
  color: var(--green);
  text-align: center;
}

.certificate-file svg {
  width: 42px;
  height: 42px;
}

.certificate-file span {
  max-width: 100%;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-weight: 800;
}

.certificate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.saved-note {
  color: var(--green-2);
  font-size: 0.9rem;
  font-weight: 800;
}

.limit-note {
  color: var(--muted);
  font-size: 0.92rem;
}

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

.settings-actions {
  display: grid;
  gap: 12px;
}

.about-list {
  display: grid;
  gap: 10px;
  margin: 0;
}

.about-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.about-list dt {
  color: var(--muted);
}

.about-list dd {
  margin: 0;
  font-weight: 700;
  text-align: right;
}

.install-banner {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  background: #fff8e5;
}

.install-banner img {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  object-fit: cover;
}

.install-banner strong {
  display: block;
  margin-bottom: 4px;
}

.install-banner span {
  color: var(--muted);
  font-size: 0.92rem;
}

/* iPhone: keep content clear of the notch and home bar, and stop Safari
   zooming in when a form field is tapped (it does that below 16px). */
.topbar {
  padding-top: env(safe-area-inset-top);
}

.page {
  padding-bottom: calc(56px + env(safe-area-inset-bottom));
}

@supports (-webkit-touch-callout: none) {
  input,
  select,
  textarea {
    font-size: max(16px, 1em);
  }
}

@media print {
  body {
    background: #fff;
  }

  body * {
    visibility: hidden;
  }

  #horse-qr-print,
  #horse-qr-print * {
    visibility: visible;
  }

  #horse-qr-print {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    max-width: 420px;
    padding: 24px;
    border: 0;
  }

  #horse-qr-print .secondary-button,
  #horse-qr-print .limit-note,
  .topbar {
    display: none;
  }

  .qr-card {
    box-shadow: none;
  }

  .qr-code-svg {
    width: 260px;
    box-shadow: none;
  }
}

@media (max-width: 920px) {
  .topbar-inner,
  .page-header,
  .hero-band,
  .hero-copy,
  .layout-grid,
  .profile-layout {
    grid-template-columns: 1fr;
  }

  .nav-tabs {
    width: 100%;
    overflow-x: auto;
  }

  .mini-stat-grid,
  .tile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 660px) {
  .topbar-inner,
  .page {
    width: min(100% - 20px, 1180px);
  }

  .topbar-inner {
    min-height: auto;
    padding: 10px 0;
  }

  .brand-title {
    font-size: 1.1rem;
  }

  .brand-subtitle,
  .nav-tab span {
    display: none;
  }

  .hero-copy,
  .today-panel,
  .panel {
    padding: 16px;
  }

  .hero-photo {
    min-height: 180px;
  }

  .mini-stat-grid {
    grid-template-columns: 1fr;
  }

  .tile-grid,
  .stock-field-grid,
  .stock-movement-grid,
  .stock-action-form,
  .compact-grid {
    grid-template-columns: 1fr;
  }

  .stock-summary {
    min-width: 0;
    justify-items: start;
    text-align: left;
  }

  .home-photo-strip {
    grid-template-columns: 1fr;
  }

  .calendar-grid {
    display: block;
    border: 0;
    overflow: visible;
  }

  .weekday {
    display: none;
  }

  .day-cell {
    display: none;
  }

  .day-cell.has-events,
  .day-cell.today {
    display: block;
    min-height: auto;
    margin-bottom: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
  }

  .day-cell.other-month:not(.today) {
    display: none;
  }

  .horse-card,
  .slot-card {
    grid-template-columns: 74px minmax(0, 1fr);
    min-height: 98px;
  }

  .horse-thumb {
    width: 74px;
    height: 74px;
  }
}
