:root{
  --bg:#0c0d10; --panel:#16181d; --muted:#9aa3af;
  --text:#e5e7eb; --primary:#4f46e5; --primary-weak:#312e81;
  --ok:#10b981; --warn:#f59e0b; --danger:#ef4444;
  --border:#242833;
}

*{
	margin: 0;
	padding: 0;
	font-size: 100%;
	color:var(--text);
	box-sizing: border-box;
}

html{
	-webkit-text-size-adjust:100%;
	height: 100%;
	scroll-behavior: smooth;
	background:var(--bg);
}

body{
	width: auto;
	font: 100%/1.618 'Noto Sans JP', "Meiryo", "ヒラギノ角ゴ Pro W3", "Hiragino Kaku Gothic Pro", "ＭＳ Ｐゴシック", Verdana, Geneva, Arial, Helvetica, sans-serif;
	margin: 0 auto;
	word-break: break-word;
}

a{color:var(--text);text-decoration:none}
button{cursor:pointer}

.wrap{max-width:1200px;margin:0 auto;padding:0 16px}

.site-header{border-bottom:1px solid var(--border);position:sticky;top:0;background:rgba(12,13,16,.75);backdrop-filter: blur(8px);z-index:10}
.site-header .wrap{display:flex;align-items:center;justify-content:space-between;height:60px}
.brand{font-weight:700;
        white-space: nowrap;}

.nav {
    display: flex;
    gap: 8px;
    font-size: 88%;
}

.container{display:grid;grid-template-columns:320px 1fr;gap:16px;max-width:1200px;margin:24px auto;padding:0 16px}

.card{background:var(--panel);border:1px solid var(--border);border-radius:12px;padding:16px}
.muted{color:var(--muted)}

.desc{
	margin-bottom: 16px;
    line-height: 1.6;
}

#ui_wcag_result{
	display: none;
}

#ui_palette_picks {
    margin-left: 7px;
}

.small{font-size:.9rem}
.btn{
    background: var(--primary);
    border: none;
    color: #fff;
    padding: 8px 16px;
    border-radius: 12px;
    transition: .2s;
    box-shadow: 0 0 0 0 rgba(79, 70, 229, .2);
}
.btn:hover{transform:translateY(-1px);box-shadow:0 8px 16px -12px rgba(79,70,229,.6)}
.btn.ghost{
    background: #333;
    border: 1px solid var(--border);
    color: var(--text);
    white-space: nowrap;
}
.btn[disabled]{opacity:.5;cursor:not-allowed}

.sidebar .card+.card{margin-top:16px}

#grid_gen_logo {
    display: flex;
    flex-wrap: wrap;
	gap: 8px;
}

#grid_gen_logo .card{
    width: calc(100% / 4 - 6px);
}

#grid_gen_logo .card img{
    width: 100%;
}

div#grid_gen_design {
    display: flex;
    flex-wrap: wrap;
	gap: 8px;
}

#grid_gen_design .card{
    width: calc(100% / 2 - 8px);
}

#grid_gen_design .card img{
    width: 100%;
}

.progress-row{display:flex;gap:10px;align-items:center}
.progress-bar{flex:1;height:10px;background:#0c0d13;border-radius:100px;overflow:hidden;border:1px solid var(--border)}
.progress-bar>span{display:block;height:100%;background:linear-gradient(90deg,var(--primary),#6d28d9);width:0%}
.progress-num{width:48px;text-align:right}

.answers-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: 360px;
    overflow: auto;
    font-size: 92%;
}

.answers-item{
    display: flex;
    justify-content: space-between;
    flex-direction: column;
    gap: 8px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px;
}
.answers-item .key{opacity:.75}
.answers-item .val{
	font-weight: 600;
}
.answers-item button{padding:6px 10px}

.estimate-box .price{font-size:1.6rem;font-weight:800;margin-bottom:6px}

.content{display:flex;flex-direction:column;gap:16px;max-width:832px;}
.chat-stream{display:flex;flex-direction:column;gap:10px;margin-bottom:12px;max-height:240px;overflow:auto}
.chat-bot,.chat-user{padding:10px 12px;border-radius:12px;border:1px solid var(--border)}
.chat-bot{background:#0f1116}
.chat-user{background:#10121a}

.answer-form{display:flex;flex-direction:column;gap:10px}
.question-label{font-weight:700}
.input-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.input-row input[type="text"], .input-row input[type="number"], .input-row textarea, .input-row select{
  background:#0f1116;color:var(--text);border:1px solid var(--border);padding:10px;border-radius:10px;min-width:260px
}
.input-row textarea{min-height:90px;width:100%}
.input-row .tag{background:#0f1116;border:1px dashed var(--border);padding:6px 10px;border-radius:999px}

.form-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    font-size: 92%;
}

.tabs{display:flex;gap:8px;border-bottom:1px solid var(--border);margin-bottom:12px}
.tab{background:transparent;border:1px solid var(--border);color:var(--text);padding:8px 12px;border-radius:10px 10px 0 0;margin-bottom:-1px}
.tab.active{background:#0f1116;border-bottom-color:#0f1116}

.hidden{display:none}

.palette-actions{display:flex;align-items:center;gap:12px;margin-bottom:12px}
.palette-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:10px}
.palette-item{border:1px solid var(--border);border-radius:10px;overflow:hidden}
.palette-swatch{height:80px}
.palette-meta{padding:8px;display:flex;justify-content:space-between;align-items:center;gap:8px}
.pin{background:transparent;border:1px solid var(--border);padding:6px 8px;border-radius:8px;
    color: #fff;
    white-space: nowrap;}
.pin.active{border-color:var(--ok);color:var(--ok)}
.wcag-result{margin-top:8px}

.gallery{display:grid;grid-template-columns:repeat(2,1fr);gap:10px}
.gallery img{width:100%;height:auto;border:1px solid var(--border);border-radius:10px}

.site-footer{border-top:1px solid var(--border);margin-top:24px}
.site-footer .wrap{padding:14px 16px}



/* toast */
.toast{
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(16px);
  background: rgba(20,24,28,0.95);
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  opacity: 0;
  transition: opacity .25s ease, transform .25s ease;
  z-index: 9999;
  font-size: 14px;
  line-height: 1.4;
}
.toast.show{
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}



.contact-box{

}

.contact-box label{
    display: block;
    margin-bottom: 8px;
}

.contact-box textarea#followup_message {
    width: 600px;
    max-width: 100%;
    padding: 8px;
	color: #333;
}

/* === Modal (fixed overlay) === */
.modal{
  position: fixed;
  inset: 0;                 /* top/right/bottom/left:0 */
  display: none;            /* JSでblockに */
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.45); /* 背景の半透明幕 */
  z-index: 10000;
  padding: 24px;            /* 余白（モバイルで端ピッタリ防止） */
}
.modal .modal-inner{
    width: min(560px, 100%);
    max-height: 85vh;
    overflow: auto;
    background: #070709;
    border-radius: 14px;
    box-shadow: 0 8px 80px rgb(255 255 255 / 62%);
    padding: 20px 18px;
}
.modal h3{
  margin: 0 0 12px;
  font-size: 18px;
}
.modal label{
  display:block;
  margin: 10px 0 6px;
  font-size: 13px;
}
.modal input[type="email"],
.modal input[type="password"]{
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid #d0d6dd;
  border-radius: 10px;
  font-size: 14px;
	color: #333;
}
.modal .modal-actions{
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 16px;
    margin-bottom: 16px;
    font-size: 92%;
}

/* モーダル中は背面スクロール禁止 */
body.modal-open{ overflow: hidden; }



/* ピル（回答一覧の右に出る小ラベル） */
.pill { display:inline-block; padding:2px 6px; border-radius:999px; font-size:11px; line-height:1; margin-left:6px; vertical-align:middle; }
.pill.warn { background:#FEF3C7; color:#92400E; border:1px solid #FDE68A; }
.pill.todo { background:#E5E7EB; color:#374151; border:1px solid #D1D5DB; }
.pill.ok   { background:#DCFCE7; color:#166534; border:1px solid #BBF7D0; }

/* 回答一覧ヘッダのフィルタ行 */
#answers_filter_bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 8px 0;
    font-size: 92%;
}
#answers_filter_bar .muted { font-size:12px; color:#6B7280; }

/* 送信ボタンのわかりやすい無効化表現 */
.btn.is-disabled {
  opacity: .45 !important;
  cursor: not-allowed !important;
  pointer-events: none !important; /* hoverで影が出ないように */
  filter: grayscale(.2) brightness(.9);
}











/* ====== Mobile (～768px) 追加分 ====== */
@media (max-width: 768px){

input,select,textarea{
	font-size: 16px !important;
}

  .wrap{padding:12px}

  .site-header .wrap{
    height:auto;
    gap:10px;
  }
  .brand{font-size:14px}
  .nav{gap:6px; flex-wrap:wrap;justify-content: right;}
  .nav .btn{padding:8px 12px; font-size:12px}
  /* 必要ならPDFボタンを隠す（表示したい場合は以下を消す） */
  /* #btn_export_pdf{display:none} */

	button#btn_signup {
	    width: 154px;
	}

  .container{
    grid-template-columns: 1fr;   /* 1カラム */
    gap:12px;
    margin:16px auto;
    padding:0 12px;
  }
  /* 並び順：コンテンツ→サイドバー */
  .content{order:1}
  .sidebar{order:2}

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

  /* 進捗 */
  .progress-row{gap:8px}
  .progress-num{width:auto; min-width:42px; font-size:12px}

  /* 回答一覧 */
  .answers-list{
    height: 260px;   /* 少し低めに */
  }
  .answers-item{
    gap:6px; padding:8px;
  }
  .answers-item .val{
    max-width:100%;   /* モバイルでは折り返し優先 */
    word-break: break-word;
  }

  /* 概算見積 */
  .estimate-box .price{font-size:1.4rem}

  /* チャット */
	.chat.card {
	    min-height: 50vh;
	}

  .chat-stream{
    max-height: 40vh;  /* 固定240pxを緩める */
    overflow:auto;
  }
  .chat-bot,.chat-user{padding:8px 10px}

  /* 入力UI */
  .answer-form{gap:8px}
  .question-label{font-size:16px}
  #input_wrap{
	margin-bottom: 40px;
  }
  .input-row{
    gap:6px;
    flex-direction:column;    /* 縦積み */
    align-items:stretch;
  }
  .input-row input[type="text"],
  .input-row input[type="number"],
  .input-row textarea,
  .input-row select{
    min-width:0; width:100%;
    padding:10px;
  }
  .form-actions{
    gap:6px;
  }

  /* パレット/ギャラリー系 */
  .palette-actions{flex-wrap:wrap; gap:8px}
  .palette-grid{grid-template-columns: repeat(3, 1fr); gap:8px}
  .palette-swatch{height:64px}
  .gallery{grid-template-columns: 1fr; gap:8px}

  /* 生成ロゴ／デザインのグリッド */
  #grid_gen_logo{gap:8px}
  #grid_gen_logo .card{width: calc(50% - 4px)}     /* 2列 */
  #grid_gen_logo .card img{width:100%; height:auto; display:block}

  #grid_gen_design{gap:8px}
  #grid_gen_design .card{width: 100%}              /* 1列 */

  /* フッター */
  .site-footer .wrap{padding:12px}

  /* モーダル */
  .modal{padding:16px}
  .modal .modal-inner{
    width: 100%;
    max-height: 80vh;
    padding:16px 14px;
  }
  .modal .modal-actions{
	gap:8px;
  }
  .modal input[type="email"],
  .modal input[type="password"]{
    font-size:13px; padding:9px 10px;
  }

  /* 連絡欄 */
  .contact-box textarea#followup_message{
    width:100%;
  }
}

/* さらに狭い端末（～360px）での微調整 */
@media (max-width: 360px){
  .nav .btn{padding:7px 8px; font-size:11px}

	button#btn_signup {
	    width: 130px;
	}

  .palette-grid{grid-template-columns: repeat(2, 1fr)}
  #grid_gen_logo .card{width:100%}   /* 1列 */

  .brand{width: 100%;font-size:14px}

  .form-actions{
    flex-direction:column;
    justify-content:stretch;
  }

  .form-actions .btn{width:100%}
}


