/* ==========================================================================
   NEXA-PING design system — layout
   The loading bar, the header with the tools of constant use and the panel of all of them, the
   footer, messages, the appearance dialog, the tool menu of an address, the button that returns
   to the top, and the page that was not found.
   ========================================================================== */

/* ---- loading bar --------------------------------------------------------- */

.nx-progress { position: fixed; inset: 0 0 auto 0; z-index: 1000; height: 3px; overflow: hidden; pointer-events: none; }
.nx-progress i { display: block; width: 0; height: 100%; border-radius: 0 3px 3px 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); animation: nx-load 5s cubic-bezier(0.1, 0.65, 0.2, 1) forwards; }
.nx-progress.is-done i { width: 100% !important; animation: none; transition: width 0.25s var(--ease-out); }
.nx-progress.is-done { opacity: 0; transition: opacity 0.35s 0.15s; }
.nx-progress.is-gone { display: none; }
@keyframes nx-load { 0% { width: 0; } 35% { width: 58%; } 100% { width: 93%; } }

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

/* the bar stands over the page, frosted: what lies under it shows through faintly */
.hd {
	position: sticky; top: 0; z-index: 900;
	background: color-mix(in srgb, var(--bg) 68%, transparent);
	-webkit-backdrop-filter: blur(18px) saturate(1.5); backdrop-filter: blur(18px) saturate(1.5);
	border-bottom: 1px solid transparent;
	transition: border-color 0.25s, box-shadow 0.25s;
}
.hd.is-stuck { border-bottom-color: var(--line); box-shadow: 0 12px 28px -22px rgba(15, 23, 42, 0.35); }
.hd-in { display: flex; align-items: center; gap: 18px; width: 100%; max-width: var(--wrap); height: var(--header-h); margin: 0 auto; padding: 0 var(--gutter); }

.hd-brand { display: inline-flex; align-items: center; flex: 0 0 auto; height: 44px; margin-left: -8px; padding: 0 8px; border-radius: 14px; transition: background 0.2s; }
.hd-brand:hover { background: color-mix(in srgb, var(--surface) 70%, transparent); }
.hd-logo { width: auto; height: 32px; }
.hd-logo--dark { display: none; }
[data-theme="dark"] .hd-logo--light { display: none; }
[data-theme="dark"] .hd-logo--dark { display: block; }

/* the tools in constant use: a pill each, the one of the page lifted out of the trough */
.hd-nav { display: flex; align-items: center; gap: 3px; min-width: 0; }
.hd-link {
	display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 14px; border-radius: var(--r-pill);
	color: var(--ink-2); font-size: 14.5px; font-weight: 500; white-space: nowrap;
	transition: background 0.2s, color 0.2s, box-shadow 0.2s, transform 0.16s var(--ease);
}
.hd-link-ic { display: none; font-size: 18px; }
.hd-link:hover { background: color-mix(in srgb, var(--surface) 78%, transparent); color: var(--ink); }
.hd-link:active { transform: scale(0.96); }
.hd-link.is-active { background: var(--surface); color: var(--accent-ink); font-weight: 600; box-shadow: var(--sh-1), 0 0 0 1px var(--line); }
@media (min-width: 1280px) {
	.hd-link { padding: 0 15px; }
	.hd-link-ic { display: block; }
	.hd-link.is-active .hd-link-ic { color: var(--accent); }
}

.hd-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.hd-more {
	display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 13px 0 11px;
	border: 1px solid var(--line-2); border-radius: var(--r-pill); background: var(--surface); color: var(--ink-2);
	font-size: 14px; font-weight: 600; white-space: nowrap;
	transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.16s var(--ease);
}
.hd-more:hover { border-color: var(--ink-4); color: var(--ink); box-shadow: var(--sh-1); }
.hd-more:active { transform: scale(0.96); }
.hd-more-ic { font-size: 18px; color: var(--accent-ink); }
.hd-more-caret { font-size: 14px; color: var(--ink-4); transition: transform 0.24s var(--ease); }
.hd-more[aria-expanded="true"], .hd-more.is-here { border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: var(--accent-soft); color: var(--accent-ink); }
.hd-more[aria-expanded="true"] .hd-more-caret { transform: rotate(180deg); }
.hd-more.is-here .hd-more-ic { color: var(--accent); }
.nx-menu-btn { display: none; }

/* the button that returns to the top, once the page has moved down. On a desk it is the first
   of the header's round buttons: until it comes it takes no room at all, and the group it
   opens is tied to the right edge, so the buttons that were there do not move. On a phone
   (small screens, below) it is not in the header, which has room for nothing more: it floats
   over the page at the lower right */
.nx-totop {
	flex: 0 0 auto; width: 0; height: 40px; margin-right: -8px; border-width: 0; overflow: hidden;
	opacity: 0; visibility: hidden; transform: scale(0.6);
	transition: width 0.26s var(--ease-out), margin-right 0.26s var(--ease-out), opacity 0.2s, transform 0.26s var(--ease-out), visibility 0.26s, background 0.2s, color 0.2s;
}
.nx-totop.is-shown { width: 40px; margin-right: 0; border-width: 1px; opacity: 1; visibility: visible; transform: none; }

/* ---- the panel of every tool --------------------------------------------- */

/* under the bar on a wide screen, a sheet over the page on a phone (small screens, below). On a
   desk the panel opens under the button that opens it: its right edge is the right edge of what
   the bar holds, so that it lies over the free side of a page and not over its title */
.hd-panel {
	position: absolute; left: 0; right: 0; top: calc(100% + 10px); z-index: 5;
	display: flex; justify-content: flex-end;
	padding: 0 calc((100% - min(100%, var(--wrap))) / 2 + var(--gutter)) 0 var(--gutter);
	opacity: 0; visibility: hidden; transform: translateY(-10px) scale(0.99); pointer-events: none;
	transition: opacity 0.2s var(--ease), transform 0.3s var(--ease-out), visibility 0.3s;
}
.hd-panel.is-open { opacity: 1; visibility: visible; transform: none; pointer-events: auto; }
/* two columns of the same height: each holds the groups of one side, one under the other, and
   the tiles are shared out to hold as many each. A column is one grid, whose lines — the mark,
   the name, the description — are the same for every tool in it, group under group, so that
   names and descriptions stand in rows. The line of the name has one width in both columns, wide
   enough for the longest name: a name is never sized by the font a visitor's browser happens to
   pick, and the descriptions of the two columns begin at the same distance from their marks */
.hd-panel-in {
	display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 30px;
	width: 100%; max-width: 860px; padding: 20px 20px 18px;
	max-height: calc(100vh - var(--header-h) - 44px); overflow-y: auto; overscroll-behavior: contain;
	border-radius: 24px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-3);
}
.nav-col { display: grid; grid-template-columns: 30px 112px minmax(0, 1fr); gap: 2px 10px; align-content: start; min-width: 0; }
/* a group is its title and its tiles, laid out by the column they are in */
.nav-group, .nav-tiles { display: contents; }
/* the tools of the bar are not listed a second time where the bar shows them */
.nav-group--primary { display: none; }
.nav-group-title { grid-column: 1 / -1; margin: 12px 0 2px; padding: 0 10px; color: var(--ink-4); font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; line-height: 22px; }
.nav-group-title:first-child { margin-top: 0; }
/* a line holds the mark of the tool, its name and what it does; nothing wraps */
.nav-tile {
	grid-column: 1 / -1; display: grid; grid-template-columns: 30px 112px minmax(0, 1fr); align-items: center; column-gap: 10px;
	min-width: 0; min-height: 42px; padding: 5px 10px; border-radius: 12px; color: var(--ink-2);
	transition: background 0.18s, color 0.18s;
}
/* where a grid can take the tracks of the grid it is in, the three columns are the column's own
   (above); elsewhere every line has its three, and only the names line up */
@supports (grid-template-columns: subgrid) {
	.nav-tile { grid-template-columns: subgrid; }
}
.nav-tile:hover { background: var(--surface-2); color: var(--ink); }
.nav-tile.is-active { background: var(--accent-soft); color: var(--accent-ink); }
.nav-tile-ic {
	--mark: var(--ink-3); --badge-edge: var(--surface-3);
	position: relative; display: grid; place-items: center; width: 30px; height: 30px;
	border-radius: 10px; background: var(--surface-3); color: var(--ink-2); font-size: 18px;
	transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.nav-tile-ic .ic-badge { right: -5px; bottom: -5px; min-width: 13px; height: 13px; padding: 0 2px; border-radius: 4px; font-size: 8px; line-height: 9px; }
.nav-tile:hover .nav-tile-ic { background: var(--surface); color: var(--accent-ink); box-shadow: var(--sh-1); --mark: var(--accent-ink); --badge-edge: var(--surface); }
.nav-tile.is-active .nav-tile-ic { background: var(--accent); color: #fff; --mark: var(--accent); --badge-edge: var(--accent); }
/* the name and the description are the two columns after the mark; one longer than its line is
   cut with an ellipsis, never laid over what stands beside it */
.nav-tile-text { display: contents; }
.nav-tile-text b { min-width: 0; overflow: hidden; color: var(--ink); font-size: 13.5px; font-weight: 600; line-height: 1.35; white-space: nowrap; text-overflow: ellipsis; }
.nav-tile.is-active .nav-tile-text b { color: var(--accent-ink); }
.nav-tile-text small { min-width: 0; overflow: hidden; color: var(--ink-3); font-size: 12px; line-height: 1.4; white-space: nowrap; text-overflow: ellipsis; }

.hd-mask {
	position: fixed; inset: 0; z-index: 890; background: rgba(15, 23, 42, 0.42);
	-webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); touch-action: none;
	opacity: 0; pointer-events: none; transition: opacity 0.25s var(--ease);
}
.hd-mask.is-shown { opacity: 1; pointer-events: auto; }

/* ---- footer -------------------------------------------------------------- */

.nx-footer { margin-top: 44px; padding: 0 var(--gutter) 32px; }
.nx-footer-in { max-width: var(--wrap); margin: 0 auto; padding: 24px 28px 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-1); }
.nx-footer-top { display: flex; align-items: center; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap; }
.nx-footer-brand { display: flex; align-items: center; gap: 12px; }
.nx-footer-brand img { width: 40px; height: 40px; }
.nx-footer-brand strong { display: block; color: var(--ink); font-size: 15px; font-weight: 700; line-height: 1.35; }
.nx-footer-brand span { color: var(--ink-3); font-size: 12.5px; }
.nx-footer-links { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 4px; }
.nx-footer-links a { padding: 5px 12px; border-radius: var(--r-pill); color: var(--ink-3); font-size: 13.5px; transition: background 0.18s, color 0.18s; }
.nx-footer-links a:hover { background: var(--surface-3); color: var(--ink); }
.nx-footer-info { display: flex; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); color: var(--ink-3); font-size: 13px; }
.nx-footer-contact { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.nx-footer-about { position: relative; }
.nx-footer-about-btn { padding: 5px 12px; border: 0; border-radius: var(--r-pill); background: transparent; color: var(--ink-3); font: inherit; transition: background 0.18s, color 0.18s; }
.nx-footer-about-btn:hover { background: var(--surface-3); color: var(--ink); }
.nx-footer-about-card {
	position: absolute; right: 0; bottom: calc(100% + 8px); z-index: 20; width: max-content; max-width: min(320px, 80vw); padding: 12px 14px;
	border-radius: 14px; background: var(--ink); color: var(--bg); font-size: 13px; line-height: 1.7;
	opacity: 0; visibility: hidden; transform: translateY(4px); transition: all 0.2s var(--ease); pointer-events: none;
}
.nx-footer-about-btn[aria-expanded="true"] + .nx-footer-about-card { opacity: 1; visibility: visible; transform: none; }
.nx-footer-line { height: 1px; margin: 16px 0 12px; background: var(--line); }
.nx-footer-copy { color: var(--ink-3); font-size: 13px; text-align: center; }
.nx-footer-copy a { color: var(--ink-3); }
.nx-footer-copy a:hover { color: var(--accent-ink); }
.nx-footer-police { display: inline-flex; align-items: center; gap: 4px; }
.nx-footer-police img { width: 14px; height: 14px; }

/* ---- messages ------------------------------------------------------------ */

/* the message is as wide as its one line, up to most of the window, and stands in the middle:
   centred by its margins over the whole window (a box pinned at the left edge of the middle
   of the window is given only the other half to fit in, which broke every message into
   lines on a phone) */
.kkyun-toast-wrap {
	position: fixed; left: 0; right: 0; top: calc(var(--header-h) + 18px); z-index: 1300;
	width: max-content; max-width: min(92vw, 560px); margin: 0 auto; animation: nx-pop 0.3s var(--ease-out);
}
.kkyun-toast {
	display: flex; align-items: center; gap: 10px; padding: 12px 20px 12px 16px;
	border-radius: var(--r-pill); background: var(--ink); color: var(--bg); font-size: 14px; font-weight: 500; line-height: 1.5; box-shadow: var(--sh-2);
}
.kkyun-toast-icon { flex: none; width: 17px; height: 17px; font-size: 17px; }
.kkyun-toast.kkyun-toast-success .kkyun-toast-icon { color: #6ee7b7; }
.kkyun-toast.kkyun-toast-info .kkyun-toast-icon { color: var(--accent-2); }
.kkyun-toast-wrap.kkyun-toast-fade-leave-active { transition: opacity 0.3s, transform 0.3s var(--ease); }
.kkyun-toast-wrap.kkyun-toast-fade-leave-to { opacity: 0; transform: translateY(-8px); }

/* ---- the appearance dialog ----------------------------------------------- */

.nx-dialog-overlay {
	position: fixed; inset: 0; z-index: 1200; display: grid; place-items: center; padding: 16px;
	background: rgba(15, 23, 42, 0.42); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: nx-fade 0.2s ease;
}
.nx-dialog {
	position: relative; width: min(470px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; padding: 26px 26px 24px;
	border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-3); animation: nx-pop 0.36s var(--ease-out);
}
.nx-dialog-close {
	position: absolute; z-index: 2; top: 16px; right: 16px; display: grid; place-items: center; width: 36px; height: 36px; padding: 0;
	border: 0; border-radius: 50%; background: var(--surface-3); color: var(--ink-3); font-size: 14px; line-height: 1;
	transition: background 0.18s, color 0.18s, transform 0.2s var(--ease);
}
.nx-dialog-close:hover { background: var(--bad-soft); color: var(--bad); transform: rotate(90deg); }
.nx-dialog-head { padding-right: 44px; }
.nx-dialog-head h2 { font-size: 20px; font-weight: 800; letter-spacing: -0.01em; }
.nx-dialog-head p { margin-top: 4px; color: var(--ink-3); font-size: 13.5px; }
.nx-dialog-body { display: grid; gap: 22px; margin-top: 22px; }
.nx-dialog-body legend { margin-bottom: 10px; padding: 0; color: var(--ink-2); font-size: 13.5px; font-weight: 600; }
.nx-appearance { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.nx-appearance-option {
	display: grid; gap: 8px; justify-items: center; padding: 10px 8px 9px;
	border: 1.5px solid var(--line-2); border-radius: 18px; background: var(--surface); color: var(--ink-2); font-size: 13.5px; font-weight: 500; cursor: pointer;
	transition: border-color 0.2s, box-shadow 0.2s, color 0.2s, transform 0.16s var(--ease);
}
.nx-appearance-option:hover { border-color: var(--ink-4); transform: translateY(-1px); }
.nx-appearance-option.active { border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 4px var(--accent-ring); }
/* a little page: the bar over two cards */
.nx-appearance-preview {
	display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 12px 1fr; gap: 5px; width: 100%; height: 54px; padding: 7px;
	border-radius: 12px; background: #f4f7fc; border: 1px solid #e9eef6; overflow: hidden;
}
.nx-appearance-preview i { display: block; border-radius: 5px; background: #fff; box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06); }
.nx-appearance-preview i:first-child { grid-column: 1 / -1; border-radius: 4px; background: color-mix(in srgb, var(--accent) 22%, #fff); }
.nx-appearance-option--dark .nx-appearance-preview { background: #0e1220; border-color: #242d45; }
.nx-appearance-option--dark .nx-appearance-preview i { background: #1b2236; }
.nx-appearance-option--dark .nx-appearance-preview i:first-child { background: color-mix(in srgb, var(--accent) 40%, #161c2e); }
.nx-appearance-option--auto .nx-appearance-preview { background: linear-gradient(90deg, #f4f7fc 50%, #0e1220 50%); border-color: #c9d4e6; }
.nx-accent-options { display: flex; flex-wrap: wrap; gap: 12px; }
.nx-accent-option { display: grid; place-items: center; width: 42px; height: 42px; padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: pointer; }
.nx-accent-option i {
	display: block; width: 28px; height: 28px; border-radius: 50%;
	background: linear-gradient(135deg, var(--swatch), var(--swatch-2));
	box-shadow: inset 0 0 0 2px var(--surface), 0 2px 6px -1px var(--swatch);
	transition: transform 0.2s var(--ease), box-shadow 0.2s;
}
.nx-accent-option:hover i { transform: scale(1.1); }
.nx-accent-option.active i { transform: scale(1.08); box-shadow: inset 0 0 0 2px var(--surface), 0 0 0 2px var(--swatch); }

/* ---- the captcha ----------------------------------------------------------
   The field (the picture, the field of its signs, the keys of a phone) lays itself out by the
   room it is given: a row where there is room, the picture in the full width and the field
   under it where there is not. The dialog that asks for it comes in with a turn, shakes for a
   wrong answer, and draws in to the mark of the pass. */

.nx-captcha-box { position: relative; min-width: 0; container-type: inline-size; }
.nx-captcha { display: flex; align-items: stretch; gap: 8px; min-width: 0; }
.nx-captcha-picture {
	flex: 0 0 auto; display: grid; place-items: center; width: 124px; min-height: 44px; padding: 0; overflow: hidden; cursor: pointer; perspective: 420px;
	border: 1px solid var(--line-2); border-radius: var(--r-xs); background: var(--surface-2);
	transition: border-color 0.2s, box-shadow 0.2s;
}
.nx-captcha-picture:hover { border-color: var(--ink-4); }
.nx-captcha-img {
	display: block; width: 100%; height: 100%; object-fit: cover; user-select: none; -webkit-user-drag: none;
	transform-origin: left center; transition: opacity 0.2s;
}
.nx-captcha-picture.is-dealt .nx-captcha-img { animation: nx-captcha-deal 0.44s var(--ease-out) both; }
.nx-captcha-input {
	flex: 1 1 0; min-width: 0; font-family: var(--mono); font-weight: 700; font-size: 18px;
	text-align: center; letter-spacing: 0.3em; text-indent: 0.3em; text-transform: uppercase;
}
.nx-captcha-input::placeholder { font-family: var(--font); font-weight: 400; font-size: 14.5px; letter-spacing: 0; text-indent: 0; text-transform: none; }
.nx-captcha-again {
	flex: 0 0 44px; display: grid; place-items: center; width: 44px; padding: 0; cursor: pointer; font-size: 18px;
	border: 1px solid var(--line-2); border-radius: var(--r-xs); background: var(--surface-2); color: var(--ink-2);
	transition: border-color 0.2s, color 0.2s, background 0.2s, transform 0.2s var(--ease);
}
.nx-captcha-again:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.nx-captcha-again:active { transform: scale(0.92); }
.nx-captcha-box.is-loading .nx-captcha-img { opacity: 0.35; }
.nx-captcha-box.is-loading .nx-captcha-picture { cursor: progress; }
.nx-captcha-box.is-failed .nx-captcha-img { opacity: 0.25; }
.nx-captcha-box.is-wrong .nx-captcha-input { border-color: var(--bad); box-shadow: 0 0 0 4px var(--bad-soft); }
.nx-captcha-box.is-full .nx-captcha-input { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.nx-captcha-box.is-checking { opacity: 0.6; pointer-events: none; }
.nx-captcha-box.is-checking .nx-captcha-picture { cursor: default; }

/* the keys of a phone: the signs of the code and the key that takes one back, five to a row, as large as the room allows */
.nx-captcha-keys { display: grid; grid-template-columns: repeat(5, minmax(0, 56px)); justify-content: center; gap: 6px; margin-top: 10px; }
.nx-captcha-key {
	height: 44px; padding: 0; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface-2); color: var(--ink);
	font-family: var(--font); font-size: 17px; font-weight: 700; line-height: 1; cursor: pointer;
	user-select: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
	transition: transform 0.12s var(--ease), background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}
.nx-captcha-key:hover { border-color: var(--ink-4); background: var(--surface-3); }
.nx-captcha-key.nx-captcha-key-erase { color: var(--ink-2); font-size: 19px; }
/* nineteen keys in rows of five: the last row has four, and stands in the middle */
.nx-captcha-key:nth-child(16) { grid-column: 2; }
.nx-captcha-key:active { transform: scale(0.88); background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 4px var(--accent-ring); }

/* where the row would be cramped — a small picture beside a narrow field —: the picture across, the field under */
@container (max-width: 379px) {
	.nx-captcha { flex-wrap: wrap; }
	.nx-captcha-picture { flex: 1 0 100%; width: auto; }
	.nx-captcha-img { height: auto; aspect-ratio: 180 / 64; }
	.nx-captcha-input { flex: 1 1 calc(100% - 52px); }
	.has-keys .nx-captcha-input { flex: 1 1 100%; }
}

/* the dialog */
.nx-captcha-overlay { animation: nx-captcha-veil 0.32s ease both; }
.nx-captcha-overlay.is-leaving { animation: nx-captcha-veil-out 0.3s ease both; }
.nx-captcha-overlay.is-leaving .nx-captcha-dialog { animation: nx-captcha-leave 0.3s var(--ease) both; pointer-events: none; }
.nx-captcha-dialog {
	display: flex; flex-direction: column; justify-content: center; width: min(440px, 100%); overflow: hidden auto;
	background: linear-gradient(180deg, color-mix(in srgb, var(--accent-soft) 70%, var(--surface)) 0, var(--surface) 170px);
	transform-origin: 50% 40%; animation: nx-captcha-enter 0.58s var(--ease-out) both;
}
.nx-captcha-dialog.is-shaking { animation: nx-captcha-shake 0.46s ease both; }
.nx-captcha-dialog[data-state="passed"] .nx-dialog-close { opacity: 0; pointer-events: none; }
.nx-captcha-stage { display: grid; min-width: 0; }
.nx-captcha-ask { grid-area: 1 / 1; min-width: 0; }
.nx-captcha-ask > * { animation: nx-captcha-rise 0.52s var(--ease-out) both; }
.nx-captcha-ask > *:nth-child(1) { animation-delay: 0.1s; }
.nx-captcha-ask > *:nth-child(2) { animation-delay: 0.19s; }
.nx-captcha-ask > *:nth-child(3) { animation-delay: 0.28s; }
.nx-captcha-ask > *:nth-child(4) { animation-delay: 0.37s; }
.nx-captcha-dialog[data-state="passed"] .nx-captcha-ask { display: none; }
.nx-captcha-head { display: flex; align-items: flex-start; gap: 14px; padding-right: 36px; }
.nx-captcha-mark {
	position: relative; flex: 0 0 auto; display: grid; place-items: center; width: 44px; height: 44px; margin-top: 2px;
	border-radius: 14px; color: #fff; font-size: 22px; background: linear-gradient(135deg, var(--accent), var(--accent-2));
	box-shadow: 0 8px 18px -8px var(--accent-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.4);
	animation: nx-captcha-mark 0.6s var(--ease-out) 0.14s both;
}
.nx-captcha-mark .ic { animation: nx-captcha-rise 0.4s var(--ease-out) 0.3s both; }
.nx-captcha-mark::after { content: ''; position: absolute; inset: 0; border-radius: inherit; border: 2px solid var(--accent); animation: nx-captcha-ping 1s ease-out 0.5s both; }
.nx-captcha-words { min-width: 0; }
.nx-captcha-words h2 { font-size: 20px; font-weight: 800; line-height: 1.25; letter-spacing: -0.01em; }
.nx-captcha-note { margin-top: 3px; color: var(--ink-3); font-size: 13.5px; line-height: 1.5; transition: color 0.2s; }
.nx-captcha-note.is-wrong { color: var(--bad); font-weight: 600; }
.nx-captcha-dialog .nx-captcha-box { margin-top: 22px; }
.nx-captcha-hint { margin-top: 10px; color: var(--ink-4); font-size: 12.5px; }
.nx-captcha-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.nx-captcha-confirm { min-width: 104px; }
.nx-captcha-spinner { display: none; width: 16px; height: 16px; border: 2px solid rgba(255, 255, 255, 0.45); border-top-color: #fff; border-radius: 50%; animation: nx-spin 0.7s linear infinite; }
.nx-captcha-dialog.is-checking .nx-captcha-spinner { display: inline-block; }
.nx-captcha-dialog.is-ready .nx-captcha-confirm:not(:disabled) { animation: nx-captcha-ready 1.5s ease-in-out infinite; }

/* the pass: the disc comes, the tick is drawn, a ring goes out twice */
.nx-captcha-passed {
	grid-area: 1 / 1; display: grid; place-content: center; justify-items: center; gap: 4px; min-height: 196px; text-align: center;
	opacity: 0; visibility: hidden; transform: scale(0.92);
	transition: opacity 0.22s ease, transform 0.3s var(--ease-out), visibility 0s linear 0.3s;
}
.nx-captcha-dialog[data-state="passed"] .nx-captcha-passed { opacity: 1; visibility: visible; transform: none; transition: opacity 0.3s ease 0.06s, transform 0.42s var(--ease-out) 0.06s, visibility 0s; }
.nx-captcha-passed-mark { position: relative; display: grid; place-items: center; width: 88px; height: 88px; margin-bottom: 8px; }
.nx-captcha-passed-mark svg { position: relative; z-index: 1; width: 72px; height: 72px; overflow: visible; }
.nx-captcha-passed-disc { fill: var(--ok); transform-origin: center; transform: scale(0); filter: drop-shadow(0 8px 14px color-mix(in srgb, var(--ok) 40%, transparent)); }
.nx-captcha-passed-check { fill: none; stroke: #fff; stroke-width: 4.2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 34; stroke-dashoffset: 34; }
.nx-captcha-ring { position: absolute; inset: 4px; border-radius: 50%; border: 2px solid var(--ok); opacity: 0; }
.nx-captcha-dialog[data-state="passed"] .nx-captcha-passed-disc { animation: nx-captcha-disc 0.5s var(--ease-out) both; }
.nx-captcha-dialog[data-state="passed"] .nx-captcha-passed-check { animation: nx-captcha-draw 0.42s ease-out 0.28s forwards; }
.nx-captcha-dialog[data-state="passed"] .nx-captcha-ring { animation: nx-captcha-ring 1s ease-out 0.18s both; }
.nx-captcha-dialog[data-state="passed"] .nx-captcha-ring-2 { animation-delay: 0.44s; }
.nx-captcha-passed-title { color: var(--ink); font-size: 21px; font-weight: 800; letter-spacing: -0.01em; }
.nx-captcha-passed-text { color: var(--ink-3); font-size: 13.5px; }
.nx-captcha-dialog[data-state="passed"] .nx-captcha-passed-title { animation: nx-captcha-rise 0.5s var(--ease-out) 0.32s both; }
.nx-captcha-dialog[data-state="passed"] .nx-captcha-passed-text { animation: nx-captcha-rise 0.5s var(--ease-out) 0.46s both; }

/* a phone: the buttons share the row, a short screen does without the hint */
@media (max-width: 480px) {
	.nx-captcha-actions .nx-btn { flex: 1 1 0; }
	.nx-captcha-confirm { min-width: 0; }
}
@media (max-height: 600px) {
	.nx-captcha-dialog .nx-captcha-hint { display: none; }
	.nx-captcha-dialog .nx-captcha-box { margin-top: 14px; }
	.nx-captcha-actions { margin-top: 14px; }
	.nx-captcha-passed { min-height: 150px; }
	.nx-captcha-passed-mark { width: 68px; height: 68px; }
	.nx-captcha-passed-mark svg { width: 56px; height: 56px; }
}
/* a phone on its side: there is width and no height — the keys stand beside the picture and the
   field, six to a row, and nothing scrolls */
@media (max-height: 560px) and (min-width: 600px) and (pointer: coarse) {
	.nx-captcha-dialog { width: min(660px, 100%); padding: 18px 20px; }
	.nx-captcha-ask { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-auto-rows: min-content; column-gap: 18px; align-content: center; }
	.nx-captcha-box.has-keys { display: contents; }
	.nx-captcha-head { grid-column: 1; grid-row: 1; }
	.has-keys > .nx-captcha { grid-column: 1; grid-row: 2; flex-wrap: wrap; margin-top: 12px; }
	/* the picture keeps its shape at the height there is room for, and the button hugs it */
	.has-keys .nx-captcha-picture { flex: 0 0 auto; width: auto; margin: 0 auto; }
	.has-keys .nx-captcha-picture .nx-captcha-img { height: 84px; width: auto; aspect-ratio: 180 / 64; }
	.has-keys .nx-captcha-input { flex: 1 1 100%; }
	/* the keys stand under the button that closes: the first row is not hidden by it */
	.has-keys > .nx-captcha-keys { grid-column: 2; grid-row: 1 / span 4; grid-template-columns: repeat(5, 44px); gap: 5px 6px; margin: 38px 0 0; align-self: start; }
	.has-keys > .nx-captcha-keys .nx-captcha-key { height: 38px; }
	.nx-captcha-hint { display: none; }
	.nx-captcha-actions { grid-column: 1; grid-row: 4; margin-top: 12px; }
	.nx-captcha-actions .nx-btn { flex: 1 1 0; }
	.nx-captcha-confirm { min-width: 0; }
}

@keyframes nx-captcha-veil { from { opacity: 0; } to { opacity: 1; } }
@keyframes nx-captcha-veil-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes nx-captcha-enter {
	0% { opacity: 0; transform: translateY(26px) scale(0.9); }
	60% { opacity: 1; transform: translateY(-5px) scale(1.02); }
	100% { opacity: 1; transform: none; }
}
@keyframes nx-captcha-leave { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(-12px) scale(0.94); } }
@keyframes nx-captcha-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes nx-captcha-mark { 0% { opacity: 0; transform: scale(0.3) rotate(-20deg); } 60% { opacity: 1; transform: scale(1.15) rotate(4deg); } 100% { opacity: 1; transform: none; } }
@keyframes nx-captcha-ping { from { opacity: 0.7; transform: scale(1); } to { opacity: 0; transform: scale(2); } }
@keyframes nx-captcha-deal { from { opacity: 0; transform: rotateY(-72deg); } to { opacity: 1; transform: none; } }
@keyframes nx-captcha-shake {
	0%, 100% { transform: translateX(0); }
	15% { transform: translateX(-11px); }
	30% { transform: translateX(10px); }
	45% { transform: translateX(-7px); }
	60% { transform: translateX(5px); }
	75% { transform: translateX(-3px); }
	90% { transform: translateX(1px); }
}
@keyframes nx-captcha-disc { from { transform: scale(0); } 60% { transform: scale(1.12); } to { transform: scale(1); } }
@keyframes nx-captcha-draw { to { stroke-dashoffset: 0; } }
@keyframes nx-captcha-ring { from { opacity: 0.55; transform: scale(0.7); } to { opacity: 0; transform: scale(2.1); } }
@keyframes nx-captcha-ready {
	0%, 100% { box-shadow: 0 0 0 0 var(--accent-ring); }
	70% { box-shadow: 0 0 0 9px transparent; }
}

/* ---- floating tool menu of an address ------------------------------------ */

.kkyun-ip-floating-menu {
	position: fixed; z-index: 1150; display: flex; flex-direction: column; gap: 2px; width: 132px; padding: 6px;
	border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-2); animation: nx-pop 0.18s var(--ease-out);
}
.kkyun-ip-floating-menu button { height: 34px; padding: 0 12px; border: 0; border-radius: 10px; background: transparent; color: var(--ink-2); font-size: 13.5px; text-align: left; white-space: nowrap; transition: background 0.15s, color 0.15s; }
.kkyun-ip-floating-menu button:hover { background: var(--accent-soft); color: var(--accent-ink); }

/* ---- the page that was not found ----------------------------------------- */

.nx-404 {
	position: relative; overflow: hidden; display: grid; justify-items: center; gap: 10px; margin-top: 12px; padding: 72px 24px 64px;
	border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-1); text-align: center;
}
.nx-404-glow {
	position: absolute; inset: -40% -10% auto; height: 120%; pointer-events: none; animation: nx-drift 16s ease-in-out infinite;
	background: radial-gradient(45% 60% at 28% 40%, var(--glow-1), transparent 70%), radial-gradient(40% 55% at 74% 28%, var(--glow-2), transparent 70%), radial-gradient(35% 50% at 56% 62%, var(--glow-3), transparent 70%);
}
.nx-404-mark { position: relative; display: flex; align-items: center; gap: 6px; color: var(--accent); font-size: clamp(88px, 15vw, 164px); font-weight: 800; line-height: 1; letter-spacing: -0.05em; }
.nx-404-mark span { background: linear-gradient(135deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nx-404-mark i { position: relative; width: 0.62em; height: 0.62em; margin: 0 0.05em; border: 0.09em solid var(--accent); border-radius: 50%; }
.nx-404-mark i::after { content: ""; position: absolute; inset: 0.14em; border-radius: 50%; background: var(--accent-2); }
.nx-404-title { font-size: 26px; font-weight: 800; }
.nx-404-text { max-width: 520px; color: var(--ink-3); font-size: 15px; line-height: 1.75; }
.nx-404-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 10px; }

/* ---- small screens ------------------------------------------------------- */

/* a phone has no room for the links of the bar: the panel is its menu, a sheet under the bar */
@media (max-width: 1023px) {
	.hd-nav, .hd-more { display: none; }
	.nx-menu-btn { display: inline-grid; }
	/* the bar is the top of the sheet while the sheet is down: no page shows through it */
	.hd.is-sheet { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; border-bottom-color: var(--line); }
	.hd-panel { position: fixed; left: 0; right: 0; top: var(--header-h); z-index: 895; justify-content: stretch; padding: 8px 10px 0; transform: translateY(-14px) scale(0.99); }
	/* the sheet scrolls itself: what it holds never shows past its own edge. One column: the
	   group of the bar, then the two columns of the desk one under the other, each a block of
	   its groups again */
	.hd-panel-in {
		display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: none; gap: 12px;
		max-height: calc(100dvh - var(--header-h) - 18px); overflow-y: auto; padding: 14px 12px 12px; border-radius: 22px;
	}
	.nav-col { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
	.nav-group, .nav-tiles { display: grid; }
	.nav-group { gap: 4px; }
	.nav-group-title { margin: 0; }
	/* the rest of a group cut between the columns of a desk follows here as one list on a phone */
	.nav-group.is-continued .nav-group-title { display: none; }
	.nav-group--primary { display: grid; }
	/* two tools to a line, their names alone: the whole menu fits in a sheet */
	.nav-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 8px; }
	.nav-tile { grid-column: auto; grid-template-columns: 30px minmax(0, 1fr); column-gap: 7px; min-height: 44px; padding: 6px 8px; border-radius: 12px; }
	.nav-tile-text small { display: none; }
	/* the way back to the top floats at the lower right of the window, over the home bar of the
	   device if it has one; it takes no room anywhere while it is away */
	.nx-totop, .nx-totop.is-shown {
		position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 800;
		width: 44px; height: 44px; margin: 0; border-width: 1px; overflow: visible; font-size: 20px; box-shadow: var(--sh-2);
	}
	.nx-totop { transform: translateY(10px) scale(0.9); }
	.nx-totop.is-shown { transform: none; }
}
@media (max-width: 640px) {
	.hd-in { gap: 10px; }
	.hd-brand { margin-left: -6px; }
	.hd-logo { height: 28px; }
	.nx-footer { margin-top: 28px; }
	.nx-footer-in { padding: 18px 16px 14px; border-radius: var(--r-md); }
	.nx-footer-top { flex-direction: column; align-items: flex-start; gap: 12px; }
	.nx-footer-info { flex-direction: column; }
	.nx-dialog { padding: 22px 18px 20px; border-radius: var(--r-lg); }
}
