[hidden] { display: none !important; }

:root {
  --chrome-bg: #0c0e11;
  --chrome-bg-soft: #15171a;
  --chrome-line: rgba(255,255,255,.08);
  --chrome-text: #f4f5f6;
  --chrome-muted: rgba(255,255,255,.62);
  --chrome-gold: #e4c363;
  --chrome-gold-soft: rgba(228,195,99,.14);
  --chrome-teal: #65d4c8;
  --chrome-blue: #79b9f2;
  --chrome-violet: #c0a4f3;
  --chrome-green: #7fe3a0;
  --chrome-amber: #f0b36b;
  --chrome-accent: #ed1728;
  --chrome-accent-soft: rgba(237,23,40,.14);
  --chrome-ok: #7fe3a0;
  --chrome-danger: #ff9b90;
  --chrome-radius: 8px;
  --chrome-font-body: 14px;
  --chrome-app-width: 390px;
  --chrome-ease: cubic-bezier(.25,.8,.35,1);
  --chrome-transition-fast: 80ms var(--chrome-ease);
  --chrome-transition: 120ms var(--chrome-ease);
}

html body { font-size: var(--chrome-font-body); }
html body :is(button,input,select,textarea,a):focus-visible { outline: 2px solid var(--chrome-teal); outline-offset: 2px; }
html body main section.panel:nth-of-type(3n + 1) { border-top-color: rgba(121,185,242,.55); }
html body main section.panel:nth-of-type(3n + 2) { border-top-color: rgba(101,212,200,.55); }
html body main section.panel:nth-of-type(3n) { border-top-color: rgba(192,164,243,.55); }

@media (prefers-reduced-motion: reduce) {
  :root { --chrome-transition-fast: 0ms; --chrome-transition: 0ms; }
}

html { scroll-behavior: auto !important; }
html body *, html body *::before, html body *::after {
  transition-duration: 120ms !important;
  transition-delay: 0ms !important;
}

@media (prefers-reduced-motion: reduce) {
  html body *, html body *::before, html body *::after {
    transition-duration: 0ms !important;
    animation-duration: 0ms !important;
    scroll-behavior: auto !important;
  }
}

.app-chrome-header {
  position: sticky;
  z-index: 40;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  height: 58px;
  min-height: 58px;
  flex: 0 0 58px;
  padding: 8px 12px;
  border: 0;
  background: var(--chrome-bg);
  color: var(--chrome-text);
  font-family: "Segoe UI",Tahoma,sans-serif;
}

.app-chrome-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 6px; }

.app-chrome-home,.app-chrome-manage,.app-chrome-logout {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(228,195,99,.4);
  border-radius: var(--chrome-radius);
  background: rgba(255,255,255,.03);
  color: var(--chrome-gold);
  text-decoration: none;
  transition: background var(--chrome-transition-fast), border-color var(--chrome-transition-fast), color var(--chrome-transition-fast), transform var(--chrome-transition-fast);
}

.app-chrome-home:hover,.app-chrome-manage:hover,.app-chrome-logout:hover {
  border-color: var(--chrome-gold);
  background: var(--chrome-gold-soft);
  transform: translateY(-1px);
}
.app-chrome-home:active,.app-chrome-manage:active,.app-chrome-logout:active { transform: translateY(0) scale(.96); }
.app-chrome-home:focus-visible,.app-chrome-manage:focus-visible,.app-chrome-logout:focus-visible,
.app-chrome-nav-item:focus-visible {
  outline: 2px solid var(--chrome-gold);
  outline-offset: 2px;
}

.app-chrome-home { width: 36px; min-width: 36px; height: 36px; min-height: 36px; padding: 0; border-color: rgba(243,214,106,.7); border-radius: 6px; color: var(--chrome-accent); }
.app-chrome-reset { width: 36px; min-width: 36px; height: 36px; min-height: 36px; padding: 0; border-color: rgba(237,23,40,.5); background: rgba(8,9,10,.6); color: var(--chrome-accent); }
.app-chrome-reset:hover { border-color: var(--chrome-accent); background: var(--chrome-accent-soft); }
.app-chrome-reset .app-chrome-reset-icon { display: block; flex: 0 0 18px; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.app-chrome-organization-management {
  flex: 0 0 auto;
  width: 36px;
  min-width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  min-height: 36px;
  border: 1px solid rgba(243,214,106,.8);
  border-radius: 6px;
  background: rgba(8,9,10,.6);
  color: #f7e79a;
  cursor: pointer;
  transition: background var(--chrome-transition-fast), transform var(--chrome-transition-fast), border-color var(--chrome-transition-fast);
}
.app-chrome-organization-management:hover { background: rgba(243,214,106,.16); border-color: #f7e79a; transform: translateY(-1px); }
.app-chrome-organization-management:active { transform: translateY(0) scale(.97); }
.app-chrome-organization-management svg { width: 16px; height: 16px; }
.app-chrome-manage { min-height: 34px; max-width: 106px; gap: 5px; padding: 6px 8px; font-size: 8px; font-weight: 800; line-height: 1.15; text-align: left; }
.app-chrome-manage svg { flex: 0 0 16px; width: 16px; height: 16px; }
.app-chrome-manage span { min-width: 0; overflow-wrap: anywhere; }
.app-chrome-home svg { width: 18px; height: 18px; transition: transform var(--chrome-transition-fast); }
.app-chrome-home:hover svg { transform: scale(1.08); }
.app-chrome-home.active { border-color: var(--chrome-accent); background: var(--chrome-accent-soft); color: var(--chrome-accent); }
.app-chrome-account { display: flex; flex: 1 1 auto; flex-direction: column; align-items: flex-start; justify-content: center; gap: 1px; min-width: 0; max-width: 220px; }
.app-chrome-account strong { display: none !important; }
.app-chrome-account span { overflow: hidden; color: #f3d66a; font-size: 10px; font-weight: 700; line-height: 1.1; text-overflow: ellipsis; white-space: nowrap; }
.app-chrome-status { max-width: 110px; overflow: hidden; color: var(--chrome-ok); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; transition: color var(--chrome-transition-fast); }
.app-chrome-status[data-state="error"] { color: var(--chrome-danger); }
.app-chrome-logout { height: 36px; min-height: 36px; gap: 5px; padding: 0 8px; border-color: rgba(255,255,255,.42); border-radius: 6px; background: rgba(8,9,10,.6); color: #fff; font-size: 9px; font-weight: 700; cursor: pointer; }
.app-chrome-logout:hover { border-color: var(--chrome-accent); background: var(--chrome-accent-soft); color: #ffd4cf; }
.app-chrome-logout svg { width: 15px; height: 15px; }
.app-chrome-header svg,.app-chrome-nav svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.app-chrome-profile { position: relative; flex: 0 0 auto; }
.app-chrome-profile-active .app-chrome-profile { margin-left: auto; }
.app-chrome-profile-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  max-width: 84px;
  min-height: 34px;
  padding: 5px 7px;
  border: 1px solid rgba(243,214,106,.8);
  border-radius: 6px;
  background: rgba(8,9,10,.6);
  color: #f7e79a;
  font-size: 8px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--chrome-transition-fast), border-color var(--chrome-transition-fast);
}
.app-chrome-profile-toggle:hover { border-color: #f7e79a; background: rgba(243,214,106,.16); }
.app-chrome-profile-toggle span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-chrome-profile-chevron { flex: 0 0 auto; width: 12px; height: 12px; transition: transform var(--chrome-transition-fast); }
.app-chrome-profile-toggle[aria-expanded="true"] .app-chrome-profile-chevron { transform: rotate(180deg); }
.app-chrome-profile-menu {
  position: absolute;
  z-index: 60;
  top: calc(100% + 6px);
  right: 0;
  display: grid;
  gap: 6px;
  width: 170px;
  padding: 8px;
  border: 1px solid var(--chrome-line);
  border-radius: var(--chrome-radius);
  background: #15171a;
  box-shadow: 0 8px 24px rgba(0,0,0,.45);
}
html[dir="rtl"] .app-chrome-profile-menu { right: auto; left: 0; }
.app-chrome-profile-list { display: grid; gap: 4px; max-height: 180px; overflow-y: auto; }
.app-chrome-profile-item {
  padding: 7px 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: rgba(255,255,255,.03);
  color: var(--chrome-text);
  font-size: 11px;
  text-align: left;
  cursor: pointer;
}
html[dir="rtl"] .app-chrome-profile-item { text-align: right; }
.app-chrome-profile-item:hover { background: rgba(255,255,255,.07); }
.app-chrome-profile-item.active { border-color: var(--chrome-gold); color: var(--chrome-gold); background: var(--chrome-gold-soft); }
.app-chrome-profile-add {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 8px;
  border: 1px dashed rgba(228,195,99,.5);
  border-radius: 6px;
  background: transparent;
  color: var(--chrome-gold);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.app-chrome-profile-add:hover { background: var(--chrome-gold-soft); }
.app-chrome-profile-add svg { width: 14px; height: 14px; }
html[dir="rtl"] .app-chrome-profile-active .app-chrome-profile { margin-right: auto; margin-left: 0; }
html[dir="rtl"] .app-chrome-manage { text-align: right; }

.app-chrome-dependent-dialog {
  width: min(92vw, 360px);
  max-height: min(88dvh, 720px);
  overflow-y: auto;
  padding: 0;
  border: 1px solid var(--chrome-line);
  border-radius: 12px;
  background: #15171a;
  color: var(--chrome-text);
}
.app-chrome-dependent-dialog::backdrop { background: rgba(0,0,0,.6); }
.app-chrome-dependent-form { display: grid; gap: 10px; padding: 16px; }
.app-chrome-dependent-head { display: flex; align-items: center; justify-content: space-between; }
.app-chrome-dependent-head h3 { margin: 0; font-size: 15px; }
.app-chrome-dependent-close { border: none; background: none; color: var(--chrome-text); font-size: 20px; cursor: pointer; line-height: 1; }
.app-chrome-dependent-hint { margin: 0; color: var(--chrome-muted); font-size: 11px; }
.app-chrome-dependent-form label { display: grid; gap: 4px; font-size: 11px; color: var(--chrome-muted); }
.app-chrome-dependent-form input, .app-chrome-dependent-form select {
  min-height: 36px;
  padding: 6px 8px;
  border: 1px solid var(--chrome-line);
  border-radius: 6px;
  background: #0c0e11;
  color: var(--chrome-text);
  font-size: 13px;
}
.app-chrome-dependent-status { margin: 0; min-height: 14px; color: var(--chrome-gold); font-size: 11px; }
.app-chrome-dependent-actions { display: flex; justify-content: flex-end; }
.app-chrome-dependent-actions .primary {
  min-height: 36px;
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  background: var(--chrome-gold);
  color: #141414;
  font-weight: 700;
  cursor: pointer;
}
.app-chrome-dependent-actions .primary.danger { background: var(--chrome-accent); color: #fff; }
.app-chrome-reset-warning { margin: 0; padding: 8px 10px; border: 1px solid rgba(237,23,40,.4); border-radius: 6px; background: var(--chrome-accent-soft); color: var(--chrome-danger); font-size: 11px; line-height: 1.5; }

.app-chrome-nav {
  position: fixed;
  z-index: 50;
  bottom: 0;
  left: 50%;
  display: flex;
  align-items: stretch;
  gap: 2px;
  width: min(100vw,1100px);
  height: 78px;
  padding: 4px 5px max(8px,env(safe-area-inset-bottom));
  transform: translateX(-50%);
  border-top: 1px solid var(--chrome-line);
  background: linear-gradient(180deg,rgba(14,15,16,.98),#0b0c0f);
  box-shadow: 0 -2px 14px rgba(0,0,0,.3);
  font-family: "Segoe UI",Tahoma,sans-serif;
}

.app-chrome-nav-item {
  position: relative;
  display: flex;
  flex: 1 1 0;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  margin: 3px 1px;
  border-radius: 10px;
  color: var(--chrome-muted);
  font-size: 8px;
  font-weight: 700;
  line-height: 1.05;
  text-align: center;
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: color var(--chrome-transition-fast), background var(--chrome-transition-fast);
}

.app-chrome-nav-item:hover { color: var(--chrome-teal); background: rgba(101,212,200,.08); }
.app-chrome-nav-item.active { color: var(--chrome-accent); background: var(--chrome-accent-soft); }
.app-chrome-nav-item.active::before {
  position: absolute;
  top: 2px;
  left: 50%;
  width: 16px;
  height: 3px;
  border-radius: 2px;
  background: var(--chrome-accent);
  content: "";
  transform: translateX(-50%);
  transition: opacity var(--chrome-transition-fast);
}
.app-chrome-nav-pending .app-chrome-nav-item { visibility: hidden; }
.app-chrome-nav-item[hidden],.app-chrome-header [hidden] { display: none !important; }
.app-chrome-nav-icon { display: grid; width: 22px; height: 22px; flex: 0 0 22px; place-items: center; transition: transform var(--chrome-transition-fast); }
.app-chrome-nav-icon svg { width: 20px; height: 20px; }
.app-chrome-nav-item:active .app-chrome-nav-icon { transform: scale(.9); }
.app-chrome-qr .app-chrome-nav-icon { width: 40px; height: 40px; flex-basis: 40px; border-radius: 50%; background: linear-gradient(145deg,#e75a4f,#a5231d); color: #fff; box-shadow: 0 4px 12px rgba(216,76,65,.3); transition: box-shadow var(--chrome-transition-fast), transform var(--chrome-transition-fast); }
.app-chrome-qr .app-chrome-nav-icon svg { width: 25px; height: 25px; }
.app-chrome-qr:hover .app-chrome-nav-icon { box-shadow: 0 6px 18px rgba(216,76,65,.45); transform: translateY(-2px); }
.app-chrome-qr.active .app-chrome-nav-icon { box-shadow: 0 0 0 2px var(--chrome-gold), 0 6px 18px rgba(216,76,65,.4); }
.app-chrome-qr.active::before { display: none; }
body.app-chrome-standalone {
  width: min(100%,var(--chrome-app-width));
  margin: 0 auto;
  padding-bottom: 90px;
  container: app-screen / inline-size;
}
body.app-chrome-standalone > * { max-width: var(--chrome-app-width); margin-right: auto; margin-left: auto; }
body.app-chrome-standalone .app-chrome-nav { width: min(100vw,var(--chrome-app-width)); }
.app.app-chrome-contained { width: min(100%,var(--chrome-app-width)); padding-bottom: 80px; container: app-screen / inline-size; }
.app.app-chrome-contained .app-chrome-header { position: sticky; }
.app.app-chrome-contained .app-chrome-nav { position: fixed; left: 50%; width: min(100vw,var(--chrome-app-width)); transform: translateX(-50%); }

@container app-screen (max-width: 440px) {
  .app-chrome-header { padding-right: 14px; padding-left: 14px; }
  .app-chrome-actions { gap: 5px; }
  .app-chrome-home,.app-chrome-reset,.app-chrome-organization-management { width: 32px; min-width: 32px; height: 32px; min-height: 32px; }
  .app-chrome-logout { height: 32px; min-height: 32px; gap: 4px; padding: 0 6px; font-size: 8px; }
  .app-chrome-organization-management svg { width: 17px; height: 17px; }
  .app-chrome-logout svg { width: 14px; height: 14px; }
  .app-chrome-profile-toggle { min-height: 31px; padding: 5px 6px; font-size: 8px; }
}

@media print {
  .app-chrome-header,.app-chrome-nav { display: none !important; }
  body.app-chrome-standalone { padding-bottom: 0; }
}
