/* 薬価検索画面 - 完全に整理されたレイアウト */

/* Alpine.js x-cloak: 初期化前の非表示 */
[x-cloak] {
    display: none !important;
}

/* リセットとベース */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #1f2937;
    background: #f9fafb;
    line-height: 1.6;
    overflow-x: hidden;
}

/* ヘッダー */
.drug-header {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
    gap: 24px;
}

/* ロゴ */
.header-left .logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #2563eb;
    font-weight: 700;
}

.logo-icon {
    font-size: 28px;
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
}

/* 検索エリア */
.header-center {
    flex: 1;
    max-width: 500px;
    margin: 0 32px;
}

.main-search {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1;
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    transition: all 0.2s ease;
    height: 50px;
}

.search-submit-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 20px;
    height: 50px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
    flex-shrink: 0;
}

.search-submit-btn:hover {
    background: #1d4ed8;
}

.search-submit-btn .material-icons {
    font-size: 20px;
}

.search-input-wrapper:focus-within {
    border-color: #2563eb;
}

.search-icon {
    position: absolute;
    left: 16px;
    color: #9ca3af;
    font-size: 20px;
}

.main-search-input {
    flex: 1;
    padding: 15px 50px 15px 50px;
    border: none;
    background: transparent;
    font-size: 16px;
    outline: none;
    color: #374151;
}

.main-search-input::placeholder {
    color: #9ca3af;
}

.clear-search-btn {
    position: absolute;
    right: 12px;
    width: 32px;
    height: 32px;
    border: none;
    background: #f3f4f6;
    border-radius: 50%;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.clear-search-btn:hover {
    background: #e5e7eb;
    color: #374151;
}

/* ヘッダー右側 */
.header-right {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.comparison-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.selected-count {
    display: flex;
    align-items: center;
}

.count-badge {
    background: #10b981;
    color: #fff;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.compare-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.compare-btn:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

.quantity-compare-btn {
    background: #10b981;
}

.quantity-compare-btn:hover {
    background: #059669;
}

.clear-selection-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: white;
    color: #4b5563;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.clear-selection-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
    transform: translateY(-1px);
}

.header-stats {
    display: flex;
    gap: 20px;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: #2563eb;
    margin-bottom: 2px;
}

.stat-label {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}

/* メインコンテンツ */
.main-content {
    max-width: 1600px;
    margin: 0 auto;
    min-height: calc(100vh - 80px);
    width: 100%;
}

/* 検索結果エリア */
.results-area {
    padding: 20px 24px;
    background: #f9fafb;
    position: relative;
    z-index: 1;
}

.results-header {
    margin-bottom: 20px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.results-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
}

.results-info {
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
}

.active-filter-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: #dbeafe;
    color: #1e40af;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
}

.active-filter-badge .badge-clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #93c5fd;
    color: #1e3a8a;
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
    line-height: 0;
    padding-bottom: 1px;
    transition: background 0.15s;
}

.active-filter-badge .badge-clear:hover {
    background: #60a5fa;
}

.results-title {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

.results-count {
    font-size: 14px;
    color: #64748b;
}

.results-header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* 絞り込みトグルボタン */
.filter-toggle-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #f8fafc;
    color: #475569;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-toggle-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #334155;
}

.filter-toggle-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}

.filter-toggle-btn .material-icons {
    font-size: 18px;
}

/* 折りたたみフィルターパネル */
.filter-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    border-top: 0 solid #e5e7eb;
}

.filter-panel.open {
    max-height: 600px;
    border-top-width: 1px;
}

.filter-panel-inner {
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-start;
}

.filter-row-actions {
    justify-content: flex-end;
    padding-top: 4px;
    border-top: 1px solid #f1f5f9;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.filter-group-wide {
    flex: 1 1 100%;
}

.filter-group-title {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* フィルター入力（インライン） */
.filter-options-inline {
    display: flex;
    align-items: center;
    gap: 12px;
}

.filter-option-inline {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    font-size: 13px;
    color: #374151;
}

.filter-radio {
    width: 14px;
    height: 14px;
    accent-color: #2563eb;
    margin: 0;
}

.filter-input-sm {
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    background: #fff;
    width: 160px;
    transition: border-color 0.2s;
}

.filter-input-sm:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.price-range-inline {
    display: flex;
    align-items: center;
    gap: 6px;
}

.price-input-sm {
    width: 80px;
    padding: 6px 8px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    text-align: center;
    background: #fff;
}

.price-input-sm:focus {
    outline: none;
    border-color: #2563eb;
}

.price-separator {
    color: #9ca3af;
    font-size: 13px;
}

.price-unit-sm {
    font-size: 12px;
    color: #64748b;
}

/* フィルターチップ */
.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.filter-chip {
    background: #f3f4f6;
    color: #374151;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.filter-chip:hover {
    background: #e5e7eb;
}

.filter-chip.active {
    background: #3b82f6;
    color: #fff;
}

.clear-filters-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    background: #f9fafb;
    color: #64748b;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.clear-filters-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

/* カード表示（スマホ用）- デフォルト非表示 */
.results-card-list {
    display: none;
}

.drug-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 0;
    overflow: hidden;
    transition: box-shadow 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.drug-card.selected {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

/* カードヘッダー: チェックボックス + 薬品名 + 詳細ボタン */
.drug-card-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px 6px;
}

.drug-card-select {
    flex-shrink: 0;
    padding-top: 2px;
}

/* カード内のチェックボックス・バッジのテーブル用スタイル上書き */
.drug-card-select .selection-checkbox {
    width: auto;
    height: auto;
    margin: 0;
}

.drug-card-select .select-badge {
    display: inline-block;
    width: auto;
    min-width: 40px;
    height: 24px;
    line-height: 24px;
    margin: 0;
    font-size: 10px;
    padding: 0 6px;
}

.drug-card-title {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
}

.drug-card-title .drug-name-link {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    word-break: break-word;
    white-space: normal;
    overflow: visible;
    line-height: 1.4;
    /* <button> / <a> どちらでも同じ見た目にする */
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
}

.drug-card-title a.drug-name-link,
.drug-card-title button.drug-name-link {
    color: #2563eb;
    text-decoration: none;
}

.drug-card-title .badge-generic,
.drug-card-title .badge-brand {
    flex-shrink: 0;
    font-size: 10px;
    padding: 2px 6px;
    vertical-align: baseline;
}

.drug-card-detail-btn {
    flex-shrink: 0;
    background: #f3f4f6;
    border: none;
    border-radius: 8px;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.2s;
}

.drug-card-detail-btn:hover {
    background: #e5e7eb;
    color: #374151;
}

/* カードメーカー行 */
.drug-card-manufacturer {
    padding: 0 14px 8px 14px;
    padding-left: calc(14px + 16px + 10px);
    /* select幅分インデント */
    font-size: 12px;
    color: #6b7280;
}

.drug-card-manufacturer-link {
    background: none;
    border: none;
    padding: 0;
    font-size: 12px;
    color: #2563eb;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

/* カードボディ: 薬価 + メタ情報 */
.drug-card-body {
    padding: 0 14px 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-top: 1px solid #f5f5f5;
    margin: 0 14px;
    padding: 10px 0;
}

.drug-card-price-section {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.drug-card-price-main {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.drug-card-price-label {
    font-size: 11px;
    color: #9ca3af;
    flex-shrink: 0;
    margin-right: auto;
}

.drug-card-price-value {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 6px;
}

.drug-card-transition-badge {
    background: #fef3c7;
    color: #92400e;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
}

.drug-card-price-sub {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.drug-card-price-value-sub {
    font-size: 13px;
    color: #9ca3af;
}

.drug-card-rate {
    font-size: 12px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
    background: #f9fafb;
}

.drug-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    padding-top: 4px;
}

/* カードフッター: アクションリンク */
.drug-card-footer {
    display: flex;
    border-top: 1px solid #e5e7eb;
    background: #fafbfc;
}

.drug-card-action {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 10px 4px;
    font-size: 10px;
    font-weight: 500;
    color: #6b7280;
    text-decoration: none;
    transition: all 0.15s;
    border-right: 1px solid #f0f0f0;
}

.drug-card-action:last-child {
    border-right: none;
}

.drug-card-action:hover,
.drug-card-action:active {
    background: #f0f4ff;
    color: #2563eb;
}

.drug-card-action .material-icons {
    font-size: 20px;
    color: #0ea5e9;
}

.drug-card-action .material-symbols-outlined {
    font-size: 20px;
    color: #6366f1;
}

.drug-card-action:nth-child(3) .material-icons {
    color: #7c3aed;
}

.sort-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sort-label {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}

.sort-select {
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    background: #fff;
    cursor: pointer;
    min-width: 110px;
}

.sort-direction-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #d1d5db;
    background: #fff;
    border-radius: 6px;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.sort-direction-btn:hover {
    background: #f9fafb;
    color: #374151;
}

/* 検索結果テーブル */
.results-table-wrapper {
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    overflow-x: auto;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

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

.results-table thead {
    background: #f8fafc;
    border-bottom: 2px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 30;
}

.results-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    vertical-align: middle;
}

.results-table td {
    padding: 12px 16px;
    color: #374151;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.th-checkbox,
.td-checkbox {
    width: 60px;
    text-align: center;
}

.th-name {
    min-width: 200px;
}


.th-scroll-hint {
    font-size: 14px;
    color: #9ca3af;
    vertical-align: middle;
    margin-left: 2px;
}

.th-manufacturer {
    min-width: 120px;
}

.th-price {
    min-width: 100px;
}

.th-type {
    min-width: 60px;
    text-align: center;
}

.th-shipment {
    min-width: 110px;
}

.th-volume {
    min-width: 100px;
}

.th-links {
    min-width: 200px;
}

.th-code {
    min-width: 120px;
}

.th-action {
    width: 220px;
}

/* テーブル行 */
.drug-row {
    transition: background 0.15s;
}

.drug-row:hover td {
    background: #fef9c3 !important;
    background-color: #fef9c3 !important;
}

.drug-row.selected {
    background: #f0fdf4;
}

.drug-row.selected td {
    border-bottom-color: #bbf7d0;
}

/* チェックボックス・選択バッジ */
.td-checkbox {
    width: 60px;
}

.selection-checkbox {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 28px;
    margin: 0 auto;
}

.checkbox-input {
    width: 16px;
    height: 16px;
    cursor: pointer;
    margin: 0;
    accent-color: #10b981;
}

.select-badge {
    display: block;
    width: 48px;
    height: 28px;
    line-height: 28px;
    text-align: center;
    margin: 0 auto;
    padding: 0;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    border: none;
    transition: opacity 0.15s;
}

.select-badge:hover {
    opacity: 0.8;
}

.badge-base {
    background: #f59e0b;
    color: #fff;
}

.badge-compare {
    background: #6366f1;
    color: #fff;
}

/* 製品名セル */
.td-name {
    max-width: 400px;
    overflow-x: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.td-name::-webkit-scrollbar {
    display: none;
}

/* td-name 内の薬品名リンク（<a> / <button> 両対応） */
.td-name .drug-name-link,
.td-name a.drug-name-link,
.td-name button.drug-name-link {
    display: inline;
    font-size: 14px;
    font-weight: 600;
    color: #2563eb;
    text-decoration: none;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    line-height: 1.4;
}

.td-name .drug-name-link:hover,
.td-name a.drug-name-link:hover,
.td-name button.drug-name-link:hover {
    text-decoration: underline;
}

.drug-name-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
    white-space: nowrap;
}

.drug-name {
    font-size: 14px;
    color: #111827;
    font-weight: 600;
    line-height: 1.4;
    margin: 0;
}

.drug-official-name {
    font-size: 12px;
    color: #9ca3af;
    line-height: 1.3;
}

/* 区分バッジ */
.td-type {
    text-align: center;
}

.badge-generic {
    display: inline-block;
    background: #10b981;
    color: #fff;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-brand {
    display: inline-block;
    background: #3b82f6;
    color: #fff;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

/* Shipment Status Badges */
.badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    display: inline-block;
}

.badge-vol {
    font-size: 13px;
    padding: 2px 8px;
}

.badge-normal {
    background: #f1f5f9;
    color: #475569;
}

.badge-warning-light {
    background: #fef3c7;
    color: #d97706;
}

.badge-warning {
    background: #f59e0b;
    color: #fff;
}

.badge-danger {
    background: #ef4444;
    color: #fff;
}

/* 出荷状況 */
.status-alert {
    color: #dc2626;
    font-weight: 600;
}

.text-muted {
    color: #d1d5db;
}

/* 詳細ボタン */
.detail-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
}

.detail-btn:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #374151;
}

.detail-btn .material-icons {
    font-size: 18px;
}

/* 検索結果なし */
.no-results {
    text-align: center;
    padding: 80px 20px;
    background: #fff;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.no-results-icon {
    font-size: 64px;
    color: #ccc;
    margin-bottom: 24px;
}

.no-results-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.no-results-text {
    font-size: 14px;
    color: #666;
    margin-bottom: 32px;
}

.retry-btn {
    padding: 10px 20px;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 3px;
    font-size: 14px;
    cursor: pointer;
}

.retry-btn:hover {
    background: #1d4ed8;
}

/* ページネーション */
.pagination-wrapper {
    margin-top: 32px;
    display: flex;
    justify-content: center;
}

.pagination-nav {
    flex-wrap: wrap;
    gap: 6px;
}

/* PC: 前へ/次へテキスト非表示、アイコンのみ */
.pagination-prev-text,
.pagination-next-text {
    display: none;
}

/* ページ番号ボタン共通 */
.pagination-page,
.pagination-prev,
.pagination-next {
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

button.pagination-page:hover,
button.pagination-prev:hover,
button.pagination-next:hover {
    background: #f3f4f6;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* モーダル */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(4px);
}

.modal {
    background: #fff;
    border-radius: 16px;
    width: 90%;
    max-width: 1100px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}

.modal-header {
    padding: 24px 28px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f9fafb;
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: #f3f4f6;
    border-radius: 50%;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #e5e7eb;
    color: #374151;
}

.modal-body {
    padding: 28px;
    max-height: 70vh;
    overflow-y: auto;
}

.drug-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin-bottom: 24px;
}

.detail-section {
    background: #f9fafb;
    border-radius: 12px;
    padding: 20px;
}

.detail-section-title {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e7eb;
}

.detail-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 8px 0;
}

.detail-label {
    font-weight: 500;
    color: #64748b;
    min-width: 120px;
    font-size: 14px;
}

.detail-value {
    text-align: right;
    color: #1f2937;
    font-weight: 500;
    flex: 1;
    margin-left: 16px;
    font-size: 14px;
}

.price-highlight {
    font-size: 18px;
    font-weight: 700;
    color: #2563eb;
}

.detail-notes {
    background: #fff;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    color: #374151;
    line-height: 1.6;
}

/* レスポンシブ対応 */
@media (max-width: 1200px) {
    .results-area {
        padding: 16px;
    }

    .header-container {
        padding: 0 20px;
    }
}

@media (max-width: 1024px) {
    .drug-detail-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .filter-row {
        flex-direction: column;
        gap: 12px;
    }

    .filter-input-sm {
        width: 100%;
    }
}

@media (max-width: 768px) {

    /* テーブル非表示 → カード表示 */
    .results-table-wrapper {
        display: none !important;
    }

    .results-card-list {
        display: flex !important;
        flex-direction: column;
        gap: 12px;
    }

    /* ヘッダー: 薬比+医薬品数を横並びbetween、検索を下段 */
    .header-container {
        flex-wrap: wrap;
        height: auto;
        padding: 12px 16px;
        gap: 10px;
    }

    .header-left {
        order: 1;
        flex-shrink: 0;
        gap: 16px !important;
    }

    .header-right {
        order: 2;
        margin-left: auto;
        justify-content: flex-end;
        min-width: 0;
        flex-shrink: 1;
    }

    .header-center {
        order: 3;
        margin: 0;
        max-width: none;
        width: 100%;
        flex-basis: 100%;
    }

    .search-input-wrapper {
        height: 44px;
    }

    .main-search-input {
        font-size: 15px;
        padding: 10px 42px 10px 42px;
    }

    .search-icon {
        font-size: 18px;
        left: 12px;
    }

    .results-header-top {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
        padding: 14px 16px;
    }

    .results-info {
        flex-direction: column;
        gap: 4px;
    }

    .results-title {
        font-size: 16px;
    }

    .results-title span {
        display: none;
    }

    .results-count {
        font-size: 13px;
    }

    .results-header-actions {
        width: 100%;
        flex-wrap: wrap;
        gap: 8px;
    }

    .filter-toggle-btn {
        flex: 1;
        justify-content: center;
        min-width: 0;
    }

    .sort-controls {
        flex: 1;
        min-width: 0;
    }

    .sort-controls>div {
        width: 100%;
        flex-wrap: wrap;
        gap: 4px !important;
        padding: 4px 8px !important;
    }

    .sort-select {
        font-size: 12px;
        padding: 2px !important;
    }

    .export-group {
        width: 100%;
        justify-content: center;
    }

    .modal {
        width: 95%;
        margin: 20px;
    }

    .comparison-controls {
        flex-wrap: nowrap;
        gap: 6px;
        align-items: center;
    }

    .compare-btn,
    .clear-selection-btn {
        font-size: 13px;
        padding: 7px 10px;
    }

    /* スマホ: 選択解除・比較ボタンのテキストを非表示（アイコンのみ） */
    .clear-selection-btn .btn-text,
    .compare-btn .btn-text {
        display: none;
    }

    /* 選択件数バッジ: コンパクト化 */
    .count-badge {
        padding: 5px 10px;
        font-size: 12px;
    }

    /* フィルター: カード風 */
    .filter-panel.open {
        max-height: 1200px;
    }

    .filter-panel-inner {
        padding: 16px;
        gap: 12px;
    }

    .filter-row {
        gap: 0;
    }

    .filter-group {
        width: 100%;
        padding: 12px;
        background: #f9fafb;
        border-radius: 8px;
        border: 1px solid #f1f5f9;
        margin-bottom: 8px;
    }

    .filter-group-title {
        font-size: 11px;
        margin-bottom: 6px;
    }

    .filter-input-sm {
        width: 100%;
    }

    .price-range-inline {
        flex-wrap: nowrap;
        width: 100%;
    }

    .price-input-sm {
        flex: 1;
        min-width: 0;
        width: auto;
    }

    .filter-chip {
        padding: 6px 12px;
        border-radius: 16px;
    }

    .filter-row-actions {
        border-top: none;
        padding-top: 0;
    }

    .clear-filters-btn {
        width: 100%;
        justify-content: center;
        padding: 10px;
        font-size: 13px;
        border-radius: 8px;
    }

    /* ページネーション: コンパクト化 */
    .pagination-page,
    .pagination-prev,
    .pagination-next {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        font-size: 13px;
    }

    /* 人気検索バー */
    .popular-search-group {
        flex-direction: column !important;
    }

    .popular-label {
        width: auto !important;
    }
}

@media (max-width: 480px) {
    .header-container {
        padding: 10px 12px;
        gap: 8px;
    }

    .header-left {
        gap: 12px !important;
    }

    /* 「使い方」リンクを非表示 */
    .how-to-use-link {
        display: none !important;
    }

    /* 結果ヘッダー */
    .results-header-top {
        padding: 12px;
        gap: 8px;
    }

    .results-header-actions {
        flex-direction: column;
        gap: 8px;
    }

    .filter-toggle-btn {
        width: 100%;
    }

    .sort-controls {
        width: 100%;
    }

    .sort-controls>div {
        justify-content: space-between;
    }

    /* 表示件数とソートの仕切り線を非表示 */
    .sort-controls>div>div[style*="width: 1px"] {
        display: none;
    }

    .logo-text {
        font-size: 18px;
    }

    /* 検索ボタンのテキスト非表示 */
    .search-submit-btn span:not(.material-icons) {
        display: none;
    }

    .search-submit-btn {
        padding: 0 12px;
        min-width: 44px;
    }

    .search-input-wrapper {
        height: 42px;
    }

    .results-area {
        padding: 12px;
    }

    /* フィルターパネル */
    .filter-panel-inner {
        padding: 10px;
        gap: 8px;
    }

    .filter-group {
        padding: 10px;
        margin-bottom: 6px;
    }

    .filter-options-inline {
        flex-wrap: wrap;
        gap: 8px;
    }

    .filter-option-inline {
        font-size: 13px;
        padding: 4px 0;
    }

    .filter-chip {
        font-size: 12px;
        padding: 6px 10px;
        border-radius: 14px;
    }

    .filter-group-title {
        font-size: 11px;
    }

    .price-input-sm {
        font-size: 14px;
        padding: 8px 6px;
    }

    /* モーダル: フルスクリーン風 */
    .modal {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        border-radius: 0 !important;
        max-height: 100vh;
    }

    /* ページネーション: スマホは前へ/次へのみ表示 */
    .pagination-page {
        display: none !important;
    }

    .pagination-prev,
    .pagination-next {
        width: auto !important;
        flex: 1;
        gap: 6px;
        padding: 10px 16px !important;
        font-size: 14px !important;
    }

    .pagination-prev-text,
    .pagination-next-text {
        display: inline !important;
    }

    .pagination-nav {
        width: 100%;
    }

    /* カード微調整 */
    .drug-card-header {
        padding: 10px 12px 4px;
        gap: 8px;
    }

    .drug-card-manufacturer {
        padding: 0 12px 6px;
        padding-left: calc(12px + 16px + 8px);
    }

    .drug-card-body {
        margin: 0 12px;
        padding: 8px 0;
    }

    .drug-card-price-value {
        font-size: 18px;
    }

    .drug-card-title .drug-name-link {
        font-size: 13px;
    }

    .drug-card-action {
        padding: 8px 4px;
        font-size: 9px;
    }

    .drug-card-action .material-icons,
    .drug-card-action .material-symbols-outlined {
        font-size: 18px;
    }
}

/* テーブル薬価セル */
.td-price {
    font-weight: 600;
    white-space: nowrap;
}

/* テーブル出荷状況セル */
.td-shipment {
    font-size: 13px;
}

.td-volume {
    font-size: 13px;
}

.td-code {
    font-family: 'SF Mono', 'Monaco', 'Menlo', monospace;
    font-size: 13px;
    color: #6b7280;
}

/* リンクカラム */
.th-link {
    min-width: 100px;
    text-align: center;
}

.th-link-icon {
    min-width: 120px;
    text-align: center;
}

.td-link {
    text-align: center;
    white-space: nowrap;
}

.td-link-icon {
    text-align: center;
    padding: 12px 8px !important;
}

.table-link {
    color: #2563eb;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: color 0.15s;
}

.table-link:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.link-separator {
    color: #d1d5db;
    margin: 0 2px;
    font-size: 13px;
}

.sns-buttons {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
}

/* シェアリンク（アイコンボタン風） */
.share-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    color: #0284c7;
    text-decoration: none;
    transition: all 0.15s;
    flex-shrink: 0;
}

.share-link:hover {
    background: #0284c7;
    border-color: #0284c7;
    color: #fff;
    transform: translateY(-1px);
}

.share-link.x-share-link {
    background: #000;
    color: #fff;
    border-color: #000;
}

.share-link.x-share-link:hover {
    background: #333;
    border-color: #333;
    transform: translateY(-1px);
}

.share-link.line-share-link {
    background: #06C755;
    border-color: #06C755;
    color: #fff;
}

.share-link.line-share-link:hover {
    background: #05b34c;
    border-color: #05b34c;
    transform: translateY(-1px);
}

.share-link.insta-share-btn {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    border-color: transparent;
    color: #fff;
}

.share-link.insta-share-btn:hover {
    opacity: 0.9;
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    border-color: transparent;
    transform: translateY(-1px);
}

.share-link .material-symbols-outlined {
    font-size: 18px;
}

/* モーダルヘッダー拡張 */
.modal-title-desc {
    flex: 1;
}

.modal-subtitle {
    font-size: 14px;
    color: #64748b;
    margin-top: 4px;
}

.modal-header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.pdf-download-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #fee2e2;
    color: #b91c1c;
    text-decoration: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
    border: 1px solid #fecaca;
    height: 40px;
}

.pdf-download-btn:hover {
    background: #fecaca;
    transform: translateY(-1px);
}

/* モーダルタブ */
.modal-tabs {
    display: flex;
    padding: 0 28px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.tab-btn {
    padding: 14px 24px;
    border: none;
    background: none;
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: #1f2937;
}

.tab-btn.active {
    color: #2563eb;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: #2563eb;
}

/* 添付文書セクション */
.document-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.document-section {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
}

.document-section-title {
    font-size: 15px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.document-text {
    font-size: 14px;
    color: #374151;
    line-height: 1.8;
    white-space: pre-wrap;
    word-break: break-all;
}

.document-subsection {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.document-subsection:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.document-subsection-title {
    font-size: 13px;
    font-weight: 600;
    color: #4b5563;
    margin-bottom: 8px;
}

/* 警告・禁忌ボックス */
.warning-box {
    border: 2px solid #ef4444;
    background: #fef2f2;
}

.warning-title {
    color: #b91c1c;
}

.warning-box .material-icons {
    font-size: 20px;
}

.contra-box {
    border: 2px solid #f97316;
    background: #fff7ed;
}

.contra-title {
    color: #c2410c;
}

.contra-box .material-icons {
    font-size: 20px;
}

.no-document {
    text-align: center;
    padding: 40px;
    color: #9ca3af;
    font-style: italic;
}

/* レスポンシブ対応の追加 */
@media (max-width: 768px) {
    .modal-tabs {
        padding: 0 16px;
        overflow-x: auto;
    }

    .tab-btn {
        padding: 12px 16px;
        font-size: 13px;
        white-space: nowrap;
    }

    .modal-header-actions {
        flex-direction: column-reverse;
        align-items: flex-end;
        gap: 8px;
    }
}

/* Drug Search Component Specific Styles */
/* 薬価固定列の右側の罫線を削除 */
/* th.th-price-fixed::after, td.td-price-fixed::after {
    content: '';
    position: absolute;
    right: 0;
    top: -0.5px;
    bottom: 0;
    width: 3px;
    background: #9ca3af;
    z-index: 20;
    height: calc(100% + 1px);
} */

th.th-action::before,
td.td-action::before {
    content: '';
    position: absolute;
    left: 0;
    top: -0.5px;
    bottom: 0;
    width: 3px;
    background: #9ca3af;
    z-index: 20;
    height: calc(100% + 1px);
}

.export-group {
    display: flex;
    align-items: center;
    background: #f8fafc;
    padding: 3px;
    border-radius: 10px;
    gap: 4px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.csv-export-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    background: transparent;
    color: #059669;
    border: 1px solid transparent;
    border-radius: 7px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.csv-export-btn:hover {
    background: #ecfdf5;
    color: #047857;
    border-color: #a7f3d0;
}

.excel-export-btn {
    color: #10b981;
}

.excel-export-btn:hover {
    background: #ecfdf5;
    color: #059669;
    border-color: #a7f3d0;
    transform: translateY(-1px);
}

.pdf-export-btn {
    color: #ef4444;
}

.pdf-export-btn:hover {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fecaca;
    transform: translateY(-1px);
}

.csv-export-btn .material-icons {
    font-size: 14px;
}

.csv-export-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* 追加のコンポーネントスタイル - インラインCSSの外部化 */

/* 1. バッジ関連 (bladeから移行) */
@keyframes modal-in {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.badge-brand {
    background-color: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
    white-space: nowrap;
}

.badge-brand-available {
    background-color: #fff7ed;
    color: #c2410c;
    border: 1px solid #ffedd5;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
    white-space: nowrap;
}

.badge-generic {
    background-color: #f0fdf4;
    color: #15803d;
    border: 1px solid #dcfce7;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
    white-space: nowrap;
}

.badge-basic {
    background-color: #f0fdfa;
    color: #0f766e;
    border: 1px solid #ccfbf1;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
    white-space: nowrap;
}

.badge-basic-brand {
    background-color: #f5f3ff;
    color: #6d28d9;
    border: 1px solid #ddd6fe;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
    white-space: nowrap;
}

/* 2. ヘッダーユーティリティ */
.header-left-group {
    display: flex;
    align-items: center;
    gap: 24px;
}

.how-to-use-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #4b5563;
    text-decoration: none;
    transition: color 0.2s;
}

.how-to-use-link:hover {
    color: #2563eb;
}

.how-to-use-icon {
    font-size: 18px;
}

.header-right-container {
    flex-shrink: 0;
}

.comparison-controls-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.compare-all-btn {
    background: #2563eb;
    color: white;
    padding: 8px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
    white-space: nowrap;
}

.compare-all-btn:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.compare-all-icon {
    font-size: 18px;
    margin-left: 8px;
}

.selected-count-trigger {
    position: relative;
}

.selected-count-badge-btn {
    background: #3b82f6;
    color: white;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
    transition: background 0.2s;
}

.selected-count-badge-btn:hover {
    background: #2563eb;
}

.selected-dropdown-list {
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
    z-index: 1000;
    max-height: 60vh;
    overflow-y: auto;
    text-align: left;
}

.selected-list-header {
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: #f9fafb;
    z-index: 5;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.clear-all-list-btn {
    background: none;
    border: none;
    color: #ef4444;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.clear-all-list-btn:hover {
    background: #fee2e2;
}

.selected-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    border-bottom: 1px solid #f3f4f6;
}

.selected-item-info {
    flex: 1;
    min-width: 0;
    padding-right: 8px;
}

.selected-item-name-group {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
}

.selected-item-name {
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.base-drug-badge {
    background: #f59e0b;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    flex-shrink: 0;
}

.set-base-btn {
    background: #f3f4f6;
    color: #4b5563;
    border: 1px solid #d1d5db;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.2s;
}

.set-base-btn:hover {
    background: #e5e7eb;
}

.remove-item-btn {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.remove-item-btn:hover {
    background-color: #fee2e2;
    color: #ef4444;
}

/* 3. よく検索されるキーワード */
.popular-searches-container {
    margin-bottom: 20px;
    padding: 16px 24px;
    background: white;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.popular-search-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.popular-search-label {
    font-size: 14px;
    font-weight: 600;
    color: #4b5563;
    white-space: nowrap;
    width: 200px;
    padding-top: 6px;
}

.popular-tag-btn {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.tag-manufacturer {
    background: #ecfdf5;
    color: #10b981;
    border: 1px solid #a7f3d0;
}

.tag-manufacturer:hover {
    background: #a7f3d0;
}

.tag-drug {
    background: #f0f9ff;
    color: #0284c7;
    border: 1px solid #bae6fd;
}

.tag-drug:hover {
    background: #bae6fd;
}

.tag-common-manufacturer {
    background: #fdf4ff;
    color: #c026d3;
    border: 1px solid #fbcfe8;
}

.tag-common-manufacturer:hover {
    background: #fbcfe8;
}

/* 4. 比較方法選択モーダル */
.comparison-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    overflow-y: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.comparison-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
}

.comparison-modal-content {
    position: relative;
    background: white;
    border-radius: 24px;
    width: 100%;
    max-width: 500px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: modal-in 0.3s ease-out;
}

.comparison-modal-body {
    padding: 32px 24px;
}

.comparison-modal-title {
    font-size: 20px;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 24px;
    text-align: center;
}

.comparison-options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.comparison-option-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: white;
    border: 2px solid #f1f5f9;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.comparison-option-card:hover {
    border-color: #3b82f6;
    background: #f8f1ff;
    transform: translateY(-2px);
}

.comparison-option-card.qty:hover {
    border-color: #6366f1;
    background: #f0f9ff;
}

.comparison-option-icon-wrapper {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.comparison-option-icon-wrapper.doc {
    background: #dbeafe;
    color: #2563eb;
}

.comparison-option-icon-wrapper.qty {
    background: #e0e7ff;
    color: #4f46e5;
}

.comparison-option-label {
    font-weight: 700;
    color: #1e293b;
    font-size: 15px;
}

.comparison-option-desc {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 4px;
}

.comparison-modal-footer {
    padding: 24px;
    text-align: center;
    border-top: 1px solid #f1f5f9;
}

.comparison-modal-cancel-btn {
    padding: 12px 48px;
    background: white;
    color: #475569;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.comparison-modal-cancel-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #1e293b;
}

/* 5. 検索結果・カード関連 */
.update-info-badge {
    font-size: 13px;
    font-weight: 500;
    color: #4b5563;
    background: #e5e7eb;
    padding: 2px 10px;
    border-radius: 12px;
    border: 1px solid #d1d5db;
}

.sort-select-wrapper {
    display: flex;
    align-items: center;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 2px 8px;
    gap: 8px;
}

.sort-select-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.sort-select-field {
    border: none;
    padding: 4px;
    font-size: 13px;
    outline: none;
    background: transparent;
}

.sort-direction-btn {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    width: 24px;
    height: 24px;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.sort-direction-btn:hover {
    background: #f1f5f9;
}

/* カード内価格セクション */
.price-tag-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    padding-top: 4px;
}

/* --- Search Results Table --- */
.results-table-wrapper {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 600px;
}

.results-table {
    min-width: max-content;
    width: 100%;
    background: white;
}

.results-table th {
    padding: 0 !important;
    position: sticky;
    top: 0;
    background: white;
    z-index: 2;
    border-bottom: 2px solid #f1f5f9;
}

.results-table th button {
    width: 100%;
    height: 100%;
    padding: 12px 16px;
    background: transparent;
    border: none;
    font-weight: 600;
    color: #4b5563;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    cursor: pointer;
    transition: background 0.2s;
}

.results-table th .th-static-text {
    width: 100%;
    height: 100%;
    padding: 12px 16px;
    font-weight: 600;
    color: #4b5563;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.results-table th button:hover {
    background: #f8fafc;
}

.results-table th button .material-icons {
    font-size: 16px;
    margin-left: 4px;
    color: #6366f1;
}

.th-price-sublabel {
    font-size: 11px;
    color: #6b7280;
    font-weight: 400;
}

.th-price-mainlabel {
    display: flex;
    align-items: center;
}

.th-sticky-top {
    padding: 0 !important;
    position: sticky;
    top: 0;
    background: white;
    z-index: 2;
    border-bottom: 2px solid #f1f5f9;
}

.results-table th .th-scroll-hint {
    margin-left: auto;
    color: #94a3b8;
}

/* Sticky Columns */
.th-checkbox,
.td-checkbox {
    position: sticky !important;
    left: 0 !important;
    width: 80px !important;
    min-width: 80px !important;
    max-width: 80px !important;
    background: white !important;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.05);
}

.th-checkbox {
    z-index: 3 !important;
    top: 0 !important;
    padding-top: 8px !important;
    padding-bottom: 8px !important;
}

.td-checkbox {
    z-index: 2 !important;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle !important;
}

.th-name,
.td-name {
    position: sticky !important;
    left: 80px !important;
    width: 256px !important;
    min-width: 256px !important;
    max-width: 256px !important;
    background: white !important;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.05);
}

.th-name {
    z-index: 3 !important;
    top: 0 !important;
}

.td-name {
    z-index: 2 !important;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle !important;
}

.th-manufacturer,
.td-manufacturer {
    position: sticky !important;
    left: 336px !important;
    width: 200px !important;
    min-width: 200px !important;
    max-width: 200px !important;
    background: white !important;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.05);
}

.th-manufacturer {
    z-index: 3 !important;
    top: 0 !important;
}

.td-manufacturer {
    z-index: 2 !important;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle !important;
}

.th-type,
.td-type {
    position: sticky !important;
    left: 536px !important;
    width: 80px !important;
    min-width: 80px !important;
    max-width: 80px !important;
    background: white !important;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.05);
}

.th-type {
    z-index: 3 !important;
    top: 0 !important;
}

.td-type {
    z-index: 2 !important;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle !important;
}

.th-price-fixed,
.td-price-fixed {
    position: sticky !important;
    left: 616px !important;
    width: 150px !important;
    min-width: 150px !important;
    max-width: 150px !important;
    background: white !important;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.05);
}

.th-price-fixed {
    z-index: 4 !important;
    top: 0 !important;
}

.td-price-fixed {
    z-index: 3 !important;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle !important;
}

.th-action,
.td-action {
    position: sticky !important;
    right: 0 !important;
    width: 64px !important;
    min-width: 64px !important;
    max-width: 64px !important;
    background: white !important;
    box-shadow: -2px 0 4px rgba(0, 0, 0, 0.05);
}

.td-action {
    z-index: 10 !important;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle !important;
}

.th-action {
    z-index: 20 !important;
    top: 0 !important;
}

.td-links {
    width: 200px;
    min-width: 200px;
}

.td-links-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.share-link-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f1f5f9;
    color: #475569;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    /* <button> リセット */
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
}

.share-link-circle:hover {
    background: #e2e8f0;
    color: #2563eb;
    transform: translateY(-1px);
}

.detail-link-circle {
    background: #eff6ff;
    color: #2563eb;
}

.detail-link-circle:hover {
    background: #2563eb;
    color: #fff !important;
}

.sns-buttons-inline {
    display: flex;
    gap: 6px;
    margin-left: 4px;
}

.share-link-sns {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

.share-link-sns:hover {
    opacity: 0.8;
    transform: scale(1.05);
}

.share-link-sns svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

.x-share {
    background: #000;
    color: #fff;
}

.line-share {
    background: #06C755;
    color: #fff;
}

.material-icons {
    font-size: 18px;
}

.results-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

/* Comparison Modal */
.comparison-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    overflow-y: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.comparison-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
}

.comparison-modal-content {
    position: relative;
    background: white;
    border-radius: 24px;
    width: 100%;
    max-width: 500px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: modal-in 0.3s ease-out;
}

.comparison-modal-body {
    padding: 32px 24px;
}

.comparison-modal-title {
    font-size: 20px;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 24px;
    text-align: center;
}

.comparison-options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.comparison-option-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: white;
    border: 2px solid #f1f5f9;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.comparison-option-card:hover {
    border-color: #3b82f6;
    background: #f8f1ff;
    transform: translateY(-2px);
}

.comparison-option-card.qty:hover {
    border-color: #6366f1;
    background: #f0f9ff;
}

.comparison-option-icon-wrapper {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.comparison-option-icon-wrapper.doc {
    background: #dbeafe;
    color: #2563eb;
}

.comparison-option-icon-wrapper.qty {
    background: #e0e7ff;
    color: #4f46e5;
}

.comparison-option-label {
    font-weight: 700;
    color: #1e293b;
    font-size: 15px;
}

.comparison-option-desc {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 4px;
}

.comparison-modal-footer {
    padding: 24px;
    text-align: center;
    border-top: 1px solid #f1f5f9;
}

.comparison-modal-cancel-btn {
    padding: 12px 48px;
    background: white;
    color: #475569;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.comparison-modal-cancel-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #1e293b;
}

@keyframes modal-in {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.td-prescribed-volume {
    font-size: 0.82em;
    display: block;
    margin-top: 4px;
    white-space: nowrap;
    color: #374151;
    font-weight: 500;
}

.badge-transition {
    background: #fef3c7;
    color: #92400e;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
}

.rate-text {
    font-weight: 600;
}

.td-change-rate {
    text-align: center;
    white-space: nowrap;
}

.suggestion-box {
    margin-bottom: 24px;
    padding: 16px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    text-align: left;
}

.suggestion-label {
    font-size: 14px;
    color: #0369a1;
    font-weight: 600;
}

.suggestion-btn {
    background: none;
    border: none;
    padding: 0;
    color: #2563eb;
    font-size: 16px;
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
    transition: color 0.2s;
    margin-right: 2px;
}

.suggestion-btn:hover {
    color: #1d4ed8;
}

.sns-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
}

.sns-buttons svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.manufacturer-btn {
    background: none;
    border: none;
    padding: 0;
    font-size: 14px;
    color: #2563eb;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s;
    text-align: left;
}

.manufacturer-btn:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.manufacturer-btn .material-icons {
    font-size: 14px;
}

/* Detail Modal Styles */
.detail-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
}

.detail-modal-content {
    background: white;
    border-radius: 20px;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: modal-in 0.3s ease-out;
}

.detail-modal-header {
    background: white;
    padding: 20px 24px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.detail-modal-title {
    font-size: 18px;
    font-weight: 800;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
}

.detail-modal-close {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    background: #f8fafc;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.detail-modal-close:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.detail-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    background: #f8fafc;
}

.detail-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 24px;
}

.detail-card-title {
    font-size: 16px;
    font-weight: 700;
    color: #334155;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f1f5f9;
}

.detail-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.detail-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.detail-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.detail-grid-1 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.detail-item-label {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 6px;
    font-weight: 500;
}

.detail-item-value {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    word-break: break-word;
    overflow-wrap: break-word;
}

.history-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.history-table th {
    background: #f8fafc;
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    text-align: left;
    border-bottom: 2px solid #f1f5f9;
}

.history-table td {
    padding: 12px 16px;
    font-size: 14px;
    color: #334155;
    border-bottom: 1px solid #f1f5f9;
}

.history-table tr:hover td {
    background-color: #f8fafc;
}

.badge-yj {
    background: #f1f5f9;
    color: #475569;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 13px;
}

/* Warning Modal Styles */
.warning-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    overflow-y: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.warning-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
}

.warning-modal-content {
    position: relative;
    background: white;
    border-radius: 20px;
    width: 100%;
    max-width: 400px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: modal-in 0.3s ease-out;
}

.warning-modal-body {
    padding: 32px 24px;
    text-align: center;
}

.warning-modal-icon-wrapper {
    width: 64px;
    height: 64px;
    background: #fffbeb;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.warning-modal-title {
    font-size: 20px;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 12px;
}

.warning-modal-desc {
    font-size: 15px;
    color: #64748b;
    line-height: 1.6;
}

.warning-modal-footer {
    padding: 16px 24px;
    background: #f8fafc;
    display: flex;
    justify-content: center;
}

.warning-modal-ok-btn {
    width: 100%;
    background: #2563eb;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

.warning-icon {
    font-size: 32px;
    color: #f59e0b;
}

.th-common-sticky {
    padding: 0;
    position: sticky;
    top: 0;
    background: white;
    z-index: 2;
}

.badge-sm {
    font-size: 11px;
    padding: 2px 6px;
}

.sns-icon-x {
    width: 20px;
    height: 20px;
    fill: #0f1419;
}

.sns-icon-line {
    width: 20px;
    height: 20px;
    fill: #06C755;
}

.th-sort-btn {
    width: 100%;
    height: 100%;
    padding: 12px 16px;
    background: transparent;
    border: none;
    font-weight: 600;
    color: #4b5563;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    cursor: pointer;
    transition: background 0.2s;
}

.th-sort-btn-center {
    width: 100%;
    height: 100%;
    padding: 12px 16px;
    background: transparent;
    border: none;
    font-weight: 600;
    color: #4b5563;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.th-sort-btn-center:hover {
    background: #f8fafc;
}

.th-sort-btn-column {
    width: 100%;
    height: 100%;
    padding: 12px 16px;
    background: transparent;
    border: none;
    font-weight: 600;
    color: #4b5563;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.th-sort-btn-column:hover {
    background: #f8fafc;
}

.sort-btn-sub {
    font-size: 11px;
    color: #64748b;
    font-weight: 400;
}

.sort-btn-main {
    display: flex;
    align-items: center;
}

.info-icon-blue {
    color: #0ea5e9;
}

.info-icon-purple {
    color: #7c3aed;
}

.title-icon {
    color: #3b82f6;
    font-size: 24px;
}

.marker-separator {
    margin-right: 8px;
    color: #94a3b8;
}

.help-marker {
    font-size: 16px;
    font-weight: 700;
    color: #0369a1;
    margin-left: 4px;
}

/* Detail Modal Tabs */
.detail-modal-tabs {
    display: flex;
    background: white;
    padding: 0 24px;
    border-bottom: 1px solid #f1f5f9;
    gap: 24px;
}

.detail-tab-btn {
    padding: 16px 4px;
    font-size: 14px;
    font-weight: 700;
    color: #64748b;
    border: none;
    background: none;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

.detail-tab-btn:hover {
    color: #3b82f6;
}

.detail-tab-btn.active {
    color: #3b82f6;
}

.detail-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 3px;
    background: #3b82f6;
    border-radius: 3px 3px 0 0;
}

/* Document Content Styles */
.document-section {
    margin-bottom: 32px;
}

.document-section-title {
    font-size: 15px;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.document-text {
    font-size: 14px;
    line-height: 1.8;
    color: #475569;
    background: white;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid #f1f5f9;
}

.warning-box {
    border-left: 4px solid #ef4444;
}

.warning-title {
    color: #ef4444;
}

.contra-box {
    border-left: 4px solid #f97316;
}

.contra-title {
    color: #f97316;
}

.no-document {
    padding: 48px;
    text-align: center;
    color: #94a3b8;
    font-size: 15px;
}

/* =============================================
   詳細モーダル レスポンシブ対応
   ============================================= */

/* タブレット (768px以下) */
@media (max-width: 768px) {
    .detail-modal-overlay {
        padding: 8px;
        z-index: 3000;
    }

    .detail-modal-content {
        max-width: 100%;
        max-height: 95vh;
        border-radius: 16px;
    }

    .detail-modal-header {
        padding: 16px;
    }

    .detail-modal-title {
        font-size: 15px;
        gap: 8px;
        min-width: 0;
        overflow: hidden;
    }

    .detail-modal-title .title-icon {
        font-size: 20px;
        flex-shrink: 0;
    }

    .detail-modal-body {
        padding: 16px;
    }

    .detail-card {
        padding: 16px;
        border-radius: 12px;
        margin-bottom: 16px;
    }

    .detail-card-title {
        font-size: 14px;
        margin-bottom: 14px;
    }

    .detail-grid-4 {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .detail-grid-3 {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .detail-modal-tabs {
        padding: 0 16px;
        gap: 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .detail-tab-btn {
        padding: 12px 12px;
        font-size: 13px;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .document-section {
        padding: 14px;
        border-radius: 10px;
    }

    .document-text {
        padding: 12px;
        font-size: 13px;
        border-radius: 8px;
    }

    .history-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }

    .history-table th,
    .history-table td {
        padding: 10px 12px;
        font-size: 12px;
    }
}

/* スマホ (480px以下) */
@media (max-width: 480px) {
    .detail-modal-overlay {
        padding: 0;
        align-items: flex-end;
    }

    .detail-modal-content {
        max-width: 100%;
        max-height: 100vh;
        height: 100vh;
        border-radius: 0;
        animation: modal-slide-up 0.3s ease-out;
    }

    .detail-modal-header {
        padding: 12px 16px;
        gap: 8px;
    }

    .detail-modal-title {
        font-size: 14px;
        gap: 6px;
        flex: 1;
        min-width: 0;
    }

    .detail-modal-title .title-icon {
        font-size: 18px;
    }

    .detail-modal-close {
        width: 32px;
        height: 32px;
        border-radius: 8px;
        flex-shrink: 0;
    }

    .detail-modal-close .material-icons {
        font-size: 20px;
    }

    .detail-modal-body {
        padding: 12px;
    }

    .detail-card {
        padding: 12px;
        border-radius: 10px;
        margin-bottom: 12px;
    }

    .detail-card-title {
        font-size: 13px;
        margin-bottom: 12px;
        padding-bottom: 10px;
    }

    .detail-grid-4 {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .detail-grid-3 {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .detail-item {
        flex-direction: column;
        gap: 2px;
        padding: 6px 0;
    }

    .detail-item-label {
        font-size: 11px;
        margin-bottom: 2px;
    }

    .detail-item-value {
        font-size: 14px;
        word-break: break-word;
    }

    .detail-modal-tabs {
        padding: 0 12px;
        gap: 0;
    }

    .detail-tab-btn {
        padding: 10px 10px;
        font-size: 12px;
    }

    .document-section {
        padding: 12px;
        margin-bottom: 20px;
    }

    .document-section-title {
        font-size: 13px;
        gap: 6px;
    }

    .document-section-title .material-icons {
        font-size: 16px;
    }

    .document-text {
        padding: 10px;
        font-size: 13px;
        line-height: 1.7;
    }

    .document-subsection-title {
        font-size: 12px;
    }

    .document-content {
        gap: 16px;
    }

    .no-document {
        padding: 32px 16px;
        font-size: 14px;
    }

    .badge-yj {
        font-size: 12px;
        padding: 2px 6px;
    }

    .price-highlight {
        font-size: 16px;
    }
}

@keyframes modal-slide-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}