@charset "UTF-8";
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: "Noto Sans JP", sans-serif;
  font-size: 16px;
  line-height: 1.7;
  background: #1c1c1c;
  color: #ffffff;
  padding-top: 80px;
}
@media screen and (min-width: 768px) {
  body {
    padding-top: 100px;
  }
}

/* コンテナ */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
}
@media screen and (min-width: 768px) {
  .container {
    padding-left: 30px;
    padding-right: 30px;
  }
}

/* 見出し */
h1 {
  text-align: center;
  margin-bottom: 2rem;
  font-family: "Montserrat", sans-serif;
  font-size: 2rem;
  font-weight: bold;
}

h2 {
  margin: 2rem 0 1rem;
  font-size: 1.75rem;
  font-weight: 700;
  text-align: center;
  font-family: "Montserrat", sans-serif;
  letter-spacing: 0.05em;
}
@media screen and (min-width: 768px) {
  h2 {
    font-size: 2rem;
  }
}

h3 {
  margin: 1.5rem 0 1rem;
  font-size: 1.25rem;
  font-weight: bold;
}

.section-description {
  text-align: center;
  color: #a1a1aa;
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

/* 推定器タブ */
.estimator-tabs {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid #404040;
}

.estimator-tab {
  padding: 0.75rem 1.5rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: #a0a0a0;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
}

.estimator-tab:hover {
  color: #ffffff;
}

.estimator-tab.active {
  color: #ffffff;
  border-bottom-color: #ffffff;
}

.estimator-form {
  display: none;
}

.estimator-form.active {
  display: block;
}

/* ヘッダー */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: rgba(28, 28, 28, 0.95);
  backdrop-filter: blur(10px);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  border-bottom: 1px solid transparent;
}
.header.is-scrolled {
  background: rgba(28, 28, 28, 0.98);
  border-bottom-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}
.header__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 15px;
}
@media screen and (min-width: 768px) {
  .header__inner {
    padding-left: 30px;
    padding-right: 30px;
    padding-bottom: 21px;
    max-width: 1200px;
    margin: 0 auto;
  }
}

.header__logo {
  padding-top: 6px;
}
.header__logo a {
  display: block;
  transition: transform 0.3s ease;
}
.header__logo a:hover {
  transform: scale(1.05);
}
.header__logo a img {
  transition: filter 0.3s ease;
}
.header__logo a:hover img {
  filter: brightness(1.1);
}
.header__logo img {
  width: 100px;
  display: block;
}
@media screen and (min-width: 768px) {
  .header__logo img {
    width: 135px;
  }
}

.header__nav {
  display: none;
}
@media screen and (min-width: 768px) {
  .header__nav {
    display: flex;
    align-items: center;
    gap: 40px;
  }
}
.header__link {
  font-weight: 700;
  letter-spacing: 0.48px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  padding: 4px 0;
}
.header__link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: #ffffff;
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.header__link:hover {
  color: #ffffff;
  transform: translateY(-2px);
}
.header__link:hover::after {
  width: 100%;
}
@media screen and (min-width: 768px) {
  .header__nav {
    display: flex;
    align-items: center;
    gap: 40px;
  }
}

.header__link {
  font-weight: 700;
  letter-spacing: 0.48px;
  transition: color 0.3s;
  color: #ffffff;
  text-decoration: none;
}
.header__link:hover {
  color: #a0a0a0;
}

.header__open {
  margin-top: 3px;
  background: none;
  border: none;
  cursor: pointer;
}
@media screen and (min-width: 768px) {
  .header__open {
    display: none;
  }
}

.drawer-icon {
  width: 36px;
  height: 21px;
  position: relative;
  z-index: 51;
}
.drawer-icon.is-checked .drawer-icon__bar:nth-of-type(1) {
  top: 10px;
  transform: rotate(30deg);
}
.drawer-icon.is-checked .drawer-icon__bar:nth-of-type(2) {
  display: none;
}
.drawer-icon.is-checked .drawer-icon__bar:nth-of-type(3) {
  top: 10px;
  transform: rotate(-30deg);
}

.drawer-icon__bar {
  position: absolute;
  top: 0;
  left: 0;
  width: 36px;
  height: 3px;
  border-radius: 6px;
  background: #ffffff;
  transition: transform 0.3s linear, top 0.3s linear;
}
.drawer-icon__bar:nth-of-type(2) {
  top: 9px;
}
.drawer-icon__bar:nth-of-type(3) {
  top: 18px;
}

.drawer-content {
  width: 320px;
  height: 100%;
  position: fixed;
  top: 0;
  right: 0;
  background: #1c1c1c;
  z-index: 50;
  padding: 86px 40px 40px;
  transform: translateX(100%);
  transition: transform 0.3s linear;
}
.drawer-content.is-checked {
  transform: translateX(0);
}

.drawer-content__link {
  display: block;
  padding-top: 14px;
  padding-bottom: 14px;
  text-align: right;
  font-weight: 700;
  letter-spacing: 0.48px;
  color: #ffffff;
  text-decoration: none;
}

/* タブナビゲーション */
.tab-navigation {
  display: flex;
  gap: 12px;
  margin-bottom: 2rem;
  border-bottom: 2px solid rgba(82, 82, 91, 0.6);
  padding: 0 1rem;
}

.tab-button {
  padding: 12px 24px;
  background: none;
  border: none;
  color: #a1a1aa;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.48px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.tab-button::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: #ffffff;
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.tab-button:hover {
  color: #ffffff;
  transform: translateY(-2px);
}

.tab-button:hover::after {
  width: 100%;
}

.tab-button.active {
  color: #ffffff;
  border-bottom-color: #ffffff;
}

.tab-button.active::after {
  width: 100%;
}

.tab-section {
  display: none;
}

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

/* フォーム */
.form-card {
  background: linear-gradient(180deg, #323232 0%, #525252 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  margin-bottom: 2rem;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.form-card:hover {
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transform: translateY(-2px);
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.label {
  font-size: 0.9rem;
  color: #d4d4d8;
}

.help-text {
  margin: 0;
  font-size: 0.78rem;
  color: #a1a1aa;
  line-height: 1.5;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
}

.input,
.select {
  appearance: none;
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 12px 14px;
  font-size: 1rem;
  background: rgba(28, 28, 28, 0.8);
  color: #ffffff;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: inherit;
}

.input:focus,
.select:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(40, 40, 40, 0.9);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}
.input:hover,
.select:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.details {
  margin-top: 8px;
}

.summary {
  cursor: pointer;
  color: #a0a0a0;
  font-size: 0.88rem;
  padding: 8px 0;
}

.summary:hover {
  color: #ffffff;
}

.label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.secondary-button {
  border-radius: 60px;
  border: 2px solid currentColor;
  background: #1c1c1c;
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.48px;
  padding: 8px 20px;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: inherit;
  position: relative;
  overflow: hidden;
}
.secondary-button::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}
.secondary-button:hover::before {
  width: 200px;
  height: 200px;
}
.secondary-button:hover:not(:disabled) {
  background-color: #525252;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}
.secondary-button:active {
  transform: translateY(0);
}

.formula-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: #e4e4e7;
}

.checkbox-label input {
  width: 16px;
  height: 16px;
}

.submit-button {
  margin-top: 8px;
  border: 2px solid currentColor;
  border-radius: 60px;
  padding: 8px 28px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.48px;
  color: #ffffff;
  background: #1c1c1c;
  cursor: pointer;
  min-width: 150px;
  text-align: center;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
  font-family: inherit;
}
.submit-button::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}
.submit-button:hover::before {
  width: 300px;
  height: 300px;
}
.submit-button:hover {
  background-color: #525252;
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}
.submit-button:active {
  transform: translateY(-1px);
}

/* セグメントコントロール */
.segmented {
  display: flex;
  gap: 0;
  border-radius: 12px;
  background: rgba(39, 39, 42, 0.7);
  border: 1px solid rgba(82, 82, 91, 0.5);
  overflow: hidden;
}

.segmented input[type="radio"] {
  display: none;
}

.segmented-label {
  flex: 1;
  padding: 10px 16px;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  font-size: 0.9rem;
}

.segmented input[type="radio"]:checked + .segmented-label {
  background: #808080;
  color: #ffffff;
  font-weight: 600;
}

.segmented input[type="radio"]:not(:checked) + .segmented-label:hover {
  background: rgba(63, 63, 70, 0.6);
}

.range {
  width: 100%;
  margin: 8px 0;
}

.hint {
  font-size: 0.85rem;
  color: #a1a1aa;
  margin-top: 4px;
}

/* 結果表示 */
.result-container {
  margin-top: 2rem;
}

.result-card {
  background: rgba(17, 24, 39, 0.7);
  border: 1px solid rgba(63, 63, 70, 0.5);
  border-radius: 18px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.highlight-value {
  font-size: 2.4rem;
  font-weight: 700;
  color: #ffffff;
  text-align: center;
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.stat-item {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(39, 39, 42, 0.8);
  border: 1px solid rgba(82, 82, 91, 0.6);
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.9rem;
}

.stat-item strong {
  font-size: 1.2rem;
  color: #ffffff;
}

.formula-table,
.macro-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid rgba(63, 63, 70, 0.6);
  border-radius: 12px;
  overflow: hidden;
}

.formula-table th,
.formula-table td,
.macro-table th,
.macro-table td {
  text-align: left;
  padding: 12px 16px;
  font-size: 0.92rem;
}

.formula-table thead,
.macro-table thead {
  background: rgba(24, 24, 27, 0.85);
}

.formula-table tbody tr:nth-child(odd),
.macro-table tbody tr:nth-child(odd) {
  background: rgba(39, 39, 42, 0.6);
}

.result-sub {
  font-size: 0.85rem;
  color: #a1a1aa;
  text-align: center;
}

.per-meal {
  padding: 12px;
  background: rgba(128, 128, 128, 0.2);
  border-radius: 8px;
  font-size: 0.9rem;
  color: #d4d4d8;
}

.note {
  padding: 12px;
  background: rgba(128, 128, 128, 0.2);
  border-radius: 8px;
  font-size: 0.85rem;
  color: #d4d4d8;
}

/* 履歴 */
.history-section {
  margin-top: 2rem;
}

.history-list {
  background: linear-gradient(180deg, #323232 0%, #525252 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.history-item {
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(63, 63, 70, 0.4);
}

.history-item-clickable {
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.history-item-clickable:hover {
  background-color: rgba(255, 255, 255, 0.02);
  border-radius: 4px;
  padding: 8px;
  margin: -8px;
}

.history-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  gap: 12px;
}

.history-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  gap: 12px;
  flex-wrap: wrap;
}

.history-item-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  flex: 1;
}

.history-item-info strong {
  font-weight: 600;
  color: #ffffff;
}

.history-item-info span {
  color: #a0a0a0;
  font-size: 0.9rem;
}

.history-type-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  background: rgba(82, 82, 82, 0.5);
  border: 1px solid #525252;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #ffffff;
  margin-left: 0.5rem;
}

.history-item-info time {
  color: #808080;
  font-size: 0.85rem;
}

.history-item-delete {
  padding: 0.4rem 0.8rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #808080;
  background: transparent;
  border: 1px solid #525252;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
  flex-shrink: 0;
}

.history-item-delete:hover {
  color: #ffffff;
  border-color: #808080;
  background: #323232;
}

.history-item-load {
  padding: 0.4rem 0.8rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #ffffff;
  background: #404040;
  border: 1px solid #525252;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
  flex-shrink: 0;
}

.history-item-load:hover {
  background: #4a4a4a;
  border-color: #808080;
}

.history-value {
  font-size: 1.2rem;
  font-weight: 600;
  color: #ffffff;
}

.history-empty {
  text-align: center;
  color: #808080;
  padding: 2rem;
  font-size: 0.9rem;
}

.history-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* プログラム生成 */
.program-header {
  margin-bottom: 2.5rem;
}

.program-header h2 {
  margin-bottom: 0.75rem;
  font-size: 2rem;
  font-weight: 700;
  color: #ffffff;
  font-family: "Montserrat", sans-serif;
  letter-spacing: 0.05em;
}
@media screen and (min-width: 768px) {
  .program-header h2 {
    font-size: 2.5rem;
  }
}

.program-form-card {
  background: linear-gradient(180deg, #323232 0%, #525252 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 2.5rem;
  margin-bottom: 3rem;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.program-form-card:hover {
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transform: translateY(-2px);
}

.program-form-header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #404040;
}

.program-form-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 0.5rem 0;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.program-form-subtitle {
  font-size: 0.85rem;
  color: #808080;
  margin: 0;
  letter-spacing: 0.02em;
}

.program-input-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.program-input-card {
  background: linear-gradient(180deg, #323232 0%, #525252 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.program-input-card:focus-within {
  border-color: rgba(255, 255, 255, 0.3);
  background: linear-gradient(180deg, #3a3a3a 0%, #5a5a5a 100%);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transform: translateY(-2px);
}

.program-input-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.program-input-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.program-input-label {
  display: flex;
  align-items: center;
  font-weight: 600;
  color: #ffffff;
  font-size: 1rem;
  cursor: pointer;
  letter-spacing: 0.03em;
}

.exercise-name {
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-size: 0.9rem;
}

.exercise-unit {
  font-size: 0.75rem;
  color: #808080;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

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

.program-input {
  width: 100%;
  padding: 1.125rem 3.5rem 1.125rem 1.25rem;
  font-size: 1.5rem;
  font-weight: 300;
  border: 1px solid #404040;
  border-radius: 6px;
  background: #252525;
  color: #ffffff;
  transition: all 0.3s ease;
  box-sizing: border-box;
  -moz-appearance: textfield;
  font-family: "Montserrat", sans-serif;
}

.program-input::-webkit-outer-spin-button,
.program-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.program-input:focus {
  outline: none;
  border-color: #ffffff;
  background: #323232;
}

.program-input::placeholder {
  color: #525252;
  font-weight: 400;
}

.input-suffix {
  position: absolute;
  right: 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #808080;
  pointer-events: none;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.program-actions-wrapper {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid #404040;
}

.program-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.program-primary-button {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 28px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.48px;
  color: #ffffff;
  background: #1c1c1c;
  border: 2px solid currentColor;
  border-radius: 60px;
  cursor: pointer;
  min-width: 150px;
  text-align: center;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
  font-family: inherit;
}
.program-primary-button::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}
.program-primary-button:hover::before {
  width: 300px;
  height: 300px;
}
.program-primary-button:hover {
  background-color: #525252;
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}
.program-primary-button:active {
  transform: translateY(-1px);
}

.program-secondary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.program-secondary-button {
  padding: 8px 20px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.48px;
  color: #ffffff;
  background: #1c1c1c;
  border: 2px solid currentColor;
  border-radius: 60px;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: inherit;
  position: relative;
  overflow: hidden;
}
.program-secondary-button::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}
.program-secondary-button:hover::before {
  width: 200px;
  height: 200px;
}
.program-secondary-button:hover {
  background-color: #525252;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}
.program-secondary-button:active {
  transform: translateY(0);
}

.program-help-text {
  font-size: 0.8rem;
  color: #808080;
  line-height: 1.6;
  margin: 0;
  letter-spacing: 0.01em;
}

.program-error {
  background: rgba(128, 128, 128, 0.15);
  border: 2px solid #808080;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  color: #ffffff;
  margin-top: 1.5rem;
  font-size: 0.9rem;
  line-height: 1.6;
  white-space: pre-line;
}

.week-selector-wrapper {
  margin: 2.5rem 0;
}

.week-selector-header {
  margin-bottom: 1.5rem;
}

.week-selector-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 0.5rem 0;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.week-selector-subtitle {
  font-size: 0.85rem;
  color: #808080;
  margin: 0;
  letter-spacing: 0.02em;
}

.week-selector-form {
  margin-bottom: 1.5rem;
}

.week-selector-form .label {
  display: block;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 0.75rem;
  font-size: 1rem;
  letter-spacing: 0.02em;
}

.week-description-card {
  background: #1c1c1c;
  border: 1px solid #404040;
  border-radius: 6px;
  padding: 1.25rem 1.5rem;
  margin-top: 1.5rem;
}

.week-description-card .help-text {
  margin: 0;
  color: #808080;
  font-size: 0.85rem;
  line-height: 1.7;
  letter-spacing: 0.01em;
}

.result-section {
  display: none;
  margin-top: 2.5rem;
}

.result-section.active {
  display: block;
  animation: fadeInUp 0.5s ease;
}

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

.result-card {
  background: linear-gradient(180deg, #323232 0%, #525252 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 2.5rem;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.result-card:hover {
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #404040;
  flex-wrap: wrap;
  gap: 1rem;
}

.result-header-content {
  flex: 1;
}

.result-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 0.5rem 0;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.result-subtitle {
  font-size: 0.85rem;
  color: #808080;
  margin: 0;
  letter-spacing: 0.02em;
}

.result-copy-button {
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #a0a0a0;
  background: transparent;
  border: 1px solid #525252;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
  letter-spacing: 0.02em;
}

.result-copy-button:hover {
  color: #ffffff;
  border-color: #808080;
  background: #323232;
}

.result-footer {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #404040;
}

.result-actions {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.result-save-button,
.result-load-button {
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #ffffff;
  background: #404040;
  border: 1px solid #525252;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
  letter-spacing: 0.02em;
}

.result-save-button:hover,
.result-load-button:hover {
  background: #4a4a4a;
  border-color: #808080;
}

.history-section .history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.saved-programs-section,
.saved-nutrition-section {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid #404040;
}

.saved-programs-section h3,
.saved-nutrition-section h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 1.5rem 0;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.saved-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.saved-item {
  background: linear-gradient(180deg, #323232 0%, #525252 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1.25rem;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.saved-item:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: linear-gradient(180deg, #3a3a3a 0%, #5a5a5a 100%);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transform: translateY(-2px);
}

.saved-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.saved-item-header strong {
  font-size: 1rem;
  font-weight: 600;
  color: #ffffff;
}

.saved-item-date {
  font-size: 0.8rem;
  color: #808080;
}

.saved-item-content {
  margin-bottom: 1rem;
}

.saved-item-inputs,
.saved-item-results {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: #a0a0a0;
}

.saved-item-inputs span,
.saved-item-results span {
  padding: 0.25rem 0.75rem;
  background: #323232;
  border-radius: 4px;
}

.saved-item-actions {
  display: flex;
  gap: 0.5rem;
}

.saved-item-load,
.saved-item-delete {
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid #525252;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
}

.saved-item-load {
  color: #ffffff;
  background: #404040;
}

.saved-item-load:hover {
  background: #4a4a4a;
  border-color: #808080;
}

.saved-item-delete {
  color: #808080;
  background: transparent;
}

.saved-item-delete:hover {
  color: #ffffff;
  border-color: #808080;
  background: #323232;
}

.result-disclaimer {
  padding: 1rem 1.25rem;
  background: rgba(128, 128, 128, 0.05);
  border-left: 2px solid #808080;
  border-radius: 4px;
  color: #808080;
  font-size: 0.8rem;
  line-height: 1.7;
  margin: 0;
  letter-spacing: 0.01em;
}

@media screen and (min-width: 768px) {
  .program-input-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .program-actions {
    flex-direction: row;
    align-items: center;
  }
  
  .program-primary-button {
    flex: 0 1 auto;
    min-width: 220px;
  }
  
  .week-selector-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .result-header {
    align-items: center;
  }
  
  .exercise-header-name {
    font-size: 1.25rem;
  }
  
  .sets-value,
  .reps-value {
    font-size: 1.25rem !important;
  }
  
  .weight-value {
    font-size: 1.75rem !important;
  }
}

@media screen and (max-width: 767px) {
  .exercise-header-cell {
    padding: 1.25rem 1rem !important;
  }
  
  .exercise-header-name {
    font-size: 1rem;
    display: block;
    margin-bottom: 0.5rem;
  }
  
  .exercise-header-1rm {
    font-size: 0.8rem;
  }
  
  .exercise-set-row td {
    padding: 0.875rem 0.75rem;
  }
  
  .set-number {
    font-size: 0.7rem !important;
    padding-left: 1rem !important;
    width: 60px;
  }
  
  .sets-value,
  .reps-value {
    font-size: 1rem !important;
  }
  
  .weight-value {
    font-size: 1.25rem !important;
  }
}

.table-container {
  width: 100%;
  overflow-x: auto;
  margin-top: 1rem;
}

.workout-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-bottom: 0;
  background: linear-gradient(180deg, #323232 0%, #525252 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.workout-table thead {
  background: rgba(28, 28, 28, 0.8);
}

.workout-table th {
  padding: 1.25rem 1rem;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #ffffff;
  border-bottom: 1px solid #404040;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.workout-table th:first-child {
  text-align: left;
  padding-left: 1.5rem;
}

.workout-table th:last-child {
  padding-right: 1.5rem;
}

.workout-table td {
  padding: 1.25rem 1rem;
  text-align: center;
  font-size: 0.95rem;
  color: #ffffff;
  border-bottom: 1px solid #252525;
  transition: all 0.2s ease;
  position: relative;
}

.workout-table tbody tr {
  transition: background-color 0.2s ease;
}

.workout-table tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.workout-table tbody tr:hover td {
  color: #ffffff;
}

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

.table-col-exercise {
  text-align: left !important;
  padding-left: 1.5rem !important;
  font-weight: 600;
  color: #ffffff;
}

.table-col-sets,
.table-col-reps {
  font-weight: 500;
  color: #e0e0e0;
}

.table-col-weight {
  font-weight: 300;
  font-size: 1.25rem;
  color: #ffffff;
  position: relative;
  font-family: "Montserrat", sans-serif;
}

.table-col-weight::after {
  content: 'kg';
  font-size: 0.7rem;
  font-weight: 400;
  color: #808080;
  margin-left: 0.5rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.workout-table tbody tr:nth-child(even) {
  background-color: rgba(255, 255, 255, 0.02);
}

.workout-table tbody tr:nth-child(even):hover {
  background-color: rgba(255, 255, 255, 0.08);
}

/* 種目ヘッダー行 */
.exercise-header-row {
  background: rgba(28, 28, 28, 0.9) !important;
}

.exercise-header-row:hover {
  background: rgba(28, 28, 28, 0.9) !important;
}

.exercise-header-cell {
  padding: 1.5rem 1.5rem !important;
  text-align: left !important;
  border-bottom: 2px solid #525252 !important;
}

.exercise-header-name {
  font-size: 1.125rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.03em;
  display: inline-block;
  margin-right: 1.5rem;
}

.exercise-header-1rm {
  font-size: 0.875rem;
  font-weight: 500;
  color: #808080;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* セット行 */
.exercise-set-row {
  background: transparent;
}

.exercise-set-row.first-set {
  border-top: 1px solid #404040;
}

.exercise-set-row:hover {
  background: rgba(255, 255, 255, 0.05);
}

.exercise-set-row td {
  padding: 1rem 1rem;
  vertical-align: middle;
}

.set-number {
  text-align: left !important;
  padding-left: 1.5rem !important;
  font-size: 0.75rem !important;
  font-weight: 600 !important;
  color: #808080 !important;
  letter-spacing: 0.1em !important;
  text-transform: uppercase !important;
  width: 80px;
}

.sets-value {
  font-size: 1.125rem !important;
  font-weight: 600 !important;
  color: #ffffff !important;
  font-family: "Montserrat", sans-serif;
}

.reps-value {
  font-size: 1.125rem !important;
  font-weight: 500 !important;
  color: #e0e0e0 !important;
  font-family: "Montserrat", sans-serif;
}

.weight-value {
  font-size: 1.5rem !important;
  font-weight: 300 !important;
  color: #ffffff !important;
  font-family: "Montserrat", sans-serif;
  position: relative;
}

.weight-value::after {
  content: 'kg';
  font-size: 0.7rem;
  font-weight: 400;
  color: #808080;
  margin-left: 0.5rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  vertical-align: super;
}

/* スペーサー行 */
.exercise-spacer-row {
  height: 1rem;
  background: #1c1c1c !important;
}

.exercise-spacer-row:hover {
  background: #1c1c1c !important;
}

.exercise-spacer-row td {
  padding: 0 !important;
  border: none !important;
  height: 1rem;
}

.weekSelect {
  width: 100%;
  font-family: "Noto Sans JP", sans-serif, "Montserrat", sans-serif;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.75rem 1rem;
  border: 1px solid #404040;
  border-radius: 8px;
  background: #1c1c1c;
  color: #ffffff;
  cursor: pointer;
  transition: border-color 0.3s, background-color 0.3s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
  box-sizing: border-box;
}
.weekSelect:hover {
  border-color: #808080;
  background-color: #252525;
}
.weekSelect:focus {
  outline: none;
  border-color: #808080;
  box-shadow: 0 0 0 3px rgba(128, 128, 128, 0.2);
}

.result-section {
  display: none;
  margin-top: 2rem;
}

.result-section.active {
  display: block;
}

/* レスポンシブ */
@media screen and (max-width: 767px) {
  .workout-table {
    font-size: 0.8rem;
  }
  .tab-navigation {
    flex-wrap: wrap;
    gap: 8px;
  }
  .tab-button {
    padding: 10px 16px;
    font-size: 0.85rem;
  }
  .form-card {
    padding: 20px;
  }
  .result-card {
    padding: 20px;
  }
}

/* フッター */
.footer {
  background: #111;
  padding-top: 8px;
  padding-bottom: 12px;
  text-align: center;
  margin-top: 4rem;
}

.footer__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.footer__copyright {
  color: #f5f5f5;
  font-size: 12px;
  line-height: 100%;
  letter-spacing: 0.96px;
}

.footer__nav {
  margin-bottom: 10px;
}

.footer__menu {
  list-style: none;
  display: flex;
  gap: 15px;
  padding: 0;
  justify-content: center;
}

.footer__menu li {
  display: inline;
}

.footer__menu a {
  text-decoration: none;
  color: #ffffff;
  font-size: 14px;
  transition: color 0.3s;
}

.footer__menu a:hover {
  color: #cccccc;
}

