/* ---- Excel印刷範囲指定画面 ---- */

.pr-dropzone{
  border:2px dashed var(--line);
  border-radius:8px;
  padding:34px 16px;
  text-align:center;
  cursor:pointer;
  transition:border-color .15s, background .15s;
}
.pr-dropzone.drag{
  border-color:var(--accent);
  background:var(--accent-soft);
}
.pr-dropzone .pr-icon{font-size:30px;margin-bottom:8px;}
.pr-dropzone .pr-main-txt{font-weight:700;font-size:15px;color:var(--navy-deep);}
.pr-dropzone .pr-sub-txt{color:#8792a0;font-size:12.5px;margin-top:4px;}
.pr-dropzone input[type=file]{display:none;}

.pr-file-info{
  display:flex;align-items:center;justify-content:space-between;
  gap:10px;flex-wrap:wrap;
  font-size:13px;
}
.pr-file-info .pr-name{font-weight:700;color:var(--navy-deep);}
.pr-file-info .pr-meta{color:#8792a0;font-family:ui-monospace,"SFMono-Regular",Menlo,monospace;font-size:12px;}
.pr-btn-text{
  background:none;border:none;color:var(--accent);font-size:12.5px;font-weight:700;
  cursor:pointer;padding:4px 0;text-decoration:underline;
}

/* ---- Sheet tabs ---- */
.pr-sheet-tabs{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:14px;}
.pr-sheet-tab{
  font-family:ui-monospace,"SFMono-Regular",Menlo,monospace;
  font-size:12.5px;
  padding:6px 12px;
  background:var(--paper);
  border:1px solid var(--line);
  border-radius:6px;
  cursor:pointer;
  color:#6b7684;
  white-space:nowrap;
}
.pr-sheet-tab.active{
  background:var(--navy-deep);
  border-color:var(--navy-deep);
  color:#fff;
}

/* ---- Range controls ---- */
.pr-range-row{
  display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-bottom:12px;
}
.pr-range-row label{font-size:12.5px;color:#6b7684;font-weight:700;}
.pr-range-row input[type=text]{
  font-family:ui-monospace,"SFMono-Regular",Menlo,monospace;
  font-size:14px;font-weight:600;
  padding:8px 10px;
  border:1.5px solid var(--line);
  border-radius:6px;
  width:170px;
  background:var(--paper);
  color:var(--navy-deep);
}
.pr-range-row input[type=text]:focus{outline:2px solid var(--accent);outline-offset:1px;border-color:var(--accent);}

/* ---- Grid ---- */
.pr-grid-scroll{
  max-height:52vh;
  overflow:auto;
  border:1px solid var(--line);
  border-radius:6px;
  -webkit-overflow-scrolling:touch;
  touch-action:pan-x pan-y;
}
table.pr-grid{
  border-collapse:separate;
  border-spacing:0;
  font-family:ui-monospace,"SFMono-Regular",Menlo,monospace;
  font-size:12px;
}
table.pr-grid td, table.pr-grid th{
  border-right:1px solid var(--line-soft);
  border-bottom:1px solid var(--line-soft);
  padding:4px 7px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  max-width:160px;
}
table.pr-grid thead th{
  position:sticky;top:0;z-index:3;
  background:var(--paper);
  color:#6b7684;
  font-weight:700;
  text-align:center;
  font-size:11.5px;
  border-bottom:1px solid var(--line);
}
table.pr-grid thead th.corner{left:0;z-index:4;}
table.pr-grid tbody th{
  position:sticky;left:0;z-index:2;
  background:var(--paper);
  color:#6b7684;
  font-weight:700;
  text-align:center;
  font-size:11.5px;
  border-right:1px solid var(--line);
}
table.pr-grid tbody td{
  background:var(--card);
  cursor:pointer;
  user-select:none;
  touch-action:none;
}
table.pr-grid tbody td.sel{background:var(--accent-soft);}
table.pr-grid tbody td.sel-top{box-shadow:inset 0 2px 0 0 var(--accent);}
table.pr-grid tbody td.sel-bottom{box-shadow:inset 0 -2px 0 0 var(--accent);}
table.pr-grid tbody td.sel-left{box-shadow:inset 2px 0 0 0 var(--accent);}
table.pr-grid tbody td.sel-right{box-shadow:inset -2px 0 0 0 var(--accent);}
table.pr-grid tbody td.sel-top.sel-left{box-shadow:inset 2px 0 0 0 var(--accent), inset 0 2px 0 0 var(--accent);}
table.pr-grid tbody td.sel-top.sel-right{box-shadow:inset -2px 0 0 0 var(--accent), inset 0 2px 0 0 var(--accent);}
table.pr-grid tbody td.sel-bottom.sel-left{box-shadow:inset 2px 0 0 0 var(--accent), inset 0 -2px 0 0 var(--accent);}
table.pr-grid tbody td.sel-bottom.sel-right{box-shadow:inset -2px 0 0 0 var(--accent), inset 0 -2px 0 0 var(--accent);}

/* crop-mark corner glyphs marking the selection */
table.pr-grid tbody td.sel-tl,
table.pr-grid tbody td.sel-tr,
table.pr-grid tbody td.sel-bl,
table.pr-grid tbody td.sel-br{position:relative;}
table.pr-grid tbody td.sel-tl::after{content:"";position:absolute;top:-1px;left:-1px;width:9px;height:9px;border-top:2px solid var(--accent);border-left:2px solid var(--accent);}
table.pr-grid tbody td.sel-tr::after{content:"";position:absolute;top:-1px;right:-1px;width:9px;height:9px;border-top:2px solid var(--accent);border-right:2px solid var(--accent);}
table.pr-grid tbody td.sel-bl::after{content:"";position:absolute;bottom:-1px;left:-1px;width:9px;height:9px;border-bottom:2px solid var(--accent);border-left:2px solid var(--accent);}
table.pr-grid tbody td.sel-br::after{content:"";position:absolute;bottom:-1px;right:-1px;width:9px;height:9px;border-bottom:2px solid var(--accent);border-right:2px solid var(--accent);}

.pr-status{
  margin-top:10px;font-size:12.5px;color:#8792a0;
  min-height:16px;
}
.pr-status.err{color:var(--danger);font-weight:700;}
.pr-status.ok{color:#2c6e49;font-weight:700;}

/* ---- Output options (PDF) ---- */
.pr-opt-row{ display:flex; gap:18px; flex-wrap:wrap; margin-bottom:14px; }
.pr-opt-group{ display:flex; flex-direction:column; gap:6px; }
.pr-opt-group .pr-grp-label{ font-size:11.5px; font-weight:700; color:#6b7684; }
.pr-seg{ display:flex; border:1.5px solid var(--line); border-radius:6px; overflow:hidden; }
.pr-seg button{
  font-family:inherit; font-size:12.5px; font-weight:600;
  background:var(--card); color:var(--navy-deep);
  border:none; padding:7px 12px; cursor:pointer;
  border-right:1px solid var(--line);
}
.pr-seg button:last-child{ border-right:none; }
.pr-seg button.active{ background:var(--navy-deep); color:#fff; }

@media (max-width:640px){
  table.pr-grid td, table.pr-grid th{padding:4px 6px;font-size:11.5px;}
}
