/* =========================================================
   MENU
   	00. Variables & Base
   	01. Typography
   	02. Layout
   	03. Header
   	04. Navigation
   	05. Footer
   	06. Cards
   	07. Forms & Buttons
        07A. Inputs & Labels
        07B. Buttons
        07C. Form Layouts
        07D. Checkboxes & Class UI
        07E. Action Buttons
   	08. Alerts & Badges
   	09. Tables
   	10. Results & Exports
   	11. Auth / Login
   	12. Titles & Awards
   	13. Cookie Consent
   	14. Classes & Competition Entry
	15. Mobile
	16. My horses
	17. Result exporter
	18. Results
	19. Results list
	20. My horses
		20A. Horse list columns
        20B. Horse Cards
        20C. Horse Stats
        20D. Horse Levels
        20E. Horse Actions
        20F. Horse States
        20G. Horse Badges
        20H. Horse Edit Panel
   ========================================================= */


/* =========================================================
   00. VARIABLES & BASE
   ========================================================= */

:root {
    --green: #2f5d50;
    --light-green: #3d7a69;
    --dark-sand: #AD905A;
    --cream: #f5f1e8;
    --white: #ffffff;
    --gray: #666;
    --border: #ddd;
    --danger: #a33;
    --success-bg: #e5f6ea;
    --success-text: #2d7a46;
    --error-bg: #ffe5e5;
    --error-text: #a00;
    --card-shadow: 0 6px 18px rgba(0,0,0,0.08);
}

* {
    box-sizing: border-box;
    font-family: system-ui, Arial, sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--cream);
    color: #222;
}


/* =========================================================
   01. TYPOGRAPHY
   ========================================================= */

.berkshire-swash-regular {
    font-family: "Berkshire Swash", serif;
    font-weight: 400;
    font-style: normal;
}

.merienda-regular {
    font-family: "Merienda", cursive;
    font-optical-sizing: auto;
    font-style: normal;
}


.fredoka-medium {
  font-family: "Fredoka", sans-serif;
  font-optical-sizing: auto;
  font-weight: 300;
  font-style: normal;
  font-variation-settings:
    "wdth" 100;
}

h1,
.site-name,
.title-text h1,
.header h1,
.login-header h1,
.admin-header h1,
.admin-header .site-name {
    font-family: "Berkshire Swash", serif;
}

h1,
h2,
h3,
h4 {
    line-height: 1.2;
}

.small {
    font-size: 13px;
    color: var(--gray);
}


/* =========================================================
   02. LAYOUT
   ========================================================= */

.page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.container {
    max-width: 1000px;
    margin: auto;
    padding: 20px;
}

.grid {
    display: grid;
    gap: 20px;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.table-scroll {
    overflow-x: auto;
}


/* =========================================================
   03. HEADER
   ========================================================= */

.header {
    position: relative;
    z-index: 2;
    padding: 10px 20px;
    background: var(--green);
    color: #fff;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.logo-title {
    position: relative;
    display: flex;
    align-items: flex-start;
}

.logo {
    position: absolute;
    top: 10px;
    left: 0;
    z-index: 5;
    height: 150px;
    border-radius: 50%;
	border: 5px solid var(--green);
    box-shadow: 4px 2px 12px #666666;
    /* box-shadow: 4px 2px 12px rgba(0,0,0,0.15); */
}

.title-text {
    display: flex;
    flex-direction: column;
    margin-left: 170px;
}

.title-text h1 {
    margin: 0;
    font-size: 28px;
}

.title-text h2 {
    margin: 3px 0 0;
    font-size: 16px;
    color: var(--dark-sand);
}

.header h1 {
    margin: 0;
    font-size: 28px;
    line-height: 1.1;
}

.header h2 {
    margin: 3px 0 0;
    font-size: 16px;
    line-height: 1.2;
    color: var(--dark-sand);
}

.header-image,
.adaptive-header {
 	border-bottom: 3px solid var(--dark-sand);
}

.header-image {
    height: 400px;
    margin-top: 0;
    background: url('../assets/header.png') center/cover;
}

.adaptive-header {
    position: relative;
    height: 400px;
    overflow: hidden;
}

.adaptive-header img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.adaptive-header::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.adaptive-header-none::after {
    background: transparent;
}

.adaptive-header-dark::after {
    background: rgba(0, 0, 0, 0.42);
}

.adaptive-header-light::after {
    background: rgba(255, 255, 255, 0.42);
}

.adaptive-header-content {
    position: absolute;
    z-index: 2;
    left: 24px;
    right: 24px;
    bottom: 24px;
    max-width: 720px;
    color: white;
}

.adaptive-header-light .adaptive-header-content {
    color: #222;
}

.header-over-hero {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 20;
    background: linear-gradient(
        to bottom,
        rgba(0,0,0,0.35),
        rgba(0,0,0,0.08),
        rgba(0,0,0,0)
    );
}

.header-over-hero .title-text {
    display: none;
}

.header-over-hero .logo {
    top: 18px;
    height: 145px;
    background: rgba(255,255,255,0.75);
}

.header-over-hero .header-inner {
    align-items: flex-start;
}

.header-over-hero .nav-wrap {
    margin-top: 14px;
}

.header-over-hero .nav a,
.header-over-hero .nav-dropdown-toggle,
.header-over-hero .hamburger {
    color: #fff;
    text-transform: uppercase;
    /* font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.03em; */
    text-shadow:
        -1px -1px 0 #111,
         1px -1px 0 #111,
        -1px  1px 0 #111,
         1px  1px 0 #111;
}

.header-over-hero .material-symbols-outlined {
    text-shadow:
        -1px -1px 0 #111,
         1px -1px 0 #111,
        -1px  1px 0 #111,
         1px  1px 0 #111,
         0 3px 8px rgba(0,0,0,0.65);
}

/* =========================================================
   04. NAVIGATION
   ========================================================= */

.nav-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 8px;
}

.nav {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.nav a,
.nav-dropdown-toggle {
    padding: 0;
    margin: 0;
    border: none;
    background: none;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
  	letter-spacing: 1px;
    text-decoration: none;
    cursor: pointer;
	font-family: "Fredoka", sans-serif;
  	text-transform: uppercase;
}

.nav-dropdown {
    position: relative;
}

.nav-dropdown-toggle::after {
    content: " ▾";
    font-size: 12px;
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 100;
    min-width: 210px;
    padding: 8px;
    border-radius: 8px;
    background: var(--green);
    box-shadow: 0 8px 18px rgba(0,0,0,0.18);
}

.nav-dropdown.open .nav-dropdown-menu {
    display: block;
}

.nav-dropdown-menu a {
    display: block;
    margin: 0;
    padding: 4px 10px;
    border-radius: 6px;
    white-space: nowrap;
}

.nav-dropdown-menu a:hover {
    background: var(--light-green);
}

@media (hover: hover) {
    .nav-dropdown:hover .nav-dropdown-menu {
        display: block;
    }
}

.material-symbols-outlined {
    font-size: 22px;
    vertical-align: middle;
}

.nav-icon-link {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.nav-icon-link .badge {
    position: absolute;
    top: -6px;
    right: -10px;
}

.hamburger {
    display: none;
    margin: 4px 0 0;
    padding: 0;
    border: none;
    background: none;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
}

.lang-switch {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lang-switch img {
    width: 22px;
    height: 16px;
    object-fit: cover;
    border-radius: 2px;
}


/* =========================================================
   05. FOOTER
   ========================================================= */

.footer-image {
    height: 155px;
    background-image: url("../assets/footer.png");
    background-size: cover;
    background-position: center;
	border-top: 3px solid var(--dark-sand);
}

.site-footer {
    padding: 18px 20px;
    background: var(--green);
    color: #fff;
	border-top: 3px solid var(--dark-sand);
}

.site-footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    max-width: 1100px;
    margin: 0 auto;
}

.site-footer .small {
    color: var(--dark-sand);
}

.site-footer a {
    color: #fff;
    font-weight: bold;
    text-decoration: none;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-right: 50px;
}

.back-to-top {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 9998;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--green);
    color: #fff;
    font-size: 22px;
    text-decoration: none;
    box-shadow: 0 6px 18px rgba(0,0,0,0.25);
}

.footer-site-name {
    display: block;
    font-family: "Berkshire Swash", serif;
    font-size: 30px;
    line-height: 1.1;
}

.footer-site-slogan {
    margin: 4px 0 8px;
    color: var(--dark-sand);
    font-size: 16px;
    font-weight: 700;
}


/* =========================================================
   06. CARDS
   ========================================================= */

.card {
    background: var(--white);
    padding: 20px;
    border-radius: 10px;
    box-shadow: var(--card-shadow);
}

.auth-card {
    width: 100%;
    max-width: 400px;
}

.horse-list {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    margin-bottom: 25px;
}

.horse-card {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #faf8f1;
}

.horse-card h3 {
    margin-top: 0;
}

.horse-card h4 {
    margin: 0 0 8px;
}

.horse-card p {
    margin: 0;
}

.horse-inactive {
    opacity: 0.7;
}

.horse-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.horse-edit {
    margin-top: 15px;
}

.competition-item {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.competition-item:last-child {
    border-bottom: none;
}

.entry-list {
    display: grid;
    gap: 12px;
}

.entry-item {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #faf8f1;
}

.simple-search {
    margin-bottom: 18px;
}

.notification-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    position: relative;
    padding-right: 42px;
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-dismiss-form {
    position: absolute;
    top: 10px;
    right: 0;
}

.notification-dismiss-button {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    margin: 0;
    padding: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--gray);
    font-size: 22px;
    line-height: 1;
}

.notification-dismiss-button:hover {
    background: #eee;
    color: var(--danger);
}


/* =========================================================
   07. FORMS & BUTTONS
   ========================================================= */


/* =========================================================
   07A. INPUTS & LABELS
   ========================================================= */

label {
    display: block;
    margin-top: 10px;
    font-weight: 500;
}

input,
select,
textarea {
    width: 100%;
    padding: 10px;
    margin-top: 5px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
}

textarea {
    resize: vertical;
}


/* =========================================================
   07B. BUTTONS
   ========================================================= */

button {
    margin-top: 15px;
    padding: 10px 14px;
    border: none;
    border-radius: 6px;
    background: var(--green);
    color: #fff;
    cursor: pointer;
    transition: background 0.15s ease;
}

button:hover {
    background: var(--light-green);
}

.button-link {
    display: inline-block;
    margin-top: 12px;
    margin-left: 8px;
}

.danger-button {
    background: var(--danger);
}


/* =========================================================
   07C. FORM LAYOUTS
   ========================================================= */

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 20px;
}

.form-grid.two-col,
.filter-form .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-row {
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
}

.form-row label {
    margin-top: 0;
}

.form-row input,
.form-row select,
.form-row textarea {
    margin-top: 0;
}

.form-row-full,
.form-row.full {
    grid-column: 1 / -1;
}


/* =========================================================
   07D. CHECKBOXES & CLASS UI
   ========================================================= */

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 6px 0;
    cursor: pointer;
    line-height: 1.2;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    flex-shrink: 0;
}

.checkbox-label span {
    display: inline-block;
}

.class-checkbox-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 8px;
}

.class-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #faf8f1;
    cursor: pointer;
    transition: background 0.15s ease;
}

.class-checkbox:hover {
    background: #f3eee4;
}

.class-checkbox input {
    margin: 0;
}

.class-group {
    overflow: hidden;
    margin-bottom: 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #faf8f1;
}

.class-group summary {
    padding: 10px;
    background: #f0eadc;
    font-weight: 600;
    cursor: pointer;
}

.class-group-items {
    display: grid;
    gap: 6px;
    padding: 8px;
}

.class-group-items.two-col {
    grid-template-columns: 1fr;
}

.class-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0;
}

.class-tools button {
    width: auto;
}

.discipline-actions {
    display: inline-flex;
    gap: 8px;
    margin-left: 12px;
}

.discipline-actions button {
    margin: 0;
    padding: 4px 8px;
    font-size: 0.82rem;
}


/* =========================================================
   07E. ACTION BUTTONS
   ========================================================= */

.actions,
.action-icons {
    white-space: nowrap;
}

.action-icons button {
    padding: 4px;
    margin: 0;
    border: none;
    background: none;
    cursor: pointer;
}

.action-icons .material-symbols-outlined {
    font-size: 15px;
    vertical-align: middle;
    color: #444;
}

.translation-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.translation-actions form {
    display: inline;
}


/* =========================================================
   08. ALERTS & BADGES
   ========================================================= */

.alert {
    margin-bottom: 10px;
    padding: 10px;
    border-radius: 6px;
}

.alert.error {
    background: var(--error-bg);
    color: var(--error-text);
}

.alert.success {
    background: var(--success-bg);
    color: var(--success-text);
}

.badge {
    display: inline-block;
    min-width: 20px;
    margin-left: 4px;
    padding: 2px 6px;
    border-radius: 999px;
    background: #f3d36b;
    color: #1f352f;
    font-size: 12px;
    font-weight: bold;
    text-align: center;
}

.badge-active {
    background: #88e788;
    color: #1f6b3b;
}

.badge-inactive {
    background: #eee;
    color: #666;
}

.notification-stats-inline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
}

.notification-stats-inline div {
    white-space: nowrap;
}


/* =========================================================
   09. TABLES
   ========================================================= */

.admin-table {
    width: 100%;
    border-collapse: collapse;
  	font-size: 12px;
}

.admin-table th,
.admin-table td {
    padding: 4px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.admin-table th a {
    position: relative;
    z-index: 5;
    display: inline-block;
    padding: 4px 4px;
    color: var(--green);
    text-decoration: underline;
}

.admin-table button {
    margin-top: 5px;
    padding: 4px 6px;
}


/* =========================================================
   10. RESULTS & EXPORTS
   ========================================================= */

.result-list-item {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.result-list-item:last-child {
    border-bottom: none;
}

.result-newest {
    margin: 0 -10px;
    padding: 14px 10px;
    border-radius: 8px;
    background: #faf4df;
}

.result-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.result-prize-image {
    width: auto;
    height: 30px;
    flex-shrink: 0;
}

.export-heading {
    white-space: pre-wrap;
    overflow-x: auto;
}

.export-list {
    display: grid;
    gap: 6px;
}

.export-row {
    display: grid;
    grid-template-columns: 1.4fr 40px 40px 2fr 1.5fr 110px 1fr;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.export-template-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.export-template-grid .full {
    grid-column: 1 / -1;
}

.export-grid > div,
.export-template-grid > div {
    min-width: 0;
}

.export-grid textarea,
.export-template-grid textarea {
    display: block;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-height: 110px;
}

.export-grid .full textarea,
.export-template-grid .full textarea {
    min-height: 150px;
}

.export-template-grid textarea {
    width: 100%;
    min-height: 90px;
    font-family: monospace;
}

.export-grid select,
.export-grid input,
.export-template-grid select,
.export-template-grid input {
    box-sizing: border-box;
    width: 100%;
}

.export-placeholder-list code {
    display: inline-block;
    margin: 2px 4px 2px 0;
}


/* =========================================================
   11. AUTH / LOGIN
   ========================================================= */

.login-header {
    position: relative;
    z-index: 2;
    padding: 12px 0;
    background: var(--green);
    color: #fff;
    text-align: center;
}

.login-header-inner {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
}

.login-logo {
    position: relative;
    z-index: 3;
    max-height: 150px;
    border-radius: 50%;
    box-shadow: 4px 6px 12px rgba(0,0,0,0.2);
}

.login-header h1 {
    margin: 0;
    font-size: 28px;
}

.login-header h2 {
    color: var(--dark-sand);
}

.login-header .small {
    margin: 4px 0 0;
    color: var(--dark-sand);
}

.login-header-image {
    height: 400px;
    margin-top: -30px;
    background: url('../assets/header.png') center/cover;
}

.login-lang-switch {
    position: absolute;
    top: 10px;
    right: 15px;
    z-index: 4;
    display: flex;
    gap: 8px;
}

.login-lang-switch img {
    width: 22px;
    height: 16px;
    object-fit: cover;
    border-radius: 2px;
    cursor: pointer;
    transition: transform 0.1s ease;
}

.login-lang-switch img:hover {
    transform: scale(1.1);
}

.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 120px);
}

.auth-layout {
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: 20px;
    padding: 20px;
}

.welcome-card,
.auth-card {
    width: 100%;
    max-width: 420px;
}

.welcome-card {
    line-height: 1.5;
}

.welcome-card ul {
    margin-bottom: 0;
    padding-left: 20px;
}


/* =========================================================
   12. TITLES & AWARDS
   ========================================================= */

.title-awards {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.title-award {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fafafa;
}

.title-award-image {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.horse-title-details {
    margin: 8px 0 12px;
}

.horse-title-details summary {
    font-weight: bold;
    cursor: pointer;
}


/* =========================================================
   13. COOKIE CONSENT
   ========================================================= */

.cookie-consent {
    position: fixed;
    right: 20px;
    bottom: 20px;
    left: 20px;
    z-index: 9999;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(0,0,0,0.18);
}

.cookie-consent p {
    margin: 6px 0 0;
}

.cookie-consent-actions {
    display: flex;
    flex-shrink: 0;
    gap: 8px;
}


/* =========================================================
   14. CLASSES & COMPETITION ENTRY
   ========================================================= */

.class-entry-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 20px;
}

.class-entry-card {
    padding: 15px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
}

.existing-horse-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0;
}

.existing-horse-list {
    overflow: auto;
    max-height: 220px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fafafa;
}

.horse-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.15s ease;
}

.horse-option:hover {
    background: rgba(0,0,0,0.025);
}

.horse-option:last-child {
    border-bottom: none;
}

.horse-option input[type="checkbox"] {
    width: 22px;
    height: 22px;
    margin-top: 4px;
    flex-shrink: 0;
}

.horse-option-body {
    display: block;
    width: 100%;
}

.horse-option-top {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.horse-option-name {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;
}

.horse-option-bottom {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;

    margin-top: 6px;

    color: var(--gray);
    font-size: 0.95rem;
    line-height: 1.25;
}

.horse-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1;
}

.horse-badge-class {
    border: 1px solid #a9d8b5;
    background: #e5f6ea;
    color: var(--green);
}

.horse-badge-entry {
    border: 1px solid #dfc58d;
    background: #f4ead6;
    color: #7a5a22;
}

.horse-badge-placement {
    border: 1px solid #c8c3e8;
    background: #efedfb;
    color: #514a8a;
}

.discipline-level-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}


/* =========================================================
   15. MOBILE
   ========================================================= */




/* =========================================================
   16. MY HORSES
   ========================================================= */

.horse-edit-panel {
  	margin-top: 20px;
  	display: none;
}

.discipline-level-grid {
  	display: grid;
  	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  	gap: 12px;
  	margin-top: 10px;
}

.horse-edit-actions {
  	display: flex;
  	gap: 10px;
  	flex-wrap: wrap;
  	margin-top: 15px;
}

.discipline-category-block {
  	margin-top: 18px;
}

.discipline-category-block h4 {
 	margin-bottom: 8px;
}


/* =========================================================
   17. RESULTS EXPORTER
   ========================================================= */

.export-grid {
  	display: grid;
  	grid-template-columns: repeat(2, minmax(0, 1fr));
  	gap: 16px;
}

.export-grid .full {
  	grid-column: 1 / -1;
}

.export-filter-grid {
  	display: grid;
  	grid-template-columns: 1fr 1fr;
  	gap: 16px;
  	margin-bottom: 16px;
}

.export-filter-grid .form-row {
  	margin: 0;
}

.export-help {
  	margin-top: 10px;
  	font-size: 13px;
  	line-height: 1.6;
  	color: #666;
}

.export-output-pre {
  	margin: 0;
  	padding: 0;
  	border: 0;
  	background: transparent;
  	font-family: monospace;
  	font-size: 15px;
  	line-height: 1.35;
  	white-space: pre-wrap;
  	word-break: normal;
  	overflow-x: auto;
}


/* =========================================================
   18. RESULTS
   ========================================================= */

.result-filter-panel {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 20px;
    margin-top: 16px;
}

.results-block-layout {
    display: grid;
    gap: 18px;
    margin-top: 20px;
}

.results-category-block,
.results-discipline-block,
.results-class-block,
.results-level-block {
    overflow: hidden;
    border-radius: 10px;
}

.results-category-block {
    border: 1px solid var(--green);
    background: var(--white);
    box-shadow: var(--card-shadow);
}

.results-discipline-block {
    margin: 12px;
    border: 1px solid var(--border);
    background: #fff;
}

.results-class-block {
    margin: 10px;
    border: 1px solid var(--border);
    background: #faf8f1;
}

.results-level-grid {
    column-count: 2;
    column-gap: 12px;
    padding: 10px;
}

.results-level-block {
    display: inline-block;
    width: 100%;
    margin: 0 0 12px;
    break-inside: avoid;
    border: 1px solid var(--border);
    background: #fff;
}

.results-category-summary,
.results-discipline-summary,
.results-class-summary,
.results-level-summary {
    cursor: pointer;
    font-weight: 700;
}

.results-category-summary {
    padding: 12px 16px;
    background: var(--green);
    color: #fff;
}

.results-discipline-summary {
    padding: 10px 14px;
    background: #f0eadc;
}

.results-class-summary {
    padding: 9px 12px;
    background: #f7f1e5;
}

.results-level-summary {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 12px;
    background: #fff;
}

.results-class-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 10px;
}

.result-card {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    padding: 3px 0;
    border-radius: 8px;
}

.result-prize-image {
    width: 24px;
    height: 34px;
    object-fit: contain;
}

.result-placement {
    min-width: 34px;
    font-weight: 700;
    color: var(--green);
    text-align: right;
}

.result-main {
    min-width: 0;
}

.result-main strong {
    display: block;
    margin: 0;
    line-height: 1.05;
}

.result-meta {
    display: block;
    margin-top: 1px;
    color: var(--gray);
    font-size: 13px;
    line-height: 1.05;
}

.result-score {
    min-width: 58px;
    text-align: right;
    font-weight: 700;
    white-space: nowrap;
}

.result-card-highlight {
    background: #fff7df;
    outline: 2px solid var(--dark-sand);
}

.result-group-highlight {
    outline: 2px solid var(--dark-sand);
    outline-offset: 2px;
}

.results-category-block.result-group-highlight > .results-category-summary {
    background: var(--green);
}

.results-discipline-block.result-group-highlight > .results-discipline-summary,
.results-class-block.result-group-highlight > .results-class-summary,
.results-level-block.result-group-highlight > .results-level-summary {
    box-shadow: inset 4px 0 0 var(--dark-sand);
}

.result-filter-hidden {
    display: none !important;
}

.results-category-block:not([open]) > *:not(summary),
.results-discipline-block:not([open]) > *:not(summary),
.results-class-block:not([open]) > *:not(summary),
.results-level-block:not([open]) > *:not(summary) {
    display: none;
}

.results-level-block:not([open]) {
    margin-bottom: 8px;
}


/* =========================================================
   19. RESULTS LIST
   ========================================================= */

.results-list-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    align-items: start;
    margin-top: 20px;
}

.results-list-column {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.result-competition-card {
    display: inline-block;
    width: 100%;
    margin: 0 0 18px;
    overflow: hidden;
    break-inside: avoid;
    border-radius: 10px;
    background: var(--white);
    box-shadow: var(--card-shadow);
}

.result-competition-summary {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    cursor: pointer;
    font-weight: 700;
}

.result-competition-title {
    min-width: 0;
}

.result-competition-summary-link {
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.result-competition-body {
    padding: 0 16px 16px;
}

.result-competition-body p {
    margin: 8px 0;
}

.result-competition-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.result-newest-card {
    border: 2px solid var(--green);
}

.result-participated-card {
    border: 2px solid var(--dark-sand);
}

.result-newest-card.result-participated-card {
    box-shadow:
        0 0 0 2px var(--dark-sand),
        0 6px 18px rgba(0,0,0,0.08);
}

.result-newest-badge {
    background: #d9f0e7;
    color: var(--green);
}

.result-participated-badge {
    background: #f4ead6;
    color: #7a5a22;
}

.result-competition-card:not([open]) > *:not(summary) {
    display: none;
}


/* =========================================================
   20. MY HORSES
   ========================================================= */

.horse-page-controls-card {
    margin-bottom: 20px;
}

.horse-page-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.horse-control-buttons,
.horse-settings-submit,
.horse-settings-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.horse-control-buttons button {
    margin-top: 0;
}

.horse-settings-panel {
    margin-top: 18px;
}

.horse-settings-details {
    margin-top: 14px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #faf8f1;
}

.horse-settings-details summary {
    cursor: pointer;
    font-weight: 700;
}

.horse-settings-details[open] summary {
    margin-bottom: 14px;
}

.horse-settings-checkboxes,
.horse-settings-submit {
    margin-top: 14px;
}

.horse-group-layout {
    display: grid;
    gap: 18px;
}

.horse-group-block {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--white);
    box-shadow: var(--card-shadow);
}

.horse-group-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    cursor: pointer;
    background: var(--green);
    color: #fff;
}

.horse-group-summary .small {
    color: #f4ead6;
}

.horse-group-counts {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.horse-group-highlight {
    outline: 2px solid var(--dark-sand);
    outline-offset: 2px;
}

.horse-group-highlight > .horse-group-summary {
    box-shadow: inset 6px 0 0 var(--dark-sand);
}




/* =========================================================
   20A. HORSE LIST COLUMNS
   ========================================================= */

.horse-list-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    align-items: start;
    padding: 16px;
}

.horse-list-column {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}

.horse-masonry,
.horse-masonry-item {
    all: unset;
}

.horse-subgroup-block {
    margin: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #faf8f1;
}

.horse-subgroup-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 10px 14px;
    cursor: pointer;
    background: #f0eadc;
    color: #333;
}

.horse-subgroup-depth-2 {
    background: #fff;
}

.horse-subgroup-depth-2 > .horse-subgroup-summary {
    background: #f7f1e5;
}

.horse-subgroup-block:not([open]) > *:not(summary) {
    display: none;
}

.horse-group-duplicates-only {
    border-color: #dcc9a3;
    background: #fcfaf5;
}

.horse-group-duplicates-only > .horse-group-summary {
    background: #7a684f;
    color: #fff;
}

.horse-group-duplicates-only > .horse-group-summary .small {
    color: #efe3cb;
}

.horse-group-duplicates-only.horse-subgroup-block {
    border-color: #dcc9a3;
    background: #fcfaf5;
}

.horse-group-duplicates-only.horse-subgroup-block > .horse-subgroup-summary {
    background: #efe3cb;
    color: #4c4030;
}

.horse-group-duplicates-only.horse-subgroup-block > .horse-subgroup-summary .badge-dark-sand {
    background: #7a684f;
    color: #fff;
}


/* =========================================================
   20B. HORSE CARD
   ========================================================= */

.horse-card {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #faf8f1;
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
}

.horse-card-summary {
    cursor: pointer;
    padding: 12px 14px 10px;
}

.horse-card-title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.horse-card-title-row strong {
    font-size: 16px;
}
.horse-card-title-row a {
    font-size: 11px;
}

.horse-mini-meta,
.horse-summary-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 6px;
}

.horse-mini-badge,
.mini-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 7px;
    border-radius: 999px;
    background: #f0eadc;
    color: #4c4030;
    font-size: 12px;
    line-height: 1;
}

.horse-card-content {
    padding: 0 14px 14px;
}


/* =========================================================
   20C. HORSE STATS
   ========================================================= */

.horse-stat-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 10px 0;
    border-radius: 8px;
    background: #fff;
}

.horse-stat-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 6px;
    background: transparent;
}

.horse-stat-box span {
    margin: 0;
    color: var(--gray);
    font-size: 11px;
}

.horse-stat-box strong {
    font-size: 13px;
  	float: right;
}


/* =========================================================
   20D. HORSE LEVELS
   ========================================================= */

.horse-level-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 8px;
}

.horse-level-pill {
    display: inline-flex;
    padding: 3px 7px;
    border-radius: 999px;
    background: #eef5f2;
    color: var(--green);
    font-size: 11px;
    font-weight: 700;
}


/* =========================================================
   20E. HORSE ACTIONS
   ========================================================= */

.horse-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.horse-actions button {
    margin-top: 0;
}


/* =========================================================
   20F. HORSE STATES
   ========================================================= */

.horse-inactive {
    opacity: 0.75;
}

.horse-duplicate {
    border-style: dashed;
}

.horse-card-highlight {
    outline: 2px solid var(--dark-sand);
    outline-offset: 2px;
}

.horse-card-highlight > .horse-card-summary {
    box-shadow: inset 5px 0 0 var(--dark-sand);
}

.horse-filter-hidden {
    display: none !important;
}

.horse-group-block:not([open]) > *:not(summary),
.horse-card:not([open]) > *:not(summary) {
    display: none;
}


/* =========================================================
   20G. HORSE BADGES
   ========================================================= */

.badge-green {
    background: #d9f0e7;
    color: var(--green);
}

.badge-gray {
    background: #eee;
    color: #666;
}

.badge-dark-sand {
    background: #f4ead6;
    color: #7a5a22;
}


/* =========================================================
   20H. HORSE EDIT PANEL
   ========================================================= */

.horse-edit-panel {
    display: none;
    margin-top: 20px;
}

.horse-edit-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.horse-discipline-category {
    margin-top: 16px;
}

.horse-discipline-category h4 {
    margin: 0 0 8px;
}

.horse-discipline-table {
    display: grid;
    gap: 6px;
}

.horse-discipline-row {
    display: grid;
    grid-template-columns: 90px minmax(130px, 1fr) minmax(180px, 1.4fr);
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #faf8f1;
}

.horse-discipline-row-head {
    background: #f0eadc;
    color: var(--gray);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.horse-discipline-main-cell {
    display: flex;
    justify-content: center;
}

.horse-discipline-main-cell input {
    width: 18px;
    height: 18px;
    margin: 0;
}

.horse-discipline-name {
    font-weight: 700;
}

.horse-discipline-row select {
    margin-top: 0;
}