:root { font-family: system-ui, sans-serif; color: #1c1c1c; }
.container { max-width: 880px; margin: 2rem auto; padding: 0 1rem; }

/* top navigation */
.topnav { display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: .5rem 1rem; padding: .7rem 1rem; background: #1c1c1c;
  color: #fff; position: sticky; top: 0; z-index: 10; }
.topnav-brand { color: #fff; font-weight: 600; text-decoration: none; font-size: 1.05rem; }
.topnav-links { display: flex; gap: .25rem; flex-wrap: wrap; }
.topnav-links a { color: #ddd; text-decoration: none; padding: .35rem .7rem;
  border-radius: 6px; font-size: .95rem; }
.topnav-links a:hover { background: #333; color: #fff; }
.topnav-links a.active { background: #0a7d4b; color: #fff; }
h1 { font-weight: 600; }
form label { display: block; margin: 1rem 0; }
button, .shop { background: #1c1c1c; color: #fff; border: 0; padding: .6rem 1rem;
  border-radius: 6px; cursor: pointer; text-decoration: none; display: inline-block; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.card { border: 1px solid #e3e3e3; border-radius: 10px; padding: 1rem; }
.price { font-weight: 600; }
.reason { color: #444; font-size: .95rem; }
.error { color: #b00020; }

/* recommendation card actions */
.actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .5rem; }
.tryon { background: #0a7d4b; color: #fff; padding: .6rem 1rem; border-radius: 6px;
  text-decoration: none; display: inline-block; }

/* catalog showcase */
.cat-heading { text-transform: capitalize; margin: 1.5rem 0 .5rem; }
.thumb { display: block; }
.thumb img { width: 100%; height: 160px; object-fit: contain;
  background: #f6f6f6; border-radius: 8px; }
.card h3 { font-weight: 600; font-size: 1rem; margin: .5rem 0 .25rem; }
.home-link { margin-top: 1.5rem; }
.setup { display: flex; gap: 1.5rem; flex-wrap: wrap; align-items: flex-start; }
.setup-thumb { width: 260px; max-width: 100%; height: auto; object-fit: contain;
  background: #f6f6f6; border-radius: 8px; }
.setup-forms { flex: 1; min-width: 260px; }
.sub { font-size: 1rem; font-weight: 600; margin: .5rem 0; }
.rooms { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: .6rem; margin-bottom: 1rem; }
.room-thumb { display: block; width: 100%; padding: 0; background: #fff;
  cursor: pointer; border-radius: 8px; overflow: hidden; border: 1px solid #e3e3e3; }
.room-thumb img { width: 100%; height: 90px; object-fit: cover; display: block; }
.room-thumb:hover { border-color: #0a7d4b; }
.room-thumb.active { border-color: #0a7d4b; box-shadow: 0 0 0 2px #0a7d4b; }

/* uploaded rooms on the home page */
.rooms-section { margin-top: 2rem; }
.room-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center;
  margin-top: 1rem; }
#room-preview { margin: 1rem 0 0; }
#room-preview img { max-width: 100%; max-height: 70vh; border-radius: 8px; display: block; }

/* try-in-room screen */
.try-page { max-width: 1080px; }
.try-layout { display: flex; gap: 1.5rem; align-items: flex-start; margin-top: 1rem; }
.try-nav { flex: 0 0 220px; max-height: 80vh; overflow-y: auto; }
.try-main { flex: 1; min-width: 0; }
.nav-cat { text-transform: capitalize; font-size: .9rem; font-weight: 600;
  margin: .8rem 0 .4rem; color: #444; }
.try-nav ul { list-style: none; margin: 0; padding: 0; }
.nav-row { display: flex; align-items: center; gap: .15rem; }
.nav-item { flex: 1; min-width: 0; display: flex; gap: .5rem; align-items: center;
  padding: .35rem; border-radius: 6px; text-decoration: none; color: #1c1c1c;
  font-size: .82rem; line-height: 1.2; }
.nav-item:hover { background: #f3f3f3; }
.nav-item.active { background: #eaf5ef; font-weight: 600; }
.nav-item img { flex: 0 0 40px; width: 40px; height: 40px; object-fit: contain;
  background: #f6f6f6; border-radius: 4px; }
.nav-shop { flex: 0 0 auto; display: flex; align-items: center; justify-content: center;
  padding: .4rem; color: #0a7d4b; border-radius: 6px; }
.nav-shop:hover { background: #eaf5ef; }
@media (max-width: 640px) {
  .try-layout { flex-direction: column; }
  .try-nav { flex-basis: auto; width: 100%; max-height: none; }
}
.hint { color: #444; }
.meta { font-weight: 600; }
.status { min-height: 1.4em; color: #0a7d4b; }
.status.error { color: #b00020; }
#stage { position: relative; display: inline-block; max-width: 100%; line-height: 0; }
#room { max-width: 100%; height: auto; display: block; cursor: crosshair; border-radius: 8px; }
#product { position: absolute; top: 0; left: 0; cursor: grab; touch-action: none;
  user-select: none; -webkit-user-drag: none; filter: drop-shadow(0 6px 10px rgba(0,0,0,.35)); }
#product:active { cursor: grabbing; }
.cal-marker { position: absolute; width: 22px; height: 22px; margin: -11px 0 0 -11px;
  border-radius: 50%; background: #0a7d4b; color: #fff; font-size: 12px;
  line-height: 22px; text-align: center; font-weight: 600; pointer-events: none;
  box-shadow: 0 0 0 2px #fff; }
.reset-btn { display: inline-block; margin: .6rem 0; background: #fff; color: #1c1c1c;
  border: 1px solid #1c1c1c; padding: .45rem .9rem; border-radius: 6px; cursor: pointer; }
.reset-btn:hover { background: #f3f3f3; }
.reset-btn.active { background: #0a7d4b; color: #fff; border-color: #0a7d4b; }
.try-buttons { display: flex; gap: .5rem; flex-wrap: wrap; margin: .6rem 0; }
.try-buttons .reset-btn { margin: 0; }

/* camera try-on (mobile) */
/* The panes below use display:flex, which would override the `hidden`
   attribute's default display:none — force hidden to always win. */
[hidden] { display: none !important; }
.camera-body { margin: 0; background: #000; }
#camera-screen { position: fixed; inset: 0; overflow: hidden; touch-action: none; }
#cam { width: 100%; height: 100%; object-fit: cover; display: block; }
#ar-product { position: absolute; top: 0; left: 0; touch-action: none;
  user-select: none; -webkit-user-drag: none; filter: drop-shadow(0 6px 12px rgba(0,0,0,.4)); }
.cam-overlay { position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 1rem; padding: 1.5rem;
  background: rgba(0,0,0,.65); color: #fff; text-align: center; }
.cam-title { font-size: 1.1rem; font-weight: 600; }
.cam-hint { position: absolute; top: env(safe-area-inset-top, 12px); left: 0; right: 0;
  margin: 12px auto; max-width: 90%; color: #fff; background: rgba(0,0,0,.5);
  padding: .5rem .8rem; border-radius: 8px; font-size: .9rem; text-align: center; }
.cam-controls { position: absolute; left: 0; right: 0;
  bottom: env(safe-area-inset-bottom, 16px); padding: 1rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between; }
.cam-back { color: #fff; font-size: 1.6rem; text-decoration: none; width: 44px; }
.cam-spacer { width: 44px; }
.cam-shutter { width: 72px; height: 72px; border-radius: 50%; border: 4px solid #fff;
  background: #fff; cursor: pointer; box-shadow: 0 0 0 3px rgba(0,0,0,.3); }
.cam-shutter:active { transform: scale(.95); }
.cam-btn-primary { background: #0a7d4b; color: #fff; border: 0; padding: .7rem 1.4rem;
  border-radius: 8px; font-size: 1rem; text-decoration: none; cursor: pointer; }
.cam-btn { background: #fff; color: #1c1c1c; border: 0; padding: .6rem 1.1rem;
  border-radius: 8px; font-size: .95rem; cursor: pointer; }
.cam-link { color: #fff; text-decoration: underline; font-size: .9rem; }
.cam-result-img { max-width: 90%; max-height: 60vh; border-radius: 8px; }
.cam-result-actions { display: flex; gap: .6rem; flex-wrap: wrap; justify-content: center; }
.cam-save-status { color: #fff; min-height: 1.2em; }
.cam-save-status a { color: #8fe3b5; }
.camera-link { background: #1c1c1c; color: #fff; padding: .6rem 1rem; border-radius: 6px;
  text-decoration: none; display: inline-block; }
