/* 日程変更受付ダッシュボード — オペレーター確認画面のスタイル */

:root {
  --ink: #1d2140;
  --ink-2: #4a5073;
  --muted: #8e93ad;
  --faint: #b4b8cc;
  --line: #e9e6f7;
  --line-2: #f1eefb;
  --brand: #7b6cf6;
  --brand-d: #5f50e0;
  --brand-soft: #efecff;
  --sky: #62c6ee;
  --sky-soft: #e7f6fd;
  --grad: linear-gradient(90deg, #7b6cf6 0%, #6f8df5 55%, #62c6ee 100%);
  --shadow-sm: 0 1px 2px rgba(60, 50, 140, 0.04), 0 8px 22px -10px rgba(80, 66, 190, 0.12);
  --shadow-md: 0 14px 34px -14px rgba(80, 66, 190, 0.28), 0 2px 6px rgba(60, 50, 140, 0.05);
  --ff-num: 'Plus Jakarta Sans', 'LINE Seed JP', system-ui, sans-serif;
  --ff: 'Plus Jakarta Sans', 'LINE Seed JP', 'Hiragino Sans', 'Yu Gothic UI', 'Noto Sans JP', system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--ff);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: linear-gradient(162deg, #ece8ff 0%, #f5f3ff 36%, #fbfaff 68%, #ffffff 100%) fixed;
  -webkit-font-smoothing: antialiased;
}
body.no-scroll { overflow: hidden; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, p { margin: 0; }
ol, ul, dl, dd { margin: 0; padding: 0; list-style: none; }
.ic { flex: none; }
.num { font-family: var(--ff-num); font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------- 背景の曲線 ---------- */
.bg { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.bg svg { width: 100%; height: 100%; display: block; }

/* ---------- シェル ---------- */
.shell {
  width: calc(100% - 48px);
  max-width: 1760px;
  margin: 22px auto;
  padding: 22px 32px 32px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(123, 108, 246, 0.16);
  border-radius: 30px;
  box-shadow: 0 30px 80px -40px rgba(80, 66, 190, 0.35), 0 1px 0 rgba(255, 255, 255, 0.8) inset;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

/* ---------- ヘッダー ---------- */
.topbar {
  position: relative; z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas: 'brand pills actions';
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}
.brand { grid-area: brand; display: flex; align-items: center; gap: 12px; }
.logo {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(140deg, #8a7cf8 0%, #6b5bf0 100%);
  box-shadow: 0 8px 18px -8px rgba(107, 91, 240, 0.7), 0 0 0 4px rgba(123, 108, 246, 0.10);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 17px; font-weight: 700; letter-spacing: 0.01em; }
.brand-text strong em { font-style: normal; color: var(--brand); font-weight: 700; }
.brand-text span { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

.pills { grid-area: pills; display: flex; justify-content: center; flex-wrap: nowrap; gap: 5px; min-width: 0; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  height: 38px; padding: 0 5px 0 13px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink-2); font-weight: 700; font-size: 13px;
  transition: background-color 0.18s, border-color 0.18s, color 0.18s, box-shadow 0.18s, transform 0.18s;
}
.pill:hover { background: #fff; border-color: #d7d1f6; color: var(--ink); }
.pill-count {
  min-width: 25px; height: 25px; padding: 0 7px;
  display: inline-grid; place-items: center;
  border-radius: 999px; background: var(--line-2); color: var(--muted);
  font-family: var(--ff-num); font-size: 12px; font-weight: 700;
}
.pill.is-active {
  color: var(--brand-d);
  border-color: transparent;
  background: linear-gradient(#fff, #fff) padding-box, var(--grad) border-box;
  box-shadow: 0 8px 20px -10px rgba(107, 91, 240, 0.55);
}
.pill.is-active .pill-count { background: var(--brand-soft); color: var(--brand-d); }

.top-actions { grid-area: actions; display: flex; align-items: center; gap: 10px; justify-self: end; }

/* 操作アカウントの切り替え */
.acct { position: relative; }
.operator {
  display: flex; align-items: center; gap: 10px; padding: 7px 14px 7px 18px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.7); border: 1.5px solid var(--line); text-align: left;
  transition: border-color 0.18s, background-color 0.18s, box-shadow 0.18s;
}
.operator:hover { background: #fff; border-color: #d7d1f6; }
.operator[aria-expanded='true'] { background: #fff; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(123, 108, 246, 0.12); }
.op-text { display: flex; flex-direction: column; line-height: 1.2; }
.op-text b { font-size: 13px; font-weight: 700; white-space: nowrap; }
.op-text small { font-size: 11px; color: #12865a; }
.op-text small::before { content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: #2fc48a; vertical-align: 1px; }
.op-caret { display: grid; place-items: center; color: var(--muted); transition: transform 0.2s; }
.operator[aria-expanded='true'] .op-caret { transform: rotate(180deg); color: var(--brand); }
.acct-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; width: 264px; padding: 10px;
  background: #fff; border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-md);
  animation: pop 0.2s cubic-bezier(0.22, 0.8, 0.24, 1);
}
.acct-menu-title { padding: 4px 10px 8px; font-size: 11.5px; font-weight: 700; color: var(--muted); letter-spacing: 0.04em; }
.acct-menu ul { display: flex; flex-direction: column; gap: 2px; }
.acct-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 14px;
  background: transparent; text-align: left; transition: background-color 0.15s;
}
.acct-item:hover, .acct-item:focus-visible { background: var(--brand-soft); }
.acct-item.is-on { background: #f5f3ff; }
.acct-item-text { display: flex; flex-direction: column; line-height: 1.25; }
.acct-item-text b { font-size: 13.5px; font-weight: 700; }
.acct-item-text small { font-size: 11.5px; color: var(--muted); }
.acct-check { margin-left: auto; width: 16px; display: grid; place-items: center; color: var(--brand); }

/* ---------- ボタン ---------- */
.btn-ghost, .btn-pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px;
  border: 1.5px solid var(--line); border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink-2); font-weight: 700; font-size: 13.5px; white-space: nowrap;
  transition: border-color 0.18s, background-color 0.18s, color 0.18s, box-shadow 0.18s;
}
.btn-ghost:hover, .btn-pill:hover { border-color: #cfc8f5; background: #fff; color: var(--brand-d); box-shadow: 0 8px 18px -12px rgba(107, 91, 240, 0.6); }
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 30px; border: 0; border-radius: 999px;
  background: var(--grad); color: #fff; font-weight: 700; font-size: 14px; letter-spacing: 0.04em;
  box-shadow: 0 12px 24px -12px rgba(107, 91, 240, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: transform 0.18s, box-shadow 0.18s, filter 0.18s;
}
.btn-primary:hover { transform: translateY(-1px); filter: saturate(1.08); box-shadow: 0 16px 28px -12px rgba(107, 91, 240, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.35); }
.btn-primary:active { transform: translateY(0); }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border: 1.5px solid var(--line); border-radius: 50%; background: #fff; color: var(--ink-2); transition: background-color 0.18s, border-color 0.18s, color 0.18s; }
.icon-btn:hover { background: var(--brand-soft); border-color: #cfc8f5; color: var(--brand-d); }

/* ---------- 保存領域の警告 ---------- */
.storage-banner {
  display: flex; align-items: flex-start; gap: 10px; margin-bottom: 18px; padding: 12px 16px;
  border: 1px solid #f3d8a5; border-radius: 16px; background: #fff6e4; color: #7c5208; font-size: 13px;
}
.storage-banner .ic { margin-top: 2px; }

/* ---------- レイアウト ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.panel {
  background: #fff; border: 1px solid var(--line); border-radius: 26px; box-shadow: var(--shadow-sm);
}
.table-panel { padding: 24px 20px 14px; min-width: 0; }
.panel-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 0 12px 18px; }
.panel-title h1 { font-size: 22px; font-weight: 700; letter-spacing: 0.01em; }
.panel-sub { margin-top: 3px; font-size: 12.5px; color: var(--muted); }
.panel-sub b { color: var(--ink); font-family: var(--ff-num); font-weight: 800; }
.tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.search {
  display: flex; align-items: center; gap: 10px; width: 340px; max-width: 100%; height: 42px; padding: 0 16px;
  border: 1.5px solid var(--line); border-radius: 999px; background: #fbfaff; color: var(--muted);
  transition: border-color 0.18s, box-shadow 0.18s, background-color 0.18s;
}
.search:focus-within { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 4px rgba(123, 108, 246, 0.12); color: var(--brand); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 13.5px; color: var(--ink); }
.search input::placeholder { color: var(--faint); }

/* ---------- 表 ---------- */
.table-scroll { overflow-x: auto; margin: 0 -8px; padding: 0 8px 8px; }
.table {
  --cols: minmax(80px, 0.85fr) minmax(158px, 1.3fr) minmax(116px, 1.1fr) minmax(116px, 1.1fr) minmax(82px, 0.85fr) minmax(82px, 0.85fr) minmax(104px, 1fr) 40px minmax(104px, 1fr);
  min-width: 900px;
}
.thead, .row { display: grid; grid-template-columns: var(--cols); column-gap: 8px; align-items: center; }
.thead { padding: 0 12px 10px; font-size: 11.5px; font-weight: 700; color: var(--faint); letter-spacing: 0.05em; }
.thead .c-memo { text-align: center; }
.row {
  position: relative; padding: 13px 12px; border-radius: 18px; cursor: pointer;
  background-image: linear-gradient(var(--line-2), var(--line-2));
  background-size: calc(100% - 24px) 1px; background-repeat: no-repeat; background-position: center bottom;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}
.row:hover, .row:focus-visible {
  z-index: 1; transform: translateY(-2px); background-color: #fff; background-image: none;
  box-shadow: var(--shadow-md); outline: 1.5px solid rgba(123, 108, 246, 0.22); outline-offset: -1px;
}
.row:focus-visible { outline-color: var(--brand); }
.cell { min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 1px; }
.l1 { font-size: 13.5px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.l2 { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.l1.faint { color: var(--faint); font-weight: 500; }
.l1 .d { font-family: var(--ff-num); font-weight: 700; }
.wd { font-size: 11.5px; font-weight: 500; color: var(--muted); }
.wd-6 { color: #3f88d8; }
.wd-0 { color: #d64a70; }
.c-name .name { font-size: 14px; overflow: hidden; text-overflow: ellipsis; }
.c-caller .l1, .c-input .l1 { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.c-caller .faint, .c-input .faint { font-size: 12px; font-weight: 500; color: var(--faint); }
.c-cond { align-items: flex-start; gap: 5px; }
.c-memo { align-items: center; }

.chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 700; white-space: nowrap; border: 1px solid transparent;
}
.chip.c-ok { background: #e6f7ee; color: #17835a; }
.chip.c-ng { background: #ffe6ec; color: #c22a4d; }
.chip.c-unk { background: #f0f0f6; color: #767b93; border-color: #e3e3ee; }
.chip.c-band { background: var(--brand-soft); color: var(--brand-d); }
.chip.c-hidden { background: #f1e3ff; color: #8a3fc7; border-color: #e4cdfa; }

.memo { display: inline-flex; align-items: center; gap: 3px; color: var(--faint); }
.memo b { font-family: var(--ff-num); font-size: 12px; font-weight: 800; color: var(--brand-d); }
.memo.has { color: var(--brand); }

.badge {
  display: inline-flex; align-items: center; gap: 5px; width: fit-content; padding: 4px 11px 4px 8px;
  border-radius: 999px; border: 1px solid transparent; font-size: 12px; font-weight: 700; white-space: nowrap;
}
.s-none { background: #f1f1f6; color: #6b7088; border-color: #e6e6ef; }
.s-review { background: #fff6d6; color: #9a6f06; border-color: #f7e6a6; }
.s-callback { background: #ffeadb; color: #c2570c; border-color: #ffd6b8; }
.s-done { background: #ddf6e8; color: #12805a; border-color: #bfeed3; }
.s-ng { background: #ffe3e8; color: #c22a4d; border-color: #ffc6d1; }

/* ---------- 空状態 ---------- */
.empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 64px 20px 72px; text-align: center; }
.empty-icon { width: 74px; height: 74px; display: grid; place-items: center; border-radius: 50%; background: var(--brand-soft); color: var(--brand); margin-bottom: 6px; }
.empty h3 { font-size: 17px; font-weight: 700; }
.empty p { font-size: 13px; color: var(--muted); margin-bottom: 10px; }

/* ---------- 指標カード ---------- */
.metrics { --pie: 84px; display: flex; flex-direction: column; gap: 14px; position: sticky; top: 16px; }
.mcard { background: #fff; border: 1px solid var(--line); border-radius: 22px; padding: 16px 18px 18px; box-shadow: var(--shadow-sm); }
.mcard-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.mcard-title { font-size: 13.5px; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
.mcard-chip { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--brand-soft); color: var(--brand); }
.mcard-body.split { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.big { display: flex; align-items: baseline; gap: 4px; }
.big-num { font-family: var(--ff-num); font-size: 42px; line-height: 1.05; font-weight: 800; letter-spacing: -0.03em; }
.big-unit { font-size: 15px; font-weight: 700; color: var(--muted); }
.mcard-sub { margin-top: 6px; font-size: 12px; color: var(--muted); line-height: 1.6; }
.mcard-sub b { color: var(--ink); font-weight: 800; }
.ring { flex: none; }

/* 入電概況 */
.calls-hero { display: flex; align-items: baseline; gap: 10px; }
.calls-hero-label { font-size: 12px; font-weight: 700; color: var(--brand-d); padding: 2px 10px; border-radius: 999px; background: var(--brand-soft); }
.calls-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.cg { padding: 8px 12px; border-radius: 14px; background: #f8f7fd; }
.cg dt { font-size: 11px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.cg dd { display: flex; align-items: baseline; gap: 2px; margin-top: 1px; }
.cg dd b { font-size: 20px; line-height: 1.2; font-weight: 800; letter-spacing: -0.01em; color: var(--ink); }
.cg dd small { font-size: 11px; font-weight: 700; color: var(--muted); }
.calls-note { margin-top: 10px; font-size: 11px; }

/* ステータス比率 */
.pie-wrap { display: flex; align-items: center; gap: 14px; }
.pie { flex: none; width: var(--pie); height: var(--pie); }
.pie-total { font-family: var(--ff-num); font-size: 19px; font-weight: 800; fill: var(--ink); }
.pie-unit { font-size: 8px; font-weight: 700; fill: var(--muted); }
.pie-legend { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--ink-2); }
.pie-legend li { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto 34px; align-items: center; gap: 6px; }
.pie-legend .lg { width: 8px; height: 8px; }
.pie-legend .lg-name { white-space: nowrap; }
.pie-legend b { font-weight: 800; color: var(--ink); text-align: right; }
.pie-legend small { font-size: 11px; color: var(--muted); text-align: right; }

.mcard-accent { background: linear-gradient(150deg, #f0ecff 0%, #e4f4fd 100%); border-color: #ddd8fa; }
.mcard-accent .mcard-chip { background: #fff; }
.stackbar { display: flex; height: 10px; margin: 12px 0 10px; overflow: hidden; border-radius: 999px; background: rgba(255, 255, 255, 0.7); }
.stackbar-a { background: #9aa0bd; }
.stackbar-b { background: #ff9a5c; }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--ink-2); }
.legend li { display: flex; align-items: center; gap: 6px; }
.legend b { font-weight: 800; color: var(--ink); }
.lg { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.lg-a { background: #9aa0bd; }
.lg-b { background: #ff9a5c; }

/* ---------- 編集画面（中央の大きなモーダル） ---------- */
.editor-root { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; }
.ed-scrim {
  position: absolute; inset: 0; background: rgba(29, 33, 64, 0.42);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: fade 0.22s ease;
}
.editor {
  position: relative; width: 80vw; height: 95vh; height: 95dvh; display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--line); border-radius: 28px; overflow: hidden;
  box-shadow: 0 50px 110px -34px rgba(40, 30, 120, 0.55);
  animation: pop 0.28s cubic-bezier(0.22, 0.8, 0.24, 1);
}
.editor:focus { outline: none; }
.ed-head {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 18px 28px 16px; border-bottom: 1px solid var(--line-2); background: linear-gradient(180deg, #f7f5ff 0%, #fff 100%);
}
.eyebrow { font-size: 11.5px; font-weight: 700; color: var(--brand); letter-spacing: 0.08em; }
.ed-title { margin-top: 1px; font-size: 22px; font-weight: 800; letter-spacing: 0; }
.ed-head-r { display: flex; align-items: center; gap: 12px; }
.dirty-tag {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 13px; border-radius: 999px;
  background: #fff3cc; border: 1px solid #f0cf62; color: #8a6104; font-size: 12px; font-weight: 700;
}
.dirty-tag::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #f0a91a; }
.ed-body { flex: 1; min-height: 0; overflow-y: auto; padding: 20px 28px 8px; overscroll-behavior: contain; background: #fbfaff; }
.ed-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; align-items: start; }
.ed-col { min-width: 0; }
.ed-card {
  margin-bottom: 16px; padding: 18px 20px 20px; border: 1px solid var(--line); border-radius: 22px; background: #fff; box-shadow: var(--shadow-sm);
}
.ed-status { margin-bottom: 16px; padding: 16px 20px 18px; border: 1px solid #ddd8fa; border-radius: 22px; background: linear-gradient(140deg, #f3f0ff, #ecf7fd); }
.ed-sec-title { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; font-size: 14.5px; font-weight: 700; }
.ed-sec-title .ic { color: var(--brand); }
.sec-note { margin-left: auto; font-size: 11.5px; font-weight: 500; color: var(--muted); }
.ed-foot {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 28px; border-top: 1px solid var(--line-2); background: #fff;
}
.ed-foot-note { font-size: 12px; color: var(--muted); line-height: 1.6; }
.ed-foot-note b { color: var(--ink-2); }
.ed-foot-actions { display: flex; align-items: center; gap: 10px; flex: none; }

/* 入力部品 */
.field { margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
.fgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 14px; }
@media (max-width: 480px) { .fgrid { grid-template-columns: minmax(0, 1fr); } }
.fgrid .field { margin-bottom: 0; }
.field-wide { grid-column: 1 / -1; }
.flabel { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 700; color: var(--muted); }
.tinput {
  display: block; width: 100%; height: 44px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: 14px;
  background: #fbfaff; font-size: 14px; outline: 0; color-scheme: light;
  transition: border-color 0.18s, box-shadow 0.18s, background-color 0.18s;
}
.tinput::placeholder, .tarea::placeholder { color: var(--faint); }
.tinput:focus, .tarea:focus { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 4px rgba(123, 108, 246, 0.12); }
.tinput[aria-invalid='true'] { border-color: #f08aa0; background: #fff8fa; box-shadow: 0 0 0 4px rgba(240, 138, 160, 0.16); }
.tarea {
  display: block; width: 100%; resize: vertical; min-height: 104px; padding: 13px 16px; border: 1.5px solid var(--line); border-radius: 16px;
  background: #fbfaff; font-size: 13.5px; line-height: 1.7; outline: 0;
  transition: border-color 0.18s, box-shadow 0.18s, background-color 0.18s;
}
.ro-box {
  display: flex; align-items: center; min-height: 44px; padding: 0 14px; border: 1.5px dashed #dfe1ee; border-radius: 14px;
  background: #f6f5fb; color: var(--ink-2); font-size: 13.5px;
}
.ro-note { display: flex; align-items: center; gap: 6px; margin-top: 14px; font-size: 11.5px; color: var(--muted); }
.field-error { margin-top: 7px; padding-left: 4px; font-size: 12.5px; font-weight: 700; color: #c22a4d; }
.fhint { margin-top: 6px; font-size: 11.5px; color: var(--muted); }
.pref-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.pref-row .tinput { width: 172px; flex: none; }
.link-btn { padding: 6px 4px; border: 0; background: transparent; color: var(--brand-d); font-size: 12.5px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: var(--brand); }

/* 選択ボタン（ステータス・午前午後・条件） */
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg-row { gap: 6px; }
.seg-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 18px 0 14px;
  border: 1.5px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink-2); font-size: 13.5px; font-weight: 700;
  transition: background-color 0.16s, border-color 0.16s, color 0.16s, box-shadow 0.16s, transform 0.16s;
}
.seg-btn.seg-sm { height: 40px; padding: 0 16px; font-size: 13px; }
.seg-btn:hover { transform: translateY(-1px); border-color: #d2ccf5; }
.seg-btn.is-active { box-shadow: 0 0 0 3px rgba(123, 108, 246, 0.14); }
.seg-btn.seg-sm.is-active { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-d); }
.seg-btn.s-none.is-active { background: #f1f1f6; border-color: #b9bdd0; color: #565b73; box-shadow: 0 0 0 3px rgba(150, 155, 185, 0.22); }
.seg-btn.s-review.is-active { background: #fff6d6; border-color: #f0cf62; color: #8a6104; box-shadow: 0 0 0 3px rgba(240, 207, 98, 0.28); }
.seg-btn.s-callback.is-active { background: #ffeadb; border-color: #ffb27a; color: #b34c06; box-shadow: 0 0 0 3px rgba(255, 178, 122, 0.3); }
.seg-btn.s-done.is-active { background: #ddf6e8; border-color: #6fd2a2; color: #0e7350; box-shadow: 0 0 0 3px rgba(111, 210, 162, 0.3); }
.seg-btn.s-ng.is-active { background: #ffe3e8; border-color: #ff90a6; color: #b1203f; box-shadow: 0 0 0 3px rgba(255, 144, 166, 0.3); }
.seg-btn:not(.is-active) .ic { color: var(--muted); }

/* 過去入電のアコーディオン */
.past { margin-bottom: 16px; border: 1px solid #ddd8fa; border-radius: 22px; background: linear-gradient(140deg, #f7f5ff, #f0f9fe); }
.past-toggle {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 20px; border: 0; background: transparent;
  text-align: left; font-size: 13.5px; font-weight: 700; color: var(--ink); border-radius: 22px;
}
.past-ic { flex: none; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: #fff; color: var(--brand); }
.past-text b { color: var(--brand-d); font-weight: 800; }
.past-caret { margin-left: auto; flex: none; display: grid; place-items: center; color: var(--muted); transition: transform 0.2s; }
[aria-expanded='true'] > .past-caret { transform: rotate(180deg); color: var(--brand); }
.past-list { display: flex; flex-direction: column; gap: 8px; padding: 0 14px 14px; }
.past-item { border: 1px solid var(--line); border-radius: 16px; background: #fff; overflow: hidden; }
.past-head {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; width: 100%; padding: 11px 16px; border: 0; background: transparent;
  text-align: left; font-size: 13px;
}
.past-head:hover { background: #faf9ff; }
.past-id { font-weight: 800; }
.past-at { color: var(--muted); }
.past-name { font-weight: 700; color: var(--ink-2); }
.past-body { padding: 4px 18px 16px; border-top: 1px solid var(--line-2); }
.ro-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 16px; margin-top: 12px; }
.ro-grid dt { margin-bottom: 2px; font-size: 11.5px; color: var(--muted); }
.ro-grid dd { font-size: 13.5px; }
.past-sub { display: flex; align-items: center; margin: 16px 0 8px; font-size: 12.5px; font-weight: 700; color: var(--ink-2); }

/* メモ・変更履歴 */
.notes { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.notes-sm { margin-top: 0; }
.notes-empty { padding: 16px; text-align: center; font-size: 12.5px; color: var(--faint); border: 1.5px dashed #e0e2ee; border-radius: 16px; }
.note { padding: 12px 16px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.note.is-new, .hist-item.is-new { animation: noteIn 1.6s ease; }
@keyframes noteIn { 0% { background: #efecff; transform: translateY(-6px); opacity: 0; } 25% { opacity: 1; transform: none; } 100% { background: #fff; } }
.note-meta { display: flex; justify-content: space-between; gap: 10px; font-size: 11.5px; color: var(--muted); }
.note-author { font-weight: 700; color: var(--ink-2); }
.note-meta time { font-family: var(--ff-num); }
.note-body { margin-top: 5px; font-size: 13.5px; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }

.hist { display: flex; flex-direction: column; gap: 10px; }
.hist-item { padding: 12px 16px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.hist-dl { display: flex; flex-direction: column; gap: 8px; }
.hist-dl > div { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 10px; align-items: baseline; }
.hist-dl dt { font-size: 11.5px; color: var(--muted); }
.hist-dl dd { font-size: 13px; overflow-wrap: anywhere; }
.hist-changes { display: flex; flex-direction: column; gap: 6px; }
.hc { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; line-height: 1.6; }
.hc-field { padding: 1px 9px; border-radius: 999px; background: var(--line-2); color: var(--ink-2); font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.hc .badge { font-size: 11.5px; padding: 2px 9px 2px 7px; }
.hc .arrow { color: var(--muted); }
.hc-from { color: var(--muted); }
.hc-to { font-weight: 700; }
.hc-received { font-weight: 700; color: #1b7fa8; }

/* ---------- モーダル（確認ダイアログ） ---------- */
.modal-root { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; }
.modal-scrim { position: absolute; inset: 0; background: rgba(29, 33, 64, 0.42); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: fade 0.2s ease; }
.modal {
  position: relative; width: min(460px, 100%); padding: 30px 30px 26px; text-align: center;
  background: #fff; border: 1px solid var(--line); border-radius: 26px; box-shadow: 0 40px 90px -30px rgba(40, 30, 120, 0.5);
  animation: pop 0.26s cubic-bezier(0.22, 0.8, 0.24, 1);
}
.modal-icon { width: 56px; height: 56px; margin: 0 auto 14px; display: grid; place-items: center; border-radius: 50%; background: var(--brand-soft); color: var(--brand); box-shadow: 0 0 0 7px rgba(123, 108, 246, 0.08); }
.modal h2 { font-size: 18px; font-weight: 700; }
.modal p { margin-top: 10px; font-size: 13.5px; line-height: 1.8; color: var(--ink-2); }
.modal-actions { display: flex; justify-content: center; gap: 10px; margin-top: 24px; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(0.97); } to { opacity: 1; transform: none; } }

/* ---------- トースト ---------- */
.toasts { position: fixed; left: 50%; bottom: 28px; z-index: 70; display: flex; flex-direction: column; align-items: center; gap: 10px; transform: translateX(-50%); pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px; max-width: min(520px, calc(100vw - 32px)); padding: 12px 20px 12px 16px;
  border-radius: 16px; background: #1d2140; color: #fff; font-size: 13.5px; font-weight: 600;
  box-shadow: 0 20px 40px -16px rgba(20, 18, 60, 0.6);
  opacity: 0; transform: translateY(12px); transition: opacity 0.28s ease, transform 0.28s ease;
}
.toast.show { opacity: 1; transform: none; }
/* 編集モーダルの表示中は、フッター（説明文・保存ボタン）に重ならない高さへ上げる */
body:has(.editor-root:not([hidden])) .toasts { bottom: calc(2.5vh + 96px); }
.toast .ic { color: #6fe3b0; }
.toast-info .ic { color: #9fd8f5; }

/* ---------- 画面幅ごとの調整 ---------- */
@media (max-height: 880px) {
  .metrics { position: static; }
}
@media (max-width: 1439px) {
  .shell { width: calc(100% - 24px); margin: 12px auto; padding: 18px 20px 24px; border-radius: 26px; }
  .topbar { grid-template-columns: 1fr auto; grid-template-areas: 'brand actions' 'pills pills'; row-gap: 14px; }
  .pills { justify-content: center; flex-wrap: wrap; }
  .layout { grid-template-columns: minmax(0, 1fr) 244px; gap: 16px; }
  .table-panel { padding: 22px 12px 12px; }
  .table { --cols: minmax(76px, 0.85fr) minmax(146px, 1.3fr) minmax(108px, 1.1fr) minmax(108px, 1.1fr) minmax(78px, 0.85fr) minmax(78px, 0.85fr) minmax(98px, 1fr) 34px minmax(100px, 1fr); min-width: 880px; }
  .thead, .row { column-gap: 8px; }
  .mcard { padding: 14px 16px 16px; }
  .big-num { font-size: 36px; }
  .metrics { --pie: 66px; }
  .pie-wrap { gap: 10px; }
  .pie-total { font-size: 21px; }
  .pie-legend { font-size: 11.5px; gap: 4px; }
  .pie-legend li { grid-template-columns: 8px minmax(0, 1fr) auto 30px; gap: 5px; }
  .cg { padding: 7px 10px; }
}
@media (max-width: 1279px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .metrics { --pie: 62px; position: static; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); order: -1; gap: 12px; }
  .mcard-head { margin-bottom: 4px; }
  .mcard-chip { width: 26px; height: 26px; }
  .mcard-body.split { flex-wrap: wrap; }
  .stackbar { margin: 8px 0 8px; }
  .legend { gap: 10px; flex-wrap: wrap; }
  .calls-note { display: none; }
  .calls-grid { margin-top: 8px; gap: 6px; }
  .cg { padding: 5px 9px; }
  .cg dd b { font-size: 16px; }
  .calls-hero .big-num { font-size: 32px; }
  .pie-wrap { gap: 8px; }
  .pie-total { font-size: 21px; }
  .pie-legend { font-size: 11px; gap: 3px; }
  .pie-legend li { grid-template-columns: 7px minmax(0, 1fr) auto 28px; gap: 4px; }
  .pie-legend .lg { width: 7px; height: 7px; }
  .table-panel { padding: 22px 14px 12px; }
}
@media (max-width: 1099px) {
  .search { width: 280px; }
  .mcard { padding: 12px 12px 12px; border-radius: 18px; }
  .mcard-title { font-size: 12.5px; }
  .big-num { font-size: 30px; }
  .calls-hero .big-num { font-size: 28px; }
  .mcard-sub { font-size: 11px; }
  .ed-head, .ed-foot { padding-left: 22px; padding-right: 22px; }
  .ed-body { padding: 16px 22px 6px; }
}
@media (max-width: 900px) {
  .ed-cols { grid-template-columns: minmax(0, 1fr); }
  .editor { width: 94vw; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
