: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-grey-light: #eeeeee;
  --uw-grey-mid: #dddddd;
  --uw-grey: #cccccc;
  --uw-grey-dark: #666666;
  --uw-black: #000000;
  --shadow-lg: 0 24px 54px rgba(0, 42, 82, 0.16);
  --shadow-md: 0 10px 24px rgba(0, 56, 116, 0.11);
  --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: linear-gradient(180deg, #f8fcff 0%, #eaf4fb 48%, #f6f6f6 100%);
  color: var(--uw-black);
}

.app-frame svg {
  display: block;
}

.app-frame svg path,
.app-frame svg rect,
.app-frame svg circle {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-button svg circle,
.nav-item svg circle {
  fill: currentColor;
  stroke: none;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  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: 32px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(124, 205, 235, 0.55);
  box-shadow: var(--shadow-lg);
}

.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-weight: 700;
  letter-spacing: 0.06em;
}

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

h1,
h2,
p {
  margin-top: 0;
}

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

.icon-button,
.admin-link,
.ghost-button,
.primary-button,
.danger-button {
  min-height: 38px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

.icon-button,
.admin-link,
.ghost-button {
  color: var(--uw-blue);
  background: rgba(0, 119, 193, 0.08);
  border: 1px solid rgba(124, 205, 235, 0.55);
}

.icon-button {
  width: 38px;
  padding: 0;
  line-height: 1;
}

.icon-button svg,
.quick-icon svg,
.media-icon svg,
.nav-item svg {
  width: 20px !important;
  height: 20px !important;
  max-width: 20px;
  max-height: 20px;
  flex: 0 0 auto;
  overflow: visible;
}

.primary-button {
  color: var(--uw-white);
  background: linear-gradient(180deg, var(--uw-blue) 0%, var(--uw-blue-deep) 100%);
}

.primary-button:disabled {
  cursor: not-allowed;
  color: var(--uw-grey-dark);
  background: var(--uw-grey-mid);
}

.danger-button {
  color: #b52727;
  background: rgba(241, 75, 75, 0.12);
}

.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: 8px;
  background: var(--uw-grey-light);
  color: var(--uw-blue);
}

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

.screen-stack {
  flex: 1;
  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.24), rgba(255, 255, 255, 0.94)), 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,
.control-row p,
.action-button small,
.detail-row span,
.admin-row span {
  color: var(--uw-grey-dark);
}

.hero-label {
  margin-bottom: 8px;
  font-size: 0.8rem;
  text-transform: uppercase;
}

.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: 16px;
  background: rgba(255, 255, 255, 0.94);
  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-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: 12px;
  background: linear-gradient(180deg, rgba(246, 246, 246, 0.94), #fff);
  border: 1px solid rgba(221, 221, 221, 0.9);
  color: var(--uw-black);
  text-align: left;
}

.quick-icon,
.media-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(0, 119, 193, 0.1);
  color: var(--uw-blue);
  font-weight: 700;
}

.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);
}

.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: 22px;
  background: linear-gradient(145deg, #0564a1 0%, #0077c1 52%, #23ab67 112%);
  color: var(--uw-white);
  box-shadow: var(--shadow-lg);
}

.bank-card-top,
.bank-card-bottom,
.control-row,
.detail-row,
.admin-row,
.save-bar,
.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.bank-card-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.2);
  font-weight: 700;
}

.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 h2 {
  margin: 0;
  font-size: 1.9rem;
  font-weight: 400;
}

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

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

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

.steps-list {
  margin: 0;
  padding: 16px 16px 16px 34px;
  color: var(--uw-grey-dark);
  line-height: 1.7;
}

.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: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(246, 246, 246, 1));
  border: 1px solid rgba(221, 221, 221, 0.8);
  color: var(--uw-black);
  text-align: left;
}

.action-button span {
  font-weight: 500;
}

.control-row,
.detail-row {
  min-height: 68px;
  padding: 14px;
  border-bottom: 1px solid rgba(221, 221, 221, 0.75);
}

.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);
}

.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);
}

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

.support-status {
  margin: 16px 16px 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(0, 119, 193, 0.08);
  color: var(--uw-blue);
  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,
.settings-form,
.admin-form {
  padding: 16px;
}

.compact-form {
  padding-bottom: 8px;
}

.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: 8px;
  border: 1px solid var(--uw-grey-mid);
  background: var(--uw-white);
  color: var(--uw-black);
}

.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);
}

.field-group input[readonly] {
  background: var(--uw-grey-light);
  color: var(--uw-grey-dark);
}

.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: 12px;
  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);
}

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

.media-button.is-active .media-icon {
  background: rgba(255, 255, 255, 0.18);
  color: var(--uw-white);
}

.support-footer {
  margin-top: 16px;
}

.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: rgba(255, 255, 255, 0.96);
  border-top: 1px solid rgba(221, 221, 221, 0.75);
}

.nav-item {
  min-height: 58px;
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-radius: 10px;
  background: transparent;
  color: var(--uw-grey-dark);
}

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

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

.admin-body {
  background: #f1fdff;
}

.admin-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 104px;
}

.admin-login {
  width: min(430px, 100%);
  margin: 12vh auto 0;
  padding: 22px;
  border-radius: 16px;
  background: var(--uw-white);
  border: 1px solid var(--uw-grey-mid);
  box-shadow: var(--shadow-lg);
}

.admin-header {
  margin-bottom: 18px;
  padding: 18px;
  border-radius: 16px;
  background: var(--uw-white);
  border: 1px solid var(--uw-grey-mid);
  box-shadow: var(--shadow-md);
}

.admin-actions {
  display: flex;
  gap: 10px;
}

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

.admin-panel {
  margin: 0;
}

.form-grid {
  display: grid;
  gap: 12px;
}

.form-grid.two,
.form-grid.three {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.check-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.check-row {
  min-height: 34px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 999px;
  background: var(--uw-grey-light);
  color: var(--uw-grey-dark);
}

.admin-list {
  border-top: 1px solid var(--uw-grey-mid);
}

.admin-row {
  min-height: 62px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(221, 221, 221, 0.75);
}

.admin-row div {
  min-width: 0;
}

.admin-row span {
  display: block;
  margin-top: 3px;
  overflow-wrap: anywhere;
  font-size: 0.84rem;
}

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

.audit-row code {
  max-width: 260px;
  padding: 6px 8px;
  border-radius: 8px;
  background: var(--uw-grey-light);
  color: var(--uw-grey-dark);
  overflow-wrap: anywhere;
  font-size: 0.78rem;
}

.save-bar {
  position: fixed;
  right: max(16px, calc((100vw - 1180px) / 2));
  bottom: 16px;
  left: max(16px, calc((100vw - 1180px) / 2));
  padding: 12px;
  border-radius: 12px;
  background: var(--uw-white);
  border: 1px solid var(--uw-grey-mid);
  box-shadow: var(--shadow-lg);
}

.form-message {
  margin: 0;
  color: var(--uw-blue);
  overflow-wrap: anywhere;
}

.change-counter {
  margin: 4px 0 0;
  color: var(--uw-grey-dark);
  font-size: 0.84rem;
}

[hidden] {
  display: none !important;
}

@media (min-width: 840px) {
  .app-shell {
    align-items: stretch;
  }

  .app-frame {
    width: min(1120px, 100%);
    height: calc(100dvh - 48px);
    min-height: 680px;
    border-radius: 18px;
  }

  .title-bar {
    padding: 18px 24px;
  }

  .gadget-tabs {
    padding-inline: 24px;
    grid-template-columns: repeat(4, minmax(120px, 1fr));
  }

  .screen {
    padding: 8px 24px 24px;
  }

  .desktop-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
    gap: 16px;
  }

  .hero-card,
  .bank-card {
    min-height: 260px;
  }

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

  .bottom-nav {
    display: none;
  }
}

@media (min-width: 1040px) {
  .form-grid.three {
    grid-template-columns: 0.8fr 1.4fr 0.55fr;
  }
}

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

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

  .admin-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 10px;
  }

  .admin-grid,
  .form-grid.two,
  .form-grid.three {
    grid-template-columns: 1fr;
  }

  .admin-header,
  .save-bar {
    align-items: stretch;
    flex-direction: column;
  }

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