/* CAO-TECH client hosting portal. Uses the cao-tech-child design tokens, with fallbacks. */
.cth-app, .cth-signin, .cth-dialog, .cth-toast {
	--cth-navy: var(--ct-navy, #071525);
	--cth-text: var(--ct-text, #0B1728);
	--cth-text-2: var(--ct-text-2, #536273);
	--cth-border: var(--ct-border, #DCE6EF);
	--cth-card: var(--ct-card, #fff);
	--cth-surface: var(--ct-surface, #F2F6FA);
	--cth-tint: var(--ct-tint, #EEF6FD);
	--cth-cta: var(--ct-cta-aa, #0B72B5);
	--cth-cta-hover: var(--ct-cta-aa-hover, #085A90);
	--cth-radius: var(--ct-r-card, 14px);
	--cth-r-ctl: var(--ct-r-control, 10px);
	--cth-shadow: var(--ct-shadow, 0 12px 35px rgba(7, 21, 37, .08));
	--cth-focus: var(--ct-focus, #0B72B5);
	font-family: var(--ct-font, Inter, system-ui, sans-serif);
	color: var(--cth-text);
}
.cth-portal-section { padding-top: 40px; }
.cth-app:focus { outline: none; }
.cth-card { background: var(--cth-card); border: 1px solid var(--cth-border); border-radius: var(--cth-radius); padding: 24px; }
.cth-card h3 { margin: 0 0 14px; font-size: 18px; line-height: 1.3; color: var(--cth-text); }
.cth-h2 { margin: 0 0 4px; font-size: 26px; line-height: 1.2; letter-spacing: -.01em; color: var(--cth-text); }
.cth-muted { color: var(--cth-text-2); }
.cth-small { font-size: 13px; margin: 14px 0 0; }
.cth-right { text-align: right; }

/* Buttons
   Every rule names the element as well as the class (`button.cth-btn`). Hello
   Elementor's reset.css styles `[type="button"], [type="submit"], button` — an
   attribute selector scores the same as a bare class, and the theme loads after
   this file, so `.cth-btn` alone lost the tie: portal buttons rendered in the
   theme's default pink (#c36), inline-block and nowrap. */
.cth-btn, button.cth-btn, a.cth-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 18px; border: 1px solid transparent; border-radius: var(--cth-r-ctl); font: inherit; font-size: 15px; font-weight: 600; line-height: 1.2; white-space: nowrap; text-align: center; text-decoration: none !important; cursor: pointer; transition: background-color .15s, border-color .15s, color .15s; }
.cth-btn--primary, button.cth-btn--primary, a.cth-btn--primary { background: var(--cth-cta); border-color: var(--cth-cta); color: #fff !important; }
.cth-btn--primary:hover, button.cth-btn--primary:hover, a.cth-btn--primary:hover { background: var(--cth-cta-hover); border-color: var(--cth-cta-hover); color: #fff !important; }
.cth-btn--ghost, button.cth-btn--ghost, a.cth-btn--ghost { background: #fff; border-color: var(--cth-border); color: var(--cth-text) !important; }
.cth-btn--ghost:hover, button.cth-btn--ghost:hover, a.cth-btn--ghost:hover { background: var(--cth-tint); border-color: var(--cth-cta); color: var(--cth-cta) !important; }
.cth-btn--danger, button.cth-btn--danger, a.cth-btn--danger { background: #B42318; border-color: #B42318; color: #fff !important; }
.cth-btn--danger:hover, button.cth-btn--danger:hover, a.cth-btn--danger:hover { background: #912018; border-color: #912018; color: #fff !important; }
.cth-btn--sm, button.cth-btn--sm, a.cth-btn--sm { min-height: 36px; padding: 0 12px; font-size: 14px; }
.cth-btn[disabled], button.cth-btn[disabled] { opacity: .6; cursor: progress; }
.cth-btn:focus-visible, .cth-tab:focus-visible, .cth-action:focus-visible, .cth-link:focus-visible, .cth-site__name a:focus-visible { outline: 3px solid var(--cth-focus); outline-offset: 2px; box-shadow: none; }

/* Inline text link inside portal copy (theme styles bare <a> pink). */
.cth-link, a.cth-link { color: var(--cth-cta) !important; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.cth-link:hover, a.cth-link:hover { color: var(--cth-cta-hover) !important; }

/* Badges */
.cth-badge { display: inline-flex; align-items: center; min-height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: .02em; white-space: nowrap; }
.cth-badge--ok { background: #E6F6EE; color: #0C6B3F; }
.cth-badge--live { background: #E7F1FB; color: #0B4F82; }
.cth-badge--info { background: #EEF2FF; color: #3538CD; }
.cth-badge--warn { background: #FFF4E0; color: #8A4B00; }
.cth-badge--bad { background: #FEECEB; color: #B42318; }
.cth-badge--neutral { background: var(--cth-surface); color: var(--cth-text-2); }

/* States */
.cth-loading { display: flex; align-items: center; gap: 12px; color: var(--cth-text-2); }
.cth-spinner { width: 18px; height: 18px; border: 2px solid var(--cth-border); border-top-color: var(--cth-cta); border-radius: 50%; animation: cth-spin .8s linear infinite; }
@keyframes cth-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .cth-spinner { animation: none; } }
.cth-empty { text-align: center; padding: 40px 24px; }
.cth-empty h3 { margin-bottom: 8px; }
.cth-empty p { color: var(--cth-text-2); margin: 0 auto 16px; max-width: 48ch; }
.cth-error { border-color: #F5C2BE; background: #FFF8F7; }
.cth-error p { margin: 0 0 12px; color: #912018; font-weight: 600; }
.cth-signin { max-width: 520px; }
.cth-signin h2 { margin: 0 0 8px; font-size: 22px; }
.cth-signin p { margin: 0 0 18px; }
.cth-signin .cth-muted { margin: 14px 0 0; font-size: 14px; }

/* Toolbar */
.cth-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 0 0 22px; }
.cth-toolbar p { margin: 0; }
.cth-toolbar__actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* Website cards */
.cth-sites { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.cth-site { display: flex; flex-direction: column; transition: box-shadow .2s, transform .2s; }
.cth-site:hover { box-shadow: var(--cth-shadow); transform: translateY(-2px); }
.cth-site__top { display: flex; gap: 8px; margin-bottom: 14px; }
.cth-site__name { margin: 0 0 2px !important; font-size: 20px !important; }
.cth-site__name a { color: inherit; text-decoration: none; }
.cth-site__name a:hover { color: var(--cth-cta); }
.cth-site__domain { margin: 0; color: var(--cth-text-2); font-size: 15px; word-break: break-all; }
.cth-site__meta { margin: 10px 0 18px; font-size: 13px; }
.cth-site__actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: auto; }

/* Website detail */
.cth-back { display: inline-block; margin-bottom: 14px; font-size: 14px; font-weight: 600; color: var(--cth-cta); text-decoration: none; }
.cth-site-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.cth-site-head__badges { display: flex; gap: 8px; }
.cth-tabs { display: flex; gap: 4px; margin: 0 0 22px; border-bottom: 1px solid var(--cth-border); overflow-x: auto; scrollbar-width: thin; }
.cth-tab { padding: 12px 14px; border-bottom: 3px solid transparent; margin-bottom: -1px; font-size: 15px; font-weight: 600; color: var(--cth-text-2); text-decoration: none; white-space: nowrap; }
.cth-tab:hover { color: var(--cth-text); }
.cth-tab.is-active { color: var(--cth-cta); border-bottom-color: var(--cth-cta); }
.cth-grid2 { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); align-items: start; }
.cth-dl { display: grid; grid-template-columns: max-content 1fr; gap: 10px 20px; margin: 0; font-size: 15px; }
.cth-dl dt { color: var(--cth-text-2); }
.cth-dl dd { margin: 0; font-weight: 600; word-break: break-word; }
.cth-actions { display: grid; gap: 10px; }
.cth-action, button.cth-action, a.cth-action { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; width: 100%; padding: 14px 16px; text-align: left; white-space: normal; border: 1px solid var(--cth-border); border-radius: var(--cth-r-ctl); background: #fff; font: inherit; color: var(--cth-text) !important; text-decoration: none; cursor: pointer; transition: border-color .15s, background-color .15s; }
.cth-action:hover, button.cth-action:hover, a.cth-action:hover { border-color: var(--cth-cta); background: var(--cth-tint); color: var(--cth-text) !important; }
.cth-action strong, button.cth-action strong, a.cth-action strong { font-size: 15px; font-weight: 700; line-height: 1.3; }
.cth-action span, button.cth-action span, a.cth-action span { font-size: 13px; font-weight: 400; line-height: 1.45; color: var(--cth-text-2); }

/* Usage */
.cth-stats { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); margin-bottom: 20px; }
.cth-stat span { display: block; font-size: 13px; font-weight: 600; color: var(--cth-text-2); }
.cth-stat strong { display: block; margin: 6px 0 2px; font-size: 28px; line-height: 1.1; letter-spacing: -.02em; }
.cth-stat small { font-size: 12px; }
.cth-bars { display: flex; align-items: flex-end; gap: 3px; height: 160px; padding-top: 8px; }
.cth-bar { flex: 1; min-width: 3px; background: var(--cth-cta); border-radius: 3px 3px 0 0; opacity: .85; }
.cth-bar:hover { opacity: 1; }
.cth-table-wrap { margin-top: 14px; }
.cth-table-wrap summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--cth-cta); }

/* Tables and lists */
.cth-table-card { padding: 0; overflow-x: auto; }
.cth-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.cth-table th, .cth-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--cth-border); vertical-align: middle; }
.cth-table th { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--cth-text-2); background: var(--cth-surface); }
.cth-table tr:last-child td { border-bottom: 0; }
.cth-list { list-style: none; margin: 0; padding: 0; }
.cth-list li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--cth-border); font-size: 15px; }
.cth-list li:last-child { border-bottom: 0; }
.cth-list li > span:first-child { font-weight: 600; word-break: break-all; }

/* Dialog + toast */
.cth-dialog { width: min(520px, calc(100vw - 24px)); padding: 0; border: 0; border-radius: var(--cth-radius); box-shadow: 0 30px 80px rgba(4, 16, 29, .35); }
.cth-dialog::backdrop { background: rgba(4, 16, 29, .6); }
.cth-dialog form { padding: 26px; }
.cth-dialog h2 { margin: 0 0 10px; font-size: 20px; }
.cth-dialog__body { margin: 0 0 16px; color: var(--cth-text-2); line-height: 1.55; }
.cth-dialog__actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.cth-field { display: block; margin: 0 0 12px; }
.cth-field span { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; }
.cth-field input, .cth-field textarea { width: 100%; box-sizing: border-box; min-height: 44px; padding: 10px 12px; border: 1px solid var(--ct-control-border, #7A8897); border-radius: var(--cth-r-ctl); font: inherit; font-size: 15px; }
.cth-field input:focus-visible, .cth-field textarea:focus-visible { border-color: var(--cth-cta); outline: 3px solid var(--cth-focus); outline-offset: 1px; box-shadow: none; }
.cth-check { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 12px; font-size: 14px; }
.cth-check input { width: 18px; height: 18px; margin-top: 1px; accent-color: var(--cth-cta); }
.cth-toast { position: fixed; left: 50%; bottom: 24px; z-index: 100000; transform: translateX(-50%); max-width: calc(100vw - 32px); padding: 14px 20px; border-radius: var(--cth-r-ctl); background: var(--cth-navy); color: #fff; font-weight: 600; box-shadow: var(--cth-shadow); transition: opacity .4s; }
.cth-toast--bad { background: #912018; }
.cth-toast.is-out { opacity: 0; }

@media (max-width: 600px) {
	.cth-card { padding: 18px; }
	.cth-toolbar__actions { width: 100%; }
	.cth-toolbar__actions .cth-btn { flex: 1; }
	.cth-dl { grid-template-columns: 1fr; gap: 2px; }
	.cth-dl dd { margin-bottom: 10px; }
	.cth-table th, .cth-table td { padding: 10px 12px; font-size: 14px; }
}
.cth-updated { margin: -6px 0 12px; font-size: 12px; color: var(--cth-text-2); }

/* Portal-wide navigation (Websites · Support · Billing). */
.cth-portal-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 0 0 28px; padding: 6px; border: 1px solid var(--cth-border); border-radius: 999px; background: var(--cth-surface); width: fit-content; max-width: 100%; }
.cth-portal-nav__item { padding: 9px 18px; border-radius: 999px; font-size: 15px; font-weight: 600; color: var(--cth-text-2); text-decoration: none; }
.cth-portal-nav__item:hover { color: var(--cth-text); background: #fff; }
.cth-portal-nav__item.is-active { background: #fff; color: var(--cth-cta); box-shadow: 0 1px 3px rgba(7, 21, 37, .1); }
.cth-portal-nav__signout { padding: 9px 14px; font-size: 14px; color: var(--cth-text-2); text-decoration: none; }
.cth-portal-nav__signout:hover { color: var(--cth-cta); }
.cth-portal-nav a:focus-visible { outline: 3px solid var(--cth-focus); outline-offset: 2px; }
@media (max-width: 600px) { .cth-portal-nav { width: 100%; border-radius: var(--cth-r-ctl); } .cth-portal-nav__item { flex: 1; text-align: center; padding: 9px 10px; } .cth-portal-nav__signout { width: 100%; text-align: center; } }
#cth-portal, #cth-portal:focus, #cth-portal:focus-visible { outline: none !important; box-shadow: none !important; }
/* Screen-reader-only live region (action results, see announce() in portal.js). */
.cth-sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
/* The view heading takes focus after in-app navigation so the new view is announced;
   it is not keyboard-reachable, so it should not draw a ring. */
.cth-h2[tabindex="-1"]:focus, .cth-h2[tabindex="-1"]:focus-visible { outline: none; }

/* Setup progress (new hosting) */
.cth-setups { display: grid; gap: 16px; margin-bottom: 24px; }
.cth-setup h3 { overflow-wrap: anywhere; }
.cth-steps { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; padding: 0; list-style: none; counter-reset: cth-step; }
.cth-steps li { counter-increment: cth-step; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 999px; background: var(--cth-surface); color: var(--cth-text-2); font-size: 13px; font-weight: 600; }
.cth-steps li::before { content: counter(cth-step); display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 1px solid var(--cth-border); font-size: 12px; }
.cth-steps li.is-done { background: #E6F6EE; color: #0C6B3F; }
.cth-steps li.is-done::before { content: "✓"; border-color: #0C6B3F; }
.cth-steps li.is-current { background: var(--cth-tint); color: var(--cth-cta); }
.cth-steps li.is-current::before { border-color: var(--cth-cta); }

/* Domains & SSL */
.cth-connect { display: grid; gap: 16px; margin-bottom: 24px; }
.cth-domain__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 8px; }
.cth-domain__head h3 { margin: 0; overflow-wrap: anywhere; }
.cth-records td { vertical-align: middle; }
.cth-records code, .cth-changes code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; overflow-wrap: anywhere; word-break: break-all; }
.cth-notes { margin: 12px 0 0; padding-left: 18px; color: var(--cth-text-2); font-size: 14px; }
.cth-changes { margin: 0 0 14px; padding-left: 18px; font-size: 14px; }
.cth-changes li { margin: 4px 0; }
.cth-cf { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--cth-border); }
.cth-cf h4 { margin: 0 0 6px; font-size: 15px; }
.cth-inline { display: flex; flex-wrap: wrap; gap: 10px; }
.cth-inline input { flex: 1 1 220px; min-height: 44px; padding: 0 12px; border: 1px solid var(--ct-control-border, #7A8897); border-radius: var(--cth-r-ctl); font: inherit; }
.cth-inline input:focus-visible { outline: 2px solid var(--cth-focus); outline-offset: 1px; }
.cth-error-text { margin: 10px 0 0; color: #B42318; font-size: 14px; }
