/* R2 layout override: remove nested-card feel and prevent mobile overflow. */
.tron-ms-shell,.tron-ms-shell *{box-sizing:border-box}.tron-ms-shell{width:100%;max-width:100%;min-width:0;overflow-x:hidden}.tron-ms-shell [class^="tron-ms-"],.tron-ms-shell [class*=" tron-ms-"]{min-width:0}.tron-ms-shell img,.tron-ms-shell svg,.tron-ms-shell canvas{max-width:100%;height:auto}.tron-ms-shell input,.tron-ms-shell select,.tron-ms-shell textarea,.tron-ms-shell button{max-width:100%;min-width:0}.tron-ms-shell pre,.tron-ms-shell code,.tron-ms-console,.tron-ms-preview{max-width:100%;overflow-wrap:anywhere;word-break:break-word;white-space:pre-wrap}

/* Top function tabs: no outer card wrapping individual card-like tabs. */
.tron-ms-tabs{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:5px!important;margin:5px 0!important;padding:0!important;background:transparent!important;border:0!important;box-shadow:none!important;border-radius:0!important;overflow:visible!important}.tron-ms-tabs button{width:100%!important;min-width:0!important;margin:0!important;border-radius:5px!important;white-space:normal!important;overflow-wrap:anywhere!important}

/* Signing method choices: only the two choices are independent cards. */
.tron-ms-mode-switch{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:5px!important;padding:0!important;margin:10px 0!important;background:transparent!important;border:0!important;box-shadow:none!important;border-radius:0!important;overflow:visible!important}.tron-ms-mode-switch label{width:100%!important;min-width:0!important;margin:0!important;border-radius:5px!important}.tron-ms-mode-switch label span{overflow-wrap:anywhere!important;word-break:break-word!important}

/* Selected-method content should not look like another card nested inside the main card. */
.tron-ms-sign-panel{max-width:100%!important;margin:8px 0 0!important;padding:0!important;background:transparent!important;box-shadow:none!important;border:0!important;border-radius:0!important}

/* Approval subtabs follow the same single-layer rule. */
.tron-ms-subtabs{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:5px!important;padding:0!important;background:transparent!important;border:0!important;box-shadow:none!important;border-radius:0!important}.tron-ms-subtabs button{width:100%!important;min-width:0!important;border-radius:5px!important;white-space:normal!important}

/* Flexible rows/grids must be allowed to shrink. */
.tron-ms-target-load-row,.tron-ms-active-grid,.tron-ms-approval-account-grid,.tron-ms-approval-grid,.tron-ms-transfer-grid,.tron-ms-transfer-flow,.tron-ms-asset-picker,.tron-ms-reauth-signers,.tron-ms-submit-actions,.tron-ms-approval-actions,.tron-ms-transfer-actions,.tron-ms-trx-note-actions,.tron-ms-sync-row{max-width:100%!important;min-width:0!important}.tron-ms-summary-row strong,.tron-ms-summary-row div,.tron-ms-inline-note,.tron-ms-compact-meta,.tron-ms-address-list,.tron-ms-signer-list,.tron-ms-check-permissions,.tron-ms-check-live,.tron-ms-approval-info,.tron-ms-transfer-meta{max-width:100%!important;overflow-wrap:anywhere!important;word-break:break-word!important}

@media(max-width:767.98px){
  .tron-ms-shell{width:100%!important;max-width:100%!important;margin-left:0!important;margin-right:0!important;padding-left:0!important;padding-right:0!important}
  .tron-ms-hero,.tron-ms-card,.tron-ms-fee-banner,.tron-ms-console-card,.tron-ms-aftercare,.tron-ms-approval-panel,.tron-ms-workspace-card{width:100%!important;max-width:100%!important;min-width:0!important;margin-left:0!important;margin-right:0!important;overflow:hidden!important}
  .tron-ms-tabs{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .tron-ms-mode-switch{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .tron-ms-target-load-row,.tron-ms-active-grid,.tron-ms-approval-account-grid,.tron-ms-approval-grid,.tron-ms-transfer-grid,.tron-ms-transfer-flow,.tron-ms-asset-picker,.tron-ms-reauth-signers{display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:8px!important}
  .tron-ms-secret-line{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;max-width:100%!important}
  .tron-ms-primary-button,.tron-ms-secondary-button,.tron-ms-add-button,.tron-ms-revoke-button{white-space:normal!important;overflow-wrap:anywhere!important}
  .tron-ms-submit-actions,.tron-ms-approval-actions,.tron-ms-transfer-actions,.tron-ms-trx-note-actions{display:flex!important;flex-wrap:wrap!important;gap:6px!important}
  .tron-ms-submit-actions>* ,.tron-ms-approval-actions>* ,.tron-ms-transfer-actions>* ,.tron-ms-trx-note-actions>*{flex:1 1 180px!important;min-width:0!important}
}
@media(max-width:420px){.tron-ms-tabs,.tron-ms-mode-switch,.tron-ms-subtabs{grid-template-columns:minmax(0,1fr)!important}}

/* R3 tab refinement: visible pale background when inactive; selected state remains original. */
.tron-ms-tabs button:not(.is-active):not([aria-selected="true"]),
.tron-ms-subtabs button:not(.is-active):not([aria-selected="true"]){
  background:linear-gradient(180deg,#fffaf0 0%,#f8edda 100%)!important;
  border-color:#ead9bc!important;
  color:#735f43!important;
  box-shadow:0 2px 7px rgba(120,88,42,.06)!important;
}
.tron-ms-tabs button:not(.is-active):not([aria-selected="true"]):hover,
.tron-ms-subtabs button:not(.is-active):not([aria-selected="true"]):hover{
  background:linear-gradient(180deg,#fff5e2 0%,#f3dfbd 100%)!important;
  border-color:#dcc397!important;
}
.tron-ms-mode-switch label:not(.is-active):not(:has(input:checked)){
  background:linear-gradient(180deg,#f7fbff 0%,#edf6ff 100%)!important;
  border-color:#cfe3f6!important;
  box-shadow:0 2px 7px rgba(39,109,168,.06)!important;
}
.tron-ms-mode-switch label:not(.is-active):not(:has(input:checked)):hover{
  background:linear-gradient(180deg,#eef8ff 0%,#e1f1ff 100%)!important;
  border-color:#b9d8f0!important;
}

/* R5 signing-mode tabs: stronger inactive contrast while preserving selected state. */
.tron-ms-mode-switch label:not(.is-active):not(:has(input:checked)){
  background:linear-gradient(180deg,#e8f4ff 0%,#d7ebfb 100%)!important;
  border-color:#9bc7e6!important;
  color:#245d84!important;
  box-shadow:0 2px 8px rgba(35,98,142,.12)!important;
}
.tron-ms-mode-switch label:not(.is-active):not(:has(input:checked)):hover{
  background:linear-gradient(180deg,#dcefff 0%,#c8e3f7 100%)!important;
  border-color:#79b4dc!important;
  color:#174c73!important;
  box-shadow:0 3px 10px rgba(35,98,142,.16)!important;
}

/* R6 signing-mode tabs: medium blue inactive state for clearer separation. */
.tron-ms-mode-switch label:not(.is-active):not(:has(input:checked)){
  background:linear-gradient(180deg,#a8c5e0 0%,#8fb4d6 100%)!important;
  border-color:#729fc7!important;
  color:#173f61!important;
  box-shadow:0 2px 9px rgba(34,79,119,.18)!important;
}
.tron-ms-mode-switch label:not(.is-active):not(:has(input:checked)):hover{
  background:linear-gradient(180deg,#99bad9 0%,#7da8cf 100%)!important;
  border-color:#5e8fb9!important;
  color:#123653!important;
  box-shadow:0 3px 11px rgba(34,79,119,.24)!important;
}

/* R7 signing-mode tabs: exactly match top function-tab selected/inactive colors. */
.tron-ms-tabs button:not(.is-active):not([aria-selected="true"]),
.tron-ms-subtabs button:not(.is-active):not([aria-selected="true"]),
.tron-ms-mode-switch label:not(.is-active):not(:has(input:checked)){
  background:linear-gradient(180deg,#fffaf0 0%,#f8edda 100%)!important;
  border-color:#ead9bc!important;
  color:#735f43!important;
  box-shadow:0 2px 7px rgba(120,88,42,.06)!important;
}
.tron-ms-tabs button:not(.is-active):not([aria-selected="true"]):hover,
.tron-ms-subtabs button:not(.is-active):not([aria-selected="true"]):hover,
.tron-ms-mode-switch label:not(.is-active):not(:has(input:checked)):hover{
  background:linear-gradient(180deg,#fff5e2 0%,#f3dfbd 100%)!important;
  border-color:#dcc397!important;
  color:#735f43!important;
  box-shadow:0 2px 8px rgba(120,88,42,.09)!important;
}
.tron-ms-tabs button.is-active,
.tron-ms-tabs button[aria-selected="true"],
.tron-ms-subtabs button.is-active,
.tron-ms-subtabs button[aria-selected="true"],
.tron-ms-mode-switch label.is-active,
.tron-ms-mode-switch label:has(input:checked){
  background:#b83232!important;
  border-color:#b83232!important;
  color:#fff!important;
  box-shadow:0 3px 10px rgba(184,50,50,.20)!important;
}
.tron-ms-mode-switch label.is-active span,
.tron-ms-mode-switch label:has(input:checked) span{
  color:#fff!important;
}

/* R8 final tab colors.
 * Top function tabs: selected #c69131; inactive keeps the existing warm pale treatment.
 * Signing-mode tabs: selected TronLink-style blue; inactive light blue.
 */
.tron-ms-tabs button:not(.is-active):not([aria-selected="true"]),
.tron-ms-subtabs button:not(.is-active):not([aria-selected="true"]){
  background:linear-gradient(180deg,#fffaf0 0%,#f8edda 100%)!important;
  border-color:#ead9bc!important;
  color:#735f43!important;
  box-shadow:0 2px 7px rgba(120,88,42,.06)!important;
}
.tron-ms-tabs button:not(.is-active):not([aria-selected="true"]):hover,
.tron-ms-subtabs button:not(.is-active):not([aria-selected="true"]):hover{
  background:linear-gradient(180deg,#fff5e2 0%,#f3dfbd 100%)!important;
  border-color:#dcc397!important;
  color:#735f43!important;
}
.tron-ms-tabs button.is-active,
.tron-ms-tabs button[aria-selected="true"],
.tron-ms-subtabs button.is-active,
.tron-ms-subtabs button[aria-selected="true"]{
  background:#c69131!important;
  border-color:#c69131!important;
  color:#fff!important;
  box-shadow:0 3px 10px rgba(198,145,49,.24)!important;
}

.tron-ms-mode-switch label:not(.is-active):not(:has(input:checked)){
  background:linear-gradient(180deg,#eaf4ff 0%,#dceeff 100%)!important;
  border-color:#b7d7f4!important;
  color:#245d84!important;
  box-shadow:0 2px 8px rgba(33,111,178,.10)!important;
}
.tron-ms-mode-switch label:not(.is-active):not(:has(input:checked)):hover{
  background:linear-gradient(180deg,#deefff 0%,#cde6fb 100%)!important;
  border-color:#91c1e9!important;
  color:#174c73!important;
  box-shadow:0 3px 10px rgba(33,111,178,.15)!important;
}
.tron-ms-mode-switch label.is-active,
.tron-ms-mode-switch label:has(input:checked){
  background:#1677ff!important;
  border-color:#1677ff!important;
  color:#fff!important;
  box-shadow:0 3px 10px rgba(22,119,255,.26)!important;
}
.tron-ms-mode-switch label.is-active span,
.tron-ms-mode-switch label:has(input:checked) span{
  color:#fff!important;
}
