:root {
    --ink: #050505;
    --muted: #5f698c;
    --line: #d1d7e3;
    --soft: #f4f4f4;
    --field: #f7f9ff;
    --blue: #6495ed;
    --green: #28a745;
    --shadow: 0 10px 30px rgb(35 48 73 / 10%);
}

* { box-sizing: border-box; }

html { color-scheme: light; }

body {
    margin: 0;
    background: #fff;
    color: var(--ink);
    font: 14px/1.5 Arial, Helvetica, sans-serif;
}

a { color: var(--ink); }

.site-header {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 600px;
    min-height: 58px;
    margin: 0 auto;
    padding: 12px 16px 0;
    position: relative;
}

.primary-navigation {
    display: flex;
    align-items: center;
    justify-content: center;
}

.site-header a,
.site-footer a {
    margin-right: 20px;
    text-decoration: none;
}

.site-header a:last-child,
.site-footer a:last-child { margin-right: 0; }

.site-header a:hover,
.site-footer a:hover,
.content a:hover { text-decoration: underline; }

.language-menu {
    position: relative;
    z-index: 20;
}

.language-menu-button {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 118px;
    height: 38px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 9px;
    outline: 0;
    background: #fff;
    color: var(--ink);
    font: 500 13px/1 Arial, sans-serif;
    cursor: pointer;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.language-menu-button:hover,
.language-menu-button:focus-visible,
.language-menu-button[aria-expanded="true"] {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgb(100 149 237 / 14%);
}

.language-menu-button > svg:first-child {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
}

.language-menu-button .chevron {
    width: 15px;
    height: 15px;
    margin-left: auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    transition: transform .18s ease;
}

.language-menu-button[aria-expanded="true"] .chevron { transform: rotate(180deg); }

.language-menu-popover {
    position: absolute;
    top: calc(100% + 7px);
    right: 0;
    width: 174px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #fff;
    box-shadow: var(--shadow);
}

.language-menu-popover[hidden] { display: none; }

.language-menu-popover a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 38px;
    margin: 0;
    padding: 0 10px;
    border-radius: 7px;
    text-decoration: none;
}

.language-menu-popover a:hover,
.language-menu-popover a:focus-visible { background: #f1f5ff; text-decoration: none; }
.language-menu-popover a[aria-current="true"] { color: #386fc8; background: #edf3ff; font-weight: 700; }
.language-code { color: #7b8493; font-size: 10px; font-weight: 700; letter-spacing: .08em; }

.brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: fit-content;
    margin: 17px auto 28px;
    color: var(--ink);
    text-decoration: none;
}

.brand-icon {
    display: block;
    width: 146px;
    height: 146px;
}

.brand-icon svg { display: block; width: 100%; height: 100%; }
.brand-icon circle { fill: none; stroke: var(--ink); stroke-width: 5; }
.brand-icon path:first-of-type { fill: var(--blue); stroke: var(--ink); stroke-width: 3; stroke-linejoin: round; }
.brand-icon path:last-of-type { fill: none; stroke: var(--ink); stroke-width: 5; stroke-linecap: round; }

.brand-word {
    margin-top: 6px;
    font-family: Copperplate, Papyrus, fantasy;
    font-size: 54px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -4px;
}

.brand-word span:last-child { color: var(--blue); }

.converter {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    border-radius: 0;
    background: var(--soft);
}

.converter-message {
    display: none;
    width: 100%;
    margin-bottom: 15px;
    font-weight: 700;
    text-align: center;
    overflow-wrap: anywhere;
}

.converter-message.show { display: block; }
.converter-message.error { color: #a61d24; }

.format-row {
    display: flex;
    align-items: center;
    gap: 13px;
    margin-bottom: 13px;
    font-size: 12px;
}

.format-row > span { font-weight: 700; }
.format-row label { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.format-row input { accent-color: var(--ink); }

.converter-row { display: flex; }
.url-field { position: relative; width: 82.142857%; }

.converter input[type="url"] {
    width: 100%;
    height: 48px;
    padding: 0 12px;
    outline: 0;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--field);
    color: var(--muted);
    font: 16px Arial, sans-serif;
}

.converter input[type="url"]:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 2px rgb(100 149 237 / 18%);
}

.converter button {
    width: 14.285714%;
    height: 48px;
    margin-left: 3.571428%;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: var(--ink);
    color: #fff;
    font: 400 14px Arial, sans-serif;
    cursor: pointer;
}

.converter button:hover { background: #242424; }
.converter button:disabled { cursor: wait; opacity: .7; }

.converter-frame-wrap {
    width: calc(100% + 40px);
    margin-left: -20px;
    margin-top: 20px;
    padding: 0;
    background: transparent;
}

.converter-frame-wrap iframe { display: block; width: 100%; border: 0; background: #fff; }
.converter-frame-wrap iframe[data-auto-height="true"] { overflow: hidden; }

.content {
    max-width: 600px;
    margin: 40px auto;
    overflow-wrap: anywhere;
}

.content h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 400;
    line-height: 1.25;
    text-align: center;
}

.content h2 {
    margin: 30px 0 10px;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
    text-align: center;
}

.content p {
    margin: 20px 0 0;
    font-size: 14px;
    hyphens: auto;
    line-height: 24px;
    text-align: justify;
}

.content ul,
.content ol { margin: 16px 0 0; padding-left: 25px; line-height: 24px; }
.content blockquote { margin: 20px 0 0; padding: 2px 0 2px 16px; border-left: 3px solid var(--blue); color: #424b5b; }
.content blockquote p { margin-top: 0; }
.content a { color: #285eae; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.content a:hover,
.content a:focus-visible { color: #173f7e; }

.guide-step { margin-top: 20px; }
.guide-step h3 { display: flex; align-items: flex-start; gap: 9px; margin: 0; font-size: 14px; line-height: 1.45; }
.guide-step h3 span { display: inline-grid; width: 25px; height: 25px; place-items: center; flex: 0 0 auto; border-radius: 50%; background: #edf3ff; color: #386fc8; font-size: 11px; }
.guide-step p { margin-top: 8px; }

.content .center { text-align: center; }
.page-content { min-height: 260px; }
.faq-list article h2 { text-align: left; }
.faq-list article p { margin-top: 8px; }

.site-footer {
    max-width: 600px;
    margin: 24px auto 0;
    padding: 22px 0 30px;
    border-top: 1px solid var(--line);
}

.footer-inner { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 18px; }
.footer-links { display: flex; flex-wrap: wrap; align-items: center; row-gap: 8px; }
.footer-inner > small { grid-column: 1 / -1; color: #8a929f; font-size: 10px; }
.site-footer-language .language-menu-popover { top: auto; right: 0; bottom: calc(100% + 7px); }
.site-footer-language .language-menu-button[aria-expanded="true"] .chevron { transform: rotate(0deg); }
.site-footer-language .language-menu-button .chevron { transform: rotate(180deg); }

.error-page {
    width: min(92%, 600px);
    margin: 8px auto 70px;
    padding: 52px 35px;
    border: 1px solid #e2e7ee;
    border-radius: 18px;
    background: linear-gradient(145deg, #fff, #f8faff);
    box-shadow: 0 20px 55px rgb(38 53 75 / 10%);
    text-align: center;
}

.error-visual { display: flex; align-items: center; justify-content: center; margin-bottom: 20px; font-size: 72px; font-weight: 800; line-height: 1; letter-spacing: -.08em; }
.error-visual svg { width: 78px; height: 78px; margin: 0 7px; }
.error-visual circle { fill: #edf3ff; stroke: #050505; stroke-width: 4; }
.error-visual path { fill: var(--blue); stroke: #050505; stroke-width: 3; stroke-linejoin: round; }
.error-kicker { color: #6495ed; font-size: 10px; font-weight: 700; letter-spacing: .14em; }
.error-page h1 { margin: 8px 0 0; font-size: 28px; }
.error-page > p { max-width: 430px; margin: 12px auto 0; color: #657083; line-height: 1.7; }
.error-actions { display: flex; justify-content: center; gap: 10px; margin-top: 24px; }
.error-actions a,
.error-actions button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; padding: 0 17px; border: 1px solid #ccd4df; border-radius: 9px; background: #fff; color: #17202a; font-weight: 700; text-decoration: none; cursor: pointer; }
.error-actions .error-primary { border-color: #050505; background: #050505; color: #fff; }
.error-actions a:hover,
.error-actions button:hover { transform: translateY(-1px); }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-left: 8px;
    vertical-align: -3px;
    border: 2px solid transparent;
    border-top-color: var(--green);
    border-bottom-color: var(--green);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

@media (max-width: 600px) {
    .brand-icon { width: 120px; height: 120px; }
    .brand-word { font-size: 45px; }
    .converter { width: 100%; }
    .url-field { width: 74%; }
    .converter button { width: 22.4%; }
    .content { width: 92%; }
    .site-footer { width: 92%; font-size: 12px; }
}

@media (max-width: 420px) {
    .site-header { justify-content: center; padding-left: 12px; }
    .site-header a { margin-right: 13px; }
    .language-menu-button { min-width: 104px; padding: 0 8px; font-size: 12px; }
    .format-row { gap: 8px; }
    .converter-row { gap: 10px; flex-direction: column; }
    .url-field,
    .converter button { width: 100%; margin-left: 0; }
    .converter button { font-size: 15px; }
    .footer-inner { grid-template-columns: 1fr; justify-items: center; }
    .footer-inner > small { grid-column: 1; }
    .footer-links { justify-content: center; }
    .site-footer-language .language-menu-popover { right: 50%; transform: translateX(50%); }
    .error-page { padding: 38px 22px; }
    .error-visual { font-size: 54px; }
    .error-visual svg { width: 62px; height: 62px; }
    .error-actions { flex-direction: column; }
}

@media (max-width: 350px) {
    .site-header { justify-content: center; padding-left: 8px; padding-right: 8px; }
}
