[hidden] { display:none !important; }
.gonly[hidden] { display:none !important; }
:root { --fg:#1f2933; --muted:#667085; --line:#d0d5dd; --bg:#f5f6f8; --card:#fff; --accent:#2563eb; --warn:#b45309; --err:#c0262d; --ok:#15803d; }
* { box-sizing: border-box; }
body { margin:0; background:var(--bg); color:var(--fg); font-family:-apple-system,"Hiragino Sans","Yu Gothic UI","Meiryo",sans-serif; font-size:15px; line-height:1.5; }
.app { max-width:1100px; margin:0 auto; padding:16px; }
header { display:flex; justify-content:space-between; align-items:center; }
h1 { font-size:22px; margin:8px 0; }
h2 { font-size:16px; margin:0 0 10px; }
h3 { font-size:14px; margin:12px 0 4px; }
.privacy { background:#eef4ff; border:1px solid #c7d7fe; border-radius:8px; padding:8px 12px; margin:8px 0 12px; font-size:13px; }
.tabs { display:flex; gap:6px; border-bottom:2px solid var(--line); margin-bottom:12px; }
.tabs button { font-size:15px; padding:10px 16px; border:0; background:none; cursor:pointer; border-bottom:3px solid transparent; margin-bottom:-2px; color:var(--muted); }
.tabs button.on { color:var(--fg); font-weight:700; border-color:var(--accent); }
.card { background:var(--card); border:1px solid var(--line); border-radius:10px; padding:14px 16px; margin-bottom:12px; }
.cols { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
@media (max-width:760px) { .cols { grid-template-columns:1fr; } }
.row { display:flex; flex-wrap:wrap; gap:12px; margin-bottom:8px; }
.row > label { flex:1 1 150px; }
label { display:block; font-weight:600; font-size:13px; }
label.inline { font-weight:400; margin:6px 0; }
label.file { padding:10px; border:2px dashed var(--line); border-radius:8px; }
input, select { font:inherit; padding:6px 8px; width:100%; border:1px solid var(--line); border-radius:6px; margin-top:3px; background:#fff; }
input[type=checkbox] { width:auto; margin-right:6px; }
input[type=file] { border:0; padding:4px 0; }
button { font:inherit; padding:8px 14px; border:1px solid var(--line); border-radius:8px; background:#fff; cursor:pointer; }
button.primary { background:var(--accent); color:#fff; border-color:var(--accent); }
button.danger { color:var(--err); }
button.link { border:0; background:none; color:var(--accent); padding:0; text-decoration:underline; }
button:disabled { opacity:.5; cursor:default; }
.actions { display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin-top:10px; }
.hint { color:var(--muted); font-size:12.5px; margin:4px 0; }
.info { margin-top:10px; padding:10px; background:#fafbfc; border:1px solid var(--line); border-radius:8px; }
.warn { color:var(--warn); font-size:13.5px; padding-left:20px; }
.err { color:var(--err); font-weight:600; }
.ok { color:var(--ok); font-weight:600; }
.summary { font-size:15px; font-weight:600; }
.tablewrap { overflow-x:auto; }
table { border-collapse:collapse; width:100%; font-size:13.5px; }
th, td { border:1px solid var(--line); padding:3px 6px; text-align:left; vertical-align:top; }
th { background:#f2f4f7; white-space:nowrap; }
td input, td select { margin:0; padding:3px 5px; border-color:transparent; background:transparent; }
td input:focus, td select:focus { border-color:var(--accent); background:#fff; }
td.num, th.num { text-align:right; }
td.num input { text-align:right; }
#t-table td:nth-child(1) { width:34px; text-align:center; color:var(--muted); }
#t-table td:last-child { width:34px; text-align:center; }
#t-table td button { padding:0 6px; border:0; color:var(--err); font-size:16px; }
#t-table input { min-width:70px; }
#t-table td:nth-child(3) input { min-width:150px; }
tr.flag td { background:#fff7ed; }
#c-findings td:first-child { white-space:nowrap; }
.tag { display:inline-block; background:#fff1e6; color:var(--warn); border-radius:4px; padding:0 6px; font-size:12px; font-weight:700; }
#gate { position:fixed; inset:0; background:var(--bg); display:flex; align-items:center; justify-content:center; z-index:10; }
#gate[hidden] { display:none; }
.gate-box { background:#fff; border:1px solid var(--line); border-radius:12px; padding:28px 36px; text-align:center; }

/* 申請・承認 */
.badge { display:inline-block; border-radius:10px; padding:0 9px; font-size:12px; font-weight:700; white-space:nowrap; }
.st-pending { background:#fff4d6; color:#8a5a00; }
.st-approved { background:#dcf5e3; color:#126a35; }
.st-returned { background:#fde4e4; color:#a1212a; }
.st-withdrawn { background:#e8eaee; color:#566; }
.card.sub { background:#fafbfc; }
.attlist { margin:6px 0 0; padding-left:20px; font-size:13.5px; }
.detail-head { display:flex; justify-content:space-between; align-items:center; }
.history { margin:4px 0 10px; padding-left:20px; font-size:13.5px; }
dialog#a-dialog { width:min(920px,96vw); max-height:94vh; border:1px solid var(--line); border-radius:12px; padding:16px; overflow:auto; }
dialog#a-dialog::backdrop { background:rgba(0,0,0,.4); }
.docview { background:#e9ecf1; padding:10px; border-radius:8px; max-height:70vh; overflow:auto; }
.doc-page { position:relative; background:#fff; color:#000; width:min(794px,100%); margin:0 auto 12px; padding:12mm; box-shadow:0 1px 4px rgba(0,0,0,.25); font-size:10pt; }
.doc-page.media { padding:0; }
.doc-page canvas, .doc-page img:not(.stamp) { width:100%; height:auto; display:block; }
.doc-page h1 { text-align:center; font-size:15pt; margin:0 0 6mm; }
.doc-page .meta { margin-left:auto; width:60%; margin-bottom:5mm; }
.doc-page .meta div { display:flex; border-bottom:1px solid #000; padding:1mm 0; }
.doc-page .meta b { width:22mm; font-weight:400; }
.doc-page table { font-size:9.5pt; }
.doc-page th, .doc-page td { border:1px solid #000; padding:1.2mm 1.6mm; }
.doc-page td.num { text-align:right; }
.doc-page .sum { width:55%; margin:6mm 0 0 auto; }
.doc-page .receipt { margin-top:8mm; border:1px solid #000; height:60mm; padding:2mm; }
.stamp { position:absolute; aspect-ratio:1; pointer-events:none; user-select:none; mix-blend-mode:multiply; }
.stamp.mine { pointer-events:auto; cursor:grab; outline:1px dashed var(--accent); touch-action:none; }

/* 印刷（PDF出力）: 交通費精算書の様式だけを A4 縦で出す */
#print-sheet { display:none; }
@media print {
  @page { size:A4 portrait; margin:12mm; }
  body { background:#fff; }
  .app, #gate { display:none !important; }
  #print-sheet { display:block; color:#000; font-size:10pt; }
  #print-sheet h1 { text-align:center; font-size:15pt; margin:0 0 6mm; }
  #print-sheet .meta { margin-left:auto; width:60%; margin-bottom:5mm; }
  #print-sheet .meta div { display:flex; border-bottom:1px solid #000; padding:1mm 0; }
  #print-sheet .meta b { width:22mm; font-weight:400; }
  #print-sheet table { font-size:9.5pt; }
  #print-sheet th, #print-sheet td { border:1px solid #000; padding:1.2mm 1.6mm; }
  #print-sheet th { background:#eee; -webkit-print-color-adjust:exact; print-color-adjust:exact; }
  #print-sheet td.num { text-align:right; }
  #print-sheet .sum { width:55%; margin:6mm 0 0 auto; }
  #print-sheet .receipt { margin-top:8mm; border:1px solid #000; height:60mm; padding:2mm; }
  #print-sheet tr { break-inside:avoid; }
  #print-sheet .doc-page { width:100%; margin:0; padding:0; box-shadow:none; break-after:page; }
  #print-sheet .doc-page.media { page-break-after:always; }
  #print-sheet .stamp { mix-blend-mode:multiply; }
}

.icoca { margin:8px 0; }
.icoca summary { cursor:pointer; }
.icoca textarea { width:100%; box-sizing:border-box; margin:6px 0; font:inherit; }

.tip { position:relative; display:inline-block; margin-left:4px; width:1.4em; height:1.4em; line-height:1.4em; text-align:center; border-radius:50%; background:var(--accent, #1a73e8); color:#fff; font-size:.8em; cursor:help; }
.tip::after { content:attr(data-tip); position:absolute; left:50%; bottom:130%; transform:translateX(-50%); width:20em; max-width:80vw; padding:8px 10px; border-radius:6px; background:#333; color:#fff; font-size:12px; line-height:1.5; text-align:left; white-space:normal; display:none; z-index:20; }
.tip:hover::after, .tip:focus::after { display:block; }

.deptsel summary { cursor:pointer; }
.deptsel[open] { padding:4px 0; }
