:root {
  --bg: #f5f6f8; --card: #fff; --ink: #1f2933; --muted: #6b7680; --line: #dde1e6;
  --accent: #1f6feb; --ok: #1a7f37; --warn: #b35900; --err: #c62828; --consult: #8250df;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Yu Gothic UI", "Hiragino Sans", "Meiryo", sans-serif; font-size: 15px; line-height: 1.55; }
a { color: var(--accent); }
main { max-width: 1000px; margin: 0 auto; padding: 16px; }
.top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; padding: 10px 16px; background: #24324a; color: #fff; }
.top a { color: #dfe8ff; text-decoration: none; white-space: nowrap; }
.top .brand { font-weight: bold; color: #fff; font-size: 17px; }
.top nav { display: flex; flex-wrap: wrap; gap: 4px 14px; flex: 1; }
.top .who { display: flex; gap: 10px; align-items: center; font-size: 13px; }
.top .who button.link { color: #dfe8ff; }
h1 { font-size: 21px; margin: 6px 0 14px; }
h2 { font-size: 17px; margin: 22px 0 10px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; margin-bottom: 14px; }
.flash { padding: 9px 12px; border-radius: 6px; margin-bottom: 10px; }
.flash.ok { background: #e6f4ea; color: var(--ok); }
.flash.error { background: #fdecea; color: var(--err); }
.flash.warn { background: #fff4e0; color: var(--warn); }
table { width: 100%; border-collapse: collapse; background: var(--card); }
th, td { border-bottom: 1px solid var(--line); padding: 8px 6px; text-align: left; vertical-align: top; }
th { font-size: 13px; color: var(--muted); font-weight: normal; background: #fafbfc; }
td.num, th.num { text-align: right; white-space: nowrap; }
table.kv th { width: 9em; background: none; white-space: nowrap; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
.table-wrap table { border: 0; }
.muted { color: var(--muted); font-size: 13px; }
.small { font-size: 12px; }
.late { color: var(--err); font-size: 13px; font-weight: bold; }
.status { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; white-space: nowrap; font-weight: normal; vertical-align: middle; }
.st-draft { background: #eef0f3; color: #4a5560; }
.st-sent { background: #fff4e0; color: var(--warn); }
.st-opened { background: #e8effd; color: var(--accent); }
.st-consult { background: #f3edfd; color: var(--consult); }
.st-approved { background: #e6f4ea; color: var(--ok); }
.st-declined { background: #f1f1f1; color: #555; }
.st-expired { background: #fdecea; color: var(--err); }
.st-cancelled { background: #f1f1f1; color: #999; text-decoration: line-through; }
form.inline { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 3px; }
input[type=text], input[type=password], input[type=date], input[type=number], input[type=email], select, textarea {
  width: 100%; padding: 9px 10px; border: 1px solid #c4cad1; border-radius: 6px; font-size: 16px; font-family: inherit; background: #fff; }
textarea { min-height: 60px; }
.row { display: flex; flex-wrap: wrap; gap: 0 14px; }
.row > div { flex: 1 1 200px; }
.check { display: flex; align-items: center; gap: 6px; color: var(--ink); font-size: 15px; margin: 12px 0 0; }
.check input { width: 20px; height: 20px; flex: none; }
button, .btn { display: inline-block; padding: 9px 16px; border-radius: 6px; border: 1px solid var(--accent);
  background: var(--accent); color: #fff; font-size: 15px; cursor: pointer; text-decoration: none; font-family: inherit; }
button.sub, .btn.sub { background: #fff; color: var(--accent); }
button.danger { background: #fff; color: var(--err); border-color: var(--err); }
button.link { background: none; border: 0; padding: 0; color: var(--accent); font-size: inherit; text-decoration: underline; }
button.small, .btn.small { padding: 4px 10px; font-size: 13px; }
button:disabled { opacity: .5; cursor: default; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; align-items: center; }
.total { font-size: 20px; font-weight: bold; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.tabs a { padding: 6px 12px; border-radius: 6px; border: 1px solid var(--line); background: #fff; text-decoration: none; color: var(--ink); white-space: nowrap; }
.tabs a.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.cnt { display: inline-block; min-width: 20px; padding: 0 5px; border-radius: 9px; background: #e5484d; color: #fff; font-size: 12px; text-align: center; }
.tabs a.on .cnt { background: #fff; color: var(--accent); }
.search { display: flex; gap: 8px; margin-bottom: 12px; }
.search input { flex: 1; }
.copyrow { display: flex; gap: 8px; }
.copyrow input { flex: 1; font-family: Consolas, monospace; font-size: 13px; }
.login-box { max-width: 380px; margin: 60px auto; }
.answer, .c-done { border-radius: 8px; padding: 12px 16px; margin-bottom: 14px; border-left: 5px solid; background: #fff; }
.ans-approved { border-color: var(--ok); background: #e6f4ea; }
.ans-consult { border-color: var(--consult); background: #f3edfd; }
.ans-declined { border-color: #888; background: #f1f1f1; }
.ans-title { font-weight: bold; font-size: 17px; margin-bottom: 2px; }
.ans-comment { margin-top: 8px; padding: 8px 10px; background: #fff; border-radius: 6px; }
details code { display: block; white-space: pre-wrap; word-break: break-all; font-size: 11px; }
.list-mobile { display: none; }
@media (max-width: 640px) {
  .list-desktop { display: none; }
  .list-mobile { display: block; }
  .m-item { display: block; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; color: var(--ink); text-decoration: none; }
  .m-item .amt { float: right; font-weight: bold; }
  main { padding: 12px; }
}

/* ---- お客様の画面 ---- */
body.cust { background: #eef1f5; }
.c-top { background: #24324a; color: #fff; padding: 12px 16px; font-weight: bold; text-align: center; }
.c-main { max-width: 620px; padding: 16px; }
.c-card { background: #fff; border-radius: 12px; padding: 18px; margin-bottom: 14px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.c-card h1 { font-size: 20px; margin: 4px 0 6px; }
.c-card h2 { margin-top: 0; }
.c-amount { font-size: 30px; font-weight: bold; margin: 4px 0 10px; }
.c-amount small { font-size: 14px; font-weight: normal; color: var(--muted); margin-left: 4px; }
.c-pdf { display: block; text-align: center; margin: 14px 0 4px; padding: 12px; font-size: 16px; }
.c-msg { margin-top: 12px; padding: 10px 12px; background: #f7f8fa; border-radius: 8px; }
.choices { display: grid; gap: 10px; }
.choice { margin: 0; cursor: pointer; }
.choice input { position: absolute; opacity: 0; }
.choice span { display: block; padding: 15px; border: 2px solid var(--line); border-radius: 10px; text-align: center;
  font-size: 18px; font-weight: bold; color: var(--ink); background: #fff; }
.ch-approved input:checked + span { border-color: var(--ok); background: #e6f4ea; color: var(--ok); }
.ch-consult input:checked + span { border-color: var(--consult); background: #f3edfd; color: var(--consult); }
.ch-declined input:checked + span { border-color: #777; background: #f1f1f1; color: #444; }
.choice input:focus-visible + span { outline: 3px solid #9cc0ff; }
.c-send { width: 100%; margin-top: 14px; padding: 14px; font-size: 17px; border-radius: 10px; }
.c-contact { text-align: center; color: var(--muted); font-size: 13px; padding: 10px 0 30px; }
