/* Tool-specific layout and behavior. Shared skin: /shared/theme.css. */
body {
  margin: 0;
  display: flex;
  flex-direction: column;
}
#pp-container {
  max-width: 960px;
  width: 100%;
  margin: 40px auto;
  padding: 20px;
  box-sizing: border-box;
  flex: 1;
}
#pp-header {
  text-align: center;
  font-size: 26px;
  color: var(--theme-color);
  margin: 0 0 6px;
}
.pp-sub {
  text-align: center;
  color: var(--tp-muted);
  margin: 0 0 24px;
}
.pp-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
}
.pp-panel {
  padding: 20px;
  margin-bottom: 20px;
}
.section-label {
  display: block;
  font-size: 12px;
  font-weight: bold;
  color: var(--tp-muted);
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.dropzone {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 110px;
  border: 2px dashed #bbb;
  border-radius: 8px;
  cursor: pointer;
  color: var(--tp-muted);
  padding: 12px;
}
.dropzone.over,
.dropzone:focus {
  border-color: var(--theme-color);
  outline: none;
  background: #f0f0ff;
}
.dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.crop-wrap {
  margin-top: 16px;
  text-align: center;
}
#crop-canvas {
  touch-action: none;
  cursor: grab;
  border: 1px solid var(--tp-border);
  max-width: 100%;
  background: #fff;
}
#crop-canvas:focus {
  outline: 2px solid var(--theme-color);
}
.crop-tools {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
  flex-wrap: wrap;
}
.crop-tools input[type="range"] {
  flex: 1;
  min-width: 100px;
  accent-color: var(--theme-color);
}
button {
  background: #fff;
  border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius-sm);
  padding: 8px 12px;
  font-size: 14px;
  cursor: pointer;
}
button:hover:not(:disabled) {
  border-color: var(--theme-color);
  color: var(--theme-color);
}
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.field {
  display: flex;
  flex-direction: column;
  font-size: 14px;
  gap: 4px;
  margin-bottom: 12px;
  flex: 1;
}
.field select,
.field input {
  padding: 8px;
  border: 1px solid var(--tp-border);
  border-radius: var(--tp-radius-sm);
  font-size: 14px;
}
.field-row {
  display: flex;
  gap: 12px;
}
.check {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 14px;
  margin-bottom: 8px;
}
.hint {
  font-size: 13px;
  color: var(--tp-muted);
}
.preview-wrap {
  background: #e8e8e8;
  padding: 16px;
  text-align: center;
  border-radius: 6px;
}
#preview-canvas {
  max-width: 100%;
  max-height: 520px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  background: #fff;
}
.download-bar {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 16px;
  flex-wrap: wrap;
}
.download-bar button {
  padding: 10px 20px;
  font-size: 15px;
}
.download-bar button:hover:not(:disabled) {
  color: #fff;
  filter: brightness(1.15);
}
.pp-content {
  padding: 20px;
  line-height: 1.6;
}
.pp-content h2 {
  color: var(--theme-color);
  font-size: 20px;
}
.pp-content h3 {
  font-size: 16px;
  margin-bottom: 4px;
}
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  padding: 10px 18px;
  border-radius: var(--tp-radius-sm);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
@media (max-width: 720px) {
  .pp-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  #pp-container {
    margin: 16px auto;
    padding: 12px;
  }
}
.table-wrap {
  overflow-x: auto;
}
table.sizes {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
}
table.sizes caption {
  text-align: left;
  font-weight: bold;
  margin-bottom: 6px;
}
table.sizes th,
table.sizes td {
  border: 1px solid var(--tp-border);
  padding: 6px 8px;
  text-align: left;
  white-space: nowrap;
}
table.sizes thead th {
  background: #f4f4f8;
}
table.sizes tbody th {
  font-weight: normal;
}
.crumbs {
  font-size: 13px;
  margin-bottom: 8px;
}
.crumbs a,
.related a,
.pp-content a {
  color: var(--theme-color);
}

/* Allow long template names to shrink inside mobile grid / flex tracks. */
.pp-panel,
.field {
  min-width: 0;
}
.field select,
.field input,
#size-search {
  width: 100%;
  min-width: 0;
}
