:focus-visible {
    outline: 3px solid #78a8f4;
    outline-offset: 3px;
}

.service-icon img {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    object-fit: cover;
}

.button:disabled,
.button[aria-disabled="true"] {
    cursor: not-allowed;
    opacity: .58;
    transform: none;
}

.request-form-heading {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 26px;
}

.request-form-heading .service-icon {
    flex: 0 0 52px;
}

.request-form-heading .muted {
    margin: 4px 0 0;
}

.service-selection {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.field-label {
    display: block;
    margin-bottom: 12px;
    color: #35445a;
    font-size: 14px;
    font-weight: 800;
}

.service-choice-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.service-choice {
    position: relative;
    display: block;
    min-width: 0;
    cursor: pointer;
}

.service-choice > input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    opacity: 0;
}

.service-choice-card {
    display: grid;
    min-height: 100px;
    grid-template-columns: 46px minmax(0, 1fr) 22px;
    align-items: center;
    gap: 12px;
    padding: 15px;
    border: 1px solid #e1e9f4;
    border-radius: 16px;
    background: #fff;
    transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.service-choice:hover .service-choice-card {
    border-color: #9dbbe9;
    box-shadow: 0 9px 22px rgba(20, 43, 78, .08);
    transform: translateY(-2px);
}

.service-choice > input:checked + .service-choice-card {
    border-color: #4384e4;
    background: linear-gradient(135deg, #f1f7ff, #fff);
    box-shadow: 0 0 0 2px rgba(18, 105, 232, .1);
}

.service-choice > input:focus-visible + .service-choice-card {
    outline: 3px solid #78a8f4;
    outline-offset: 3px;
}

.service-choice > input:disabled + .service-choice-card {
    cursor: not-allowed;
    opacity: .55;
    background: #f5f7fa;
    transform: none;
}

.service-choice-icon {
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    border-radius: 14px;
    background: #edf4ff;
    color: #1768d4;
}

.service-choice-icon svg {
    width: 24px;
    height: 24px;
}

.service-choice-copy {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.service-choice-copy strong {
    color: #172b4d;
    font-size: 14px;
    font-weight: 800;
}

.service-choice-copy small {
    color: #718096;
    font-size: 11px;
    line-height: 1.65;
}

.service-choice-indicator {
    display: grid;
    width: 20px;
    height: 20px;
    place-items: center;
    border: 1.5px solid #bdcadb;
    border-radius: 50%;
    background: #fff;
    color: #fff;
}

.nav-hide-desktop {
    display: none !important;
}

.story-list .story-item {
    display: block;
    min-width: 90px;
    max-width: 125px;
}

.story-list .story-item strong,
.story-list .story-item small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
}

.story-list .story-item small {
    color: #718096;
    font-size: 10px;
    line-height: 1.5;
}

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

.admin-page-heading h1,
.admin-page-heading h2 {
    margin: 0;
    color: #172b4d;
    font-size: 25px;
}

.admin-page-heading p {
    margin: 4px 0 0;
}

.admin-subheading {
    margin: 26px 0 10px;
}

.admin-subheading h2 {
    font-size: 19px;
}

.admin-section {
    margin-top: 20px;
}

.admin-filter-form,
.admin-form-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    align-items: end;
}

.admin-filter-form > label,
.admin-form-grid > .field {
    display: grid;
    gap: 6px;
    min-width: 0;
    color: #35445a;
    font-size: 13px;
    font-weight: 700;
}

.admin-filter-form input,
.admin-filter-form select {
    min-width: 0;
    border: 1px solid #dfe7f1;
    border-radius: 10px;
    background: #fff;
    padding: 10px 12px;
}

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

.admin-actions form {
    display: inline-flex;
    margin: 0;
}

.button-small {
    min-height: 34px;
    padding: 6px 10px;
    border-radius: 9px;
    font-size: 12px;
    box-shadow: none;
}

.button-danger {
    background: #b83232;
    box-shadow: none;
}

.button-danger:hover {
    background: #962626;
}

.admin-status {
    display: inline-flex;
    padding: 3px 9px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 700;
}

.admin-status.is-on {
    background: #e8f8f2;
    color: #087957;
}

.admin-status.is-off {
    background: #f0f2f5;
    color: #657185;
}

.admin-empty {
    padding: 28px;
    color: #718096;
    text-align: center;
}

.admin-import-form {
    display: grid;
    gap: 14px;
    max-width: 620px;
}

.admin-import-form input[type="file"] {
    padding: 10px;
    border: 1px dashed #bdcadb;
    border-radius: 10px;
    background: #f8faff;
}

.admin-check,
.admin-module-toggle {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid #e1e9f4;
    border-radius: 12px;
    background: #fff;
    color: #35445a;
    font-size: 13px;
}

.admin-check input,
.admin-module-toggle input {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin: 2px 0 0;
    accent-color: #1269e8;
}

.admin-full {
    grid-column: 1 / -1;
}

.admin-form-actions {
    margin-top: 22px;
}

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

.admin-detail-grid > div {
    min-width: 0;
}

.admin-detail-grid span {
    display: block;
    color: #718096;
    font-size: 12px;
}

.admin-detail-grid strong {
    display: block;
    overflow-wrap: anywhere;
    margin-top: 4px;
}

.admin-delete-form {
    margin-top: 18px;
}

.admin-report-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
    gap: 12px;
    margin-block: 18px;
}

.admin-report-grid > div {
    display: grid;
    gap: 3px;
    padding: 14px;
    border: 1px solid #e1e9f4;
    border-radius: 13px;
    background: white;
}

.admin-report-grid span {
    color: #718096;
    font-size: 12px;
}

.admin-report-grid strong {
    color: #172b4d;
    font-size: 21px;
}

.admin-story-thumb {
    display: block;
    width: 52px;
    height: 52px;
    border-radius: 12px;
    object-fit: cover;
}

.admin-cell-note {
    display: block;
    max-width: 250px;
    color: #718096;
    font-size: 11px;
}

.admin-story-preview {
    display: block;
    width: 100px;
    height: 100px;
    border-radius: 18px;
    object-fit: cover;
}

.admin-hero-preview {
    display: block;
    width: min(100%, 360px);
    max-height: 220px;
    margin-top: 8px;
    border: 1px solid #e1e9f4;
    border-radius: 16px;
    object-fit: cover;
}

.admin-story-preview-card {
    display: grid;
    grid-template-columns: minmax(180px, 300px) 1fr;
    gap: 24px;
    align-items: start;
}

.admin-story-preview-card > img {
    width: 100%;
    max-height: 360px;
    border-radius: 18px;
    object-fit: cover;
}

.admin-settings-section + .admin-settings-section {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid #e6edf5;
}

.admin-module-toggle span {
    display: grid;
    gap: 4px;
}

.admin-module-toggle small {
    color: #718096;
    line-height: 1.7;
}

.admin-table {
    min-width: 800px;
}

@media (max-width: 900px) {
    .admin-filter-form,
    .admin-form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .nav-hide-desktop {
        display: block !important;
    }

    .nav-hide-mobile {
        display: none !important;
    }

    .admin-nav .container {
        flex-wrap: nowrap;
        overflow-x: auto;
        white-space: nowrap;
    }

    .admin-page-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .admin-page-heading .admin-actions {
        width: 100%;
    }

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

    .admin-story-preview-card {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 500px) {
    .admin-filter-form,
    .admin-form-grid,
    .admin-detail-grid {
        grid-template-columns: 1fr;
    }

    .admin-full {
        grid-column: auto;
    }

    .admin-filter-actions > * {
        flex: 1 1 auto;
    }

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

.service-choice > input:checked + .service-choice-card .service-choice-indicator {
    border-color: #1269e8;
    background: #1269e8;
}

.service-choice > input:checked + .service-choice-card .service-choice-indicator::after {
    content: "";
    width: 8px;
    height: 5px;
    border: solid currentColor;
    border-width: 0 0 2px 2px;
    transform: rotate(-45deg) translate(1px, -1px);
}

.field-error {
    color: #a6322c;
    font-size: 12px;
    font-weight: 700;
}

.request-submit {
    width: 100%;
}

.check-option {
    min-height: 46px;
    border-radius: 13px;
    transition: border-color .18s ease, background-color .18s ease;
}

.check-option:focus-within {
    border-color: #78a8f4;
    background: #f5f9ff;
}

.admin-nav .container {
    align-items: center;
}

.admin-nav a {
    flex: 0 0 auto;
    padding: 7px 10px;
    border-radius: 9px;
    transition: color .18s ease, background-color .18s ease;
}

.admin-nav a:hover,
.admin-nav a:focus-visible {
    background: #edf4ff;
    color: #1269e8;
}

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

.admin-page-heading .panel-title {
    margin: 0;
}

.admin-page-heading p {
    margin: 4px 0 0;
}

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

.admin-inline-form {
    display: flex;
    min-width: 190px;
    align-items: center;
    gap: 7px;
}

.admin-inline-form select {
    min-width: 110px;
    max-width: 170px;
    padding: 7px 9px;
    border: 1px solid #dfe7f1;
    border-radius: 9px;
    background: #fff;
}

.admin-filter-panel {
    padding: 16px;
}

.admin-empty {
    padding: 36px 18px;
    color: #718096;
    text-align: center;
}

.template-editor {
    min-height: 360px !important;
    font-family: ui-monospace, Consolas, monospace;
    line-height: 2;
    direction: rtl;
}

.contract-document {
    width: min(210mm, 100%);
    min-height: 297mm;
    margin: 0 auto;
    padding: 20mm;
    border: 1px solid #e6edf5;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 12px 36px rgba(20, 43, 78, .09);
}

.contract-document-content {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    line-height: 2;
}

.contract-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

@media (max-width: 760px) {
    .admin-nav .container {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-block: 9px;
        scrollbar-width: thin;
    }

    .admin-page-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .admin-inline-form {
        min-width: 0;
    }

    .contract-document {
        min-height: 0;
        padding: 22px;
    }

    .contract-heading {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 560px) {
    .service-choice-grid {
        grid-template-columns: 1fr;
    }

    .service-choice-card {
        min-height: 88px;
    }

    .request-form-heading {
        gap: 10px;
    }

    .request-form-heading .service-icon {
        flex-basis: 44px;
        width: 44px;
        height: 44px;
    }

    .admin-content {
        padding-top: 20px;
    }

    .admin-actions,
    .admin-actions > * {
        width: 100%;
    }

    .admin-inline-form {
        flex-wrap: wrap;
    }
}

@media print {
    .admin-top,
    .admin-nav,
    .actions,
    .flash {
        display: none !important;
    }

    .admin-content {
        padding: 0;
    }

    .contract-document {
        width: 100%;
        min-height: 0;
        padding: 0;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }
}

.story-list .story-item {
    position: relative;
    padding: 0;
    border: 0;
    background: transparent;
    color: #536178;
    font: inherit;
    text-align: center;
    cursor: pointer;
}

.story-list .story-item:focus-visible {
    outline: 3px solid #1269e8;
    outline-offset: 4px;
    border-radius: 12px;
}

.story-list .story-item strong {
    color: var(--navy);
    font-size: 12px;
}

.story-icon {
    position: relative;
}

.story-image-placeholder {
    display: grid;
    width: 100%;
    height: 100%;
    place-items: center;
    background: linear-gradient(145deg, #eaf2ff, #d6e5fc);
    color: #1269e8;
    font-size: 24px;
}

.story-video-indicator {
    position: absolute;
    inset: auto 0 0;
    display: grid;
    min-height: 24px;
    place-items: center;
    background: linear-gradient(transparent, #10213be8);
    color: #fff;
    font-size: 11px;
}

.story-viewer[hidden] {
    display: none;
}

.story-viewer[open] {
    display: grid;
    width: 100vw;
    height: 100dvh;
    max-width: none;
    max-height: none;
    padding: 16px;
    place-items: center;
    overflow: hidden;
    border: 0;
    background: transparent;
    color: #fff;
}

.story-viewer::backdrop {
    background: rgb(7 13 24 / 88%);
    backdrop-filter: blur(8px);
}

.story-viewer__panel {
    position: relative;
    width: min(420px, calc(100vw - 32px));
    height: min(780px, calc(100dvh - 32px));
    aspect-ratio: 9 / 16;
    overflow: hidden;
    border: 1px solid rgb(255 255 255 / 16%);
    border-radius: 24px;
    background: #101725;
    box-shadow: 0 30px 90px rgb(0 0 0 / 40%);
}

.story-viewer__progress {
    position: absolute;
    z-index: 4;
    inset: calc(14px + env(safe-area-inset-top)) 14px auto;
    display: flex;
    gap: 4px;
    direction: ltr;
}

.story-viewer__progress-segment {
    flex: 1;
    height: 3px;
    overflow: hidden;
    border-radius: 99px;
    background: rgb(255 255 255 / 40%);
}

.story-viewer__progress-fill {
    display: block;
    width: 0;
    height: 100%;
    background: #fff;
    transition: width 50ms linear;
}

.story-viewer__media,
.story-viewer__media > img,
.story-viewer__media > video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.story-viewer__media > img,
.story-viewer__media > video {
    display: block;
    object-fit: cover;
}

.story-viewer__media > img[hidden],
.story-viewer__media > video[hidden],
.story-viewer__error[hidden],
.story-viewer__link[hidden],
.story-viewer__control[hidden] {
    display: none !important;
}

.story-viewer__caption {
    position: absolute;
    z-index: 2;
    inset: auto 0 0;
    padding: 100px 24px 88px;
    background: linear-gradient(transparent, rgb(5 10 18 / 88%));
    pointer-events: none;
}

.story-viewer__caption h2 {
    display: -webkit-box;
    margin: 0 0 5px;
    overflow: hidden;
    color: #fff;
    font-size: 21px;
    line-height: 1.5;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.story-viewer__caption p {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: rgb(255 255 255 / 86%);
    font-size: 13px;
    line-height: 1.8;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.story-viewer__close,
.story-viewer__previous,
.story-viewer__next,
.story-viewer__control {
    display: grid;
    place-items: center;
    border: 1px solid rgb(255 255 255 / 35%);
    background: rgb(9 17 30 / 48%);
    color: #fff;
    cursor: pointer;
    backdrop-filter: blur(8px);
}

.story-viewer__close {
    position: absolute;
    z-index: 5;
    inset: calc(28px + env(safe-area-inset-top)) 14px auto auto;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
}

.story-viewer__previous,
.story-viewer__next {
    position: absolute;
    z-index: 3;
    top: 50%;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    transform: translateY(-50%);
}

.story-viewer__previous {
    left: 10px;
}

.story-viewer__next {
    right: 10px;
}

.story-viewer__actions {
    position: absolute;
    z-index: 4;
    inset: auto 16px max(16px, env(safe-area-inset-bottom));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.story-viewer__playback {
    display: flex;
    gap: 8px;
}

.story-viewer__control {
    min-width: 40px;
    min-height: 40px;
    padding: 0 12px;
    border-radius: 99px;
    font-size: 13px;
}

.story-viewer__link {
    min-height: 42px;
    padding: 9px 18px;
    border-radius: 99px;
    background: #fff;
    color: #172b4d;
    box-shadow: 0 5px 20px rgb(0 0 0 / 22%);
}

.story-viewer__link:hover {
    background: #edf4ff;
    color: #172b4d;
}

.story-viewer__error {
    position: absolute;
    z-index: 2;
    inset: 45% 20px auto;
    padding: 12px;
    border-radius: 12px;
    background: rgb(8 14 25 / 75%);
    color: #fff;
    text-align: center;
}

.admin-story-thumb-wrap {
    position: relative;
    width: fit-content;
}

.admin-story-video-badge {
    position: absolute;
    right: 3px;
    bottom: 3px;
    display: grid;
    width: 20px;
    height: 20px;
    place-items: center;
    border-radius: 50%;
    background: #172b4d;
    color: #fff;
    font-size: 9px;
}

.admin-story-video {
    display: block;
    width: min(100%, 360px);
    max-height: 300px;
    margin-top: 12px;
    border-radius: 16px;
    background: #101725;
}

.admin-story-placeholder {
    display: grid;
    place-items: center;
    background: linear-gradient(145deg, #eaf2ff, #d6e5fc);
    color: #1269e8;
    font-size: 20px;
}

.admin-story-preview-placeholder {
    width: min(100%, 300px);
    height: 300px;
    border-radius: 18px;
}

@media (max-width: 600px) {
    .story-viewer[open] {
        padding: 0;
    }

    .story-viewer__panel {
        width: 100%;
        height: 100%;
        max-height: none;
        border: 0;
        border-radius: 0;
        aspect-ratio: auto;
    }
}
