/* ==========================================================================
   DRAWING HOME & DRAWING PAGE (Drawings module)
   ========================================================================== */
.pill.awaiting { background: var(--warn-soft); color: var(--ink); }
.pill.confirmed { background: var(--accent-soft); color: var(--ink); }
.pill.approved { background: var(--ok-soft); color: var(--ink); }
.pill.approved::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
.pill.superseded { background: var(--surface-3); color: var(--ink-3); text-decoration: line-through; }
.pill.none { background: transparent; color: var(--ink-3); border: 1px dashed var(--line-strong); }

.dh-toolbar { margin-bottom: 14px; }
.dh-layout { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 18px; align-items: start; }
.dh-layout .data-table td.cat { max-width: 260px; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); }

.dh-rail { padding: 8px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; }
.rail-title { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-3); padding: 8px 10px 6px; }
.rail-btn {
    display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
    background: none; border: 1px solid transparent; border-radius: 8px; padding: 8px 10px;
    font-size: 13px; color: var(--ink-2); cursor: pointer; transition: var(--transition-fast);
}
.rail-btn i { width: 16px; text-align: center; color: var(--ink-3); font-size: 12px; }
.rail-btn em { margin-left: auto; font-style: normal; color: var(--ink-3); font-variant-numeric: tabular-nums; font-size: 12px; }
.rail-btn:hover { background: var(--surface-2); color: var(--ink); }
.rail-btn[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--link-line); color: var(--ink); font-weight: 600; }
.rail-btn[aria-pressed="true"] i { color: var(--ink); }
.rail-btn.sub { padding: 5px 10px 5px 36px; font-size: 12.5px; }
.rail-btn.sub span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Drawing Home: revisions as sub-items */
.btn[aria-pressed="true"] { background: var(--surface-3); border-color: var(--ink-3); }
.btn.sm, .btn-primary.sm { padding: 4px 10px; font-size: 12px; gap: 6px; }
a.btn { text-decoration: none; }
.btn-icon {
    width: 32px; height: 32px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
    border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-size: 12px;
}
.btn-icon:hover:not(:disabled) { color: var(--ink); border-color: var(--line-strong); }
.btn-icon:disabled { opacity: 0.4; cursor: default; }
.btn-icon.sm { width: 28px; height: 28px; font-size: 11px; }
.btn-icon.danger:hover:not(:disabled) { color: var(--danger-strong); background: var(--danger-soft); border-color: var(--danger-soft); }
.dh-name { display: inline-flex; align-items: center; gap: 6px; }
.dh-caret {
    width: 22px; height: 22px; border: 0; background: none; border-radius: 5px; color: var(--ink-3);
    cursor: pointer; display: inline-flex; align-items: center; justify-content: center; margin-left: -6px;
}
.dh-caret:hover { background: var(--surface-3); color: var(--ink); }
.dh-caret i { font-size: 10px; transition: transform var(--transition-fast); }
.dh-caret[aria-expanded="true"] i { transform: rotate(90deg); }
.dh-caret-gap { width: 16px; display: inline-block; }
.dh-revcount { font-size: 11px; font-weight: 500; color: var(--ink-2); background: var(--surface-3); padding: 1px 8px; border-radius: 10px; }
.data-table tr.dh-sub td { background: var(--surface-2); padding-top: 8px; padding-bottom: 8px; font-size: 12.5px; }
.data-table tbody.clickable tr.dh-sub:hover td { background: var(--surface-3); }
.dh-sub-name { display: inline-flex; gap: 8px; align-items: center; padding-left: 22px; font-weight: 500; color: var(--ink-2); }
.dh-sub-name i { font-size: 10px; color: var(--ink-3); }
.data-table td .dim { color: var(--ink-3); font-size: 12px; }

/* Drawing Page: revision tabs and the stage bar */
.dp-revtabs { display: flex; align-items: flex-end; gap: 4px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.dp-revtab-list { display: flex; gap: 2px; flex-wrap: wrap; }
.dp-revtab {
    border: 1px solid transparent; border-bottom: 0; background: transparent; padding: 9px 16px; margin-bottom: -1px;
    border-radius: 8px 8px 0 0; font-size: 13px; font-weight: 500; color: var(--ink-2); cursor: pointer;
    display: inline-flex; gap: 8px; align-items: center; font-family: inherit;
}
.dp-revtab:hover { color: var(--ink); background: var(--surface-2); }
.dp-revtab .code { font-family: var(--font-mono); }
.dp-revtab[aria-selected="true"] { background: var(--surface); border-color: var(--line); color: var(--ink); font-weight: 600; box-shadow: inset 0 2px 0 var(--accent); }
.dp-revtab-none { padding: 9px 4px; font-size: 13px; color: var(--ink-3); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); flex: none; }
.dot.awaiting { background: var(--warn); }
.dot.confirmed { background: var(--accent); }
.dot.approved { background: var(--ok); }
.dot.superseded { background: var(--ink-3); opacity: 0.5; }
.dp-revtab-new {
    border: 0; background: none; color: var(--ink-2); font: inherit; font-size: 12.5px; font-weight: 500; padding: 9px 12px;
    cursor: pointer; display: inline-flex; gap: 6px; align-items: center; border-radius: 8px 8px 0 0;
}
.dp-revtab-new:hover { color: var(--ink); background: var(--surface-2); }
.dp-stagebar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: -4px; }
.dp-rev-note { font-size: 12.5px; color: var(--ink-3); }
.dp-stage-wrap { display: flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; }
.statusbar { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; max-width: 100%; background: var(--surface); }
.statusbar button {
    position: relative; border: 0; background: var(--surface); color: var(--ink-2); font: inherit; font-size: 12.5px; font-weight: 500;
    padding: 7px 14px 7px 26px; cursor: pointer; white-space: nowrap;
}
.statusbar button:first-child { padding-left: 16px; }
.statusbar button::after {
    content: ""; position: absolute; right: -11px; top: 50%; width: 22px; height: 22px; z-index: 1;
    transform: translateY(-50%) rotate(45deg); background: inherit;
    border-top: 1px solid var(--line-strong); border-right: 1px solid var(--line-strong);
}
.statusbar button:last-child::after { display: none; }
.statusbar button.done { background: var(--surface-2); color: var(--ink); }
.statusbar button.current { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.statusbar button:disabled { cursor: default; }
.statusbar button:not(:disabled):hover { background: var(--surface-3); color: var(--ink); }
.statusbar-note { font-size: 12.5px; color: var(--ink-3); padding: 7px 12px; }

/* Drawing Page: inline metadata editing */
.spec-list .fv {
    background: none; border: 1px solid transparent; border-radius: 6px; padding: 3px 8px; margin: -4px -9px;
    font: inherit; color: inherit; cursor: pointer; display: inline-flex; gap: 8px; align-items: center; text-align: left;
    max-width: calc(100% + 18px);
}
.spec-list .fv:hover, .spec-list .fv:focus-visible { border-color: var(--line-strong); background: var(--surface-2); }
.spec-list .fv .pen { font-size: 10.5px; color: var(--ink-3); opacity: 0; }
.spec-list .fv:hover .pen, .spec-list .fv:focus-visible .pen { opacity: 1; }
.spec-list .lock { font-size: 10.5px; color: var(--ink-3); }
.spec-list li.spec-lock-note { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--ink-3); background: var(--surface-2); border-radius: 0 0 10px 10px; }
.fe { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; width: 100%; margin: -4px 0; }
.fe input, .fe select {
    flex: 1; min-width: 140px; font: inherit; font-size: 13px; padding: 5px 9px; border: 1px solid var(--focus);
    border-radius: 6px; background: var(--surface); color: var(--ink); outline: none;
}
.fe input.mono { font-family: var(--font-mono); }
.fe-error { width: 100%; font-size: 12px; color: var(--danger-strong); }

/* Drawing Page: PDF */
.pdf-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.pdf-frame { margin: 0 20px 20px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface-2); }
.pdf-frame iframe { display: block; width: 100%; height: 760px; border: 0; }
.pdf-warn { margin: 0 20px 12px; padding: 8px 12px; border-radius: 6px; background: var(--warn-soft); color: var(--ink); font-size: 12.5px; display: flex; gap: 8px; align-items: baseline; }
.pdf-warn i { color: var(--warn-strong); }
.pdf-link { margin-top: 12px; width: 100%; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.pdf-search { display: flex; gap: 8px; width: 100%; }
.pdf-search input {
    flex: 1; min-width: 0; font: inherit; font-size: 13px; color: var(--ink); background: var(--surface);
    border: 1px solid var(--line-strong); border-radius: 8px; padding: 6px 10px; outline: none;
}
.pdf-search input:focus { border-color: var(--focus); }
.pdf-results { list-style: none; width: 100%; text-align: left; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); max-height: 300px; overflow-y: auto; }
.pdf-results li { display: flex; gap: 10px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.pdf-results li:last-child { border-bottom: 0; }
.pdf-results li > i { color: var(--ink-3); }
.pdf-results li div { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.pdf-results li b { font-weight: 500; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdf-results li span { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdf-msg { font-size: 12.5px; color: var(--ink-3); }
.pdf-msg.err { color: var(--danger-strong); }

/* Drawing Page: chatter */
.seg-sm button { padding: 4px 10px; font-size: 12px; }
.chatter { border-top: 1px solid var(--line); max-height: 640px; overflow-y: auto; padding-bottom: 8px; }
.chatter .none { text-align: center; color: var(--ink-3); padding: 24px 20px; font-size: 13px; }
.chatter-day { display: flex; align-items: center; gap: 12px; font-size: 12px; font-weight: 600; color: var(--ink-2); padding: 14px 20px 2px; }
.chatter-day::before, .chatter-day::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.chatter-msg { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; padding: 10px 20px; }
.chatter-msg .av {
    width: 30px; height: 30px; border-radius: 50%; background: var(--nml-deep); color: var(--nml-electric);
    display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600;
}
:root[data-theme="dark"] .chatter-msg .av { background: var(--nml-electric); color: var(--nml-deep); }
.chatter-msg .hd { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 12.5px; }
.chatter-msg .hd b { font-weight: 600; }
.chatter-msg .hd .when { color: var(--ink-3); font-size: 11.5px; }
.chatter-msg .hd .type-tag { font-size: 10.5px; padding: 1px 7px; }
.chatter-msg ul { list-style: none; margin-top: 4px; display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; }
.chatter-msg li { color: var(--ink-2); overflow-wrap: anywhere; }
.chatter-msg li::before { content: "\2022"; margin-right: 7px; color: var(--ink-3); }
.chatter-msg li.ev { color: var(--ink); }
.chatter-msg .new { color: var(--ink); font-weight: 600; }
.chatter-msg .arrow { color: var(--ink-3); font-size: 10px; margin: 0 6px; }
.chatter-msg .fld { color: var(--ink-3); font-style: italic; margin-left: 6px; }
.chatter-msg .empty { color: var(--ink-3); font-style: italic; font-weight: 400; }

/* Workflow stage editor */
.stage-edit { list-style: none; display: flex; flex-direction: column; gap: 6px; counter-reset: st; }
.stage-edit li { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.stage-edit li::before { counter-increment: st; content: counter(st); font-size: 12px; color: var(--ink-3); text-align: right; }
.stage-edit li.none { display: block; font-size: 13px; color: var(--ink-3); }
.stage-edit li.none::before { content: none; }
.stage-edit .acts { display: flex; gap: 4px; }
#dp-stage-add { align-self: flex-start; }
.dp-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.dp-col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.dp-empty { margin: 0 20px 20px; padding: 20px; text-align: center; color: var(--ink-3); border: 1px dashed var(--line-strong); border-radius: 8px; font-size: 13px; }

.pdf-placeholder {
    margin: 0 20px 20px; min-height: 220px; border: 1px dashed var(--line-strong); border-radius: 8px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
    padding: 24px; text-align: center; color: var(--ink-2); font-size: 13px; background: var(--surface-2);
}
.pdf-placeholder > i { font-size: 30px; color: var(--ink-3); }
.pdf-placeholder b { color: var(--ink); font-weight: 600; }
.pdf-paths { list-style: none; width: 100%; margin-top: 8px; text-align: left; display: flex; flex-direction: column; gap: 4px; }
.pdf-paths li { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-3); word-break: break-all; }
.pdf-paths li b { font-family: var(--font-sans); color: var(--ink-2); font-weight: 500; margin-right: 6px; }

.dp-notes, .comment-form { padding: 0 20px 20px; display: flex; flex-direction: column; gap: 8px; }
.dp-notes textarea, .comment-form textarea {
    width: 100%; font: inherit; font-size: 13px; color: var(--ink); background: var(--surface);
    border: 1px solid var(--line-strong); border-radius: 8px; padding: 8px 10px; outline: none; resize: vertical;
}
.dp-notes textarea:focus, .comment-form textarea:focus { border-color: var(--focus); }
.dp-notes textarea[readonly] { background: var(--surface-2); color: var(--ink-2); }
.dp-notes-foot { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.dp-hint { font-size: 12px; color: var(--ink-3); }
.dp-hint.warn { color: var(--warn-strong); }
.comment-form { flex-direction: row; align-items: flex-end; border-top: 1px solid var(--line); padding-top: 14px; }

.comments { list-style: none; border-top: 1px solid var(--line); max-height: 420px; overflow-y: auto; }
.comments li { padding: 12px 20px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; }
.comments li:last-child { border-bottom: 0; }
.comments .av {
    width: 30px; height: 30px; border-radius: 50%; background: var(--nml-deep); color: var(--nml-electric);
    display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600;
}
:root[data-theme="dark"] .comments .av { background: var(--nml-electric); color: var(--nml-deep); }
.comments .hd { display: flex; align-items: baseline; gap: 8px; font-size: 12.5px; }
.comments .hd b { font-weight: 600; }
.comments .hd span { color: var(--ink-3); font-size: 11.5px; }
.comments .hd button { margin-left: auto; background: none; border: 0; color: var(--ink-3); cursor: pointer; font-size: 11.5px; padding: 2px 4px; border-radius: 4px; }
.comments .hd button:hover { color: var(--danger-strong); background: var(--danger-soft); }
.comments .bd { font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 2px; }
.comments .none { display: block; color: var(--ink-3); font-size: 13px; text-align: center; padding: 24px 20px; }

