/* =========================================
   SurPad Online Surveying Tools - Shared UI
   ========================================= */

/* Local Fonts (shared with main site) */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400 500;
    font-display: swap;
    src: url(../fonts/google-fonts/inter-400-cyrillic-ext.woff2) format('woff2');
    unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400 500;
    font-display: swap;
    src: url(../fonts/google-fonts/inter-400-cyrillic.woff2) format('woff2');
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400 500;
    font-display: swap;
    src: url(../fonts/google-fonts/inter-400-greek-ext.woff2) format('woff2');
    unicode-range: U+1F00-1FFF;
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400 500;
    font-display: swap;
    src: url(../fonts/google-fonts/inter-400-greek.woff2) format('woff2');
    unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400 500;
    font-display: swap;
    src: url(../fonts/google-fonts/inter-400-vietnamese.woff2) format('woff2');
    unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400 500;
    font-display: swap;
    src: url(../fonts/google-fonts/inter-400-latin-ext.woff2) format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400 500;
    font-display: swap;
    src: url(../fonts/google-fonts/inter-400-latin.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Plus Jakarta Sans';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url(../fonts/google-fonts/plus-jakarta-sans-400-cyrillic-ext.woff2) format('woff2');
    unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
    font-family: 'Plus Jakarta Sans';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url(../fonts/google-fonts/plus-jakarta-sans-400-vietnamese.woff2) format('woff2');
    unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
    font-family: 'Plus Jakarta Sans';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url(../fonts/google-fonts/plus-jakarta-sans-400-latin-ext.woff2) format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Plus Jakarta Sans';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url(../fonts/google-fonts/plus-jakarta-sans-400-latin.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --color-primary: #5267d8;
    --primary: #5267d8;
    --primary-strong: #4054c4;
    --secondary: #8174d8;
    --accent: #52aeb3;
    --success: #1b8f75;
    --danger: #c84b60;
    --ink: #1e2942;
    --muted: #66728a;
    --surface: rgba(255, 255, 255, 0.78);
    --surface-solid: #ffffff;
    --surface-soft: #f7f9ff;
    --border: rgba(92, 111, 157, 0.18);
    --shadow-sm: 0 10px 30px rgba(45, 61, 105, 0.08);
    --shadow-lg: 0 24px 70px rgba(46, 61, 108, 0.14);
    --radius-sm: 14px;
    --radius-md: 22px;
    --radius-lg: 30px;
    --transition: 180ms ease;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.55;
    background:
        radial-gradient(circle at 8% 8%, rgba(154, 178, 255, 0.28), transparent 28rem),
        radial-gradient(circle at 90% 15%, rgba(174, 226, 220, 0.28), transparent 25rem),
        linear-gradient(145deg, #f8faff 0%, #f2f5fc 50%, #f8fbfb 100%);
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

body::before,
body::after {
    content: "";
    position: fixed;
    z-index: -1;
    width: 22rem;
    height: 22rem;
    border-radius: 50%;
    filter: blur(18px);
    opacity: 0.45;
    pointer-events: none;
}

body::before {
    top: 14rem;
    left: -10rem;
    background: rgba(128, 119, 219, 0.24);
}

body::after {
    right: -11rem;
    bottom: 7rem;
    background: rgba(77, 177, 180, 0.2);
}

h1, h2, h3, h4 {
    font-family: "Plus Jakarta Sans", Inter, ui-sans-serif, system-ui, sans-serif;
}

button,
textarea,
input,
select {
    font: inherit;
}

a {
    color: inherit;
}

img {
    max-width: 100%;
    height: auto;
}

.container {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

/* Header & Topbar */
.site-header {
    padding: 22px 0 0;
    position: relative;
    z-index: 50;
}

.topbar {
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 14px 10px 18px;
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: var(--shadow-sm);
    position: relative;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
}

.brand-logo {
    display: block;
    width: auto;
    height: 36px;
    max-width: 150px;
    object-fit: contain;
}

.topbar-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 auto;
}

.nav-link-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 40px;
    padding: 0 13px;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: #3f4b64;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
    white-space: nowrap;
}

.nav-link-item:hover,
.nav-link-item.is-active {
    background: rgba(82, 103, 216, 0.09);
    color: var(--primary-strong);
}

.tools-dropdown-wrap {
    position: relative;
}

.tools-dropdown-trigger .fa-chevron-down {
    font-size: 10px;
    opacity: 0.7;
    transition: transform var(--transition);
}

.tools-dropdown-wrap.is-open .tools-dropdown-trigger .fa-chevron-down {
    transform: rotate(180deg);
}

.tools-dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    min-width: 270px;
    padding: 8px;
    border: 1px solid rgba(92, 111, 157, 0.18);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(18px);
    box-shadow: 0 20px 50px rgba(30, 41, 66, 0.16);
    display: none;
    z-index: 120;
}

.tools-dropdown-wrap.is-open .tools-dropdown-menu {
    display: grid;
    gap: 3px;
}

.tools-dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    border-radius: 11px;
    text-decoration: none;
    color: var(--ink);
    font-size: 0.88rem;
    font-weight: 600;
    transition: background var(--transition), color var(--transition);
}

.tools-dropdown-menu a i {
    width: 18px;
    text-align: center;
    color: var(--primary);
    font-size: 0.92rem;
    flex-shrink: 0;
}

.tools-dropdown-menu a:hover,
.tools-dropdown-menu a.is-current {
    background: rgba(82, 103, 216, 0.1);
    color: var(--primary-strong);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Override language-selector.css so the single trigger button stays visible on all viewports inside .topbar */
.topbar .sp-language-trigger {
    min-height: 40px;
    padding: 8px 13px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid var(--border);
    font-size: 0.86rem;
    font-weight: 600;
}

.topbar .sp-language-trigger:hover {
    background: #ffffff;
    border-color: var(--primary);
}

.topbar-mobile-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--ink);
    font-size: 18px;
    cursor: pointer;
}

.mobile-drawer {
    display: none;
    margin-top: 10px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.88);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow-sm);
}

.mobile-drawer.is-open {
    display: grid;
    gap: 4px;
}

.mobile-drawer-label {
    padding: 8px 12px 4px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.mobile-drawer a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 11px;
    text-decoration: none;
    color: var(--ink);
    font-size: 0.92rem;
    font-weight: 600;
}

.mobile-drawer a i {
    width: 18px;
    text-align: center;
    color: var(--primary);
}

.mobile-drawer a:hover,
.mobile-drawer a.is-current {
    background: rgba(82, 103, 216, 0.1);
    color: var(--primary-strong);
}

/* Breadcrumb */
.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 22px;
    font-size: 0.82rem;
    color: var(--muted);
}

.breadcrumbs a {
    text-decoration: none;
    font-weight: 500;
}

.breadcrumbs a:hover {
    color: var(--primary-strong);
}

.breadcrumbs .sep {
    opacity: 0.45;
}

/* Hero */
.hero {
    padding: clamp(22px, 4vw, 44px) 0 34px;
    text-align: center;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding: 7px 14px;
    border: 1px solid rgba(82, 103, 216, 0.18);
    border-radius: 999px;
    color: #536289;
    background: rgba(255, 255, 255, 0.68);
    font-size: 0.84rem;
    font-weight: 700;
    backdrop-filter: blur(12px);
}

.hero h1 {
    max-width: 860px;
    margin: 0 auto;
    font-size: clamp(2rem, 5vw, 3.7rem);
    line-height: 1.08;
    letter-spacing: -0.04em;
}

.gradient-text {
    color: transparent;
    background: linear-gradient(110deg, var(--primary-strong), var(--secondary) 55%, var(--accent));
    background-clip: text;
    -webkit-background-clip: text;
}

.hero p {
    max-width: 720px;
    margin: 18px auto 0;
    color: var(--muted);
    font-size: clamp(0.98rem, 1.8vw, 1.12rem);
}

.hero-features {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 22px;
}

.feature-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 13px;
    border-radius: 999px;
    color: #536078;
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.82);
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: 0 7px 20px rgba(48, 63, 102, 0.06);
}

.feature-pill i {
    color: var(--primary);
}

/* Main & Cards */
main {
    flex: 1;
    padding-bottom: 56px;
}

.glass-card {
    border: 1px solid rgba(255, 255, 255, 0.88);
    border-radius: var(--radius-lg);
    background: var(--surface);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    box-shadow: var(--shadow-lg);
}

.converter-card {
    padding: clamp(18px, 3vw, 32px);
}

.converter-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
    gap: 22px;
    align-items: stretch;
}

.panel {
    min-width: 0;
    padding: clamp(18px, 2.4vw, 26px);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.74);
    display: flex;
    flex-direction: column;
}

.panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
}

.panel-title {
    margin: 0;
    font-size: 1.08rem;
    letter-spacing: -0.02em;
}

.panel-hint {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.88rem;
}

.step-badge {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 11px;
    color: var(--primary-strong);
    background: rgba(82, 103, 216, 0.1);
    font-size: 0.86rem;
    font-weight: 800;
}

/* Drop zone */
.drop-zone {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 152px;
    padding: 22px;
    border: 1.5px dashed rgba(82, 103, 216, 0.32);
    border-radius: 18px;
    background: linear-gradient(145deg, rgba(246, 248, 255, 0.92), rgba(248, 252, 252, 0.84));
    text-align: center;
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition), transform var(--transition);
}

.drop-zone:hover,
.drop-zone.is-dragover {
    border-color: var(--primary);
    background: linear-gradient(145deg, rgba(239, 243, 255, 0.98), rgba(240, 250, 249, 0.95));
    transform: translateY(-2px);
}

.drop-icon {
    width: 50px;
    height: 50px;
    display: grid;
    place-items: center;
    margin: 0 auto 12px;
    border-radius: 15px;
    color: var(--primary-strong);
    background: linear-gradient(145deg, rgba(82, 103, 216, 0.14), rgba(82, 174, 179, 0.14));
    font-size: 1.2rem;
}

.drop-title {
    display: block;
    margin-bottom: 4px;
    font-weight: 700;
}

.drop-subtitle,
.file-meta {
    display: block;
    color: var(--muted);
    font-size: 0.84rem;
}

.file-meta {
    margin-top: 6px;
    color: var(--primary-strong);
    font-weight: 600;
}

.visually-hidden-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
    color: #8a94a9;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.divider::before,
.divider::after {
    content: "";
    height: 1px;
    flex: 1;
    background: var(--border);
}

/* Inputs & Textareas */
.textarea-wrap {
    position: relative;
}

textarea {
    width: 100%;
    min-height: 220px;
    resize: vertical;
    padding: 16px 16px 38px;
    border: 1px solid var(--border);
    border-radius: 16px;
    outline: none;
    color: #28324a;
    background: rgba(249, 250, 254, 0.94);
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 0.86rem;
    line-height: 1.6;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

textarea:focus,
.field-input:focus,
.field-select:focus {
    border-color: rgba(82, 103, 216, 0.65);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(82, 103, 216, 0.1);
}

.textarea-meta {
    position: absolute;
    right: 14px;
    bottom: 11px;
    color: #8a94a9;
    font-size: 0.75rem;
}

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

.field-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.field-label {
    font-size: 0.84rem;
    font-weight: 700;
    color: #46516a;
}

.field-input,
.field-select {
    width: 100%;
    min-height: 46px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: rgba(249, 250, 254, 0.96);
    color: var(--ink);
    font-size: 0.95rem;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

/* Radio / Segmented option groups */
.coordinate-order {
    margin-top: 14px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: rgba(247, 249, 255, 0.82);
}

.coordinate-order-title {
    display: block;
    margin-bottom: 9px;
    color: #4f5a72;
    font-size: 0.82rem;
    font-weight: 700;
}

.coordinate-order-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.coordinate-order-options.cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.coordinate-order-option {
    position: relative;
    cursor: pointer;
}

.coordinate-order-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.coordinate-order-option span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 12px;
    color: #5d687f;
    background: rgba(255, 255, 255, 0.8);
    font-size: 0.84rem;
    font-weight: 700;
    text-align: center;
    transition: border-color var(--transition), background var(--transition), color var(--transition), box-shadow var(--transition);
}

.coordinate-order-option input:checked + span {
    color: var(--primary-strong);
    border-color: rgba(82, 103, 216, 0.5);
    background: rgba(82, 103, 216, 0.1);
    box-shadow: 0 0 0 3px rgba(82, 103, 216, 0.07);
}

.coordinate-order-hint {
    margin: 8px 2px 0;
    color: var(--muted);
    font-size: 0.77rem;
}

/* Mode tabs (for WGS84 <-> MGRS) */
.mode-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 5px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(242, 245, 252, 0.9);
    margin-bottom: 18px;
}

.mode-tab {
    min-height: 42px;
    padding: 8px 12px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--transition), color var(--transition), box-shadow var(--transition);
}

.mode-tab.is-active {
    background: #ffffff;
    color: var(--primary-strong);
    box-shadow: 0 4px 12px rgba(45, 61, 105, 0.1);
}

/* Buttons */
.btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 46px;
    padding: 0 18px;
    border: 0;
    border-radius: 14px;
    cursor: pointer;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.92rem;
    transition: transform var(--transition), box-shadow var(--transition), filter var(--transition), background var(--transition);
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px);
    filter: saturate(1.03);
}

.btn:active:not(:disabled) {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.52;
    cursor: not-allowed;
}

.btn-primary {
    width: 100%;
    margin-top: 14px;
    color: #fff;
    background: linear-gradient(110deg, var(--primary-strong), var(--secondary));
    box-shadow: 0 14px 30px rgba(71, 84, 190, 0.24);
}

.btn-row .btn-primary {
    margin-top: 0;
    flex: 1 1 180px;
}

.btn-download {
    width: 100%;
    color: #fff;
    background: linear-gradient(110deg, #16866f, #39a296);
    box-shadow: 0 14px 30px rgba(27, 143, 117, 0.22);
}

.btn-row .btn-download {
    flex: 1 1 180px;
}

.btn-secondary {
    color: #46516a;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
    border-color: rgba(82, 103, 216, 0.45);
    color: var(--primary-strong);
}

/* Output, placeholder, stats, tables */
.output-placeholder {
    flex: 1;
    min-height: 220px;
    display: grid;
    place-items: center;
    padding: 30px 18px;
    text-align: center;
}

.output-placeholder-icon {
    width: 60px;
    height: 60px;
    display: grid;
    place-items: center;
    margin: 0 auto 14px;
    border-radius: 18px;
    color: #7180a5;
    background: rgba(91, 112, 163, 0.09);
    font-size: 1.35rem;
}

.output-placeholder h3 {
    margin: 0 0 6px;
    font-size: 1rem;
}

.output-placeholder p {
    max-width: 340px;
    margin: 0;
    color: var(--muted);
    font-size: 0.87rem;
}

.loading {
    display: none;
    min-height: 220px;
    place-items: center;
    text-align: center;
}

.loading.is-visible {
    display: grid;
}

.spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 14px;
    border: 4px solid rgba(82, 103, 216, 0.14);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.status-message {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    margin-bottom: 14px;
    padding: 13px 14px;
    border-radius: 14px;
    font-size: 0.88rem;
}

.status-message.error {
    color: #8c2f40;
    background: rgba(248, 226, 231, 0.88);
    border: 1px solid rgba(200, 75, 96, 0.24);
}

.status-message.success {
    color: #146955;
    background: rgba(220, 247, 239, 0.88);
    border: 1px solid rgba(27, 143, 117, 0.24);
}

.result-wrap {
    display: none;
}

.result-wrap.is-visible {
    display: block;
}

.result-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.stat-card {
    padding: 13px;
    border-radius: 14px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
}

.stat-label {
    display: block;
    color: var(--muted);
    font-size: 0.75rem;
}

.stat-value {
    display: block;
    margin-top: 2px;
    font-size: 1.05rem;
    font-weight: 800;
    word-break: break-word;
}

.stat-value-small {
    font-size: 0.9rem;
}

.result-highlight {
    padding: 18px;
    border-radius: 16px;
    background: linear-gradient(145deg, rgba(242, 245, 255, 0.95), rgba(240, 250, 249, 0.92));
    border: 1px solid rgba(82, 103, 216, 0.24);
    margin-bottom: 14px;
}

.result-highlight-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    margin-bottom: 6px;
}

.result-highlight-value {
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: clamp(1.15rem, 2.5vw, 1.55rem);
    font-weight: 800;
    color: var(--primary-strong);
    word-break: break-all;
}

.table-shell {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #ffffff;
}

.table-scroll {
    max-height: 400px;
    overflow: auto;
}

.coordinates-table {
    width: 100%;
    min-width: 380px;
    border-collapse: collapse;
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 0.82rem;
}

.coordinates-table.projections-table {
    min-width: 1100px;
    font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

.coordinates-table th,
.coordinates-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #edf0f6;
    white-space: nowrap;
}

.coordinates-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    color: #59647a;
    background: rgba(246, 248, 252, 0.98);
    font-family: Inter, ui-sans-serif, system-ui, sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
}

.coordinates-table tbody tr:hover {
    background: #f4f7ff;
}

.coordinates-table.projections-table tbody tr {
    cursor: pointer;
}

.coordinates-table tbody tr:last-child td {
    border-bottom: 0;
}

.more-points {
    margin: 10px 12px 12px;
    color: var(--muted);
    font-size: 0.8rem;
}

.download-section {
    display: none;
    margin-top: 14px;
}

.download-section.is-visible {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* Projections Search Bar & Chips */
.search-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.search-input-wrap {
    position: relative;
    flex: 1 1 280px;
}

.search-input-wrap i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    pointer-events: none;
}

.search-input-wrap .field-input {
    padding-left: 42px;
}

.quick-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.quick-chip {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.8);
    color: #46516a;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition), color var(--transition);
}

.quick-chip:hover {
    border-color: var(--primary);
    background: rgba(82, 103, 216, 0.08);
    color: var(--primary-strong);
}

/* Details tiles grid */
.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.detail-tile {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.82);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.detail-tile-label {
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}

.detail-tile-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.detail-tile-value {
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 0.94rem;
    font-weight: 700;
    color: var(--ink);
    word-break: break-word;
}

.icon-copy-btn {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-soft);
    color: var(--primary-strong);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}

.icon-copy-btn:hover {
    background: var(--primary);
    color: #ffffff;
}

/* Sections: Steps, Video, Related Tools, SurPad CTA */
.content-section {
    margin-top: 32px;
}

.section-heading {
    margin: 0 0 16px;
}

.section-heading h2 {
    margin: 0;
    font-size: clamp(1.3rem, 2.8vw, 1.8rem);
    letter-spacing: -0.03em;
}

.section-heading p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 0.92rem;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.step-card {
    padding: 19px;
    border: 1px solid rgba(255, 255, 255, 0.88);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.66);
    box-shadow: var(--shadow-sm);
}

.step-number {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    margin-bottom: 12px;
    border-radius: 11px;
    color: var(--primary-strong);
    background: rgba(82, 103, 216, 0.1);
    font-size: 0.82rem;
    font-weight: 800;
}

.step-card h3 {
    margin: 0 0 6px;
    font-size: 0.96rem;
}

.step-card p {
    margin: 0;
    color: var(--muted);
    font-size: 0.84rem;
}

.video-card {
    overflow: hidden;
    padding: 10px;
}

.video-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    overflow: hidden;
    border-radius: 20px;
    background: #e9edf6;
}

.video-container iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Cross-linking Tools Grid */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.tool-link-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.88);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.72);
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.tool-link-card:hover {
    transform: translateY(-3px);
    border-color: rgba(82, 103, 216, 0.42);
    box-shadow: 0 16px 36px rgba(45, 61, 105, 0.12);
}

.tool-link-icon {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    background: linear-gradient(145deg, rgba(82, 103, 216, 0.14), rgba(82, 174, 179, 0.14));
    color: var(--primary-strong);
    font-size: 1.05rem;
}

.tool-link-body h3 {
    margin: 0 0 4px;
    font-size: 0.96rem;
    color: var(--ink);
}

.tool-link-body p {
    margin: 0;
    font-size: 0.82rem;
    color: var(--muted);
    line-height: 1.45;
}

/* SurPad Promo Banner */
.surpad-cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 26px 28px;
    border-radius: 24px;
    background: linear-gradient(120deg, #4054c4, #6c63d8 60%, #449ea6);
    color: #ffffff;
    box-shadow: 0 20px 50px rgba(64, 84, 196, 0.24);
}

.surpad-cta h2 {
    margin: 0 0 6px;
    font-size: clamp(1.2rem, 2.5vw, 1.55rem);
    color: #ffffff;
}

.surpad-cta p {
    margin: 0;
    max-width: 620px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.92rem;
}

.surpad-cta .btn-cta-white {
    background: #ffffff;
    color: var(--primary-strong);
    padding: 0 22px;
    min-height: 46px;
    border-radius: 14px;
    font-weight: 700;
    white-space: nowrap;
}

/* Toast notification */
.copy-toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%) translateY(20px);
    padding: 11px 18px;
    border-radius: 12px;
    background: #1e2942;
    color: #ffffff;
    font-size: 0.86rem;
    font-weight: 600;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 300;
}

.copy-toast.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Footer */
footer {
    margin-top: auto;
    padding: 28px 0 36px;
    color: #6b768f;
    text-align: center;
    font-size: 0.84rem;
    border-top: 1px solid rgba(92, 111, 157, 0.12);
}

.footer-links-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 20px;
    margin-bottom: 12px;
}

.footer-links-row a {
    text-decoration: none;
    font-weight: 500;
}

.footer-links-row a:hover {
    color: var(--primary-strong);
}

/* Responsive */
@media (max-width: 960px) {
    .topbar-nav {
        display: none;
    }

    .topbar-mobile-toggle {
        display: inline-flex;
    }

    .topbar .sp-language-trigger {
        background: transparent;
        border: 0;
        padding: 0 8px;
        min-height: 36px;
    }

    .topbar .sp-language-trigger .sp-current-language,
    .topbar .sp-language-trigger .sp-language-arrow {
        display: none;
    }

    .topbar .sp-language-trigger .sp-current-code {
        display: inline;
        font-size: 13px;
        font-weight: 700;
    }

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

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

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

@media (max-width: 640px) {
    .container {
        width: min(100% - 20px, 1180px);
    }

    .site-header {
        padding-top: 12px;
    }

    .topbar {
        min-height: 52px;
        padding: 7px 10px 7px 12px;
        border-radius: 15px;
    }

    .brand-logo {
        height: 30px;
        max-width: 130px;
    }

    .hero {
        padding: 20px 0 24px;
    }

    .converter-card {
        padding: 12px;
        border-radius: 22px;
    }

    .panel {
        padding: 16px;
        border-radius: 18px;
    }

    .field-grid,
    .steps-grid,
    .tools-grid {
        grid-template-columns: 1fr;
    }

    .surpad-cta {
        padding: 20px;
    }
}
