:root {
  color-scheme: light;
  font-family: "Instrument Sans", system-ui, sans-serif;
  color: #172745;
  background: #edf2fa;
  --navy: #101d39;
  --blue: #24447b;
  --muted: #475c7b;
  --border: #d5dfef;
  --tint: #f2f6fd;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
header { background: linear-gradient(125deg, var(--navy), #1e3966); color: #fff; }
.wrap { width: min(100% - 32px, 740px); margin-inline: auto; }
.masthead { padding-block: 30px 36px; }
.stable { font-weight: 700; letter-spacing: .12em; text-transform: uppercase; font-size: .78rem; color: #b9d0ff; }
h1 { font-family: "Instrument Serif", Georgia, serif; font-size: clamp(2.25rem, 7vw, 4rem); font-weight: 400; letter-spacing: -.035em; margin: .3em 0 .1em; line-height: 1; }
p { line-height: 1.5; margin: .55em 0 1em; }
header p { margin-bottom: 0; color: #dce7fb; }
#logout { margin-top: 12px; color: var(--navy); }
#auth { max-width: 440px; margin-inline: auto; }
#auth-message:empty { display: none; }
main { padding-block: 20px 36px; }
.workspace-views { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 6px; margin-bottom: 16px; background: #dce5f4; border-radius: 14px; position: sticky; top: 8px; z-index: 10; box-shadow: 0 4px 14px #101d3912; }
.workspace-views button { background: transparent; border-color: transparent; }
.workspace-views button[aria-pressed="true"] { background: var(--navy); color: #fff; box-shadow: 0 2px 6px #101d3920; }
form { display: grid; gap: 14px; }
#admin { display: grid; gap: 14px; }
#schedule-form { margin-top: 16px; background: var(--tint); border: 1px solid var(--border); border-radius: 14px; padding: 14px; }
#schedule-save { background: var(--blue); color: #fff; border-color: var(--blue); }
#schedule-list, #schedule-settled { display: grid; gap: 10px; }
#schedule-list, #schedule-horses { margin-top: 16px; }
#schedule-preview button[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.schedule-table-wrap { max-width: 100%; overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
.schedule-table-wrap table { width: 100%; border-collapse: collapse; text-align: left; font-size: .9rem; }
.schedule-table-wrap th, .schedule-table-wrap td { padding: 10px; vertical-align: top; overflow-wrap: anywhere; }
.schedule-table-wrap th { background: var(--navy); color: #fff; }
.schedule-table-wrap td { border-top: 1px solid var(--border); }
.schedule-table-wrap tr:nth-child(even) { background: var(--tint); }
.schedule-instructor { display: inline-block; padding: 4px 8px; border-radius: 6px; border-inline-start: 3px solid hsl(var(--instructor-hue) 54% 42%); background: hsl(var(--instructor-hue) 72% 92%); color: hsl(var(--instructor-hue) 60% 23%); font-weight: 700; }
.schedule-ride { background: var(--tint); border: 1px solid var(--border); border-inline-start: 4px solid #6485bf; border-radius: 12px; padding: 14px; overflow-wrap: anywhere; }
.schedule-ride h4 { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin: 0 0 12px; }
.schedule-ride time { padding: 4px 9px; border-radius: 6px; background: var(--blue); color: #fff; font-variant-numeric: tabular-nums; }
.schedule-ride dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(115px, 1fr)); gap: 10px; margin: 0; }
.schedule-ride dt { color: var(--muted); font-size: .82rem; }
.schedule-ride dd { margin: 3px 0 0; font-weight: 650; }
#review, #review-details { margin-top: 16px; }
#review-details p { overflow-wrap: anywhere; white-space: pre-wrap; }
section { background: #fff; border: 1px solid var(--border); padding: clamp(15px, 4vw, 25px); border-radius: 18px; box-shadow: 0 4px 14px #101d3909; }
h2 { font-size: 1.2rem; margin: 0 0 16px; display: flex; align-items: center; gap: 10px; }
.count { background: #dce8fb; color: var(--blue); padding: 3px 9px; border-radius: 100px; font-size: .8rem; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.wide { grid-column: 1 / -1; }
label { display: grid; align-content: start; gap: 6px; font-size: .875rem; font-weight: 650; min-width: 0; }
input, select, textarea, button { font: inherit; font-size: 1rem; color: inherit; }
input, select, textarea { display: block; width: 100%; max-width: 100%; min-width: 0; min-height: 46px; border-radius: 9px; border: 1px solid #a8bad6; background: #fff; padding: 9px; }
input[type="date"], input[type="time"], input[type="month"] { -webkit-appearance: none; appearance: none; height: 48px; overflow: hidden; }
input::-webkit-date-and-time-value { text-align: left; min-width: 0; }
input::-webkit-datetime-edit { min-width: 0; padding: 0; }
select { height: 48px; text-overflow: ellipsis; }
textarea { resize: vertical; }
button { min-height: 46px; border: 1px solid #a8bad6; border-radius: 9px; background: var(--tint); padding: 8px 15px; cursor: pointer; font-weight: 700; }
.primary { background: var(--blue); color: white; border-color: var(--blue); width: 100%; }
:focus-visible { outline: 3px solid #5076bd; outline-offset: 2px; }
.ride { margin-bottom: 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--tint); }
summary { cursor: pointer; padding: 13px; font-weight: 700; overflow-wrap: anywhere; }
.ride-fields { padding: 0 12px 12px; }
.remove { justify-self: start; color: #8b3429; background: transparent; border-color: #cfb6ac; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
#status:empty { display: none; }
#status { margin-bottom: 0; }
@media (max-width: 600px) {
  .masthead { padding-block: 22px 24px; }
  h1 { font-size: 2.1rem; line-height: 1.1; }
  .wrap { width: calc(100% - 24px); }
  section { padding: 16px; border-radius: 16px; min-width: 0; }
  .fields { grid-template-columns: minmax(0, 1fr); }
  #schedule-form { padding: 12px; }
  .workspace-views { top: max(8px, env(safe-area-inset-top)); }
  .workspace-views button { min-width: 0; padding-inline: 7px; font-size: .9rem; }
  #schedule-preview > .actions { display: grid; grid-template-columns: 1fr 1fr; }
  #schedule-preview > .actions button { min-width: 0; padding-inline: 6px; font-size: .9rem; }
  #schedule-form .actions button { flex: 1; }
  #schedule-plan, #schedule-horses { min-width: 0; }
}
