/* Latent: phone layout and Swiss line for ti&m's e-banking. Injected, the template stays untouched. */
.tr-menu, .tr-swiss { display: none; }

div:has(> main > div > iframe[title=TrustRoom]) > footer { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
div:has(> main > div > iframe[title=TrustRoom]) > footer .tr-swiss { display: inline-flex; position: relative; margin-left: auto; }
.tr-swiss > button { display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none; color: var(--color-text-muted); font: inherit; cursor: pointer; }
.tr-swiss > button:hover { color: var(--color-text); }
.tr-swiss svg { flex: none; border-radius: 2px; }
.tr-pop { display: none; position: absolute; right: 0; bottom: calc(100% + 8px); width: max-content; max-width: min(300px, 80vw); padding: 12px 14px; border: 1px solid var(--color-border); border-radius: var(--radius); background: var(--color-surface); color: var(--color-text); box-shadow: var(--shadow-pop); font-size: 13px; line-height: 1.45; }
.tr-swiss.tr-open .tr-pop { display: block; }
.tr-demo { display: none; }
div:has(> main > div > iframe[title=TrustRoom]) > footer .tr-demo { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border: 1px dashed var(--color-border); border-radius: 999px; background: none; color: var(--color-text-muted); font: inherit; font-size: 11px; cursor: pointer; opacity: 0.7; }
div:has(> main > div > iframe[title=TrustRoom]) > footer .tr-demo:hover, div:has(> main > div > iframe[title=TrustRoom]) > footer .tr-demo:focus-visible { opacity: 1; color: var(--color-text); }
.tr-demo[disabled] { cursor: progress; }
@keyframes tr-ring { 0%, 100% { transform: none; } 20% { transform: scale(1.35); } 40% { transform: scale(0.95); } 60% { transform: scale(1.15); } }
.tr-ring { animation: tr-ring 1.2s ease-out 2; }

@media (max-width: 767.98px) {
  :root { --header-height: 56px; --content-padding: 16px; }
  html, body { overflow-x: hidden; }

  nav:has(button[aria-label="Toggle navigation"]) { width: min(280px, 86vw) !important; z-index: 40; transform: translateX(-100%); visibility: hidden; transition: transform 0.2s, visibility 0.2s; }
  html.tr-nav-open nav:has(button[aria-label="Toggle navigation"]) { transform: none; visibility: visible; box-shadow: var(--shadow-pop); }
  html.tr-nav-open body::after { content: ""; position: fixed; inset: 0; z-index: 30; background: rgb(11 30 42 / 0.5); }
  nav button[aria-label="Toggle navigation"] { display: none; }
  nav:has(button[aria-label="Toggle navigation"]) > div:first-child { padding-left: 68px; }
  nav:has(button[aria-label="Toggle navigation"]) > div:first-child span { font-size: 30px; }
  nav:has(button[aria-label="Toggle navigation"]) + div { margin-left: 0 !important; min-height: 100vh; min-height: 100dvh; min-width: 0; }
  body:has(nav button[aria-label="Toggle navigation"]) .tr-menu { display: flex; }

  .tr-menu { position: fixed; top: 8px; left: 8px; z-index: 50; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: var(--radius-sm); background: none; color: var(--color-primary); cursor: pointer; }
  html.tr-nav-open .tr-menu { color: #fff; }
  .tr-menu .tr-x, html.tr-nav-open .tr-menu .tr-burger { display: none; }
  html.tr-nav-open .tr-menu .tr-x { display: block; }

  nav:has(button[aria-label="Toggle navigation"]) + div > header { height: 56px; padding: 0 4px 0 56px; }
  nav:has(button[aria-label="Toggle navigation"]) + div > header > label { display: none; }
  nav:has(button[aria-label="Toggle navigation"]) + div > header > div { flex: 1; min-width: 0; }
  nav:has(button[aria-label="Toggle navigation"]) + div > header > div > * { flex: 1 1 0; min-width: 0; padding: 0 2px; gap: 0; border-left: 0; }
  nav:has(button[aria-label="Toggle navigation"]) + div > header > div > * > span:first-of-type { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  nav:has(button[aria-label="Toggle navigation"]) + div > header > div > * > span + span { top: 8px; left: calc(50% + 4px); font-size: 10px; padding: 0 5px; }

  main { min-width: 0; }
  [class*="_grid_"], [class*="_tiles_"], [class*="_donuts_"], [class*="_form_"], [class*="_terms_"] { grid-template-columns: minmax(0, 1fr) !important; grid-auto-rows: auto; gap: 16px; }
  [class*="_grid_"] > [style*="grid-area"] { grid-area: auto !important; }
  /* Dashboard tiles are placed with inline grid-column/grid-row; on a phone they stack in one column. */
  [class*="_grid_"] > [style*="grid-column"] { grid-column: 1 / -1 !important; grid-row: auto !important; }
  [class*="_grid_"] > [class*="_emptyCell_"] { display: none; }
  [class*="_rowText_"] { overflow-wrap: anywhere; }
  main table { display: block; max-width: 100%; overflow-x: auto; }
  [class*="_pageHeader_"] { flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
  [class*="_detailList_"], [class*="_review_"] { grid-template-columns: minmax(0, 120px) minmax(0, 1fr) !important; }
  main:has(> div > iframe[title=TrustRoom]) { padding: 0; min-height: 0; }
  main:has(> div > iframe[title=TrustRoom]) > div:not(:has(> iframe)) { display: none; }
  main > div:has(> iframe[title=TrustRoom]) { min-height: 0 !important; border-radius: 0; box-shadow: none; }

  aside[aria-label=TrustRoom] { inset: 0 !important; width: 100% !important; height: 100dvh; border: 0; border-radius: 0; z-index: 60; }
  aside[aria-label=TrustRoom] > header { padding: 8px 8px 8px 16px; min-height: 56px; box-sizing: border-box; }

  #root > div:has(> main > form) { flex-direction: column; }
  #root > div > aside:has(+ main > form) { width: auto; flex-direction: row; align-items: baseline; gap: 12px; padding: 16px 20px; }
  #root > div > aside:has(+ main > form) > span:first-child { font-size: 30px; }
  #root > div > main > form { width: 100%; max-width: 420px; box-sizing: border-box; padding: 24px 20px; }
  #root > div > main:has(> form) { align-items: flex-start; }
}

@media (max-width: 480px) {
  div:has(> main > div > iframe[title=TrustRoom]) > footer { display: none; }
}

@keyframes tr-glow { 0% { box-shadow: 0 0 0 0 rgb(46 107 102 / 0); } 25% { box-shadow: 0 0 0 3px #2e6b66, 0 0 22px 4px rgb(46 107 102 / 0.55); } 100% { box-shadow: 0 0 0 0 rgb(46 107 102 / 0); } }
.tr-glow { border-radius: var(--radius); animation: tr-glow 1.5s ease-out 1; }
