/* JPAL partner UI — follows UI MASTER 02–05: navy sidebar, white top bar with the official logo,
   light sky-blue page, white cards, blue primary buttons, gold accent. Brand: Navy / Blue / Gold / White. */
:root {
  --navy: #0b2453;
  --navy-2: #12336f;
  --blue: #1f5eff;
  --blue-soft: #e8efff;
  --gold: #c9a24a;
  --bg: #eef4fc;
  --card: #ffffff;
  --text: #13213b;
  --muted: #5a6b86;
  --line: #dde6f3;
  --ok: #138a4b;
  --ok-soft: #e3f6ec;
  --warn: #b26b00;
  --warn-soft: #fff3dc;
  --ng: #c0282d;
  --ng-soft: #fde8e8;
  --na: #6b7790;
  --na-soft: #eef1f6;
  --radius: 12px;
  --shadow: 0 2px 10px rgba(16, 42, 92, 0.07);
  --font: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", "Meiryo", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; line-height: 1.65; }
a { color: var(--blue); }
button, input, select { font: inherit; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---- shell ---- */
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); grid-template-rows: 64px minmax(0, 1fr); min-height: 100%; }
.topbar { grid-column: 1 / -1; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 20px; padding: 0 20px; position: sticky; top: 0; z-index: 10; }
.topbar .logo { height: 44px; width: auto; display: block; }
.topbar form { flex: 1; max-width: 620px; display: flex; align-items: center; gap: 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 4px 6px 4px 16px; }
.topbar form input { border: 0; background: transparent; flex: 1; min-width: 0; padding: 6px 0; color: var(--text); }
.topbar form input:focus-visible { outline: none; }
.topbar form:focus-within { outline: 3px solid var(--blue); outline-offset: 1px; }
.topbar form button { border: 0; background: var(--blue); color: #fff; border-radius: 999px; padding: 6px 14px; cursor: pointer; }
.who { margin-left: auto; text-align: right; line-height: 1.3; }
.who strong { display: block; font-size: 14px; }
.who span { font-size: 12px; color: var(--muted); }
.side { background: var(--navy); color: #dfe8ff; padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 64px; height: calc(100vh - 64px); overflow-y: auto; }
.side a { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 10px; color: inherit; text-decoration: none; font-weight: 600; }
.side a:hover { background: var(--navy-2); }
.side a[aria-current="page"] { background: var(--blue); color: #fff; }
.side a .soon { margin-left: auto; font-size: 10px; font-weight: 600; background: rgba(255,255,255,0.14); padding: 1px 6px; border-radius: 6px; }
.side .sep { border-top: 1px solid rgba(255,255,255,0.12); margin: 10px 4px; }
.side .label { font-size: 12px; color: #9fb2da; padding: 4px 14px; }
.side .mascot { margin-top: auto; background: linear-gradient(180deg, #1c3d80, #12306a); border-radius: var(--radius); padding: 14px; text-align: center; }
.side .mascot img { width: 120px; height: auto; display: block; margin: 0 auto 6px; }
.side .mascot p { margin: 0; font-size: 13px; color: #fff; font-weight: 600; }
.side .logout { margin-top: 10px; background: transparent; border: 1px solid rgba(255,255,255,0.25); color: #dfe8ff; border-radius: 10px; padding: 8px; cursor: pointer; }
.ico { width: 20px; height: 20px; flex: none; }
main { padding: 24px 28px 64px; min-width: 0; }
.bottomnav { display: none; }

/* ---- common ---- */
h1 { font-size: 28px; margin: 0 0 6px; color: var(--navy); letter-spacing: 0.01em; text-wrap: balance; }
h2 { font-size: 18px; margin: 0 0 12px; color: var(--navy); }
.lead { color: var(--muted); margin: 0 0 20px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; min-width: 0; }
.grid { display: grid; gap: 16px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 10px; padding: 11px 18px; font-weight: 700; cursor: pointer; text-decoration: none; }
.btn.primary { background: var(--blue); color: #fff; }
.btn.ghost { background: #fff; color: var(--blue); border: 1px solid #b9cdfd; }
.btn[disabled] { opacity: 0.55; cursor: default; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.empty { padding: 28px; text-align: center; color: var(--muted); }
.notice { background: var(--blue-soft); border: 1px solid #c9d8ff; border-radius: 10px; padding: 10px 14px; font-size: 13px; color: var(--navy); }
.error { color: var(--ng); }
.tag { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 6px; background: var(--blue-soft); color: var(--blue); margin: 0 4px 4px 0; }

/* ---- home ---- */
.hero { position: relative; background: linear-gradient(110deg, #ffffff 0%, #eaf2ff 60%, #d9e7ff 100%); border: 1px solid var(--line); border-radius: 16px; padding: 28px 30px; overflow: hidden; margin-bottom: 20px; }
.hero h1 { font-size: 30px; }
.hero h1 b { color: var(--navy); }
.hero p { margin: 4px 0 0; color: var(--muted); max-width: 34em; }
.hero img { position: absolute; right: 24px; bottom: -6px; width: 170px; height: auto; }
.quick { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 20px; }
.qcard { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--text); }
.qcard .qi { width: 48px; height: 48px; border-radius: 12px; background: var(--blue); color: #fff; display: grid; place-items: center; flex: none; }
.qcard strong { display: block; font-size: 16px; }
.qcard span { font-size: 12px; color: var(--muted); }
.qcard.soon { opacity: 0.6; }
.two { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
.cats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.cat { border: 1px solid var(--line); border-radius: 10px; padding: 14px; text-align: center; text-decoration: none; color: var(--text); }
.cat strong { display: block; }
.cat span { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.list .t { flex: 1; min-width: 0; }
.list .t strong { display: block; font-size: 14px; overflow-wrap: anywhere; }

/* ---- products ---- */
.tabs { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs button { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 18px; cursor: pointer; font-weight: 600; color: var(--text); }
.tabs button[aria-pressed="true"] { background: var(--blue); border-color: var(--blue); color: #fff; }
.filters { display: grid; grid-template-columns: minmax(0, 2fr) repeat(4, minmax(0, 1fr)); gap: 10px; align-items: end; margin-bottom: 16px; }
.filters label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.filters input, .filters select { padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--text); width: 100%; }
.checks { display: flex; gap: 16px; flex-wrap: wrap; margin: -6px 0 16px; font-size: 14px; }
.checks label { display: flex; align-items: center; gap: 6px; }
.results-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.results-head strong { font-size: 18px; font-variant-numeric: tabular-nums; }
.pgrid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.pcard { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--text); padding: 14px; }
.pcard .thumb { height: 110px; border-radius: 10px; background: linear-gradient(160deg, #f4f8ff, #e2ebfb); display: grid; place-items: center; color: var(--navy); position: relative; }
.pcard .thumb .size { position: absolute; right: 10px; bottom: 6px; font-size: 22px; font-weight: 800; color: var(--navy); font-variant-numeric: tabular-nums; }
.pcard .maker { font-size: 12px; color: var(--muted); }
.pcard strong { font-size: 16px; overflow-wrap: anywhere; }
.price { font-size: 18px; font-weight: 800; color: var(--ng); font-variant-numeric: tabular-nums; }
.price small { font-size: 12px; color: var(--muted); font-weight: 600; }
.price.none { font-size: 13px; color: var(--muted); font-weight: 600; }
.pager { display: flex; gap: 10px; justify-content: center; margin-top: 18px; }

/* ---- detail ---- */
.detail { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: start; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.crumbs a { text-decoration: none; }
.actions { display: grid; gap: 10px; margin: 14px 0; }
table.specs { width: 100%; border-collapse: collapse; font-size: 14px; }
table.specs th, table.specs td { border-top: 1px solid var(--line); padding: 9px 6px; text-align: left; vertical-align: top; }
table.specs th { width: 34%; color: var(--muted); font-weight: 600; }
table.specs td { overflow-wrap: anywhere; }
.state { display: inline-block; font-size: 11px; border-radius: 6px; padding: 0 6px; margin-left: 6px; font-weight: 700; white-space: nowrap; }
.state.VERIFIED { background: var(--ok-soft); color: var(--ok); }
.state.UNVERIFIED { background: var(--na-soft); color: var(--na); }
.state.NOT_REGISTERED { background: var(--warn-soft); color: var(--warn); }
.tablewrap { overflow-x: auto; }

/* ---- signfit ---- */
.steps { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.steps div { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px 14px; font-weight: 600; }
.steps b { width: 26px; height: 26px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-size: 13px; }
.steps div.on b { background: var(--blue); }
.picker { display: grid; gap: 8px; }
.picker ul { list-style: none; margin: 0; padding: 0; max-height: 260px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; }
.picker li button { width: 100%; text-align: left; background: #fff; border: 0; border-top: 1px solid var(--line); padding: 9px 12px; cursor: pointer; }
.picker li:first-child button { border-top: 0; }
.picker li button:hover { background: var(--blue-soft); }
.chosen { display: flex; align-items: center; gap: 10px; background: var(--blue-soft); border-radius: 10px; padding: 10px 12px; }
.badge { display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 8px; border-radius: 8px; font-weight: 800; font-size: 15px; flex: none; }
.badge.A, .badge.B { background: var(--ok-soft); color: var(--ok); }
.badge.C { background: var(--warn-soft); color: var(--warn); }
.badge.D { background: var(--ng-soft); color: var(--ng); }
.badge.U { background: var(--na-soft); color: var(--na); }
.counts { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; font-size: 13px; }
.counts span { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 2px 10px; font-variant-numeric: tabular-nums; }
.check { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.check:first-child { border-top: 0; }
.res { font-size: 12px; font-weight: 800; border-radius: 6px; padding: 2px 8px; text-align: center; align-self: start; }
.res.OK { background: var(--ok-soft); color: var(--ok); }
.res.NG { background: var(--ng-soft); color: var(--ng); }
.res.UNRESOLVED { background: var(--warn-soft); color: var(--warn); }
.res.NOT_CHECKED, .res.NOT_APPLICABLE { background: var(--na-soft); color: var(--na); }
.check p { margin: 0; overflow-wrap: anywhere; }
.check .src { font-size: 12px; color: var(--muted); }

/* ---- responsive ---- */
@media (max-width: 1100px) {
  .quick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two, .detail { grid-template-columns: minmax(0, 1fr); }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters label:first-child { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .side { display: none; }
  .topbar { flex-wrap: wrap; padding: 8px 14px; gap: 8px; }
  .topbar .logo { height: 36px; }
  .topbar form { order: 3; flex-basis: 100%; max-width: none; }
  .who span { display: none; }
  main { padding: 16px 16px 90px; }
  h1, .hero h1 { font-size: 22px; }
  .hero { padding: 20px 16px 110px; }
  .hero img { width: 110px; right: 12px; }
  .quick, .cats { grid-template-columns: minmax(0, 1fr); }
  .bottomnav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px)); z-index: 20; }
  .bottomnav a { display: grid; justify-items: center; gap: 2px; font-size: 11px; color: var(--muted); text-decoration: none; }
  .bottomnav a[aria-current="page"] { color: var(--blue); font-weight: 700; }
  .check { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---- login / invite ---- */
.auth { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; background: linear-gradient(160deg, #f6f9ff, #dfeaff); }
.auth .card { width: 100%; max-width: 420px; display: grid; gap: 14px; padding: 28px; }
.auth .logo { width: 220px; height: auto; margin: 0 auto 4px; display: block; }
.auth label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.auth input { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); }
.auth h1 { font-size: 20px; text-align: center; }
.msg { min-height: 1.4em; font-size: 13px; margin: 0; }
.msg.error { color: var(--ng); }

/* ---- product entry / LED guide ---- */
.mt24 { margin-top: 24px; }
.m0 { margin: 0; }
h3 { font-size: 16px; margin: 0 0 6px; color: var(--navy); }
.uses { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { background: #fff; border: 1px solid #b9cdfd; color: var(--blue); border-radius: 999px; padding: 8px 18px; font-weight: 700; text-decoration: none; font-variant-numeric: tabular-nums; }
.chip:hover { background: var(--blue-soft); }
.pcard .thumb .pick { position: absolute; left: 8px; top: 8px; background: var(--gold); color: #fff; font-size: 11px; font-weight: 800; border-radius: 6px; padding: 1px 8px; }
.led-hero { background: linear-gradient(110deg, #0b2453 0%, #163d86 55%, #1f5eff 100%); border: 0; color: #fff; padding-right: 220px; }
.led-hero h1, .led-hero h1 b { color: #fff; }
.led-hero h1 b { color: #ffd77a; }
.led-hero p { color: #dbe6ff; }
.hero-actions { margin-top: 16px; display: flex; gap: 10px; flex-wrap: wrap; }
.three { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 8px; }
.types { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ltype { display: grid; gap: 8px; align-content: start; }
.lhead { display: flex; align-items: center; gap: 8px; color: var(--navy); }
.lhead .tag { margin: 0 0 0 auto; background: var(--warn-soft); color: var(--warn); }
.flow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.flow li { display: grid; gap: 4px; align-content: start; }
.flow .num { width: 28px; height: 28px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center; }
.hearing { margin: 0 0 12px; padding-left: 1.2em; display: grid; gap: 4px; }
@media (max-width: 1100px) { .uses, .three, .types { grid-template-columns: repeat(2, minmax(0, 1fr)); } .flow { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .uses, .three, .types, .flow { grid-template-columns: minmax(0, 1fr); } .led-hero { padding-right: 16px; } }

/* ---- requests / admin ---- */
.rstatus { display: inline-block; font-size: 12px; font-weight: 800; border-radius: 6px; padding: 1px 8px; white-space: nowrap; }
.rstatus.NEW { background: var(--blue-soft); color: var(--blue); }
.rstatus.IN_PROGRESS { background: var(--warn-soft); color: var(--warn); }
.rstatus.ANSWERED { background: var(--ok-soft); color: var(--ok); }
.rstatus.CLOSED { background: var(--na-soft); color: var(--na); }
.reqform { display: grid; gap: 12px; max-width: 760px; }
.reqform label, .reply, .inline label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.reqform input, .reqform textarea, .reply textarea, .inline input, .picker input { font: inherit; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: #fff; width: 100%; }
.qty { width: 80px !important; }
.hits { list-style: none; margin: 0; padding: 0; }
.hits button { width: 100%; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-top: 4px; cursor: pointer; }
.hits button:hover { background: var(--blue-soft); }
.bubble { border-radius: 12px; padding: 10px 14px; margin-top: 10px; max-width: 92%; }
.bubble p { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble.jp { background: var(--blue-soft); }
.bubble.pt { background: #f5f7fb; margin-left: auto; }
.reply { margin-top: 14px; }
.inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin-top: 12px; }
.inline > label { flex: 1 1 240px; }
.inline input { flex: 1 1 180px; width: auto; }

/* ---- attachments ---- */
.files { margin-top: 16px; display: grid; gap: 8px; }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.thumbs img { width: 96px; height: 96px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); display: block; }
.thumbs .pdf { display: inline-block; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; }
.upload { position: relative; overflow: hidden; justify-self: start; }
.upload input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.priceform { display: grid; gap: 10px; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; margin-bottom: 16px; }
.priceform h2, .priceform p { grid-column: 1 / -1; }
.priceform label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.priceform input { font: inherit; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; }
@media (max-width: 760px) { .priceform { grid-template-columns: minmax(0, 1fr); } }

.linkbox { width: 100%; margin: 6px 0; font-size: 12px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; }

/* ---- chat (UI MASTER 03) / home ask box ---- */
.askbox { display: flex; gap: 8px; margin-top: 16px; max-width: 640px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 6px; box-shadow: var(--shadow); }
.askbox input { flex: 1; min-width: 0; border: 0; padding: 8px 10px; font: inherit; color: var(--text); }
.askbox input:focus-visible { outline: none; }
.askbox:focus-within { outline: 3px solid var(--blue); outline-offset: 1px; }
.chat-hero { padding-right: 200px; }
.chatgrid { grid-template-columns: minmax(0, 1fr) 300px; align-items: start; margin-top: 14px; }
.chatcard { display: grid; gap: 10px; padding: 0; overflow: hidden; }
.chatlog { min-height: 360px; max-height: 62vh; overflow-y: auto; padding: 16px; display: grid; gap: 12px; align-content: start; }
.cmsg { display: flex; gap: 10px; align-items: flex-start; }
.cmsg.user { justify-content: flex-end; }
.cmsg .avatar { width: 40px; height: 34px; object-fit: contain; flex: none; }
.cbody { max-width: 88%; min-width: 0; display: grid; gap: 10px; }
.cmsg.assistant .cbody { background: #fff; border: 1px solid var(--line); border-radius: 4px 14px 14px 14px; padding: 10px 14px; }
.cmsg.user .cbody { background: var(--blue-soft); border-radius: 14px 4px 14px 14px; padding: 10px 14px; }
.cbody p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.cbody .pgrid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.chatbar { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); background: #fafcff; }
.chatbar input { flex: 1; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; }
.conds { position: sticky; top: 80px; }
@media (max-width: 1100px) { .chatgrid { grid-template-columns: minmax(0, 1fr); } .conds { position: static; } }
@media (max-width: 760px) { .chat-hero { padding-right: 16px; } .askbox { flex-direction: column; } }
