/* 掲載文AI ツール画面CSS */
:root {
  --ink: #1c2b3a;
  --ink-soft: #44566b;
  --bg: #f5f7f8;
  --panel: #ffffff;
  --accent: #ce3a2b;
  --accent-dark: #a92e22;
  --line: #d8dee3;
  --ok: #2e6e4e;
  --radius: 10px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: "Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", sans-serif;
  font-size: 16px; line-height: 1.8; color: var(--ink); background: var(--bg);
}
.container { max-width: 860px; margin: 0 auto; padding: 0 16px; }

.tool-header { background: var(--ink); color: #fff; padding: 12px 0; }
.tool-header .container { display: flex; justify-content: space-between; align-items: center; }
.tool-header .brand { color: #fff; text-decoration: none; font-weight: 700; font-size: 17px; }
.tool-header nav { display: flex; gap: 14px; align-items: center; }
.tool-header nav a { color: #fff; font-size: 14px; text-decoration: none; opacity: 0.85; }
.tool-header nav a:hover { opacity: 1; }
.tool-header .logout-btn {
  background: none; border: 1px solid rgba(255,255,255,0.4); color: #fff;
  font-size: 13px; padding: 4px 10px; border-radius: 5px; cursor: pointer; font-family: inherit;
}

main { padding: 32px 0 64px; }
h1 { font-size: 22px; margin-bottom: 4px; }
.page-lede { font-size: 14px; color: var(--ink-soft); margin-bottom: 24px; }

.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; margin-bottom: 22px;
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.form-field.wide { grid-column: 1 / -1; }
.form-field label { display: block; font-size: 14px; font-weight: 700; margin-bottom: 5px; }
.form-field label .req { color: var(--accent); font-size: 12px; margin-left: 5px; }
.form-field input, .form-field textarea, .form-field select {
  width: 100%; font-size: 16px; font-family: inherit; padding: 11px;
  border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink);
}
.form-field input:focus, .form-field textarea:focus, .form-field select:focus {
  outline: 2px solid var(--ink); outline-offset: 1px;
}
.form-field .hint { font-size: 12px; color: var(--ink-soft); margin-top: 3px; }

.btn {
  display: inline-block; background: var(--accent); color: #fff; font-size: 17px; font-weight: 700;
  border: none; border-radius: 8px; padding: 14px 32px; cursor: pointer; font-family: inherit;
  text-decoration: none;
}
.btn:hover { background: var(--accent-dark); }
.btn:disabled { background: #b9c2cb; cursor: wait; }
.btn-sub {
  display: inline-block; background: #fff; color: var(--ink); font-size: 13px;
  border: 1px solid var(--line); border-radius: 6px; padding: 6px 14px; cursor: pointer; font-family: inherit;
}
.btn-sub:hover { border-color: var(--ink); }

.form-errors {
  background: #fdf0ee; border: 1px solid var(--accent); border-radius: 6px;
  color: var(--accent-dark); font-size: 14px; padding: 12px 16px; margin-bottom: 18px;
}

/* 生成結果 */
.result-section h2 { font-size: 15px; color: var(--ink-soft); margin: 18px 0 6px; }
.result-block {
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
  padding: 14px 16px; position: relative; white-space: pre-wrap; font-size: 15px;
}
.result-block .copy-btn { position: absolute; top: 10px; right: 10px; }
.compliance {
  background: #fff8ec; border: 1px solid #e0b95c; border-radius: 8px;
  padding: 12px 16px; font-size: 14px; margin-top: 18px;
}
.compliance::before { content: "⚠ 掲載時の注意: "; font-weight: 700; }

.usage-note { font-size: 13px; color: var(--ink-soft); margin-top: 8px; }

/* 履歴 */
.history-item { border-bottom: 1px solid var(--line); padding: 14px 0; }
.history-item:last-child { border-bottom: none; }
.history-item .meta { font-size: 12.5px; color: var(--ink-soft); }
.history-item .name { font-weight: 700; }
.history-item details summary { cursor: pointer; font-size: 14px; color: var(--accent-dark); margin-top: 4px; }
.history-item .result-block { margin-top: 10px; }

.pagination { margin-top: 18px; font-size: 14px; }
.pagination a, .pagination span { margin-right: 8px; }

/* ログイン */
.login-panel { max-width: 420px; margin: 48px auto; }

/* 生成中オーバーレイ */
.gen-overlay {
  position: fixed; inset: 0; z-index: 1000;
  display: none;
  align-items: center; justify-content: center;
  background: rgba(28, 43, 58, 0.82);
}
.gen-overlay.active { display: flex; }
.gen-overlay .box {
  background: var(--panel); border-radius: 12px;
  padding: 36px 40px; text-align: center; max-width: 90vw; width: 380px;
}
.gen-overlay .spinner {
  width: 46px; height: 46px; margin: 0 auto 18px;
  border: 4px solid var(--line); border-top-color: var(--accent);
  border-radius: 50%;
  animation: gen-spin 0.9s linear infinite;
}
@keyframes gen-spin { to { transform: rotate(360deg); } }
.gen-overlay .status { font-size: 16px; font-weight: 700; min-height: 1.8em; }
.gen-overlay .note { font-size: 13px; color: var(--ink-soft); margin-top: 10px; }
@media (prefers-reduced-motion: reduce) {
  .gen-overlay .spinner { animation: none; border-top-color: var(--line); }
}
