:root {
  color-scheme: light;
  --ink: #18332f;
  --muted: #64736d;
  --green: #1d5148;
  --green-dark: #173f38;
  --green-pale: #e9f1ed;
  --cream: #f8f6f0;
  --paper: #fffefa;
  --line: #dce4de;
  --gold: #d8ae60;
  --red: #9d463b;
  --shadow: 0 16px 45px rgba(28, 55, 47, .09);
  font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  min-height: 100vh;
}
button, input, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid #d2a84f;
  outline-offset: 2px;
}
.hidden { display: none !important; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.topbar {
  min-height: 76px; padding: 12px max(22px, calc((100% - 1120px) / 2));
  display: flex; align-items: center; justify-content: space-between;
  background: var(--green-dark); color: white;
}
.brand { display: inline-flex; gap: 11px; align-items: center; color: inherit; text-decoration: none; }
.brand img { border-radius: 12px; }
.brand span { display: grid; gap: 1px; }
.brand strong { font-family: Georgia, serif; font-size: 18px; letter-spacing: .01em; }
.brand small { color: #c9dbd1; font-size: 11px; letter-spacing: .11em; text-transform: uppercase; }
.account-area { display: flex; align-items: center; gap: 16px; }
.account-name { color: #e7eee9; font-size: 14px; }
.page { width: min(1120px, calc(100% - 40px)); margin: 44px auto 66px; min-height: 58vh; }
.login-layout {
  display: grid; grid-template-columns: 1fr;
  place-items: center; min-height: calc(100vh - 130px);
}
.login-card { width: min(100%, 390px); }
.private-project-note { text-align: center; margin-top: 17px; }
.home-panel {
  padding: clamp(25px, 5vw, 70px) 15px;
  display: flex; flex-direction: column; align-items: center;
  text-align: center; gap: 8px;
}
.home-panel .home-logo {
  display: block; width: 90px; height: 90px; object-fit: contain;
  margin-bottom: 16px; border-radius: 18px;
}
.home-panel h1 {
  margin: 0 0 12px; color: var(--green-dark);
  font-size: clamp(39px, 5.6vw, 66px); line-height: 1.07;
}
.home-panel .lead { max-width: 530px; margin: 0; }
.home-panel .rule-chips { justify-content: center; margin: 18px 0 12px; }
.home-panel .button { min-width: 180px; }


.eyebrow {
  margin: 0 0 10px; color: #718178; font-size: 11px; font-weight: 750;
  letter-spacing: .16em; text-transform: uppercase;
}
h1, h2, h3, p { margin-top: 0; }
h1, h2 { font-family: Georgia, "Times New Roman", serif; letter-spacing: -.025em; }

.lead { max-width: 460px; color: #62716b; font-size: 18px; line-height: 1.65; }
.rule-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 30px; }
.rule-chips span {
  border: 1px solid #d7e2db; border-radius: 99px; padding: 8px 11px;
  background: rgba(255,255,255,.48); color: #4f685c; font-size: 12px;
}
.card, .panel {
  border: 1px solid rgba(213, 224, 216, .95); border-radius: 20px;
  background: var(--paper); box-shadow: var(--shadow);
}
.login-card { padding: 32px; }
.card-heading { display: flex; gap: 14px; align-items: center; margin-bottom: 24px; }
.card-heading h2 { margin: 0; font-size: 30px; }
.icon-mark {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px;
  background: var(--green-pale); color: var(--green); font-size: 22px;
}
label { display: block; margin: 15px 0 7px; color: #42544c; font-size: 13px; font-weight: 700; }
input, select {
  width: 100%; min-height: 45px; border: 1px solid #cfd9d2; border-radius: 9px;
  padding: 10px 12px; background: white; color: var(--ink);
}
input::placeholder { color: #9aa69f; }
.button {
  display: inline-flex; justify-content: center; align-items: center; gap: 7px;
  min-height: 42px; border: 1px solid transparent; border-radius: 9px;
  padding: 10px 15px; font-size: 13px; font-weight: 720; transition: .16s ease;
}
.button:hover { transform: translateY(-1px); }
.button-primary { background: var(--green); color: white; }
.button-primary:hover { background: #163f38; }
.button-secondary { border-color: #cfdcd2; background: var(--green-pale); color: var(--green-dark); }
.button-quiet { background: transparent; color: inherit; border-color: rgba(255,255,255,.25); }
.site-footer .button-quiet { color: var(--ink); border-color: var(--line); }
.button-wide { width: 100%; margin-top: 21px; }
.hint { margin: 15px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.notice {
  position: fixed; z-index: 10; top: 88px; left: 50%; transform: translateX(-50%);
  width: min(620px, calc(100% - 28px)); border: 1px solid #bfd4c6; border-radius: 11px;
  padding: 13px 17px; background: #eef6ef; box-shadow: var(--shadow); color: #25473a;
  font-size: 14px;
}
.notice.error { border-color: #e6c4bd; background: #fbefec; color: #76362e; }
.connection-note { padding: 10px 20px; background: #9d463b; color: white; text-align: center; font-size: 13px; }
.narrow-card { max-width: 560px; margin: 34px auto; padding: 32px; }
.narrow-card h1 { margin-bottom: 12px; font-size: 34px; }
.narrow-card > p:not(.eyebrow) { color: var(--muted); line-height: 1.6; }
.form-stack { display: grid; gap: 4px; }
.form-stack label { margin-top: 12px; }
.form-stack h3 { margin: 14px 0 2px; font-size: 16px; }
.form-stack .button { margin-top: 15px; }
.welcome-bar { display: flex; justify-content: space-between; align-items: end; margin-bottom: 24px; }
.welcome-bar h1 { margin: 0; color: var(--green-dark); font-size: 42px; }
.welcome-caption { margin: 0 0 5px; color: var(--muted); font-size: 12px; }
.tabs {
  display: flex; gap: 5px; overflow-x: auto; padding: 5px; margin-bottom: 18px;
  border: 1px solid var(--line); border-radius: 12px; background: #eef1eb;
}
.tab {
  flex: 0 0 auto; border: 0; border-radius: 8px; padding: 11px 15px;
  background: transparent; color: #66756c; font-size: 13px; font-weight: 700;
}
.tab.active { background: white; color: var(--green-dark); box-shadow: 0 2px 8px rgba(27,53,44,.09); }
.panel { padding: clamp(20px, 4vw, 34px); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.panel-heading h2 { margin: 0; font-size: 31px; }
.board-controls { display: flex; align-items: center; gap: 10px; }
.view-toggle { display: flex; gap: 3px; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: #eef1eb; }
.view-toggle-button { border: 0; border-radius: 7px; padding: 8px 11px; background: transparent; color: #66756c; font-size: 12px; font-weight: 700; }
.view-toggle-button.active { background: #fff; color: var(--green-dark); box-shadow: 0 2px 7px rgba(27,53,44,.09); }
.date-control { display: flex; align-items: center; gap: 7px; }
.date-control input { width: auto; min-height: 40px; padding: 7px 9px; }
.icon-button {
  display: grid; place-items: center; width: 39px; height: 39px; border: 1px solid var(--line);
  border-radius: 9px; background: white; color: var(--green); font-size: 26px; line-height: 1;
}
.legend { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 15px; color: #637168; font-size: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; background: #6ba483; }
.legend-dot.reserved { background: #d2a052; }
.legend-dot.locked { background: #aab4ac; }
.legend-dot.maintenance { background: #8f9a9b; }
.opening-summary { margin-bottom: 10px; color: var(--muted); font-size: 12px; }
.slot-list { display: grid; gap: 7px; }
.multi-day-list { grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); align-items: start; gap: 13px; }
.multi-day-card { min-width: 0; border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #fff; }
.multi-day-heading { margin: 0 0 12px; color: var(--green-dark); font: 700 17px/1.3 Georgia, "Times New Roman", serif; }
.multi-day-slots .slot-row { grid-template-columns: minmax(74px, .62fr) minmax(0, 1fr) auto; gap: 8px; padding: 8px; }
.slot-row {
  display: grid; grid-template-columns: minmax(100px, .65fr) minmax(120px, 1fr) auto;
  align-items: center; gap: 12px; min-height: 60px; border: 1px solid var(--line);
  border-radius: 11px; padding: 9px 13px; background: #fff;
}
.slot-row.available { border-color: #c7ded0; background: #f6fbf7; }
.slot-row.reserved { border-color: #ead9b5; background: #fdf9f0; }
.slot-row.maintenance { border-color: #d3dadb; background: #f1f4f4; }
.slot-row.maintenance .slot-description { color: #435a5c; font-weight: 700; }
.slot-row.maintenance .slot-state { color: #57676a; }
.slot-row.locked { background: #f8f8f5; }
.slot-time { color: #2e4940; font-size: 14px; font-variant-numeric: tabular-nums; font-weight: 760; }
.slot-description { color: #65746c; font-size: 13px; }
.slot-state { color: #5a6d61; font-size: 11px; }
.slot-row.reserved .slot-state { color: #87632d; }
.slot-row .button { min-height: 36px; padding: 7px 12px; }
.empty-state { padding: 28px; border: 1px dashed #cdd8cf; border-radius: 12px; color: var(--muted); text-align: center; }
.inline-form {
  display: grid; grid-template-columns: minmax(150px, .65fr) minmax(180px, 1.2fr) auto;
  gap: 10px; align-items: end; margin: 20px 0 10px;
}
.inline-form label { margin: 0 0 7px; }
.inline-form input { min-width: 0; }
.admin-user-form { grid-template-columns: minmax(160px, .7fr) minmax(180px, 1fr) minmax(190px, auto) auto; }
.checkbox-label { display: flex; align-items: center; gap: 8px; margin: 0 0 9px !important; font-size: 13px; font-weight: 650; }
.checkbox-label input { width: auto; min-width: 18px; min-height: auto; margin: 0; }
.field-label { margin: 12px 0 8px; color: #42544c; font-size: 13px; font-weight: 700; }
.weekday-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(125px, 1fr)); gap: 4px 8px; }
.weekday-choices .checkbox-label { margin: 0 !important; }
.item-list { display: grid; gap: 9px; margin-top: 20px; }
.item-card {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border: 1px solid var(--line); border-radius: 11px; padding: 14px 16px; background: #fff;
}
.item-main { display: grid; gap: 4px; }
.item-title { font-weight: 730; }
.item-meta { color: var(--muted); font-size: 12px; }
.item-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.button-small { min-height: 33px; padding: 6px 10px; font-size: 11px; }
.button-danger { border-color: #e2c9c4; background: #fff5f2; color: #8d4036; }
.profile-user { color: var(--muted); }
.compact-form { max-width: 460px; margin-top: 22px; }
.table-wrap { overflow-x: auto; margin-top: 22px; }
.admin-hall-settings { margin-bottom: 32px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: #f7faf7; }
.admin-hall-settings h2 { margin: 0; font-size: 23px; }
.admin-hall-settings .hint { margin: 10px 0 14px; }
.admin-hall-settings .button { justify-self: start; }
.admin-times-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 195px), 1fr)); gap: 12px; }
.admin-time-group { min-width: 0; background: white; border: 1px solid var(--line); border-radius: 11px; padding: 13px; }
.admin-time-group h3 { margin-bottom: 12px; font-size: 15px; }
.admin-time-group label:not(.checkbox-label) { margin: 10px 0 5px; }
.admin-time-group input[type="time"] { min-width: 0; }
.admin-horse-management, .admin-booking-management { margin-top: 28px; }
.admin-horse-management h3, .admin-booking-management h3 { margin: 0; font-size: 18px; }
.admin-horse-management .hint, .admin-booking-management .hint { margin: 7px 0; }
.admin-booking-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { border-bottom: 1px solid var(--line); padding: 12px 10px; font-size: 13px; vertical-align: middle; }
th { color: #64736b; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.credential-box {
  margin-top: 15px; border: 1px solid #d4bd7d; border-radius: 10px; padding: 13px 15px;
  background: #fff9e9; color: #584720; white-space: pre-wrap; overflow-wrap: anywhere;
}
.dialog {
  width: min(450px, calc(100% - 28px)); border: 1px solid var(--line); border-radius: 17px;
  padding: 25px; background: var(--paper); color: var(--ink); box-shadow: 0 25px 90px rgba(9,29,23,.3);
}
.dialog::backdrop { background: rgba(14, 33, 27, .48); }
.dialog h2 { margin-bottom: 16px; font-size: 28px; }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.site-footer {
  width: min(1120px, calc(100% - 40px)); margin: 0 auto; border-top: 1px solid var(--line);
  padding: 24px 0 32px; color: #748179; font-size: 11px;
}
.site-footer > p { margin-bottom: 12px; }
.legal-details { color: #526259; }
.legal-details summary { width: fit-content; cursor: pointer; color: var(--green); font-weight: 700; }
.legal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin-top: 18px; }
.legal-grid article { max-width: 560px; }
.legal-grid h2 { margin-bottom: 8px; color: var(--ink); font-size: 20px; }
.legal-grid p { line-height: 1.6; }
.sample-warning { color: #8a5730; font-weight: 700; }
@media (max-width: 760px) {
  .multi-day-list { grid-template-columns: 1fr; }
  .topbar { min-height: 66px; padding-inline: 16px; }
  .brand img { width: 36px; height: 36px; }
  .account-area { gap: 8px; }
  .account-name { max-width: 95px; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
  .account-area .button { min-height: 35px; padding: 7px 9px; font-size: 11px; }
  .page { width: min(100% - 26px, 620px); margin: 25px auto 42px; }
  .login-layout { min-height: calc(100dvh - 95px); }
  .home-panel h1 { font-size: clamp(36px, 10vw, 46px); }
  .lead { font-size: 15px; }
  .rule-chips { margin-top: 17px; }
  .login-card { padding: 23px; }
  .welcome-bar { align-items: start; flex-direction: column; gap: 8px; }
  .welcome-bar h1 { font-size: 35px; }
  .welcome-caption { margin: 0; }
  .tabs { margin-bottom: 12px; }
  .tab { padding: 10px 12px; font-size: 12px; }
  .panel { padding: 19px 14px; border-radius: 15px; }
  .panel-heading { align-items: flex-start; flex-direction: column; }
  .panel-heading h2 { font-size: 27px; }
  .board-controls { width: 100%; flex-direction: column; align-items: stretch; }
  .view-toggle { width: 100%; }
  .view-toggle-button { flex: 1; }
  .date-control { align-self: stretch; justify-content: space-between; }
  .date-control input { flex: 1; }
  .slot-row { grid-template-columns: minmax(76px, .55fr) minmax(0, 1fr) auto; gap: 8px; padding: 9px; }
  .slot-time { font-size: 12px; }
  .slot-description { font-size: 12px; }
  .slot-state { font-size: 10px; }
  .slot-row .button { padding: 6px 8px; font-size: 11px; }
  .inline-form { grid-template-columns: 1fr; gap: 0; }
  .inline-form .button { margin-top: 10px; }
  .admin-booking-heading { align-items: flex-start; flex-direction: column; }
  .item-card { align-items: flex-start; flex-direction: column; }
  .item-actions { width: 100%; }
  .legal-grid { grid-template-columns: 1fr; gap: 16px; }
  .site-footer { width: calc(100% - 28px); }
  .narrow-card { padding: 23px; }
}
@media (max-width: 390px) {
  .slot-row { grid-template-columns: minmax(74px, .7fr) minmax(0, 1fr); }
  .slot-row .button, .slot-row .slot-state { grid-column: 2; justify-self: start; }
  .legend { gap: 10px; font-size: 11px; }
}

.icon-button:disabled { opacity: .42; cursor: not-allowed; transform: none; }
