/*
 * SkyLink Helpdesk — front end.
 * Inherits the theme's font. Re-brand by overriding the custom properties, e.g.
 *   .slhd { --slhd-accent: #0f766e; }
 */
.slhd {
	--slhd-accent: #2563eb;
	--slhd-accent-ink: #ffffff;
	--slhd-ink: #0f172a;
	--slhd-ink-2: #475569;
	--slhd-muted: #64748b;
	--slhd-line: #e2e8f0;
	--slhd-surface: #ffffff;
	--slhd-surface-2: #f8fafc;
	--slhd-danger: #dc2626;
	--slhd-success: #059669;
	--slhd-radius: 12px;
	color: var(--slhd-ink);
	font: inherit;
	line-height: 1.55;
}
.slhd *, .slhd *::before, .slhd *::after { box-sizing: border-box; }
.slhd h3 { margin: 0 0 6px; font-size: 1.25rem; }
.slhd-hint { color: var(--slhd-muted); font-size: .875rem; margin: 6px 0 0; }
.slhd-label { display: block; font-weight: 600; font-size: .925rem; margin: 0 0 6px; color: var(--slhd-ink); }
.slhd-ref { color: var(--slhd-muted); font-weight: 600; font-variant-numeric: tabular-nums; }

/* Fields */
.slhd-form { display: grid; gap: 18px; }
.slhd-row { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.slhd-field { position: relative; min-width: 0; }
.slhd-input {
	display: block; width: 100%; padding: 11px 14px; font: inherit; font-size: .95rem;
	color: var(--slhd-ink); background: var(--slhd-surface); border: 1px solid var(--slhd-line);
	border-radius: 10px; transition: border-color .15s, box-shadow .15s;
}
.slhd-input:focus { outline: none; border-color: var(--slhd-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--slhd-accent) 18%, transparent); }
textarea.slhd-input { resize: vertical; min-height: 120px; }
input[type="file"].slhd-input { padding: 8px; font-size: .875rem; }
.slhd-field.has-error .slhd-input { border-color: var(--slhd-danger); }
.slhd-field__error { color: var(--slhd-danger); font-size: .85rem; margin: 6px 0 0; }
.slhd-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* Type chooser */
.slhd-types { border: 0; padding: 0; margin: 0; }
.slhd-types__options { display: flex; flex-wrap: wrap; gap: 10px; }
.slhd-type { position: relative; cursor: pointer; }
.slhd-type input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.slhd-type span {
	display: inline-block; padding: 9px 16px; border: 1px solid var(--slhd-line); border-radius: 999px;
	font-weight: 600; font-size: .9rem; color: var(--slhd-ink-2); background: var(--slhd-surface); transition: all .15s;
}
.slhd-type input:checked + span { border-color: var(--slhd-accent); color: var(--slhd-accent); background: color-mix(in srgb, var(--slhd-accent) 8%, var(--slhd-surface)); }
.slhd-type input:focus-visible + span { box-shadow: 0 0 0 3px color-mix(in srgb, var(--slhd-accent) 25%, transparent); }

/* Buttons */
.slhd-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 20px;
	font: inherit; font-weight: 600; font-size: .95rem; line-height: 1.2; text-decoration: none; cursor: pointer;
	border: 1px solid var(--slhd-line); border-radius: 10px; background: var(--slhd-surface); color: var(--slhd-ink);
	transition: transform .1s, background .15s, border-color .15s;
}
.slhd-btn:hover { border-color: var(--slhd-accent); color: var(--slhd-accent); }
.slhd-btn:active { transform: translateY(1px); }
.slhd-btn--primary { background: var(--slhd-accent); border-color: var(--slhd-accent); color: var(--slhd-accent-ink); }
.slhd-btn--primary:hover { color: var(--slhd-accent-ink); filter: brightness(1.08); }
.slhd-btn--ghost { background: transparent; }
.slhd-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; justify-content: space-between; }
.slhd-meta-links { font-size: .9rem; color: var(--slhd-muted); margin: 0; }
.slhd-meta-links a { color: var(--slhd-accent); }

/* Notices & boxes */
.slhd-notice { padding: 12px 16px; border-radius: 10px; margin: 0 0 18px; font-size: .95rem; border: 1px solid; }
.slhd-notice--success { background: color-mix(in srgb, var(--slhd-success) 8%, #fff); border-color: color-mix(in srgb, var(--slhd-success) 35%, #fff); color: #065f46; }
.slhd-notice--error { background: color-mix(in srgb, var(--slhd-danger) 7%, #fff); border-color: color-mix(in srgb, var(--slhd-danger) 35%, #fff); color: #991b1b; }
.slhd-card-box { background: var(--slhd-surface); border: 1px solid var(--slhd-line); border-radius: var(--slhd-radius); padding: 22px; margin: 0 0 18px; }
.slhd-inline-form { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0; }
.slhd-inline-form .slhd-input { flex: 1 1 240px; width: auto; }

/* Suggestions */
.slhd-suggest {
	margin-top: 10px; padding: 14px 16px; border: 1px dashed color-mix(in srgb, var(--slhd-accent) 45%, var(--slhd-line));
	background: color-mix(in srgb, var(--slhd-accent) 5%, var(--slhd-surface)); border-radius: 10px;
}
.slhd-suggest p { margin: 0 0 8px; font-weight: 600; font-size: .9rem; }
.slhd-suggest ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.slhd-suggest a { color: var(--slhd-accent); font-weight: 600; text-decoration: none; }
.slhd-suggest a:hover { text-decoration: underline; }
.slhd-suggest span { display: block; color: var(--slhd-muted); font-size: .85rem; }

/* Portal */
.slhd-portal__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.slhd-tickets { list-style: none; margin: 0; padding: 0; border: 1px solid var(--slhd-line); border-radius: var(--slhd-radius); overflow: hidden; background: var(--slhd-surface); }
.slhd-tickets__item { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 18px; border-top: 1px solid var(--slhd-line); }
.slhd-tickets__item:first-child { border-top: 0; }
.slhd-tickets__item a { flex: 1; min-width: 0; text-decoration: none; color: inherit; }
.slhd-tickets__subject { display: block; font-weight: 600; color: var(--slhd-ink); overflow-wrap: anywhere; }
.slhd-tickets__meta { display: block; font-size: .85rem; color: var(--slhd-muted); }
.slhd-badge, .slhd-pill {
	display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; white-space: nowrap;
	color: var(--c, var(--slhd-ink-2)); background: color-mix(in srgb, var(--c, var(--slhd-ink-2)) 12%, #fff);
}
.slhd-pagination { display: flex; gap: 6px; margin-top: 14px; }
.slhd-pagination a { padding: 6px 12px; border: 1px solid var(--slhd-line); border-radius: 8px; text-decoration: none; color: var(--slhd-ink); }
.slhd-pagination a.is-current { background: var(--slhd-accent); border-color: var(--slhd-accent); color: var(--slhd-accent-ink); }
.slhd-back { color: var(--slhd-muted); text-decoration: none; font-size: .9rem; }
.slhd-ticket-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.slhd-ticket-head h3 { margin: 0; overflow-wrap: anywhere; }

/* Thread */
.slhd-thread { display: grid; gap: 14px; margin: 18px 0; }
.slhd-msg { border: 1px solid var(--slhd-line); border-radius: var(--slhd-radius); background: var(--slhd-surface); padding: 16px 18px; }
.slhd-msg--agent { background: color-mix(in srgb, var(--slhd-accent) 4%, var(--slhd-surface)); border-color: color-mix(in srgb, var(--slhd-accent) 22%, var(--slhd-line)); }
.slhd-msg__head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; font-size: .9rem; }
.slhd-msg__head img { border-radius: 50%; }
.slhd-msg__head time { margin-left: auto; color: var(--slhd-muted); font-size: .82rem; }
.slhd-msg__content { overflow-wrap: anywhere; color: var(--slhd-ink-2); }
.slhd-msg__content p { margin: 0 0 .8em; }
.slhd-msg__content p:last-child { margin-bottom: 0; }
.slhd-msg__content pre, .slhd-msg__content code { white-space: pre-wrap; background: var(--slhd-surface-2); border-radius: 6px; padding: 2px 6px; }
.slhd-files { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.slhd-files a { display: inline-block; padding: 5px 10px; border: 1px solid var(--slhd-line); border-radius: 8px; font-size: .85rem; text-decoration: none; color: var(--slhd-ink); background: var(--slhd-surface-2); }
.slhd-reply-box { background: var(--slhd-surface-2); border: 1px solid var(--slhd-line); border-radius: var(--slhd-radius); padding: 18px; gap: 12px; }
.slhd-close { margin-top: 12px; text-align: right; }

/* Rating */
.slhd-rating { display: grid; gap: 10px; }
.slhd-stars { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: 4px; }
.slhd-stars input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.slhd-stars label { font-size: 2rem; line-height: 1; color: #cbd5e1; cursor: pointer; transition: color .1s, transform .1s; }
.slhd-stars label:hover, .slhd-stars label:hover ~ label, .slhd-stars input:checked ~ label { color: #f59e0b; }
.slhd-stars input:focus-visible + label { transform: scale(1.15); }

/* Knowledge base */
.slhd-kb__search { position: relative; display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 28px; }
.slhd-kb__input { flex: 1 1 260px; width: auto; font-size: 1.05rem; padding: 14px 16px; }
.slhd-kb__results { flex-basis: 100%; margin-top: 0; }
.slhd-kb__grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.slhd-kb__cat { background: var(--slhd-surface); border: 1px solid var(--slhd-line); border-radius: var(--slhd-radius); padding: 20px; }
.slhd-kb__cat h3 a { color: var(--slhd-ink); text-decoration: none; }
.slhd-kb__cat ul { margin: 12px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.slhd-kb__cat li a { color: var(--slhd-ink-2); text-decoration: none; }
.slhd-kb__cat li a:hover { color: var(--slhd-accent); }
.slhd-kb__cta {
	display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-top: 28px;
	padding: 20px 22px; border-radius: var(--slhd-radius); background: var(--slhd-surface-2); border: 1px solid var(--slhd-line);
}
.slhd-kb__cta strong { display: block; }
.slhd-kb__cta span { color: var(--slhd-muted); font-size: .92rem; }
.slhd-article-footer { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--slhd-line); }
.slhd-helpful { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.slhd-helpful .slhd-btn { padding: 7px 14px; font-size: .88rem; }
.slhd-helpful__thanks { color: var(--slhd-success); font-weight: 600; }

@media (max-width: 480px) {
	.slhd-actions { flex-direction: column; align-items: stretch; }
	.slhd-actions .slhd-btn { width: 100%; }
	.slhd-tickets__item { flex-direction: column; align-items: flex-start; }
}

/* Store pages: receipt / order help box, checkout pre-sales note */
.slhd-store-help { margin: 24px 0; padding: 18px 20px; border: 1px solid var(--slhd-line); border-radius: var(--slhd-radius); background: var(--slhd-surface-2); }
.slhd-store-help__title { margin: 0 0 10px; color: var(--slhd-ink-2); }
.slhd-store-help__title strong { color: var(--slhd-ink); }
.slhd-store-help__list { margin: 0 0 12px; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.slhd-store-help__list a, .slhd-presales a { color: var(--slhd-accent); font-weight: 600; text-decoration: none; }
.slhd-store-help__list a:hover, .slhd-presales a:hover { text-decoration: underline; }
.slhd-store-help__actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; }
.slhd-presales { margin: 0 0 18px; font-size: .95rem; color: var(--slhd-muted); }
.slhd-history-help a { font-weight: 600; }
