.nsgpsp-root {
    --nsgpsp-bg: #f7f9f8;
    --nsgpsp-panel: #ffffff;
    --nsgpsp-text: #172321;
    --nsgpsp-muted: #5f706c;
    --nsgpsp-line: #d8e2de;
    --nsgpsp-main: #116466;
    --nsgpsp-main-dark: #0b4d50;
    --nsgpsp-warn: #815500;
    --nsgpsp-bad: #9f2626;
    --nsgpsp-good: #127344;
    box-sizing: border-box;
    color: var(--nsgpsp-text);
    direction: rtl;
    font-family: inherit;
    margin: 32px auto;
    max-width: 780px;
    padding: 0 12px;
    text-align: right;
}

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

.nsgpsp-root [hidden] {
    display: none !important;
}

.nsgpsp-root bdi {
    direction: ltr;
    unicode-bidi: isolate;
}

.nsgpsp-card {
    background: var(--nsgpsp-bg);
    border: 1px solid var(--nsgpsp-line);
    border-radius: 14px;
    padding: 22px;
}

.nsgpsp-title {
    color: var(--nsgpsp-text);
    font-size: clamp(23px, 4vw, 36px);
    font-weight: 800;
    line-height: 1.45;
    margin: 0 0 10px;
    text-align: center;
}

.nsgpsp-desc {
    color: var(--nsgpsp-muted);
    font-size: 15px;
    line-height: 1.9;
    margin: 0;
    text-align: center;
}

.nsgpsp-version {
    color: var(--nsgpsp-muted);
    font-size: 12px;
    margin: 5px 0 0;
    text-align: center;
}

.nsgpsp-ios-guide {
    background: #eef7f5;
    border: 1px solid #b7d6d1;
    border-radius: 10px;
    color: #164d4f;
    font-size: 14px;
    line-height: 1.85;
    margin: 0;
    overflow: hidden;
    padding: 0;
}

.nsgpsp-ios-guide > summary {
    color: var(--nsgpsp-main-dark);
    cursor: pointer;
    font-size: 14px;
    font-weight: 800;
    padding: 12px 14px;
}

.nsgpsp-ios-guide-body {
    border-top: 1px solid #b7d6d1;
    padding: 13px 15px;
}

.nsgpsp-ios-guide strong {
    color: var(--nsgpsp-main-dark);
    display: block;
    font-size: 15px;
    margin-bottom: 5px;
}

.nsgpsp-ios-guide p {
    margin: 0 0 8px;
}

.nsgpsp-ios-guide ol {
    margin: 0;
    padding-inline-start: 22px;
}

.nsgpsp-ios-guide li + li {
    margin-top: 3px;
}

.nsgpsp-ios-guide .nsgpsp-select-original {
    background: #ffffff;
    border-color: var(--nsgpsp-main);
    margin-top: 12px;
}

.nsgpsp-ios-guide .nsgpsp-file-help {
    color: #315f5d;
    margin-top: 6px;
}

.nsgpsp-root[data-needs-original="1"] .nsgpsp-ios-guide {
    border-color: #d39a21;
    box-shadow: 0 0 0 3px rgba(211, 154, 33, .16);
}

.nsgpsp-panel {
    background: var(--nsgpsp-panel);
    border: 1px solid var(--nsgpsp-line);
    border-radius: 12px;
    display: grid;
    gap: 14px;
    margin-top: 18px;
    padding: 16px;
}

.nsgpsp-source-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.nsgpsp-source-button,
.nsgpsp-launch-camera,
.nsgpsp-copy-shortcut-base,
.nsgpsp-extract,
.nsgpsp-copy,
.nsgpsp-link,
.nsgpsp-select,
.nsgpsp-ios-guide > summary,
.nsgpsp-shortcut-guide > summary,
.nsgpsp-diagnostics > summary {
    -webkit-tap-highlight-color: rgba(17, 100, 102, .18);
    appearance: none;
    cursor: pointer;
    font-family: inherit;
    pointer-events: auto;
    touch-action: manipulation;
    transition: background-color .18s ease, border-color .18s ease,
        box-shadow .18s ease, color .18s ease, transform .18s ease;
}

.nsgpsp-source-button,
.nsgpsp-launch-camera,
.nsgpsp-copy-shortcut-base {
    border-radius: 10px;
    font-weight: 800;
    margin: 0;
}

.nsgpsp-source-button {
    background: #e6f4f1;
    border: 2px solid var(--nsgpsp-main);
    color: var(--nsgpsp-main-dark);
    display: grid;
    gap: 4px;
    min-height: 82px;
    padding: 13px;
    position: relative;
    text-align: center;
    user-select: none;
}

.nsgpsp-source-button span {
    font-size: 16px;
}

.nsgpsp-source-button small {
    color: var(--nsgpsp-muted);
    font-size: 12px;
    font-weight: 600;
}

.nsgpsp-source-button:hover,
.nsgpsp-source-button:focus-visible {
    background: #d7ece8;
    border-color: var(--nsgpsp-main-dark);
    box-shadow: 0 9px 22px rgba(11, 77, 80, .18);
    color: #073f42;
    transform: translateY(-3px);
}

.nsgpsp-source-button:active {
    box-shadow: 0 3px 9px rgba(11, 77, 80, .16);
    transform: translateY(1px) scale(.985);
}

.nsgpsp-camera-ready {
    align-items: center;
    background: #eef8f2;
    border: 1px solid #bddfc9;
    border-radius: 10px;
    color: var(--nsgpsp-good);
    display: grid;
    gap: 7px;
    padding: 12px;
    text-align: center;
}

.nsgpsp-camera-ready span {
    font-size: 13px;
}

.nsgpsp-camera-accuracy {
    color: var(--nsgpsp-muted);
    display: block;
    line-height: 1.7;
}

.nsgpsp-launch-camera,
.nsgpsp-copy-shortcut-base {
    background: var(--nsgpsp-main);
    border: 1px solid var(--nsgpsp-main);
    color: #ffffff;
    min-height: 46px;
    padding: 10px 13px;
}

.nsgpsp-launch-camera:hover,
.nsgpsp-launch-camera:focus-visible,
.nsgpsp-copy-shortcut-base:hover,
.nsgpsp-copy-shortcut-base:focus-visible {
    background: var(--nsgpsp-main-dark);
    border-color: var(--nsgpsp-main-dark);
    box-shadow: 0 7px 17px rgba(11, 77, 80, .2);
    color: #ffffff;
    transform: translateY(-2px);
}

.nsgpsp-launch-camera:active,
.nsgpsp-copy-shortcut-base:active {
    box-shadow: none;
    transform: translateY(1px) scale(.99);
}

.nsgpsp-original-heading {
    border-top: 1px solid #b7d6d1;
    margin-top: 14px;
    padding-top: 12px;
}

.nsgpsp-select {
    align-items: center;
    background: #eef7f5;
    border: 2px dashed #9fc4be;
    border-radius: 10px;
    color: var(--nsgpsp-main);
    cursor: pointer;
    display: grid;
    font-size: 15px;
    font-weight: 800;
    gap: 9px;
    line-height: 1.5;
    padding: 13px;
    text-align: center;
    width: 100%;
}

.nsgpsp-select:hover,
.nsgpsp-select:focus-within {
    background: #dff0ed;
    border-color: var(--nsgpsp-main-dark);
    box-shadow: 0 7px 17px rgba(11, 77, 80, .14);
    transform: translateY(-2px);
}

.nsgpsp-file {
    appearance: none;
    background: #ffffff;
    border: 1px solid var(--nsgpsp-line);
    border-radius: 8px;
    color: var(--nsgpsp-text);
    direction: ltr;
    display: block;
    font-family: inherit;
    font-size: 14px;
    height: auto;
    margin: 0;
    max-width: 100%;
    opacity: 1;
    padding: 9px;
    position: static;
    width: 100%;
}

.nsgpsp-visually-hidden {
    clip: rect(0 0 0 0) !important;
    clip-path: inset(50%) !important;
    height: 1px !important;
    opacity: 0 !important;
    overflow: hidden !important;
    padding: 0 !important;
    position: absolute !important;
    white-space: nowrap !important;
    width: 1px !important;
}

.nsgpsp-file-help {
    color: var(--nsgpsp-muted);
    display: block;
    font-size: 13px;
    line-height: 1.75;
    margin: -4px 2px 0;
    text-align: center;
}

.nsgpsp-extract,
.nsgpsp-copy,
.nsgpsp-link {
    align-items: center;
    appearance: none;
    border-radius: 9px;
    cursor: pointer;
    display: inline-flex;
    font-family: inherit;
    font-size: 15px;
    font-weight: 800;
    justify-content: center;
    line-height: 1.5;
    margin: 0;
    min-height: 50px;
    padding: 11px 14px;
    text-align: center;
    text-decoration: none;
    width: 100%;
}

.nsgpsp-extract {
    background: var(--nsgpsp-main);
    border: 1px solid var(--nsgpsp-main);
    color: #ffffff;
}

.nsgpsp-extract:hover:not(:disabled),
.nsgpsp-extract:focus-visible {
    background: var(--nsgpsp-main-dark);
    border-color: var(--nsgpsp-main-dark);
    box-shadow: 0 8px 20px rgba(11, 77, 80, .22);
    color: #ffffff;
    transform: translateY(-2px);
}

.nsgpsp-extract:active:not(:disabled),
.nsgpsp-copy:active,
.nsgpsp-link:active {
    box-shadow: none;
    transform: translateY(1px) scale(.99);
}

.nsgpsp-extract:disabled {
    box-shadow: none;
    cursor: not-allowed;
    opacity: .55;
    transform: none;
}

.nsgpsp-file:focus-visible,
.nsgpsp-extract:focus-visible,
.nsgpsp-copy:focus-visible,
.nsgpsp-link:focus-visible,
.nsgpsp-source-button:focus-visible,
.nsgpsp-launch-camera:focus-visible,
.nsgpsp-copy-shortcut-base:focus-visible,
.nsgpsp-ios-guide summary:focus-visible,
.nsgpsp-shortcut-guide summary:focus-visible,
.nsgpsp-diagnostics summary:focus-visible {
    outline: 3px solid rgba(17, 100, 102, .25);
    outline-offset: 2px;
}

.nsgpsp-shortcut-guide {
    background: #f1f6ff;
    border: 1px solid #bfd0eb;
    border-radius: 10px;
    color: #234265;
    font-size: 14px;
    line-height: 1.85;
    overflow: hidden;
}

.nsgpsp-shortcut-guide > summary {
    color: #173a63;
    cursor: pointer;
    font-weight: 800;
    padding: 12px 14px;
}

.nsgpsp-ios-guide > summary:hover,
.nsgpsp-ios-guide > summary:focus-visible,
.nsgpsp-shortcut-guide > summary:hover,
.nsgpsp-shortcut-guide > summary:focus-visible,
.nsgpsp-diagnostics > summary:hover,
.nsgpsp-diagnostics > summary:focus-visible {
    background: rgba(17, 100, 102, .09);
    color: var(--nsgpsp-main-dark);
}

.nsgpsp-shortcut-guide-body {
    border-top: 1px solid #bfd0eb;
    padding: 13px 15px;
}

.nsgpsp-shortcut-guide-body p,
.nsgpsp-shortcut-guide-body ol {
    margin: 0 0 10px;
}

.nsgpsp-shortcut-guide-body ol {
    padding-inline-start: 22px;
}

.nsgpsp-shortcut-template {
    background: #ffffff;
    border: 1px solid #cbd8eb;
    border-radius: 7px;
    color: #173a63;
    display: block;
    direction: ltr;
    font-family: Consolas, Monaco, monospace;
    font-size: 12px;
    line-height: 1.7;
    margin: 10px 0;
    overflow-wrap: anywhere;
    padding: 10px;
    text-align: left;
}

.nsgpsp-copy-shortcut-base {
    display: block;
    margin: 0 0 8px;
    width: 100%;
}

.nsgpsp-shortcut-guide-body small {
    color: #536a84;
    display: block;
}

.nsgpsp-status {
    background: #f8faf9;
    border: 1px solid var(--nsgpsp-line);
    border-radius: 9px;
    color: var(--nsgpsp-muted);
    font-size: 15px;
    line-height: 1.85;
    margin: 0;
    overflow-wrap: anywhere;
    padding: 12px 14px;
    text-align: right;
}

.nsgpsp-status[data-tone="success"] {
    background: #eef8f2;
    border-color: #bddfc9;
    color: var(--nsgpsp-good);
}

.nsgpsp-status[data-tone="warning"] {
    background: #fff8e8;
    border-color: #ead7aa;
    color: var(--nsgpsp-warn);
}

.nsgpsp-status[data-tone="error"] {
    background: #fff0f0;
    border-color: #e5b8b8;
    color: var(--nsgpsp-bad);
}

.nsgpsp-preview {
    background: #f0f4f2;
    border: 1px solid var(--nsgpsp-line);
    border-radius: 10px;
    min-height: 80px;
    overflow: hidden;
}

.nsgpsp-preview img {
    display: block;
    max-height: 400px;
    object-fit: contain;
    width: 100%;
}

.nsgpsp-diagnostics {
    background: #fbfcfc;
    border: 1px solid var(--nsgpsp-line);
    border-radius: 9px;
    color: var(--nsgpsp-text);
    font-size: 13px;
    overflow: hidden;
}

.nsgpsp-diagnostics summary {
    color: var(--nsgpsp-main-dark);
    cursor: pointer;
    font-weight: 800;
    padding: 11px 13px;
}

.nsgpsp-diagnostics dl {
    border-top: 1px solid var(--nsgpsp-line);
    margin: 0;
    padding: 0;
}

.nsgpsp-diagnostics dl > div {
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(110px, .8fr) minmax(0, 1.2fr);
    padding: 9px 13px;
}

.nsgpsp-diagnostics dl > div + div {
    border-top: 1px solid #edf1ef;
}

.nsgpsp-diagnostics dt {
    color: var(--nsgpsp-muted);
    font-weight: 600;
}

.nsgpsp-diagnostics dd {
    direction: rtl;
    margin: 0;
    overflow-wrap: anywhere;
    text-align: right;
}

.nsgpsp-result {
    border: 1px solid var(--nsgpsp-line);
    border-radius: 10px;
    overflow: hidden;
}

.nsgpsp-row {
    align-items: center;
    background: #ffffff;
    border-bottom: 1px solid var(--nsgpsp-line);
    display: grid;
    gap: 10px;
    grid-template-columns: 150px minmax(0, 1fr);
    padding: 12px;
}

.nsgpsp-row span {
    color: var(--nsgpsp-muted);
    font-size: 14px;
}

.nsgpsp-row strong {
    color: var(--nsgpsp-text);
    direction: ltr;
    font-family: Consolas, Monaco, monospace;
    overflow-wrap: anywhere;
    text-align: left;
}

.nsgpsp-source-row strong,
.nsgpsp-accuracy-row strong {
    direction: rtl;
    font-family: inherit;
    text-align: right;
}

.nsgpsp-actions {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 12px;
}

.nsgpsp-link,
.nsgpsp-copy {
    background: #ffffff;
    border: 1px solid var(--nsgpsp-line);
    color: var(--nsgpsp-text);
}

.nsgpsp-link:first-child {
    background: var(--nsgpsp-main);
    border-color: var(--nsgpsp-main);
    color: #ffffff;
}

.nsgpsp-link:hover,
.nsgpsp-link:focus-visible,
.nsgpsp-copy:hover,
.nsgpsp-copy:focus-visible {
    background: #e8f3f1;
    border-color: var(--nsgpsp-main);
    box-shadow: 0 7px 17px rgba(11, 77, 80, .16);
    color: var(--nsgpsp-main-dark);
    transform: translateY(-2px);
}

.nsgpsp-link:first-child:hover,
.nsgpsp-link:first-child:focus-visible {
    background: var(--nsgpsp-main-dark);
    border-color: var(--nsgpsp-main-dark);
    color: #ffffff;
}

@media (max-width: 640px) {
    .nsgpsp-root {
        margin: 24px auto;
        padding: 0 8px;
    }

    .nsgpsp-card {
        padding: 13px;
    }

    .nsgpsp-panel {
        padding: 12px;
    }

    .nsgpsp-source-grid {
        grid-template-columns: 1fr;
    }

    .nsgpsp-ios-guide-body {
        padding: 12px;
    }

    .nsgpsp-diagnostics dl > div,
    .nsgpsp-row,
    .nsgpsp-actions {
        grid-template-columns: 1fr;
    }

    .nsgpsp-row strong {
        text-align: right;
    }
}

@media (prefers-reduced-motion: reduce) {
    .nsgpsp-root * {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }

    .nsgpsp-root button:hover,
    .nsgpsp-root button:focus-visible,
    .nsgpsp-root button:active,
    .nsgpsp-root a:hover,
    .nsgpsp-root a:focus-visible,
    .nsgpsp-root a:active,
    .nsgpsp-root label:hover,
    .nsgpsp-root label:focus-within {
        transform: none !important;
    }
}
