:root{
  --gap: 22px;
  --dark: #000;
  --light: #e9e9e9;
  --white: #fff;

  --text-dark: #111;
  --text-muted-dark: #bdbdbd;
  --text-muted-light: #666;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }

body{
  margin:0;
  background:#fff;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text-dark);
}

/* Kill default link colors (purple/blue) */
a, a:visited, a:hover, a:active{
  color: inherit;
  text-decoration: none;
}

.page{
  width: min(980px, 92vw);
  margin: 22px auto 60px;
}

/* ===== Banner ===== */
.banner{
  background: #f1f1f1;
  padding: 20px 22px 18px;
  margin-bottom: var(--gap);

  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 16px;

  overflow:hidden; /* prevents huge image from expanding layout */
}

.banner-mark{
  height: 86px;          /* controls logo size */
  max-width: 70%;
  width: auto;
  object-fit: contain;
  display:block;
}

.banner-tagline{
  font-size: 14px;
  white-space: nowrap;
  color:#111;
}

/* ===== Grid ===== */
.grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
}

/* ===== Tiles ===== */
.tile{
  display:flex;
  flex-direction:column;
  height: 240px;              /* stable tile height */
  padding: 16px 18px;
  overflow:hidden;
  transition: transform .15s ease;
}
.tile:hover{ transform: translateY(-1px); }

.tile--dark{ background: var(--dark); color:#fff; }
.tile--light{ background: var(--light); }
.tile--white{ background: var(--white); }

/* Media area (logo/image) */
.tile-media{
  flex: 1 1 auto;
  display:flex;
  align-items:center;
  justify-content:center;
  width:100%;
  min-height: 0;
}

/* If you want the IOL logo centered too, change flex-start -> center */
.tile-media--iol{
  justify-content: flex-start;
}

.tile-img{
  max-width: 96%;
  max-height: 100%;
  object-fit: contain;
  display:block;
}

/* Content area */
.tile-body{
  flex: 0 0 auto;
  padding-top: 10px;
}

/* Captions */
.tile-caption{
  font-size: 12px;
  line-height: 1.25;
  color: #333;
  text-align: center;
}
.tile-caption--dark{
  color: var(--text-muted-dark);
}

/* Subtitle */
.tile-subtitle{
  font-size: 12px;
  line-height: 1.2;
  color: var(--text-muted-dark);
  margin-bottom: 6px;
  text-align: center;
}

/* Contact title */
.contact-title{
  font-size: 20px;
  letter-spacing: 1px;
  color: #111;
  text-align: center;
}

/* Make the rings not dominate */
.tile-img--contact{
  max-width: 85%;
}

/* =========================
   CENTERING RULES (FINAL)
   MEDly list + IOL list + App Store badge
========================= */

/* MEDly: center subtitle + list */
.tile.tile--dark .tile-body{
  display:flex;
  flex-direction:column;
  align-items:center;
  text-align:center;
}

/* IOL: center list + badge */
.tile.tile--white .tile-body.tile-body--iol{
  display:flex;
  flex-direction:column;
  align-items:center;
  text-align:center;
}

/* Default list styling (MEDly) */
.tile.tile--dark .tile-body .tile-list{
  list-style-position: inside;
  padding-left: 0;
  margin: 8px 0 0;
  text-align: center;

  font-size: 11px;
  line-height: 1.35;
  color: var(--text-muted-dark);
}

.tile.tile--dark .tile-body .tile-list li{
  text-align:center;
  margin: 2px 0;
}

/* IOL list: centered as a block, but numbers align cleanly */
.tile.tile--white .tile-body.tile-body--iol .tile-list{
  list-style-position: inside;
  padding-left: 0;
  margin: 6px 0 12px;

  display: inline-block;  /* shrink-wrap the list */
  text-align: left;       /* keeps numbering aligned */
  font-size: 11px;
  line-height: 1.35;
  color: var(--text-muted-light);
}

.tile-list li::marker{
  font-size: 0.85em;
}

/* App Store badge centered */
.appstore-badge{
  width: 170px;
  height: auto;
  display:block;
  margin: 0;
  align-self: center;  /* works because parent is flex */
}

/* ===== Responsive ===== */
@media (max-width: 760px){
  .banner{
    flex-direction: column;
    align-items:flex-start;
  }
  .banner-tagline{
    white-space: normal;
  }
  .banner-mark{
    max-width: 100%;
  }
  .grid{
    grid-template-columns: 1fr;
  }
  .tile{
    height: 220px;
  }
}
