:root {
  --bg: #0b0d0f;
  --surface: #15181b;
  --surface-hover: #1c2024;
  --border: #2a2f34;
  --text: #f4f5f6;
  --muted: #939aa1;
  --accent: #f58212;
  --cleaning: #62b84e;
  --rinsing: #4c92d9;
  font-family: Roboto, Arial, Helvetica, sans-serif;
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

* { box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  background: var(--bg);
}

body {
  color: var(--text);
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

button { font: inherit; touch-action: manipulation; }
input,select,textarea { -webkit-user-select: text; user-select: text; }

.hmi-shell {
  width: 100%;
  height: 100%;
  background: var(--bg);
}

.screen {
  display: none;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  background: var(--bg);
}

.screen.is-active { display: block; }

.splash.is-active {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  padding: 32px;
  text-align: center;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 44px;
  border: 1px solid #454b50;
  border-radius: 7px;
  color: var(--accent);
  font-size: 30px;
  line-height: 1;
}

.brand-mark--splash {
  width: 126px;
  height: 84px;
  border: 3px solid var(--accent);
  border-radius: 16px;
  font-size: 62px;
}

.splash-rule { width: 40px; height: 2px; margin: 40px 0 28px; background: var(--accent); }
.splash h1 { margin: 0; font-size: clamp(30px, 6vw, 46px); line-height: 1.15; letter-spacing: .03em; }
.splash p { margin: 18px 0 0; color: var(--muted); font-size: 16px; letter-spacing: .12em; }

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  width: 100%;
  height: 72px;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(11, 13, 15, .96);
}

.header-copy { display: flex; flex-direction: column; min-width: 0; margin-left: 14px; }
.header-copy strong { overflow: hidden; font-size: 18px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.header-accent { width: 28px; height: 2px; margin-left: auto; background: var(--accent); }

.home, .settings { padding-bottom: 24px; }

.machine-panel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: calc(100% - 48px);
  max-width: 720px;
  height: clamp(250px, 34vh, 380px);
  margin: 24px auto 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.machine-panel img { display: block; width: 92%; height: 96%; object-fit: contain; }
.home-menu {
  display: grid;
  grid-template-columns: 1fr;
  width: calc(100% - 48px);
  max-width: 720px;
  margin: 24px auto 0;
  gap: 12px;
}

.menu-card, .settings-card {
  position: relative;
  appearance: none;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.menu-card {
  display: flex;
  align-items: center;
  min-height: 86px;
  padding: 18px;
  text-align: left;
}

.menu-card .icon, .settings-card .icon {
  display: flex;
  flex: 0 0 48px;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 0;
  background: transparent;
}

.icon svg {
  width: 28px;
  height: 28px;
  overflow: visible;
  fill: none;
  stroke: #f2f3f4;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon svg .fill { fill: #f2f3f4; stroke: none; }
.material-symbols-rounded { font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24; }
.material-symbols-rounded.icon { color: #f2f3f4; font-size: 30px; }
.menu-card>strong { margin-left: 14px; font-size: 17px; font-weight: 600; line-height: 1.2; }
.menu-card em, .settings-card em { display: none; }
.menu-card:active, .settings-card:active, .home-button:active { border-color: var(--accent); background: var(--surface-hover); }

.home-button {
  display: inline-flex;
  align-items: center;
  height: 42px;
  margin-left: auto;
  padding: 0 13px;
  gap: 7px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.home-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; }

.settings-intro {
  width: calc(100% - 48px);
  max-width: 720px;
  margin: 32px auto 20px;
}

.settings-intro strong { display: block; font-size: 26px; font-weight: 600; }

.settings-grid {
  display: flex;
  flex-direction: column;
  width: calc(100% - 48px);
  max-width: 720px;
  margin: 0 auto;
  gap: 10px;
}

.settings-card { display: flex; align-items: center; min-height: 92px; padding: 16px 18px; text-align: left; }
.card-copy { display: flex; flex-direction: column; min-width: 0; margin-left: 16px; }
.card-copy strong { font-size: 17px; font-weight: 600; }
.card-copy small { margin-top: 5px; color: var(--muted); font-size: 16px; line-height: 1.3; }

@media (max-width: 520px) {
  .app-header { padding: 0 16px; }
  .header-copy strong { font-size: 16px; }
  .machine-panel, .section-heading, .home-menu, .settings-intro, .settings-grid { width: calc(100% - 32px); }
  .machine-panel { margin-top: 16px; }
  .home-menu { grid-template-columns: 1fr; }
  .menu-card { min-height: 88px; }
}

.run-layout { display: flex; flex-direction: column; gap: 16px; width: calc(100% - 48px); max-width: 760px; margin: 24px auto 0; }
.program-select { display: flex; align-items: flex-end; gap: 12px; }
.program-select label { display: flex; flex: 1; flex-direction: column; gap: 8px; font-size: 16px; }
.program-select select { width: 100%; height: 54px; padding: 0 14px; border: 1px solid var(--border); border-radius: 8px; background: #111416; color: var(--text); font-size: 16px; }
.program-select>button { display: flex; align-items: center; justify-content: center; gap: 6px; height: 54px; padding: 0 16px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font-size: 16px; cursor: pointer; }
.program-panel,.program-detail { border: 1px solid var(--border); border-radius: 10px; background: #101315; overflow: hidden; }
.section-title { display: flex; align-items: center; justify-content: space-between; min-height: 62px; padding: 0 18px; border-bottom: 1px solid var(--border); }
.section-title h2 { margin: 0; font-size: 19px; }
.section-title button { width: 40px; height: 40px; border: 0; border-radius: 8px; background: transparent; color: var(--text); cursor: pointer; }
.program-list { display: flex; flex-direction: column; }
.program-list button { min-height: 58px; padding: 0 18px; border: 0; border-bottom: 1px solid #202428; background: transparent; color: var(--muted); font-size: 16px; text-align: left; cursor: pointer; }
.program-list button.active { color: var(--text); background: #20252a; box-shadow: inset 3px 0 var(--accent); }
.process-summary { display: grid; grid-template-columns: repeat(2,1fr); }
.process-summary article { padding: 20px; border-right: 1px solid var(--border); }
.process-summary article:nth-child(2n) { border-right: 0; }
.process-summary article:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
.process-summary h3 { margin: 0 0 18px; font-size: 17px; }
.process-summary dl { margin: 0; }
.process-summary dl div { display: flex; justify-content: space-between; margin-top: 12px; }
.process-summary dt { color: var(--muted); font-size: 16px; }
.process-summary dd { margin: 0; font-size: 16px; font-weight: 600; }
.run-actions { display: flex; justify-content: flex-end; gap: 12px; width: calc(100% - 48px); max-width: 900px; margin: 18px auto 0; }
.run-actions button,.editor-actions button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 160px; height: 52px; border: 0; border-radius: 8px; color: #fff; font-size: 16px; font-weight: 700; cursor: pointer; }
.run-actions .auto,.editor-actions .primary { background: #367d00; }
.abort-button { display: inline-flex; align-items: center; height: 44px; margin-left: auto; padding: 0 15px; gap: 7px; border: 1px solid #bd3a3a; border-radius: 8px; background: #9a2525; color: #fff; font-size: 16px; font-weight: 700; cursor: pointer; }
.abort-button .material-symbols-rounded { font-size: 22px; }
.auto-process-content { width: calc(100% - 48px); max-width: 760px; margin: 0 auto; padding: 16px 0 32px; }
.run-meta { display: flex; align-items: flex-end; justify-content: space-between; min-height: 48px; margin-bottom: 12px; }
.run-meta>div { display: flex; flex-direction: column; gap: 4px; }
.run-meta>div:last-child { align-items: flex-end; }
.run-meta span { color: var(--muted); font-size: 16px; }
.run-meta strong { font-size: 18px; font-weight: 600; }
.run-meta>div:last-child strong { font-size: 22px; font-variant-numeric: tabular-nums; }
.auto-overview { display: grid; grid-template-columns: 1fr; margin: 0 0 16px; gap: 12px; }
.process-machine { display: flex; align-items: center; justify-content: center; width: 100%; height: 340px; padding: 0; border: 0; outline: 0; background: transparent; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.process-machine:focus,.process-machine:active { border: 0; outline: 0; background: transparent; box-shadow: none; }
.process-machine img { display: block; width: 100%; height: 100%; object-fit: contain; }
.live-parameters { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; }
.live-parameters article { display: flex; align-items: center; flex-direction: column; justify-content: center; min-width: 0; min-height: 58px; padding: 4px; gap: 4px; text-align: center; }
.live-parameters span { overflow: hidden; color: var(--muted); font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
.live-parameters strong { font-size: 20px; font-weight: 600; }
.live-parameters small { margin-left: 3px; color: var(--muted); font-size: 16px; font-weight: 500; }
.neutral-operation { display: none; align-items: center; justify-content: center; min-height: 64px; margin-bottom: 16px; padding: 12px 16px; border: 1px solid var(--border); border-radius: 10px; background: #111416; text-align: center; }
.neutral-operation>strong { font-size: 26px; font-weight: 600; }
.state-initializing .neutral-operation,.state-transfer .neutral-operation { display: flex; }
.error-operation { display: none; align-items: center; min-height: 76px; margin-bottom: 16px; padding: 12px 16px; gap: 14px; border: 1px solid #b83d3d; border-radius: 10px; background: #391516; box-shadow: inset 4px 0 #e34b4b; }
.error-operation>.material-symbols-rounded { color: #ff6868; font-size: 34px; }
.error-operation>div { display: flex; flex-direction: column; gap: 3px; }
.error-operation small { color: #ff8585; font-size: 16px; font-weight: 700; letter-spacing: .08em; }
.error-operation strong { color: #fff; font-size: 28px; font-weight: 600; }
.state-error .error-operation { display: flex; }
.parallel-processes { display: grid; grid-template-columns: 1fr 1fr; align-items: start; gap: 16px; }
.chamber-process { overflow: hidden; border: 1px solid var(--border); border-radius: 10px; background: #111416; }
.chamber-title { display: flex; align-items: center; justify-content: space-between; min-height: 72px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.chamber-title>div:first-child { display: flex; flex-direction: column; gap: 5px; }
.chamber-title span { color: var(--muted); font-size: 16px; }
.chamber-title strong { font-size: 20px; font-weight: 600; }
.phase-time { display: flex; align-items: flex-end; flex-direction: column; gap: 3px; }
.phase-time strong { font-size: 26px; font-variant-numeric: tabular-nums; }
.phase-track { display: grid; grid-template-columns: repeat(3,1fr); padding: 16px 16px 8px; gap: 5px; }
.phase-track>div { height: 5px; overflow: hidden; border-radius: 3px; background: #30353a; }
.phase-track>div { opacity: .3; }
.cleaning-process.phase-cleaning .phase-track>div:nth-child(1) { background: var(--cleaning); opacity: 1; }
.cleaning-process.phase-rinse-1 .phase-track>div:nth-child(2) { background: var(--rinsing); opacity: 1; }
.cleaning-process.phase-rinse-2 .phase-track>div:nth-child(3) { background: var(--rinsing); opacity: 1; }
.phase-track i,.phase-track span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.stage-parameters { display: grid; grid-template-columns: 1fr; padding: 8px 16px 16px; gap: 8px; }
.stage-parameters article { display: flex; flex-direction: column; min-width: 0; min-height: 82px; padding: 10px 12px; border: 1px solid transparent; border-radius: 7px; background: #171b1e; }
.stage-parameters article:nth-child(1).active { border-color: var(--cleaning); background: #182018; }
.stage-parameters article:nth-child(2).active,.stage-parameters article:nth-child(3).active { border-color: var(--rinsing); background: #171d23; }
.stage-parameters article>strong { display: block; margin-bottom: 8px; font-size: 16px; }
.stage-parameters article:nth-child(1).active>strong { color: var(--cleaning); }
.stage-parameters article:nth-child(2).active>strong,.stage-parameters article:nth-child(3).active>strong { color: var(--rinsing); }
.stage-parameters dl { display: grid; grid-template-columns: .8fr .8fr 1.4fr; margin: 0; gap: 8px; }
.stage-parameters dl div { display: flex; flex-direction: column; gap: 2px; }
.stage-parameters dt { color: var(--muted); font-size: 16px; }
.stage-parameters dd { margin: 0; font-size: 16px; font-weight: 600; }
.drying-progress { height: 5px; margin: 16px; overflow: hidden; border-radius: 3px; background: #292e32; }
.drying-progress span { display: block; height: 100%; background: var(--accent); }
.cleaning-process.phase-cleaning .chamber-title>div:first-child strong { color: var(--cleaning); }
.cleaning-process.phase-rinse-1 .chamber-title>div:first-child strong,.cleaning-process.phase-rinse-2 .chamber-title>div:first-child strong { color: var(--rinsing); }
.drying-process .chamber-title>div:first-child strong { color: var(--accent); }
.state-initializing .chamber-title>div:first-child strong,.state-transfer .chamber-title>div:first-child strong,.state-error .chamber-title>div:first-child strong { display: none; }
.state-initializing .stage-parameters article>strong,.state-transfer .stage-parameters article>strong,.state-error .stage-parameters article>strong,.state-initializing .stage-parameters article.active>strong,.state-transfer .stage-parameters article.active>strong,.state-error .stage-parameters article.active>strong { color: var(--text); }
.state-initializing .phase-time,.state-transfer .phase-time,.state-error .phase-time,.state-initializing .phase-track,.state-transfer .phase-track,.state-error .phase-track,.state-initializing .drying-progress,.state-transfer .drying-progress,.state-error .drying-progress { display: none; }
.state-initializing .stage-parameters article.active,.state-transfer .stage-parameters article.active,.state-error .stage-parameters article.active { border-color: transparent; background: #171b1e; }
.state-initializing .drying-values,.state-transfer .drying-values,.state-error .drying-values { padding-top: 16px; }
.state-cleaning .drying-process .chamber-title>div:first-child strong,.state-rinse-1 .drying-process .chamber-title>div:first-child strong,.state-rinse-2 .drying-process .chamber-title>div:first-child strong,.state-cleaning .drying-process .phase-time,.state-rinse-1 .drying-process .phase-time,.state-rinse-2 .drying-process .phase-time,.state-cleaning .drying-progress,.state-rinse-1 .drying-progress,.state-rinse-2 .drying-progress { display: none; }
.state-cleaning .drying-values,.state-rinse-1 .drying-values,.state-rinse-2 .drying-values { padding-top: 16px; }
.drying-values { display: grid; grid-template-columns: 1fr 1fr; padding: 0 16px 16px; gap: 16px; }
.drying-values>div { display: flex; flex-direction: column; gap: 5px; }
.drying-values span { color: var(--muted); font-size: 16px; }
.drying-values strong { font-size: 17px; }
.program-form { display: flex; flex-direction: column; gap: 16px; padding-bottom: 28px; }
.program-form>label { display: flex; flex-direction: column; gap: 8px; font-size: 16px; }
.program-form>label input { height: 56px; padding: 0 16px; border: 1px solid var(--border); border-radius: 8px; background: #111416; color: var(--text); font-size: 18px; }
.editor-actions { display: flex; justify-content: flex-end; gap: 10px; }
.editor-actions .danger { background: #9a2525; }.editor-actions .secondary { background: #3b4146; }
.logs-content { max-width: 800px; }
.log-list { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.log-list.hidden { display: none; }
.log-list article { display: flex; align-items: center; justify-content: space-between; min-height: 84px; padding: 16px 18px; border: 1px solid var(--border); border-radius: 9px; background: #111416; cursor: pointer; }
.log-list article div { display: flex; flex-direction: column; gap: 7px; }
.log-list strong { font-size: 17px; }.log-list span { color: var(--muted); font-size: 16px; }.log-list article>b { color: #56a900; font-size: 16px; }.log-list article.failed>b { color: #e34b4b; }
.log-summary { display: grid; grid-template-columns: repeat(2,1fr); gap: 12px; }
.log-summary>div { display: flex; flex-direction: column; gap: 6px; padding: 16px; border: 1px solid var(--border); border-radius: 8px; background: #111416; }
.log-summary span { color: var(--muted); font-size: 16px; }.log-summary strong { font-size: 17px; }.status-failed { color: #e34b4b; }
.log-detail-grid { display: grid; grid-template-columns: 1fr; gap: 16px; margin-top: 16px; }
.log-detail-grid>section { border: 1px solid var(--border); border-radius: 10px; background: #101315; overflow: hidden; }
.log-detail-grid h2 { margin: 0; padding: 16px 18px; border-bottom: 1px solid var(--border); font-size: 18px; }
.error-panel>div { display: flex; justify-content: space-between; padding: 18px; }.error-panel strong,.error-panel span { font-size: 16px; }.error-panel strong { color: #e34b4b; }

.manual-content,.weekly-content { max-width: 760px; padding-bottom: 28px; }
.manual-machine { position: relative; display: flex; align-items: center; justify-content: center; height: clamp(220px,31vh,310px); margin: -6px auto 6px; }
.manual-machine img { display: block; width: 82%; height: 100%; object-fit: contain; }
.machine-visual { height: clamp(250px, 30vh, 340px); }
.machine-visual img { display: block; width: 92%; height: 100%; object-fit: contain; }
.temperature-strip { display: grid; grid-template-columns: 1fr 1fr; overflow: hidden; margin-bottom: 10px; border: 1px solid var(--border); border-radius: 7px; background: #111416; }
.temperature-strip article { display: flex; align-items: center; justify-content: center; min-height: 56px; padding: 8px 12px; gap: 14px; border-right: 1px solid var(--border); }
.temperature-strip article:last-child { border-right: 0; }
.temperature-strip span { color: var(--muted); font-size: 16px; }
.temperature-strip strong { color: var(--accent); font-size: 22px; font-weight: 600; }
.temperature-strip strong small { margin-left: 3px; font-size: 16px; font-weight: 500; }
.manual-tabs { margin-bottom: 12px; }
.signal-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.signal-list.hidden { display: none; }
.signal-list>div,.signal-list>button { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; min-height: 58px; padding: 0 12px 0 16px; gap: 10px; border: 1px solid var(--border); border-radius: 8px; background: #111416; color: var(--text); font-size: 16px; text-align: left; cursor: pointer; }
.signal-list>button { width: 100%; appearance: none; -webkit-appearance: none; font: inherit; cursor: pointer; }
.signal-list>button:active,.signal-list>div:active,.signal-list .selected { border-color: var(--accent); }
.state { min-width: 48px; padding: 5px 8px; border-radius: 5px; background: #292e32; color: #aeb4b9; font-size: 16px; font-weight: 600; text-align: center; }
.state.on { background: #23451d; color: #89d36f; }
.weekly-heading { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 18px; }
.weekly-heading h2 { margin: 0; font-size: 24px; }
.weekly-heading p { margin: 6px 0 0; color: var(--muted); font-size: 16px; }
.weekly-heading>span { padding: 6px 10px; border-radius: 6px; background: #23451d; color: #89d36f; font-size: 16px; }
.schedule-list { overflow: hidden; border: 1px solid var(--border); border-radius: 10px; background: #111416; }
.schedule-list article { display: grid; grid-template-columns: minmax(0,1fr) 104px 48px 44px; align-items: center; min-height: 78px; padding: 10px 12px 10px 18px; gap: 12px; border-bottom: 1px solid var(--border); }
.schedule-list article:last-child { border-bottom: 0; }
.schedule-list .day { display: flex; flex-direction: column; min-width: 0; gap: 5px; }
.schedule-list .day strong { font-size: 17px; font-weight: 600; }
.schedule-list .day span { overflow: hidden; color: var(--muted); font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
.schedule-list time { font-size: 16px; font-weight: 600; }
.schedule-switch { position: relative; width: 46px; height: 26px; padding: 0; border: 0; border-radius: 14px; background: #343a3f; cursor: pointer; }
.schedule-switch:after { position: absolute; top: 4px; left: 4px; width: 18px; height: 18px; border-radius: 50%; background: #aeb4b9; content: ""; transition: left .15s; }
.schedule-switch.active { background: #397916; }
.schedule-switch.active:after { left: 24px; background: #fff; }
.edit-schedule { width: 42px; height: 42px; padding: 0; border: 0; border-radius: 7px; background: transparent; color: var(--text); font-size: 24px; cursor: pointer; }
.edit-schedule:active { background: #292e32; }
.schedule-dialog { display: flex; flex-direction: column; gap: 20px; }
.schedule-dialog label { display: flex; flex-direction: column; gap: 8px; font-size: 16px; }
.schedule-dialog select,.schedule-dialog input { width: 100%; height: 54px; padding: 0 14px; border: 1px solid var(--border); border-radius: 8px; background: #0f1214; color: var(--text); font-size: 17px; }
.dialog .primary { background: var(--accent); color: #17100a; }

@media (max-width: 700px) {
  .run-layout, .run-actions { width: calc(100% - 32px); }
  .run-actions button { flex: 1; min-width: 0; }
  .log-summary { grid-template-columns: 1fr; }
}

@media (max-height: 760px) {
  .machine-panel { height: 200px; }
}

.detail-content {
  width: calc(100% - 48px);
  max-width: 720px;
  margin: 28px auto 0;
}

.subnav {
  display: flex;
  gap: 8px;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #101214;
}

.subnav button {
  flex: 1;
  min-height: 48px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
}

.subnav button.active { background: #24292d; color: var(--text); }
.setting-panel { display: none; margin-top: 44px; }
.setting-panel.active { display: block; }
.setting-panel h2 { margin: 0; font-size: 24px; font-weight: 600; }
.setting-panel p { margin: 8px 0 24px; color: var(--muted); font-size: 16px; }
.choice-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choice-row label { position: relative; }
.choice-row input { position: absolute; opacity: 0; }
.choice-row span { display: flex; align-items: center; justify-content: center; min-height: 68px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); font-size: 18px; }
.choice-row input:checked + span { border-color: var(--accent); box-shadow: inset 4px 0 var(--accent); }

.parameter-sections { display: flex; flex-direction: column; gap: 16px; padding-bottom: 28px; }
.form-section { padding: 20px; border: 1px solid var(--border); border-radius: 10px; background: #101315; }
.form-section h2 { margin: 0 0 18px; font-size: 18px; font-weight: 600; }
.parameter-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.parameter-grid label, .calibration-grid label, .password-form label { display: flex; flex-direction: column; gap: 8px; color: var(--text); font-size: 16px; }
.parameter-grid input, .calibration-grid input, .password-form input { width: 100%; height: 56px; padding: 0 16px; border: 1px solid var(--border); border-radius: 8px; outline: 0; background: #111416; color: var(--text); font-size: 20px; }
.parameter-grid input:focus, .calibration-grid input:focus, .password-form input:focus { border-color: var(--accent); }
.unit-input { position: relative; }
.unit-input input { padding-right: 58px; }
.unit-input.wide-unit input { padding-right: 82px; }
.unit-input b { position: absolute; right: 16px; top: 17px; color: var(--muted); font-size: 16px; font-weight: 500; }
.reset-field { display: grid; grid-template-columns: 1fr 56px; gap: 8px; }
.reset-field button { border: 0; border-radius: 8px; background: var(--accent); color: #111; font-size: 26px; cursor: pointer; }

.password-form { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 36px; }
.save-button { grid-column: 1/-1; justify-self: end; min-width: 180px; height: 52px; border: 0; border-radius: 8px; background: var(--accent); color: #15100a; font-size: 16px; font-weight: 700; cursor: pointer; }
.calibration-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.calibration-grid small { color: var(--muted); font-size: 16px; }

.dialog-backdrop { position: fixed; z-index: 30; inset: 0; display: none; align-items: center; justify-content: center; padding: 24px; background: rgba(0,0,0,.72); }
.dialog-backdrop.open { display: flex; }
.dialog { width: 100%; max-width: 440px; padding: 24px; border: 1px solid var(--border); border-radius: 12px; background: #15181b; box-shadow: 0 24px 80px rgba(0,0,0,.45); }
.dialog h2 { margin: 0; font-size: 22px; }
.dialog p { margin: 12px 0 28px; color: var(--muted); font-size: 16px; line-height: 1.5; }
.dialog>div { display: flex; justify-content: flex-end; gap: 10px; }
.dialog button { min-width: 110px; height: 48px; border: 0; border-radius: 8px; color: #fff; font-size: 16px; font-weight: 600; cursor: pointer; }
.dialog .secondary { background: #30353a; }
.dialog .danger { background: #a52525; }

@media (max-width: 520px) {
  .detail-content { width: calc(100% - 32px); }
  .parameter-grid, .calibration-grid, .password-form { grid-template-columns: 1fr; }
  .save-button { grid-column: 1; width: 100%; }
  .subnav { overflow-x: auto; }
  .subnav button { min-width: 120px; }
  .temperature-strip article { padding-right: 7px; padding-left: 7px; gap: 6px; }
  .schedule-list article { grid-template-columns: minmax(0,1fr) 48px 42px; }
  .schedule-list time { grid-column: 1; grid-row: 2; color: var(--text); }
  .schedule-list .schedule-switch { grid-column: 2; grid-row: 1/3; }
  .schedule-list .edit-schedule { grid-column: 3; grid-row: 1/3; }
  .auto-process-content { width: calc(100% - 32px); }
  .process-header { padding-right: 12px; padding-left: 12px; }
  .process-header .brand-mark { width: 54px; }
  .process-header .header-copy { margin-left: 9px; }
  .process-header .header-copy strong { font-size: 16px; }
  .abort-button { padding: 0 10px; }
  .auto-overview { grid-template-columns: 1fr; }
  .process-machine { height: 230px; }
  .parallel-processes { grid-template-columns: 1fr; }
  .program-select { align-items: stretch; flex-direction: column; }
  .program-select>button { width: 100%; }
  .process-summary, .signal-list { grid-template-columns: 1fr; }
  .process-summary article { border-right: 0; border-bottom: 1px solid var(--border); }
}

@media (max-height: 760px) {
  .machine-visual { height: 220px; }
}
