/*
Theme Name: 華佗の薬箱 (Kadahutu Medicine Box)
Theme URI: https://kadahutu.com
Author: Your Name
Author URI: https://kadahutu.com
Description: A custom WordPress theme for drug side effect search functionality with traditional Japanese aesthetics
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: kadahutu
*/

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Zen+Maru+Gothic:wght@400;500;700&family=Noto+Sans+JP:wght@300;400;500;700&display=swap');

/* CSS Variables */
:root {
    --bs-link-color: #0f90cf;
    --bs-link-color-rgb: 15, 144, 207;
    --bs-link-hover-color: #086b9c;
    --bs-link-hover-color-rgb: 8, 107, 156;
    --bs-link-color-light: #cfe9f5;
    --bs-btn-bg: #0f90cf;
    --bs-btn-border-color: #0f90cf;
    --bs-btn-disabled-bg: #0f90cf;
    --bs-btn-disabled-border-color: #0f90cf;
    --bs-btn-active-color: #086b9c;
    --bs-btn-hover-bg: #086b9c;
    --bs-btn-hover-border-color: #086b9c;

    --primary-orange: #FF7F3E;
    --primary-orange-rgb: 255, 127, 62;
    --accent-red: #E63946;
    --accent-red-rgb: 230, 57, 70;
    --accent-yellow: #ffd900;
    --accent-pink: #eb95a9;
    --accent-sky: #87CEEB;
    --accent-purple:#cfabdd;
    --bg-cream: #FAFBEE;
    --bg-beige: #F5F1E8;
    --text-dark: #2C2416;
    --text-gray: #6B6B6B;
    --card-bg: #FFFFFF;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.15);

    --font-ja-ud-sans:
    -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;

    --kada-red: #D92626;
    --kada-red-rgb: 217, 38, 38;
    --kada-orange: #FD7430;
    --kada-orange-rgb: 253, 116, 48;
    --kada-brown: #6B4423;
    --kada-brown-rgb: 107, 68, 35;
}
.card {
    background-color: transparent;
}
.btn-primary {
    --bs-btn-bg: #0f90cf;
    --bs-btn-border-color: #0f90cf;
    --bs-btn-disabled-bg: #0f90cf;
    --bs-btn-disabled-border-color: #0f90cf;
    --bs-btn-active-color: #086b9c;
    --bs-btn-hover-bg: #086b9c;
    --bs-btn-hover-border-color: #086b9c;
}
.nav {
    --bs-nav-link-color: var(--bs-link-color);
}

/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
.form-control:focus {
    box-shadow: 0 0 0 .2rem rgba(var(--bs-link-color-rgb), .25);
    border-color: rgba(var(--bs-link-color-rgb), .5);
    outline: none;
}

.font-color-kada-brown {
    color: var(--kada-brown);
}
body {
    font-family: var(--font-ja-ud-sans);
    background-color: var(--bg-cream);
    color: var(--text-dark);
    line-height: 1.7;
    overflow-x: hidden;
}

html, body {
  height: 100%;
}

body {
    overflow-y: scroll;
    margin: 0;          /* ← デフォの 8px が超よく原因になる */
}
main {
    min-height: 80vh;
}
.site-header {
    background: linear-gradient(90deg, var(--kada-orange) 0%, #F7931E 100%);
    border: none;
    border-bottom-right-radius: 1.5rem;
    border-bottom-left-radius: 1.5rem;
    margin-bottom: 2rem;
}
.custom-logo-link img{
    width: 300px;
    height: auto;
}
.kadakusu-bg {
    background-image: url("/wp-content/themes/kadahutu-theme/assets/images/main_bg.jpg");
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    position: fixed;
    inset: 0;
    z-index: -9999;
}
.kadakusu-drug_bg {
    background-image: url("/wp-content/themes/kadahutu-theme/assets/images/drug_guide_bg.jpg");
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    position: fixed;
    inset: 0;
    z-index: -9999;
}
.hero-area {
    height: 680px;
}
.hero-content {
    position: absolute;
    top: 140px;
    left: 140px;
}
.hero-content h1 {
    font-size: 100px;
    background: linear-gradient(90deg, var(--kada-orange) 0%, #F7931E 100%);
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1.75rem;
    line-height: 1;
}
.hero-content .main-catch {
    font-size: 3.4rem;
    font-weight: bold;
    line-height: 1;
}
.hero-content .sub-catch1 {
    font-size: 1.4rem;
    line-height: 1;
    margin-bottom: 1rem;
}
.hero-content .sub-catch2 {
    font-size: 1.8rem;
}
.hero-content .attention {
    padding: 1rem;
    background: rgb(255 255 255 / 85%);
    border-radius: .5rem;
}
.hero-content .attention ul {
    margin-bottom: 0;
}

#page.site {
    min-height: 100dvh; /* 100vh より安全（ブラウザUI差分） */
    display: flex;
    flex-direction: column;
}

#page.site > main {
    flex: 1;
}

/* footer の上マージンが原因になりがちなので念のため */
footer {
    margin-top: 0;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-ja-ud-sans);
    font-weight: 700;
}

a {
    text-decoration: none;
    transition : all 0.5s;
    text-underline-offset: 0.25em;
}
a:hover {
    text-decoration: underline;
}


/* Hero Section */
.hero-section {
    position: relative;
    background: linear-gradient(135deg, #F5F1E8 0%, #FCF9F1 100%);
    padding: 80px 0 60px;
    overflow: hidden;
}


/* Decorative cloud elements */
.cloud-decoration {
    position: absolute;
    opacity: 0.6;
    z-index: 0;
}

.cloud-1 {
    top: 20px;
    right: 10%;
    width: 80px;
}

.cloud-2 {
    top: 60px;
    right: 25%;
    width: 60px;
}

/* Search Section */
.search-section {
    background: linear-gradient(135deg, var(--primary-orange) 0%, #FF9955 100%);
    padding: 2rem 0;
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 10;
}

.search-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.search-icon {
    width: 48px;
    height: 48px;
    background: rgba(255,255,255,0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.search-title {
    font-size: 1.75rem;
    color: white;
    font-weight: 700;
    margin: 0;
}

.search-form {
    position: relative;
}

.search-input-group {
    display: flex;
    gap: 0.75rem;
    background: white;
    border-radius: 12px;
    padding: 0.5rem;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

.search-input-group:focus-within {
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
    transform: translateY(-2px);
}

.search-input {
    flex: 1;
    border: none;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    outline: none;
    background: transparent;
}

.search-input::placeholder {
    color: #999;
}

.search-button {
    background: var(--primary-orange);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-button:hover {
    background: #FF6A1F;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255,127,62,0.4);
}

/* Added Medicines List */
.medicines-list-section {
    padding: 2rem 0;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.section-icon {
    width: 32px;
    height: 32px;
    color: var(--primary-orange);
    font-size: 1.5rem;
}

.section-title {
    font-size: 1.3rem;
    color: var(--text-dark);
    font-weight: 700;
    margin: 0;
}

.medicine-card {
    background: var(--card-bg);
    border: 2px solid #E8E4DA;
    border-radius: 12px;
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.medicine-card:hover {
    border-color: var(--primary-orange);
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
}

.medicine-info h4 {
    font-size: 1.1rem;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.medicine-meta {
    font-size: 0.85rem;
    color: var(--text-gray);
}

.medicine-remove {
    background: none;
    border: none;
    color: #999;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    transition: all 0.2s ease;
}

.medicine-remove:hover {
    color: var(--accent-red);
    transform: scale(1.2);
}
#kadakusu-sideeffects-panel .card-header h2 {
    width: 100%;
}
#kadakusu-sideeffects-panel .card-header #btn-print-kadakusu {
    white-space: nowrap;
}
/* Side Effects Results */
.results-section {
    padding: 2rem 0;
}

.alert-warning {
    background: linear-gradient(135deg, #FFF8E1 0%, #FFF3CC 100%);
    border-left: 4px solid var(--primary-orange);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.alert-icon {
    font-size: 1.5rem;
    color: var(--primary-orange);
    margin-top: 0.2rem;
}

.alert-content {
    flex: 1;
}

.alert-content h3 {
    font-size: 1.1rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.alert-content p {
    font-size: 0.9rem;
    color: var(--text-gray);
    line-height: 1.6;
}
#etc-side-effects-sec {
    padding-top: 2rem;
}

/* Serious Side Effects */
.serious-effects {
    margin-bottom: .5rem;
}

.serious-header {
    background: linear-gradient(135deg, var(--accent-red) 0%, #D32F3E 100%);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 12px 12px 0 0;
    font-size: 1.2rem;
    font-weight: 700;
}

.effect-card {
    background: var(--card-bg);
    border: 1px solid #E8E4DA;
    border-top: none;
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    transition: all 0.3s ease;
}

.effect-card:last-child {
    border-radius: 0 0 12px 12px;
}

.effect-card:hover {
    background: #FFFBF5;
    border-color: var(--primary-orange);
}

.effect-info h4 {
    font-size: 1rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.effect-symptoms {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.symptom-tag {
    background: #E3F2FD;
    color: #1976D2;
    padding: 0.25rem 0.75rem;
    border-radius: 16px;
    font-size: 0.85rem;
}

.effect-frequency {
    background: #F5F5F5;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text-gray);
    white-space: nowrap;
}

/* Other Side Effects */
.other-effects {
    margin-bottom: .5rem;
}

.other-header {
    background: linear-gradient(135deg, #9E9E9E 0%, #757575 100%);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 12px 12px 0 0;
    font-size: 1.2rem;
    font-weight: 700;
}

.severity-badge {
    display: inline-block;
    padding: 0.35rem 0.85rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.badge-high {
    background: #FFEBEE;
    color: #C62828;
}

.badge-moderate {
    background: #FFF3E0;
    color: #E65100;
}

/* Important Notice */
.important-notice {
    background: linear-gradient(135deg, #FFF9E6 0%, #FFEFC1 100%);
    border: 2px solid #FFD54F;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 3rem;
}

.notice-title {
    font-size: 1.3rem;
    color: var(--text-dark);
    margin-bottom: 1rem;
    font-weight: 700;
}

.notice-list {
    list-style: none;
    padding: 0;
}

.notice-list li {
    padding: 0.5rem 0;
    padding-left: 2rem;
    position: relative;
    color: var(--text-gray);
    font-size: 0.95rem;
}

.notice-list li::before {
    content: '●';
    position: absolute;
    left: 0.5rem;
    color: #FFB300;
}

/* Footer */
.site-footer {
    border-top-right-radius: 1.5rem;
    border-top-left-radius: 1.5rem;
    background: linear-gradient(90deg, var(--kada-orange) 0%, #F7931E 100%);
    color: white;
    padding: 2.5rem 0 1.5rem;
    margin-top: 4rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 4rem;
    margin-bottom: 1.5rem;
}

.footer-link {
    color: white;
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    opacity: 0.9;
}

.footer-link:hover {
    opacity: 1;
    text-decoration: underline;
}

.footer-site {
    text-align: center;
    font-size: 0.9rem;
    opacity: 0.8;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .75rem;
}
.footer-x-link {
    color: white;
    font-size: 1.2rem;
    line-height: 1;
    opacity: 0.8;
    text-decoration: none;
    transition: opacity .15s;
}
.footer-x-link:hover {
    opacity: 1;
}


/* 副作用（縦積み：横並びにしない） */
.kadakusu-cols{
    display:block;
}
.kadakusu-col{
    margin-bottom: 3rem;
}
.kadakusu-col h3.danger-side-effects,
.kadakusu-col h3.etc-side-effects {
    background: var(--kada-red);
    padding: .75rem 1rem;
    border-radius: 10px;
    color: #fff;
}
.kadakusu-col h3.etc-side-effects {
    color: black;
    background: #ddd;
}
.kadakusu-row {
    display:flex;
    gap:12px;
    align-items:center;
    padding: 1rem;
    border-bottom: 1px dotted #e7e7e7;
    border-top: 2px dotted #ddd;
}
.kadakusu-row-wrap {
    margin-bottom: 4rem;
}
.kadakusu-row-wrap .kadakusu-row {
    border-top: none;
}
.kadakusu-row-wrap .kadakusu-row:first-of-type {
    border-top: 2px dotted #ddd;
}
.tab-content {
    padding: 2rem;
    min-height: 12rem;
    background-color: #fff;
    border-radius: .5rem;
    width: stretch;
}
.kadakusu-row-wrap .kadakusu-row:first-of-type .kadakusu-row-value {
    font-weight: bold;
    font-size: 1rem;
}
.kadakusu-row-wrap .kadakusu-row .kadakusu-row-value p {
    margin-bottom: 0;
}
.kadakusu-row-wrap .kadakusu-row:first-of-type .kadakusu-row-value ul:last-child {
    margin-bottom: 0;
}
.kadakusu-row-wrap .kadakusu-row:first-of-type .kadakusu-row-value p + ul {
    margin-bottom: 1rem;
}
.kadakusu-row-wrap .kadakusu-row:first-of-type .kadakusu-row-value ul {
    font-weight: normal;
}


.kadakusu-row-label {
    font-weight: bold;
    font-size:.8rem;
    min-width: 160px;
}

/* 重複行の薬名だけ非表示（列幅は維持） */
.kadakusu-row.is-dup > .kadakusu-drug { visibility: hidden; }
.kadakusu-row.is-dup {
    border-top: none;
    border-bottom: 1px dotted #e7e7e7;
}

.kadakusu-row:last-child,
.kadakusu-row.is-last-drug {
    border-bottom:none;
}
.kadakusu-drug{
    position: relative;
    width: 220px;
    min-width:160px;
    font-weight:bold;
    display: inline-block;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: bottom;
    opacity: .95;
    background: transparent;
    border: none;
    transition: all;
    transition-duration: .25s;
    color: #037cb7;
}
.kadakusu-drug:hover{
    color: var(--bs-link-color);
}

.kadakusu-sys-freq-wrap {
    display: flex;
    align-items: center;
}

.kadakusu-name{flex:1;min-width:0;}
.kadakusu-name sup {
    display: none;
}
.kadakusu-freq{
    width:120px;
    flex:0 0 120px;
    opacity: .8;
    font-size: .8rem;
}
.kadakusu-freq sup {
    display: none;
}
.kadakusu-system{
    font-size: .85rem;
    font-weight: bold;
    margin-right: 8px;
    min-width: 220px;
    padding-top: .5rem;
    padding-bottom: .5rem;
    border-radius: 4px;
    position: relative;
    padding-left: 65px; /* 28pxアイコン + 余白 */
    background-color: transparent !important;
}

.kadakusu-system::before{
    content:"";
    position:absolute;
    left: 0px;
    top: 50%;
    transform: translateY(-50%);
    width: 56px;
    height: 56px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

/* 25分類スラッグ（あなたの確定版） */
.kadakusu-row[data-system-slug="anus"] .kadakusu-system::before{ background-image:url("/wp-content/themes/kadahutu-theme/assets/images/anus.png"); }
.kadakusu-row[data-system-slug="medication-use"] .kadakusu-system::before{ background-image:url("/wp-content/themes/kadahutu-theme/assets/images/medication-use.png"); }
.kadakusu-row[data-system-slug="eye"] .kadakusu-system::before{ background-image:url("/wp-content/themes/kadahutu-theme/assets/images/eye.png"); }
.kadakusu-row[data-system-slug="immune"] .kadakusu-system::before{ background-image:url("/wp-content/themes/kadahutu-theme/assets/images/immune.png"); }
.kadakusu-row[data-system-slug="skin"] .kadakusu-system::before{ background-image:url("/wp-content/themes/kadahutu-theme/assets/images/skin.png"); }
.kadakusu-row[data-system-slug="respiratory"] .kadakusu-system::before{ background-image:url("/wp-content/themes/kadahutu-theme/assets/images/respiratory.png"); }
.kadakusu-row[data-system-slug="neuro"] .kadakusu-system::before{ background-image:url("/wp-content/themes/kadahutu-theme/assets/images/neuro.png"); }
.kadakusu-row[data-system-slug="endocrine-metabolic"] .kadakusu-system::before{ background-image:url("/wp-content/themes/kadahutu-theme/assets/images/endocrine-metabolic.png"); }
.kadakusu-row[data-system-slug="fetus-neonate"] .kadakusu-system::before{ background-image:url("/wp-content/themes/kadahutu-theme/assets/images/fetus-neonate.png"); }
.kadakusu-row[data-system-slug="fluid-electrolyte"] .kadakusu-system::before{ background-image:url("/wp-content/themes/kadahutu-theme/assets/images/fluid-electrolyte.png"); }
.kadakusu-row[data-system-slug="general-local-application-site"] .kadakusu-system::before{ background-image:url("/wp-content/themes/kadahutu-theme/assets/images/general-local-application-site.png"); }
.kadakusu-row[data-system-slug="congenital-familial"] .kadakusu-system::before{ background-image:url("/wp-content/themes/kadahutu-theme/assets/images/congenital-familial.png"); }
.kadakusu-row[data-system-slug="reproductive"] .kadakusu-system::before{ background-image:url("/wp-content/themes/kadahutu-theme/assets/images/reproductive.png"); }
.kadakusu-row[data-system-slug="renal-urinary"] .kadakusu-system::before{ background-image:url("/wp-content/themes/kadahutu-theme/assets/images/renal-urinary.png"); }
.kadakusu-row[data-system-slug="neoplasm"] .kadakusu-system::before{ background-image:url("/wp-content/themes/kadahutu-theme/assets/images/neoplasm.png"); }
.kadakusu-row[data-system-slug="cardiovascular"] .kadakusu-system::before{ background-image:url("/wp-content/themes/kadahutu-theme/assets/images/cardiovascular.png"); }
.kadakusu-row[data-system-slug="tooth"] .kadakusu-system::before{ background-image:url("/wp-content/themes/kadahutu-theme/assets/images/tooth.png"); }
.kadakusu-row[data-system-slug="oral-pharyngeal-ear-nose"] .kadakusu-system::before{ background-image:url("/wp-content/themes/kadahutu-theme/assets/images/oral-pharyngeal-ear-nose.png"); }
.kadakusu-row[data-system-slug="hematologic"] .kadakusu-system::before{ background-image:url("/wp-content/themes/kadahutu-theme/assets/images/hematologic.png"); }
.kadakusu-row[data-system-slug="hepatic-biliary"] .kadakusu-system::before{ background-image:url("/wp-content/themes/kadahutu-theme/assets/images/hepatic-biliary.png"); }
.kadakusu-row[data-system-slug="infection-fever"] .kadakusu-system::before{ background-image:url("/wp-content/themes/kadahutu-theme/assets/images/infection-fever.png"); }
.kadakusu-row[data-system-slug="sensory"] .kadakusu-system::before{ background-image:url("/wp-content/themes/kadahutu-theme/assets/images/sensory.png"); }
.kadakusu-row[data-system-slug="musculoskeletal"] .kadakusu-system::before{ background-image:url("/wp-content/themes/kadahutu-theme/assets/images/musculoskeletal.png"); }
.kadakusu-row[data-system-slug="gastrointestinal"] .kadakusu-system::before{ background-image:url("/wp-content/themes/kadahutu-theme/assets/images/gastrointestinal.png"); }
.kadakusu-row[data-system-slug="women"] .kadakusu-system::before{ background-image:url("/wp-content/themes/kadahutu-theme/assets/images/women.png"); }
.kadakusu-row[data-system-slug="men"] .kadakusu-system::before{ background-image:url("/wp-content/themes/kadahutu-theme/assets/images/men.png"); }
.kadakusu-row[data-system-slug="other"] .kadakusu-system::before{ background-image:url("/wp-content/themes/kadahutu-theme/assets/images/other.png"); }
.kadakusu-empty{
    opacity:.7;
    padding:8px 0;
    margin-left: 1rem;
}

/*=====================*/
/* 吹き出し */
/*=====================*/
.ae-pop {
    display: inline-block;
}
.ae-popover{
    z-index: 99999;
    width: min(420px, calc(100vw - 24px));
    background:#fff;
    border:2px solid #eb6a2a;
    border-radius:8px;
    box-shadow:0 10px 30px rgba(0,0,0,.18);

    opacity: 0;
    transform: translateY(4px) scale(.98);
    transition: opacity .14s ease, transform .14s ease;
    will-change: opacity, transform;
    pointer-events: none; /* 隠れてる時に触れない */
}
/* 表示中 */
.ae-popover.is-open{
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}
/* 閉じ中（見た目はベース状態に戻るだけなので、主に状態用） */
.ae-popover.is-closing{
    pointer-events: none;
}

@media (prefers-reduced-motion: reduce){
    .ae-popover{ transition: none; transform: none; }
}

.ae-popover-bar {
    width: 100%;
    height: 24px;
    background: var(--primary-orange);
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    cursor: move;
}
.ae-popover-bar hr {
    margin: 0;
    margin-bottom: .25rem;
    border-top-width: 2px;
    border-top-color: #fff;
}
.ae-popover-bar hr:last-child {
    margin-bottom:0;
}
.ae-popover-head{
    display:flex;
    justify-content:space-between;
    gap:10px;
    align-items:start;
    margin: 1rem 1rem 0;
}
.ae-popover-therapeutic_classification {
    line-height: 1.3;
    font-size: .9rem;
    margin-bottom: .5rem;
}
.ae-popover-generic_name {
    line-height: 1;
    font-size: .8rem;
    opacity: .75;
    margin-bottom: .5rem;
}
.ae-popover-title{
    font-weight:700;
    font-size:1.2rem;
    line-height: 1.3;
}
.ae-popover-kana{
    font-size:.8rem;
    opacity:.75;
    margin: 0 1rem;
}
.ae-popover-actions {
    display: flex;
    gap: 1rem;
}
.ae-popover-actions button {
    color: rgba(var(--bs-link-color-rgb), .75);
    transition: all;
    animation-delay: .25s;
}
.ae-popover-actions button:hover {
    color: rgba(var(--bs-link-color-rgb), 1);
}

.ae-popover-copy,
.ae-popover-close{
    display: flex;
    border:none;
    background:transparent;
    font-size:1.2rem;
    cursor:pointer;
}
.ae-popover-body{
    margin-top:1rem;
    font-size:1rem;
    line-height:1.6;
    overflow: auto;
    max-height: var(--kd-popover-max-h, 60vh); /* JSで上書きされる */
    margin: 0 1rem;
}
.ae-popover-subitem {
    margin: 0 1rem;
}
.ae-popover-foot{
    display: flex;
    align-items: center;
    flex-direction: row;
    justify-content: end;
    padding-top: .5rem;
    margin: 0 1rem 1rem;
}
.ae-popover-link{
    font-size:.75rem;
    text-decoration:underline;
}
.ae-popover-foot .ae-popover-link::after {
    content: "\f105";
    font-family: "Font Awesome 7 Free";
    font-weight: 900;
    margin-left: .5rem;
}
.kd-popover--drug .kd-popover-label {
    padding-top: 1rem;
    font-size: .8rem;
    opacity: .8;
    line-height: 1;
    margin: 0 1rem;
}
.kd-popover--drug .ae-popover-body {
    margin-top: .25rem;
}
.ae-bubble-toast{
    position: fixed;
    z-index: 2147483647;
    left: 0; top: 0;
    padding: .4rem .6rem;
    border-radius: .6rem;
    background: rgba(0,0,0,.85);
    color: #fff;
    font-size: 12px;
    line-height: 1.2;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity .15s ease;
    transform: translate(-50%, -120%); /* 通常は上に */
}

.ae-bubble-toast.is-bottom{
  transform: translate(-50%, 20%);   /* 下に出す */
}

.ae-bubble-toast.is-show{ opacity: 1; }
.ae-bubble-toast.is-hide{ opacity: 0; }

/* 計測中は表示しない（opacity 0のままでOK） */
.ae-bubble-toast.is-measuring{ opacity: 0; }

/* 検索（サジェスト） */
.kadakusu-panel{
    border: none;
    padding: 0;
    border-radius: 12px;
    box-shadow: 0 4px 12px 0 rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    background-color: #fff;
}
.kadakusu-panel section:last-child {
    margin-bottom: 0;
}
.kadakusu-panel .card-header {
    border: none;
    color: #fff;
    padding: 1.5rem 2rem;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    background-color: #fff;
}
.kadakusu-panel .card-header.suggest-header {
    background: linear-gradient(90deg, var(--kada-orange) 0%, #F7931E 100%);
    padding: 1rem 2rem;

}
.kadakusu-panel .card-header.suggest-header h2 {
    margin-bottom: 0;
}
.kadakusu-panel.important-notes{
    background-color: #FCE9BD;
}

.kadakusu-panel.important-notes .card-header {
    color: #E65100;
    background-color: transparent;
    padding-bottom: 0;
    padding-top: 2rem;
}

.kadakusu-suggest{
    display: flex;
    align-items: center;
    gap: 4rem;
}
.kadakusu-suggest, .kadakusu-result{
    padding: 2rem;
}
.kadakusu-suggest input{
    font-family: var(--font-ja-ud-sans);
    font-weight: bold;
    box-shadow: inset 1px 1px 3px rgba(0, 0, 0, 0.1);
    background-color: #F6F6F6;
}
.kadakusu-suggest input::placeholder {
    font-weight: bold;
    color: #c4c4c4;
}
.kadakusu-btn{
    position: absolute;
    right: 1rem;
    top: 0;
    bottom: 0;
    margin: auto;
    cursor: pointer;
    color: #ccc;
    display: flex;
    align-items: center;
    text-decoration: none;
}
/* マイクボタン：クリアボタンの左隣 */
.kadakusu-mic-btn {
    right: 2.8rem;
    color: #aaa;
    font-size: 1.1rem;
}
.kadakusu-mic-btn.is-recording {
    color: #e03;
    animation: mic-pulse .9s ease-in-out infinite;
}
@keyframes mic-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: .4; }
}
/* クリアボタンが非表示のときはマイクを右端に寄せる */
.kadakusu-mic-btn:not(.has-clear) {
    right: 1rem;
}
.kadakusu-suggest button{
    padding: 0;
    border: none;
    border-radius: 28px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    width: 2rem;
    height: 2rem;
    justify-content: center;
}
.kadakusu-added-wrap {
    border-top: 2px dotted var(--kada-orange);
    margin: 0 2rem 2rem 2rem;
    padding-top: 1.5rem;
}
.kadakusu-added-wrap h3 {
    margin-bottom: 1.5rem;
}
.kadakusu-hint{margin-top:8px;font-size:12px;opacity:.75;}

.kadakusu-suggest-list{
    width: 100%;
    list-style:none;
    background:rgb(0, 0, 0, .95);
    /* 画面高さの60%を基本に、下限と上限を付ける */
    max-height: clamp(220px, 60vh, 560px);
    overflow:auto;
    position: absolute;
    z-index: 9999;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .2);
    border-radius: 8px;
    padding: .5rem;
}
.kadakusu-suggest-list li{
    margin-bottom: .25rem;
    border-radius: .25rem;
}
.kadakusu-suggest-list li:last-child {
    margin-bottom: 0;
}

.kadakusu-suggest-list li a{
    display: flex;
    align-items: center;
    background: #fff;
    padding:.5rem 1rem;
    text-decoration:none;
    border-radius: .25rem;
    gap: 1rem;
}
.kadakusu-suggest-list li a:hover{
    background:rgba(255, 255, 255, 0.95);
}
.kadakusu-suggest-title{
    font-size: 1.2rem;
    line-height: 1.35;
    font-weight: bold;
}
.kadakusu-suggest-maker{
    font-size: .8rem;
    opacity:.85;
    margin-top:2px;
}


/* 追加済み薬（1行ボタン風） */
.kadakusu-added-list{
    display:flex;
    flex-direction:column;
    gap:10px;
    margin-top:10px;
}
.kadakusu-added-btn{
    display:flex;
    justify-content:space-between;
    align-items:center;
    width:100%;
    padding:12px 14px;
    border:3px solid var(--kada-orange);
    border-radius:8px;
    background: linear-gradient(90deg,#fff, #FFF3E0);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, .2);
    transition: opacity .18s ease, transform .18s ease, max-height .25s ease, margin .25s ease, padding .25s ease;
    will-change: opacity, transform, max-height;
}
/* 削除（leave） */
.kadakusu-added-btn.kadakusu-is-leave{
    overflow: hidden;
    max-height: 240px; /* 十分大きければOK */
    }
.kadakusu-added-btn.kadakusu-is-leave.kadakusu-is-leave-active{
    opacity: 0;
    transform: translateY(-6px);
    max-height: 0;
    margin-top: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
}

/* 副作用行（.kadakusu-row）も同じ感じで消す */
.kadakusu-row.kadakusu-is-leave{
    overflow: hidden;
    max-height: 240px;
    transition: opacity .18s ease, transform .18s ease, max-height .25s ease, margin .25s ease, padding .25s ease;
    will-change: opacity, transform, max-height;
}
.kadakusu-row.kadakusu-is-leave.kadakusu-is-leave-active{
    opacity: 0;
    transform: translateY(-6px);
    max-height: 0;
    margin-top: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
}
@media (prefers-reduced-motion: reduce){
    .kadakusu-added-btn, .kadakusu-row{ transition: none; }
}
.kadakusu-added-text{
    display:flex;
    flex-direction:column;
    min-width:0;
    align-items: start;
    background: transparent;
    border: none;

}
.kadakusu-added-therapeutic_classification {
    line-height: 1.3;
    font-size: 1rem;
    color: var(--kada-brown);
    margin-bottom: .5rem;
    text-align: left;
}
.kadakusu-added-generic_name {
    line-height: 1;
    font-size: .8rem;
    color: var(--kada-brown);
    margin-bottom: .5rem;
    text-align: left;
}
.kadakusu-added-title {
    transition: all;
    transition-duration: .25s;
}
.kadakusu-added-text:hover .kadakusu-added-title {
    color: var(--bs-link-color);
}
.kadakusu-added-title {
    font-weight:bold;
    color: var(--kada-brown);
    font-size:1.6rem;
    line-height:1.25;
    /*white-space:nowrap;*/
    overflow:hidden;
    text-overflow:ellipsis;
    margin-bottom: .25rem;
    text-align: left;
}
.kadakusu-added-maker{
    font-size:.8rem;
    color: var(--kada-brown);
    line-height:1.2;
    /*white-space:nowrap;*/
    overflow:hidden;
    text-overflow:ellipsis;
    text-align: start;
}
.kadakusu-added-remove{
    font-size: 1.8rem;
    margin-left:12px;
    text-decoration:none;
    line-height:1;
    color: var(--kada-brown);
    width: 3rem;
    height: 3rem;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    border: none;
    background: transparent;
    flex-shrink: 0;
}
.kadakusu-added-remove:hover{
    opacity:1;
    background:rgba(0,0,0,.05);
}
.kadakusu-added-remove .fa-solid {
    transform: translateY(2px);
}
.kugiri {
    margin-right: .5rem;
}
.icon-box {
    height: 5rem;
    width: 5rem;
    border-radius: 8px;
    font-size: 3rem;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(90deg, var(--kada-orange) 0%, #F7931E 100%);
    color: #fff;
    flex-shrink: 0;
}

/* ===== 初回ローディングプレースホルダー ===== */
#kd-initial-loading {
    padding: 2rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
}
.kd-initial-loading-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    color: #fff;
    font-size: 1.2rem;
    opacity: .75;
    width: 100%;
    height: 100%;
}
.kd-initial-spinner {
    width: 2rem;
    height: 2rem;
    border: 5px solid rgba(255, 255, 255, .9);
    border-top-color: var(--kada-orange, #e8963e);
    border-radius: 50%;
    flex-shrink: 0;
    animation: spin .75s linear infinite;
}

/* ===== 抽出中インジケータ（overlay） ===== */
.kadakusu-is-loading{
    position: relative;
    pointer-events: none; /* 連打防止 */
    opacity: .75;
}

.kadakusu-is-loading::after{
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    border-radius: 12px;
}

.kadakusu-is-loading::before{
    content: "";
    position: absolute;
    z-index: 2;
    top: 50%;
    left: 50%;
    width: 3rem;
    height: 3rem;
    margin: -1.5rem 0 0 -1.5rem;
    border-radius: 50%;
    border: 6px solid rgba(255, 255, 255, 0.25);
    border-top-color: rgba(255, 255, 255, 0.7);
    animation: kadakusu-spin .7s linear infinite;
}

@keyframes kadakusu-spin{
    to{ transform: rotate(360deg); }
}

/* ローディング中は「全クリア」ボタンを隠す */
.kadakusu-is-loading .kadakusu-btn,
.kadakusu-suggest-loading .kadakusu-btn{
    display: none !important;
}

/* サジェスト取得中：入力欄に小スピナー */
.kadakusu-input-wrap{ position: relative; } /* inputの親に付ける想定 */
.kadakusu-input-wrap.kadakusu-suggest-loading::after{
    content:"";
    position:absolute;
    left:-3rem;
    top:50%;
    width:1.5rem;
    height:1.5rem;
    margin-top:-0.75rem;
    border-radius:50%;
    border:2px solid rgba(0,0,0,.25);
    border-top-color: rgba(0,0,0,.7);
    animation: kadakusu-spin .7s linear infinite;
    pointer-events:none;
}

/* ===== 追加（enter）アニメ：追加済み薬 ===== */
.kadakusu-added-btn.kadakusu-is-enter{
    opacity: 0;
    transform: translateY(-6px);
    max-height: 0;
    overflow: hidden;
    margin-top: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
}
.kadakusu-added-btn.kadakusu-is-enter.kadakusu-is-enter-active{
    opacity: 1;
    transform: translateY(0);
    max-height: 240px; /* 十分大きく */
}

/* ===== 追加（enter）アニメ：副作用行（任意） ===== */
.kadakusu-row.kadakusu-is-enter{
    opacity: 0;
    transform: translateY(-6px);
    max-height: 0;
    overflow: hidden;
}
.kadakusu-row.kadakusu-is-enter.kadakusu-is-enter-active{
    opacity: 1;
    transform: translateY(0);
    max-height: 240px;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.8s ease-out;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.float-animation {
    animation: float 3s ease-in-out infinite;
}

/* Loading State */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner {
    border: 3px solid rgba(255,127,62,0.3);
    border-top: 3px solid var(--primary-orange);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.entry-content h1 {
    margin-bottom: 2rem;
    font-size: 2.8rem;
}
.entry-content h2 {
    margin-bottom: 1rem;
    padding-top: 3rem;
}

.drug-guide-article {
    background: rgb(255 255 255 / 97%);
    padding: 3rem 2rem;
    border-radius: 12px;
}
.drug-guide-article header {
    margin-bottom: 4rem;
}
.drug-guide-article h1 {
    color: var(--kada-brown);
}
.drug-guide-article .manufacturer {
    padding-top: 1rem;
}
.generic-info-wrap {
    display: flex;
    gap: 4px;
    font-size: 1.2rem;
    font-weight: bold;
    flex-direction: column;
    line-height: 1.3;
}
.generic-info-wrap p {
    margin-bottom: 0;
}
p.therapeutic_classification,
p.generic_name {
    display: flex;
    opacity: 1;
}
p.generic_name {
    margin-bottom: .5rem;
}
p.therapeutic_classification .detail,
p.generic_name .detail {
    opacity: 1;
}
.generic-info-wrap p span {
    opacity: .5;
    margin-right: .75rem;
}
.brand_names_kana,
.brand_names_en {
    font-style: italic;
    opacity: .5;
    font-size: .8rem;
    margin-bottom: .5rem;
    line-height: 1;
}
.pmda-section h3 {
    font-size: 1.5rem;
    margin-bottom: 2rem;
}
.pmda-subsection h4 {
    padding-top: .75rem;
    font-size: 1.4rem;
    margin-bottom: 1rem;
}
.pmda-item-subject {
    font-weight: bold;
    margin-bottom: .25rem;
    line-height: 1.2;
}
.pmda-item-header {
    font-weight: bold;
    margin-bottom: .5rem;
}
.pmda-item-detail {
    margin-bottom: 2rem;
}
ul.pmda-simplelist li:last-child .pmda-item-detail {
    margin-bottom: 0;
}
.pmda-table {
    --bs-table-color-type: initial;
    --bs-table-bg-type: initial;
    --bs-table-color-state: initial;
    --bs-table-bg-state: initial;
    --bs-table-color: var(--bs-emphasis-color);
    --bs-table-bg: var(--bs-body-bg);
    --bs-table-border-color: var(--bs-border-color);
    --bs-table-accent-bg: transparent;
    --bs-table-striped-color: var(--bs-emphasis-color);
    --bs-table-striped-bg: rgba(var(--bs-emphasis-color-rgb), 0.05);
    --bs-table-active-color: var(--bs-emphasis-color);
    --bs-table-active-bg: rgba(var(--bs-emphasis-color-rgb), 0.1);
    --bs-table-hover-color: var(--bs-emphasis-color);
    --bs-table-hover-bg: rgba(var(--bs-emphasis-color-rgb), 0.075);
    width: 100%;
    margin-bottom: 2rem;
    vertical-align: top;
    border-color: var(--bs-table-border-color);
}
.pmda-table>thead {
    vertical-align: bottom;
}
.pmda-table>thead>tr>th{
    line-height: 1.3;
    white-space: nowrap;
}
.pmda-table>tbody>tr>th{
    line-height: 2;
    white-space: nowrap;
}
.pmda-table>:not(caption)>*>* {
    padding: .5rem .5rem;
    color: var(--bs-table-color-state, var(--bs-table-color-type, var(--bs-table-color)));
    background-color: var(--bs-table-bg);
    border-bottom-width: var(--bs-border-width);
    box-shadow: inset 0 0 0 9999px var(--bs-table-bg-state, var(--bs-table-bg-type, var(--bs-table-accent-bg)));
}
.pmda-table>tbody {
    vertical-align: inherit;
}
.pmda-literature,
.pmda-ol,
.pmda-list {
    list-style: none;
}
.pmda-commentref {
    margin-left: 1rem;
    font-size: .8rem;
}
.pmda-brand-title {
    font-weight: bold;
    margin-bottom: .25rem;
    padding-top: .75rem;
    font-size: 1.2rem;
}
.nav-tabs-kadakusu > .nav-item > button {
    font-weight: bold;
    padding: 1rem 2rem;
}
.drag-guide-comb-table thead tr {
    border-bottom: 2px solid #e7e7e7;
}
.drag-guide-comb-table tbody tr {
    border-bottom: 1px dotted #e7e7e7;
}
.drag-guide-comb-table thead tr th,
.drag-guide-comb-table tbody tr td {
    border: none;
}
.card.drag-guide-comb-card {
    border: none;
}
.card.drag-guide-comb-card > .card-header {
    background-color: #ef7023;
    padding: .75rem 1rem;
    border-radius: 10px;
}
.card.drag-guide-basic-info-card > .card-header {
    background-color: #e7e7e7;
    color: #000;
    padding: .75rem 1rem;
    border-radius: 10px;
}
.card.drag-guide-basic-info-card {
    border: none;
}
.card.drag-guide-basic-info-card .kadakusu-row:first-of-type {
    border-top: none;
}
.card.drag-guide-basic-info-card .kadakusu-row:first-of-type .kadakusu-row-value {
    font-weight: normal;
    font-size: 1rem;
}
.card.drag-guide-basic-info-card .kadakusu-row-wrap {
    margin-bottom: 0;
}
.nav-tabs-kadakusu {
    border-bottom-width: 2px;
}
.nav-tabs-kadakusu .nav-link {
    margin-bottom: -2px;
    border-width: 2px;
}
#important-info-section,
#danger-side-effects-section,
#kadakusu-other-section {
    margin-bottom: 4rem;
}
.popover {
    max-width: 420px;
    border: none;
    box-shadow: 0 10px 30px rgba(0,0,0,.18);
    background: #fff;
    border: 1px solid rgba(0, 0, 0, .10);
    border-radius: 8px;
    transition: opacity .14s ease, transform .14s ease;
    will-change: opacity, transform;
}
#head-danger-row.kadakusu-header,
#head-etc-row.kadakusu-header {
    display: flex;
    gap: 12px;
    font-size: .8rem;
    align-items: center;
    padding: .25rem 1rem;
}
#head-danger-row .header1,
#head-etc-row .header11 {
    width: 220px;
    min-width: 160px;
}
#head-danger-row .header2 {
    width: 120px;
}
#head-etc-row .header12 {
    min-width: 220px;
}
#head-etc-row .header13 {
    width: 120px
}

.list-group-item {
    border-color: #f9f9f9;
    margin-bottom: .05rem;
    display: block;
}
.list-group-item-action {
    color: var(--bs-link-color);
    background-color: rgba(var(--bs-link-color-rgb), 0.05);
}
.list-group-item.active {
    color: var(--bs-list-group-active-color);
    background-color: var(--bs-link-color);
    border-color: var(--bs-link-color);
}
.list-group-item-action:not(.active):focus,
.list-group-item-action:not(.active):hover {
    color: var(--bs-link-color);
    background-color: rgba(var(--bs-link-color-rgb), 0.15);
}
.blog-card p {
    margin-bottom: 0;
}
.blog-navigation {
    display: flex;
    justify-content: center;
    margin-top: 4rem;
}
.blog-navigation .nav-links {
    display: flex;
    gap: 6px;
}
.blog-navigation .page-numbers {
    display: flex;
    padding: .5rem;
    border: 1px solid;
    border-radius: .25rem;
    min-width: 2.4rem;
    align-items: center;
    justify-content: center;
    background-color: var(--bs-link-color);
    color: #fff;
}
.blog-navigation .page-numbers.current{
    background-color: transparent;
    color: #a7a7a7;
}
.category-uncategorized h3.wp-block-heading {
    padding-top: 1rem;
    margin-bottom: .75rem;
}
.comment-reply-title {
    font-size: 1.4rem;
    margin-bottom: 1rem;
}
.next-post-link {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
}
.next-post-link i{
    font-size: 2rem;
    margin-left: 1rem;
}
.prev-post-link {
    display: flex;
    align-items: center;
}
.prev-post-link i{
    font-size: 2rem;
    margin-right: 1rem;
}
.post-card {
    background: #fff;
    border-radius: 1.5rem;
}
.post-card .entry-header {
    margin-bottom: 2rem;
    padding-top: 2rem;
}
.kadakusu-breadcrumb__list {
    list-style: none;
    padding: 0;
    display: flex;
    gap: .5rem;
}
.kadakusu-breadcrumb__item::after {
    content: "\f105";/* 例: fa-chevron-right */
    font-family: "Font Awesome 7 Free";
    font-weight: 900;
    margin-left: .5rem;
    color: #c4c4c4;
}
.kadakusu-breadcrumb__item:last-child::after {
    content: "";
}
.kadakusu-breadcrumb__item.is-current {
    font-weight: bold;
}
.kadakusu-breadcrumb__item a {
    background: var(--bs-link-color);
    border-radius: 1.5em;
    padding: .25rem 1rem;
    color: #fff;
}
.kd-hero{
    /* 背景画像 */
    background-image: var(--kd-hero-bg);
    background-size: cover;       /* 画面にフィット（はみ出しはトリミング） */
    background-position: center;  /* ど真ん中を基準に */
    background-repeat: no-repeat;

    /* 画像サイズに左右されない箱 */
    aspect-ratio: 16 / 9;         /* ここで比率を固定 */
    width: 100%;
    border-radius: 12px;

    /* たまに高すぎ/低すぎを防ぐ保険 */
    max-height: 520px;
    min-height: 220px;

    /* 影とか必要なら */
    box-shadow: inset 0 6px 18px rgba(0,0,0,.5);

    margin-bottom: 2rem;
}
.navigate-buttons {
    height: 90px;
    overflow: hidden;
}
.navigate-buttons .small {
    font-size: .8rem;
    line-height: 1;
}
.navigate-buttons .link-text {
    line-height: 1.2;
}
.single-drug_guide .table p {
    margin-bottom: 0;
}
.single-drug_guide .table {
    line-height: 1.3;
}
.single-drug_guide .table th {
    white-space: nowrap;
}
.single-drug_guide .table tr.tableFooter th {
    white-space: normal;
}
.single-drug_guide .tab-content ol,
.single-drug_guide .tab-content ul {
    list-style: none;
    padding-left: .5rem;
}
.single-drug_guide .table-responsive {
    margin-bottom: 2rem;
}
.single-drug_guide .tab-content .table {
    margin-top: 2rem;
    caption-side: top;
    min-width: 600px;
}
.single-drug_guide .tab-content .table caption {
    color: #000;
    font-weight: bold;
    margin-bottom: .5rem;
    padding-bottom: 0;
}
.single-drug_guide .tab-content .table tr td {
    font-size: .9rem;
}
.single-drug_guide .tab-content .table tr td ul {
    white-space: nowrap;
}
.single-drug_guide .tab-content ol li,
.single-drug_guide .tab-content ul li {
    margin-top: 2rem;
}
.single-drug_guide .section_header,
.single-drug_guide .Header-preview {
    font-weight: bold;
    margin-bottom: 2rem;
}
.single-drug_guide h4 {
    padding-top: .75rem;
    margin-bottom: .75rem;
    font-size: 1.3rem;
}
.single-drug_guide h5.section_header.brand-name {
    padding-top: .5rem;
    margin-bottom: .5rem;
}
.single-drug_guide .brand-name,
.single-drug_guide .ApprovalBrandNameRef {
    color: var(--kada-brown);
}
.level-2 .section_header,
.level-2 .Header-preview {
    font-size: 1.2rem;
}
.subitem {
    display: flex;
    gap: .5rem;
    padding-top: 1rem;
    flex-wrap: wrap;
}
.subitem span {
    background: #ddd;
    border-radius: .15rem;
    padding: .25rem .5rem;
    font-size: .8rem;
    line-height: 1;
}
.subitem span::before {
    content: "\f05e";
    font-family: "Font Awesome 7 Free";
    font-weight: 900;
    margin-right: .25rem;
}
span.Warnings,
span.ContraIndications {
    background: var(--accent-red);
    color: #fff;
}
span.Interactions {
    background: var(--primary-orange);
    color: #000;
}
span.UseInPatientsWithComplicationsOrHistoryOfDiseasesEtc,
span.PatientsWithHepaticImpairment,
span.PatientsWithRenalImpairment,
span.MalesAndFemalesOfReproductivePotential {
    background: var(--accent-yellow);
    color: #000;
}
span.UseInPregnant,
span.UseInNursing {
    background: var(--accent-pink);
    color: #000;
}
span.PediatricUse {
    background: var(--accent-sky);
    color: #000;
}
span.UseInTheElderly {
    background: var(--accent-purple);
    color: #000;
}
#HDR_Warnings,
#HDR_ContraIndications {
    color: var(--kada-red);
}
.revisionPrev-editor, .revisionThis-editor, .revisionPrevThis-editor {
    display: none;
}
.list-group-item-action.HDR_Warning.active,
.list-group-item-action.HDR_ContraIndications.active {
    color: #fff;
    background: var(--kada-red);
    border-color: var(--kada-red);
}
.list-group-item-action.HDR_Warning,
.list-group-item-action.HDR_ContraIndications {
    color: var(--kada-red);
    background-color: rgba(var(--kada-red-rgb), 0.05);
}
.list-group-item-action.HDR_Warning:not(.active):focus,
.list-group-item-action.HDR_Warning:not(.active):hover,
.list-group-item-action.HDR_ContraIndications:not(.active):focus,
.list-group-item-action.HDR_ContraIndications:not(.active):hover {
    color: var(--kada-red);
    background-color: rgba(var(--kada-red-rgb), 0.15);
}

.list-group-item-action.HDR_UseInSpecificPopulations.active,
.list-group-item-action.HDR_Interactions.active {
    color: #fff;
    background: var(--kada-orange);
    border-color: var(--kada-orange);
}
.list-group-item-action.HDR_UseInSpecificPopulations,
.list-group-item-action.HDR_Interactions {
    color: #c96109;
    background-color: rgba(var(--kada-orange-rgb), 0.05);
}
.list-group-item-action.HDR_UseInSpecificPopulations:not(.active):focus,
.list-group-item-action.HDR_UseInSpecificPopulations:not(.active):hover,
.list-group-item-action.HDR_Interactions:not(.active):focus,
.list-group-item-action.HDR_Interactions:not(.active):hover {
    color: #c96109;
    background-color: rgba(var(--kada-orange-rgb), 0.25);
}
.single-drug_guide figure {
    padding-top: 1rem;
    margin-bottom: 2rem;
}
.single-drug_guide figure img {
    margin-bottom: 1rem;
    max-width: 100%;
    height: auto;
}
.single-drug_guide figcaption {
    line-height: 1.3;
    padding-top: .5rem;
    font-size: .9rem;
}
.single-drug_guide .Comment {
    background: #f7f7f7;
    padding: .5rem;
    border-radius: .25rem;
    padding-left: 3rem;
}
.single-drug_guide .Comment a {
    font-weight: bold;
    margin-left: -2rem;
}
.card.blog-card {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.blog-card h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}
a img:hover {
    opacity: 0.8;
    transition: opacity 0.3s ease;
}
/* 閉じている状態 */
.kadakusu-acc-body {
    display: grid;
    grid-template-rows: 0fr;        /* 高さ 0 */
    transition: grid-template-rows .3s ease;
}
/* 開いている状態 */
.kadakusu-acc-body.is-open {
    grid-template-rows: 1fr;        /* 自然な高さ */
}
.kadakusu-acc-body-inner {
    overflow: hidden;               /* はみ出し防止 */
    overflow-wrap: anywhere;
}
/* タブレット（768～1024px）: iPad / Androidタブレットをまとめて扱う */
@media (min-width: 768px) and (max-width: 1024px) {
  /* tablet */
    .kadakusu-bg {
        background-position: right center;
        background-image: url(/wp-content/themes/kadahutu-theme/assets/images/main_bg_md.jpg);
    }
    .kadakusu-drug_bg {
        background-position: right center;
        background-image: url(/wp-content/themes/kadahutu-theme/assets/images/drug_guide_bg_md.jpg);
    }
    .hero-area {
        height: 580px;
    }
    .hero-content {
        top: 140px;
        left: 80px;
    }
    .hero-content h1 {
        font-size: 60px;
    }
    .hero-content .main-catch {
        font-size: 2.4rem;
    }
    .hero-content .sub-catch2 {
        font-size: 1.4rem;
    }
    .kadakusu-row {
        flex-wrap: wrap;
        align-items: start;
        gap: 6px;
        padding: 1rem 0;
    }
    .card.drag-guide-comb-card > .card-header {
        padding: .75rem 1rem;
    }
    .drag-guide-comb-card .kadakusu-row.drug-guide-comb-row {
        flex-wrap: nowrap;
    }
    .drag-guide-comb-card .kadakusu-row.drug-guide-comb-row:first-of-type {
        align-items: center;
    }
    .kadakusu-row.is-dup > .kadakusu-drug {
        display: none;
    }
    .kadakusu-drug {
        width: 100%;
        min-width: auto;
        max-width: none;
        margin-bottom: 1.5rem;
        font-size: 1.2rem;
        opacity: 1;
    }
    .kadakusu-name {
        line-height: 2;
    }
    .drug-guide-article {
        padding: 2.5rem 1.5rem;
        border-radius: 1.5rem;
    }
    .kadakusu-breadcrumb__list {
        flex-direction: column;
        gap: .5rem;
    }
    #head-danger-row .header1, #head-etc-row .header11 {
        display: none;
    }
    #head-danger-row.kadakusu-header, #head-etc-row.kadakusu-header {
        gap: 6px;
        padding: .25rem 0;
    }
    .single-drug_guide .tab-content .table tr td ul {
        white-space: normal;
    }
}

/* Responsive Design */
@media (max-width: 767px) {
    #primaryNav ul#menu-primary {
        margin-top: 1rem;
    }
    #primaryNav ul#menu-primary li {
        text-align: center;
    }
    .kadakusu-bg {
        background-position: right top;
        background-image: url(/wp-content/themes/kadahutu-theme/assets/images/main_bg_sp.jpg);
    }
    .kadakusu-drug_bg {
        background-position: right center;
        background-image: url(/wp-content/themes/kadahutu-theme/assets/images/drug_guide_bg_sp.jpg);
    }
    .hero-area {
        height: 480px;
    }
    .hero-content {
        top: 60px;
        left: 15px;
        right: 15px;
    }
    .hero-content h1 {
        font-size: 38px;
        margin-bottom: 1rem;
    }
    .hero-content .sub-catch1 {
        font-size: 1rem;
        margin-bottom: .5rem;
    }
    .hero-content .main-catch {
        font-size: 1.4rem;
        margin-bottom: .5rem;
    }
    .hero-content .sub-catch2 {
        font-size: 1rem;
        width: 200px;
        line-height: 1.2;
    }
    .hero-content .attention {
        font-size: .9rem;
    }
    .kadakusu-panel .card-header.suggest-header {
        padding: .5rem .75rem;
    }
    .kadakusu-panel .card-header.suggest-header h2 {
        margin-bottom: 0;
    }
    .kadakusu-added-wrap {
        margin: 0 1rem 1rem 1rem;
    }
    .kadakusu-suggest, .kadakusu-result {
        padding: 1rem;
    }
    .kadakusu-col {
        margin-bottom: 1.5rem;
    }
    .kadakusu-row {
        flex-wrap: wrap;
        align-items: start;
        gap: 2px;
        padding: 1rem 0;
    }
    #danger-side-effects-sec .kadakusu-row {
        padding: .25rem 0;
    }
    .kadakusu-drug {
        width: 100%;
        min-width: auto;
        max-width: 40ch;
        font-size: 1.2rem;
        opacity: 1;
        margin-bottom: 1rem;
        padding: .25rem .5rem;
        background: var(--bs-link-color-light);
        border-radius: .25rem;
    }
    .kadakusu-drug::before {
        content: "\f2d2";
        font-family: "Font Awesome 7 Free";
        font-weight: 900;
        margin-right: .25rem;
    }
    #head-danger-row.kadakusu-header,
    #head-etc-row.kadakusu-header{
        display: none;
    }
    .kadakusu-sys-freq-wrap {
        background: #e7e7e7;
        border-radius: .25rem;
        display: flex;
        justify-content: space-between;
        width: 100%;
        margin-bottom: 1rem;
    }
    .kadakusu-system {
        min-width: auto;
        margin-right: 0;
        border-top-right-radius: 0;
        border-bottom-right-radius: 0;
    }
    #danger-side-effects-sec .kadakusu-freq{
        text-align: left;
    }
    #danger-side-effects-sec .kadakusu-freq::before{
        content: "頻度：";
    }
    .kadakusu-freq {
        width: 50%;
        flex: auto;
        text-align: right;
        padding-right: .5rem;
        line-height: 1.2;
        padding-top: .2rem;
        padding-bottom: .2rem;
    }
    .kadakusu-freq::before {
        content: "頻度：";
    }
    .kadakusu-name {
        flex: none;
        width: 100%;
        line-height: 2;
    }
    .kadakusu-row.is-dup > .kadakusu-drug {
        display: none;
    }
    .icon-box {
        height: 3.4rem;
        width: 3.4rem;
        border-radius: 6px;
        font-size: 2.2rem;
    }
    .kadakusu-suggest {
        gap: 2.4rem;
    }
    .kadakusu-suggest input {
        font-size: 1rem;
    }
    .kadakusu-added-title {
        font-size: 1.3rem;
    }
    .kadakusu-panel .card-header {
        padding: 1rem;
    }
    .kadakusu-input-wrap.kadakusu-suggest-loading::after{
        left:-1.8rem;
        width:1.2rem;
        height:1.2rem;
    }
    .card.drag-guide-comb-card .kadakusu-row-wrap .kadakusu-row,
    .card.drag-guide-basic-info-card .kadakusu-row-wrap .kadakusu-row {
        flex-direction: column;
    }
    .footer-links {
        gap: .25rem;
        flex-direction: column;
        align-items: center;
    }
    .drug-guide-article {
        padding: 2rem 1rem;
        border-radius: 1rem;
    }
    .generic-info-wrap {
        font-size: .8rem;
        flex-direction: column;
        gap: 0;
    }
    .custom-logo-link img {
        width: 200px;
        height: auto;
    }
    .tab-content {
        padding: 1rem .5rem;
        background: #f9f9f9;
        border-radius: .75rem;
        border-bottom: none;
    }
    .site-header {
        border-bottom-right-radius: 1rem;
        border-bottom-left-radius: 1rem;
        margin-bottom: 1rem;
    }
    .site-footer {
        border-top-right-radius: 1rem;
        border-top-left-radius: 1rem;
    }
    #danger-side-effects-section .kadakusu-freq {
        padding-right: 0;
        text-align: left;
        width: 100%;
    }
    .generic-info-wrap p span {
        display: inline-block;
        min-width: 6ch;
    }
    #kadakusu-other-section .kadakusu-row {
        border-bottom: none;
    }
    .pmda-section h3 {
        font-size: 1.3rem;
    }
    .sub-message {
        font-size: .8rem;
        margin-bottom: 3rem;
    }
    .entry-content h1 {
        margin-bottom: 1rem;
        font-size: 2rem;
    }
}

/* ========== Kadakusu Tabs: SPだけ2列pills化 ========== */
@media (max-width: 576px) {
    /* ul をグリッド化 */
    .nav-tabs.nav-tabs-kadakusu {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .5rem;
        border-bottom: 0;          /* tabsの下線を消す */
        padding: .25rem 0 .5rem;
        margin-bottom: .75rem;
    }

    /* li は nav-item のままOK。余計な余白を殺す */
    .nav-tabs.nav-tabs-kadakusu .nav-item {
        margin: 0;
    }

    /* buttonを幅100%に */
    .nav-tabs.nav-tabs-kadakusu .nav-link {
        width: 100%;
        border: 0;                 /* tabsの枠線を消す */
        border-radius: 999px;      /* pill */
        background: rgba(0,0,0,.06);
        padding: .7rem .8rem;      /* 押しやすく */
        min-height: 44px;          /* タップ領域 */
        line-height: 1.2;
        text-align: center;
        font-weight: 600;

        /* 長いラベル対策（「効能・効果」等は大丈夫だけど保険） */
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* active をカードっぽく強調 */
    .nav-tabs.nav-tabs-kadakusu .nav-link.active {
        background: #fff;
        box-shadow: 0 2px 10px rgba(0,0,0,.12);
    }

    /* hover/focus の見え方（スマホでもフォーカスが入ることがある） */
    .nav-tabs.nav-tabs-kadakusu .nav-link:focus-visible {
        outline: 2px solid rgba(0,0,0,.35);
        outline-offset: 2px;
    }
}

/* 576px以上は従来の tabs を維持（必要ならここで微調整） */
/* .nav-tabs-kadakusu .nav-link { ... } */

/* =====================================================================
   Amazon アフィリエイト セクション
   ===================================================================== */
.kadakusu-amazon-section {
    background: transparent;
    padding: 2.5rem 0 2rem;
    margin-bottom: 2rem;
}

.kadakusu-amazon-section__title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #333;
    margin-bottom: .4rem;
}

.kadakusu-amazon-section__title .fa-amazon {
    color: #ff9900;
}

.kadakusu-amazon-section__note {
    color: #666;
    font-size: .9rem;
    margin-bottom: 1.25rem;
}

/* グリッド */
.kadakusu-amazon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

/* カード */
.kadakusu-amazon-card {
    background: #fff;
    border: none;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow .2s, transform .2s;
}

.kadakusu-amazon-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,.12);
    transform: translateY(-2px);
}

.kadakusu-amazon-card__link {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.kadakusu-amazon-card__img-wrap {
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: .75rem;
    min-height: 160px;
}

.kadakusu-amazon-card__img {
    max-width: 100%;
    max-height: 150px;
    object-fit: contain;
}

.kadakusu-amazon-card__body {
    padding: .75rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.kadakusu-amazon-card__title {
    font-size: .9rem;
    font-weight: 600;
    color: var(--bs-link-color);
    margin-bottom: .4rem;
    line-height: 1.4;
}

.kadakusu-amazon-card__excerpt {
    font-size: .8rem;
    color: #555;
    line-height: 1.5;
    flex: 1;
    margin-bottom: .6rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.kadakusu-amazon-card__btn {
    display: inline-block;
    background: #ff9900;
    color: #fff;
    font-size: .8rem;
    font-weight: 700;
    padding: .3rem .75rem;
    border-radius: 4px;
    align-self: flex-start;
    margin-top: auto;
}
a.kadakusu-amazon-card__link:hover {
    text-decoration: none;
}
a.kadakusu-amazon-card__link:hover .kadakusu-amazon-card__title {
    color: var(--bs-link-hover-color);
}
.kadakusu-amazon-card__link:hover .kadakusu-amazon-card__btn {
    background: #e68a00;
}

.kadakusu-amazon-section__disclaimer {
    font-size: .75rem;
    color: #888;
    margin-top: .5rem;
    margin-bottom: 0;
}

@media (max-width: 575.98px) {
    .kadakusu-amazon-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}



