:root {
  color-scheme: light;
  --navy: #091b27;
  --navy-soft: #102b38;
  --ink: #182b36;
  --muted: #60727c;
  --line: #dbe4e8;
  --surface: #fff;
  --canvas: #eef3f4;
  --teal: #087f70;
  --teal-dark: #066355;
  --mint: #65dec0;
  --amber: #e9b36b;
  --red: #b94335;
  --shadow: 0 7px 25px rgba(15,42,55,.045);
  font-family: "Segoe UI", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-synthesis: none;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 30px; }
body { margin: 0; min-width: 320px; color: var(--ink); background: var(--canvas); font-size: 16px; line-height: 1.5; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
[hidden] { display: none !important; }
button:disabled { cursor: not-allowed; opacity: .45; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid #e2a550; outline-offset: 4px; }
button { transition: background .15s, border-color .15s; }
svg { max-width: 100%; }
.skip-link { position: fixed; z-index: 100; left: 16px; top: -70px; padding: 12px 18px; border-radius: 8px; background: var(--amber); color: var(--navy); font-weight: 700; }
.skip-link:focus { top: 12px; }
.brand { display: flex; align-items: center; gap: 12px; font-size: 1.05rem; font-weight: 740; line-height: 1.2; letter-spacing: -.02em; }
.brand small { display: block; margin-top: 5px; font-size: .57rem; letter-spacing: .2em; color: #8aa6b0; font-weight: 650; }
.brand-mark { flex-shrink: 0; display: flex; align-items: flex-end; justify-content: center; gap: 4px; width: 39px; height: 39px; padding: 9px 7px; border: 1px solid #47616c; border-radius: 9px; transform: rotate(-3deg); }
.brand-mark > span { display: block; width: 5px; background: var(--mint); border-radius: 1px; transform: skewY(-12deg); }
.brand-mark > span:nth-child(1) { height: 10px; }
.brand-mark > span:nth-child(2) { height: 16px; }
.brand-mark > span:nth-child(3) { height: 21px; }
.eyebrow { display: inline-flex; align-items: center; gap: 12px; color: var(--teal); font-size: .67rem; font-weight: 760; letter-spacing: .17em; line-height: 1.5; }
.primary-button, .secondary-button, .danger-button { display: inline-flex; align-items: center; justify-content: center; gap: 16px; padding: 13px 20px; min-height: 46px; border-radius: 7px; font-size: .9rem; font-weight: 700; line-height: 1.4; }
.primary-button { border: 1px solid var(--teal); background: var(--teal); color: #fff; }
.primary-button:hover { background: var(--teal-dark); border-color: var(--teal-dark); }
.secondary-button { border: 1px solid #c7d5db; background: #fff; color: var(--ink); }
.secondary-button:hover { background: #edf4f4; border-color: #9fb8be; }
.danger-button { border: 1px solid #e1b1aa; background: #fff2ef; color: #a73227; }
.danger-button:hover { background: #ffe2dc; border-color: #bf7569; }
.quiet-link { display: inline-flex; align-items: center; gap: 16px; font-size: .88rem; font-weight: 650; }
.quiet-link:hover { color: var(--mint); }

/* Página pública: apresentação do projeto, sem telemetria ou comandos. */
.home-page { background: var(--navy); color: #e9f1f1; }
.home-container { width: min(1220px, calc(100% - 80px)); margin-inline: auto; }
.home-header { width: min(1320px, calc(100% - 80px)); margin: auto; min-height: 104px; display: flex; align-items: center; justify-content: space-between; gap: 30px; border-bottom: 1px solid #213843; }
.home-brand { font-size: 1.1rem; }
.home-nav { display: flex; align-items: center; gap: 35px; font-size: .85rem; font-weight: 600; color: #a9bdc4; }
.home-nav > a:hover { color: var(--mint); }
.home-nav .header-panel-link { padding: 10px 15px; border: 1px solid #38535e; border-radius: 6px; color: #e9f1f1; }
.header-panel-link span { margin-left: 12px; color: var(--mint); }
.home-hero { display: grid; grid-template-columns: minmax(0,.93fr) minmax(0,1.07fr); gap: 44px; align-items: center; padding-block: 76px 92px; }
.home-hero .eyebrow { color: var(--mint); }
.eyebrow-line { width: 28px; height: 1px; background: var(--mint); }
.hero-copy h1 { margin: 23px 0 25px; font-size: clamp(2.7rem,4.3vw,4.1rem); font-weight: 660; letter-spacing: -.065em; line-height: 1.09; }
.hero-copy h1 em { color: var(--mint); font-style: normal; }
.hero-copy > p { max-width: 430px; color: #9eb5be; line-height: 1.8; font-size: .98rem; }
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 24px; margin-top: 31px; }
.home-page .primary-button { background: var(--mint); border-color: var(--mint); color: #072b2c; }
.home-page .primary-button:hover { background: #a0f2da; border-color: #a0f2da; }
.hero-bottom { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 35px; font-size: .54rem; font-weight: 650; letter-spacing: .1em; color: #77949f; }
.hero-bottom i { width: 3px; height: 3px; border-radius: 50%; background: #496773; }
.hero-machine { min-width: 0; margin-top: 16px; border: 1px solid #29434f; border-radius: 14px; background: #0d2430; box-shadow: 0 20px 65px #04121a50; transform: rotate(1deg); }
.machine-label, .machine-caption { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 17px 20px; color: #8ba7b1; font-size: .59rem; letter-spacing: .13em; }
.machine-label { border-bottom: 1px solid #25404b; }
.machine-label > span:last-child { color: #587784; }
.machine-diagram { display: block; width: 100%; height: auto; }
.machine-caption { border-top: 1px solid #25404b; padding-block: 14px; font-size: .6rem; letter-spacing: .02em; }
.diagram-key { display: flex; align-items: center; gap: 8px; }
.diagram-key i { width: 16px; height: 2px; background: var(--mint); }
.home-section { padding-block: 24px 90px; }
.section-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 50px; margin-bottom: 32px; }
.section-heading h2, .dashboard-invite h2 { margin: 15px 0 0; font-size: clamp(1.8rem,2.7vw,2.6rem); font-weight: 610; letter-spacing: -.055em; line-height: 1.17; }
.section-heading > p { margin: 0 0 3px; max-width: 350px; font-size: .9rem; line-height: 1.8; color: #97adb7; }
.home-page .eyebrow { color: var(--mint); }
.module-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 18px; }
.module-card { display: flex; flex-direction: column; padding: 26px 27px 22px; border: 1px solid #29424e; border-radius: 10px; background: #0e2632; }
.module-top { display: flex; justify-content: space-between; align-items: center; }
.module-number { color: #698894; font-size: .7rem; font-weight: 650; }
.module-chip { padding: 4px 8px; border: 1px solid #31505c; border-radius: 4px; color: #9cb6c0; font-size: .6rem; letter-spacing: .08em; font-weight: 650; }
.module-card > svg { width: 53px; height: 46px; margin-top: 34px; fill: none; stroke: #61d3b9; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.module-card h3 { margin: 19px 0 10px; font-size: 1.28rem; letter-spacing: -.025em; font-weight: 620; }
.module-card > p { margin: 0; padding-bottom: 26px; font-size: .86rem; line-height: 1.8; color: #99b0ba; }
.module-detail { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 17px; border-top: 1px solid #29424e; color: #b7c9cf; font-size: .7rem; }
.module-detail > span { color: var(--mint); font-size: 1rem; }
.flow-section { padding-block: 68px; border-top: 1px solid #233e4a; border-bottom: 1px solid #233e4a; background: #0c222e; }
.flow-steps { list-style: none; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 28px; margin: 42px 0 0; padding: 0; }
.flow-steps li { position: relative; }
.flow-steps li > span { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 1px solid #42606c; border-radius: 50%; color: var(--amber); font-size: .63rem; }
.flow-steps li:not(:last-child)::after { content: ""; position: absolute; top: 17px; left: 48px; right: -13px; height: 1px; background: #2d4753; }
.flow-steps h3 { margin: 19px 0 10px; font-size: 1rem; font-weight: 650; }
.flow-steps p { margin: 0; max-width: 235px; color: #91aab5; font-size: .82rem; line-height: 1.8; }
.flow-note { display: flex; align-items: center; gap: 12px; margin-top: 35px; padding: 15px 18px; border: 1px solid #605240; border-radius: 7px; background: #b77a2810; }
.note-symbol { display: grid; place-items: center; flex-shrink: 0; width: 21px; height: 21px; border-radius: 50%; border: 1px solid #967143; color: var(--amber); font-size: .73rem; font-weight: 700; }
.flow-note p { margin: 0; color: #c5b79f; font-size: .8rem; }
.dashboard-invite { display: flex; align-items: center; justify-content: space-between; gap: 70px; padding-block: 80px; }
.dashboard-invite p { max-width: 630px; color: #99b0ba; font-size: .93rem; line-height: 1.8; }
.dashboard-invite .primary-button { flex-shrink: 0; }
.home-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 25px; min-height: 110px; padding-block: 25px; border-top: 1px solid #263e49; }
.footer-brand { font-size: .9rem; font-weight: 750; letter-spacing: .17em; }
.footer-brand span { display: block; margin-top: 4px; color: #738f9d; font-size: .63rem; font-weight: 500; letter-spacing: 0; }
.home-footer p { font-size: .69rem; color: #73909c; }
.home-footer > a:last-child { font-size: .75rem; color: #b5c8ce; }

/* Painel privado: apresentação nova, contratos e controles preservados. */
.dashboard-page { background: var(--canvas); }
.login-screen { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; gap: clamp(35px,9vw,150px); align-items: center; padding: 56px max(40px,calc((100vw - 1130px)/2)); color: #eef6f4; background: radial-gradient(ellipse at 20% 40%,#18414a 0,transparent 55%),var(--navy); }
.login-intro { display: flex; flex-direction: column; justify-content: space-between; gap: 55px; min-height: 580px; }
.login-intro .eyebrow { color: var(--mint); }
.login-intro h2 { margin: 20px 0; font-size: clamp(3rem,5.4vw,5rem); font-weight: 610; line-height: 1.05; letter-spacing: -.065em; }
.login-intro p { max-width: 390px; color: #9bb6bf; font-size: .95rem; line-height: 1.85; }
.login-intro .quiet-link { color: #a5bdc5; align-self: flex-start; }
.login-modules { display: flex; align-items: center; gap: 11px; margin-top: 27px; font-size: .58rem; letter-spacing: .1em; color: #a4c7c9; }
.login-modules span { padding: 6px 9px; border: 1px solid #3a5a65; border-radius: 4px; }
.login-modules i { color: var(--mint); font-style: normal; }
.login-card { width: min(100%,420px); justify-self: end; padding: 37px 34px 25px; border: 1px solid #dce6e7; border-radius: 12px; background: #fff; color: var(--ink); box-shadow: 0 24px 70px #020e1640; }
.login-card h1 { margin: 12px 0 8px; font-size: 1.9rem; font-weight: 650; letter-spacing: -.05em; }
.login-card > p { margin: 0 0 29px; color: var(--muted); font-size: .88rem; }
label { display: grid; gap: 8px; color: #3e5661; font-weight: 650; font-size: .81rem; }
input { width: 100%; padding: 12px 13px; border: 1px solid #c8d7dc; border-radius: 6px; background: #fff; color: var(--ink); }
input:focus { border-color: var(--teal); }
input::placeholder { color: #8a9ca5; }
.login-card label + label { margin-top: 19px; }
.login-card .primary-button { width: 100%; margin-top: 25px; }
.login-card .login-caption { margin: 20px 0 0; padding-top: 17px; border-top: 1px solid var(--line); font-size: .7rem; line-height: 1.7; }
.form-error { min-height: 20px; margin: 12px 0 0 !important; color: var(--red) !important; font-size: .8rem !important; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 228px minmax(0,1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 28px 17px 18px; background: var(--navy); color: #edf4f4; }
.sidebar > .brand { padding-inline: 8px; font-size: .96rem; }
.sidebar-section-label { display: block; margin: 47px 15px 14px; color: #65838e; font-size: .6rem; letter-spacing: .16em; font-weight: 700; }
.sidebar nav { display: grid; gap: 6px; }
.nav-button { display: flex; align-items: center; gap: 15px; padding: 12px 14px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: #97b0ba; text-align: left; font-size: .83rem; font-weight: 600; }
.nav-button > span { color: #54727f; font-size: .62rem; font-weight: 650; }
.nav-button:hover { background: #102e3b; color: #e3f2ef; }
.nav-button.active { border-color: #245348; background: #143b39; color: #80e5c9; }
.nav-button.active > span { color: #57aa98; }
.sidebar-footer { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 17px 10px 0; border-top: 1px solid #213a46; color: #96afb8; font-size: .72rem; overflow-wrap: anywhere; }
.text-button { flex-shrink: 0; padding: 5px; border: 0; background: transparent; color: #94d7c9; font-weight: 600; }
.main-content { width: 100%; max-width: 1590px; padding: 40px clamp(20px,3.6vw,55px) 65px; }
.mobile-header { display: none; }
.view { display: none; }
.active-view { display: block; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 27px; }
.page-heading h1 { margin: 7px 0 0; font-size: clamp(1.8rem,3vw,2.35rem); line-height: 1.2; font-weight: 650; letter-spacing: -.055em; }
.page-heading p { margin: 8px 0 0; color: var(--muted); font-size: .84rem; }
.connection-label { display: inline-flex; align-items: center; gap: 8px; font-size: .7rem; font-weight: 650; color: var(--teal); }
.status-dot { flex-shrink: 0; width: 7px; height: 7px; border-radius: 50%; background: #229780; box-shadow: 0 0 0 4px #22978012; }
.server-connection[data-state="offline"], .server-connection[data-state="waiting"] { color: #90652b; }
.server-connection[data-state="offline"] .status-dot, .server-connection[data-state="waiting"] .status-dot { background: #be8a45; box-shadow: 0 0 0 4px #be8a4512; }
.server-connection[data-state="preview"] { color: var(--muted); }
.server-connection[data-state="preview"] .status-dot { background: #8998a0; box-shadow: none; }
.stat-card, .panel, .form-panel, .component-card, .table-panel { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow); }
.panel { padding: 23px; }
.panel-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.panel-title h2 { margin: 0; font-size: 1.04rem; font-weight: 700; letter-spacing: -.02em; }
.panel-kicker { display: block; margin-bottom: 5px; font-size: .55rem; color: #78929c; letter-spacing: .13em; font-weight: 700; }
.factory-panel { border-top: 3px solid var(--teal); margin-bottom: 20px; }
.factory-intro { margin: -2px 0 20px; max-width: 800px; color: var(--muted); font-size: .82rem; line-height: 1.75; }
.factory-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.factory-actions button { min-width: 126px; }
.factory-message { min-height: 22px; margin: 13px 0 0; color: #37515c; font-size: .8rem; line-height: 1.6; }
.factory-error { margin: 12px 0 0; padding: 12px 14px; border: 1px solid #edc0b5; border-radius: 7px; background: #fff3ed; color: #9b402d; font-size: .8rem; line-height: 1.6; }
.factory-status { margin-top: 18px; }
.factory-device-grid, .factory-details-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 13px; }
.factory-device, .factory-command, .factory-event { min-width: 0; padding: 16px; border: 1px solid #e0e8eb; border-radius: 7px; background: #f8fafb; }
.factory-device h3, .factory-command h3, .factory-event h3 { margin: 0; font-size: .82rem; font-weight: 700; }
.device-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ai-title { margin-top: 20px; }
.factory-device p, .factory-command p, .factory-event p { margin: 8px 0 0; color: var(--muted); font-size: .76rem; line-height: 1.65; overflow-wrap: anywhere; }
.factory-device dl { margin: 16px 0 0; display: grid; gap: 10px; }
.factory-device dl > div { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; font-size: .77rem; }
.factory-device dt { color: var(--muted); }
.factory-device dd { margin: 0; font-weight: 650; text-align: right; overflow-wrap: anywhere; }
.factory-details-grid { margin-top: 13px; }
.factory-command > strong { display: inline-block; margin: 13px 8px 0 0; font-size: .86rem; }
.factory-event-content { display: flex; align-items: flex-start; gap: 12px; margin-top: 13px; }
.factory-event-content > div { min-width: 0; }
.factory-event-content strong { display: inline-block; margin: 0 7px 6px 0; font-size: .86rem; }
.factory-event-image { width: 92px; flex-shrink: 0; aspect-ratio: 4/3; object-fit: cover; border-radius: 6px; background: #e4edf0; }
.badge { display: inline-block; padding: 4px 8px; border: 1px solid #e9d4af; border-radius: 5px; background: #fff6e7; color: #8e611e; font-size: .62rem; font-weight: 700; line-height: 1.5; }
.badge-success { border-color: #b9ded2; background: #e7f5ee; color: #1d765a; }
.badge-muted { border-color: #d9e2e7; background: #edf1f4; color: #647984; }
.factory-footnote { margin: 15px 0 0; color: #7e929c; font-size: .66rem; line-height: 1.7; }
.event-reason { color: #946326 !important; }
.stats-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.stat-card { padding: 20px 21px; }
.stat-card span { display: block; color: var(--muted); font-size: .74rem; }
.stat-card strong { display: block; margin-top: 9px; font-size: 2rem; line-height: 1.2; font-weight: 650; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.latest-panel { margin-top: 16px; }
.latest-grid { display: grid; grid-template-columns: minmax(180px,.85fr) minmax(210px,1.15fr); gap: 26px; align-items: center; }
.capture-image { width: 100%; max-height: 300px; aspect-ratio: 4/3; object-fit: cover; border-radius: 8px; background: #e3ecef; }
.image-placeholder { display: grid; place-items: center; width: 100%; aspect-ratio: 4/3; border-radius: 8px; background: repeating-linear-gradient(-45deg,#e9f0f2,#e9f0f2 10px,#e4edef 10px,#e4edef 11px); color: #7d96a1; text-align: center; padding: 20px; font-size: .82rem; }
.recognition-name { margin: 0 0 12px; font-size: clamp(1.4rem,2.4vw,2rem); font-weight: 650; line-height: 1.2; letter-spacing: -.045em; }
.recognition-meta { margin: 7px 0; color: var(--muted); font-size: .82rem; overflow-wrap: anywhere; }
.confidence { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; padding: 7px 10px; border-radius: 5px; background: #e8f4ee; color: var(--teal); font-size: .8rem; font-weight: 750; }
.form-panel { padding: clamp(18px,3vw,30px); }
.form-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 17px; }
.upload-box { margin-top: 23px; padding: 30px; border: 1px dashed #9ebbc2; border-radius: 8px; background: #f3f8f8; text-align: center; cursor: pointer; }
.upload-box:hover { border-color: var(--teal); background: #edf6f4; }
.upload-box strong { font-size: .94rem; }
.upload-box span { color: var(--muted); font-weight: 400; font-size: .8rem; }
.upload-box input { margin: 13px auto 0; max-width: 430px; padding: 8px; background: #fff; font-size: .76rem; }
.image-preview { display: grid; grid-template-columns: repeat(auto-fill,minmax(100px,1fr)); gap: 10px; margin-top: 17px; }
.image-preview img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 7px; }
.form-actions { display: flex; align-items: center; gap: 16px; margin-top: 23px; font-size: .8rem; }
.component-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(245px,1fr)); gap: 17px; }
.component-card { overflow: hidden; }
.component-card img, .component-card .image-placeholder { border-radius: 0; width: 100%; aspect-ratio: 16/10; object-fit: cover; }
.component-info { padding: 18px; }
.component-info h2 { margin: 0 0 7px; font-size: 1rem; font-weight: 700; }
.component-info p { margin: 5px 0; color: var(--muted); font-size: .77rem; }
.component-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 17px; }
.component-actions .secondary-button { min-height: 33px; padding: 7px 10px; font-size: .74rem; }
.inactive { opacity: .6; }
.table-panel { overflow: hidden; }
.responsive-table { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 15px 17px; border-bottom: 1px solid #e3eaed; text-align: left; white-space: nowrap; }
th { background: #f6f9fa; color: #69818c; font-size: .63rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 750; }
td { font-size: .8rem; }
.table-thumb { width: 46px; height: 46px; border-radius: 6px; object-fit: cover; background: #e4edef; }
.history-reason { margin: 6px 0 0; white-space: normal; max-width: 320px; color: var(--muted); font-size: .73rem; line-height: 1.6; }
.empty-state { padding: 46px 22px; border: 1px dashed #b6cbd1; border-radius: 9px; background: #ffffff70; text-align: center; color: var(--muted); font-size: .84rem; }
.empty-state strong { display: block; margin-bottom: 7px; color: var(--ink); font-size: 1rem; }
@media (min-width: 1450px) { .home-hero { gap: 60px; padding-block: 100px; } }
@media (max-width: 1100px) {
  .home-container { width: calc(100% - 56px); }
  .home-header { width: calc(100% - 56px); }
  .home-hero { gap: 24px; }
  .hero-actions { align-items: flex-start; flex-direction: column; gap: 18px; }
  .hero-copy h1 { font-size: clamp(2.65rem,4.5vw,3.4rem); }
  .hero-bottom { font-size: .49rem; gap: 7px; }
  .module-card { padding-inline: 21px; }
  .section-heading { gap: 35px; }
  .app-shell { grid-template-columns: 205px minmax(0,1fr); }
  .sidebar { padding-inline: 12px; }
  .sidebar > .brand { font-size: .86rem; gap: 8px; }
  .main-content { padding-inline: 25px; }
  .factory-device-grid, .factory-details-grid { grid-template-columns: 1fr; }
}
@media (max-width: 800px) {
  .home-header { min-height: 90px; }
  .home-nav { gap: 22px; }
  .home-hero { grid-template-columns: 1fr; padding-block: 56px 62px; gap: 40px; }
  .hero-copy { max-width: 600px; }
  .hero-copy h1 { font-size: clamp(2.8rem,7.5vw,4rem); }
  .hero-copy > p { max-width: 550px; }
  .hero-actions { flex-direction: row; align-items: center; gap: 25px; }
  .hero-bottom { font-size: .57rem; gap: 12px; }
  .hero-machine { max-width: 640px; width: 100%; margin: auto; transform: none; }
  .home-section { padding-bottom: 62px; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 18px; }
  .section-heading > p { max-width: 550px; }
  .module-grid { grid-template-columns: 1fr; }
  .module-card { position: relative; padding: 24px 25px; }
  .module-card > svg { position: absolute; right: 24px; top: 62px; width: 47px; margin: 0; }
  .module-card h3 { margin-top: 27px; }
  .module-card > p { max-width: calc(100% - 85px); padding-bottom: 20px; }
  .flow-section { padding-block: 56px; }
  .flow-steps { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 30px; }
  .flow-steps li:nth-child(2)::after { display: none; }
  .dashboard-invite { gap: 30px; padding-block: 58px; align-items: flex-start; flex-direction: column; }
  .home-footer { align-items: flex-start; }
  .login-screen { grid-template-columns: 1fr; gap: 40px; padding: 32px 28px 45px; }
  .login-intro { min-height: 0; gap: 26px; max-width: 520px; width: 100%; margin: auto; }
  .login-intro h2 { font-size: 2.9rem; margin-block: 13px; }
  .login-intro h2 br { display: none; }
  .login-intro p, .login-modules { display: none; }
  .login-intro .quiet-link { display: none; }
  .login-card { width: min(100%,520px); justify-self: center; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 10; left: 0; right: 0; bottom: 0; top: auto; height: auto; padding: 8px 10px 5px; border-top: 1px solid #29414d; }
  .sidebar > .brand, .sidebar-section-label { display: none; }
  .sidebar nav { grid-template-columns: repeat(4,1fr); gap: 4px; }
  .nav-button { justify-content: center; gap: 0; padding: 11px 4px; font-size: .73rem; }
  .nav-button > span { display: none; }
  .sidebar-footer { padding: 6px 8px 0; margin-top: 5px; border-top: 1px solid #213a46; min-height: 29px; font-size: .65rem; }
  .sidebar-footer .text-button { padding: 2px 5px; font-size: .7rem; }
  .main-content { padding: 23px 20px 130px; }
  .mobile-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-bottom: 23px; margin-bottom: 27px; border-bottom: 1px solid #d4e1e5; }
  .mobile-header .brand { font-size: .9rem; }
  .mobile-header .brand-mark { width: 30px; height: 32px; padding: 6px; border-color: #9fbbc2; gap: 3px; }
  .mobile-header .brand-mark span { background: var(--teal); width: 4px; }
  .mobile-header .brand-mark span:nth-child(3) { height: 19px; }
  .mobile-header .connection-label { max-width: 135px; font-size: .64rem; }
  .desktop-only { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .factory-device-grid, .factory-details-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 560px) {
  .home-container, .home-header { width: calc(100% - 38px); }
  .home-header { min-height: 82px; gap: 15px; }
  .home-brand { font-size: .92rem; gap: 8px; }
  .home-brand small { font-size: .5rem; }
  .home-brand .brand-mark { width: 33px; height: 35px; padding: 7px 5px; gap: 3px; }
  .home-nav > a:not(.header-panel-link) { display: none; }
  .home-nav .header-panel-link { font-size: .68rem; padding: 9px 10px; }
  .header-panel-link span { margin-left: 6px; }
  .home-hero { padding-top: 43px; gap: 32px; }
  .hero-copy h1 { font-size: clamp(2.55rem,10vw,3.55rem); }
  .hero-copy > p { font-size: .9rem; line-height: 1.85; }
  .eyebrow { font-size: .58rem; letter-spacing: .13em; gap: 8px; }
  .hero-actions { gap: 20px; }
  .hero-actions .primary-button { width: 100%; justify-content: space-between; }
  .hero-actions .quiet-link { font-size: .8rem; }
  .hero-bottom { font-size: .43rem; gap: 6px; margin-top: 29px; }
  .machine-label, .machine-caption { padding: 12px 13px; font-size: .49rem; }
  .machine-caption { gap: 10px; }
  .section-heading h2, .dashboard-invite h2 { font-size: 1.9rem; }
  .section-heading > p { font-size: .84rem; }
  .module-card { padding: 23px 22px; }
  .module-card > p { font-size: .82rem; max-width: calc(100% - 55px); }
  .module-card > svg { right: 17px; width: 38px; }
  .flow-steps { grid-template-columns: 1fr; gap: 26px; margin-top: 33px; }
  .flow-steps li { padding-left: 50px; }
  .flow-steps li > span { position: absolute; top: 0; left: 0; }
  .flow-steps li:not(:last-child)::after { display: block; width: 1px; height: auto; left: 17px; top: 45px; bottom: -13px; right: auto; }
  .flow-steps h3 { margin: 4px 0 8px; }
  .flow-steps p { max-width: none; }
  .flow-note { align-items: flex-start; padding: 14px; }
  .flow-note p { font-size: .75rem; }
  .dashboard-invite .primary-button { width: 100%; justify-content: space-between; }
  .home-footer { display: grid; gap: 15px; padding-block: 27px; }
  .home-footer p { margin: 0; line-height: 1.8; }
  .login-screen { padding: 27px 20px 40px; gap: 27px; }
  .login-intro h2 { font-size: 2.25rem; }
  .login-intro { gap: 28px; }
  .login-card { padding: 28px 24px 23px; }
  .login-card h1 { font-size: 1.7rem; }
  .main-content { padding-inline: 15px; }
  .page-heading { margin-bottom: 22px; }
  .page-heading h1 { font-size: 1.85rem; }
  .page-heading p { font-size: .8rem; }
  .panel { padding: 18px; }
  .factory-panel .panel-title { align-items: flex-start; flex-direction: column; gap: 12px; }
  .factory-actions { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; }
  .factory-actions button { width: 100%; min-width: 0; padding-inline: 6px; font-size: .8rem; }
  .factory-device-grid, .factory-details-grid { grid-template-columns: 1fr; }
  .factory-device, .factory-command, .factory-event { padding: 14px; }
  .factory-event-content { flex-wrap: wrap; }
  .factory-device dl > div { gap: 10px; }
  .stats-grid { grid-template-columns: 1fr; gap: 10px; }
  .stat-card { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 16px 19px; }
  .stat-card strong { margin: 0; font-size: 1.65rem; }
  .latest-grid { grid-template-columns: 1fr; gap: 19px; }
  .form-actions { align-items: stretch; flex-direction: column; }
  .form-actions .primary-button { width: 100%; }
  .upload-box { padding-inline: 16px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } button { transition: none; } }
