




#twpCalloutModal .twp-callout-content{position:relative;max-width:520px;width:min(94vw,520px);max-height:90dvh;overflow-y:auto;}
#twpCalloutModal .rich-text-editor{min-height:120px;}

* { box-sizing: border-box; }
:root {
    --navy: #003366; --blue: #2196f3; --teal: #0d9488; --orange: #f39c12;
    --violet: #EE82EE; --green: #2e9d44; --red: #d93025; --border: #d9dee5;
    --bg: #f4f6f8; --text: #20262e;
}
html, body { height: 100%; margin: 0; overflow: hidden; }
body { display: flex; flex-direction: column; font-family: Arial, Helvetica, sans-serif; background: var(--bg); color: var(--text); }

/* SECURITY GATEWAY */
.login-overlay {
    position: fixed; inset: 0; background: rgba(0, 35, 70, 0.96); z-index: 999999;
    display: flex; align-items: center; justify-content: center; backdrop-filter: blur(8px);
}
.login-card {
    width: 350px; max-width: calc(100vw - 32px); background: #fff; border-radius: 12px;
    padding: 26px 22px; text-align: center; box-shadow: 0 16px 45px rgba(0,0,0,0.35); border: 1px solid var(--border);
}
.login-icon { font-size: 36px; margin-bottom: 6px; }
.login-card h2 { margin: 0 0 6px; font-size: 19px; color: var(--navy); }
.login-card p { margin: 0 0 16px; font-size: 13px; color: #64748b; line-height: 1.4; }
.login-error-msg { color: #d93025; background: #fee2e2; padding: 7px; border-radius: 6px; font-size: 12px; font-weight: 600; margin-bottom: 12px; display: none; }
.login-btn { width: 100%; padding: 10px; font-size: 14px; font-weight: bold; border-radius: 6px; cursor: pointer; }

/* HEADER & ACTIONS */
.header {
    flex: 0 0 auto; min-height: 72px; height: auto; background: var(--navy); color: #fff;
    display: flex; justify-content: space-between; align-items: center; padding: 0 16px;
    z-index: 1000; box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
.header h2 { margin: 0; font-size: 21px; letter-spacing:.4px; color:#e4ffed; text-shadow:0 1px 2px rgba(0,0,0,.2); }
.header-actions button { background:#86efac !important; color:#123b24 !important; border:1px solid #4ade80 !important; font-weight:700; }
.header-actions button:hover { background:#bbf7d0 !important; }
.header-actions { flex-wrap:wrap; justify-content:flex-end; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.btn-upload-map { background: var(--teal); color: #fff; border-color: #0f766e; font-weight: 600; }
.btn-upload-map:hover { background: #0f766e; }
.btn-import-excel { background: #16a34a; color: #fff; border-color: #15803d; font-weight: 600; }
.btn-import-excel:hover { background: #15803d; }
.btn-logout { background: #dc2626; color: #fff; border: 1px solid #b91c1c; border-radius: 6px; padding: 7px 12px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.btn-logout:hover { background: #b91c1c; }

.signed-in-user{display:flex;flex-direction:column;align-items:center;max-width:185px;gap:3px}.signed-in-user span{font-size:10px;color:#e6f1ff;max-width:185px;overflow-wrap:anywhere;text-align:center;line-height:1.2}
.login-secondary-actions{display:flex;gap:8px;margin-top:10px}
.login-secondary-actions button{flex:1;font-size:12px;padding:8px 5px}
.twp-auth-modal{z-index:1000001}
.registration-card{width:410px;max-height:calc(100vh - 30px);overflow:auto}
.registration-plan{background:#f0f7ff;padding:10px;border-radius:7px;color:#17365a!important}
.registration-pay-link{display:block;background:#635bff;color:#fff;text-decoration:none;border-radius:6px;padding:11px;margin:8px 0;font-size:13px;font-weight:bold}
.registration-check{display:flex;align-items:center;gap:7px;font-size:12px;margin:12px 0}
.registration-check input{width:auto}
.auth-action-message{font-size:12px;line-height:1.4;margin:8px 0;color:#334155;overflow-wrap:anywhere}
/* Login project selection and authenticated actions */
#loginProjectGroup { transition: background .2s ease; border-radius:7px; padding:7px; }
#loginProjectGroup.authenticated { background:#dcfce7; }
#loginProjectGroup.authenticated select { background:#f0fdf4; border-color:#16a34a; }
#loginSubmitBtn.authenticated,#loginAdminBtn.authenticated { background:#166534 !important; border-color:#14532d !important; color:#fff !important; }
body.twp-admin-only { background:rgba(0,35,70,0.96); }
body.twp-admin-only > header,body.twp-admin-only > .dashboard,body.twp-admin-only > .legend,body.twp-admin-only > main { display:none !important; }
body.twp-admin-only #projectAdminModal { z-index:1000002 !important; background:rgba(0,35,70,0.96); backdrop-filter:blur(8px); }
/* DASHBOARD & LEGEND */
.dashboard { flex: 0 0 auto; display: grid; grid-template-columns: repeat(5, minmax(110px, 1fr)); gap: 8px; padding: 8px 12px; }
.card { background: #fff; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.card h3 { margin: 0 0 2px; font-size: 22px; }
.card span { font-size: 12px; color: #66717d; }
.legend {
    flex: 0 0 auto; background: #fff; margin: 0 12px 6px; padding: 6px 12px;
    border: 1px solid var(--border); border-radius: 8px; display: flex; flex-wrap: wrap; gap: 16px; font-size: 12px;
}
.legend-item { display: flex; align-items: center; gap: 6px; }
.legend-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }

/* MAIN & SIDEBAR */
.main { flex: 1 1 0; min-height: 0; display: flex; position: relative; overflow: hidden; }
.sidebar { width: 340px; min-width: 300px; height: 100%; overflow-y: auto; background: #fff; border-right: 1px solid var(--border); padding: 12px; position: relative; }
.search-control { position: relative; flex: 1; min-width: 0; }
.search-control input { width: 100%; }
.search-suggestions {
    position: absolute; left: 0; right: 0; top: calc(100% - 1px); max-height: 280px; overflow: auto;
    background: #fff; border: 1px solid #b9c1ca; border-radius: 0 0 6px 6px; box-shadow: 0 6px 14px rgba(0,0,0,.16); z-index: 500;
}
.search-suggestion { display: flex; align-items: center; gap: 7px; width: 100%; border: 0; text-align: left; padding: 8px 10px; background: #fff; font-size: 13px; cursor: pointer; }
.search-suggestion:hover, .search-suggestion.active { background: #eaf3ff; outline: none; }
.suggestion-kind { flex: 0 0 auto; font-size: 10px; font-weight: 700; text-transform: uppercase; color: #fff; background: #526779; border-radius: 3px; padding: 2px 5px; }
.suggestion-kind.markup { background: #a65312; }
.search-suggestion-text { overflow-wrap: anywhere; }
.search-row { position: sticky; top: 0; z-index: 200; padding-bottom: 8px; margin-bottom: 8px; background: #fff; }

.filters-grid { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.filter-chip { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border: 1px solid #d5dbe1; border-radius: 6px; background: #fff; font-size: 12px; font-weight: 600; cursor: pointer; }
.filter-chip input { width: 15px; height: 15px; cursor: pointer; }
.filter-chip.wip-chip { flex: 1 1 100%; }

.markup-summary-box { background: #f8fafc; border: 1px solid #dbe2ea; border-radius: 7px; padding: 10px; margin-bottom: 12px; }
.markup-summary-header { font-size: 12px; font-weight: 700; color: #2c3e50; margin-bottom: 6px; display: flex; justify-content: space-between; }
.markup-progress-bar { height: 10px; background: #e2e8f0; border-radius: 5px; display: flex; overflow: hidden; margin: 6px 0 8px; }
.progress-bar-fill { height: 100%; transition: width .2s ease; }
.progress-bar-fill.green { background: var(--green); }
.progress-bar-fill.orange { background: var(--orange); }
.progress-bar-fill.red { background: var(--red); }
.markup-summary-stats { display: flex; flex-wrap: wrap; gap: 6px; font-size: 11px; }
.stat-pill { padding: 2px 6px; border-radius: 4px; background: #fff; border: 1px solid #d1d5db; }
.stat-pill.green { border-color: #a7f3d0; background: #ecfdf5; color: #065f46; }
.stat-pill.orange { border-color: #fed7aa; background: #fff7ed; color: #9a3412; }
.stat-pill.red { border-color: #fecaca; background: #fef2f2; color: #991b1b; }
.stat-pill.total { border-color: #cbd5e1; background: #f1f5f9; color: #334155; font-weight: bold; }

.sidebar-section-title { font-size: 11px; font-weight: 700; text-transform: uppercase; color: #526779; letter-spacing: .5px; padding: 6px 0 4px; border-bottom: 1px solid #e4e7eb; margin: 10px 0 6px; }
.eqRow { border-bottom: 1px solid #e4e7eb; padding: 9px 7px; cursor: pointer; border-radius: 5px; }
.eqRow:hover { background: #eef4fa; }
.eqRow.markupRow:hover { background: #fff8f0; }
.eq-name { font-weight: bold; font-size: 13px; display: flex; justify-content: space-between; align-items: center; }
.eq-qty { font-size: 11px; color: #004b91; background: #e8f4fd; padding: 2px 6px; border-radius: 4px; font-weight: 600; }
.eq-type { color: #66717d; font-size: 12px; margin-top: 2px; overflow-wrap: anywhere; }
.eq-status { display: inline-block; margin-top: 5px; padding: 2px 6px; border-radius: 10px; font-size: 10px; color: #fff; }
.activity-badge { display: inline-block; padding: 1px 5px; border-radius: 3px; font-size: 10px; font-weight: bold; margin-right: 4px; background: #e2e8f0; color: #334155; }

/* VIEWER & OVERLAYS */
.viewer { flex: 1 1 0; height: 100%; overflow: auto; padding: 14px; background: #eef1f4; position: relative; }
.viewer.drop-target { outline: 3px dashed #0d9488; outline-offset: -6px; background: #e6fffb; }
.image-overlay-controls {
    position: absolute; top: 8px; right: 8px; z-index: 1200;
    width: max-content; max-width: calc(100% - 16px); margin: 0;
    display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 7px;
    background: #e5e7eb; color: #1f2937; backdrop-filter: blur(4px);
    padding: 6px 8px; border: 1px solid #cbd5e1; border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,.15); box-sizing: border-box;
}
.image-overlay-controls .overlay-toggle, .image-overlay-controls .twp-project-switch-label { color: #1f2937; }
.overlay-toggle { display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: bold; cursor: pointer; white-space: nowrap; }
.overlay-toggle input:disabled + span { opacity: .45; cursor: not-allowed; }
#imageOverlayControls button:disabled { opacity: .45; cursor: not-allowed; }

.draggable-canvas-box {
    position: absolute; background: rgba(255, 255, 255, 0.96); border: 1px solid #003366;
    border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,0.22); z-index: 220; font-size: 12px; user-select: none;
    display: flex; flex-direction: column; box-sizing: border-box;
}
.draggable-box-header {
    background: var(--navy); color: #fff; padding: 6px 10px; border-top-left-radius: 7px;
    border-top-right-radius: 7px; font-weight: bold; cursor: grab; display: flex; justify-content: space-between; align-items: center; flex: 0 0 auto;
}
.draggable-box-header:active { cursor: grabbing; }
.draggable-box-header span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.draggable-box-close { background: transparent; border: 0; color: #fff; font-size: 16px; cursor: pointer; padding: 0 4px; line-height: 1; }
.draggable-box-body { padding: 8px 10px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1 1 auto; overflow: auto; }
.draggable-box-resize {
    position: absolute; right: 2px; bottom: 0px; width: 16px; height: 16px;
    cursor: nwse-resize; font-size: 11px; color: #003366; line-height: 1; text-align: right; user-select: none;
}
.floating-legend { top: 20px; left: 20px; min-width: 140px; min-height: 140px; }
.floating-progress { top: 20px; left: 180px; min-width: 220px; min-height: 90px; height: auto; }
.floating-progress .draggable-box-body { flex:0 0 auto; overflow:visible; padding-bottom:18px; }
.floating-progress .draggable-box-header { touch-action:none; }
.overlay-toggle:has(input:disabled) { opacity:.45; cursor:not-allowed; }

.context-menu {
    position: fixed; background: #fff; border: 1px solid #c9d0d8; border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.18); padding: 5px 0; min-width: 190px; z-index: 6000; font-size: 13px; display: none;
}
.context-menu-item { display: flex; align-items: center; gap: 8px; padding: 8px 14px; cursor: pointer; color: #20262e; }
.context-menu-item:hover { background: #eef4fa; color: #003366; }
.context-menu-item.danger:hover { background: #fef2f2; color: #b42318; }
.context-menu-separator { height: 1px; background: #e4e7eb; margin: 4px 0; }

.control-row { display: flex; gap: 7px; margin-bottom: 8px; }
.control-row > * { flex: 1; }
input[type="text"], input[type="number"], input[type="email"], input[type="password"], input[type="date"], input[type="file"], select, textarea {
    width: 100%; padding: 8px 9px; border: 1px solid #cbd2d9; border-radius: 5px; font: inherit; background: #fff;
}
textarea { resize: vertical; }
button { padding: 8px 11px; border: 1px solid #b9c1ca; border-radius: 5px; background: #fff; cursor: pointer; font: inherit; }
button:hover { background: #eef3f8; }
.btn-primary { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn-primary:hover { background: #004b91; }
.btn-danger { color: #fff; background: #b42318; border-color: #b42318; }
.small-note { font-size: 11px; color: #6c757d; margin: 8px 0; }

.container { position: relative; display: inline-block; line-height: 0; background: #fff; box-shadow: 0 1px 8px rgba(0,0,0,.15); }
#yard { display: block; max-width: none; height: auto; user-select: none; -webkit-user-drag: none; }
.drawing-stage { position: relative; display: inline-block; line-height: 0; }
#annotationCanvas { position: absolute; inset: 0; z-index: 25; pointer-events: none; touch-action: none; }
#annotationCanvas.active { pointer-events: auto; cursor: crosshair; }
.twp-show-name-toggle {display:inline-flex;align-items:center;gap:6px;padding:8px 10px;background:rgba(255,255,255,.96);border:1px solid #cbd5e1;border-radius:7px;white-space:nowrap;font-size:13px;font-weight:600;cursor:pointer;}
.twp-show-name-toggle {color:#17365d;}
.twp-show-name-toggle input {width:17px;height:17px;accent-color:#2563eb;cursor:pointer;}
#hotspotLayer { position: absolute; inset: 0; pointer-events: none; z-index: 30; }
#hotspotLayer .hotspot { pointer-events: auto; }

.viewer-controls {
    position: fixed; right: 22px; bottom: 78px; z-index: 300; display: flex;
    flex-direction: column; align-items: flex-end; gap: 6px; padding: 7px;
    background: #e5e7eb; color: #1f2937; border: 1px solid #cbd5e1;
    border-radius: 8px; box-shadow: 0 2px 9px rgba(0,0,0,.16); max-width: calc(100vw - 16px);
}
.toolbox-toggle { width: 76px; height: 24px; padding: 1px 6px; font-size: 15px; line-height: 1; border: 1px solid #b9c1ca; background: #fff; border-radius: 5px; align-self: flex-end; font-weight: bold; }
.viewer-controls.tools-collapsed .tool-grid { display: none; }
.viewer-controls.tools-collapsed .toolbox-toggle { background: #eef4fa; }
.tool-grid { display: flex; gap: 4px; align-items: center; flex-wrap: nowrap; width: max-content; max-width: calc(100vw - 380px); overflow-x: auto; overflow-y: hidden; }
.tool-grid button { width: 32px; height: 30px; padding: 2px; font-weight: bold; }
.tool-grid button.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.font-size-select { height: 30px; padding: 2px 4px; font-size: 12px; font-weight: bold; border: 1px solid var(--border); border-radius: 4px; background: #fff; cursor: pointer; width: auto; }
.markup-color {
    width: 32px; height: 30px; display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--border); border-radius: 4px; background: #fff; cursor: pointer; overflow: hidden;
}
.markup-color span { font-size: 15px; color: #e53935; line-height: 1; }
.markup-color input { width: 22px; height: 22px; border: 0; padding: 0; background: transparent; cursor: pointer; }

.markup-status-group { border: 1px solid #d5dbe1; border-radius: 7px; padding: 9px 10px; margin-top: 8px; background: #fafbfc; }
.markup-status-title { font-size: 12px; font-weight: 700; margin-bottom: 7px; color: #374151; }
.markup-status-option { display: inline-flex; align-items: center; gap: 5px; margin-right: 14px; font-size: 12px; font-weight: 600; cursor: pointer; }
.markup-status-option input { width: 15px; height: 15px; cursor: pointer; }
.red-option { color: #c62828; } .orange-option { color: #e65100; } .green-option { color: #2e7d32; }

.markup-qty-group { border: 1px solid #d5dbe1; border-radius: 7px; padding: 9px 10px; margin-top: 8px; background: #fbfcfd; }
.qty-inputs-row { display: flex; gap: 8px; align-items: center; }
.markup-na-option { display: inline-flex; align-items: center; gap: 5px; margin-top: 6px; font-size: 12px; font-weight: 600; cursor: pointer; color: #4b5563; }
#hideMarkupsBtn { min-width: 42px; }

.zoom-controls { display: flex; align-items: center; gap: 4px; width: max-content; }
.zoom-controls button { min-width: 34px; height: 30px; margin: 0; padding: 4px 8px; font-weight: bold; }
.zoom-value { min-width: 54px; text-align: center; font-size: 12px; }

.ruler-banner {
    position: sticky; top: 8px; margin: 0 auto 6px; width: fit-content; max-width: 85%;
    background: rgba(0,51,102,.92); color: #fff; padding: 4px 14px; border-radius: 14px;
    font-size: 11px; font-weight: 600; z-index: 200; box-shadow: 0 2px 8px rgba(0,0,0,.18);
    text-align: center; pointer-events: none;
}

.hotspot {
    position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2px solid #fff;
    transform: translate(-50%,-50%); cursor: pointer; box-shadow: 0 1px 5px rgba(0,0,0,.45);
    transition: transform .12s ease, width .12s ease, height .12s ease;
}
.hotspot:hover, .hotspot:focus { width: 24px; height: 24px; transform: translate(-50%,-50%); z-index: 100; outline: none; }
.hotspot.wip { animation: wipSparkle 1.05s ease-in-out infinite; box-shadow: 0 0 0 2px #fff, 0 0 8px 3px rgba(255,193,7,.9); }
@keyframes wipSparkle { 0%,100% { transform: translate(-50%,-50%) scale(1); } 50% { transform: translate(-50%,-50%) scale(1.22); } }

.tooltip {
    position: fixed; display: none; width: 310px; max-width: calc(100vw - 20px);
    background: #fff; color: #20262e; border: 1px solid #c9d0d8; border-radius: 8px;
    padding: 11px 12px; z-index: 5000; box-shadow: 0 8px 25px rgba(0,0,0,.22); pointer-events: auto; line-height: 1.35;
}
.tooltip-title { font-size: 14px; font-weight: bold; margin-bottom: 7px; padding-bottom: 7px; border-bottom: 1px solid #e5e8ec; }
.tooltip-row { display: grid; grid-template-columns: 105px 1fr; gap: 7px; font-size: 12px; margin: 4px 0; }
.tooltip-label { color: #66717d; font-weight: bold; }
.tooltip-status { display: inline-block; color: #fff; border-radius: 10px; padding: 2px 7px; font-size: 10px; font-weight: bold; }
.tooltip-remarks { margin-top: 8px; padding-top: 8px; border-top: 1px solid #e5e8ec; font-size: 12px; line-height: 1.45; text-align: left; overflow-wrap: anywhere; word-break: break-word; }
.tooltip-remarks strong { display: block; margin-bottom: 4px; text-align: left; }
.remark-content { text-align: left; overflow-wrap: anywhere; }
.remark-content a { color: #0563c1; text-decoration: underline; overflow-wrap: anywhere; }
.text-highlight { display:inline; padding:1px 3px; border-radius:3px; box-decoration-break:clone; -webkit-box-decoration-break:clone; }

/* INSTALLED STATUS IS VIOLET #EE82EE */
.red { background: var(--red); }
.blue { background: var(--blue); }
.orange { background: var(--orange); }
.violet { background: var(--violet); }
.green { background: var(--green); }
.eq-status.violet, .tooltip-status.violet { background: #EE82EE; color: #1a1a1a; font-weight: bold; }

.modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 4000; padding: 20px 12px; }
.markup-modal-content { width: 480px; }
.modal-content {
    width: 500px; max-width: 100%; background: #fff; margin: 0 auto;
    padding: 18px; border-radius: 10px; max-height: calc(100vh - 50px);
    overflow: auto; box-shadow: 0 12px 35px rgba(0,0,0,.25);
}
.modal-content h2 { margin: 0 0 15px; }
.modal-heading-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 10px; }
.wip-toggle { display: flex; align-items: center; gap: 6px; padding: 5px 8px; border: 1px solid #cbd2d9; border-radius: 6px; background: #fff; font-size: 12px; font-weight: 700; cursor: pointer; }
.wip-toggle input { accent-color: #ff9800; }
.wip-toggle:has(input:checked) { background: #fff4d6; border-color: #ffb300; color: #8a5600; }
.form-group { margin-bottom: 12px; }
.link-preview { margin-top: 6px; font-size: 12px; color: #66717d; word-break: break-word; }
.link-preview a { color: #006dcc; text-decoration: underline; }
.form-group label { display: block; font-weight: bold; font-size: 12px; margin-bottom: 4px; }
.stage { border: 1px solid #e0e4e8; border-radius: 7px; padding: 9px; margin-bottom: 9px; }
.stage-title { font-weight: bold; margin-bottom: 5px; }
.check-date { display: grid; grid-template-columns: 24px 1fr; align-items: center; gap: 7px; }
.check-date input[type="date"] { grid-column: 2; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 15px; }

/* PROPORTIONATE RULER MODAL STYLE */
.ruler-choice-content {
    width: 300px !important; max-width: calc(100vw - 32px) !important;
    height: auto !important; min-height: 0 !important; max-height: min(85vh, 320px) !important;
    padding: 11px 15px !important; border-radius: 10px !important; box-sizing: border-box !important;
    background: #fff !important; box-shadow: 0 10px 30px rgba(0,0,0,0.24) !important;
}
.ruler-choice-content h2 { margin: 0 0 5px !important; font-size: 16px !important; color: #003366 !important; }
.ruler-choice-content p { margin: 0 0 8px !important; font-size: 13.5px !important; line-height: 1.45 !important; color: #334155 !important; }
.ruler-choice-content label { display: block; margin: 5px 0 3px; font-weight: 600; font-size: 13px; color: #1e293b; }
.ruler-choice-content input, .ruler-choice-content select { width: 100%; padding: 7px 10px; font-size: 13px; border: 1px solid #cbd5e1; border-radius: 6px; box-sizing: border-box; }
.ruler-choice-content button { padding: 7px 14px; font-size: 13px; font-weight: 600; border-radius: 6px; }

.text-highlight-group { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin-top:8px; padding:7px 9px; border:1px solid #dbe2ea; border-radius:6px; background:#f8fafc; font-size:11px; }
.text-highlight-group label { display:inline-flex; align-items:center; gap:3px; font-weight:600; cursor:pointer; margin:0; }
.text-highlight-label { font-weight:700; color:#475569; margin-right:3px; }
.rich-text-editor { min-height:96px; max-height:220px; overflow:auto; border:1px solid #cbd5e1; border-radius:6px; padding:9px 10px; background:#fff; font-size:13px; line-height:1.45; outline:none; white-space:pre-wrap; word-break:break-word; }
.rich-text-editor:focus { border-color:#2563eb; box-shadow:0 0 0 2px rgba(37,99,235,.12); }
.rich-text-editor:empty:before { content:attr(data-placeholder); color:#94a3b8; pointer-events:none; }
.rich-text-toolbar { display:flex; align-items:center; flex-wrap:wrap; gap:6px; margin-top:6px; padding:6px 8px; border:1px solid #dbe2ea; border-radius:6px; background:#f8fafc; font-size:11px; }
.rich-text-label { font-weight:700; color:#475569; margin-right:2px; }
.rich-text-toolbar button { border:1px solid #cbd5e1; border-radius:4px; padding:4px 8px; font-size:11px; font-weight:700; cursor:pointer; background:#fff; }
.text-colour-red { color:#e53935 !important; }
.text-colour-orange { color:#fb8c00 !important; }
.text-colour-green { color:#43a047 !important; }
.text-colour-clear { color:#334155 !important; }

.highlight-red { color:#b42318; } .highlight-orange { color:#b45309; } .highlight-green { color:#15803d; }
.shape-edit-handle { cursor:grab; }

/* Project-wide activity progress dialog */
.project-progress-modal { width: 660px; max-width: min(94vw,1000px); min-width: min(380px,94vw); margin: 4vh auto; height: 540px; min-height: 300px; max-height: 86vh; padding: 16px; display:flex; flex-direction:column; overflow:hidden; resize:both; }
#projectProgressContent {overflow-y:auto; flex:1 1 auto; min-height:0;padding-right:6px;}
.project-progress-head,.project-progress-tabs,.project-progress-filters{flex:0 0 auto;}
.project-progress-head { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; }
.project-progress-head h2 { color:#003366; margin-bottom:4px; }
.project-progress-head-actions { display:flex; gap:8px; align-items:center; flex-shrink:0; }
#printProjectProgress { padding:8px 13px; background:#eaf3ff; border:1px solid #9bbde4; border-radius:6px; color:#003366; font-weight:700; cursor:pointer; }
.project-progress-tabs { display:flex; gap:8px; border-bottom:1px solid #dbe2ea; margin:14px 0; }
.project-progress-tabs button { border:0; border-bottom:3px solid transparent; border-radius:5px 5px 0 0; font-weight:700; padding:10px 22px; }
.project-progress-tabs button.active { border-bottom-color:#0d9488; color:#003366; background:#eaf8ee; }
.project-progress-summary { display:flex; flex-wrap:wrap; gap:12px; padding:12px; background:#f1f5f9; border-radius:8px; margin-bottom:12px; font-size:13px; }
.project-progress-summary b { color:#003366; }
.project-progress-activity { display:block; width:100%; text-align:left; padding:12px; margin:7px 0; border:1px solid #dbe2ea; border-radius:8px; background:#fff; }
.project-progress-activity:hover,.project-progress-activity:focus-visible { background:#f0fdf4; border-color:#0d9488; }
.project-progress-activity-title { display:flex; justify-content:space-between; gap:10px; font-size:13px; font-weight:700; margin-bottom:6px; }
.project-progress-activity .markup-progress-bar { height:12px; margin:6px 0; }
.project-progress-activity-meta { font-size:11px; color:#526779; }
 .project-progress-filters{display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin:10px 0 14px}
.project-progress-search-wrap{position:relative;flex:1 1 240px}
.project-progress-search-wrap input{width:100%}
.project-progress-unit-toggle{display:flex;align-items:center;gap:5px;font-size:12px;font-weight:600;cursor:pointer}
.project-progress-sort-label{font-size:12px;font-weight:600;display:flex;align-items:center;gap:6px}
.project-progress-sort-label select{width:auto;max-width:210px;font-size:12px}
.project-progress-activity-meta{line-height:1.5}
.rich-text-editor table{border-collapse:collapse;margin:6px 0;max-width:100%;font-size:12px}
.rich-text-editor td,.rich-text-editor th{border:1px solid #94a3b8;padding:4px 7px;min-width:35px}
.rich-text-editor th{background:#e2e8f0;font-weight:700}
.rich-text-editor{overflow-x:auto}

/* Editable Excel-like tables: drag right edge of a cell to resize its column,
   drag bottom edge to resize its row. Hover preview keeps a compact, unwrapped grid. */
.rich-text-editor table{table-layout:fixed;width:max-content;max-width:none;border-collapse:collapse;white-space:normal}
.rich-text-editor td,.rich-text-editor th{position:relative;min-width:35px;white-space:normal;overflow-wrap:break-word;word-break:normal;vertical-align:middle}
.rich-text-editor .twp-col-resizer{position:absolute;right:0;top:0;bottom:0;width:7px;cursor:col-resize;z-index:2;background:transparent}
.rich-text-editor .twp-row-resizer{position:absolute;bottom:0;left:0;right:0;height:6px;cursor:row-resize;z-index:2;background:transparent}
.rich-text-editor .twp-col-resizer:hover,.rich-text-editor .twp-row-resizer:hover{background:rgba(37,99,235,.22)}
.rich-text-editor{white-space:normal}
.tooltip .remark-content{max-height:260px;overflow:auto;overflow-wrap:normal;word-break:normal}
.tooltip .remark-content table{border-collapse:collapse;table-layout:fixed;width:max-content;max-width:none;font-size:10px;line-height:1.2;white-space:normal}
.tooltip .remark-content td,.tooltip .remark-content th{border:1px solid #94a3b8;padding:2px 4px;white-space:normal;overflow-wrap:break-word;word-break:normal;box-sizing:border-box}
.tooltip .remark-content th{background:#e2e8f0;font-weight:700}
.tooltip .remark-content table *{overflow-wrap:break-word;word-break:normal;white-space:normal}
.tooltip .remark-content table .twp-col-resizer,.tooltip .remark-content table .twp-row-resizer{display:none}


body.twp-new-markup-mode .hotspot:not(.twp-new-session-equipment):not(.twp-cable-endpoint) {visibility:hidden!important;pointer-events:none!important;}
body.twp-new-markup-mode .floating-progress-box,
body.twp-new-markup-mode .twp-individual-progress-box {visibility:hidden!important;pointer-events:none!important;}
#newMarkupModeBtn[aria-pressed="true"] {background:#0f766e;color:white;}

/* iPad landscape / finger controls. Desktop CSS is unchanged. */
@media (pointer: coarse) and (orientation: landscape) and (min-width: 700px) and (max-width: 1400px) {
  html,body { height:100%; height:100dvh; overscroll-behavior:none; }
  .header { min-height:58px; padding:6px 10px; gap:8px; }
  .header h2 {font-size:16px;}
  .header-actions { flex-wrap:nowrap; overflow-x:auto; max-width:75vw; -webkit-overflow-scrolling:touch; padding-bottom:3px; }
  .header-actions button { min-height:42px; white-space:nowrap; font-size:12px; }
  .signed-in-user {flex-shrink:0;}
  .dashboard {grid-template-columns:repeat(5,minmax(90px,1fr));gap:4px;padding:5px 8px;}
  .card {padding:5px 7px;} .card h3 {font-size:17px;} .card span {font-size:10px;}
  .legend {margin:0 8px 4px;padding:4px 8px;gap:10px;font-size:11px;}
  .sidebar {width:260px;min-width:260px;padding:9px;}
  body.twp-ipad-sidebar-closed .sidebar {display:none;}
  .viewer {padding:8px;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;touch-action:pan-x pan-y;}
  .viewer-controls {position:fixed;right:9px;bottom:12px;max-width:calc(100vw - 18px);padding:5px;}
  .tool-grid {max-width:calc(100vw - 130px);gap:5px;}
  .tool-grid button, .zoom-controls button, .toolbox-toggle {min-width:44px;min-height:44px;height:44px;font-size:17px;}
  .toolbox-toggle {width:92px;font-size:14px;}
  .tool-grid select {min-height:44px;}
  .markup-color {min-width:44px;height:44px;}
  .hotspot {width:24px;height:24px;}
  .hotspot:hover,.hotspot:focus {width:28px;height:28px;}
  .modal-content {max-height:calc(100dvh - 26px);margin:10px auto;}
  #modal,#markupModal {padding:6px 8px;overflow-y:auto;align-items:flex-start;}
  #modal .modal-content,#markupModal .modal-content {
    width:min(520px,calc(100vw - 16px));max-width:calc(100vw - 16px);
    max-height:calc(100dvh - 12px);margin:0 auto;overflow-y:auto;
    overscroll-behavior:contain;-webkit-overflow-scrolling:touch;
    padding:12px 14px;
  }
  #modal .form-group,#markupModal .form-group {margin-bottom:8px;}
  #modal .check-date {display:grid;grid-template-columns:28px minmax(65px,1fr) minmax(150px,1.5fr);gap:7px;align-items:center;min-width:0;}
  #modal .check-date input[type="date"] {grid-column:3;grid-row:1;min-width:0;width:100%;max-width:100%;box-sizing:border-box;}
  #modal .check-date label {grid-column:2;grid-row:1;min-width:0;}
  #modal .check-date input[type="checkbox"] {grid-column:1;grid-row:1;min-width:0;}
  #modal .stage {min-width:0;box-sizing:border-box;}

  #modal .stage,#markupModal .stage {padding:6px;margin-bottom:6px;}
  #modal .modal-actions,#markupModal .modal-actions {
    position:sticky;bottom:-12px;background:#fff;padding:8px 0;z-index:3;
  }
  #modal .rich-text-editor,#markupModal .rich-text-editor {max-height:110px;min-height:55px;}
  .modal-content button, .login-card button {min-height:44px;}
  .modal-content input,.modal-content select,.modal-content textarea,.login-card input,.login-card select {font-size:16px;min-height:42px;}
  .project-progress-modal {max-height:88dvh;}
  .draggable-box-header,.draggable-box-resize {touch-action:none;}
  .context-menu-item {min-height:44px;}
  #twpIpadSidebarToggle,#twpIpadFinish {display:inline-flex!important;align-items:center;justify-content:center;min-height:44px;padding:8px 12px;font-size:13px;font-weight:700;}
  #twpIpadFinish {background:#0d9488;color:#fff;border-color:#0f766e;}
  #twpIpadFinish[hidden] {display:none!important;}
}
@media not all and (pointer: coarse) {#twpIpadSidebarToggle,#twpIpadFinish{display:none!important;}}
#twpIpadSidebarToggle,#twpIpadFinish{display:none;}

.twp-search-progress-group + .twp-search-progress-group { border-top:1px solid #dbe2ea; margin-top:12px; padding-top:12px; }
.twp-search-progress-group .markup-summary-stats { gap:5px; }

/* Per-search progress overlays; desktop layout is otherwise unchanged. */
.twp-progress-heading { display:flex;align-items:center;justify-content:space-between;gap:6px;flex-wrap:wrap;margin-bottom:5px; }
.twp-progress-actions {display:inline-flex;align-items:center;gap:8px;font-size:11px;font-weight:500;white-space:nowrap;}
.twp-progress-actions label {display:inline-flex;align-items:center;gap:3px;cursor:pointer;}
.twp-progress-actions input {accent-color:#1769aa;}
#individualProgressOverlays {position:absolute;inset:0;pointer-events:none;z-index:17;}
.twp-individual-overlay {position:absolute;display:flex;flex-direction:column;min-width:190px;width:250px;max-width:min(360px,85vw);background:#fff;color:#1f2937;border:1px solid #003366;border-radius:8px;box-shadow:0 3px 12px #0004;pointer-events:auto;touch-action:none;overflow:hidden;font:12px Arial,sans-serif;}
.twp-individual-overlay .twp-overlay-head {padding:9px 10px;background:#003366;color:#fff;font-weight:700;cursor:move;touch-action:none;overflow-wrap:anywhere;}
.twp-individual-overlay .twp-overlay-content {padding:9px;line-height:1.6;}
.twp-individual-overlay .twp-overlay-resize {position:absolute;bottom:0;right:0;cursor:nwse-resize;padding:3px;color:#475569;touch-action:none;}
@media (pointer:coarse) {.twp-progress-actions {font-size:12px}.twp-progress-actions input {width:17px;height:17px}.twp-individual-overlay .twp-overlay-head {padding:13px 11px}.twp-individual-overlay .twp-overlay-resize {padding:9px}}

/* Compact equipment editing form: desktop and landscape iPad, without changing tracker layout. */
#modal .equipment-modal-content {width:min(680px,calc(100vw - 28px));box-sizing:border-box;}
#modal .equipment-identity-grid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 12px;}
#modal .equipment-identity-grid .form-group:last-child {grid-column:1/-1;}
#modal .equipment-identity-grid input {width:100%;min-width:0;box-sizing:border-box;}
#modal .equipment-stages-grid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 10px;margin-bottom:10px;}
#modal .equipment-stages-grid .stage {margin:0;min-width:0;padding:8px 10px;box-sizing:border-box;}
#modal .equipment-stages-grid .stage-title {font-size:12px;margin-bottom:7px;}
#modal .equipment-stages-grid .check-date {display:grid;grid-template-columns:22px minmax(50px,1fr);gap:5px 7px;align-items:center;}
#modal .equipment-stages-grid .check-date input[type="date"] {grid-column:1/-1;grid-row:2;width:100%;min-width:0;box-sizing:border-box;}
#modal .equipment-stages-grid .check-date label {grid-column:2;grid-row:1;}
#modal .equipment-stages-grid .check-date input[type="checkbox"] {grid-column:1;grid-row:1;}
#modal .equipment-modal-content .rich-text-editor {min-height:68px;}
@media (max-width:560px) {
  #modal .equipment-identity-grid,#modal .equipment-stages-grid {grid-template-columns:minmax(0,1fr);}
  #modal .equipment-identity-grid .form-group:last-child {grid-column:auto;}
}

/* Movable equipment / markup editors; movement is limited to the visible viewport. */
#modal .twp-modal-drag-handle, #markupModal .twp-modal-drag-handle, #twpCalloutModal .twp-modal-drag-handle { cursor: move; touch-action: none; user-select: none; }
.twp-drag-hint { font-size: 11px; font-weight: normal; opacity: .6; margin-left: 10px; }
#markupActivityGroup.twp-activity-error { border: 2px solid #dc2626 !important; background: #fef2f2 !important; box-shadow: 0 0 0 2px #fecaca; }


/* Popup close controls and assigned-project selector. */
#modal .modal-content,#markupModal .modal-content{position:relative}
.twp-popup-x{position:absolute;top:10px;right:12px;z-index:5;min-width:32px;min-height:32px;border:1px solid #cbd5e1;border-radius:6px;background:#fff;color:#334155;cursor:pointer}
#modal .modal-heading-row{padding-right:42px}
#markupModalTitle{padding-right:45px}
/* Assigned-project selector: beside Rotate, without altering desktop header. */
.twp-project-switch-label{display:inline-flex;align-items:center;gap:5px;font-size:12px;font-weight:600;white-space:nowrap}
#twpProjectSwitcher{max-width:190px;min-width:115px;padding:5px 7px;font-size:12px;border:1px solid #b9c1ca;border-radius:5px;background:#fff;color:#172b4d}
#toolbox button[data-tool="equipment"]{white-space:nowrap;font-size:12px;min-width:86px}
@media (pointer:coarse){#twpProjectSwitcher{max-width:150px;min-height:40px;font-size:14px}}


/* Consistent, compact toolbox controls: prevent symbols overflowing buttons. */
#toolbox.tool-grid { gap: 5px; align-items: center; min-width: 0; scrollbar-width: thin; }
#toolbox.tool-grid button[data-tool],
#toolbox.tool-grid button#undoAnnotationBtn,
#toolbox.tool-grid button#redoAnnotationBtn,
#toolbox.tool-grid button#twpIpadFinish {
  box-sizing: border-box; flex: 0 0 auto; width: 38px; min-width: 38px;
  height: 34px; min-height: 34px; padding: 3px 4px;
  display: inline-flex; justify-content: center; align-items: center;
  font-family: Arial, sans-serif; font-size: 19px; font-weight: 600;
  line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: clip;
  vertical-align: middle;
}
#toolbox.tool-grid button[data-tool="equipment"] {width: 76px; min-width: 76px; font-size: 12px; padding: 3px 5px;}
#toolbox.tool-grid button[data-tool="cloud"] {width: 68px; min-width: 68px; font-size: 12px; padding: 3px 5px;}
#toolbox.tool-grid button[data-tool="callout"] {font-size: 16px;}
#toolbox.tool-grid button[data-tool="ruler"] {width: 48px; min-width: 48px; font-size: 11px;}
#toolbox.tool-grid button#twpIpadFinish {width: 70px; min-width: 70px; font-size: 12px;}
#toolbox.tool-grid select {flex: 0 0 auto; max-width: 92px; box-sizing: border-box;}
#toolbox.tool-grid .markup-color {flex: 0 0 auto;}
@media (pointer:coarse) {
  #toolbox.tool-grid button[data-tool], #toolbox.tool-grid button#undoAnnotationBtn,
  #toolbox.tool-grid button#redoAnnotationBtn, #toolbox.tool-grid button#twpIpadFinish {
    height: 44px; min-height: 44px; width: 44px; min-width: 44px;
  }
  #toolbox.tool-grid button[data-tool="equipment"] {width: 84px; min-width: 84px; font-size: 13px;}
  #toolbox.tool-grid button[data-tool="cloud"] {width: 74px; min-width: 74px; font-size: 13px;}
  #toolbox.tool-grid button[data-tool="ruler"] {width: 54px; min-width: 54px;}
  #toolbox.tool-grid button#twpIpadFinish {width: 74px; min-width: 74px;}
}

.twp-permission-options{display:grid;gap:10px;margin:14px 0}.twp-permission-options label{display:flex;gap:10px;align-items:center;padding:9px 10px;border:1px solid #dce3ec;border-radius:7px;font-size:13px}.twp-permission-options input{width:auto!important;flex:none}.twp-permission-disabled{opacity:.38!important;filter:grayscale(1);cursor:not-allowed!important}.twp-permission-disabled:disabled{pointer-events:auto}.twp-restricted-field{opacity:.6;background:#f1f5f9!important;cursor:not-allowed!important}


.hotspot.twp-multi-selected{outline:2px solid #60a5fa!important;outline-offset:2px!important;box-shadow:0 0 5px 2px rgba(59,130,246,.35)!important;z-index:30!important}


/* Live collaborators: compact header indicator, hover only (not sticky). */
#twpOnlineUsersWrap{display:inline-flex;align-items:center;position:relative;max-width:100%;vertical-align:baseline}
#twpLastUpdatedBy{font:inherit;color:inherit}
#twpOnlineUsersWrap.twp-has-collaborators #twpLastUpdatedBy{color:#bbf7d0;animation:twpPresenceShine 1.6s ease-in-out infinite;cursor:help;text-decoration:underline dotted;text-underline-offset:3px}
@keyframes twpPresenceShine{0%,100%{text-shadow:0 0 2px rgba(134,239,172,.35);opacity:1}50%{text-shadow:0 0 12px #86efac,0 0 18px rgba(187,247,208,.6);opacity:.78}}
#twpOnlineUsersPopup{display:none;position:absolute;top:calc(100% + 6px);left:0;z-index:25000;width:max-content;min-width:240px;max-width:min(380px,90vw);padding:10px 12px;border-radius:8px;background:#fff;color:#1e293b;border:1px solid #cbd5e1;box-shadow:0 8px 25px #0004;line-height:1.6;text-shadow:none;font-weight:normal;font-size:12px;white-space:normal;overflow-wrap:anywhere;pointer-events:none}
#twpOnlineUsersWrap.twp-has-collaborators:hover #twpOnlineUsersPopup{display:block}
#twpOnlineUsersPopup strong{display:block;color:#003366;margin-bottom:4px}
#twpOnlineUsersPopup .twp-online-entry{padding:3px 0;border-top:1px solid #e2e8f0}
#twpCloudStatus{display:none!important} /* Save feedback now uses the Save Update button colour. */


/* Cloud save indication on the existing button: green=saved, amber=pending,
   blue=saving, red=retry required. Header button rules use !important. */
.header-actions #cloudSaveBtn.twp-save-pending{background:#fbbf24!important;border-color:#d97706!important;color:#422006!important;box-shadow:0 0 0 2px rgba(251,191,36,.25)}
.header-actions #cloudSaveBtn.twp-save-saving{background:#93c5fd!important;border-color:#2563eb!important;color:#1e3a8a!important}
.header-actions #cloudSaveBtn.twp-save-error{background:#fca5a5!important;border-color:#dc2626!important;color:#7f1d1d!important}
.header-actions #cloudSaveBtn.twp-save-conflict{background:#fdba74!important;border-color:#ea580c!important;color:#7c2d12!important}

/* Compact refresh button, immediately to the left of Logout. */
#twpRefreshCloudBtn { flex:0 0 32px; width:32px; min-width:32px; height:31px;
  min-height:31px; max-height:31px; padding:2px 4px!important;
  font-size:19px!important; line-height:1; text-align:center; border-radius:6px; }
@media (pointer:coarse) { #twpRefreshCloudBtn { flex-basis:38px; width:38px;
  min-width:38px; height:38px; min-height:38px; max-height:38px; } }

/* Phone-only responsive layer. Existing desktop and landscape iPad styles are unchanged. */
@media (pointer: coarse) and (max-width: 699px) {
 html,body {width:100%;height:100%;height:100dvh;overflow:hidden;overscroll-behavior:none}
 body {min-width:0}
 .header {height:auto;min-height:0;padding:7px 9px;gap:5px;display:flex;flex-direction:column;align-items:stretch}
 .header h2 {font-size:15px;line-height:1.2}
 #siteUpdateInfo {font-size:10px!important;line-height:1.25!important;max-height:29px;overflow:auto}
 .header-actions {display:flex;flex-wrap:nowrap;justify-content:flex-start;overflow-x:auto;overflow-y:hidden;max-width:100%;gap:6px;padding:3px 0 5px;scrollbar-width:thin;-webkit-overflow-scrolling:touch}
 .header-actions button {flex:0 0 auto;min-height:39px;padding:7px 9px!important;font-size:12px;white-space:nowrap}
 .header-actions .signed-in-user {flex:0 0 auto;max-width:175px}
 .header-actions .signed-in-user span {font-size:10px}
 .dashboard,.legend {display:none}
 .main {min-height:0;flex:1 1 0;position:relative;overflow:hidden}
 .sidebar {position:absolute;z-index:1350;top:0;left:0;bottom:0;width:min(90vw,350px);min-width:0;max-width:100%;height:100%;padding:10px;background:#fff;box-shadow:3px 0 15px #0003;overflow-y:auto}
 body.twp-ipad-sidebar-closed .sidebar {display:none}
 .viewer {width:100%;height:100%;flex:1 1 auto;padding:5px;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;touch-action:pan-x pan-y}
 .image-overlay-controls {top:5px;right:5px;max-width:calc(100% - 10px);gap:4px;padding:4px 5px;flex-wrap:wrap}
 .image-overlay-controls button,.image-overlay-controls select {font-size:11px;min-height:34px;padding:4px 6px}
 .image-overlay-controls .overlay-toggle,.twp-project-switch-label {font-size:11px}
 #twpProjectSwitcher {max-width:130px;min-width:90px;min-height:34px}
 .viewer-controls {position:fixed;right:6px;bottom:max(9px,env(safe-area-inset-bottom));padding:5px;max-width:calc(100vw - 12px);z-index:1400}
 .tool-grid {max-width:calc(100vw - 24px);overflow-x:auto;gap:5px}
 #toolbox.tool-grid button[data-tool],#toolbox.tool-grid button#undoAnnotationBtn,#toolbox.tool-grid button#redoAnnotationBtn {min-width:42px;width:42px;min-height:42px;height:42px}
 #toolbox.tool-grid button[data-tool="equipment"] {min-width:80px;width:80px}
 #toolbox.tool-grid button[data-tool="cloud"] {min-width:70px;width:70px}
 .toolbox-toggle,.zoom-controls button {min-height:40px;height:40px}
 #twpIpadSidebarToggle,#twpIpadFinish {display:inline-flex!important;align-items:center;justify-content:center;min-height:40px;font-size:12px;font-weight:700}
 #twpIpadFinish[hidden] {display:none!important}
 .modal {padding:5px;overflow-y:auto;overscroll-behavior:contain}
 .modal-content,#projectAdminModal .modal-content,#twpConflictModal .modal-content {width:calc(100vw - 12px)!important;max-width:calc(100vw - 12px)!important;max-height:calc(100dvh - 14px)!important;margin:5px auto!important;padding:12px!important;overflow-y:auto}
 .project-progress-modal {min-width:0!important;height:min(76dvh,560px)!important;resize:none}
 .login-card,.registration-card {width:calc(100vw - 24px);max-width:420px;max-height:calc(100dvh - 24px);overflow:auto;padding:18px 14px}
 .equipment-identity-grid,.equipment-stages-grid {grid-template-columns:minmax(0,1fr)!important}
 .equipment-identity-grid .form-group:last-child {grid-column:auto!important}
 .modal-content input,.modal-content select,.modal-content textarea,.login-card input,.login-card select {font-size:16px;min-height:42px}
 .modal-content button,.login-card button {min-height:42px}
 .tooltip {max-width:calc(100vw - 14px);width:min(310px,calc(100vw - 14px))}
 .floating-progress,.floating-legend {max-width:calc(100vw - 18px)}
}

/* TWP compact phone / iPad controls: desktop untouched. */
@media (pointer:coarse) and (max-width:1400px) {
 .header-actions{overflow:visible!important;flex-wrap:nowrap!important;align-items:center;gap:5px!important;max-width:100%;min-width:0}
 .header-actions > :not(#twpIpadSidebarToggle):not(#projectProgressBtn):not(#twpRefreshCloudBtn):not(#logoutBtn):not(#twpMobileOptionsWrap):not(#twpCloudStatus):not(input){display:none!important}
 .header-actions #twpIpadSidebarToggle,.header-actions #projectProgressBtn,.header-actions #twpRefreshCloudBtn,.header-actions #logoutBtn,.header-actions #twpMobileOptionsBtn {display:inline-flex!important;align-items:center;justify-content:center;min-width:0;min-height:38px;height:38px;padding:5px 7px!important;font-size:clamp(10px,2.4vw,12px)!important;white-space:nowrap}
 .header-actions #projectProgressBtn{flex:1 1 auto}
 .header-actions #twpMobileOptionsWrap{display:block!important;position:relative;flex:0 0 auto}
 .header-actions #twpMobileOptionsMenu{display:none;position:fixed;right:8px;top:var(--twp-options-top,110px);z-index:20000;width:min(260px,85vw);max-height:65dvh;overflow:auto;padding:6px;background:white;border:1px solid #cbd5e1;border-radius:9px;box-shadow:0 10px 25px #0004}
 .header-actions #twpMobileOptionsMenu.twp-open{display:flex;flex-direction:column;gap:5px}
 .header-actions #twpMobileOptionsMenu button{display:block!important;width:100%;min-height:39px;text-align:left;font-size:13px!important;color:#17365d!important;background:#f8fafc!important;border:1px solid #e2e8f0!important}
 .header-actions #twpMobileOptionsMenu button[style*="display: none"],.header-actions #twpMobileOptionsMenu button[style*="display:none"]{display:none!important}
 .header-actions .signed-in-user{display:contents!important}
 .header-actions #logoutBtn{font-size:20px!important;width:40px;flex:0 0 40px}
 .header-actions #twpRefreshCloudBtn{flex:0 0 38px;width:38px;min-width:38px}
 .header-actions #twpMobileOptionsMenu .button-file{display:block!important;width:100%}
 .image-overlay-controls{position:absolute;top:6px;right:6px;left:auto;display:block!important;width:auto;max-width:calc(100% - 12px);padding:4px!important;background:#e5e7eb}
 #twpMobileDrawingBtn{display:block!important;min-height:36px;white-space:nowrap;font-weight:700}
 #twpMobileDrawingMenu{display:none;max-height:55dvh;overflow:auto;min-width:190px;flex-direction:column;gap:8px;padding:7px 3px}
 #imageOverlayControls.twp-mobile-drawing-open #twpMobileDrawingMenu{display:flex}
 #twpMobileDrawingMenu > *{display:flex!important;align-items:center;justify-content:flex-start;max-width:100%;width:100%;min-height:36px;box-sizing:border-box;gap:6px}
 #twpMobileDrawingMenu #twpProjectSwitcher{width:auto;flex:1;min-width:80px}
 .viewer-controls .zoom-controls{display:none!important}
 #modal input[type=date],#markupModal input[type=date],#twpCalloutModal input[type=date]{min-width:0!important;max-width:100%!important;width:100%!important;box-sizing:border-box;font-size:14px!important;min-height:35px!important;padding:4px 5px!important}
 #modal .check-date,#markupModal .check-date{min-width:0;max-width:100%;grid-template-columns:22px minmax(0,1fr)!important}
 #modal .check-date input[type=date],#markupModal .check-date input[type=date]{grid-column:1/-1!important;grid-row:auto!important}
 #modal .stage,#markupModal .stage{min-width:0;max-width:100%;overflow:hidden}
 .tooltip.twp-touch-pinned{display:block!important;max-height:65dvh;overflow:auto;z-index:6500;touch-action:pan-y;cursor:pointer}
 .tooltip.twp-touch-pinned:after{content:none!important;display:none!important}
}
@media (pointer:coarse) and (min-width:700px) and (max-width:1400px){
 .header{gap:8px}.header-actions{justify-content:flex-end}.header-actions #projectProgressBtn{flex:0 1 auto}
}

/* TWP touch refinement v2 — only coarse-pointer phone/tablet layouts. */
@media (pointer:coarse) and (max-width:1400px) {
 .header-actions{gap:clamp(4px,1vw,9px)!important;width:100%;justify-content:space-between!important}
 .header-actions #twpIpadSidebarToggle,
 .header-actions #projectProgressBtn,
 .header-actions #twpMobileOptionsBtn{
   font-size:clamp(12px,2.9vw,16px)!important;
   font-weight:700!important;
   min-height:44px!important;height:44px!important;
   padding:6px clamp(6px,1.7vw,13px)!important;
   border-radius:7px!important;
 }
 .header-actions #twpIpadSidebarToggle{flex:0 1 auto;white-space:nowrap}
 .header-actions #projectProgressBtn{flex:1 1 auto;min-width:0;white-space:normal!important;line-height:1.05;text-align:center}
 .header-actions #twpMobileOptionsWrap{flex:0 0 auto}
 .header-actions #twpRefreshCloudBtn,.header-actions #logoutBtn{
   flex:0 0 44px!important;width:44px!important;min-width:44px!important;
   min-height:44px!important;height:44px!important;
   font-size:26px!important;padding:5px!important;border-radius:7px!important;
 }
 .header-actions #logoutBtn svg{display:block;width:24px;height:24px}
 #twpMobileDrawingBtn{font-size:15px!important;min-height:42px!important;padding:7px 12px!important;border-radius:7px!important}
 #twpMobileDrawingMenu{min-width:min(220px,80vw)!important}
 #twpMobileDrawingMenu > *{font-size:13px!important}
 #modal .equipment-stages-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
 #modal .equipment-stages-grid .stage{min-width:0!important;overflow:hidden;padding:7px!important}
 #modal .equipment-stages-grid .check-date{display:grid!important;grid-template-columns:20px minmax(0,1fr)!important;min-width:0!important;width:100%!important}
 #modal .equipment-stages-grid .check-date input[type=date]{
   grid-column:1/-1!important;grid-row:2!important;
   display:block!important;min-width:0!important;width:min(100%,170px)!important;
   max-width:170px!important;height:35px!important;min-height:35px!important;
   font-size:12px!important;padding:3px 2px!important;margin:0!important;
   box-sizing:border-box!important;
 }
 #markupModal .form-group:has(>div>input[type=date]){min-width:0!important;max-width:100%!important}
 #markupModal .form-group:has(>div>input[type=date]) > div{min-width:0!important}
 #markupModal input[type=date]{width:100%!important;min-width:0!important;font-size:12px!important;padding:3px!important;box-sizing:border-box!important}
 .tooltip.twp-touch-pinned{cursor:pointer!important;pointer-events:auto!important}
 .tooltip.twp-touch-pinned:after{content:none!important;display:none!important}
}
@media (pointer:coarse) and (max-width:699px){
 .header-actions #twpIpadSidebarToggle,.header-actions #projectProgressBtn,.header-actions #twpMobileOptionsBtn{font-size:clamp(12px,3vw,14px)!important;padding:5px 6px!important}
 .header-actions #twpRefreshCloudBtn,.header-actions #logoutBtn{flex-basis:39px!important;width:39px!important;min-width:39px!important}
 .header-actions #projectProgressBtn{font-size:12px!important}
 #modal .equipment-stages-grid{grid-template-columns:minmax(0,1fr)!important}
 #modal .equipment-stages-grid .check-date input[type=date]{width:170px!important;max-width:100%!important}
}

/* Touch-only inspection and expanded Project Progress. Desktop remains unchanged. */
@media (pointer:coarse) and (max-width:1400px){
 #tooltip.twp-touch-pinned{box-sizing:border-box;width:min(355px,calc(100vw - 18px))!important;max-width:calc(100vw - 18px)!important;max-height:70dvh;overflow-y:auto;box-shadow:0 8px 24px rgba(0,0,0,.28);border:1px solid #94a3b8;}
 #tooltip.twp-touch-pinned .twp-touch-edit-action{display:block;position:sticky;bottom:0;text-align:center;font-size:14px;font-weight:700;color:#003366;background:#eaf3ff;border:1px solid #bfdbfe;border-radius:6px;padding:11px 8px;margin-top:11px;pointer-events:none;}
 #tooltip.twp-touch-pinned:after{content:none!important;display:none!important;}
 #projectProgressModal .project-progress-modal{height:min(91dvh,950px)!important;max-height:calc(100dvh - 14px)!important;min-height:min(450px,85dvh)!important;display:flex!important;flex-direction:column!important;overflow:hidden!important;}
 #projectProgressModal #projectProgressContent{flex:1 1 auto!important;min-height:0!important;overflow-y:auto!important;padding-right:3px;}
 #projectProgressModal .project-progress-head{gap:8px;}
 #projectProgressModal .project-progress-head h2{font-size:19px;margin:0 0 3px;}
 #projectProgressModal .project-progress-head .small-note{font-size:10px;line-height:1.3;margin:3px 0;}
 #projectProgressModal .project-progress-tabs{margin:8px 0!important;gap:4px;}
 #projectProgressModal .project-progress-tabs button{padding:9px 12px!important;font-size:13px;}
 #projectProgressModal .project-progress-filters{gap:6px;margin:6px 0 9px!important;}
 #projectProgressModal .project-progress-activity{padding:10px!important;margin:5px 0!important;}
 #projectProgressModal .project-progress-activity-title{font-size:13px;align-items:flex-start;}
 #projectProgressModal .project-progress-activity-title span:first-child{flex:1;min-width:0;overflow-wrap:anywhere;}
 #projectProgressModal .project-progress-activity-title span:last-child{flex:0 0 auto;font-size:11px;}
}
/* Registration and Contact Us dialogs */
.login-secondary-actions{flex-wrap:wrap}
.login-secondary-actions button{flex:1 1 28%;min-width:0}
.twp-payment-card{width:min(460px,calc(100vw - 24px));overflow-y:auto}
.twp-payment-message{font-size:13px!important;line-height:1.5!important;color:#26374a!important;margin:12px 0!important}
.twp-stripe-container{display:flex;justify-content:center;align-items:center;min-height:60px;margin:14px 0;max-width:100%;overflow-x:auto}
#twpContactMessage{min-height:95px;resize:vertical;font-family:inherit}
@media(max-width:400px){.login-secondary-actions button{font-size:11px;padding:7px 3px}}


#twpCloudStatus{font-size:11px;max-width:220px;line-height:1.3;color:#d1fae5;font-weight:600;overflow-wrap:anywhere}
#twpCloudStatus.warning{color:#fde68a}#twpCloudStatus.error{color:#fecaca}
#twpConflictModal{z-index:8000;background:rgba(10,28,53,.65)}
#twpConflictModal .modal-content{width:min(710px,96vw);margin:6vh auto;max-height:85vh}
.twp-conflict-card{border:1px solid #fbbf24;background:#fffbeb;border-radius:8px;padding:12px;margin:10px 0;font-size:12px;overflow-wrap:anywhere}
.twp-conflict-card button{font-size:12px;margin:5px 5px 2px 0}
.twp-conflict-meta{font-size:11px;color:#475569;margin-top:5px}
.twp-conflict-diff{background:#fff;padding:8px;border:1px solid #e2e8f0;border-radius:5px;margin:8px 0;max-height:170px;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere}


/* Mobile and tablet: safe gestures and prominent undo/redo beside drawing List. */
@media (pointer:coarse) and (max-width:1400px){
 #drawingStage,#annotationCanvas,#hotspotLayer,.hotspot{ -webkit-user-select:none!important;user-select:none!important;-webkit-touch-callout:none!important; }
 #viewer{overscroll-behavior:contain}
 #twpMobileDrawingMenu{min-width:225px}
 #twpTouchUndoRedo{display:flex;gap:6px;align-items:center}
 #twpTouchUndoRedo button{width:43px;height:42px;min-width:43px;font-size:25px;font-weight:bold;background:#dbeafe!important;color:#123d73!important;border:1px solid #93c5fd!important;border-radius:7px}
 #twpMobileDrawingBtn{font-size:15px!important}
}
/* Desktop: retain the original full top-right toolbar and add Undo / Redo. */
@media (pointer:fine){
 #imageOverlayControls #twpDesktopUndoRedo{display:inline-flex;align-items:center;gap:5px;margin-left:3px}
 #imageOverlayControls #twpDesktopUndoRedo button{min-width:35px;min-height:32px;padding:3px 7px;font-size:22px;font-weight:bold;background:#dbeafe;color:#003366;border:1px solid #93c5fd;border-radius:5px}
}


/* Touch-only floating action controls, outside the expandable drawing toolbox. */
@media (pointer:coarse) and (max-width:1400px){
 #twpTouchActionDock{position:fixed;right:12px;bottom:76px;z-index:1800;display:flex;flex-direction:column;align-items:flex-end;gap:7px;pointer-events:none}
 #twpTouchActionDock button:not([hidden]){display:inline-flex!important;align-items:center;justify-content:center;pointer-events:auto;min-height:45px;min-width:135px;max-width:min(75vw,260px);padding:9px 14px;background:#0f766e;color:white;border:2px solid white;border-radius:9px;box-shadow:0 3px 13px #0005;font-size:15px;font-weight:800;white-space:normal}
 #twpTouchActionDock #twpEndActiveTool{background:#1e40af}
 #twpMobileOptionsWrap,#twpMobileOptionsMenu.twp-open{z-index:2147483000!important}
}
@media (pointer:fine){#twpHandToggle{display:inline-flex!important}}
@media (pointer:coarse){#twpHandToggle{display:none!important}}
#twpHandToggle{min-width:39px;align-items:center;justify-content:center;font-size:19px;font-weight:700}
#twpHandToggle.twp-hand-on{background:#dbeafe;border-color:#2563eb;color:#1d4ed8}
#drawingStage.twp-hand-active,#drawingStage.twp-hand-active *{cursor:grab!important;user-select:none!important;-webkit-user-select:none!important}
#drawingStage.twp-hand-dragging,#drawingStage.twp-hand-dragging *,#viewer.twp-hand-view:active{cursor:grabbing!important}
#viewer.twp-hand-view{cursor:grab!important;user-select:none!important;-webkit-user-select:none!important}


/* iPad/phone Options menu lives under body so it is ABOVE drawing/List/Undo/Redo. */
@media (pointer:coarse) and (max-width:1400px){
 body > #twpMobileOptionsMenu{display:none;position:fixed;right:8px;top:var(--twp-options-top,110px);z-index:2147483646!important;width:min(260px,85vw);max-height:65dvh;overflow:auto;padding:6px;background:#fff;border:1px solid #cbd5e1;border-radius:9px;box-shadow:0 10px 25px #0005}
 body > #twpMobileOptionsMenu.twp-open{display:flex!important;flex-direction:column;gap:5px}
 body > #twpMobileOptionsMenu button{display:block!important;width:100%;min-height:39px;text-align:left;font-size:13px!important;color:#17365d!important;background:#f8fafc!important;border:1px solid #e2e8f0!important}
 body > #twpMobileOptionsMenu button[style*="display: none"],body > #twpMobileOptionsMenu button[style*="display:none"]{display:none!important}
 body > #twpMobileOptionsMenu .button-file{display:block!important;width:100%}
 /* Allow controlled finger panning across empty canvas and annotations. */
 #drawingStage,#drawingStage .hotspot,#drawingStage #hotspotLayer,#annotationCanvas{touch-action:none}
}


/* Four scoped improvements: mandatory types, clear search, phone context menu. */
.twp-required-star{color:#dc2626;font-weight:800;font-size:15px}
input.twp-required-invalid{border:2px solid #dc2626!important;background:#fff1f2!important;box-shadow:0 0 0 2px rgba(220,38,38,.13)!important}
.search-control{position:relative}
#twpClearSearch{position:absolute;right:5px;top:50%;transform:translateY(-50%);z-index:2;width:30px;height:30px;min-width:30px;min-height:30px;padding:0;border:0;border-radius:5px;background:#f1f5f9;color:#334155;font-size:20px;font-weight:700;line-height:1;display:none;align-items:center;justify-content:center}
#twpClearSearch.twp-visible{display:flex}
#search{padding-right:41px!important}
@media(pointer:coarse) and (max-width:699px){#drawingStage,#drawingStage .hotspot{-webkit-touch-callout:none!important;user-select:none!important;-webkit-user-select:none!important}}


/* Align Import Excel with Export Excel in the touch Options list. */
@media (pointer:coarse) and (max-width:1400px){
 #twpMobileOptionsMenu #importExcelBtn{font-weight:normal!important;}
 #twpMobileOptionsMenu #exportExcelBtn{font-weight:normal!important;}
}
/* Show Name: a single-choice popup, available on desktop and touch. */
#twpNameChoicePopup{position:fixed;display:none;z-index:2147483645;min-width:170px;padding:8px 10px;background:#fff;color:#1e293b;border:1px solid #94a3b8;border-radius:8px;box-shadow:0 7px 20px #0004;font:13px Arial,sans-serif;}
#twpNameChoicePopup.twp-open{display:block;}
#twpNameChoicePopup label{display:flex;align-items:center;gap:9px;padding:8px 6px;cursor:pointer;font-weight:500;}
#twpNameChoicePopup input{width:17px;height:17px;accent-color:#0f766e;}

/* Import Excel uses regular text weight in both desktop header and touch Options. */
.header-actions #importExcelBtn, #twpMobileOptionsMenu #importExcelBtn{font-weight:400!important;}

/* Touch-only refinement: do not let native scroll cancel the controlled one-finger pan.
   The existing two-finger pinch handler remains active. */
@media (pointer:coarse) and (max-width:1400px) {
 #viewer { touch-action:none; }
 #floatingProgressHeader,#floatingProgressResize,.floating-progress .draggable-box-header {touch-action:none!important; -webkit-user-select:none;user-select:none;}
 #floatingProgress {touch-action:pan-y;}
}

/* iPad-only progress card gesture: do not modify the working phone behaviour. */
@media (pointer:coarse) and (min-width:700px) and (max-width:1400px){
 #floatingProgress{touch-action:none!important;}
 #floatingProgressHeader{touch-action:none!important;user-select:none!important;-webkit-user-select:none!important;}
}
/* Active Search / Options touch header buttons. */
@media (pointer:coarse) and (max-width:1400px){
 .header-actions #twpIpadSidebarToggle.twp-touch-active,
 .header-actions #twpMobileOptionsBtn.twp-touch-active{background:#166534!important;color:#fff!important;border:2px solid #bbf7d0!important;box-shadow:0 0 0 2px rgba(22,101,52,.22)!important;}
}

/* Isolated administrator unsubscribe request feedback */
.twp-unsubscribe-section{margin-top:16px;padding-top:12px;border-top:1px solid #dbe2ea}
#twpUnsubscribeBtn{background:#fff;color:#9a3412;border:1px solid #f3b68c;font-weight:600}
#twpUnsubscribeStatus{display:none;font-size:12px;line-height:1.5;margin-top:9px;padding:9px 12px;border-radius:6px}
#twpUnsubscribeStatus.twp-unsubscribe-success{display:block;color:#14532d;background:#dcfce7;border:1px solid #86efac;font-weight:700}
#twpUnsubscribeStatus.twp-unsubscribe-error{display:block;color:#991b1b;background:#fee2e2;border:1px solid #fca5a5}



/* Targeted GPS, Comment Subject and per-activity Units additions. */
.twp-unit-check{display:inline-flex;align-items:center;gap:4px;font-size:11px;color:#334155;white-space:nowrap;cursor:pointer;font-weight:600}
.twp-unit-check input{width:15px;height:15px;accent-color:#0d9488}
.project-progress-activity-title .twp-activity-title-right{display:flex;align-items:center;gap:10px;flex-shrink:0}
#twpCalloutCategory:invalid,#twpCalloutCategory.twp-required-error,#twpCalloutSubject.twp-required-error{border:2px solid #dc2626!important;background:#fff1f2!important}
#twpMyLocationBtn.twp-gps-active{background:#166534!important;color:white!important;border:2px solid #86efac!important;box-shadow:0 0 0 2px #86efac55!important}
#twpGpsDot{position:absolute;width:20px;height:20px;margin:-10px 0 0 -10px;z-index:39;pointer-events:none;border-radius:50%;background:#1681ff;border:3px solid white;box-shadow:0 0 0 2px #1577e5,0 1px 10px #00336666;animation:twpGpsPulse 1.5s ease-in-out infinite}
#twpGpsDot[hidden],#twpGpsCalibrationPin[hidden]{display:none!important}
#twpGpsDot span{display:block;width:100%;height:100%;border-radius:50%;background:#1681ff}
@keyframes twpGpsPulse{50%{box-shadow:0 0 0 9px #1681ff36,0 1px 10px #00336644}}
#twpGpsCalibrationPin{position:absolute;z-index:42;background:#ef4444;color:white;border:2px solid white;width:22px;height:22px;border-radius:50%;transform:translate(-50%,-50%);text-align:center;line-height:18px;font-weight:bold;pointer-events:none}
.twp-gps-modal{width:min(450px,calc(100vw - 20px));max-height:80dvh;overflow:auto;margin:3vh auto;padding:18px}
.twp-gps-modal label{display:block;font-size:12px;font-weight:700;margin:9px 0 4px}.twp-gps-modal p{font-size:12px;line-height:1.5}
.twp-gps-count{border-radius:7px;background:#eff6ff;padding:10px;color:#1e40af;font-weight:700}
.twp-gps-inputs{display:grid;grid-template-columns:1fr 1fr;gap:10px}
#twpGpsCalibrationMessage{font-size:12px;line-height:1.5;margin-top:9px}
@media print{.twp-unit-check{display:none!important}}
/* Comment hover shows saved rich text, including paragraph and inline formatting. */
.tooltip .remark-content.twp-comment-preview{white-space:normal;line-height:1.45;max-height:350px;overflow:auto}
.tooltip .remark-content.twp-comment-preview p{margin:0 0 .5em}
.tooltip .remark-content.twp-comment-preview div{margin:0}
.tooltip .remark-content.twp-comment-preview span{white-space:inherit}


@media (pointer:coarse) and (max-width:1400px){body > #twpMobileOptionsMenu #twpMyLocationBtn,body > #twpMobileOptionsMenu #twpGpsCalibrateBtn{display:block!important;width:100%!important;text-align:left!important}}

/* Isolated Project Progress search-clear control (all screen sizes). */
.project-progress-search-wrap #projectProgressSearch{padding-right:37px;}
.project-progress-search-wrap #twpProgressSearchClear{position:absolute;right:5px;top:50%;transform:translateY(-50%);z-index:3;display:flex;align-items:center;justify-content:center;width:27px;min-width:27px;height:27px;min-height:27px;padding:0;border:0;border-radius:5px;background:#eef2f7;color:#475569;font:22px/1 Arial;cursor:pointer;}
.project-progress-search-wrap #twpProgressSearchClear[hidden]{display:none!important;}
.project-progress-search-wrap #twpProgressSearchClear:hover{background:#dbeafe;color:#003366;}
.twp-gps-modal #twpGpsFinish:disabled{opacity:.48;cursor:not-allowed;}

/* Version 3 desktop-only consolidated header; preserve existing touch layouts. */
@media (pointer:fine), (min-width:1401px){
 body.twp-ipad-sidebar-closed .sidebar{display:none!important}
 .header-actions{flex-wrap:nowrap!important;gap:8px;min-width:0}
 .header-actions #twpIpadSidebarToggle{display:inline-flex!important;align-items:center;white-space:nowrap}
 .header-actions #twpIpadSidebarToggle.twp-search-open{background:#0f766e!important;color:#fff!important;border-color:#0f766e!important;box-shadow:0 0 0 2px #86efac55}
 .header-actions #twpMobileOptionsWrap{display:block!important;position:relative;flex:0 0 auto}
 .header-actions #twpMobileOptionsBtn{display:inline-flex!important;align-items:center;min-height:32px;white-space:nowrap}
 .header-actions #twpMobileOptionsMenu{display:none;position:absolute;right:0;top:calc(100% + 7px);width:240px;max-height:min(65vh,560px);overflow-y:auto;z-index:2147483000;padding:6px;background:#fff;border:1px solid #cbd5e1;border-radius:9px;box-shadow:0 10px 24px #0004}
 .header-actions #twpMobileOptionsMenu.twp-open{display:flex;flex-direction:column;gap:5px}
 .header-actions #twpMobileOptionsMenu button{display:block!important;width:100%;min-height:34px;text-align:left;color:#17365d!important;background:#f8fafc!important;border:1px solid #e2e8f0!important;font-size:12px!important}
 .header-actions #twpMobileOptionsMenu button[style*="display: none"],.header-actions #twpMobileOptionsMenu button[style*="display:none"]{display:none!important}
 .header-actions #twpMobileOptionsMenu .button-file{display:block!important;width:100%}
 .header-actions .signed-in-user{display:none!important}
 .header-actions #signedInUserEmail{display:none!important}
 .header-actions #logoutBtn{white-space:nowrap}
 .header-actions #twpMyLocationBtn,.header-actions #cloudSaveBtn{white-space:nowrap}
}


/* Fix desktop Options dropdown being overlaid by the image's top-right controls. */
@media (pointer:fine), (min-width:1401px){
  body > .header, body > header.header {z-index:6000!important;position:relative;overflow:visible!important;}
  .header-actions #twpMobileOptionsWrap{z-index:6001!important;}
  .header-actions #twpMobileOptionsMenu{z-index:6002!important;}
}

/* Persistent clear control for the left-panel search. Escape never clears this field. */
.search-control #twpClearSearch,
.search-control #twpClearSearch:not(.twp-visible){display:flex!important;align-items:center;justify-content:center;}
.search-control #twpClearSearch:disabled{opacity:.45;cursor:default;}
.search-control #twpClearSearch:not(:disabled){opacity:1;cursor:pointer;}


/* V7: these dialogs must render above the navy header and drawing toolbar. */
#projectProgressModal,#twpGpsModal {z-index:8100!important;}
#projectProgressModal .project-progress-modal,#twpGpsModal .twp-gps-modal {position:relative;}
#projectProgressModal .project-progress-head,#twpGpsModal #twpGpsModalTitle {
 cursor:move;touch-action:none;user-select:none;-webkit-user-select:none;
}
#projectProgressModal .project-progress-head button {cursor:pointer;touch-action:auto;}
/* Keep a visible grab area and title within the overlay on opening. */
#projectProgressModal .project-progress-modal {margin-top:max(20px,3vh);}
#twpGpsModal .twp-gps-modal {margin-top:max(20px,3vh);}

/* V11: desktop editing overlays must sit above the navy page header.
   Restrict the rule to fine-pointer layouts; touch layouts remain unchanged. */
@media (pointer:fine) {
  #modal, #markupModal, #twpCalloutModal { z-index: 8200 !important; }
}


/* iPad/phone: isolate pinch gestures on the fixed navy header, leaving the drawing zoom alone. */
@media (pointer:coarse) and (max-width:1400px) {
  .header, .header * { touch-action:pan-x pan-y; }
}

/* Desktop only: keep Manage Projects & Users within the viewport.
   Scope directly to the admin dialog to avoid changing nested permission dialogs. */
@media (min-width: 700px) and (pointer: fine) {
  #projectAdminModal > .modal-content {
    max-height: min(76dvh, 720px) !important;
    margin: 3vh auto !important;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  #projectAdminModal > .modal-content > .modal-actions {
    position: sticky;
    bottom: 0;
    z-index: 2;
    background: #fff;
    padding: 10px 0 3px;
    border-top: 1px solid #e2e8f0;
  }
}

/* Version 14 — comment history, mandatory issue status. Existing mobile layout unchanged. */
#twpCalloutModal .twp-callout-content{max-height:min(88dvh,760px);overflow-y:auto;}
.twp-comment-history{margin:10px 0;border:1px solid #dbe2ea;border-radius:7px;background:#f8fafc;padding:9px;}
.twp-comment-history-title{font-size:12px;font-weight:700;color:#003366;margin-bottom:7px;}
.twp-comment-history-title span{font-weight:400;color:#64748b;}
.twp-comment-history-scroll{max-height:170px;min-height:55px;overflow-y:auto;overscroll-behavior:contain;background:#fff;border:1px solid #e2e8f0;border-radius:5px;padding:7px;}
.twp-history-entry{padding:7px 5px;border-bottom:1px solid #e2e8f0;font-size:12px;}
.twp-history-entry:last-child{border-bottom:0;}
.twp-history-meta{display:flex;flex-wrap:wrap;justify-content:space-between;gap:5px;color:#475569;}
.twp-history-status{font-size:11px;font-weight:700;color:#0f766e;margin:3px 0;}
.twp-history-text{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.45;color:#1e293b;}
.twp-history-empty{font-size:12px;color:#64748b;padding:8px 3px;}
.twp-comment-status{display:flex;flex-wrap:wrap;gap:10px;border:1px solid #dbe2ea;border-radius:7px;padding:8px 10px;margin:10px 0;}
.twp-comment-status legend{font-weight:700;font-size:12px;color:#003366;padding:0 5px;}
.twp-comment-status label{display:inline-flex;gap:5px;align-items:center;font-size:12px;font-weight:600;cursor:pointer;}
.twp-comment-status input{width:auto;accent-color:#0d9488;}
.twp-comment-error{color:#b42318;font-size:12px;font-weight:700;flex-basis:100%;}
/* Only the comment originator can change the subject and category. */
#twpCalloutModal .twp-comment-owner-locked{background:#f1f5f9!important;color:#64748b!important;opacity:1!important;cursor:not-allowed!important;}

/* V17: ruler always centred above the fixed application header */
#rulerCalibrationModal {z-index:1000050!important;align-items:center!important;justify-content:center!important;padding:12px!important;}
#rulerCalibrationModal .ruler-choice-content {position:relative!important;margin:auto!important;transform:none!important;max-height:calc(100dvh - 40px)!important;overflow:auto!important;}
/* Compact dimension editing fields, no changes outside markup editor. */
#twpShapeDimensions{display:none;margin:9px 0;padding:10px;border:1px solid #cbd5e1;border-radius:6px;background:#f8fafc}
#twpShapeDimensions .twp-dim-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
#twpShapeDimensions label{display:block;font-size:12px;font-weight:600;color:#334155}
#twpShapeDimensions input{margin-top:4px;min-width:0}
#twpShapeDimensions .twp-shape-result{font-size:12px;margin-top:8px;color:#0f4c81;font-weight:700}
#projectProgressModal .twp-progress-actions-bottom{display:flex;justify-content:flex-end;padding-top:8px;flex:0 0 auto}
#projectProgressModal .project-progress-activity.twp-progress-chosen{border:2px solid #0d9488;background:#ecfdf5}

/* V18: Project Progress action row and permission inspection. */
#projectProgressModal .twp-progress-actions-bottom{gap:8px;align-items:center;}
#twpExistingAccessModal .twp-existing-right{font-size:12px;padding:6px 4px;border-bottom:1px solid #e2e8f0;}
#twpPermissionModal .twp-select-all-access{display:flex;align-items:center;gap:8px;font-size:13px;font-weight:700;padding:8px 10px;background:#f0f7ff;border:1px solid #dbeafe;border-radius:6px;}
#twpPermissionModal .twp-select-all-access input{width:auto;min-height:0;}

/* V21: Sub Activity editor additions; keep all other popup and device layouts. */
.twp-subactivity-control{padding:8px 10px;background:#f8fafc;border:1px solid #e2e8f0;border-radius:6px}
.twp-subactivity-control .twp-subactivity-check{display:flex;align-items:center;gap:8px;margin-bottom:4px;cursor:pointer}
.twp-subactivity-control .twp-subactivity-check input{width:17px;height:17px;min-height:0;accent-color:#0d9488}
.twp-subactivity-control small{display:block;color:#64748b;font-size:11px;line-height:1.45}
#twpSubActivityParent.twp-required-invalid{border:2px solid #dc2626;background:#fef2f2}
#twpSubPrintModal .modal-content{max-height:80dvh;overflow:auto}

/* V24: Collapsible, independently countable Sub Activities in Project Progress. */
.twp-progress-parent-label{display:inline-flex;align-items:center;gap:6px;min-width:0;flex-wrap:wrap}
.twp-sub-toggle{display:inline-flex;align-items:center;justify-content:center;width:25px;height:25px;padding:0;border:1px solid #cbd5e1;border-radius:5px;background:#f1f5f9;color:#003366;font-size:19px;font-weight:700;line-height:1;flex:none;cursor:pointer}
.twp-sub-toggle:hover{background:#dbeafe}
.twp-sub-count{color:#64748b;font-size:10px;font-weight:normal}
.twp-progress-parent-block{margin:7px 0}
.twp-progress-parent-block>.project-progress-activity{margin:0}
.twp-progress-sub-list{border:1px solid #c9e6df;border-top:0;border-radius:0 0 8px 8px;background:#effaf7;padding:5px 8px 6px 21px}
.twp-progress-sub-row{padding:9px 8px;border-bottom:1px solid #c9e6df;font-size:12px}
.twp-progress-sub-row:last-child{border-bottom:0}
.twp-progress-sub-row .project-progress-activity-title{gap:8px}
.twp-progress-sub-row .project-progress-activity-title>span:first-child{color:#0f766e}
@media (pointer:fine) and (min-width:700px){
  #projectProgressModal .project-progress-modal{height:min(86dvh,850px);max-height:calc(100dvh - 28px);margin-top:2vh}
}

/* v25 cable controls in the existing scrollable tool row */
#toolbox #twpAddCableBtn,#toolbox #twpViewCableBtn{flex:0 0 auto;min-width:85px;width:auto;height:34px;font-size:12px;font-weight:700;white-space:nowrap;padding:4px 7px}
@media(pointer:coarse){#toolbox #twpAddCableBtn,#toolbox #twpViewCableBtn{min-height:44px;height:44px;font-size:12px}}
#twpCableModal select{width:100%;font-size:14px}

/* Searchable cable endpoint fields; constrained to the cable dialog only. */
#twpCableModal .twp-cable-combobox{position:relative;width:100%}
#twpCableModal .twp-cable-hidden-select{display:none!important}
#twpCableModal .twp-cable-search{width:100%;box-sizing:border-box;min-height:39px;padding:8px 10px;font-size:14px}
#twpCableModal .twp-cable-suggestions{position:absolute;top:100%;left:0;right:0;max-height:240px;overflow-y:auto;background:#fff;color:#1f2937;border:1px solid #a9b7c7;border-radius:0 0 7px 7px;box-shadow:0 7px 18px #0003;z-index:20}
#twpCableModal .twp-cable-suggestions[hidden]{display:none}
#twpCableModal .twp-cable-result{display:block;width:100%;min-height:36px;padding:8px 10px;text-align:left;border:0;border-radius:0;background:#fff;white-space:normal;overflow-wrap:anywhere;font-size:13px;color:#1f2937}
#twpCableModal .twp-cable-result:hover,#twpCableModal .twp-cable-result.active{background:#e8f2ff;color:#003366}
#twpCableModal .twp-cable-none{padding:9px 10px;font-size:12px;color:#64748b}


/* Cable endpoint items remain visible and hoverable only while routing a new cable.
   The other existing equipment/markup stays hidden in clean New Markup mode. */
body.twp-new-markup-mode .hotspot.twp-cable-endpoint{visibility:visible!important;pointer-events:auto!important;cursor:help}
/* Only the active cable-routing banner gets the low-edge position. */
#twpCableRouteHelp{bottom:4px;max-width:min(900px,calc(100vw - 12px));box-sizing:border-box}
@media (pointer:coarse){
 body.twp-cable-routing .viewer-controls{bottom:92px!important}
 #twpCableRouteHelp{bottom:max(3px,env(safe-area-inset-bottom));font-size:11px;padding:6px 9px}
}

/* Cable/conduit creation is available on both desktop and touch devices. */


/* V33: touch controls must not magnify the page when focused or double-tapped.
   16px prevents Safari's automatic input-focus zoom. No desktop styling changes. */
@media (pointer:coarse) and (max-width:1400px) {
  #twpCableModal .twp-cable-search,
  #twpCableModal select,
  .sidebar .search-control input,
  #projectProgressSearch,
  #twpMobileOptionsMenu input,
  #twpMobileOptionsMenu select {font-size:16px!important;}
  #twpCableModal .twp-cable-combobox,
  #twpCableModal .twp-cable-suggestions,
  #twpCableModal .twp-cable-result,
  .header, .header-actions,
  #twpMobileOptionsBtn, #twpMobileOptionsMenu,
  #twpIpadSidebarToggle, .sidebar .search-row,
  #twpCableModal .modal-content {
    touch-action:pan-x pan-y;
  }
}

/* V34: Print choice fits on touch screens without changing project-progress layout. */
#twpSubPrintModal .modal-content{width:min(94vw,480px)}
#twpSubPrintModal .modal-actions{flex-wrap:wrap}
#twpSubPrintCurrent{white-space:nowrap}

/* V36: grouped admin permissions; confined to the two permission windows. */
#twpPermissionModal .modal-content,#twpExistingAccessModal .modal-content{max-height:min(86dvh,760px);overflow-y:auto;}
#twpPermissionOptions.twp-permission-options{display:block;}
#twpPermissionModal .twp-access-group,#twpExistingAccessModal .twp-access-group{border:1px solid #dbe2ea;border-radius:8px;margin:10px 0;overflow:hidden;background:#fff;}
#twpPermissionModal .twp-access-group h3,#twpExistingAccessModal .twp-access-group h3{font-size:14px;margin:0;padding:9px 12px;background:#eaf1f8;color:#003366;border-bottom:1px solid #dbe2ea;}
#twpPermissionModal .twp-access-grid,#twpExistingAccessModal .twp-access-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px;padding:8px;}
#twpPermissionModal .twp-access-row,#twpExistingAccessModal .twp-access-row{margin:0;padding:8px 6px;min-width:0;display:flex;align-items:center;gap:7px;font-size:12px;word-break:break-word;cursor:pointer;}
#twpPermissionModal .twp-access-row input,#twpExistingAccessModal .twp-access-row input{flex:0 0 auto;width:17px;height:17px;min-height:0;}
#twpExistingAccessModal .twp-access-readonly{cursor:default;}
@media(max-width:550px){#twpPermissionModal .twp-access-grid,#twpExistingAccessModal .twp-access-grid{grid-template-columns:minmax(0,1fr);}}
/* Keep route handles interactive with the Hand/Select tool; allow existing touch pinch zoom. */
body.twp-cable-routing #annotationCanvas{pointer-events:auto!important;touch-action:none;}
@media(pointer:coarse) and (max-width:1400px){body.twp-cable-routing #twpTouchActionDock #twpIpadFinish{display:inline-flex!important;}}

/* TWP v40 — photos: isolated from desktop/tablet/mobile drawing layout */
#twpPhotoModal{z-index:9300!important}
.twp-photo-notice{position:fixed;bottom:14px;left:14px;z-index:9400;max-width:min(420px,calc(100vw - 28px));padding:10px 12px;background:#fffbeb;border:1px solid #f59e0b;border-radius:8px;box-shadow:0 5px 15px #0003;color:#78350f;display:flex;align-items:center;gap:12px;font-size:12px;line-height:1.4}
.twp-photo-notice[hidden]{display:none!important}
.twp-photo-notice button{margin-left:auto;padding:3px 7px;min-width:28px;background:white}
.twp-photo-dialog{position:relative;width:min(540px,96vw)!important;max-height:min(88dvh,760px)!important;overflow-y:auto;overscroll-behavior:contain;margin:3vh auto!important}
.twp-photo-header{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:9px}
.twp-photo-header h2{margin:0}
#twpPhotoX{min-width:36px;min-height:36px;font-weight:bold;font-size:17px}
.twp-photo-quota{background:#f1f5f9;padding:9px;border-radius:6px;font-size:12px;line-height:1.45}
.twp-photo-file-action{display:inline-flex!important;align-items:center;justify-content:center;border:1px solid #9cabb9;background:#f8fafc;padding:10px 14px;border-radius:6px;cursor:pointer;font-size:13px!important;min-height:40px}
.twp-photo-file-action input{position:absolute;opacity:0;width:1px;height:1px;pointer-events:none}
.twp-photo-capture-actions{display:flex;gap:8px;flex-wrap:wrap;margin:9px 0 4px}
.twp-photo-camera-choice{display:none!important}
#twpPhotoName{margin:5px 0}
#twpPhotoMessage{margin:10px 0;font-size:12px;min-height:16px;line-height:1.45}
.twp-photo-view-title{font-size:14px;margin:13px 0 6px}
#twpPhotoList{max-height:36vh;overflow-y:auto}
.twp-photo-item{border:1px solid #d9e2e9;border-radius:6px;margin:5px 0;background:#fff}
.twp-photo-item summary{padding:10px;cursor:pointer;overflow-wrap:anywhere;font-size:13px}
.twp-photo-preview{padding:8px;font-size:12px}
.twp-photo-preview img{display:block;width:auto;max-width:100%;max-height:55vh;object-fit:contain;border-radius:4px}
.rich-text-toolbar .twp-photo-upload-open{min-width:33px!important;min-height:29px;padding:3px 6px!important;font-size:17px!important}
.rich-text-toolbar .twp-photo-view-open{min-height:29px;padding:4px 7px!important;white-space:nowrap}
@media (pointer:coarse) and (max-width:1400px){
 .twp-photo-camera-choice{display:inline-flex!important}
 .twp-photo-dialog{max-height:calc(100dvh - 20px)!important;margin:5px auto!important}
 .rich-text-toolbar .twp-photo-upload-open,.rich-text-toolbar .twp-photo-view-open{min-height:42px!important;font-size:14px!important;touch-action:manipulation}
}

/* V41: photo access directly from hover details, without changing markup geometry. */
.tooltip .tooltip-title{position:relative;padding-right:40px;min-height:28px}
.tooltip .twp-hover-photo-button{position:absolute;top:-3px;right:0;display:inline-flex;align-items:center;justify-content:center;width:34px;height:30px;min-width:34px;padding:2px;border:1px solid #cbd5e1;border-radius:6px;background:#fff;font-size:18px;line-height:1;cursor:pointer;z-index:2;touch-action:manipulation}
.tooltip .twp-hover-photo-button:hover{background:#eaf3ff;border-color:#93c5fd}
.twp-photo-actions{padding:4px 8px 12px;display:flex;justify-content:flex-end}
.twp-photo-download{font-size:12px;font-weight:600;background:#eef6ff;border:1px solid #b6cbe4;color:#17365d}
/* Larger photo viewer on desktop only. Preserve iPad/phone geometry. */
@media (pointer:fine) and (min-width:701px){
 #twpPhotoModal .twp-photo-dialog{width:min(860px,94vw)!important;max-height:min(92dvh,940px)!important;margin:2vh auto!important}
 #twpPhotoList{max-height:62vh}
 .twp-photo-preview img{max-height:68vh}
}

/* TWP v42: focused enhancements without changing the drawing stage geometry. */
.sidebar{display:flex;flex-direction:column;overflow:hidden;}
.sidebar .twp-sidebar-scroll{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;}
.sidebar .twp-sidebar-footer{flex:0 0 auto;background:#fff;border-top:1px solid #dbe2ea;padding:9px 4px 2px;font:10px/1.35 Arial,sans-serif;color:#64748b;text-align:center;}
.twp-hold-progress{touch-action:pan-y;}
.twp-hold-progress .twp-progress-heading>b{background:linear-gradient(90deg,#fff7a8,#fff000,#ffe878);border-radius:3px;padding:3px 4px;box-decoration-break:clone;}
.twp-hold-progress .twp-progress-heading>b:hover{box-shadow:0 0 8px #facc15;}
.twp-progress-heading{align-items:center;}
.twp-summary-percent-only{justify-content:flex-end!important;}
.twp-summary-percent-only span{font-size:15px;font-weight:800;color:#003366;}
.twp-hold-progress .twp-progress-heading{font-size:13px;}
.twp-photo-delete{background:#b42318!important;color:white!important;border-color:#991b1b!important;font-weight:700;}
.twp-photo-delete:disabled{opacity:.45;cursor:not-allowed;}
.twp-photo-actions{gap:9px;}
.twp-photo-location{font-size:11px;color:#475569;padding:1px 10px 8px;line-height:1.5;}
.twp-logout-icon{display:none;}
.twp-sort-icon{display:none;}
@media (pointer:coarse) and (max-width:1400px){
 .header-actions #logoutBtn{display:inline-flex!important;align-items:center;justify-content:center;background:#dc2626!important;border-color:#b91c1c!important;color:#fff!important;border-radius:10px!important;}
 #logoutBtn .twp-logout-text{display:none;}
 #logoutBtn .twp-logout-icon{display:block;font-weight:900;font-size:29px;line-height:1;color:white;}
 #projectProgressModal .project-progress-sort-label{position:relative;display:inline-flex;align-items:center;justify-content:center;width:42px!important;min-width:42px;max-width:42px;height:40px;background:#f1f5f9;border:1px solid #cbd5e1;border-radius:7px;overflow:hidden;flex:0 0 auto;}
 #projectProgressModal .twp-sort-text{display:none;}
 #projectProgressModal .twp-sort-icon{display:block;font-size:27px;font-weight:800;line-height:1;color:#003366;pointer-events:none;}
 #projectProgressModal #projectProgressSort{position:absolute;inset:0;width:100%!important;max-width:none!important;height:100%;opacity:0;cursor:pointer;font-size:16px;}
 #projectProgressModal .project-progress-search-wrap{min-width:0;flex:1 1 140px;}
}

/* Version 43: Show Progress heading readability; drawing geometry is unchanged. */
.twp-individual-overlay .twp-overlay-head{font-size:15px;line-height:1.35;}
@media (pointer:coarse){.twp-individual-overlay .twp-overlay-head{font-size:16px;}}

/* Version 45: Bulk Equipments (desktop only; does not affect existing Options layout). */
#twpBulkEquipmentsDialog{z-index:25000;}
#twpBulkEquipmentsDialog .twp-bulk-equipment-content{position:relative;width:min(510px,92vw);margin:8vh auto;max-height:80vh;overflow:auto;}
#twpBulkEquipmentsDialog .twp-popup-x{position:absolute;top:10px;right:10px;}
@media (pointer:coarse) and (max-width:1400px){#twpBulkEquipmentsBtn{display:none!important}#twpBulkEquipmentsDialog{display:none!important}}

/* Version 46: desktop Bulk Markup dialog without changing touch layout */
#twpBulkMarkupDialog{z-index:25000;}#twpBulkMarkupDialog .twp-bulk-markup-content{position:relative;width:min(535px,92vw);margin:8vh auto;max-height:80vh;overflow:auto;}@media(pointer:coarse) and (max-width:1400px){#twpBulkMarkupsBtn{display:none!important;} }


/* V51: larger site name and compact single-line calibrated site weather. */
#siteUpdateInfo{display:flex;align-items:baseline;white-space:nowrap!important;overflow-x:auto;overflow-y:hidden;overflow-wrap:normal!important;max-width:100%;font-weight:600!important;scrollbar-width:thin}
#twpWeatherSiteName{font-size:15px;font-weight:800;flex:none}
#twpWeatherInline{font-size:12px;flex:none}
#twpOnlineUsersWrap{flex:none}
@media(pointer:coarse) and (max-width:1400px){#twpWeatherSiteName{font-size:13px}#twpWeatherInline{font-size:11px}}
#twpSevenDayWeatherDialog{z-index:25000}

/* V53: no horizontally scrolling weather text on small screens. */
#siteUpdateInfo{overflow:hidden!important;max-width:100%;min-width:0;white-space:nowrap!important;align-items:center;}
#twpWeatherInline{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
#twpWeatherCompactBtn{display:none;border:1px solid #0284c7;background:#7dd3fc;color:#ffffff;text-shadow:-1px -1px 0 #111827,1px -1px 0 #111827,-1px 1px 0 #111827,1px 1px 0 #111827;font-weight:750;border-radius:6px;padding:3px 10px;cursor:pointer;white-space:nowrap;font-size:12px;line-height:1.5;}
@media (max-width:1550px){#twpWeatherInline{display:none!important}#twpWeatherCompactBtn{display:inline-flex!important;align-items:center;}}
#twpTodayWeatherDialog{z-index:25001;}


/* Version 54: immediate photo upload and touch gallery. */
#twpPhotoUploadBtn{display:none!important}
/* Version 54: touch photo gallery gets more usable vertical space. */
@media (pointer:coarse) and (max-width:1400px){
 .twp-photo-dialog{height:calc(100dvh - 18px)!important;max-height:calc(100dvh - 18px)!important;display:flex;flex-direction:column;}
 #twpPhotoList{max-height:none!important;min-height:36vh;flex:1 1 auto;overflow-y:auto;-webkit-overflow-scrolling:touch;}
 .twp-photo-preview img{max-height:62dvh;}
}

/* v56: Add User request modal must sit above the admin-only management overlay. */
#twpAddUserRequestModal { z-index: 1000010 !important; }

/* v57: hover details use the same site weather as Today’s Weather dialog. */
#twpWeatherHoverTip{position:fixed;display:none;z-index:1000005;width:min(390px,calc(100vw - 20px));max-height:75vh;overflow:auto;background:#fff;color:#172b4d;border:1px solid #9ecae9;border-radius:11px;box-shadow:0 8px 28px rgba(0,0,0,.22);padding:14px 16px;font-size:13px;line-height:1.5;pointer-events:none;white-space:normal;text-align:left;}
#twpWeatherHoverTip p{margin:4px 0 10px;}
