:root {
  --red: #c8102e; --red-dark: #a00c24; --red-soft: #fde8ec; --red-line: #f3b6c1;
  --bg: #f4f4f6; --card: #fff; --text: #1d1d1f; --muted: #6e6e73; --line: #e3e3e8; --chip: #fff; --ink: #1d1d1f;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #111113; --card: #1c1c1e; --text: #f5f5f7; --muted: #a1a1a6; --line: #34343a; --chip: #1c1c1e; --ink: #f5f5f7;
    --red-soft: #3a1219; --red-line: #7a2232; }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", "Meiryo", sans-serif;
  -webkit-text-size-adjust: 100%; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
button { font: inherit; color: inherit; cursor: pointer; }
svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.wrap { max-width: 1000px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }
[hidden] { display: none !important; }

/* ヘッダー */
.bar { background: var(--red); color: #fff; padding: calc(16px + env(safe-area-inset-top)) 0 20px; }
.head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.bar h1 { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: .02em; }
.bar .sub { margin: 4px 0 0; font-size: 12px; opacity: .85; }
.actions { display: flex; gap: 8px; flex: none; }
.hbtn { display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.35);
  color: #fff; border-radius: 999px; padding: 5px 12px 5px 5px; font-size: 13px; font-weight: 600; white-space: nowrap; }
#admin { padding: 6px 12px; border-radius: 8px; }
.search { display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,.95); color: #8e8e93; border-radius: 10px; padding: 0 14px; margin-top: 14px; }
.search svg { font-size: 18px; }
.search input { flex: 1; border: 0; background: none; outline: none; font-size: 16px; padding: 12px 0; color: #1d1d1f; }
.search.in { background: var(--card); border: 1px solid var(--line); margin: 16px 0 8px; }
.search.in input { color: var(--text); }

/* カテゴリーチップ */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 12px 16px; background: var(--bg); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); background: var(--chip); border-radius: 999px; padding: 7px 14px; font-size: 13px; white-space: nowrap; }
.chip b { font-weight: 700; margin-left: 4px; }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }

main { padding-top: 16px; }
.loading { text-align: center; color: var(--muted); margin-top: 40px; }
.card { background: var(--card); border-radius: 14px; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.muted { color: var(--muted); font-size: 14px; line-height: 1.6; }
.small { font-size: 12px; }

/* 合言葉 */
.gate { text-align: center; max-width: 420px; margin: 12px auto; }
.gate h2 { margin: 0 0 8px; font-size: 20px; }
.gate input#pass { width: 100%; font-size: 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); color: var(--text); margin-top: 8px; text-align: center; }
.check { display: inline-flex; gap: 6px; align-items: center; margin: 10px 0; font-size: 14px; color: var(--muted); }
.primary { width: 100%; padding: 12px; border: 0; border-radius: 10px; background: var(--red); color: #fff; font-size: 16px; font-weight: 600; }
.primary:active { background: var(--red-dark); }
.primary:disabled { opacity: .6; }
.err { color: var(--red); font-size: 14px; min-height: 1.2em; margin: 10px 0 0; }

/* 定例会カード */
.meeting { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; text-align: left;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.meeting .date { color: var(--red); font-weight: 800; font-size: 16px; }
.meeting .vis { font-size: 15px; margin-top: 2px; }
.meeting .right { display: flex; align-items: center; gap: 4px; color: var(--muted); }
.stack { display: flex; }
.stack .av + .av { margin-left: -8px; }

.countrow { display: flex; align-items: center; justify-content: space-between; margin: 14px 0 6px; }
.countrow p { margin: 0; color: var(--muted); font-size: 13px; }
.soft { display: inline-flex; align-items: center; gap: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 12px; font-size: 13px; font-weight: 600; }
.soft.spin svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* セクション */
.group { margin-top: 18px; }
.group h2 { display: flex; align-items: baseline; gap: 8px; margin: 0; padding-left: 12px; border-left: 4px solid var(--red); font-size: 18px; font-weight: 800; }
.group h2 small { font-size: 12px; color: var(--muted); font-weight: 500; }
.recruit { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0 0 16px; font-size: 12px; color: var(--muted); }
.recruit span.r { color: var(--red); border: 1px dashed var(--red); border-radius: 6px; padding: 2px 8px; background: var(--card); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; margin-top: 12px; }

/* メンバーカード */
.mcard { position: relative; display: flex; gap: 14px; align-items: flex-start; width: 100%; text-align: left;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.mcard.visitor { border: 2px solid var(--red-line); box-shadow: 0 0 0 3px var(--red-soft); }
.badge { position: absolute; top: -10px; right: 12px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 3px 10px; }
.photo { width: 72px; height: 88px; border-radius: 10px; object-fit: cover; flex: none; background: var(--bg); }
.photo.ph { display: grid; place-items: center; font-size: 28px; font-weight: 700; color: var(--red); background: var(--red-soft); }
.minfo { min-width: 0; flex: 1; }
.cat { display: inline-block; background: var(--red-soft); color: var(--red); font-size: 11px; font-weight: 700; border-radius: 4px; padding: 2px 8px; margin-bottom: 4px; }
.nm { font-size: 18px; font-weight: 800; line-height: 1.3; }
.kn { font-size: 12px; color: var(--muted); }
.co { font-size: 13px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.none { text-align: center; color: var(--muted); padding: 40px 0; }

/* アバター */
.av { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--red-soft); color: var(--red);
  font-size: 13px; font-weight: 700; overflow: hidden; flex: none; border: 2px solid var(--card); }
.av img { width: 100%; height: 100%; object-fit: cover; }
.av.xs { width: 24px; height: 24px; font-size: 12px; border: 0; }
.av.q { background: #fff; color: var(--red); }

/* 下タブ */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: grid; grid-template-columns: repeat(3, 1fr);
  background: var(--card); border-top: 1px solid var(--line); padding: 6px 0 calc(6px + env(safe-area-inset-bottom)); }
.tabs button { display: flex; flex-direction: column; align-items: center; gap: 2px; background: none; border: 0; font-size: 11px; color: var(--muted); padding: 4px; }
.tabs button svg { font-size: 22px; }
.tabs button.on { color: var(--red); font-weight: 700; }
.tabs .plus { display: grid; place-items: center; width: 44px; height: 44px; margin-top: -22px; border-radius: 50%; background: var(--red); color: #fff;
  box-shadow: 0 4px 10px rgba(200,16,46,.35); border: 3px solid var(--card); }
.tabs .plus svg { font-size: 22px; stroke-width: 2.5; }

/* ダイアログ */
.sheet { width: min(560px, calc(100% - 24px)); max-height: 90vh; border: 0; border-radius: 16px; padding: 24px; background: var(--card); color: var(--text); }
.sheet::backdrop { background: rgba(0,0,0,.45); }
.sheet h2 { margin: 0 0 6px; font-size: 20px; font-weight: 800; }
.sheet .x { position: absolute; top: 12px; right: 12px; background: none; border: 0; font-size: 22px; color: var(--muted); }
.wg { color: var(--red); font-weight: 800; font-size: 14px; border-left: 3px solid var(--red); padding-left: 8px; margin: 18px 0 8px; }
.wrow { display: flex; gap: 12px; align-items: center; width: 100%; text-align: left; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; }
.wrow:hover { border-color: var(--red-line); }
.wrow .photo { width: 52px; height: 62px; border-radius: 8px; }
.wrow .photo.ph { font-size: 20px; }
.wrow .nm { font-size: 16px; }
.dl { display: grid; gap: 8px; margin-top: 16px; font-size: 15px; }
.dl a { color: var(--red); text-decoration: none; }
.dhead { display: flex; gap: 14px; align-items: center; }
.dhead .photo { width: 96px; height: 118px; }

/* ビジター一覧 */
.vlist { display: grid; gap: 10px; margin-top: 12px; }
.vrow { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.vrow .by { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 13px; color: var(--muted); }
.empty { text-align: center; }
.ghost { display: block; margin: 32px auto 0; background: none; border: 0; color: var(--muted); font-size: 12px; text-decoration: underline; }

@media (max-width: 640px) {
  .bar h1 { font-size: 16px; }
  .head { flex-direction: column; }
  .actions { align-self: flex-end; margin-top: -4px; }
  .nm { font-size: 17px; }
}

/* 本人確認 */
.confirm { text-align: center; }
.confirm h2 { margin-bottom: 16px; }
.photo.big { width: 150px; height: 180px; border-radius: 14px; border: 3px solid var(--red-line); margin: 0 auto 14px; display: block; }
.photo.big.ph { display: grid; font-size: 56px; }
.confirm .nm { font-size: 24px; }
.confirm .co { font-size: 15px; margin: 4px 0 8px; }
.pin { text-align: left; max-width: 340px; margin: 22px auto 0; }
.pin > label { font-size: 13px; color: var(--muted); }
#pin { width: 100%; margin-top: 6px; font-size: 20px; letter-spacing: .3em; text-align: center; padding: 14px; border: 2px solid var(--text);
  border-radius: 10px; background: var(--card); color: var(--text); }
.btns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 20px; }
.gray { padding: 14px; border: 0; border-radius: 10px; background: var(--bg); font-size: 16px; font-weight: 700; }
.btns .primary { padding: 14px; font-weight: 700; }
.center { text-align: center; margin-top: 16px; }

/* 本物に合わせた調整 */
.wrap { max-width: 1240px; }
.grid { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.chips { background: var(--card); }
.av { background: var(--bg); color: var(--muted); border-color: var(--card); }
.av.q { background: #fff; color: var(--red); }
.hbtn .av.xs { width: 30px; height: 30px; }
.tabs .plus { width: 40px; height: 40px; margin-top: 0; border: 0; box-shadow: none; }
.tabs .ico { position: relative; display: inline-flex; }
.tbadge { position: absolute; top: -6px; right: -10px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--red); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--card); }
.cat { white-space: normal; }

/* ビジター登録 */
.narrow { max-width: 780px; margin: 0 auto; }
.rhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rhead h2 { margin: 0; font-size: 24px; font-weight: 800; }
.byPill { display: inline-flex; align-items: center; gap: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  padding: 4px 14px 4px 4px; font-size: 13px; color: var(--muted); }
.byPill b { color: var(--text); }
.byPill .av.xs { width: 28px; height: 28px; }
.steps { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 0; margin: 18px 0 16px; }
.steps li { border-top: 4px solid var(--line); border-radius: 2px; padding-top: 8px; font-size: 13px; color: var(--muted); line-height: 1.5; }
.steps li b { display: block; font-weight: 600; }
.steps li.on { border-color: var(--red); }
.steps li.cur { color: var(--red); font-weight: 700; }
.rcard { padding: 24px; }
.rcard h3 { margin: 0 0 18px; font-size: 20px; font-weight: 800; }
.f { display: block; margin-top: 18px; }
.f > span { display: block; font-weight: 700; font-size: 15px; margin-bottom: 8px; }
.f small { font-weight: 400; color: var(--muted); font-size: 12px; margin-left: 4px; }
.req { font-style: normal; background: var(--red); color: #fff; font-size: 11px; border-radius: 4px; padding: 1px 6px; margin-left: 4px; vertical-align: 2px; }
.f input, .f textarea { width: 100%; font: inherit; font-size: 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); color: var(--text); }
.f input:focus, .f textarea:focus { outline: 2px solid var(--red-line); border-color: var(--red); }
.f textarea { resize: vertical; min-height: 110px; }
.hint { font-size: 13px; color: var(--muted); margin: 6px 0 0; }
.link { background: none; border: 0; padding: 0; margin-top: 10px; color: var(--red); font-weight: 700; font-size: 14px; }
.link.plain { color: var(--muted); }
.reclist { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.reclist .r { color: var(--red); border: 1px dashed var(--red); border-radius: 6px; padding: 4px 10px; background: var(--card); font-size: 13px; }
.dash { border: 0; border-top: 1px dashed var(--line); margin: 22px 0 6px; }
.dates { display: grid; gap: 10px; }
.date-opt { display: flex; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; cursor: pointer; }
.date-opt:has(input:checked) { border-color: var(--red); background: var(--red-soft); }
.date-opt input { accent-color: var(--red); width: 18px; height: 18px; }
.date-opt b { display: block; font-size: 16px; }
.date-opt small { color: var(--muted); }
.summary { display: grid; grid-template-columns: max-content 1fr; gap: 10px 16px; margin: 0; font-size: 15px; }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; white-space: pre-wrap; }
.nextbar { position: sticky; bottom: calc(70px + env(safe-area-inset-bottom)); display: flex; gap: 12px; margin-top: 20px; padding-bottom: 8px; }
.nextbar .primary { flex: 1; padding: 16px; font-size: 17px; font-weight: 700; border-radius: 12px; box-shadow: 0 6px 16px rgba(200,16,46,.3); }
.nextbar .gray { flex: none; width: 30%; }
@media (max-width: 640px) { .rhead h2 { font-size: 20px; } .byPill { font-size: 12px; } }

/* 下タブを本物に合わせる：中央寄せ・高さをそろえる */
.tabs { grid-template-columns: repeat(3, minmax(0, 240px)); justify-content: center; align-items: end; padding-top: 8px; }
.tabs button { justify-content: flex-end; height: 56px; gap: 4px; }
.tabs .plus { width: 36px; height: 36px; }
.tabs .plus svg { font-size: 20px; }

/* 本物に合わせた微調整 */
.search { background: #fff; }
.chip b { font-weight: 400; color: var(--muted); }
.chip.on b { font-weight: 700; color: inherit; }
.photo { width: 88px; height: 108px; }

/* ビジター（本物に合わせて） */
.vhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.vhead h2 { margin: 0; font-size: 22px; font-weight: 800; }
.vtools { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.vsec { display: flex; align-items: center; justify-content: space-between; margin-top: 24px; }
.sech { margin: 0; padding-left: 12px; border-left: 4px solid var(--red); font-size: 20px; font-weight: 800; display: flex; align-items: baseline; gap: 10px; }
.sech small { font-size: 13px; font-weight: 400; color: var(--muted); }
.fb { border-radius: 8px; }
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; margin-top: 14px; align-items: start; }
.vcard { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; }
.vtop { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.vn { font-size: 20px; font-weight: 800; }
.san { font-size: 13px; color: var(--muted); margin-left: 4px; }
.status { flex: none; background: var(--bg); color: var(--muted); font-size: 12px; font-weight: 700; border-radius: 999px; padding: 3px 10px; }
.vco { color: var(--muted); font-size: 15px; margin-top: 8px; }
.vco .cat { margin: 0 0 0 4px; vertical-align: 1px; }
.about { background: var(--bg); border-radius: 10px; padding: 12px 14px; margin-top: 12px; white-space: pre-wrap; line-height: 1.7; }
.vrowx { display: grid; grid-template-columns: 72px 1fr; gap: 8px; margin-top: 12px; align-items: start; }
.lbl { font-size: 13px; color: var(--muted); line-height: 1.4; padding-top: 8px; }
.chipsx { display: flex; flex-wrap: wrap; gap: 8px; }
.mchip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 4px 14px 4px 4px; font-size: 14px; }
.mchip .av.xs { width: 28px; height: 28px; }
.sns { font-size: 12px; color: var(--muted); margin-top: 14px; }
.fbtext { width: 100%; font: inherit; font-size: 14px; line-height: 1.7; padding: 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); color: var(--text); margin: 12px 0; resize: vertical; }

/* 連絡先ステップ */
.notice { display: flex; gap: 8px; background: var(--red-soft); border: 1px solid var(--red-line); color: var(--red); border-radius: 10px;
  padding: 12px 16px; font-size: 14px; line-height: 1.7; margin-bottom: 4px; }
.notice b { font-weight: 800; }
.plusR { color: var(--red); font-weight: 700; margin-right: 2px; }
.snsopts { display: flex; flex-wrap: wrap; gap: 10px; }
.snsopt { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 999px; padding: 10px 18px;
  font-size: 16px; font-weight: 700; cursor: pointer; }
.snsopt input { accent-color: var(--red); width: 20px; height: 20px; margin: 0; }
.snsopt:has(input:checked) { border-color: var(--red); }
.outline { flex: none; width: 32%; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); font-size: 17px; font-weight: 700; }

/* 参加日・繋げたいメンバー */
.date-opt { padding: 18px 20px; }
.date-opt b { display: inline; font-size: 17px; flex: 1; }
.date-opt input { width: 22px; height: 22px; }
.nextb { background: var(--red); color: #fff; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 3px 12px; }
.h3sub { margin: 32px 0 6px !important; font-size: 18px !important; }
.h3sub small { font-size: 12px; font-weight: 400; color: var(--muted); margin-left: 4px; }
.dashbtn { width: 100%; margin-top: 16px; padding: 16px; border: 2px dashed var(--red-line); border-radius: 12px; background: var(--red-soft);
  color: var(--red); font-size: 16px; font-weight: 700; }
.connect { margin-top: 14px; }
.connect:empty { display: none; }
.mchip .rm { background: none; border: 0; color: var(--muted); font-size: 16px; padding: 0 0 0 4px; line-height: 1; }
.wrow { position: relative; }
.wrow .tick { margin-left: auto; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center;
  color: transparent; font-weight: 700; flex: none; }
.wrow.sel { border-color: var(--red); background: var(--red-soft); }
.wrow.sel .tick { background: var(--red); border-color: var(--red); color: #fff; }
.pickbar { position: sticky; bottom: -24px; display: flex; align-items: center; gap: 12px; background: var(--card); padding: 12px 0 0; margin-top: 8px; }
.pickbar .primary { flex: 1; }

/* 確認ページ */
.introcard { display: flex; gap: 16px; align-items: center; border: 2px solid var(--red-line); border-radius: 12px; padding: 14px 18px; }
.introcard .photo { width: 64px; height: 78px; }
.introcard .nm { font-size: 20px; }
.lblsm { font-size: 13px; color: var(--muted); }
.summary { display: block; margin-top: 8px; }
.sumsec { border-top: 1px solid var(--line); padding: 18px 0; }
.sumh { display: flex; justify-content: space-between; align-items: center; font-size: 14px; font-weight: 700; color: var(--muted); margin-bottom: 8px; }
.fix { background: none; border: 0; color: var(--red); font-weight: 800; font-size: 15px; padding: 0; }
.sumsec .big { font-size: 18px; line-height: 1.9; }
.sumsec .sub { font-size: 15px; color: var(--muted); margin-top: 4px; }
.consent { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; margin-top: 8px;
  font-size: 15px; line-height: 1.8; cursor: pointer; }
.consent input { width: 22px; height: 22px; flex: none; margin-top: 4px; accent-color: var(--red); }
.consent:has(input:checked) { border-color: var(--red); background: var(--red-soft); }

/* フッター */
.foot { text-align: center; color: var(--muted); font-size: 13px; margin: 56px 0 8px; }
.foot p { margin: 0; }
.foot .ghost { margin-top: 6px; font-size: 13px; }
.privbody p { line-height: 1.8; font-size: 14px; margin: 14px 0 0; }

/* 管理画面 */
.seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; background: var(--line); border-radius: 12px; padding: 4px; margin: 16px 0; }
.seg button { border: 0; background: none; border-radius: 9px; padding: 10px 4px; font-size: 14px; font-weight: 700; color: var(--muted); }
.seg button.on { background: var(--card); color: var(--red); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
#adminBanner .notice { margin-top: 12px; }
.notice.gray { background: var(--bg); border-color: var(--line); color: var(--muted); }
.sech.ah { font-size: 17px; margin: 22px 0 10px; }
.arow { display: flex; gap: 14px; align-items: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 8px; }
.arow.slim { align-items: center; padding: 8px 14px; }
.arow.dim { opacity: .6; }
.ainfo { flex: 1; min-width: 0; line-height: 1.7; }
.ainfo .sub { font-size: 13px; color: var(--muted); }
.an { font-size: 16px; }
.aact { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; align-items: center; flex: none; max-width: 50%; }
.aact select { font: inherit; font-size: 13px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--text); }
.soft.danger { color: var(--red); }
.photo.xs { width: 48px; height: 58px; border-radius: 8px; }
.photo.xs.ph { font-size: 18px; }
.tag { display: inline-block; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 8px; background: var(--bg); color: var(--muted); margin-left: 4px; }
.tag.ok { background: #e7f6ec; color: #1d7a3e; }
.atools { display: flex; gap: 10px; align-items: center; }
.atools .search { flex: 1; margin: 0; }
.primary.sm { width: auto; padding: 10px 16px; font-size: 14px; white-space: nowrap; }
.logs { background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.log { display: flex; flex-wrap: wrap; gap: 4px 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 14px; }
.log:last-child { border-bottom: 0; }
.log .when { color: var(--muted); font-variant-numeric: tabular-nums; }
.log .sub { width: 100%; color: var(--muted); font-size: 13px; }
.aset { margin-bottom: 14px; }
.aset h3 { margin: 0 0 4px; font-size: 17px; }
.aset h3 small { font-size: 12px; color: var(--muted); font-weight: 400; }
.aset .chipsx { margin: 12px 0; }
.aset .f input { padding: 10px 12px; font-size: 15px; }
.aset .primary.sm { margin-top: 14px; }
.aset code { background: var(--bg); padding: 1px 6px; border-radius: 4px; }
.mchip.pad { padding: 6px 8px 6px 14px; }
.hrow { display: flex; gap: 8px; }
.hrow input { flex: 1; font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--text); }
.sheet.small { width: min(400px, calc(100% - 24px)); }
.pinbox { width: 100%; margin: 12px 0 0; font-size: 22px; letter-spacing: .3em; text-align: center; padding: 14px; border: 2px solid var(--text);
  border-radius: 10px; background: var(--card); color: var(--text); }
#formDlg select { width: 100%; font: inherit; font-size: 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--text); }
.phrow { display: flex; gap: 12px; align-items: center; }
.phrow .photo { width: 64px; height: 78px; }
.toast { position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 100;
  background: #1d1d1f; color: #fff; padding: 12px 20px; border-radius: 999px; font-size: 14px; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.contact { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 14px; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.contact a { color: var(--red); text-decoration: none; }
.contact .sub { width: 100%; color: var(--muted); }
.mcard.conn { border-color: var(--red-line); box-shadow: none; }
@media (max-width: 640px) { .arow { flex-wrap: wrap; } .aact { max-width: none; width: 100%; justify-content: flex-start; } .seg button { font-size: 12px; } }

/* パスワード */
.pin input { width: 100%; margin-top: 6px; font-size: 17px; padding: 13px 14px; border: 2px solid var(--text); border-radius: 10px;
  background: var(--card); color: var(--text); letter-spacing: .04em; }
#pin2Wrap { margin-top: 12px; }
.pin > label, #pin2Wrap > label { font-size: 13px; color: var(--muted); }
.pinbox { font-size: 18px; letter-spacing: .04em; text-align: left; }
.meter { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.meter i { flex: 1; height: 6px; border-radius: 3px; background: var(--line); position: relative; overflow: hidden; }
.meter i::after { content: ""; position: absolute; inset: 0; width: 0; background: var(--red); transition: width .2s; }
.meter[data-n="1"] i::after { width: 25%; }
.meter[data-n="2"] i::after { width: 50%; background: #e0a100; }
.meter[data-n="3"] i::after { width: 75%; background: #2f9e57; }
.meter[data-n="4"] i::after { width: 100%; background: #1d7a3e; }
.meter span { min-width: 5em; text-align: right; }
.meter[data-n="2"] i::after { width: 40%; background: #e8590c; }
.meter[data-n="3"] i::after { width: 70%; background: #e0a100; }
.meter[data-n="4"] i::after { width: 100%; background: #2f9e57; }
.tag.warn { background: #fff1e6; color: #c2410c; }
#agChange .notice { margin: 4px 0 6px; }
#agChange .f input { padding: 12px 14px; font-size: 16px; }

/* パスワード欄の見た目をそろえる（どの画面でも同じ） */
#pin, #pin2, #agPin, #agNew, #agNew2 {
  width: 100%; margin-top: 6px; padding: 13px 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
  font-size: 18px; letter-spacing: .02em; text-align: left; font-variant-ligatures: none;
  border: 2px solid var(--line); border-radius: 10px; background: var(--card); color: var(--text);
}
#pin:focus, #pin2:focus, #agPin:focus, #agNew:focus, #agNew2:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
#pin::placeholder, #pin2::placeholder, #agPin::placeholder { font-family: inherit; letter-spacing: 0; }
/* チェックボックスは元の大きさに戻す */
.pin .check, #agForm .check, #agChange .check { display: flex; align-items: center; gap: 8px; margin: 12px 0 4px; font-size: 14px; color: var(--muted); }
.pin .check input, #agForm .check input, #agChange .check input { width: 18px; height: 18px; margin: 0; padding: 0; border: 0; accent-color: var(--red); flex: none; }
.pin > label, #pin2Wrap > label { display: block; margin-top: 4px; }

/* 入力チェックのメッセージ */
.ferr { color: var(--red); font-size: 13px; margin: 6px 0 0; min-height: 0; }
.ferr:empty { display: none; }
input.bad, textarea.bad, select.bad { border-color: var(--red) !important; background: var(--red-soft) !important; }
.counter { display: block; text-align: right; font-size: 12px; color: var(--muted); margin-top: 4px; }
.counter.over { color: var(--red); font-weight: 700; }

/* 半角専用の欄のお知らせ・パスワードの「表示」 */
.hnote { color: #c2410c; font-size: 13px; margin: 6px 0 0; }
.hnote:empty { display: none; }
.pwpreview { font-size: 13px; color: var(--muted); margin: 6px 0 0; text-align: left; }
.pwpreview code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 15px; color: var(--text);
  background: var(--bg); padding: 2px 8px; border-radius: 6px; letter-spacing: .04em; word-break: break-all; }
