:root{
  --text-color:#111;
  --panel-bg:#f6f6f6;
  --panel-border:#e5e5e5;
  --shadow: 0 2px 8px rgba(0,0,0,.06);
}

/* Prevent iOS auto-zoom on focus by ensuring inputs are >=16px */
textarea, input, button { font-size: 16px; }

html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  background: #fff;
  color: var(--text-color);
  font-family: "Quicksand", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-optical-sizing: auto;
}

main { padding-top: 56px; }

#container{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap: 12px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 8px 16px 8px;
  box-sizing:border-box;
}

.panel{
  width: 100%;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 12px;
  box-sizing: border-box;
}

.field{
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
}

label{
  font-weight: 500;
  font-size: 14px;
}

/* Controls layout: textarea left, fill+generate right */
.controls-layout{
  display: flex;
  gap: 12px;
  align-items: stretch;
}

.controls-left{
  flex: 1 1 auto;
  min-width: 0;
}

.controls-right{
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end; /* place on the right side */
  justify-content: flex-end;
  min-width: 150px;
}

textarea{
  width: 100%;
  min-height: 110px;
  resize: vertical;
  padding: 10px 12px;
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  box-sizing: border-box;
  font-family: inherit;
  line-height: 1.35;
  background: #fff;
}

input[type="text"]{
  width: 92px;
  padding: 10px 12px;
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  box-sizing: border-box;
  font-family: inherit;
  background: #fff;
}

button{
  appearance: none;
  border: 1px solid var(--panel-border);
  background: #fff;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 500;
  line-height: 1;
  min-height: 44px; /* consistent touch target and equal heights */
}

button:hover{
  background: #f2f2f2;
}

#outputArt{
  background: #fff;
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 12px;
  margin: 0;
  overflow: auto;
  min-height: 180px;
  white-space: pre;
  font-family: "Courier New", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

/* Output footer with Copy button at bottom-right */
.output-actions{
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
}

.copy-wrap{
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
}

/* Tooltip that briefly shows then fades (floats above Copy) */
.tooltip{
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%) translateY(6px);
  white-space: nowrap;

  font-size: 13px;
  font-weight: 500;
  color: #111;

  /* glass-like, matching header */
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  padding: 6px 10px;
  box-shadow: var(--shadow);

  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease, transform 220ms ease;
}

.tooltip.show{
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.tooltip.fade{
  opacity: 0;
}

/* Small screens: stack but keep controls aligned to the right */
@media (max-width: 520px){
  .controls-layout{
    flex-direction: column;
  }
  .controls-right{
    align-self: flex-end; /* keep on right side */
    min-width: 0;
  }
  input[type="text"]{
    width: 110px;
  }
  }
