/* 基本レイアウト */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #F8F9FA;
  color: #222;
}

.app-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

/* アプリヘッダー */
.app-header {
  text-align: center;
  margin-bottom: 2rem;
}

.app-header h1 {
  font-size: 2.5rem;
  margin: 0 0 0.5rem 0;
  color: #333;
}

.app-header p {
  font-size: 1.1rem;
  color: #666;
  margin: 0;
}

.language-switch {
  display: flex;
  justify-content: center;
  margin-top: 0.9rem;
}

.language-switch a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.55rem 1rem;
  border: 2px solid #4A90E2;
  border-radius: 8px;
  background: #fff;
  color: #245f9e;
  font-weight: 700;
  text-decoration: none;
}

.language-switch a:hover,
.language-switch a:focus-visible {
  background: #e8f1fb;
}

/* タブナビゲーション */
.tab-navigation {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 2rem;
  padding-top: 0.5rem;
  padding-bottom: 1rem;
  border-bottom: 3px solid #e0e0e0;
  overflow-x: auto;
  overflow-y: visible;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #4A90E2 #f0f0f0;
}

.tab-navigation::-webkit-scrollbar {
  height: 6px;
}

.tab-navigation::-webkit-scrollbar-track {
  background: #f0f0f0;
  border-radius: 3px;
}

.tab-navigation::-webkit-scrollbar-thumb {
  background: #4A90E2;
  border-radius: 3px;
}

.tab-navigation::-webkit-scrollbar-thumb:hover {
  background: #357ABD;
}

.tab-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 0.75rem 1.5rem;
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 500;
  color: #555;
  transition: all 0.25s ease;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 90px;
  position: relative;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.tab-btn:hover {
  background: #f8f9fa;
  border-color: #4A90E2;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(74, 144, 226, 0.15);
}

.tab-btn:focus {
  outline: 2px solid #4A90E2;
  outline-offset: 2px;
}

.tab-btn.active {
  background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
  color: white;
  border-color: #357ABD;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.tab-btn.active .tab-number {
  background: rgba(255, 255, 255, 0.3);
  color: white;
}

.tab-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: #e0e0e0;
  border-radius: 50%;
  font-size: 0.85rem;
  font-weight: 700;
  color: #555;
  transition: all 0.25s ease;
}

.tab-text {
  font-size: 0.9rem;
  line-height: 1.2;
}

/* タブコンテンツ */
.tab-content {
  display: none;
  min-width: 0;
  animation: fadeIn 0.3s ease;
}

.tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* セクションヘッダー */
.section-header {
  text-align: center;
  margin-bottom: 2rem;
}

.section-header h2 {
  font-size: 2rem;
  margin: 0 0 0.5rem 0;
  color: #333;
}

.section-header p {
  color: #666;
  font-size: 1.05rem;
}

.fh-header h2 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  color: #333;
}

.fh-header p {
  color: #666;
  font-size: 1.05rem;
}

/* 解説テキスト */
.intro-text {
  font-size: 1.1rem;
  line-height: 1.8;
  color: #555;
  margin-bottom: 2rem;
}

/* 属性カードグリッド */
.attribute-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.attribute-card {
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: 8px;
  border-left: 4px solid #4A90E2;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.attribute-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.attribute-card h4 {
  font-size: 1.3rem;
  color: #333;
  margin-top: 0;
  margin-bottom: 1rem;
}

.attribute-card p {
  line-height: 1.7;
  color: #555;
  margin-bottom: 0.8rem;
}

.attribute-card .range-info {
  background: white;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-weight: 600;
  color: #2c6ba8;
  display: inline-block;
  margin: 0.5rem 0;
}

.attribute-card ul {
  margin: 1rem 0 0 0;
  padding-left: 1.5rem;
  line-height: 1.8;
  color: #666;
}

.attribute-card li {
  margin-bottom: 0.4rem;
}

.color-samples {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.sample-box {
  flex: 1;
  min-width: 70px;
  height: 70px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease;
  cursor: pointer;
}

.sample-box:hover {
  transform: scale(1.05) translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.sample-box span {
  font-size: 0.75rem;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  color: black;
}

/* メインアコーディオンセクション */
.main-accordion-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* メインアコーディオン */
.main-accordion {
  background: white;
  border: 3px solid #4A90E2;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
}

.main-accordion:hover {
  box-shadow: 0 4px 16px rgba(74, 144, 226, 0.2);
  transform: translateY(-2px);
}

.main-accordion > summary {
  cursor: pointer;
  padding: 1.5rem 2rem;
  background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
  font-weight: 700;
  font-size: 1.4rem;
  color: white;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 1rem;
  user-select: none;
  transition: all 0.25s ease;
}

.main-accordion > summary::-webkit-details-marker {
  display: none;
}

.main-accordion > summary::before {
  content: '▼';
  font-size: 1.1rem;
  color: white;
  transition: transform 0.3s ease;
}

.main-accordion:not([open]) > summary::before {
  transform: rotate(-90deg);
}

.main-accordion > summary:hover {
  background: linear-gradient(135deg, #357ABD 0%, #2c6ba8 100%);
}

.main-accordion > .accordion-content {
  padding: 2rem;
  background: white;
  animation: slideDown 0.3s ease;
}

/* サブアコーディオン */
.sub-accordion {
  margin-bottom: 1rem;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.sub-accordion:hover {
  border-color: #4A90E2;
  box-shadow: 0 2px 8px rgba(74, 144, 226, 0.1);
}

.sub-accordion summary {
  cursor: pointer;
  padding: 1rem 1.5rem;
  background: #f8f9fa;
  font-weight: 600;
  font-size: 1.05rem;
  color: #333;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  user-select: none;
  transition: all 0.25s ease;
}

.sub-accordion summary::-webkit-details-marker {
  display: none;
}

.sub-accordion summary::before {
  content: '▶';
  font-size: 0.9rem;
  color: #4A90E2;
  transition: transform 0.3s ease;
}

.sub-accordion[open] summary::before {
  transform: rotate(90deg);
}

.sub-accordion summary:hover {
  background: #e9ecef;
}

.sub-accordion[open] summary {
  background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
  color: white;
}

.sub-accordion[open] summary::before {
  color: white;
}

/* 色相環 */
.color-wheel-container {
  position: relative;
  width: 400px;
  height: 400px;
  max-width: 95vw;
  margin: 3rem auto;
}

.color-wheel {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 65%;
  height: 65%;
  border-radius: 50%;
  background: conic-gradient(
    hsl(0, 100%, 50%) 0deg,
    hsl(30, 100%, 50%) 30deg,
    hsl(60, 100%, 50%) 60deg,
    hsl(90, 100%, 50%) 90deg,
    hsl(120, 100%, 50%) 120deg,
    hsl(150, 100%, 50%) 150deg,
    hsl(180, 100%, 50%) 180deg,
    hsl(210, 100%, 50%) 210deg,
    hsl(240, 100%, 50%) 240deg,
    hsl(270, 100%, 50%) 270deg,
    hsl(300, 100%, 50%) 300deg,
    hsl(330, 100%, 50%) 330deg,
    hsl(360, 100%, 50%) 360deg
  );
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2),
              inset 0 0 0 2px rgba(255, 255, 255, 0.3);
}

.color-wheel::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40%;
  height: 40%;
  background: white;
  border-radius: 50%;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.color-wheel-labels {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.wheel-label {
  position: absolute;
  font-size: 0.85rem;
  font-weight: 600;
  color: #333;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.9);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* 補色用の色相環 */
.complementary-wheel-container {
  position: relative;
  max-width: 300px;
  margin: 2rem auto;
}

.complementary-wheel-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  cursor: crosshair;
}

.complementary-wheel-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: conic-gradient(
    hsl(0, 100%, 50%) 0deg,
    hsl(30, 100%, 50%) 30deg,
    hsl(60, 100%, 50%) 60deg,
    hsl(90, 100%, 50%) 90deg,
    hsl(120, 100%, 50%) 120deg,
    hsl(150, 100%, 50%) 150deg,
    hsl(180, 100%, 50%) 180deg,
    hsl(210, 100%, 50%) 210deg,
    hsl(240, 100%, 50%) 240deg,
    hsl(270, 100%, 50%) 270deg,
    hsl(300, 100%, 50%) 300deg,
    hsl(330, 100%, 50%) 330deg,
    hsl(360, 100%, 50%) 360deg
  );
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease;
}

.complementary-wheel-wrapper:hover .complementary-wheel-bg {
  transform: scale(1.02);
}

.complementary-wheel-segments {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
}

.wheel-segment {
  position: absolute;
  top: 0;
  left: 50%;
  width: 50%;
  height: 50%;
  transform-origin: left bottom;
  background: transparent;
  transition: background 0.2s ease;
  clip-path: polygon(0 100%, 100% 100%, 100% 0);
  pointer-events: all;
}

.wheel-segment.dimmed {
  background: rgba(0, 0, 0, 0.7);
}

.wheel-segment.highlighted {
  background: rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.8);
}

.complementary-wheel-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40%;
  height: 40%;
  background: white;
  border-radius: 50%;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  pointer-events: none;
  z-index: 10;
}

.wheel-instruction {
  text-align: center;
  font-size: 0.9rem;
  color: #666;
  margin-top: 1rem;
  font-style: italic;
}

.complementary-example,
.analogous-example {
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.complementary-example:hover,
.analogous-example:hover {
  background: rgba(74, 144, 226, 0.1);
  color: #4A90E2;
}

/* 類似色相用の色相環 */
.analogous-wheel-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  cursor: crosshair;
}

.analogous-wheel-wrapper .complementary-wheel-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: conic-gradient(
    hsl(0, 100%, 50%) 0deg,
    hsl(30, 100%, 50%) 30deg,
    hsl(60, 100%, 50%) 60deg,
    hsl(90, 100%, 50%) 90deg,
    hsl(120, 100%, 50%) 120deg,
    hsl(150, 100%, 50%) 150deg,
    hsl(180, 100%, 50%) 180deg,
    hsl(210, 100%, 50%) 210deg,
    hsl(240, 100%, 50%) 240deg,
    hsl(270, 100%, 50%) 270deg,
    hsl(300, 100%, 50%) 300deg,
    hsl(330, 100%, 50%) 330deg,
    hsl(360, 100%, 50%) 360deg
  );
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease;
}

.analogous-wheel-wrapper:hover .complementary-wheel-bg {
  transform: scale(1.02);
}

.analogous-wheel-segments {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
}

/* 明度のデモ */
.lightness-demo {
  margin: 2rem 0;
}

.lightness-bar {
  display: flex;
  gap: 0.5rem;
  margin: 1.5rem 0;
  flex-wrap: wrap;
  justify-content: center;
}

.lightness-sample {
  flex: 1;
  min-width: 70px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.85rem;
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease;
}

.lightness-sample:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.demo-caption {
  text-align: center;
  font-size: 0.9rem;
  color: #666;
  font-style: italic;
  margin-top: 1rem;
}

/* 明度の例カード */
.lightness-examples {
  margin: 2rem 0;
}

.lightness-card {
  background: #f8f9fa;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.color-sample-large {
  width: 100%;
  max-width: 300px;
  height: 150px;
  margin: 0 auto 1.5rem;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.lightness-card h4 {
  font-size: 1.3rem;
  color: #333;
  margin-top: 0;
  margin-bottom: 1rem;
  border-bottom: 2px solid #4A90E2;
  padding-bottom: 0.5rem;
}

.lightness-card ul {
  line-height: 2;
  margin: 1rem 0;
}

.lightness-card li {
  margin-bottom: 0.5rem;
}

.usage-note {
  background: white;
  padding: 1rem;
  border-radius: 8px;
  border-left: 4px solid #4A90E2;
  margin-top: 1.5rem;
  font-size: 0.95rem;
}

/* 明度のヒント */
.lightness-tips {
  margin: 2rem 0;
}

.tip-item {
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  border-left: 4px solid #4A90E2;
}

.tip-item h4 {
  margin-top: 0;
  margin-bottom: 1rem;
  color: #333;
  font-size: 1.1rem;
}

.tip-item p {
  margin: 0.5rem 0;
}

.tip-item ul {
  margin: 1rem 0;
  padding-left: 2rem;
}

.tip-item li {
  margin-bottom: 0.5rem;
}

/* コントラストの例 */
.contrast-examples {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

.contrast-good,
.contrast-bad {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* 彩度の警告と情報 */
.saturation-warning {
  background: #fff3cd;
  border-left: 4px solid #ffc107;
  padding: 1.5rem;
  border-radius: 8px;
  margin-top: 2rem;
}

.saturation-warning h4 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  color: #856404;
}

.saturation-warning p {
  margin: 0;
  color: #856404;
}

.saturation-info {
  background: #d1ecf1;
  border-left: 4px solid #17a2b8;
  padding: 1.5rem;
  border-radius: 8px;
  margin-top: 2rem;
}

.saturation-info h4 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  color: #0c5460;
}

.saturation-info p {
  margin: 0;
  color: #0c5460;
}

/* 彩度比率のデモ */
.saturation-ratio-demo {
  margin: 1.5rem 0;
}

.ratio-bar {
  display: flex;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.ratio-segment {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-weight: 600;
  transition: transform 0.2s ease;
}

.ratio-segment:hover {
  transform: scale(1.05);
  z-index: 1;
}

.ratio-segment span {
  padding: 0.5rem;
}

/* 彩度と明度のグリッド */
.saturation-lightness-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-top: 1.5rem;
}

.sl-cell {
  padding: 2rem 1rem;
  border-radius: 8px;
  text-align: center;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sl-cell:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.sl-cell span {
  display: block;
  line-height: 1.6;
}

.sl-cell small {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  font-weight: 400;
  opacity: 0.9;
}

/* タブ2: 無彩色専用スタイル */
.achromatic-demo {
  margin: 2rem 0;
}

.achromatic-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
  gap: 0.5rem;
  margin: 1.5rem 0;
}

.achromatic-sample {
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.8rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease;
  text-align: center;
  line-height: 1.4;
}

.achromatic-sample:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.achromatic-features {
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: 8px;
  margin-top: 2rem;
}

.achromatic-features h4 {
  margin-top: 0;
  margin-bottom: 1rem;
  color: #333;
  font-size: 1.2rem;
}

.achromatic-features ul {
  margin: 0;
  padding-left: 1.5rem;
  line-height: 2;
}

/* グレースケールインタラクティブ */
.grayscale-interactive {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin: 2rem 0;
  padding: 2rem;
  background: #f8f9fa;
  border-radius: 12px;
}

.grayscale-preview {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.grayscale-chip {
  width: 100%;
  height: 250px;
  border-radius: 12px;
  background: hsl(0, 0%, 50%);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: background 0.3s ease;
}

.grayscale-info {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid #e9ecef;
}

.info-row:last-child {
  border-bottom: none;
}

.info-label {
  font-weight: 600;
  color: #666;
}

.info-value {
  font-family: 'Courier New', monospace;
  color: #333;
  font-weight: 600;
}

.grayscale-controls {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.grayscale-controls label {
  font-weight: 600;
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.grayscale-controls input[type="range"] {
  width: 100%;
  margin-bottom: 2rem;
  touch-action: none;
}

.grayscale-presets {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.preset-btn {
  padding: 0.75rem 1.5rem;
  border: 2px solid #4A90E2;
  background: white;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.preset-btn:hover {
  background: #4A90E2;
  color: white;
  transform: translateX(4px);
}

/* 無彩色の役割 */
.role-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.role-card {
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.role-card h4 {
  margin-top: 0;
  margin-bottom: 1rem;
  color: #333;
  font-size: 1.2rem;
}

.role-card > p {
  font-size: 0.95rem;
  color: #666;
  line-height: 1.7;
}

.role-demo,
.role-demo-bg,
.role-demo-ui,
.role-demo-accent {
  margin: 1rem 0;
}

/* WCAGテーブル */
.wcag-info {
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: 8px;
  margin: 2rem 0;
}

.wcag-info h4 {
  margin-top: 0;
  margin-bottom: 1rem;
  color: #333;
}

.wcag-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  background: white;
  border-radius: 8px;
  overflow: hidden;
}

.wcag-table th,
.wcag-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid #e9ecef;
}

.wcag-table th {
  background: #4A90E2;
  color: white;
  font-weight: 600;
}

.wcag-table tbody tr:last-child td {
  border-bottom: none;
}

.wcag-table-note {
  margin: 0.75rem 0 0;
  color: #475569;
  font-size: 0.9rem;
  line-height: 1.6;
}

.wcag-info {
  max-width: 100%;
  overflow-x: auto;
}

.contrast-checker {
  margin: 2rem 0;
  padding: 1.25rem;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #f8fafc;
}

.contrast-checker h4 {
  margin: 0 0 0.5rem;
}

.contrast-input-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin: 1rem 0;
}

.contrast-color-control {
  display: grid;
  gap: 0.5rem;
  min-width: 0;
  font-weight: 600;
}

.contrast-input-row {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr);
  gap: 0.5rem;
}

.contrast-input-row input[type="color"] {
  width: 3rem;
  height: 2.75rem;
  padding: 0.2rem;
  border: 1px solid #94a3b8;
  border-radius: 8px;
  background: #fff;
}

.contrast-input-row input[type="text"] {
  min-width: 0;
  height: 2.75rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid #94a3b8;
  border-radius: 8px;
  font: inherit;
  text-transform: uppercase;
}

.contrast-swap {
  min-height: 2.75rem;
  padding: 0.6rem 1rem;
  align-self: end;
  border: 1px solid #64748b;
  border-radius: 8px;
  background: #fff;
  color: #1e293b;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.contrast-swap:hover,
.contrast-swap:focus-visible {
  border-color: #2563eb;
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
}

.contrast-error {
  min-height: 1.5em;
  margin: 0.5rem 0;
  color: #b91c1c;
  font-weight: 600;
}

.contrast-error:empty {
  display: none;
}

/* 読み上げ専用（live 領域など）。見た目には出さない */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.contrast-preview-live {
  display: grid;
  gap: 0.4rem;
  padding: 1.25rem;
  border: 1px solid #94a3b8;
  border-radius: 8px;
}

.accordion-content .contrast-preview-live strong,
.accordion-content .contrast-preview-live span,
.accordion-content .contrast-suggestion-preview strong,
.accordion-content .contrast-suggestion-preview span {
  color: inherit;
}

.contrast-result > p {
  font-size: 1.1rem;
  font-weight: 600;
}

.contrast-target-control {
  display: grid;
  gap: 0.5rem;
  margin: 1rem 0;
  font-weight: 600;
}

.contrast-target-control select {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.55rem 2.25rem 0.55rem 0.75rem;
  border: 1px solid #64748b;
  border-radius: 8px;
  background: #fff;
  color: #0f172a;
  font: inherit;
}

.contrast-target-control select:focus-visible {
  outline: 3px solid #93c5fd;
  outline-offset: 2px;
}

.contrast-target-status {
  padding: 0.75rem;
  border-left: 4px solid currentColor;
  border-radius: 6px;
}

.contrast-target-status.pass {
  color: #166534;
  background: #dcfce7;
}

.contrast-target-status.fail {
  color: #991b1b;
  background: #fee2e2;
}

#contrast-ratio {
  font-size: 1.35rem;
}

.contrast-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.contrast-badges span {
  padding: 0.45rem 0.65rem;
  border-radius: 999px;
  border: 1px solid currentColor;
  font-size: 0.85rem;
  font-weight: 700;
}

.contrast-badges .pass {
  color: #166534;
  background: #dcfce7;
}

.contrast-badges .fail {
  color: #991b1b;
  background: #fee2e2;
}

.contrast-suggestion {
  margin-top: 1rem;
  padding: 1rem;
  border: 2px solid #d97706;
  border-radius: 10px;
  background: #fffbeb;
}

.contrast-suggestion[hidden] {
  display: none;
}

.contrast-suggestion h5 {
  margin: 0 0 0.75rem;
  color: #78350f;
  font-size: 1rem;
}

.contrast-suggestion-preview {
  display: grid;
  gap: 0.35rem;
  padding: 1rem;
  border: 1px solid #64748b;
  border-radius: 8px;
}

.contrast-suggestion-values {
  display: grid;
  gap: 0.5rem;
  margin: 1rem 0;
}

.contrast-suggestion-values div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.contrast-suggestion-values dt {
  font-weight: 600;
}

.contrast-suggestion-values dd {
  margin: 0;
}

.contrast-suggestion-values code,
.contrast-suggestion-values output {
  font-size: 1rem;
  font-weight: 700;
}

.contrast-suggestion-note {
  color: #78350f;
  line-height: 1.6;
}

.contrast-suggestion-actions {
  display: grid;
  gap: 0.75rem;
}

.contrast-suggestion-actions button {
  min-height: 2.75rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid #92400e;
  border-radius: 8px;
  background: #fff;
  color: #78350f;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.contrast-suggestion-actions button:first-child {
  background: #92400e;
  color: #fff;
}

.contrast-suggestion-actions button:hover,
.contrast-suggestion-actions button:focus-visible {
  outline: 3px solid #fbbf24;
  outline-offset: 2px;
}

.contrast-limit {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border-left: 4px solid #2563eb;
  border-radius: 6px;
  background: #eff6ff;
  color: #475569;
  font-size: 0.9rem;
  line-height: 1.6;
}

.contrast-limit p {
  margin: 0 0 0.75rem;
}

.contrast-limit p:last-child {
  margin-bottom: 0;
}

.contrast-examples-achromatic {
  margin: 2rem 0;
}

.contrast-examples-achromatic h4 {
  margin-bottom: 1.5rem;
  color: #333;
}

.contrast-demo {
  margin-bottom: 1.5rem;
}

.contrast-note {
  font-size: 0.9rem;
  color: #666;
  margin: 0.5rem 0 0 0;
  font-style: italic;
}

.good-contrast > div {
  border-left: 4px solid #28a745;
}

.ok-contrast > div {
  border-left: 4px solid #ffc107;
}

.bad-contrast > div {
  border-left: 4px solid #dc3545;
}

.accessibility-tips {
  background: #d1ecf1;
  border-left: 4px solid #17a2b8;
  padding: 1.5rem;
  border-radius: 8px;
  margin-top: 2rem;
}

.accessibility-tips h4 {
  margin-top: 0;
  margin-bottom: 1rem;
  color: #0c5460;
}

.accessibility-tips ul {
  margin: 0;
  padding-left: 1.5rem;
  line-height: 2;
  color: #0c5460;
}

/* モノクロデザイン */
.monochrome-benefits {
  margin: 2rem 0;
}

.monochrome-benefits h4 {
  margin-bottom: 1.5rem;
  color: #333;
}

.benefit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

.benefit-card {
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.benefit-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.benefit-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 1rem;
}

.benefit-card h5 {
  margin: 0 0 0.75rem 0;
  color: #333;
  font-size: 1.1rem;
}

.benefit-card p {
  margin: 0;
  font-size: 0.9rem;
  color: #666;
  line-height: 1.6;
}

.monochrome-tips {
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: 8px;
  margin: 2rem 0;
}

.monochrome-tips h4 {
  margin-top: 0;
  margin-bottom: 1rem;
  color: #333;
}

.monochrome-tips ul {
  margin: 0;
  padding-left: 1.5rem;
  line-height: 2;
}

.monochrome-example {
  margin: 2rem 0;
}

.monochrome-example h4 {
  margin-bottom: 1.5rem;
  color: #333;
}

.accent-demo {
  margin: 1.5rem 0;
}

/* カラーコードセクション */
.hex-pattern-info,
.hex-brightness,
.common-grays,
.hex-tips,
.hex-practice {
  margin: 2rem 0;
}

.hex-pattern-info h4,
.hex-brightness h4,
.common-grays h4,
.hex-tips h4,
.hex-practice h4 {
  color: #333;
  margin-bottom: 1rem;
}

/* HEX構造の説明 */
.hex-structure {
  background: #f8f9fa;
  padding: 2rem;
  border-radius: 12px;
  margin: 1.5rem 0;
}

.hex-explanation {
  text-align: center;
}

.hex-box {
  display: inline-flex;
  align-items: center;
  background: white;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  font-size: 2rem;
  font-family: 'Courier New', monospace;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  margin-bottom: 1rem;
}

.hex-symbol {
  color: #666;
  margin-right: 0.25rem;
}

.hex-part {
  padding: 0.25rem 0.5rem;
  margin: 0 0.1rem;
  border-radius: 4px;
}

.hex-part.red {
  background: #ffe0e0;
  color: #c92a2a;
}

.hex-part.green {
  background: #d3f9d8;
  color: #2b8a3e;
}

.hex-part.blue {
  background: #d0ebff;
  color: #1971c2;
}

.hex-labels {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin: 1rem 0 1.5rem 0;
  font-weight: 600;
  font-size: 0.9rem;
}

.label-arrow.red {
  color: #c92a2a;
}

.label-arrow.green {
  color: #2b8a3e;
}

.label-arrow.blue {
  color: #1971c2;
}

.hex-note {
  font-size: 0.95rem;
  color: #666;
  font-style: italic;
  margin-top: 1rem;
}

/* 16進数スケール */
.hex-scale {
  background: #f8f9fa;
  padding: 2rem;
  border-radius: 12px;
  margin: 1.5rem 0;
}

.hex-scale-bar {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.scale-item {
  flex: 1;
  text-align: center;
  padding: 1.5rem 0.5rem;
  background: white;
  border-radius: 8px;
  margin: 0 0.25rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease;
}

.scale-item:hover {
  transform: translateY(-4px);
}

.scale-item.dark {
  background: #000;
  color: white;
}

.scale-item.bright {
  background: #fff;
  border: 2px solid #4A90E2;
}

.scale-value {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  font-family: 'Courier New', monospace;
  margin-bottom: 0.5rem;
}

.scale-label {
  display: block;
  font-size: 0.75rem;
  line-height: 1.4;
}

.scale-note {
  text-align: center;
  font-size: 1rem;
  color: #333;
  margin: 0;
}

/* グレーの例 */
.gray-examples-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.gray-example-card {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease;
}

.gray-example-card:hover {
  transform: translateY(-4px);
}

.gray-color-display {
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 700;
}

.color-name {
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.gray-code-info {
  background: white;
  padding: 1rem;
  text-align: center;
}

.gray-hex {
  font-family: 'Courier New', monospace;
  font-size: 1.1rem;
  font-weight: 700;
  color: #333;
  margin: 0 0 0.5rem 0;
}

.gray-detail {
  font-size: 0.85rem;
  color: #666;
  margin: 0;
  line-height: 1.6;
}

/* ヒントボックス */
.tip-boxes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.tip-box {
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: 8px;
  border-left: 4px solid #4A90E2;
}

.tip-box h5 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  color: #333;
  font-size: 1rem;
}

.tip-box p {
  font-size: 0.9rem;
  color: #666;
  margin: 0.5rem 0;
}

.tip-box ul {
  margin: 0.75rem 0 0 0;
  padding-left: 1.5rem;
  font-size: 0.9rem;
  line-height: 1.8;
}

/* 練習問題 */
.practice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.practice-item {
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  text-align: center;
  transition: transform 0.2s ease;
}

.practice-item:hover {
  transform: translateY(-4px);
}

.practice-color {
  width: 100%;
  height: 100px;
  border-radius: 8px;
  margin-bottom: 1rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.practice-code {
  font-family: 'Courier New', monospace;
  font-size: 1.1rem;
  font-weight: 700;
  color: #333;
  margin: 0.5rem 0;
}

.practice-answer {
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0.5rem 0 0 0;
}

.practice-item.achromatic .practice-answer {
  color: #28a745;
}

.practice-item.chromatic .practice-answer {
  color: #dc3545;
}

.practice-note {
  background: #d1ecf1;
  border-left: 4px solid #17a2b8;
  padding: 1rem;
  border-radius: 8px;
  margin-top: 1.5rem;
  font-size: 0.95rem;
  color: #0c5460;
}

/* ===== タブ3: RGBカラースペーススタイル ===== */

.rgb-interactive {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin: 2rem 0;
  padding: 2rem;
  background: #f8f9fa;
  border-radius: 12px;
}

.rgb-controls {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.rgb-slider-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.rgb-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: 1.1rem;
}

.rgb-label.red { color: #dc3545; }
.rgb-label.green { color: #28a745; }
.rgb-label.blue { color: #007bff; }

.rgb-slider {
  width: 100%;
  height: 18px;
  -webkit-appearance: none;
  appearance: none;
  border-radius: 9px;
  cursor: pointer;
  outline: none;
  touch-action: none;
}

.red-slider {
  background: linear-gradient(to right, #000, #ff0000);
}

.green-slider {
  background: linear-gradient(to right, #000, #00ff00);
}

.blue-slider {
  background: linear-gradient(to right, #000, #0000ff);
}

.rgb-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  background: white;
  border: 3px solid #333;
  border-radius: 50%;
  cursor: grab;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.rgb-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.rgb-slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  background: white;
  border: 3px solid #333;
  border-radius: 50%;
  cursor: grab;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.rgb-presets {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.rgb-preset-btn {
  width: 60px;
  height: 60px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.rgb-preset-btn:hover {
  transform: scale(1.1) translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.rgb-preview {
  text-align: center;
}

.rgb-color-chip {
  width: 200px;
  height: 200px;
  margin: 0 auto 1rem;
  border: 2px solid rgba(0, 0, 0, 0.3);
  background-color: rgb(128, 128, 128);
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  transition: background-color 0.2s ease;
}

/* RGB 3D Cube Styles */
.rgb-cube-container {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: center;
  align-items: flex-start;
  margin: 2rem 0;
  padding: 2rem;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border-radius: 12px;
}

.rgb-cube-scene {
  width: 250px;
  height: 250px;
  perspective: 800px;
  cursor: grab;
}

.rgb-cube {
  width: 150px;
  height: 150px;
  position: relative;
  transform-style: preserve-3d;
  transform: rotateX(-20deg) rotateY(45deg);
  margin: 50px auto;
  transition: transform 0.05s ease-out;
}

.cube-face {
  position: absolute;
  width: 150px;
  height: 150px;
  opacity: 0.85;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Front face: B=255 plane - cyan to white (top), blue to magenta (bottom) */
.cube-front {
  background: linear-gradient(to bottom,
    linear-gradient(to right, rgb(0, 255, 255), rgb(255, 255, 255)),
    linear-gradient(to right, rgb(0, 0, 255), rgb(255, 0, 255))
  );
  background:
    linear-gradient(to bottom, rgb(0, 255, 255), rgb(0, 0, 255)) 0% 0% / 1px 100% no-repeat,
    linear-gradient(to bottom, rgb(255, 255, 255), rgb(255, 0, 255)) 100% 0% / 1px 100% no-repeat,
    linear-gradient(to right, rgb(0, 255, 255), rgb(255, 255, 255)) 0% 0% / 100% 1px no-repeat,
    linear-gradient(to right, rgb(0, 0, 255), rgb(255, 0, 255)) 0% 100% / 100% 1px no-repeat,
    linear-gradient(135deg, rgb(0, 255, 255) 0%, rgb(128, 255, 255) 25%, rgb(255, 128, 255) 75%, rgb(255, 0, 255) 100%);
  transform: translateZ(75px);
}

/* Back face: B=0 plane - green to yellow (top), black to red (bottom) */
.cube-back {
  background: linear-gradient(135deg, rgb(0, 255, 0) 0%, rgb(128, 255, 0) 25%, rgb(255, 128, 0) 50%, rgb(255, 0, 0) 75%, rgb(0, 0, 0) 100%);
  transform: rotateY(180deg) translateZ(75px);
}

/* Right face: R=255 plane - yellow to white (top), red to magenta (bottom) */
.cube-right {
  background: linear-gradient(135deg, rgb(255, 255, 0) 0%, rgb(255, 255, 128) 25%, rgb(255, 128, 255) 75%, rgb(255, 0, 255) 100%);
  transform: rotateY(90deg) translateZ(75px);
}

/* Left face: R=0 plane - green to cyan (top), black to blue (bottom) */
.cube-left {
  background: linear-gradient(135deg, rgb(0, 255, 0) 0%, rgb(0, 255, 128) 25%, rgb(0, 128, 255) 75%, rgb(0, 0, 255) 100%);
  transform: rotateY(-90deg) translateZ(75px);
}

/* Top face: G=255 plane - green to cyan (left), yellow to white (right) */
.cube-top {
  background: linear-gradient(to right,
    linear-gradient(to bottom, rgb(0, 255, 0), rgb(0, 255, 255)),
    linear-gradient(to bottom, rgb(255, 255, 0), rgb(255, 255, 255))
  );
  background: linear-gradient(135deg, rgb(0, 255, 0) 0%, rgb(0, 255, 255) 25%, rgb(255, 255, 255) 75%, rgb(255, 255, 0) 100%);
  transform: rotateX(90deg) translateZ(75px);
}

/* Bottom face: G=0 plane - black to blue (left), red to magenta (right) */
.cube-bottom {
  background: linear-gradient(135deg, rgb(0, 0, 0) 0%, rgb(0, 0, 255) 25%, rgb(255, 0, 255) 75%, rgb(255, 0, 0) 100%);
  transform: rotateX(-90deg) translateZ(75px);
}

/* 3D Sphere point */
.cube-point {
  position: absolute;
  width: 18px;
  height: 18px;
  left: 50%;
  top: 50%;
  margin-left: -9px;
  margin-top: -9px;
  transform-style: preserve-3d;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.9));
}

/* 3D Sphere wireframe rings */
.sphere-ring {
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid;
  border-color: inherit;
  border-radius: 50%;
  box-sizing: border-box;
  opacity: 0.9;
}

.ring-xy {
  transform: rotateX(0deg);
}

.ring-xz {
  transform: rotateX(90deg);
}

.ring-yz {
  transform: rotateY(90deg);
}

/* Solid inner core */
.sphere-core {
  position: absolute;
  width: 10px;
  height: 10px;
  left: 4px;
  top: 4px;
  border-radius: 50%;
  background: inherit;
}

/* Additional wireframe rings for depth */
.cube-point::before {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  left: 2px;
  top: 2px;
  border: 1.5px solid;
  border-color: inherit;
  border-radius: 50%;
  opacity: 0.7;
  transform: rotateX(60deg) rotateZ(30deg);
}

.cube-point::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  left: 2px;
  top: 2px;
  border: 1.5px solid;
  border-color: inherit;
  border-radius: 50%;
  opacity: 0.7;
  transform: rotateY(60deg) rotateZ(-30deg);
}

.cube-controls {
  color: white;
  padding: 1rem;
}

.cube-instruction {
  font-size: 0.9rem;
  color: #aaa;
  margin-bottom: 1rem;
}

.cube-legend {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.legend-axis {
  font-weight: 700;
  font-size: 1rem;
}

.legend-axis.red { color: #ff6b6b; }
.legend-axis.green { color: #69db7c; }
.legend-axis.blue { color: #74c0fc; }

.legend-desc {
  font-size: 0.85rem;
  color: #aaa;
}

.cube-corners {
  margin-top: 1.5rem;
}

.corners-instruction {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 0.75rem;
}

.corner-grid-inline {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.corner-btn {
  width: 45px;
  height: 45px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.75rem;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.corner-btn:hover {
  transform: scale(1.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 1;
}

.corner-btn:active {
  transform: scale(0.95);
}

.cube-set-btn {
  background: linear-gradient(135deg, #4A90E2, #357ABD);
  color: white;
  border: none;
  padding: 0.6rem 1rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  margin: 0.75rem 0;
  transition: all 0.2s ease;
}

.cube-set-btn:hover {
  background: linear-gradient(135deg, #357ABD, #2868A0);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(74, 144, 226, 0.4);
}

/* ===== RGBベクトル類似度セクション ===== */

.vector-concept {
  background: #e8f4fd;
  padding: 1.5rem;
  border-radius: 8px;
  margin: 1.5rem 0;
  border-left: 4px solid #2196f3;
}

.vector-concept h4 {
  margin: 0 0 1rem 0;
  color: #1565c0;
}

.vector-examples {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.vector-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.vector-color {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  border: 1px solid rgba(0,0,0,0.2);
}

.similarity-methods {
  margin: 2rem 0;
}

.similarity-methods h4 {
  margin-bottom: 1rem;
}

.method-card {
  background: #f8f9fa;
  padding: 1.25rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  border: 1px solid #e0e0e0;
}

.method-card h5 {
  margin: 0 0 0.5rem 0;
  color: #333;
}

.method-card code {
  display: block;
  background: #263238;
  color: #80cbc4;
  padding: 0.75rem 1rem;
  border-radius: 4px;
  font-size: 0.95rem;
  margin: 0.75rem 0;
}

.method-note {
  font-size: 0.9rem;
  color: #666;
  margin: 0.5rem 0 0 0;
}

.similarity-calculator {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 2rem;
  border-radius: 12px;
  margin-top: 2rem;
  color: white;
}

.similarity-calculator h4 {
  margin: 0 0 0.5rem 0;
}

.similarity-calculator > p {
  margin: 0 0 1.5rem 0;
  opacity: 0.9;
}

/* Make strong text stand out */
.similarity-calculator strong {
  color: #ffeb3b;
  font-weight: 700;
  text-shadow: 0 0 4px rgba(0, 0, 0, 0.3);
}

.color-compare-inputs {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.compare-color-box {
  background: rgba(255,255,255,0.15);
  padding: 1rem;
  border-radius: 8px;
  text-align: center;
}

.compare-color-box label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.compare-color-preview {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  margin: 0 auto 0.75rem;
  border: 2px solid rgba(255,255,255,0.5);
}

.compare-sliders {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.mini-slider-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.mini-label {
  width: 16px;
  font-weight: 600;
  font-size: 0.8rem;
}

.mini-slider {
  width: 80px;
  height: 8px;
  -webkit-appearance: none;
  appearance: none;
  border-radius: 4px;
  cursor: pointer;
}

.mini-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  background: white;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.mini-val {
  width: 28px;
  font-size: 0.75rem;
  text-align: right;
}

.compare-vs {
  font-size: 1.5rem;
  font-weight: 700;
  opacity: 0.7;
}

/* Compare Cube Section */
.compare-cube-section {
  margin: 1.5rem 0;
  text-align: center;
}

.compare-cube-section h5 {
  margin: 0 0 0.5rem 0;
  font-size: 1.1rem;
}

.compare-cube-desc {
  font-size: 0.9rem;
  margin: 0 0 1rem 0;
  color: rgba(255, 255, 255, 0.95);
  line-height: 1.6;
}

.compare-cube-desc strong {
  color: #1a1a2e;
  background: #4dd0e1;
  padding: 0.15em 0.5em;
  border-radius: 4px;
  font-weight: 700;
}

.compare-cube-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.compare-cube-scene {
  width: 200px;
  height: 200px;
  perspective: 600px;
  cursor: grab;
}

.compare-cube {
  width: 120px;
  height: 120px;
  position: relative;
  transform-style: preserve-3d;
  transform: rotateX(-20deg) rotateY(45deg);
  margin: 40px auto;
  transition: transform 0.05s ease-out;
}

/* Wireframe cube - transparent faces with borders only */
.wire-face {
  position: absolute;
  width: 120px;
  height: 120px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-sizing: border-box;
}

.wire-front { transform: translateZ(60px); }
.wire-back { transform: rotateY(180deg) translateZ(60px); }
.wire-right { transform: rotateY(90deg) translateZ(60px); }
.wire-left { transform: rotateY(-90deg) translateZ(60px); }
.wire-top { transform: rotateX(90deg) translateZ(60px); }
.wire-bottom { transform: rotateX(-90deg) translateZ(60px); }

/* Origin point (0,0,0) at back-bottom-left corner */
.origin-point {
  position: absolute;
  width: 10px;
  height: 10px;
  background: rgba(255,255,255,0.9);
  border-radius: 50%;
  left: 50%;
  top: 50%;
  margin-left: -65px;
  margin-top: 55px;
  transform: translateZ(-60px);
  box-shadow: 0 0 8px white;
}

.origin-label {
  position: absolute;
  font-size: 0.65rem;
  color: rgba(255,255,255,0.7);
  left: 50%;
  top: 50%;
  margin-left: -75px;
  margin-top: 70px;
  transform: translateZ(-60px);
  white-space: nowrap;
}

/* Compare points - same 3D sphere style */
.compare-point {
  position: absolute;
  width: 16px;
  height: 16px;
  left: 50%;
  top: 50%;
  margin-left: -8px;
  margin-top: -8px;
  transform-style: preserve-3d;
  filter: drop-shadow(0 0 6px currentColor);
}

.compare-point .sphere-ring {
  width: 16px;
  height: 16px;
}

.compare-point .sphere-core {
  width: 8px;
  height: 8px;
  left: 4px;
  top: 4px;
}

.point-a {
  color: rgb(255, 0, 0);
}

.point-b {
  color: rgb(255, 128, 0);
}

/* Vector lines from origin */
.vector-line {
  position: absolute;
  height: 2px;
  transform-origin: left center;
  left: -60px;
  top: 60px;
}

.vector-line-a {
  background: rgba(255, 100, 100, 0.6);
}

.vector-line-b {
  background: rgba(100, 200, 255, 0.6);
}

/* Distance line between points */
.distance-line {
  position: absolute;
  height: 2px;
  background: linear-gradient(90deg,
    rgba(255,255,255,0.8) 0%,
    rgba(255,255,255,0.3) 50%,
    rgba(255,255,255,0.8) 100%);
  transform-origin: left center;
  box-shadow: 0 0 4px rgba(255,255,255,0.5);
}

/* Legend */
.compare-cube-legend {
  text-align: left;
  font-size: 0.85rem;
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid white;
}

.dot-a {
  background: rgb(255, 0, 0);
}

.dot-b {
  background: rgb(255, 128, 0);
}

.legend-line {
  width: 20px;
  height: 2px;
  background: linear-gradient(90deg, white, rgba(255,255,255,0.3), white);
}

.legend-note {
  font-size: 0.75rem;
  opacity: 0.6;
  margin-top: 0.75rem;
}

.similarity-result {
  background: rgba(0,0,0,0.2);
  padding: 1rem;
  border-radius: 8px;
  font-family: monospace;
}

.result-row {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.result-row:last-child {
  border-bottom: none;
}

.result-row.highlight {
  background: rgba(255,255,255,0.1);
  margin: 0.5rem -0.5rem;
  padding: 0.6rem 0.5rem;
  border-radius: 4px;
  border-bottom: none;
}

.result-label {
  opacity: 0.8;
}

.result-value {
  font-weight: 600;
}

.cosine-value {
  font-size: 1.2rem;
  color: #ffd54f;
}

.similarity-interpretation {
  margin-top: 1rem;
  background: rgba(0, 0, 0, 0.25);
  padding: 1rem;
  border-radius: 8px;
}

.similarity-interpretation p {
  margin: 0;
  line-height: 1.6;
}

.similarity-interpretation strong {
  color: #1a1a2e;
  background: #4dd0e1;
  padding: 0.15em 0.5em;
  border-radius: 4px;
  font-weight: 700;
}

/* RGB-HSL comparison table */
.rgb-hsl-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
}

.rgb-hsl-table th,
.rgb-hsl-table td {
  padding: 1rem;
  text-align: left;
  border: 1px solid #ddd;
}

.rgb-hsl-table th {
  background: #4A90E2;
  color: white;
  font-weight: 600;
}

.rgb-hsl-table tr:nth-child(even) {
  background: #f8f9fa;
}

.rgb-theory-info,
.conversion-formula {
  background: #e3f2fd;
  padding: 1.5rem;
  border-radius: 8px;
  border-left: 4px solid #2196f3;
  margin-top: 1.5rem;
}

.rgb-theory-info h4,
.conversion-formula h4 {
  margin: 0 0 0.75rem 0;
  color: #1565c0;
}

/* タブ4: 色の心理効果スタイル */
.psychology-intro,
.color-categories {
  margin: 2rem 0;
}

.psychology-intro h4,
.color-categories h4 {
  color: #333;
  margin-bottom: 1.5rem;
  font-size: 1.2rem;
}

/* 影響領域グリッド */
.influence-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.influence-card {
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: 12px;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.influence-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.influence-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 1rem;
}

.influence-card h5 {
  margin: 0.5rem 0;
  color: #333;
  font-size: 1.1rem;
}

.influence-card p {
  font-size: 0.9rem;
  color: #666;
  line-height: 1.6;
  margin: 0.5rem 0 0 0;
}

/* 色の分類 */
.category-boxes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.category-box {
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  text-align: center;
  transition: transform 0.2s ease;
}

.category-box:hover {
  transform: translateY(-4px);
}

.category-box h5 {
  margin: 0 0 1rem 0;
  color: #333;
  font-size: 1.1rem;
}

.category-samples {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin: 1rem 0;
}

.cat-sample {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.category-box p {
  font-size: 0.9rem;
  color: #666;
  line-height: 1.6;
  margin: 1rem 0 0 0;
}

/* 個別色の心理効果 */
.color-psychology-header {
  text-align: center;
}

.psychology-details {
  margin-top: 1.5rem;
}

.psych-section {
  margin: 2rem 0;
}

.psych-section h4 {
  color: #333;
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.psych-section ul {
  margin: 0.75rem 0;
  padding-left: 1.5rem;
  line-height: 1.8;
}

.psych-section ul li {
  margin-bottom: 0.75rem;
}

/* 連想タグ */
.association-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.association-tags span {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  transition: transform 0.2s ease;
}

.association-tags span:hover {
  transform: scale(1.05);
}

.tag-positive {
  background: #d3f9d8;
  color: #2b8a3e;
}

.tag-neutral {
  background: #e7f5ff;
  color: #1971c2;
}

.tag-negative {
  background: #ffe0e0;
  color: #c92a2a;
}

/* 色のバリエーション */
.color-variations {
  margin-top: 2rem;
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: 12px;
}

.color-variations h4 {
  color: #333;
  margin-bottom: 1.5rem;
  text-align: center;
}

.variation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1.5rem;
}

.var-item {
  text-align: center;
  transition: transform 0.2s ease;
}

.var-item:hover {
  transform: translateY(-4px);
}

.var-color {
  width: 100%;
  height: 100px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  margin-bottom: 0.75rem;
}

.var-name {
  font-weight: 700;
  color: #333;
  margin: 0.5rem 0;
  font-size: 0.95rem;
}

.var-desc {
  font-size: 0.85rem;
  color: #666;
  margin: 0.25rem 0 0 0;
}

/* タブ5: トーンスタイル */
.tone-intro,
.tone-map-intro,
.tone-importance {
  margin: 2rem 0;
}

.tone-elements {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.tone-element-card {
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: 12px;
  text-align: center;
  border: 2px solid transparent;
  transition: transform 0.2s ease;
}

.tone-element-card.highlight {
  background: #e7f5ff;
  border-color: #4A90E2;
}

.tone-element-card:hover {
  transform: translateY(-4px);
}

.tone-element-card h5 {
  margin: 0 0 0.75rem 0;
  color: #333;
  font-size: 1.1rem;
}

.tone-element-card p {
  font-size: 0.9rem;
  color: #666;
  margin: 0;
  line-height: 1.6;
}

/* トーンマップ */
.tone-map-diagram {
  margin: 2rem auto;
  padding: 1.5rem;
  background: #f8f9fa;
  border-radius: 12px;
  max-width: 500px;
}

.tone-axis-labels {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.axis-label-y {
  font-weight: 700;
  color: #333;
  font-size: 0.8rem;
  line-height: 1.3;
  text-align: center;
  min-width: 35px;
}

.tone-map-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
  flex: 1;
}

.tone-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.75rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease;
}

.tone-cell:hover {
  transform: scale(1.05);
}

.axis-label-x {
  display: block;
  text-align: center;
  font-weight: 700;
  color: #333;
  font-size: 0.8rem;
  margin-top: 0.75rem;
}

/* トーン詳細セクション */
.tone-detail-section {
  margin: 2rem 0;
}

.tone-header {
  padding: 1.5rem 2rem;
  border-radius: 12px;
  text-align: center;
  margin-bottom: 1.5rem;
}

.tone-header h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.5rem;
}

.tone-params {
  margin: 0;
  font-size: 0.95rem;
}

/* トーンカラーグリッド */
.tone-colors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.tone-color-item {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease;
}

.tone-color-item:hover {
  transform: translateY(-4px);
}

.tone-color-name {
  font-weight: 700;
  font-size: 0.9rem;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.tone-description {
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: 12px;
  margin-top: 1.5rem;
}

.tone-description h4 {
  color: #333;
  margin: 0 0 1rem 0;
}

.tone-description p {
  margin: 0.75rem 0;
  line-height: 1.8;
}

.tone-description ul {
  margin: 1rem 0;
  padding-left: 1.5rem;
  line-height: 1.8;
}

.tone-description ul li {
  margin-bottom: 0.75rem;
}

/* トーンテクニック */
.tone-technique {
  margin: 2rem 0;
}

.tone-technique h4 {
  color: #333;
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

.technique-example {
  margin: 1.5rem 0;
  padding: 1.5rem;
  background: #f8f9fa;
  border-radius: 12px;
}

.example-label {
  font-weight: 700;
  color: #333;
  margin-bottom: 1rem;
  font-size: 1rem;
}

.technique-palette {
  display: flex;
  gap: 1rem;
  margin: 1rem 0;
  flex-wrap: wrap;
}

.palette-color {
  flex: 1;
  min-width: 80px;
  height: 100px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  transition: transform 0.2s ease;
}

.palette-color:hover {
  transform: translateY(-4px);
}

.palette-color.large {
  flex: 3;
  min-height: 120px;
}

.palette-color.small {
  flex: 1;
  min-height: 120px;
}

.technique-note {
  margin: 1rem 0 0 0;
  font-weight: 600;
  color: #28a745;
  font-size: 0.95rem;
}

.tone-tips {
  background: #e7f5ff;
  padding: 1.5rem;
  border-radius: 12px;
  border-left: 4px solid #4A90E2;
}

.tone-tips h4 {
  color: #333;
  margin: 0 0 1rem 0;
}

.tone-tips ul {
  margin: 0.75rem 0;
  padding-left: 1.5rem;
  line-height: 1.8;
}

.tone-tips ul li {
  margin-bottom: 0.75rem;
}

/* タブ6: 配色比率スタイル */
.ratio-intro,
.ratio-roles {
  margin: 2rem 0;
}

.ratio-importance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.importance-item {
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: 12px;
  text-align: center;
  transition: transform 0.2s ease;
}

.importance-item:hover {
  transform: translateY(-4px);
}

.importance-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 1rem;
}

.importance-item h5 {
  margin: 0.5rem 0;
  color: #333;
  font-size: 1.1rem;
}

.importance-item p {
  font-size: 0.9rem;
  color: #666;
  margin: 0.5rem 0 0 0;
}

/* 役割カード */
.role-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.role-card {
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease;
}

.role-card:hover {
  transform: translateY(-4px);
}

.role-card.base {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border: 2px solid #dee2e6;
}

.role-card.main {
  background: linear-gradient(135deg, #d4e9f7 0%, #b8dff0 100%);
  border: 2px solid #4A90E2;
}

.role-card.accent {
  background: linear-gradient(135deg, #ffe0e0 0%, #ffc9c9 100%);
  border: 2px solid #ff6b6b;
}

.role-card h5 {
  margin: 0 0 0.75rem 0;
  color: #333;
  font-size: 1.2rem;
}

.role-percentage {
  font-size: 2rem;
  font-weight: 700;
  color: #4A90E2;
  margin: 0.5rem 0;
}

.role-example {
  font-size: 0.9rem;
  color: #666;
  margin-top: 1rem;
}

/* 比率バー */
.ratio-bar-container {
  margin: 2rem 0;
}

.ratio-bar-70-25-5,
.ratio-bar-60-30-10 {
  display: flex;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.ratio-segment {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.ratio-segment:hover {
  transform: scale(1.02);
}

.segment-label {
  font-weight: 700;
  font-size: 0.9rem;
  text-align: center;
}

.base-70 {
  flex: 7;
  background: #f8f9fa;
  color: #333;
}

.main-25 {
  flex: 2.5;
  background: #4A90E2;
  color: white;
}

.accent-5 {
  flex: 0.5;
  background: #ff6b6b;
  color: white;
}

.base-60 {
  flex: 6;
  background: #f8f9fa;
  color: #333;
}

.main-30 {
  flex: 3;
  background: #4A90E2;
  color: white;
}

.accent-10 {
  flex: 1;
  background: #ff6b6b;
  color: white;
}

/* 配色例 */
.law-example,
.law-tips,
.law-comparison {
  margin: 2rem 0;
}

.example-card {
  margin: 1.5rem 0;
  padding: 1.5rem;
  background: #f8f9fa;
  border-radius: 12px;
}

.example-label {
  font-weight: 700;
  color: #333;
  margin-bottom: 1rem;
  font-size: 1rem;
}

.color-ratio-demo {
  margin: 1rem 0;
}

.demo-layout {
  display: flex;
  height: 120px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.demo-section {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  text-align: center;
  line-height: 1.4;
  transition: transform 0.2s ease;
}

.demo-section:hover {
  transform: scale(1.02);
}

.example-note {
  margin: 1rem 0 0 0;
  font-size: 0.85rem;
  color: #666;
  font-style: italic;
}

/* 比較グリッド */
.comparison-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.comparison-item {
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
  border: 2px solid #dee2e6;
}

.comparison-item h5 {
  margin: 0 0 1rem 0;
  color: #4A90E2;
  font-size: 1.1rem;
}

.comparison-item ul {
  margin: 0.5rem 0;
  padding-left: 1.5rem;
  line-height: 1.8;
}

/* パターンセクション */
.pattern-section {
  margin: 2rem 0;
}

.pattern-section h4 {
  color: #333;
  margin-bottom: 1rem;
}

/* 目的別グリッド */
.purpose-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.purpose-card {
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: 12px;
  border-left: 4px solid #4A90E2;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.purpose-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.purpose-card h5 {
  margin: 0 0 0.75rem 0;
  color: #333;
  font-size: 1.1rem;
}

.purpose-card p {
  font-size: 0.9rem;
  color: #666;
  margin: 0.5rem 0;
  line-height: 1.6;
}

/* 重さの例 */
.weight-example {
  margin: 1.5rem 0;
  padding: 1.5rem;
  background: #f8f9fa;
  border-radius: 12px;
}

.weight-demo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  margin: 1.5rem 0;
}

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

.weight-color {
  width: 100px;
  height: 100px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  margin-bottom: 1rem;
}

.weight-arrow {
  font-size: 2rem;
  font-weight: 700;
  color: #4A90E2;
}

.weight-note {
  margin: 1rem 0 0 0;
  font-size: 0.9rem;
  color: #666;
}

/* ステップ */
.check-steps {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 2rem 0;
  flex-wrap: wrap;
}

.step-item {
  flex: 1;
  min-width: 150px;
  text-align: center;
  padding: 1.5rem 1rem;
  background: #f8f9fa;
  border-radius: 12px;
  border: 2px solid #dee2e6;
}

.step-number {
  display: inline-block;
  width: 40px;
  height: 40px;
  line-height: 40px;
  background: #4A90E2;
  color: white;
  border-radius: 50%;
  font-weight: 700;
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

.step-item h5 {
  margin: 0.5rem 0;
  color: #333;
  font-size: 1rem;
}

.step-item p {
  font-size: 0.85rem;
  color: #666;
  margin: 0.5rem 0 0 0;
}

.step-arrow {
  font-size: 1.5rem;
  font-weight: 700;
  color: #4A90E2;
}

.final-tips {
  background: #e7f5ff;
  padding: 1.5rem;
  border-radius: 12px;
  border-left: 4px solid #4A90E2;
  margin-top: 2rem;
}

.final-tips h4 {
  color: #333;
  margin: 0 0 1rem 0;
}

.final-tips ul {
  margin: 0.75rem 0;
  padding-left: 1.5rem;
  line-height: 1.8;
}

/* アコーディオンコンテンツ共通 */
.accordion-content {
  padding: 1.5rem;
  line-height: 1.8;
  color: #555;
  background: white;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.accordion-content p {
  margin: 0.75rem 0;
}

.accordion-content strong {
  color: #2c6ba8;
  font-weight: 600;
}

.accordion-content ul {
  margin: 1rem 0;
  padding-left: 2rem;
}

.accordion-content li {
  margin-bottom: 0.5rem;
}

.fh-main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.fh-controls label {
  display: block;
  margin-top: 1rem;
  font-weight: 600;
}

.fh-controls input[type="range"] {
  width: 100%;
  margin-top: 0.75rem;
  margin-bottom: 1rem;
  height: 18px;
  -webkit-appearance: none;
  appearance: none;
  background: #b8b8b8;
  border: 2px solid #777;
  border-radius: 9px;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  outline: none;
  touch-action: none;
}

/* スライダートラック - Webkit */
.fh-controls input[type="range"]::-webkit-slider-track {
  width: 100%;
  height: 18px;
  background: transparent;
  border: none;
}

.fh-controls input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 28px;
  height: 28px;
  margin-top: -5px;
  background: linear-gradient(135deg, #ffffff 0%, #e8e8e8 100%);
  border: 4px solid #4A90E2;
  border-radius: 50%;
  cursor: grab;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
  transition: all 0.2s ease;
}

.fh-controls input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  border-width: 4px;
  box-shadow: 0 4px 12px rgba(74, 144, 226, 0.5);
}

.fh-controls input[type="range"]::-webkit-slider-thumb:active {
  cursor: grabbing;
  transform: scale(1.1);
  box-shadow: 0 2px 6px rgba(74, 144, 226, 0.6);
}

/* スライダートラック - Firefox */
.fh-controls input[type="range"]::-moz-range-track {
  width: 100%;
  height: 18px;
  background: #b8b8b8;
  border-radius: 9px;
  border: 2px solid #777;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.2);
}

.fh-controls input[type="range"]::-moz-range-thumb {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, #ffffff 0%, #e8e8e8 100%);
  border: 4px solid #4A90E2;
  border-radius: 50%;
  cursor: grab;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
  transition: all 0.2s ease;
}

.fh-controls input[type="range"]::-moz-range-thumb:hover {
  transform: scale(1.2);
  border-width: 4px;
  box-shadow: 0 4px 12px rgba(74, 144, 226, 0.5);
}

.fh-controls input[type="range"]::-moz-range-thumb:active {
  cursor: grabbing;
  transform: scale(1.1);
  box-shadow: 0 2px 6px rgba(74, 144, 226, 0.6);
}

/* フォーカス時のスタイル */
.fh-controls input[type="range"]:focus {
  outline: none;
}

.fh-controls input[type="range"]:focus::-webkit-slider-thumb {
  border-color: #357ABD;
  box-shadow: 0 0 0 4px rgba(74, 144, 226, 0.2);
}

.fh-controls input[type="range"]:focus::-moz-range-thumb {
  border-color: #357ABD;
  box-shadow: 0 0 0 4px rgba(74, 144, 226, 0.2);
}

.fh-buttons {
  margin-top: 1.5rem;
}

.fh-buttons button {
  margin-right: 0.75rem;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  border-radius: 8px;
  transition: all 0.25s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

#btn-random {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  color: white;
}

#btn-random:hover {
  background: linear-gradient(135deg, #20c997 0%, #28a745 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

#btn-random:active {
  transform: translateY(0);
}

#btn-reset {
  background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
  color: white;
}

#btn-reset:hover {
  background: linear-gradient(135deg, #5a6268 0%, #6c757d 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

#btn-reset:active {
  transform: translateY(0);
}

.fh-preview {
  text-align: center;
}

.color-chip {
  width: 200px;
  height: 200px;
  margin: 0 auto 1rem;
  border: 2px solid rgba(0,0,0,0.3);
  background-color: hsl(0, 50%, 50%);
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.color-chip:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.color-codes {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.code-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #1E1E1E;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease;
}

.code-item:hover {
  transform: translateX(4px);
}

.code-label {
  font-weight: 700;
  color: #4A90E2;
  font-size: 0.85rem;
  min-width: 40px;
}

.code-value {
  flex: 1;
  font-family: 'Courier New', monospace;
  color: #F5F5F5;
  font-size: 0.95rem;
  letter-spacing: 0.5px;
}

.copy-btn {
  background: #357ABD;
  border: none;
  border-radius: 6px;
  padding: 0.4rem 0.75rem;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  opacity: 0.8;
}

.copy-btn:hover {
  opacity: 1;
  background: #4A90E2;
  transform: scale(1.1);
}

.copy-btn:active {
  transform: scale(0.95);
}

.copy-btn.copied {
  background: #28a745;
  animation: pulse 0.3s ease;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

.fh-footer details {
  margin-top: 2rem;
  font-size: 0.9rem;
}

/* プレースホルダー */
.placeholder-content {
  text-align: center;
  padding: 4rem 2rem;
  font-size: 1.5rem;
  color: #999;
}

/* タブ8: 雑学コンテンツ */
.trivia-content {
  max-width: 900px;
  margin: 0 auto;
}

.trivia-item {
  background: white;
  padding: 2rem;
  margin-bottom: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.trivia-item h3 {
  margin-top: 0;
  color: #333;
  font-size: 1.5rem;
  border-bottom: 2px solid #4A90E2;
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

.trivia-item p {
  line-height: 1.7;
  color: #555;
  margin: 1rem 0;
}

.trivia-item ul {
  line-height: 1.8;
  color: #555;
  margin: 1rem 0;
  padding-left: 1.5rem;
}

.trivia-item li {
  margin-bottom: 0.5rem;
}

/* カラーサンプル表示 */
.color-examples {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.color-sample {
  flex: 1;
  min-width: 120px;
  padding: 2rem 1rem;
  text-align: center;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.color-sample span {
  display: block;
  font-family: monospace;
  font-weight: bold;
  font-size: 1rem;
  color: white;
  margin-bottom: 0.5rem;
}

.color-sample small {
  display: block;
  font-size: 0.85rem;
  opacity: 0.9;
}

/* 比較テーブル */
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.comparison-table th,
.comparison-table td {
  padding: 0.75rem;
  border: 1px solid #ddd;
  text-align: left;
}

.comparison-table th {
  background: #4A90E2;
  color: white;
  font-weight: 600;
}

.comparison-table tr:nth-child(even) {
  background: #f9f9f9;
}

/* グレースケール段階 */
.grayscale-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.gray-step {
  padding: 1.5rem 1rem;
  text-align: center;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.gray-step strong {
  display: block;
  font-family: monospace;
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

.gray-step small {
  display: block;
  font-size: 0.8rem;
}

/* トースト通知 */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #28a745;
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  font-size: 1rem;
  font-weight: 500;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* フッター */
footer {
  margin-top: 4rem;
  padding: 2rem 1rem;
  background: #f8f9fa;
  border-top: 2px solid #e0e0e0;
}

.footer {
  text-align: center;
  color: #555;
  font-size: 1rem;
}

.footer a {
  color: #2c6ba8;
  text-decoration: none;
  font-weight: 500;
}

.footer a:hover {
  text-decoration: underline;
}

/* モバイル対応 */
@media (max-width: 768px) {
  .app-container {
    padding: 1rem 0.75rem;
  }

  .fh-header,
  .accordion-content,
  .main-accordion,
  .tab-content,
  .tab-content * {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .app-header h1 {
    font-size: 1.8rem;
  }

  .tab-navigation {
    gap: 0.3rem;
  }

  .tab-btn {
    padding: 0.6rem 0.8rem;
    font-size: 0.85rem;
  }

  .main-accordion > .accordion-content {
    padding: 1rem;
  }

  .main-accordion > summary {
    font-size: 1.2rem;
    padding: 1rem;
  }

  .attribute-grid {
    grid-template-columns: 1fr;
  }

  .attribute-card {
    padding: 1.2rem;
  }

  .intro-text {
    font-size: 1rem;
  }

  .trivia-item {
    padding: 1.5rem;
  }

  .trivia-item h3 {
    font-size: 1.3rem;
  }

  .color-examples {
    flex-direction: column;
  }

  .grayscale-steps {
    grid-template-columns: repeat(2, 1fr);
  }

  .color-wheel-container {
    width: 340px;
    height: 340px;
  }

  .wheel-label {
    font-size: 0.75rem;
    padding: 0.2rem 0.4rem;
  }

  .contrast-examples {
    grid-template-columns: 1fr;
  }

  .lightness-bar {
    gap: 0.3rem;
  }

  .lightness-sample {
    min-width: 60px;
    height: 70px;
    font-size: 0.75rem;
  }

  .saturation-lightness-grid {
    grid-template-columns: 1fr;
  }

  .sl-cell {
    padding: 1.5rem 1rem;
  }

  .ratio-bar {
    height: 60px;
    flex-direction: column;
  }

  .ratio-segment {
    width: 100% !important;
  }

  .achromatic-bar {
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
  }

  .achromatic-sample {
    min-height: 80px;
    font-size: 0.7rem;
  }

  .grayscale-interactive {
    grid-template-columns: 1fr;
  }

  .grayscale-chip {
    height: 200px;
  }

  /* RGB tab responsive */
  .rgb-interactive {
    grid-template-columns: 1fr;
  }

  .rgb-cube-container {
    flex-direction: column;
    align-items: center;
  }

  .corner-grid-inline {
    gap: 0.4rem;
  }

  .corner-btn {
    width: 40px;
    height: 40px;
    font-size: 0.7rem;
  }

  .role-grid {
    grid-template-columns: 1fr;
  }

  .benefit-grid {
    grid-template-columns: 1fr;
  }

  footer {
    padding: 1.5rem 1rem;
  }

  .footer {
    font-size: 0.9rem;
  }
}

@media (min-width: 600px) {
  .contrast-input-grid {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: end;
  }

  .contrast-target-control {
    grid-template-columns: auto minmax(16rem, 24rem);
    align-items: center;
  }

  .contrast-suggestion-values {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .contrast-suggestion-values div {
    display: grid;
    gap: 0.25rem;
  }

  .contrast-suggestion-actions {
    grid-template-columns: repeat(2, max-content);
  }
}

@media (max-width: 600px) {
  .fh-main {
    display: block;
  }
  .color-chip {
    width: 100%;
    height: auto;
    padding-top: 100%; /* 正方形維持 */
    position: relative;
  }

  .tab-btn {
    font-size: 0.75rem;
    padding: 0.5rem 0.6rem;
  }

  .grayscale-steps {
    grid-template-columns: 1fr;
  }

  .color-wheel-container {
    width: 300px;
    height: 300px;
  }

  .wheel-label {
    font-size: 0.65rem;
    padding: 0.15rem 0.3rem;
  }

  .lightness-sample {
    min-width: 50px;
    height: 60px;
    font-size: 0.7rem;
  }

  .lightness-card {
    padding: 1.5rem;
  }

  .color-sample-large {
    height: 120px;
  }

  .tip-item {
    padding: 1rem;
  }

  .saturation-warning,
  .saturation-info {
    padding: 1rem;
  }

  .sl-cell {
    padding: 1.5rem 0.75rem;
    font-size: 0.9rem;
  }

  .ratio-segment span {
    font-size: 0.85rem;
  }

  .achromatic-bar {
    grid-template-columns: repeat(auto-fit, minmax(50px, 1fr));
  }

  .achromatic-sample {
    min-height: 70px;
    font-size: 0.65rem;
  }

  .grayscale-interactive {
    padding: 1.5rem;
  }

  .grayscale-chip {
    height: 180px;
  }

  /* RGB tab mobile */
  .rgb-presets {
    justify-content: center;
  }

  .rgb-preset-btn {
    width: 50px;
    height: 50px;
    font-size: 0.8rem;
  }

  .rgb-cube-scene {
    width: 200px;
    height: 200px;
  }

  .rgb-cube {
    width: 120px;
    height: 120px;
    margin: 40px auto;
  }

  .cube-face {
    width: 120px;
    height: 120px;
  }

  .cube-front { transform: translateZ(60px); }
  .cube-back { transform: rotateY(180deg) translateZ(60px); }
  .cube-right { transform: rotateY(90deg) translateZ(60px); }
  .cube-left { transform: rotateY(-90deg) translateZ(60px); }
  .cube-top { transform: rotateX(90deg) translateZ(60px); }
  .cube-bottom { transform: rotateX(-90deg) translateZ(60px); }

  .rgb-color-chip {
    width: 150px;
    height: 150px;
  }

  .wcag-table {
    font-size: 0.85rem;
  }

  .wcag-table th,
  .wcag-table td {
    padding: 0.75rem 0.5rem;
  }

  .benefit-icon {
    font-size: 2rem;
  }

  .toast {
    bottom: 1rem;
    right: 1rem;
    left: 1rem;
    font-size: 0.9rem;
    padding: 0.875rem 1.25rem;
  }
}

/* Tab 8: 色覚シミュレーションと配色監査 */
.cvd-limit-note {
  margin: 1rem 0;
  padding: 1rem;
  border-left: 5px solid #b45309;
  border-radius: 8px;
  background: #fff7ed;
  color: #78350f;
}

.cvd-limit-note p {
  margin: 0.4rem 0 0;
}

.cvd-lab {
  margin: 1.5rem 0;
  padding: 1rem;
  border: 2px solid #dbe4ee;
  border-radius: 12px;
  background: #f8fafc;
}

.cvd-controls,
.cvd-comparison,
.noncolor-examples {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.cvd-controls label,
.cvd-audit-heading label {
  display: grid;
  gap: 0.4rem;
  font-weight: 700;
}

.cvd-controls textarea,
.cvd-controls select,
.cvd-audit-heading select {
  width: 100%;
  min-height: 44px;
  padding: 0.65rem;
  border: 2px solid #94a3b8;
  border-radius: 8px;
  background: #fff;
  color: #172033;
  font: inherit;
}

.cvd-controls textarea {
  resize: vertical;
  font-family: "Courier New", monospace;
}

.cvd-samples {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0.8rem 0;
}

.cvd-samples button {
  min-height: 44px;
  padding: 0.55rem 0.8rem;
  border: 1px solid #64748b;
  border-radius: 8px;
  background: #fff;
  color: #172033;
  cursor: pointer;
}

.cvd-samples button:hover,
.cvd-samples button:focus-visible {
  background: #e8f1fb;
}

.cvd-error {
  min-height: 1.5em;
  margin: 0.5rem 0;
  color: #b91c1c;
  font-weight: 700;
}

.cvd-comparison h5,
.cvd-audit-heading h5,
.noncolor-card h5 {
  margin: 0 0 0.6rem;
  font-size: 1rem;
}

.cvd-swatch-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.cvd-swatch {
  min-height: 72px;
  padding: 0.6rem;
  border: 1px solid rgba(0, 0, 0, 0.25);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}

.cvd-swatch-marker {
  display: inline-grid;
  place-items: center;
  min-width: 1.7rem;
  min-height: 1.7rem;
  border: 2px solid currentColor;
  border-radius: 50%;
  font-weight: 800;
}

.cvd-swatch code,
.cvd-pair-label code {
  color: inherit;
}

.cvd-audit-heading {
  display: grid;
  gap: 0.8rem;
  margin-top: 1.5rem;
}

.cvd-audit-heading p {
  margin: 0;
}

.table-scroll {
  max-width: 100%;
  overflow-x: auto;
  margin: 1rem 0;
  outline-offset: 3px;
}

.cvd-audit-table {
  min-width: 790px;
  margin: 0;
}

.cvd-pair-label {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.cvd-pair-chip {
  width: 1.25rem;
  height: 1.25rem;
  border: 1px solid #475569;
  border-radius: 4px;
}

.audit-pass {
  color: #166534;
  font-weight: 700;
}

.audit-fail {
  color: #b91c1c;
  font-weight: 700;
}

.noncolor-card {
  padding: 1rem;
  border: 2px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
}

.noncolor-card.recommended {
  border-color: #15803d;
  background: #f0fdf4;
}

.noncolor-card p {
  margin: 0.5rem 0;
}

.status-dot {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  margin-right: 0.4rem;
  border-radius: 50%;
  vertical-align: -0.1rem;
}

.status-dot-red { background: #d32f2f; }
.status-dot-green { background: #388e3c; }

@media (min-width: 600px) {
  .cvd-swatch-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .cvd-audit-heading {
    grid-template-columns: minmax(0, 1fr) minmax(220px, 0.5fr);
    align-items: end;
  }

  .noncolor-examples {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 900px) {
  .cvd-lab {
    padding: 1.5rem;
  }

  .cvd-controls,
  .cvd-comparison {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* タブ7: 配色例・目的別パレット */
.palette-intro {
  margin: 2rem 0;
}

.palette-intro h4 {
  color: #333;
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

.palette-intro p {
  line-height: 1.8;
  color: #666;
}

/* パレットセクション */
.palette-section {
  margin: 2rem 0;
}

.palette-section h4 {
  color: #333;
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
}

/* パレット例 */
.palette-example {
  margin: 1.5rem 0;
  padding: 1.5rem;
  background: #f8f9fa;
  border-radius: 12px;
  border: 2px solid #e0e0e0;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.palette-example:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.palette-header {
  font-weight: 700;
  color: #333;
  margin-bottom: 1rem;
  font-size: 1.05rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #4A90E2;
}

.palette-colors {
  display: flex;
  gap: 1rem;
  margin: 1.5rem 0;
  flex-wrap: wrap;
}

.palette-chip {
  flex: 1;
  min-width: 100px;
  min-height: 120px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.palette-chip:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.chip-code {
  font-family: 'Courier New', monospace;
  font-weight: 700;
  font-size: 0.9rem;
  color: #333;
}

.chip-role {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 20px;
  color: #333;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.palette-usage {
  font-size: 0.9rem;
  color: #666;
  margin: 1rem 0 0 0;
  font-style: italic;
  line-height: 1.6;
}

/* 季節別パレット */
.seasonal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.seasonal-card {
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.seasonal-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.seasonal-card h5 {
  margin: 0 0 1rem 0;
  color: #333;
  font-size: 1.15rem;
  text-align: center;
}

.seasonal-card p {
  font-size: 0.9rem;
  color: #666;
  margin: 0.75rem 0;
  line-height: 1.7;
}

.seasonal-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.seasonal-keywords span {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  background: #e7f5ff;
  color: #1971c2;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}

/* 感情・雰囲気別配色 */
.mood-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.mood-card {
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
  border: 2px solid #e0e0e0;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mood-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
  border-color: #4A90E2;
}

.mood-card h5 {
  margin: 0 0 1rem 0;
  color: #333;
  font-size: 1.1rem;
  text-align: center;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #4A90E2;
}

.mood-card p {
  font-size: 0.9rem;
  color: #666;
  margin: 0.75rem 0 1rem 0;
  line-height: 1.6;
}

/* ミニパレット */
.palette-colors-mini {
  display: flex;
  gap: 0.5rem;
  margin: 1rem 0;
}

.mini-chip {
  flex: 1;
  height: 60px;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease;
}

.mini-chip:hover {
  transform: scale(1.05);
}

/* 使い方ガイド */
.usage-tips {
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: 12px;
  margin: 2rem 0;
}

.usage-tips h4 {
  color: #333;
  margin: 0 0 1rem 0;
  font-size: 1.2rem;
}

.usage-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.usage-step {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  text-align: center;
  border: 2px solid #4A90E2;
  transition: transform 0.2s ease;
}

.usage-step:hover {
  transform: translateY(-4px);
}

.step-number {
  display: inline-block;
  width: 40px;
  height: 40px;
  line-height: 40px;
  background: #4A90E2;
  color: white;
  border-radius: 50%;
  font-weight: 700;
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

.usage-step h5 {
  margin: 0.5rem 0;
  color: #333;
  font-size: 1rem;
}

.usage-step p {
  font-size: 0.85rem;
  color: #666;
  margin: 0.5rem 0 0 0;
  line-height: 1.6;
}

/* アプリケーション例 */
.application-example {
  margin: 2rem 0;
  padding: 2rem;
  background: white;
  border-radius: 12px;
  border: 2px solid #4A90E2;
}

.application-example h4 {
  color: #333;
  margin: 0 0 1.5rem 0;
  font-size: 1.2rem;
  text-align: center;
}

.example-scenario {
  margin: 1.5rem 0;
}

.example-scenario h5 {
  color: #4A90E2;
  margin: 0 0 0.75rem 0;
  font-size: 1.05rem;
}

.example-scenario p {
  color: #666;
  line-height: 1.7;
  margin: 0.5rem 0;
}

.example-scenario ul {
  margin: 0.75rem 0;
  padding-left: 1.5rem;
  line-height: 1.8;
}

.example-scenario ul li {
  margin-bottom: 0.5rem;
}

/* 最終アドバイス */
.final-advice {
  background: linear-gradient(135deg, #e7f5ff 0%, #d0ebff 100%);
  padding: 2rem;
  border-radius: 12px;
  border-left: 4px solid #4A90E2;
  margin: 2rem 0;
}

.final-advice h4 {
  color: #333;
  margin: 0 0 1rem 0;
  font-size: 1.2rem;
}

.final-advice p {
  color: #333;
  line-height: 1.8;
  margin: 0.75rem 0;
  font-weight: 500;
}

.final-advice ul {
  margin: 1rem 0;
  padding-left: 1.5rem;
  line-height: 1.8;
}

.final-advice ul li {
  margin-bottom: 0.75rem;
  color: #333;
}

.final-advice strong {
  color: #4A90E2;
  font-weight: 700;
}

/* モバイル対応 - Tab 6 */
@media (max-width: 768px) {
  .palette-colors {
    flex-direction: column;
  }

  .palette-chip {
    min-width: 100%;
    min-height: 100px;
  }

  .seasonal-grid,
  .mood-grid {
    grid-template-columns: 1fr;
  }

  .usage-steps {
    grid-template-columns: 1fr;
  }

  .application-example {
    padding: 1.5rem;
  }
}

@media (max-width: 600px) {
  .palette-example {
    padding: 1rem;
  }

  .palette-chip {
    min-height: 80px;
  }

  .chip-code {
    font-size: 0.8rem;
  }

  .chip-role {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
  }

  .final-advice {
    padding: 1.5rem;
  }
}
