/* ========================================
   カマルド 無料ツール 共通スタイル
   既存ツール（CSS to SCSS 等）と同じ見た目に揃える
   ======================================== */
.tool-wrapper,
.tool-wrapper * { box-sizing: border-box; }

.tool-wrapper {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: clamp(30px, 5vw, 60px) clamp(15px, 3vw, 20px);
}

.tool-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: clamp(25px, 4vw, 40px);
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

/* ---------- ヘッダー ---------- */
.tool-header {
    text-align: center;
    margin-bottom: clamp(25px, 4vw, 35px);
    padding-bottom: clamp(20px, 3vw, 30px);
    border-bottom: 2px solid #e0e0e0;
}

.tool-title {
    color: #2c3e50;
    margin: 0 0 15px;
    font-size: clamp(20px, 4vw, 32px);
    font-weight: 700;
    line-height: 1.3;
    word-break: break-word;
}

.tool-description {
    color: #5a6c7d;
    font-size: clamp(14px, 2vw, 16px);
    line-height: 1.8;
    max-width: 900px;
    margin: 0 auto 20px;
}

.tool-description code {
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
    color: #667eea;
    white-space: nowrap;
}

.feature-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: clamp(8px, 1.5vw, 10px);
    margin-top: 20px;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: clamp(6px, 1vw, 8px) clamp(12px, 2vw, 16px);
    background: #e8f5e9;
    color: #2e7d32;
    border-radius: 20px;
    font-size: clamp(12px, 1.8vw, 14px);
    font-weight: 500;
    white-space: nowrap;
}

.badge-icon { margin-right: 5px; font-size: clamp(14px, 2vw, 16px); }

/* ---------- パネル ---------- */
.tool-panel {
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.tool-panel + .tool-panel { margin-top: 20px; }

.panel-head {
    background: #f5f5f5;
    padding: 14px 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.panel-head h2 {
    margin: 0;
    font-size: clamp(14px, 2vw, 16px);
    color: #2c3e50;
    font-weight: 600;
}

.panel-body { padding: clamp(16px, 3vw, 24px); }

/* ---------- フォーム部品 ---------- */
.tool-field { margin-bottom: 18px; }
.tool-field:last-child { margin-bottom: 0; }

.tool-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 7px;
}

.tool-hint {
    font-size: 12px;
    color: #8a97a3;
    line-height: 1.6;
    margin: 6px 0 0;
}

.tool-input,
.tool-select,
.tool-textarea {
    width: 100%;
    padding: 11px 13px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    color: #2c3e50;
    background: #fff;
    transition: border-color 0.2s;
}

.tool-input:focus,
.tool-select:focus,
.tool-textarea:focus {
    outline: none;
    border-color: #667eea;
}

.tool-textarea {
    min-height: 200px;
    resize: vertical;
    line-height: 1.7;
    font-family: 'Monaco', 'Consolas', 'Courier New', monospace;
    font-size: 13.5px;
}

.tool-range {
    width: 100%;
    accent-color: #667eea;
    height: 30px;
}

.tool-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
}

/* ---------- ボタン ---------- */
.tool-buttons {
    display: flex;
    gap: clamp(10px, 2vw, 15px);
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 22px;
}

.btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: clamp(12px, 2vw, 14px) clamp(20px, 4vw, 30px);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: clamp(14px, 2vw, 16px);
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    white-space: nowrap;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
}

.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 12px rgba(102,126,234,0.4); }
.btn:active { transform: translateY(0); }
.btn:disabled { background: #cccccc; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-secondary { background: #fff; color: #667eea; border: 2px solid #667eea; }
.btn-secondary:hover { background: #667eea; color: #fff; }
.btn-clear { background: #fff; color: #666; border: 2px solid #ddd; }
.btn-clear:hover { background: #f5f5f5; box-shadow: 0 6px 12px rgba(0,0,0,0.1); }
.btn-sm { padding: 8px 16px; font-size: 13px; min-height: 36px; }

/* ---------- ドロップゾーン ---------- */
.dropzone {
    border: 3px dashed #c5cbe8;
    border-radius: 12px;
    padding: clamp(30px, 6vw, 55px) 20px;
    text-align: center;
    background: #f8f9ff;
    cursor: pointer;
    transition: all 0.25s;
}

.dropzone:hover,
.dropzone.dragover {
    border-color: #667eea;
    background: #eef1ff;
}

.dropzone-icon { font-size: clamp(34px, 7vw, 46px); line-height: 1; margin-bottom: 12px; }
.dropzone-text { font-size: clamp(15px, 2.2vw, 17px); color: #2c3e50; font-weight: 600; margin: 0 0 6px; }
.dropzone-sub { font-size: 13px; color: #8a97a3; margin: 0; }

/* ---------- 結果表示 ---------- */
.result-box {
    background: #f8f9ff;
    border: 1px solid #e2e6f5;
    border-radius: 10px;
    padding: clamp(16px, 3vw, 22px);
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 14px;
}

.stat {
    background: #fff;
    border: 1px solid #e8eaf6;
    border-radius: 8px;
    padding: 14px 16px;
    text-align: center;
}

.stat-label { font-size: 11.5px; color: #8a97a3; margin: 0 0 6px; letter-spacing: 0.03em; }
.stat-value { font-size: clamp(18px, 3vw, 24px); font-weight: 700; color: #2c3e50; margin: 0; line-height: 1.2; }
.stat-value.good { color: #2e7d32; }
.stat-value.warn { color: #e65100; }

/* ---------- メッセージ ---------- */
.tool-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 14px 24px;
    background: #4caf50;
    color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s;
    z-index: 10000;
    font-weight: 500;
    pointer-events: none;
    max-width: calc(100vw - 40px);
}

.tool-message.show { opacity: 1; transform: translateY(0); }
.tool-message.error { background: #f44336; }

/* ---------- 説明セクション ---------- */
.about-section {
    line-height: 1.9;
    color: #5a6c7d;
    margin-top: clamp(30px, 4vw, 44px);
    font-size: clamp(14px, 1.9vw, 15px);
}

.about-section h2 {
    font-size: clamp(19px, 3vw, 23px);
    color: #2c3e50;
    margin: clamp(30px, 4vw, 40px) 0 clamp(14px, 2vw, 18px);
    padding-bottom: 10px;
    border-bottom: 2px solid #eceff4;
}

.about-section h3 {
    font-size: clamp(16px, 2.4vw, 18px);
    color: #2c3e50;
    margin: 28px 0 10px;
}

.about-section p { margin: 0 0 15px; }
.about-section ul, .about-section ol { margin: 0 0 16px; padding-left: 1.4em; }
.about-section li { margin-bottom: 7px; }

.about-section code {
    background: #f0f0f0;
    padding: 2px 7px;
    border-radius: 4px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
    color: #667eea;
}

.faq-item {
    border: 1px solid #e8eaf6;
    border-radius: 8px;
    padding: 16px 18px;
    margin-bottom: 12px;
    background: #fbfcff;
}

.faq-item h3 { margin: 0 0 8px; font-size: 15.5px; }
.faq-item p { margin: 0; font-size: 14px; }

/* ---------- 表 ---------- */
.tool-table-scroll { overflow-x: auto; margin: 0 0 18px; }

.tool-table {
    width: 100%;
    min-width: 480px;
    border-collapse: collapse;
    font-size: 14px;
}

.tool-table th,
.tool-table td {
    padding: 11px 14px;
    border-bottom: 1px solid #eceff4;
    text-align: left;
    vertical-align: top;
}

.tool-table th {
    background: #f5f6fa;
    color: #2c3e50;
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
}

/* ---------- 関連ツール ---------- */
.related-tools { margin-top: clamp(30px, 4vw, 40px); }

.related-tools h2 {
    font-size: clamp(19px, 3vw, 23px);
    color: #2c3e50;
    margin: 0 0 18px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eceff4;
}

.tool-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 14px;
}

.tool-card {
    display: block;
    border: 1px solid #e4e7f2;
    border-radius: 10px;
    padding: 18px;
    text-decoration: none;
    background: #fff;
    transition: all 0.25s;
}

.tool-card:hover {
    border-color: #667eea;
    transform: translateY(-3px);
    box-shadow: 0 8px 18px rgba(102,126,234,0.16);
}

.tool-card-icon { font-size: 26px; line-height: 1; margin-bottom: 9px; }
.tool-card-name { font-size: 15px; font-weight: 700; color: #2c3e50; margin: 0 0 6px; line-height: 1.45; }
.tool-card-desc { font-size: 12.5px; color: #8a97a3; margin: 0; line-height: 1.65; }

/* ---------- レスポンシブ ---------- */
@media (max-width: 600px) {
    .tool-container { padding: 20px 16px; border-radius: 10px; }
    .tool-buttons .btn { width: 100%; }
    .tool-message { left: 20px; right: 20px; top: 12px; }
}

@media (prefers-reduced-motion: reduce) {
    .tool-wrapper *, .tool-card { transition: none !important; }
    .btn:hover, .tool-card:hover { transform: none; }
}

.visually-hidden {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border-width: 0;
}

/* ---------- テーマ既定の見出し装飾を打ち消す ---------- */
/* AFFINGER の h2:not(.st-css-no2) と同等以上の詳細度が要るため :not() を重ねる */
.tool-wrapper h1:not(.st-css-no2),
.tool-wrapper h2:not(.st-css-no2),
.tool-wrapper h3:not(.st-css-no2),
.tool-wrapper h4:not(.st-css-no2) {
    background: none;
    background-color: transparent;
    background-image: none;
    border: none;
    box-shadow: none;
    text-shadow: none;
    position: static;
    padding: 0;
    line-height: 1.45;
}

.tool-wrapper h1:not(.st-css-no2)::before, .tool-wrapper h1:not(.st-css-no2)::after,
.tool-wrapper h2:not(.st-css-no2)::before, .tool-wrapper h2:not(.st-css-no2)::after,
.tool-wrapper h3:not(.st-css-no2)::before, .tool-wrapper h3:not(.st-css-no2)::after,
.tool-wrapper h4:not(.st-css-no2)::before, .tool-wrapper h4:not(.st-css-no2)::after {
    content: none;
    display: none;
}

.tool-wrapper .about-section h2:not(.st-css-no2),
.tool-wrapper .related-tools h2:not(.st-css-no2) {
    padding: 0 0 10px;
    border-bottom: 2px solid #eceff4;
}

.tool-wrapper .tools-group-lead {
    border-bottom: 2px solid #eceff4;
}

/* AFFINGER の input{width:100%} より詳細度を上げてカラーピッカーの幅を保つ */
.tool-wrapper input[type="color"]:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="image"]) {
    width: 56px;
    min-width: 56px;
    flex: none;
    height: 44px;
    padding: 2px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
}
