/* 【最新版のsetting.css】 */

/* 全体レイアウト */
/* html,  */
html, body {
  width: 99vw;
  min-height:97vh;
  height: auto;
  margin-top: 0;
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
  background: #ffffff;
  color: #222;
  /* font-family: 'Roboto', 'Noto Sans JP', 'Yu Gothic', sans-serif; */
  font-family: "FK Grotesk", "IBM Plex Sans", "Inter", "Roboto", "Yu Gothic UI", sans-serif;
}

.settings-outer {
  width: 100%;
  height: auto;
  min-height: 97vh;
  box-sizing: border-box;
  background: #fff;
  border-radius: 18px; 
  border: 1px solid #eee;
  margin: 12px auto; /* これで下側余白が上手くできた */
  display: flex;
  flex-direction: column;
  justify-content: center;
}



.settings-root {
  display: flex;
  flex-direction: row;
  flex: 1;
  width: 100%;
  min-height: 97vh;
  height: 100%;
  background: transparent;
  border-radius: 0;
  align-items: stretch;
  box-sizing: border-box;
  margin-bottom: 4px;
}


/* サイドバー */
.sidebar {
  width: 220px;
  min-width: 180px;
  min-height: 0;
  height: auto;
  background: transparent;
  color: #222;
  box-shadow: none;
  border-right: 1px solid #eee;
  padding: 20px;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.sidebar a {
  display: inline-block;
  font-size: 1.1em;
  color: #222;
  border-radius: 6px;
  padding: 4px 12px;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
  background: transparent;
  width: fit-content;
  max-width: max-content;
}
.sidebar a:hover {
  background: #f3f4f6;
  color: #222;
}

.sidebar-logo {
  font-size: 1.3em;     /* 以前の1.6emから小さめ推奨 */
  font-weight: 600;     /* 標準の太さへ */
  color: #222;
  letter-spacing: 0.5px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 0.4em;
} 

.sidebar-menu {
  list-style: none;
  margin: 0;
  padding: 0;
}
.sidebar-menu li {
  padding: 12px 0 12px 12px;
  font-size: 1.1em;
  cursor: pointer;
  border-radius: 6px;
  margin-bottom: 4px;
  background: none;
  transition: background 0.12s;
}

.sidebar-menu li.active{
  background: #f3f4f6; 
  color: #222;
}
.sidebar-menu li:hover {
  background: #dddddd; 
  color: #222;
}


/* メイン設定エリア */
.settings-main {
  flex: 1;
  display: flex;
  padding-left: 16px;
  padding-right: 16px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: 650px;
  margin: 0 auto 4px auto;
  box-sizing: border-box;
  min-height: 0;
  height: auto;
}


.settings-title {
  font-size: 1.5em;
  font-weight: 500;
  margin-top: 40px;
  margin-bottom: 20px;
}

.settings-section {
  padding-top: 10px;
  background: #ffffff;
}

.settings-section h2 {
  text-align: left;
  font-size: 1.4em;
  font-weight: 500;
  margin: 24px 0 24px 0;
  /* color: #555; */

}

.settings-section:last-child {
  margin-bottom: 12px;
}

.settings-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #ffffff;
  box-shadow: none;
  padding-top: 0px;
  padding-bottom: 16px;
  width: 100%;
  box-sizing: border-box;
}

.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  text-align: left;
  margin-left: 0;
  margin-bottom: 14px;
}

.form-row select {
  /* .form-row内にあるselect要素に対してCSSルールを適用（各行のプルダウン(セレクトボックス)を個別に装飾したい時） */
  width: auto;
  font-weight: 400;
  max-width: 180px;
}

.form-label-group {
  display: flex;
  flex-direction: column;
  min-width: 120px;
}

.form-label-group label {
  font-size: 1.2em;
  min-width: 300px; /* ラベル幅を揃えるなら追加（任意）  */
  text-align: left;
  font-weight: 500;
  color: #333;
}

.description {
  margin-top: 2px;
  margin-bottom: 2px;
  margin-left: 2px;         
  font-size: 1.0em;        /* あるいは12px/13pxなど */
  color: #665;              /* グレー系で主張しすぎない */
  line-height: 1.4;
  letter-spacing: 0.01em;
}

input, select {
  background: #fff;
  border: 1px solid #eee;
  padding: 8px 12px;
  font-size: 1em;
  font-weight: 400;
  border-radius: 8px;
}

.settings-card > *:last-child {
  margin-right: 0;
  /* margin-bottom: 100px; */
}

.divider {
  border: none;
  border-bottom: 1px solid #eee;
  margin-top: 0px;
  margin-bottom: 24px;
  opacity: 0.85;
}


/* カラーパレット関連 */
.color-palette-container {
  width: 100%;
  display: flex;
  justify-content: flex-end; /* コンテナ自体を右寄せ */
}

.color-palette {
  display: grid;
  grid-template-columns: repeat(auto-fill, 36px);
  gap: 8px;
  padding: 8px 0;
  justify-content: space-between;
}

/* 最終行を右寄せにする */
.color-palette::after {
  content: "";
  flex: auto;
}

.form-row .color-palette {
  max-width: 100%;
}

.color-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%; /* 円形 */
  border: 1px solid rgba(60, 60, 60, 0.1); /* 薄いグレーの外枠 */
  cursor: pointer;
  padding: 0;
  transition: all 0.2s ease;
  box-sizing: border-box;
  flex-shrink: 0;
}

.color-btn:hover {
  transform: scale(1.15);
  border-color: rgba(208, 208, 208, 0.3);
  box-shadow: 0 2px 8px rgba(208, 208, 208, 0.15);
}

.color-btn.selected {
  border-color: rgba(113, 113, 113, 0.4);
}

/* 白色ボタン用の特別スタイル（見えやすくするため） */
.color-btn[data-color="white"],
.color-btn[data-color="#ffffff"] {
  border-color: rgba(0, 0, 0, 0.2);
  border-width: 1px; 
}

.color-btn[data-color="white"].selected,
.color-btn[data-color="#ffffff"].selected {
  border-color: rgba(0, 0, 0, 0.5);
}


/* iPad横持ち, ノートPC */
@media (max-width: 1366px) {
  html, body {
    width: 98vw;
    min-height: 95vh;
  }
}

/* iPad縦持ち, Tablet, 小型ノートPC */
@media (max-width: 991px) {
  html, body {
    width: 98vw;
    min-height: 95vh;
  }
  .settings-outer, .settings-root {
    min-height:95vh;
  }
  .settings-main {
  max-width: 450px;
}

}


/* スマホ縦持ち */
@media (max-width: 768px) {
  html,body{
    /* width: 94vw; */
    width: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
  }

  .settings-outer{
    margin-right: 14px;
  }

  /* sidebar → ヘッダー化 */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    height: 60px;
    border-bottom: 1px solid #E6E7E6;
    background: #fff;
    padding: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
  }

  /* 戻るボタン以外は非表示 */
  .sidebar > * { display: none; }
  .sidebar > a {
    align-items: center;
    gap: 6px;
    font-size: 16px;
    text-decoration: none;
    color: #222;
    border-radius: 9999px;
    background: #F3F4F6;
    margin-left: 30px;
    padding-left: 12px;
    padding-right: 12px;
    display: inline-flex;
  }

  /* mainを全幅に拡張 */
  .settings-root {
    flex-direction: column;
    min-height: 100dvh;
    background: #F9FAF9;
  }
  
  .settings-main {
    width: 100%;
    max-width: none;
    margin: 0;
    border-radius: 0;
    padding-left: 16px;
    padding-right: 16px;
    background: #fff;
    height: 100%;
    overflow-y: auto; /* ← スクロール可 */
  }

  .settings-title {
    margin-top: 60px;
    margin-bottom: 0px;
  }

  .settings-section {
    margin-top: 0px;
    padding-top: 0px;
    background: #ffffff;
  }

  /* 各項目を横幅いっぱいに */
  .form-row {
    display: flex;
    flex-direction: column; /* スマホでは縦積みに */
    align-items: stretch;
    width: 100%;
    gap: 6px;
  }

  .form-row select {
    max-width: 100%;
    box-sizing: border-box;
    border: 1px solid #E6E7E6;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 16px;     /* ズーム防止 */
  }

}