:root{
  --bg:#ffffff;
  --text:#111111;
  --muted:#666666;
  --border:rgba(0,0,0,.10);
  --border-strong:rgba(0,0,0,.28);
  --radius:18px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }

body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* prevent mobile tap-zoom quirks */
html, body { touch-action: manipulation; }
button, a { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }

.wrap{
  max-width: 980px;
  margin: 0 auto;
  padding: 22px 16px;
}

.site-header{
  background:#fff;
  border-bottom:1px solid var(--border);
}

.title{
  margin:0;
  font-size: 26px;
  line-height: 1.1;
  letter-spacing: .2px;
}

.section{ margin-top: 18px; }

/* ---------- Thumbnail strip (scrollbar) ---------- */

.thumb-viewport{
  width: 100%;
  border:1px solid var(--border);
  border-radius: var(--radius);
  background:#fff;
  padding: 10px;
  overflow: hidden; /* keeps the container clean */
}

.thumb-strip{
  display:flex;
  gap: 10px;
  overflow-x:auto;          /* keep scrollbar */
  overflow-y:hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  padding-bottom: 6px;
}

.thumb-strip::-webkit-scrollbar{ height:10px; }
.thumb-strip::-webkit-scrollbar-thumb{
  background: rgba(0,0,0,.18);
  border-radius: 999px;
}

.thumb{
  flex: 0 0 auto;
  width: 86px;
  height: 86px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background:#fff;
  overflow:hidden;
  cursor:pointer;
  padding:0;
  appearance: none;
  -webkit-appearance: none;
}

.thumb img{
  width:100%;
  height:100%;
  object-fit: contain;
  display:block;
  padding: 8px;
  background:#fff;
}

/* clear active state */
.thumb.is-active{
  border: 2px solid rgba(0,0,0,.55);
  box-shadow: 0 0 0 4px rgba(0,0,0,.06);
}

.thumb:focus-visible{
  outline: 2px solid rgba(0,0,0,.45);
  outline-offset: 2px;
}

/* ---------- Preview ---------- */

.preview{
  border:1px solid var(--border);
  border-radius: var(--radius);
  background:#fff;
  padding: 14px;
}

.preview-meta{
  display:flex;
  justify-content:flex-end;
  margin-bottom: 10px;
}

.preview-actions{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
}

.link-btn{
  border:1px solid var(--border);
  background:#fff;
  color: var(--text);
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 14px;
  text-decoration:none;
  cursor:pointer;
}

.link-btn:hover{ background: rgba(0,0,0,.02); }
.link-btn:active{ transform: translateY(1px); }

.preview-frame{
  border:1px solid var(--border);
  border-radius: 16px;
  background:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 14px;
  min-height: 320px;
}

.preview-frame img{
  max-width: 100%;
  max-height: 62vh;
  width: auto;
  height: auto;
  object-fit: contain;
  background:#fff;
}

/* ---------- Empty ---------- */

.empty{
  border:1px solid var(--border);
  border-radius: var(--radius);
  background:#fff;
  padding: 16px;
}

/* ---------- Footer ---------- */

.site-footer{
  margin-top: 26px;
  border-top:1px solid var(--border);
  background:#fff;
  color: var(--muted);
}

.footer-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.footer-email{
  color: var(--text);
  text-decoration:none;
}
.footer-email:hover{ text-decoration: underline; }

/* ---------- Small screens ---------- */
@media (max-width: 420px){
  .wrap{ padding: 18px 14px; }
  .thumb{ width: 76px; height: 76px; }
}

/* ---------- Desktop polish ---------- */
@media (min-width: 860px){
  .wrap{ padding: 26px 18px; }
  .preview-frame{ min-height: 420px; padding: 18px; }
}
