:root { --panel-w: 450px; --bg: #333333; --panel: #ffffff; --border: #f3f3f3; --text: #000E14; --muted: #a6afc3; --accent: #b4008d; }

* { 
	box-sizing: border-box; 
}

html, body { 
	height: 100%;
}

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

.app{
  display: grid;
  grid-template-columns: var(--panel-w) 1fr;
  grid-template-rows: 1fr;
  height: 100vh;
  height: 100dvh;
}

.stageWrap{
  position: relative;
  overflow: hidden;
  min-height: 0;
}

#stageContainer{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
}
.panel { 
	padding: 16px; 
	background: var(--panel); 
	border-right: 1px solid var(--border); 
	overflow: auto; 
	justify-content: center;
	padding-bottom:32px;
}

.panel h1 { 
	font-size: 32px; 
	margin: 0 0 12px;
}

.panel .logo{
	width:100%;
	padding:16px;
}

.group { 
	margin: 12px 0 16px; 
	padding: 12px; 
	border: 1px solid var(--border); 
}

.group h2 { 
	font-size: 16px; 
	margin: 0 0 10px; 
	color: var(--text); 
	font-weight: 600; 
}

label { 
	display: block; 
	font-size: 13px; 
	margin: 10px 0 6px; 
	color: var(--text); 
}

select, input[type=file], button { 
	width: 100%; 
	border: 1px solid var(--border); 
	background: var(--panel); 
	color: var(--text); 
	padding: 10px 12px; 
	font-size: 14px; 
}

button { 
	cursor: pointer; 
	background: var(--accent); 
	border-color: var(--accent); 
	text-align: center; 
	color: var(--panel); 
	font-weight: 600;
}

button.primary { 
	background: var(--accent); 
	border-color: var(--accent); 
	height: 42px;
}

button:disabled { 
	opacity: .5; 
	cursor: not-allowed; 
}

.row { 
	display: grid; 
	grid-template-columns: 1fr 1fr; 
	gap: 10px; 
}

.radios { 
	display: grid;
	gap: 8px; 
}

.radios label { 
	display: flex; 
	align-items: center; 
	gap: 8px; margin: 0;
	color: var(--text); 
	font-size: 14px; 
}

.hint { 
	font-size: 12px; 
	line-height: 1.35; 
	color: var(--text); 
	margin-top: 8px; 
}

.topbar { 
	position: absolute; 
	left: 12px; 
	right: 12px; 
	top: 12px; 
	display: flex; 
	justify-content: space-between; 
	align-items: center; 
	pointer-events: none; 
}

.badge { 
	pointer-events: none; 
	padding: 8px 10px; 
	background: rgba(0,0,0,.35); 
	border: 1px solid rgba(255,255,255,.12); 
	font-size: 12px; 
	color: var(--panel); 
}

@media (max-width: 920px) {
  .app{
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 100dvh;
  }

  .stageWrap{
    order: 1;
    position: relative;
    height: 60dvh;
    min-height: 420px;
    overflow: hidden;
  }

  #stageContainer{
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
  }

  .panel{
    order: 2;
    overflow: visible;
    border-right: none;
    border-top: 1px solid var(--border);
  }
}

.btnRow{
  display: flex;
  gap: 10px;
  align-items: center;
}

#uploadBtn{
  flex: 1 1 auto;
}

#cameraBtn{
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  padding: 0; 
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#cameraBtn .icon{
  width: 20px;
  height: 20px;
  display: block;
  fill: currentColor;
}

/* Smartphone-only (coarse && max-width) */
#cameraBtn { display: none; } /* default aus */
@media (pointer: coarse) and (max-width: 820px){
  #cameraBtn { display: inline-flex; }
}

.overlayThumbs{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.overlayThumb{
  border: 1px solid rgba(0,0,0,.12);
  padding: 8px;
  background: #fff;
  cursor: pointer;
  appearance: none;
}

.overlayThumb::before{
  content: "";
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  background-color: #fff;
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
}

.overlayThumb img{
  width: 100%;
  height: auto;
  display: block;
  margin-top: calc(-100%);
  pointer-events: none;
}

.overlayThumb.isActive{
  outline: 2px solid rgba(0,0,0,.55);
  outline-offset: 2px;
}

.overlayThumb:hover{
  border-color: rgba(0,0,0,.25);
}

.imprintLink{
  position: absolute;
  left: 0;
  bottom: 0;
  padding:12px;
  font-size: 12px;
  color: var(--text);
  text-decoration: none;
  background: var(--border);
  width:var(--panel-w);
}

.imprintLink:hover{
  text-decoration: underline;
}

@media (max-width: 920px) {
  .imprintLink{
    position: relative;
	top:16px;
  }
}