/* Sign-in view and dashboard (index.html). Figma: Sign in, Dashboard — Overview / API keys / Usage / Billing, Dashboard — Mobile. */

/* Sign in: full-page split; the site header and footer step aside. */
body.view-signin .site-header,body.view-signin .site-footer{display:none}
.signin-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,700px);min-height:100vh;min-height:100dvh}
.signin-side{display:flex;flex-direction:column;padding:40px}
.signin-center{flex:1;display:flex;align-items:center;justify-content:center;padding:40px 0}
.signin-panel{width:100%;max-width:380px;display:flex;flex-direction:column;align-items:center;text-align:center}
.signin-title{font-size:40px;line-height:44px;font-weight:600;letter-spacing:-.035em}
.signin-title:focus{outline:none}
.signin-sub{font-size:16px;line-height:22px;color:var(--ink-2);margin-top:12px;max-width:360px}
.signin-form{width:100%;display:flex;flex-direction:column;gap:12px;margin-top:36px;text-align:left}
.signin-form .dialog-form{gap:12px}
.auth-google{gap:10px}
.auth-google.unavailable{opacity:.45;pointer-events:none}
.auth-divider{display:flex;align-items:center;gap:12px;margin:8px 0;font-size:12px;font-weight:500;color:var(--ink-3)}
.auth-divider::before,.auth-divider::after{content:"";flex:1;height:1px;background:var(--line)}
.auth-status{font-size:13px;line-height:18px;color:var(--ink-3);text-align:center;margin-top:6px}
.auth-status.error{color:var(--warn-ink)}
.auth-privacy{font-size:12px;line-height:18px;color:var(--ink-3);margin-top:20px;max-width:340px}
.auth-privacy a{text-decoration:underline;text-underline-offset:2px}
.signin-icon{width:56px;height:56px;border-radius:18px;background:var(--surface);display:inline-flex;align-items:center;justify-content:center;margin-bottom:24px}
.code-input{text-align:center;font-family:var(--mono);font-size:26px!important;letter-spacing:.5em;font-weight:600;height:64px}
.signin-links{display:flex;gap:16px;justify-content:center;margin-top:18px;font-size:14px;color:var(--ink-2)}
.signin-links button{font-weight:600;color:var(--ink)}
.signin-connector{margin-top:56px;width:100%;text-align:left}
.signin-connector .atile{border-radius:999px;margin-top:1px}
.signin-foot{display:flex;justify-content:space-between;align-items:center;font-size:12px;color:var(--ink-3);font-weight:500}
.signin-foot a:hover{color:var(--ink)}
.signin-visual{padding:24px 24px 24px 0;display:flex}
.signin-tile{flex:1;border-radius:28px;display:flex;align-items:center;justify-content:center}
.signin-visual-inner{position:relative;z-index:1;display:flex;flex-direction:column;align-items:center;gap:18px;padding:24px}
.signin-pill{box-shadow:var(--shadow-chip)}
.signin-widget{width:min(460px,100%);box-shadow:var(--shadow-card);border:0}
.signin-loading{display:flex;justify-content:center;padding:120px 0;color:var(--ink-3);font-size:14px}

/* Dashboard layout */
.dashboard{padding-top:40px;padding-bottom:120px}
.dash-head{display:flex;align-items:flex-end;justify-content:space-between;gap:20px;flex-wrap:wrap}
.dash-head h1{font-size:48px;line-height:52px;font-weight:600;letter-spacing:-.035em}
.dash-sub{display:flex;gap:8px;flex-wrap:wrap;margin-top:8px;font-size:14px;line-height:20px;color:var(--ink-2)}
.dash-sub span+span::before{content:"·";margin-right:8px;color:var(--ink-3)}
.dash-actions{display:flex;gap:10px;flex-wrap:wrap}
.dash-tabs{margin-top:32px}
.dash-panel{padding-top:32px}
.dash-row{display:flex;gap:16px;align-items:stretch}
.dash-row+.dash-row,.dash-panel>*+*{margin-top:16px}
.dash-grid-4{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px}
.dash-card{background:#fff;border:1px solid var(--line);border-radius:22px;padding:24px}
.dash-card.panel-sm{background:var(--surface);border-color:transparent}
.dash-card-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;flex-wrap:wrap}
.dash-card-head h2{font-size:20px;line-height:26px;font-weight:600;letter-spacing:-.02em}
.dash-card-head p{font-size:14px;line-height:20px;color:var(--ink-2);margin-top:2px}
.dash-side{width:308px;flex-shrink:0}
.stat{height:184px;display:flex;flex-direction:column;padding:22px}
.stat-top{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:26px}
.stat-top>span:first-child{font-size:14px;font-weight:600}
.stat-icon{width:28px;height:28px;border-radius:9px;background:#f2f2f2;display:inline-flex;align-items:center;justify-content:center}
.stat-value{display:flex;align-items:baseline;gap:6px;margin-top:12px;flex-wrap:wrap}
.stat-value strong{font-size:32px;line-height:36px;font-weight:600;letter-spacing:-.03em;font-variant-numeric:tabular-nums}
.stat-value span{font-size:14px;color:var(--ink-2)}
.stat .meter{margin-top:14px}
.stat-foot{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:auto}
.stat-foot .t-cap{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.stat-link{font-size:13px;font-weight:600;display:inline-flex;align-items:center;gap:4px;white-space:nowrap}
.stat-link:hover{color:var(--ink-2)}
.stat .mono{font-size:11.5px}
.dash-notice{display:flex;align-items:center;gap:10px;border-radius:16px;padding:14px 16px;font-size:14px;line-height:20px;background:var(--amber-tint);color:var(--amber-ink)}
.dash-notice .grow b{font-weight:600}
.dash-notice.warn{background:var(--warn-tint);color:var(--warn-ink)}
.dash-notice button{font-weight:600;color:var(--ink);white-space:nowrap}

/* Onboarding */
.onboard{background:var(--surface);border-radius:28px;padding:32px 36px}
.onboard h2{font-size:30px;line-height:36px;font-weight:600;letter-spacing:-.03em;margin-top:14px}
.onboard-steps{margin-top:20px}
.onboard-step{display:flex;gap:18px;align-items:flex-start;padding:24px 0;border-top:1px solid #e6e6e6}
.onboard-num{width:32px;height:32px;border-radius:999px;background:#ebebeb;display:inline-flex;align-items:center;justify-content:center;font-size:14px;font-weight:600;flex-shrink:0}
.onboard-step.done .onboard-num{background:var(--deal);color:#fff}
.onboard-body{flex:1;min-width:0;display:flex;flex-direction:column;gap:10px}
.onboard-body .t-sub{display:flex;align-items:center;gap:8px}
.onboard-body .code{background:#fff}
.links-card a{display:flex;align-items:center;justify-content:space-between;height:36px;font-size:14px}
.links-card a svg{color:var(--mute)}
.links-card a:hover{color:var(--ink-2)}

/* Usage chart */
.chart-stats{display:flex;gap:40px;margin:22px 0 18px;flex-wrap:wrap}
.chart-stats strong{display:block;font-size:24px;line-height:30px;font-weight:600;letter-spacing:-.02em;font-variant-numeric:tabular-nums}
.chart-stats span{font-size:12px;font-weight:500;color:var(--ink-3)}
.chart-legend{display:flex;gap:18px;flex-wrap:wrap;margin-bottom:16px}
.chart-legend span{display:inline-flex;align-items:center;gap:7px;font-size:13px;color:var(--text-soft)}
.chart-legend i{width:10px;height:10px;border-radius:3px;display:block}
.chart-legend code{font-size:12px}
.chart-legend b{font-weight:600;color:var(--ink);font-variant-numeric:tabular-nums}
.usage-chart{position:relative;display:flex;align-items:flex-end;gap:6px;height:var(--h,180px);padding-left:28px;border-bottom:1px solid var(--line-2)}
.usage-chart.compact{padding-left:0;gap:4px}
.usage-chart .grid-line{position:absolute;left:28px;right:0;height:1px;background:#f1f1f1}
.usage-chart.compact .grid-line{left:0}
.usage-chart .grid-label{position:absolute;left:0;width:20px;text-align:right;font-size:11px;line-height:16px;color:var(--mute);transform:translateY(-8px)}
.bar-col{position:relative;flex:1;height:100%;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;outline:none}
.bar-stack{width:min(20px,62%);display:flex;flex-direction:column-reverse;gap:2px}
.bar-stack i{display:block;width:100%;min-height:2px}
.bar-stack i:last-child{border-radius:4px 4px 0 0}
.bar-col.empty .bar-stack{height:2px;background:#ececec}
.bar-tip{position:absolute;bottom:calc(100% + 8px);left:50%;transform:translateX(-50%);display:none;z-index:4;width:190px;background:#fff;border-radius:12px;box-shadow:var(--shadow-float);padding:10px 12px;pointer-events:none}
.bar-col:hover .bar-tip,.bar-col:focus-visible .bar-tip{display:block}
.bar-col:first-child .bar-tip,.bar-col:nth-child(2) .bar-tip,.bar-col:nth-child(3) .bar-tip{left:0;transform:none}
.bar-col:nth-last-child(-n+3) .bar-tip{left:auto;right:0;transform:none}
.bar-tip-head{display:flex;justify-content:space-between;gap:8px;font-size:12px;font-weight:600;margin-bottom:4px}
.bar-tip-head span{color:var(--ink-3);font-weight:500}
.bar-tip-row{display:flex;justify-content:space-between;align-items:center;height:20px;font-size:12px}
.bar-tip-row span{display:flex;align-items:center;gap:7px;font-family:var(--mono);font-size:11.5px;color:var(--text-soft)}
.bar-tip-row i{width:9px;height:9px;border-radius:3px;display:block}
.bar-tip-row b{font-variant-numeric:tabular-nums}
.chart-axis{position:relative;height:18px;margin-top:8px;margin-left:28px;font-size:11px;color:var(--mute)}
.usage-chart.compact+.chart-axis{margin-left:0}
.chart-axis span{position:absolute;transform:translateX(-50%);white-space:nowrap}
.chart-axis span:first-child{transform:none}
.chart-axis span:last-child{transform:translateX(-100%)}
.chart-data{margin-top:12px;font-size:13px;color:var(--ink-2)}
.chart-data summary{cursor:pointer;font-weight:600;color:var(--ink);width:max-content}
.chart-data ul{columns:3;margin:10px 0 0;padding-left:18px;font-size:12.5px;line-height:20px}

/* Limits, keys and calls */
.limit-row{display:flex;justify-content:space-between;align-items:center;gap:12px;min-height:42px;border-top:1px solid #f0f0f0;font-size:14px}
.limit-row strong{font-weight:600;font-variant-numeric:tabular-nums;font-size:14px}
.key-new{background:#f6fcf8;border:1px solid var(--deal-line);border-radius:22px;padding:24px 28px}
.key-new-head{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap}
.key-new-head .row{gap:12px}
.key-new-icon{width:36px;height:36px;border-radius:12px;background:var(--deal);color:#fff;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0}
.key-new .cmd{margin-top:18px;height:52px;font-size:14px;border-color:#cdeedb}
.key-new .cmd .value{user-select:all}
.key-new p.t-cap{margin-top:12px}
.key-form{display:flex;flex-direction:column;gap:12px}
.key-status{font-size:13px;line-height:18px;color:var(--ink-2)}
.key-summary{font-size:14px;color:var(--ink-2);margin-bottom:12px}
.key-row.revoked td{color:var(--mute)!important}
.calls-empty{padding:28px 0;font-size:14px;color:var(--ink-2)}
.calls-empty a{font-weight:600;color:var(--ink)}
.pager{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 0 6px;font-size:13px;color:var(--ink-3);flex-wrap:wrap}
.usage-layout{display:grid;grid-template-columns:minmax(0,1fr) 420px;gap:16px;align-items:flex-start}
.usage-layout.no-detail{grid-template-columns:minmax(0,1fr)}
.usage-main{display:flex;flex-direction:column;gap:16px;min-width:0}
.detail-card{background:#fff;border-radius:22px;box-shadow:var(--shadow-card);overflow:hidden;position:sticky;top:96px}
.detail-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:18px 20px;border-bottom:1px solid #f0f0f0}
.detail-head h3{font-size:16px;line-height:22px;font-weight:600}
.detail-head p{font-size:12px;color:var(--ink-3);font-family:var(--mono);margin-top:2px}
.detail-body{padding:14px 20px 20px}
.detail-body pre{max-height:560px}
tr.selected td{background:#f7f7f7}

/* Billing */
.billing-layout{display:grid;grid-template-columns:400px minmax(0,1fr);gap:16px;align-items:flex-start}
.billing-side{display:flex;flex-direction:column;gap:16px}
.balance-big{font-size:56px;line-height:60px;font-weight:600;letter-spacing:-.04em;margin-top:6px;font-variant-numeric:tabular-nums}
.how-list{list-style:none;padding:0;margin-top:10px;display:flex;flex-direction:column;gap:8px}
.how-list li{display:flex;gap:8px;align-items:flex-start;font-size:14px;line-height:20px;color:var(--ink-2)}
.how-list svg{color:var(--deal-ink);flex-shrink:0;margin-top:2px}
.topup-custom{display:flex;align-items:center;gap:8px;margin-top:12px}
.topup-custom .input{max-width:200px}
.topup-summary{margin-top:22px;border-top:1px solid #f0f0f0}
.topup-summary div{display:flex;justify-content:space-between;align-items:center;min-height:46px;font-size:14px}
.topup-summary div+div{border-top:1px solid #f0f0f0}
.topup-summary strong{font-weight:600;font-variant-numeric:tabular-nums}
.secure-note{display:flex;align-items:center;justify-content:center;gap:6px;margin-top:12px;font-size:12px;font-weight:500;color:var(--ink-3);text-align:center}
#billing-status,#billing-tab-status{font-size:13px;color:var(--warn-ink);margin-top:10px;text-align:center}

/* ── Responsive ───────────────────────────────────────── */
@media (max-width:1180px){
  .dash-grid-4{grid-template-columns:repeat(2,minmax(0,1fr))}
  .usage-layout{grid-template-columns:minmax(0,1fr)}
  .detail-card{position:static}
  .billing-layout{grid-template-columns:minmax(0,1fr)}
}
@media (max-width:1023px){
  .signin-layout{grid-template-columns:minmax(0,1fr)}
  .signin-visual{display:none}
  .dash-row{flex-direction:column}
  .dash-side{width:auto}
}
@media (max-width:767px){
  .signin-side{padding:20px 16px}
  .signin-title{font-size:32px;line-height:36px}
  .signin-connector{margin-top:36px}
  .dashboard{padding-top:18px}
  .dash-head{align-items:flex-start}
  .dash-head h1{font-size:34px;line-height:38px}
  .dash-actions{width:100%}
  .dash-actions .btn{flex:1}
  .dash-tabs{margin-top:20px;gap:22px}
  .dash-panel{padding-top:18px}
  .dash-grid-4{grid-template-columns:minmax(0,1fr);gap:10px}
  .stat{height:auto;min-height:124px;padding:16px 18px}
  .stat-value{margin-top:6px}
  .stat-value strong{font-size:26px;line-height:32px}
  .stat .meter{margin-top:10px}
  .stat-foot{margin-top:12px}
  .dash-card{padding:18px;border-radius:18px}
  .onboard{padding:24px 20px;border-radius:24px}
  .onboard h2{font-size:24px;line-height:30px}
  .chart-stats{gap:24px}
  .usage-chart{padding-left:0;gap:3px}
  .usage-chart .grid-label{display:none}
  .usage-chart .grid-line{left:0}
  .chart-axis{margin-left:0}
  .chart-data ul{columns:1}
  .key-new{padding:18px}
  .key-new .cmd{height:auto;min-height:52px;padding:10px 6px 10px 14px;flex-wrap:wrap}
  .key-new .cmd .value{white-space:normal;word-break:break-all}
  .balance-big{font-size:44px;line-height:48px}
  .table th:nth-child(n+5),.table td:nth-child(n+5){display:none}
  .table td:last-child,.table th:last-child{display:table-cell}
}
