[hidden] { display: none !important; }
.op-header { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding: 11px max(16px, env(safe-area-inset-right)) 11px max(16px, env(safe-area-inset-left)); background: color-mix(in srgb, var(--surface) 94%, transparent); border-bottom: 1px solid var(--line); backdrop-filter: blur(10px); }
.op-header > a { color: var(--muted); text-decoration: none; white-space: nowrap; }
.op-header > div { display: flex; flex-direction: column; line-height: 1.3; margin-right: auto; }
.op-header > div span { color: var(--muted); font-size: 12px; }
.op-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.op-tabs button { background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 6px 13px; cursor: pointer; }
.op-tabs button.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.op-main { max-width: 980px; margin: 0 auto; padding: 18px 16px 80px; }
.op-main h1 { font-size: 1.3rem; margin: 6px 0 4px; }
.op-main h2 { font-size: 1rem; margin: 18px 0 4px; }
.subtle { color: var(--muted); font-size: 13px; }
.primary { border: 1px solid var(--accent); border-radius: 9px; padding: 9px 16px; color: var(--accent-ink); background: var(--accent); font-weight: 700; cursor: pointer; text-decoration: none; display: inline-block; }
.primary.small { font-size: 13px; padding: 6px 11px; }
.primary:disabled { opacity: .55; cursor: wait; }
.ghost { background: transparent; border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; cursor: pointer; text-decoration: none; color: inherit; display: inline-block; }
.ghost.small { padding: 4px 10px; font-size: 13px; }
.op-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; margin: 12px 0; }
.op-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.op-main label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; }
.op-main input, .op-main select, .op-main textarea { font: inherit; font-weight: 400; color: var(--text); background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; width: 100%; }
.op-main textarea { resize: vertical; }
.op-block { margin-top: 12px; }
.op-items { display: flex; flex-direction: column; gap: 10px; margin: 8px 0; }
.op-item { display: grid; grid-template-columns: 1fr 1.4fr 1.4fr auto; gap: 8px; align-items: start; padding: 10px; border: 1px dashed var(--line); border-radius: 10px; }
.op-item button { margin-top: 22px; }
.op-targets { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.op-target-group { font-size: 12px; color: var(--muted); margin: 8px 0 0; font-weight: 700; }
.op-target { display: grid; grid-template-columns: minmax(200px, 1fr) 1.3fr; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.op-main .op-target label.op-check { flex-direction: row; align-items: center; gap: 8px; font-weight: 600; }
.op-main .op-target input[type=checkbox] { width: auto; }
.op-target .op-warn { grid-column: 1 / -1; }
.op-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 14px; }
.op-error { color: var(--bad); background: var(--bad-weak); border-radius: 8px; padding: 8px 12px; }
.op-warn { color: var(--warn); background: var(--warn-weak); border-radius: 8px; padding: 6px 10px; font-size: 13px; margin: 6px 0; }
.op-head { display: flex; justify-content: space-between; align-items: end; gap: 12px; flex-wrap: wrap; }
.op-main label.op-filter { flex-direction: row; align-items: center; gap: 8px; }
.op-main label.op-filter select { width: auto; }
.op-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.op-row { display: flex; flex-direction: column; gap: 6px; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; cursor: pointer; }
.op-row:hover { border-color: var(--accent); }
.op-row strong { font-size: 15px; }
.op-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.op-chip { font-size: 12px; border-radius: 999px; padding: 2px 9px; background: var(--surface-2); border: 1px solid var(--line); }
.op-chip.todo { background: var(--warn-weak); color: var(--warn); border-color: transparent; }
.op-chip.sent, .op-chip.applied { background: var(--accent-weak); color: var(--accent); border-color: transparent; }
.op-chip.confirmed { background: var(--ok-weak); color: var(--ok); border-color: transparent; }
.op-chip.skipped, .op-chip.cancelled { color: var(--muted); }
.op-chip.done { background: var(--ok-weak); color: var(--ok); border-color: transparent; }
.op-summary dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0; }
.op-summary dt { color: var(--muted); font-size: 13px; }
.op-summary dd { margin: 0; white-space: pre-wrap; }
.op-summary ol { margin: 6px 0 0; padding-left: 1.4em; }
.op-summary li { margin-bottom: 6px; white-space: pre-wrap; }
.op-target-cards { display: flex; flex-direction: column; gap: 12px; }
.op-target-card h2 { margin: 0 0 4px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.op-target-card .op-method { font-size: 12px; font-weight: 400; color: var(--muted); }
.op-mail-meta { display: grid; grid-template-columns: max-content 1fr; gap: 2px 10px; font-size: 13px; margin: 8px 0; }
.op-mail-meta dt { color: var(--muted); }
.op-mail-meta dd { margin: 0; word-break: break-all; }
.op-mail-body { width: 100%; min-height: 260px; font: 13px/1.6 ui-monospace, SFMono-Regular, Menlo, "Hiragino Sans", monospace; }
.op-buttons { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.op-steps { margin: 8px 0; padding-left: 1.4em; }
.op-steps li { margin-bottom: 8px; }
.op-copy-row { display: flex; gap: 8px; align-items: flex-start; }
.op-copy-row span { white-space: pre-wrap; flex: 1; background: var(--surface-2); border-radius: 6px; padding: 4px 8px; }
.op-status { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.op-status small { color: var(--muted); margin-left: auto; }
.op-channel-settings { display: flex; flex-direction: column; gap: 12px; }
.op-channel-settings .op-grid { margin-top: 8px; }
.op-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 9px 16px; border-radius: 999px; font-size: 14px; z-index: 10; }
h3 { font-size: .95rem; margin: 4px 0; }
.op-pending-list { display: flex; flex-direction: column; gap: 6px; margin: 6px 0; }
.op-pending { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(180px, 1.2fr) 1.4fr auto; gap: 8px; align-items: center; padding: 6px 8px; border: 1px dashed var(--line); border-radius: 8px; }
.op-pending-name { font-size: 13px; word-break: break-all; }
.op-images { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin: 6px 0; }
.op-image { margin: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface-2); display: flex; flex-direction: column; }
.op-image img { width: 100%; height: 120px; object-fit: cover; display: block; background: var(--surface); }
.op-image figcaption { display: flex; flex-direction: column; gap: 4px; padding: 6px 8px; font-size: 12px; word-break: break-all; }
.op-image-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.op-ai { border: 1px solid var(--accent); border-radius: 10px; padding: 10px 12px; margin: 8px 0; background: var(--accent-weak); }
.op-ai-text { min-height: 180px; background: var(--surface); }
.op-manual { margin: 8px 0; }
.op-manual summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.op-preview { margin-top: 16px; padding: 12px 14px; border: 1px solid var(--accent); border-radius: 10px; background: var(--accent-weak); }
.op-preview h2 { margin-top: 0; }
fieldset.op-mode { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 6px 18px; }
fieldset.op-mode legend { font-size: 13px; font-weight: 700; padding: 0 4px; }
.op-main fieldset.op-mode label { flex-direction: row; align-items: center; gap: 6px; font-weight: 600; }
.op-main fieldset.op-mode input { width: auto; }
.op-columns { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0; }
.op-columns-title { font-size: 13px; font-weight: 700; }
.op-column-list { display: flex; flex-wrap: wrap; gap: 6px; }
.op-column { display: flex; gap: 4px; align-items: center; }
.op-main .op-column input { width: 140px; }
.op-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.op-plan-table { border-collapse: collapse; width: 100%; min-width: 560px; font-size: 13px; }
.op-plan-table th, .op-plan-table td { border-bottom: 1px solid var(--line); padding: 4px 6px; text-align: left; vertical-align: middle; }
.op-plan-table th { background: var(--surface-2); font-weight: 700; white-space: nowrap; }
.op-plan-table button { white-space: nowrap; }
.op-plan-table td.op-num { color: var(--muted); width: 2em; text-align: right; }
.op-main .op-plan-table input { padding: 5px 7px; min-width: 90px; }
.op-main .op-plan-table td.op-name input { min-width: 200px; }
.op-tools { margin: 10px 0; }
.op-tools summary { cursor: pointer; font-size: 13px; color: var(--accent); }
.op-fill { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.op-fill-item { display: flex; gap: 4px; align-items: center; font-size: 13px; }
.op-main .op-fill-item input { width: 120px; }
.op-summary table.op-plan-table { min-width: 0; }
.op-result { margin-top: 10px; }
.op-result summary { cursor: pointer; font-size: 13px; color: var(--accent); }
.op-result textarea { min-height: 110px; }
.op-result-saved { white-space: pre-wrap; font-size: 13px; background: var(--surface-2); border-radius: 8px; padding: 6px 10px; margin: 6px 0; }
.op-subject { font-weight: 600; }
.op-main label.op-check-inline { flex-direction: row; align-items: center; gap: 6px; font-weight: 400; margin: 6px 0; }
.op-main label.op-check-inline input { width: auto; }
.op-sent-list { list-style: none; padding: 0; margin: 8px 0; font-size: 13px; display: flex; flex-direction: column; gap: 4px; }
.op-sent-list li { background: var(--surface-2); border-radius: 8px; padding: 5px 9px; }
.op-sent-list li.sent { background: var(--ok-weak); }
.op-sent-list li.failed { background: var(--bad-weak); color: var(--bad); }
.op-history-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; align-items: end; }
.op-history-table td { vertical-align: top; }
.op-main:has(> #historyView:not([hidden])) { max-width: 1320px; }
.op-history-table th, .op-history-table td:first-child, .op-history-table td:last-child, .op-history-table .op-chip.open, .op-history-table .op-chip.done, .op-history-table .op-chip.cancelled { white-space: nowrap; }
.op-history-table td:nth-child(2) { min-width: 6.5em; }
.op-history-table td:nth-child(3) { min-width: 13em; }
.op-history-table td:nth-child(4) { min-width: 5em; }
.op-history-table td.op-change { min-width: 160px; }
.op-history-table .op-chips { flex-direction: column; align-items: flex-start; }
.op-event-list { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.op-event-list li { border-bottom: 1px solid var(--line); padding: 4px 0; }
.op-event-at { color: var(--muted); font-variant-numeric: tabular-nums; }
.op-ota-summary { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; margin: 10px 0; }
.op-ota-card { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; cursor: pointer; color: inherit; }
.op-ota-card:hover { border-color: var(--accent); }
.op-ota-card.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-weak); }
.op-ota-name { font-weight: 700; }
.op-ota-total { font-size: 22px; font-weight: 700; line-height: 1.1; }
.op-ota-card .op-chips { gap: 4px; }
.op-history-group h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 8px; }
.op-history-group h2 .op-method { font-size: 12px; font-weight: 400; color: var(--muted); }
.op-history-group.op-ota-mail { border-left: 5px solid var(--warn); }
.op-history-group.op-ota-screen { border-left: 5px solid var(--accent); }
.op-history-table tr.op-row-todo td { background: var(--warn-weak); }
@media (max-width: 720px) {
  .op-pending { grid-template-columns: 1fr; }
  .op-item { grid-template-columns: 1fr; }
  .op-item button { margin-top: 0; justify-self: end; }
  .op-target { grid-template-columns: 1fr; }
  .op-header > div span { display: none; }
}
.g-main { max-width: 900px; }
.g-main h3 { font-size: 1rem; margin: 0 0 8px; }
.g-main ol, .g-main ul { padding-left: 1.4em; }
.g-main li { margin-bottom: 6px; line-height: 1.7; }
.g-main code { background: var(--surface-2); padding: 1px 6px; border-radius: 5px; font-size: .9em; word-break: break-all; }
.g-h { font-size: 1.15rem; margin: 28px 0 6px; padding-top: 6px; scroll-margin-top: 80px; border-top: 2px solid var(--accent); }
.g-tab { border: 1px solid var(--line); border-radius: 999px; padding: 6px 13px; text-decoration: none; color: inherit; white-space: nowrap; }
.g-tab:hover { border-color: var(--accent); }
.g-fig { margin: 10px 0 14px; }
.g-fig img { display: block; max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
.g-fig figcaption { font-size: 12px; color: var(--muted); margin-top: 4px; }
.g-note { background: var(--warn-weak); color: var(--text); border-left: 4px solid var(--warn); border-radius: 8px; padding: 8px 12px; font-size: 14px; }
.g-steps-row { list-style: none; padding: 0 !important; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; counter-reset: g; }
.g-steps-row li { counter-increment: g; background: var(--accent-weak); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.g-steps-row li b { font-size: 15px; color: var(--accent); }
.g-steps-row li b::before { content: counter(g) ". "; }
.g-table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 10px 0; }
.g-table th, .g-table td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
.g-table th { background: var(--surface-2); }
.g-chat { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 12px 0; background: var(--surface-2); display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.g-chat-title { margin: 0; font-weight: 700; color: var(--muted); font-size: 12px; }
.g-me, .g-ai { margin: 0; padding: 8px 12px; border-radius: 12px; max-width: 85%; line-height: 1.6; }
.g-me { align-self: flex-end; background: var(--accent); color: var(--accent-ink); }
.g-ai { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); }
.g-faq dt { font-weight: 700; margin-top: 12px; }
.g-faq dd { margin: 4px 0 0 0; line-height: 1.7; }
.g-check { list-style: none; padding-left: 0 !important; }
.g-check li { padding-left: 1.8em; position: relative; }
.g-check li::before { content: "☐"; position: absolute; left: 0; font-size: 1.1em; }
.g-foot { margin-top: 24px; }
.op-guide-link { margin-left: 6px; }
@media print {
  .op-header { position: static; }
  .op-tabs, .op-header > a { display: none; }
  .op-card { box-shadow: none; break-inside: avoid; }
  .g-h { break-before: auto; }
}

/* ---- NIRAI OTA 追加 ---- */
.op-brand { display: flex; flex-direction: column; line-height: 1.3; margin-right: auto; }
.op-brand strong { letter-spacing: .02em; }
.op-brand span { color: var(--muted); font-size: 12px; }
.op-brand select { font-size: 12px; padding: 2px 6px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface-2); max-width: 220px; }
.op-user { position: relative; }
.op-user summary { list-style: none; cursor: pointer; border: 1px solid var(--line); border-radius: 999px; padding: 6px 13px; white-space: nowrap; max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.op-user summary::-webkit-details-marker { display: none; }
.op-user-menu { position: absolute; right: 0; top: calc(100% + 6px); width: 300px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 12px; display: flex; flex-direction: column; gap: 8px; z-index: 20; }
.op-user-menu input { font: inherit; border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; background: var(--surface-2); color: var(--text); }
.op-user-title { font-size: 13px; font-weight: 700; margin: 4px 0 0; }
.op-store-list { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.op-store-row { display: flex; gap: 8px; align-items: center; }
.op-main .op-store-row input:not([type=checkbox]) { flex: 1; }
.op-subcard { margin: 0; box-shadow: none; }
.op-main label.op-check-inline { flex-direction: row; align-items: center; gap: 6px; font-weight: 400; }
.op-main label.op-check-inline input { width: auto; }
