:root {
    --aior-primary: #4a90e2;
    --aior-secondary: #f5a623;
    --aior-bg: #f8f9fa;
    --aior-card-bg: #ffffff;
    --aior-text: #333;
    --aior-text-light: #777;
    --aior-border: #e9ecef;
    --aior-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    --aior-radius: 12px;
}

/* --- ★ 追加：b タグのスタイルを定義 --- */
b {
    font-weight: 700; /* strongタグのデフォルトスタイルを継承 */
}

.required {
    color: #CD403E;
}

.aior-field-error label:not(.comment-label) {
    color: #CD403E;
}

.aior-error-message {
    color: #CD403E;
    font-size: 0.9em;
    margin-top: 5px;
}

.aior-wrapper {
    width: 100%;
}

.aior-main-header {
    text-align: left;
    margin-bottom: 40px;
}

.aior-main-header h1 {
    font-size: 24px;
    color: var(--aior-text);
}

.aior-main-header p {
    font-size: 1em;
    color: var(--aior-text-light);
}

.aior-summary-container {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 30px;
    margin-bottom: 40px;
    padding: 30px;
    background: var(--aior-card-bg);
    border-radius: var(--aior-radius);
    box-shadow: var(--aior-shadow);
}

.aior-overall-rating-box {
    text-align: center;
    border-right: 1px solid var(--aior-border);
    padding-right: 30px;
}

/* --- ★ 変更：h3 セレクタを追加 --- */
.aior-overall-rating-box .aior-section-title,
.aior-overall-rating-box h3.aior-section-title {
    margin: 0;
    font-size: 1em;
    font-weight: 700;
}


.aior-overall-rating-box .score {
    font-size: 5em;
    font-weight: 700;
    line-height: 1;
    color: var(--aior-primary);
    background: -webkit-linear-gradient(45deg, var(--aior-primary), var(--aior-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.aior-overall-rating-box .stars-static {
    font-size: 22px;
    color: var(--aior-secondary);
}

.aior-chart-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
}

.aior-chart-controls .button {
    background: transparent;
    border: 1px solid var(--aior-border);
    color: var(--aior-text-light);
    border-radius: 20px;
    padding: 8px 15px;
    cursor: pointer;
    transition: all 0.2s;
}

.aior-chart-controls .button.active,
.aior-chart-controls .button:hover {
    background: var(--aior-primary);
    color: #fff;
    border-color: var(--aior-primary);
}

.aior-filter-section {
    background-color: #fce7e6;
    padding: 20px;
    margin: 40px 0;
    border-radius: var(--aior-radius);
    text-align: center;
}

/* --- ★ 変更：h3 -> .aior-section-title --- */
.aior-filter-section .aior-section-title {
    margin-top: 0;
    /* --- ★ 追加：h3のスタイルを継承 --- */
    font-size: 1.5em; /* h3のデフォルトサイズに近い */
    font-weight: 700;
    margin-bottom: 20px;
}

/* --- ★ 変更：スクロール案内削除に伴い不要に --- */
/* .aior-filter-section .description {
    font-size: 0.9em;
    color: var(--aior-text-light);
    margin-bottom: 20px;
} */

/* --- ★ 変更：リセットボタン用コンテナを .aior-list-controls に移動 --- */
/* .aior-filter-actions {
    text-align: right;
    margin-bottom: 15px;
} */
/* --- ★ 変更：リセットボタンを .aior-list-controls に移動 --- */
/* .aior-reset-filter-button {
    font-size: 0.8em !important;
    padding: 4px 10px !important;
    height: auto !important;
    line-height: normal !important;
    background: #fff !important;
    color: #555 !important;
    border: 1px solid #ccc !important;
    border-radius: 3px !important;
    text-decoration: none;
}
.aior-reset-filter-button:hover {
    background: #f0f0f0 !important;
    border-color: #999 !important;
} */


.aior-filter-group {
    margin-bottom: 20px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
}

/* --- ★ 変更：h4 -> .aior-sub-title --- */
.aior-filter-group .aior-sub-title {
    text-align: left;
    margin-bottom: 10px;
    padding-left: 10px;
    font-size: 1em; /* ★ 変更：フォントサイズ */
    /* --- ★ 追加：h4のスタイルを継承 --- */
    font-weight: 700;
}

.aior-filter-controls {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    overflow-x: auto;
    padding: 5px 10px 15px 10px;
    -webkit-overflow-scrolling: touch;
}

.aior-filter-controls::-webkit-scrollbar {
    height: 8px;
}

.aior-filter-controls::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

.aior-filter-controls::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.aior-filter-controls .button {
    background: #fff;
    border: 1px solid var(--aior-border);
    color: #555;
    border-radius: 20px;
    padding: 8px 15px;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}

.aior-filter-controls .button.active {
    background: var(--aior-primary);
    color: #fff;
    border-color: var(--aior-primary);
}

.aior-star-filter-container {
    margin: 40px 0;
}

/* --- ★ 変更：h4 -> .aior-sub-title --- */
.aior-star-filter-container .aior-sub-title {
    text-align: center;
    margin-bottom: 15px;
    /* --- ★ 追加：h4のスタイルを継承 --- */
    font-size: 1em;
    font-weight: 700;
}


.aior-star-filter-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 15px;
    align-items: center;
    margin-bottom: 8px;
    text-decoration: none;
    color: var(--aior-primary);
    border-radius: 4px;
    padding: 4px 8px;
    transition: background-color 0.2s;
}

.aior-star-filter-row:hover {
    background-color: #f8f9fa;
    text-decoration: underline;
}

.aior-star-filter-row[aria-disabled="true"] {
    color: var(--aior-text-light);
    pointer-events: none;
    cursor: default;
    background-color: transparent;
    text-decoration: none;
}

.aior-star-filter-row .star-label {
    white-space: nowrap;
    font-size: 0.9em;
}

.aior-star-filter-row .bar-bg {
    background-color: #f0f0f0;
    border-radius: 4px;
    height: 18px;
    position: relative;
    overflow: hidden;
    border: 1px solid #ddd;
}

.aior-star-filter-row .bar-fill {
    background-color: var(--aior-secondary);
    height: 100%;
}

.aior-star-filter-row .star-count {
    white-space: nowrap;
    color: var(--aior-text-light);
    font-size: 0.9em;
}

/* --- ★ 変更：セレクタの具体性を高め、テーマCSSによる padding-left を上書き --- */
.entry-content .aior-review-list,
.aior-shortcode-wrapper .aior-review-list {
    list-style: none;
    margin: 0;
    padding: 0; /* SPでのズレ（緑の余白）解消のため 0 を明示 */
    display: flex;
    flex-direction: column; /* 縦積みを指定 */
    /* align-items: center; */ /* <-- ★ 変更：この行を削除 */
    gap: 25px;
}

.aior-review-item {
    background: var(--aior-card-bg);
    padding: 25px;
    border-radius: var(--aior-radius);
    box-shadow: var(--aior-shadow);
    transition: transform 0.2s;
    /* --- ★ 変更：width と box-sizing のみ残し、max-width を削除 --- */
    width: 100%;             /* 親に対して100% */
    box-sizing: border-box;  /* paddingを含めて計算 */
    /* max-width: none; */ /* <-- ★ 変更：max-width を削除（前回） */
}

/* ★ 変更：絞り込み時にもホバー効果 */
.aior-review-item:not(.aior-review-summary-card) {
    /* cursor: pointer; */ /* Removed cursor pointer as link is added below */
}
.aior-review-item:not(.aior-review-summary-card):hover {
    transform: translateY(-5px); /* Add hover effect */
}

/* --- ★ 変更：絞り込み表示時の不要なスタイルを削除 --- */
/* .aior-review-item:not(.aior-review-summary-card) .rating-item {
    display: flex;
    align-items: center;
    gap: 10px;
} */
/* .aior-review-item:not(.aior-review-summary-card) .score-number {
    font-size: 1.2em;
    font-weight: bold;
    color: var(--aior-text);
} */

.aior-review-header {
    padding-bottom: 15px;
    /* --- ★ 変更：ボーダーを削除 --- */
    /* border-bottom: 1px solid var(--aior-border); */
}

/* --- ★ 変更：h3 セレクタを追加 --- */
.aior-reviewer-meta .reviewer-name,
.aior-reviewer-meta h3.reviewer-name,
.aior-reviewer-meta h4.reviewer-name { /* ★ 変更：h4 セレクタを追加 */
    font-weight: bold;
    display: block;
    margin: 0; /* h3/h4のデフォルトマージンをリセット */
    font-size: 1em; /* h3/h4のデフォルトサイズをリセット */
}

/* --- ★ 変更(1/2)： 口コミタイトル用のスタイルを追加 --- */
.aior-reviewer-meta .review-title,
.aior-reviewer-meta h3.review-title,
.aior-reviewer-meta h4.review-title {
    font-weight: bold;
    display: block;
    margin: 0; /* h3/h4のデフォルトマージンをリセット */
    font-size: 1em; /* h3/h4のデフォルトサイズをリセット */
    margin-bottom: 4px; /* ★ 投稿者名との間にマージンを追加 */
}
/* --- ★ 変更終了 --- */

.aior-reviewer-meta .review-date {
    font-size: 12px;
    color: var(--aior-text-light);
    display: block;
    margin-bottom: 4px;
}

.aior-review-ratings {
    margin-top: 20px;
}

/* --- ★ 変更：h5 -> .aior-section-title --- */
/* .aior-review-ratings h5 { */
.aior-review-ratings .aior-section-title {
    margin-top: 15px; /* Added margin top */
    margin-bottom: 10px; /* Reduced margin bottom */
    padding-top: 10px; /* <-- ★ 変更：削除 */
    /* border-top: 1px dashed var(--aior-border); */ /* <-- ★ 変更：削除 */
    font-size: 1.1em; /* Make it slightly smaller than summary group title */
    /* --- ★ 追加：h5のスタイルを継承 --- */
    font-weight: 700;
}
/* Remove top border/margin from the very first h5 */
/* --- ★ 変更：h5 -> .aior-section-title --- */
/* .aior-single-review-wrapper .aior-review-ratings h5:first-of-type { */
.aior-single-review-wrapper .aior-review-ratings .aior-section-title:first-of-type {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}


/* --- ★ MODIFICATION START ★ --- */
.aior-rating-item-comment {
    /* background: #f8f9fa; */ /* REMOVED */
    /* border-left: 3px solid var(--aior-primary); */ /* REMOVED */
    background: transparent; /* Changed to transparent */
    border-left: none;       /* Removed border */
    padding: 0;              /* Removed padding */
    margin-top: 8px;
    /* ★ 追加：コメントのインデントを少し調整 */
    padding-left: 5px;
    font-size: 14px;
}
/* --- ★ MODIFICATION END ★ --- */

.aior-admin-reply {
    border-left: 3px solid var(--aior-secondary);
    background: #fffaf0;
    padding: 15px;
    margin-top: 15px;
}

.aior-form-container {
    background: var(--aior-card-bg);
    border: none;
    box-shadow: var(--aior-shadow);
    padding: 25px; /* --- ★ 変更：40px から 25px に変更 --- */
    border-radius: var(--aior-radius);
    margin-top: 50px;
    /* --- ★ 変更：ここに追加 --- */
    width: 100%;
    box-sizing: border-box;
}

/* --- ★ 変更：h3 -> .aior-section-title --- */
.aior-form-container .aior-section-title[style*="text-align: center"] {
    text-align: center;
    /* --- ★ 追加：h3のスタイルを継承 --- */
    font-size: 1.5em;
    font-weight: 700;
    margin-bottom: 20px;
}

/* --- ADDED START: Form section title style --- */
/* --- ★ 変更：.aior-section-title もセレクタに追加 --- */
.aior-form-section-title,
.aior-section-title {
    font-size: 1.2em;
    font-weight: 700;
    margin-bottom: 15px;
    margin-top: 25px;
    padding-bottom: 5px;
    border-bottom: 1px solid var(--aior-border);
}

.aior-form-container > .aior-form-section-title:first-of-type,
.aior-form-container > .aior-section-title:first-of-type {
    margin-top: 0; /* Remove top margin for the very first title */
}
/* --- ADDED END --- */

/* --- ★ 変更(Phase 5)： H2見出しのスタイルを削除 --- */
/* .aior-single-review-wrapper h2.aior-component-heading {
    background-color: #1a4b72; 
    color: #ffffff;
    padding: 12px 20px;
    font-size: 1.2em;
    font-weight: 700;
    margin-top: 25px;
    margin-bottom: 20px;
    border-top: 2px solid #ffffff;
    border-bottom: 2px solid #ffffff;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.1); 
    text-align: center;
} 
*/

/* フォームのh2とは区別する */
.aior-form-container h2.aior-section-title {
    background-color: transparent;
    color: var(--aior-text);
    padding: 0;
    font-size: 1.5em;
    margin-bottom: 20px;
    border: none;
    box-shadow: none;
    text-align: left;
}
/* --- ★ 変更終了 --- */


/* --- ★ 変更(2/2)： フォームからタイトル入力欄を削除したため、このスタイルは不要 --- */
/*
.aior-form-field input[type=text],
.aior-form-field input[type=number],
.aior-form-field input[type=email],
.aior-form-field textarea,
.aior-form-field select {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    width: 100%;
    padding: 10px;
    border-radius: 4px;
}
*/
/* --- ★ 変更終了 --- */

/* --- ★ 変更： 上記のセレクタを分割し、 input[type=text] 以外を再定義 --- */
.aior-form-field input[type=number],
.aior-form-field input[type=email],
.aior-form-field textarea,
.aior-form-field select {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    width: 100%;
    padding: 10px;
    border-radius: 4px;
}
/* ★ input[type=text] のみ、フォームから削除されたため除外 (上記) */
/* ★ ただし、"その他質問" で text が使われる可能性があるので、元に戻す */
.aior-form-field input[type=text] {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    width: 100%;
    padding: 10px;
    border-radius: 4px;
}
/* --- ★ 変更終了 --- */


.aior-form-field fieldset {
    border: 1px solid #e9ecef;
    padding: 15px;
    border-radius: 4px;
    background: #f8f9fa;
}

.aior-form-field .aior-checkbox-group div,
.aior-form-field .aior-radio-group div {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.aior-form-field .aior-checkbox-group input,
.aior-form-field .aior-radio-group input {
    margin-right: 10px;
}

.button.button-primary {
    background: var(--aior-primary);
    border: none;
    border-radius: 25px;
    padding: 12px 30px;
    font-size: 1.1em;
    transition: background 0.3s;
}

.button.button-primary:hover {
    background: #3a7ac2;
}

/* --- ★ 変更：ここから送信ボタンのスタイルを修正 --- */
/* 送信ボタンのラッパー（.aior-form-field）を中央揃えにし、マージンを設定 */
.aior-form-container form .aior-form-field:last-of-type {
    text-align: center;
    margin-top: 25px; /* --- ★ 変更：ボタンからラッパーにマージンを移動 --- */
}

/* 送信ボタン自体のスタイル */
.aior-form-container .button.button-primary {
    background: #fd9535;
    color: #ffffff;
    /* margin-top: 25px; */ /* --- ★ 変更：この行を削除 --- */
}

/* 送信ボタンのホバー色 */
.aior-form-container .button.button-primary:hover {
    background: #e0822b; /* 少し暗いオレンジ */
}
/* --- ★ 変更：送信ボタンのスタイルはここまで --- */


.stars-static {
    color: var(--aior-secondary);
}

.aior-no-reviews {
    text-align: center;
    padding: 40px;
    background: var(--aior-card-bg);
    border-radius: var(--aior-radius);
    box-shadow: var(--aior-shadow);
}

.aior-star-rating-input .stars {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    font-size: 22px;
    color: var(--aior-secondary);
}

.aior-star-rating-input .stars .fa-star {
    cursor: pointer;
    transition: color 0.2s;
    margin: 0 2px;
}

.aior-star-rating-input .stars .far {
    color: #e9ecef;
}

.aior-question-text {
    font-size: 0.9em;
    color: #555;
    margin: -5px 0 10px 0;
}

.aior-navigation-links {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
}

.aior-single-review-wrapper .aior-review-item>a {
    pointer-events: none;
    /* Disable link on single page */
}

/* --- ★ 変更：ここからページネーションのCSS詳細度を修正 --- */
/* SWELL連携（.c-pagination）への干渉を削除し、.aior-pagination のみ対象にする */
.aior-wrapper .aior-pagination {
    display: flex; /* Keep flex for alignment */
    justify-content: center; /* Center align items */
    align-items: center; /* ADDED: Vertically center align items */
    margin: 3em 0; /* Keep original margin */
    flex-wrap: wrap; /* Allow wrapping */
}

.aior-wrapper .aior-pagination .page-numbers {
    /* Basic styling for links and current page */
    box-sizing: content-box;
    display: inline-block; /* Changed to inline-block */
    font-size: 14px;
    height: 36px;
    line-height: 36px;
    margin: 6px;
    min-width: 36px;
    padding: 0;
    text-align: center;
    text-decoration: none;
    transition: color .25s, background-color .25s;
    border: 1px solid #ddd; /* Example border */
    background-color: #f7f7f7; /* Example background */
    color: #555; /* Example text color */
}

.aior-wrapper .aior-pagination .page-numbers.current,
.aior-wrapper .aior-pagination .page-numbers:hover {
    background-color: var(--aior-primary); /* Use primary color for current/hover */
    color: #fff;
    border-color: var(--aior-primary);
}

.aior-wrapper .aior-pagination .dots {
    /* Style for the dots '...' */
    color: #aaa;
    margin: 6px;
    line-height: 36px;
    padding: 0 8px; /* Add some padding */
    display: inline-block; /* Ensure it aligns */
}
/* --- ★ 変更：ページネーションのCSSはここまで --- */

/* --- ★ 変更：Summary CardとSingle Page共通の評価項目スタイル --- */
/* ★ 変更： rating-item-wrapperにも適用 */
.aior-review-ratings .rating-group-summary,
.aior-review-ratings .rating-item-wrapper /* Apply border/margin to individual wrappers */
/* .aior-review-ratings h5 + .rating-item-wrapper, */ /* Single page: first item after h5 */
/* .aior-review-ratings .rating-item-wrapper + .rating-item-wrapper */ /* Single page: subsequent items */
{
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px dashed var(--aior-border);
}
/* 最初のグループ/アイテムのボーダーを削除 */
.aior-review-ratings .rating-group-summary:first-of-type,
/* --- ★ 変更：h5 -> .aior-section-title --- */
.aior-review-ratings .overall-comment-wrapper + .aior-section-title + .rating-item-wrapper, /* First item after overall comment + h5 */
.aior-review-ratings .overall-rating-summary + .rating-group-summary, /* First group after overall summary (if no overall comment) */
/* --- ★ 変更：ここから4行追加 --- */
.aior-review-ratings .aior-section-title + .rating-group-summary,
.aior-review-ratings .aior-section-title + .rating-item-wrapper,
.aior-review-ratings .overall-comment-wrapper .rating-item-wrapper,
.aior-review-summary-card .aior-review-ratings > .rating-item-wrapper:first-of-type
{
    margin-top: 10px;
    padding-top: 0;
    border-top: none;
}

/* --- ★ 変更(Phase 5)： .extra-field-item のスタイルを追加 --- */
.aior-review-ratings .extra-field-item {
     margin-top: 15px;
    padding-top: 10px;
    border-top: 1px dashed var(--aior-border);
    font-size: 0.9em;
}
.aior-review-ratings .extra-field-item b {
    font-weight: 700;
}
.aior-review-ratings .extra-field-item div {
    margin-top: 5px;
    padding-left: 10px;
    line-height: 1.5;
}
/* 最初の .extra-field-item のボーダーを削除 */
.aior-review-ratings .rating-item-wrapper + .extra-field-item,
.aior-review-ratings .aior-component-heading + .extra-field-item,
.aior-review-ratings .overall-comment-wrapper + .extra-field-item {
    margin-top: 10px;
    padding-top: 0;
    border-top: none;
}
/* --- ★ 変更終了 --- */


/* --- ★ 変更：strong -> b --- */
/* --- ★ 変更：h3 セレクタを削除 --- */
.aior-review-ratings .rating-group-summary b, /* Summary Card Group Title */
.aior-review-ratings .overall-rating-summary b.rating-label /* Summary & Single Overall Label */
 {
    display: block;
    margin-bottom: 8px;
    font-size: 1.1em;
    font-weight: bold; /* ★ 太字指定 */
    margin: 0; /* h3のデフォルトマージンをリセット */
}

.aior-review-ratings .overall-rating-summary {
    margin-bottom: 15px;
    font-size: 1.1em;
    /* ★ 変更： flex layout for overall rating */
    display: flex;
    align-items: center;
    gap: 10px;
}
/* --- ★ 変更：strong -> b --- */
/* --- ★ 変更：h3 セレクタを削除 --- */
.aior-review-ratings .overall-rating-summary b.rating-label {
    margin-bottom: 0; /* Remove bottom margin for flex alignment */
    margin-right: auto; /* Push stars right */
    display: inline; /* Override block display */
}


.aior-review-ratings .rating-item {
    display: flex;
    justify-content: space-between; /* Pushes label and stars apart */
    align-items: center;       /* Vertically align label and stars */
    gap: 10px;                 /* Add space between label and stars if they get close */
    margin-bottom: 5px;       /* Spacing between rating items */
}

.aior-review-ratings .rating-item .rating-label {
    flex-shrink: 1; /* Allow label to shrink if needed */
    margin-right: auto; /* Push stars to the right */
    line-height: 1.3; /* Improve readability if label wraps */
    font-weight: bold; /* ★ 太字指定 */
    font-size: 0.9em; /* ★ 変更：フォントサイズ */
}

.aior-review-ratings .rating-item .stars-static {
    white-space: nowrap; /* Prevent stars from wrapping */
    flex-shrink: 0;      /* Prevent stars from shrinking */
    font-size: 1em;     /* Default size */
}

.aior-review-item .aior-read-more-link { /* ★ 変更：.aior-review-summary-card から .aior-review-item に変更 */
    text-align: right;
    font-size: 13px;
    font-weight: 600;
    margin-top: 15px;
}
/* --- ★ 変更終了 --- */

/* --- ★ MODIFICATION START ★ --- */
/* Style for overall comment in summary card */
.aior-overall-comment-summary {
    margin-top: 10px; /* Add space below overall rating */
    margin-bottom: 15px; /* Add space before the next section */
    font-style: italic; /* Optional: make it stand out slightly */
    /* padding: 10px; */ /* REMOVED */
    /* background: #f8f9fa; */ /* REMOVED */
    /* border-left: 3px solid var(--aior-primary); */ /* REMOVED */
    background: transparent; /* Changed to transparent */
    border-left: none;       /* Removed border */
    padding: 0;              /* Removed padding */
}

/* Style for overall rating section in single review page */
.aior-single-review-wrapper .overall-comment-wrapper {
    margin-bottom: 20px; /* Add space before common ratings */
    padding-bottom: 15px; /* Add space within the wrapper */
    border-bottom: 1px dashed var(--aior-border); /* Add a separator */
}

/* ★ 変更：Single page overall rating は flex 不要 (rating-item-wrapperが担当) */
/* .aior-single-review-wrapper .overall-comment-wrapper .overall-rating-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
} */
/* ★ 変更：Single page overall rating label は rating-label style を継承 */
/* .aior-single-review-wrapper .overall-comment-wrapper .overall-rating-summary strong {
    font-weight: bold;
} */

.aior-single-review-wrapper .overall-comment-wrapper .aior-rating-item-comment {
    margin-top: 0; /* Remove default margin-top from the comment box */
}
/* --- ★ MODIFICATION END ★ --- */

/* --- ★ 追加：リストコントロール --- */
.aior-list-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap; /* Allow wrapping on small screens */
    gap: 10px; /* Add gap for wrapped items */
}
.aior-sort-control {
    /* Styles for sort dropdown if needed */
}
.aior-filter-actions {
    /* Container for reset button */
}
.aior-reset-filter-button {
    font-size: 0.8em !important;
    padding: 4px 10px !important;
    height: auto !important;
    line-height: normal !important;
    background: #fff !important;
    color: #555 !important;
    border: 1px solid #ccc !important;
    border-radius: 3px !important;
    text-decoration: none;
    white-space: nowrap; /* Prevent button text wrapping */
}
.aior-reset-filter-button:hover {
    background: #f0f0f0 !important;
    border-color: #999 !important;
}
.aior-filter-notice {
    width: 100%; /* Make notice take full width when wrapped */
    text-align: center;
    font-size: 0.9em;
    color: var(--aior-text-light);
    order: 3; /* Ensure notice appears below controls when wrapped */
    margin-top: 5px;
}


@media (max-width: 768px) {
    .aior-summary-container {
        grid-template-columns: 1fr;
    }
    .aior-overall-rating-box {
        border-right: none;
        border-bottom: 1px solid var(--aior-border);
        padding: 0 0 30px 0;
    }
    .aior-chart-controls {
        flex-wrap: wrap;
    }
    /* --- MODIFICATION START: Ensure pagination wraps correctly on mobile --- */
    .aior-wrapper .aior-pagination .page-numbers { /* ★ 変更：セレクタ詳細度UP */
        margin: 4px; /* Adjust margin for smaller screens */
    }
    /* --- MODIFICATION END --- */

    /* --- ★ 変更：Mobile adjustments for Summary Card & Single Page --- */
    .aior-review-ratings .rating-item .stars-static {
        font-size: 0.9em; /* Slightly smaller stars on mobile */
    }
     .aior-review-ratings .rating-item .rating-label {
        /* Optional: reduce label font size on mobile if still wrapping badly */
        /* font-size: 0.9em; */
    }
    /* --- ★ 変更終了 --- */

    /* --- ★ MODIFICATION START ★ --- */
    /* Mobile adjustments for overall rating section in single review page */
    .aior-single-review-wrapper .overall-comment-wrapper .overall-rating-summary {
        flex-wrap: wrap; /* Allow wrapping on small screens */
    }
    /* --- ★ MODIFICATION END ★ --- */
}

/* --- ★ 追加：Shortcode Wrapper Styles --- */
.aior-shortcode-rating-detail,
.aior-shortcode-wrapper {
    margin-top: 30px;
    margin-bottom: 30px;
}

/* --- ★ 追加：SWELL !important 対策 --- */
/* SWELL: .post_content>:first-child { margin-top: 0 !important; } 対策 */
.entry-content > .aior-wrapper:first-child,
.entry-content > .aior-single-review-wrapper:first-child,
.entry-content > .aior-shortcode-rating-detail:first-child,
.entry-content > .aior-shortcode-wrapper:first-child {
    margin-top: revert !important; 
}

/* SWELL: .post_content>:last-child { margin-bottom: 0 !important; } 対策 */
.entry-content > .aior-wrapper:last-child,
.entry-content > .aior-single-review-wrapper:last-child,
.entry-content > .aior-shortcode-rating-detail:last-child,
.entry-content > .aior-shortcode-wrapper:last-child {
    margin-bottom: revert !important;
}

/* --- ★★★ 変更開始：ページネーションのマージン上書き修正 ★★★ --- */
/* SWELL: .post_content div>:first-child { margin-top: 0 !important; } 対策 */
.aior-wrapper .c-pagination > [class*="page-numbers"]:first-child,
.aior-wrapper .aior-pagination > [class*="page-numbers"]:first-child {
     margin-top: 6px !important;
}

/* SWELL: .post_content div>:last-child { margin-bottom: 0 !important; } 対策 */
.aior-wrapper .c-pagination > [class*="page-numbers"]:last-child,
.aior-wrapper .aior-pagination > [class*="page-numbers"]:last-child {
     margin-bottom: 6px !important;
}
/* === チラ見せアコーディオン（口コミコメント用） ======================= */
.aior-peek-accordion {
    position: relative;
    margin-bottom: 1.75em;
}

.aior-peek-accordion__body {
    font-size: 14px;
    line-height: 1.8;
}

/* 閉じているときは 3 行分だけ表示（JS がクラスを付与した場合のみ） */
.aior-peek-accordion--collapsed .aior-peek-accordion__body {
    max-height: calc(1.8em * 3);
    overflow: hidden;
}

/* 開いているときは制限なし */
.aior-peek-accordion--expanded .aior-peek-accordion__body {
    max-height: none;
}

/* 下部グラデーションマスク（閉じている時だけ） */
.aior-peek-accordion__mask {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 2.8rem; /* ボタン分のスペース */
    height: 4rem;
    pointer-events: none;
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.7) 60%,
        rgba(255, 255, 255, 1) 100%
    );
}

.aior-peek-accordion--expanded .aior-peek-accordion__mask {
    display: none;
}

/* トグルボタン（軽めのピル型） */
.aior-peek-accordion__toggle {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5em;
    margin: 0.5rem auto 0;
    padding: 0.5rem 1.8rem;
    border-radius: 9999px;
    border: 1px solid #ffffff;
    background-color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    transition: box-shadow 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
}

.aior-peek-accordion__toggle:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
    background-color: rgba(255, 255, 255, 1);
}

.aior-peek-accordion__toggle-icon {
    display: inline-block;
    font-size: 10px;
    transition: transform 0.2s ease;
}

.aior-peek-accordion--expanded .aior-peek-accordion__toggle-icon {
    transform: rotate(180deg);
}
