/* ══════════════════════════════════════════════════════════
   合言葉で暗号化メモ — スタイル
   テーマカラー: Teal (#0d9488)
   ══════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f0fdfa;
  color: #1c1917;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── ヘッダー ── */
header {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 16px;
  height: 52px;
  display: flex;
  align-items: center;
}
.logo { font-weight: 700; font-size: 1.1rem; color: #0d9488; text-decoration: none; }
.logo:hover { color: #0f766e; }

/* ── メイン ── */
main {
  flex: 1;
  max-width: 860px;
  margin: 0 auto;
  padding: 24px 16px 48px;
  width: 100%;
}

/* ── ヒーロー ── */
.hero { text-align: center; padding: 24px 0 20px; }
.hero-icon { font-size: 3rem; margin-bottom: 10px; }
.hero h1 { font-size: 1.65rem; font-weight: 700; color: #115e59; margin-bottom: 6px; }
.description { color: #0d9488; font-size: 0.9rem; line-height: 1.7; }

/* ━━━ ヒーローバッジ ━━━ */
.hero-badges {
  display: flex; justify-content: center; flex-wrap: wrap;
  gap: .5rem; margin-top: .75rem;
}
.badge {
  display: inline-block;
  background: #ccfbf1; color: #0d9488;
  border: 1px solid #99f6e4;
  border-radius: 999px;
  font-size: .78rem; font-weight: 600;
  padding: .2rem .75rem;
}

/* ══════════════════════════════
   方向トグル
   ══════════════════════════════ */
.dir-options-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}
.dir-toggle {
  display: flex;
  gap: 6px;
  background: #f0fdfa;
  border: 1.5px solid #99f6e4;
  border-radius: 12px;
  padding: 4px;
}
.dir-btn {
  padding: 9px 18px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: #0f766e;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
  touch-action: manipulation;
}
.dir-btn.active {
  background: #0d9488;
  color: #fff;
  box-shadow: 0 2px 6px rgba(13,148,136,.3);
}
.dir-btn:hover:not(.active) { background: #ccfbf1; }
.dir-arrow { font-size: 0.8rem; }

/* ══════════════════════════════
   ツールラップ
   ══════════════════════════════ */
.tool-wrap {
  background: #fff;
  border-radius: 20px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 2px 16px rgba(13,148,136,.1);
}

/* ══════════════════════════════
   合言葉
   ══════════════════════════════ */
.pass-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}
.pass-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: #0d9488;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 6px;
}
.pass-input-wrap {
  position: relative;
  flex: 1;
  min-width: 220px;
}
.pass-input {
  width: 100%;
  padding: 11px 42px 11px 14px;
  border: 1.5px solid #99f6e4;
  border-radius: 12px;
  font-size: 0.92rem;
  color: #115e59;
  background: #f0fdfa;
  outline: none;
  transition: border-color .15s, background .15s;
}
.pass-input:focus { border-color: #0d9488; background: #fff; }
.pass-input::placeholder { color: #94a3b8; font-size: 0.86rem; }
.pass-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: #0d9488;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
.pass-toggle:hover { background: #ccfbf1; }

/* 強度メーター */
.pass-meter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  margin-bottom: 4px;
  min-height: 16px;
}
.pass-meter {
  flex: 1;
  height: 6px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}
.pass-meter-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  transition: width .25s, background .25s;
}
.pass-meter-label {
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
  min-width: 60px;
  text-align: right;
}

/* ══════════════════════════════
   入出力グリッド
   ══════════════════════════════ */
.io-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: start;
  margin-top: 20px;
  margin-bottom: 16px;
}
.io-panel { display: flex; flex-direction: column; gap: 8px; }
.io-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 24px;
}
.io-title { font-size: 0.8rem; font-weight: 700; color: #0d9488; text-transform: uppercase; letter-spacing: .06em; }
.io-stat  { font-size: 0.72rem; color: #9ca3af; font-family: monospace; }

.ta-wrap { position: relative; }
.memo-ta {
  width: 100%;
  height: 200px;
  padding: 12px;
  border: 1.5px solid #99f6e4;
  border-radius: 12px;
  font-size: 0.86rem;
  font-family: 'SFMono-Regular', 'Consolas', 'Courier New', monospace;
  color: #115e59;
  background: #f0fdfa;
  resize: vertical;
  outline: none;
  line-height: 1.6;
  transition: border-color .15s, background .15s;
  word-break: break-all;
}
.memo-ta:focus { border-color: #0d9488; background: #fff; }
.memo-ta::placeholder { color: #94a3b8; font-family: -apple-system, sans-serif; font-size: 0.84rem; }
.output-ta { background: #fafafa; color: #374151; }
.output-ta:focus { border-color: #99f6e4; background: #fafafa; }

.output-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* 中央ボタン列 */
.io-arrow-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding-top: 32px;
}
.io-arrow-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid #0d9488;
  background: #0d9488;
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all .18s;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(13,148,136,.35);
}
.io-arrow-btn:hover { background: #0f766e; transform: scale(1.08); }

/* ══════════════════════════════
   ボタン
   ══════════════════════════════ */
.act-btn {
  padding: 7px 14px;
  border: 1.5px solid #99f6e4;
  border-radius: 20px;
  background: #f0fdfa;
  color: #0f766e;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .15s;
  touch-action: manipulation;
  white-space: nowrap;
}
.act-btn:hover { background: #0d9488; color: #fff; border-color: #0d9488; }
.act-btn.primary { background: #0d9488; color: #fff; border-color: #0d9488; box-shadow: 0 2px 8px rgba(13,148,136,.3); }
.act-btn.primary:hover { background: #0f766e; border-color: #0f766e; }

/* メイン実行ボタン */
.run-btn {
  display: block;
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 14px;
  background: #0d9488;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .18s, transform .1s;
  box-shadow: 0 3px 12px rgba(13,148,136,.3);
  touch-action: manipulation;
}
.run-btn:hover { background: #0f766e; }
.run-btn:active { transform: translateY(1px); }
.run-btn:disabled { background: #94d3cb; cursor: progress; }

/* ══════════════════════════════
   エラーバー
   ══════════════════════════════ */
.error-bar {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 14px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 10px;
  margin-top: 14px;
}
.error-icon { font-size: 0.95rem; flex-shrink: 0; }
.error-bar span:last-child { font-size: 0.82rem; color: #991b1b; line-height: 1.5; white-space: pre-line; }

/* ══════════════════════════════
   統計バー
   ══════════════════════════════ */
.stats-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}
.stat-chip {
  padding: 4px 10px;
  background: #ccfbf1;
  color: #0f766e;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: monospace;
}

/* ══════════════════════════════
   汎用カード
   ══════════════════════════════ */
.card {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 2px 12px rgba(13,148,136,.07);
}
.card h2 { font-size: 1.05rem; font-weight: 700; color: #115e59; margin-bottom: 16px; }

.hidden { display: none !important; }

/* ─── Tips grid ──────── */
.tips-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.tip-item { display: flex; gap: .65rem; }
.tip-icon { font-size: 1.4rem; flex-shrink: 0; }
.tip-text strong { display: block; font-weight: 700; margin-bottom: .15rem; font-size: .88rem; }
.tip-text p { font-size: .8rem; color: #78716c; line-height: 1.55; }
.tip-text code {
  background: #ccfbf1; color: #0f766e;
  padding: 1px 5px; border-radius: 4px;
  font-family: monospace; font-size: 0.85em; word-break: break-all;
}

/* ── フッター ── */
footer {
  text-align: center;
  padding: 1.5rem 1rem;
  font-size: .82rem;
  color: #a8a29e;
  border-top: 1px solid #e7e5e4;
  margin-top: auto;
}
footer a { color: #ea580c; text-decoration: none; }
footer a:hover { text-decoration: underline; }
footer p + p { margin-top: .3rem; }

/* ━━━ Amazonおすすめ ━━━ */
.amazon-card h2 { margin-bottom: 0.25rem; }
.amazon-note { font-size: 0.82rem; color: #999; margin-bottom: 1rem; }
.amazon-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
.amazon-item {
  display: block;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  padding: 0.9rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.1s;
}
.amazon-item:hover {
  border-color: #FF9900;
  box-shadow: 0 2px 8px rgba(255,153,0,0.15);
  transform: translateY(-1px);
}
.amazon-item-icon { font-size: 1.7rem; margin-bottom: 0.35rem; }
.amazon-item-name { font-size: 0.88rem; font-weight: bold; margin-bottom: 0.2rem; }
.amazon-item-desc { font-size: 0.76rem; color: #888; line-height: 1.5; margin-bottom: 0.45rem; }
.amazon-item-link { font-size: 0.78rem; color: #FF9900; font-weight: bold; }
.amazon-notice { font-size: 0.72rem; color: #bbb; margin-top: 0.2rem; }

/* ━━━ 仕様テーブル ━━━ */
.table-note-top { font-size: .8rem; color: #aaa; margin-bottom: .65rem; }
.table-note     { font-size: .75rem; color: #bbb; margin-top: .5rem; line-height: 1.6; }
.table-note code { background: #ccfbf1; color: #0f766e; padding: .05rem .3rem; border-radius: 4px; font-size: .9em; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.spec-table {
  width: 100%; border-collapse: collapse;
  font-size: .85rem; min-width: 360px;
}
.spec-table th {
  background: #0d9488; color: #fff;
  padding: .5rem .85rem; text-align: left;
  font-weight: 700; font-size: .8rem; white-space: nowrap;
}
.spec-table td {
  padding: .55rem .85rem;
  border-bottom: 1px solid #f0f0f0;
  color: #444; vertical-align: middle;
}
.spec-table td code {
  background: #ccfbf1; color: #0f766e;
  padding: .1rem .35rem; border-radius: 4px;
  font-size: .85em; word-break: break-all;
}
.spec-table tr:hover td { background: #f0fdfa; }
.hl-row td { background: #ccfbf1 !important; font-weight: 600; }

/* ━━━ 活用シーン ━━━ */
.scene-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .9rem; }
.scene-item { display: flex; gap: .65rem; align-items: flex-start; }
.scene-icon { font-size: 1.5rem; flex-shrink: 0; }
.scene-body strong { display: block; font-size: .88rem; font-weight: 700; margin-bottom: .15rem; color: #333; }
.scene-body p { font-size: .8rem; color: #666; line-height: 1.55; margin: 0; }

/* ━━━ FAQ ━━━ */
.faq-list { display: flex; flex-direction: column; }
.faq-item { padding: .9rem 0; border-bottom: 1px solid #f0f0f0; }
.faq-item:last-child { border-bottom: none; padding-bottom: 0; }
.faq-q { font-size: .9rem; font-weight: 700; color: #0d9488; margin-bottom: .35rem; }
.faq-a { font-size: .85rem; color: #555; line-height: 1.75; }

/* ━━━ 関連ツール ━━━ */
.related-tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .75rem; }
.related-tool-item {
  display: flex; align-items: flex-start; gap: .75rem;
  padding: .85rem 1rem;
  border: 1.5px solid #ccfbf1; border-radius: 10px;
  text-decoration: none; color: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.related-tool-item:hover { border-color: #0d9488; box-shadow: 0 2px 8px rgba(13,148,136,.1); }
.related-tool-icon { font-size: 1.6rem; flex-shrink: 0; }
.related-tool-item strong { display: block; font-size: .88rem; font-weight: 700; color: #0d9488; margin-bottom: .2rem; }
.related-tool-item p { font-size: .76rem; color: #888; line-height: 1.5; margin: 0; }

/* ══════════════════════════════
   レスポンシブ
   ══════════════════════════════ */
@media (max-width: 620px) {
  .hero h1 { font-size: 1.35rem; }
  .tool-wrap { padding: 18px 14px; }
  .io-grid { grid-template-columns: 1fr; gap: 10px; }
  .io-arrow-col {
    flex-direction: row;
    justify-content: center;
    padding-top: 0;
  }
  .arrow-icon { transform: none !important; }
  .pass-row { flex-direction: column; align-items: stretch; }
  .pass-input-wrap { min-width: 0; }
  #btn-gen-pass { width: 100%; }
}

@media (max-width: 560px) {
  .scene-grid { grid-template-columns: 1fr; }
  .amazon-grid { grid-template-columns: 1fr; }
}

/* ━━━ note CTA（まるっとアプリ・紺×山吹） ━━━ */
.note-cta {
  background: linear-gradient(135deg, #0f2747 0%, #13315c 100%);
  border: none;
  color: #fff;
}
.note-cta h2 { color: #ffb627; }
.note-cta-lead { font-size: .9rem; line-height: 1.7; color: #e7eefa; margin-bottom: .9rem; }
.note-cta-points { list-style: none; padding: 0; margin: 0 0 1rem; display: flex; flex-direction: column; gap: .4rem; }
.note-cta-points li { font-size: .85rem; color: #e7eefa; padding-left: 1.4rem; position: relative; }
.note-cta-points li::before { content: "✓"; position: absolute; left: 0; color: #ffb627; font-weight: 800; }
.note-cta-btn {
  display: inline-flex; align-items: center; gap: .4rem;
  background: #ffb627; color: #0f2747;
  font-size: .92rem; font-weight: 800;
  padding: .7rem 1.3rem; border-radius: 10px;
  text-decoration: none; transition: background .15s, transform .12s;
}
.note-cta-btn:hover { background: #ffc857; }
.note-cta-btn:active { transform: scale(.98); }
.note-cta-note { font-size: .72rem; color: #9fb2cc; margin-top: .7rem; }
