/*
 * barkodoku theme
 * Ink on cool white, with the red of a scanner's laser line as the one accent.
 * Archivo (slightly wide) for text, Martian Mono only for barcode digits, Noto Sans JP for Japanese.
 * Loaded after bootstrap.min.css and re-themes it through its CSS variables.
 */

@import url("/jp/css/fonts/noto-sans-jp/400-efe48a435b7f895835eea3fd31632afd.css");
@import url("/jp/css/fonts/noto-sans-jp/700-07bbe9c0e39e2344740e301589f7a0e2.css");

@font-face {
    font-family: "Archivo Variable";
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    font-stretch: 62% 125%;
    src: url("/jp/css/fonts/archivo/archivo-latin-ext-wdth-normal-589f7bc0fac4910a173640106fe30c0e.woff2") format("woff2-variations");
    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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: "Archivo Variable";
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    font-stretch: 62% 125%;
    src: url("/jp/css/fonts/archivo/archivo-latin-wdth-normal-de2f1fe81758075f50ed6ce1e8e238ed.woff2") format("woff2-variations");
    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: "Martian Mono Variable";
    font-style: normal;
    font-display: swap;
    font-weight: 100 800;
    src: url("/jp/css/fonts/martian-mono/martian-mono-latin-wght-normal-64092ca6bf632baf715c89b3b2ad90ff.woff2") format("woff2-variations");
    unicode-range: U+0000-00FF;
}

/* ---------- Tokens ---------- */

:root {
    --ink: #142033;
    --ink-2: #3b4759;
    --ink-3: #626d7e;
    --paper: #f3f5f7;
    --surface: #ffffff;
    --rule: #dce1e8;
    --rule-strong: #b9c1cd;
    --laser: #e5132b;
    --laser-soft: #fde8eb;
    --go: #0b7a4f;
    --go-soft: #e2f3ea;

    --font-text: "Archivo Variable", "Noto Sans JP", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-digits: "Martian Mono Variable", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    --stretch-head: 112%;
    --stretch-display: 118%;

    --radius: 6px;
    --radius-lg: 10px;

    /* Older names still used in inline page styles */
    --primary-color: var(--ink);
    --primary-hover: #22324d;
    --bg-light: var(--paper);
    --text-dark: var(--ink);

    /* Bootstrap */
    --bs-body-font-family: var(--font-text);
    --bs-body-color: var(--ink);
    --bs-body-color-rgb: 20, 32, 51;
    --bs-body-bg: var(--paper);
    --bs-emphasis-color: var(--ink);
    --bs-secondary-color: var(--ink-3);
    --bs-heading-color: var(--ink);
    --bs-primary: var(--ink);
    --bs-primary-rgb: 20, 32, 51;
    --bs-primary-text-emphasis: var(--ink);
    --bs-primary-bg-subtle: #e6eaf0;
    --bs-primary-border-subtle: var(--rule-strong);
    --bs-danger: var(--laser);
    --bs-danger-rgb: 229, 19, 43;
    --bs-success: var(--go);
    --bs-success-rgb: 11, 122, 79;
    --bs-link-color: var(--ink);
    --bs-link-color-rgb: 20, 32, 51;
    --bs-link-hover-color: var(--laser);
    --bs-link-hover-color-rgb: 229, 19, 43;
    --bs-border-color: var(--rule);
    --bs-border-radius: var(--radius);
    --bs-border-radius-sm: 4px;
    --bs-border-radius-lg: var(--radius-lg);
    --bs-border-radius-xl: var(--radius-lg);
    --bs-border-radius-xxl: var(--radius-lg);
    /* Pills across the old templates become label-like corners */
    --bs-border-radius-pill: var(--radius);
    --bs-focus-ring-color: rgba(229, 19, 43, 0.35);
    --bs-box-shadow-sm: none;
}

/* ---------- Base ---------- */

body {
    font-family: var(--font-text);
    font-stretch: 104%;
    background-color: var(--paper);
    color: var(--ink);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

:lang(ja) body,
html:lang(ja) {
    line-height: 1.8;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-stretch: var(--stretch-head);
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.display-1, .display-2, .display-3, .display-4, .display-5, .display-6 {
    font-stretch: var(--stretch-display);
    font-weight: 800;
    letter-spacing: -0.025em;
}

html:lang(ja) h1, html:lang(ja) h2, html:lang(ja) h3,
html:lang(ja) .display-4, html:lang(ja) .display-5 {
    letter-spacing: 0;
    line-height: 1.35;
    /* Break Japanese headings between phrases, not mid-word (where supported) */
    word-break: auto-phrase;
}

a {
    text-underline-offset: 0.18em;
    text-decoration-thickness: 1px;
}

:focus-visible {
    outline: 2px solid var(--laser);
    outline-offset: 2px;
}

::selection {
    background: var(--laser-soft);
    color: var(--ink);
}

.font-monospace,
.digits {
    font-family: var(--font-digits) !important;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
}

.text-muted {
    color: var(--ink-3) !important;
}

/* ---------- Bootstrap components ---------- */

.btn {
    --bs-btn-font-weight: 600;
    --bs-btn-border-radius: var(--radius);
    font-stretch: 108%;
}

.btn-primary {
    --bs-btn-bg: var(--ink);
    --bs-btn-border-color: var(--ink);
    --bs-btn-hover-bg: #22324d;
    --bs-btn-hover-border-color: #22324d;
    --bs-btn-active-bg: #0c1422;
    --bs-btn-active-border-color: #0c1422;
    --bs-btn-disabled-bg: var(--ink-3);
    --bs-btn-disabled-border-color: var(--ink-3);
    --bs-btn-focus-shadow-rgb: 229, 19, 43;
}

.btn-outline-primary,
.btn-outline-secondary,
.btn-outline-dark {
    --bs-btn-color: var(--ink);
    --bs-btn-border-color: var(--rule-strong);
    --bs-btn-hover-color: var(--ink);
    --bs-btn-hover-bg: var(--surface);
    --bs-btn-hover-border-color: var(--ink);
    --bs-btn-active-color: var(--surface);
    --bs-btn-active-bg: var(--ink);
    --bs-btn-active-border-color: var(--ink);
}

.btn-dark {
    --bs-btn-bg: var(--ink);
    --bs-btn-border-color: var(--ink);
}

.btn-outline-success {
    --bs-btn-color: var(--go);
    --bs-btn-border-color: var(--rule-strong);
    --bs-btn-hover-bg: var(--go-soft);
    --bs-btn-hover-color: var(--go);
    --bs-btn-hover-border-color: var(--go);
    --bs-btn-active-bg: var(--go);
    --bs-btn-active-border-color: var(--go);
}

.btn-success {
    --bs-btn-bg: var(--go);
    --bs-btn-border-color: var(--go);
    --bs-btn-disabled-bg: var(--go);
    --bs-btn-disabled-border-color: var(--go);
}

.btn-outline-danger {
    --bs-btn-color: var(--laser);
    --bs-btn-border-color: var(--rule-strong);
    --bs-btn-hover-bg: var(--laser-soft);
    --bs-btn-hover-color: var(--laser);
    --bs-btn-hover-border-color: var(--laser);
    --bs-btn-active-bg: var(--laser);
    --bs-btn-active-border-color: var(--laser);
}

.btn-danger {
    --bs-btn-bg: var(--laser);
    --bs-btn-border-color: var(--laser);
    --bs-btn-disabled-bg: var(--laser);
    --bs-btn-disabled-border-color: var(--laser);
}

.form-control,
.form-select {
    border-color: var(--rule-strong);
    border-radius: var(--radius);
}

/* Neutral focus on forms: red there would read as an error */
.form-control:focus,
.form-select:focus {
    border-color: var(--ink);
    box-shadow: 0 0 0 3px rgba(20, 32, 51, 0.14);
}

.form-check-input:checked {
    background-color: var(--ink);
    border-color: var(--ink);
}

.form-label {
    font-weight: 600;
}

/* Flat, bordered surfaces instead of floating shadow cards */
.card {
    --bs-card-border-color: var(--rule);
    --bs-card-border-radius: var(--radius-lg);
    --bs-card-cap-bg: var(--surface);
    --bs-card-bg: var(--surface);
}

.card.border-0,
.card.shadow-sm,
.card.shadow {
    border: 1px solid var(--rule) !important;
    box-shadow: none !important;
}

.shadow-sm {
    box-shadow: none !important;
}

.shadow {
    box-shadow: 0 1px 2px rgba(20, 32, 51, 0.06), 0 8px 24px rgba(20, 32, 51, 0.06) !important;
}

.navbar .dropdown-menu,
.dropdown-menu {
    --bs-dropdown-border-color: var(--rule);
    --bs-dropdown-border-radius: var(--radius-lg);
    --bs-dropdown-link-active-bg: var(--ink);
    --bs-dropdown-link-hover-bg: var(--paper);
    --bs-dropdown-padding-y: 0.375rem;
    border: 1px solid var(--rule) !important;
    box-shadow: 0 8px 24px rgba(20, 32, 51, 0.08) !important;
}

.dropdown-item {
    padding-top: 0.45rem;
    padding-bottom: 0.45rem;
}

.nav-pills {
    --bs-nav-pills-link-active-bg: var(--ink);
}

.pagination {
    --bs-pagination-color: var(--ink);
    --bs-pagination-border-color: var(--rule);
    --bs-pagination-hover-color: var(--ink);
    --bs-pagination-hover-bg: var(--surface);
    --bs-pagination-hover-border-color: var(--ink);
    --bs-pagination-active-bg: var(--ink);
    --bs-pagination-active-border-color: var(--ink);
    --bs-pagination-focus-box-shadow: 0 0 0 3px rgba(229, 19, 43, 0.18);
}

.badge.bg-primary {
    background-color: var(--ink) !important;
}

.progress {
    --bs-progress-bg: #e8ecf1;
    --bs-progress-bar-bg: var(--ink);
    --bs-progress-border-radius: 2px;
}

.table {
    --bs-table-border-color: var(--rule);
}

.table thead th {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--ink-2);
    background-color: var(--paper);
    border-bottom: 1px solid var(--rule);
}

.table th {
    font-weight: 500;
    font-size: 0.9rem;
    vertical-align: middle;
}

.table td {
    vertical-align: middle;
}

.accordion {
    --bs-accordion-border-color: var(--rule);
    --bs-accordion-active-color: var(--ink);
    --bs-accordion-active-bg: var(--paper);
    --bs-accordion-btn-focus-box-shadow: 0 0 0 3px rgba(229, 19, 43, 0.18);
}

.accordion-button {
    font-weight: 600;
}

.alert {
    --bs-alert-border-radius: var(--radius);
}

.dropdown-header.text-uppercase {
    text-transform: none !important;
    letter-spacing: 0;
}

/* Old hero gradients and tinted icon tiles become plain */
.bg-gradient-primary {
    background: var(--ink);
    color: #fff;
}

.bg-primary-subtle {
    background-color: var(--bs-primary-bg-subtle) !important;
}

/* ---------- Site header ---------- */

.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--rule);
    padding-top: 0.625rem;
    padding-bottom: 0.625rem;
}

.site-header .navbar-brand {
    padding: 0;
    margin-right: 2rem;
}

.site-header .navbar-brand img {
    display: block;
    height: 30px;
    width: auto;
}

.site-header .nav-link {
    font-weight: 500;
    color: var(--ink-2);
    padding-left: 0.875rem !important;
    padding-right: 0.875rem !important;
}

.site-header .nav-link:hover,
.site-header .nav-link:focus-visible,
.site-header .nav-link.show {
    color: var(--ink);
}

.site-header .navbar-toggler:focus {
    box-shadow: none;
}

.account-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--ink);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ---------- Home ---------- */

.home-hero {
    background: var(--surface);
    border-bottom: 1px solid var(--rule);
    padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(2.5rem, 5vw, 4rem);
}

.home-hero h1 {
    font-size: clamp(2.5rem, 1.6rem + 3.6vw, 4.75rem);
    font-stretch: 120%;
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1.02;
    margin-bottom: 1.25rem;
    max-width: 12ch;
}

html:lang(ja) .home-hero h1 {
    font-size: clamp(2rem, 1.4rem + 2.6vw, 3.5rem);
    letter-spacing: 0;
    line-height: 1.25;
    max-width: 14em;
}

.home-hero .lede {
    font-size: 1.1875rem;
    color: var(--ink-2);
    max-width: 34em;
    margin-bottom: 2rem;
}

/* Barcode / product name switch */
.scan-tabs {
    display: inline-flex;
    gap: 0.25rem;
    padding: 0.25rem;
    margin-bottom: 0.875rem;
    background: var(--paper);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
}

.scan-tabs button {
    border: 0;
    background: transparent;
    color: var(--ink-2);
    font-weight: 600;
    font-stretch: 108%;
    padding: 0.4rem 0.9rem;
    border-radius: 4px;
}

.scan-tabs button[aria-selected="true"] {
    background: var(--surface);
    color: var(--ink);
    box-shadow: 0 0 0 1px var(--rule-strong);
}

/*
 * The search field drawn as a scanner viewfinder: corner brackets around the input
 * and a laser line that sweeps down once when the page loads.
 */
.scan-field {
    --corner: 22px;
    --corner-color: var(--ink);
    position: relative;
    padding: 14px;
    background:
        linear-gradient(var(--corner-color), var(--corner-color)) top left / var(--corner) 2px no-repeat,
        linear-gradient(var(--corner-color), var(--corner-color)) top left / 2px var(--corner) no-repeat,
        linear-gradient(var(--corner-color), var(--corner-color)) top right / var(--corner) 2px no-repeat,
        linear-gradient(var(--corner-color), var(--corner-color)) top right / 2px var(--corner) no-repeat,
        linear-gradient(var(--corner-color), var(--corner-color)) bottom left / var(--corner) 2px no-repeat,
        linear-gradient(var(--corner-color), var(--corner-color)) bottom left / 2px var(--corner) no-repeat,
        linear-gradient(var(--corner-color), var(--corner-color)) bottom right / var(--corner) 2px no-repeat,
        linear-gradient(var(--corner-color), var(--corner-color)) bottom right / 2px var(--corner) no-repeat;
}

.scan-field:focus-within {
    --corner-color: var(--laser);
}

.scan-field::after {
    content: "";
    position: absolute;
    left: 6px;
    right: 6px;
    bottom: 6px;
    height: 2px;
    border-radius: 1px;
    background: var(--laser);
    box-shadow: 0 0 10px 1px rgba(229, 19, 43, 0.45);
    pointer-events: none;
    animation: laser-sweep 1.1s cubic-bezier(0.45, 0, 0.2, 1) 0.3s both;
}

@keyframes laser-sweep {
    0% { bottom: calc(100% - 8px); opacity: 0; }
    15% { opacity: 1; }
    100% { bottom: 6px; opacity: 1; }
}

.scan-field .scan-row {
    display: flex;
    gap: 0.5rem;
}

.scan-field input {
    flex: 1;
    min-width: 0;
    height: 60px;
    padding: 0 1.125rem;
    font-size: 1.25rem;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--rule-strong);
    border-radius: var(--radius);
}

.scan-field input.digits {
    font-size: 1.375rem;
    letter-spacing: 0.06em;
}

.scan-field input::placeholder {
    color: #98a1ae;
    letter-spacing: 0.02em;
}

.scan-field input:focus {
    outline: none;
    border-color: var(--ink);
}

.scan-field input.is-invalid {
    border-color: var(--laser);
}

.scan-field .btn {
    height: 60px;
    padding: 0 1.75rem;
    font-size: 1.0625rem;
}

@media (max-width: 575.98px) {
    .scan-field { padding: 10px; }
    .scan-field input,
    .scan-field .btn { height: 52px; }
    .scan-field input.digits { font-size: 1.0625rem; letter-spacing: 0.03em; padding: 0 0.75rem; }
    .scan-field .btn { padding: 0 1.125rem; }
}

.scan-hint {
    margin-top: 0.875rem;
    font-size: 0.9375rem;
    color: var(--ink-3);
}

/* Recently added list */
.recent-list {
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: var(--radius-lg);
}

.recent-list h2 {
    font-size: 1.0625rem;
    margin: 0;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--rule);
}

.recent-list ol {
    list-style: none;
    margin: 0;
    padding: 0;
}

.recent-list li + li {
    border-top: 1px solid var(--rule);
}

.recent-list a {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.125rem 1rem;
    padding: 0.75rem 1.25rem;
    color: var(--ink);
    text-decoration: none;
}

.recent-list a:hover .recent-name,
.recent-list a:focus-visible .recent-name {
    text-decoration: underline;
}

.recent-name {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recent-code {
    grid-column: 1;
    font-family: var(--font-digits);
    font-size: 0.8125rem;
    color: var(--ink-3);
}

.recent-time {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
    font-size: 0.8125rem;
    color: var(--ink-3);
    white-space: nowrap;
}

.recent-list .recent-more {
    display: block;
    padding: 0.875rem 1.25rem;
    border-top: 1px solid var(--rule);
    font-weight: 600;
}

.recent-empty {
    padding: 1.25rem;
    color: var(--ink-3);
    margin: 0;
}

/* Country prefixes */
.home-section {
    padding: clamp(2.5rem, 5vw, 4rem) 0;
}

.home-section h2 {
    font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
    margin-bottom: 0.5rem;
}

.home-section .section-desc {
    color: var(--ink-2);
    max-width: 40em;
    margin-bottom: 1.75rem;
}

/* 12 prefixes: 2, 3, 4 or 6 per row so rows always fill */
.prefix-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

@media (min-width: 576px) { .prefix-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 768px) { .prefix-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .prefix-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

.prefix-grid a {
    display: block;
    height: 100%;
    padding: 0.875rem 1rem 1rem;
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: var(--radius-lg);
    color: var(--ink);
    text-decoration: none;
}

.prefix-grid a:hover,
.prefix-grid a:focus-visible {
    border-color: var(--ink);
}

.prefix-grid .prefix {
    display: block;
    font-family: var(--font-digits);
    font-size: 1.625rem;
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: 0.04em;
}

.prefix-grid a:hover .prefix {
    color: var(--laser);
}

.prefix-grid .country {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.9375rem;
    color: var(--ink-2);
}

/* App + API */
.home-split {
    border-top: 1px solid var(--rule);
}

.home-split .split-col {
    padding-top: clamp(2rem, 4vw, 3rem);
    padding-bottom: clamp(2rem, 4vw, 3rem);
}

@media (min-width: 992px) {
    .home-split .split-col + .split-col {
        border-left: 1px solid var(--rule);
        padding-left: calc(var(--bs-gutter-x) * 0.5 + 2.5rem);
    }
}

.home-split h2 {
    font-size: 1.5rem;
}

.home-split p {
    color: var(--ink-2);
    max-width: 32em;
}

.code-sample {
    margin: 1.25rem 0;
    padding: 1rem 1.125rem;
    background: var(--ink);
    color: #dfe5ee;
    border-radius: var(--radius-lg);
    font-family: var(--font-digits);
    font-size: 0.8125rem;
    line-height: 1.7;
    overflow-x: auto;
    white-space: pre;
}

.code-sample .c-method {
    color: #ff8a97;
}

.code-sample .c-str {
    color: #9fe0bd;
}

/* ---------- Barcode page ---------- */

.crumbs {
    font-size: 0.875rem;
    color: var(--ink-3);
    margin-bottom: 1rem;
}

.crumbs ol {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.crumbs li + li::before {
    content: "/";
    margin-right: 0.5rem;
    color: var(--rule-strong);
}

.crumbs a {
    color: var(--ink-2);
}

.product-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem 2.5rem;
    padding: clamp(1.25rem, 3vw, 2rem);
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
    .product-head.has-graphic {
        grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
        align-items: center;
    }
}

.barcode-graphic {
    display: block;
    width: 100%;
    max-width: 300px;
    height: auto;
}

.barcode-graphic .bars {
    fill: var(--ink);
}

.barcode-graphic text {
    font-family: var(--font-digits);
    font-size: 6.6px;
    fill: var(--ink);
}

.product-head h1 {
    font-size: clamp(1.75rem, 1.3rem + 1.8vw, 2.75rem);
    font-stretch: var(--stretch-display);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
    overflow-wrap: anywhere;
}

html:lang(ja) .product-head h1 {
    letter-spacing: 0;
}

.product-head h1.no-name {
    color: var(--ink-3);
    font-weight: 600;
}

.product-code {
    display: inline-block;
    font-family: var(--font-digits);
    font-size: 1.125rem;
    letter-spacing: 0.06em;
    color: var(--ink-2);
    margin-bottom: 1.25rem;
}

.product-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 2.5rem;
    margin: 0;
}

.product-facts dt {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--ink-3);
}

.product-facts dd {
    margin: 0;
    font-weight: 600;
}

.product-facts dd.digits {
    font-weight: 500;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: var(--radius-lg);
    padding: clamp(1.25rem, 2.5vw, 1.75rem);
    margin-bottom: 1.5rem;
}

.panel > h2 {
    font-size: 1.1875rem;
    margin-bottom: 1rem;
}

.panel .panel-note {
    font-size: 0.875rem;
    color: var(--ink-3);
    margin: -0.5rem 0 1rem;
}

.prose {
    max-width: 68ch;
    color: var(--ink-2);
    line-height: 1.75;
}

.prose h1, .prose h2, .prose h3, .prose h4 {
    font-size: 1.0625rem;
    color: var(--ink);
    margin: 1.5rem 0 0.5rem;
}

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

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

.lookup-counts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 0;
    border-top: 1px solid var(--rule);
}

.lookup-counts div {
    padding: 0.875rem 0 0.25rem;
}

.lookup-counts div + div {
    padding-left: 1rem;
    border-left: 1px solid var(--rule);
}

.lookup-counts dt {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--ink-3);
}

.lookup-counts dd {
    margin: 0;
    font-family: var(--font-digits);
    font-size: 1.25rem;
    font-weight: 500;
}

@media (max-width: 575.98px) {
    .lookup-counts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .lookup-counts div:nth-child(3) {
        padding-left: 0;
        border-left: 0;
    }
}

.vote-group + .vote-group {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--rule);
}

.vote-group p {
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.vote-group .vote-row {
    display: flex;
    gap: 0.5rem;
}

.vote-group .btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.vote-group .count {
    font-family: var(--font-digits);
    font-size: 0.8125rem;
    font-weight: 500;
    opacity: 0.85;
}

.country-bars {
    list-style: none;
    margin: 0;
    padding: 0;
}

.country-bars li + li {
    margin-top: 0.875rem;
}

.country-bars .row-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.9375rem;
    margin-bottom: 0.3rem;
}

.country-bars .row-label span:last-child {
    font-family: var(--font-digits);
    font-size: 0.8125rem;
    color: var(--ink-3);
}

.country-bars .track {
    height: 6px;
    background: #e8ecf1;
    border-radius: 2px;
    overflow: hidden;
}

.country-bars .bar {
    display: block;
    height: 100%;
    width: 0;
    background: var(--ink);
}

.country-bars li:first-child .bar {
    background: var(--laser);
}

/* Comments widget (fragments/comments.html) as a regular panel */
#comments-widget {
    margin-top: 0 !important;
    border-radius: var(--radius-lg) !important;
}

#comments-widget .card-header {
    padding: 1.5rem 1.75rem 0;
}

#comments-widget .card-header h4 {
    font-size: 1.1875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#comments-widget .card-header h4 > i {
    display: none;
}

#comments-widget #commentCountBadge {
    margin-left: 0 !important;
    background: var(--paper) !important;
    color: var(--ink-2) !important;
    font-family: var(--font-digits);
    font-size: 0.8125rem !important;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
}

#comments-widget .card-body {
    padding: 1.25rem 1.75rem 1.75rem !important;
}

/* ---------- Footer ---------- */

.site-footer {
    background: var(--ink);
    color: #c4ccd8;
    padding-top: 3.5rem;
    margin-top: auto;
    width: 100%;
}

.site-footer img.footer-logo {
    height: 32px;
    width: auto;
    margin-bottom: 1rem;
}

.site-footer h2 {
    font-size: 0.9375rem;
    color: #fff;
    margin-bottom: 0.875rem;
}

.site-footer ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.site-footer li + li {
    margin-top: 0.5rem;
}

.site-footer a {
    color: #c4ccd8;
    text-decoration: none;
}

.site-footer a:hover,
.site-footer a:focus-visible {
    color: #fff;
    text-decoration: underline;
}

.site-footer .footer-tagline {
    max-width: 26em;
    font-size: 0.9375rem;
}

.site-footer .footer-base {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 2.5rem;
    padding: 1.25rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 0.875rem;
}

.site-footer .lang-switch {
    display: flex;
    gap: 0.25rem;
}

.site-footer .lang-switch li + li {
    margin-top: 0;
}

.site-footer .lang-switch a {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 4px;
    font-weight: 600;
    font-stretch: 110%;
}

.site-footer .lang-switch a[aria-current="true"] {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

/* ---------- Classes used by the other pages ---------- */

.content-card {
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: var(--radius-lg);
    padding: 2rem;
}

.hero-search-input {
    border: 1px solid var(--rule-strong);
    padding: 1rem 1.25rem;
    font-size: 1.1rem;
}

.hero-search-input:focus {
    border-color: var(--ink);
    box-shadow: 0 0 0 3px rgba(229, 19, 43, 0.18);
}

.hero-search-btn {
    background-color: var(--ink);
    border: none;
    padding-left: 2rem;
    padding-right: 2rem;
    font-weight: 600;
}

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.5;
}

/* Cards that used to lift on hover now just firm up their outline */
.country-card,
.card-hover,
.transition-hover {
    background-color: var(--surface);
    transition: border-color 0.15s ease;
}

.country-card:hover,
.card-hover:hover,
.transition-hover:hover {
    border-color: var(--ink) !important;
}

.country-card .display-4 {
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
}

/* Blog */
.blog-content {
    font-size: 1.0625rem;
    line-height: 1.8;
    color: var(--ink-2);
    max-width: 68ch;
}

.blog-content h2 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--ink);
}

.blog-content h3 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.blog-content ul,
.blog-content ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.blog-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-lg);
    margin: 2rem 0;
}

.blog-content blockquote {
    border-left: 3px solid var(--laser);
    padding-left: 1rem;
    color: var(--ink-2);
    margin: 2rem 0;
}

.blog-page {
    padding: clamp(1.5rem, 3vw, 2.5rem) 0 3.5rem;
}

.blog-heading {
    font-size: clamp(1.75rem, 3.5vw, 2.25rem);
    margin-bottom: 1.5rem;
}

.post-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--rule);
}

.post-list > li {
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--rule);
}

.post-list h2 {
    font-size: 1.3125rem;
    line-height: 1.3;
    margin-bottom: 0.4rem;
}

.post-list h2 a {
    color: var(--ink);
    text-decoration: none;
}

.post-list h2 a:hover {
    text-decoration: underline;
    text-decoration-color: var(--laser);
    text-underline-offset: 0.2em;
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
    font-size: 0.875rem;
    color: var(--ink-3);
    margin-bottom: 0.6rem;
}

.post-meta a {
    color: var(--ink-2);
}

.post-excerpt {
    color: var(--ink-2);
    margin: 0;
    max-width: 68ch;
}

.blog-empty {
    color: var(--ink-3);
}

.post-head {
    margin-bottom: 2rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--rule);
}

.post-head h1 {
    font-size: clamp(1.875rem, 4vw, 2.625rem);
    line-height: 1.15;
    max-width: 24ch;
    margin-bottom: 0.75rem;
}

.post-back {
    margin-top: 2.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--rule);
}

.post-back a {
    color: var(--ink-2);
    font-weight: 600;
}

.blog-content h2 {
    font-size: 1.5rem;
}

.blog-content h3 {
    font-size: 1.1875rem;
}

.blog-content h4 {
    font-size: 1.0625rem;
    margin-top: 1.25rem;
}

.blog-content p {
    margin-bottom: 1.1rem;
}

.blog-content li {
    margin-bottom: 0.35rem;
}

.blog-content code {
    font-family: var(--font-digits);
    font-size: 0.85em;
    color: var(--ink);
    background: var(--paper);
    border: 1px solid var(--rule);
    border-radius: 4px;
    padding: 0.05em 0.3em;
}

.blog-content pre {
    background: var(--ink);
    color: #e6ebf2;
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.blog-content pre code {
    background: none;
    border: 0;
    color: inherit;
    padding: 0;
}

.blog-content .table {
    display: block;
    overflow-x: auto;
    font-size: 0.9375rem;
    margin: 1.5rem 0;
}

.blog-content hr {
    margin: 2rem 0;
    border-color: var(--rule);
    opacity: 1;
}

.blog-aside {
    position: sticky;
    top: 5.5rem;
}

.blog-aside .panel > h2 {
    font-size: 1rem;
}

.blog-categories {
    list-style: none;
    margin: 0;
    padding: 0;
}

.blog-categories a {
    display: block;
    padding: 0.45rem 0;
    color: var(--ink-2);
    text-decoration: none;
    border-bottom: 1px solid var(--rule);
}

.blog-categories li:last-child a {
    border-bottom: 0;
}

.blog-categories a:hover,
.blog-categories a[aria-current="page"] {
    color: var(--ink);
}

.blog-categories a[aria-current="page"] {
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--laser);
    padding-left: 0.75rem;
}

.blog-api p {
    color: var(--ink-2);
    font-size: 0.9375rem;
}

@media (max-width: 991.98px) {
    .blog-aside {
        position: static;
    }
}

/* Error pages */
.error-page {
    padding: clamp(3rem, 8vw, 6rem) 0;
}

.error-page h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    margin-bottom: 0.75rem;
}

.error-page .lede {
    color: var(--ink-2);
    max-width: 52ch;
    margin-bottom: 1.75rem;
}

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

.still-working {
    margin-top: 3rem;
    max-width: 52rem;
}

.still-working h2 {
    font-size: 1.125rem;
    margin-bottom: 1rem;
}

.still-working ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    gap: 0.75rem;
}

.still-working a {
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
    height: 100%;
    padding: 1rem 1.1rem;
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: var(--radius-lg);
    color: var(--ink);
    text-decoration: none;
}

.still-working a:hover {
    border-color: var(--ink);
}

.still-working i {
    font-size: 1.25rem;
    color: var(--ink-2);
    line-height: 1.4;
}

.still-working small {
    display: block;
    color: var(--ink-3);
    font-size: 0.875rem;
    margin-top: 0.15rem;
}

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

/* Contact */
.contact-page {
    padding: clamp(1.5rem, 3vw, 2.5rem) 0 3.5rem;
}

.contact-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
}

@media (min-width: 992px) {
    .contact-layout {
        grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
        column-gap: 3rem;
        align-items: start;
    }

    .contact-intro { grid-column: 1; grid-row: 1; }
    .contact-shortcuts { grid-column: 1; grid-row: 2; }
    .contact-main { grid-column: 2; grid-row: 1 / span 2; }
}

.contact-intro .lede {
    margin-bottom: 0;
}

.contact-page h1 {
    font-size: clamp(2rem, 4vw, 2.75rem);
    margin-bottom: 0.75rem;
}

.contact-page .lede {
    color: var(--ink-2);
    font-size: 1.0625rem;
    max-width: 40ch;
    margin-bottom: 2rem;
}

.contact-shortcuts h2 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

.contact-shortcuts ul {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--rule);
}

.contact-shortcuts li {
    display: flex;
    gap: 0.9rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--rule);
}

.contact-shortcuts li > i {
    font-size: 1.25rem;
    color: var(--ink-2);
    line-height: 1.3;
}

.contact-shortcuts h3 {
    font-size: 1rem;
    margin-bottom: 0.2rem;
}

.contact-shortcuts p {
    color: var(--ink-3);
    font-size: 0.9375rem;
    margin-bottom: 0.3rem;
}

.contact-shortcuts a {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--ink);
}

.contact-form > h2,
.contact-sent > h2 {
    font-size: 1.25rem;
    margin-bottom: 1.25rem;
}

.contact-count {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.contact-altcha-error {
    margin-top: 0.4rem;
    font-size: 0.875em;
    color: var(--bs-form-invalid-color, #b02a37);
}

.contact-sent {
    text-align: center;
    padding-block: 3rem;
}

.contact-sent > i {
    display: block;
    font-size: 2.75rem;
    color: var(--go);
    margin-bottom: 0.5rem;
}

.contact-sent p {
    color: var(--ink-2);
    margin: -0.5rem auto 1.5rem;
    max-width: 44ch;
    overflow-wrap: anywhere;
}

/* API docs */
#api-sidebar .nav-link {
    color: var(--ink-2);
    padding: 0.5rem 1rem;
    border-left: 2px solid transparent;
    border-radius: 0;
}

#api-sidebar .nav-link:hover {
    color: var(--ink);
    background-color: var(--paper);
}

#api-sidebar .nav-link.active {
    color: var(--ink);
    background-color: transparent;
    border-left-color: var(--laser);
    font-weight: 600;
}

.code-block {
    background-color: var(--ink);
    border-radius: var(--radius-lg);
    padding: 1rem;
    color: #dfe5ee;
    font-family: var(--font-digits);
    font-size: 0.8125rem;
    overflow-x: auto;
}

.code-block pre {
    margin: 0;
}

.response-block {
    background-color: #0e1726;
    color: #9fe0bd;
    padding: 1rem;
    border-radius: var(--radius);
    font-family: var(--font-digits);
    font-size: 0.8125rem;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #26344b;
}

.playground {
    border: 1px solid var(--rule);
}

.accordion-item {
    border: 1px solid var(--rule);
}

/* Feedback animations kept for the login and dashboard pages */
@keyframes shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-5px); }
    100% { transform: translateX(0); }
}

.shake-animation {
    animation: shake 0.3s ease-in-out;
}

.fade-in {
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.link-hover:hover {
    text-decoration: underline !important;
}

footer {
    width: 100%;
}

/* ---------- Admin ---------- */

.admin-page {
    padding: clamp(1.5rem, 3vw, 2.5rem) 0 3rem;
}

body.has-admin-selection .admin-page {
    padding-bottom: 6rem; /* room for the selection bar */
}

.admin-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    border-bottom: 1px solid var(--rule);
    margin-bottom: 1.75rem;
}

.admin-tabs a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 0.9rem;
    margin-bottom: -1px;
    color: var(--ink-2);
    font-weight: 600;
    font-stretch: 108%;
    text-decoration: none;
    border-bottom: 2px solid transparent;
}

.admin-tabs a:hover {
    color: var(--ink);
}

.admin-tabs a[aria-current="page"] {
    color: var(--ink);
    border-bottom-color: var(--laser);
}

.admin-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem 2rem;
    margin-bottom: 1.25rem;
}

.admin-head h1 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    margin-bottom: 0.35rem;
}

.admin-desc {
    color: var(--ink-3);
    margin: 0;
    max-width: 62ch;
}

.admin-filter {
    display: inline-flex;
    border: 1px solid var(--rule-strong);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface);
}

.admin-filter a {
    padding: 0.4rem 0.85rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ink-2);
    text-decoration: none;
}

.admin-filter a + a {
    border-left: 1px solid var(--rule);
}

.admin-filter a[aria-current="true"] {
    background: var(--ink);
    color: var(--surface);
}

.admin-flash {
    border: 1px solid var(--go);
    background: var(--go-soft);
    color: var(--go);
    border-radius: var(--radius);
    padding: 0.7rem 1rem;
    margin-bottom: 1rem;
    font-weight: 500;
}

.admin-flash.is-error {
    border-color: var(--laser);
    background: var(--laser-soft);
    color: #a30d1f;
}

.admin-panel {
    padding: 0;
    overflow: hidden;
}

.admin-total,
.admin-empty {
    margin: 0;
    padding: 0.85rem 1.25rem;
    font-size: 0.875rem;
    color: var(--ink-3);
}

.admin-total {
    border-bottom: 1px solid var(--rule);
}

.admin-panel > h2 {
    font-size: 1rem;
    margin: 0;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--rule);
}

.form-check-input:indeterminate {
    background-color: var(--ink);
    border-color: var(--ink);
}

.admin-empty {
    padding: 2.5rem 1.25rem;
    text-align: center;
}

.admin-table {
    table-layout: auto;
}

.admin-table th,
.admin-table td {
    padding: 0.7rem 0.75rem;
}

.admin-table th:first-child,
.admin-table td:first-child {
    padding-left: 1.25rem;
}

.admin-table th:last-child,
.admin-table td:last-child {
    padding-right: 1.25rem;
}

.admin-table tbody tr.is-selected > * {
    background-color: var(--laser-soft);
}

.admin-check {
    width: 1%;
}

.admin-check .form-check-input {
    margin: 0;
    width: 1.1rem;
    height: 1.1rem;
    cursor: pointer;
}

.admin-text {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: anywhere;
    cursor: pointer;
    max-width: 70ch;
}

.admin-text.is-missing {
    color: var(--ink-3);
    font-style: italic;
}

.admin-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.25rem;
    font-size: 0.8125rem;
    color: var(--ink-3);
}

.admin-meta a,
.admin-code a {
    color: var(--ink-2);
}

.admin-code {
    white-space: nowrap;
    font-size: 0.875rem;
}

.admin-lang {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 0.05rem 0.35rem;
    border: 1px solid var(--rule-strong);
    border-radius: 3px;
    color: var(--ink-2);
}

.admin-id {
    font-family: var(--font-digits);
    font-size: 0.75rem;
    color: var(--ink-3);
    white-space: nowrap;
}

.admin-when {
    white-space: nowrap;
    font-size: 0.875rem;
    color: var(--ink-3);
    width: 1%;
}

.admin-actions {
    width: 1%;
    text-align: right;
}

.admin-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.25rem;
}

.admin-pager-pos {
    font-size: 0.875rem;
    color: var(--ink-3);
}

.admin-selection {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 1030;
    background: var(--ink);
    color: var(--surface);
    box-shadow: 0 -4px 16px rgba(20, 32, 51, 0.18);
    animation: admin-bar-in 0.15s ease-out;
}

.admin-selection[hidden] {
    display: none;
}

.admin-selection-inner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.admin-selection-count {
    font-weight: 600;
    font-stretch: 108%;
}

.admin-selection .btn-link {
    color: #c9d1dc;
}

@keyframes admin-bar-in {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

@media (max-width: 575.98px) {
    .admin-table th:first-child,
    .admin-table td:first-child {
        padding-left: 0.85rem;
    }

    .admin-table th:last-child,
    .admin-table td:last-child {
        padding-right: 0.85rem;
    }

    .admin-table th,
    .admin-table td {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    .admin-code {
        font-size: 0.75rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
