/*
 * HostingArabi Tools — shared design system.
 * Everything is scoped under .hat so nothing leaks into the theme.
 * Colours follow the Blocksy palette used on hostingarabi.com.
 */

.hat {
	--hat-primary: var(--theme-palette-color-1, #2872fa);
	--hat-primary-dark: var(--theme-palette-color-2, #1559ed);
	--hat-primary-soft: #eaf1ff;
	--hat-text: var(--theme-palette-color-3, #3a4f66);
	--hat-heading: var(--theme-palette-color-4, #192a3d);
	--hat-border: var(--theme-palette-color-5, #e1e8ed);
	--hat-surface: var(--theme-palette-color-6, #f2f5f7);
	--hat-surface-2: var(--theme-palette-color-7, #fafbfc);
	--hat-white: #fff;
	--hat-success: #0e9f6e;
	--hat-success-soft: #e6f6ef;
	--hat-danger: #e02d3c;
	--hat-danger-soft: #fdecee;
	--hat-warn: #c27803;
	--hat-warn-soft: #fdf6e3;
	--hat-radius: 14px;
	--hat-radius-lg: 22px;
	--hat-shadow: 0 10px 30px -12px rgba(25, 42, 61, 0.18);
	--hat-ease: cubic-bezier(0.2, 0.7, 0.2, 1);

	direction: rtl;
	text-align: right;
	color: var(--hat-text);
	font-family: inherit;
	font-size: 16px;
	line-height: 1.7;
	max-width: 1000px;
	margin: 72px auto 40px;
	padding: 0 16px;
	box-sizing: border-box;
}

.hat *,
.hat *::before,
.hat *::after {
	box-sizing: border-box;
}

.hat [hidden] {
	display: none !important;
}

.hat .hat-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* ---------- Card shell (matches the /tools/ page cards) ---------- */

.hat .hat-card {
	position: relative;
	background: var(--hat-white);
	border: 2px solid var(--hat-primary);
	border-radius: var(--hat-radius-lg);
	padding: 64px clamp(16px, 4vw, 44px) clamp(22px, 4vw, 44px);
}

.hat .hat-badge {
	position: absolute;
	top: -46px;
	left: 50%;
	transform: translateX(-50%);
	width: 92px;
	height: 92px;
	border-radius: 50%;
	background: var(--hat-white);
	border: 2px solid var(--hat-primary);
	color: var(--hat-primary);
	display: grid;
	place-items: center;
}

.hat .hat-badge .hat-icon {
	width: 42px;
	height: 42px;
	stroke-width: 1.8;
}

.hat .hat-icon {
	width: 1.15em;
	height: 1.15em;
	flex: none;
	vertical-align: -0.2em;
}

.hat .hat-head {
	text-align: center;
	margin: 0 auto 28px;
	max-width: 720px;
}

.hat .hat-title {
	color: var(--hat-heading);
	font-size: clamp(1.35rem, 3vw, 1.75rem);
	font-weight: 800;
	line-height: 1.4;
	margin: 0 0 8px;
}

.hat .hat-subtitle {
	margin: 0;
	color: var(--hat-text);
}

.hat .hat-h3 {
	display: flex;
	align-items: center;
	gap: 8px;
	color: var(--hat-heading);
	font-size: 1.1rem;
	font-weight: 700;
	margin: 0 0 12px;
}

.hat .hat-h3 .hat-icon {
	color: var(--hat-primary);
}

.hat .hat-muted {
	color: var(--hat-text);
	opacity: 0.8;
	font-size: 0.9rem;
}

.hat .hat-hint {
	margin: 10px 0 0;
	font-size: 0.875rem;
	color: var(--hat-text);
	opacity: 0.8;
	text-align: center;
}

.hat .hat-empty {
	text-align: center;
	color: var(--hat-text);
	padding: 24px;
	background: var(--hat-surface);
	border-radius: var(--hat-radius);
}

/* ---------- Form controls ---------- */

.hat .hat-form {
	display: grid;
	gap: 18px;
}

.hat .hat-row {
	display: grid;
	gap: 16px;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.hat .hat-field {
	display: grid;
	gap: 6px;
	margin: 0;
	padding: 0;
	border: 0;
	min-width: 0;
}

.hat .hat-label {
	font-weight: 700;
	font-size: 0.95rem;
	color: var(--hat-heading);
	padding: 0;
}

.hat .hat-input {
	width: 100%;
	height: auto;
	min-height: 50px;
	margin: 0;
	padding: 11px 14px;
	font: inherit;
	font-size: 1rem;
	color: var(--hat-heading);
	background: var(--hat-white);
	border: 1.5px solid var(--hat-border);
	border-radius: 12px;
	box-shadow: none;
	transition: border-color 0.15s, box-shadow 0.15s;
	-webkit-appearance: none;
	appearance: none;
}

.hat select.hat-input {
	padding-left: 38px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233a4f66' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: left 12px center;
	background-size: 16px;
	cursor: pointer;
}

.hat .hat-textarea {
	min-height: 96px;
	resize: vertical;
}

.hat .hat-input:hover {
	border-color: #c9d4de;
}

.hat .hat-input:focus {
	outline: none;
	border-color: var(--hat-primary);
	box-shadow: 0 0 0 4px rgba(40, 114, 250, 0.14);
}

.hat .hat-input::placeholder {
	color: #8a9bb0;
	opacity: 1;
}

/* LTR inputs (domains, URLs, numbers) keep an RTL Arabic placeholder until typed in. */
.hat .hat-input[dir="ltr"]:placeholder-shown {
	direction: rtl;
}

.hat .hat-input[dir="ltr"] {
	text-align: left;
}

.hat .hat-input[dir="ltr"]:placeholder-shown {
	text-align: right;
}

.hat .hat-affix {
	position: relative;
}

.hat .hat-affix .hat-input {
	padding-left: 40px;
}

.hat .hat-affix-text {
	position: absolute;
	left: 14px;
	top: 50%;
	transform: translateY(-50%);
	color: var(--hat-text);
	font-weight: 700;
	pointer-events: none;
}

.hat .hat-join {
	display: flex;
	gap: 8px;
}

.hat .hat-join .hat-input:first-child {
	flex: 1 1 60%;
	min-width: 0;
}

.hat .hat-join select.hat-input {
	flex: 1 1 40%;
}

/* Search bar: input + button in one row */
.hat .hat-search {
	display: flex;
	gap: 10px;
	max-width: 720px;
	margin: 0 auto;
}

.hat .hat-search .hat-input {
	flex: 1;
	min-height: 56px;
	font-size: 1.05rem;
	border-radius: 14px;
}

/* ---------- Buttons ---------- */

.hat .hat-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 48px;
	margin: 0;
	padding: 10px 22px;
	font: inherit;
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.2;
	color: var(--hat-white);
	background: var(--hat-primary);
	border: 1.5px solid var(--hat-primary);
	border-radius: 12px;
	text-decoration: none;
	cursor: pointer;
	white-space: nowrap;
	transition: background-color 0.15s, border-color 0.15s, color 0.15s, transform 0.15s var(--hat-ease), box-shadow 0.15s;
}

.hat .hat-btn:hover {
	background: var(--hat-primary-dark);
	border-color: var(--hat-primary-dark);
	color: var(--hat-white);
	text-decoration: none;
}

.hat .hat-btn:active {
	transform: translateY(1px);
}

.hat .hat-btn:focus-visible,
.hat .hat-tab:focus-visible,
.hat .hat-choice:focus-visible,
.hat .hat-chip input:focus-visible + span,
.hat a:focus-visible {
	outline: 3px solid rgba(40, 114, 250, 0.45);
	outline-offset: 2px;
}

.hat .hat-btn:disabled,
.hat .hat-btn[aria-disabled="true"] {
	opacity: 0.6;
	cursor: not-allowed;
	transform: none;
}

.hat .hat-search .hat-btn {
	min-height: 56px;
	border-radius: 14px;
	padding-inline: 26px;
}

.hat .hat-btn--ghost {
	background: var(--hat-white);
	color: var(--hat-primary);
	border-color: var(--hat-border);
}

.hat .hat-btn--ghost:hover {
	background: var(--hat-primary-soft);
	border-color: var(--hat-primary);
	color: var(--hat-primary-dark);
}

.hat .hat-btn--success {
	background: var(--hat-success);
	border-color: var(--hat-success);
}

.hat .hat-btn--success:hover {
	background: #0b8a5f;
	border-color: #0b8a5f;
}

.hat .hat-btn--sm {
	min-height: 38px;
	padding: 6px 14px;
	font-size: 0.9rem;
	border-radius: 10px;
}

.hat .hat-btn--lg {
	min-height: 56px;
	padding: 12px 34px;
	font-size: 1.1rem;
	border-radius: 14px;
}

.hat .hat-btn--block {
	width: 100%;
}

.hat .hat-btn .hat-icon {
	width: 1.1em;
	height: 1.1em;
}

.hat .hat-btn.is-loading {
	position: relative;
	color: transparent !important;
	pointer-events: none;
}

.hat .hat-btn.is-loading::after {
	content: "";
	position: absolute;
	inset: 0;
	margin: auto;
	width: 20px;
	height: 20px;
	border: 2.5px solid rgba(255, 255, 255, 0.45);
	border-top-color: #fff;
	border-radius: 50%;
	animation: hat-spin 0.7s linear infinite;
}

.hat .hat-btn--ghost.is-loading::after {
	border-color: rgba(40, 114, 250, 0.25);
	border-top-color: var(--hat-primary);
}

.hat .hat-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.hat .hat-link {
	color: var(--hat-primary);
	font-weight: 700;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.hat .hat-link:hover {
	color: var(--hat-primary-dark);
	text-decoration: underline;
}

/* ---------- Chips (checkbox pills) ---------- */

.hat .hat-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.hat .hat-chip {
	position: relative;
	margin: 0;
	cursor: pointer;
}

.hat .hat-chip input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.hat .hat-chip span,
.hat .hat-chip-btn {
	display: inline-flex;
	align-items: center;
	min-height: 36px;
	padding: 4px 14px;
	font: inherit;
	font-size: 0.9rem;
	font-weight: 700;
	color: var(--hat-text);
	background: var(--hat-white);
	border: 1.5px solid var(--hat-border);
	border-radius: 999px;
	cursor: pointer;
	transition: all 0.15s;
}

.hat .hat-chip:hover span,
.hat .hat-chip-btn:hover {
	border-color: var(--hat-primary);
	color: var(--hat-primary);
}

.hat .hat-chip input:checked + span,
.hat .hat-chip-btn.is-active {
	background: var(--hat-primary);
	border-color: var(--hat-primary);
	color: var(--hat-white);
}

.hat .hat-presets {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-top: 14px;
}

/* ---------- Pills / badges ---------- */

.hat .hat-pill {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 3px 12px;
	font-size: 0.8rem;
	font-weight: 700;
	line-height: 1.6;
	border-radius: 999px;
	background: var(--hat-surface);
	color: var(--hat-text);
	white-space: nowrap;
}

.hat .hat-pill .hat-icon {
	width: 14px;
	height: 14px;
}

.hat .hat-pill--primary { background: var(--hat-primary-soft); color: var(--hat-primary-dark); }
.hat .hat-pill--success { background: var(--hat-success-soft); color: var(--hat-success); }
.hat .hat-pill--danger { background: var(--hat-danger-soft); color: var(--hat-danger); }
.hat .hat-pill--warn { background: var(--hat-warn-soft); color: var(--hat-warn); }

/* ---------- Tabs (segmented control) ---------- */

.hat .hat-tabs {
	display: flex;
	gap: 6px;
	padding: 6px;
	margin: 0 auto 24px;
	width: fit-content;
	max-width: 100%;
	background: var(--hat-surface);
	border-radius: 999px;
	overflow-x: auto;
	scrollbar-width: none;
}

.hat .hat-tabs::-webkit-scrollbar {
	display: none;
}

.hat .hat-tab {
	flex: none;
	min-height: 42px;
	margin: 0;
	padding: 8px 20px;
	font: inherit;
	font-size: 0.95rem;
	font-weight: 700;
	color: var(--hat-text);
	background: transparent;
	border: 0;
	border-radius: 999px;
	cursor: pointer;
	white-space: nowrap;
	transition: background-color 0.15s, color 0.15s;
}

.hat .hat-tab:hover {
	color: var(--hat-primary);
	background: transparent;
}

.hat .hat-tab[aria-selected="true"] {
	background: var(--hat-primary);
	color: var(--hat-white);
	box-shadow: 0 6px 16px -8px rgba(40, 114, 250, 0.7);
}

.hat .hat-panel {
	animation: hat-fade 0.25s var(--hat-ease);
}

/* ---------- Alerts ---------- */

.hat .hat-alert {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	padding: 14px 16px;
	border-radius: var(--hat-radius);
	background: var(--hat-primary-soft);
	color: var(--hat-heading);
	margin: 0;
}

.hat .hat-alert > .hat-icon {
	width: 22px;
	height: 22px;
	margin-top: 2px;
	color: var(--hat-primary);
}

.hat .hat-alert p {
	margin: 0;
}

.hat .hat-alert--success { background: var(--hat-success-soft); }
.hat .hat-alert--success > .hat-icon { color: var(--hat-success); }
.hat .hat-alert--danger { background: var(--hat-danger-soft); }
.hat .hat-alert--danger > .hat-icon { color: var(--hat-danger); }
.hat .hat-alert--warn { background: var(--hat-warn-soft); }
.hat .hat-alert--warn > .hat-icon { color: var(--hat-warn); }

/* ---------- Output area ---------- */

.hat .hat-output {
	margin-top: 28px;
	display: grid;
	gap: 22px;
}

.hat .hat-output:empty {
	display: none;
}

.hat .hat-output > * {
	animation: hat-rise 0.35s var(--hat-ease) both;
}

/* Big status block at the top of a result */
.hat .hat-hero {
	display: flex;
	align-items: center;
	gap: 18px;
	padding: 22px;
	border-radius: var(--hat-radius-lg);
	background: var(--hat-surface);
	border: 1.5px solid transparent;
}

.hat .hat-hero-icon {
	flex: none;
	width: 60px;
	height: 60px;
	border-radius: 50%;
	display: grid;
	place-items: center;
	background: var(--hat-white);
	color: var(--hat-primary);
}

.hat .hat-hero-icon .hat-icon {
	width: 32px;
	height: 32px;
}

.hat .hat-hero-body {
	flex: 1;
	min-width: 0;
}

.hat .hat-hero-title {
	margin: 0;
	font-size: 1.25rem;
	font-weight: 800;
	color: var(--hat-heading);
	line-height: 1.5;
	overflow-wrap: anywhere;
}

.hat .hat-hero-text {
	margin: 2px 0 0;
}

.hat .hat-hero-side {
	flex: none;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 8px;
}

.hat .hat-hero--success { background: var(--hat-success-soft); border-color: rgba(14, 159, 110, 0.25); }
.hat .hat-hero--success .hat-hero-icon { color: var(--hat-success); }
.hat .hat-hero--danger { background: var(--hat-danger-soft); border-color: rgba(224, 45, 60, 0.2); }
.hat .hat-hero--danger .hat-hero-icon { color: var(--hat-danger); }
.hat .hat-hero--warn { background: var(--hat-warn-soft); border-color: rgba(194, 120, 3, 0.2); }
.hat .hat-hero--warn .hat-hero-icon { color: var(--hat-warn); }

/* Key/value tiles */
.hat .hat-kv {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 10px;
	margin: 0;
}

.hat .hat-kv > div {
	padding: 12px 14px;
	background: var(--hat-surface-2);
	border: 1px solid var(--hat-border);
	border-radius: 12px;
	min-width: 0;
}

.hat .hat-kv dt {
	font-size: 0.82rem;
	color: var(--hat-text);
	margin: 0 0 2px;
}

.hat .hat-kv dd {
	margin: 0;
	font-weight: 700;
	color: var(--hat-heading);
	overflow-wrap: anywhere;
}

/* Section block inside results */
.hat .hat-section {
	padding: 20px;
	border: 1.5px solid var(--hat-border);
	border-radius: var(--hat-radius-lg);
	background: var(--hat-white);
}

.hat .hat-section-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
	margin-bottom: 14px;
}

.hat .hat-section-head .hat-h3 {
	margin: 0;
}

/* Progress / meter */
.hat .hat-meter {
	height: 10px;
	border-radius: 999px;
	background: var(--hat-border);
	overflow: hidden;
}

.hat .hat-meter > span {
	display: block;
	height: 100%;
	border-radius: inherit;
	background: var(--hat-primary);
	transition: width 0.6s var(--hat-ease);
}

.hat .hat-meter--success > span { background: var(--hat-success); }
.hat .hat-meter--warn > span { background: var(--hat-warn); }
.hat .hat-meter--danger > span { background: var(--hat-danger); }

.hat .hat-meter-legend {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	margin-top: 6px;
	font-size: 0.85rem;
}

/* Checklist */
.hat .hat-checklist {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 8px;
}

.hat .hat-checklist li {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	padding: 10px 12px;
	border-radius: 12px;
	background: var(--hat-surface-2);
	border: 1px solid var(--hat-border);
	margin: 0;
}

.hat .hat-checklist li > .hat-icon {
	margin-top: 4px;
}

.hat .hat-checklist .is-ok > .hat-icon { color: var(--hat-success); }
.hat .hat-checklist .is-bad > .hat-icon { color: var(--hat-danger); }
.hat .hat-checklist .is-warn > .hat-icon { color: var(--hat-warn); }

.hat .hat-checklist strong {
	display: block;
	color: var(--hat-heading);
}

.hat .hat-checklist small {
	display: block;
	color: var(--hat-text);
	overflow-wrap: anywhere;
}

/* Tables */
.hat .hat-table-wrap {
	overflow-x: auto;
	border: 1.5px solid var(--hat-border);
	border-radius: var(--hat-radius);
}

.hat .hat-table {
	width: 100%;
	border-collapse: collapse;
	margin: 0;
	font-size: 0.95rem;
	border: 0;
}

.hat .hat-table th,
.hat .hat-table td {
	padding: 12px 14px;
	text-align: right;
	border: 0;
	border-bottom: 1px solid var(--hat-border);
	white-space: nowrap;
}

.hat .hat-table th {
	background: var(--hat-surface);
	color: var(--hat-heading);
	font-weight: 700;
}

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

.hat .hat-table tr.is-hl td {
	background: var(--hat-primary-soft);
	font-weight: 700;
}

.hat .hat-details {
	margin-top: 22px;
	border: 1.5px solid var(--hat-border);
	border-radius: var(--hat-radius);
	background: var(--hat-white);
}

.hat .hat-details summary {
	padding: 14px 18px;
	font-weight: 700;
	color: var(--hat-heading);
	cursor: pointer;
	list-style-position: inside;
}

.hat .hat-details[open] summary {
	border-bottom: 1px solid var(--hat-border);
}

.hat .hat-details .hat-table-wrap {
	border: 0;
	border-radius: 0 0 var(--hat-radius) var(--hat-radius);
}

/* Big number stats */
.hat .hat-stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
	gap: 12px;
}

.hat .hat-stat {
	padding: 16px;
	border-radius: var(--hat-radius);
	background: var(--hat-surface-2);
	border: 1px solid var(--hat-border);
	text-align: center;
}

.hat .hat-stat-value {
	display: block;
	font-size: 1.35rem;
	font-weight: 800;
	color: var(--hat-heading);
	line-height: 1.4;
}

.hat .hat-stat-label {
	display: block;
	font-size: 0.85rem;
	color: var(--hat-text);
}

.hat .hat-stat--primary {
	background: var(--hat-primary);
	border-color: var(--hat-primary);
}

.hat .hat-stat--primary .hat-stat-value,
.hat .hat-stat--primary .hat-stat-label {
	color: var(--hat-white);
}

/* ---------- Domain rows (checker + generator) ---------- */

.hat .hat-domains {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 10px;
}

.hat .hat-domain {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 14px 16px;
	border: 1.5px solid var(--hat-border);
	border-radius: var(--hat-radius);
	background: var(--hat-white);
	margin: 0;
	transition: border-color 0.15s, box-shadow 0.15s;
}

.hat .hat-domain:hover {
	border-color: #c9d4de;
	box-shadow: var(--hat-shadow);
}

.hat .hat-domain.is-available {
	border-color: rgba(14, 159, 110, 0.35);
}

.hat .hat-domain {
	scroll-margin-top: 110px; /* Room for the site's sticky header when scrolled into view. */
}

.hat .hat-domain.is-new {
	animation: hat-new 1.6s var(--hat-ease);
}

@keyframes hat-new {
	0%, 40% { background: var(--hat-primary-soft); border-color: var(--hat-primary); }
	100% { background: var(--hat-white); }
}

.hat .hat-domain-main {
	flex: 1;
	min-width: 0;
}

.hat .hat-domain-name {
	display: block;
	font-weight: 800;
	font-size: 1.05rem;
	color: var(--hat-heading);
	direction: ltr;
	text-align: right;
	unicode-bidi: plaintext;
	overflow-wrap: anywhere;
}

.hat .hat-domain-note {
	display: block;
	font-size: 0.88rem;
	color: var(--hat-text);
}

.hat .hat-domain-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 10px;
	margin-top: 4px;
	font-size: 0.85rem;
}

.hat .hat-domain-price {
	font-weight: 700;
	color: var(--hat-heading);
}

.hat .hat-domain-actions {
	flex: none;
	display: flex;
	gap: 8px;
	align-items: center;
}

.hat .hat-icon-btn {
	display: inline-grid;
	place-items: center;
	width: 38px;
	height: 38px;
	margin: 0;
	padding: 0;
	color: var(--hat-text);
	background: var(--hat-white);
	border: 1.5px solid var(--hat-border);
	border-radius: 10px;
	cursor: pointer;
	transition: all 0.15s;
}

.hat .hat-icon-btn:hover {
	color: var(--hat-primary);
	border-color: var(--hat-primary);
	background: var(--hat-primary-soft);
}

.hat .hat-icon-btn.is-active {
	color: var(--hat-white);
	background: var(--hat-primary);
	border-color: var(--hat-primary);
}

.hat .hat-icon-btn.is-active .hat-icon {
	fill: currentColor;
}

/* Filter bar above a list */
.hat .hat-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 10px;
}

/* Saved domains */
.hat .hat-saved {
	margin-top: 28px;
	padding: 18px;
	border-radius: var(--hat-radius-lg);
	background: var(--hat-surface);
}

.hat .hat-saved-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	flex-wrap: wrap;
	margin-bottom: 12px;
}

.hat .hat-saved-head .hat-h3 {
	margin: 0;
}

.hat .hat-saved-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.hat .hat-saved-list li {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 4px 6px 4px 14px;
	margin: 0;
	background: var(--hat-white);
	border: 1px solid var(--hat-border);
	border-radius: 999px;
	font-weight: 700;
	color: var(--hat-heading);
	direction: ltr;
}

.hat .hat-saved-list button {
	display: grid;
	place-items: center;
	width: 26px;
	height: 26px;
	padding: 0;
	margin: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--hat-text);
	cursor: pointer;
}

.hat .hat-saved-list button:hover {
	background: var(--hat-danger-soft);
	color: var(--hat-danger);
}

/* ---------- Hosting comparison ---------- */

.hat .hat-rank-grid {
	list-style: none;
	margin: 0;
	padding: 18px 0 0;
	display: grid;
	gap: 34px 20px;
	grid-template-columns: repeat(auto-fit, minmax(220px, 290px));
	justify-content: center;
}

.hat .hat-rank-card {
	margin: 0;
	position: relative;
}

.hat .hat-rank-link {
	height: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	padding: 34px 18px 20px;
	text-align: center;
	text-decoration: none;
	color: var(--hat-text);
	background: var(--hat-white);
	border: 1.5px solid var(--hat-border);
	border-radius: var(--hat-radius-lg);
	transition: transform 0.2s var(--hat-ease), box-shadow 0.2s, border-color 0.2s;
}

.hat .hat-rank-link:hover {
	transform: translateY(-4px);
	border-color: var(--hat-primary);
	box-shadow: var(--hat-shadow);
	text-decoration: none;
	color: var(--hat-text);
}

.hat .hat-rank-card.is-top .hat-rank-link {
	border: 2px solid var(--hat-primary);
}

.hat .hat-rank-num {
	position: absolute;
	top: -20px;
	left: 50%;
	transform: translateX(-50%);
	width: 40px;
	height: 40px;
	border-radius: 50%;
	display: grid;
	place-items: center;
	background: var(--hat-primary);
	color: var(--hat-white);
	font-weight: 800;
	font-size: 1.1rem;
	box-shadow: 0 0 0 5px var(--hat-white);
}

.hat .hat-logo {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 120px;
	height: 120px;
	margin: 8px 0 6px;
	padding: 12px;
	border-radius: 18px;
	background: var(--hat-surface-2);
	border: 1px solid var(--hat-border);
}

.hat .hat-logo {
	overflow: hidden;
}

/* Fill the box and let object-fit scale any logo shape down to fit it. */
.hat .hat-logo img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: contain;
	transition: transform 0.25s var(--hat-ease);
}

.hat .hat-rank-link:hover .hat-logo img {
	transform: scale(1.05);
}

.hat .hat-rank-name {
	font-weight: 800;
	font-size: 1.15rem;
	color: var(--hat-heading);
}

.hat .hat-rank-en {
	font-size: 0.9rem;
	opacity: 0.8;
}

.hat .hat-rank-note {
	font-size: 0.9rem;
}

.hat .hat-rank-link .hat-btn {
	margin-top: auto;
	pointer-events: none;
}

.hat .hat-rank-link .hat-btn:first-of-type {
	margin-top: 10px;
}

.hat .hat-rank-link:hover .hat-btn--ghost {
	background: var(--hat-primary);
	border-color: var(--hat-primary);
	color: var(--hat-white);
}

/* ---------- Host finder quiz ---------- */

.hat .hat-quiz-intro {
	text-align: center;
	max-width: 620px;
	margin: 0 auto;
}

.hat .hat-quiz-intro .hat-subtitle {
	margin-bottom: 22px;
}

.hat .hat-step-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 8px;
	font-size: 0.9rem;
	font-weight: 700;
}

.hat .hat-question {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	margin: 18px 0 16px;
}

.hat .hat-question h3 {
	margin: 0;
	font-size: 1.3rem;
	font-weight: 800;
	color: var(--hat-heading);
	line-height: 1.5;
}

.hat .hat-help-text {
	margin: -4px 0 16px;
	padding: 14px 16px;
	background: var(--hat-primary-soft);
	border-radius: var(--hat-radius);
	font-size: 0.95rem;
}

.hat .hat-choices {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
	gap: 10px;
}

.hat .hat-choice {
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 58px;
	margin: 0;
	padding: 12px 16px;
	font: inherit;
	font-weight: 700;
	text-align: right;
	color: var(--hat-heading);
	background: var(--hat-white);
	border: 1.5px solid var(--hat-border);
	border-radius: var(--hat-radius);
	cursor: pointer;
	transition: all 0.15s;
}

.hat .hat-choice::before {
	content: "";
	flex: none;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	border: 2px solid var(--hat-border);
	background: var(--hat-white);
	transition: all 0.15s;
}

.hat .hat-choice:hover {
	border-color: var(--hat-primary);
	background: var(--hat-primary-soft);
	color: var(--hat-heading);
}

.hat .hat-choice.is-selected {
	border-color: var(--hat-primary);
	background: var(--hat-primary-soft);
}

.hat .hat-choice.is-selected::before {
	border-color: var(--hat-primary);
	background: var(--hat-primary);
	box-shadow: inset 0 0 0 3px var(--hat-white);
}

.hat .hat-quiz-nav {
	display: flex;
	justify-content: space-between;
	gap: 10px;
	margin-top: 20px;
}

.hat .hat-picks {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 300px));
	justify-content: center;
	gap: 18px;
}

.hat .hat-pick {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 22px 18px;
	text-align: center;
	background: var(--hat-white);
	border: 1.5px solid var(--hat-border);
	border-radius: var(--hat-radius-lg);
	position: relative;
}

.hat .hat-pick.is-top {
	border: 2px solid var(--hat-primary);
	box-shadow: var(--hat-shadow);
}

.hat .hat-pick .hat-logo {
	margin: 0 auto;
	width: 100%;
	height: 90px;
}

.hat .hat-pick h4 {
	margin: 0;
	font-size: 1.2rem;
	font-weight: 800;
	color: var(--hat-heading);
}

.hat .hat-pick-reason {
	margin: 0;
	padding: 12px;
	font-size: 0.93rem;
	text-align: right;
	background: var(--hat-surface-2);
	border-radius: 12px;
}

.hat .hat-pick-tags {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 6px;
}

.hat .hat-pick-title {
	display: grid;
	gap: 2px;
	justify-items: center;
}

.hat .hat-pick-review {
	font-size: 0.88rem;
}

.hat .hat-pick-cta {
	margin-top: auto;
}

/* Keep the space above the CTA even when the tag list is short. */
.hat .hat-pick-tags {
	margin-bottom: 6px;
}

.hat .hat-mail-form {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}

.hat .hat-mail-form .hat-input {
	flex: 1 1 240px;
}

.hat .hat-hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* ---------- SSL validity ring ---------- */

.hat .hat-ring {
	--p: 50;
	--c: var(--hat-success);
	flex: none;
	width: 96px;
	height: 96px;
	border-radius: 50%;
	display: grid;
	place-items: center;
	background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--hat-border) 0);
}

.hat .hat-ring > span {
	width: 76px;
	height: 76px;
	border-radius: 50%;
	background: var(--hat-white);
	display: grid;
	place-content: center;
	text-align: center;
	line-height: 1.1;
}

.hat .hat-ring b {
	font-size: 1.35rem;
	color: var(--hat-heading);
}

.hat .hat-ring small {
	font-size: 0.75rem;
}

/* Timing waterfall */
.hat .hat-bars {
	display: grid;
	gap: 10px;
}

.hat .hat-bar {
	display: grid;
	grid-template-columns: 120px 1fr 80px;
	align-items: center;
	gap: 12px;
	font-size: 0.9rem;
}

.hat .hat-bar-track {
	height: 12px;
	border-radius: 999px;
	background: var(--hat-surface);
	overflow: hidden;
	direction: ltr;
}

.hat .hat-bar-fill {
	height: 100%;
	border-radius: 999px;
	background: var(--hat-primary);
	min-width: 3px;
}

.hat .hat-bar-val {
	font-weight: 700;
	color: var(--hat-heading);
	text-align: left;
	direction: ltr;
}

.hat .hat-flip {
	transform: scaleX(-1);
}

.hat .hat-ltr {
	direction: ltr;
	unicode-bidi: isolate;
}

.hat .hat-code {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 0.85em;
	direction: ltr;
	unicode-bidi: isolate;
}

/* Skeleton loading */
.hat .hat-skeleton {
	display: grid;
	gap: 10px;
}

.hat .hat-skeleton span {
	display: block;
	height: 64px;
	border-radius: var(--hat-radius);
	background: linear-gradient(90deg, var(--hat-surface) 25%, #e9eef3 50%, var(--hat-surface) 75%);
	background-size: 200% 100%;
	animation: hat-shimmer 1.2s linear infinite;
}

.hat .hat-skeleton span:nth-child(2) { opacity: 0.8; }
.hat .hat-skeleton span:nth-child(3) { opacity: 0.6; }

.hat .hat-loading-text {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	color: var(--hat-text);
	font-weight: 700;
}

.hat .hat-loading-text::before {
	content: "";
	width: 18px;
	height: 18px;
	border: 2.5px solid var(--hat-border);
	border-top-color: var(--hat-primary);
	border-radius: 50%;
	animation: hat-spin 0.7s linear infinite;
}

/* Admin-only notice when a tool is disabled */
.hat-admin-note {
	padding: 12px 16px;
	border: 1px dashed #c27803;
	border-radius: 10px;
	background: #fdf6e3;
	color: #7a4b00;
	direction: rtl;
}

/* Toast */
.hat-toast {
	position: fixed;
	bottom: 24px;
	left: 50%;
	transform: translate(-50%, 20px);
	z-index: 99999;
	padding: 12px 20px;
	border-radius: 12px;
	background: #192a3d;
	color: #fff;
	font-weight: 700;
	direction: rtl;
	box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.4);
	opacity: 0;
	transition: opacity 0.2s, transform 0.2s;
	pointer-events: none;
}

.hat-toast.is-visible {
	opacity: 1;
	transform: translate(-50%, 0);
}

/* ---------- Animations ---------- */

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

@keyframes hat-fade {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes hat-rise {
	from { opacity: 0; transform: translateY(8px); }
	to { opacity: 1; transform: none; }
}

@keyframes hat-shimmer {
	from { background-position: 200% 0; }
	to { background-position: -200% 0; }
}

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

/* ---------- Mobile ---------- */

@media (max-width: 640px) {
	.hat {
		margin-top: 64px;
		padding: 0;
	}

	.hat .hat-card {
		padding-top: 58px;
		border-radius: 18px;
	}

	.hat .hat-badge {
		width: 80px;
		height: 80px;
		top: -40px;
	}

	.hat .hat-badge .hat-icon {
		width: 36px;
		height: 36px;
	}

	.hat .hat-search {
		flex-direction: column;
	}

	.hat .hat-tabs {
		width: 100%;
		flex-wrap: wrap;
		border-radius: 16px;
	}

	.hat .hat-tab {
		flex: 1 1 auto;
		padding-inline: 14px;
		border-radius: 12px;
		white-space: normal;
	}

	.hat .hat-hero {
		flex-direction: column;
		text-align: center;
		gap: 12px;
		padding: 20px 16px;
	}

	.hat .hat-hero-side {
		width: 100%;
		align-items: stretch;
	}

	.hat .hat-hero-side .hat-ring {
		align-self: center;
	}

	.hat .hat-domain {
		flex-wrap: wrap;
	}

	.hat .hat-domain-actions {
		width: 100%;
	}

	.hat .hat-domain-actions .hat-btn {
		flex: 1;
	}

	.hat .hat-bar {
		grid-template-columns: 90px 1fr 64px;
	}

	.hat .hat-quiz-nav .hat-btn {
		flex: 1;
	}
}

/* Themes (Blocksy) pull <legend> sideways with a negative margin; keep it aligned. */
.hat fieldset > legend {
	float: none;
	width: auto;
	margin: 0 0 6px;
	padding: 0;
}
