:root { --fg: #1b1f24; --muted: #5d6670; --line: #d7dde3; --bg: #f3f5f7; --card: #fff; --pri: #1f5fbf; --pri-d: #174a96; --ok: #1c7c3a; --err: #b3261e; --warn: #a35a00; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: system-ui, -apple-system, "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", Meiryo, sans-serif; font-size: 17px; line-height: 1.6; color: var(--fg); background: var(--bg); }
a { color: var(--pri); }
main { max-width: 960px; margin: 0 auto; padding: 12px; }
.top { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: #123a73; color: #fff; }
.top .brand { color: #fff; font-weight: 700; text-decoration: none; font-size: 18px; }
.top .me { margin-left: auto; font-size: 14px; }
.top .link { color: #fff; }
.nav, .subnav { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px 10px; background: #fff; border-bottom: 1px solid var(--line); }
.nav a, .subnav a { padding: 8px 12px; border-radius: 8px; text-decoration: none; color: var(--fg); font-size: 15px; }
.nav a.on, .subnav a.on { background: #e3ecfa; color: var(--pri-d); font-weight: 600; }
.subnav { margin: -12px -12px 12px; }
.devbanner { background: #ffe9a8; color: #5c4400; text-align: center; font-size: 13px; padding: 4px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin: 0 0 14px; }
.card.center { text-align: center; max-width: 480px; margin: 40px auto; }
.card.action { border: 2px solid var(--pri); }
h1 { font-size: 21px; margin: 0 0 10px; }
h2 { font-size: 18px; margin: 0 0 8px; }
h3 { font-size: 16px; margin: 14px 0 6px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 8px 16px; border: 1px solid #b7c1cc; border-radius: 10px; background: #fff; color: var(--fg); font-size: 16px; text-decoration: none; cursor: pointer; }
.btn:hover { background: #f1f4f8; }
.btn.primary { background: var(--pri); border-color: var(--pri); color: #fff; font-weight: 600; }
.btn.primary:hover { background: var(--pri-d); }
.btn.danger { color: var(--err); border-color: #e0a9a5; }
.btn.warn { color: var(--warn); border-color: #e4c08d; }
.btn.big { min-height: 54px; font-size: 18px; padding: 10px 22px; }
.btn.block { display: flex; width: 100%; }
.btn.small { min-height: 34px; padding: 4px 10px; font-size: 14px; }
.btn:disabled { opacity: .55; cursor: wait; }
button.link { background: none; border: 0; padding: 0; color: var(--pri); cursor: pointer; font-size: 14px; text-decoration: underline; }
button.link.danger { color: var(--err); }
.mini { border: 1px solid var(--line); background: #fff; border-radius: 6px; min-width: 30px; min-height: 30px; margin-left: 4px; cursor: pointer; font-size: 14px; }
.mini.danger { color: var(--err); }
.inline { display: inline; }
form.inline button { margin: 2px; }
.field { display: block; margin: 0 0 14px; font-weight: 600; }
.field input:not([type=checkbox]):not([type=radio]), .field select, .field textarea, .row input, .row select, input[type=search] { display: block; width: 100%; margin-top: 4px; font: inherit; font-weight: 400; padding: 10px 12px; border: 1px solid #b7c1cc; border-radius: 8px; background: #fff; }
fieldset.field { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
fieldset.field legend { padding: 0 6px; }
fieldset.field input[type=time], fieldset.field input[type=number] { display: inline-block; width: auto; }
.req { font-size: 12px; color: #fff; background: var(--err); border-radius: 4px; padding: 0 5px; margin-left: 4px; font-weight: 400; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 400; margin: 6px 0; min-height: 36px; }
.check input { width: 22px; height: 22px; }
.radio { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 8px; font-weight: 400; }
.radio input { width: 20px; height: 20px; vertical-align: middle; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 6px 0; }
.row input, .row select { width: auto; flex: 1 1 160px; display: inline-block; margin: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.actions.sticky { position: sticky; bottom: 0; background: #fff; padding: 10px 0; border-top: 1px solid var(--line); margin-top: 10px; }
.save-state { margin-right: auto; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.ok { color: var(--ok); font-weight: 600; }
.err { color: var(--err); }
.notice { background: #fff6df; border: 1px solid #f0d58a; border-radius: 8px; padding: 8px 10px; }
.flash { border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; font-weight: 600; }
.flash.ok { background: #e4f4e8; color: var(--ok); border: 1px solid #b6dfc0; }
.flash.error { background: #fbe9e7; color: var(--err); border: 1px solid #f0bcb7; }
.badge { display: inline-block; font-size: 13px; padding: 1px 8px; border-radius: 999px; background: #e9edf1; color: #39424c; margin-right: 4px; white-space: nowrap; }
.badge.green { background: #dff2e4; color: #17602e; } .badge.red { background: #fbe1de; color: #9c1f18; } .badge.orange { background: #fdebd2; color: #8a4a00; }
.badge.blue { background: #e1ebfb; color: #1a4f9e; } .badge.purple { background: #ece4f9; color: #5a2f9b; } .badge.teal { background: #dcf1ef; color: #145f58; } .badge.gray { background: #eceff2; color: #4c5660; }
.tabs { display: flex; gap: 6px; margin-bottom: 12px; overflow-x: auto; }
.tab { flex: 1 0 auto; text-align: center; padding: 10px 12px; border-radius: 10px; background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--fg); font-weight: 600; font-size: 15px; }
.tab.on { background: var(--pri); color: #fff; border-color: var(--pri); }
.count { display: inline-block; margin-left: 6px; min-width: 24px; padding: 0 6px; border-radius: 999px; background: rgba(0,0,0,.08); font-size: 13px; }
.count.hot { background: #d93025; color: #fff; }
.cases { list-style: none; margin: 0; padding: 0; }
.cases li a { display: block; padding: 12px 6px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--fg); }
.cases li a:hover { background: #f7f9fb; }
.cases .row1, .row1 { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: 14px; }
.no { font-family: ui-monospace, Consolas, monospace; color: var(--muted); margin-right: 4px; }
.ttl { font-weight: 700; font-size: 17px; margin: 2px 0; }
.meta { font-size: 14px; color: var(--muted); }
.due { color: var(--warn); font-weight: 600; }
.empty { color: var(--muted); text-align: center; padding: 20px 0; }
.choice { display: grid; gap: 12px; }
.choice-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 18px; border: 2px solid var(--line); border-radius: 12px; background: #fff; font: inherit; text-align: left; cursor: pointer; }
.choice-btn strong { font-size: 20px; color: var(--pri-d); }
.choice-btn:hover { border-color: var(--pri); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 8px 0; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }
.body { white-space: normal; word-break: break-word; margin: 12px 0; padding: 12px; background: #fafbfc; border-radius: 8px; border: 1px solid #eef1f4; }
.atts { list-style: none; padding: 0; margin: 6px 0; }
.att { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.att > div { flex: 1; }
.thumb { width: 72px; height: 72px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.upload-btns { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.up-line { font-size: 14px; padding: 4px 0; }
.up-st.ok { color: var(--ok); } .up-st.err { color: var(--err); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; align-items: center; }
.chip { display: inline-flex; align-items: center; padding: 4px 6px 4px 10px; border-radius: 999px; background: #e3ecfa; font-size: 15px; }
.chip.org { background: #dcf1ef; } .chip.all { background: #fdebd2; font-weight: 600; } .chip.bad { background: #fbe1de; color: var(--err); }
.popts details, .pick-people { margin: 6px 0; }
summary { cursor: pointer; padding: 6px 0; color: var(--pri-d); font-weight: 600; }
.plist { list-style: none; padding: 0; margin: 6px 0; max-height: 320px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; }
.pitem { display: flex; justify-content: space-between; width: 100%; padding: 10px 12px; border: 0; border-bottom: 1px solid #eef1f4; background: #fff; font: inherit; text-align: left; cursor: pointer; min-height: 44px; }
.pitem.sel { background: #e3ecfa; font-weight: 600; }
.pdept { color: var(--muted); font-size: 13px; }
.stage-edit { border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin: 8px 0; }
.stages { padding-left: 0; list-style: none; }
.stage { border-left: 4px solid var(--line); padding: 4px 10px; margin: 8px 0; }
.stage.active { border-color: #f0a33a; } .stage.done { border-color: #3aa35a; } .stage.returned, .stage.rejected { border-color: #d93025; }
.stage ul { list-style: none; padding-left: 8px; margin: 4px 0; }
.tbl { width: 100%; border-collapse: collapse; font-size: 15px; }
.tbl th, .tbl td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { background: #f6f8fa; font-weight: 600; }
.log { padding-left: 18px; font-size: 14px; }
.comments { list-style: none; padding: 0; }
.comments li { border-bottom: 1px solid var(--line); padding: 8px 0; }
.comments li.deleted { opacity: .7; }
.inline-details { display: inline-block; }
.inline-details[open] { display: block; background: #f9fafb; padding: 6px; border-radius: 8px; }
.revs a, .revs b { margin-right: 8px; }
code.wrap { white-space: pre-wrap; word-break: break-all; font-size: 12px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 12px; align-items: end; }
.list { list-style: none; padding: 0; }
.list li { margin: 6px 0; }
.tpl { border-bottom: 1px solid var(--line); padding: 8px 0; }
.group { border-bottom: 1px solid var(--line); padding: 6px 0; }
@media (max-width: 640px) {
  body { font-size: 17px; }
  main { padding: 8px; }
  .card { padding: 12px; border-radius: 10px; }
  .kv { grid-template-columns: 1fr; } .kv dt { margin-top: 6px; }
  .tbl { font-size: 14px; }
  .tbl thead { display: none; }
  .tbl tr { display: block; border-bottom: 2px solid var(--line); padding: 6px 0; }
  .tbl td { display: block; border: 0; padding: 2px 4px; }
  .actions .btn { flex: 1 1 auto; }
  .subnav { overflow-x: auto; flex-wrap: nowrap; }
  .subnav a { white-space: nowrap; }
}
:focus-visible { outline: 3px solid #f0a33a; outline-offset: 2px; }
