body {
    margin: 0;
    background: #f1f5f9;
    color: #1a1a1a;
}

.portal {
    font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    line-height: 1.5;
    max-width: 56rem;
    margin: 0 auto;
    padding: 1rem clamp(0.75rem, 3vw, 1.5rem) 2.5rem;
    box-sizing: border-box;
}

.portal *,
.portal *::before,
.portal *::after {
    box-sizing: border-box;
}

.portal--wide {
    max-width: 68.75rem;
}

.portal--narrow {
    max-width: 28rem;
}

.portal__header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.portal__brand {
    font-weight: 700;
    font-size: 1.15rem;
    color: #0f172a;
    text-decoration: none;
    flex: 0 0 auto;
}

.portal__brand:hover {
    color: #2563eb;
}

.portal__nav-drawer {
    flex: 1 1 auto;
    min-width: 0;
}

.portal__nav-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
    padding: 0.45rem 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.375rem;
    background: #fff;
    color: #0f172a;
    cursor: pointer;
    font: inherit;
    font-size: 0.9rem;
    list-style: none;
}

.portal__nav-toggle::-webkit-details-marker {
    display: none;
}

.portal__nav-toggle::marker {
    content: '';
}

.portal__nav-toggle-icon {
    display: block;
    width: 1.125rem;
    height: 2px;
    background: currentColor;
    border-radius: 1px;
    box-shadow: 0 -5px 0 currentColor, 0 5px 0 currentColor;
}

.portal__nav {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-top: 0.75rem;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    background: #fff;
    font-size: 0.95rem;
}

.portal__nav-drawer:not([open]) .portal__nav {
    display: none;
}

.portal__nav a {
    display: block;
    padding: 0.4rem 0.25rem;
    color: #2563eb;
    text-decoration: none;
}

.portal__nav a:hover {
    text-decoration: underline;
}

.portal__nav-logout {
    display: block;
    margin: 0;
    padding: 0;
}

.portal__nav-logout button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.4rem 0.25rem;
    background: none;
    border: none;
    color: #2563eb;
    cursor: pointer;
    font: inherit;
}

.portal__nav-logout button:hover {
    text-decoration: underline;
}

.portal__main {
    min-width: 0;
}

.portal a {
    color: #2563eb;
}

.portal h1 {
    font-size: clamp(1.35rem, 4vw, 1.75rem);
    margin: 0 0 1rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.portal h2 {
    font-size: 1.25rem;
    margin: 1.5rem 0 0.75rem;
}

.portal h3 {
    font-size: 1.1rem;
    margin: 1rem 0 0.5rem;
}

.flash {
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    margin-bottom: 0.75rem;
}

.flash--success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.flash--danger {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.flash--warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

.portal-alert {
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.portal-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
    gap: 1rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.portal-tile {
    display: block;
    padding: 1.25rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    background: #fff;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.portal-tile:hover {
    border-color: #93c5fd;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.12);
}

.portal-tile--add {
    border-style: dashed;
    background: #f8fafc;
}

.portal-tile--add:hover {
    border-color: #2563eb;
    background: #eff6ff;
}

.portal-tile__title {
    font-weight: 600;
    font-size: 1.1rem;
    margin: 0 0 0.5rem;
}

.portal-tile__meta {
    font-size: 0.875rem;
    color: #64748b;
    margin: 0.25rem 0;
}

.portal-tile__badge {
    display: inline-block;
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    margin-top: 0.5rem;
}

.portal-card {
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 1.25rem;
    margin-bottom: 1rem;
    background: #fff;
}

.portal-card--muted {
    background: #f8fafc;
}

.portal-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -0.25rem;
    padding: 0 0.25rem;
}

.portal-table {
    width: 100%;
    min-width: 36rem;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.portal-table th,
.portal-table td {
    text-align: left;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #e2e8f0;
}

.portal-table th {
    font-weight: 600;
    background: #f8fafc;
}

.portal-form label,
.portal-form__row > label {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.portal-form input[type="text"],
.portal-form input[type="email"],
.portal-form input[type="password"],
.portal-form input[type="datetime-local"],
.portal-form textarea,
.portal-form select,
.portal-form__row input[type="text"],
.portal-form__row input[type="email"],
.portal-form__row input[type="password"],
.portal-form__row textarea,
.portal-form__row select {
    display: block;
    margin-top: 0.25rem;
    max-width: min(24rem, 100%);
    width: 100%;
    padding: 0.4rem 0.5rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.25rem;
    font: inherit;
    box-sizing: border-box;
}

.portal-form__row {
    margin-bottom: 0.75rem;
}

.portal-form__row--checkbox {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.5rem;
}

.portal-form__row--checkbox input[type="checkbox"] {
    margin-top: 0.2rem;
}

.portal-form__row--checkbox label {
    margin-bottom: 0;
    font-weight: 400;
}

.portal-form__errors {
    margin: 0.35rem 0 0;
    padding: 0;
    list-style: none;
    font-size: 0.85rem;
    color: #b91c1c;
}

.portal-form__row--error input,
.portal-form__row--error textarea,
.portal-form__row--error select {
    border-color: #f87171;
}

.portal-form__submit {
    margin-top: 1rem;
}

.portal-record-form {
    display: grid;
    gap: 0.9rem;
}

.portal-record-form__summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 7rem;
    gap: 0.75rem;
    align-items: stretch;
}

.portal-record-form__switch,
.portal-record-form__rating,
.portal-record-form__field {
    display: block;
    margin: 0;
}

.portal-record-form__switch {
    display: flex;
    gap: 0.65rem;
    align-items: flex-start;
    padding: 0.75rem;
    border: 1px solid #dbeafe;
    border-radius: 0.5rem;
    background: #eff6ff;
}

.portal-record-form__switch input {
    margin-top: 0.2rem;
}

.portal-record-form__switch strong,
.portal-record-form__field > span,
.portal-record-form__rating > span {
    display: block;
    color: #0f172a;
    font-size: 0.9rem;
    font-weight: 600;
}

.portal-record-form__switch small,
.portal-record-form__field small {
    display: block;
    margin-top: 0.15rem;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 400;
}

.portal-record-form__rating {
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    background: #f8fafc;
}

.portal-record-form__field input,
.portal-record-form__field textarea,
.portal-record-form__rating select {
    display: block;
    width: 100%;
    max-width: none;
    margin-top: 0.35rem;
    padding: 0.55rem 0.65rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.45rem;
    background: #fff;
    box-sizing: border-box;
    font: inherit;
}

.portal-record-form__field textarea {
    min-height: 7rem;
    resize: vertical;
}

.portal-record-form__field input:focus,
.portal-record-form__field textarea:focus,
.portal-record-form__rating select:focus {
    border-color: #2563eb;
    outline: 2px solid rgb(37 99 235 / 0.16);
    outline-offset: 1px;
}

@media (max-width: 42rem) {
    .portal-record-form__summary {
        grid-template-columns: 1fr;
    }
}

.portal-form button,
.portal-actions button {
    padding: 0.4rem 0.85rem;
    border-radius: 0.25rem;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    cursor: pointer;
    font-size: 0.875rem;
    font: inherit;
}

.portal-form button[type="submit"],
.portal-actions .portal-btn--primary,
a.portal-btn--primary {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}

.portal-form button[type="submit"]:hover,
.portal-actions .portal-btn--primary:hover,
a.portal-btn--primary:hover {
    background: #1d4ed8;
    color: #fff;
}

a.portal-btn--primary {
    display: inline-block;
    padding: 0.4rem 0.85rem;
    border-radius: 0.25rem;
    text-decoration: none;
    font-size: 0.875rem;
}

.portal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.portal-back {
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.portal-back a {
    text-decoration: none;
}

.portal-back a:hover {
    text-decoration: underline;
}

.portal-meta {
    color: #64748b;
    font-size: 0.9rem;
}

.portal-empty {
    color: #64748b;
    font-style: italic;
}

.portal-inline-form {
    display: inline;
}

.portal-readonly-input {
    display: block;
    max-width: 100%;
    width: min(28rem, 100%);
}

.portal-links {
    margin-top: 1.25rem;
    font-size: 0.9rem;
}

.portal-links p {
    margin: 0.35rem 0;
}

/* Ceník */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(17.5rem, 1fr));
    gap: 1rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.plan-card {
    display: flex;
    flex-direction: column;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 1.25rem;
    background: #fff;
}

.plan-card__name {
    margin: 0 0 0.5rem;
    font-size: 1.25rem;
    font-weight: 600;
}

.plan-card__price {
    margin: 0 0 1rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.plan-card__trial-note {
    font-size: 0.875rem;
    color: #64748b;
    margin: 0 0 0.75rem;
}

.plan-card__description {
    flex: 1;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #334155;
}

.plan-card__description > :first-child {
    margin-top: 0;
}

.plan-card__description > :last-child {
    margin-bottom: 0;
}

.plan-card__description h1,
.plan-card__description h2,
.plan-card__description h3 {
    font-size: 1.1rem;
    margin: 1rem 0 0.5rem;
}

.plan-card__description ul,
.plan-card__description ol {
    padding-left: 1.25rem;
    margin: 0.5rem 0;
}

.plan-card__request {
    margin-top: 1rem;
}

.plan-card__request label {
    display: block;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}

.plan-card__request input[type="text"] {
    display: block;
    margin-top: 0.25rem;
    width: 100%;
    max-width: none;
    padding: 0.4rem 0.5rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.25rem;
    font: inherit;
    box-sizing: border-box;
}

.plan-card__request button {
    padding: 0.4rem 0.85rem;
    border-radius: 0.25rem;
    border: 1px solid #2563eb;
    background: #2563eb;
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-size: 0.875rem;
}

.plan-card__request button:hover {
    background: #1d4ed8;
}

.plan-card__login-hint {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: #64748b;
}

.portal-section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    margin-bottom: 0.75rem;
}

.portal-section-head h2 {
    margin: 0;
}

.portal-section-head p {
    margin: 0;
}

a.portal-btn--inline {
    font-size: 0.875rem;
}

.portal-sort {
    margin-bottom: 0.75rem;
}

.portal-sort__link {
    font-weight: 500;
}

.portal-sort__link--active {
    color: #1e40af;
}

.portal-optional {
    font-weight: normal;
    color: #64748b;
    font-size: 0.875rem;
}

.portal-locality-picker {
    position: relative;
    margin-bottom: 1rem;
}

.portal-locality-picker__input {
    width: 100%;
    box-sizing: border-box;
}

.portal-locality-picker__results {
    list-style: none;
    margin: 0.25rem 0 0;
    padding: 0;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    background: #fff;
    max-height: 12rem;
    overflow-y: auto;
}

.portal-locality-picker__results li button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.5rem 0.75rem;
    border: none;
    background: none;
    cursor: pointer;
    font: inherit;
}

.portal-locality-picker__results li button:hover {
    background: #f1f5f9;
}

.portal-map-section {
    margin-top: 0.5rem;
}

.portal-map {
    height: clamp(16rem, 45vh, 28rem);
    width: 100%;
    min-height: 14rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    background: #e2e8f0;
    position: relative;
    z-index: 0;
}

.portal-map-section .leaflet-draw {
    z-index: 1000;
}

.portal-map-section .leaflet-draw-toolbar a {
    background-size: 270px 30px;
}

.portal-map-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    align-items: center;
    margin-bottom: 0.75rem;
}

.portal-map__fit-bounds,
.portal-map__clear {
    font: inherit;
    font-size: 0.875rem;
    padding: 0.35rem 0.75rem;
    border-radius: 0.375rem;
    border: 1px solid #cbd5e1;
    background: #fff;
    cursor: pointer;
}

.portal-map__fit-bounds:hover,
.portal-map__clear:hover {
    background: #f8fafc;
}

.portal-map-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    list-style: none;
    margin: 0.75rem 0 0;
    padding: 0;
    font-size: 0.875rem;
}

.portal-map-legend__dot {
    display: inline-block;
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    margin-right: 0.35rem;
    vertical-align: middle;
}

.portal-map-legend__dot--open {
    background: #22c55e;
}

.portal-map-legend__dot--closed {
    background: #ef4444;
}

.portal-map-legend__dot--candidate {
    background: #4b5563;
}

.portal-map-legend__dot--inactive {
    background: #cbd5e1;
}

.portal-map-candidates {
    list-style: none;
    margin: 0.5rem 0 0;
    padding: 0;
    max-height: 10rem;
    overflow-y: auto;
    font-size: 0.875rem;
}

.portal-map-candidates__item {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    justify-content: space-between;
    padding: 0.2rem 0;
    border-bottom: 1px solid #e2e8f0;
}

.portal-map-candidates__item--highlighted {
    background: #fffbeb;
}

.portal-map-candidates__item:last-child {
    border-bottom: none;
}

.portal-map-candidates__btn {
    background: none;
    border: none;
    color: #2563eb;
    cursor: pointer;
    font: inherit;
    padding: 0.15rem 0;
    text-align: left;
}

.portal-map-candidates__remove {
    flex: 0 0 auto;
    padding: 0.15rem 0.45rem;
    border: 1px solid #fecaca;
    border-radius: 0.25rem;
    background: #fff;
    color: #b91c1c;
    cursor: pointer;
    font: inherit;
    font-size: 0.8rem;
}

.portal-map-candidates__remove:hover {
    background: #fef2f2;
}

.portal-map-zoom-hint {
    margin: 0.5rem 0 0;
    padding: 0.5rem 0.75rem;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 0.375rem;
}

.portal-map-message {
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: #eff6ff;
    border-radius: 0.375rem;
    font-size: 0.875rem;
}

.portal-modal {
    border: none;
    border-radius: 0.5rem;
    padding: 0;
    max-width: 32rem;
    width: calc(100% - 2rem);
    box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
}

.portal-modal::backdrop {
    background: rgb(15 23 42 / 0.45);
}

.portal-modal__card {
    padding: 1.25rem;
}

.portal-record-modal {
    display: grid;
    gap: 1rem;
}

.portal-record-modal__header {
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e2e8f0;
}

.portal-record-modal__header h3 {
    margin: 0.1rem 0 0;
}

.portal-record-modal__eyebrow {
    margin: 0;
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.portal-record-modal__address {
    margin: 0.35rem 0 0;
    color: #334155;
    font-size: 0.9rem;
}

.portal-modal__actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1rem;
}

.portal-modal__error {
    color: #b91c1c;
    font-size: 0.875rem;
    margin: 0 0 0.75rem;
}

.portal-btn--secondary {
    font: inherit;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    border: 1px solid #cbd5e1;
    background: #fff;
    cursor: pointer;
}

/* ——— Responzivní layout ——— */

@media (min-width: 48rem) {
    .portal__header {
        flex-wrap: nowrap;
    }

    .portal__nav-drawer {
        display: contents;
    }

    .portal__nav-toggle {
        display: none;
    }

    .portal__nav {
        display: flex;
        flex-flow: row wrap;
        align-items: center;
        justify-content: flex-end;
        gap: 0.25rem 1rem;
        margin: 0;
        padding: 0;
        border: none;
        border-radius: 0;
        background: transparent;
    }

    .portal__nav-drawer:not([open]) .portal__nav {
        display: flex;
    }

    .portal__nav a {
        display: inline;
        padding: 0;
    }

    .portal__nav-logout {
        display: inline;
    }

    .portal__nav-logout button {
        display: inline;
        width: auto;
        padding: 0;
        text-align: inherit;
    }
}

@media (max-width: 47.99rem) {
    .portal-table-wrap:has(.portal-table--responsive) {
        overflow-x: visible;
        margin: 0;
        padding: 0;
    }

    .portal-table--responsive {
        min-width: 0;
    }

    .portal-table--responsive thead {
        display: none;
    }

    .portal-table--responsive tbody tr {
        display: block;
        margin-bottom: 0.85rem;
        padding: 0.75rem;
        border: 1px solid #e2e8f0;
        border-radius: 0.5rem;
        background: #fff;
    }

    .portal-table--responsive tbody td {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 0.75rem;
        padding: 0.35rem 0;
        border-bottom: none;
        text-align: right;
        overflow-wrap: anywhere;
    }

    .portal-table--responsive tbody td::before {
        content: attr(data-label);
        flex: 0 0 38%;
        max-width: 45%;
        font-weight: 600;
        text-align: left;
        color: #475569;
    }

    .portal-table--responsive tbody td[data-label='Akce'],
    .portal-table--responsive tbody td.portal-table__actions {
        flex-direction: column;
        align-items: stretch;
        text-align: left;
    }

    .portal-table--responsive tbody td[data-label='Akce']::before,
    .portal-table--responsive tbody td.portal-table__actions::before {
        margin-bottom: 0.25rem;
    }

    .portal-table--responsive tbody td[data-label='Akce'] .portal-actions,
    .portal-table--responsive tbody td.portal-table__actions .portal-inline-form {
        display: block;
        width: 100%;
    }

    .portal-table--responsive tbody td.portal-table__actions form {
        display: flex;
        flex-wrap: wrap;
        gap: 0.35rem;
        margin-bottom: 0.35rem;
    }

    .portal-section-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .portal-sort {
        display: flex;
        flex-wrap: wrap;
        gap: 0.35rem 0.5rem;
        align-items: center;
    }

    .portal-map-candidates__item {
        flex-direction: column;
        align-items: flex-start;
    }

    .portal-modal__actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .portal-modal__actions .portal-btn--secondary,
    .portal-modal__actions button[type='submit'] {
        width: 100%;
        text-align: center;
    }

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

    .portal-tiles {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 22rem) {
    .portal-table--responsive tbody td {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }

    .portal-table--responsive tbody td::before {
        max-width: none;
    }
}
