/* TVUX — Structural Build (Apple-like Controls, Panel-only Nav, Proof Stamp) */

:root{
  --pad: 24px;
  --gap: 16px;

  --tile: 140px;
  --tileRadius: 12px;

  --panelRadius: 16px;
  --panelPad: 14px;

  --hit: 44px;                 /* Apple Touch Target */
  --line: rgba(0,0,0,.12);
  --text: #111;
  --bg: #fff;
}

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

body{
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}

.tvux{
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

/* HEADER */
.tvux-header{
  width: 100%;
  padding: var(--pad);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--gap);
}

.tvux-header__left{
  min-width: 0;
  display: grid;
  gap: 8px;
}

.tvux-brand{
  font-weight: 600;
  letter-spacing: .2px;
  font-size: 18px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tvux-slogans{
  display: grid;
  gap: 4px;
  min-width: 0;
}

.tvux-slogan{
  font-size: 14px;
  line-height: 1.2;
  opacity: .85;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* MENU BUTTON */
.tvux-menuBtn{
  flex: 0 0 auto;
  width: var(--hit);
  height: var(--hit);
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 999px;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

/* Icons */
.tvux-icon{
  width: 18px;
  height: 18px;
  display: block;
}

.tvux-icon--close{ display: none; }
.tvux-menuBtn.is-open .tvux-icon--hamburger{ display: none; }
.tvux-menuBtn.is-open .tvux-icon--close{ display: block; }

/* MAIN */
.tvux-main{
  width: 100%;
  padding: var(--pad);
  display: grid;
  place-items: center;
}

.tvux-tiles{
  display: grid;
  grid-template-columns: repeat(3, var(--tile));
  gap: var(--gap);
  justify-content: center;
  align-content: center;
}

.tvux-tile{
  width: var(--tile);
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--tileRadius);
  text-decoration: none;
  color: inherit;
  user-select: none;
  font-size: 14px;
}

/* FOOTER */
.tvux-footer{
  padding: 14px var(--pad);
  display: grid;
  place-items: center;
}

.tvux-copyright{
  font-size: 12px;
  opacity: .75;
}

/* NAV PANEL (panel-only => no iOS dim) */
.tvux-navPanel{
  position: fixed;
  z-index: 50;
  width: min(360px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: var(--panelRadius);
  background: #fff;
  padding: var(--panelPad);
  display: grid;
  gap: 14px;

  max-height: calc(100vh - 32px);
  overflow: auto;

  left: 16px; /* fallback */
  top: 16px;  /* fallback */
}

/* Pill */
.tvux-pill{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

.tvux-pill__item{
  border: 0;
  background: transparent;
  padding: 10px 8px;
  cursor: pointer;
  font: inherit;
}

.tvux-pill__item + .tvux-pill__item{
  border-left: 1px solid var(--line);
}

/* Social */
.tvux-social{
  display: flex;
  gap: 10px;
}

.tvux-social__icon{
  width: var(--hit);
  height: var(--hit);
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  font-size: 14px;
}

/* BUILDSTAMP */
.tvux-build{
  position: fixed;
  right: 12px;
  bottom: 12px;
  z-index: 9999;
  font-size: 12px;
  border: 1px solid rgba(0,0,0,.18);
  border-radius: 999px;
  padding: 6px 10px;
  background: #fff;
  opacity: .92;
}
html[data-tvux-js="ok"] .tvux-build__js::after{
  content: "OK";
}
html:not([data-tvux-js="ok"]) .tvux-build__js::after{
  content: "…";
}

/* Responsive */
@media (max-width: 520px){
  :root{ --tile: 120px; }
  .tvux-tiles{ grid-template-columns: repeat(2, var(--tile)); }
}