:root {
  --bg: #eef3f9;
  --surface: #ffffff;
  --surface-soft: #f7f9fc;
  --line: #d7dee8;
  --line-strong: #bcc8d6;
  --text: #152233;
  --muted: #64748b;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #eaf2ff;
  --success: #16a34a;
  --success-soft: #e8f8ee;
  --warn: #d97706;
  --warn-soft: #fff5e8;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --shadow: 0 12px 36px rgba(15, 23, 42, 0.08);
  --shadow-sm: 0 4px 16px rgba(15, 23, 42, 0.05);
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  /*font-family: "Yu Gothic UI", "Meiryo", sans-serif;*/
  font-family: monospace;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.10), transparent 28%),
    var(--bg);
  color: var(--text);
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; }
img { max-width: 100%; display: block; }
.layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 268px 1fr;
  overflow-x: hidden;
}
.sidebar {
  background: linear-gradient(180deg, #0f172a 0%, #16274c 100%);
  color: #fff;
  padding: 26px 18px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px 24px;
}
.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, #60a5fa, #2563eb);
  display: grid;
  place-items: center;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.30);
}
.brand-title {
  font-size: 22px;
  font-weight: 800;
}
.brand-sub {
  color: rgba(255,255,255,.72);
  font-size: 12px;
  margin-top: 2px;
}
.nav-group {
  margin-top: 8px;
}
.nav-label {
  color: rgba(255,255,255,.48);
  font-size: 11px;
  letter-spacing: .08em;
  padding: 0 12px 10px;
}
.sidebar nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #e5edf8;
  border-radius: 14px;
  padding: 14px 14px;
  margin-bottom: 8px;
  background: transparent;
}
.sidebar nav a.active,
.sidebar nav a:hover {
  background: rgba(255,255,255,.12);
  text-decoration: none;
}
.sidebar .nav-note {
  font-size: 12px;
  color: rgba(255,255,255,.68);
  margin-top: 18px;
  padding: 14px;
  background: rgba(255,255,255,.08);
  border-radius: 14px;
  line-height: 1.6;
}
.main {
  padding: 24px;
  margin-bottom: 100px;
  min-width: 0;
  overflow-x: hidden;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 22px;
  position: relative;
  z-index: 100;
}
.page-title {
  margin: 0;
  font-size: 30px;
  line-height: 1.2;
}
.page-desc {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}
.user-chip {
  min-width: 240px;
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.9);
  border-radius: 18px;
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}
.user-chip .label {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 6px;
}
.user-chip .value {
  font-weight: 700;
}
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card {
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.95);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow);
}
.card-title {
  /*margin: 0 0 18px;*/
  /*margin: 20px 10px 5px;*/
  margin: 20px 10px 5px;
  /*font-size: 20px;*/
}
.section-title{
  display: flex;
  align-items: center;
  /*margin: 18px 0 10px;*/
  margin: 8px 0 5px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  /*padding: 8px 14px;*/
  padding: 4px 4px;
  border-left: 4px solid var(--primary);
  background: var(--primary-soft);
  border-radius: 0 8px 8px 0;
}

.card-sub {
  color: var(--muted);
  font-size: 13px;
  margin-top: 6px;
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  /*margin-bottom: 18px;*/
  flex-wrap: wrap;

  margin-bottom: 0px;
  padding-top: 10px;
  /* padding-bottom: 0px; */
  min-height: 40px;
}
.kpi-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.kpi {
  border: 1px solid var(--line);
  background: var(--surface-soft);
  border-radius: 16px;
  padding: 16px;
}
.kpi .k {
  color: var(--muted);
  font-size: 12px;
}
.kpi .v {
  margin-top: 8px;
  font-size: 24px;
  font-weight: 800;
}
.form-stack {
  display: grid;
  gap: 18px;
}
.field-group {
  display: grid;
  gap: 8px;
}
.field-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.helper {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}
.input, .select, .textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 13px 14px;
  color: var(--text);
  transition: border-color .18s ease, box-shadow .18s ease;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 4px rgba(37,99,235,.10);
}
.textarea { min-height: 92px; resize: vertical; }
.file-drop {
  border: 2px dashed #9fc3ff;
  border-radius: 22px;
  background: linear-gradient(180deg, #f3f8ff 0%, #eef5ff 100%);
  min-height: 320px;
  position: relative;
  overflow: hidden;
}
.file-drop.dragover {
  border-color: var(--primary);
  background: linear-gradient(180deg, #edf5ff 0%, #dfeeff 100%);
}
.drop-inner {
  padding: 28px;
  min-height: 320px;
  display: grid;
  place-items: center;
  text-align: center;
}
.drop-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 18px;
  border-radius: 22px;
  background: #fff;
  border: 1px solid #cfe0ff;
  display: grid;
  place-items: center;
  font-size: 32px;
  box-shadow: var(--shadow-sm);
}
.drop-title {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 10px;
}
.drop-desc {
  color: var(--muted);
  line-height: 1.7;
  max-width: 560px;
  margin: 0 auto 18px;
}
.drop-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}
.hidden-input { display: none; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 128px;
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 12px 18px;
  cursor: pointer;
  background: var(--surface-soft);
  color: var(--text);
  transition: transform .08s ease, background .16s ease, border-color .16s ease;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn.primary { background: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); }
.btn.outline {
  background: #fff;
  border-color: var(--line);
  margin: 2px 10px;
}
.btn.soft { background: var(--primary-soft); color: var(--primary-dark); }
.btn.danger { background: var(--danger-soft); color: #991b1b; }
.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}
.badge.success { background: var(--success-soft); color: #166534; }
.badge.processing { background: #fff5db; color: #8a5a12; }
.badge.error { background: var(--danger-soft); color: #991b1b; }
.badge.info { background: var(--primary-soft); color: #1d4ed8; }
.badge.neutral { background: #eef2f7; color: #475569; }
.file-preview {
  display: none;
  gap: 18px;
  align-items: stretch;
  grid-template-columns: minmax(0, 1fr) 320px;
  padding: 18px;
  background: #fff;
  border-top: 1px solid #d7e5ff;
}
.file-preview.show { display: grid; }
.preview-canvas {
  background: linear-gradient(180deg, #fff 0%, #f7f9fc 100%);
  border: 1px solid var(--line);
  border-radius: 18px;
  min-height: 320px;
  display: grid;
  place-items: center;
  padding: 18px;
  overflow: hidden;
}
.preview-canvas img {
  max-height: 420px;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
}
.preview-placeholder {
  width: min(82%, 440px);
  aspect-ratio: .72;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  padding: 20px;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.10);
}
.preview-line {
  height: 10px;
  border-radius: 8px;
  margin-bottom: 10px;
  background: #dde6f0;
}
.w40 { width: 40%; }
.w55 { width: 55%; }
.w70 { width: 70%; }
.w85 { width: 85%; }
.preview-table {
  margin-top: 18px;
  border: 1px solid var(--line-strong);
}
.preview-table div {
  height: 34px;
  border-bottom: 1px solid var(--line-strong);
}
.preview-table div:last-child { border-bottom: 0; }
.file-meta {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-soft);
  padding: 18px;
}
.file-meta-grid {
  display: grid;
  gap: 14px;
  min-width: 300px;
}
.meta-item {
  display: grid;
  gap: 6px;
}
.meta-item .k { color: var(--muted); font-size: 12px; }
.meta-item .v { font-weight: 700; word-break: break-all; }
.extension-box {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}
.extension-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.switch-row + .switch-row { margin-top: 10px; }
.switch {
  position: relative;
  width: 48px;
  height: 28px;
  flex: 0 0 auto;
}
.switch input { display: none; }
.switch-slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background .18s ease;
}
.switch-slider::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.16);
  transition: transform .18s ease;
}
.switch input:checked + .switch-slider {
  background: var(--primary);
}
.switch input:checked + .switch-slider::before {
  transform: translateX(20px);
}
.csv-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}
.csv-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff;
}
.csv-meta {
  display: grid;
  gap: 5px;
}
.csv-name {
  font-weight: 700;
}
.csv-note {
  color: var(--muted);
  font-size: 12px;
}
.mini-btn {
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
}
.status-list {
  display: grid;
  gap: 12px;
}
.status-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--line);
}
.status-icon {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-weight: 800;
}
.alert {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid transparent;
  font-size: 14px;
}
.alert.warn { background: var(--warn-soft); color: #8a5a12; border-color: #f6d6ac; }
.alert.error { background: var(--danger-soft); color: #991b1b; border-color: #fecaca; }
.alert.success { background: var(--success-soft); color: #166534; border-color: #bbf7d0; }
.kv {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.kv .item {
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}
.kv .item.full { grid-column: 1 / -1; }
.kv .k { color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.kv .v { font-weight: 700; line-height: 1.6; }
.table-wrap {
  /*max-width: 1000px;*/
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: auto;
  background: #fff;
}
.table-drag-hint {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}
.table-drag-hint kbd {
  display: inline-block;
  padding: 1px 6px;
  font-size: 11px;
  font-family: inherit;
  line-height: 1.4;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 1px 0 var(--line);
}
#verify-table-wrap {
  cursor: grab;
}
#verify-table-wrap.dragging {
  cursor: grabbing !important;
}
#verify-table-wrap.dragging * {
  cursor: grabbing !important;
}
table {
  width: 100%;
  border-collapse: collapse;
  /*min-width: 900px;*/
}
table.detailTable {
  min-width: 0;
  max-width: 100%;
  table-layout: auto;
  word-break: break-word;
}
table.detailTable th {
  white-space: nowrap;
}
table.detailTable td {
  max-width: 300px;
}
table.detailTable td .desc-input {
  width: 100%;
}
.stacked-field {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.stacked-field:last-child {
  margin-bottom: 0;
}
.stacked-field label {
  flex: 0 0 92px;
  width: 92px;
  flex-shrink: 0;
  white-space: nowrap;
  font-size: 12px;
  color: #64748b;
}
.stacked-field .desc-input {
  flex: 1;
  min-width: 0;
}
#additional_prompt_table {
  table-layout: fixed;
  width: 100%;
}
#additional_prompt_table td {
  max-width: none;
}
#additional_prompt_table th.th-keyword,
#additional_prompt_table td:nth-child(1) {
  width: 18%;
}
#additional_prompt_table th.th-focus-point,
#additional_prompt_table td:nth-child(2) {
  width: 27%;
}
#additional_prompt_table th.th-caution,
#additional_prompt_table td:nth-child(3) {
  width: 50%;
}
#additional_prompt_table th.th-action,
#additional_prompt_table td.td-action {
  width: 50px;
}
table.detailTable td textarea.desc-input {
  height: 35px;
  resize: vertical;
  overflow-y: hidden;
}
#caution_table th {
  font-size: 14px;
  font-weight: 700;
  color: inherit;
}
#caution_table th.th-keyword { width: 20%; }
#caution_table th.th-caution { display: flex; align-items: center; justify-content: space-between; }
#caution_table th.th-action  { width: 50px; text-align: center; }
#caution_table td.td-action  { text-align: center; }

.hidden-template { display: none; }
#header_dummy    { display: none; }
#detail_dummy    { display: none; }
#dummy_frame     { display: none; }
#swalTemplateContainer { display: none; }

.result-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.result-row-header {
  font-weight: bold;
  font-size: 12px;
  color: #6b7280;
}
.result-desc {
  display: flex;
  align-items: center;
  gap: 8px;
}
.result-desc .desc-input { flex: 1; }
.result-sample .desc-input { flex: 1; }

.detail-maintain-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.detail-maintain-row-header {
  font-weight: bold;
  font-size: 12px;
  color: #6b7280;
}

.btn-add-row {
  padding: 2px 8px;
  font-size: 12px;
  /*height: auto;*/
  height: 25px;
}
.btn-delete-group{
  padding: 2px 8px;
  font-size: 12px;
  /*height: auto;*/
  height: 25px;
}
.btn-delete-row {
  color: #dc2626;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 16px;
  padding: 0 4px;
}
th, td {
  padding: 4px 7px;
  border-bottom: 1px solid #edf2f7;
  text-align: left;
  white-space: nowrap;
}
th {
  font-size: 12px;
  color: var(--muted);
  background: #f8fafc;
  position: sticky;
  top: 0;
  z-index: 1;
}
.result-layout {
  display: grid;
  grid-template-columns: minmax(360px, .9fr) minmax(0, 1.1fr);
  gap: 20px;
}
.result-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
}
.result-file {
  font-size: 24px;
  font-weight: 800;
  margin-top: 6px;
}
.preview-panel {
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  background: #fff;
}
.preview-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}
.preview-panel-body {
  padding: 20px;
  min-height: 620px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #ffffff 0%, #f7f9fc 100%);
}
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 30px;
}
.login-card {
  width: 100%;
  max-width: 1100px;
  display: grid;
  grid-template-columns: 1.06fr .94fr;
  overflow: hidden;
  border-radius: 28px;
  border: 1px solid rgba(255,255,255,.9);
  box-shadow: var(--shadow);
  background: #fff;
}
.login-left {
  padding: 52px;
  color: #fff;
  background:
    radial-gradient(circle at top right, rgba(96,165,250,.45), transparent 28%),
    linear-gradient(135deg, #1d4ed8 0%, #0f172a 100%);
}
.login-left h1 {
  margin: 18px 0 14px;
  font-size: 35px;
  line-height: 1.2;
}
.login-left p {
  color: rgba(255,255,255,.84);
  line-height: 1.85;
  margin: 0;
  font-size: 0.95em;
}
.feature-list {
  display: grid;
  gap: 12px;
  margin-top: 26px;
}
.feature-item {
  padding: 14px 16px;
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 16px;
  margin: 4px;
}
.login-right { padding: 46px; }
.login-form {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}
.login-footer {
  margin-top: 24px;
  color: var(--muted);
  font-size: 12px;
}
.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.toolbar .left, .toolbar .right {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 12px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
@media (max-width: 1220px) {
  .grid-2, .result-layout, .file-preview { grid-template-columns: 1fr; }
}
@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .login-card { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .main { padding: 16px; }
  .topbar, .result-hero { grid-template-columns: 1fr; display: grid; }
  .field-grid-2, .kpi-row, .grid-3, .kv { grid-template-columns: 1fr; }
  .login-left, .login-right { padding: 28px; }
  .preview-panel-body { min-height: 420px; }
}


.info-group{border:1px solid var(--line);border-radius:18px;background:linear-gradient(180deg,#ffffff 0%,#f8fbff 100%);padding:18px}
.info-group+.info-group{margin-top:18px}
.group-title{margin:0 0 14px;font-size:18px;font-weight:800;color:var(--primary-dark)}
.page-shell{display:grid;gap:20px;min-width:0}
.page-block{background:rgba(255,255,255,.88);backdrop-filter:blur(12px);border:1px solid rgba(255,255,255,.95);border-radius:var(--radius-lg);padding:22px;box-shadow:var(--shadow);min-width:0;overflow:visible}
.drop-section-title{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px;flex-wrap:wrap}
.drop-section-title h2{margin:0;font-size:28px}
.file-limit{background:#f5f8fd;border:1px solid #d8e2f0;color:#54657f;border-radius:999px;padding:10px 16px;font-size:13px;font-weight:700;white-space:nowrap}

/* =========================================================
   Result page unified layout
   result.html 側のインラインCSSを廃止し、共通CSS基準に統一
========================================================= */

body.has-sticky-action {
  padding-bottom: 96px;
}

.result-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.top-result-layout {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.header-detail-layout {
  display: flex;
  flex-direction: row;
  gap: 18px;
  align-items: stretch;
}
.header-detail-layout > div {
  flex: 1 1 0;
  min-width: 0;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: #dcfce7;
  color: #166534;
  font-size: 12px;
  font-weight: 700;
}

.result-group {
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 14px;
  background: #fff;
}

.result-group:last-child {
  margin-bottom: 0;
}

.result-group-title {
  padding: 6px 16px;
  background: #f8fafc;
  /*background: var(--primary-soft);*/
  border-bottom: 1px solid #e5e7eb;
  font-size: 15px;
  font-weight: 700;
}

.result-row {
  display: grid;
  /* grid-template-columns: 220px minmax(0, 1fr) 340px; */
  grid-template-columns: 220px minmax(0, 1fr) minmax(0, 2fr);
  border-top: 1px solid #edf2f7;
}

.result-row:first-of-type {
  border-top: none;
}

.result-label {
  background: #fbfdff;
  padding: 4px 16px;
  border-right: 1px solid #edf2f7;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

input.result-label-input{
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 6px 12px;
    font: inherit;
    font-size: 13px;
    line-height: 1.6;
    background: #fff;
}

.result-value {
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.7;
  min-width: 0;
}

.result-desc {
  padding: 4px 12px;
  background: #f8fafc;
  border-left: 1px solid #edf2f7;
  min-width: 0;
}

.result-sample {
    display: flex;
    align-items: center;
    gap: 8px;
  padding: 4px 12px;
}

.desc-input,
.desc-textarea {
  /* width: 100%;*/
  box-sizing: border-box;
  min-width: 0;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 6px 12px;
  font: inherit;
  font-size: 13px;
  line-height: 1.6;
  background: #fff;
}

.desc-textarea {
  min-height: 76px;
  resize: vertical;
}

/*
.detail-maintain {
  margin-top: 16px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
}
*/

/* 明細情報カードの中身を1列のグリッドにする */
.detail-maintain {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: auto;
  background: #fff;
  margin-bottom: 14px;
}


/* タイトルとサブタイトルは2列分ぶち抜きで表示させる */
.detail-maintain-title,
.detail-maintain-sub {
  grid-column: 1 / -1;
}

/* スマホなどのレスポンシブ対応（760px以下は1列に戻す） */
@media (max-width: 760px) {
  .detail-maintain {
    grid-template-columns: 1fr;
  }
}


.detail-maintain-title {
  padding: 4px 16px;
  background: #f8fafc;
  /*background: var(--primary-soft);*/
  border-bottom: 1px solid #e5e7eb;
  font-size: 15px;
  font-weight: 700;
}

.detail-maintain-sub {
  padding: 0 16px 12px;
  background: #f8fafc;
  color: #64748b;
  font-size: 12px;
}

.detail-maintain-row {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) minmax(0, 2fr);
  border-top: 1px solid #edf2f7;
}

.detail-maintain-row:first-of-type {
  border-top: none;
}

.detail-maintain-row > input[type="hidden"] {
  display: none;
}

.detail-maintain-label {
  background: #fbfdff;
  padding: 4px 16px;
  border-right: 1px solid #edf2f7;
  font-size: 14px;
  font-weight: 700;
  min-width: 200px;
}

input.detail-maintain-label-input{
border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 6px 12px;
    font: inherit;
    font-size: 13px;
    line-height: 1.6;
    background: #fff;
}

/*
.detail-maintain-value {
  padding: 6px 12px;
  min-width: 0;
}
*/
.detail-maintain-sample {
  display: flex;
  align-items: center;
  padding: 4px 12px;
  border-right: 1px solid #edf2f7;
}

.detail-maintain-sample .desc-input {
  flex: 1;
  width: 100%;
}

/* 2. 入力欄のコンテナを横いっぱいに広げる設定 */
.detail-maintain-value {
  display: flex;
  align-items: center;
  gap: 8px; /* inputと×ボタンの間の隙間 */
  padding: 4px 12px !important; /* 上下の余白も少しタイトに */
}

/* 3. input自体をフレキシブルに最大化する */
.detail-maintain-value .desc-input {
  flex: 1;       /* 利用可能な横幅をすべて埋める */
  width: 100%;
}

.desc-action-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.desc-action-row .desc-input {
  flex: 1;
  min-width: 0;
}

.btn-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #dc2626;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.btn-icon:hover {
  background: #fef2f2;
  border-color: #fca5a5;
}

.optional-col {
  background: #fffdf7;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .45);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 1000;
}

.modal {
  width: min(940px, 100%);
  background: #fff;
  border-radius: 20px;
  border: 1px solid #dbe2ea;
  box-shadow: 0 30px 80px rgba(15, 23, 42, .18);
  overflow: hidden;
}

.modal-header {
  padding: 18px 22px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.modal-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}

.modal-sub {
  color: #64748b;
  font-size: 13px;
  line-height: 1.6;
  margin-top: 6px;
}

.close-btn {
  border: none;
  background: transparent;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  color: #64748b;
}

.modal-body {
  padding: 22px;
  display: grid;
  gap: 18px;
}

.form-item label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
}

.form-item textarea {
  width: 100%;
  /*min-height: 120px;*/
  min-height: 72px;
  resize: vertical;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  padding: 14px;
  font: inherit;
  font-size: 13px;
  line-height: 1.7;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 0 22px 22px;
}

/* Sticky action bar */
.sticky-action-bar {
  position: fixed;
  left: 268px;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, .96);
  border-top: 1px solid #dbe2ea;
  box-shadow: 0 -8px 24px rgba(15, 23, 42, .08);
  z-index: 999;
  backdrop-filter: blur(8px);
}

.sticky-action-inner {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 24px;
}

.sticky-action-left,
.sticky-action-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.sticky-save-btn {
  min-width: 180px;
  box-shadow: 0 8px 20px rgba(37, 99, 235, .22);
}

@media (max-width: 1180px) {
  .result-row {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .result-desc {
    grid-column: 1 / -1;
    border-left: none;
    border-top: 1px solid #edf2f7;
  }
}

@media (max-width: 980px) {
  .sticky-action-bar {
    left: 0;
  }
}

@media (max-width: 760px) {
  body.has-sticky-action {
    padding-bottom: 148px;
  }

  .result-row,
  .detail-maintain-row {
    grid-template-columns: 1fr;
  }

  .result-label,
  .detail-maintain-label {
    border-right: none;
    border-bottom: 1px solid #edf2f7;
  }

  .file-meta-grid {
    grid-template-columns: 1fr;
  }

  .sticky-action-inner {
    flex-direction: column;
    align-items: stretch;
    padding: 12px 16px;
  }

  .sticky-action-left,
  .sticky-action-right {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .sticky-action-bar .btn,
  .sticky-save-btn {
    width: 100%;
  }
}




/* =========================================================
   Pattern List Page Styles (S030)
========================================================= */

/* パターンIDの等幅フォントと強調表示 */
.pattern-id {
  font-family: monospace;
  font-weight: 700;
}

/* パターン名のメインタイトル */
.pattern-main-title {
  font-weight: 700;
  font-size: 15px;
}

/* パターン名の下に表示する補足テキストの余白調整 */
.pattern-sub-desc {
  margin: 4px 0 0 0;
}

/* テーブル内の「編集」ボタン専用の極小調整 */
.btn-table {
  padding: 6px 12px;
  min-width: auto;
  font-size: 13px;
}

.swal-detail-table {
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
  min-width: 0;
}
.swal-detail-table th,
.swal-detail-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.swal-detail-table th {
  width: 110px;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
}

/* 各列の幅固定（テーブル wrap 内でのレスポンシブ維持のため） */
.col-id { width: 140px; }
.col-date { width: 160px; }
.col-status { width: 130px; }
.col-action { width: 120px; text-align: center; }

/* 操作ボタンセルの配置調整 */
.cell-center {
  text-align: center;
}










/* =========================================================
   Result page unified layout (ドラッグ移動対応版)
========================================================= */

/* プレビュー固定ボタン */
.preview-pin-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 10;
  padding: 3px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: #475569;
  cursor: pointer;
  line-height: 1.6;
}
.preview-pin-btn:hover { background: #f1f5f9; }
.preview-pin-btn.pinned { background: #2563eb; color: #fff; border-color: #2563eb; }

/* 固定状態の preview-column */
.preview-column {
  position: relative;
}

/* body直下に移動した固定プレビュー */
.preview-column-fixed {
  position: fixed;
  z-index: 1000;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  border-radius: 16px;
  overflow: hidden;
}

/* ドラッグバー */
.preview-drag-bar {
  height: 28px;
  /*background: #1e293b;*/
  /*background: #5476ae;*/
  background: #8a98ae;
  cursor: move;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  user-select: none;
}
.preview-drag-bar-dots {
  display: flex;
  gap: 4px;
}
.preview-drag-bar-dots span {
  display: block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255,255,255,0.45);
}

/* リサイズハンドル */
#preview-resize-handle {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 18px;
  height: 18px;
  cursor: se-resize;
  z-index: 1001;
  background: linear-gradient(135deg, transparent 40%, #94a3b8 40%, #94a3b8 55%, transparent 55%, transparent 70%, #94a3b8 70%, #94a3b8 85%, transparent 85%);
}

.preview-body {
  display: flex;
  flex-direction: row;
  gap: 18px;
  align-items: start;
}
.preview-body .preview-frame {
  flex: 1 1 0;
  min-width: 0;
}

/* 1. 親要素（外枠） */
.preview-frame {
  width: 100% !important;
  height: 500px !important;   /* 枠の高さ固定 */
  background: #e2e8f0;
  border: 1px solid #cbd5e1;
  border-radius: 16px;
  overflow: hidden;           /* はみ出た部分は隠す（ドラッグで引っ張り出す） */
  position: relative;
  cursor: grab;
}

.preview-frame:active {
  cursor: grabbing;
}

/* 2. 中の画像（ドラッグで動かすため、基準を左上に） */
#result_image {
  position: absolute;
  top: 0%;
  left: 0%;
  transform: translate(-50%, -50%); /* 初期表示を枠の中央に */

  /* ↓ 競合する制限を解除 */
  max-width: none !important;
  max-height: none !important;

  /* ---------------------------------------------------------------
     【重要】画像の向きに合わせて、どちらか片方を選んでください
     --------------------------------------------------------------- */

  /* ▼ パターンA：【横長】の画像が多く、高さを枠(500px)にピッタリ合わせたい場合 */
  height: 100% !important;
  width: auto !important;

  /* ▼ パターンB：【縦長】の画像が多く、横幅を枠(100%)にピッタリ合わせたい場合
     （もし縦長画像がメインなら、上の2行を消して、下の2行を生かしてください） */
  /* width: 100% !important; */
  /* height: auto !important; */

  transform-origin: center center;
  user-select: none;
  -webkit-user-drag: none;
}

/*h2 {*/
/*  display: flex;*/
/*  align-items: center;*/
/*  margin: 18px 0 10px;*/
/*  font-size: 18px;*/
/*  font-weight: 700;*/
/*  color: var(--text);*/
/*  padding: 8px 14px;*/
/*  border-left: 4px solid var(--primary);*/
/*  background: var(--primary-soft);*/
/*  border-radius: 0 8px 8px 0;*/
/*}*/

.verification_detail_table{
  min-width: 0;
}

.pointer{
  cursor: pointer
}

.user-chip {
    position: relative;
}

.user-chip-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-chip-arrow {
    background: none;
    border: none;
    padding: 0 2px;
    cursor: pointer;
    font-size: 1rem;
    color: #64748b;
    line-height: 1;
    margin-left: auto;
}

.user-chip-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 160px;
    background: #2d3748;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.18);
    z-index: 1000;
    overflow: hidden;
}

.user-chip-dropdown.open {
    display: block;
}

.user-chip-menu-item {
    display: block;
    padding: 12px 20px;
    text-decoration: none;
    color: #fff;
    font-size: 0.9rem;
    white-space: nowrap;
}

.user-chip-menu-item:hover {
    background: #3d4f66;
}




.master-detail-layout {
  display: flex;
  flex-direction: row;
  gap: 18px;
  align-items: stretch;
  min-height: 100px;
}
.master-detail-layout > div {
  /*flex: 0.2 1 0;*/
  flex: 0.25 1 0;
  min-width: 0;
}

.master-cassette {
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 14px;
  background: #fff;
}
.master-cassette:last-child {
  margin-bottom: 0;
}
.master-cassette-title {
  padding: 12px 16px;
  background: #f8fafc;
  border-bottom: 1px solid #e5e7eb;
  font-size: 15px;
  font-weight: 700;
}
.master-cassette-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.master-row-header {
  font-weight: bold;
  font-size: 12px;
  color: #6b7280;
}
.master-label {
  background: #fbfdff;
  padding: 4px 16px;
  border-right: 1px solid #edf2f7;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

input.master-label-input{
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 6px 12px;
    font: inherit;
    font-size: 13px;
    line-height: 1.6;
    background: #fff;
  width: 90%;

}

.btn-add-master {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    color: #64748b;
    font-size: 20px;
    font-weight: 400;
    line-height: 1;
    cursor: pointer;
    box-shadow: none;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
    margin-top: 20px;
}

.btn-add-master:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #2563eb;
}

.btn-add-master:active {
    background: #f1f5f9;
}

.btn-add-master:focus-visible {
    outline: 2px solid rgba(37, 99, 235, 0.25);
    outline-offset: 2px;
}

/* リスト全体のコンテナ */
.swal-custom-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
    text-align: left;
}

/* 選択肢ボタンの共通スタイル */
.swal-custom-option {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 12px 15px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
    width: 100%;
}

/* ホバー時のエフェクト */
.swal-custom-option:hover {
    background: #e9ecef;
    border-color: #007bff;
}

/* タイトル部分 */
.swal-option-title {
    font-weight: bold;
    font-size: 16px;
    color: #333;
    margin-bottom: 4px;
}

/* 説明部分 */
.swal-option-desc {
    font-size: 13px;
    color: #666;
}


.ellipsis-text {
    max-width: 300px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    /*cursor: default;*/
    cursor: auto;
}

#textToast {
    display: none;
    position: fixed;
    left: 50%;
    bottom: 30px;
    transform: translateX(-50%);
    z-index: 9999;

    max-width: 80%;
    padding: 10px 16px;

    color: #fff;
    background: rgba(0, 0, 0, 0.85);
    border-radius: 6px;
    font-size: 14px;
    word-break: break-word;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

input:disabled {
    background-color: #e9ecef; /* 明るめのグレー */
    color: #6c757d;            /* 少し薄めの文字色 */
    cursor: not-allowed;       /* マウスカーソルを禁止マークにする（おすすめ） */
    border-color: #ced4da;     /* 枠線もマイルドなグレーに */
}

div.tool-card.tool {
  background: rgb(122 204 132 / 10%);
}
div.tool-card.user {
  background: rgb(186 107 107 / 10%);
}
div.tool-card.system {
  background: rgb(192 181 44 / 10%);
}

input.disabled{
  background: rgb(148 163 184 / 14%);
}