/* Consortium Vault v0.41.1 – Responsive UI Layer */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

img,
svg,
video,
canvas,
iframe {
  max-width: 100%;
  height: auto;
}

main,
.container,
.page,
.wrapper,
.dashboard,
.admin-dashboard,
.portal-shell,
.login-shell {
  width: min(1180px, calc(100% - 32px)) !important;
  max-width: 1180px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

section,
.card,
.panel,
.box,
.module,
.tile,
.login-card,
.dashboard-card,
.admin-card,
.notice,
form {
  width: 100% !important;
  max-width: 100% !important;
}

/* Dynamische Karten-Layouts */
.grid,
.cards,
.card-grid,
.dashboard-grid,
.admin-grid,
.modules,
.tiles,
.stats,
.kpi-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)) !important;
  gap: 18px !important;
  width: 100% !important;
}

/* Falls alte Seiten einfache direkte DIV-Strukturen nutzen */
main > div,
.container > div,
.page > div,
.wrapper > div {
  max-width: 100%;
}

/* Tabellen auf Handy horizontal scrollbar statt kaputt */
table {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
}

thead,
tbody,
tr {
  width: 100%;
}

td,
th {
  min-width: 120px;
  word-break: normal;
}

/* Formulare dynamisch */
form {
  display: grid;
  gap: 14px;
}

input,
select,
textarea,
button,
.button,
.btn {
  max-width: 100% !important;
}

/* Lange Wallets, IDs, URLs und technische Texte umbrechen */
code,
pre,
.wallet,
.address,
.hash,
.monospace,
.api-output,
pre *,
code * {
  white-space: pre-wrap !important;
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
}

/* Große Überschriften dynamisch */
h1 {
  font-size: clamp(30px, 7vw, 64px) !important;
}

h2 {
  font-size: clamp(22px, 4.5vw, 38px) !important;
}

h3 {
  font-size: clamp(18px, 3.4vw, 26px) !important;
}

p,
li,
td,
th,
label {
  font-size: clamp(14px, 1.6vw, 16px);
}

/* Laptop */
@media (max-width: 1100px) {
  main,
  .container,
  .page,
  .wrapper,
  .dashboard,
  .admin-dashboard,
  .portal-shell,
  .login-shell {
    width: min(100% - 28px, 980px) !important;
  }

  header,
  .hero {
    padding: 28px !important;
  }
}

/* Tablet */
@media (max-width: 820px) {
  body::before {
    font-size: 10px !important;
    line-height: 1.5 !important;
    letter-spacing: 0.08em !important;
  }

  main,
  .container,
  .page,
  .wrapper,
  .dashboard,
  .admin-dashboard,
  .portal-shell,
  .login-shell {
    width: calc(100% - 24px) !important;
  }

  header,
  .hero,
  .card,
  .panel,
  .box,
  .module,
  .tile,
  .login-card,
  .dashboard-card,
  .admin-card,
  .notice,
  form {
    padding: 18px !important;
    border-radius: 18px !important;
  }

  .grid,
  .cards,
  .card-grid,
  .dashboard-grid,
  .admin-grid,
  .modules,
  .tiles,
  .stats,
  .kpi-grid {
    grid-template-columns: 1fr !important;
  }

  button,
  .button,
  .btn,
  input[type="submit"] {
    width: 100% !important;
    justify-content: center !important;
    text-align: center !important;
  }
}

/* Handy */
@media (max-width: 520px) {
  main,
  .container,
  .page,
  .wrapper,
  .dashboard,
  .admin-dashboard,
  .portal-shell,
  .login-shell {
    width: calc(100% - 18px) !important;
  }

  header,
  .hero {
    margin-top: 14px !important;
    margin-bottom: 16px !important;
  }

  h1 {
    line-height: 1.04 !important;
  }

  .card,
  .panel,
  .box,
  .module,
  .tile,
  .login-card,
  .dashboard-card,
  .admin-card,
  .notice,
  form {
    padding: 15px !important;
    margin-bottom: 14px !important;
  }

  input,
  select,
  textarea {
    font-size: 16px !important;
  }

  td,
  th {
    padding: 11px !important;
    min-width: 130px;
  }
}

/* Sehr kleine Handys */
@media (max-width: 380px) {
  body::before {
    font-size: 9px !important;
  }

  h1 {
    font-size: 28px !important;
  }

  .card,
  .panel,
  .box,
  .module,
  .tile,
  .login-card,
  .dashboard-card,
  .admin-card,
  .notice,
  form {
    padding: 13px !important;
  }
}
