* { box-sizing: border-box; margin: 0; }

body {
  display: flex;
  height: 100vh;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: #2b3138;
  overflow: hidden;
}

/* ---------- control panel ---------- */
#panel {
  width: 290px;
  min-width: 290px;
  padding: 18px 20px 12px;
  background: #fdfdfb;
  border-right: 2px solid #c9cdd4;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#panel h1 {
  font-family: "Segoe Print", "Bradley Hand", cursive;
  font-size: 22px;
  letter-spacing: .5px;
}

.sub {
  font-family: "Segoe Print", "Bradley Hand", cursive;
  font-size: 12px;
  color: #8a9099;
  margin-top: 2px;
}

.grp {
  border: 1.5px solid #d7dae0;
  border-radius: 8px;
  padding: 10px 12px 11px;
  background: #fff;
}

.grp-title {
  font-family: "Segoe Print", "Bradley Hand", cursive;
  font-size: 13px;
  color: #4a525e;
  margin-bottom: 8px;
}

.unit { font-size: 11px; color: #9aa0a8; font-family: "Segoe UI", sans-serif; }

.row { display: flex; gap: 8px; }

button.preset {
  flex: 1;
  padding: 6px 0;
  font-family: "Segoe Print", cursive;
  font-size: 12px;
  background: #f3f5f7;
  border: 1.5px solid #c9cdd4;
  border-radius: 6px;
  cursor: pointer;
}
button.preset:hover { background: #e8f0fa; border-color: #7ba7d7; }

.dim {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 5px 0;
}
.dim label { width: 84px; font-size: 13px; }
.dim input, .dim select {
  width: 64px;
  padding: 4px 6px;
  font-size: 13px;
  border: 1.5px solid #c9cdd4;
  border-radius: 5px;
  background: #fbfcfd;
}
.ftin { font-size: 11px; color: #9aa0a8; }
.note { font-size: 10px; }

.radio, .check {
  display: block;
  font-size: 13px;
  padding: 3px 0;
  cursor: pointer;
}
.radio input, .check input { margin-right: 7px; }

#generate {
  padding: 12px 0;
  font-family: "Segoe Print", cursive;
  font-size: 15px;
  color: #fff;
  background: #2f6db4;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}
#generate:hover { background: #285e9c; }
#generate:disabled { background: #9db8d4; cursor: wait; }

#status {
  font-size: 12px;
  color: #6b7280;
  min-height: 16px;
  font-family: "Segoe Print", cursive;
}

#results { display: flex; flex-direction: column; gap: 8px; }
#results img {
  width: 100%;
  border: 1.5px solid #c9cdd4;
  border-radius: 6px;
  cursor: pointer;
}
#results a { font-size: 11px; color: #2f6db4; }

footer {
  margin-top: auto;
  padding-top: 10px;
  font-size: 10px;
  color: #b3b8bf;
  text-align: center;
}

/* ---------- viewport: graph paper ---------- */
#view {
  flex: 1;
  position: relative;
  background:
    linear-gradient(#dfe7f0 1px, transparent 1px),
    linear-gradient(90deg, #dfe7f0 1px, transparent 1px),
    linear-gradient(#eef2f7 1px, transparent 1px),
    linear-gradient(90deg, #eef2f7 1px, transparent 1px),
    #f8fafc;
  background-size: 80px 80px, 80px 80px, 16px 16px, 16px 16px;
}

#c { width: 100%; height: 100%; display: block; }
