/* Print & Craft tools — shared layout (graph-paper, envelope-template, label-maker,
   poster-maker). Everything is scoped under .pc-app / .pc- classes. */

.pc-page .tool-header { padding: 40px 20px; }
/* display rules below must never beat the hidden attribute */
.pc-app [hidden] { display: none !important; }
.pc-app {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    gap: 28px;
    padding: 28px;
    align-items: start;
}
.pc-preview { position: sticky; top: 78px; }
.pc-stage {
    position: relative; border-radius: 14px; overflow: hidden; background: #e9edf3;
    display: flex; align-items: center; justify-content: center; padding: 18px;
    min-height: 320px; box-shadow: inset 0 0 0 1px #dfe4ec;
}
.pc-stage canvas, .pc-stage svg, .pc-stage img { max-width: 100%; height: auto; display: block; box-shadow: 0 6px 22px rgba(31,42,51,0.18); background: #fff; }
.pc-stage-note { text-align: center; color: #6c757d; font-size: 0.82rem; margin-top: 8px; }
.pc-summary { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.pc-chip-info { background: #f4f7fb; border-radius: 8px; padding: 7px 11px; font-size: 0.84rem; color: #2c3e50; }
.pc-chip-info b { color: #667eea; }
.pc-chip-info.is-warn { background: #fff4e5; color: #8a4b00; }
.pc-chip-info.is-warn b { color: #c05600; }

.pc-controls { display: flex; flex-direction: column; gap: 14px; }
.pc-sec { background: #f8f9fb; border: 1px solid #eceff5; border-radius: 14px; padding: 16px 18px; }
.pc-sec[hidden] { display: none; }
.pc-h { font-size: 1rem; color: #2c3e50; margin: 0 0 12px; font-weight: 700; }
.pc-row { margin-top: 10px; }
.pc-row:first-child { margin-top: 0; }
.pc-row[hidden] { display: none; }
.pc-row > label, .pc-label { display: block; font-size: 0.86rem; font-weight: 600; color: #2c3e50; margin-bottom: 4px; }
.pc-row select, .pc-row input[type=text], .pc-row input[type=number], .pc-row textarea {
    width: 100%; padding: 9px 10px; border: 2px solid #e5e7eb; border-radius: 8px; font-size: 0.92rem; color: #333; background: #fff; font-family: inherit;
}
.pc-row textarea { resize: vertical; min-height: 90px; line-height: 1.45; }
.pc-row select:focus, .pc-row input:focus, .pc-row textarea:focus { outline: none; border-color: #667eea; }
.pc-row input[type=range] { width: 100%; accent-color: #667eea; }
.pc-row input[type=color] { width: 44px; height: 36px; border: 2px solid #e5e7eb; border-radius: 8px; padding: 2px; background: #fff; cursor: pointer; }
.pc-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pc-grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.pc-grid2 .pc-row, .pc-grid3 .pc-row { margin-top: 0; }
.pc-inline { display: flex; align-items: center; gap: 8px; }
.pc-inline input[type=number] { width: 90px; }
.pc-val { color: #667eea; font-weight: 700; }
.pc-note { font-size: 0.8rem; color: #6c757d; margin: 6px 0 0; line-height: 1.45; }
.pc-check { display: flex; gap: 8px; align-items: flex-start; font-size: 0.88rem; color: #333; margin-top: 10px; cursor: pointer; line-height: 1.4; }
.pc-check input { margin-top: 3px; accent-color: #667eea; }

.pc-seg { display: inline-flex; flex-wrap: wrap; background: #e9edf5; border-radius: 9px; padding: 3px; gap: 2px; }
.pc-seg button {
    border: none; background: transparent; padding: 6px 12px; border-radius: 7px; font-weight: 600; font-size: 0.85rem;
    color: #4a5568; cursor: pointer; transition: all 0.2s ease; font-family: inherit;
}
.pc-seg button.is-on { background: #fff; color: #667eea; box-shadow: 0 1px 4px rgba(0,0,0,0.12); }

.pc-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.pc-card {
    text-align: left; border: 2px solid #e3e7f1; background: #fff; border-radius: 12px; padding: 9px 11px; cursor: pointer;
    transition: all 0.2s ease; display: flex; flex-direction: column; gap: 2px; font: inherit; color: #333;
}
.pc-card:hover { border-color: #667eea; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(102,126,234,0.15); }
.pc-card.is-on { border-color: #667eea; background: #f1f3ff; box-shadow: 0 0 0 2px rgba(102,126,234,0.25); }
.pc-card b { font-size: 0.88rem; color: #2c3e50; }
.pc-card span { font-size: 0.74rem; color: #6c757d; line-height: 1.3; }
.pc-card i { font-style: normal; font-size: 1.2rem; }

.pc-swatches { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pc-swatch {
    width: 30px; height: 30px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px #d5dae3; cursor: pointer;
    transition: transform 0.2s ease;
}
.pc-swatch:hover { transform: translateY(-2px); }
.pc-swatch.is-on { box-shadow: 0 0 0 3px #667eea; }

.pc-drop {
    border: 2px dashed #b9c3e8; border-radius: 14px; background: #f7f8ff; padding: 26px 16px; text-align: center; cursor: pointer;
    transition: all 0.2s ease; color: #4a5568;
}
.pc-drop:hover, .pc-drop.is-over { border-color: #667eea; background: #eef1ff; }
.pc-drop b { color: #667eea; }

.pc-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.pc-btn {
    padding: 12px 16px; border-radius: 10px; border: 2px solid #667eea; background: #fff; color: #667eea; font-weight: 700;
    font-size: 0.95rem; cursor: pointer; transition: all 0.25s ease; font-family: inherit;
}
.pc-btn:hover { background: #667eea; color: #fff; transform: translateY(-2px); box-shadow: 0 6px 16px rgba(102,126,234,0.25); }
.pc-btn-primary { background: #ff6b00; border-color: #ff6b00; color: #fff; font-size: 1.02rem; }
.pc-btn-primary:hover { background: #e65f00; border-color: #e65f00; box-shadow: 0 6px 16px rgba(255,107,0,0.3); }
.pc-btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }
.pc-btn-sm { padding: 7px 12px; font-size: 0.85rem; border-width: 2px; }
.pc-status { font-size: 0.85rem; color: #2f855a; min-height: 1.2em; margin-top: 6px; }
.pc-status.is-err { color: #c53030; }

.pc-howto { max-width: 1200px; margin: 0 auto; padding: 0 28px 10px; }
.pc-howto h2 { font-size: 1.3rem; color: #2c3e50; margin-bottom: 10px; }
.pc-howto ol { margin: 0 0 0 22px; color: #333; line-height: 1.7; }
.pc-tip { margin-top: 12px; background: #fff7ed; border-left: 4px solid #ff6b00; padding: 10px 14px; border-radius: 8px; color: #5a3b1a; font-size: 0.92rem; }

@media (max-width: 960px) {
    .pc-app { grid-template-columns: 1fr; padding: 16px; gap: 18px; }
    .pc-preview { position: static; }
    .pc-howto { padding: 0 16px 10px; }
}
@media (max-width: 480px) {
    .pc-sec { padding: 14px; }
    .pc-stage { padding: 10px; min-height: 240px; }
    .pc-grid3 { grid-template-columns: 1fr 1fr; }
}
