#pedia-app { max-width: 1050px; margin: 20px auto; font-family: sans-serif; color: #333; line-height: 1.4; }
.pedia-section { background: #fff; border: 1px solid #ddd; border-radius: 8px; padding: 20px; margin-bottom: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.pedia-title { border-left: 6px solid #0073aa; padding-left: 12px; font-weight: bold; margin-bottom: 15px; color: #0073aa; font-size: 1.2em; }
.pedia-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; }
.input-group label { display: block; font-size: 13px; color: #444; margin-bottom: 6px; font-weight: bold; }
.input-group input { width: 100%; padding: 10px; border: 1px solid #bbb; border-radius: 4px; font-size: 16px; box-sizing: border-box; }
.quick-days { margin-top: 8px; display: flex; gap: 4px; }
.q-btn { background: #f0f0f0; border: 1px solid #ccc; padding: 5px 8px; border-radius: 4px; cursor: pointer; font-size: 11px; }
.q-btn.active { background: #0073aa; color: #fff; }
.search-container { position: relative; width: 100%; margin-bottom: 20px; }
.search-bar { width: 100%; padding: 14px; border: 2px solid #0073aa; border-radius: 6px; font-size: 16px; box-sizing: border-box; }
.search-clear-btn { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); border: none; background: #ddd; border-radius: 50%; cursor: pointer; width: 24px; height: 24px; }
.accordion-header { background: #f8f9fa; padding: 12px 15px; cursor: pointer; display: flex; justify-content: space-between; font-weight: bold; border: 1px solid #eee; }
.med-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; padding: 15px; background: #fff; border: 1px solid #eee; border-top: none; }
.med-card { border: 1px solid #ddd; padding: 10px; border-radius: 6px; cursor: pointer; font-size: 14px; position: relative; transition: background 0.2s; }
.med-type-powder { background-color: #ffffff; }
.med-type-syrup { background-color: #e3f2fd; }
.med-type-tablet { background-color: #e8f5e9; }
.med-card.selected { background-color: #fff3e0 !important; border-color: #ff9800; box-shadow: inset 0 0 0 1px #ff9800; }
.med-card-cat { position: absolute; bottom: 5px; right: 5px; font-size: 9px; color: #999; border: 1px solid rgba(0,0,0,0.05); padding: 1px 3px; border-radius: 2px; background: rgba(255,255,255,0.5); }
.result-table { width: 100%; border-collapse: collapse; border: 1px solid #444; margin-top: 10px; }
.result-table th { background: #f0f0f0; padding: 10px 5px; border: 1px solid #444; font-size: 13px; font-weight: bold; text-align: center; }
.result-table td { border: 1px solid #444; padding: 10px 4px; text-align: center; vertical-align: middle; }
.td-left { text-align: left !important; padding-left: 10px !important; }
.val-main { font-weight: 900; font-size: 1.35em; color: #000; }
.row-caution, .over-cell { background-color: #fff1f0 !important; }
.auto-label { font-size: 10px; color: #666; font-weight: normal; margin-top: 2px; }
.important-cell { background-color: #f0f7ff !important; border: 2px solid #0073aa !important; }
.fixed-hl { color: #0073aa; text-decoration: underline; }
.val-sub { color: #555; font-size: 11px; margin-top: 2px; }
.caution-txt { color: #f5222d; font-weight: bold; font-size: 11px; margin-top: 2px; }
.note-txt { color: #2e7d32; font-size: 11px; margin-top: 5px; border-top: 1px dotted #8bc34a; font-weight: bold; padding-top: 3px; }
.row-select, .row-input { padding: 6px; border: 1px solid #888; border-radius: 4px; width: 110px; text-align: center; font-size: 12px; }
.flex-center-col { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100%; width: 100%; gap: 5px; }
.fix-toggle-wrap { display: flex; flex-direction: column; gap: 4px; align-items: center; }
.toggle-btn { font-size: 10px; padding: 5px 8px; border: 1px solid #ccc; background: #fff; cursor: pointer; border-radius: 4px; width: 100px; font-weight: bold; }
.toggle-btn.active { background: #0073aa; color: #fff; border-color: #0073aa; }
.reset-btn { font-size: 9px; color: #d46b08; background: #fffbe6; border: 1px solid #ffe58f; border-radius: 3px; cursor: pointer; padding: 2px 4px; width: 100px; margin-top: 2px; }
.limit-btns { display: flex; gap: 2px; justify-content: center; margin-top: 5px; }
.m-btn { font-size: 10px; padding: 2px 6px; cursor: pointer; border: 1px solid #ccc; background: #fff; border-radius: 3px; }
.m-btn.active { background: #0073aa; color: #fff; border-color: #0073aa; }
.print-btn { background: #0073aa; color: #fff; border: none; padding: 15px 40px; border-radius: 6px; cursor: pointer; font-size: 18px; font-weight: bold; }
.print-footer { text-align: right; margin-top: 30px; }
.overflow-x { overflow-x: auto; }
.badge { background: #0073aa; color: #fff; padding: 2px 6px; border-radius: 10px; font-size: 10px; margin-left: 5px; }
.print-only { display: none; }
@media print { 
    .no-print { display: none !important; } 
    .print-only { display: inline !important; }
    .pedia-section { border: none !important; box-shadow: none !important; padding: 0 !important; }
    .result-table { margin-top: 0; width: 100% !important; }
    .result-table th, .result-table td { border: 1px solid #000; }
}
.print-timestamp {
    display: none; /* 通常は見えない */
}

@media print {
    .print-timestamp {
        display: block; /* 印刷時だけ見える */
    }
}