/* HIDEYUKI APP — 静かで、今日やることが埋もれない画面。色は役割の見分けにだけ使う */
:root {
  --bg: #e7f2f2;
  --panel: #ffffff;
  --text: #162122;
  --sub: #5a7173;
  --faint: #9bb1b2;
  --line: rgba(16, 70, 72, 0.13);
  --accent: #0f7f86;
  --done: #2f8a5e;
  --later: #b5703a;
  --danger: #b0413e;
  --radius: 0;      /* 角丸はなし（2026-09-24 本人）。丸のままにするのは役割の色・チェック・地図の印・今日の丸だけ */
  --tabh: 58px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111a1b;
    --panel: #1b2526;
    --text: #e6eeee;
    --sub: #91a6a7;
    --faint: #5f7476;
    --line: rgba(255, 255, 255, 0.10);
    --accent: #4fc3c7;
    --done: #5fb384;
    --later: #d69457;
    --danger: #de6b67;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }   /* display を指定した要素でも hidden を効かせる */
/* ★横揺れ止め：スマホで斜めになぞると画面ごと横にずれて戻る（ゴムのような動き）のを止める。
   overflow-x は hidden ではなく clip（hidden はスクロールの入れ物を作るので上のヘッダーの sticky が効かなくなる） */
html, body { margin: 0; background: var(--bg); color: var(--text); overflow-x: clip; overscroll-behavior-x: none; }
body {
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", sans-serif;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

#app { max-width: 720px; margin: 0 auto; min-height: 100dvh; }

.page { min-width: 0; }
.top {
  position: relative;
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 4px;
  padding: calc(env(safe-area-inset-top) + 8px) 14px 8px 14px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
}
.top-text { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }
/* ページ名は小さく四角で囲む（TODAY・CALENDAR…）。その右に大きな日付か名前 */
.top-title {
  flex-shrink: 0; font-size: 9.5px; font-weight: 700; letter-spacing: 0.09em;
  padding: 4px 6px; border: 1.5px solid var(--text); color: var(--text); line-height: 1;
}
.top-date { font-size: 15px; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* ヘッダーの真ん中。幅は centerTop() が測って入れる（左右のボタンに重ねないため） */
.top-date.center {
  position: absolute; left: 50%; top: calc(env(safe-area-inset-top) + 50%); transform: translate(-50%, -50%);
  pointer-events: none; text-align: center;
}
.hbtn {
  flex-shrink: 0; width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: none; border-radius: 0; color: var(--sub); padding: 0;
}
.hbtn:hover { background: var(--line); }
.top .hbtn:last-child { margin-right: -8px; }   /* 端のボタンは少し外へ出して、見た目の幅を入力欄と合わせる */
.hbtn svg, .tabs svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#back { margin-left: -8px; margin-right: -4px; }

/* ---- 文字の中に置く小さな印（app.js の ico()）。絵文字は使わず、下のメニューと同じ線の形で揃える ---- */
.ic { width: 1.05em; height: 1.05em; flex: none; vertical-align: -0.16em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ic.fill { fill: currentColor; }
.ic.go, .ic.arrow { color: var(--faint); }


.view { padding: 4px 14px calc(var(--tabh) + env(safe-area-inset-bottom) + 28px); }

/* ---- 下のメニュー（アイコンだけ） ---- */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--tabh) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.tabs a { position: relative; display: flex; align-items: center; justify-content: center; color: var(--faint); }
.tabs a svg { width: 25px; height: 25px; }
.tabs a.on { color: var(--accent); }
.badge { position: absolute; top: 9px; left: calc(50% + 6px); min-width: 17px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 10px; line-height: 17px; font-weight: 700; text-align: center; }
.badge:empty { display: none; }

/* Mac など幅の広い画面：下のメニューを左の縦メニューに */
@media (min-width: 900px) {
  #app { max-width: 1040px; display: grid; grid-template-columns: 76px 1fr; }
  .tabs {
    position: sticky; top: 0; bottom: auto; left: auto; right: auto; height: 100dvh;
    grid-template-columns: 1fr; grid-auto-rows: 64px; align-content: start; padding: 18px 0 0;
    border-top: 0; border-right: 1px solid var(--line); background: transparent; backdrop-filter: none;
  }
  /* ヘッダーも中身も同じ幅（Inbox の入力欄の幅）。★margin:auto は格子の中だと中身の幅に縮むので使わない */
  .page { width: 100%; max-width: 760px; justify-self: center; }
  .view { padding-bottom: 60px; }
  .toast { bottom: 24px !important; }
}

/* ---- 入力欄（Inbox に入れる） ---- */
.add {
  display: flex; gap: 8px; margin: 6px 0 14px;
}
.add input {
  flex: 1; min-width: 0; height: 46px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); outline: none; font-size: 16px;
}
.add input:focus { border-color: var(--accent); }
.add .where { align-self: center; font-size: 12px; color: var(--sub); white-space: nowrap; }

/* ---- 見出しとまとまり ---- */
.group { margin: 18px 0 6px; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--sub); font-weight: 600; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.muted { color: var(--sub); font-size: 13px; }
.empty { color: var(--faint); font-size: 14px; padding: 18px 4px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; margin: 0 6px 6px 0;
  border: 1px solid var(--line); border-radius: 0; background: var(--panel); font-size: 13px; color: var(--sub);
}
.chip.on { border-color: var(--accent); color: var(--accent); }
.row-tools { display: flex; flex-wrap: wrap; align-items: center; margin: 2px 0 4px; }

/* ---- タスクの行 ---- */
.list { background: var(--panel); border-radius: var(--radius); overflow: hidden; }
.list + .list { margin-top: 10px; }
.task { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.task:last-child { border-bottom: 0; }
.task-under {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: space-between;
  padding: 0 18px; font-size: 13px; font-weight: 700; color: #fff;
}
.task-under .l { opacity: 0; }
.task-under .r { opacity: 0; }
.task.sw-r .task-under { background: var(--done); }
.task.sw-r .task-under .l { opacity: 1; }
.task.sw-l .task-under { background: var(--later); }
.task.sw-l .task-under .r { opacity: 1; }
.task-main {
  position: relative; display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 14px; background: var(--panel);
  transition: transform 0.18s ease;
}
.task.dragging .task-main { transition: none; }
.check {
  flex-shrink: 0; width: 22px; height: 22px; margin-top: 1px; border-radius: 50%;
  border: 1.6px solid var(--faint); background: transparent; padding: 0;
}
.task.done .check { background: var(--done); border-color: var(--done); }
.task-body { flex: 1; min-width: 0; }
.task-title { word-break: break-word; }
.task.done .task-title { color: var(--faint); text-decoration: line-through; }
.task-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 2px; font-size: 12px; color: var(--sub); }
.task-meta .late { color: var(--danger); }
.task-meta .due { color: var(--later); }
.place { display: inline-flex; align-items: center; gap: 5px; }
.place .dot { width: 7px; height: 7px; }
.sort-btn { flex-shrink: 0; align-self: center; font-size: 12px; color: var(--accent); background: none; border: 1px solid var(--line); border-radius: 0; padding: 3px 8px; }

/* ---- 役割のツリー ---- */
.nav-row {
  display: flex; align-items: center; gap: 10px; padding: 13px 14px;
  background: var(--panel); border-bottom: 1px solid var(--line);
}
.nav-row:last-child { border-bottom: 0; }
.nav-row .name { flex: 1; min-width: 0; }
.nav-row .n { font-size: 13px; color: var(--sub); }
.nav-row .go { color: var(--faint); }
.crumb { font-size: 13px; color: var(--sub); margin: 2px 0 8px; display: flex; flex-wrap: wrap; gap: 4px; }
.crumb a { color: var(--accent); }
.memo-box { width: 100%; min-height: 90px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); outline: none; resize: vertical; line-height: 1.6; }
.memo-box:focus { border-color: var(--accent); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 40px; padding: 0 16px; border-radius: 0; border: 1px solid var(--line);
  background: var(--panel); font-size: 14px;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.danger { color: var(--danger); }
.btn.small { height: 32px; padding: 0 12px; font-size: 13px; }
.btns { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }

/* ---- 下から出るシート ---- */
.sheet { position: fixed; inset: 0; z-index: 20; }
.sheet-bg { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.35); }
.sheet-body {
  position: absolute; left: 0; right: 0; bottom: 0; max-width: 720px; margin: 0 auto;
  max-height: 88dvh; overflow-y: auto; overscroll-behavior: contain;
  padding: 18px 16px calc(env(safe-area-inset-bottom) + 18px);
  background: var(--bg); border-radius: 0;
}
.sheet h3 { margin: 0 0 10px; font-size: 15px; color: var(--sub); font-weight: 600; }
.field { margin: 12px 0; }
.field label { display: block; font-size: 12px; color: var(--sub); margin-bottom: 4px; }
.field input[type=text], .field input[type=date], .field input[type=password], .field textarea, .field select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 0; background: var(--panel); outline: none;
}
.field textarea { min-height: 110px; resize: vertical; line-height: 1.6; }
.date-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.date-btns .chip { margin: 0; }
.pick { display: block; width: 100%; text-align: left; padding: 11px 12px; border: 0; border-bottom: 1px solid var(--line); background: var(--panel); }
.pick.lv1 { padding-left: 32px; font-size: 15px; }
.pick.lv2 { padding-left: 52px; font-size: 14px; color: var(--sub); }
.pick.cur { color: var(--accent); font-weight: 600; }
.picks { border-radius: var(--radius); overflow: hidden; }

/* ---- 設定 ---- */
.set-row { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--panel); border-bottom: 1px solid var(--line); }
.set-row:last-child { border-bottom: 0; }
.set-row input[type=text] { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; padding: 4px 0; }
.set-row input[type=color] { width: 28px; height: 28px; border: 0; padding: 0; background: none; }
.icon-btn { width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 0; background: var(--panel); font-size: 13px; color: var(--sub); flex-shrink: 0; }
.token-box { word-break: break-all; font-family: ui-monospace, Menlo, monospace; font-size: 13px; padding: 10px 12px; border-radius: 0; background: var(--panel); border: 1px dashed var(--accent); }

/* ---- ログイン ---- */
.login { max-width: 360px; margin: 18vh auto 0; padding: 0 20px; text-align: center; }
.login h1 { font-size: 20px; letter-spacing: 0.08em; margin: 0 0 22px; }
.login input { width: 100%; height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: 0; background: var(--panel); outline: none; margin-bottom: 10px; }
.login .btn { width: 100%; height: 48px; }
.login .err { color: var(--danger); font-size: 13px; min-height: 20px; }

/* ---- 知らせ ---- */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 30;
  bottom: calc(var(--tabh) + env(safe-area-inset-bottom) + 14px);
  display: flex; align-items: center; gap: 14px; max-width: calc(100% - 32px);
  padding: 11px 16px; border-radius: 0; background: #2a2b2f; color: #fff; font-size: 14px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
}
.toast button { background: none; border: 0; color: #8fc1f0; font-weight: 700; padding: 0; }

/* ---- 開閉（タスクのタブ） ---- */
.fold { margin-bottom: 10px; }
.fold-head {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 14px 14px;
  border: 0; border-radius: var(--radius); background: var(--panel); text-align: left; font-size: 16px; font-weight: 600;
}
.fold.open > .fold-head { border-radius: var(--radius) var(--radius) 0 0; border-bottom: 1px solid var(--line); }
.fold-head .n { margin-left: auto; font-size: 13px; color: var(--sub); font-weight: 400; }
.fold-head .arrow { color: var(--faint); transition: transform 0.15s; }
.fold.open > .fold-head .arrow { transform: rotate(90deg); }
.fold-body { background: var(--panel); border-radius: 0 0 var(--radius) var(--radius); padding: 2px 0 10px; }
.sub-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px 4px; font-size: 12px; color: var(--sub); font-weight: 700; letter-spacing: 0.04em; }
.proj-head {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px; margin-top: 4px;
  font-size: 15px; font-weight: 600; border-top: 1px solid var(--line);
}
.proj-head .n { margin-left: auto; font-size: 12px; color: var(--sub); font-weight: 400; }
.proj-head .go { color: var(--faint); }
.fold-body .task { border-bottom: 0; }
.fold-body .task-main { padding: 8px 14px 8px 18px; }
.fold-body .task-title { font-size: 15px; }
.fold-foot { display: flex; gap: 8px; padding: 10px 14px 2px; border-top: 1px solid var(--line); margin-top: 6px; }

/* ---- 並び替え（つまみ） ---- */
.grip {
  flex-shrink: 0; align-self: center; width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: none; color: var(--faint); touch-action: none; cursor: grab; padding: 0;
}
.grip svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.lifted { z-index: 3; position: relative; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18); }
.lifted .task-main { background: var(--panel); }
.c-item.lifted { background: var(--panel); }

/* ---- 詳細ページ ---- */
.detail .field { margin: 14px 0; }
.detail .title-input { font-size: 19px; font-weight: 600; width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 0; background: var(--panel); outline: none; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 0; background: var(--panel); font-size: 14px; }
.soon { padding: 40px 10px; text-align: center; color: var(--faint); }

/* ---- カレンダー ---- */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 8px; }
.cal-head b { font-size: 17px; }
.cal-head .hbtn { width: 36px; height: 36px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; background: var(--panel); border-radius: var(--radius); padding: 6px; }
.cal .wd { text-align: center; font-size: 11px; color: var(--sub); padding: 4px 0; }
.cal .wd.sun, .cal .day.sun .num { color: #c0504d; }
.cal .wd.sat, .cal .day.sat .num { color: #3b6ea5; }
.cal .day {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px;
  min-height: 48px; padding: 5px 0 4px; border: 0; border-radius: 0; background: none; font-size: 15px;
}
.cal .day.other { opacity: 0.35; }
.cal .day.today .num { background: var(--accent); color: #fff !important; border-radius: 50%; width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; }
.cal .day.sel { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.cal .marks { display: flex; gap: 3px; height: 6px; }
.cal .marks i { width: 6px; height: 6px; border-radius: 50%; }
.m-ev { background: var(--accent); }
.m-due { background: var(--later); }
.m-note { background: var(--done); }
.legend { display: flex; gap: 14px; justify-content: flex-end; font-size: 11px; color: var(--sub); margin: 6px 2px 0; }
.legend i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 4px; vertical-align: 1px; }

/* ---- 予定の行 ---- */
.ev { display: flex; gap: 12px; align-items: flex-start; padding: 11px 14px; border-bottom: 1px solid var(--line); background: var(--panel); }
.ev:last-child { border-bottom: 0; }
.ev-time { flex-shrink: 0; width: 52px; font-size: 13px; color: var(--accent); font-weight: 600; line-height: 1.35; padding-top: 2px; }
.ev-time small { display: block; color: var(--sub); font-weight: 400; }
.ev-body { flex: 1; min-width: 0; }
.ev-meta { font-size: 12px; color: var(--sub); margin-top: 2px; display: flex; flex-wrap: wrap; gap: 4px 10px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; }

/* ---- ノート ---- */
.note-new { background: var(--panel); border-radius: var(--radius); padding: 10px; margin: 6px 0 14px; }
.note-new textarea { width: 100%; min-height: 70px; border: 0; outline: none; background: transparent; resize: vertical; line-height: 1.6; }
.note-new .row { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.note-new .row .muted { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.previews { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.previews img { width: 56px; height: 56px; object-fit: cover; border-radius: 0; }
.ncard { background: var(--panel); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px; }
.ncard-head { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--sub); }
.ncard-head .t { font-weight: 700; color: var(--accent); }
.ncard-body { white-space: pre-wrap; word-break: break-word; margin: 6px 0; line-height: 1.65; }
.coord { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 13px; color: var(--sub); margin: 6px 0; }
.coord code { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; color: var(--text); }
.smap { position: relative; display: block; width: 100%; max-width: 360px; height: 180px; overflow: hidden; border: 1px solid var(--line); border-radius: 0; background: var(--line); }
.smap .tiles { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
.smap .tiles img { position: absolute; width: 256px; height: 256px; max-width: none; user-select: none; }
.smap .pin { position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: var(--accent); border: 2.5px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.25), 0 2px 6px rgba(0,0,0,.35); }
.smap-credit { font-size: 10px; color: var(--faint); margin-top: 2px; }
.smap-credit a { color: inherit; }
.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin: 8px 0; }
.photos a { display: block; aspect-ratio: 1; overflow: hidden; border-radius: 0; background: var(--line); position: relative; }
.photos img { width: 100%; height: 100%; object-fit: cover; }
.photos .x { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0,0,0,.55); color: #fff; font-size: 12px; }
.files-list { margin: 6px 0; display: flex; flex-direction: column; gap: 4px; }
.files-list .f { display: flex; align-items: center; gap: 8px; font-size: 14px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 0; }
.files-list .f a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--accent); }
.files-list .f .x { border: 0; background: none; color: var(--faint); }
.ncard-foot { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.journal-box { min-height: 120px; }
.hit { padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--panel); display: block; }
.hit:last-child { border-bottom: 0; }
.hit .d { font-size: 12px; color: var(--sub); }
.hit .b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- Inbox の入力（座標と写真つき） ---- */
.inbox-add { display: block; margin: 6px 0 0; }
.inbox-add textarea {
  display: block; width: 100%; height: 46px; min-height: 46px; padding: 12px 14px;
  border: 1px solid var(--line); background: var(--panel); outline: none;
  font: inherit; font-size: 16px; line-height: 1.45; resize: none; overflow: hidden;
}
.inbox-add textarea:focus { border-color: var(--accent); }
.inbox-geo { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--sub); margin: 6px 0 14px; min-height: 16px; }
.inbox-geo #ib-geo { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-geo .btn { flex-shrink: 0; }

/* 新しい予定の添付（見出しは置かず、クリップのアイコンだけ・2026-09-25 本人） */
.ev-attach { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin: 16px 0 0; }
.ev-attach .muted { font-size: 13px; }

.sort-opts { display: grid; gap: 8px; }
.sort-opts .btn { justify-content: flex-start; height: 48px; font-size: 15px; }
.sort-opts .btn small { color: var(--sub); font-size: 12px; margin-left: auto; }

/* ---- 添付（ドラッグ＆ドロップ） ---- */
.view.dropping { outline: 2px dashed var(--accent); outline-offset: -6px; border-radius: 0; }
.drop-hint { display: none; margin: 6px 2px 0; font-size: 12px; }
@media (min-width: 900px) { .drop-hint { display: block; } }

/* ---- 写真の最大化（サムネイルをタップ → 画像をタップで終了） ---- */
.lightbox {
  position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, 0.93);
  display: flex; align-items: center; justify-content: center;
  padding: calc(env(safe-area-inset-top) + 8px) 8px calc(env(safe-area-inset-bottom) + 8px);
}
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 0; }
.photos a { cursor: zoom-in; }

/* ---- コンタクト ---- */
.mark { flex-shrink: 0; width: 30px; height: 30px; border-radius: 0; display: inline-flex; align-items: center; justify-content: center; }
.mark svg { width: 19px; height: 19px; display: block; }
.marks-row { display: flex; gap: 4px; flex-shrink: 0; }
.marks-row .mark { width: 22px; height: 22px; border-radius: 0; }
.marks-row .mark svg { width: 14px; height: 14px; }
.c-head { display: flex; align-items: flex-start; gap: 12px; }
.c-name { font-size: 21px; font-weight: 700; }
.c-head .btn { flex-shrink: 0; margin-left: auto; }
.call-name { font-size: 16px; color: var(--accent); font-weight: 600; }
.c-item { display: grid; grid-template-columns: 30px 104px 1fr 90px 32px; gap: 6px; align-items: center; margin-bottom: 6px; }
.c-item select, .c-item input { padding: 9px 10px; border: 1px solid var(--line); border-radius: 0; background: var(--panel); outline: none; min-width: 0; font-size: 14px; }
@media (max-width: 520px) {
  .c-item { grid-template-columns: 26px 92px 1fr 30px; }
  .c-item [data-label] { grid-column: 2 / 5; }
}
.kana-row { gap: 0; }
.kana-row .chip { padding: 6px 10px; margin: 0 4px 6px 0; }
.kana-row .chip.off { opacity: 0.35; }
.nav-row .name { line-height: 1.35; }

/* ---- じぶん ---- */
.me-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--panel); }
.me-row:last-child { border-bottom: 0; }
.me-pick { display: flex; align-items: center; }
.me-pick input { width: 20px; height: 20px; }
.me-body { flex: 1; min-width: 0; word-break: break-all; }
.me-body .muted { font-size: 12px; }
.me-row .btn { flex-shrink: 0; }
.nav-row[data-img] .name { color: var(--accent); }

/* ---- アイコンだけのボタン ---- */
.btn.icon { width: 44px; padding: 0; flex-shrink: 0; }
.btn.icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
