:root {
  --bg: #f4f6f8;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-solid: #ffffff;
  --text: #17191c;
  --muted: #737982;
  --border: #e6e8eb;
  --primary: #ef7a1a;
  --primary-dark: #d96508;
  --dark: #16181b;
  --danger: #c93d3d;
  --shadow: 0 18px 50px rgba(22, 24, 27, 0.08);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at top right, rgba(239, 122, 26, 0.12), transparent 28%),
    linear-gradient(180deg, #f8f9fa 0%, var(--bg) 100%);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(239, 122, 26, 0.25);
  outline-offset: 3px;
}

.page-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.brand-logo {
  width: 132px;
  height: 64px;
  object-fit: contain;
  object-position: left center;
  display: block;
}

.brand-copy h1 {
  margin: 1px 0 0;
  font-size: 18px;
  line-height: 1.1;
}

.eyebrow {
  display: block;
  margin: 0;
  color: var(--primary);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.icon-button {
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
  display: grid;
  place-items: center;
  transition: 160ms ease;
  box-shadow: 0 7px 18px rgba(22, 24, 27, 0.04);
}

.icon-button:hover {
  transform: translateY(-1px);
  background: #fff;
}

.icon-button svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.content {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  flex: 1;
}

.hero {
  margin-top: 24px;
  padding: 34px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(135deg, rgba(22, 24, 27, 0.98), rgba(40, 43, 48, 0.98));
  color: #fff;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 1fr minmax(260px, 390px);
  gap: 28px;
  align-items: end;
  overflow: hidden;
  position: relative;
}

.hero::after {
  content: "";
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: rgba(239, 122, 26, 0.18);
  position: absolute;
  right: -100px;
  top: -130px;
  filter: blur(3px);
}

.hero > * {
  position: relative;
  z-index: 1;
}

.hero-kicker {
  margin: 0 0 8px;
  color: rgba(255, 255, 255, 0.65);
  font-size: 13px;
  font-weight: 650;
}

.hero h2 {
  margin: 0;
  font-size: clamp(32px, 4vw, 52px);
  letter-spacing: -0.04em;
}

.hero-description {
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.66);
  font-size: 14px;
}

.search-box {
  min-height: 52px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.11);
  border: 1px solid rgba(255, 255, 255, 0.14);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 15px;
  backdrop-filter: blur(10px);
}

.search-box svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: rgba(255, 255, 255, 0.72);
  stroke-width: 2;
  stroke-linecap: round;
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  color: #fff;
  background: transparent;
  font-size: 14px;
}

.search-box input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.section-heading {
  margin: 34px 2px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.section-heading.compact {
  margin: 0 0 12px;
}

.section-heading h3 {
  margin: 0;
  font-size: 17px;
}

.app-count {
  color: var(--muted);
  font-size: 13px;
}

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

.app-card {
  min-width: 0;
  position: relative;
  text-decoration: none;
  color: inherit;
  padding: 18px;
  background: var(--surface);
  border: 1px solid rgba(230, 232, 235, 0.85);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  gap: 15px;
  box-shadow: 0 10px 28px rgba(22, 24, 27, 0.04);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease;
}

.app-card:hover {
  transform: translateY(-3px);
  border-color: rgba(239, 122, 26, 0.4);
  box-shadow: 0 16px 34px rgba(22, 24, 27, 0.08);
}

.app-icon-wrap {
  width: 58px;
  height: 58px;
  min-width: 58px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: #f1f2f3;
  overflow: hidden;
}

.app-icon {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.app-icon-fallback {
  width: 100%;
  height: 100%;
  display: none;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(239, 122, 26, 0.95), rgba(255, 163, 70, 0.95));
  color: #fff;
  font-size: 22px;
  font-weight: 800;
}

.app-card-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.app-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
}

.app-host {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
}

.open-indicator {
  margin-left: auto;
  align-self: flex-start;
  color: #a0a5ad;
  font-size: 15px;
}

.empty-state {
  padding: 54px 20px;
  border: 1px dashed #d9dde2;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.6);
  text-align: center;
}

.empty-state h3 {
  margin: 12px 0 6px;
}

.empty-state p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 14px;
}

.empty-icon {
  width: 54px;
  height: 54px;
  margin: 0 auto;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: rgba(239, 122, 26, 0.12);
  color: var(--primary);
  font-size: 30px;
  font-weight: 300;
}

.footer {
  width: min(1180px, calc(100% - 40px));
  margin: 34px auto 0;
  padding: 24px 2px calc(24px + var(--safe-bottom));
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(14, 16, 18, 0.56);
  backdrop-filter: blur(9px);
  padding: 24px;
  overflow-y: auto;
}

.overlay:not([hidden]) {
  display: grid;
  place-items: center;
}

.settings-panel {
  width: min(720px, 100%);
  max-height: calc(100vh - 48px);
  overflow: hidden;
  background: var(--surface-solid);
  border-radius: 26px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.22);
  display: flex;
  flex-direction: column;
}

.settings-header {
  padding: 22px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.settings-header h2 {
  margin: 2px 0 0;
  font-size: 22px;
}

.settings-body {
  padding: 24px;
  overflow-y: auto;
}

.app-form {
  display: grid;
  gap: 18px;
}

.form-group {
  display: grid;
  gap: 7px;
}

.form-group label {
  font-size: 13px;
  font-weight: 700;
}

.form-group input[type="text"],
.form-group input[type="url"] {
  width: 100%;
  min-height: 48px;
  border: 1px solid #dfe2e6;
  border-radius: 13px;
  padding: 0 14px;
  outline: 0;
  transition: 150ms ease;
}

.form-group input[type="text"]:focus,
.form-group input[type="url"]:focus {
  border-color: rgba(239, 122, 26, 0.8);
  box-shadow: 0 0 0 4px rgba(239, 122, 26, 0.08);
}

.form-group input[type="file"] {
  width: 100%;
  border: 1px dashed #d9dde2;
  border-radius: 13px;
  padding: 12px;
  background: #fafafa;
}

.form-group small {
  color: var(--muted);
  font-size: 11px;
}

.icon-preview-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.icon-preview {
  width: 66px;
  height: 66px;
  border-radius: 18px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: #f1f2f3;
  color: #9a9fa7;
  font-size: 12px;
  font-weight: 700;
}

.icon-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.text-button,
.danger-text-button {
  border: 0;
  background: transparent;
  padding: 7px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.danger-text-button {
  color: var(--danger);
}

.form-error {
  padding: 11px 13px;
  border-radius: 12px;
  background: rgba(201, 61, 61, 0.09);
  color: var(--danger);
  font-size: 12px;
  font-weight: 650;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.primary-button,
.secondary-button {
  min-height: 44px;
  border-radius: 12px;
  padding: 0 17px;
  font-size: 13px;
  font-weight: 750;
}

.primary-button {
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #fff;
}

.primary-button:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

.secondary-button {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
}

.manage-section {
  margin-top: 30px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.manage-list {
  display: grid;
  gap: 9px;
}

.manage-item {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
}

.manage-item-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #f1f2f3;
  object-fit: cover;
}

.manage-item-fallback {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(239, 122, 26, 0.12);
  color: var(--primary);
  font-weight: 800;
}

.manage-item-copy {
  min-width: 0;
}

.manage-item-copy strong,
.manage-item-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manage-item-copy strong {
  font-size: 13px;
}

.manage-item-copy span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.manage-item-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.small-button {
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 700;
}

.small-button.delete {
  color: var(--danger);
}

@media (max-width: 920px) {
  .app-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .topbar,
  .content,
  .footer {
    width: min(100% - 28px, 1180px);
  }

  .topbar {
    padding-top: 18px;
  }

  .hero {
    margin-top: 14px;
    padding: 24px;
    grid-template-columns: 1fr;
    gap: 22px;
    border-radius: 24px;
  }

  .hero h2 {
    font-size: 34px;
  }

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

  .app-card {
    min-height: 142px;
    padding: 16px 12px 14px;
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 10px;
    text-align: center;
  }

  .app-card-copy {
    width: 100%;
  }

  .app-icon-wrap {
    width: 60px;
    height: 60px;
    min-width: 60px;
  }

  .open-indicator {
    display: none;
  }

  .settings-panel {
    max-height: calc(100vh - 20px);
    border-radius: 22px;
  }

  .overlay {
    padding: 10px;
  }
}

@media (max-width: 420px) {
  .brand-logo {
    width: 108px;
    height: 54px;
  }

  .brand-copy h1 {
    font-size: 16px;
  }

  .hero {
    padding: 22px 18px;
  }

  .hero h2 {
    font-size: 31px;
  }

  .section-heading {
    margin-top: 26px;
  }

  .app-grid {
    gap: 10px;
  }

  .app-card {
    min-height: 130px;
  }

  .settings-header,
  .settings-body {
    padding-left: 18px;
    padding-right: 18px;
  }

  .form-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .manage-item {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .manage-item-icon,
  .manage-item-fallback {
    width: 40px;
    height: 40px;
  }

  .manage-item-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
}


.company-version-text {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.manage-item-title-row {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
}

.manage-item-title-row strong {
  min-width: 0;
}

.company-badge {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(239, 122, 26, 0.10);
  color: var(--primary);
  font-size: 9px;
  font-weight: 800;
}

.company-managed-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}


/* Compact official social links */
.social-section {
  margin-top: 30px;
  padding: 20px 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 8px 24px rgba(22, 24, 27, 0.035);
}

.social-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.social-heading h3 {
  margin: 3px 0 0;
  font-size: 15px;
}

.social-kicker {
  margin: 0;
  color: var(--primary);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.social-note {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.social-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.social-button {
  width: 44px;
  height: 44px;
  position: relative;
  flex: 0 0 44px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 5px 14px rgba(22, 24, 27, 0.05);
  text-decoration: none;
  transition:
    transform 150ms ease,
    box-shadow 150ms ease,
    border-color 150ms ease;
}

a.social-button:hover {
  transform: translateY(-2px);
  border-color: rgba(239, 122, 26, 0.30);
  box-shadow: 0 8px 18px rgba(22, 24, 27, 0.08);
}

.social-icon {
  width: 25px;
  height: 25px;
  display: block;
}

.social-badge {
  position: absolute;
  right: -5px;
  bottom: -5px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--dark);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 7px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.social-button.is-disabled {
  opacity: 0.45;
  filter: grayscale(0.25);
  cursor: default;
}

@media (max-width: 720px) {
  .social-section {
    margin-top: 24px;
    padding: 17px 16px;
  }

  .social-heading {
    align-items: center;
  }

  .social-note {
    display: none;
  }

  .social-grid {
    gap: 9px;
  }

  .social-button {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
    border-radius: 13px;
  }

  .social-icon {
    width: 24px;
    height: 24px;
  }
}
