.apps-page {
  max-width: 1500px;
  margin: auto;
  padding: 12px 0 40px;
}
.apps-page > header {
  margin-bottom: 28px;
}
.apps-page h1 {
  font-size: 32px;
  margin: 0 0 8px;
}
.apps-page h2 {
  font-size: 22px;
  margin-bottom: 8px;
}
.apps-page p {
  color: #5a6e89;
  line-height: 1.6;
}
.app-company {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.app-company > span,
.app-status {
  background: #e8f0fc;
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 13px;
}
.app-company > button {
  margin-left: auto;
}
.apps-installed {
  background: #eef1ff;
  border-radius: 18px;
  padding: 24px;
  margin: 24px 0 36px;
}
.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.app-card {
  background: white;
  border: 1px solid #e0e7f1;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 5px 18px #17324f08;
  display: flex;
  flex-direction: column;
}
.app-card-heading {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}
.app-card h3 {
  font-size: 20px;
  margin: 0;
}
.app-card-heading p {
  margin: 4px 0;
}
.app-icon {
  background: #e9efff;
  color: #295beb;
  border-radius: 14px;
  padding: 8px 14px;
  font-size: 28px;
}
.app-card footer {
  border-top: 1px solid #e2e8f0;
  margin-top: 24px;
  padding-top: 16px;
  display: flex;
  justify-content: flex-end;
}
.app-origin {
  overflow-wrap: anywhere;
}
.app-dialog {
  width: min(760px, 94vw);
  max-height: 90vh;
  border: 1px solid #dce5f0;
  border-radius: 18px;
  padding: 28px;
  color: #12304b;
}
.app-dialog::backdrop {
  background: #12274180;
}
.app-dialog header,
.app-dialog footer,
.app-search {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}
.app-dialog form > label {
  display: block;
  margin: 16px 0;
}
.app-dialog input:not([type="checkbox"]) {
  width: 100%;
}
.app-products {
  max-height: 260px;
  overflow: auto;
  border: 1px solid #dce5f0;
  border-radius: 10px;
  padding: 8px;
}
.app-product {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border-bottom: 1px solid #eef2f7;
}
.app-product small {
  display: block;
  color: #61738e;
}
.app-dialog input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.app-dialog .app-consent {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.app-dialog [data-app-error] {
  color: #b32828;
}
.app-dialog footer {
  margin-top: 24px;
  flex-wrap: wrap;
}
.app-search input {
  min-width: 0;
}
.app-dialog [data-app-pairing] {
  padding: 8px;
}
.app-dialog p {
  line-height: 1.6;
}
@media (max-width: 600px) {
  .apps-installed {
    padding: 16px;
  }
  .app-card {
    padding: 18px;
  }
  .app-dialog {
    padding: 18px;
  }
  .app-company > button {
    margin-left: 0;
  }
}

.app-card footer {
  gap: 10px;
}
.app-frame {
  width: 100%;
  min-height: 500px;
  border: 1px solid #dce5f0;
  border-radius: 10px;
  margin-top: 20px;
}

.apps-payment {
  margin-top: 36px;
}
.apps-page > header,
.app-dialog header {
  height: auto;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.apps-page .apps-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}
.apps-page > header h1 {
  letter-spacing: -0.03em;
}
.apps-page .app-setup-guide {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: #f0f5ff;
  border: 1px solid #d8e4f7;
  border-radius: 12px;
  padding: 20px;
  margin: 24px 0;
}
.app-setup-guide strong {
  color: #234568;
}
.app-setup-guide p {
  margin: 6px 0 0;
  font-size: 13px;
  max-width: 700px;
}
.app-setup-guide button {
  flex-shrink: 0;
}
.apps-page .apps-installed {
  background: transparent;
  padding: 0;
  margin: 30px 0;
}
.apps-page .app-card {
  border-radius: 14px;
  padding: 22px;
  min-width: 0;
}
.apps-page .app-card h3 {
  font-size: 18px;
  overflow-wrap: anywhere;
}
.apps-page .app-card-heading {
  align-items: flex-start;
  gap: 12px;
}
.apps-page .app-card-heading > div {
  flex: 1;
  min-width: 0;
}
.apps-page .app-card-heading > .app-status {
  flex-basis: 100%;
  width: fit-content;
}
.apps-page .app-card p {
  font-size: 13px;
}
.apps-page .app-icon {
  font-size: 22px;
  padding: 8px 12px;
}
.apps-page .app-status-ready {
  background: #eaf7f0;
  color: #15704c;
}
.apps-page .app-status-pending,
.app-store-dialog .app-status-pending {
  background: #fff4dc;
  color: #8b6515;
}
.apps-page .app-activity {
  font-size: 12px;
  color: #60738a;
  padding: 14px 0;
  line-height: 1.7;
}
.apps-page .app-card footer {
  margin-top: auto;
  flex-wrap: wrap;
  justify-content: flex-start;
}
.apps-page button,
.app-store-dialog button {
  min-height: 42px;
  border-radius: 9px;
}
.app-store-dialog {
  overflow-y: auto;
  width: min(680px, 94vw);
}
.app-store-dialog h2 {
  font-size: 22px;
  letter-spacing: -0.02em;
}
.app-store-dialog h3 {
  font-size: 15px;
  margin-top: 24px;
}
.app-store-dialog p,
.app-store-dialog li {
  font-size: 13px;
  line-height: 1.7;
  color: #52677f;
}
.app-store-dialog label {
  font-size: 13px;
  line-height: 1.7;
}
.app-store-dialog select {
  width: 100%;
  min-width: 0;
  margin-top: 8px;
}
.app-store-dialog .app-store-summary {
  border: 1px solid #dfe7f0;
  border-radius: 10px;
  padding: 18px;
  background: #f8faff;
  margin: 18px 0;
}
.app-store-dialog .app-store-summary span {
  color: #15704c;
  font-size: 13px;
}
.app-store-dialog .app-next-step {
  border-left: 3px solid #d9ad4e;
  padding: 10px 14px;
  background: #fff9ec;
}
.app-store-dialog .app-product-preview summary {
  cursor: pointer;
  color: #365477;
  font-size: 13px;
  padding: 10px 0;
}
.app-store-dialog [data-error] {
  color: #b32828;
}
.app-store-dialog .app-code-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}
.app-store-dialog .app-code-row input {
  min-width: 0;
  font-family: ui-monospace, monospace;
}
.app-store-dialog .app-code-row button {
  flex-shrink: 0;
}
.app-store-dialog .app-code-help {
  font-size: 12px;
}
.app-store-dialog .app-pairing-link {
  display: inline-block;
  padding: 12px 0;
  font-size: 14px;
}
.app-store-dialog .app-pairing-steps {
  padding-left: 20px;
  margin: 22px 0;
}
.app-store-dialog .app-pairing-steps li {
  padding: 6px 0 6px 4px;
}
@media (max-width: 700px) {
  .apps-page .app-setup-guide {
    flex-direction: column;
    align-items: flex-start;
  }
  .apps-page .app-card {
    padding: 18px;
  }
  .apps-page button,
  .app-store-dialog button {
    min-height: 44px;
  }
  .app-store-dialog .app-code-row {
    flex-wrap: wrap;
  }
  .app-store-dialog .app-code-row input {
    flex-basis: 100%;
  }
  .app-store-dialog .app-code-row button {
    width: 100%;
  }
}
.apps-page > header {
  display: block;
}
.apps-page > header > p {
  margin: 8px 0 18px;
}
.apps-page .apps-installed .apps-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
}
.apps-page .app-card-heading > .app-status {
  flex: 0 0 auto;
  margin-top: 6px;
}
.apps-page .app-card footer {
  background: transparent;
  padding: 16px 0 0;
}
