/* Keep every public and authenticated surface inside the device viewport. */
html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body,
button,
input,
select,
textarea {
  min-width: 0;
}

button,
input,
select,
textarea,
img,
svg,
video,
canvas {
  max-width: 100%;
}

img,
svg,
video,
canvas {
  height: auto;
}

a,
strong,
small,
p,
h1,
h2,
h3,
.comment {
  overflow-wrap: anywhere;
}

.topbar,
#landing,
.hero,
.workflow,
.steps,
.safety,
.app-shell,
.sidebar,
.workspace,
.grid,
.card,
.data-list,
.data-row,
.task-card,
.copy-box {
  min-width: 0;
  max-width: 100%;
}

.ambient {
  pointer-events: none;
}

.app-shell {
  grid-template-columns: minmax(210px, 250px) minmax(0, 1fr);
}

.top-actions,
.data-row > div:first-child,
.task-card > div,
.page-head > div,
.copy-box input {
  min-width: 0;
}

.top-actions > * {
  flex: 0 0 auto;
}

.row-actions {
  flex-wrap: wrap;
}

.workspace {
  width: 100%;
}

@media (max-width: 1100px) {
  .workspace {
    padding: 28px 22px;
  }

  .admin-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .steps article {
    padding: 25px;
  }

  .safety {
    padding-inline: clamp(24px, 6vw, 70px);
  }
}

@media (min-width: 821px) and (max-width: 900px) {
  .app-shell {
    grid-template-columns: 250px minmax(0, 1fr);
  }

  .sidebar {
    padding: 22px 14px;
  }

  .user-mini {
    justify-content: flex-start;
  }

  .user-mini > div:not(:first-child),
  #sideNav button,
  #sideNav button:not(.active) {
    font-size: 13px;
  }

  #sideNav button {
    justify-content: flex-start;
  }

  #sideNav button i {
    display: block;
    font-size: 13px;
  }
}

@media (max-width: 820px) {
  .app-shell {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  #sideNav button i {
    display: none;
  }

  .sidebar {
    padding-inline: 8px;
  }

  .stats,
  .admin-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .page-head {
    align-items: flex-start;
  }
}

@media (max-width: 680px) {
  html:has(dialog[open]),
  body:has(dialog[open]) {
    height: 100%;
    overflow: hidden;
  }

  .topbar {
    width: 100%;
    height: 64px;
    min-height: 64px;
    padding: 0 10px;
    gap: 8px;
  }

  .brand {
    flex: 0 0 auto;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }

  .top-actions {
    justify-content: flex-end;
    gap: 6px;
  }

  .top-actions .primary,
  .top-actions .ghost {
    padding: 8px 10px;
  }

  .balance {
    padding: 7px 9px;
    font-size: 12px;
  }

  .hero {
    width: 100%;
    padding: 58px 16px 68px;
  }

  .hero h1 {
    font-size: clamp(32px, 10vw, 44px);
    line-height: 1.08;
    letter-spacing: -1.8px;
  }

  .hero > p {
    font-size: 15px;
  }

  .hero-actions > * {
    width: 100%;
    justify-content: center;
  }

  .trust {
    gap: 10px;
    text-align: left;
  }

  .workflow,
  .safety {
    width: 100%;
    padding: 52px 16px;
  }

  .workflow > h2,
  .safety h2 {
    font-size: clamp(28px, 8vw, 36px);
    line-height: 1.15;
  }

  .steps article {
    min-height: 0;
    padding: 22px;
  }

  .safety {
    gap: 32px;
  }

  .shield {
    width: min(190px, 70vw);
    height: 210px;
  }

  .app-shell {
    display: block;
    min-height: calc(100dvh - 64px);
  }

  .sidebar {
    position: sticky;
    top: 64px;
    z-index: 15;
    width: 100%;
    padding: 7px;
    overflow: visible;
    background: #091411f2;
    backdrop-filter: blur(14px);
  }

  #sideNav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(42px, 1fr));
    gap: 4px;
    width: 100%;
    padding: 0;
  }

  #sideNav button {
    justify-content: center;
    width: 100%;
    min-width: 0;
    padding: 9px 4px;
    font-size: 0;
  }

  #sideNav button span {
    font-size: 19px;
  }

  .workspace {
    width: 100%;
    padding: 18px 12px;
  }

  .page-head {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .page-head > select,
  .page-head > button {
    width: 100%;
  }

  .task-card,
  .stats,
  .admin-metrics,
  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .card {
    padding: 16px;
    border-radius: 14px;
  }

  .data-row {
    align-items: flex-start;
  }

  .row-actions {
    width: 100%;
  }

  .row-actions button {
    flex: 1 1 120px;
  }

  .copy-box {
    flex-direction: column;
  }

  .copy-box button {
    width: 100%;
  }

  .empty {
    padding: 26px 12px;
  }

  dialog {
    width: 100vw;
    max-width: none;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border: 0;
    border-radius: 0;
    padding: calc(22px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) calc(22px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    overflow-x: hidden;
    overflow-y: auto;
  }

  .language-dialog {
    overflow-y: hidden;
  }

  #toast {
    right: 10px;
    bottom: 10px;
    left: 10px;
    width: auto;
    max-width: calc(100vw - 20px);
  }
}

/* Kichik ekranlar: ikonalar qatori o‘rniga chapdan ochiladigan nomli menyu. */
.mobile-menu-toggle,
.mobile-menu-backdrop {
  display: none;
}

@media (max-width: 820px) {
  body.mobile-menu-open {
    overflow: hidden;
  }

  .app-authenticated .mobile-menu-toggle {
    display: grid;
    place-content: center;
    gap: 4px;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    padding: 0;
    border: 1px solid #274a40;
    border-radius: 11px;
    background: #10211c;
    cursor: pointer;
  }

  .mobile-menu-toggle span {
    width: 19px;
    height: 2px;
    border-radius: 2px;
    background: #dcebe6;
    transition: transform .2s, opacity .2s;
  }

  .mobile-menu-open .mobile-menu-toggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .mobile-menu-open .mobile-menu-toggle span:nth-child(2) { opacity: 0; }
  .mobile-menu-open .mobile-menu-toggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

  .app-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    top: 72px;
    bottom: 0;
    left: 0;
    z-index: 70;
    width: min(310px, 88vw);
    padding: 18px 14px;
    overflow-y: auto;
    border-right: 1px solid #29483f;
    background: #081511;
    box-shadow: 22px 0 55px #000a;
    visibility: hidden;
    transform: translateX(-105%);
    transition: transform .23s ease, visibility .23s;
    scrollbar-width: thin;
    scrollbar-color: #31584b #081511;
  }

  .sidebar::-webkit-scrollbar { width: 5px; }
  .sidebar::-webkit-scrollbar-track { background: #081511; }
  .sidebar::-webkit-scrollbar-thumb { border-radius: 5px; background: #31584b; }

  .mobile-menu-open .sidebar {
    visibility: visible;
    transform: translateX(0);
  }

  .user-mini {
    display: flex;
    justify-content: flex-start;
  }

  .user-mini > div:not(:first-child) {
    font-size: 14px;
  }

  #sideNav {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    width: 100%;
    padding-top: 16px;
  }

  #sideNav button,
  #sideNav button:not(.active) {
    justify-content: flex-start;
    width: 100%;
    min-width: 0;
    padding: 12px 14px;
    font-size: 13px;
  }

  #sideNav button span {
    width: 24px;
    flex: 0 0 24px;
    font-size: 19px;
    text-align: center;
  }

  #sideNav button i {
    display: block !important;
    min-width: 0;
    overflow: hidden;
    font-size: 13px !important;
    font-style: normal;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .sidebar-note {
    display: block;
    margin-top: 18px;
  }

  .mobile-menu-backdrop {
    position: fixed;
    inset: 72px 0 0;
    z-index: 65;
    width: 100%;
    border: 0;
    background: #010705b8;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s;
  }

  .mobile-menu-open .mobile-menu-backdrop {
    display: block;
    opacity: 1;
    pointer-events: auto;
  }

  .workspace {
    width: 100%;
  }
}

@media (max-width: 680px) {
  .sidebar { top: 64px; }
  .mobile-menu-backdrop { inset-block-start: 64px; }
}

/* Compact earn-tasks layout: reference ergonomics with an original RepX visual. */
.earn-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 390px), 1fr));
  gap: 16px;
  align-items: start;
}

.earn-card {
  min-width: 0;
  padding: 20px;
  border: 1px solid #214038;
  border-radius: 18px;
  background: linear-gradient(145deg, #10221d, #0a1714);
  box-shadow: 0 16px 44px #0003;
}

.earn-card-head,
.earn-person,
.earn-actions > a,
.earn-actions > button {
  display: flex;
  align-items: center;
}

.earn-card-head {
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 17px;
}

.earn-person { gap: 12px; min-width: 0; }
.earn-avatar { width: 46px; height: 46px; flex: 0 0 46px; display: grid; place-items: center; border: 1px solid #2de39d55; border-radius: 13px; object-fit: cover; background: linear-gradient(145deg,#173f33,#0c211b); color: var(--green); font-size: 18px; font-weight: 1000; }
.earn-person-copy { min-width: 0; }
.earn-steam-level { width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center; align-self: center; border: 2px solid #f2c52f; border-radius: 50%; color: #f4d55d; background: #111b18; font-size: 12px; font-weight: 900; }
.earn-person h3 { overflow: hidden; margin: 0 0 2px; text-overflow: ellipsis; white-space: nowrap; font-size: 18px; }
.earn-person a { color: #9eb4ac; font-size: 12px; text-underline-offset: 4px; }
.earn-reward { flex: 0 0 auto; border-radius: 999px; padding: 6px 10px; background: #1d6d5033; color: #67edb8; font-size: 12px; font-weight: 900; white-space: nowrap; }
.earn-comment-row { display: grid; grid-template-columns: minmax(0,1fr) auto; border: 1px solid #28473e; border-radius: 12px; overflow: hidden; background: #07120f; }
.earn-comment { min-height: 52px; padding: 14px 15px; border-left: 3px solid var(--green); display: flex; align-items: center; color: #f2f7f5; font-size: 15px; font-weight: 750; overflow-wrap: anywhere; }
.earn-copy { border-width: 0 0 0 1px !important; border-radius: 0 !important; display: flex; align-items: center; gap: 7px; padding-inline: 17px !important; }
.earn-hint { display: block; margin: 8px 2px 15px; color: var(--muted); font-size: 11px; }
.earn-form { display: grid; gap: 13px; }
.earn-actions { display: grid; grid-template-columns: 1fr 1.35fr; gap: 10px; }
.earn-actions > a,
.earn-actions > button { min-height: 46px; justify-content: center; text-align: center; text-decoration: none; }

@media (max-width: 620px) {
  .earn-list { grid-template-columns: 1fr; }
  .earn-card { padding: 16px; border-radius: 16px; }
  .earn-card-head { gap: 10px; }
  .earn-avatar { width: 42px; height: 42px; flex-basis: 42px; }
  .earn-reward { font-size: 11px; }
  .earn-copy { padding-inline: 13px !important; }
  .earn-actions { grid-template-columns: 1fr 1fr; }
  .earn-actions > a,
  .earn-actions > button { padding: 10px 8px; font-size: 12px; }
  .earn-hint { line-height: 1.45; }
}

@media (max-width: 380px) {
  .earn-avatar { width: 38px; height: 38px; flex-basis: 38px; }
  .earn-steam-level { width: 30px; height: 30px; flex-basis: 30px; font-size: 11px; }
  .earn-person { gap: 8px; }
  .earn-comment-row { grid-template-columns: 1fr; }
  .earn-copy { border-width: 1px 0 0 !important; justify-content: center; }
  .earn-actions { grid-template-columns: 1fr; }
}

.profile-layout { display: grid; grid-template-columns: minmax(280px,.72fr) minmax(0,1.28fr); gap: 16px; align-items: start; }
.profile-connect { display: grid; gap: 16px; position: sticky; top: 96px; }
.profile-connect h3,.profile-connect p { margin: 0; }
.profile-connect p { color: var(--muted); font-size: 12px; }
.profile-list > h3 { margin-bottom: 16px; }
.steam-profile-list { display: grid; gap: 12px; }
.steam-profile-card { padding: 16px; border: 1px solid #214038; border-radius: 15px; background: #091713; }
.steam-profile-card.is-private { border-color: #793c45; background: linear-gradient(145deg,#211316,#0c1613); }
.steam-profile-card > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.steam-profile-main { display: flex; align-items: center; gap: 13px; min-width: 0; }
.steam-profile-main img,.steam-profile-fallback { width: 62px; height: 62px; flex: 0 0 62px; border-radius: 14px; object-fit: cover; background: #16362c; border: 1px solid #2a4d42; }
.steam-profile-fallback { display: grid; place-items: center; color: var(--green); font-size: 24px; font-weight: 1000; }
.steam-profile-main h3 { overflow: hidden; margin: 0 0 3px; text-overflow: ellipsis; white-space: nowrap; }
.steam-level { width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center; border: 2px solid #f2c52f; border-radius: 50%; color: #f4d55d; background: #111b18; font-size: 12px; font-weight: 900; }
.steam-profile-main a { color: var(--muted); font-size: 11px; text-underline-offset: 3px; }
.profile-alert { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: #ff5e6d; color: #fff; font-size: 20px; font-weight: 1000; box-shadow: 0 0 22px #ff5e6d55; }
.profile-status-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-top: 15px; }
.profile-status-grid > div { padding: 10px; border: 1px solid #1d352e; border-radius: 11px; background: #07120f; }
.profile-status-grid span,.profile-status-grid b { display: block; }
.profile-status-grid span { color: var(--muted); font-size: 10px; margin-bottom: 3px; }
.profile-status-grid b { font-size: 12px; }
.profile-status-grid .ok { color: #50e9a9; }.profile-status-grid .bad { color: #ff7c89; }.profile-status-grid .unknown { color: #e0bb68; }
.profile-warning { display: flex; align-items: flex-start; gap: 9px; margin-top: 12px; padding: 11px; border-radius: 11px; background: #5f222a66; color: #ffb4bb; font-size: 11px; line-height: 1.45; }
.profile-warning strong { width: 20px; height: 20px; flex: 0 0 20px; display: grid; place-items: center; border-radius: 50%; background: #ff6170; color: #fff; }
.profile-delete { width: 100%; margin-top: 13px; }
@media(max-width:900px){.profile-layout{grid-template-columns:1fr}.profile-connect{position:static}.profile-status-grid{grid-template-columns:1fr 1fr 1fr}}
@media(max-width:480px){.profile-layout{gap:12px}.profile-list{padding:12px}.steam-profile-card{padding:13px}.steam-profile-main img,.steam-profile-fallback{width:52px;height:52px;flex-basis:52px}.profile-status-grid{grid-template-columns:1fr}.profile-status-grid>div{display:flex;justify-content:space-between;align-items:center;gap:10px}.profile-status-grid span{margin:0}.steam-profile-main h3{font-size:16px}}

@media (max-width: 460px) {
  .top-actions {
    gap: 4px;
  }

  .top-actions .primary,
  .top-actions .ghost {
    padding: 7px 8px;
    font-size: 12px;
  }

  .hero,
  .workflow,
  .safety {
    padding-inline: 13px;
  }

  .workspace {
    padding-inline: 10px;
  }

  .steps article,
  .card {
    padding: 14px;
  }

  .data-row {
    flex-direction: column;
    align-items: stretch;
  }

  .stats .stat strong {
    font-size: 24px;
  }
}

/* Task creation guidance, filters and coming-soon state. */
.task-create-form > label,
.task-create-form > .feature-soon {
  align-content: start;
  min-width: 0;
}

.field-label {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 22px;
  color: #b8cac4;
  font-size: 12px;
  font-weight: 800;
}

.field-help {
  display: inline-grid;
  place-items: center;
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  padding: 0;
  border: 1px solid #2b6150;
  border-radius: 50%;
  background: #173329;
  color: var(--green);
  font-size: 11px;
  font-weight: 1000;
  line-height: 1;
  cursor: help;
  transition: border-color .18s, background .18s, transform .18s;
}

.field-help:hover,
.field-help:focus-visible {
  border-color: var(--green);
  background: #21513f;
  outline: none;
  transform: translateY(-1px);
}

.field-tooltip {
  position: fixed;
  z-index: 200;
  width: min(310px, calc(100vw - 24px));
  padding: 11px 13px;
  border: 1px solid #34725d;
  border-radius: 11px;
  background: #10241e;
  color: #e9f6f1;
  box-shadow: 0 14px 34px #0009;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.5;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity .15s, transform .15s;
}

.field-tooltip.show {
  opacity: 1;
  transform: none;
}

.feature-soon {
  display: grid;
  gap: 6px;
}

.coming-soon-control {
  min-height: 47px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 13px;
  border: 1px solid #2de39d66;
  border-radius: 10px;
  background: linear-gradient(135deg, #12392c, #0a211a);
  box-shadow: inset 0 0 24px #2de39d0a, 0 0 18px #2de39d0b;
}

.soon-spark {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  flex: 0 0 29px;
  border-radius: 9px;
  background: #2de39d1c;
  color: var(--green);
  font-size: 15px;
}

.coming-soon-control strong,
.coming-soon-control small {
  display: block;
}

.coming-soon-control strong {
  color: var(--green);
  font-size: 13px;
  letter-spacing: .2px;
}

.coming-soon-control small {
  color: #9cb7ae;
  font-size: 10px;
  font-weight: 650;
}

.cost-box {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #07120f;
}

@media (max-width: 680px) {
  .field-tooltip {
    width: calc(100vw - 24px);
  }

  .cost-box {
    align-items: flex-start;
    flex-direction: column;
  }
}
 .side-subnav{display:grid;gap:4px;margin:-6px 0 6px 34px}.side-subnav button{padding:9px 12px!important;font-size:12px!important}.side-subnav.hidden{display:none}
