/* 配送受注システム 共通の見た目
   白地に、黒に近い青の文字。車はナンバープレートの形で出す。
   色は下の変数にまとめてある。画面ごとのクラス名は前のまま。 */

:root {
  --ink: #0f2340;          /* 黒に近い青。文字・主なボタン */
  --ink-2: #2b3f5e;
  --muted: #5b6b82;
  --line: #dbe3ee;
  --line-strong: #b8c5d6;
  --bg: #f4f7fb;           /* 地（明るい白） */
  --surface: #ffffff;
  --surface-2: #f5f8fc;
  --link: #1662d6;
  --plate-green: #0e6b3a;  /* 緑ナンバー */
  --plate-green-edge: #0a5229;
  --plate-yellow: #f3c845; /* 黒ナンバーの文字 */
  --danger: #b3261e; --danger-soft: #fbeceb; --danger-line: #eab3ae;
  --ok: #0e6b3a;     --ok-soft: #e7f2ec;     --ok-line: #a9cfb9;
  --warn: #6b5200;   --warn-soft: #fff4cc;   --warn-line: #e2bd3a;
  --focus: 0 0 0 3px rgba(22, 98, 214, .35);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "BIZ UDPGothic", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", Meiryo, "Noto Sans JP", sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--bg);
  line-break: strict;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}
a { color: var(--link); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
:focus-visible { outline: none; box-shadow: var(--focus); }
small { color: var(--muted); font-size: 13px; }
strong { font-weight: 700; }
em { font-style: normal; font-weight: 700; }

/* ---------- ナンバープレート（この見た目の主役） ---------- */
.plate {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 104px; padding: 2px 10px 3px; vertical-align: middle;
  border-radius: 5px; border: 2px solid; line-height: 1.1; white-space: nowrap;
  font-weight: 700; font-variant-numeric: tabular-nums;
}
.plate-top { font-size: 10px; letter-spacing: .12em; }
.plate-main { display: inline-flex; align-items: baseline; gap: 6px; font-size: 18px; letter-spacing: .04em; }
.plate-kana { font-size: 11px; }
.plate-green { background: var(--plate-green); border-color: var(--plate-green-edge); color: #fff; }
.plate-black { background: var(--ink); border-color: #000; color: var(--plate-yellow); }
.plate-white { background: #fff; border-color: var(--plate-green); color: var(--plate-green); }
.plate-none  { background: #fff; border-color: var(--line-strong); color: var(--ink); }
.plate-raw .plate-main { font-size: 15px; }
.plate.plate-s { min-width: 84px; padding: 1px 7px 2px; border-width: 1.5px; border-radius: 4px; }
.plate-s .plate-top { font-size: 9px; }
.plate-s .plate-main { font-size: 14px; gap: 4px; }
.plate-s .plate-kana { font-size: 10px; }
a.plate-link { text-decoration: none; display: inline-block; border-radius: 6px; }
a.plate-link:hover .plate { filter: brightness(1.12); }

/* ---------- 上の帯 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 18px;
  min-height: 56px; padding: 8px 20px; background: #fff; color: var(--ink-2); border-bottom: 1px solid var(--line); box-shadow: 0 1px 6px rgba(15, 35, 64, .06);
}
.topbar a.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); font-weight: 700; text-decoration: none; }
.brand-mark {
  display: inline-grid; place-items: center; width: 44px; height: 28px; border-radius: 4px;
  background: var(--plate-green); border: 2px solid var(--plate-green-edge); color: #fff; font-size: 14px; font-weight: 700; letter-spacing: .1em;
}
.brand-name { font-size: 16px; letter-spacing: .06em; }
.topbar .who { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; font-size: 14px; color: var(--ink-2); }
.topbar .who-company { font-weight: 700; color: var(--ink); }
.topbar .who-user small { margin-left: 8px; color: var(--muted); font-size: 12px; }
.topbar .who .link { color: var(--link); font-size: 14px; }
.topbar .who .link:hover { color: var(--ink); }
.topbar .nav-open { display: none; }

/* ---------- 左の案内（パソコン幅） ---------- */
.frame { display: block; }
body.has-nav .frame {
  display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: calc(100vh - 56px);
  background: linear-gradient(to right, var(--surface) 235px, var(--line) 235px, var(--line) 236px, transparent 236px); /* 左の帯と境の線を下まで伸ばす */
}
.sidenav {
  position: sticky; top: 56px; align-self: start; height: calc(100vh - 56px); overflow-y: auto;
  padding: 14px 10px 32px; font-size: 14px;
}
.sidenav a { display: block; padding: 6px 12px; border-radius: 4px; color: var(--ink-2); text-decoration: none; line-height: 1.45; }
.sidenav a:hover { background: var(--surface-2); color: var(--ink); }
.sidenav a.on { background: var(--ink); color: #fff; font-weight: 700; }
.sidenav a.sidenav-home { font-weight: 700; color: var(--ink); }
.sidenav a.sidenav-home.on { color: #fff; }
.sidenav-group { margin: 18px 12px 4px; font-size: 12px; font-weight: 700; color: var(--muted); }
.sidenav ul { list-style: none; margin: 0; padding: 0; }

/* ---------- 本文 ---------- */
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 26px 32px 56px; }
body.no-nav .container { max-width: 1100px; }
h1 { font-size: 26px; line-height: 1.35; margin: 2px 0 22px; font-weight: 700; letter-spacing: .02em; }
h2 { font-size: 18px; line-height: 1.5; margin: 34px 0 12px; font-weight: 700; }
h3 { font-size: 16px; margin: 18px 0 8px; }
@supports (word-break: auto-phrase) { h1, h2, h3 { word-break: auto-phrase; } }
p { margin: 0 0 12px; }

/* お知らせ */
.flash { padding: 11px 16px; margin-bottom: 16px; border: 1px solid var(--line); border-left: 5px solid var(--ink); background: var(--surface); line-height: 1.6; }
.flash.success { background: var(--ok-soft); border-color: var(--ok-line); border-left-color: var(--ok); }
.flash.error { background: var(--danger-soft); border-color: var(--danger-line); border-left-color: var(--danger); }
.flash.warning { background: var(--warn-soft); border-color: var(--warn-line); border-left-color: #c79a00; }

/* カード（区切りの枠） */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 20px; margin-bottom: 16px; }
.card.narrow { max-width: 440px; }
.card > :last-child { margin-bottom: 0; }
.card + h2 { margin-top: 34px; }

/* ---------- 入力 ---------- */
label { display: block; margin-bottom: 14px; font-size: 14px; font-weight: 700; color: var(--ink-2); }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 400; color: var(--ink); }
input[type=text], input[type=password], input[type=tel], input[type=date], input[type=time], input[type=datetime-local],
input[type=month], input[type=email], input[type=number], input[type=search], select, textarea {
  display: block; width: 100%; margin-top: 6px; padding: 9px 11px; font: inherit; font-size: 16px; font-weight: 400; line-height: 1.5;
  color: var(--ink); background-color: #fff; border: 1px solid var(--line-strong); border-radius: 4px;
}
input:hover, select:hover, textarea:hover { border-color: #9aa4af; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: var(--focus); }
input[readonly], input:disabled, select:disabled { background-color: var(--surface-2); color: var(--muted); }
select {
  appearance: none; -webkit-appearance: none; padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2315191e' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
label.check input { width: 18px; height: 18px; margin: 0; }
input[type=checkbox], input[type=radio] { accent-color: var(--ink); }
.req { margin-left: 6px; font-size: 11px; font-weight: 700; color: var(--danger); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 20px; }
.grid label.wide { grid-column: 1 / -1; }
.buttons { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin-top: 8px; }
textarea { min-height: 88px; resize: vertical; }
input[type=file] { font-size: 15px; max-width: 100%; }
input[type=file]::file-selector-button {
  margin-right: 10px; padding: 6px 14px; font: inherit; font-size: 14px; font-weight: 700; color: var(--ink);
  background: #fff; border: 1px solid var(--ink); border-radius: 4px; cursor: pointer;
}

/* ---------- ボタン ---------- */
/* 何も付いていないボタンは、白地に墨の枠 */
button {
  font: inherit; cursor: pointer;
  padding: 8px 18px; font-size: 15px; font-weight: 700; line-height: 1.4; color: var(--ink);
  background: #fff; border: 1px solid var(--ink); border-radius: 4px;
}
button:hover { background: var(--surface-2); }
button.primary { padding: 10px 26px; font-size: 16px; color: #fff; background: var(--ink); border-color: var(--ink); }
button.primary:hover { background: #000; }
button.link {
  padding: 0; font-size: inherit; font-weight: 400; line-height: inherit; color: var(--link);
  background: none; border: none; border-radius: 0; text-decoration: underline; text-underline-offset: 3px;
}
button.link:hover { background: none; color: var(--ink); }
button.link.danger, a.danger { color: var(--danger); }
form.inline { display: inline; }
a.button-link { display: inline-block; padding: 6px 16px; font-size: 15px; font-weight: 700; color: var(--ink); background: #fff; border: 1px solid var(--ink); border-radius: 4px; text-decoration: none; }
a.button-link:hover { background: var(--surface-2); }

/* ---------- メニュー ---------- */
h2.menu-group { margin-top: 30px; padding-bottom: 6px; border-bottom: 2px solid var(--ink); }
h2.menu-group:first-of-type { margin-top: 0; }
.menu { list-style: none; margin: 0 0 8px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.menu a {
  display: flex; flex-direction: column; gap: 2px; height: 100%; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 6px;
  text-decoration: none; color: var(--ink); font-weight: 700; line-height: 1.5;
}
.menu a:hover { border-color: var(--ink); }
.menu .no { font-size: 12px; font-weight: 400; color: var(--muted); }

/* ---------- 表 ---------- */
.table-wrap { overflow-x: auto; margin-bottom: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.table-wrap > table.list { margin-bottom: 0; border: none; }
table.list { width: 100%; border-collapse: collapse; margin-bottom: 16px; background: var(--surface); border: 1px solid var(--line); }
table.list th, table.list td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
table.list tbody tr:last-child td { border-bottom: none; }
table.list th { font-size: 13px; font-weight: 700; color: var(--ink-2); white-space: nowrap; border-bottom: 2px solid var(--ink); background: var(--surface); }
table.list tbody tr:hover td { background: #fafbfa; }
table.list td.num, table.list th.num { text-align: right; white-space: nowrap; }
table.list td.actions { white-space: nowrap; }
table.list td.actions > * { margin-right: 14px; }
table.list td.actions button.link, table.list td.actions a { display: inline-block; padding: 6px 2px; }
table.list tr.muted td { color: #98a1ab; }
table.list.compact { margin-bottom: 10px; }
table.list.compact th, table.list.compact td { padding: 7px 12px; }
.card table.list { border-left: none; border-right: none; }
table.list tr.alert td { background: var(--danger-soft); }

/* ---------- 小さな印 ---------- */
.tag, .status {
  display: inline-block; padding: 0 8px; margin-right: 8px; border-radius: 3px; font-size: 12px; font-weight: 700; line-height: 1.8;
  color: var(--ink-2); background: #e6e9ec; white-space: nowrap;
}
.tag.over { color: var(--danger); background: var(--danger-soft); box-shadow: inset 0 0 0 1px var(--danger-line); }
.status.received { color: var(--warn); background: var(--warn-soft); }
.status.dispatched { color: var(--link); background: #e5eef8; }
.status.done { color: var(--ok); background: var(--ok-soft); }
.status.cancelled { color: #8a96a3; background: #eef1f4; }

/* ---------- 検索・日付の帯 ---------- */
form.search, form.datebar { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; margin-bottom: 18px; }
form.search input { display: inline-block; width: auto; min-width: 240px; margin: 0; }
form.datebar input[type=date], form.datebar input[type=month] { display: inline-block; width: auto; margin: 0; }
form.datebar label { display: flex; align-items: center; gap: 8px; margin: 0; }
form.datebar label input, form.datebar label select { display: inline-block; width: auto; margin: 0; }
form.row-form { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; margin-top: 14px; }
form.row-form label { margin-bottom: 0; min-width: 160px; }
form.upload { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 10px; }
p.summary { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; color: var(--ink-2); }

/* ---------- 写真 ---------- */
img.photo { max-width: 100%; max-height: 320px; border: 1px solid var(--line); border-radius: 4px; }
img.photo.small { max-height: 200px; }
.thumbs { display: flex; flex-wrap: wrap; gap: 12px; }
.thumbs figure { margin: 0; width: 200px; }
.thumbs img { width: 200px; height: 130px; object-fit: cover; border: 1px solid var(--line); border-radius: 4px; }
.thumbs figcaption { font-size: 13px; color: var(--muted); }

/* ---------- 配車 ---------- */
section.dispatch { margin-bottom: 18px; }
.dispatch-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
details { margin-top: 10px; }
details summary { cursor: pointer; color: var(--link); font-weight: 700; }
.route-line { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 6px 0; }
.route-box form { margin-top: 8px; }
details.map iframe { width: 100%; height: 400px; border: 0; margin-top: 10px; border-radius: 4px; }

/* ---------- ドライバーのスマホ画面・点呼 ---------- */
p.today { font-size: 18px; font-weight: 700; }
ol.steps { list-style: none; padding: 0; margin: 0 0 16px; }
ol.steps > li { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 14px; margin-bottom: 8px; }
ol.steps form, ol.steps a.big { margin-top: 8px; }
.step-ok, .step-todo { display: inline-block; min-width: 3.4em; padding: 0 8px; text-align: center; border-radius: 3px; font-size: 12px; font-weight: 700; margin-right: 8px; }
.step-ok { background: var(--ok); color: #fff; }
.step-todo { background: var(--plate-yellow); color: var(--ink); }
button.big, a.big {
  display: block; width: 100%; padding: 16px; margin-top: 8px; font-size: 18px; font-weight: 700; text-align: center;
  border: 2px solid var(--ink); border-radius: 6px; background: var(--ink); color: #fff; text-decoration: none;
}
button.big:hover, a.big:hover { background: #000; color: #fff; }
button.big:disabled { opacity: .5; }
button.sub { padding: 10px 18px; font-size: 16px; color: var(--ink); background: #fff; border: 1px solid var(--ink); border-radius: 4px; }
button.big.sub { background: #fff; color: var(--ink); border: 2px solid var(--ink); }
button.big.warn, button.warn { background: var(--danger); color: #fff; border-color: var(--danger); }
ul.stops { list-style: none; padding: 0; }
ul.stops li a {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 6px; color: var(--ink); text-decoration: none;
}
ul.stops li a:hover { border-color: var(--ink); }
ul.stops li.done a { background: var(--surface-2); color: var(--muted); }
ul.stops .seq { display: inline-grid; place-items: center; min-width: 34px; height: 34px; border-radius: 4px; font-size: 17px; font-weight: 700; color: #fff; background: var(--ink); }
ul.stops li.done .seq { background: #a3acb6; }
ul.stops .name { flex: 1; font-weight: 700; }
ul.stops .name small { display: block; font-weight: 400; }
ul.stops .state { font-size: 13px; }
.note { background: var(--warn-soft); border: 1px solid var(--warn-line); border-radius: 4px; padding: 10px 12px; margin-top: 8px; }
canvas.signature { width: 100%; max-width: 600px; height: auto; aspect-ratio: 600 / 220; border: 2px dashed #9aa4af; border-radius: 6px; background: #fff; touch-action: none; }
fieldset.chk { border: 1px solid var(--line); border-radius: 4px; margin: 0 0 10px; padding: 8px 12px; background: #fff; }
fieldset.chk legend { padding: 0 4px; font-size: 14px; font-weight: 700; }
fieldset.chk label.check { display: inline-flex; margin: 4px 18px 4px 0; }
section.rollcall { margin-bottom: 18px; }
.driver-form h2 { margin-top: 22px; }

/* ---------- 依頼主の画面の切り替え ---------- */
nav.tabs { display: flex; flex-wrap: wrap; gap: 0; margin: 0 0 20px; border-bottom: 2px solid var(--ink); }
nav.tabs a { padding: 8px 18px; text-decoration: none; color: var(--ink-2); font-weight: 700; border-radius: 4px 4px 0 0; }
nav.tabs a:hover { color: var(--ink); background: var(--surface); }
nav.tabs a.on { background: var(--ink); color: #fff; }

/* ---------- ログイン前（ログイン画面など） ---------- */
body.guest .container { display: flex; flex-direction: column; align-items: center; padding-top: 9vh; }
body.guest h1 { text-align: center; }
body.guest .container > .card, body.guest .container > .flash { width: 100%; max-width: 400px; }
body.guest .card { padding: 26px; border-top: 5px solid var(--plate-green); }
body.guest .card button.primary { width: 100%; }

/* ---------- 狭い幅 ---------- */
@media (max-width: 1023px) {
  body.has-nav .frame { display: block; background: none; }
  .sidenav { display: none; }
  .topbar .nav-open { display: inline-block; padding: 3px 12px; border: 1px solid #5d6672; border-radius: 4px; font-weight: 700; font-size: 14px; color: #fff; text-decoration: none; }
}
@media (max-width: 640px) {
  .topbar { position: static; padding: 10px 14px; }
  .topbar .who { gap: 2px 12px; font-size: 13px; }
  .container { padding: 18px 12px 40px; }
  h1 { font-size: 22px; margin-bottom: 16px; }
  h2 { font-size: 17px; }
  .card { padding: 16px; }
  form.search input { min-width: 0; flex: 1; }

  /* 表は1行ずつ札にして縦に積む */
  .table-wrap { overflow: visible; background: none; border: none; }
  table.list { border: none; background: transparent; }
  table.list thead { display: none; }
  table.list, table.list tbody, table.list tr, table.list td { display: block; width: 100%; }
  table.list tr { margin-bottom: 8px; padding: 8px 0; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
  table.list tbody tr:hover td { background: transparent; }
  table.list td, table.list tbody tr:last-child td { border: none; padding: 4px 14px; }
  table.list td[data-label]::before { content: attr(data-label) "："; color: var(--muted); font-size: 13px; font-weight: 700; }
  table.list td.num { text-align: left; }
  table.list td.actions { white-space: normal; padding-top: 8px; margin-top: 4px; border-top: 1px solid var(--line); }
  table.list td[data-label]:empty { display: none; }
  table.list tr.alert { background: var(--danger-soft); }
}

/* ==========================================================================
   指令メニュー専用レイアウト（menu.php 内の .cmd-shell）
   ========================================================================== */
body:has(.cmd-shell) .container {
  max-width: 1440px;
  padding: 24px 28px 56px;
}
body:has(.cmd-shell) .container > h1 {
  display: none;
}

.cmd-shell {
  --obs-bg: #ffffff;
  --obs-panel: #ffffff;
  --obs-panel-2: #f5f8fc;
  --brass: #1662d6;
  --brass-light: #0f2340;
  --brass-dim: rgba(22, 98, 214, 0.22);
  --brass-glow: rgba(22, 98, 214, 0.12);
  --text-main: #0f2340;
  --text-muted: #5b6b82;
  position: relative;
  border-radius: 14px;
  padding: 24px;
  background-color: var(--obs-panel);
  background-image:
    radial-gradient(circle at 12% 0%, rgba(22, 98, 214, 0.11), transparent 42%),
    radial-gradient(circle at 92% 100%, rgba(22, 98, 214, 0.07), transparent 45%),
    repeating-linear-gradient(45deg, rgba(22, 98, 214, 0.025) 0, rgba(22, 98, 214, 0.025) 1px, transparent 1px, transparent 18px),
    repeating-linear-gradient(-45deg, rgba(22, 98, 214, 0.025) 0, rgba(22, 98, 214, 0.025) 1px, transparent 1px, transparent 18px);
  border: 1px solid var(--brass-dim);
  box-shadow: 0 24px 60px rgba(15, 35, 64, 0.13), inset 0 1px 0 rgba(15, 35, 64, 0.1);
}

.cmd-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  padding-bottom: 18px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--brass-dim);
}
.cmd-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--brass);
  margin-bottom: 4px;
}
.cmd-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brass);
  box-shadow: 0 0 10px var(--brass);
}
.cmd-heading-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.cmd-main-title {
  margin: 0;
  font-size: 23px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-main);
}
.cmd-date-pill {
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--brass-light);
  background: rgba(22, 98, 214, 0.1);
  border: 1px solid rgba(22, 98, 214, 0.3);
}

.cmd-search-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 7px 12px;
  min-width: 300px;
  background: #ffffff;
  border: 1px solid rgba(22, 98, 214, 0.3);
  border-radius: 8px;
  color: var(--brass);
}
.cmd-search-label:focus-within {
  border-color: var(--brass-light);
  box-shadow: 0 0 0 3px rgba(22, 98, 214, 0.18);
}
.cmd-search-label input {
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-main);
  font-size: 14px;
}
.cmd-search-label input:focus { box-shadow: none; }
.cmd-search-label kbd {
  padding: 1px 6px;
  font-size: 11px;
  color: var(--brass);
  border: 1px solid rgba(22, 98, 214, 0.35);
  border-radius: 4px;
}

.cmd-split {
  display: grid;
  grid-template-columns: minmax(320px, 42%) minmax(0, 58%);
  gap: 22px;
  align-items: start;
}

.cmd-left-pane {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--brass-dim);
  border-radius: 12px;
  padding: 18px;
  box-shadow: inset 0 1px 0 rgba(15, 35, 64, 0.08);
}
.cmd-pane-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 14px;
}
.cmd-eyebrow {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--brass);
}
.cmd-pane-head h3 {
  margin: 2px 0 0;
  font-size: 16px;
  color: var(--text-main);
}
.cmd-ghost-link {
  font-size: 13px;
  color: var(--brass-light);
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(22, 98, 214, 0.25);
}
.cmd-ghost-link:hover {
  background: rgba(22, 98, 214, 0.14);
  color: #fff;
}

.cmd-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.cmd-kpi-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: 9px;
  background: linear-gradient(160deg, #f7f9fd, #ffffff);
  border: 1px solid rgba(22, 98, 214, 0.2);
  text-decoration: none;
  color: var(--text-main);
  transition: border-color 0.2s, transform 0.2s;
}
.cmd-kpi-card:hover {
  border-color: var(--brass);
  transform: translateY(-1px);
  color: #fff;
}
.cmd-kpi-card.is-alert {
  border-color: rgba(245, 158, 11, 0.55);
  background: linear-gradient(160deg, rgba(245, 158, 11, 0.12), #f7f9fd);
}
.cmd-kpi-label {
  font-size: 12px;
  color: var(--text-muted);
}
.cmd-kpi-val {
  margin: 4px 0 6px;
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.cmd-kpi-val strong {
  font-size: 24px;
  line-height: 1.1;
  color: var(--brass-light);
}
.cmd-kpi-card.is-alert .cmd-kpi-val strong { color: #b45309; }
.cmd-kpi-val small { color: var(--text-muted); font-size: 12px; }
.cmd-kpi-note { font-size: 11px; color: #5b6b82; }
.cmd-meter {
  height: 5px;
  border-radius: 999px;
  background: rgba(15, 35, 64, 0.04);
  overflow: hidden;
}
.cmd-meter span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #0f4fb8, #0f2340);
  border-radius: 999px;
}

.cmd-feed-box {
  border-top: 1px solid rgba(22, 98, 214, 0.16);
  padding-top: 14px;
}
.cmd-feed-head {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.cmd-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cmd-tl-item a {
  display: grid;
  grid-template-columns: 44px 12px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  border-radius: 8px;
  background: rgba(15, 35, 64, 0.025);
  border: 1px solid rgba(22, 98, 214, 0.12);
  text-decoration: none;
  color: var(--text-main);
}
.cmd-tl-item a:hover {
  border-color: rgba(22, 98, 214, 0.45);
  background: rgba(22, 98, 214, 0.06);
}
.cmd-tl-time {
  font-size: 13px;
  font-weight: 700;
  color: var(--brass-light);
}
.cmd-tl-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #5b6b82;
}
.cmd-tl-item.is-active .cmd-tl-dot {
  background: var(--brass);
  box-shadow: 0 0 8px var(--brass);
}
.cmd-tl-item.is-done .cmd-tl-dot { background: #10b981; }
.cmd-tl-body strong { display: block; font-size: 13px; line-height: 1.35; }
.cmd-tl-body small { display: block; font-size: 11px; color: var(--text-muted); }
.cmd-tl-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(22, 98, 214, 0.14);
  color: var(--brass-light);
  border: 1px solid rgba(22, 98, 214, 0.28);
}
.cmd-tl-item.is-done .cmd-tl-badge {
  background: rgba(16, 185, 129, 0.14);
  color: #0e7a45;
  border-color: rgba(16, 185, 129, 0.3);
}
.cmd-feed-empty {
  padding: 18px 12px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}
.cmd-brass-btn {
  display: inline-block;
  margin-top: 6px;
  padding: 7px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  background: linear-gradient(135deg, #0f2340, #1662d6);
  text-decoration: none;
}

.cmd-section-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}
.cmd-section-label span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--brass);
}
.cmd-section-label small { color: var(--text-muted); font-size: 12px; }

.cmd-hero-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.cmd-core-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}
.cmd-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text-main);
  background: linear-gradient(155deg, #f5f8fc 0%, #ffffff 100%);
  border: 1px solid rgba(22, 98, 214, 0.26);
  box-shadow: 0 8px 20px rgba(15, 35, 64, 0.07), inset 0 1px 0 rgba(15, 35, 64, 0.1);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.cmd-card:hover {
  transform: translateY(-2px);
  border-color: var(--brass-light);
  box-shadow: 0 14px 28px rgba(15, 35, 64, 0.11), 0 0 20px rgba(22, 98, 214, 0.16);
  color: #fff;
}
.cmd-card-hero {
  padding: 18px 18px 16px;
  min-height: 122px;
  background:
    radial-gradient(circle at 100% 0%, rgba(22, 98, 214, 0.18), transparent 55%),
    linear-gradient(155deg, #eef3fa 0%, #ffffff 100%);
  border-color: rgba(22, 98, 214, 0.45);
}
.cmd-card-core {
  padding: 13px 14px;
  min-height: 92px;
}
.cmd-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.cmd-code {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--brass);
}
.cmd-arrow {
  font-size: 14px;
  color: var(--brass-light);
  opacity: 0.75;
}
.cmd-card-hero .cmd-card-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--brass-light);
  margin-bottom: 4px;
}
.cmd-card-core .cmd-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 3px;
}
.cmd-card-desc {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-muted);
}

.cmd-card-shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(15, 35, 64, 0.1) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 0.65s ease;
  pointer-events: none;
}
.cmd-card-hero:hover .cmd-card-shimmer {
  transform: translateX(100%);
}

.cmd-drawer {
  margin-top: 6px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid rgba(22, 98, 214, 0.28);
  overflow: hidden;
}
.cmd-drawer-summary {
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  cursor: pointer;
  color: var(--text-main);
  background: linear-gradient(90deg, rgba(22, 98, 214, 0.09), transparent);
}
.cmd-drawer-summary::-webkit-details-marker { display: none; }
.cmd-drawer-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.cmd-drawer-icon {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(22, 98, 214, 0.14);
  border: 1px solid rgba(22, 98, 214, 0.35);
  color: var(--brass-light);
}
.cmd-drawer-left strong { display: block; font-size: 14px; color: var(--brass-light); }
.cmd-drawer-left small { display: block; font-size: 12px; color: var(--text-muted); }
.cmd-drawer-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--brass);
  white-space: nowrap;
}
.cmd-drawer[open] .label-closed { display: none; }
.cmd-drawer:not([open]) .label-open { display: none; }
.cmd-drawer[open] .chevron { transform: rotate(180deg); }

.cmd-drawer-body {
  padding: 14px 16px 18px;
  border-top: 1px solid rgba(22, 98, 214, 0.18);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.cmd-drawer-group h4 {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--brass);
  letter-spacing: 0.06em;
}
.cmd-drawer-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 8px;
}
.cmd-mini-tile {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 7px;
  background: #f7f9fd;
  border: 1px solid rgba(22, 98, 214, 0.16);
  text-decoration: none;
  color: var(--text-main);
  font-size: 13px;
}
.cmd-mini-tile:hover {
  border-color: var(--brass);
  background: rgba(22, 98, 214, 0.08);
  color: var(--brass-light);
}
.cmd-mini-no {
  font-size: 11px;
  color: var(--brass);
  font-weight: 700;
}
.cmd-empty-search {
  text-align: center;
  color: var(--text-muted);
  padding: 18px;
}

@media (max-width: 1100px) {
  .cmd-split { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .cmd-shell { padding: 14px; }
  .cmd-hero-grid { grid-template-columns: 1fr; }
  .cmd-core-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cmd-search-label { min-width: 100%; }
}

/* 左の一覧のグループをたためるようにする（グループ名を押すと開く・たたむ） */
.sidenav details.sidenav-sec { margin: 0; }
.sidenav summary.sidenav-group {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-bottom: 2px; padding: 4px 6px 4px 0; cursor: pointer; list-style: none; user-select: none; border-radius: 4px;
}
.sidenav summary.sidenav-group::-webkit-details-marker { display: none; }
.sidenav summary.sidenav-group::after {
  content: ""; flex: none; width: 7px; height: 7px; margin-right: 4px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(-45deg); transition: transform .15s;
}
.sidenav details[open] > summary.sidenav-group::after { transform: rotate(45deg); }
.sidenav summary.sidenav-group:hover { opacity: .85; }

/* ---------- カーソルを合わせると、ボタンが浮いて光る ---------- */
button, a.button-link, a.big, .menu a, .cmd-card, .cmd-mini-tile, .cmd-kpi-card, .cmd-brass-btn, .cmd-ghost-link, ul.stops li a {
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease, background-color .15s ease;
}
button:not(.link):hover, a.button-link:hover, a.big:hover, .cmd-brass-btn:hover, .cmd-ghost-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(22, 98, 214, .22), 0 0 0 3px rgba(22, 98, 214, .12);
}
.menu a:hover, .cmd-card:hover, .cmd-mini-tile:hover, .cmd-kpi-card:hover, ul.stops li a:hover {
  transform: translateY(-3px);
  border-color: rgba(22, 98, 214, .55);
  box-shadow: 0 10px 24px rgba(15, 35, 64, .12), 0 0 0 3px rgba(22, 98, 214, .14);
}
button:not(.link):active, a.button-link:active, a.big:active { transform: translateY(0); box-shadow: none; }
button.primary { background: var(--ink); border-color: var(--ink); }
button.primary:hover { background: #1662d6; border-color: #1662d6; }
@media (prefers-reduced-motion: reduce) {
  button, a.button-link, a.big, .menu a, .cmd-card, .cmd-mini-tile, .cmd-kpi-card, .cmd-brass-btn, .cmd-ghost-link, ul.stops li a { transition: none; }
  button:not(.link):hover, a.button-link:hover, a.big:hover, .menu a:hover, .cmd-card:hover, .cmd-mini-tile:hover, .cmd-kpi-card:hover, .cmd-brass-btn:hover, .cmd-ghost-link:hover, ul.stops li a:hover { transform: none; }
}

/* ---------- 運行表（今日の状況・配車表） ----------
   車ごとに横1本の線。配送先は時刻の位置の点。実線は走った道のり、点線はこれから。赤い縦線は今の時刻。 */
.rd-wrap { overflow-x: auto; margin-bottom: 8px; padding: 10px 18px 26px; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.rd { min-width: 760px; }
.rd-row { display: grid; grid-template-columns: 176px minmax(0, 1fr); }
.rd-track { position: relative; }
.rd-axis .rd-track { height: 24px; }
.rd-tick { position: absolute; top: 2px; transform: translateX(-50%); font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.rd-lanes { position: relative; }
.rd-grid { position: absolute; inset: 0; pointer-events: none; }
.rd-grid .rd-track { height: 100%; }
.rd-gl { position: absolute; top: 0; bottom: 0; width: 1px; background: #e9eef5; }
.rd-now { position: absolute; top: -6px; bottom: -6px; width: 2px; margin-left: -1px; background: #d1241a; z-index: 3; }
.rd-now span { position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 700; color: #d1241a; white-space: nowrap; }
.rd-lane { position: relative; }
.rd-lane + .rd-lane { border-top: 1px dashed #e3e9f2; }
.rd-lane .rd-track { height: 92px; }
.rd-head { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 3px; padding: 10px 14px 10px 0; }
.rd-driver { font-size: 13px; font-weight: 700; color: var(--ink); }
.rd-note { padding: 0 7px; border-radius: 3px; font-size: 11px; font-weight: 700; color: var(--ink-2); background: #e6ebf2; }
.rd-note.warn { color: #8a5a00; background: #fff1c7; }
.rd-note.ok { color: #0b6a3c; background: #e3f4ea; }
.rd-line { position: absolute; top: 50%; height: 4px; margin-top: -2px; border-radius: 2px; }
.rd-line-done { background: var(--ink); }
.rd-line-todo { background: repeating-linear-gradient(90deg, #aebcd0 0 7px, transparent 7px 12px); }
.rd-base { position: absolute; top: 50%; width: 11px; height: 11px; margin: -6px 0 0 -6px; background: #fff; border: 2px solid var(--ink); transform: rotate(45deg); }
.rd-base.is-done { background: var(--ink); }
.rd-stop { position: absolute; top: 50%; transform: translate(-50%, -50%); z-index: 2; }
.rd-dot { display: block; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid var(--ink); transition: transform .15s; }
.rd-stop:hover .rd-dot { transform: scale(1.25); }
.rd-stop.is-done .rd-dot { background: var(--ink); }
.rd-stop.is-work .rd-dot { background: #1662d6; border-color: #1662d6; box-shadow: 0 0 0 5px rgba(22, 98, 214, .22); }
.rd-stop.is-late .rd-dot { border-color: #d1241a; box-shadow: 0 0 0 5px rgba(209, 36, 26, .16); }
.rd-stop.is-ng .rd-dot { background: #b45309; border-color: #b45309; }
.rd-lbl {
  position: absolute; top: 20px; left: 50%; transform: translateX(-50%);
  font-size: 12px; font-weight: 700; line-height: 1.25; text-align: center; white-space: nowrap; color: var(--ink);
}
.rd-lbl small { display: block; font-size: 11px; font-weight: 400; color: var(--muted); }
.rd-stop.is-up .rd-lbl { top: auto; bottom: 20px; }
.rd-stop.is-late .rd-lbl, .rd-stop.is-late .rd-lbl small { color: #d1241a; }
.rd-stop.is-ng .rd-lbl small { color: #b45309; font-weight: 700; }
.rd-stop.is-todo .rd-lbl { color: var(--ink-2); }
.rd-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 6px 0 18px; font-size: 12px; color: var(--muted); }
.rd-key { display: inline-block; width: 11px; height: 11px; margin-left: 8px; border-radius: 50%; border: 2px solid var(--ink); background: #fff; vertical-align: -1px; }
.rd-key:first-child { margin-left: 0; }
.rd-key.is-done { background: var(--ink); }
.rd-key.is-work { background: #1662d6; border-color: #1662d6; }
.rd-key.is-late { border-color: #d1241a; }
.rd-key.is-ng { background: #b45309; border-color: #b45309; }
.rd-empty { color: var(--muted); }

/* ドライバーの配送先：縦の線でつないで、1本の道のりに見せる */
ul.stops li { position: relative; }
ul.stops li:not(:last-child)::after {
  content: ""; position: absolute; left: 29px; top: calc(50% + 17px); height: calc(100% - 24px); width: 3px;
  background: repeating-linear-gradient(180deg, #aebcd0 0 6px, transparent 6px 10px); z-index: 0;
}
ul.stops li.done:not(:last-child)::after { background: var(--ink); }
ul.stops .seq { position: relative; z-index: 1; border-radius: 50%; }
ul.stops .state { text-align: right; }
ul.stops .when { display: block; font-size: 12px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.rd-head { position: sticky; left: 0; z-index: 4; background: #fff; box-shadow: -20px 0 0 #fff, 6px 0 8px -6px rgba(15, 35, 64, .12); }
@media (max-width: 640px) {
  .rd-wrap { padding: 8px 10px 24px; }
  .rd { min-width: 680px; }
  .rd-row { grid-template-columns: 112px minmax(0, 1fr); }
  .rd-head .plate { min-width: 92px; }
}

/* ---------- 次にやること・はじめの設定 ---------- */
section.setup, section.next { margin: 0 0 22px; padding: 16px 20px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 1px 4px rgba(15, 35, 64, .05); }
section.setup { border-left: 5px solid var(--plate-green); }
section.next { border-left: 5px solid #1662d6; }
.setup-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.setup-head strong, .next-title { font-size: 17px; font-weight: 700; color: var(--ink); }
.setup-head span { font-size: 13px; font-weight: 700; color: var(--muted); }
.setup-bar { height: 6px; margin-bottom: 12px; background: #e6ecf3; border-radius: 3px; overflow: hidden; }
.setup-bar span { display: block; height: 100%; background: var(--plate-green); }
ol.setup-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
ol.setup-steps li { display: flex; align-items: center; gap: 12px; padding: 6px 8px; border-radius: 8px; color: var(--muted); }
ol.setup-steps li.is-done { color: var(--ink-2); }
ol.setup-steps li.is-next { background: #eef6f1; color: var(--ink); font-weight: 700; }
.setup-no { display: inline-grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 50%; font-size: 13px; font-weight: 700; border: 2px solid #c3cdd9; color: var(--muted); background: #fff; }
li.is-done .setup-no { background: var(--plate-green); border-color: var(--plate-green); color: #fff; }
li.is-next .setup-no { border-color: var(--plate-green); color: var(--plate-green); }
.setup-txt { flex: 1; }
.setup-txt small { display: block; font-weight: 400; color: var(--ink-2); }
.next-title { display: block; margin-bottom: 8px; }
section.next ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
section.next li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 8px; background: #f3f7fd; }
section.next li.warn { background: #fff6dc; }
section.next li span { font-weight: 700; color: var(--ink); }
a.button-link.go { flex: none; padding: 8px 18px; font-weight: 700; color: #fff; background: var(--ink); border: 1px solid var(--ink); border-radius: 8px; text-decoration: none; white-space: nowrap; }
a.button-link.go:hover { background: #1662d6; border-color: #1662d6; color: #fff; }

/* ---------- 手順の番号（配車表） ---------- */
.step-no { display: inline-grid; place-items: center; width: 28px; height: 28px; margin-right: 10px; border-radius: 50%; font-size: 15px; color: #fff; background: var(--ink); vertical-align: 2px; }
p.step-help { margin: -6px 0 12px; font-size: 14px; color: var(--ink-2); }

/* ---------- 表の中の操作：主な操作は小さなボタン、削除などは赤い文字で控えめに ---------- */
table.list td.actions a:not(.danger):not(.sub-link), table.list td.actions button.link:not(.danger) {
  display: inline-block; padding: 4px 12px; margin: 2px 6px 2px 0; font-size: 14px; font-weight: 700; color: var(--ink);
  background: #fff; border: 1px solid var(--line-strong); border-radius: 6px; text-decoration: none;
}
table.list td.actions a:not(.danger):not(.sub-link):hover, table.list td.actions button.link:not(.danger):hover { border-color: #1662d6; color: #1662d6; }
table.list td.actions button.link.danger, table.list td.actions a.danger { margin-left: 10px; font-size: 13px; text-decoration: none; opacity: .85; }
table.list td.actions button.link.danger:hover, table.list td.actions a.danger:hover { opacity: 1; text-decoration: underline; }
button.btn-s { padding: 4px 12px; margin: 2px 6px 2px 0; font-size: 14px; font-weight: 700; color: #fff; background: var(--plate-green); border: 1px solid var(--plate-green); border-radius: 6px; }
button.btn-s:hover { background: #0a5229; border-color: #0a5229; }
a.sub-link { font-size: 13px; }
@media (max-width: 640px) {
  section.next li { flex-direction: column; align-items: stretch; }
  section.next li a.button-link.go, ol.setup-steps a.button-link.go { text-align: center; }
  ol.setup-steps li.is-next { flex-wrap: wrap; }
}

/* ---------- 登録の入力欄：ふだんはたたみ、「＋ 新しく登録」で開く ---------- */
details.crud-panel { margin: 0 0 18px; }
details.crud-panel > summary {
  display: inline-flex; align-items: center; gap: 6px; padding: 10px 22px; list-style: none; cursor: pointer;
  font-size: 15px; font-weight: 700; color: #fff; background: var(--ink); border: 1px solid var(--ink); border-radius: 8px;
  transition: transform .15s, box-shadow .15s, background-color .15s;
}
details.crud-panel > summary::-webkit-details-marker { display: none; }
details.crud-panel > summary:hover { background: #1662d6; border-color: #1662d6; transform: translateY(-2px); box-shadow: 0 6px 16px rgba(22, 98, 214, .22); }
details.crud-panel[open] > summary { color: var(--ink); background: #fff; border-color: var(--line-strong); transform: none; box-shadow: none; }
details.crud-panel[open] > summary::after { content: "（閉じる）"; font-size: 13px; font-weight: 400; color: var(--muted); }
details.crud-panel > form, details.crud-panel > .card, details.crud-panel > section { margin-top: 12px; }
details.crud-panel[open] { padding-bottom: 4px; }
h3.form-group { grid-column: 1 / -1; margin: 18px 0 10px; padding-bottom: 6px; font-size: 15px; color: var(--ink); border-bottom: 2px solid #e3e9f2; }
.crud-form > .grid:first-of-type + h3.form-group, .crud-form h3.form-group:first-of-type { margin-top: 0; }
table.list td.empty { padding: 26px 16px; text-align: center; color: var(--muted); font-weight: 700; }

/* ---------- 文字リンクは使わない：画面の中のリンクと「link」のボタンは、全部ボタンの形にする ---------- */
.container a:not([class]):not(:has(img)), a.sub-link, a.danger, button.link,
.topbar .who .link {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px; vertical-align: middle;
  margin: 2px 4px 2px 0; padding: 5px 14px; font-size: 14px; font-weight: 700; line-height: 1.4; letter-spacing: 0;
  color: var(--ink); background: #fff; border: 1px solid var(--line-strong); border-radius: 8px;
  text-decoration: none; box-shadow: 0 1px 2px rgba(15, 35, 64, .05); cursor: pointer; white-space: nowrap;
  transition: transform .15s, box-shadow .15s, border-color .15s, color .15s, background-color .15s;
}
.container a:not([class]):not(:has(img)):hover, a.sub-link:hover, button.link:hover, .topbar .who .link:hover {
  color: #1662d6; border-color: #1662d6; text-decoration: none; background: #fff;
  transform: translateY(-1px); box-shadow: 0 4px 12px rgba(22, 98, 214, .18);
}
a.danger, button.link.danger, table.list td.actions button.link.danger, table.list td.actions a.danger {
  color: var(--danger); border-color: #efc4bf; background: #fff; opacity: 1; margin-left: 6px; font-size: 13px; text-decoration: none;
}
a.danger:hover, button.link.danger:hover, table.list td.actions button.link.danger:hover, table.list td.actions a.danger:hover {
  color: #fff; background: var(--danger); border-color: var(--danger); text-decoration: none;
  transform: translateY(-1px); box-shadow: 0 4px 12px rgba(180, 35, 24, .22);
}
table.list td.actions button.link:not(.danger), table.list td.actions a:not(.danger):not(.sub-link) { padding: 4px 12px; }
.flash a:not([class]) { color: var(--ink); }
small a:not([class]), .container small a:not([class]) { padding: 2px 10px; font-size: 12px; }
form.datebar a:not([class]) { margin: 0; }
.topbar .who form.inline { display: inline-flex; }
.topbar .who .link { margin: 0; padding: 4px 12px; font-size: 13px; }
/* ボタンの言葉が1文字ずつ折り返さないように */
.container a:not([class]), a.sub-link, a.danger, button, a.button-link, table.list td.actions { overflow-wrap: normal; word-break: keep-all; }
