:root {
  --brand: #155aa8;
  --brand-dark: #102842;
  --brand-deep: #0d1f35;
  --accent: #f47b20;
  --good: #10a36d;
  --warn: #d89116;
  --bad: #d34b4b;
  --ink: #172033;
  --muted: #66758a;
  --soft: #f5f7fb;
  --line: #e4e9f1;
  --surface: #ffffff;
  --shadow: 0 18px 45px rgba(21, 43, 72, 0.12);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: #f7f8fa;
  overflow-x: hidden;
}
button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 6vw;
  background: rgba(255,255,255,.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 210px;
}
.brand img, .sidebar-brand img, .brand-on-dark img {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  object-fit: cover;
}
.brand strong, .sidebar-brand strong { display:block; font-size: 18px; }
.brand small, .sidebar-brand small { display:block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.site-nav {
  display: flex;
  gap: 28px;
  font-size: 14px;
  color: #405066;
}
.site-nav a:hover { color: var(--brand); }
.ghost-btn, .primary-btn, .text-link, .icon-btn, .send-btn, .ghost-action {
  border: 0;
  border-radius: 8px;
  min-height: 42px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ghost-btn {
  background: #eef4fb;
  color: var(--brand);
  font-weight: 700;
}
.ghost-action {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  background: #fff;
  color: #405066;
  font-size: 13px;
}
.primary-btn {
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 10px 22px rgba(21,90,168,.18);
}
.primary-btn:hover { background: #0e4d96; }
.primary-btn.small { min-height: 36px; padding: 0 14px; font-size: 13px; }
.primary-btn.wide { width: 100%; }
.text-link { color: var(--brand); font-weight: 700; }
.send-btn {
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  padding: 0;
  border-radius: 12px;
  background: var(--brand);
  color: #fff;
  box-shadow: 0 10px 22px rgba(21,90,168,.2);
}
.send-btn:hover { background: #0e4d96; }
.send-btn svg {
  width: 21px;
  height: 21px;
  display: block;
}
.send-btn path:first-child { fill: currentColor; }
.send-btn path:last-child {
  fill: none;
  stroke: var(--brand);
  stroke-width: 2;
  stroke-linecap: round;
}

.hero {
  min-height: 680px;
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(320px, 460px);
  align-items: center;
  gap: 64px;
  padding: 70px 6vw 90px;
  background:
    radial-gradient(circle at 78% 25%, rgba(21,90,168,.13), transparent 30%),
    linear-gradient(180deg, #fff, #f4f7fb);
}
.hero > * { min-width: 0; }
.hero-copy h1 {
  margin: 0;
  font-size: clamp(52px, 7vw, 96px);
  letter-spacing: 0;
  line-height: 1;
  color: var(--brand-dark);
}
.hero-copy p {
  max-width: 640px;
  margin: 24px 0 0;
  font-size: 22px;
  line-height: 1.65;
  color: #4b5a6f;
}
.hero-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 34px;
}
.factory-card {
  background: var(--brand-deep);
  color: #fff;
  border-radius: 18px;
  padding: 24px;
  box-shadow: var(--shadow);
  min-height: 420px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background-image:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 28px 28px;
}
.factory-top { display:flex; align-items:center; gap:12px; font-weight:700; }
.factory-top img { width:44px; height:44px; border-radius:12px; }
.factory-highlight {
  padding: 22px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 14px;
  background: rgba(255,255,255,.07);
}
.factory-highlight strong {
  display: block;
  font-size: 28px;
}
.factory-highlight p {
  margin: 10px 0 0;
  color: rgba(255,255,255,.72);
  line-height: 1.65;
}
.factory-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.factory-grid div {
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 12px;
  padding: 18px;
  background: rgba(255,255,255,.07);
}
.factory-grid strong { display:block; font-size: 30px; }
.factory-grid span { display:block; color: rgba(255,255,255,.72); margin-top: 8px; }

.section {
  padding: 82px 6vw;
  background: #fff;
}
.section.muted { background: var(--soft); }
.section-title { max-width: 760px; margin-bottom: 32px; }
.section-title h2, .contact h2 {
  margin: 0;
  font-size: 36px;
  line-height: 1.2;
  color: var(--brand-dark);
}
.section-title p, .contact p {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.7;
}
.plain-grid, .product-row, .capacity-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.plain-grid article, .product-tile, .capacity-board div {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 24px;
}
.plain-grid h3, .capacity-board strong { margin: 0; font-size: 22px; }
.plain-grid p, .capacity-board p { color: var(--muted); line-height: 1.7; }
.product-tile { min-height: 190px; display:flex; flex-direction:column; justify-content:space-between; }
.product-tile span { width: 48px; height: 48px; border-radius: 12px; display:grid; place-items:center; color:#fff; font-weight:800; }
.product-tile strong { font-size: 24px; }
.product-tile small { color: var(--muted); font-size: 14px; line-height: 1.55; }
.product-tile.blue span { background: var(--brand); }
.product-tile.green span { background: var(--good); }
.product-tile.orange span { background: var(--accent); }
.product-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 18px;
  padding: 22px 24px;
  border: 1px solid #cfe0f4;
  border-radius: 12px;
  background: #fff;
}
.product-note strong {
  color: var(--brand-dark);
  font-size: 20px;
  min-width: 220px;
}
.product-note p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}
.capacity-board span { color: var(--brand); font-weight:700; display:block; margin-bottom:10px; }
.process-line {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}
.process-line div {
  position: relative;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.process-line span {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #eef4fb;
  color: var(--brand);
  font-weight: 800;
}
.process-line strong {
  display: block;
  margin-top: 18px;
  color: var(--brand-dark);
  font-size: 20px;
}
.process-line p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.65;
}
.quality-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.quality-grid article {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.quality-grid strong {
  color: var(--brand-dark);
  font-size: 22px;
}
.quality-grid p {
  color: var(--muted);
  line-height: 1.7;
}
.contact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  background: var(--brand-dark);
  color: #fff;
}
.contact h2 { color:#fff; }
.contact p { color: rgba(255,255,255,.72); }
.contact-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.contact .ghost-btn {
  background: rgba(255,255,255,.12);
  color: #fff;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 46vw) 1fr;
  background: #fff;
}
.login-brand-panel {
  padding: 42px;
  background:
    radial-gradient(circle at 80% 18%, rgba(244,123,32,.32), transparent 22%),
    var(--brand-deep);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100vh;
}
.brand-on-dark { display:flex; align-items:center; gap:12px; font-weight:800; }
.login-brand-panel h2 { font-size: 42px; line-height:1.18; margin:14px 0; }
.login-brand-panel p, .login-brand-panel small { color: rgba(255,255,255,.68); line-height:1.8; }
.login-stats { display:flex; gap:24px; }
.login-stats strong { display:block; font-size:24px; color:#fff; }
.login-stats span { color: rgba(255,255,255,.68); }
.login-card {
  width: min(440px, calc(100vw - 40px));
  margin: auto;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.back-home {
  border: 0;
  background: transparent;
  color: var(--brand);
  padding: 0;
  margin-bottom: 24px;
}
.login-card h1 { margin:0; font-size:30px; }
.login-card p { color: var(--muted); margin-bottom:26px; }
.login-card label { display:block; margin:16px 0; font-weight:700; font-size:14px; }
.login-card input, .topbar input, .chat-input input {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  outline: none;
  background: #fff;
}
.login-card input:focus, .topbar input:focus, .chat-input input:focus { border-color: var(--brand); }
.login-hint { display:grid; grid-template-columns: repeat(3,1fr); gap:10px; margin-top:18px; }
.login-hint button {
  height: 38px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  color: var(--muted);
}

.admin {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 244px 1fr;
  background: #eef2f7;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--brand-deep);
  color: #d8e2ef;
  padding: 18px 14px;
}
.sidebar-brand {
  display:flex;
  align-items:center;
  gap:10px;
  padding: 8px 8px 18px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-brand small { color: rgba(255,255,255,.55); }
.menu { margin-top: 16px; display:flex; flex-direction:column; gap:4px; overflow:auto; }
.menu button {
  height: 38px;
  text-align: left;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #c8d5e5;
  padding: 0 12px;
}
.menu button:hover, .menu button.active { background: var(--brand); color: #fff; }
.sidebar-user {
  margin-top: auto;
  display:flex;
  align-items:center;
  gap:10px;
  padding: 14px 8px 2px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display:grid;
  place-items:center;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}
.sidebar-user small { display:block; color: rgba(255,255,255,.55); margin-top:2px; }
.workspace { min-width: 0; padding: 22px; }
.topbar {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 22px;
  margin-bottom: 18px;
}
.topbar p { margin:0 0 4px; color: var(--muted); }
.topbar h1 { margin:0; font-size: 28px; color: var(--brand-dark); }
.topbar-actions { display:flex; gap:10px; align-items:center; }
.topbar input { width: 310px; height: 38px; }
.icon-btn {
  min-height: 38px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--muted);
}
.page { display:none; }
.page.active { display:block; }

.ai-brief {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 24px;
  padding: 24px;
  border-radius: 14px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(21,90,168,.96), rgba(13,31,53,.96)),
    var(--brand);
  box-shadow: var(--shadow);
}
.ai-brief > div {
  min-width: 0;
}
.section-label {
  display:block;
  margin-bottom:10px;
  color: #b8dcff;
  font-weight: 700;
}
.ai-brief h2 { margin:0; font-size: 26px; }
.ai-brief p { margin:10px 0 0; max-width: 780px; color: rgba(255,255,255,.74); line-height:1.65; }
.metric-grid {
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap:14px;
  margin:16px 0;
}
.metric-grid article, .panel, .ai-main, .ai-side {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(21,43,72,.06);
}
.metric-grid article { padding:18px; }
.metric-grid span { color: var(--muted); }
.metric-grid strong { display:block; margin:8px 0 6px; font-size:30px; color: var(--brand-dark); }
.metric-grid small { color: var(--muted); }
.good { color: var(--good) !important; }
.warn { color: var(--warn) !important; }
.bad { color: var(--bad) !important; }
.dashboard-grid {
  display:grid;
  grid-template-columns: 1.5fr 1fr;
  gap:14px;
}
.panel { padding: 20px; min-width:0; }
.panel.wide { grid-row: span 2; }
.panel-head {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  margin-bottom:16px;
}
.panel-head h2, .panel-head h3 { margin:0; color: var(--brand-dark); }
.panel-head span { color: var(--muted); font-size:13px; }
.line-chart {
  height: 300px;
  display:flex;
  align-items:end;
  gap:12px;
  padding: 26px 10px 0;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(#fff, #f7fbff);
}
.line-chart i {
  flex: 1;
  min-width: 12px;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, #2c77c8, #acd2ff);
}
.donut {
  width: 160px;
  height:160px;
  margin: 10px auto 18px;
  border-radius:50%;
  display:grid;
  place-items:center;
  background: conic-gradient(var(--brand) 0 50%, var(--accent) 50% 78%, var(--bad) 78% 100%);
  position: relative;
}
.donut:before {
  content:"";
  position:absolute;
  width: 98px;
  height:98px;
  border-radius:50%;
  background:#fff;
}
.donut span { position:relative; font-size:30px; font-weight:800; color:var(--brand-dark); }
.legend { list-style:none; padding:0; margin:0; display:grid; gap:8px; color:var(--muted); }
.legend b { display:inline-block; width:10px; height:10px; border-radius:50%; margin-right:8px; }
.blue-dot { background: var(--brand); }
.orange-dot { background: var(--accent); }
.red-dot { background: var(--bad); }
.task-list { margin:0; padding-left:22px; display:grid; gap:14px; }
.task-list strong { display:block; color: var(--brand-dark); }
.task-list span { color: var(--muted); font-size: 13px; }
.rank-row {
  display:flex;
  justify-content:space-between;
  gap:12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.rank-row:last-child { border-bottom:0; }
.rank-row b { color: var(--good); }

.ai-layout {
  display:grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap:16px;
}
.ai-command {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 24px;
  margin-bottom: 16px;
  border-radius: 14px;
  color: #fff;
  background:
    radial-gradient(circle at 88% 20%, rgba(244,123,32,.25), transparent 22%),
    linear-gradient(135deg, #155aa8, #102842);
  box-shadow: var(--shadow);
}
.ai-command h2 {
  margin: 0;
  font-size: 28px;
}
.ai-command p {
  max-width: 780px;
  margin: 10px 0 0;
  color: rgba(255,255,255,.72);
  line-height: 1.65;
}
.ai-command-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.ai-command .ghost-action {
  border-color: rgba(255,255,255,.3);
  background: rgba(255,255,255,.12);
  color: #fff;
}
.ai-report-grid {
  display: grid;
  grid-template-columns: 1.25fr repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}
.ai-report-card {
  min-width: 0;
  min-height: 142px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(21,43,72,.06);
}
.ai-report-card.priority {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, #0d1f35, #155aa8);
}
.ai-report-card span {
  display: block;
  color: var(--muted);
}
.ai-report-card.priority span,
.ai-report-card.priority p {
  color: rgba(255,255,255,.72);
}
.ai-report-card strong {
  display: block;
  margin: 10px 0;
  color: var(--brand-dark);
  font-size: 26px;
}
.ai-report-card.priority strong {
  color: #fff;
}
.ai-report-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.analysis-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}
.analysis-grid article {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(21,43,72,.06);
}
.analysis-grid b {
  display: block;
  color: var(--brand-dark);
  font-size: 18px;
}
.analysis-grid p {
  min-height: 48px;
  color: var(--muted);
  line-height: 1.6;
}
.analysis-grid button {
  height: 34px;
  border: 1px solid #cdd9e8;
  border-radius: 17px;
  background: #f5f9ff;
  color: var(--brand);
  padding: 0 14px;
}
.ai-main, .ai-side { padding: 20px; }
.quick-prompts {
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-bottom:16px;
}
.quick-prompts button {
  height: 36px;
  border: 1px solid #cdd9e8;
  background: #f5f9ff;
  color: var(--brand);
  border-radius: 18px;
  padding: 0 14px;
}
.chat {
  height: 470px;
  overflow:auto;
  border: 1px solid var(--line);
  background: #f8fafc;
  border-radius: 12px;
  padding: 16px;
  display:flex;
  flex-direction:column;
  gap:12px;
}
.message {
  max-width: 78%;
  border-radius: 14px;
  padding: 14px;
  line-height: 1.65;
}
.message p { margin: 6px 0 0; }
.message.assistant { background: #fff; border: 1px solid var(--line); }
.message.user { align-self:flex-end; background: var(--brand); color:#fff; }
.answer-table {
  width:100%;
  border-collapse: collapse;
  margin-top:10px;
  font-size: 13px;
}
.answer-table th, .answer-table td {
  border-bottom: 1px solid var(--line);
  text-align:left;
  padding:8px;
}
.chat-input { display:flex; gap:10px; margin-top:14px; }
.chat-input input {
  height: 48px;
  flex: 1;
  min-width: 0;
}
.source-box {
  display:grid;
  gap:10px;
  margin-top: 18px;
  padding: 14px;
  border-radius: 12px;
  background: #f5f9ff;
  color: var(--muted);
}
.source-box strong { color: var(--brand-dark); }

.exception-list { display:grid; gap:12px; }
.exception-list article {
  display:flex;
  align-items:center;
  gap:14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.exception-list div { flex:1; }
.exception-list strong { display:block; color: var(--brand-dark); }
.exception-list span { display:block; color: var(--muted); margin-top:5px; }
.exception-list button {
  border:0;
  border-radius:8px;
  background:#eef4fb;
  color: var(--brand);
  height:36px;
  padding:0 14px;
}
.level {
  width:34px;
  height:34px;
  border-radius:10px;
  display:grid;
  place-items:center;
  color:#fff;
}
.level.high { background: var(--bad); }
.level.mid { background: var(--warn); }
.level.low { background: var(--brand); }
.module-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(21,43,72,.06);
}
.module-head h2 {
  margin: 0;
  color: var(--brand-dark);
  font-size: 26px;
}
.module-head > div {
  min-width: 0;
}
.module-head p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.65;
}
.module-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.module-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}
.module-stats article {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(21,43,72,.06);
}
.module-stats span {
  display: block;
  color: var(--muted);
}
.module-stats strong {
  display: block;
  margin-top: 8px;
  color: var(--brand-dark);
  font-size: 30px;
}
.data-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.data-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  background: #fff;
}
.data-table th,
.data-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.data-table th {
  color: #52627a;
  background: #f7f9fc;
  font-size: 13px;
}
.data-table td {
  color: var(--ink);
}
.data-table tr:last-child td {
  border-bottom: 0;
}
.workflow {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.workflow div {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: #52627a;
}
.workflow div.current {
  border-color: #9fc4ef;
  background: #f1f7ff;
  color: var(--brand);
}
.workflow span {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #eef4fb;
  font-weight: 800;
}
.workflow strong {
  font-size: 14px;
}
.orders-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, .85fr);
  gap: 16px;
  margin-bottom: 16px;
}
.order-form-panel {
  min-width: 0;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.form-grid label,
.wide-field {
  display: grid;
  gap: 8px;
  color: #52627a;
  font-size: 13px;
  font-weight: 700;
}
.form-grid input,
.form-grid select,
.wide-field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  outline: 0;
}
.form-grid input,
.form-grid select {
  height: 42px;
  padding: 0 12px;
}
.wide-field {
  margin-top: 14px;
}
.wide-field textarea {
  min-height: 82px;
  resize: vertical;
  padding: 12px;
  line-height: 1.6;
}
.form-actions,
.review-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.review-card {
  padding: 16px;
  border: 1px solid #cfe0f4;
  border-radius: 12px;
  background: #f5f9ff;
}
.review-card strong {
  color: var(--brand-dark);
}
.review-card p {
  color: var(--muted);
  line-height: 1.65;
}
.audit-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}
.audit-list div {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.audit-list div:last-child {
  border-bottom: 0;
}
.audit-list b {
  color: var(--brand);
}
.audit-list span {
  color: var(--muted);
}
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 13px;
  background: #eef7f3;
  color: #08704d;
  font-size: 13px;
  font-weight: 700;
}
.status-pill.danger {
  background: #fff1f1;
  color: var(--bad);
}
.schedule-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}
.schedule-summary article {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(21,43,72,.06);
}
.schedule-summary span,
.schedule-summary small {
  color: var(--muted);
}
.schedule-summary strong {
  display: block;
  margin: 8px 0 4px;
  color: var(--brand-dark);
  font-size: 30px;
}
.schedule-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 16px;
}
.machine-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(128px, 1fr));
  gap: 12px;
}
.machine-section {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fafc;
}
.machine-section + .machine-section {
  margin-top: 16px;
}
.machine-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}
.machine-section-head strong {
  display: block;
  color: var(--brand-dark);
  font-size: 18px;
}
.machine-section-head span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}
.machine-section-head em {
  min-width: 48px;
  min-height: 30px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: #eef4fb;
  color: var(--brand);
  font-style: normal;
  font-weight: 800;
}
.machine-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--good);
  border-radius: 12px;
  background: #fff;
}
.machine-card.warn { border-left-color: var(--warn); background: #fffaf1; }
.machine-card.slow { border-left-color: var(--bad); background: #fff6f6; }
.machine-card.idle { border-left-color: #9aa8ba; background: #f8fafc; }
.machine-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.machine-top strong {
  color: var(--brand-dark);
}
.machine-top span {
  color: var(--muted);
  font-size: 12px;
}
.machine-card p {
  margin: 12px 0 4px;
  color: var(--ink);
  font-weight: 700;
}
.machine-card small {
  display: block;
  min-height: 18px;
  color: var(--muted);
}
.progress-track {
  height: 7px;
  margin-top: 12px;
  border-radius: 8px;
  background: #e5ecf5;
  overflow: hidden;
}
.progress-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), #7fb8f4);
}
.machine-card em {
  display: block;
  margin-top: 6px;
  color: #52627a;
  font-style: normal;
  font-size: 12px;
}
.schedule-side {
  display: grid;
  gap: 16px;
  align-content: start;
}
.recommend-list,
.pending-orders {
  display: grid;
  gap: 12px;
}
.recommend-list div {
  display: flex;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.recommend-list div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}
.recommend-list b {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: #eef4fb;
  color: var(--brand);
}
.recommend-list strong,
.pending-orders strong {
  display: block;
  color: var(--brand-dark);
}
.recommend-list small,
.pending-orders span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.5;
}
.pending-orders div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
}
.entry-layout,
.inventory-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 16px;
}
.inventory-layout {
  grid-template-columns: minmax(0, 1fr) 420px;
}
.phone-form {
  border: 10px solid #101b2c;
  border-radius: 30px;
  background: #eef3f8;
  overflow: hidden;
  box-shadow: 0 18px 45px rgba(21, 43, 72, .18);
}
.phone-head {
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  background: #fff;
  color: var(--brand-dark);
  font-size: 13px;
}
.phone-head strong {
  font-size: 16px;
}
.mobile-form-card {
  display: grid;
  gap: 14px;
  padding: 16px;
}
.mobile-form-card label,
.confirm-card label {
  display: grid;
  gap: 8px;
  color: #52627a;
  font-size: 13px;
  font-weight: 700;
}
.mobile-form-card input,
.mobile-form-card select,
.mobile-form-card textarea,
.confirm-card textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  outline: 0;
}
.mobile-form-card input,
.mobile-form-card select {
  height: 44px;
  padding: 0 12px;
}
.mobile-form-card textarea,
.confirm-card textarea {
  min-height: 78px;
  padding: 12px;
  line-height: 1.6;
  resize: vertical;
}
.segmented {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.segmented button {
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: #52627a;
}
.segmented button.active {
  border-color: #9fc4ef;
  background: #eef7ff;
  color: var(--brand);
  font-weight: 800;
}
.two-col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.calc-box {
  padding: 14px;
  border-radius: 12px;
  background: #f1f7ff;
  border: 1px solid #cfe0f4;
}
.calc-box span,
.calc-box small {
  display: block;
  color: #52627a;
}
.calc-box strong {
  display: block;
  margin: 6px 0 4px;
  color: var(--brand);
  font-size: 28px;
}
.warn-box {
  background: #fff7ed;
  border-color: #f3c98c;
}
.warn-box strong {
  color: var(--warn);
}
.module-stats.compact {
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 16px;
}
.quality-alert {
  padding: 16px;
  margin-bottom: 16px;
  border: 1px solid #f2c1c1;
  border-radius: 12px;
  background: #fff6f6;
}
.quality-alert strong {
  color: var(--bad);
}
.quality-alert p {
  margin: 8px 0 0;
  color: var(--muted);
}
.stock-flow {
  display: grid;
  gap: 12px;
}
.stock-flow div {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.stock-flow div.current {
  border-color: #9fc4ef;
  background: #f1f7ff;
}
.stock-flow b {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #eef4fb;
  color: var(--brand);
}
.stock-flow strong,
.confirm-card strong,
.stock-list strong {
  display: block;
  color: var(--brand-dark);
}
.stock-flow small,
.stock-list span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}
.stock-flow em {
  color: var(--brand-dark);
  font-style: normal;
  font-weight: 800;
}
.confirm-card {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid #cfe0f4;
  border-radius: 12px;
  background: #f5f9ff;
}
.confirm-card p {
  color: var(--muted);
  line-height: 1.65;
}
.stock-list {
  display: grid;
  gap: 12px;
}
.stock-list div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
}
.material-layout,
.settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 16px;
  margin-bottom: 16px;
}
.warning-hero {
  min-width: 0;
  padding: 18px;
  border-radius: 14px;
  background: linear-gradient(135deg, #fff7ed, #fff);
  border: 1px solid #f3c98c;
  overflow: hidden;
}
.warning-hero strong {
  display: block;
  color: var(--warn);
  font-size: 24px;
}
.warning-hero p {
  color: var(--muted);
  line-height: 1.65;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.material-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 14px;
}
.material-cards div {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.material-cards span,
.material-cards small {
  display: block;
  color: var(--muted);
  overflow-wrap: anywhere;
  word-break: break-word;
}
.material-cards strong {
  display: block;
  margin: 8px 0 5px;
  color: var(--brand-dark);
  font-size: 22px;
}
.purchase-list,
.rule-list,
.weight-list {
  display: grid;
  gap: 12px;
}
.purchase-list div,
.rule-list div,
.weight-list div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
}
.purchase-list b,
.rule-list strong {
  display: block;
  color: var(--brand-dark);
}
.purchase-list span,
.rule-list span,
.weight-list span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.5;
}
.purchase-list em {
  display: inline-flex;
  margin-top: 10px;
  padding: 4px 9px;
  border-radius: 12px;
  background: #eef4fb;
  color: var(--brand);
  font-style: normal;
  font-size: 12px;
}
.material-filter {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.material-filter button {
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: #fff;
  color: #52627a;
  padding: 0 13px;
}
.material-filter button.active {
  border-color: #9fc4ef;
  background: #eef7ff;
  color: var(--brand);
  font-weight: 800;
}
.account-toolbar {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) 150px auto;
  gap: 10px;
  margin-bottom: 14px;
}
.account-toolbar input,
.account-toolbar select {
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0 12px;
  outline: 0;
}
.settings-side {
  display: grid;
  gap: 16px;
  align-content: start;
}
.weight-list div {
  display: flex;
  align-items: center;
  gap: 12px;
}
.weight-list b {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--brand);
  color: #fff;
}
.permission-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.permission-grid label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
  color: var(--brand-dark);
}
.permission-grid input {
  width: 17px;
  height: 17px;
  accent-color: var(--brand);
}
.import-flow {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.import-flow div {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: #52627a;
}
.import-flow div.current {
  border-color: #9fc4ef;
  background: #f1f7ff;
  color: var(--brand);
}
.import-flow span {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #eef4fb;
  font-weight: 800;
}
.base-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
  margin-bottom: 16px;
}
.upload-zone {
  display: grid;
  place-items: center;
  text-align: center;
  min-height: 180px;
  padding: 24px;
  margin-bottom: 16px;
  border: 1px dashed #9fc4ef;
  border-radius: 14px;
  background: #f5f9ff;
}
.upload-zone strong {
  display: block;
  color: var(--brand-dark);
  font-size: 22px;
}
.upload-zone p {
  max-width: 620px;
  color: var(--muted);
  line-height: 1.65;
}
.field-match {
  align-self: start;
}
.match-list {
  display: grid;
  gap: 12px;
}
.match-list div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
}
.match-list span,
.match-list em {
  display: block;
  color: var(--muted);
  font-style: normal;
  line-height: 1.5;
}
.match-list b {
  display: block;
  margin: 5px 0;
  color: var(--brand-dark);
}
.import-result {
  margin-top: 16px;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid #bfe3d2;
  background: #f1fbf6;
}
.import-result strong {
  color: #08704d;
}
.import-result p {
  color: var(--muted);
  margin-bottom: 0;
}
.base-card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.base-card-grid article {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.base-card-grid article > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.base-card-grid strong {
  color: var(--brand-dark);
  font-size: 18px;
}
.base-card-grid span {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 0 10px;
  border-radius: 14px;
  background: #eef4fb;
  color: var(--brand);
  font-weight: 800;
}
.base-card-grid p {
  min-height: 52px;
  color: var(--muted);
  line-height: 1.6;
}
.knowledge-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
  margin-bottom: 16px;
}
.knowledge-ai-panel {
  min-height: 420px;
}
.knowledge-upload {
  min-height: 170px;
}
.knowledge-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.knowledge-tags button {
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: #fff;
  color: #52627a;
  padding: 0 13px;
}
.knowledge-tags button.active {
  border-color: #9fc4ef;
  background: #eef7ff;
  color: var(--brand);
  font-weight: 800;
}
.knowledge-chat {
  display: grid;
  gap: 16px;
}
.knowledge-chat strong {
  color: var(--brand-dark);
}
.knowledge-chat p {
  margin: 10px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
  color: #52627a;
  line-height: 1.5;
}
.knowledge-ai-panel .knowledge-chat > div:first-child {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.knowledge-ai-panel .knowledge-chat > div:first-child strong {
  grid-column: 1 / -1;
}
.knowledge-answer-preview {
  padding: 16px;
  border: 1px solid #bfe3d2;
  border-radius: 14px;
  background: #f1fbf6;
}
.knowledge-answer-preview strong {
  display: block;
  color: #08704d;
}
.knowledge-answer-preview p {
  margin: 10px 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
}
.knowledge-answer-preview span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}
.knowledge-search {
  display: flex;
  gap: 10px;
}
.knowledge-search input {
  flex: 1;
  min-width: 0;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 12px;
  outline: 0;
}
.knowledge-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}
.knowledge-summary article {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(21,43,72,.06);
}
.knowledge-summary span,
.knowledge-summary small {
  display: block;
  color: var(--muted);
}
.knowledge-summary strong {
  display: block;
  margin: 8px 0 4px;
  color: var(--brand-dark);
  font-size: 30px;
}
.learning-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.learning-grid article {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fafc;
}
.learning-grid strong {
  color: var(--brand-dark);
}
.learning-grid p {
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 0;
}

.mobile-dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  height: 64px;
  display: none;
  grid-template-columns: repeat(5,1fr);
  background: #fff;
  border-top: 1px solid var(--line);
}
.mobile-dock button {
  border:0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
}
.mobile-dock button.active { color: var(--brand); font-weight:800; }
.mobile-role-switch {
  display: none;
}

@media (max-width: 1100px) {
  .site-nav { display:none; }
  .hero { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid, .ai-layout, .orders-layout, .schedule-layout, .entry-layout, .inventory-layout, .material-layout, .settings-layout, .base-layout, .ai-report-grid, .analysis-grid, .knowledge-layout { grid-template-columns: 1fr; }
  .workflow { grid-template-columns: repeat(4, 1fr); }
  .import-flow { grid-template-columns: repeat(3, 1fr); }
  .base-card-grid { grid-template-columns: repeat(2, 1fr); }
  .process-line { grid-template-columns: repeat(2, 1fr); }
  .machine-board { grid-template-columns: repeat(3, minmax(128px, 1fr)); }
  .topbar { align-items:flex-start; flex-direction:column; }
}

@media (max-width: 760px) {
  html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }
  .site-header { height:64px; padding: 0 16px; }
  .brand small, .ghost-btn { display:none; }
  .brand { min-width: 0; }
  .hero {
    width: 100%;
    max-width: 100vw;
    min-height:auto;
    padding: 44px 18px 42px;
    gap:0;
  }
  .hero-copy,
  .factory-card {
    max-width: calc(100vw - 36px);
  }
  .hero-copy h1 { font-size: 44px; line-height: 1.08; }
  .hero-copy p {
    max-width: 100%;
    margin-top: 18px;
    font-size: 17px;
    line-height: 1.72;
  }
  .hero-actions {
    flex-direction:column;
    align-items:stretch;
    gap: 12px;
    margin-top: 28px;
  }
  .hero-actions .primary-btn,
  .hero-actions .link-btn,
  .hero-actions .ghost-btn {
    display: inline-flex;
    width: 100%;
    justify-content: center;
    min-height: 46px;
  }
  .factory-card {
    width: 100%;
    min-height: 0;
    margin-top: 34px;
    padding: 18px;
    border-radius: 16px;
    gap: 18px;
  }
  .factory-top {
    align-items:flex-start;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 15px;
  }
  .factory-top span {
    min-width: 0;
    overflow-wrap: anywhere;
  }
  .factory-top img { width: 40px; height: 40px; }
  .factory-highlight { padding: 18px; }
  .factory-highlight strong { font-size: 24px; line-height: 1.2; }
  .factory-highlight p { font-size: 15px; }
  .factory-highlight,
  .factory-grid div {
    min-width: 0;
  }
  .factory-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .factory-grid div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
  }
  .factory-grid strong { font-size: 25px; }
  .factory-grid span {
    margin-top: 0;
    font-size: 14px;
    text-align: right;
    overflow-wrap: anywhere;
  }
  .plain-grid, .product-row, .capacity-board { grid-template-columns: 1fr; }
  .product-note {
    align-items: flex-start;
    flex-direction: column;
  }
  .product-note strong {
    min-width: 0;
  }
  .process-line,
  .quality-grid {
    grid-template-columns: 1fr;
  }
  .section { padding: 56px 18px; }
  .contact { align-items:flex-start; flex-direction:column; }
  .contact-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .login-screen { grid-template-columns:1fr; }
  .login-brand-panel { min-height: 320px; padding: 28px; }
  .login-brand-panel h2 { font-size: 32px; }
  .login-card { margin: 22px auto; box-shadow:none; }
  .login-hint { grid-template-columns: repeat(2, 1fr); }
  .admin { grid-template-columns:1fr; }
  .admin,
  .page,
  .topbar,
  .module-head,
  .workflow,
  .orders-layout,
  .schedule-layout,
  .schedule-summary {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
  }
  .sidebar {
    display:none;
  }
  .workspace {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    padding: 16px 16px 78px;
  }
  .topbar-actions { width:100%; }
  .topbar-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 56px;
    gap: 8px;
  }
  .topbar-actions .icon-btn {
    display: none;
  }
  .topbar-actions .primary-btn { display: none; }
  .topbar input {
    width:100%;
    min-width: 0;
  }
  .mobile-role-switch {
    display: grid;
    gap: 10px;
    width: 100%;
    max-width: 100%;
    padding: 12px;
    margin: 4px 0 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
  }
  .mobile-nav-row {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }
  .mobile-nav-row::-webkit-scrollbar {
    display: none;
  }
  .mobile-nav-row span {
    flex: 0 0 auto;
    min-width: 66px;
    color: var(--brand-dark);
    font-size: 13px;
    font-weight: 800;
  }
  .mobile-nav-row button,
  .mobile-all-nav button {
    flex: 0 0 auto;
    min-height: 34px;
    border: 1px solid #d8e3f1;
    border-radius: 999px;
    background: #f7fbff;
    color: #36516f;
    padding: 0 12px;
    font-size: 13px;
    font-weight: 700;
  }
  .mobile-nav-row button.active,
  .mobile-all-nav button.active {
    border-color: var(--brand);
    background: var(--brand);
    color: #fff;
  }
  .mobile-all-nav {
    border-top: 1px dashed var(--line);
    padding-top: 8px;
  }
  .mobile-all-nav summary {
    color: var(--brand);
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
  }
  .mobile-all-nav div {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 10px;
  }
  .ai-brief {
    overflow: hidden;
    width: 100%;
    max-width: 100%;
  }
  .ai-command {
    align-items: flex-start;
    flex-direction: column;
  }
  .ai-command h2 {
    font-size: 24px;
    line-height: 1.35;
  }
  .ai-command p {
    max-width: 300px;
  }
  .ai-report-card strong,
  .ai-report-card p {
    max-width: 300px;
  }
  .ai-command-actions {
    justify-content: flex-start;
  }
  .ai-brief > div {
    width: 100%;
  }
  .ai-brief h2 {
    max-width: 300px;
    font-size: 22px;
    line-height: 1.35;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  .ai-brief p {
    max-width: 300px;
    font-size: 15px;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  .metric-grid { grid-template-columns:1fr; }
  .dashboard-grid,
  .ai-layout {
    width: 100%;
    max-width: 100%;
  }
  .panel,
  .ai-main,
  .ai-side {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }
  .module-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .module-head p {
    max-width: 300px;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .module-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .module-stats {
    grid-template-columns: 1fr;
  }
  .workflow {
    grid-template-columns: 1fr;
  }
  .import-flow {
    grid-template-columns: 1fr;
  }
  .workflow div {
    min-height: 52px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .schedule-summary {
    grid-template-columns: 1fr;
  }
  .machine-board {
    grid-template-columns: 1fr;
  }
  .machine-section {
    padding: 12px;
  }
  .machine-section-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .schedule-side {
    grid-template-columns: 1fr;
  }
  .phone-form {
    width: 100%;
    max-width: 310px;
    margin: 0 auto;
    border-width: 7px;
    border-radius: 26px;
  }
  .module-stats.compact {
    grid-template-columns: 1fr;
  }
  .two-col {
    grid-template-columns: 1fr;
  }
  .stock-flow div {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
  .stock-flow em {
    grid-column: auto;
  }
  .material-cards,
  .permission-grid {
    grid-template-columns: 1fr;
  }
  .warning-hero strong {
    font-size: 22px;
  }
  .warning-hero,
  .material-cards,
  .material-cards div {
    width: 100%;
    max-width: 100%;
  }
  .warning-hero p {
    max-width: 280px;
  }
  .material-warning,
  .material-layout,
  .settings-layout,
  .base-layout {
    max-width: 100%;
    overflow-x: hidden;
  }
  .base-card-grid {
    grid-template-columns: 1fr;
  }
  .knowledge-summary,
  .learning-grid {
    grid-template-columns: 1fr;
  }
  .knowledge-layout {
    max-width: 100%;
    overflow-x: hidden;
  }
  .knowledge-ai-panel .knowledge-chat > div:first-child {
    grid-template-columns: 1fr;
  }
  .upload-zone {
    min-height: 150px;
    padding: 18px;
  }
  .knowledge-upload {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }
  .knowledge-upload strong,
  .knowledge-upload p {
    max-width: 280px;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  .upload-zone p {
    max-width: 280px;
  }
  .account-toolbar {
    grid-template-columns: 1fr;
  }
  .ai-brief { align-items:flex-start; flex-direction:column; }
  .message { max-width: 92%; }
  .mobile-dock { display:grid; }
}
