/* ===== Domain Tools – bảng màu dùng chung (tối mặc định) ===== */
.wdh-app {
	--dt-accent: #1fb6ff;
	--dt-accent-2: color-mix(in srgb, var(--dt-accent) 70%, #000);
	--dt-accent-soft: color-mix(in srgb, var(--dt-accent) 14%, transparent);
	--dt-accent-line: color-mix(in srgb, var(--dt-accent) 45%, transparent);
	--dt-on-accent: #ffffff;
	--dt-card: #14171c;
	--dt-card-2: #1b1f26;
	--dt-input: #0d0f13;
	--dt-border: #262b33;
	--dt-border-2: #353b45;
	--dt-text: #e9edf2;
	--dt-muted: #9aa4b2;
	--dt-faint: #6b7480;
	--dt-ok: #22c55e;
	--dt-ok-soft: rgba(34, 197, 94, .14);
	--dt-warn: #f59e0b;
	--dt-warn-soft: rgba(245, 158, 11, .14);
	--dt-bad: #f43f5e;
	--dt-bad-soft: rgba(244, 63, 94, .14);
	--dt-shadow: 0 18px 50px rgba(0, 0, 0, .45);
	--dt-radius: 16px;
	color-scheme: dark;
	color: var(--dt-text);
	font-size: 15px;
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;
}
.wdh-app[data-dt-theme="light"] {
	--dt-card: #ffffff;
	--dt-card-2: #f6f8fb;
	--dt-input: #f8fafc;
	--dt-border: #e3e8ef;
	--dt-border-2: #cfd7e2;
	--dt-text: #0f172a;
	--dt-muted: #5b6678;
	--dt-faint: #94a0b2;
	--dt-ok-soft: #e8f8ee;
	--dt-warn-soft: #fff6e5;
	--dt-bad-soft: #fdecef;
	--dt-shadow: 0 10px 30px rgba(15, 23, 42, .08);
	color-scheme: light;
}
@media (prefers-color-scheme: light) {
	.wdh-app[data-dt-theme="auto"] {
		--dt-card: #ffffff;
		--dt-card-2: #f6f8fb;
		--dt-input: #f8fafc;
		--dt-border: #e3e8ef;
		--dt-border-2: #cfd7e2;
		--dt-text: #0f172a;
		--dt-muted: #5b6678;
		--dt-faint: #94a0b2;
		--dt-ok-soft: #e8f8ee;
		--dt-warn-soft: #fff6e5;
		--dt-bad-soft: #fdecef;
		--dt-shadow: 0 10px 30px rgba(15, 23, 42, .08);
		color-scheme: light;
	}
}
/* Chống theme ghi đè */
.wdh-app { box-sizing: border-box; }
.wdh-app *, .wdh-app *::before, .wdh-app *::after { box-sizing: border-box; }
.wdh-app :is(h1,h2,h3,h4,h5,h6) { color: var(--dt-text) !important; font-family: inherit; text-transform: none !important; letter-spacing: normal !important; line-height: 1.3; margin: 0; padding: 0; border: 0; background: none; }
.wdh-app :is(button,input,select,textarea) { font-family: inherit !important; text-transform: none !important; letter-spacing: normal !important; text-shadow: none; min-height: 0; margin: 0; }
.dt-ico { display: inline-block; vertical-align: -3px; flex: 0 0 auto; }
.wdh-app :is(textarea,pre,code) { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace !important; }

/* ===== Wayback Domain History ===== */
.wdh-app { max-width: 1040px; margin: 0 auto; }

.wdh-app .wdh-card {
	position: relative; overflow: hidden;
	background: var(--dt-card); border: 1px solid var(--dt-border); border-radius: var(--dt-radius);
	padding: 26px 28px; margin: 0 0 22px; box-shadow: var(--dt-shadow);
}
.wdh-app .wdh-card::before {
	content: ""; position: absolute; inset: 0 0 auto 0; height: 2px;
	background: linear-gradient(90deg, transparent, var(--dt-accent), transparent); opacity: .9;
}
.wdh-app .wdh-hero { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 18px; }
.wdh-app .wdh-icon {
	flex: 0 0 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
	color: var(--dt-accent); background: var(--dt-accent-soft); border: 1px solid var(--dt-accent-line);
}
.wdh-app .wdh-icon .dt-ico { width: 22px; height: 22px; }
.wdh-app .wdh-title { font-size: 22px; font-weight: 700; }
.wdh-app .wdh-sub { margin: 4px 0 0; color: var(--dt-muted); font-size: 14.5px; }
.wdh-app .wdh-muted { color: var(--dt-muted); font-weight: 500; }
.wdh-app p { margin: 8px 0 0; }

.wdh-app .wdh-input-wrap { position: relative; }
.wdh-app textarea {
	display: block; width: 100%; min-height: 170px; margin: 0; padding: 14px 16px 34px;
	border: 1px solid var(--dt-border-2); border-radius: 12px; background: var(--dt-input); color: var(--dt-text);
	font-size: 14px; line-height: 1.7; resize: vertical; box-shadow: none; transition: border-color .15s, box-shadow .15s;
}
.wdh-app textarea::placeholder { color: var(--dt-faint); opacity: 1; }
.wdh-app textarea:focus { outline: none; border-color: var(--dt-accent); box-shadow: 0 0 0 4px var(--dt-accent-soft); }
.wdh-app .wdh-input-meta { position: absolute; left: 14px; right: 14px; bottom: 8px; display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; color: var(--dt-muted); pointer-events: none; }
.wdh-app .wdh-input-meta b { color: var(--dt-accent); }
.wdh-app .wdh-link { pointer-events: auto; padding: 2px 6px; border: 0; border-radius: 6px; background: none; color: var(--dt-muted); font-size: 12.5px; cursor: pointer; }
.wdh-app .wdh-link:hover { color: var(--dt-text); background: var(--dt-card-2); }

.wdh-app .wdh-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 16px; }
.wdh-app .wdh-btn {
	display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px;
	border: 1px solid var(--dt-border-2); border-radius: 10px; background: var(--dt-card-2); color: var(--dt-text);
	font-size: 14.5px; font-weight: 600; line-height: 1.2; cursor: pointer;
	transition: transform .12s, box-shadow .15s, background .15s, border-color .15s, opacity .15s;
}
.wdh-app .wdh-btn:hover:not(:disabled) { border-color: var(--dt-accent-line); background: var(--dt-accent-soft); }
.wdh-app .wdh-btn:active:not(:disabled) { transform: translateY(1px); }
.wdh-app .wdh-btn:disabled { opacity: .45; cursor: not-allowed; }
.wdh-app .wdh-btn-primary { border-color: transparent; color: var(--dt-on-accent); background: linear-gradient(135deg, var(--dt-accent), var(--dt-accent-2)); box-shadow: 0 6px 20px color-mix(in srgb, var(--dt-accent) 35%, transparent); }
.wdh-app .wdh-btn-primary:hover:not(:disabled) { background: linear-gradient(135deg, var(--dt-accent), var(--dt-accent-2)); filter: brightness(1.08); }
.wdh-app .wdh-btn-sm { padding: 8px 12px; font-size: 13px; border-radius: 8px; }
.wdh-app select { padding: 8px 32px 8px 12px; border: 1px solid var(--dt-border-2); border-radius: 8px; background-color: var(--dt-card-2); color: var(--dt-text); font-size: 13.5px; height: auto; line-height: 1.3; }

.wdh-app .wdh-switch { display: inline-flex; align-items: center; gap: 9px; margin-left: 6px; color: var(--dt-muted); font-size: 14px; cursor: pointer; user-select: none; }
.wdh-app .wdh-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.wdh-app .wdh-switch-ui { position: relative; width: 36px; height: 20px; border-radius: 99px; background: var(--dt-border-2); transition: background .15s; }
.wdh-app .wdh-switch-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .15s; }
.wdh-app .wdh-switch input:checked + .wdh-switch-ui { background: var(--dt-accent); }
.wdh-app .wdh-switch input:checked + .wdh-switch-ui::after { transform: translateX(16px); }

.wdh-app #wdh-progress { margin-top: 20px; }
.wdh-app .wdh-progress-top { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; font-size: 13.5px; }
.wdh-app .wdh-status { margin: 0; color: var(--dt-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wdh-app .wdh-pct { color: var(--dt-accent); font-weight: 700; font-variant-numeric: tabular-nums; }
.wdh-app .wdh-bar { height: 8px; background: var(--dt-card-2); border: 1px solid var(--dt-border); border-radius: 99px; overflow: hidden; }
.wdh-app .wdh-bar span { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--dt-accent-2), var(--dt-accent)); box-shadow: 0 0 12px var(--dt-accent); transition: width .35s ease; }
.wdh-app .wdh-notice { padding: 12px 14px; border-radius: 10px; background: var(--dt-accent-soft); border: 1px solid var(--dt-accent-line); }
.wdh-app .wdh-notice a { color: var(--dt-accent); font-weight: 600; }

.wdh-app .wdh-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.wdh-app .wdh-head h3 { font-size: 17px; font-weight: 700; }
.wdh-app .wdh-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Thẻ domain */
.wdh-app .wdh-item { border: 1px solid var(--dt-border); border-radius: 14px; padding: 18px 20px; margin-bottom: 14px; background: var(--dt-card-2); transition: border-color .15s; }
.wdh-app .wdh-item:hover { border-color: var(--dt-border-2); }
.wdh-app .wdh-item-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.wdh-app .wdh-domain { font-size: 17px; font-weight: 700; margin-right: 4px; word-break: break-all; color: var(--dt-text); }
.wdh-app .wdh-badge { display: inline-block; padding: 3px 10px; border-radius: 99px; background: var(--dt-card); border: 1px solid var(--dt-border); color: var(--dt-muted); font-size: 12px; font-weight: 600; }
.wdh-app .wdh-badge-ok { background: var(--dt-accent-soft); border-color: var(--dt-accent-line); color: var(--dt-accent); }
.wdh-app .wdh-badge-err { background: var(--dt-bad-soft); border-color: transparent; color: var(--dt-bad); }
.wdh-app .wdh-badge-light { background: transparent; border-style: dashed; color: var(--dt-faint); }
.wdh-app .wdh-cal { margin-left: auto; font-size: 13.5px; color: var(--dt-accent); text-decoration: none; font-weight: 600; }
.wdh-app .wdh-cal:hover { text-decoration: underline; }

.wdh-app .wdh-facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 14px; }
.wdh-app .wdh-fact { background: var(--dt-card); border: 1px solid var(--dt-border); border-radius: 10px; padding: 10px 12px; }
.wdh-app .wdh-fact-label { display: block; font-size: 11.5px; color: var(--dt-faint); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.wdh-app .wdh-fact-value { margin-top: 2px; font-size: 14px; font-weight: 600; color: var(--dt-text); }
.wdh-app .wdh-fact-value a { color: var(--dt-accent); text-decoration: none; }
.wdh-app .wdh-fact-value a:hover { text-decoration: underline; }

.wdh-app .wdh-section-label { margin-top: 16px; margin-bottom: 8px; font-size: 11.5px; color: var(--dt-faint); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.wdh-app .wdh-timeline { display: flex; align-items: flex-end; gap: 4px; overflow-x: auto; padding: 10px 10px 6px; background: var(--dt-card); border: 1px solid var(--dt-border); border-radius: 10px; }
.wdh-app .wdh-tl-col { flex: 1 0 22px; max-width: 42px; display: flex; flex-direction: column; align-items: stretch; }
.wdh-app .wdh-tl-barbox { height: 58px; display: flex; align-items: flex-end; }
.wdh-app .wdh-tl-bar { width: 100%; border-radius: 4px 4px 1px 1px; background: linear-gradient(180deg, var(--dt-accent), var(--dt-accent-2)); box-shadow: 0 0 10px color-mix(in srgb, var(--dt-accent) 35%, transparent); }
.wdh-app .wdh-tl-zero { background: var(--dt-border-2); box-shadow: none; }
.wdh-app .wdh-tl-year { text-align: center; font-size: 11px; color: var(--dt-faint); margin-top: 4px; font-variant-numeric: tabular-nums; }

.wdh-app .wdh-titles { display: grid; gap: 6px; }
.wdh-app .wdh-title-row { display: flex; gap: 12px; align-items: baseline; font-size: 14px; padding: 8px 12px; background: var(--dt-card); border: 1px solid var(--dt-border); border-radius: 8px; }
.wdh-app .wdh-title-date { flex: 0 0 auto; font-size: 12.5px; color: var(--dt-faint); font-variant-numeric: tabular-nums; }
.wdh-app .wdh-title-text { word-break: break-word; color: var(--dt-text); }
.wdh-app .wdh-title-text.wdh-muted { color: var(--dt-faint); }

@media (max-width: 720px) {
	.wdh-app .wdh-card { padding: 18px; }
	.wdh-app .wdh-facts { grid-template-columns: repeat(2, 1fr); }
	.wdh-app .wdh-cal { margin-left: 0; }
	.wdh-app .wdh-title { font-size: 19px; }
}
