/* Models (md-), Gateway Status (gs-), Model Status (ms-) */

/* ---------- Models: toolbar ---------- */
.md-tools{display:flex;align-items:center;gap:10px;min-width:0}
/* Toolbar size (34), as on Request Logs: search, currency (.seg sm) and the three selects. */
.md-search{flex:1 1 auto;min-width:0;display:flex;align-items:center;gap:8px;height:var(--h-sm);padding:0 8px 0 12px;background:var(--surface);border:1px solid var(--line-control);border-radius:8px;color:var(--text);cursor:text;transition:border-color var(--dur-1) var(--ease-std),box-shadow var(--dur-1) var(--ease-std)}
.md-search:hover{border-color:var(--text-3)}
.md-search:focus-within{border-color:var(--accent);box-shadow:var(--ring)}
.md-search > .i{width:14px;height:14px;color:var(--text-3);flex:0 0 14px}
.md-search input{flex:1;min-width:0;border:0;outline:0;background:transparent;font:inherit;font-size:13px;color:inherit;padding:0}
.md-search input::placeholder{color:var(--text-3)}
.md-search input::-webkit-search-cancel-button{display:none}
.md-search input:focus-visible{outline:none}
.md-search:focus-within kbd{visibility:hidden}
.md-dd .dd-btn{color:var(--text-2)}
.md-dd .dd-btn > .i:first-child{color:var(--text-3)}
.md-msub{display:none}

/* ---------- Models: table ---------- */
.md-card{overflow:hidden}
.md-tbl td{line-height:18px}
/* Fixed columns, each wide enough for its widest value in USD or IDR, so switching
   currency never moves a column (padding included; room for one more digit). Model
   takes the rest. */
.md-tbl{table-layout:fixed}
.md-tbl .md-c-ctx{width:86px}
.md-tbl .md-c-cap{width:156px}
.md-tbl .md-c-price{width:188px}
.md-tbl .md-c-off{width:206px}
.md-tbl .md-c-up{width:150px}
.md-tbl .md-c-st{width:132px}
.md-tbl .md-ci,.md-tbl .md-co{display:block;white-space:nowrap}
.md-tbl .md-ci{font-size:13px;line-height:17px;color:var(--text)}
.md-tbl .md-co{font-size:11px;line-height:14px;color:var(--text-3);margin-top:2px}
.md-ci i,.md-co i{font-style:normal;font-size:11px;color:var(--text-3)}
.md-tbl .namecell{gap:12px}
.md-nt{display:flex;flex-direction:column;gap:2px;min-width:0;flex:0 1 auto}
.md-tbl .md-id{font-size:13px;color:var(--text);white-space:nowrap;line-height:17px;overflow:hidden;text-overflow:ellipsis}
.md-prov{font-size:12px;color:var(--text-3);line-height:15px}
.md-acts{display:inline-flex;gap:2px;flex:0 0 auto}
.md-acts .copy{width:26px;height:26px;flex-basis:26px}
.md-try{opacity:0;transition:opacity var(--dur-1) var(--ease-std),background-color var(--dur-1) var(--ease-std),color var(--dur-1) var(--ease-std)}
.md-tbl tr:hover .md-try,.md-try:focus-visible{opacity:1}
.md-caps{display:flex;gap:6px}
.md-cap{width:26px;height:26px;border-radius:6px;background:var(--tint-2);display:grid;place-items:center;color:var(--text-2)}
.md-cap .i{width:13px;height:13px}
.md-tbl .md-p1{font-size:13px;color:var(--text);white-space:nowrap;line-height:17px}
.md-p1 .t3,.md-per{color:var(--text-3);font-size:11px}
.md-per{display:none}
.md-tbl .md-p2{font-size:11px;color:var(--text-3);margin-top:2px;white-space:nowrap;line-height:14px}
.md-tbl .md-off{display:flex;align-items:center;gap:5px;font-size:13px;color:var(--text-3);white-space:nowrap;line-height:17px}
.md-off s{text-decoration-thickness:1px;text-decoration-color:var(--text-3)}
.md-tbl .md-save{font-size:11px;color:var(--accent-text);margin-top:2px;line-height:14px}
.md-up{display:flex;gap:2px;align-items:center;height:18px}
.md-up i{flex:1;height:18px;border-radius:2px;background:var(--tint-4);transition:opacity var(--dur-1) var(--ease-std)}
.md-up i.g{background:var(--ok-fill)}
.md-up i.a{background:var(--warn-fill)}
.md-up i.r{background:var(--err-fill)}
.md-up i.n{background:color-mix(in srgb,var(--ok-fill) 22%,transparent)}
.md-up:hover i{opacity:.55}
.md-up:hover i:hover{opacity:1}
.md-c-st .badge{vertical-align:top}
.md-tbl .md-pct{font-size:11px;color:var(--text-3);margin-top:3px;line-height:14px}
.md-tbl .md-pct.warn{color:var(--warn)}.md-tbl .md-pct.err{color:var(--err)}
.md-offline td{color:var(--text-3)}
.md-offline .md-id{color:var(--text-2)}
.md-offline .plogo{opacity:.6}
.md-none td{padding:0!important}
.md-foot{color:var(--text-2)}
.md-foot .link-btn{font-size:12px}
.md-more .i{width:14px;height:14px;color:var(--text-2)}
.md-sk{display:flex;flex-direction:column}
.md-skr{display:flex;align-items:center;gap:24px;padding:14px 22px;border-bottom:1px solid var(--line)}
.md-skr:last-child{border-bottom:0}
.md-errw{padding:18px}

/* ---------- Models: bottom cards ---------- */
.md-bottom{align-items:stretch}
.md-bottom > *{flex:1 1 0}
.md-tiers{display:flex;flex-direction:column;gap:14px}
.md-tdesc{font-size:13px;color:var(--text-2);line-height:20px}
.md-th,.md-tier{display:grid;grid-template-columns:70px minmax(0,1fr) minmax(80px,auto) 14px;gap:14px;align-items:center}
.md-th{font-size:12px;font-weight:500;color:var(--text-3);padding-bottom:6px;border-bottom:1px solid var(--line)}
.md-th span:nth-child(3){text-align:right}
.md-tl{display:flex;flex-direction:column}
.md-tier{width:100%;text-align:left;padding:12px 6px;margin:0 -6px;width:calc(100% + 12px);border-bottom:1px solid var(--line);border-radius:0}
.md-tier:last-child{border-bottom:0}
.md-tier:hover{background:var(--tint-1)}
.md-tier.on{background:var(--accent-soft);box-shadow:inset 0 0 0 1px var(--accent-line);border-radius:8px}
.md-tv{font-size:14px;font-weight:500;color:var(--text)}
.md-tm{display:flex;align-items:center;gap:10px;min-width:0;font-size:12px;color:var(--text-2)}
.md-logos{display:flex;flex:0 0 auto}
.md-lg{width:22px;height:22px;border-radius:50%;background:var(--surface-2);border:2px solid var(--surface);display:grid;place-items:center;margin-left:-6px}
.md-lg:first-child{margin-left:0}
.md-lg .plogo.sm img{width:12px;height:12px}
.md-tp{white-space:nowrap;font-size:12px;color:var(--text-3);text-align:right}
.md-tc{width:14px;height:14px;color:var(--text-3)}
.md-tnote{font-size:13px;padding:12px 0}
.md-tmore{padding-top:10px}
.md-bill{padding:22px;display:flex;flex-direction:column}
.md-bh{display:flex;align-items:center;gap:8px;font-size:16px;font-weight:500;padding-bottom:6px}
.md-bh .i{color:var(--accent)}
.md-bl{display:flex;flex-direction:column;flex:1}
.md-bi{display:flex;gap:12px;padding:12px 0;border-bottom:1px solid var(--accent-line)}
.md-bi:last-child{border-bottom:0}
.md-bic{width:28px;height:28px;border-radius:8px;background:var(--surface);display:grid;place-items:center;flex:0 0 28px;color:var(--accent)}
.md-bic .i{width:14px;height:14px}
.md-bi b{display:block;font-size:13px;font-weight:500;color:var(--text);margin-bottom:3px}
.md-bi p{font-size:12px;color:var(--text-2);line-height:19px}
.md-bf{display:flex;justify-content:space-between;align-items:center;gap:12px;padding-top:12px;margin-top:6px;border-top:1px solid var(--accent-line);font-size:12px;color:var(--text-2)}

/* ---------- Gateway Status ---------- */
.gs-health{position:relative;overflow:hidden;min-height:150px;padding:24px;display:flex;flex-direction:column;justify-content:center}
.gs-health .art{left:auto;width:51%}
.gs-hl{position:relative;z-index:2;display:flex;flex-direction:column;gap:8px;max-width:62%}
.gs-state{display:flex;align-items:center;gap:10px}
.gs-state h2{font-size:24px;font-weight:500;letter-spacing:-.6px;line-height:30px}
.gs-dot{width:14px;height:14px;border-radius:50%;background:var(--ok-soft);display:grid;place-items:center;flex:0 0 14px}
.gs-dot i{width:8px;height:8px;border-radius:50%;background:var(--ok-fill)}
.gs-dot.warn{background:var(--warn-soft)}.gs-dot.warn i{background:var(--warn-fill)}
.gs-dot.mute{background:var(--tint-2)}.gs-dot.mute i{background:var(--tint-4)}
.gs-hic{display:none}
.gs-sub{font-size:14px;color:var(--text-2);line-height:20px}
.gs-link{color:var(--accent-text);font-weight:500}
.gs-link:hover{text-decoration:underline;text-underline-offset:3px}
.gs-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px}
.gs-oh{white-space:nowrap}
.gs-geo{overflow:hidden}
.gs-geo-b{padding:0 22px 18px}
.gs-gh,.gs-gr{display:grid;grid-template-columns:minmax(150px,220px) minmax(0,1fr) 44px 96px;column-gap:16px;align-items:center}
.gs-gh{font-size:12px;color:var(--text-3);padding:2px 0 8px}
.gs-gh .r{text-align:right}
.gs-gr{min-height:29px}
.gs-gn{display:flex;align-items:center;gap:10px;min-width:0;font-size:13px;color:var(--text)}
.gs-flag{width:20px;flex:0 0 20px;font-size:15px;line-height:1;text-align:center;font-family:"Twemoji Country Flags","Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif}
.gs-gd{width:20px;flex:0 0 20px;display:grid;place-items:center}
.gs-gd::before{content:"";width:8px;height:8px;border-radius:50%;background:var(--tint-4)}
.gs-gi{width:16px;height:16px;flex:0 0 20px;color:var(--text-3)}
.gs-gr.other .gs-gn,.gs-gr.unknown .gs-gn{color:var(--text-2)}
.gs-gp,.gs-gq{font-size:12px;color:var(--text-2);text-align:right;font-variant-numeric:tabular-nums}
.gs-gq{font-size:13px}
.gs-gm{display:none}
.gs-top{overflow:hidden}
.gs-th{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;padding:18px 22px}
.gs-th h2{font-size:16px;font-weight:500;line-height:20px}
.gs-th .card-meta{font-size:11px}
.gs-tbl th{border-top:1px solid var(--line)}
.gs-tbl .namecell b{font-size:14px;font-weight:500}
.gs-tbl td.mono{font-size:13px;color:var(--text-2)}
.gs-tbl td.warn{color:var(--warn)}
.gs-tbl td.gs-tok{white-space:nowrap}
.gs-tbl .gs-share{width:200px}
.gs-tbl .gs-share .track{flex:0 0 120px;min-width:0}
.gs-tbl .gs-share .share span{width:auto;font-size:12px}
.gs-tbl .gs-m{display:none}
.gs-top .card-foot .mono{font-size:11px}
.gs-sk{display:flex;flex-direction:column;gap:14px;padding:0 22px 22px}

/* ---------- Model Status ---------- */
.ms-legend{display:flex;align-items:center;gap:14px;flex-wrap:wrap;font-size:12px;color:var(--text-2)}
.ms-legend span{display:inline-flex;align-items:center;gap:6px}
.ms-legend i{width:10px;height:10px;border-radius:2px}
.ms-legend i.g,.ms-cells i.g{background:var(--ok-fill)}
.ms-legend i.a,.ms-cells i.a{background:var(--warn-fill)}
.ms-legend i.r,.ms-cells i.r{background:var(--err-fill)}
.ms-legend i.n,.ms-cells i.n{background:color-mix(in srgb,var(--ok-fill) 22%,transparent)}
.ms-sum{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
.ms-s{padding:18px;display:flex;flex-direction:column;gap:6px;min-width:0}
.ms-sl{display:flex;align-items:center;gap:7px;font-size:12px;font-weight:500;color:var(--text-3)}
.ms-sl .dot{width:7px;height:7px;flex-basis:7px}
.ms-sv{font-size:24px;font-weight:500;letter-spacing:-.6px;line-height:30px;font-variant-numeric:tabular-nums}
.ms-su{font-size:24px}
.ms-ss{font-size:12px;color:var(--text-3)}
.ms-card{overflow:hidden}
.ms-head,.ms-row{display:grid;grid-template-columns:230px minmax(0,1fr) 70px;gap:16px;align-items:center;padding:0 22px}
.ms-head{padding-top:12px;padding-bottom:12px;background:var(--bg-alt);border-bottom:1px solid var(--line);font-size:12px;font-weight:500;color:var(--text-3)}
.ms-head .ms-u{text-align:right;color:inherit}
.ms-head .ms-m{color:inherit;font-size:12px}
.ms-head .ms-um{display:none}
.ms-axis{position:relative;height:15px;font-family:var(--font-code);font-size:11px;font-weight:400;color:var(--text-3)}
.ms-axis span{position:absolute;top:0;white-space:nowrap}
.ms-axis span.now{right:0}
.ms-row{padding-top:11px;padding-bottom:11px;border-bottom:1px solid var(--line)}
.ms-m{display:flex;align-items:center;gap:10px;min-width:0;font-size:12px;color:var(--text)}
.ms-m .plogo.sm img{width:16px;height:16px}
.ms-cells{display:flex;gap:3px;align-items:center;height:18px;min-width:0}
.ms-cells i{flex:1 1 0;min-width:0;height:18px;border-radius:2px;transition:opacity var(--dur-1) var(--ease-std)}
.ms-cells:hover i{opacity:.55}
.ms-cells:hover i:hover{opacity:1}
.ms-b{display:none}
.ms-u{font-size:12px;text-align:right;color:var(--text)}
.ms-u.warn{color:var(--warn)}.ms-u.err{color:var(--err)}
.ms-card .card-foot{color:var(--text-2);border-top:0}
.ms-sk{display:flex;flex-direction:column;gap:16px;padding:22px}
.ms-err{padding:18px}

/* ---------- Responsive ---------- */
/* the fixed columns leave the model name room: drop Capabilities, then Uptime */
@media (max-width:1500px){
  .md-tbl .md-c-cap{display:none}
}
@media (max-width:1320px){
  .md-tbl .md-c-up{display:none}
}
@media (max-width:1180px){
  .md-tools{flex-wrap:wrap}
  .md-search{flex-basis:100%}
  .ms-head,.ms-row{grid-template-columns:170px minmax(0,1fr) 60px;gap:12px}
  .ms-cells{gap:1px}
  .ms-cells i{border-radius:1px}
  .gs-stats{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:1024px){
  .gs-hl{max-width:none}
  .gs-health .art{width:45%;opacity:.55}
  .gs-tbl .gs-tok{display:none}
  .gs-tbl .gs-share{width:150px}
  .gs-tbl .gs-share .track{flex-basis:80px}
}
@media (max-width:720px){
  /* Models: search only, rows become cards */
  .md-cur,.md-dd-prov,.md-dd-cap{display:none}
  .md-search{flex-basis:auto;height:38px}
  .md-search kbd{display:none}
  .md-dd-sort .dd-btn span{display:none}
  .md-dd-sort .dd-btn{width:38px;height:38px;padding:0;justify-content:center}
  .md-dd-sort .dd-btn .chev{display:none}
  .md-tools{flex-wrap:nowrap}
  .md-msub{display:block;font-size:13px;color:var(--text-2);margin-top:-4px}
  .md-tbl thead{display:none}
  .md-tbl,.md-tbl tbody{display:block}
  .md-tbl tr{display:grid;grid-template-columns:minmax(0,1fr) auto auto;grid-template-areas:"name name price" "ctx ctx ctx" "off st st";gap:8px 12px;padding:14px 16px;border-bottom:1px solid var(--line)}
  .md-tbl .md-c-ctx{grid-area:ctx;display:flex;align-items:baseline;gap:8px}
  .md-tbl .md-ci,.md-tbl .md-co{display:inline;margin-top:0;font-size:12px}
  .md-tbl .md-co{color:var(--text-2)}
  .md-tbl tr:last-child{border-bottom:0}
  .md-tbl td{display:block;padding:0!important;border:0;width:auto!important}
  .md-tbl .md-c-name{grid-area:name;min-width:0}
  .md-tbl .md-c-price{grid-area:price;text-align:right}
  .md-tbl .md-c-off{grid-area:off;display:flex;align-items:center;gap:8px;flex-wrap:wrap;align-self:center}
  .md-tbl .md-c-st{grid-area:st;display:flex;align-items:center;gap:8px;justify-content:flex-end}
  .md-tbl .md-c-cap,.md-tbl .md-c-up{display:none}
  .md-tbl tr.md-none{display:block;padding:0}
  .md-tbl .namecell .plogo{background:none;width:24px;height:24px;flex-basis:24px}
  .md-tbl .namecell .plogo img{width:20px;height:20px}
  .md-tbl .md-p1{font-weight:500;font-size:13px}
  .md-per{display:inline}
  .md-tbl .md-off{font-size:12px}
  .md-tbl .md-save{margin-top:0;font-size:12px}
  .md-tbl .md-pct{margin-top:0;font-size:12px;color:var(--text)}
  .md-try{display:none}
  .md-foot{padding:14px 16px}
  .md-foot .c-btn{height:var(--h-sm);padding:0 12px;font-size:13px}
  .md-skr{padding:14px 16px}
  .md-th,.md-tier{grid-template-columns:56px minmax(0,1fr) 64px 14px;gap:10px}
  .md-bill{padding:16px}
  .md-bf{flex-wrap:wrap}

  /* Gateway: tinted banner, one metric card, compact top list */
  .gs-range{display:flex;width:100%}
  .gs-range > button{flex:1}
  .page-head .acts{width:100%}
  .gs-health{min-height:0;padding:16px;background:var(--ok-soft);box-shadow:none}
  .gs-health.bad{background:var(--warn-soft)}
  .gs-health .art{display:none}
  .gs-hl{gap:4px}
  .gs-state{align-items:flex-start}
  .gs-state h2{font-size:16px;font-weight:500;letter-spacing:0;line-height:20px}
  .gs-dot{display:none}
  .gs-hic{display:block;width:18px;height:18px;flex:0 0 18px;color:var(--ok);margin-top:1px}
  .gs-health.bad .gs-hic{color:var(--warn)}
  .gs-sub{font-size:12px;line-height:17px;padding-left:28px}
  .gs-stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:0;background:var(--surface);border-radius:16px;box-shadow:var(--sh-card);overflow:hidden}
  .gs-stat{box-shadow:none;border-radius:0;padding:14px;border-bottom:1px solid var(--line)}
  .gs-stat:nth-child(odd){border-right:1px solid var(--line)}
  .gs-stat .v{font-size:20px;line-height:26px}
  .gs-stat .s{font-size:12px}
  .gs-th{padding:14px 16px 6px}
  .gs-th .card-meta{font-family:inherit;font-size:12px}
  .gs-tbl thead{display:none}
  .gs-tbl td{padding:8px 0;border:0}
  .gs-tbl td:first-child{padding-left:16px}
  .gs-tbl td:last-child{padding-right:16px}
  .gs-tbl td.r,.gs-tbl .gs-share{display:none}
  .gs-tbl .gs-m{display:table-cell;text-align:right;font-size:12px}
  .gs-tbl .namecell{gap:8px}
  .gs-tbl .namecell .plogo{background:none;width:auto;height:auto;flex-basis:auto}
  .gs-tbl .namecell .plogo img{width:16px;height:16px}
  .gs-tbl .namecell b{font-family:var(--font-code);font-weight:400;font-size:13px}
  .gs-top .card-foot,.gs-geo .card-foot{padding:12px 16px;flex-wrap:wrap}
  .gs-oh{white-space:normal}
  /* Countries: flag and name, count · share on the right, the bar below */
  .gs-geo-b{padding:2px 16px 14px}
  .gs-gh{display:none}
  .gs-gr{grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"n m" "t t";row-gap:6px;padding:6px 0}
  .gs-gn{grid-area:n;gap:8px}
  .gs-gr .track{grid-area:t}
  .gs-gp,.gs-gq{display:none}
  .gs-gm{display:block;grid-area:m;font-size:12px;color:var(--text);text-align:right}

  /* Model status: compact list */
  .ms-legend{display:none}
  .ms-sum{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
  .ms-s{padding:12px;border-radius:12px;gap:2px}
  .ms-sv,.ms-su{font-size:20px;line-height:26px}
  .ms-su,.ms-ss{display:none}
  .ms-head,.ms-row{grid-template-columns:minmax(0,1fr) auto auto;padding:0 16px;gap:10px}
  .ms-head{padding-top:12px;padding-bottom:12px}
  .ms-row{padding-top:11px;padding-bottom:11px}
  .ms-axis,.ms-cells,.ms-head .ms-u{display:none}
  .ms-head .ms-um{display:block;text-align:right;grid-column:3}
  .ms-b{display:block}
  .ms-m{font-size:13px}
  .ms-u{font-size:13px}
}
