/* CoreGuard / Graphite. One presentation layer, independent of module data. */
:root{--cg-ink:#1d2027;--cg-muted:#6c727e;--cg-paper:#f5f5f7;--cg-line:#e5e6ea;--cg-accent:#0671e8;--cg-ease:cubic-bezier(.22,1,.36,1);--cg-shadow:0 2px 6px #151c2d03,0 16px 40px -24px #151c2d30;--background:var(--cg-paper);--foreground:var(--cg-ink);--primary:var(--cg-accent);--ink:var(--cg-ink);--paper:var(--cg-paper);--muted:var(--cg-muted);--line:var(--cg-line);color-scheme:light}
html{scroll-behavior:smooth;scroll-padding-top:100px;scrollbar-gutter:stable}
body{background:var(--cg-paper);color:var(--cg-ink);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;-webkit-font-smoothing:antialiased}
::selection{background:#cfe5ff;color:#152940}
*{scrollbar-width:thin;scrollbar-color:#c8cbd1 transparent}
::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-thumb{background:#c8cbd1;border:2px solid transparent;background-clip:padding-box;border-radius:8px}::-webkit-scrollbar-track{background:transparent}
button,a,input,select,textarea{touch-action:manipulation}button,a{transition:background-color .18s ease,color .18s ease,border-color .18s ease,box-shadow .18s ease,transform .2s var(--cg-ease)}
button:active:not(:disabled){transform:translateY(1px)}button:disabled{cursor:not-allowed}
:is(button,a,input,select,textarea):focus-visible{outline:3px solid #80b9f9;outline-offset:3px}
input,select,textarea{transition:border-color .18s,box-shadow .18s}input:focus,textarea:focus{border-color:#8fbbee;box-shadow:0 0 0 4px #0878f90d}
.brand-mark,.auth-mark{background:#191d25!important;border-radius:14px!important;box-shadow:inset 0 1px 1px #ffffff20,0 4px 10px #1c233515!important;flex-shrink:0;color:white}
.brand-mark svg{width:34px!important;height:34px!important}.brand strong{color:var(--cg-ink);font-weight:650;letter-spacing:-.9px}.brand small{font-size:12px;color:var(--cg-muted)}
.sidebar-brand{padding-top:30px;padding-bottom:30px}.sidebar-brand .brand{gap:11px}.sidebar-brand .brand small{display:block;max-width:130px;line-height:1.5;margin-top:3px}
[data-slot=sidebar-inner]{background:#fbfbfce8}.sidebar-nav [data-slot=sidebar-menu-button]{height:46px;border-radius:11px;font-size:14px;color:#626876}
.sidebar-nav [data-active=true]{background:#e9edf3;color:#202733!important;font-weight:600}.sidebar-nav [data-active=true] svg{color:var(--cg-accent)}
.workspace>.topbar{background:#ffffffcf;backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px);border-bottom:1px solid #e5e6ea99;min-height:82px}
.topbar h1{font-size:24px;letter-spacing:-.7px}.content{padding-top:30px}.page-intro h2,.welcome{letter-spacing:-1.2px}.page-intro p{color:var(--cg-muted)}
.card,.summary-card,.equipment-card,.home-gpu-card,.list-card,.status-card,.tax-stat{border-color:var(--cg-line);box-shadow:var(--cg-shadow);border-radius:20px}
.card:hover{border-color:#d8dbe1}.kpi-value,.tax-stat strong{font-variant-numeric:tabular-nums;letter-spacing:-1.2px}
.button-main,.primary-button{background:var(--cg-accent);border-radius:12px;box-shadow:0 3px 7px #0067d514;font-weight:550;min-height:44px}
.button-main:hover:not(:disabled),.primary-button:hover:not(:disabled){background:#0064ce;box-shadow:0 4px 10px #0067d526}
.button-soft,.button-secondary,.button-outline{border-radius:12px;min-height:42px}.avatar{background:#e9edf4;color:#3e526b;font-size:13px;border:1px solid #dde3ed}
.auth-screen{min-height:100dvh;background:radial-gradient(ellipse at 50% 10%,#fff 0,transparent 60%),var(--cg-paper)}
.auth-card{border:1px solid #e6e7eb;border-radius:28px;box-shadow:0 20px 80px -40px #151c2d30;animation:cg-arrive .55s var(--cg-ease) both}.auth-card h1{font-size:32px;letter-spacing:-1.2px;font-weight:650}.auth-card .auth-mark{width:60px;height:60px;margin-bottom:18px}.auth-card .auth-mark svg{width:42px!important;height:42px!important}.auth-card .eyebrow{letter-spacing:.5px;text-transform:none;font-size:15px;font-weight:600;color:#333b49}.auth-copy{line-height:1.65}.auth-footer{color:#747b88;font-size:12px}
.cg-loader{min-height:240px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:15px;color:var(--cg-ink);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;text-align:center;padding:36px 24px}.cg-loader strong{font-size:24px;letter-spacing:-.7px;font-weight:600}.cg-loader-mark{display:grid;place-items:center;width:64px;height:64px;background:#191d25;color:white;border-radius:20px;box-shadow:0 10px 30px #18223315;animation:cg-breathe 2s ease-in-out infinite}.cg-loader-mark svg{width:46px;height:46px}.cg-loader-label{color:var(--cg-muted);font-size:14px;line-height:1.6}.cg-loader-track{height:3px;width:120px;border-radius:3px;background:#e3e6eb;overflow:hidden;margin-top:6px}.cg-loader-track i{display:block;width:45%;height:100%;border-radius:3px;background:var(--cg-accent);animation:cg-progress 1.4s ease-in-out infinite}.cg-boot{min-height:100dvh;margin:0;display:grid;place-items:center;background:#f5f5f7}
.cg-skeleton{height:15px;border-radius:6px;background:#e9ecf0;animation:cg-breathe 1.7s ease-in-out infinite}.cg-skeleton-card{padding:24px;display:grid;gap:18px;min-height:136px}.cg-skeleton-card .cg-skeleton:nth-child(2){height:28px;width:65%}
.cg-toast-region{position:fixed;z-index:110;right:28px;bottom:28px;width:min(420px,calc(100vw - 32px));pointer-events:none}.cg-toast{display:flex;align-items:center;gap:14px;background:#fffefef2;backdrop-filter:blur(16px);border:1px solid #e4e7ec;box-shadow:0 12px 50px #17243920;border-radius:18px;padding:16px 14px 16px 18px;pointer-events:auto;animation:cg-toast-in .35s var(--cg-ease) both}.cg-toast p{font-size:14px;line-height:1.55;flex:1;margin:0;color:#303b49}.cg-toast-icon{width:32px;height:32px;display:grid;place-items:center;flex-shrink:0;color:#227e5f;background:#e9f6f0;border-radius:50%}.cg-toast button{display:grid;place-items:center;width:32px;height:32px;border:0;background:transparent;color:#808997;border-radius:9px}.cg-toast button:hover{background:#eef1f6}
[data-slot=dialog-overlay],[data-slot=alert-dialog-overlay]{z-index:1090;background:#171d2b55;backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px)}
[data-slot=dialog-content],[data-slot=alert-dialog-content],.app-dialog{border:1px solid #ffffffa6!important;border-radius:24px!important;padding:30px!important;box-shadow:0 30px 120px -30px #0e193d70!important;background:#fff!important;max-height:calc(100dvh - 40px);overflow-y:auto}
[data-slot=dialog-title],[data-slot=alert-dialog-title]{font-size:23px;letter-spacing:-.6px;line-height:1.3}[data-slot=dialog-description],[data-slot=alert-dialog-description]{font-size:14px;line-height:1.7;color:var(--cg-muted)}
.cg-page-enter{animation:cg-arrive .35s var(--cg-ease) both}.tax-badge,.tax-stat p,.tax-source-id,.tax-purpose small,.tax-evidence{font-size:12px!important}.tax-module table,.tax-module th,.tax-muted,.tax-footnote,.tax-tabs button,.tax-statusline,.tax-stat>span{font-size:14px!important}.tax-tabs{background:#e9ecf1;padding:4px;border-radius:13px}.tax-tabs button{border-radius:10px;min-height:44px}.tax-module th{background:#f8f9fb}.tax-stat strong{color:var(--cg-ink)}.tax-notice{background:#edf3fb;border-color:#dfe8f4;color:#5b6c83}.tax-module .page-intro h2{font-size:30px}.tax-small{min-height:36px!important}
@keyframes cg-arrive{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}@keyframes cg-toast-in{from{opacity:0;transform:translateY(12px) scale(.98)}to{opacity:1;transform:none}}@keyframes cg-breathe{50%{opacity:.55}}@keyframes cg-progress{0%{transform:translateX(-110%)}100%{transform:translateX(340%)}}
@media(max-width:640px){.content{padding-top:22px}.auth-card{border-radius:24px}.auth-card h1{font-size:29px}.cg-toast-region{right:16px;bottom:max(18px,env(safe-area-inset-bottom))}.workspace>.topbar{min-height:68px}.topbar h1{font-size:21px}.tax-module .page-intro h2{font-size:26px}[data-slot=dialog-content],[data-slot=alert-dialog-content]{padding:24px!important}}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}*,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}.cg-loader-mark,.cg-skeleton{animation:none;opacity:1}.cg-loader-track i{animation:none;transform:none;width:100%}}
/* Native module shells use the same material, spacing and motion. */
body[data-cg-module] .brand-mark svg,body[data-cg-module] .mini-mark svg{fill:none;color:white;stroke:none;width:34px;height:34px}
body[data-cg-module] .brand-mark svg path{fill:none;stroke:currentColor;stroke-width:4.5}body[data-cg-module] .brand-mark svg rect{fill:currentColor;stroke:none}
body[data-cg-module] .mini-mark{display:grid;place-items:center;width:44px;height:44px;flex:none;background:#191d25;border-radius:14px;color:#fff}
body[data-cg-module] .topbar{background:#ffffffed!important;border-color:var(--cg-line)}
body[data-cg-module] :is(.sidebar,.desktop-sidebar){background:#fbfbfc;border-color:var(--cg-line)}
body[data-cg-module] :is(.primary,.primary-button,.primary-link-button){background:var(--cg-accent);color:#fff;border-color:transparent;border-radius:12px;min-height:44px}
body[data-cg-module] :is(.ghost-button,.secondary,.secondary-button){border-color:var(--cg-line);border-radius:12px;min-height:42px}
body[data-cg-module] :is(.card,.hero-main,.hero-side,.search-panel,.map-panel,.knowledge-card,.miner-section,.details){border-color:var(--cg-line);border-radius:20px;box-shadow:var(--cg-shadow)}
body[data-cg-module] :is(.nav-item,.side-nav-button){border-radius:11px;transition:background .18s,color .18s}
body[data-cg-module] :is(.nav-item.is-active,.side-nav-button.active){background:#e9edf3;color:#202733}
body[data-cg-module] :is(.cg-prepared,.demo-state,.data-status){background:#edf3fb;border-color:#dfe8f4;border-radius:14px}
body[data-cg-module] :is(.cg-prepared,.cg-module-bar,.data-status){font-size:13px}
body[data-cg-module] :is(.toast,#toast,#miner-toast,#knowledge-toast){background:#fff;color:#26344a;border:1px solid #e1e5ec;box-shadow:0 12px 50px #17243924;border-radius:16px;padding:16px 20px;max-width:calc(100vw - 32px);font-size:14px;line-height:1.6}
body[data-cg-module] .toast.error{border-color:#edc6ce;color:#ac3349;background:#fff9fa}
body[data-cg-module] :is(.modal-backdrop,.site-dialog-backdrop,.uptime-dialog-backdrop){background:#171d2b55;backdrop-filter:blur(6px)}
body[data-cg-module] :is(.app-modal,.site-dialog-card,.uptime-dialog-card),body[data-cg-module] dialog{border:1px solid #ffffffb0;border-radius:24px;background:#fff;box-shadow:0 30px 120px -30px #0e193d70;max-height:calc(100dvh - 40px);overflow-y:auto;overscroll-behavior:contain}
body[data-cg-module] dialog::backdrop,.cg-confirm::backdrop{background:#171d2b55;backdrop-filter:blur(6px)}
body[data-cg-module] dialog[open],body[data-cg-module] .app-modal,.cg-confirm[open]{animation:cg-arrive .3s var(--cg-ease) both}
.cg-confirm{padding:30px;max-width:440px;width:calc(100% - 32px);border:1px solid #ffffffb0;border-radius:24px;background:white;color:var(--cg-ink);box-shadow:0 30px 120px -30px #0e193d70}
.cg-confirm h2{font-size:24px;letter-spacing:-.6px;margin:0 0 14px}.cg-confirm p{font-size:15px;color:var(--cg-muted);line-height:1.7;margin:0}.cg-confirm-actions{display:flex;gap:10px;justify-content:flex-end;margin-top:28px}.cg-confirm-actions button{min-height:44px;border-radius:12px;padding:10px 20px;font:inherit;font-size:14px;font-weight:600;cursor:pointer}.cg-confirm-cancel{border:1px solid #dce1e9;background:#f6f7f9;color:#465469}.cg-confirm-accept{border:0;background:var(--cg-accent);color:white}.cg-confirm-accept.danger{background:#bb374f}
body[data-cg-module] .boot-card{background:transparent;border:0;box-shadow:none}.boot-card strong{font-size:24px;letter-spacing:-.7px}.boot-card .boot-spinner,.busy-overlay .spinner{width:24px;height:24px;border:2px solid #dce6f3;border-top-color:var(--cg-accent)}
body[data-cg-module] .busy-overlay{background:#f5f5f7dc;backdrop-filter:blur(5px)}body[data-cg-module] .busy-overlay>div{border:1px solid #e4e7ed;background:white;border-radius:22px;padding:24px 30px;box-shadow:var(--cg-shadow);font-size:15px}
body[data-cg-module] :is(.view,.page.active,.page:not(.hidden)){animation:cg-arrive .3s var(--cg-ease) both}
body[data-cg-module=asic] .topbar .cg-module-nav a{font-size:14px;font-weight:550;border-radius:11px}.topbar .cg-module-nav a[aria-current=page]{background:#e9eef5;border-color:#dce4ef;color:#0965c9}
body[data-cg-module=asic] :is(.session-user,.safe-mode,.scan-status,.nav-count){font-size:12px!important}
/* Touch layouts keep the working canvas and all actions accessible. */
@media(max-width:760px){
  html{scroll-padding-top:78px}body{overflow-wrap:anywhere}
  input:not([type=checkbox]):not([type=radio]),select,textarea{font-size:16px!important}input,select,button{min-height:44px}
  .top-actions>span{display:none}.page-intro{flex-wrap:wrap}.page-intro>div{min-width:0}.profile-grid{grid-template-columns:minmax(0,1fr)}
  [data-slot=sheet-content]{max-width:calc(100vw - 44px);padding-top:env(safe-area-inset-top);padding-bottom:env(safe-area-inset-bottom)}
  [data-slot=dialog-content],[data-slot=alert-dialog-content]{width:calc(100vw - 24px)!important;max-width:520px;max-height:calc(100dvh - 24px);border-radius:22px!important}
  .tax-toolbar{align-items:stretch}.tax-toolbar>.tax-period{width:100%;justify-content:space-between}.tax-actions{width:100%;display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.tax-actions button{white-space:normal!important;line-height:1.4;padding:12px!important}.tax-tabs{width:100%;scroll-snap-type:x proximity}.tax-tabs button{scroll-snap-align:start;flex-shrink:0}.tax-stat strong{font-size:clamp(19px,5vw,26px)}.tax-stat>span{display:block;min-height:40px;line-height:1.45}.tax-stat p{line-height:1.5}.tax-table-scroll{overscroll-behavior-x:contain}.tax-module th:first-child,.tax-module td:first-child{position:sticky;left:0;background:#fff;z-index:1;box-shadow:1px 0 #edf0f5}.tax-module th:first-child{z-index:2;background:#f8f9fb}.tax-confirm>div{min-width:0;width:100%;flex-basis:100%}.tax-confirm button{width:100%}
  body[data-cg-module] :is(.app-modal,.site-dialog-card,.uptime-dialog-card),body[data-cg-module] dialog{max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px);border-radius:22px}.modal-grid{grid-template-columns:minmax(0,1fr)!important}.modal-grid .wide{grid-column:auto!important}.modal-body{overflow-y:auto;overscroll-behavior:contain}.modal-footer{padding-bottom:max(16px,env(safe-area-inset-bottom));flex-wrap:wrap}.modal-footer button{flex:1;min-width:110px}
  body[data-cg-module] :is(.toast,#toast,#miner-toast,#knowledge-toast){bottom:max(88px,calc(24px + env(safe-area-inset-bottom)));left:16px;right:16px;width:auto;transform:none;font-size:14px}
  body[data-cg-module=gpu] .cg-module-bar{gap:10px;padding:10px 16px;font-size:13px;position:relative}.cg-module-bar button{min-height:44px}.cg-module-bar .cg-source-status{line-height:1.5}.bottom-nav{padding-bottom:env(safe-area-inset-bottom)}
  body[data-cg-module=asic] .topbar{padding:16px!important;gap:16px;grid-template-columns:minmax(0,1fr) auto}.cg-account-links{gap:12px}.cg-account-links a{font-size:12px}.cg-module-nav{grid-column:1 / -1!important;display:flex;flex-wrap:nowrap!important;overflow-x:auto;padding-bottom:6px;scroll-snap-type:x proximity}.cg-module-nav a{flex-shrink:0;scroll-snap-align:start}.topbar-actions{grid-column:1 / -1!important;grid-row:3!important;justify-content:flex-start!important;gap:8px!important}.topbar-actions .session-user{display:none!important}.topbar-actions .scan-control{flex:1}.topbar-actions .scan-button{width:100%;font-size:13px!important}.topbar-actions #refresh-button{flex:1}.topbar-actions .scan-status{text-align:center;margin-top:5px}.cg-prepared{padding:14px 16px!important;line-height:1.6}.app-shell,.miner-shell,.knowledge-shell{min-width:0}.table-scroll{overscroll-behavior-x:contain}.dialog-actions{flex-wrap:wrap}.dialog-actions button{flex:1;min-width:110px}
}

.cg-pagination{display:flex;justify-content:space-between;align-items:center;gap:14px;flex-wrap:wrap;font-size:14px;color:var(--cg-muted)}.cg-pagination>div{display:flex;gap:8px}
@media(prefers-reduced-motion:reduce){body[data-cg-module] dialog[open],body[data-cg-module] .app-modal,body[data-cg-module] :is(.view,.page.active,.page:not(.hidden)),.cg-confirm[open]{animation:none}}
@media(max-width:960px){
 body[data-cg-module=finance] .topbar{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:10px;padding:14px 16px}
 body[data-cg-module=finance] .topbar .mobile-brand{grid-column:1;grid-row:1;min-width:0;width:fit-content;text-decoration:none}
 body[data-cg-module=finance] .mobile-brand strong{white-space:nowrap;font-size:18px;letter-spacing:-.6px;overflow-wrap:normal}
 body[data-cg-module=finance] .mobile-brand .brand-mark{width:36px;height:36px;border-radius:12px!important}
 body[data-cg-module=finance] .topbar-actions{display:contents}
 body[data-cg-module=finance] .topbar-actions .avatar{grid-column:2;grid-row:1}
 body[data-cg-module=finance] .topbar-rate{grid-column:2;grid-row:2;background:#f5f7fa;border:0;box-shadow:none;padding:0 10px;min-height:44px}
 body[data-cg-module=finance] .topbar-rate span{display:inline;font-size:12px}.topbar-rate strong{font-size:13px!important}
 body[data-cg-module=finance] .month-picker{grid-column:1;grid-row:2;max-width:220px;width:100%}
 body[data-cg-module=finance] .month-picker select{width:100%;min-width:0;padding-right:28px}
 body[data-cg-module=finance] .mobile-nav{padding-bottom:max(8px,env(safe-area-inset-bottom));background:#ffffffef;backdrop-filter:blur(18px);border-color:#e3e7ed}
 body[data-cg-module=finance] .mobile-nav button{font-size:12px;min-height:52px}.mobile-nav button>span{font-size:20px}
 body[data-cg-module=finance] .mobile-sheet{max-height:calc(var(--cg-vh,100dvh) - 24px);overflow:auto;padding-bottom:max(24px,env(safe-area-inset-bottom));border-radius:24px 24px 0 0}
}
@media(max-width:620px){
 body[data-cg-module=finance] .modal-backdrop#app-modal{position:fixed;inset:var(--cg-vtop,0px) 0 auto;top:var(--cg-vtop,0px);width:100%;height:var(--cg-vh,100dvh);min-height:0;padding:12px;display:flex;align-items:flex-end;justify-content:center;background:#171d2b55;backdrop-filter:blur(6px);overflow:hidden}
 body[data-cg-module=finance] .app-modal{min-height:0;max-height:calc(var(--cg-vh,100dvh) - 24px);width:100%;overflow:auto;overscroll-behavior:contain;box-sizing:border-box}
 body[data-cg-module=finance] .modal-head{position:sticky;top:0;z-index:2;padding:18px;background:#fffffff5;border-bottom:1px solid #edf0f4}
 body[data-cg-module=finance] .modal-head h2{font-size:23px;letter-spacing:-.6px}.modal-head .eyebrow{font-size:12px}
 body[data-cg-module=finance] .modal-grid label{font-size:14px;line-height:1.5}.modal-body{padding:18px}
 body[data-cg-module=finance] .main .content{padding-bottom:110px}.cg-confirm{max-height:calc(100dvh - 24px);overflow:auto}
}
@media(max-width:960px){body[data-cg-module=finance] .topbar{height:auto;min-height:126px;grid-template-rows:36px 44px;column-gap:12px}body[data-cg-module=finance] .mobile-brand{color:var(--cg-ink)!important;grid-column:1 / -1;padding-right:56px}body[data-cg-module=finance] .month-picker{max-width:none;min-width:0}body[data-cg-module=finance] .month-picker select{max-width:none;min-width:0;padding-left:10px;font-size:14px!important}body[data-cg-module=finance] .topbar-actions .avatar{justify-self:end}body[data-cg-module=finance] .topbar-rate{font-size:12px}body[data-cg-module=finance] .mobile-nav .pending-count{font-size:10px;min-height:19px}}
@media(max-width:760px){body[data-cg-module=gpu] .hero-main{padding:20px}body[data-cg-module=gpu] .hero-main h2{font-size:24px;line-height:1.25;letter-spacing:-.7px}body[data-cg-module=gpu] .hero-main p{font-size:14px;line-height:1.6}body[data-cg-module=gpu] .bottom-nav .nav-button{padding:8px 2px;font-size:12px;white-space:nowrap;min-width:0}body[data-cg-module=gpu] .bottom-nav{gap:0;grid-template-columns:none;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr)}body[data-cg-module=gpu] .topbar .brand h1{font-size:22px}.uptime-dialog-card{max-height:calc(var(--cg-vh,100dvh) - 24px)!important}}
body[data-cg-module=finance][data-coreguard-mode=training] .notice{display:flex;background:#edf3fb;border:1px solid #dfe8f4;color:#596c85}.notice strong,.notice p{font-size:13px;line-height:1.6}
@media(max-width:420px){body[data-cg-module=finance] .kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}body[data-cg-module=finance] .kpi-card{padding:15px;min-height:150px}body[data-cg-module=finance] .kpi-value{font-size:clamp(20px,6vw,25px);letter-spacing:-.7px}body[data-cg-module=finance] .kpi-head{font-size:12px;line-height:1.4;min-height:36px}body[data-cg-module=finance] .kpi-head .soft-icon{display:none}body[data-cg-module=finance] .kpi-note{font-size:12px;line-height:1.5}.notice-icon{flex:none}}
@media(max-width:700px){body[data-cg-module=finance] td[data-label="Статус"]{flex-wrap:wrap;gap:8px}body[data-cg-module=finance] td .row-action{margin-left:auto;flex-shrink:0}body[data-cg-module=finance] .mobile-nav button{white-space:nowrap}body[data-cg-module=finance] .notice{gap:10px}body[data-cg-module=finance] .notice p{min-width:0}}
@media(max-width:350px){body[data-cg-module=finance] .topbar-rate{flex-direction:column;gap:0;padding:4px 9px;line-height:18px}body[data-cg-module=finance] .mobile-nav{left:4px;right:4px;padding:4px}}

[data-slot=dialog-close],[data-slot=sheet-close]{width:40px;height:40px}
@media(max-width:760px){[data-slot=dialog-close],[data-slot=sheet-close]{width:44px;height:44px}}

.cg-module-loading{min-height:55dvh;display:grid;place-items:center;padding:32px 16px}

/* Alignment: each module keeps its own layout rules and predictable control sizes. */
.workspace .kpi-label { min-height: 40px; line-height: 1.45; }
@media(max-width:640px) {
  .workspace .section-tabs:has(> [data-slot=tabs-trigger]:nth-child(4)) {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    width: 100%;
    gap: 4px;
  }
  .workspace .section-tabs [data-slot=tabs-trigger] { min-height: 44px; }
}
body[data-cg-module=gpu] .workspace > .topbar {
  min-height: 76px;
  padding: 16px 20px;
  margin-bottom: 24px;
  justify-content: flex-end;
  align-items: center;
  border: 1px solid var(--cg-line);
  border-radius: 18px;
}
body[data-cg-module=gpu] .userbox {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px 16px;
  min-width: 0;
  line-height: 1.4;
  text-align: left;
}
body[data-cg-module=gpu] .userbox .role-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  min-height: 28px;
  padding: 5px 10px;
  margin: 0;
  line-height: 18px;
}
body[data-cg-module=gpu] .userbox .cg-profile-link {
  min-width: 0;
  min-height: 44px;
  max-width: 320px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
body[data-cg-module=gpu] #logoutButton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  gap: 8px;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 10px;
  line-height: 20px;
  white-space: nowrap;
}
body[data-cg-module=gpu] #logoutButton:hover { background: #edf4fc; }
body[data-cg-module=gpu] :is(.page-head,.form-header,.home-section-head) {
  align-items: center;
  gap: 16px;
}
body[data-cg-module=gpu] :is(.page-head,.form-header,.home-section-head) > div { min-width: 0; }
body[data-cg-module=gpu] :is(.page-head,.form-header,.home-section-head) > button { flex-shrink: 0; }
body[data-cg-module=gpu] :is(.button-icon,.icon-label) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  line-height: 1.4;
  vertical-align: middle;
}
body[data-cg-module=gpu] :is(.button-icon,.icon-label) > .ui-icon { flex: none; margin: 0; }
body[data-cg-module=gpu] :is(.primary,.secondary,.soft-button,.danger) { min-height: 44px; }

body[data-cg-module=asic] .summary-cards { grid-template-columns: repeat(6,minmax(0,1fr)); }
body[data-cg-module=asic] :is(.summary-card,.fault-summary-card) {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 8px;
  min-width: 0;
}
body[data-cg-module=asic] :is(.summary-card,.fault-summary-card) strong {
  display: flex;
  align-items: center;
  min-height: 38px;
  margin: 0;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
body[data-cg-module=asic] :is(.summary-card,.fault-summary-card) span {
  margin: 0;
  line-height: 1.45;
}
body[data-cg-module=asic] .cg-account-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
body[data-cg-module=asic] .topbar-actions { align-self: start; }
body[data-cg-module=asic] :is(.topbar-actions button,.topbar .cg-module-nav a) { line-height: 20px; }

body[data-cg-module=finance] .notice {
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  margin-bottom: 20px;
  border-radius: 16px;
}
body[data-cg-module=finance] .notice p { min-width: 0; }
body[data-cg-module=finance] .notice-icon { flex: none; }
body[data-cg-module=finance] .kpi-head { min-height: 36px; line-height: 1.45; }
body[data-cg-module=finance] .kpi-meta { padding-top: 12px; line-height: 1.5; }
body[data-cg-module=finance] .kpi-value { line-height: 1.2; }
body[data-cg-module=finance] .modal-grid { align-items: end; }
body[data-cg-module=finance] .modal-field { min-width: 0; }
body[data-cg-module=finance] .modal-footer.inline button { min-height: 44px; }

@media(max-width:1100px) {
  body[data-cg-module=asic] .summary-cards { grid-template-columns: repeat(4,minmax(0,1fr)); }
}
@media(max-width:820px) {
  body[data-cg-module=gpu] .workspace { padding-inline: 16px; }
  body[data-cg-module=gpu] .workspace > .topbar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    min-height: 0;
    padding: 16px;
    margin-bottom: 18px;
  }
  body[data-cg-module=gpu] .workspace > .topbar .brand {
    width: fit-content;
    max-width: 100%;
    gap: 12px;
    text-align: left;
    flex-shrink: 0;
  }
  body[data-cg-module=gpu] .topbar .brand :is(h1,p) {
    white-space: nowrap;
    overflow-wrap: normal;
    margin: 0;
    line-height: 1.4;
  }
  body[data-cg-module=gpu] .topbar .brand p { font-size: 12px; }
  body[data-cg-module=gpu] .userbox {
    width: 100%;
    justify-content: flex-start;
    gap: 4px 12px;
    padding-top: 10px;
    border-top: 1px solid var(--cg-line);
  }
  body[data-cg-module=gpu] .userbox .cg-profile-link { flex: 1; max-width: none; }
  body[data-cg-module=gpu] #logoutButton { margin-left: auto; padding-inline: 8px; }
  body[data-cg-module=gpu] :is(.page-head,.form-header) {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }
  body[data-cg-module=gpu] :is(.page-head button,.form-header .back) { margin-top: 0; }
}
@media(max-width:760px) {
  body[data-cg-module=asic] .summary-cards { grid-template-columns: repeat(3,minmax(0,1fr)); }
  body[data-cg-module=asic] .topbar .cg-module-nav a { height: 64px; min-height: 64px; }
  body[data-cg-module=asic] .cg-account-links { gap: 0; }
  body[data-cg-module=asic] .topbar-actions .scan-control,
  body[data-cg-module=asic] .topbar-actions #refresh-button { flex: 1 1 0; min-width: 0; }
  body[data-cg-module=asic] .topbar-actions #refresh-button { justify-content: center; white-space: normal; }
  body[data-cg-module=finance] .notice { align-items: flex-start; padding: 14px; margin-bottom: 16px; }
  body[data-cg-module=finance] .modal-footer.inline { align-items: stretch; }
}
@media(max-width:520px) {
  body[data-cg-module=asic] .summary-cards { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media(min-width:361px) and (max-width:760px) {
  body[data-cg-module=asic] .cg-account-links { flex-direction: row; gap: 12px; }
}
@media(max-width:360px) {
  body[data-cg-module=asic] .topbar .cg-module-nav a { font-size: 12px; line-height: 18px; padding-inline: 6px; gap: 6px; }
  body[data-cg-module=gpu] .bottom-nav .nav-button { font-size: 10.5px; }
  body[data-cg-module=gpu] .userbox { column-gap: 8px; }
  body[data-cg-module=gpu] .userbox .role-badge { font-size: 10px; padding-inline: 7px; }
  body[data-cg-module=gpu] #logoutButton { padding-inline: 4px; gap: 6px; }
}

/* Shared compact status and control rhythm across the application. */
.cg-source-status { display:flex; align-items:center; flex-wrap:wrap; gap:8px 16px; padding:12px 16px; border:1px solid #e3e7ef; border-radius:14px; background:#f7f9fd; color:#697385; font-size:13px; }
.cg-source-status summary { cursor:pointer; color:#50637d; font-weight:600; min-height:24px; }
.cg-source-status p { margin:8px 0 0; line-height:1.5; }
.cg-source-status time { font-variant-numeric:tabular-nums; }
.cg-source-status[data-stale=true] { border-color:#efd8ac; background:#fffaf0; }
.cg-security { margin-top:24px; }
.cg-security .form-stack { max-width:440px; margin-top:20px; }
.cg-security code { display:block; overflow-wrap:anywhere; user-select:all; padding:14px; background:#f5f7fb; border-radius:10px; }
.cg-security ul { list-style:none; margin:0; padding:0; }
.cg-session-row { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:16px 0; border-bottom:1px solid #e6e9ef; }
.cg-session-row small { display:block; color:#747d8b; margin-top:4px; }
.cg-recovery { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; padding:0; }
@media(max-width:400px) {
 .tax-segments { display:grid!important; grid-template-columns:repeat(3,minmax(0,1fr)); width:100%; overflow:visible!important; }
 .tax-segments button { min-width:0!important; white-space:normal!important; padding:8px 4px!important; font-size:11px!important; min-height:44px; }
 .cg-recovery { grid-template-columns:1fr; }
}
@media(prefers-reduced-motion:no-preference) {
 dialog[open]:not(.cg-tabs-sheet),.app-dialog[data-state=open] { animation:cg-dialog-appear .16s ease-out; }
 @keyframes cg-dialog-appear { from {opacity:0;transform:translateY(6px)} to {opacity:1;transform:translateY(0)} }
}

.cg-overview-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:24px; }
.cg-overview-grid .panel-heading h3,.cg-security .panel-heading h3 { display:flex; gap:12px; align-items:center; }
.cg-overview-metrics { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:24px 16px; margin:24px 0; }
.cg-overview-metrics span { display:block; color:#747d8b; font-size:13px; margin-bottom:6px; }
.cg-overview-metrics strong { font-size:26px; letter-spacing:-.5px; overflow-wrap:anywhere; }
.cg-overview-pending { display:flex; gap:16px; align-items:center; width:100%; margin-bottom:24px; text-align:left; color:#0878f9; }
@media(max-width:760px) { .cg-overview-grid { grid-template-columns:1fr; gap:16px; } }

.cg-gpu-intro { margin:16px 0 24px; border:1px solid #e5e8ef; border-radius:14px; padding:12px 16px; color:#758091; }
.cg-gpu-intro>summary { cursor:pointer; font-size:13px; min-height:24px; }
.cg-gpu-intro .home-hero { margin:16px 0 0; }
body[data-cg-module] .cg-prepared { padding:12px 16px; font-size:13px; border-radius:14px; }
body[data-cg-module] .cg-prepared strong { font-size:13px; }

/* Profile notification setup and permission-scoped instruction library. */
.cg-notifications h2,.cg-instructions h2{display:flex;align-items:center;gap:10px}
.cg-panel-actions{display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin-top:16px}
.cg-notice{padding:16px 18px;border-radius:18px;background:#f0f5ff;color:#476183;margin:16px 0;line-height:1.55}
.cg-notification-options{display:grid;gap:4px;margin:20px 0}
.cg-notification-options label{display:flex;align-items:center;gap:12px;min-height:44px;padding:7px 0;font-size:14px;line-height:1.45;cursor:pointer}
.cg-notification-options input{width:19px;height:19px;flex-shrink:0;accent-color:#007aff}
.cg-instructions,.cg-legacy-telegram{margin-top:24px}
.cg-instructions-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap}
.cg-instructions-heading .cg-panel-actions{margin-top:0}
.cg-instruction-form{display:grid;gap:18px;margin:24px 0;padding:22px;background:#f5f5f7;border-radius:20px}
.cg-instruction-form label{display:grid;gap:9px;font-size:14px;font-weight:500}
.cg-instruction-form input,.cg-instruction-form select,.cg-instruction-form textarea{max-width:100%;min-width:0;width:100%;padding:12px 14px;border:1px solid #dddfe7;border-radius:12px;background:#fff;font:inherit;color:#1d1d1f}
.cg-instruction-form textarea{resize:vertical}.cg-instruction-form input[type=file]{font-size:13px}
.cg-instruction-form .button-main{justify-self:start}
.cg-instruction-list{display:grid;gap:10px;margin-top:22px}
.cg-instruction-list details{border:1px solid #e5e5eb;border-radius:16px;overflow:hidden}
.cg-instruction-list summary{padding:18px 20px;cursor:pointer;line-height:1.5;overflow-wrap:anywhere}
.cg-instruction-list summary span{font-weight:600}.cg-instruction-list summary small{display:block;color:#6e6e73;margin-top:5px}
.cg-instruction-body{padding:0 20px 18px;overflow-wrap:anywhere}.cg-instruction-body>p{white-space:pre-wrap;line-height:1.6;margin:12px 0}.cg-instruction-body a{max-width:100%;white-space:normal}
.cg-legacy-telegram>summary{cursor:pointer;font-size:14px;color:#6e6e73}.cg-legacy-telegram>.card{box-shadow:none;border:0;padding:16px 0 0;margin:0}
@media(max-width:600px){.cg-instruction-form{padding:16px}.cg-instructions-heading h2{font-size:20px}.cg-instructions-heading .cg-panel-actions{width:100%}.cg-instructions-heading button{flex:1}.cg-notifications .cg-panel-actions>*{flex:1;justify-content:center;white-space:normal}.cg-notifications h2{font-size:20px}}

.cg-security .cg-session-row>div{min-width:0;flex:1}.cg-security .cg-session-row>.button-secondary{flex-shrink:0;white-space:nowrap;min-height:44px;padding:10px 14px;border:1px solid #e5e5eb;border-radius:12px}.cg-security .cg-session-row small{overflow-wrap:anywhere}.cg-security .panel-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}.cg-security .panel-heading h3{display:flex;align-items:center;gap:10px}
@media(max-width:420px){.cg-security .cg-session-row{flex-wrap:wrap;gap:12px}.cg-security .cg-session-row>div{flex-basis:180px}}

/* Keep modal backgrounds above navigation, and nested controls above their dialog. */
[data-slot=dialog-content],[data-slot=alert-dialog-content]{z-index:1100}
body:has([data-slot=dialog-content]) :is(div:has(>[data-slot=select-content]),div:has(>[data-slot=popover-content])){z-index:1110}

.cg-read-status,.cg-block-status{display:flex;align-items:center;flex-wrap:wrap;gap:8px;padding:10px 12px;margin:8px 0;font-size:13px;line-height:1.45;border-radius:12px;background:color-mix(in srgb,currentColor 5%,transparent);color:inherit}.cg-read-status button,.cg-block-status button{font:inherit;color:inherit;background:transparent;border:1px solid currentColor;border-radius:8px;padding:5px 10px;cursor:pointer}.cg-block-status[hidden]{display:none!important}
