/* ============================================================
   わかばTRPG卓報告ツール — グラスモーフィズム / 2ペイン(PC)
   配色はチャパレ生成ツールと統一（--green #74C69D 系）
   ============================================================ */
:root {
  --green:        #74C69D;
  --green-dark:   #4EAA82;
  --green-text:   #1E6B42;
  --green-rgb:    116, 198, 157;
  --green-light:  rgba(116, 198, 157, .13);
  --error:        #EF476F;

  --text:         #2b3b33;
  --text-sub:     #6b7b73;
  --text-faint:   #9aa8a0;

  --glass-bg:     rgba(255, 255, 255, .62);
  --glass-border: rgba(255, 255, 255, .75);
  --glass-blur:   18px;

  --radius:    18px;
  --radius-sm: 12px;
  --shadow:    0 8px 30px rgba(31, 107, 66, .10), 0 2px 8px rgba(31, 107, 66, .06);
  --shadow-sm: 0 2px 10px rgba(31, 107, 66, .08);
  --maxw: 1180px;
  --transition: all .2s ease;
}

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

html, body {
  min-height: 100%;
  color: var(--text);
  font-family: 'Hiragino Sans', 'Meiryo', 'Noto Sans JP', system-ui, sans-serif;
  font-size: 15px; line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}
body {
  background:
    radial-gradient(1200px 600px at 12% -8%, rgba(116,198,157,.40), transparent 60%),
    radial-gradient(1000px 700px at 110% 10%, rgba(120,200,220,.26), transparent 55%),
    radial-gradient(900px 900px at 50% 120%, rgba(150,220,180,.30), transparent 60%),
    linear-gradient(160deg, #f3faf6 0%, #eef7f8 55%, #f4fbf3 100%);
  background-attachment: fixed;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* アイコン（インラインSVG）共通 */
.ic { display: inline-flex; align-items: center; justify-content: center; line-height: 0; flex: 0 0 auto; }
.ic svg { width: 1.05em; height: 1.05em; display: block; }
input, textarea, select { font-family: inherit; font-size: 15px; color: var(--text); }

/* ===== ガラス面 ユーティリティ ===== */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(150%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(150%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
}

/* ===== ヘッダー ===== */
.app-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 22px;
  background: rgba(255,255,255,.55);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  border-bottom: 1px solid var(--glass-border);
  transition: transform .25s ease;
}
.app-header.hidden { transform: translateY(-100%); }
.app-header .brand {
  display: flex; align-items: center; gap: 8px;
  font-weight: 800; font-size: 17px; color: var(--text); flex: 0 1 auto;
  white-space: nowrap; min-width: 0;
  cursor: pointer; background: none; border: none; padding: 0; font-family: inherit;
}
.app-header .brand:hover { opacity: .85; }
.app-header .brand > span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; }
.hdr-spacer { flex: 1 1 auto; min-width: 8px; }

/* ヘッダー内の編集ステータス（新規 / テンプレ名） */
.hdr-status {
  display: inline-flex; align-items: center; gap: 5px; max-width: 40vw;
  font-size: 12px; font-weight: 700; color: var(--text-sub);
  background: rgba(255,255,255,.55); border: 1px solid rgba(120,160,140,.28);
  border-radius: 999px; padding: 4px 12px; white-space: nowrap; overflow: hidden;
}
.hdr-status #based-on-text { overflow: hidden; text-overflow: ellipsis; }
.hdr-status.editing { color: var(--green-text); background: var(--green-light); border-color: rgba(var(--green-rgb),.35); }
.hdr-status b { font-weight: 800; }
@media (max-width: 620px) { .hdr-status { display: none; } }
.brand-logo { width: 24px; height: 24px; display: block; flex: 0 0 auto; }
.nav-pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 13px; font-weight: 700; color: var(--green-text);
  padding: 7px 14px; border: 1.5px solid var(--green); border-radius: 999px;
  background: rgba(255,255,255,.5); transition: var(--transition);
}
.nav-pill:hover { background: var(--green-light); }
.nav-pill.active { background: var(--green); color: #fff; }
.nav-pill.icon-only { padding: 7px 9px; }

/* ===== レイアウト ===== */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 22px; }
.screen { display: none; }
.screen.active { display: block; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px);} to { opacity:1; transform:none; } }

/* 2ペイン（PC） */
.editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.92fr);
  gap: 22px;
  align-items: start;
}
/* 右ペインは通常フロー。プレビューを圧縮し、固定せずとも装飾と一緒に俯瞰できる。 */
.pane-right { align-self: start; }
@media (max-width: 880px) {
  .editor-grid { grid-template-columns: 1fr; }
}

/* ===== テンプレート クイックバー ===== */
.tpl-bar { display: flex; gap: 8px; align-items: center; padding: 12px 14px; margin-bottom: 18px; flex-wrap: wrap; }
.tpl-bar select { flex: 1 1 160px; min-width: 140px; font-weight: 700; }
.tpl-btn {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid rgba(120,160,140,.3); background: rgba(255,255,255,.7);
  color: var(--text); border-radius: 999px; padding: 9px 14px; font-size: 13px; font-weight: 700;
  transition: var(--transition); white-space: nowrap;
}
.tpl-btn:hover { background: #fff; border-color: var(--green); }
.tpl-btn.save { color: var(--green-text); }
.tpl-btn.save .ic { color: var(--green-text); }

/* ===== カード ===== */
.card { padding: 18px 18px; margin-bottom: 18px; }
.card:last-child { margin-bottom: 0; }
.card-title {
  display: flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 800; color: var(--green-text);
  margin-bottom: 14px; letter-spacing: .02em;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); display: inline-block; flex: 0 0 auto; }

/* ===== フォーム ===== */
.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field > label { display: block; font-size: 12.5px; color: var(--green-text); font-weight: 800; margin-bottom: 7px; letter-spacing: .01em; }

/* グループの区切り（ラベルが“その下の入力”の見出しだと分かるように） */
.field-sep { margin-top: 18px; padding-top: 16px; border-top: 1px solid rgba(120,160,140,.16); }
.field-row { display: flex; gap: 8px; align-items: center; }
.field-row > * { min-width: 0; }
.field-half { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 560px) { .field-half { grid-template-columns: 1fr; } }

/* システム：セレクト＋「その他」自由入力を横並び */
#in-system-sel { flex: 1; min-width: 0; }
#in-system-free { flex: 1; min-width: 0; }

input[type=text], input[type=date], textarea, select {
  width: 100%; padding: 10px 13px;
  background: rgba(255,255,255,.7);
  border: 1px solid rgba(120,160,140,.28);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
input::placeholder, textarea::placeholder { color: var(--text-faint); }
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--green);
  background: #fff; box-shadow: 0 0 0 3px rgba(var(--green-rgb), .18);
}
textarea { resize: vertical; min-height: 92px; line-height: 1.7; }
select { -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%236b7b73' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 30px; }

/* 繰り返し行 */
.repeat-row { display: flex; gap: 7px; align-items: center; margin-bottom: 7px; }
.repeat-row input { flex: 1; }
.repeat-row .role-sel { flex: 0 0 84px; }
.repeat-row .role-custom { flex: 0 0 96px; }
.repeat-row .ho { flex: 0 0 88px; }
.row-num {
  flex: 0 0 auto; min-width: 40px; height: 38px; padding: 0 8px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--green-light); color: var(--green-text);
  border: 1px solid rgba(var(--green-rgb), .3); border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 800; white-space: nowrap;
}
.row-num.muted { background: rgba(255,255,255,.5); color: var(--text-faint); border-color: rgba(120,160,140,.25); }
.icon-btn {
  flex: 0 0 auto; width: 36px; height: 38px;
  border-radius: var(--radius-sm); background: rgba(255,255,255,.6);
  border: 1px solid rgba(120,160,140,.25);
  color: var(--text-sub); font-size: 18px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center; transition: var(--transition);
}
.icon-btn:hover { background: #fff; color: var(--error); }
.add-btn {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1.5px dashed var(--green); background: var(--green-light);
  color: var(--green-text); border-radius: 999px;
  padding: 8px 16px; font-size: 13px; font-weight: 700; transition: var(--transition);
}
.add-btn:hover { background: rgba(var(--green-rgb), .22); }

/* 画像 */
.image-drop {
  border: 1.5px dashed rgba(120,160,140,.45); border-radius: var(--radius-sm);
  padding: 16px; text-align: center; color: var(--text-sub); font-size: 13px;
  background: rgba(255,255,255,.45); transition: var(--transition);
}
.image-drop:hover, .image-drop.drag { border-color: var(--green); background: var(--green-light); color: var(--green-text); }
.image-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.image-thumb { position: relative; width: 66px; height: 66px; border-radius: 10px; overflow: hidden; border: 1px solid var(--glass-border); box-shadow: var(--shadow-sm); }
.image-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: pointer; transition: var(--transition); }
.image-thumb img:hover { filter: brightness(.9); }
.image-thumb .copy-hint { position: absolute; bottom: 0; left: 0; right: 0; background: rgba(0,0,0,.5); color: #fff; font-size: 9px; text-align: center; padding: 1px 0; pointer-events: none; }
.image-thumb .rm {
  position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: rgba(0,0,0,.55); color: #fff; font-size: 12px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}

/* アコーディオン */
.accordion { border-top: 1px solid rgba(120,160,140,.18); margin-top: 4px; padding-top: 10px; }
.accordion > summary {
  cursor: pointer; list-style: none; display: flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 700; color: var(--green-text); padding: 4px 0;
}
.accordion > summary::-webkit-details-marker { display: none; }
.accordion > summary::before { content: '＋'; font-weight: 800; transition: transform .2s; }
.accordion[open] > summary::before { content: '−'; }
.accordion[open] > summary { margin-bottom: 12px; }

/* ===== 装飾セレクタ ===== */
.deco-block { margin-bottom: 14px; }
.deco-block:last-child { margin-bottom: 0; }
.deco-label { font-size: 12px; color: var(--text-sub); font-weight: 700; margin-bottom: 7px; }
.chip-row { display: flex; gap: 7px; flex-wrap: wrap; }
.preset-chip {
  border: 1px solid rgba(120,160,140,.3); background: rgba(255,255,255,.6);
  border-radius: 999px; padding: 7px 15px; font-size: 13px; font-weight: 700; color: var(--text);
  transition: var(--transition);
}
.preset-chip:hover { border-color: var(--green); background: var(--green-light); }
.preset-chip.active { background: var(--green); color: #fff; border-color: var(--green); box-shadow: 0 2px 8px rgba(var(--green-rgb),.35); }

.deco-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; }
@media (max-width: 460px) { .deco-grid { grid-template-columns: repeat(5, 1fr); } }
.deco-cell {
  border: 1px solid rgba(120,160,140,.28); background: rgba(255,255,255,.6);
  border-radius: 10px; padding: 9px 4px; font-size: 13px; color: var(--text);
  display: flex; align-items: center; justify-content: center; min-height: 38px;
  transition: var(--transition); overflow: hidden;
}
.deco-cell:hover { border-color: var(--green); background: var(--green-light); }
.deco-cell.active { background: var(--green); color: #fff; border-color: var(--green); box-shadow: 0 2px 8px rgba(var(--green-rgb),.3); }

/* 文字スタイル ツールバー */
.font-toolbar { display: flex; gap: 6px; flex-wrap: wrap; }
.font-chip {
  width: 40px; height: 40px; flex: 0 0 auto;
  border: 1px solid rgba(120,160,140,.28); background: rgba(255,255,255,.6);
  border-radius: 10px; font-size: 18px; line-height: 1; color: var(--text);
  display: inline-flex; align-items: center; justify-content: center; transition: var(--transition);
}
.font-chip:hover { border-color: var(--green); background: var(--green-light); }
.font-chip.active { background: var(--green); color: #fff; border-color: var(--green); box-shadow: 0 2px 8px rgba(var(--green-rgb),.3); }

/* ===== プレビュー（右ペイン） ===== */
.preview-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; row-gap: 6px; }
.preview-head .ttl { font-size: 13px; font-weight: 800; color: var(--green-text); display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.preview-head .char-count { margin-left: auto; }

/* プレビュー操作（アイコンのみ・見出し右） */
.pv-tools { display: flex; gap: 3px; }
.pv-tools button {
  width: 30px; height: 30px; border-radius: 8px;
  border: 1px solid rgba(120,160,140,.28); background: rgba(255,255,255,.6);
  color: var(--text-sub); font-size: 15px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center; transition: var(--transition);
}
.pv-tools button:hover { background: #fff; color: var(--green-text); border-color: var(--green); }
.char-count { display: inline-flex; gap: 6px; }
.cc-seg {
  font-size: 12px; font-weight: 800; color: var(--text-sub);
  background: rgba(255,255,255,.6); border: 1px solid rgba(120,160,140,.25);
  padding: 3px 9px; border-radius: 999px; white-space: nowrap;
}
.cc-seg.over { color: #fff; background: var(--error); border-color: var(--error); }

/* X風カード */
.x-card { background: #fff; border-radius: var(--radius-sm); border: 1px solid rgba(120,160,140,.2); box-shadow: var(--shadow-sm); padding: 13px; }
.x-head { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.x-avatar { width: 40px; height: 40px; border-radius: 50%; background: #fff; border: 1px solid rgba(120,160,140,.25); display: flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0; }
.x-avatar img { width: 30px; height: 30px; display: block; }
.x-name { font-weight: 800; font-size: 14px; line-height: 1.2; }
.x-handle { font-size: 12px; color: var(--text-faint); }
.preview-box {
  white-space: pre-wrap; word-break: break-word;
  font-size: 14px; line-height: 1.7; min-height: 96px; color: #14171a;
  outline: none; border-radius: 8px; transition: var(--transition);
}
.preview-box:focus { background: var(--green-light); box-shadow: 0 0 0 3px rgba(var(--green-rgb),.12); padding: 6px; margin: -6px; }
.preview-box:empty::before { content: '左の入力に応じてここに本文が生成されます'; color: var(--text-faint); }
.preview-imgs { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.preview-imgs img { width: 60px; height: 60px; object-fit: cover; border-radius: 8px; border: 1px solid rgba(120,160,140,.2); }

.note-inline { font-size: 10.5px; color: var(--text-faint); margin-top: 8px; line-height: 1.5; }

/* プレビュー本文＋SNSボタン（本文の右側に縦並び） */
.preview-body { display: flex; gap: 10px; align-items: stretch; }
.preview-body .x-card { flex: 1 1 auto; min-width: 0; }
.post-actions { display: flex; flex-direction: column; gap: 7px; flex: 0 0 100px; }
.post-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  width: 100%; border-radius: 999px; padding: 8px 10px;
  font-size: 10px; font-weight: 800; color: #fff; transition: var(--transition);
  border: none; white-space: nowrap;
}
.post-btn:hover { filter: brightness(1.05); transform: translateY(-1px); }
.post-btn .ic svg { width: 16px; height: 16px; }
.post-btn.x       { background: linear-gradient(135deg, #2b3137, #14171a); }
.post-btn.bsky    { background: linear-gradient(135deg, #2aa4f0, #1d80d0); }
.post-btn.misskey { background: linear-gradient(135deg, #9cc13e, #7bb12f); }
.post-btn.copy    { background: linear-gradient(135deg, var(--green), var(--green-dark)); }
.post-btn.more {
  background: rgba(255,255,255,.7); color: var(--text-sub);
  border: 1px solid rgba(120,160,140,.3);
}
.post-btn.more:hover { background: #fff; border-color: var(--green); }
@media (max-width: 560px) {
  .preview-body { flex-direction: column; }
  /* SNSはアイコンのみ・横一列 */
  .post-actions { flex-direction: row; flex-wrap: nowrap; flex: 0 0 auto; gap: 6px; }
  .post-btn { flex: 1 1 0; width: auto; padding: 10px 6px; gap: 0; }
  .post-btn > span:not(.ic) { display: none; }
  .post-btn .ic svg { width: 18px; height: 18px; }
}

/* モーダル等で使う汎用ボタン */
.btn-primary { background: linear-gradient(135deg, var(--green), var(--green-dark)); color: #fff; border-radius: 999px; padding: 12px; font-size: 14px; font-weight: 800; box-shadow: 0 4px 14px rgba(var(--green-rgb),.35); transition: var(--transition); }
.btn-primary:hover { filter: brightness(1.04); }
.btn-sub { flex: 1; background: rgba(255,255,255,.7); color: var(--text); border: 1px solid rgba(120,160,140,.3); border-radius: 999px; padding: 11px; font-size: 13px; font-weight: 700; transition: var(--transition); }
.btn-sub:hover { background: #fff; border-color: var(--green); }


/* ===== モーダル / ポップオーバー ===== */
.modal-backdrop { position: fixed; inset: 0; background: rgba(31,60,45,.32); backdrop-filter: blur(3px); z-index: 60; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-backdrop.active { display: flex; animation: fade .18s ease; }
.modal {
  width: 100%; max-width: 580px; max-height: 84vh; overflow: hidden;
  background: rgba(255,255,255,.86); backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid var(--glass-border); border-radius: var(--radius); box-shadow: 0 20px 60px rgba(31,107,66,.25);
  display: flex; flex-direction: column; animation: pop .2s ease;
}
@keyframes pop { from { transform: scale(.96); opacity: .6; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; background: rgba(255,255,255,.5); border-bottom: 1px solid rgba(120,160,140,.18); color: var(--text); }
.modal-head h3 { font-size: 15.5px; font-weight: 800; }
.modal-head .x { width: 32px; height: 32px; border-radius: 9px; background: rgba(120,160,140,.12); color: var(--text-sub); font-size: 18px; display: flex; align-items: center; justify-content: center; transition: var(--transition); }
.modal-head .x:hover { background: rgba(120,160,140,.22); color: var(--text); }
.modal-body { padding: 20px; overflow-y: auto; }

.menu-item { display: flex; align-items: center; gap: 12px; width: 100%; border-radius: 10px; padding: 12px 12px; font-size: 14.5px; font-weight: 600; color: var(--text); text-align: left; transition: var(--transition); }
.menu-item:hover { background: var(--green-light); }
.menu-item .ic { font-size: 18px; width: 24px; text-align: center; }
.menu-item.danger { color: var(--error); }
.menu-item:disabled { opacity: .38; cursor: not-allowed; }
.menu-sep { height: 1px; background: rgba(120,160,140,.2); margin: 8px 0; }

.aa-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.aa-grid button { border: 1px solid rgba(120,160,140,.28); background: rgba(255,255,255,.6); border-radius: 10px; padding: 11px 6px; font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: var(--transition); }
.aa-grid button:hover { background: var(--green-light); border-color: var(--green); }

.code-area { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; min-height: 96px; word-break: break-all; }

/* ===== テンプレ一覧 ===== */
.list-toolbar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.list-toolbar input { flex: 1; min-width: 180px; }
.list-toolbar select { flex: 0 0 150px; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.tpl-card { overflow: hidden; display: flex; flex-direction: column; transition: var(--transition); cursor: pointer; }
.tpl-card:hover { transform: translateY(-3px); box-shadow: 0 14px 36px rgba(31,107,66,.16); }
.tpl-card .thumb { height: 108px; background: linear-gradient(135deg, var(--green-light), rgba(120,200,220,.18)); display: flex; align-items: center; justify-content: center; color: var(--green); font-size: 34px; }
.tpl-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.tpl-card .thumb svg { width: 34px; height: 34px; }
.tpl-card .body { padding: 12px 14px; flex: 1; }
.tpl-card .body .name { font-weight: 800; font-size: 14px; margin-bottom: 3px; }
.tpl-card .body .meta { font-size: 11.5px; color: var(--text-sub); line-height: 1.5; }
.tpl-card .tactions { display: flex; border-top: 1px solid rgba(120,160,140,.18); }
.tpl-card .tactions button { flex: 1; padding: 10px 0; font-size: 12px; font-weight: 700; color: var(--green-text); border-right: 1px solid rgba(120,160,140,.18); transition: var(--transition); }
.tpl-card .tactions button:last-child { border-right: none; }
.tpl-card .tactions button:hover { background: var(--green-light); }
.tpl-card .tactions button.danger { color: var(--error); }
.empty-note { text-align: center; color: var(--text-sub); padding: 60px 20px; font-size: 14px; line-height: 1.8; }

/* ===== 設定 ===== */
.setting-group h3 { font-size: 14px; font-weight: 800; margin-bottom: 12px; color: var(--text); }
.btn-block { width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 13px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 700; border: 1px solid rgba(120,160,140,.3); background: rgba(255,255,255,.6); color: var(--text); margin-bottom: 10px; transition: var(--transition); }
.btn-block:hover { background: #fff; border-color: var(--green); }
.btn-block.danger { color: var(--error); border-color: rgba(239,71,111,.35); background: rgba(239,71,111,.06); }
.hint { font-size: 12px; color: var(--text-sub); margin-top: 4px; line-height: 1.7; }
.backup-status { font-size: 12.5px; color: var(--text-sub); padding: 10px 12px; background: rgba(255,255,255,.5); border: 1px solid rgba(120,160,140,.22); border-radius: var(--radius-sm); margin-bottom: 12px; }
.backup-status.warn { color: #9a6a00; background: rgba(255,209,102,.18); border-color: rgba(255,209,102,.5); }
/* トグルスイッチ（利用統計など）— 枠で囲って一体化、トグルは左 */
.switch-row {
  display: flex; align-items: center; gap: 12px; margin-top: 14px; cursor: pointer;
  padding: 12px 14px; border: 1px solid rgba(120,160,140,.25); border-radius: var(--radius-sm);
  background: rgba(255,255,255,.5); transition: var(--transition);
}
.switch-row:hover { border-color: var(--green); background: rgba(255,255,255,.7); }
.switch-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.switch-text b { font-size: 13px; font-weight: 800; color: var(--text); }
.switch-text small { font-size: 11px; color: var(--text-faint); font-weight: 400; line-height: 1.5; }
.switch { position: relative; flex: 0 0 auto; display: inline-flex; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track {
  width: 44px; height: 26px; border-radius: 999px; background: #cfd8d3;
  display: inline-flex; align-items: center; padding: 3px; transition: background .2s ease;
}
.switch-thumb { width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s ease; }
.switch input:checked + .switch-track { background: var(--green); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(18px); }
.switch input:focus-visible + .switch-track { box-shadow: 0 0 0 3px rgba(var(--green-rgb),.3); }

/* PR（無関係の宣伝）リンクカード */
.pr-list { display: flex; flex-direction: column; gap: 10px; }
.pr-item {
  display: flex; align-items: center; gap: 12px; padding: 12px;
  border: 1px solid rgba(120,160,140,.25); border-radius: var(--radius-sm);
  background: rgba(255,255,255,.55); text-decoration: none; color: var(--text);
  transition: var(--transition);
}
.pr-item:hover { background: #fff; border-color: var(--green); transform: translateY(-1px); }
.pr-thumb {
  flex: 0 0 auto; width: 44px; height: 44px; border-radius: 10px;
  background: var(--green-light); display: inline-flex; align-items: center; justify-content: center;
  overflow: hidden; color: var(--green-dark);
}
.pr-thumb img { width: 32px; height: 32px; display: block; }
.pr-thumb .ic svg { width: 22px; height: 22px; }
.pr-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pr-title { font-size: 13px; font-weight: 800; color: var(--text); }
.pr-desc { font-size: 11.5px; color: var(--text-sub); line-height: 1.6; }
.pr-arrow { flex: 0 0 auto; color: var(--text-faint); }
.pr-item:hover .pr-arrow { color: var(--green); }

.setting-credit { text-align: center; padding: 4px 0; }
.setting-credit-name { font-size: 13px; font-weight: 800; color: var(--text); }
.setting-credit-ver { font-size: 11px; font-weight: 700; color: var(--text-faint); margin-left: 4px; }
.setting-credit-by { font-size: 12px; color: var(--text-sub); margin-top: 4px; }

/* トースト */
.toast { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(10px); background: rgba(31,60,45,.94); color: #fff; padding: 11px 20px; border-radius: 999px; font-size: 13.5px; font-weight: 600; z-index: 100; opacity: 0; transition: all .25s ease; pointer-events: none; max-width: 90vw; box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.back-link { font-size: 13px; font-weight: 700; color: var(--green-text); margin-bottom: 14px; }

/* ===== フッター ===== */
.site-footer {
  margin-top: 36px; padding: 32px 22px calc(20px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(231,243,236,.65), rgba(255,255,255,.5));
  border-top: 1px solid var(--glass-border);
}
.footer-inner {
  max-width: var(--maxw); margin: 0 auto;
  display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.1fr); gap: 32px; align-items: start;
}
@media (max-width: 760px) { .footer-inner { grid-template-columns: 1fr; gap: 24px; } }

.footer-logo { display: flex; align-items: center; gap: 10px; }
.footer-logo-img { width: 38px; height: 38px; display: block; }
.footer-logo-text { font-weight: 800; font-size: 17px; color: var(--text); }
.footer-description { margin-top: 10px; font-size: 12.5px; line-height: 1.8; color: var(--text-sub); }
.footer-about-link { color: var(--green-text); font-weight: 700; margin-left: 6px; white-space: nowrap; text-decoration: none; }
.footer-about-link:hover { text-decoration: underline; }

/* このツールについて モーダル */
/* このツールについて モーダル（緑は控えめ・余白広め） */
.about-body { padding: 24px; }
.about-lead { font-size: 14.5px; font-weight: 700; color: var(--text); line-height: 1.85; margin-bottom: 12px; }
.about-sub { font-size: 13px; color: var(--text-sub); line-height: 1.85; margin-bottom: 22px; }
.about-feature { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 18px; }
.about-ic { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 11px; background: var(--green-light); color: var(--green-dark); display: inline-flex; align-items: center; justify-content: center; }
.about-ic svg { width: 19px; height: 19px; }
.about-feature-text { display: flex; flex-direction: column; gap: 3px; padding-top: 2px; }
.about-feature-text b { font-size: 13.5px; font-weight: 800; color: var(--text); }
.about-feature-text span { font-size: 12.5px; color: var(--text-sub); line-height: 1.7; }
.about-note { font-size: 12px; color: var(--text-sub); line-height: 1.75; background: rgba(120,160,140,.08); border: 1px solid rgba(120,160,140,.2); border-radius: 10px; padding: 12px 14px; margin-top: 22px; }
.about-ok { width: 100%; margin-top: 22px; padding: 13px; }
.footer-social { display: flex; gap: 10px; margin-top: 14px; }
.footer-social-link {
  width: 38px; height: 38px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: #fff; color: var(--green-text); border: 1px solid rgba(120,160,140,.3);
  transition: var(--transition);
}
.footer-social-link .ic svg { width: 18px; height: 18px; }
.footer-social-link:hover { background: var(--green); color: #fff; border-color: var(--green); transform: translateY(-2px); }

.footer-nav-title { font-size: 13px; font-weight: 800; color: var(--green-text); margin-bottom: 12px; }
.footer-nav-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 420px) { .footer-nav-grid { grid-template-columns: 1fr; } }
.footer-nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius-sm);
  text-decoration: none; color: var(--text); background: rgba(255,255,255,.6);
  border: 1px solid rgba(120,160,140,.22); transition: var(--transition);
}
.footer-nav-item:hover { background: #fff; border-color: var(--green); transform: translateY(-1px); }
.footer-nav-item .ic { color: var(--green); flex: 0 0 auto; }
.footer-nav-item .ic svg { width: 18px; height: 18px; }
.footer-nav-text { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.footer-nav-text b { font-size: 13px; font-weight: 800; }
.footer-nav-text small { font-size: 10.5px; color: var(--text-faint); }
.footer-bottom { max-width: var(--maxw); margin: 24px auto 0; padding-top: 16px; border-top: 1px solid rgba(120,160,140,.18); text-align: center; font-size: 11.5px; color: var(--text-faint); }

/* ===== モバイル全体調整（文字を詰める / ヘッダーはアイコンのみ） ===== */
@media (max-width: 600px) {
  body { font-size: 13px; }
  /* 入力欄もボタン等と同じ ~13px に揃える */
  input[type=text], input[type=date], textarea, select { font-size: 13px; padding: 9px 11px; }
  .field > label { font-size: 11.5px; }
  .card { padding: 14px; }
  .wrap { padding: 14px; }
  .card-title, .deco-label { font-size: 12px; }

  /* ヘッダー：テキストを省きアイコンのみに（デザイン崩れ防止） */
  .app-header { padding: 10px 12px; gap: 6px; }
  .app-header .brand { font-size: 15px; }
  .app-header .brand .ver { display: none; }
  .nav-label { display: none; }
  .nav-pill { padding: 8px 10px; }
}
@media (max-width: 360px) {
  .app-header .brand > span:nth-child(2) { display: none; } /* 極狭幅ではロゴのみ */
}
