/* 藍と金の鑑定札（本人 2026-11-07 決定）。見本は docs/app/design/ */
:root {
  --ai: #1F2F4A;        /* 藍 */
  --ai2: #2E4266;
  --kin: #C9A55C;       /* 金 */
  --kin-light: #E6D3A3;
  --kokin: #7A5C1E;     /* 古金 */
  --kokin-dark: #5E4614;
  --kinari: #F6F2E9;    /* 生成り */
  --sumi: #1B1F27;      /* 墨 */
  --shu: #9E2F22;       /* 朱（止めるときだけ） */
  --shu-light: #F8E3DF;
  --nezumi: #4A505C;
  --line: #D8D0BE;
  --line2: #E3D9C2;
  --ai-light: #E3E8F1;
  --kin-pale: #F3E8CF;
  --mincho: 'Shippori Mincho', 'Yu Mincho', 'Hiragino Mincho ProN', serif;
  --gothic: 'Zen Kaku Gothic New', 'Yu Gothic', 'Hiragino Sans', sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--kinari); color: var(--sumi);
  font-family: var(--gothic); font-size: 17px; line-height: 1.6;
}
a { color: var(--ai); }
a:hover { color: var(--kokin); }
h1, h2 { font-family: var(--mincho); font-weight: 800; color: var(--ai); margin: 0; }
.mincho { font-family: var(--mincho); font-weight: 800; }
.muted { color: var(--nezumi); }
.small { font-size: 15px; }
.hidden { display: none !important; }
:focus-visible { outline: 3px solid var(--kin); outline-offset: 2px; }

/* 「鑑」の印 */
.seal {
  width: 34px; height: 34px; border-radius: 4px; box-shadow: inset 0 0 0 2px var(--kin);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--mincho); font-weight: 800; font-size: 20px; color: var(--kinari); flex-shrink: 0;
}
.seal.big { width: 64px; height: 64px; font-size: 38px; box-shadow: inset 0 0 0 3px var(--kin); }

/* 押すところは 52px 以上 */
.btn {
  min-height: 52px; padding: 0 20px; border: 0; border-radius: 10px;
  background: var(--ai); color: #fff; font: 700 17px var(--gothic);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--ai2); color: #fff; }
.btn.outline { background: #fff; color: var(--ai); box-shadow: inset 0 0 0 2px var(--ai); }
.btn.outline:hover { background: var(--ai-light); }
.btn.wide { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { background: #DAD6CC; color: #5C5A54; cursor: not-allowed; box-shadow: none; }

/* 入れる欄 */
label.field { display: flex; flex-direction: column; gap: 6px; font-weight: 700; font-size: 17px; }
label.field .hint { font-weight: 400; font-size: 15px; color: var(--nezumi); }
input, select, textarea {
  font: 400 17px var(--gothic); color: var(--sumi); background: #fff;
  min-height: 52px; padding: 10px 14px; border: 0; border-radius: 8px;
  box-shadow: inset 0 0 0 2px var(--line);
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; box-shadow: inset 0 0 0 2px var(--ai); }

.card { background: #fff; border-radius: 10px; box-shadow: 0 1px 0 var(--line); padding: 16px 18px; }
.msg { border-radius: 10px; padding: 12px 16px; }
.msg.err { background: var(--shu-light); color: #6E2117; }
.msg.ok { background: var(--kin-pale); color: var(--kokin-dark); }
.tag {
  font-size: 15px; padding: 3px 10px; border-radius: 4px; font-weight: 700; white-space: nowrap;
}
.tag.ai { background: var(--ai); color: #fff; }
.tag.shu { background: var(--shu-light); color: var(--shu); }
.tag.kin { background: var(--kin-pale); color: var(--kokin-dark); }

/* ---------------- スマホの画面（クローザー・テレアポ会社・ログイン） */
.phone { max-width: 480px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }
.topbar { background: var(--ai); color: var(--kinari); padding: 20px 20px 18px; display: flex; flex-direction: column; gap: 10px; }
.topbar .row { display: flex; align-items: center; gap: 10px; }
.topbar .brand { font-size: 15px; letter-spacing: 0.2em; color: var(--kin-light); white-space: nowrap; flex: 0 0 auto; }
/* 上の帯の1段目は 印・「出張買取」・右上のメニュー だけ（スマホの幅で折れないように）。名前は下の行に出す */
.topbar .sub { display: flex; flex-wrap: wrap; align-items: center; column-gap: 14px; row-gap: 2px; }
.topbar .who { font-size: 15px; color: var(--kin-light); white-space: nowrap; }
.topbar .row > .tmenu.in-bar { margin-left: auto; }
.topbar h1 { color: var(--kinari); font-size: 30px; }
.topbar .sub { font-size: 15px; color: #D9DEE8; }
.linkbtn {
  background: none; border: 0; color: var(--kin-light); font: 400 15px var(--gothic);
  min-height: 52px; min-width: 52px; padding: 0 6px; cursor: pointer; text-decoration: underline;
}
.content { flex-grow: 1; padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }

.souba {
  margin: 14px 16px 0; background: #fff; border-radius: 10px; padding: 12px 16px;
  display: flex; align-items: center; gap: 12px; box-shadow: inset 0 0 0 1px var(--line2);
}
.souba .ttl { font-size: 15px; color: var(--kokin); font-weight: 700; }
.souba.empty { box-shadow: inset 0 0 0 2px var(--kin); }

.appt {
  display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: inherit;
  background: #fff; border-radius: 10px; box-shadow: 0 1px 0 var(--line); padding: 16px 18px; min-height: 52px;
}
.appt:hover { color: inherit; box-shadow: 0 1px 0 var(--line), inset 0 0 0 2px var(--line2); }
.appt.next { box-shadow: inset 4px 0 0 var(--kin), 0 1px 0 var(--line); }
.appt .head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.appt .time { font-family: var(--mincho); font-weight: 800; font-size: 26px; color: var(--ai); }
.appt .no { font-size: 15px; color: var(--nezumi); }
.appt .head .tag { margin-left: auto; }
.appt .what { font-size: 17px; font-weight: 700; }
.appt .state { font-size: 15px; color: var(--nezumi); }

.bottomnav {
  position: sticky; bottom: 0; background: #fff; box-shadow: 0 -1px 0 var(--line);
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
}
.bottomnav a, .bottomnav span {
  min-height: 64px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; text-decoration: none; color: var(--nezumi); font-size: 15px;
}
.bottomnav .on { color: var(--ai); font-weight: 700; }
.bottomnav .off { color: #9A968C; }
.bottomnav .off small { font-size: 12px; }

/* 案件の画面 */
.casebar { background: var(--ai); color: var(--kinari); padding: 12px 16px; display: flex; align-items: center; gap: 10px; }
.casebar .back {
  width: 52px; height: 52px; display: flex; align-items: center; justify-content: center; color: var(--kinari);
  border-radius: 8px;
}
.casebar .back:hover { background: var(--ai2); color: var(--kinari); }
.casebar .meta { display: flex; flex-direction: column; gap: 2px; flex-grow: 1; }
.casebar .meta .s { font-size: 15px; color: var(--kin-light); }
.casebar .meta .no { font-family: var(--mincho); font-weight: 800; font-size: 24px; }
.sec-title { font-size: 15px; color: var(--kokin); font-weight: 700; letter-spacing: 0.1em; }
.kv { display: grid; grid-template-columns: 6.5em minmax(0, 1fr); gap: 6px 12px; }
.kv dt { color: var(--nezumi); }
.kv dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.item-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.item-head .name { font-size: 17px; font-weight: 700; }
.m-A, .m-C { background: var(--kin-pale); color: var(--kokin-dark); }
.m-B, .m-D { background: #EEE6F3; color: #5B3A73; }
.m-E { background: var(--shu-light); color: var(--shu); }
.bar { flex-grow: 1; height: 10px; border-radius: 5px; background: #ECE5D3; overflow: hidden; }
.bar > div { height: 10px; background: var(--kin); }
.slots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.slot {
  background: #FBF7EE; border-radius: 10px; padding: 12px; display: flex; align-items: center; gap: 10px;
  box-shadow: inset 0 0 0 1px var(--line); font-size: 15px; font-weight: 700; color: var(--nezumi); min-height: 52px;
}
.slot .ring { width: 24px; height: 24px; border-radius: 12px; border: 2px solid #8A8577; flex-shrink: 0; }
.note { font-size: 15px; line-height: 1.6; }

/* ---------------- 本部（パソコン） */
.honbu { display: flex; min-height: 100vh; flex-wrap: wrap; }
.side {
  flex: 1 1 220px; max-width: 260px; background: var(--ai); color: var(--kinari);
  padding: 24px 16px; display: flex; flex-direction: column; gap: 6px;
}
.side .logo { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.side .logo .seal { width: 40px; height: 40px; font-size: 24px; }
.side .logo .k { font-size: 13px; color: var(--kin-light); letter-spacing: 0.2em; display: block; }
.side .logo .n { font-family: var(--mincho); font-weight: 800; font-size: 20px; display: block; }
.side a, .side span.off {
  padding: 12px 14px; border-radius: 6px; color: var(--kinari); text-decoration: none; min-height: 52px;
  display: flex; align-items: center; justify-content: space-between;
}
.side a.on { background: var(--ai2); font-weight: 700; color: #fff; }
.side span.off { color: #9DA8BC; }
.side span.off small { font-size: 12px; }
.side .who { margin-top: auto; font-size: 15px; color: var(--kin-light); padding: 12px 14px 0; }
.main { flex: 999 1 560px; min-width: 0; padding: 28px 32px; display: flex; flex-direction: column; gap: 20px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.toolbar h1 { font-size: 30px; }
.toolbar .grow { flex-grow: 1; }
.souba-wide { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; box-shadow: inset 0 0 0 2px var(--kin); }
.souba-wide b { color: var(--kokin); }

.week { overflow-x: auto; padding: 16px; }
.week-grid { display: grid; grid-template-columns: repeat(7, minmax(120px, 1fr)); gap: 8px; min-width: 860px; }
.day-h { font-size: 15px; font-weight: 700; color: var(--nezumi); padding: 6px; }
.day-h.today { color: var(--ai); box-shadow: inset 0 -3px 0 var(--kin); }
.day-col { display: flex; flex-direction: column; gap: 6px; min-height: 120px; }
.ev {
  display: block; background: var(--ai-light); border-radius: 6px; padding: 8px; font-size: 15px; line-height: 1.5;
  color: var(--sumi); text-decoration: none; min-height: 52px;
}
.ev:hover { color: var(--sumi); box-shadow: inset 0 0 0 2px var(--ai); }
.ev.changed { background: var(--kin-pale); }
.ev.free { background: #fff; border: 1px dashed #8A8577; color: var(--nezumi); }
.ev b { color: var(--ai); }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }

.log { width: 100%; border-collapse: collapse; font-size: 15px; }
.log th, .log td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line2); }

@media (max-width: 700px) {
  .side { max-width: none; flex-basis: 100%; padding: 14px 16px; flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .side .logo { margin: 0 12px 0 0; width: 100%; }
  .side .who { margin: 0; width: 100%; padding: 4px 0 0; }
  .side span.off { display: none; }
  .main { padding: 18px 14px; }
  .toolbar h1 { font-size: 24px; }
}
.grow { flex-grow: 1; }
.phone.wide { max-width: 760px; }
.w0 { width: 0; }
.col-gap { display: flex; flex-direction: column; gap: 10px; }
.scroll-x { overflow-x: auto; }
.kv { margin: 0; }
.side small { white-space: nowrap; margin-left: 8px; }
.weeknav { display: flex; gap: 8px; }
.day-col .none { font-size: 15px; padding: 6px; }
@media (min-width: 701px) { .day-col .none { visibility: hidden; } }
@media (max-width: 700px) {
  .toolbar { gap: 10px; }
  .toolbar h1 { width: 100%; }
  .weeknav { width: 100%; }
  .weeknav .btn { flex: 1 1 0; padding: 0 8px; }
  #add { width: 100%; }
  .week { padding: 8px 12px; overflow-x: visible; }
  .week-grid { grid-template-columns: minmax(0, 1fr); min-width: 0; gap: 4px; }
  .day-col { min-height: 0; padding-bottom: 8px; border-bottom: 1px solid var(--line2); }
  .day-col:last-child { border-bottom: 0; }
}
@media (max-width: 700px) { .weeknav .btn { min-width: 0; } .main { overflow-x: hidden; } }
a.linkbtn { display: inline-flex; align-items: center; }
.btn.outline.wide { margin-top: 0; }
.ulist { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.ucard { display: flex; flex-direction: column; gap: 10px; }
.ucard.stopped { background: #EFEBE2; }
.ucard .uh { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.ucard .uh .dn { font-size: 19px; font-weight: 700; }
.ucard .uh .ln { font-size: 15px; color: var(--nezumi); font-family: ui-monospace, Consolas, monospace; }
.ucard .tags { display: flex; gap: 6px; flex-wrap: wrap; }
.ucard .edit { border-top: 1px solid var(--line2); padding-top: 12px; display: flex; flex-direction: column; gap: 12px; }
.ucard .edit h3 { margin: 4px 0 0; font-size: 15px; color: var(--kokin); }
.sec-h { font-size: 20px; }
@media (max-width: 700px) { .ulist { grid-template-columns: minmax(0, 1fr); } }
.main > * { min-width: 0; max-width: 100%; }
.scroll-x .log th, .scroll-x .log td { white-space: nowrap; }
.ulist { min-width: 0; max-width: 100%; }
.ucard { min-width: 0; }
@media (max-width: 700px) { .main { width: 100%; flex-basis: 100%; } #add { max-width: 100%; } }
/* 商談中（朱は止めるときだけの色なので使わない。藍の地に金の縁） */
.tag.talking { background: var(--ai); color: #fff; box-shadow: inset 0 0 0 2px var(--kin); }
.ev.talking { background: var(--ai); color: #fff; box-shadow: inset 0 0 0 2px var(--kin); }
.ev.talking b, .ev.talking .muted { color: var(--kin-light); }
.ev.done { background: #ECE5D3; }
.room { display: flex; flex-direction: column; gap: 12px; }
.room.talking { box-shadow: inset 0 0 0 3px var(--kin), 0 1px 0 var(--line); }
.room-state { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 17px; font-weight: 700; }
/* 上の帯: きょうの相場 */
.sband { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; background: #fff; border-radius: 10px;
  padding: 10px 16px; box-shadow: inset 0 0 0 1px var(--line2); font-size: 15px; }
.sband.empty { box-shadow: inset 0 0 0 2px var(--kin); }
.sband .sb-ttl { color: var(--kokin); font-weight: 700; width: 100%; }
.sband .sb-item b { color: var(--ai); }
.sband .sb-item small { color: var(--nezumi); font-size: 13px; }
.sband .sb-none { color: var(--nezumi); }
.sband .sb-warn { color: var(--kokin-dark); font-weight: 700; }
.phone > .sband { margin: 12px 16px 0; }
/* 月の表示 */
.month { padding: 12px; }
.month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.m-wd { font-size: 13px; color: var(--nezumi); text-align: center; font-weight: 700; }
.m-cell { min-height: 110px; background: #FBF9F3; border-radius: 6px; padding: 4px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.m-day { display: flex; align-items: baseline; gap: 4px; flex-wrap: wrap; min-height: 44px; border: 0; background: none; text-align: left;
  font: 700 15px var(--gothic); color: var(--sumi); cursor: pointer; padding: 4px; border-radius: 6px; }
.m-day:hover, .m-day.sel { background: var(--ai-light); }
.m-day.today .m-num { color: #fff; background: var(--ai); border-radius: 12px; padding: 0 7px; }
.m-wd-s { display: none; font-size: 13px; color: var(--nezumi); font-weight: 400; }
.m-count { font-size: 13px; color: var(--kokin-dark); background: var(--kin-pale); border-radius: 4px; padding: 0 6px; margin-left: auto; }
.m-count.talking { background: var(--ai); color: #fff; box-shadow: inset 0 0 0 2px var(--kin); }
.m-evs { display: flex; flex-direction: column; gap: 4px; }
.m-evs .ev { font-size: 13px; padding: 4px 6px; min-height: 0; line-height: 1.4; }
.day-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.weeknav .btn[aria-pressed="true"] { background: var(--ai); color: #fff; }
@media (max-width: 700px) {
  .month-grid { grid-template-columns: minmax(0, 1fr); }
  .m-wd, .m-pad { display: none; }
  .m-wd-s { display: inline; }
  .m-cell { min-height: 0; }
  .m-cell.empty .m-evs { display: none; }
  .m-evs .ev { font-size: 15px; padding: 8px; min-height: 52px; }
}
/* 写真の保管欄 */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.pcell { margin: 0; background: #FBF7EE; border-radius: 8px; padding: 8px; display: flex; flex-direction: column; gap: 6px; font-size: 15px; min-width: 0; }
.pcell img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; background: #E6DFCF; display: block; }
.pcell small { color: var(--nezumi); font-size: 13px; }
.slot.done { background: #fff; box-shadow: inset 0 0 0 2px var(--ai); color: var(--sumi); }
.slot.done .ring { background: var(--ai); border-color: var(--ai); }
.w1 { width: 25%; } .w2 { width: 50%; } .w3 { width: 75%; } .w4 { width: 100%; }
.bar > div[class^="w"] { height: 10px; background: var(--kin); }
.item-row { display: grid; grid-template-columns: 4.5em minmax(0, 2fr) minmax(0, 1.5fr) auto auto; gap: 8px; align-items: center; }
@media (max-width: 700px) { .item-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .item-row b { grid-column: 1 / -1; } }
input[type=file] { min-height: 52px; padding: 12px; }
/* 写真を選ぶ欄（撮影する／ファイルから選ぶ） */
.photo-pick { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.pick-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.pick-btns .btn { flex: 1 1 140px; min-height: 52px; }
.pick-chosen { display: flex; align-items: center; gap: 10px; min-width: 0; overflow-wrap: anywhere; }
.pick-thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; flex: 0 0 auto; }
/* 写真判定の試しの帯（ずっと出す） */
.trial-band { position: sticky; top: 0; z-index: 10; background: var(--kokin); color: #fff; font-weight: 700; text-align: center;
  padding: 10px 12px; font-size: 15px; letter-spacing: 0.05em; }
.backlink { min-height: 52px; display: inline-flex; align-items: center; font-weight: 700; }
.result { display: flex; flex-direction: column; gap: 10px; }
.result .big { font-family: var(--mincho); font-weight: 800; font-size: 34px; color: var(--ai); }
.result.stop { background: var(--shu-light); box-shadow: inset 0 0 0 3px var(--shu); }
.result.stop .big { color: var(--shu); }
.reqs { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.req { display: flex; flex-direction: column; gap: 8px; background: #FBF7EE; border-radius: 8px; padding: 10px; box-shadow: inset 0 0 0 1px var(--line); }
.req.done { box-shadow: inset 0 0 0 2px var(--ai); background: #fff; }
.req > img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; }
input[type=checkbox] { min-height: 0; width: 24px; height: 24px; padding: 0; box-shadow: none; vertical-align: middle; margin-right: 6px; }

/* ---------------- 予定の通知（クローザー） */
.phone > .pushbox { margin: 12px 16px 0; }
.pushbox .pp-head { display: flex; align-items: center; gap: 8px; color: var(--ai); margin-bottom: 6px; }
.pushbox p { margin: 6px 0 10px; line-height: 1.7; }
.pushbox .pp-steps { margin: 4px 0 12px; padding-left: 1.4em; line-height: 1.8; }
.pushbox.guide { box-shadow: inset 0 0 0 2px var(--kin); }
.pushbox.off p { color: var(--nezumi); }
.pushbox.on p { margin-bottom: 6px; }
.pushbox .actions { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.pushbox .msg { margin-top: 10px; }
.pushbox .btn[disabled] { opacity: .55; }
/* ---------------- 夜の控え（管理者） */
.bkband { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; border-radius: 10px; padding: 10px 16px; margin: 10px 0 0; background: #fff; }
.bkband b { color: var(--ai); }
.bkband small { color: var(--nezumi); }
.bkband.bad { background: var(--shu-light); box-shadow: inset 0 0 0 2px var(--shu); }
.bkband.bad b, .bkband .bk-warn { color: var(--shu); font-weight: 700; }
/* ---------------- 右上のメニュー（全員） */
.tmenu { position: relative; z-index: 60; }
.tmenu.in-bar { margin-left: 8px; flex: 0 0 auto; }
.has-tmenu { position: relative; }
.has-tmenu > .tmenu { position: absolute; top: 18px; right: 24px; }
@media (min-width: 701px) { .has-tmenu .main > .toolbar { padding-right: 150px; } }
@media (max-width: 700px) {
  .has-tmenu > .tmenu { top: 10px; right: 12px; }
  .has-tmenu .side .logo { padding-right: 130px; min-height: 52px; }
  .has-tmenu > .main:first-child, .has-tmenu > .tmenu + .main { padding-top: 76px; }
}
.tmenu-btn {
  min-height: 48px; min-width: 48px; padding: 0 14px; border: 0; border-radius: 10px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px; font: 700 16px var(--gothic);
  background: #fff; color: var(--ai); box-shadow: inset 0 0 0 2px var(--ai);
}
.tmenu-btn:hover { background: var(--ai-light); }
.tmenu-btn[aria-expanded="true"] { background: var(--ai); color: #fff; box-shadow: inset 0 0 0 2px var(--kin); }
.in-bar .tmenu-btn { background: transparent; color: var(--kinari); box-shadow: inset 0 0 0 2px var(--kin-light); }
.in-bar .tmenu-btn:hover { background: var(--ai2); }
.tmenu-panel {
  position: absolute; right: 0; top: calc(100% + 6px); width: min(300px, calc(100vw - 24px));
  max-height: calc(100vh - 90px); overflow-y: auto;
  background: #fff; color: var(--sumi); border-radius: 10px; padding: 8px;
  box-shadow: 0 10px 30px rgba(27, 31, 39, .22), inset 0 0 0 1px var(--line);
}
.tmenu-panel[hidden] { display: none; }
.tm-who { display: flex; flex-direction: column; padding: 8px 12px 10px; border-bottom: 1px solid var(--line2); margin-bottom: 4px; }
.tm-who b { color: var(--ai); }
.tm-who small { color: var(--nezumi); font-size: 13px; }
.tmenu-panel ul { list-style: none; margin: 0; padding: 0; }
.tmenu-panel a, .tmenu-panel .tm-out, .tmenu-panel .tm-off {
  display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 0 12px;
  border-radius: 6px; color: var(--sumi); text-decoration: none; font: 400 16px var(--gothic); width: 100%;
}
.tmenu-panel a:hover, .tmenu-panel .tm-out:hover { background: var(--ai-light); color: var(--ai); }
.tmenu-panel a[aria-current="page"] { font-weight: 700; color: var(--ai); box-shadow: inset 4px 0 0 var(--kin); }
.tmenu-panel .tm-off { color: #8A8577; }
.tmenu-panel .tm-off small { font-size: 12px; }
.tmenu-panel .tm-sep { border-top: 1px solid var(--line2); margin-top: 4px; padding-top: 4px; }
.tmenu-panel .tm-out { border: 0; background: none; cursor: pointer; text-align: left; }
/* ---------------- 顧客情報・帳簿（管理者） */
.purpose { background: var(--kin-pale); color: var(--kokin-dark); border-radius: 10px; padding: 12px 16px; font-size: 15px; }
.purpose b { display: block; margin-bottom: 2px; }
.searchbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.searchbar label.field { flex: 1 1 200px; min-width: 0; }
.searchbar .btn { flex: 0 0 auto; }
.pager { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.tabs button { min-height: 48px; padding: 0 14px; border: 0; border-radius: 8px; cursor: pointer; font: 700 15px var(--gothic);
  background: #fff; color: var(--ai); box-shadow: inset 0 0 0 2px var(--line); }
.tabs button[aria-selected="true"] { background: var(--ai); color: #fff; box-shadow: none; }
.crow { display: flex; flex-direction: column; gap: 8px; }
.crow .rh { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 12px; }
.crow .rh b { font-size: 17px; color: var(--ai); }
.crow.voided { background: #EFEBE2; }
.crow.voided .rv { text-decoration: line-through; color: var(--nezumi); }
.crow.draft { box-shadow: inset 4px 0 0 var(--kin), 0 1px 0 var(--line); }
.rv { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 2px 14px; font-size: 15px; margin: 0; }
.rv div { display: flex; gap: 6px; min-width: 0; }
.rv dt { color: var(--nezumi); flex: 0 0 auto; }
.rv dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; min-width: 0; }
.edit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.edit-grid label.field { font-size: 15px; min-width: 0; }
.edit-grid label.field.calc input { background: #F1EEE6; }
.draft-note { color: var(--kokin-dark); font-weight: 700; }
.warnbox { background: var(--shu-light); color: #6E2117; border-radius: 10px; padding: 12px 16px; box-shadow: inset 0 0 0 2px var(--shu); }
.infobox { background: #fff; border-radius: 10px; padding: 12px 16px; box-shadow: inset 0 0 0 1px var(--line2); display: flex; flex-direction: column; gap: 6px; }
.exportbox { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.exportbox label.field { flex: 0 1 180px; min-width: 0; }

/* 表の受付番号を押すと開く（顧客情報）。白い地の上なので藍の字 */
.log .linkbtn.rno { color: var(--ai); font-weight: 700; font-family: ui-monospace, Consolas, monospace; min-height: 44px; padding: 0; }
/* スマホの幅では、表を1件ずつ縦に積む（横に動かさずに読める・開ける）。見出しは各欄の頭に小さく出す */
@media (max-width: 700px) {
  .scroll-x:has(> .log.stack-sm) { overflow-x: visible; }
  .log.stack-sm thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .log.stack-sm, .log.stack-sm tbody { display: block; width: 100%; }
  .log.stack-sm tr { display: grid; grid-template-columns: 6.5em minmax(0, 1fr); column-gap: 10px; row-gap: 2px; align-items: baseline;
    padding: 8px 0; border-bottom: 1px solid var(--line2); overflow-wrap: anywhere; }
  .log.stack-sm td, .scroll-x .log.stack-sm td { display: contents; white-space: normal; }
  .log.stack-sm td[data-label]::before { content: attr(data-label); color: var(--nezumi); font-size: 13px; padding: 4px 0; }
  .log.stack-sm td.st-act { display: block; grid-column: 1 / -1; padding: 6px 0 0; border-bottom: 0; }
  .log.stack-sm .linkbtn.rno { justify-self: start; text-align: left; justify-content: flex-start; }
  .log.stack-sm td.st-act .btn { width: 100%; }
}
