/* gateway-whois.com — шар поверх Trezo (style.css).
 * Mobile-first: базові правила — для телефона, ширші екрани через min-width.
 * Кольори — токени нижче; темна тема перевизначає їх під [data-theme=dark].
 * Статусні кольори зарезервовані під стан домену і більше ніде не вживаються.
 */
:root {
	--gw-accent: #605dff;          /* primary Trezo */
	--gw-accent-soft: rgba(96, 93, 255, .1);
	--gw-surface: #ffffff;
	--gw-surface-2: #f6f7f9;
	--gw-border: #eceef2;
	--gw-text: #3a4252;
	--gw-text-strong: #111827;
	--gw-muted: #8695aa;
	--gw-danger: #d03b3b;
	--gw-danger-soft: rgba(208, 59, 59, .1);
	--gw-warning: #b77a00;
	--gw-warning-soft: rgba(250, 178, 25, .16);
	--gw-success: #0b8a0b;
	--gw-success-soft: rgba(12, 163, 12, .1);
	--gw-neutral: #6b7280;
	--gw-neutral-soft: rgba(107, 114, 128, .12);
	--gw-info: #2a78d6;
	--gw-info-soft: rgba(42, 120, 214, .1);
	--gw-radius: 14px;
	--gw-bottom-nav-h: 64px;
	--gw-tap: 44px;               /* мінімальна ціль дотику */
}

[data-theme=dark] {
	--gw-accent: #7c7aff;
	--gw-accent-soft: rgba(124, 122, 255, .16);
	--gw-surface: #0c1427;
	--gw-surface-2: #0a0e19;
	--gw-border: #172036;
	--gw-text: #c8d0dc;
	--gw-text-strong: #ffffff;
	--gw-muted: #8695aa;
	--gw-danger: #f07070;
	--gw-danger-soft: rgba(240, 112, 112, .14);
	--gw-warning: #fab219;
	--gw-warning-soft: rgba(250, 178, 25, .14);
	--gw-success: #3ecf5a;
	--gw-success-soft: rgba(62, 207, 90, .12);
	--gw-neutral: #9aa3b2;
	--gw-neutral-soft: rgba(154, 163, 178, .14);
	--gw-info: #6aa8f0;
	--gw-info-soft: rgba(106, 168, 240, .14);
}

/* ───────── Каркас ───────── */
body.gw-app { -webkit-tap-highlight-color: transparent; }
.gw-app .main-content { padding-bottom: calc(var(--gw-bottom-nav-h) + 24px + env(safe-area-inset-bottom)); }
@media (min-width: 1200px) {
	.gw-app .main-content { padding-bottom: 24px; }
}
.gw-app .main-content { min-height: 100vh; }

/* Шапка: на телефоні — один компактний ряд */
.gw-header { position: sticky; top: 0; z-index: 1020; background: var(--gw-surface); border-radius: 0 0 var(--gw-radius) var(--gw-radius);
	padding: 10px 14px; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; box-shadow: 0 1px 0 var(--gw-border); }
.gw-header .gw-brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--gw-text-strong); font-weight: 700; }
.gw-header .gw-brand img { width: 28px; height: 28px; }
.gw-header .gw-search { flex: 1 1 auto; min-width: 0; position: relative; }
.gw-header .gw-search input { height: var(--gw-tap); border-radius: 12px; padding-left: 40px; background: var(--gw-surface-2); border-color: transparent; }
.gw-header .gw-search input:focus { background: var(--gw-surface); border-color: var(--gw-accent); box-shadow: 0 0 0 3px var(--gw-accent-soft); }
.gw-header .gw-search .material-symbols-outlined { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--gw-muted); font-size: 20px; pointer-events: none; }
.gw-icon-btn { position: relative; width: var(--gw-tap); height: var(--gw-tap); flex: 0 0 var(--gw-tap); border-radius: 12px; border: 0; background: transparent;
	display: inline-flex; align-items: center; justify-content: center; color: var(--gw-text); text-decoration: none; }
.gw-icon-btn:hover, .gw-icon-btn:focus-visible { background: var(--gw-surface-2); color: var(--gw-text-strong); }
.gw-icon-btn .material-symbols-outlined { font-size: 22px; }
.gw-count { position: absolute; top: 6px; right: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; font-size: 11px; line-height: 18px;
	font-weight: 600; text-align: center; color: #fff; background: var(--gw-danger); }
.gw-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--gw-accent-soft); color: var(--gw-accent); font-weight: 700;
	display: inline-flex; align-items: center; justify-content: center; font-size: 14px; text-transform: uppercase; }
@media (max-width: 575.98px) {
	.gw-header .gw-brand span { display: none; }
	.gw-header .gw-hide-xs { display: none !important; }
}

/* Сайдбар-шухляда на телефоні: Trezo ховає .sidebar-area до 1199px, ми додаємо підкладку */
.gw-backdrop { position: fixed; inset: 0; background: rgba(10, 14, 25, .45); z-index: 1029; opacity: 0; visibility: hidden; transition: opacity .2s; }
body[sidebar-data-theme=sidebar-hide] .gw-backdrop { opacity: 1; visibility: visible; }
@media (min-width: 1200px) { .gw-backdrop { display: none; } }
.gw-app .sidebar-area .menu-link .badge { margin-left: auto; }

/* ───────── Нижня навігація (телефон і планшет) ───────── */
.gw-bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030; height: calc(var(--gw-bottom-nav-h) + env(safe-area-inset-bottom));
	padding-bottom: env(safe-area-inset-bottom); background: var(--gw-surface); border-top: 1px solid var(--gw-border);
	display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; }
.gw-bottom-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: 100%;
	color: var(--gw-muted); text-decoration: none; font-size: 11px; font-weight: 500; position: relative; }
.gw-bottom-nav a .material-symbols-outlined { font-size: 24px; }
.gw-bottom-nav a.active { color: var(--gw-accent); }
.gw-bottom-nav a.active .material-symbols-outlined { font-variation-settings: 'FILL' 1; }
.gw-bottom-nav .gw-count { top: 6px; right: calc(50% - 22px); }
.gw-bottom-nav .gw-fab { width: 52px; height: 52px; margin: -18px auto 0; border-radius: 16px; background: var(--gw-accent); color: #fff;
	box-shadow: 0 6px 18px rgba(96, 93, 255, .35); display: flex; align-items: center; justify-content: center; }
.gw-bottom-nav .gw-fab .material-symbols-outlined { font-size: 30px; color: #fff; }
@media (min-width: 1200px) { .gw-bottom-nav { display: none; } }

/* ───────── Сторінка ───────── */
.gw-page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.gw-page-head h1 { font-size: 22px; font-weight: 700; margin: 0; color: var(--gw-text-strong); }
.gw-page-head .gw-sub { color: var(--gw-muted); font-size: 14px; margin: 2px 0 0; }
@media (min-width: 768px) { .gw-page-head h1 { font-size: 26px; } }

.gw-card { background: var(--gw-surface); border-radius: var(--gw-radius); padding: 16px; border: 0; margin-bottom: 16px; }
@media (min-width: 768px) { .gw-card { padding: 20px 24px; } }
.gw-card-title { font-size: 16px; font-weight: 600; color: var(--gw-text-strong); margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.gw-card-title .material-symbols-outlined { font-size: 20px; color: var(--gw-muted); }

/* Плитки-лічильники: на телефоні — горизонтальна стрічка, далі — сітка */
.gw-tiles { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, 1fr); gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory;
	margin: 0 -12px 16px; padding: 0 12px 4px; scrollbar-width: none; }
.gw-tiles::-webkit-scrollbar { display: none; }
@media (min-width: 768px) { .gw-tiles { grid-auto-flow: row; grid-template-columns: repeat(4, 1fr); overflow: visible; margin: 0 0 16px; padding: 0; } }
.gw-tile { scroll-snap-align: start; background: var(--gw-surface); border-radius: var(--gw-radius); padding: 14px 16px; text-decoration: none; display: block;
	color: var(--gw-text); border: 2px solid transparent; }
.gw-tile:hover { border-color: var(--gw-accent-soft); }
.gw-tile .gw-tile-label { font-size: 13px; color: var(--gw-muted); display: flex; align-items: center; gap: 6px; }
.gw-tile .gw-tile-label .material-symbols-outlined { font-size: 18px; }
.gw-tile .gw-tile-value { font-size: 28px; font-weight: 700; color: var(--gw-text-strong); line-height: 1.2; margin-top: 4px; }

/* Статус-пігулка: іконка + підпис (колір ніколи не єдиний носій сенсу) */
.gw-pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px 3px 7px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.gw-pill .material-symbols-outlined { font-size: 16px; }
.gw-pill-expired, .gw-pill-critical { background: var(--gw-danger-soft); color: var(--gw-danger); }
.gw-pill-soon { background: var(--gw-warning-soft); color: var(--gw-warning); }
.gw-pill-ok { background: var(--gw-success-soft); color: var(--gw-success); }
.gw-pill-unknown { background: var(--gw-neutral-soft); color: var(--gw-neutral); }
.gw-pill-changed { background: var(--gw-info-soft); color: var(--gw-info); }

/* Рядок домену — картка на телефоні, рядок «таблиці» на десктопі */
.gw-list { list-style: none; margin: 0; padding: 0; }
.gw-row { display: grid; grid-template-columns: 40px 1fr auto; gap: 4px 12px; align-items: center; padding: 12px 4px; border-bottom: 1px solid var(--gw-border);
	color: inherit; text-decoration: none; min-height: 64px; }
.gw-list > li:last-child .gw-row { border-bottom: 0; }
.gw-row:hover { background: var(--gw-surface-2); border-radius: 10px; }
.gw-row .gw-favicon { width: 40px; height: 40px; border-radius: 10px; background: var(--gw-surface-2); display: flex; align-items: center; justify-content: center;
	overflow: hidden; color: var(--gw-muted); grid-row: span 2; }
.gw-row .gw-favicon img { width: 22px; height: 22px; }
.gw-row .gw-name { font-weight: 600; color: var(--gw-text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.gw-row .gw-meta { font-size: 13px; color: var(--gw-muted); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; min-width: 0; }
.gw-row .gw-when { text-align: right; grid-row: span 2; }
.gw-days { font-size: 20px; font-weight: 700; line-height: 1; color: var(--gw-text-strong); font-variant-numeric: tabular-nums; }
.gw-days small { display: block; font-size: 12px; font-weight: 500; color: var(--gw-muted); margin-top: 3px; }
.gw-days.gw-days-expired, .gw-days.gw-days-critical { color: var(--gw-danger); }
.gw-days.gw-days-soon { color: var(--gw-warning); }

/* Фільтри-чіпи: прокручуються на телефоні */
.gw-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -12px 12px; padding: 0 12px 2px; }
.gw-chips::-webkit-scrollbar { display: none; }
@media (min-width: 768px) { .gw-chips { flex-wrap: wrap; overflow: visible; margin: 0 0 12px; padding: 0; } }
.gw-chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 999px; font-size: 14px; font-weight: 500;
	background: var(--gw-surface); color: var(--gw-text); text-decoration: none; border: 1px solid var(--gw-border); }
.gw-chip .gw-chip-n { font-size: 12px; color: var(--gw-muted); font-weight: 600; }
.gw-chip.active { background: var(--gw-accent); color: #fff; border-color: var(--gw-accent); }
.gw-chip.active .gw-chip-n { color: rgba(255, 255, 255, .8); }

/* Порожній стан */
.gw-empty { text-align: center; padding: 32px 16px; color: var(--gw-muted); }
.gw-empty .material-symbols-outlined { font-size: 48px; color: var(--gw-accent); opacity: .5; }
.gw-empty h3 { font-size: 17px; color: var(--gw-text-strong); margin: 8px 0 4px; }

/* Таймлайн змін записів */
.gw-timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.gw-timeline li { position: relative; padding: 0 0 18px 28px; }
.gw-timeline li::before { content: ""; position: absolute; left: 7px; top: 18px; bottom: 0; width: 2px; background: var(--gw-border); }
.gw-timeline li:last-child::before { display: none; }
.gw-timeline .gw-dot { position: absolute; left: 0; top: 4px; width: 16px; height: 16px; border-radius: 50%; background: var(--gw-info-soft); border: 2px solid var(--gw-info); }
.gw-diff { font-family: var(--bs-font-monospace); font-size: 13px; border-radius: 8px; padding: 6px 10px; margin-top: 6px; background: var(--gw-surface-2); word-break: break-all; }
.gw-diff del { color: var(--gw-danger); text-decoration: line-through; }
.gw-diff ins { color: var(--gw-success); text-decoration: none; }

/* Ключ-значення (реєстратор, NS, дати) — дві колонки від md */
.gw-kv { display: grid; grid-template-columns: 1fr; gap: 10px 24px; margin: 0; }
@media (min-width: 768px) { .gw-kv { grid-template-columns: 1fr 1fr; } }
.gw-kv dt { font-size: 12px; font-weight: 500; color: var(--gw-muted); text-transform: uppercase; letter-spacing: .03em; }
.gw-kv dd { margin: 2px 0 0; color: var(--gw-text-strong); word-break: break-word; }

/* Кнопки на токенах: Trezo-шні outline-secondary/danger погано читаються в темній темі */
.gw-app .gw-btn-ghost { color: var(--gw-text-strong); border: 1px solid var(--gw-border); background: transparent; }
.gw-app .gw-btn-ghost:hover, .gw-app .gw-btn-ghost:focus-visible { background: var(--gw-surface-2); color: var(--gw-text-strong); border-color: var(--gw-muted); }
.gw-app .gw-btn-danger { color: #fff; background: var(--gw-danger); border: 1px solid var(--gw-danger); }
.gw-app .gw-btn-danger:hover, .gw-app .gw-btn-danger:focus-visible { color: #fff; background: var(--gw-danger); filter: brightness(.92); }
.gw-app .gw-btn-danger-outline { color: var(--gw-danger); background: transparent; border: 1px solid var(--gw-danger); }
.gw-app .gw-btn-danger-outline:hover, .gw-app .gw-btn-danger-outline:focus-visible { color: var(--gw-danger); background: var(--gw-danger-soft); }

/* Trezo не перефарбовує select у темній темі */
[data-theme=dark] .gw-app .form-select, [data-theme=dark] .form-select { background-color: var(--gw-surface); color: var(--gw-text-strong); border-color: var(--gw-border); }

/* Великі кнопки дії на телефоні */
.gw-btn-block-xs { width: 100%; }
@media (min-width: 576px) { .gw-btn-block-xs { width: auto; } }
.gw-app .btn { min-height: 40px; border-radius: 10px; }
.gw-app .form-control, .gw-app .form-select { border-radius: 10px; }

/* Нижній аркуш (offcanvas-bottom) — для дій на телефоні; у нашій style.css немає базового backdrop */
.offcanvas-backdrop { position: fixed; inset: 0; z-index: 1040; background: rgba(10, 14, 25, .45); }
.offcanvas-backdrop.fade { opacity: 0; transition: opacity .15s; }
.offcanvas-backdrop.show { opacity: 1; }
.gw-app .offcanvas-bottom { height: auto; max-height: 85vh; border-radius: 18px 18px 0 0; }

/* Тости над нижньою навігацією */
.gw-toasts { position: fixed; z-index: 1100; left: 12px; right: 12px; bottom: calc(var(--gw-bottom-nav-h) + 12px + env(safe-area-inset-bottom)); }
@media (min-width: 576px) { .gw-toasts { left: auto; width: 380px; } }
@media (min-width: 1200px) { .gw-toasts { top: 16px; bottom: auto; right: 16px; } }

.gw-mono { font-family: var(--bs-font-monospace); font-size: .92em; }
.gw-muted { color: var(--gw-muted) !important; }

/* ───────── Вхід / реєстрація ───────── */
.gw-auth { background: var(--gw-surface-2); }
.gw-auth-wrap { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; padding: 12px 16px 24px; }
.gw-auth-top { width: 100%; max-width: 440px; display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.gw-auth-top .gw-brand { color: var(--gw-text-strong); }
.gw-auth-card { width: 100%; max-width: 440px; background: var(--gw-surface); border-radius: 18px; padding: 24px 20px; margin-top: auto; margin-bottom: 16px; }
@media (min-width: 576px) { .gw-auth-card { padding: 32px; margin-top: 8vh; } }
@media (max-width: 575.98px) { .gw-auth-card { margin-top: 4vh; } }
.gw-auth-title { font-size: 24px; font-weight: 700; color: var(--gw-text-strong); margin: 0 0 4px; }
.gw-auth-sub { color: var(--gw-muted); margin: 0 0 20px; }
.gw-auth-foot { color: var(--gw-muted); text-align: center; margin: 0 0 auto; }
.gw-auth .form-label { font-weight: 500; color: var(--gw-text); }

/* Прапорці в меню мов (ті самі SVG, що й на лендінгу) */
.gw-flag { width: 20px; height: 14px; border-radius: 3px; object-fit: cover; box-shadow: 0 0 0 1px rgba(0, 0, 0, .08); flex: 0 0 auto; }
.gw-lang-btn { width: auto; padding: 0 8px; gap: 6px; }
