:root {
  --navy: #0f2647;
  --navy-2: #1c3a63;
  --red: #c8102e;
  --text: #1b2a3a;
  --muted: #5b6b7d;
  --rule: #c5cdd8;
  --head: #e8edf3;
  --bg-soft: #f4f6f9;
  --ok: #1d6b3a;
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", "Meiryo", sans-serif;
  color: var(--text);
  line-height: 1.8;
  letter-spacing: .02em;
}
* { box-sizing: border-box; }
body { margin: 0; background: #fff; }
a { color: var(--navy); }
[hidden] { display: none !important; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* ---------------------------------------------------------------- header */
.site-header { border-bottom: 1px solid var(--rule); background: #fff; position: sticky; top: 0; z-index: 10; }
.site-header .wrap { max-width: 1320px; }
.header-inner { display: flex; align-items: center; gap: 24px; min-height: 72px; position: relative; }
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; flex-shrink: 0; white-space: nowrap; }
.logo-mark { width: 40px; height: 32px; flex-shrink: 0; }
.logo-text { font-size: 1.55rem; font-weight: 800; color: var(--navy); letter-spacing: 0; line-height: 1.2; }
.logo-tld { color: var(--red); }
.header-menu { display: flex; align-items: center; gap: 24px; margin-left: auto; min-width: 0; }
.header-nav { display: flex; align-items: center; gap: 22px; }
.header-nav a { color: var(--text); text-decoration: none; font-size: .92rem; white-space: nowrap; line-height: 1.4; }
.header-nav a:hover { color: var(--navy); text-decoration: underline; }
.account { display: flex; align-items: center; gap: 14px; font-size: .85rem; color: var(--muted); white-space: nowrap; min-width: 0; }
.account:empty { display: none; }
.account > * { white-space: nowrap; line-height: 1.4; }
.account > span:first-child { max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
.account .free { color: var(--navy); font-weight: 700; }
.account .btn-link { padding: 4px 2px; }
.menu-toggle { display: none; }

/* not enough room for the address: leave it out of the one-line header */
@media (max-width: 1239px) {
  .account > span:first-child { display: none; }
}

/* narrow screens: links and account fold into a menu opened by the button */
@media (max-width: 1079px) {
  .header-inner { min-height: 60px; gap: 12px; }
  .logo-text { font-size: 1.35rem; }
  .menu-toggle { display: inline-flex; align-items: center; justify-content: center; margin-left: auto; width: 44px; height: 44px;
    padding: 0; border: 1px solid var(--rule); border-radius: 4px; background: #fff; cursor: pointer; }
  .menu-icon, .menu-icon::before, .menu-icon::after { display: block; width: 20px; height: 2px; background: var(--navy); content: ""; transition: transform .15s; }
  .menu-icon { position: relative; }
  .menu-icon::before { position: absolute; top: -6px; }
  .menu-icon::after { position: absolute; top: 6px; }
  .menu-toggle[aria-expanded="true"] .menu-icon { background: transparent; }
  .menu-toggle[aria-expanded="true"] .menu-icon::before { transform: translateY(6px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] .menu-icon::after { transform: translateY(-6px) rotate(-45deg); }
  .header-menu { display: none; position: absolute; top: 100%; left: 0; right: 0; margin: 0;
    flex-direction: column; align-items: stretch; gap: 0; background: #fff; border-bottom: 1px solid var(--rule);
    box-shadow: 0 8px 16px rgba(15, 38, 71, .08); max-height: calc(100vh - 60px); overflow-y: auto; }
  .header-menu.open { display: flex; }
  .header-nav { flex-direction: column; align-items: stretch; gap: 0; }
  .header-nav a { display: flex; align-items: center; min-height: 48px; padding: 0 24px; border-top: 1px solid var(--bg-soft); font-size: 1rem; }
  .account { flex-direction: column; align-items: flex-start; gap: 6px; padding: 14px 24px 18px; border-top: 1px solid var(--rule); background: var(--bg-soft); white-space: normal; }
  .account > span:first-child { display: block; max-width: 100%; }
  .account .btn-link { padding: 6px 0; }
}

/* ---------------------------------------------------------------- headings */
.page-title { padding: 56px 0 24px; }
.eyebrow { color: var(--red); font-weight: 700; font-size: .9rem; margin: 0 0 12px; }
h1 { color: var(--navy); font-size: clamp(1.8rem, 3.6vw, 2.6rem); line-height: 1.4; margin: 0 0 20px; font-weight: 800; letter-spacing: .04em; }
.lead { max-width: 640px; color: #3a4a5c; margin: 0; }
.rule-heading { color: var(--navy); font-size: 1.6rem; font-weight: 800; border-top: 3px solid var(--navy); padding-top: 20px; margin: 0 0 24px; max-width: 860px; }
.block { padding: 40px 0 16px; }
.panel { padding: 24px 0 8px; }
.narrow { max-width: 560px; }

/* ---------------------------------------------------------------- buttons */
.btn, .btn-outline { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px;
  padding: 0 28px; border-radius: 2px; font: inherit; font-weight: 700; letter-spacing: .06em; cursor: pointer;
  border: 1.5px solid var(--navy); background: var(--navy); color: #fff; text-decoration: none; }
.btn:hover { background: var(--navy-2); }
.btn-outline { background: #fff; color: var(--navy); }
.btn-outline:hover { background: var(--bg-soft); }
.btn-small { min-height: 36px; padding: 0 16px; font-size: .9rem; }
.btn-large { min-height: 56px; padding: 0 40px; font-size: 1.05rem; }
.btn-link { background: none; border: none; color: var(--navy); text-decoration: underline; font: inherit; cursor: pointer; padding: 4px; }
button:disabled { opacity: .5; cursor: progress; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, canvas:focus-visible, summary:focus-visible {
  outline: 3px solid #f2b705; outline-offset: 2px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 20px 0; }

/* ---------------------------------------------------------------- forms */
input, select { font: inherit; color: var(--text); border: 1px solid #9aa5b4; border-radius: 2px; padding: 8px 10px; background: #fff; min-height: 42px; }
.form-table { border: 1px solid var(--rule); }
.form-table .row { display: grid; grid-template-columns: 180px 1fr; border-bottom: 1px solid var(--rule); margin: 0; }
.form-table .label { background: var(--bg-soft); padding: 14px 16px; font-weight: 700; font-size: .95rem; }
.form-table .row input { margin: 8px 12px; }
.form-table .actions { padding: 0 16px; }
.form-table .consent { padding: 12px 16px 0; border-bottom: 0; }
.form-table .consent label.check { align-items: flex-start; line-height: 1.6; }
.form-table .consent input { margin: 5px 0 0; width: 18px; height: 18px; flex: none; }
.form-table .consent .req { color: var(--muted); font-size: .8rem; margin-left: 4px; }
.note { background: var(--bg-soft); border-left: 4px solid var(--navy); padding: 12px 16px; }
.fine { color: var(--muted); font-size: .82rem; margin: 4px 0; display: block; }

/* spec table: left column labels on grey, like the website's 概要 table */
table { border-collapse: collapse; }
.spec { width: 100%; max-width: 980px; border: 1px solid var(--rule); }
.spec th { width: 190px; background: var(--bg-soft); text-align: left; vertical-align: top; padding: 18px 16px; font-size: .95rem; border-bottom: 1px solid var(--rule); }
.spec td { padding: 14px 18px; border-bottom: 1px solid var(--rule); }
.inline-fields { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px; }
.inline-fields label { display: grid; gap: 4px; font-size: .85rem; font-weight: 700; }
.file input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.file span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 20px; border: 1.5px solid var(--navy); color: var(--navy); font-weight: 700; cursor: pointer; border-radius: 2px; }
.file:focus-within span { outline: 3px solid #f2b705; outline-offset: 2px; }

.lines-table { width: 100%; margin: 10px 0 12px; font-size: .9rem; }
.lines-table th { background: var(--head); font-weight: 700; padding: 6px 8px; border: 1px solid var(--rule); text-align: left; }
.lines-table td { border: 1px solid var(--rule); padding: 6px 8px; }
.lines-table tr.active td { background: #fff8e1; }
.lines-table input { width: 100%; min-height: 36px; padding: 4px 8px; }
.lines-table select { min-height: 36px; padding: 2px 6px; }
.swatch { display: inline-block; width: 18px; height: 18px; border: 1px solid rgba(0, 0, 0, .35); vertical-align: middle; }
.line-status { font-size: .8rem; color: var(--muted); }
.line-status.ok { color: var(--ok); font-weight: 700; }

.preview { margin-top: 20px; max-width: 980px; }
.tip { background: var(--navy); color: #fff; padding: 8px 14px; margin: 0; font-size: .9rem; }
.video { position: relative; background: #000; line-height: 0; }
.video video, .video canvas { width: 100%; display: block; }
.video canvas { position: absolute; inset: 0; height: 100%; cursor: crosshair; }
.coords { margin-top: 10px; font-size: .9rem; }
.coords summary { cursor: pointer; color: var(--navy); }
.coords .inline-fields input { width: 110px; }
.upload-state { display: grid; gap: 4px; max-width: 980px; margin-top: 16px; font-size: .9rem; color: var(--muted); }
progress { width: 100%; height: 10px; accent-color: var(--navy); }

/* ---------------------------------------------------------------- result sheet */
.state { font-weight: 700; color: var(--navy); }
.tabs { display: flex; flex-wrap: wrap; gap: 0; margin: 8px 0 -1px; }
.tabs button { font: inherit; font-size: .9rem; padding: 8px 18px; border: 1px solid var(--rule); border-bottom: none; background: var(--bg-soft); color: var(--text); cursor: pointer; margin-right: -1px; }
.tabs button[aria-selected="true"] { background: #fff; color: var(--navy); font-weight: 700; border-top: 3px solid var(--navy); }
.sheet { border: 2px solid var(--navy); max-width: 980px; background: #fff; }
.sheet-title { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px; padding: 14px 16px; border-bottom: 2px solid var(--navy); }
.sheet-name { font-weight: 800; color: var(--navy); letter-spacing: .3em; font-size: 1.05rem; }
.sheet-meta { font-size: .8rem; color: var(--muted); }
.sheet-notes { margin: 0; padding: 10px 16px; font-size: .82rem; color: var(--muted); border-top: 1px solid var(--rule); }
.table-scroll { overflow-x: auto; }
.survey { width: 100%; font-variant-numeric: tabular-nums; }
.survey th { background: var(--head); font-weight: 700; font-size: .85rem; padding: 10px 12px; border: 1px solid var(--rule); white-space: nowrap; }
.survey td { padding: 10px 12px; border: 1px solid var(--rule); text-align: right; white-space: nowrap; }
.survey td:first-child { text-align: left; }
.survey tfoot td { font-weight: 800; color: var(--navy); border-top: 3px double var(--navy); }
.sheet .survey th:first-child, .sheet .survey td:first-child { border-left: none; }
.sheet .survey th:last-child, .sheet .survey td:last-child { border-right: none; }
.survey.compact th, .survey.compact td { padding: 6px 10px; font-size: .82rem; }
.more { max-width: 980px; margin-top: 16px; border: 1px solid var(--rule); }
.more summary { cursor: pointer; padding: 10px 16px; font-weight: 700; color: var(--navy); background: var(--bg-soft); }
.more .fine { padding: 0 16px 10px; }
.history { max-width: 980px; min-width: 480px; }
html, body { overflow-x: hidden; }
.history tbody tr { cursor: pointer; }
.history tbody tr:hover td { background: #fff8e1; }
.history td { text-align: left; }
.badge { display: inline-block; padding: 0 8px; font-size: .78rem; font-weight: 700; border: 1px solid currentColor; }
.badge.done { color: var(--ok); }
.badge.failed, .badge.cancelled { color: var(--red); }
.badge.running, .badge.queued, .badge.payment { color: var(--navy); }

.alert { position: sticky; bottom: 16px; max-width: 980px; background: #fff; border: 2px solid var(--red); color: var(--red); padding: 12px 16px; font-weight: 700; }
.site-footer { border-top: 1px solid var(--rule); margin-top: 56px; padding: 24px 0 40px; font-size: .8rem; color: var(--muted); }
.copyright { margin: 0; }

@media (max-width: 760px) {
  .form-table .row { grid-template-columns: 1fr; }
  .spec, .spec > tbody { display: block; width: 100%; }
  .spec > tbody > tr > th, .spec > tbody > tr > td { display: block; width: auto; border-bottom: none; }
  .spec > tbody > tr { display: block; border-bottom: 1px solid var(--rule); }
  .spec > tbody > tr > td { padding: 12px; }
  h1 { font-size: 1.55rem; }
  .lines-table { min-width: 0; }
  .rule-heading { font-size: 1.3rem; }
}
#odTable td:nth-child(2) { text-align: left; }

/* ---- time packs ---- */
.buy-row { display: grid; grid-template-columns: minmax(220px, 300px) 1fr; gap: 16px; max-width: 980px; margin: 0 0 10px; }
.balance { border: 2px solid var(--navy); padding: 14px 18px; display: flex; flex-direction: column; justify-content: center; }
.balance .k { font-size: .8rem; color: #4a5568; }
.balance .v { font-size: 1.7rem; font-weight: 800; color: var(--navy); line-height: 1.3; }
.balance .s { font-size: .78rem; color: #4a5568; }
.pack-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.pack-card { font: inherit; text-align: left; display: flex; flex-direction: column; gap: 2px; padding: 12px 14px;
  border: 1px solid var(--rule); border-top: 3px solid var(--navy); background: #fff; color: var(--text); cursor: pointer; }
.pack-card:hover:not(:disabled) { background: var(--bg-soft); }
.pack-card:disabled { cursor: default; opacity: .6; }
.pack-name { font-weight: 800; color: var(--navy); font-size: 1.05rem; }
.pack-price { font-weight: 700; font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.pack-price small { display: block; font-weight: 400; font-size: .75rem; color: #4a5568; }
.pack-unit { font-size: .78rem; color: #4a5568; }
.pack-go { margin-top: 6px; align-self: flex-start; padding: 4px 12px; background: var(--navy); color: #fff; font-weight: 700; font-size: .82rem; }
.pack-card:disabled .pack-go { background: #9aa5b4; }
.best { white-space: nowrap; color: var(--red); font-size: .72rem; font-weight: 700; margin-left: 6px; border: 1px solid currentColor; padding: 0 4px; vertical-align: 2px; }
.more-body { padding: 12px 16px; }
.more summary .badge { margin-left: 10px; color: var(--red); background: #fff; }
#buy > .fine { max-width: 980px; }
@media (max-width: 760px) {
  .buy-row { grid-template-columns: 1fr; }
  .pack-cards { grid-template-columns: 1fr; }
  .pack-card { display: grid; grid-template-columns: 1fr auto; column-gap: 12px; align-items: center; }
  .pack-card .pack-go { grid-column: 2; grid-row: 1 / span 3; margin: 0; }
}
.confirm { border: 2px solid var(--red); padding: 18px 20px; margin: 18px 0; background: #fff; }
.confirm-title { margin: 0 0 12px; color: var(--navy); font-size: 1.1rem; }
.confirm-table th { width: 30%; }
.confirm-notes { margin: 14px 0; padding-left: 1.2em; font-size: .88rem; line-height: 1.8; }
.sub-heading { margin: 28px 0 10px; font-size: 1rem; color: var(--navy); }
.shortfall { border-left: 4px solid var(--red); padding: 8px 12px; background: var(--bg-soft); margin: 10px 0; }
#purchases td:nth-child(2), #purchases td:nth-child(4) { text-align: left; }

/* ---- admin ---- */
.admin-tag { margin-left: 8px; padding: 2px 8px; background: var(--red); color: #fff; font-size: .75rem; font-weight: 700; }
.header-nav a.current { color: var(--red); font-weight: 700; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); border: 2px solid var(--navy); margin: 0 0 8px; }
.kpi { padding: 14px 18px; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.kpi .k { display: block; font-size: .8rem; color: #4a5568; }
.kpi .v { display: block; font-size: 1.4rem; font-weight: 800; color: var(--navy); margin: 2px 0; }
.kpi .s { display: block; font-size: .76rem; color: #4a5568; }
.search { display: flex; gap: 8px; margin: 0 0 14px; max-width: 520px; }
.search input { flex: 1; }
.clickable tbody tr { cursor: pointer; }
.clickable tbody tr:hover td { background: var(--bg-soft); }
.survey td .sub { display: block; font-size: .75rem; color: #4a5568; }
.survey td.empty { text-align: center; color: #4a5568; padding: 16px; }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin: 20px 0 8px; }
.admin-card { border: 1px solid var(--rule); border-top: 3px solid var(--navy); padding: 14px 16px; background: #fff; }
.admin-card h3 { margin: 0 0 10px; font-size: 1rem; color: var(--navy); }
.stack { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.stack label { display: flex; flex-direction: column; gap: 4px; font-size: .88rem; font-weight: 700; width: 100%; }
.stack label.radio { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; }
.stack .inline { display: flex; align-items: center; gap: 6px; font-weight: 400; }
.stack .inline input { width: 110px; }
.stack textarea { width: 100%; font: inherit; padding: 8px; border: 1px solid var(--rule); }
.cell-actions { display: inline-flex; gap: 10px; align-items: center; }
.toast { position: fixed; right: 24px; bottom: 24px; background: var(--navy); color: #fff; padding: 12px 18px; font-weight: 700; margin: 0; }
#customerInvoices td:last-child, #purchases td:last-child, #jobs td:last-child { text-align: center; }
.postpaid { margin-top: 8px; }
.confirm-inline { padding: 12px 16px; }
.tiers { max-width: 480px; }
#applyForm { max-width: 980px; margin: 12px 0; }
#applyForm .row input { max-width: 520px; }
body.admin .survey td { text-align: left; }
body.admin .survey td.num { text-align: right; }
body.admin .survey td.empty { text-align: center; }
#kpis { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 760px) { #kpis { grid-template-columns: 1fr 1fr; } }
.qr { width: 200px; height: 200px; border: 1px solid var(--rule); background: #fff; margin: 8px 0 12px; }
.steps { line-height: 1.9; }

/* ---- history (left) and result (right) side by side on wide screens ---- */
.result-layout { display: block; }
.history-pane .history { min-width: 0; }
@media (min-width: 1100px) {
  .result-layout { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 32px; align-items: start; }
  .history-pane { position: sticky; top: 72px; max-height: calc(100vh - 90px); overflow-y: auto; }
  .history-pane .rule-heading, .result-pane .rule-heading { font-size: 1.3rem; }
  .history-pane .history th:nth-child(2), .history-pane .history td:nth-child(2) { display: none; }
}
.history tbody tr.current td { background: #fff3cd; font-weight: 700; }
.upload-queue { list-style: none; padding: 0; margin: 16px 0 0; max-width: 980px; display: grid; gap: 8px; }
.queue-item { display: grid; grid-template-columns: minmax(0, 1fr) 200px auto; align-items: center; gap: 4px 12px;
  border: 1px solid var(--rule); padding: 8px 12px; font-size: .88rem; }
.queue-item progress { width: 100%; grid-column: 2; }
.queue-item .queue-name { font-weight: 700; overflow-wrap: anywhere; }
.queue-item .queue-text { grid-column: 1 / 3; color: var(--muted); font-size: .8rem; }
.caution { color: var(--red); font-size: .85rem; font-weight: 700; line-height: 1.7; max-width: 980px; }
@media (max-width: 640px) { .queue-item { grid-template-columns: 1fr; } .queue-item progress, .queue-item .queue-text { grid-column: 1; } }
.history td .job-name { display: block; font-weight: 700; white-space: normal; overflow-wrap: anywhere; }
.history td .job-date { display: block; color: var(--muted); font-size: .76rem; }
.history td:last-child { width: 1%; white-space: nowrap; }
.inline-input { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 12px; font-size: .88rem; }
.inline-input input { width: 160px; margin: 0 !important; }

/* ---------------------------------------------------------------- support desk */
.support-link { display: inline-flex; align-items: center; gap: 4px; }
.count-badge { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--red); color: #fff; font-size: .72rem; font-weight: 700; line-height: 20px; text-align: center; }
.support-layout { display: grid; grid-template-columns: 280px 1fr; gap: 24px; align-items: start; }
.support-list { display: grid; gap: 12px; }
.support-threads { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 520px; overflow-y: auto; }
.support-item { width: 100%; text-align: left; display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--rule); background: #fff; font: inherit; cursor: pointer; }
.support-item:hover, .support-item.current { border-color: var(--navy); background: var(--bg-soft); }
.support-item strong { font-size: .92rem; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.support-item-top { display: flex; align-items: center; justify-content: space-between; }
.support-item .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.support-pane { border: 1px solid var(--rule); display: grid; min-width: 0; }
.support-head { display: grid; gap: 2px; padding: 12px 16px; border-bottom: 1px solid var(--rule); background: var(--bg-soft); }
.support-messages { display: grid; gap: 12px; padding: 16px; max-height: 520px; overflow-y: auto; align-content: start; }
.support-messages:empty { display: none; }
.support-msg { max-width: 82%; padding: 10px 14px; border: 1px solid var(--rule); background: #fff; }
.support-msg.customer { justify-self: end; background: var(--head); border-color: var(--head); }
.support-msg.ai { border-left: 4px solid var(--navy); }
.support-msg.admin { border-left: 4px solid var(--ok); }
.support-who { display: flex; gap: 8px; align-items: baseline; font-size: .78rem; font-weight: 700; color: var(--muted); }
.support-body { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.support-files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.support-image { max-width: 220px; max-height: 160px; border: 1px solid var(--rule); display: block; }
.support-video { max-width: 100%; width: 360px; }
.support-form { display: grid; gap: 10px; padding: 16px; border-top: 1px solid var(--rule); }
.support-form textarea { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--rule); resize: vertical; }
.support-form .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0; }
.support-form .file span { min-height: 36px; padding: 0 14px; font-size: .9rem; }
.support-pending { display: flex; flex-wrap: wrap; gap: 8px; }
.support-pending:empty { display: none; }
.support-chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 4px 2px 8px; border: 1px solid var(--rule); font-size: .82rem; background: var(--bg-soft); }
.support-chip img { width: 28px; height: 28px; object-fit: cover; }
.digest-item { border: 1px solid var(--rule); padding: 12px 16px; margin: 8px 0; display: grid; gap: 6px; }
.digest-item .actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.brief { width: 100%; min-height: 220px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .82rem; }
@media (max-width: 760px) {
  .support-layout { grid-template-columns: 1fr; }
  .support-threads { max-height: 220px; }
  .support-msg { max-width: 100%; }
}
/* survey report panel */
#surveyBlock .inline-fields { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-end; }
#surveyBlock .actions { margin-top: 12px; align-items: center; }
#checkTable input[type=time] { min-height: 36px; padding: 2px 6px; }
#checkTable select { min-height: 36px; padding: 2px 6px; }
.count-input { width: 5.5em; min-height: 36px; padding: 2px 6px; }
label.check { display: inline-flex; align-items: center; gap: 6px; font-size: .9rem; }
label.check input { min-height: auto; }

/* crossing images */
.crossing-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 10px; margin: 10px 0; }
.crossing { border: 1px solid var(--rule); padding: 8px; display: grid; gap: 6px; font-size: .82rem; background: #fff; }
.crossing.excluded { opacity: .55; }
.crossing.changed { border-color: var(--navy); }
.crossing .shot { height: 120px; display: grid; place-items: center; background: var(--head); }
.crossing .shot img { max-width: 100%; max-height: 120px; image-rendering: auto; }
.crossing .shot span { color: var(--muted); }
.crossing .meta { font-weight: 700; }
.crossing select { font-size: .8rem; padding: 2px 4px; }
.crossing .fix { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
#detailTable td.count { cursor: pointer; text-decoration: underline dotted; }


/* ---------------------------------------------------------------- quick start (signed in, time left) */
.start { padding-bottom: 0; }
.start-text { font-weight: 700; color: var(--navy); margin: 0 0 4px; }
.line-hint { display: block; margin-top: 4px; font-size: .8rem; color: var(--red); font-weight: 700; }
.empty-row td { color: var(--muted); padding: 16px 8px; white-space: normal; text-align: left; }

/* ---------------------------------------------------------------- phones: tables that would run off the right edge become stacked rows */
@media (max-width: 640px) {
  .wrap { padding-left: 16px; padding-right: 16px; }
  .lines-table thead, .purchases thead { display: none; }
  .lines-table, .lines-table tbody, .purchases, .purchases tbody { display: block; width: 100%; }
  .lines-table tr { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; padding: 10px; border: 1px solid var(--rule); margin-bottom: 8px; }
  .lines-table td { border: none; padding: 0; }
  .lines-table td:nth-child(3), .lines-table td:nth-child(4) { grid-column: 1 / -1; }
  .lines-table td:nth-child(5) { grid-column: 3; grid-row: 1; }
  .lines-table select { width: 100%; }
  .purchases tr { display: block; border: 1px solid var(--rule); margin-bottom: 8px; }
  .purchases td { display: flex; justify-content: space-between; gap: 12px; border: none; border-bottom: 1px solid var(--head); text-align: right; white-space: normal; }
  .purchases td:last-child { border-bottom: none; }
  .purchases td[colspan] { display: block; text-align: left; }
  .purchases td:not([colspan])::before { color: var(--muted); text-align: left; flex-shrink: 0; }
  .purchases td:nth-child(1)::before { content: "購入日"; }
  .purchases td:nth-child(2)::before { content: "プラン"; }
  .purchases td:nth-child(3)::before { content: "金額（税込）"; }
  .purchases td:nth-child(4)::before { content: "状態"; }
  .purchases td:nth-child(5)::before { content: "残り"; }
  .purchases td:nth-child(6)::before { content: "有効期限"; }
  .history { min-width: 0; }
  .lines-table tr.active { background: #fff8e1; }
  .lines-table tr.active td { background: transparent; }
  .tiers th, .tiers td, .history th { white-space: normal; }
  .survey.compact th, .survey.compact td { padding: 6px 8px; }
  .table-scroll { -webkit-overflow-scrolling: touch; }
}
/* the empty-history message spans all columns; don't let the last-column nowrap rule cut it */
.history tr.empty-row td:last-child { width: auto; white-space: normal; }
/* inquiry form: a long video name in "関連する解析" must not widen the pane past a phone screen */
.support-pane, .support-form { grid-template-columns: minmax(0, 1fr); }
.support-form select { width: 100%; max-width: 100%; }
.support-form .inline-fields label { min-width: 0; flex: 1 1 160px; }
