@font-face {
  font-family: "ToxTypewriter";
  src: url("./fonts/tox-typewriter.woff2") format("woff2"),
       url("./fonts/tox-typewriter.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

.ph-wrap{
  --ph-ink: #1b1b1b;
  --ph-paper: #fbfaf7;
  --ph-card: #ffffff;
  --ph-accent: #f6a16a;
  --ph-accent-2: #1aa6a6;
  --ph-line: rgba(0,0,0,.12);

  font-family: "ToxTypewriter", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  color: var(--ph-ink);
  background: var(--ph-paper);
  border: 1px solid var(--ph-line);
  border-radius: 16px;
  padding: 18px;
  max-width: 1120px;
  margin: 18px auto;
}

.ph-header { margin-bottom: 14px; }

.ph-title{
  font-size: 34px;
  letter-spacing: .5px;
  line-height: 1.1;
}

.ph-tagline{
  font-size: 16px;
  opacity: .85;
  margin-top: 4px;
}

.ph-sub{
  margin: 10px 0 0;
  font-size: 14px;
  opacity: .85;
}

.ph-grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 900px){
  .ph-grid{ grid-template-columns: 1fr; }
}

.ph-card{
  background: var(--ph-card);
  border: 1px solid var(--ph-line);
  border-radius: 14px;
  padding: 14px;
}

.ph-section-title{
  font-size: 15px;
  margin: 0 0 6px;
}

.ph-instructions{
  font-size: 13px;
  opacity: .85;
  margin: 0 0 10px;
}

.ph-divider{
  height: 1px;
  background: var(--ph-line);
  margin: 14px 0;
}

.ph-label{
  display: block;
  font-size: 14px;
  margin-bottom: 8px;
}

.ph-file{
  width: 100%;
  padding: 10px;
  border: 1px dashed var(--ph-line);
  border-radius: 12px;
  background: transparent;
}

.ph-controls{ margin-top: 12px; }
.ph-row{ margin-top: 12px; }

.ph-inline{
  display: flex;
  align-items: center;
  gap: 10px;
}

#ph-colors, #ph-threshold{ width: 100%; }

.ph-out{
  min-width: 44px;
  text-align: center;
  border: 1px solid var(--ph-line);
  border-radius: 10px;
  padding: 4px 8px;
  background: var(--ph-paper);
}

.ph-help{
  font-size: 13px;
  opacity: .85;
  margin-top: 6px;
}

.ph-help-tight{
  margin-top: 10px;
}

.ph-style{
  border: 1px solid var(--ph-line);
  border-radius: 12px;
  padding: 10px;
  background: var(--ph-paper);
}

.ph-toggles{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.ph-toggle{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--ph-line);
  padding: 8px 10px;
  border-radius: 999px;
  background: var(--ph-paper);
  cursor: pointer;
  user-select: none;
}

.ph-live{
  margin-top: 12px;
}

.ph-actions{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.ph-btn{
  border: 1px solid var(--ph-line);
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--ph-accent);
  cursor: pointer;
}

.ph-btn:disabled{
  opacity: .5;
  cursor: not-allowed;
}

.ph-btn-ghost{
  background: transparent;
  border-color: var(--ph-accent-2);
}

.ph-status{
  margin-top: 12px;
  font-size: 13px;
  opacity: .95;
  border-left: 4px solid var(--ph-accent-2);
  padding-left: 10px;
}

.ph-tipbox{
  margin-top: 14px;
  border: 1px solid var(--ph-line);
  border-radius: 12px;
  padding: 12px;
  background: var(--ph-paper);
}

.ph-tip-title{
  font-size: 14px;
  margin-bottom: 6px;
}

.ph-tiplist{
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  opacity: .9;
}

.ph-preview-head{
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}

.ph-mini{
  font-size: 13px;
  opacity: .8;
}

.ph-preview{
  margin-top: 10px;
  border: 1px solid var(--ph-line);
  border-radius: 12px;
  background: var(--ph-paper);
  overflow: hidden;
  position: relative;
  min-height: 420px;
  display: grid;
  place-items: center;
}

#ph-canvas{
  max-width: 100%;
  height: auto;
  display: block;
}

.ph-placeholder{
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 14px;
  opacity: .7;
  pointer-events: none;
}

.ph-placeholder.ph-hide{ display: none; }   

.ph-legal {
  font-size: 12px;
  opacity: .8;
  margin-top: 6px;
}

.ph-affiliate {
  margin-top: 12px;
  text-align: center;
}

.ph-affiliate-img {
  max-width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.1);
  transition: transform .2s ease;
}

.ph-affiliate-img:hover {
  transform: scale(1.02);
}

.ph-affiliate-caption {
  font-size: 13px;
  margin-top: 6px;
}

.ph-affiliate-disclaimer {
  font-size: 11px;
  opacity: .7;
  margin-top: 4px;
}