/* Drawing Number Extract – card, drop zone and button styles shared with Revision Renamer / PDF Compress;
   colours, fonts, tool bar and theme come from ../shared/rm-tools.css */
* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}
main.container { padding: 28px 20px 60px; }


/* Hero band */
.dn-hero { padding: 40px 0 34px; }
.dn-hero h1 { margin: 0 0 8px; font-size: clamp(2rem, 5vw, 2.9rem); line-height: 1.08; }
.dn-hero p { margin: 0; max-width: 560px; }

.card {
  background: var(--rm-surface);
  border: 1px solid var(--rm-border);
  border-radius: var(--rm-radius-lg);
  padding: 20px 24px;
  margin-bottom: 20px;
  box-shadow: var(--rm-shadow-sm);
}
.card h2 {
  margin: 0 0 14px;
  font-size: 1.35rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}
.step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: var(--rm-radius-sm);
  background: var(--rm-primary);
  color: var(--rm-primary-ink);
  font: 600 .8rem var(--rm-mono);
}

.dropzone {
  border: 2px dashed var(--rm-border);
  border-radius: var(--rm-radius);
  padding: 28px;
  text-align: center;
  color: var(--rm-muted);
  background: var(--rm-surface-2);
  transition: background 0.15s, border-color 0.15s;
}
.dropzone.is-dragover {
  background: var(--rm-primary-soft);
  border-color: var(--rm-primary);
}
.dropzone p { margin: 0 0 12px; }
.drop-icon { width: 34px; height: 34px; margin-bottom: 6px; fill: none; stroke: var(--rm-primary); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* The file input stays focusable (keyboard users tab to it) but is invisible; the label is the button */
.visually-hidden { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.browse-btn { position: relative; }
.browse-btn:focus-within { outline: 2px solid var(--rm-primary); outline-offset: 2px; }

.btn--large { padding: 12px 26px; font-size: 1rem; min-height: 46px; }
.btn--small { padding: 6px 12px; font-size: 0.82rem; min-height: 32px; }
.rm-btn:disabled { opacity: 0.55; cursor: wait; }

.action-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.status-msg { font-size: 0.9rem; color: var(--rm-primary); }
.status-msg.is-error { color: var(--rm-danger); }

.table-scroll { overflow-x: auto; border: 1px solid var(--rm-border); border-radius: var(--rm-radius); }
.output-note { font-size: 0.85rem; line-height: 1.6; color: var(--rm-muted); margin: 14px 0 0; }



/* ---------- Drawing Number Extract ---------- */
.dn-hero p code { font: .9em var(--rm-mono); color: var(--rm-amber); }
.drop-meta { margin: 12px 0 0 !important; font: .78rem var(--rm-mono); color: var(--rm-muted); }
.rules { margin: 16px 0 0; padding: 12px 16px 12px 34px; border: 1px solid var(--rm-border); border-radius: var(--rm-radius); background: var(--rm-surface-2); font-size: .9rem; line-height: 1.55; }
.rules li + li { margin-top: 4px; }
.file-line { margin: 14px 0 0; font-weight: 600; }
.file-line.is-error { color: var(--rm-danger); }

.notice { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 20px; padding: 14px 16px; border: 1px solid var(--rm-amber); border-radius: var(--rm-radius); background: var(--rm-surface); line-height: 1.5; }
.notice svg { width: 22px; height: 22px; flex-shrink: 0; fill: none; stroke: var(--rm-amber); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.viewer-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.pager, .zoom { display: flex; align-items: center; gap: 6px; }
.pager span { font: 600 .85rem var(--rm-mono); min-width: 110px; text-align: center; }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: .9rem; }
.check input { width: 17px; height: 17px; accent-color: var(--rm-primary); }
.preview-line { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; padding: 10px 14px; border: 1px solid var(--rm-border); border-radius: var(--rm-radius); background: var(--rm-surface-2); }
.preview-line span { color: var(--rm-muted); font-size: .9rem; }
.preview-name { font: 600 1.05rem var(--rm-mono); color: var(--rm-primary); word-break: break-all; }
.preview-name.is-empty { color: var(--rm-muted); font: italic .95rem var(--rm-body); }

.viewer { max-height: 75vh; overflow: auto; border: 1px solid var(--rm-border); border-radius: var(--rm-radius); background: var(--rm-surface-2); }
.sheet { position: relative; margin: 0 auto; cursor: crosshair; touch-action: none; user-select: none; }
.sheet canvas { display: block; background: #fff; }
.box { position: absolute; border: 2px solid #e8590c; background: rgba(255, 176, 32, .18); cursor: move; box-sizing: border-box; }
.box .h { position: absolute; width: 12px; height: 12px; background: #fff; border: 2px solid #e8590c; border-radius: 2px; }
.box .nw { left: -7px; top: -7px; cursor: nwse-resize; }
.box .ne { right: -7px; top: -7px; cursor: nesw-resize; }
.box .sw { left: -7px; bottom: -7px; cursor: nesw-resize; }
.box .se { right: -7px; bottom: -7px; cursor: nwse-resize; }
.hint { margin: 10px 0 0; font-size: .85rem; color: var(--rm-muted); }

.action-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.progress { height: 6px; margin-top: 14px; border-radius: 999px; background: var(--rm-surface-2); border: 1px solid var(--rm-border); overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: var(--rm-primary); transition: width .2s; }
#statusMsg { margin: 14px 0 0; }
.status-msg:empty { display: none; }
.table-scroll { max-height: 460px; overflow: auto; margin-top: 14px; border: 1px solid var(--rm-border); border-radius: var(--rm-radius); }
.dn-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.dn-table th { position: sticky; top: 0; background: var(--rm-surface-2); color: var(--rm-muted); font: 600 .7rem var(--rm-mono); letter-spacing: .12em; text-transform: uppercase; text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--rm-border); }
.dn-table td { padding: 7px 12px; border-bottom: 1px solid var(--rm-border); }
.dn-table tbody tr:nth-child(even) { background: var(--rm-surface-2); }
.dn-table tbody tr:last-child td { border-bottom: 0; }
.dn-table .col-num { width: 64px; text-align: center; font-family: var(--rm-mono); }
.dn-table .col-status { width: 280px; }
.dn-table td.name { font-family: var(--rm-mono); word-break: break-all; }
.dn-table .muted { color: var(--rm-muted); }
.st { font-weight: 600; }
.st-ok { color: var(--rm-success); }
.st-bad { color: var(--rm-danger); }
.output-note code { font: .9em var(--rm-mono); }

@media (max-width: 560px) {
  .viewer-bar { gap: 10px; }
  .dn-table .col-status { width: auto; }
  .action-bar .rm-btn { flex: 1 1 100%; justify-content: center; }
}
