/* Application shell and libraries. Editor/report components live in styles.css. */
:root {
  --bg: #f6f8fb;
  --text: #263449;
  --muted: #66768a;
  --border: #e5eaf1;
  --pass: #168455;
  --accent: #3768ce;
  --accent-soft: #edf3ff;
}

html, body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, select, summary { font: inherit; }
.app { display: grid; grid-template-columns: 216px minmax(0, 1fr); height: 100vh; height: 100dvh; min-height: 0; }
.main { overflow: hidden; }
.icon { width: 20px; height: 20px; display: inline-block; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon-small { width: 16px; height: 16px; }
.btn { border-radius: 7px; min-height: 38px; padding: 9px 15px; font-size: 14px; font-weight: 600; line-height: 1.4; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn-primary { background: #ec6a27; border-color: #ec6a27; box-shadow: 0 2px 3px #bc531317; }
.btn-primary:hover { background: #d65b1c; border-color: #d65b1c; }
.btn-icon { min-width: 32px; min-height: 32px; display: inline-grid; place-items: center; }
.btn-link { font-size: 14px; font-weight: 500; }
.btn:disabled, button:disabled { opacity: .5; }

/* Primary navigation has a single job, and never competes with the test list. */
.sidebar { background: #0c1729; color: #c0cede; border: none; padding: 0 12px; overflow-y: auto; }
.sidebar .brand { min-height: 76px; padding: 18px 8px; gap: 8px; background: transparent; border-bottom: 1px solid #ffffff0d; text-decoration: none; }
.sidebar .brand-mark { width: 34px; height: 34px; }
.sidebar .brand-name { font-size: 19px; display: flex; align-items: center; gap: 8px; }
.brand-edition { font-family: inherit; font-size: 10px; font-weight: 500; letter-spacing: .1em; color: #b6c6dc; border: 1px solid #ffffff24; border-radius: 4px; padding: 3px 4px; }
.sidebar .brand-sub { font-size: 10px; color: #8196b3; letter-spacing: .18em; }
.nav-caption { padding: 29px 15px 12px; font-size: 11px; font-weight: 650; letter-spacing: .16em; color: #8b9db8; }
.sidebar-tabs { display: flex; flex-direction: column; gap: 5px; border: 0; padding: 0; }
.sidebar-tabs .tab { display: flex; align-items: center; flex: none; gap: 12px; height: 44px; margin: 0; padding: 0 14px; border: 1px solid transparent; border-radius: 7px; color: #a9bad0; text-align: left; font-size: 14px; }
.sidebar-tabs .tab:hover { background: #ffffff06; color: #eef4ff; }
.sidebar-tabs .tab.active { background: #1c2d46; border-color: #2c3e58; color: #fff; }
.sidebar-tabs .tab.active .icon { color: #fc9a65; }
.nav-count { margin-left: auto; padding: 1px 6px; border-radius: 4px; font-size: 12px; color: #65758c; background: #ffffff08; }
.sidebar-note { margin-top: auto; border-top: 1px solid #ffffff0d; padding: 20px 12px 22px; display: flex; gap: 9px; align-items: flex-start; }
.environment-dot { width: 6px; height: 6px; border-radius: 50%; background: #49ae86; display: inline-block; flex: none; margin-top: 5px; }
.sidebar-note strong { font-size: 13px; color: #b3c1d4; display: block; font-weight: 500; }
.sidebar-note div > span { display: block; font-size: 11px; color: #8b9db8; margin-top: 4px; }

/* Persistent header keeps identity and account actions out of the content. */
.app-header { display: flex; min-height: 76px; flex: none; align-items: center; justify-content: space-between; background: #fff; padding: 0 32px; border-bottom: 1px solid var(--border); gap: 16px; z-index: 30; }
.breadcrumbs { display: flex; gap: 14px; align-items: center; font-size: 14px; min-width: 0; }
.breadcrumb-root { color: #65758c; }
.breadcrumb-divider { color: #c2ccda; }
#page-label { font-weight: 550; white-space: nowrap; }
.header-actions { display: flex; align-items: center; gap: 20px; }
.bell { background: transparent; border: none; width: 34px; height: 34px; display: grid; place-items: center; color: #6e7d91; }
.bell-count { min-width: 15px; height: 15px; line-height: 15px; font-size: 11px; top: -1px; right: -1px; }
.account-menu > summary { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.account-avatar { width: 33px; height: 33px; border-radius: 10px; background: #eaf0f9; border: 1px solid #e0e8f3; color: #4f678b; display: grid; place-items: center; font-size: 13px; font-weight: 650; }
.account-info { max-width: 160px; gap: 3px; }
.account-name { font-size: 13px; }
.account-role { font-size: 10px; letter-spacing: .08em; }
.dropdown { position: relative; flex: none; }
.dropdown > summary { list-style: none; cursor: pointer; }
.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown-panel { position: absolute; right: 0; top: calc(100% + 10px); min-width: 190px; padding: 6px; background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 12px 40px #15253b20; z-index: 45; }
.dropdown-panel > button { width: 100%; display: block; border: 0; border-radius: 5px; background: none; text-align: left; padding: 10px 12px; font-size: 14px; cursor: pointer; color: var(--text); }
.dropdown-panel > button:hover { background: var(--bg); }
.dropdown-panel > .danger-text { color: var(--fail); }
.menu-caption { display: block; font-size: 10px; letter-spacing: .12em; color: #65758c; padding: 10px 12px 6px; }
.menu-divider { border-top: 1px solid var(--border); margin: 5px; }
.mobile-browse, .nav-backdrop { display: none; }

/* Each section owns its controls and fills the remaining viewport. */
.page-content { padding: 32px; overflow-y: auto; min-height: 0; flex: 1; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.page-heading h1 { font-family: var(--brand-font); font-size: 27px; font-weight: 600; line-height: 1.35; letter-spacing: -.7px; margin: 8px 0 7px; color: #1e2b40; }
.page-heading p { font-size: 14px; line-height: 1.65; margin: 0; color: var(--muted); }
.eyebrow { font-size: 10px; letter-spacing: .17em; font-weight: 700; color: #65758c; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; flex: none; max-width: 100%; }
.library-workspace .page-heading { flex-wrap: wrap; }
.heading-count { vertical-align: middle; display: inline-block; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 14px; line-height: 25px; padding: 0 9px; background: #eaf0f7; color: #5a6e89; border: 1px solid #e0e7f0; border-radius: 7px; margin-left: 6px; letter-spacing: 0; }
.surface { background: #fff; border: 1px solid var(--border); border-radius: 10px; }

/* Overview */
.empty { display: block; width: 100%; margin: 0; text-align: left; color: var(--text); }
.overview-heading { max-width: none; }
.overview-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; margin-bottom: 28px; }
.overview-stat { min-width: 0; background: #fff; border: 1px solid var(--border); border-radius: 9px; padding: 18px 20px; text-align: left; display: flex; flex-direction: column; gap: 10px; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.overview-stat:hover { border-color: #bbcadf; box-shadow: 0 3px 12px #24395408; }
.stat-topline { font-size: 13px; color: #61718a; font-weight: 550; display: flex; align-items: center; gap: 8px; }
.stat-topline::before { content: ''; width: 6px; height: 6px; background: #628cce; border-radius: 2px; }
.stat-passed .stat-topline::before { background: #38a97b; }
.stat-attention .stat-topline::before { background: #edaa56; }
.stat-none .stat-topline::before { background: #a4b1c5; }
.overview-stat strong { font-size: 30px; line-height: 1.15; font-weight: 600; letter-spacing: -.8px; color: #25344a; }
.stat-caption { font-size: 12px; color: #65758c; line-height: 1.5; }
.overview-grid { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(245px, 1fr); gap: 22px; align-items: start; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 21px 22px; }
.section-heading h2 { font-size: 14px; margin: 0 0 5px; font-weight: 600; }
.section-heading p { font-size: 12px; margin: 0; color: #65758c; }
.section-heading .btn-link { font-size: 12px; white-space: nowrap; }
.activity-columns, .overview-test { display: grid; grid-template-columns: minmax(0, 1fr) 90px 78px; gap: 12px; align-items: center; padding: 12px 22px; }
.activity-columns { background: #fafbfd; font-size: 10px; font-weight: 600; letter-spacing: .08em; color: #65758c; border-top: 1px solid #f0f3f8; border-bottom: 1px solid #f0f3f8; }
.activity-columns > :last-child { text-align: right; }
.overview-test { width: 100%; background: none; border: 0; border-bottom: 1px solid #f0f3f8; border-radius: 0; margin: 0; padding-top: 17px; padding-bottom: 17px; cursor: pointer; text-align: left; }
.overview-test:last-child { border-bottom: 0; border-radius: 0 0 10px 10px; }
.overview-test:hover { background: #fafcff; }
.activity-name { min-width: 0; display: grid; gap: 4px; }
.activity-name strong { font-size: 13px; font-weight: 550; line-height: 1.6; overflow-wrap: anywhere; }
.activity-name small { font-size: 11px; color: #65758c; overflow-wrap: anywhere; }
.activity-time { font-size: 12px; color: #65758c; }
.badge { font-family: inherit; font-size: 11px; font-weight: 550; letter-spacing: 0; text-transform: none; padding: 4px 8px; border-radius: 5px; white-space: nowrap; width: fit-content; }
.overview-test > .badge { justify-self: end; }
.badge.passed { background: #eaf7f0; color: #228260; }
.badge.failed { background: #fff0ed; color: #c65d47; }
.badge.running { background: #edf3ff; color: #527dc8; }
.badge.none { background: #f0f3f7; color: #65758c; }
.workflow-card { padding: 25px; background: linear-gradient(145deg, #fff, #fcfaf7); }
.workflow-card > .eyebrow { color: #b17c50; }
.workflow-card h2 { font-family: var(--brand-font); font-size: 17px; font-weight: 500; line-height: 1.6; letter-spacing: -.4px; margin: 12px 0 23px; color: #36455b; }
.workflow-card ol { list-style: none; padding: 0; margin: 0 0 22px; display: grid; gap: 20px; }
.workflow-card li { display: flex; gap: 12px; }
.workflow-number { font-size: 11px; padding-top: 4px; color: #b4a390; }
.workflow-card strong { font-size: 13px; font-weight: 550; }
.workflow-card p { margin: 5px 0 0; font-size: 12px; color: #65758c; line-height: 1.7; }
.workflow-card .btn { width: 100%; font-size: 13px; border-color: #e7e0d7; background: #fff; color: #79664f; }
.overview-footnote { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 25px; font-size: 11px; color: #65758c; }
.overview-footnote .environment-dot { width: 5px; height: 5px; margin: 0; }

/* Libraries are full-width rows, with enough room for actual test names. */
.library-tools { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; flex-wrap: wrap; }
.library-search { display: flex; align-items: center; gap: 10px; width: 290px; border: 1px solid var(--border); border-radius: 7px; padding: 0 12px; background: #fff; }
.library-search .icon { width: 15px; color: #91a1b8; }
.library-search input { border: 0; outline: 0; width: 100%; min-width: 0; background: transparent; padding: 11px 0; font-size: 13px; }
.library-search:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.status-filter { display: flex; padding: 0; gap: 4px; flex-wrap: wrap; }
.chip { font-size: 12px; padding: 7px 10px; border-radius: 6px; border: 1px solid transparent; background: transparent; color: #65758c; }
.chip:hover { background: #edf1f7; }
.chip.active { background: #fff; border-color: #dfe6ef; color: #3f5e8e; box-shadow: 0 1px 3px #24395405; }
.library-surface { overflow: hidden; }
.library-columns, .test-item { display: grid; grid-template-columns: minmax(0, 1fr) 65px 115px 84px; align-items: center; gap: 20px; padding: 13px 22px; }
.library-columns { font-size: 10px; font-weight: 600; color: #65758c; letter-spacing: .09em; background: #fafbfd; border-bottom: 1px solid var(--border); }
.library-columns > :nth-child(2) { text-align: center; }
.test-list { list-style: none; overflow: visible; margin: 0; padding: 0; }
.test-item { width: 100%; border: 0; border-radius: 0; border-bottom: 1px solid #eff2f7; background: none; cursor: pointer; text-align: left; padding-top: 18px; padding-bottom: 18px; }
.test-list > li:last-child > .test-item { border-bottom: 0; }
.test-item.active { background: #f7faff; box-shadow: inset 2px 0 #98b5df; }
.test-item:hover { background: #f8faff; }
.library-name { display: flex; align-items: center; gap: 13px; min-width: 0; padding-left: calc(var(--depth, 0) * 12px); }
.test-file-icon { width: 30px; height: 34px; flex: none; background: #f3f6fc; color: #88a0c0; border: 1px solid #e7edf6; border-radius: 6px; display: grid; place-items: center; font-size: 14px; }
.suite-file-icon { color: #9b89bd; background: #f5f2fa; border-color: #ebe5f6; }
.test-item .meta { display: grid; gap: 5px; }
.test-item .title { display: block; font-size: 14px; font-weight: 550; white-space: normal; overflow-wrap: anywhere; line-height: 1.65; }
.test-item .sub { display: block; font-size: 11px; line-height: 1.5; color: #65758c; }
.library-step-count { font-size: 13px; color: #697b94; text-align: center; }
.library-last-run { font-size: 12px; color: #65758c; }
.folder-row { border-radius: 0; border-bottom: 1px solid #edf1f7; background: #fafbfd; padding: 10px 16px 10px calc(19px + var(--depth, 0) * 12px); gap: 12px; }
.folder-toggle { display: flex; gap: 10px; align-items: center; flex: 1; min-width: 0; width: auto; text-align: left; padding: 0; font-size: 12px; color: #657b99; }
.folder-name { flex: none; max-width: calc(100% - 65px); white-space: normal; overflow-wrap: anywhere; font-size: 13px; font-weight: 550; }
.folder-count { background: #ecf1f8; color: #65758c; font-size: 11px; }
.folder-actions { opacity: 1; margin-left: auto; }
.folder-actions .btn-icon { color: #98a6ba; min-width: 26px; min-height: 26px; font-size: 14px; }
.folder-actions .btn-icon:hover { color: var(--accent); background: #eaf0f9; }
.library-summary { display: flex; align-items: center; gap: 12px; font-size: 12px; color: #65758c; margin-top: 17px; }
.library-empty { padding: 50px 24px; margin: 0; text-align: center; color: var(--muted); font-size: 14px; line-height: 1.8; }

/* Editors and reports keep primary actions close to the work. */
.workspace { height: auto; flex: 1; min-height: 0; overflow-y: auto; }
.editor-context { display: flex; align-items: center; gap: 18px; padding: 17px 28px 0; font-size: 10px; color: #65758c; letter-spacing: .09em; flex: none; }
.editor-context .btn-link { letter-spacing: 0; font-size: 12px; }
.toolbar { background: transparent; border-bottom: 0; padding: 16px 25px 8px; flex: none; align-items: flex-start; }
.toolbar-actions { flex-wrap: wrap; justify-content: flex-end; }
.input-title { font-size: 21px; padding-left: 3px; }
.file-row { flex-wrap: wrap; padding-left: 0; gap: 9px; }
.file-name { padding-left: 3px; font-size: 12px; }
/* A floor taller than the window pushed the run panel off-screen and left dead
   space under the screenshot. Keep a floor only while it still fits, and let
   the panels scroll internally instead of growing past the viewport. */
.panes { padding: 14px 28px 26px; gap: 18px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); overflow: visible; min-height: min(500px, 100%); }
.panes .pane { min-height: 0; }
.step-desc { font-size: 12px; }
.run-status { flex-wrap: wrap; font-size: 12px; }
.pane-head { gap: 10px; }
.report-controls { display: flex; align-items: center; gap: 10px; font-size: 13px; padding-top: 10px; }
.report-controls > label { color: var(--muted); }
.report-controls select { border: 1px solid var(--border); border-radius: 6px; padding: 9px 12px; background: #fff; font-size: 13px; }
#reports-workspace > .toolbar { padding: 27px 32px 18px; align-items: center; }
.report-title { margin: 0; font-size: 27px; }
.report-body { padding: 8px 32px 32px; }

/* User management: account creation and team access have their own space. */
.user-management { width: 920px; max-width: calc(100vw - 40px); max-height: 90vh; max-height: 90dvh; border: 1px solid #e2e8f0; border-radius: 16px; box-shadow: 0 24px 90px #0c172938; }
.users-header { display: flex; align-items: center; gap: 16px; padding: 25px 28px; border-bottom: 1px solid var(--border); flex: none; }
.users-header-icon { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; color: #5277b2; background: #eef3fb; border: 1px solid #e1e9f7; flex: none; }
.users-header-icon .icon { width: 23px; height: 23px; }
.users-header-copy { min-width: 0; flex: 1; }
.users-header h2 { font-family: var(--brand-font); margin: 5px 0 4px; font-size: 22px; font-weight: 600; letter-spacing: -.5px; color: #23334a; }
.users-header p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.6; }
.users-header .eyebrow { font-size: 9px; color: #6c7d95; }
.users-close { border: 1px solid var(--border); border-radius: 8px; background: #fff; align-self: flex-start; color: #75859b; width: 32px; height: 32px; }
.users-close .icon { width: 17px; height: 17px; }
.users-close:hover { background: var(--bg); }
.users-content { display: grid; grid-template-columns: 290px minmax(0, 1fr); align-items: start; gap: 28px; padding: 26px 28px; overflow-y: auto; min-height: 0; }
.new-user-panel { padding: 21px; background: #f7f9fc; border: 1px solid #e6ecf4; border-radius: 11px; }
.users-section-heading h3 { margin: 0 0 6px; font-size: 14px; font-weight: 600; color: #2c3d55; }
.users-section-heading p { margin: 0; font-size: 12px; line-height: 1.6; color: #6c7e96; }
.new-user-form { margin-top: 24px; }
.new-user-form fieldset { display: grid; gap: 18px; margin: 0; padding: 0; border: 0; min-width: 0; }
.user-field { display: grid; gap: 7px; min-width: 0; }
.user-field label { font-size: 12px; font-weight: 600; color: #455872; }
.user-field input, .user-field select { width: 100%; min-width: 0; min-height: 41px; border: 1px solid #dce4ef; border-radius: 7px; background: #fff; padding: 10px 11px; font-size: 13px; }
.user-field input::placeholder { color: #7c8ca2; opacity: 1; }
.user-field p { margin: 0; font-size: 11px; line-height: 1.65; color: #697c96; }
.new-user-password { display: flex; align-items: center; gap: 8px; }
.new-user-password input { flex: 1; }
.new-user-password button { font-size: 11px; font-weight: 600; padding: 10px 0; min-width: 33px; border: 0; background: none; color: #466b9e; cursor: pointer; }
.new-user-form #btn-add-user { width: 100%; margin-top: 2px; min-height: 41px; font-size: 13px; }
.user-management #users-error { margin: 0; font-size: 12px; line-height: 1.6; }
.members-panel { min-width: 0; padding-top: 3px; }
.members-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.members-count { display: inline-block; border: 1px solid #e3eaf3; background: #f2f5fa; color: #6e829f; font-size: 11px; font-weight: 500; padding: 2px 7px; margin-left: 5px; border-radius: 5px; vertical-align: middle; }
.members-heading .btn-icon { background: #fff; border: 1px solid var(--border); border-radius: 7px; color: #6e829f; }
.members-search { display: flex; gap: 9px; align-items: center; border: 1px solid #dfe6ef; border-radius: 7px; padding: 0 12px; margin-bottom: 13px; }
.members-search > .icon { color: #8091a9; }
.members-search:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.members-search input { min-width: 0; width: 100%; min-height: 40px; font-size: 12px; border: 0; background: transparent; outline: 0; padding: 10px 0; }
.user-management .users-list { padding: 0 4px; max-height: 355px; }
.user-management .member-row { padding: 12px 0; gap: 12px; border-radius: 0; border-bottom: 1px solid #edf1f6; }
.user-management .member-row:last-child { border-bottom: 0; }
.user-management .member-row:hover { background: none; }
.member-avatar { width: 37px; height: 37px; border-radius: 10px; flex: none; display: grid; place-items: center; font-size: 12px; font-weight: 600; color: #5275aa; background: #edf3fc; }
.avatar-admin { background: #f1edfa; color: #8a6eaf; }
.avatar-member { background: #eef5f3; color: #5c8b7d; }
.member-details { min-width: 0; flex: 1; display: grid; gap: 5px; }
.member-name-line { display: flex; align-items: center; gap: 7px; min-width: 0; }
.user-management .u-name { flex: 0 1 auto; font-size: 13px; font-weight: 600; white-space: normal; overflow-wrap: anywhere; line-height: 1.6; }
.member-self { font-size: 9px; color: #70829a; background: #f1f4f8; padding: 1px 5px; border-radius: 4px; }
.user-management .u-role { width: fit-content; border-radius: 4px; text-transform: none; letter-spacing: 0; border: 0; background: #f0f5f3; color: #5b7d72; padding: 2px 6px; font-size: 10px; }
.user-management .role-site_admin { color: #5477aa; background: #eef3fc; }
.user-management .role-admin { color: #8769aa; background: #f3effa; }
.member-access.btn { flex: none; border: 1px solid #e2e8f1; padding: 7px 10px; min-height: 32px; font-size: 11px; font-weight: 500; background: #fff; color: #586f90; }
.member-access.btn:hover { background: #f6f9fe; color: var(--accent); }
.member-remove { border: 0; border-radius: 6px; background: none; color: #8494aa; flex: none; }
.member-remove:hover:not(:disabled) { color: #c75d4d; background: #fff0ed; }
.member-remove:disabled { opacity: .28; }
.members-footnote { margin: 20px 0 0; font-size: 11px; line-height: 1.7; color: #6e7f96; }
.members-message { padding: 22px 12px; background: #f8fafc; border: 1px dashed #dfe6ef; border-radius: 8px; font-size: 12px; line-height: 1.7; color: var(--muted); }
.users-footer { display: flex; align-items: center; justify-content: space-between; gap: 15px; border-top: 1px solid var(--border); padding: 16px 28px; flex: none; }
.users-footer > span { font-size: 11px; color: #6c7e96; }
.users-footer .btn { min-width: 86px; min-height: 35px; padding: 7px 18px; font-size: 12px; }

@media (min-width: 801px) and (max-height: 760px) {
  .users-header { padding: 16px 24px; }
  .users-header .eyebrow { display: none; }
  .users-header h2 { margin: 0 0 4px; }
  .users-content { padding: 20px 24px; }
  .new-user-panel { padding: 16px; }
  .new-user-panel .users-section-heading p { display: none; }
  .new-user-form { margin-top: 16px; }
  .new-user-form fieldset { gap: 12px; }
  .user-field { gap: 5px; }
  .user-field input, .user-field select { min-height: 38px; padding: 8px 10px; }
  .user-field p { line-height: 1.5; }
  .new-user-form #btn-add-user { min-height: 38px; }
  .users-footer { padding: 12px 24px; }
}

@media (max-width: 800px) {
  .user-management { max-width: calc(100vw - 32px); }
  .users-content { grid-template-columns: minmax(0, 1fr); gap: 25px; }
  .new-user-form fieldset { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .new-user-form #users-error { grid-column: 1 / -1; }
  .new-user-form #btn-add-user { align-self: end; }
  .user-management .users-list { max-height: none; }
}

@media (max-width: 520px) {
  #users-modal { padding: 12px; }
  #users-modal .user-management { width: 100%; max-width: 100%; overflow: hidden; border-radius: 12px; }
  .users-header { padding: 20px; gap: 12px; align-items: flex-start; }
  .users-header-icon { display: none; }
  .users-header h2 { font-size: 20px; }
  .users-header p { font-size: 12px; }
  .users-header .eyebrow { font-size: 8px; }
  .users-content { padding: 20px; }
  .new-user-panel { padding: 18px; }
  .new-user-form fieldset { grid-template-columns: minmax(0, 1fr); }
  .user-field input, .user-field select { font-size: 16px; }
  .users-footer { padding: 14px 20px; }
  .users-footer > span { max-width: 175px; }
  .user-management .member-row { gap: 9px; flex-wrap: wrap; }
  .member-details { flex-basis: calc(100% - 50px); }
  .member-access.btn { margin-left: 46px; }
  .member-remove { margin-left: auto; }
}

@media (max-width: 1150px) {
  .app { grid-template-columns: 190px minmax(0, 1fr); }
  .sidebar { padding: 0 9px; }
  .brand-edition { display: none; }
  .page-content { padding: 26px; }
  .app-header { padding: 0 26px; }
  .overview-grid { grid-template-columns: minmax(0, 1fr); }
  .workflow-card { display: none; }
  .overview-stats { gap: 10px; }
  .overview-stat { padding: 16px; }
  .stat-caption { font-size: 11px; }
  .panes { grid-template-columns: minmax(0, 1fr); }
  .panes .pane { min-height: 350px; }
  .toolbar { flex-wrap: wrap; }
  .toolbar-actions { justify-content: flex-start; }
}

@media (max-width: 760px) {
  .app { display: grid; grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 234px; z-index: 60; max-height: none; visibility: hidden; transform: translateX(-100%); transition: transform .18s ease; }
  .sidebar.nav-open { visibility: visible; transform: translateX(0); }
  .sidebar .brand-edition { display: inline; }
  .nav-backdrop:not([hidden]) { display: block; position: fixed; inset: 0; background: #0c172955; border: 0; z-index: 55; }
  .mobile-browse { display: inline-grid; margin: 0; min-width: 26px; padding: 0; color: #62758f; }
  .main { min-height: 0; }
  .app-header { min-height: 64px; padding: 0 20px; }
  .breadcrumbs { gap: 10px; font-size: 13px; }
  .breadcrumb-root, .breadcrumb-divider { display: none; }
  .header-actions { gap: 10px; }
  .account-info, .account-menu .icon-small { display: none; }
  .page-content { padding: 24px 20px; }
  .page-heading { gap: 18px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 24px; }
  .page-heading h1 { font-size: 24px; }
  .page-heading p { font-size: 13px; }
  .page-heading > .btn { min-height: 36px; }
  .overview-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 24px; }
  .overview-stat { padding: 16px; gap: 12px; }
  .stat-topline { font-size: 12px; }
  .overview-stat strong { font-size: 28px; }
  .section-heading { padding: 18px 16px; }
  .activity-columns, .overview-test { grid-template-columns: minmax(0, 1fr) 65px; gap: 12px; padding-left: 16px; padding-right: 16px; }
  .activity-columns > :nth-child(2), .activity-time { display: none; }
  .activity-name strong { font-size: 13px; }
  .library-search { width: 100%; }
  .library-tools { gap: 15px; }
  .status-filter { width: 100%; gap: 1px; }
  .chip { padding: 7px 8px; }
  .library-columns, .test-item { grid-template-columns: minmax(0, 1fr) 64px; padding: 13px 14px; gap: 12px; }
  .library-columns > :nth-child(2), .library-columns > :nth-child(3), .library-step-count, .library-last-run { display: none; }
  .library-name { gap: 8px; padding-left: calc(var(--depth, 0) * 5px); }
  .test-file-icon { display: none; }
  .test-item .title { font-size: 13px; }
  .folder-row { padding-left: calc(12px + var(--depth, 0) * 7px); padding-right: 10px; }
  .folder-actions .btn-icon { min-width: 30px; min-height: 30px; }
  .editor-context { padding: 16px 20px 0; }
  .toolbar { padding: 14px 18px 7px; }
  .toolbar-title { flex-basis: 100%; }
  .toolbar-actions .btn { padding: 8px 11px; min-height: 36px; }
  .input-title { font-size: 19px; }
  .panes { padding: 14px 16px 24px; }
  .pane { overflow: hidden; }
  .step-head { flex-wrap: wrap; }
  .step-body { grid-template-columns: minmax(0, 1fr); }
  .field.span-2 { grid-column: auto; }
  .run-split { grid-template-columns: minmax(0, 1fr); }
  .report-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #reports-workspace > .toolbar { padding: 24px 20px 12px; }
  .report-controls { width: 100%; }
  .report-body { padding: 8px 20px 25px; }
  .modal { width: calc(100vw - 24px); max-height: 90dvh; overflow-y: auto; }
  .add-user-form { flex-wrap: wrap; }
}
