/* Shared public controls. Reading content and editorial hero keep their hierarchy. */
.trace-ai-web [hidden]{display:none!important}
body.tk-premium{font-size:15px;padding-bottom:0}
body.tk-premium input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=file]),body.tk-premium select{min-height:44px;padding:10px 12px;border-radius:10px;font-size:15px;line-height:1.35}
body.tk-premium form textarea{min-height:104px;padding:11px 12px;font-size:15px;line-height:1.5}
body.tk-premium .trace-input-wrap input{padding-left:42px}
body.tk-premium .trace-ai-web>[data-form] textarea{min-height:44px;height:44px;max-height:120px;padding:10px 12px;font-size:16px;line-height:1.35;overflow-y:auto}
.tk-mainnav{min-width:0;overflow-x:auto;scrollbar-width:none}
.tk-premium :where(input,select,textarea,button){font:inherit}
.tk-premium :where(input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=file]),select){min-height:44px;height:auto;padding:10px 12px;border-radius:10px;line-height:1.35;max-width:100%;box-sizing:border-box}
.tk-premium :where(textarea){min-height:100px;padding:11px 12px;border-radius:10px;line-height:1.5;resize:vertical;max-width:100%;box-sizing:border-box}
.tk-premium :where(input,select,textarea):focus-visible{outline:2px solid var(--brand,#d7193f);outline-offset:2px}
.tk-premium :where(form label,.trace-label){font-size:13px;line-height:1.45}
.tk-premium :where(button,.button,.btn,.trace-submit){border-radius:10px;min-height:40px;font-size:14px;line-height:1.35}
.tk-premium :where(.trace-input-wrap input,.trace-input-wrap select){padding-left:42px}
.tk-premium .trace-input-wrap:has(.trace-field-icon){min-height:44px}
.tk-premium :where(.trace-field-svg,.trace-ui-icon,.ui-icon,.trace-upload-icon){width:20px;height:20px;flex-shrink:0;fill:none;stroke:currentColor;stroke-width:1.7}
.tk-premium :where(.trace-auth-card,.tk-contact-card,.trace-connect-card){border-radius:18px;padding:clamp(16px,2vw,24px);box-shadow:0 6px 24px #00000008}
.tk-premium :where(.trace-premium-form,.tk-contact-fields,.form-grid){gap:14px}
.tk-premium :where(.trace-auth-card h1,.trace-auth-card h2,.trace-connect-content h1){font-size:clamp(23px,3vw,30px);line-height:1.2;margin-block:0 12px}
.tk-premium .tk-contact-hero-inner{min-height:270px;padding-block:30px 66px;gap:18px}
.tk-premium .tk-contact-hero-copy h1{font-size:clamp(30px,4vw,52px);line-height:1.08}
.tk-premium .tk-contact-hero-copy p{font-size:16px;line-height:1.55}
.tk-premium .tk-contact-card-head h2,.tk-premium .tk-contact-editorial h2{font-size:24px}
.tk-premium .tk-contact-hero-art svg{max-width:220px}
.tk-premium .tk-contact-info-card{padding:16px;border-radius:16px;min-height:90px}
.tk-premium .tk-contact-info-card strong{font-size:14px;overflow-wrap:anywhere}
.tk-premium .trace-upload-drop{min-height:86px;padding:14px;gap:12px;border-radius:12px}
.tk-premium .trace-upload-preview{width:48px;height:48px;flex:0 0 48px;display:grid;place-items:center}
.tk-premium .trace-upload-preview svg{width:26px;height:26px}
.tk-premium .trace-upload-preview img{width:100%;height:100%;object-fit:cover;border-radius:9px}
.tk-premium .trace-upload-copy strong{font-size:14px}.tk-premium .trace-upload-copy em{font-size:12px;font-style:normal}
.trace-service-nav{display:none!important}.trace-ai-nav-link{display:none!important}
.trace-ai-launcher{position:fixed;right:max(18px,env(safe-area-inset-right));bottom:calc(var(--trace-tools-bottom,18px) + 58px);display:grid;place-items:center;width:48px;height:48px;border-radius:16px;background:var(--panel,#fff);border:1px solid var(--line,#ddd);box-shadow:0 4px 18px #0002;z-index:85}
.trace-ai-launcher:hover{transform:translateY(-2px)}.trace-ai-launcher img{width:34px;height:34px}
.trace-alert-launcher{bottom:var(--trace-tools-bottom,18px);width:48px;height:48px;min-height:48px;padding:0;justify-content:center;border-radius:16px;font-size:0}
.trace-alert-launcher span{border:0;width:25px;height:25px;font-size:20px}.trace-alert-launcher span svg{width:24px;height:24px}
.trace-ai-panel{inset:auto 18px calc(var(--trace-tools-bottom,18px) + 58px) auto;width:min(420px,calc(100vw - 36px));height:min(620px,calc(var(--trace-viewport-height,100dvh) - 100px));border-radius:18px;overflow:hidden}
.trace-ai-panel[open]{display:flex}.trace-ai-panel:not([open]){display:none}
.trace-ai-panel.is-expanded{inset:18px;margin:auto;width:min(960px,calc(100vw - 36px));height:calc(var(--trace-viewport-height,100dvh) - 36px)}
.trace-ai-panel-bar{padding:10px 12px;gap:8px;min-height:50px;border-bottom:1px solid var(--line,#ddd)}
.trace-ai-panel-bar h2{flex:1;font-size:16px}.trace-ai-panel-bar button{width:34px;height:34px;min-height:34px;padding:5px;border:0;background:transparent;color:inherit}
.trace-ai-web{border-radius:16px;min-height:0}.trace-ai-head{padding:10px 12px;gap:8px}.trace-ai-head strong{font-size:14px}.trace-ai-head small{font-size:12px}
.trace-ai-panel .trace-ai-head>div:first-child>strong{display:none}
.trace-ai-actions{gap:5px;flex-wrap:wrap}.trace-ai-actions button{font-size:12px;padding:6px 8px;min-height:32px}
.trace-ai-messages{display:flex;flex-direction:column;padding:14px;gap:12px;min-height:0;overscroll-behavior:contain}.trace-ai-bubble{max-width:90%;padding:10px 12px;border-radius:14px;font-size:14px;line-height:1.55;white-space:pre-wrap;overflow-wrap:anywhere}
.trace-ai-bubble.user{align-self:flex-end;background:var(--brand,#d7193f);color:#fff}.trace-ai-bubble.assistant,.trace-ai-bubble.admin{align-self:flex-start;background:var(--soft,#f1f3f6);color:var(--text,#171717)}
.trace-ai-empty{font-size:14px;max-width:30ch;margin:auto;color:var(--muted,#687080);text-align:center;line-height:1.6}
.trace-ai-suggestions{padding:8px 12px;gap:6px;flex-wrap:wrap;max-height:86px;overflow:auto}.trace-ai-suggestions button{min-height:30px;padding:5px 9px;font-size:12px;border-radius:16px;max-width:100%;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}
.trace-ai-web>[data-form]{padding:10px;gap:8px;align-items:flex-end;flex-wrap:nowrap;border-top:1px solid var(--line,#ddd)}
.trace-ai-web>[data-form] textarea{flex:1;min-width:0;min-height:42px;max-height:120px;height:44px;padding:10px 12px;resize:none;font-size:16px}
.trace-ai-web>[data-form] button{width:42px;min-height:42px;height:42px;padding:10px;display:grid;place-items:center;border-radius:12px;flex-shrink:0}
.trace-ai-web [data-status]:empty{display:none}.trace-ai-status{font-size:12px;margin:0;padding:6px 12px}
.trace-ai-web>[data-history-panel]{padding:12px;max-height:45%;overflow:auto;border-bottom:1px solid var(--line,#ddd)}
.trace-ai-web>[data-history-panel][hidden]{display:none}.trace-ai-web>[data-history-panel] nav{display:grid;gap:6px}
.trace-alert-panel{width:min(720px,calc(100vw - 40px));border-radius:18px}.trace-alert-panel>header{padding:10px 14px;min-height:50px}.trace-alert-panel>header h2{font-size:17px}
.field-error{display:block;font-size:12px;color:var(--brand,#c91a36);margin-top:5px;line-height:1.4}
@media(max-width:820px){
 .tk-header-spacer{height:calc(min(34px,var(--topbar-height,36px)) + 60px)}.tk-nav-shell{height:60px}.tk-brand img{max-height:36px;max-width:140px}
 .tk-mobile-drawer{width:min(340px,88vw)!important;max-width:88vw}.tk-mobile-drawer a{font-size:15px;line-height:1.4}
 .trace-ai-panel,.trace-ai-panel.is-expanded{inset:0!important;width:100%;height:var(--trace-viewport-height,100dvh);border:0;border-radius:0;margin:0;padding-top:env(safe-area-inset-top);padding-bottom:env(safe-area-inset-bottom)}
 .trace-ai-web .trace-ai-head{flex-wrap:wrap}.trace-ai-web>.trace-ai-messages{flex:1}.trace-ai-full{margin:12px auto}.trace-ai-full>.trace-ai-web{height:calc(var(--trace-viewport-height,100dvh) - 130px);min-height:300px}
 .trace-alert-panel{inset:0;width:100%;height:var(--trace-viewport-height,100dvh);max-height:none;border:0;border-radius:0;margin:0;padding-top:env(safe-area-inset-top);padding-bottom:env(safe-area-inset-bottom)}
 .tk-mobile-sticky-ad{bottom:0}.tk-popup-ad{bottom:16px}.tk-pwa-prompt,.trace-android-app-banner{bottom:12px}.tk-push-prompt{bottom:max(12px,var(--tk-prompt-offset,0px))}
 .tk-premium .tk-contact-hero-inner{padding:24px 16px 62px}.tk-premium .trace-connect-form{padding:0}.tk-premium :where(.trace-connect-content,.trace-connect-app){min-width:0}
 .tk-premium .trace-upload-drop{padding:12px;min-height:78px}.tk-premium :where(.trace-premium-form,.tk-contact-fields,.form-grid){column-gap:12px}
}
@media(prefers-reduced-motion:reduce){.trace-ai-launcher{transition:none;transform:none}.tk-contact-hero-art{animation:none}}
.tk-premium .trace-connect-app{padding:12px;background:transparent;border:0;box-shadow:none}
.tk-premium .trace-connect-content{padding:0;background:transparent;border:0;box-shadow:none;gap:16px}
.tk-premium .trace-workspace-heading{padding:4px 0 12px}
.tk-premium .trace-workspace-heading h1{font-size:24px;line-height:1.25;margin:0 0 6px}
.tk-premium .trace-workspace-heading p{font-size:13px;color:var(--muted);margin:0}
.tk-premium .trace-panel{padding:18px;border-radius:16px}
.tk-premium .trace-stat-grid{gap:10px;grid-template-columns:repeat(auto-fit,minmax(130px,1fr))}
.tk-premium .trace-stat-grid>a{padding:12px;min-height:0;border-radius:12px}
.tk-premium .trace-stat-grid strong{font-size:24px}
.tk-premium .trace-form-grid{gap:14px}
.tk-premium .trace-input-wrap{min-height:44px;border-radius:10px}
.tk-premium .trace-input-wrap input,.tk-premium .trace-input-wrap select{padding-left:40px;min-width:0}
.tk-premium .trace-field{margin:0;gap:6px}
.tk-premium .trace-label{font-size:13px}
.tk-premium :is(.trace-connect-app,.tk-contact-form,.trace-ai-web){font-family:system-ui,-apple-system,"Segoe UI",sans-serif}
.tk-premium .trace-label{font-weight:600;text-transform:none;letter-spacing:0}
.tk-premium .trace-connect-form :is(input,select,textarea){font-weight:400}
body.trace-editing .trace-ai-launcher,body.trace-editing .trace-alert-launcher{visibility:hidden;pointer-events:none}
body:has(form input:focus,form textarea:focus,form select:focus) :is(.trace-ai-launcher,.trace-alert-launcher){visibility:hidden;pointer-events:none}
.tk-premium .trace-connect-nav a{padding:10px 12px;font-size:13px;white-space:nowrap}
@media(max-width:820px){
 .tk-premium .trace-connect-app{padding:10px;margin:0}
 .tk-premium .trace-connect-shell{padding:0;gap:12px}
 .tk-premium .trace-connect-nav{display:flex;flex-wrap:nowrap;overflow-x:auto;gap:4px;padding:4px;max-width:100%;border-radius:12px}
 .tk-premium .trace-connect-nav>strong{display:none}
 .tk-premium .trace-connect-nav a{flex:0 0 auto;padding:8px 10px}
 .tk-premium .trace-panel{padding:14px}
 .tk-premium .trace-workspace-heading h1{font-size:22px}
 .tk-premium .trace-connect-form .trace-form-grid{grid-template-columns:minmax(0,1fr)}
}
