/* ====================================================================
   ToolMarche - Common Tools Styles
   共通ツールスタイル - すべてのツールで使用
   ==================================================================== */

/* Page Header
   ========================================================================== */
.page-header {
  text-align: center;
  margin-bottom: 40px;
}

.page-icon {
  font-size: 4rem;
  margin-bottom: 16px;
}

.page-title {
  font-size: 2rem;
  font-weight: 700;
  color: #333333;
  margin-bottom: 12px;
}

.page-description {
  font-size: 1rem;
  color: #666666;
  line-height: 1.7;
  max-width: 720px;
  margin: 0 auto;
}

/* Calculator/Tool Section
   ========================================================================== */
.calculator-section {
  margin-bottom: 48px;
}

.input-card {
  margin-bottom: 24px;
}

.results-table-card {
  margin-bottom: 24px;
}

.output-card {
  margin-bottom: 24px;
}

.card-subtitle {
  font-size: 1.25rem;
  font-weight: 700;
  color: #333333;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid #F5F7FA;
}

/* Form Elements
   ========================================================================== */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #333333;
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #E5E7EB;
  border-radius: 8px;
  font-size: 1rem;
  font-family: "Noto Sans JP", sans-serif;
  color: #333333;
  transition: border-color 0.3s ease;
}

.form-input:focus {
  outline: none;
  border-color: #1A73E8;
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

.form-input-small {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid #E5E7EB;
  border-radius: 6px;
  font-size: 0.9375rem;
  font-family: "Noto Sans JP", sans-serif;
  color: #333333;
  transition: border-color 0.3s ease;
  text-align: center;
}

.form-input-small:focus {
  outline: none;
  border-color: #1A73E8;
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

.select-input {
  width: 100%;
  padding: 10px 16px;
  border: 2px solid #E5E7EB;
  border-radius: 6px;
  font-size: 0.9375rem;
  font-family: "Noto Sans JP", sans-serif;
  color: #333333;
  cursor: pointer;
  transition: border-color 0.3s ease;
}

.select-input:focus {
  outline: none;
  border-color: #1A73E8;
}

.form-textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #E5E7EB;
  border-radius: 8px;
  font-size: 1rem;
  font-family: "Noto Sans JP", monospace;
  color: #333333;
  resize: vertical;
  transition: border-color 0.3s ease;
  line-height: 1.6;
  min-height: 120px;
}

.form-textarea:focus {
  outline: none;
  border-color: #1A73E8;
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

.input-with-unit {
  position: relative;
  display: flex;
  align-items: center;
}

.input-unit {
  position: absolute;
  right: 16px;
  font-size: 0.9375rem;
  color: #666666;
  pointer-events: none;
}

.input-with-copy {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.copy-icon-btn {
  padding: 10px 16px;
  background-color: #F5F7FA;
  border: 2px solid #E5E7EB;
  border-radius: 6px;
  font-size: 1.25rem;
  cursor: pointer;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.copy-icon-btn:hover {
  background-color: #1A73E8;
  border-color: #1A73E8;
  color: #FFFFFF;
}

/* Range Slider */
.range-slider {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: #E5E7EB;
  outline: none;
  margin-top: 8px;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #1A73E8;
  cursor: pointer;
}

.range-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #1A73E8;
  cursor: pointer;
  border: none;
}

/* Checkbox */
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9375rem;
  color: #333333;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* Button Styles
   ========================================================================== */
.btn-primary {
  width: 100%;
  padding: 14px 24px;
  background-color: #1A73E8;
  color: #FFFFFF;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-primary:hover {
  background-color: #1557b0;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(26, 115, 232, 0.3);
}

.btn-secondary {
  width: 100%;
  padding: 12px 24px;
  background-color: #F5F7FA;
  color: #333333;
  border: 2px solid #E5E7EB;
  border-radius: 8px;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 12px;
}

.btn-secondary:hover {
  background-color: #E5E7EB;
  border-color: #1A73E8;
}

.button-group {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.button-group .btn-primary,
.button-group .btn-secondary {
  flex: 1;
  margin-top: 0;
}

/* Toolbar
   ========================================================================== */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.toolbar-buttons {
  display: flex;
  gap: 8px;
}

.toolbar-btn {
  padding: 8px 16px;
  background-color: #F5F7FA;
  border: 2px solid #E5E7EB;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  color: #333333;
  cursor: pointer;
  transition: all 0.3s ease;
}

.toolbar-btn:hover {
  background-color: #E5E7EB;
  border-color: #1A73E8;
}

/* Password Generator Specific
   ========================================================================== */
.password-results {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.password-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background-color: #F5F7FA;
  border-radius: 8px;
  border: 2px solid #E5E7EB;
}

.password-text {
  flex: 1;
  font-family: 'Courier New', monospace;
  font-size: 1rem;
  font-weight: 600;
  color: #333333;
  word-break: break-all;
}

.strength-badge {
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.strength-strong {
  background-color: #D1FAE5;
  color: #065F46;
}

.strength-medium {
  background-color: #FEF3C7;
  color: #92400E;
}

.strength-weak {
  background-color: #FEE2E2;
  color: #991B1B;
}

.copy-btn {
  padding: 8px 16px;
  background-color: #FFFFFF;
  border: 2px solid #E5E7EB;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  color: #333333;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.copy-btn:hover {
  background-color: #1A73E8;
  border-color: #1A73E8;
  color: #FFFFFF;
}

.copy-btn.copied {
  background-color: #10B981;
  border-color: #10B981;
  color: #FFFFFF;
}

.empty-state {
  text-align: center;
  color: #999999;
  padding: 40px 20px;
  font-size: 0.9375rem;
}

/* Notepad Specific
   ========================================================================== */
.notepad-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 2px solid #F5F7FA;
  flex-wrap: wrap;
  gap: 12px;
}

.toolbar-left {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.toolbar-right {
  display: flex;
  align-items: center;
}

.save-status {
  font-size: 0.875rem;
  color: #666666;
}

.notepad-textarea {
  width: 100%;
  min-height: 400px;
  padding: 16px;
  border: 2px solid #E5E7EB;
  border-radius: 8px;
  font-size: 1rem;
  font-family: 'Courier New', monospace;
  color: #333333;
  resize: vertical;
  line-height: 1.6;
}

.notepad-textarea:focus {
  outline: none;
  border-color: #1A73E8;
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

.notepad-stats {
  display: flex;
  gap: 24px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.stat-item {
  display: flex;
  gap: 6px;
  font-size: 0.875rem;
}

.stat-label {
  color: #666666;
}

.stat-value {
  color: #333333;
  font-weight: 600;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.action-btn {
  padding: 12px 16px;
  background-color: #F5F7FA;
  border: 2px solid #E5E7EB;
  border-radius: 8px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #333333;
  cursor: pointer;
  transition: all 0.3s ease;
}

.action-btn:hover {
  background-color: #1A73E8;
  border-color: #1A73E8;
  color: #FFFFFF;
}

/* Text Formatter Specific
   ========================================================================== */
.format-options {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.option-group {
  padding: 20px;
  background-color: #F9FAFB;
  border-radius: 8px;
  border: 1px solid #E5E7EB;
}

.option-title {
  font-size: 1rem;
  font-weight: 700;
  color: #333333;
  margin-bottom: 12px;
}

.option-btn {
  padding: 10px 16px;
  background-color: #FFFFFF;
  border: 2px solid #E5E7EB;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  color: #333333;
  cursor: pointer;
  transition: all 0.3s ease;
}

.option-btn:hover {
  background-color: #1A73E8;
  border-color: #1A73E8;
  color: #FFFFFF;
}

.text-stats {
  display: flex;
  gap: 20px;
  margin-top: 8px;
  font-size: 0.875rem;
  color: #666666;
  flex-wrap: wrap;
}

.change-info {
  font-size: 0.875rem;
  margin-top: 8px;
}

/* Color Converter Specific
   ========================================================================== */
.picker-guide {
  font-size: 0.9375rem;
  color: #666666;
  font-weight: 500;
  margin-bottom: 20px;
  text-align: center;
}

.color-picker-container {
  display: flex;
  justify-content: center;
  margin-bottom: 32px;
}

/* 統合カラーピッカー（クリック可能な大きな色見本） */
.color-display-unified {
  position: relative;
  width: 280px;
  height: 280px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

.color-display-unified:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.2);
}

.color-display-unified:active {
  transform: translateY(-2px);
}

.color-display-inner {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 100%);
  pointer-events: none;
}

.display-icon {
  font-size: 4rem;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.2));
  animation: pulse 2s ease-in-out infinite;
}

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

.display-text {
  font-size: 1.125rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  padding: 12px 24px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 24px;
  backdrop-filter: blur(8px);
}

.color-input-hidden {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  border: none;
}

.rgb-inputs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.input-group-small {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-group-small label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #666666;
  text-align: center;
}

.mt-8 {
  margin-top: 8px;
}

.color-presets {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
  gap: 12px;
}

.preset-color {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  border: 2px solid #E5E7EB;
  cursor: pointer;
  transition: all 0.3s ease;
}

.preset-color:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.color-history {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
  gap: 12px;
  min-height: 60px;
}

.history-color {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  border: 2px solid #E5E7EB;
  cursor: pointer;
  transition: all 0.3s ease;
}

.history-color:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Markdown Converter Specific
   ========================================================================== */
.markdown-textarea {
  font-family: 'Courier New', monospace;
  min-height: 300px;
}

.html-textarea {
  font-family: 'Courier New', monospace;
  min-height: 300px;
  background-color: #F9FAFB;
}

.html-preview {
  min-height: 300px;
  padding: 20px;
  background-color: #FFFFFF;
  border: 2px solid #E5E7EB;
  border-radius: 8px;
  overflow-y: auto;
  max-height: 600px;
}

.html-preview h1 {
  font-size: 2rem;
  margin-bottom: 16px;
}

.html-preview h2 {
  font-size: 1.5rem;
  margin-top: 24px;
  margin-bottom: 12px;
}

.html-preview h3 {
  font-size: 1.25rem;
  margin-top: 20px;
  margin-bottom: 10px;
}

.html-preview code {
  padding: 2px 6px;
  background-color: #F5F7FA;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 0.875rem;
}

.html-preview pre {
  padding: 16px;
  background-color: #2D3748;
  color: #E2E8F0;
  border-radius: 8px;
  overflow-x: auto;
  margin: 16px 0;
}

.html-preview pre code {
  background-color: transparent;
  color: inherit;
  padding: 0;
}

.html-preview table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
}

.html-preview table th,
.html-preview table td {
  padding: 8px 12px;
  border: 1px solid #E5E7EB;
}

.html-preview table th {
  background-color: #F5F7FA;
  font-weight: 600;
}

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

.markdown-cheatsheet {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.cheatsheet-item h3 {
  font-size: 1rem;
  font-weight: 700;
  color: #333333;
  margin-bottom: 10px;
}

.cheatsheet-item pre {
  padding: 12px;
  background-color: #F5F7FA;
  border-radius: 6px;
  overflow-x: auto;
}

.cheatsheet-item code {
  font-family: 'Courier New', monospace;
  font-size: 0.875rem;
  color: #333333;
}

/* Usage Guide
   ========================================================================== */
.usage-guide {
  margin-bottom: 48px;
}

.guide-content h3 {
  font-size: 1.125rem;
  font-weight: 700;
  color: #333333;
  margin-bottom: 12px;
}

.guide-content p {
  font-size: 0.9375rem;
  color: #666666;
  line-height: 1.7;
}

.guide-list {
  list-style: disc;
  margin-left: 20px;
  margin-top: 12px;
}

.guide-list li {
  font-size: 0.9375rem;
  color: #666666;
  line-height: 1.8;
  margin-bottom: 8px;
}

/* Responsive Design
   ========================================================================== */
@media screen and (max-width: 768px) {
  .page-icon {
    font-size: 3rem;
  }

  .page-title {
    font-size: 1.5rem;
  }

  .button-group {
    flex-direction: column;
  }

  .button-group .btn-primary,
  .button-group .btn-secondary {
    width: 100%;
  }

  .toolbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .toolbar-buttons {
    width: 100%;
    flex-wrap: wrap;
  }

  .toolbar-btn {
    flex: 1;
    min-width: 100px;
  }

  .rgb-inputs {
    grid-template-columns: repeat(3, 1fr);
  }

  .color-picker-container {
    flex-direction: column;
  }

  .converter-outputs {
    grid-template-columns: 1fr;
  }

  .quick-actions {
    grid-template-columns: 1fr;
  }

  .markdown-cheatsheet {
    grid-template-columns: 1fr;
  }
}

@media screen and (max-width: 480px) {
  .password-item {
    flex-direction: column;
    align-items: stretch;
  }

  .copy-btn {
    width: 100%;
  }

  .rgb-inputs {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .color-presets {
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: 8px;
  }
}

/* ====================================================================
   税金計算・季語一覧・カラーコンバーター用の追加スタイル
   ==================================================================== */

/* 税金計算：テーブルのレスポンシブ対応 */
.tax-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
}

.tax-table th,
.tax-table td {
  padding: 16px;
  text-align: center;
  border-bottom: 1px solid #E5E7EB;
}

.tax-table th {
  background-color: #F5F7FA;
  font-weight: 600;
  color: #333333;
  font-size: 0.9375rem;
}

.tax-table .tax-rate {
  font-weight: 600;
  color: #1A73E8;
}

.tax-table .tax-amount {
  color: #FF6B6B;
  font-weight: 600;
}

.tax-table .total-amount {
  color: #10B981;
  font-weight: 700;
  font-size: 1.125rem;
}

.tax-table .highlight {
  background-color: #FEF3C7;
}

/* スマホ用：テーブルをカード表示に切り替え */
@media screen and (max-width: 640px) {
  .tax-table {
    display: block;
  }

  .tax-table thead {
    display: none;
  }

  .tax-table tbody {
    display: block;
  }

  .tax-table tr {
    display: block;
    margin-bottom: 16px;
    padding: 16px;
    background-color: #FFFFFF;
    border: 2px solid #E5E7EB;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  }

  .tax-table tr.highlight {
    background-color: #FEF3C7;
    border-color: #FCD34D;
  }

  .tax-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #F3F4F6;
    text-align: left;
  }

  .tax-table td:last-child {
    border-bottom: none;
  }

  .tax-table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: #666666;
    margin-right: 10px;
  }

  .tax-table .tax-rate::before {
    content: "税率: ";
  }

  .tax-table .tax-amount::before {
    content: "消費税額: ";
  }

  .tax-table .total-amount::before {
    content: "税込価格: ";
  }
}

/* 季語一覧：月選択ボタンのグリッド */
.month-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.month-btn {
  padding: 14px 18px;
  background-color: #FFFFFF;
  border: 2px solid #E5E7EB;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  color: #333333;
  cursor: pointer;
  transition: all 0.25s ease;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.month-btn:hover {
  background-color: #F0F7FF;
  border-color: #1A73E8;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(26, 115, 232, 0.15);
}

.month-btn.active {
  background: linear-gradient(135deg, #1A73E8 0%, #1557b0 100%);
  border-color: #1A73E8;
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(26, 115, 232, 0.3);
  transform: scale(1.05);
}

.month-btn.current-month {
  border-color: #10B981;
  background-color: #F0FDF4;
}

.month-btn.current-month.active {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  border-color: #10B981;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

@media screen and (max-width: 768px) {
  .month-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
  }

  .month-btn {
    padding: 12px 14px;
    font-size: 0.9375rem;
  }
}

@media screen and (max-width: 480px) {
  .month-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .month-btn {
    padding: 10px 12px;
    font-size: 0.875rem;
  }
}

/* ローディング表示 */
.loading-spinner {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 4px solid #F3F4F6;
  border-top: 4px solid #1A73E8;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 20px auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-text {
  text-align: center;
  color: #666666;
  margin-top: 12px;
  font-size: 0.9375rem;
}

/* カラーコード変換：レイアウト調整 */
.color-picker-container {
  display: flex;
  gap: 20px;
  align-items: center;
  margin-bottom: 24px;
  padding: 20px;
  background-color: #F5F7FA;
  border-radius: 8px;
}

.color-display {
  width: 120px;
  height: 120px;
  border-radius: 12px;
  border: 3px solid #FFFFFF;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}

.color-input {
  width: 120px;
  height: 50px;
  border: 2px solid #E5E7EB;
  border-radius: 8px;
  cursor: pointer;
}

@media screen and (max-width: 640px) {
  .color-picker-container {
    flex-direction: column;
    gap: 16px;
    padding: 16px;
  }

  .color-display {
    width: 100px;
    height: 100px;
  }

  .color-input {
    width: 100%;
    max-width: 300px;
  }
}

/* 計算タイプセレクター（税金計算用） */
.calc-type-selector {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.calc-type-btn {
  padding: 14px 20px;
  background-color: #F5F7FA;
  border: 2px solid #E5E7EB;
  border-radius: 8px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #333333;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
}

.calc-type-btn:hover {
  background-color: #E5E7EB;
  border-color: #1A73E8;
}

.calc-type-btn.active {
  background-color: #1A73E8;
  border-color: #1A73E8;
  color: #FFFFFF;
}

@media screen and (max-width: 480px) {
  .calc-type-selector {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .calc-type-btn {
    padding: 12px 16px;
    font-size: 0.875rem;
  }
}

/* 計算メモ（税金計算用） */
.calculation-note {
  padding: 16px;
  background-color: #F0F9FF;
  border-left: 4px solid #1A73E8;
  border-radius: 4px;
  margin-top: 20px;
}

.calculation-note p {
  font-size: 0.875rem;
  color: #333333;
  line-height: 1.6;
  margin: 0;
}

.calculation-note strong {
  color: #1A73E8;
  font-weight: 600;
}

/* Tax Calculator Modern Card UI
   ========================================================================== */
.tax-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.tax-result-card {
  background-color: #FFFFFF;
  border: 2px solid #E5E7EB;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.tax-result-card:hover {
  border-color: #1A73E8;
  box-shadow: 0 4px 12px rgba(26, 115, 232, 0.15);
  transform: translateY(-2px);
}

.tax-result-card.highlighted {
  border-color: #10B981;
  background: linear-gradient(to bottom, #F0FDF4 0%, #FFFFFF 100%);
}

.tax-card-header {
  background: linear-gradient(135deg, #1A73E8 0%, #1557b0 100%);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tax-result-card.highlighted .tax-card-header {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
}

.tax-card-rate {
  font-size: 2rem;
  font-weight: 700;
  color: #FFFFFF;
  line-height: 1;
}

.tax-card-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
}

.tax-card-body {
  padding: 20px;
}

.tax-card-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #F5F7FA;
}

.tax-card-item:last-child {
  border-bottom: none;
}

.tax-card-item-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #666666;
}

.tax-card-item-value {
  font-size: 1.125rem;
  font-weight: 600;
  color: #333333;
  font-family: 'Courier New', monospace;
}

.tax-amount-row .tax-card-item-value {
  color: #1A73E8;
  font-size: 1.25rem;
}

.total-row {
  margin-top: 8px;
  padding-top: 16px;
  border-top: 2px solid #E5E7EB;
}

.total-row .tax-card-item-label {
  font-size: 1rem;
  font-weight: 700;
  color: #333333;
}

.total-row .tax-card-item-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: #1A73E8;
}

.tax-result-card.highlighted .total-row .tax-card-item-value {
  color: #10B981;
}

/* Responsive adjustments */
@media screen and (max-width: 768px) {
  .tax-results-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .tax-card-header {
    padding: 14px 16px;
  }

  .tax-card-body {
    padding: 16px;
  }

  .tax-card-rate {
    font-size: 1.75rem;
  }

  .total-row .tax-card-item-value {
    font-size: 1.5rem;
  }
}

/* ====================================================================
   カスタムラジオボタン & トグルスイッチ
   ==================================================================== */

/* Custom Radio Buttons
   ========================================================================== */
.radio-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9375rem;
  color: #333333;
  cursor: pointer;
  position: relative;
  padding-left: 32px;
  min-height: 24px;
  user-select: none;
}

/* ブラウザ標準のラジオボタンを非表示 */
.radio-label input[type="radio"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  width: 0;
  height: 0;
}

/* カスタムラジオボタンの外側の円 */
.radio-label .radio-custom {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border: 2px solid #E5E7EB;
  border-radius: 50%;
  background-color: #FFFFFF;
  transition: all 0.3s ease;
}

/* ホバー時 */
.radio-label:hover .radio-custom {
  border-color: #1A73E8;
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

/* 選択時の外側の円 */
.radio-label input[type="radio"]:checked ~ .radio-custom {
  border-color: #1A73E8;
  background-color: #FFFFFF;
}

/* 選択時の内側の円（ドット） */
.radio-label input[type="radio"]:checked ~ .radio-custom::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #1A73E8;
}

/* フォーカス時のアクセシビリティ対応 */
.radio-label input[type="radio"]:focus-visible ~ .radio-custom {
  outline: 2px solid #1A73E8;
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.2);
}

/* 無効状態 */
.radio-label input[type="radio"]:disabled ~ .radio-custom {
  border-color: #E5E7EB;
  background-color: #F5F7FA;
  cursor: not-allowed;
}

.radio-label input[type="radio"]:disabled {
  cursor: not-allowed;
}

/* Toggle Switch
   ========================================================================== */
.switch-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.switch-label {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9375rem;
  color: #333333;
  cursor: pointer;
  user-select: none;
}

/* ブラウザ標準のチェックボックスを非表示 */
.switch-label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  width: 0;
  height: 0;
}

/* トグルスイッチの背景 */
.switch-label .switch {
  position: relative;
  width: 48px;
  height: 24px;
  background-color: #E5E7EB;
  border-radius: 24px;
  transition: all 0.3s ease;
}

/* トグルスイッチの丸（ノブ） */
.switch-label .switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background-color: #FFFFFF;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

/* ホバー時 */
.switch-label:hover .switch {
  background-color: #D1D5DB;
}

/* チェック時の背景 */
.switch-label input[type="checkbox"]:checked ~ .switch {
  background-color: #1A73E8;
}

/* チェック時のノブ位置 */
.switch-label input[type="checkbox"]:checked ~ .switch::after {
  left: 26px;
}

/* フォーカス時のアクセシビリティ対応 */
.switch-label input[type="checkbox"]:focus-visible ~ .switch {
  outline: 2px solid #1A73E8;
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.2);
}

/* 無効状態 */
.switch-label input[type="checkbox"]:disabled ~ .switch {
  background-color: #F5F7FA;
  cursor: not-allowed;
}

.switch-label input[type="checkbox"]:disabled ~ .switch::after {
  background-color: #E5E7EB;
}

.switch-label input[type="checkbox"]:disabled {
  cursor: not-allowed;
}

/* アクセシビリティ: すべてのインタラクティブ要素に対するフォーカス対応
   ========================================================================== */

/* ボタン */
.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.toolbar-btn:focus-visible,
.option-btn:focus-visible,
.copy-btn:focus-visible,
.action-btn:focus-visible {
  outline: 2px solid #1A73E8;
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.2);
}

/* 入力フォーム */
.form-input:focus-visible,
.form-input-small:focus-visible,
.select-input:focus-visible,
.form-textarea:focus-visible,
.notepad-textarea:focus-visible {
  outline: 2px solid #1A73E8;
  outline-offset: 2px;
}

/* リンク */
a:focus-visible {
  outline: 2px solid #1A73E8;
  outline-offset: 2px;
  border-radius: 2px;
}

/* 月選択ボタン */
.month-btn:focus-visible {
  outline: 2px solid #1A73E8;
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.2);
}

/* カラーピッカー系 */
.preset-color:focus-visible,
.history-color:focus-visible {
  outline: 2px solid #1A73E8;
  outline-offset: 2px;
}

/* キーボードナビゲーション時のスムーズスクロール */
html {
  scroll-behavior: smooth;
}

/* スキップリンク（スクリーンリーダー対応） */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #1A73E8;
  color: #FFFFFF;
  padding: 8px 16px;
  text-decoration: none;
  border-radius: 0 0 4px 0;
  z-index: 10000;
  transition: top 0.3s;
}

.skip-link:focus {
  top: 0;
}

/* ====================================================================
   Upload Area (for image tools)
   ==================================================================== */
.upload-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px 20px;
  border: 2px dashed #d1d5db;
  border-radius: 8px;
  background: #f9fafb;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-bottom: 30px;
  position: relative;
  min-height: 200px;
}

.upload-area:hover,
.upload-area.dragover {
  border-color: #10b981;
  background: #ecfdf5;
}

.upload-icon {
  font-size: 3rem;
  margin: 0;
}

.upload-text {
  font-size: 1.125rem;
  font-weight: 600;
  color: #333333;
  margin: 0;
}

.upload-subtext {
  font-size: 0.875rem;
  color: #666666;
  margin: 0;
}

.upload-note {
  font-size: 0.875rem;
  color: #999999;
  margin: 0;
}

/* Tab Navigation (for image-compressor)
   ========================================================================== */
.tab-navigation {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  border-bottom: 2px solid #E5E7EB;
  padding-bottom: 0;
}

.tab-btn {
  padding: 12px 24px;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  font-size: 1rem;
  font-weight: 600;
  color: #666666;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-bottom: -2px;
}

.tab-btn:hover {
  color: #1A73E8;
  background: #F5F7FA;
}

.tab-btn.active {
  color: #1A73E8;
  border-bottom-color: #1A73E8;
}

.tab-content {
  display: none;
}

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

/* Preset Grid (for image-cropper)
   ========================================================================== */
.preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.preset-btn {
  padding: 16px;
  background: #FFFFFF;
  border: 2px solid #E5E7EB;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.preset-btn:hover {
  border-color: #1A73E8;
  background: #F0F7FF;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(26, 115, 232, 0.15);
}

.preset-btn.active {
  border-color: #1A73E8;
  background: #E3F2FD;
  box-shadow: 0 2px 8px rgba(26, 115, 232, 0.2);
}

/* Cropper Container
   ========================================================================== */
.cropper-container {
  max-height: 600px;
  background: #f3f4f6;
  border-radius: 8px;
  overflow: hidden;
  margin: 20px 0;
}

/* Form Elements (additional)
   ========================================================================== */
.text-input {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid #E5E7EB;
  border-radius: 6px;
  font-size: 0.9375rem;
  font-family: "Noto Sans JP", sans-serif;
  color: #333333;
  transition: border-color 0.3s ease;
}

.text-input:focus {
  outline: none;
  border-color: #1A73E8;
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

.slider {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: #E5E7EB;
  outline: none;
  -webkit-appearance: none;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #1A73E8;
  cursor: pointer;
}

.slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #1A73E8;
  cursor: pointer;
  border: none;
}

.hint-text {
  font-size: 0.875rem;
  color: #666666;
  margin-top: 8px;
}

.description {
  font-size: 0.9375rem;
  color: #666666;
  margin-bottom: 16px;
  line-height: 1.6;
}

.section-heading {
  font-size: 1.375rem;
  font-weight: 700;
  color: #333333;
  margin-bottom: 16px;
}

/* Radio Group (horizontal for device/color selection)
   ========================================================================== */
.radio-group-horizontal {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.radio-group-horizontal .radio-label {
  padding-left: 0;
  background: #F5F7FA;
  padding: 12px 16px;
  border-radius: 8px;
  border: 2px solid #E5E7EB;
  transition: all 0.3s ease;
  min-height: auto;
}

.radio-group-horizontal .radio-label:hover {
  border-color: #1A73E8;
  background: #F0F7FF;
}

.radio-group-horizontal .radio-label input[type="radio"] {
  position: relative;
  opacity: 1;
  width: auto;
  height: auto;
  margin-right: 8px;
}

.radio-group-horizontal .radio-label input[type="radio"]:checked ~ span,
.radio-group-horizontal .radio-label:has(input[type="radio"]:checked) {
  background: #E3F2FD;
  border-color: #1A73E8;
  font-weight: 600;
}

/* ====================================================================
   Unified Layout Grid (Added for UI consistency)
   ==================================================================== */
.tool-wrapper-grid {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* PC layout: Side by side */
@media screen and (min-width: 992px) {
  .tool-wrapper-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Default: 50% 50% */
    align-items: start;
  }

  .tool-wrapper-grid.input-left-result-right {
    grid-template-columns: 1fr 360px; /* Input wide, Result narrow */
  }

  .tool-wrapper-grid.result-left-input-right {
    grid-template-columns: 320px 1fr; /* Result narrow, Input wide */
  }

  /* Make result cards sticky on PC */
  .tool-wrapper-grid .result-card-sticky {
    position: sticky;
    top: 24px;
  }
}

/* Standardize Trust Signal / Metadata */
.tool-meta .card {
  background: #f9fafb;
  border-left: 3px solid #1A73E8; /* Default color, can be overridden */
  padding: 16px;
  border-radius: 8px;
}

