:root {
  --uw-blue: #0077c1;
  --uw-blue-deep: #0564a1;
  --uw-blue-light: #7ccdeb;
  --uw-green: #23ab67;
  --uw-green-light: #73e6ac;
  --uw-red: #f14b4b;
  --uw-white: #ffffff;
  --uw-bg: #f6f6f6;
  --uw-bg-soft: #eef8fc;
  --uw-grey-light: #eeeeee;
  --uw-grey-mid: #dddddd;
  --uw-grey: #cccccc;
  --uw-grey-dark: #666666;
  --uw-black: #000000;
  --shadow-lg: 0 28px 60px rgba(0, 42, 82, 0.18);
  --shadow-md: 0 12px 28px rgba(0, 56, 116, 0.12);
  --radius-xl: 32px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --top-safe: max(env(safe-area-inset-top), 14px);
  --bottom-safe: max(env(safe-area-inset-bottom), 14px);
  color-scheme: light;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Roboto", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(124, 205, 235, 0.35), transparent 34%),
    linear-gradient(180deg, #f8fcff 0%, #eaf4fb 44%, #dfeef8 100%);
  color: var(--uw-black);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  background: none;
  cursor: pointer;
}

.ambient {
  position: fixed;
  inset: auto;
  pointer-events: none;
  z-index: 0;
  filter: blur(24px);
}

.ambient-a {
  top: 10%;
  left: 4%;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: rgba(0, 119, 193, 0.12);
}

.ambient-b {
  right: 2%;
  bottom: 8%;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: rgba(35, 171, 103, 0.12);
}

.app-shell {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-frame {
  width: min(430px, 100%);
  height: min(920px, calc(100dvh - 24px));
  min-height: 720px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--radius-xl);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(246, 250, 252, 0.96));
  border: 1px solid rgba(124, 205, 235, 0.55);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(16px);
}

.title-bar {
  min-height: 45px;
  padding: calc(var(--top-safe) + 10px) 18px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-badge {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(160deg, #049fd9 0%, #0077c1 55%, #0564a1 100%);
  color: var(--uw-white);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--uw-blue);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.title-bar h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 400;
}

.icon-button {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(221, 221, 221, 0.8);
  color: var(--uw-blue);
  box-shadow: var(--shadow-md);
}

.icon-button.small {
  width: 34px;
  height: 34px;
  box-shadow: none;
}

.icon-button svg,
.quick-action svg,
.nav-item svg,
.media-icon svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.gadget-tabs {
  padding: 0 16px 10px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.tab-button {
  min-height: 38px;
  padding: 0 10px;
  border-radius: 12px;
  background: var(--uw-grey-light);
  color: var(--uw-blue);
  font-size: 0.84rem;
  font-weight: 400;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.tab-button.is-active {
  background: var(--uw-blue);
  color: var(--uw-white);
}

.tab-button:active {
  transform: translateY(1px);
}

.screen-stack {
  flex: 1;
  position: relative;
  min-height: 0;
}

.screen {
  display: none;
  height: 100%;
  overflow-y: auto;
  padding: 0 16px calc(var(--bottom-safe) + 92px);
  scrollbar-width: none;
}

.screen::-webkit-scrollbar {
  display: none;
}

.screen.is-active {
  display: block;
}

.hero-card,
.panel-card,
.bank-card {
  margin-bottom: 14px;
}

.hero-card {
  padding: 22px 20px;
  border-radius: 24px;
  background:
    linear-gradient(150deg, rgba(124, 205, 235, 0.22), rgba(255, 255, 255, 0.92)),
    linear-gradient(135deg, #0077c1 0%, #049fd9 100%);
  border: 1px solid rgba(124, 205, 235, 0.65);
  box-shadow: var(--shadow-md);
}

.hero-label,
.hero-meta,
.small-note,
.control-row p,
.action-button small,
.steps-list,
.detail-row span {
  color: var(--uw-grey-dark);
}

.hero-label {
  margin: 0 0 8px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hero-card h2 {
  margin: 0;
  font-size: 2rem;
  font-weight: 300;
}

.hero-pill,
.panel-meta,
.status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 25px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.75rem;
}

.hero-pill {
  margin-top: 16px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--uw-blue);
}

.hero-meta {
  margin: 16px 0 0;
  line-height: 1.5;
}

.panel-card {
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  border: 1px solid rgba(221, 221, 221, 0.8);
}

.panel-header {
  min-height: 45px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(180deg, #0077c1 0%, #0564a1 100%);
  color: var(--uw-white);
  font-size: 1rem;
  font-weight: 300;
}

.panel-meta {
  background: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.92);
}

.quick-grid {
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.quick-action {
  min-height: 96px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(246, 246, 246, 0.94), rgba(255, 255, 255, 1));
  border: 1px solid rgba(221, 221, 221, 0.9);
  color: var(--uw-black);
  text-align: left;
}

.quick-icon {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(0, 119, 193, 0.1);
  color: var(--uw-blue);
}

.table-wrap {
  padding: 0 0 6px;
}

.table-head,
.table-row {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(80px, 0.8fr) minmax(84px, 0.8fr);
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
}

.table-head {
  background: var(--uw-grey-mid);
  font-size: 0.76rem;
  font-weight: 500;
}

.table-row {
  min-height: 56px;
  border-bottom: 1px solid rgba(221, 221, 221, 0.75);
  font-size: 0.92rem;
}

.table-row strong {
  justify-self: end;
}

.status-chip {
  background: var(--uw-grey-light);
  color: var(--uw-blue);
}

.status-chip.is-positive {
  background: rgba(115, 230, 172, 0.22);
  color: var(--uw-green);
}

.bank-card {
  padding: 22px;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-radius: 28px;
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.26), transparent 32%),
    linear-gradient(145deg, #0564a1 0%, #0077c1 52%, #23ab67 112%);
  color: var(--uw-white);
  box-shadow: var(--shadow-lg);
}

.bank-card-top,
.bank-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.bank-card-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.2);
  font-weight: 700;
  letter-spacing: 0.08em;
}

.bank-card-chip {
  width: 42px;
  height: 30px;
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.28));
}

.bank-card-label,
.bank-card-caption {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
}

.bank-card h2 {
  margin: 0;
  font-size: 1.9rem;
  font-weight: 400;
  letter-spacing: 0.2em;
}

.bank-card-caption {
  display: block;
  margin-bottom: 4px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.control-list,
.spend-list,
.details-list {
  padding: 6px 0;
}

.control-row,
.spend-row,
.detail-row {
  min-height: 68px;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(221, 221, 221, 0.75);
}

.control-row strong,
.spend-row strong,
.detail-row strong {
  font-weight: 500;
}

.control-row p {
  margin: 4px 0 0;
  font-size: 0.88rem;
  line-height: 1.4;
}

.switch {
  position: relative;
  width: 54px;
  height: 30px;
  flex: 0 0 auto;
}

.switch input {
  position: absolute;
  opacity: 0;
  inset: 0;
}

.switch span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--uw-grey-mid);
  transition: background-color 0.2s ease;
}

.switch span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--uw-white);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
  transition: transform 0.2s ease;
}

.switch input:checked + span {
  background: var(--uw-blue);
}

.switch input:checked + span::after {
  transform: translateX(24px);
}

.link-button,
.ghost-button {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 12px;
  color: var(--uw-blue);
  background: rgba(0, 119, 193, 0.08);
}

.ghost-button {
  border: 1px solid rgba(124, 205, 235, 0.55);
}

.spend-row div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.meter {
  display: inline-block;
  width: 92px;
  height: 10px;
  border-radius: 999px;
  background: var(--uw-grey-light);
  position: relative;
  overflow: hidden;
}

.meter::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--fill, 50%);
  border-radius: inherit;
}

.meter-a::after {
  --fill: 42%;
  background: var(--uw-blue);
}

.meter-b::after {
  --fill: 26%;
  background: var(--uw-green);
}

.meter-c::after {
  --fill: 19%;
  background: var(--uw-blue-light);
}

.meter-d::after {
  --fill: 13%;
  background: var(--uw-red);
}

.support-card {
  padding-bottom: 16px;
}

.support-status {
  margin: 16px 16px 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(0, 119, 193, 0.08);
  color: var(--uw-blue);
  font-size: 0.92rem;
  line-height: 1.45;
}

.support-status[data-state="success"] {
  background: rgba(115, 230, 172, 0.22);
  color: var(--uw-green);
}

.support-status[data-state="error"] {
  background: rgba(241, 75, 75, 0.16);
  color: #b52727;
}

.support-form {
  padding: 16px;
}

.field-group {
  margin-bottom: 14px;
}

.field-group label {
  display: block;
  margin-bottom: 7px;
  font-size: 0.85rem;
  color: var(--uw-grey-dark);
}

.field-group input,
.field-group select {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid var(--uw-grey-mid);
  background: var(--uw-white);
  color: var(--uw-black);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  appearance: none;
}

.field-group select {
  background-image:
    linear-gradient(45deg, transparent 50%, var(--uw-blue) 50%),
    linear-gradient(135deg, var(--uw-blue) 50%, transparent 50%);
  background-position:
    calc(100% - 21px) calc(50% - 3px),
    calc(100% - 15px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.field-group input:focus,
.field-group select:focus {
  outline: none;
  border-color: var(--uw-blue);
  box-shadow: 0 0 0 4px rgba(124, 205, 235, 0.18);
}

.channel-group {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.media-button {
  min-height: 90px;
  padding: 14px 10px;
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--uw-grey-light);
  color: var(--uw-blue);
  border: 1px solid rgba(221, 221, 221, 0.9);
  text-align: center;
}

.media-button.is-active {
  background: linear-gradient(180deg, #0077c1 0%, #0564a1 100%);
  color: var(--uw-white);
}

.media-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.18);
}

.media-button:not(.is-active) .media-icon {
  background: rgba(0, 119, 193, 0.1);
}

.support-footer {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.small-note {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.5;
}

.stack-actions {
  padding: 16px;
  display: grid;
  gap: 12px;
}

.action-button {
  min-height: 68px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 4px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(246, 246, 246, 1));
  border: 1px solid rgba(221, 221, 221, 0.8);
  text-align: left;
}

.action-button span {
  color: var(--uw-black);
  font-weight: 500;
}

.details-list {
  padding: 4px 0;
}

.steps-list {
  margin: 0;
  padding: 16px 16px 16px 34px;
  line-height: 1.7;
}

.bottom-nav {
  position: sticky;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 10px 12px calc(var(--bottom-safe) + 6px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(255, 255, 255, 0.95));
  border-top: 1px solid rgba(221, 221, 221, 0.75);
  backdrop-filter: blur(18px);
}

.nav-item {
  min-height: 58px;
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: var(--uw-grey-dark);
  border-radius: 16px;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.nav-item span {
  font-size: 0.78rem;
}

.nav-item.is-active {
  color: var(--uw-blue);
  background: rgba(0, 119, 193, 0.09);
}

.modal-shell {
  position: fixed;
  inset: 0;
  z-index: 20;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 21, 40, 0.46);
  backdrop-filter: blur(6px);
}

.modal-card {
  position: absolute;
  inset: auto 16px calc(var(--bottom-safe) + 12px);
  height: min(72dvh, 640px);
  border-radius: 24px;
  overflow: hidden;
  background: var(--uw-white);
  box-shadow: var(--shadow-lg);
}

.modal-header {
  min-height: 52px;
}

#case-pop {
  width: 100%;
  height: calc(100% - 112px);
  border: 0;
  background: var(--uw-bg);
}

.modal-footer {
  padding: 12px 14px 16px;
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid rgba(221, 221, 221, 0.75);
}

@media (max-width: 540px) {
  .app-shell {
    padding: 0;
  }

  .app-frame {
    width: 100%;
    min-height: 100dvh;
    height: 100dvh;
    border-radius: 0;
    border: 0;
    box-shadow: none;
  }

  .modal-card {
    inset: auto 0 0;
    height: min(78dvh, 680px);
    border-radius: 24px 24px 0 0;
  }
}

@media (max-width: 380px) {
  .channel-group {
    grid-template-columns: 1fr;
  }

  .support-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .gadget-tabs {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (display-mode: standalone) {
  body {
    background: linear-gradient(180deg, #f8fcff 0%, #eff7fb 100%);
  }

  .app-shell {
    padding: 0;
  }

  .app-frame {
    width: 100%;
    height: 100dvh;
    min-height: 100dvh;
    border-radius: 0;
    border: 0;
    box-shadow: none;
  }
}

body.is-standalone .app-shell {
  padding: 0;
}

body.is-standalone .app-frame {
  width: 100%;
  height: 100dvh;
  min-height: 100dvh;
  border-radius: 0;
  border: 0;
  box-shadow: none;
}
