/* Design tokens (--bg, --text, --primary, dark-mode overrides, etc.) now
   live in shared-tokens.css, loaded before this file — see each HTML
   page's <head>. Todo loads the same file cross-origin. */

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.topbar-brand,
.topbar-nav,
.topbar-actions {
    display: flex;
    align-items: center;
}

.topbar-brand {
    gap: 16px;
}

.topbar .brand {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text);
}

.topbar nav a {
    margin-left: 4px;
    padding: 6px 14px;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.9rem;
    border-radius: 9999px;
    transition: background 0.15s, color 0.15s;
}

.topbar nav a:hover {
    background: #fff1ee;
    color: var(--primary);
    text-decoration: none;
}

.topbar nav a.active {
    background: var(--primary);
    color: #fff;
}

.app-switcher {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.app-switcher-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: none;
    border: none;
    border-radius: 9999px;
    color: var(--text-muted);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.app-switcher-btn:hover {
    background: #fff1ee;
    color: var(--text);
}

.app-switcher-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 200;
    display: flex;
    flex-direction: row;
    gap: 4px;
    padding: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

/* An author-stylesheet `display` rule on this element would otherwise beat
   the UA stylesheet's [hidden] { display: none } regardless of specificity,
   since author styles always win over UA styles — so the `hidden` attribute
   needs its own explicit override here to actually hide the menu. */
.app-switcher-menu[hidden] {
    display: none;
}

.topbar .app-switcher-menu a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 64px;
    margin-left: 0;
    padding: 8px 4px;
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 500;
    text-align: center;
}

.topbar .app-switcher-menu a img {
    border-radius: 6px;
}

.topbar .app-switcher-menu a:hover {
    background: var(--surface-alt);
    text-decoration: none;
}

.topbar .app-switcher-menu a.current {
    background: #fff1ee;
    color: var(--primary);
    font-weight: 700;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 32px 20px;
}

.container.narrow {
    max-width: 420px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 16px;
}

h1 { font-size: 1.5rem; margin: 0 0 16px; }
h2 { font-size: 1.15rem; margin: 0 0 12px; }
p.muted, span.muted { color: var(--text-muted); font-size: 0.9rem; }

code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-alt);
    border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; font-size: 0.9em;
}

label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 4px;
    margin-top: 12px;
}

input[type=text], input[type=email], input[type=password], input[type=url], textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
    background: var(--surface);
    color: var(--text);
}

textarea { resize: vertical; }

input.invalid { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: 0.8rem; margin-top: 4px; min-height: 1em; }

.password-field { position: relative; }
.password-field input { padding-right: 52px; }
.toggle-visibility {
    position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
    background: none; border: none; color: var(--text-muted); cursor: pointer;
    padding: 4px 8px; font-size: 0.75rem; font-weight: 600;
}
.toggle-visibility:hover { background: none; color: var(--text); }

button, .btn {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

button:hover, .btn:hover { background: var(--primary-hover); text-decoration: none; }
button:disabled { opacity: 0.6; cursor: not-allowed; }

button.secondary, .btn.secondary {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
}
button.secondary:hover, .btn.secondary:hover { background: var(--bg); }

button.danger, .btn.danger { background: var(--danger); }
button.danger:hover, .btn.danger:hover { background: var(--danger-hover); }

.btn-row { display: flex; gap: 8px; margin-top: 16px; align-items: center; }

.error-msg {
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    color: var(--danger);
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    margin-top: 12px;
}

.success-msg {
    background: var(--success-bg);
    border: 1px solid var(--success-border);
    color: var(--success-text);
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    margin-top: 12px;
}

.tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.tabs button {
    background: none; color: var(--text-muted); border: none; border-bottom: 2px solid transparent;
    border-radius: 0; padding: 8px 4px; margin-right: 16px; font-weight: 600;
}
.tabs button.active { color: var(--primary); border-bottom-color: var(--primary); }
.tabs button:hover { background: none; text-decoration: none; }

.guide-list { display: flex; flex-direction: column; gap: 10px; }
.guide-row {
    display: flex; align-items: center; justify-content: space-between;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 14px 18px;
}
.guide-row .title { font-weight: 600; }
.guide-row .meta { color: var(--text-muted); font-size: 0.85rem; margin-top: 2px; }
.guide-row[draggable=true] { cursor: grab; }
.guide-row.dragging { opacity: 0.4; }
.badge {
    display: inline-block; font-size: 0.75rem; font-weight: 600; padding: 2px 8px; border-radius: 999px;
    background: var(--badge-bg); color: var(--primary); margin-left: 8px;
}
.badge.recording { background: var(--badge-recording-bg); color: var(--badge-recording-text); }
.badge.shared { background: var(--badge-shared-bg); color: var(--badge-shared-text); }
.badge.stalled { background: var(--error-bg); color: var(--danger); }

/* ---- Breadcrumbs ---- */
.breadcrumbs { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 16px; }
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs a:hover { color: var(--primary); }
.breadcrumbs .sep { margin: 0 6px; }
.breadcrumbs .current { color: var(--text); font-weight: 600; }

/* ---- List toolbar (search / filter / sort) ---- */
.list-toolbar {
    display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px;
}
.list-toolbar input[type=text] { max-width: 260px; }
.list-toolbar select {
    padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 0.9rem;
    background: var(--surface); color: var(--text); font-family: inherit;
}
.list-toolbar .spacer { flex: 1; }
.list-toolbar .result-count { color: var(--text-muted); font-size: 0.85rem; }

/* ---- Bulk selection ---- */
.select-row { display: flex; align-items: center; gap: 12px; }
.select-row input[type=checkbox] { width: 16px; height: 16px; cursor: pointer; flex-shrink: 0; }
.select-checkbox-spacer { display: inline-block; width: 16px; flex-shrink: 0; }
.bulk-bar {
    display: none; align-items: center; gap: 10px; background: var(--badge-bg); border: 1px solid var(--primary);
    border-radius: var(--radius); padding: 10px 14px; margin-bottom: 12px; font-size: 0.9rem;
}
.bulk-bar.visible { display: flex; }
.bulk-bar .spacer { flex: 1; }
.select-all-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; color: var(--text-muted); font-size: 0.85rem; }
.select-all-row input[type=checkbox] { width: 16px; height: 16px; cursor: pointer; }

.empty-state { text-align: center; color: var(--text-muted); padding: 48px 20px; }
.empty-state h2 { font-size: 1.15rem; margin: 0 0 8px; color: var(--text); }
.empty-state .onboarding-steps {
    text-align: left; max-width: 340px; margin: 16px auto; padding-left: 20px; color: var(--text);
}
.empty-state .onboarding-steps li { margin-bottom: 6px; }

.step-card {
    position: relative;
    display: flex; flex-direction: column; gap: 12px; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 16px; margin-bottom: 34px; cursor: grab;
}
.step-card.dragging { opacity: 0.4; }

/* "Insert step below" affordance: a "+" circle centered on a divider line
   straddling the gap between this card and the next one. */
.insert-step-row {
    position: absolute; left: 0; right: 0; bottom: -17px;
    display: flex; align-items: center; justify-content: center;
    z-index: 3;
}
.insert-step-row::before {
    content: ''; position: absolute; left: 0; right: 0; top: 0; border-top: 1px solid var(--border);
}
.insert-step-btn {
    position: relative; width: 26px; height: 26px; padding: 0; border-radius: 50%;
    border: 1px solid var(--border); background: var(--bg); color: var(--text-muted);
    display: flex; align-items: center; justify-content: center; font-size: 16px; line-height: 1;
    cursor: pointer; transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.15s;
}
.insert-step-btn:hover { background: var(--primary); border-color: var(--primary); color: #fff; transform: scale(1.1); }
/* Unscoped (not `.step-card .screenshot-wrap`) on purpose: the lightbox
   re-parents this element out of .step-card into .lightbox-frame, and it
   must keep establishing its own containing block wherever it ends up, or
   its absolutely-positioned children (marker, annotation SVG/blur/handles)
   size themselves against the wrong ancestor instead of the image.
   `align-self: flex-start` opts out of .step-card's flex stretch so the wrap
   shrink-wraps to the image's actual rendered box (a no-op outside a flex
   parent, e.g. inside .lightbox-frame, so it's safe to leave unscoped too). */
.screenshot-wrap { position: relative; align-self: flex-start; max-width: 100%; }
.step-card img {
    /* width/height both auto (not width:100% + object-fit:contain) so the
       image's CSS layout box always equals its visible pixels — with a
       forced width and only max-height capped, a narrower-than-wide
       screenshot gets letterboxed by object-fit inside a box that stays
       full width, and percentage-positioned overlays (marker, annotations)
       end up placed relative to that full-width box instead of the visibly
       narrower image, drifting off from where they should be. */
    display: block; width: auto; height: auto; max-width: 100%; max-height: 560px;
    border: 1px solid var(--border); border-radius: 6px; background: var(--surface-alt);
}
.click-marker {
    position: absolute; width: 16px; height: 16px; margin-left: -11px; margin-top: -11px;
    border-radius: 50%; background: #dc2626; border: 3px solid #fff;
    box-shadow: 0 0 0 2px #dc2626, 0 2px 6px rgba(0,0,0,0.35); pointer-events: none;
}
.click-marker::after {
    content: ''; position: absolute; inset: -8px; border-radius: 50%; border: 2px solid #dc2626;
    animation: marker-ping 1.6s ease-out infinite;
}
.click-marker.editable { pointer-events: auto; cursor: grab; touch-action: none; }
.click-marker.editable.dragging-marker { cursor: grabbing; }
.click-marker.editable.dragging-marker::after { animation: none; opacity: 0; }
@keyframes marker-ping {
    0% { transform: scale(0.6); opacity: 0.8; }
    100% { transform: scale(1.8); opacity: 0; }
}
.step-card .step-body { flex: 1; min-width: 0; }
.step-card .step-num {
    display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px;
    background: var(--primary); color: #fff; border-radius: 50%; font-size: 0.75rem; font-weight: 700;
    margin-right: 8px;
}
.step-card .step-url { color: var(--text-muted); font-size: 0.8rem; margin-bottom: 8px; word-break: break-all; }
.step-card .step-actions { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.step-card .step-status { font-size: 0.8rem; }

/* Read-only rendering of a step's rich-text description (preview/share pages). */
.step-card .step-description { color: var(--text); font-size: 0.95rem; line-height: 1.5; }
.step-card .step-description p { margin: 0 0 0.6em; }
.step-card .step-description p:last-child { margin-bottom: 0; }

/* ---- Quill rich-text editor (step description, editor only) ---- */
.description-editor-wrap { margin-top: 4px; }
.description-editor-wrap .ql-toolbar.ql-snow {
    border: 1px solid var(--border); border-bottom: none; border-radius: 6px 6px 0 0; background: var(--surface-alt);
}
.description-editor-wrap .ql-container.ql-snow {
    border: 1px solid var(--border); border-radius: 0 0 6px 6px; background: var(--surface);
    font-family: inherit; font-size: 0.95rem;
}
.description-editor-wrap .ql-editor { color: var(--text); min-height: 80px; }
.description-editor-wrap .ql-editor.ql-blank::before { color: var(--text-muted); font-style: normal; }
.description-editor-wrap .ql-snow .ql-stroke { stroke: var(--text-muted); }
.description-editor-wrap .ql-snow .ql-fill { fill: var(--text-muted); }
.description-editor-wrap .ql-snow .ql-picker { color: var(--text-muted); }
.description-editor-wrap .ql-snow .ql-picker-options { background: var(--surface); border: 1px solid var(--border); }
.description-editor-wrap .ql-snow.ql-toolbar button:hover .ql-stroke { stroke: var(--primary); }
.description-editor-wrap .ql-snow.ql-toolbar button:hover .ql-fill { fill: var(--primary); }
.description-editor-wrap .ql-snow.ql-toolbar button.ql-active .ql-stroke { stroke: var(--primary); }

/* ---- Persistent zoom/crop view ----
   The wrap gets a definite width (viewport-relative, matching the lightbox's
   own responsive pattern below) so its `aspect-ratio` — set from JS once the
   image's natural size is known, see applyZoomFrame in common.js — has
   something to compute a height from; the image itself is absolutely
   positioned and scaled via plain percentages (also set from JS) so the
   saved crop region fills the wrap exactly. */
.screenshot-wrap.screenshot-zoomed { width: min(92vw, 640px); overflow: hidden; }
.lightbox-frame .screenshot-wrap.screenshot-zoomed { width: min(92vw, 1100px); }
.screenshot-wrap.screenshot-zoomed img { position: absolute; top: 0; left: 0; border-radius: 0; }
.zoom-badge {
    position: absolute; top: 8px; left: 8px; background: rgba(0,0,0,0.55); color: #fff;
    font-size: 0.7rem; font-weight: 600; padding: 3px 8px; border-radius: 999px; z-index: 2;
    pointer-events: none;
}

/* ---- Crop picker (lightbox "Zoom View" mode) ---- */
.crop-overlay { position: absolute; inset: 0; cursor: crosshair; z-index: 6; touch-action: none; }
.crop-select-box {
    position: absolute; border: 2px dashed #fff; background: rgba(37, 99, 235, 0.25);
    box-shadow: 0 0 0 2000px rgba(0,0,0,0.4); pointer-events: none;
}
.crop-controls { margin-top: 12px; text-align: center; }
.crop-controls .btn-row { justify-content: center; }

.token-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 0; border-bottom: 1px solid var(--border);
}

/* ---- Extension connection status ---- */
.extension-status { display: flex; align-items: center; gap: 12px; }
.status-dot {
    width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; background: var(--text-muted);
}
.extension-status.status-ok .status-dot { background: var(--success-text); box-shadow: 0 0 0 4px var(--success-bg); }
.extension-status.status-idle .status-dot,
.extension-status.status-warn .status-dot { background: var(--badge-recording-text); box-shadow: 0 0 0 4px var(--badge-recording-bg); }
.extension-status.status-none .status-dot { background: var(--danger); box-shadow: 0 0 0 4px var(--error-bg); }
.token-plaintext {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--token-bg); border: 1px solid var(--token-border);
    padding: 10px 12px; border-radius: 6px; word-break: break-all; font-size: 0.9rem; margin-top: 8px;
    color: var(--text);
}

.share-box { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.share-box input { flex: 1; }

/* ---- Collaborators ---- */
.collaborator-row {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 10px 0; border-bottom: 1px solid var(--border);
}
.collaborator-row:last-child { border-bottom: none; }
.collaborator-row .collaborator-name { font-weight: 600; }
.collaborator-row .collaborator-email { color: var(--text-muted); font-size: 0.85rem; }
.collaborator-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.collaborator-actions select {
    padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px;
    background: var(--surface); color: var(--text); font-family: inherit; font-size: 0.85rem;
}
.badge.role-owner { background: var(--badge-shared-bg); color: var(--badge-shared-text); }
.badge.role-editor { background: var(--badge-bg); color: var(--primary); }
.badge.role-viewer { background: var(--surface-alt); color: var(--text-muted); }
.invite-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.invite-form input[type=email] { flex: 1; min-width: 180px; }
.invite-form select {
    padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px;
    background: var(--surface); color: var(--text); font-family: inherit; font-size: 0.9rem;
}
.role-banner {
    display: flex; align-items: center; gap: 8px; background: var(--badge-bg); color: var(--primary);
    border-radius: var(--radius); padding: 10px 14px; margin-bottom: 16px; font-size: 0.9rem; font-weight: 600;
}

.share-meta { margin-top: 10px; font-size: 0.85rem; }
.share-meta .sep { margin: 0 6px; }
.share-settings {
    display: flex; flex-direction: column; gap: 10px; margin-top: 14px; padding-top: 14px;
    border-top: 1px solid var(--border);
}
.share-setting-row { display: flex; align-items: center; gap: 8px; }
.share-setting-row label { flex-shrink: 0; width: 90px; margin: 0; font-size: 0.85rem; font-weight: 600; }
.share-setting-row select { padding: 7px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); font-family: inherit; font-size: 0.9rem; }
.share-setting-row input[type=text] { max-width: 220px; }

.loading { color: var(--text-muted); padding: 20px; text-align: center; }

/* .skeleton/.skeleton-row/@keyframes skeleton-shimmer and the toast/
   confirm-modal component styles now live in shared-ui.css (loaded before
   this file), except this one screen-specific tweak: */

/* ---- Copy feedback ---- */
button.copied, button.copied:hover { background: var(--success-text); }

/* ---- Lightbox (click-to-zoom) ---- */
.lightbox-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.8); z-index: 1002;
    display: flex; align-items: center; justify-content: center; padding: 32px;
    opacity: 0; transition: opacity 0.2s ease;
}
.lightbox-overlay.show { opacity: 1; }
.lightbox-frame { position: relative; max-width: 100%; max-height: 100%; line-height: 0; }
.lightbox-frame img {
    display: block; max-width: 100%; max-height: calc(100vh - 64px); object-fit: contain;
    border-radius: 6px; background: var(--surface-alt);
}
.lightbox-close {
    position: absolute; top: -16px; right: -16px; width: 32px; height: 32px; border-radius: 50%;
    background: var(--surface); color: var(--text); border: 1px solid var(--border);
    font-size: 1.1rem; line-height: 1; display: flex; align-items: center; justify-content: center;
    padding: 0; cursor: pointer;
}
.lightbox-close:hover { background: var(--bg); }
.zoom-btn {
    position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border-radius: 6px;
    background: rgba(0,0,0,0.55); color: #fff; border: none; font-size: 0.95rem; line-height: 1;
    display: flex; align-items: center; justify-content: center; padding: 0; cursor: pointer;
}
.zoom-btn:hover { background: rgba(0,0,0,0.75); }

/* The lightbox re-parents the real .screenshot-wrap (and, in the editor,
   its annotation toolbar) rather than cloning it — see openScreenshotLightbox
   in common.js — so marker drag / annotation drawing keep working at the
   larger size. These overrides keep the wrap's box exactly matching the
   image's rendered box (shrink-wrapped), so percentage-based marker/
   annotation coordinates still line up correctly. */
.lightbox-frame .screenshot-wrap {
    display: inline-block;
    max-width: min(92vw, 1100px);
}
.lightbox-frame .screenshot-wrap img {
    display: block; width: auto; height: auto;
    max-width: min(92vw, 1100px); max-height: calc(100vh - 140px);
}
.lightbox-frame .annotation-toolbar { margin-top: 12px; justify-content: center; }
.screenshot-wrap.lightbox-active .zoom-btn { display: none; }
.screenshot-wrap.zoomable { cursor: zoom-in; }

/* ---- Annotation overlay (rect/arrow/blur) ---- */
.annotation-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.annotation-shape {
    stroke: var(--danger); stroke-width: 2; fill: none; vector-effect: non-scaling-stroke;
}
.annotation-arrowhead-fill { fill: var(--danger); }
.annotation-blur {
    position: absolute; backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(8px);
    background: rgba(0,0,0,0.12); border-radius: 2px; pointer-events: none;
}
.annotation-delete {
    position: absolute; width: 18px; height: 18px; margin-top: -24px; margin-left: -2px;
    border-radius: 50%; background: var(--danger); color: #fff; border: 2px solid var(--surface);
    font-size: 0.7rem; line-height: 1; display: flex; align-items: center; justify-content: center;
    padding: 0; cursor: pointer; z-index: 3;
}
.annotation-delete:hover { background: var(--danger-hover); }

/* Move (rect/blur body drag) and resize/endpoint handles. */
.annotation-move {
    position: absolute; cursor: move; pointer-events: auto; z-index: 1;
}
.annotation-handle {
    position: absolute; width: 12px; height: 12px; margin: -6px 0 0 -6px;
    border-radius: 50%; background: var(--surface); border: 2px solid var(--danger);
    pointer-events: auto; z-index: 2; box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.annotation-handle[data-corner="x1y1"], .annotation-handle[data-corner="x2y2"] { cursor: nwse-resize; }
.annotation-handle[data-corner="x2y1"], .annotation-handle[data-corner="x1y2"] { cursor: nesw-resize; }
.annotation-handle[data-corner="start"], .annotation-handle[data-corner="end"] { cursor: crosshair; }

/* Tool-active cursor feedback on the screenshot itself. */
.screenshot-wrap[data-tool="rect"], .screenshot-wrap[data-tool="arrow"], .screenshot-wrap[data-tool="blur"] {
    cursor: crosshair;
}

/* ---- Add-marker hint (click-to-place) ---- */
.add-marker-hint {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.25); color: #fff; font-size: 0.85rem; font-weight: 600;
    opacity: 0; transition: opacity 0.15s ease; cursor: crosshair; border-radius: 6px;
}
.step-card .screenshot-wrap:hover .add-marker-hint { opacity: 1; }

/* ---- Editor: step title, annotation toolbar, reorder buttons ---- */
.step-title-input {
    font-weight: 600; border: 1px solid transparent; background: transparent; padding: 2px 4px;
    border-radius: 4px; margin: 0;
}
.step-title-input:hover, .step-title-input:focus { border-color: var(--border); background: var(--surface); }
.step-heading-row { display: flex; align-items: center; gap: 4px; }
.step-heading-row .step-title-input { flex: 1; font-size: 1rem; }

.annotation-toolbar { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.tool-btn {
    background: var(--surface); color: var(--text); border: 1px solid var(--border);
    padding: 5px 10px; font-size: 0.8rem; font-weight: 600; border-radius: 6px; cursor: pointer;
}
.tool-btn:hover { background: var(--bg); }
.tool-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.icon-btn { padding: 8px 10px; line-height: 1; }
.icon-btn:disabled { opacity: 0.35; }

.preview-banner {
    background: var(--badge-bg); border: 1px solid var(--primary); color: var(--text);
    padding: 10px 14px; border-radius: 6px; font-size: 0.85rem; margin-bottom: 16px;
}
.preview-banner a { font-weight: 600; margin-left: 6px; }

/* ---- Password-protected share prompt ---- */
.password-prompt { max-width: 360px; margin: 48px auto; text-align: center; }
.password-prompt .card { text-align: left; }

/* ---- Print / PDF export ---- */
@media print {
    .no-print, .topbar, .breadcrumbs, .preview-banner, .card,
    .zoom-btn, .add-marker-hint, .annotation-delete { display: none !important; }
    body { background: #fff; }
    .container { max-width: 100%; padding: 0; }
    .step-card {
        border: none; box-shadow: none; padding: 0; margin-bottom: 24px;
        break-inside: avoid; page-break-inside: avoid;
    }
    .step-card img { max-height: none; }
    .click-marker::after { animation: none; }
}
