/* =========================================================
   Personal dictionary
   ツール共通デザインテンプレート
   ========================================================= */

:root {
  --bg: #f5f7f9;
  --panel: #ffffff;
  --text: #1f2933;
  --muted: #667085;
  --line: #d8dee8;
  --accent: #263746;
  --accent-hover: #354b5f;
  --soft: #eef2f6;
  --danger: #9f3535;
  --danger-soft: #f7e8e8;
  --focus: #58708a;
  --ok: #17643c;
  --radius: 16px;
  --max-width: 1040px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "Hiragino Kaku Gothic ProN",
    "Hiragino Sans",
    "Yu Gothic",
    Meiryo,
    sans-serif;
  line-height: 1.7;
}

button,
input,
select,
textarea {
  font: inherit;
}

/* ---------- 上部共通バー ---------- */

.sitebar {
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.sitebar__inner {
  width: min(1180px, calc(100% - 32px));
  min-height: 56px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.sitebar a {
  text-decoration: none;
}

.sitebar a:hover {
  text-decoration: underline;
}

.sitebar__name {
  color: var(--text);
  font-weight: 700;
}

.sitebar__back {
  color: var(--muted);
  font-size: 14px;
}

/* ---------- ページ全体 ---------- */

.wrap {
  width: min(var(--max-width), calc(100% - 32px));
  margin: 34px auto 70px;
}

.page-head {
  margin-bottom: 22px;
}

.page-head h1 {
  margin: 0 0 8px;
  font-size: clamp(26px, 4vw, 38px);
  line-height: 1.25;
}

.page-head p {
  max-width: 780px;
  margin: 0;
  color: var(--muted);
}

/* ---------- パネル ---------- */

.panel {
  margin-bottom: 18px;
  padding: 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 10px 28px rgba(25, 35, 50, .05);
}

.panel h2 {
  margin: 0 0 14px;
  font-size: 20px;
}

.section-note {
  margin: -6px 0 18px;
  color: var(--muted);
  font-size: 14px;
}

/* ---------- フォーム ---------- */

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.form-grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field--full {
  grid-column: 1 / -1;
}

.field label,
.output-label {
  display: block;
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 700;
}

input[type="text"],
input[type="number"],
input[type="file"],
select,
textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  color: var(--text);
  background: #fff;
  border: 1px solid #cdd5df;
  border-radius: 10px;
}

textarea {
  min-height: 150px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(88, 112, 138, .12);
}

.field-help {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

/* ---------- ラジオ・チェック ---------- */

.choice-group {
  margin-top: 18px;
}

.choice-title {
  display: block;
  margin-bottom: 7px;
  font-size: 14px;
  font-weight: 700;
}

.choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}

.choice {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
}

/* ---------- ボタン ---------- */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.btn {
  appearance: none;
  min-height: 44px;
  padding: 11px 18px;
  border: 0;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
}

.btn:hover {
  opacity: .92;
}

.btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.btn-primary {
  color: #fff;
  background: var(--accent);
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  color: var(--text);
  background: var(--soft);
}

.btn-danger {
  color: var(--danger);
  background: var(--danger-soft);
}

/* ---------- ステータス・出力 ---------- */

.status {
  margin-bottom: 16px;
  padding: 12px 14px;
  color: var(--muted);
  background: #f7f9fb;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 14px;
}

.status.is-ok {
  color: var(--ok);
  background: #edf7f1;
}

.status.is-error {
  color: var(--danger);
  background: #fbefef;
}

.output {
  min-height: 220px;
  background: #fbfcfd;
}

/* ---------- テーブル ---------- */

.table-scroll {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  background: #fff;
  font-size: 14px;
}

th,
td {
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

th {
  background: #f1f4f7;
  font-weight: 700;
}

tbody tr:last-child td {
  border-bottom: 0;
}

/* ---------- 注意書き ---------- */

.info-box {
  padding: 14px 16px;
  color: var(--muted);
  background: #fafbfc;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 13px;
}

.info-box strong {
  color: var(--text);
}

.info-box p {
  margin: 4px 0 0;
}

/* ---------- スマートフォン ---------- */

@media (max-width: 760px) {
  .wrap {
    width: min(100% - 24px, var(--max-width));
    margin-top: 24px;
  }

  .sitebar__inner {
    width: calc(100% - 24px);
  }

  .panel {
    padding: 18px 15px;
  }

  .form-grid,
  .form-grid--3 {
    grid-template-columns: 1fr;
  }

  .field--full {
    grid-column: auto;
  }
}

@media (max-width: 520px) {
  .page-head h1 {
    font-size: 25px;
  }

  .actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .btn {
    width: 100%;
    padding-inline: 10px;
  }

  .choice-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .output {
    min-height: 240px;
  }
}

@media (max-width: 380px) {
  .actions {
    grid-template-columns: 1fr;
  }
}
