:root {
  color-scheme: light;
  --color-bg: #f6f8fc;
  --color-surface: #ffffff;
  --color-primary: #0f172a;
  --color-primary-2: #1d4ed8;
  --color-accent: #38bdf8;
  --color-success: #16a34a;
  --color-warning: #f59e0b;
  --color-danger: #dc2626;
  --color-text: #0f172a;
  --color-muted: #64748b;
  --color-border: #e5e7eb;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --shadow-card: 0 14px 38px rgba(15, 23, 42, 0.08);
  --shadow-soft: 0 8px 24px rgba(15, 23, 42, 0.06);
  --space-page: 24px;
  --space-card: 20px;
  --bg: var(--color-bg);
  --panel: var(--color-surface);
  --ink: var(--color-text);
  --muted: var(--color-muted);
  --line: var(--color-border);
  --accent: var(--color-primary-2);
  --accent-dark: #1e40af;
  --green: var(--color-success);
  --gold: var(--color-warning);
  --red: var(--color-danger);
  --soft-blue: #eaf4f8;
  --soft-green: #eaf7f1;
  --soft-gold: #fff4df;
  --shadow: var(--shadow-card);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.16), transparent 30%),
    linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
  color: var(--ink);
  font-family: "Microsoft JhengHei", "Noto Sans TC", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

body.is-logged-out .authenticated-only,
body.is-logged-out #productNavSection,
body.is-logged-out #dashboardShell,
body.is-logged-out #adminBootstrapSection,
body.is-logged-out #roleActionSection,
body.is-logged-out #roleModeBtn {
  display: none !important;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  font-weight: 800;
  cursor: pointer;
}

button:active {
  transform: translateY(1px);
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: wait;
  opacity: 0.62;
}

.app {
  width: min(1240px, 100%);
  margin: 0 auto;
  padding: 22px 18px 86px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 999px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: auto;
  padding: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.brand strong {
  display: block;
  font-size: 21px;
  line-height: 1.15;
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 14px;
}

.topbar-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.version-badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.update-app-button {
  min-height: 34px;
  border-radius: 999px;
  padding: 0 12px;
  font-size: 13px;
}

.brand-mark {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, #0f172a, #2563eb 58%, #38bdf8);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.25);
}

.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  height: 4px;
  border-radius: 999px;
  background: #fff;
}

.brand-mark::before {
  top: 15px;
  box-shadow: 0 7px 0 #fff;
}

.brand-mark::after {
  top: 29px;
}

.role-mode-button {
  display: none;
  min-width: 150px;
}

.top-actions,
.form-actions,
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.primary {
  background: var(--accent);
  color: #fff;
}

.secondary,
.import-button {
  display: inline-grid;
  min-height: 48px;
  place-items: center;
  border-radius: 8px;
  padding: 0 16px;
  background: var(--soft-blue);
  color: var(--accent-dark);
  font-weight: 800;
  cursor: pointer;
}

.danger-light {
  background: #fff0f0;
  color: var(--red);
}

.import-button input {
  display: none;
}

.home-view,
.view {
  display: grid;
  gap: 22px;
}

#homeView .public-tool-section,
#homeView #roleActionSection,
#homeView .summary-strip {
  display: none !important;
}

#homeView .admin-bootstrap-section {
  order: 20;
  opacity: 0.92;
}

.landing-shell {
  display: grid;
  gap: 18px;
}

.landing-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  align-items: stretch;
}

.landing-copy {
  position: relative;
  overflow: hidden;
  min-height: 430px;
  border: 1px solid rgba(191, 219, 254, 0.32);
  border-radius: var(--radius-xl);
  padding: 42px;
  background:
    radial-gradient(circle at 82% 14%, rgba(56, 189, 248, 0.42), transparent 25%),
    radial-gradient(circle at 10% 16%, rgba(96, 165, 250, 0.26), transparent 28%),
    linear-gradient(135deg, #0f172a 0%, #1d4ed8 58%, #38bdf8 100%);
  color: #fff;
  box-shadow: 0 28px 76px rgba(15, 23, 42, 0.24);
}

.landing-copy::after {
  content: "";
  position: absolute;
  right: -88px;
  bottom: -110px;
  width: 340px;
  height: 340px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
}

.landing-copy h1 {
  max-width: 760px;
  margin: 0;
  font-size: 52px;
  line-height: 1.08;
  letter-spacing: 0;
}

.landing-copy p {
  max-width: 720px;
  margin: 18px 0 0;
  color: #dbeafe;
  font-size: 21px;
  font-weight: 850;
}

.landing-copy > span {
  display: inline-flex;
  max-width: 620px;
  margin-top: 22px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.14);
  color: #eff6ff;
  font-weight: 900;
}

.landing-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.landing-cta-row button,
.landing-side-card button {
  min-height: 48px;
}

.secondary.light {
  border-color: rgba(255, 255, 255, 0.36);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.landing-side-stack {
  display: grid;
  gap: 14px;
}

.landing-side-card {
  display: grid;
  gap: 10px;
  align-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-card);
}

.landing-side-card.primary-card {
  border-color: rgba(29, 78, 216, 0.18);
  background: linear-gradient(180deg, #ffffff 0%, #eff6ff 100%);
}

.landing-side-card span {
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 900;
}

.landing-side-card strong {
  font-size: 24px;
}

.landing-side-card small {
  color: var(--muted);
  font-weight: 850;
}

.landing-login-card {
  align-self: stretch;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: var(--radius-xl);
  padding: 24px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.14);
  backdrop-filter: blur(12px);
}

.landing-login-card .section-title {
  align-items: start;
}

.landing-login-card .section-title h2 {
  font-size: 28px;
}

.landing-login-card .user-login-panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: stretch;
}

.landing-login-card .user-login-panel button {
  width: 100%;
}

.landing-login-card .user-login-panel output {
  min-height: 46px;
  border-radius: 14px;
  padding: 12px;
  background: #f8fafc;
  color: var(--muted);
  font-weight: 900;
}

.enterprise-login-note {
  border-radius: 14px;
  padding: 12px;
  background: var(--soft-blue);
  color: var(--accent-dark);
  font-weight: 900;
}

.bootstrap-admin-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-lg);
  padding: 18px;
  background: #eff6ff;
  box-shadow: var(--shadow-soft);
}

.bootstrap-admin-entry strong,
.bootstrap-admin-entry small {
  display: block;
}

.bootstrap-admin-entry strong {
  color: var(--accent-dark);
  font-size: 20px;
}

.bootstrap-admin-entry small {
  color: var(--muted);
  font-weight: 850;
}

.free-tool-feature,
.landing-pricing-cta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
  background: #fff;
  box-shadow: var(--shadow);
}

.free-tool-feature {
  border-left: 6px solid var(--green);
}

.free-tool-feature h2,
.landing-pricing-cta strong {
  margin: 0;
  color: var(--accent-dark);
  font-size: 24px;
}

.free-tool-feature p {
  margin: 8px 0 0;
  color: var(--muted);
  font-weight: 850;
}

.landing-value-section {
  display: grid;
  gap: 12px;
}

.landing-value-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.landing-value-grid.four-up {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.landing-value-grid article {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

.landing-value-grid i {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: var(--soft-blue);
  color: var(--accent-dark);
  font-style: normal;
  font-weight: 900;
}

.landing-value-grid strong {
  color: var(--ink);
  font-size: 18px;
}

.landing-value-grid small,
.landing-pricing-cta small {
  color: var(--muted);
  font-weight: 850;
}

.route-shell {
  display: grid;
  gap: 18px;
}

.route-back {
  justify-self: start;
}

.login-hero-card {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(360px, 0.7fr);
  gap: 24px;
  align-items: stretch;
  border-radius: var(--radius-xl);
  padding: 28px;
  background:
    radial-gradient(circle at 10% 12%, rgba(56, 189, 248, 0.22), transparent 28%),
    linear-gradient(135deg, #0f172a 0%, #1e40af 100%);
  color: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.2);
}

.login-hero-card h1,
.tools-head h1 {
  margin: 0;
  font-size: 40px;
  line-height: 1.1;
}

.login-hero-card p,
.tools-head p {
  color: #dbeafe;
  font-size: 18px;
  font-weight: 850;
}

.tools-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: end;
  border-radius: var(--radius-xl);
  padding: 28px;
  background:
    radial-gradient(circle at 90% 12%, rgba(56, 189, 248, 0.28), transparent 26%),
    linear-gradient(135deg, #0f172a 0%, #1d4ed8 100%);
  color: #fff;
  box-shadow: var(--shadow-card);
}

.route-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.tools-grid button {
  display: grid;
  gap: 8px;
  min-height: 140px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  box-shadow: var(--shadow-soft);
}

.tools-grid strong {
  color: var(--accent-dark);
  font-size: 20px;
}

.tools-grid small {
  color: var(--muted);
  font-weight: 850;
}

.tool-page {
  min-height: 100vh;
  border-radius: var(--radius-xl);
  background: #f6f8fc;
  padding: 16px;
}

.tool-header {
  background: linear-gradient(135deg, #0f172a, #1d4ed8);
  color: white;
  border-radius: 24px;
  padding: 24px;
  margin-bottom: 16px;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.tool-card {
  display: grid;
  gap: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  padding: 18px;
  background: white;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

.tool-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 24px;
  font-weight: 900;
}

.tool-card-title {
  font-size: 22px;
  font-weight: 900;
}

.tool-card small {
  color: var(--muted);
  font-size: 16px;
  font-weight: 850;
}

.tool-workspace {
  display: grid;
  gap: 14px;
}

.tool-detail {
  display: grid;
  gap: 14px;
  border: 1px solid #e5e7eb;
  border-radius: 24px;
  padding: 20px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

.tool-detail h2 {
  margin: 0;
  font-size: 30px;
}

.tool-detail p,
.tool-detail summary,
.tool-detail details {
  color: var(--muted);
  font-size: 17px;
  font-weight: 850;
}

.tool-form-grid,
.tool-category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.tool-form-grid label {
  display: grid;
  gap: 6px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
}

.tool-input {
  min-height: 52px;
  border-radius: 14px;
  font-size: 18px;
}

.tool-result {
  display: block;
  min-height: 88px;
  white-space: pre-line;
  border: 1px solid #bbf7d0;
  border-radius: 18px;
  padding: 18px;
  background: #ecfdf5;
  color: #14532d;
  font-size: 20px;
  font-weight: 900;
}

.tool-button {
  min-height: 52px;
  border-radius: 14px;
  font-size: 17px;
  font-weight: 900;
}

.tool-actions,
.tool-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.topbar-user-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  background: #fff;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 900;
}

.is-app-route .dashboard-hero {
  padding: 24px;
  background: linear-gradient(135deg, #0f172a 0%, #1d4ed8 100%);
}

.is-app-route .dashboard-hero h1 {
  font-size: 34px;
}

.is-app-route .dashboard-hero p {
  max-width: 520px;
  font-size: 16px;
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.home-hero {
  border: 1px solid #cbd8e6;
  border-radius: 8px;
  padding: 22px;
  background: linear-gradient(135deg, #ffffff 0%, #eef7f1 100%);
  box-shadow: var(--shadow);
}

.home-hero h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.15;
}

.home-hero p {
  max-width: 760px;
  margin: 8px 0 0;
  color: #315445;
  font-size: 18px;
  font-weight: 800;
}

.home-section {
  display: grid;
  gap: 12px;
}

.dashboard-shell {
  display: grid;
  gap: 18px;
}

.dashboard-hero {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 22px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(191, 219, 254, 0.28);
  border-radius: var(--radius-xl);
  padding: 34px;
  background:
    radial-gradient(circle at 82% 10%, rgba(56, 189, 248, 0.38), transparent 24%),
    radial-gradient(circle at 12% 22%, rgba(96, 165, 250, 0.28), transparent 30%),
    linear-gradient(135deg, #0f172a 0%, #1d4ed8 56%, #38bdf8 100%);
  color: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
}

.dashboard-hero::after {
  content: "";
  position: absolute;
  right: -80px;
  bottom: -110px;
  width: 330px;
  height: 330px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  pointer-events: none;
}

.dashboard-hero h1 {
  max-width: 760px;
  margin: 0;
  font-size: 46px;
  line-height: 1.08;
  letter-spacing: 0;
}

.dashboard-hero p {
  max-width: 720px;
  margin: 14px 0 0;
  color: #dbeafe;
  font-size: 19px;
  font-weight: 800;
}

.dashboard-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.dashboard-meta span,
.roadmap-grid span {
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  padding: 7px 12px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 13px;
  font-weight: 900;
}

.hero-status-card {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: center;
  gap: 12px;
  width: min(320px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 22px;
  padding: 18px;
  background: rgba(15, 23, 42, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(12px);
}

.hero-status-card span {
  color: #bfdbfe;
  font-weight: 900;
}

.hero-status-card strong {
  font-size: 20px;
  line-height: 1.2;
}

.dashboard-project-switch {
  color: #fff;
  font-weight: 900;
}

.dashboard-project-switch select {
  margin-top: 6px;
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.92);
}

.dashboard-stat-grid,
.product-nav-grid,
.pricing-grid,
.export-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.dashboard-card,
.product-nav-grid button {
  position: relative;
  display: grid;
  align-content: space-between;
  gap: 10px;
  min-height: 164px;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: var(--radius-lg);
  padding: 20px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.product-nav-grid button {
  min-height: 132px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

.product-nav-grid button::after {
  content: "→";
  position: absolute;
  right: 16px;
  top: 14px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--soft-blue);
  color: var(--accent-dark);
  font-weight: 900;
}

.dashboard-card:hover,
.product-nav-grid button:hover,
.dashboard-task-grid button:hover {
  transform: translateY(-2px);
  box-shadow: 0 24px 50px rgba(15, 23, 42, 0.12);
}

.dashboard-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
  background: var(--accent);
}

.dashboard-card i {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: var(--soft-blue);
  color: var(--accent-dark);
  font-style: normal;
  font-weight: 900;
}

.dashboard-card strong {
  font-size: 36px;
  line-height: 1;
}

.dashboard-card em {
  color: var(--muted);
  font-size: 15px;
  font-style: normal;
}

.dashboard-card span,
.product-nav-grid strong {
  color: var(--accent-dark);
  font-size: 17px;
  font-weight: 900;
}

.dashboard-card small,
.product-nav-grid small {
  color: var(--muted);
  font-weight: 800;
}

.dashboard-card.normal {
  --accent: var(--green);
}

.dashboard-card.warning {
  --accent: var(--gold);
}

.dashboard-card.danger {
  --accent: var(--red);
}

.dashboard-grid,
.storage-grid,
.drawing-layout {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 18px;
}

.dashboard-panel,
.mock-card,
.export-card,
.pricing-card,
.provider-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  background: #fff;
  box-shadow: var(--shadow);
}

.dashboard-panel:nth-child(3) {
  grid-column: 1 / -1;
}

.dashboard-task-grid,
.risk-alert-list,
.activity-list,
.mock-card-list,
.provider-list {
  display: grid;
  gap: 10px;
}

.dashboard-task-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dashboard-task-grid button {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 122px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  color: var(--ink);
  text-align: left;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.dashboard-task-grid button span {
  justify-self: start;
  border-radius: 999px;
  padding: 4px 9px;
  background: var(--soft-blue);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 900;
}

.dashboard-task-grid button strong {
  font-size: 18px;
}

.dashboard-task-grid button small {
  color: var(--muted);
  font-weight: 800;
  line-height: 1.45;
}

.risk-alert {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-left: 0;
  border-radius: 18px;
  padding: 14px;
  background: #f8fafc;
}

.risk-alert.high {
  background: #fff7f7;
}

.risk-alert.medium {
  background: #fffbeb;
}

.risk-alert.low {
  background: #f0fdf4;
}

.risk-alert span {
  border-radius: 999px;
  padding: 5px 10px;
  background: var(--soft-blue);
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 900;
}

.risk-alert.high span {
  background: #fee2e2;
  color: #991b1b;
}

.risk-alert.medium span {
  background: #fef3c7;
  color: #92400e;
}

.risk-alert.low span {
  background: #dcfce7;
  color: #166534;
}

.risk-alert strong {
  display: block;
  font-size: 16px;
}

.risk-alert small {
  display: block;
  color: var(--muted);
  font-weight: 800;
}

.risk-alert .secondary {
  min-height: 40px;
  white-space: nowrap;
}

.risk-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.risk-summary-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-top: 5px solid var(--accent);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
  box-shadow: var(--shadow);
}

.risk-summary-card.danger {
  border-top-color: var(--red);
}

.risk-summary-card.warning {
  border-top-color: var(--gold);
}

.risk-summary-card.normal {
  border-top-color: var(--green);
}

.risk-summary-card span,
.risk-summary-card small {
  color: var(--muted);
  font-weight: 900;
}

.risk-summary-card strong {
  color: var(--ink);
  font-size: 34px;
  line-height: 1;
}

.internal-summary-grid {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.internal-feature-grid {
  margin-bottom: 16px;
}

.risk-filter-bar {
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  min-width: min(100%, 620px);
}

.risk-form {
  display: grid;
  gap: 14px;
}

.risk-form textarea {
  min-height: 100px;
}

.risk-register-list {
  display: grid;
  gap: 12px;
}

.risk-register-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-left: 6px solid var(--accent);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}

.risk-register-card.high {
  border-left-color: var(--red);
}

.risk-register-card.medium {
  border-left-color: var(--gold);
}

.risk-register-card.low {
  border-left-color: var(--green);
}

.risk-register-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.risk-register-head > div:first-child {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.risk-register-card > strong {
  color: var(--accent-dark);
  font-size: 21px;
}

.risk-register-card p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.55;
}

.risk-score {
  display: grid;
  min-width: 86px;
  place-items: center;
  border-radius: 8px;
  padding: 10px;
  background: #f8fafc;
}

.risk-score small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.risk-score strong {
  color: var(--ink);
  font-size: 30px;
  line-height: 1;
}

.risk-factor-grid,
.risk-method-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.risk-factor-grid span,
.risk-method-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #f8fafc;
  color: var(--muted);
  font-weight: 900;
}

.risk-factor-grid b {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 18px;
}

.risk-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.risk-controls span {
  border-radius: 999px;
  padding: 6px 10px;
  background: var(--soft-blue);
  color: var(--accent-dark);
  font-weight: 900;
}

.risk-status-select {
  width: min(180px, 100%);
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  color: var(--ink);
  font-weight: 900;
}

.risk-status-select:disabled {
  background: #f1f5f9;
  color: var(--muted);
}

.risk-method-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.risk-method-grid article strong {
  display: block;
  margin-bottom: 6px;
  color: var(--accent-dark);
}

.risk-method-grid article p {
  margin: 0;
  line-height: 1.55;
}

.activity-item {
  position: relative;
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 12px 12px 40px;
  background: #f8fafc;
}

.activity-item::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 16px;
  width: 12px;
  height: 12px;
  border: 3px solid #bfdbfe;
  border-radius: 999px;
  background: var(--accent);
}

.activity-item strong {
  color: var(--accent-dark);
  font-weight: 900;
}

.activity-item span {
  font-weight: 900;
}

.activity-item small {
  color: var(--muted);
  font-weight: 800;
}

.mock-filter-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.status-badge {
  display: inline-grid;
  min-height: 28px;
  place-items: center;
  border-radius: 999px;
  padding: 3px 10px;
  background: #eef2f6;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.status-badge.normal {
  background: var(--soft-green);
  color: var(--green);
}

.status-badge.info {
  background: var(--soft-blue);
  color: var(--accent-dark);
}

.status-badge.warning,
.status-badge.pending {
  background: var(--soft-gold);
  color: #945400;
}

.status-badge.danger {
  background: #fff0f0;
  color: var(--red);
}

.mock-table-wrap {
  overflow-x: auto;
}

.mock-table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
}

.mock-table th,
.mock-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px;
  text-align: left;
  vertical-align: top;
}

.mock-table th {
  background: var(--soft-blue);
  color: var(--accent-dark);
  font-weight: 900;
}

.drawing-preview-panel {
  position: sticky;
  top: 12px;
  align-self: start;
}

.drawing-preview-box {
  display: grid;
  place-items: center;
  min-height: 260px;
  border: 1px dashed #9cc9d9;
  border-radius: 8px;
  padding: 18px;
  background: #f4fbfe;
  text-align: center;
}

.drawing-preview-box.dwg {
  background: #f7f5fb;
  border-color: #b5a9cf;
}

.roadmap-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.roadmap-grid span {
  border-color: var(--line);
  background: #fff;
  color: var(--accent-dark);
}

.storage-meter {
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #e6edf5;
}

.storage-meter span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--green), #d88720);
}

.pricing-card h2,
.pricing-card strong,
.export-card strong {
  margin: 0;
  color: var(--accent-dark);
}

.pricing-card strong {
  font-size: 26px;
}

.pricing-card ul {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  font-weight: 800;
}

.notice,
.pricing-hero,
.custom-report-panel,
.risk-radar-placeholder {
  border-left: 6px solid var(--accent);
}

#homeView .user-login-section:not(.landing-login-card) {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.05);
}

#homeView .user-login-section:not(.landing-login-card) .user-login-panel {
  grid-template-columns: 1fr 1fr auto auto minmax(220px, 1fr);
  align-items: end;
}

#homeView .user-login-section:not(.landing-login-card) .user-login-panel output {
  align-self: center;
  color: var(--muted);
  font-weight: 900;
}

.simple-home-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.role-card.big-action {
  min-height: 240px;
}

.role-card.big-action strong {
  font-size: 26px;
}

.role-card.big-action small {
  font-size: 17px;
}

.home-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.home-flow article {
  display: grid;
  gap: 6px;
  border: 1px solid #cbd8e6;
  border-radius: 8px;
  padding: 14px;
  background: #fbfdff;
}

.home-flow strong {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 20px;
}

.home-flow span {
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
}

.home-flow small {
  color: var(--muted);
  font-weight: 800;
}

.role-mode-strip {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.6fr);
  align-items: center;
  gap: 12px;
  border: 1px solid #cbd8e6;
  border-left: 6px solid var(--accent);
  border-radius: 8px;
  padding: 14px;
  background: #fbfdff;
  box-shadow: var(--shadow);
}

.role-mode-strip strong,
.role-mode-strip small {
  display: block;
}

.role-mode-strip strong {
  color: var(--ink);
  font-size: 20px;
}

.role-mode-strip small {
  color: var(--muted);
  font-weight: 800;
  line-height: 1.45;
}

.role-mode-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.role-mode-chips button {
  min-height: 42px;
  border: 1px solid #cbd8e6;
  border-radius: 999px;
  padding: 8px 13px;
  background: #fff;
  color: var(--ink);
  font-weight: 900;
}

.role-mode-chips button.selected,
.role-mode-list button.selected,
.identity-card.selected {
  border-color: var(--accent);
  background: #eaf7fc;
  color: var(--accent-dark);
  box-shadow: inset 0 0 0 2px rgba(29, 111, 143, 0.16);
}

.identity-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.user-login-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: end;
  border: 1px solid #cbd8e6;
  border-left: 6px solid var(--accent);
  border-radius: 8px;
  padding: 14px;
  background: #fbfdff;
  box-shadow: var(--shadow);
}

.user-login-panel output {
  grid-column: 1 / -1;
  color: var(--muted);
  font-weight: 800;
}

.identity-card {
  display: grid;
  align-content: start;
  justify-items: start;
  min-height: 190px;
  padding: 20px;
  border: 1px solid var(--line);
  border-top: 6px solid var(--accent);
  background: #fff;
  color: var(--ink);
  text-align: left;
  box-shadow: var(--shadow);
}

.identity-card.worker {
  border-top-color: var(--green);
}

.identity-card.safety {
  border-top-color: var(--red);
}

.identity-card.supervisor {
  border-top-color: var(--accent);
}

.identity-card.course {
  border-top-color: #c15d7f;
}

.identity-card.backend {
  border-top-color: #475467;
}

.identity-card strong {
  margin-top: 14px;
  font-size: 22px;
  line-height: 1.2;
}

.identity-card small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 800;
}

.role-card {
  display: grid;
  align-content: start;
  justify-items: start;
  min-height: 240px;
  padding: 22px;
  border: 1px solid var(--line);
  border-top: 6px solid var(--accent);
  background: var(--panel);
  color: var(--ink);
  text-align: left;
  box-shadow: var(--shadow);
}

.role-card.supervisor {
  border-top-color: var(--accent);
}

.role-card.worker {
  border-top-color: var(--green);
}

.role-card.safety {
  border-top-color: var(--red);
}

.role-card.owner {
  border-top-color: var(--gold);
}

.role-card.schedule {
  border-top-color: #4568b2;
}

.role-card.material {
  border-top-color: #7a5cba;
}

.role-card.backend {
  border-top-color: #475467;
}

.role-card.course {
  border-top-color: #c15d7f;
}

.role-card.course-admin {
  border-top-color: #8b5cf6;
}

.role-card strong {
  margin-top: 18px;
  font-size: 26px;
  line-height: 1.2;
}

.role-card small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 17px;
  font-weight: 700;
}

.permission-fieldset {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.permission-fieldset label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fbfdff;
  font-weight: 900;
}

.role-icon {
  position: relative;
  width: 62px;
  height: 62px;
  border-radius: 14px;
  background: var(--soft-blue);
  border: 1px solid #c6dbe6;
}

.worker .role-icon {
  background: var(--soft-green);
  border-color: #bddccd;
}

.safety .role-icon {
  background: #fff0f0;
  border-color: #f0c0c0;
}

.owner .role-icon {
  background: var(--soft-gold);
  border-color: #efd7a9;
}

.schedule .role-icon,
.material .role-icon,
.backend .role-icon,
.course .role-icon,
.course-admin .role-icon {
  background: #eef2ff;
  border-color: #c7d2fe;
}

.icon-helmet::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 18px;
  width: 36px;
  height: 22px;
  border-radius: 24px 24px 7px 7px;
  background: var(--accent);
}

.icon-helmet::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  top: 38px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent-dark);
}

.icon-worker::before {
  content: "";
  position: absolute;
  left: 20px;
  top: 12px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--green);
}

.icon-worker::after {
  content: "";
  position: absolute;
  left: 14px;
  top: 36px;
  width: 34px;
  height: 16px;
  border-radius: 16px 16px 5px 5px;
  background: var(--green);
}

.icon-safety::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 12px;
  width: 26px;
  height: 36px;
  background: var(--red);
  clip-path: polygon(50% 0, 92% 16%, 84% 70%, 50% 100%, 16% 70%, 8% 16%);
}

.icon-safety::after {
  content: "";
  position: absolute;
  left: 25px;
  top: 30px;
  width: 13px;
  height: 7px;
  border-left: 4px solid #fff;
  border-bottom: 4px solid #fff;
  transform: rotate(-45deg);
}

.icon-sign::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 34px;
  width: 36px;
  height: 6px;
  border-radius: 999px;
  background: var(--gold);
  transform: rotate(-32deg);
}

.icon-sign::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 12px;
  bottom: 12px;
  height: 12px;
  border-bottom: 4px solid var(--gold);
  border-radius: 50%;
}

.icon-calendar::before {
  content: "";
  position: absolute;
  inset: 16px 13px 12px;
  border: 4px solid #4568b2;
  border-radius: 8px;
}

.icon-calendar::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  top: 28px;
  height: 4px;
  background: #4568b2;
  box-shadow: 0 10px 0 #4568b2;
}

.icon-box::before {
  content: "";
  position: absolute;
  inset: 18px 14px 14px;
  border: 4px solid #7a5cba;
  border-radius: 7px;
}

.icon-box::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  top: 28px;
  height: 4px;
  background: #7a5cba;
}

.icon-table::before {
  content: "";
  position: absolute;
  inset: 15px 13px;
  border: 4px solid #475467;
  border-radius: 6px;
}

.icon-table::after {
  content: "";
  position: absolute;
  left: 20px;
  right: 20px;
  top: 27px;
  height: 4px;
  background: #475467;
  box-shadow: 0 10px 0 #475467;
}

.icon-course::before {
  content: "";
  position: absolute;
  left: 17px;
  top: 13px;
  width: 28px;
  height: 34px;
  border: 4px solid #c15d7f;
  border-radius: 5px;
  background: #fff;
}

.icon-course::after {
  content: "";
  position: absolute;
  left: 25px;
  top: 24px;
  width: 18px;
  height: 4px;
  border-radius: 999px;
  background: #c15d7f;
  box-shadow: 0 9px 0 #c15d7f;
}

.icon-course-admin::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 16px;
  width: 36px;
  height: 30px;
  border: 4px solid #8b5cf6;
  border-radius: 8px;
}

.icon-course-admin::after {
  content: "";
  position: absolute;
  left: 21px;
  top: 26px;
  width: 20px;
  height: 4px;
  border-radius: 999px;
  background: #8b5cf6;
  box-shadow: 0 8px 0 #8b5cf6;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.notice-panel {
  display: grid;
  gap: 4px;
  border: 1px solid #bddccd;
  border-left: 6px solid var(--green);
  border-radius: 8px;
  padding: 14px 16px;
  background: var(--soft-green);
}

.notice-panel strong {
  color: #1f5f4a;
  font-size: 18px;
}

.notice-panel span {
  color: #315445;
  font-weight: 700;
}

.summary-strip div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--panel);
}

.summary-strip span {
  display: block;
  font-size: 30px;
  font-weight: 900;
  color: var(--accent-dark);
}

.summary-strip small {
  color: var(--muted);
  font-weight: 800;
}

.view[hidden],
.home-view[hidden],
.home-section[hidden],
.role-card[hidden],
.no-print[hidden],
#recordPreview[hidden],
#emptyRecord[hidden] {
  display: none;
}

.view-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--accent-dark);
  font-weight: 900;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 30px;
  line-height: 1.2;
}

h2 {
  font-size: 22px;
}

.panel,
.print-sheet {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--panel);
  box-shadow: 0 1px 2px rgba(19, 34, 56, 0.04);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.wide {
  grid-column: 1 / -1;
}

label,
.option-fieldset legend {
  display: grid;
  gap: 7px;
  color: #243047;
  font-size: 17px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid #c7d0dd;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
  font-size: 18px;
}

textarea {
  resize: vertical;
}

.required,
.hint {
  color: var(--red);
  font-size: 13px;
  font-weight: 900;
}

.hint {
  color: var(--muted);
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-title span {
  color: var(--muted);
  font-weight: 800;
}

#referencePathLabel {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.reference-path-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 9px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.reference-path-chip.current {
  border-color: #b7d8e5;
  background: var(--soft-blue);
  color: var(--accent-dark);
}

.project-list {
  display: grid;
  gap: 12px;
}

.project-card {
  display: grid;
  gap: 10px;
  border: 1px solid #cbd8e6;
  border-radius: 8px;
  padding: 14px;
  background: #fbfdff;
}

.project-card strong {
  display: block;
  font-size: 20px;
}

.project-card small,
.project-card p {
  color: var(--muted);
  font-weight: 700;
}

.project-context,
.backend-summary,
.cloud-status,
.file-preview,
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.project-context div,
.backend-summary div,
.cloud-status div,
.file-preview div,
.detail-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f9fbfe;
}

.project-context strong,
.backend-summary strong,
.cloud-status strong,
.file-preview strong,
.detail-grid dt {
  display: block;
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
}

.project-context span,
.backend-summary span,
.cloud-status span,
.file-preview span,
.detail-grid dd {
  display: block;
  margin: 4px 0 0;
  font-weight: 800;
  white-space: pre-wrap;
}

.checkin-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  border: 1px solid #cbd8e6;
  border-radius: 8px;
  padding: 12px;
  background: #fbfdff;
}

.checkin-row output {
  color: var(--muted);
  font-weight: 800;
}

.option-fieldset {
  border: 1px solid #cbd8e6;
  border-radius: 8px;
  padding: 14px;
}

.work-option-list,
.safety-option-list,
.batch-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.batch-list label {
  justify-content: space-between;
}

.batch-list span {
  flex: 1 1 auto;
}

.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  border: 1px solid var(--line);
  padding: 10px;
  text-align: left;
}

.admin-table th {
  background: #eef2f7;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.table-actions button {
  min-height: 40px;
  padding: 0 12px;
}

.admin-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-color: #b9d7e5;
  background: linear-gradient(135deg, #f6fbfd 0%, #eef8fb 100%);
}

.admin-hero h2 {
  margin: 0 0 6px;
  color: var(--accent-dark);
  font-size: 26px;
}

.admin-hero p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.6;
}

.admin-hero > span {
  flex: 0 0 auto;
  border: 1px solid #acd3e5;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  color: var(--accent-dark);
  font-weight: 900;
}

.admin-shortcuts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.admin-shortcut {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  gap: 2px 12px;
  min-height: 94px;
  border: 1px solid #cbd8e6;
  border-radius: 8px;
  padding: 14px;
  background: var(--panel);
  color: var(--ink);
  text-align: left;
  box-shadow: var(--shadow);
}

.admin-shortcut .role-icon {
  grid-row: 1 / span 2;
  width: 58px;
  height: 58px;
}

.admin-shortcut strong {
  font-size: 20px;
}

.admin-shortcut small {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.admin-shortcut:active {
  transform: translateY(1px);
}

.master-data-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.master-data-panel {
  align-content: start;
}

.personnel-panel {
  margin-bottom: 14px;
}

.personnel-list {
  margin-top: 12px;
}

.person-card {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.master-list {
  display: grid;
  gap: 8px;
  max-height: 320px;
  overflow: auto;
}

.master-card {
  display: grid;
  gap: 8px;
  border: 1px solid #d6e0ea;
  border-radius: 8px;
  padding: 10px;
  background: #f8fbff;
}

.master-card strong,
.master-card small {
  display: block;
}

.master-card small {
  color: var(--muted);
  font-weight: 800;
  line-height: 1.45;
}

.admin-hub-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.admin-hub-card {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 10px;
  min-height: 240px;
  border: 1px solid #cbd8e6;
  border-top: 7px solid var(--accent);
  border-radius: 8px;
  padding: 24px;
  background: var(--panel);
  color: var(--ink);
  text-align: center;
  box-shadow: var(--shadow);
}

.admin-hub-card.course-admin {
  border-top-color: #8b5cf6;
}

.admin-hub-card.personnel-admin {
  border-top-color: var(--green);
}

.admin-hub-card .role-icon {
  width: 88px;
  height: 88px;
}

.admin-hub-card strong {
  font-size: 30px;
}

.admin-hub-card small {
  max-width: 320px;
  color: var(--muted);
  font-size: 17px;
  font-weight: 800;
  line-height: 1.45;
}

.admin-hub-card:active {
  transform: translateY(1px);
}

.admin-layout,
.course-admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 14px;
  align-items: start;
}

.admin-overview-panel,
.admin-cloud-panel,
.admin-data-panel,
.course-editor-panel,
.course-list-panel {
  min-width: 0;
}

.admin-cloud-panel .cloud-status {
  grid-template-columns: 1fr;
}

.course-admin-hero {
  border-color: #ead3df;
  background: linear-gradient(135deg, #fff8fb 0%, #f8f3ff 100%);
}

.course-admin-hero h2,
.course-admin-hero > span {
  color: #8b3b63;
}

.course-admin-hero > span {
  border-color: #e5c3d3;
}

.course-manage-list {
  max-height: 620px;
  overflow: auto;
  padding-right: 4px;
}

.schedule-overview .section-title {
  align-items: flex-start;
}

.schedule-summary {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.schedule-summary-day {
  display: grid;
  gap: 8px;
  min-height: 168px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfdff;
}

.schedule-summary-day > div {
  display: grid;
  gap: 2px;
}

.schedule-summary-day strong {
  color: var(--accent-dark);
  font-size: 18px;
}

.schedule-summary-day span,
.schedule-summary-day p,
.schedule-summary-day small {
  color: var(--muted);
  font-weight: 800;
}

.schedule-summary-day b {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 8px;
  background: var(--soft-green);
  color: #1f5f4a;
  font-size: 24px;
}

.schedule-summary-day ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.schedule-summary-day li {
  display: grid;
  gap: 2px;
  border-radius: 6px;
  padding: 7px;
  background: var(--soft-blue);
}

.schedule-summary-day li span {
  color: var(--accent-dark);
}

.material-overview .section-title {
  align-items: flex-start;
}

.compact-filter {
  width: min(260px, 100%);
  font-size: 14px;
}

.compact-filter select {
  min-height: 42px;
  font-size: 16px;
}

.material-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.material-summary-card {
  display: grid;
  gap: 6px;
  min-height: 92px;
  align-content: center;
  justify-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfdff;
  color: var(--ink);
  text-align: left;
}

.material-summary-card.selected {
  border-color: var(--accent);
  background: #f2fbff;
  box-shadow: inset 0 0 0 2px rgba(29, 111, 143, 0.18);
}

.material-summary-card strong {
  color: var(--muted);
  font-size: 15px;
}

.material-summary-card span {
  color: var(--accent-dark);
  font-size: 30px;
  font-weight: 900;
}

.reference-calc-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.8fr) minmax(0, 0.8fr);
  gap: 10px;
}

.reference-calc-grid.is-hidden {
  display: none;
}

.wire-search-panel {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.wire-search-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.wire-search-results {
  display: grid;
  gap: 10px;
}

.reference-calculator-buttons {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
}

.calculator-button-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.calculator-button-group summary {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  cursor: pointer;
  padding: 0 44px 0 14px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
  list-style: none;
}

.calculator-button-group summary::-webkit-details-marker {
  display: none;
}

.calculator-button-group summary::after {
  content: "+";
  position: absolute;
  right: 14px;
  color: var(--accent-dark);
  font-size: 23px;
  line-height: 1;
}

.calculator-button-group[open] summary::after {
  content: "−";
}

.calculator-button-group summary span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.frequent-calculator-group > strong {
  color: var(--accent-dark);
}

.frequent-calculator-group .calculator-choice {
  border-color: #9cc8d7;
  background: #f2fbfd;
}

.recent-calculator-group > strong {
  color: var(--green);
}

.recent-calculator-group .calculator-choice {
  border-color: #b9d9c6;
  background: #f4fbf6;
}

.calculator-button-group > div {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
  padding: 0 10px 10px;
}

.calculator-choice {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
  font-weight: 900;
  text-align: left;
}

.calculator-choice.active {
  border-color: var(--accent);
  background: var(--soft-blue);
  color: var(--accent-dark);
}

.reference-calculator-select {
  grid-column: 1 / -1;
}

.reference-result-grid {
  grid-template-columns: 1fr;
}

.reference-hit {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 10px;
  min-height: 72px;
  border: 1px solid var(--line);
  border-left: 6px solid var(--accent);
  border-radius: 8px;
  padding: 12px 14px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  box-shadow: none;
}

.reference-hit span {
  align-self: start;
  border-radius: 999px;
  padding: 3px 8px;
  background: var(--soft-blue);
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 900;
}

.reference-hit strong {
  min-width: 0;
  overflow: hidden;
  font-size: 20px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reference-hit small {
  grid-column: 2;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.reference-hit.selected {
  border-color: var(--accent);
  background: #f2fbff;
  box-shadow: inset 0 0 0 2px rgba(29, 111, 143, 0.12);
}

.reference-selected-detail {
  display: grid;
  gap: 12px;
}

.reference-dialog {
  width: min(820px, calc(100vw - 24px));
}

.reference-dialog .dialog-head strong {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-height: 1.25;
}

.reference-dialog .dialog-head button {
  flex: 0 0 auto;
}

.reference-dialog .reference-card {
  box-shadow: none;
}

.reference-category-grid,
.reference-sub-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.reference-recent-panel {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8fbfd;
}

.reference-recent-panel[hidden] {
  display: none !important;
}

.reference-recent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
}

.reference-recent-card {
  display: grid;
  gap: 4px;
  min-height: 76px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.reference-recent-card.favorite {
  border-color: #d7b45a;
  border-left-color: #c89418;
  background: #fffaf0;
}

.reference-recent-card.recommended {
  border-left-color: #277b65;
  background: #f7fcf9;
}

.reference-recent-card span {
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 900;
}

.reference-recent-card strong {
  overflow: hidden;
  font-size: 17px;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  white-space: normal;
}

.reference-recent-card small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.reference-clear-recent {
  min-height: 36px;
  padding: 0 12px;
  font-size: 13px;
}

.reference-favorite-toggle {
  justify-self: start;
  min-height: 38px;
  border: 1px solid #d7b45a;
  border-radius: 999px;
  padding: 0 16px;
  background: #fffaf0;
  color: #7a5410;
  font-size: 15px;
  font-weight: 900;
}

.reference-favorite-toggle.selected {
  background: #7a5410;
  color: #fff;
}

.reference-pick-card {
  display: grid;
  gap: 8px;
  min-height: 132px;
  border: 1px solid var(--accent);
  border-left: 7px solid var(--accent);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  box-shadow: var(--shadow);
}

.reference-pick-card.selected,
.reference-pick-card:focus-visible {
  background: #eaf7fc;
  color: var(--accent-dark);
}

.reference-pick-card strong {
  font-size: 24px;
  line-height: 1.2;
}

.reference-pick-card small,
.reference-pick-card span {
  color: var(--muted);
  font-weight: 800;
}

.reference-sub-panel,
.reference-detail-panel {
  display: grid;
  gap: 14px;
}

.reference-bottom-nav {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.reference-page[hidden] {
  display: none !important;
}

.reference-result-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.reference-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-top: 6px solid var(--accent);
  border-radius: 8px;
  padding: 18px;
  background: #fff;
  box-shadow: var(--shadow);
}

.reference-card .status-pill {
  position: static;
  display: inline-grid;
  min-height: 30px;
  margin-right: 6px;
  padding: 4px 10px;
}

.reference-card h2 {
  margin: 0;
  font-size: 22px;
}

.reference-card p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.law-guide {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.law-guide > div {
  display: grid;
  gap: 6px;
  min-height: 96px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8fbfd;
}

.law-guide span {
  color: var(--accent-dark);
  font-size: 14px;
  font-weight: 900;
}

.law-guide p {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
}

.law-keywords {
  grid-column: 1 / -1;
  min-height: auto !important;
}

.law-keywords p {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.law-keywords b {
  border-radius: 999px;
  padding: 5px 10px;
  background: var(--soft-blue);
  color: var(--accent-dark);
  font-size: 14px;
}

.reference-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  -webkit-overflow-scrolling: touch;
  scrollbar-color: var(--accent) #eaf2f6;
  scrollbar-width: thin;
}

.reference-table-wrap::before {
  content: "表格可左右滑動";
  display: none;
  padding: 8px 10px;
  background: #f2fbff;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 900;
}

.reference-table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  background: #fff;
  font-size: 15px;
}

.reference-section-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.reference-section-actions .secondary {
  min-height: 40px;
  padding: 0 14px;
}

.reference-card-bottom-actions {
  justify-content: flex-end;
  padding-top: 4px;
}

.reference-table th,
.reference-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

.reference-table th {
  background: var(--soft-blue);
  color: var(--accent-dark);
  font-weight: 900;
  white-space: nowrap;
}

.reference-table td:first-child {
  color: var(--ink);
  font-weight: 900;
  white-space: nowrap;
}

.reference-table tr:last-child td {
  border-bottom: 0;
}

.reference-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.reference-section summary {
  display: grid;
  position: relative;
  gap: 4px;
  cursor: pointer;
  padding: 13px 16px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
  list-style: none;
}

.reference-section summary::-webkit-details-marker {
  display: none;
}

.reference-section summary::after {
  content: "+";
  position: absolute;
  right: 16px;
  margin-top: 0;
  color: var(--accent-dark);
  font-size: 24px;
  line-height: 1;
}

.reference-section[open] summary::after {
  content: "−";
}

.reference-section summary span {
  color: var(--ink);
  padding-right: 34px;
}

.reference-section summary small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
  padding-right: 34px;
}

.reference-section-content {
  padding: 0 12px 12px;
}

.reference-link {
  display: inline-grid;
  min-height: 44px;
  place-items: center;
  justify-self: start;
  border-radius: 8px;
  padding: 0 14px;
  background: var(--soft-blue);
  color: var(--accent-dark);
  font-weight: 900;
  text-decoration: none;
}

.reference-link-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.reference-calc-result {
  display: grid;
  min-height: 58px;
  align-items: center;
  border: 1px solid #bddccd;
  border-radius: 8px;
  padding: 12px 16px;
  background: var(--soft-green);
  color: var(--green);
  font-size: 24px;
  font-weight: 900;
}

.reference-calc-output {
  display: grid;
  gap: 8px;
}

.reference-calc-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.reference-calc-actions .secondary {
  min-height: 42px;
}

.material-card {
  position: relative;
  padding-right: 116px;
}

.project-management-card {
  position: relative;
  padding-right: 116px;
}

.status-pill {
  position: absolute;
  top: 14px;
  right: 14px;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 14px;
  font-weight: 900;
}

.status-pending {
  background: var(--soft-gold);
  color: #87510e;
}

.status-ordered {
  background: var(--soft-blue);
  color: var(--accent-dark);
}

.status-done {
  background: var(--soft-green);
  color: #1f5f4a;
}

.status-cancelled {
  background: #f2f4f7;
  color: #475467;
}

.material-status-control {
  max-width: 260px;
}

.material-status-control select {
  min-height: 42px;
  font-size: 16px;
}

.sign-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.sign-summary-card {
  display: grid;
  gap: 6px;
  min-height: 92px;
  align-content: center;
  justify-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfdff;
  color: var(--ink);
  text-align: left;
}

.sign-summary-card.selected {
  border-color: var(--accent);
  background: #f2fbff;
  box-shadow: inset 0 0 0 2px rgba(29, 111, 143, 0.18);
}

.sign-summary-card strong {
  color: var(--muted);
  font-size: 15px;
}

.sign-summary-card span {
  color: var(--accent-dark);
  font-size: 30px;
  font-weight: 900;
}

.backend-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.backend-overview article {
  display: grid;
  gap: 5px;
  min-height: 118px;
  align-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfdff;
}

.backend-overview strong {
  color: var(--muted);
  font-size: 15px;
}

.backend-overview span {
  color: var(--accent-dark);
  font-size: 32px;
  font-weight: 900;
}

.backend-overview small {
  color: var(--muted);
  font-weight: 800;
}

.project-dashboard {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.task-center {
  display: grid;
  gap: 10px;
}

.task-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid #d6e0ea;
  border-left: 6px solid var(--accent);
  border-radius: 8px;
  padding: 12px;
  background: #fbfdff;
}

.task-card.task-urgent {
  border-left-color: #d94848;
  background: #fffafa;
}

.task-card.task-warning {
  border-left-color: #d98b2b;
  background: #fffaf1;
}

.task-card.task-info {
  border-left-color: #2f7ea1;
}

.task-card strong,
.task-card small {
  display: block;
}

.task-card strong {
  color: var(--ink);
  font-size: 18px;
}

.task-card small {
  color: var(--muted);
  font-weight: 800;
  line-height: 1.45;
}

.assignment-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.assignment-card {
  position: relative;
  display: grid;
  gap: 8px;
  border: 1px solid #d6e0ea;
  border-radius: 8px;
  padding: 12px;
  background: #fbfdff;
}

.assignment-card strong,
.assignment-card small,
.assignment-card p {
  display: block;
}

.assignment-card strong {
  color: var(--ink);
  font-size: 18px;
}

.assignment-card small,
.assignment-card p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.45;
}

.project-dashboard-card {
  display: grid;
  gap: 12px;
  border: 1px solid #cbd8e6;
  border-left: 6px solid var(--accent);
  border-radius: 8px;
  padding: 14px;
  background: #fbfdff;
  box-shadow: var(--shadow);
}

.project-dashboard-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.project-dashboard-card strong,
.project-dashboard-card small,
.project-dashboard-card p {
  display: block;
}

.project-dashboard-card strong {
  color: var(--ink);
  font-size: 20px;
}

.project-dashboard-card small,
.project-dashboard-card p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.5;
}

.project-dashboard-meta,
.project-dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.project-dashboard-meta div,
.project-dashboard-metrics div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px;
  background: #fff;
}

.project-dashboard-meta dt,
.project-dashboard-meta dd {
  margin: 0;
}

.project-dashboard-meta dt,
.project-dashboard-metrics small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.project-dashboard-meta dd {
  color: var(--ink);
  font-weight: 900;
}

.project-dashboard-metrics span {
  display: block;
  color: var(--accent-dark);
  font-size: 26px;
  font-weight: 900;
}

.course-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.course-summary-card {
  display: grid;
  gap: 6px;
  min-height: 92px;
  align-content: center;
  justify-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfdff;
  color: var(--ink);
  text-align: left;
}

.course-summary-card.selected {
  border-color: #c15d7f;
  background: #fff6fa;
  box-shadow: inset 0 0 0 2px rgba(193, 93, 127, 0.16);
}

.course-summary-card strong {
  color: var(--muted);
  font-size: 15px;
}

.course-summary-card span {
  color: #9b3f61;
  font-size: 30px;
  font-weight: 900;
}

.course-record-card {
  position: relative;
  padding-right: 116px;
}

.student-sign-panel {
  border: 1px solid #efd7e2;
  border-radius: 8px;
  padding: 14px;
  background: #fff8fb;
}

.student-sign-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.student-sign-button {
  display: grid;
  gap: 4px;
  min-height: 78px;
  align-content: center;
  justify-items: start;
  border: 1px solid #efd7e2;
  border-radius: 8px;
  padding: 12px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.student-sign-button strong {
  font-size: 20px;
}

.student-sign-button span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
}

.student-sign-button.selected {
  border-color: #28785f;
  background: var(--soft-green);
}

.student-sign-button.selected span {
  color: #1f5f4a;
}

.batch-list .status-pill {
  position: static;
  width: fit-content;
  white-space: nowrap;
}

.status-returned {
  background: #fff0f0;
  color: var(--red);
}

.status-tracked {
  background: #eef2ff;
  color: #4568b2;
}

.schedule-calendar {
  display: grid;
  gap: 10px;
}

.calendar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 22px;
  font-weight: 900;
  color: var(--accent-dark);
}

.calendar-head strong {
  flex: 1;
  text-align: center;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.calendar-weekdays span {
  padding: 8px;
  border-radius: 6px;
  background: #eef2f7;
  color: var(--muted);
  text-align: center;
  font-weight: 900;
}

.calendar-day {
  min-height: 112px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.calendar-day.muted {
  background: #f6f8fb;
  cursor: default;
}

.calendar-day.selected {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 2px rgba(29, 111, 143, 0.22);
  background: #f2fbff;
}

.calendar-day:hover:not(.muted) {
  border-color: var(--accent);
  background: #f8fcff;
}

.calendar-day > strong {
  display: block;
  margin-bottom: 6px;
  color: var(--accent-dark);
}

.calendar-entry {
  display: grid;
  gap: 2px;
  border-radius: 6px;
  padding: 6px;
  margin-top: 5px;
  background: var(--soft-blue);
  color: var(--accent-dark);
  font-weight: 800;
}

.calendar-entry small {
  color: var(--muted);
  font-weight: 900;
}

.schedule-week-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8fafc;
  font-weight: 900;
}

.schedule-week-head span {
  color: var(--accent-dark);
}

.schedule-week-sliders {
  display: grid;
  gap: 10px;
}

.week-slider {
  display: grid;
  grid-template-columns: 120px minmax(120px, 1fr) 68px;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.week-slider span {
  display: grid;
  gap: 2px;
}

.week-slider small {
  color: var(--muted);
  font-weight: 800;
}

.week-slider input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.week-slider output {
  font-weight: 900;
  color: var(--accent-dark);
  text-align: right;
}

.detail-dialog {
  width: min(920px, calc(100% - 24px));
  max-height: 88vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  -webkit-overflow-scrolling: touch;
}

.detail-dialog::backdrop {
  background: rgba(16, 24, 40, 0.42);
}

.dialog-head {
  position: sticky;
  top: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.role-mode-dialog {
  width: min(720px, calc(100% - 24px));
}

.role-mode-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 16px;
}

.role-mode-list button {
  display: grid;
  gap: 6px;
  justify-items: start;
  min-height: 92px;
  border: 1px solid #cbd8e6;
  border-radius: 8px;
  padding: 14px;
  background: #fbfdff;
  color: var(--ink);
  text-align: left;
}

.role-mode-list button.selected {
  border-color: var(--accent);
  background: #f2fbff;
  box-shadow: inset 0 0 0 2px rgba(29, 111, 143, 0.16);
}

.role-mode-list strong,
.role-mode-list small {
  display: block;
}

.role-mode-list strong {
  font-size: 20px;
}

.role-mode-list small {
  color: var(--muted);
  font-weight: 800;
  line-height: 1.45;
}

#recordDialogContent {
  padding: 16px;
}

#projectDetailContent {
  padding: 16px;
}

.project-detail-body {
  display: grid;
  gap: 14px;
}

.project-detail-summary {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 12px;
}

.project-detail-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.project-detail-metrics.compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.project-detail-metrics article {
  display: grid;
  gap: 4px;
  align-content: center;
  min-height: 82px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfdff;
}

.project-detail-metrics strong {
  color: var(--accent-dark);
  font-size: 28px;
  font-weight: 900;
}

.project-detail-metrics span {
  color: var(--muted);
  font-weight: 900;
}

.project-detail-section {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.project-detail-section h3 {
  margin: 0;
  color: var(--accent-dark);
  font-size: 20px;
}

.project-detail-list {
  display: grid;
  gap: 8px;
}

.project-detail-item {
  position: relative;
  display: grid;
  gap: 8px;
  border: 1px solid #d6e0ea;
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.project-detail-item strong,
.project-detail-item small,
.project-detail-item p {
  display: block;
}

.project-detail-item strong {
  color: var(--ink);
  font-size: 17px;
}

.project-detail-item small,
.project-detail-item p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.5;
}

.record-print {
  margin-bottom: 20px;
}

.daily-print-group {
  break-after: page;
}

.work-option-list label,
.safety-option,
.batch-list label {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.work-option-list input,
.safety-option input,
.batch-list input {
  width: 24px;
  min-height: 24px;
  accent-color: var(--accent);
}

.batch-list label {
  align-items: flex-start;
}

.batch-list span {
  display: grid;
  gap: 3px;
}

.batch-list small {
  color: var(--muted);
  font-weight: 700;
}

.safety-option {
  align-items: flex-start;
}

.safety-option span {
  display: grid;
  gap: 3px;
}

.safety-option small {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.safety-reminder {
  display: grid;
  gap: 12px;
  border: 1px solid #f0c0c0;
  border-radius: 8px;
  padding: 14px;
  background: #fffafa;
}

.safety-reminder article {
  display: grid;
  gap: 8px;
}

.safety-reminder ul,
.print-safety-plan ul {
  margin: 0;
  padding-left: 22px;
}

.safety-reminder p,
.print-safety-plan p {
  color: var(--muted);
  font-weight: 700;
}

.photo-panel {
  border: 1px solid #cbd8e6;
  border-radius: 8px;
  padding: 14px;
  background: #fbfdff;
}

.signature-panel {
  display: grid;
  gap: 10px;
  border: 1px solid #cbd8e6;
  border-radius: 8px;
  padding: 14px;
  background: #fbfdff;
}

.signature-panel canvas {
  width: 100%;
  height: 180px;
  border: 1px dashed #93a8bf;
  border-radius: 8px;
  background: #fff;
  touch-action: none;
}

.signature-panel output {
  color: var(--muted);
  font-weight: 800;
}

.signature-dialog {
  width: min(760px, calc(100% - 24px));
}

.signature-pad-panel {
  display: grid;
  gap: 12px;
}

.signature-pad-panel canvas {
  width: 100%;
  height: min(320px, 46vh);
  border: 2px solid #9fb2c8;
  border-radius: 8px;
  background: #fff;
  touch-action: none;
}

.signature-pad-panel output {
  color: var(--muted);
  font-weight: 900;
}

.photo-grid,
.photo-print-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.photo-slot {
  position: relative;
  display: grid;
  gap: 10px;
  min-height: 220px;
  align-content: center;
  justify-items: center;
  border: 1px dashed #93a8bf;
  border-radius: 8px;
  padding: 14px;
  background: #fff;
  color: var(--muted);
  text-align: center;
}

.photo-slot input {
  border: 0;
  min-height: auto;
  padding: 0;
}

.photo-slot img {
  display: none;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.photo-slot.has-image {
  align-content: start;
  border-style: solid;
  border-color: var(--accent);
  background: var(--soft-blue);
}

.photo-slot.has-image img {
  display: block;
}

.remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 34px;
  min-height: 34px;
  border-radius: 50%;
  padding: 0;
  background: #fff0f0;
  color: var(--red);
  font-size: 22px;
}

.print-sheet {
  box-shadow: var(--shadow);
}

.print-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--accent);
  margin-bottom: 14px;
}

.print-title h2 {
  font-size: 28px;
}

.print-title span {
  border-radius: 999px;
  padding: 6px 12px;
  background: var(--soft-gold);
  color: #87510e;
  font-weight: 900;
}

.print-section {
  margin-top: 16px;
}

.print-section h3 {
  margin-bottom: 8px;
  color: var(--accent-dark);
  font-size: 19px;
}

.print-section p,
.print-section li {
  white-space: pre-wrap;
  font-size: 17px;
}

.photo-print-grid figure {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.photo-print-grid img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 6px;
}

.photo-print-grid figcaption {
  margin-top: 6px;
  color: var(--muted);
  font-weight: 700;
}

.signature-print {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.signature-print img {
  display: block;
  width: 100%;
  max-height: 150px;
  object-fit: contain;
}

.empty-state {
  border: 1px dashed #99abc0;
  border-radius: 8px;
  padding: 28px 16px;
  background: #fbfdff;
  color: var(--muted);
  text-align: center;
  font-weight: 900;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 10;
  transform: translateX(-50%);
  width: min(420px, calc(100% - 32px));
  border-radius: 8px;
  padding: 13px 16px;
  background: #142033;
  color: #fff;
  text-align: center;
  font-weight: 900;
  box-shadow: var(--shadow);
}

.busy-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.32);
}

.busy-box {
  display: grid;
  justify-items: center;
  gap: 10px;
  width: min(360px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  background: #fff;
  color: var(--ink);
  text-align: center;
  box-shadow: var(--shadow);
}

.busy-box strong {
  font-size: 18px;
}

.busy-box small {
  color: var(--muted);
  font-weight: 800;
}

.busy-spinner {
  width: 34px;
  height: 34px;
  border: 4px solid #d9e4ee;
  border-top-color: var(--accent);
  border-radius: 999px;
  animation: busy-spin 0.8s linear infinite;
}

@keyframes busy-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 760px) {
  .app {
    padding: 12px 12px 96px;
  }

  .topbar,
  .view-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-actions,
  .top-actions > *,
  .topbar-status,
  .role-mode-button,
  .view-head .secondary {
    width: 100%;
  }

  .topbar-status {
    margin-left: 0;
    justify-content: space-between;
  }

  .home-grid,
    .identity-grid,
    .user-login-panel,
    .simple-home-grid,
    .primary-home-grid,
    .home-flow,
    .summary-strip,
    .role-mode-strip,
    .form-grid,
  .project-context,
  .backend-summary,
  .cloud-status,
    .file-preview,
    .detail-grid,
    .schedule-summary,
    .material-summary,
    .reference-calc-grid,
    .reference-category-grid,
    .reference-sub-grid,
    .reference-result-grid,
    .landing-hero,
    .landing-side-stack,
    .free-tool-feature,
    .landing-pricing-cta,
    .landing-value-grid,
    .login-hero-card,
    .bootstrap-admin-entry,
    .tools-head,
    .tools-grid,
    .tool-grid,
    .tool-form-grid,
    .tool-category-grid,
    .dashboard-stat-grid,
    .product-nav-grid,
    .dashboard-grid,
    .dashboard-task-grid,
    .mock-filter-bar,
    .risk-summary-grid,
    .risk-filter-bar,
    .risk-factor-grid,
    .risk-method-grid,
    .storage-grid,
    .drawing-layout,
    .pricing-grid,
    .export-grid,
    .sign-summary,
    .backend-overview,
    .task-card,
    .project-dashboard,
    .project-dashboard-meta,
    .project-dashboard-metrics,
    .project-detail-summary,
    .project-detail-metrics,
    .role-mode-list,
    .master-data-grid,
    .admin-hub-grid,
    .admin-shortcuts,
    .admin-layout,
    .course-admin-layout,
    .course-summary,
    .student-sign-list,
    .work-option-list,
    .safety-option-list,
    .permission-fieldset,
    .batch-list,
  .photo-grid,
  .photo-print-grid {
    grid-template-columns: 1fr;
  }

  .role-mode-chips {
    justify-content: flex-start;
  }

  .role-mode-chips button {
    flex: 1 1 calc(50% - 8px);
  }

  .home-hero {
    padding: 18px;
  }

  .home-hero h1 {
    font-size: 30px;
  }

  .landing-copy {
    min-height: auto;
    padding: 28px 22px;
  }

  .landing-copy h1 {
    font-size: 36px;
  }

  .landing-copy p {
    font-size: 18px;
  }

  .landing-copy > span {
    border-radius: 18px;
  }

  .landing-login-card {
    padding: 18px;
  }

  .landing-cta-row button,
  .landing-side-card button,
  .route-actions button {
    width: 100%;
  }

  .landing-value-grid.four-up {
    grid-template-columns: 1fr;
  }

  .login-hero-card,
  .tools-head {
    padding: 20px;
  }

  .login-hero-card h1,
  .tools-head h1 {
    font-size: 32px;
  }

  .route-actions {
    justify-content: stretch;
  }

  .tool-page {
    padding: 10px;
  }

  .tool-detail h2 {
    font-size: 26px;
  }

  .tool-actions,
  .tool-tabs {
    display: grid;
    grid-template-columns: 1fr;
  }

  .tool-button,
  .tool-actions button,
  .tool-tabs button {
    width: 100%;
  }

  .free-tool-feature,
  .landing-pricing-cta {
    align-items: stretch;
  }

  .free-tool-feature button,
  .landing-pricing-cta button {
    width: 100%;
  }

  .dashboard-hero {
    align-items: stretch;
    flex-direction: column;
    padding: 18px;
  }

  .dashboard-hero h1 {
    font-size: 32px;
  }

  .hero-status-card {
    width: 100%;
  }

  .dashboard-project-switch {
    min-width: 0;
  }

  .dashboard-card,
  .product-nav-grid button {
    min-height: 128px;
  }

  .dashboard-card strong {
    font-size: 30px;
  }

  .risk-alert {
    grid-template-columns: 1fr;
  }

  .risk-alert .secondary {
    width: 100%;
  }

  #homeView .user-login-panel {
    grid-template-columns: 1fr;
  }

  .drawing-preview-panel {
    position: static;
  }

  .mock-table {
    min-width: 760px;
  }

  .pricing-card strong {
    font-size: 24px;
  }

  .role-card,
  .role-card.big-action,
  .identity-card {
    min-height: 168px;
    padding: 18px;
  }

  .identity-card strong {
    font-size: 28px;
  }

  .role-card.big-action strong {
    font-size: 30px;
  }

  .person-card {
    grid-template-columns: 1fr;
  }

  .week-slider,
  .schedule-week-head {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .material-card {
    padding-right: 14px;
  }

  .project-management-card {
    padding-right: 14px;
  }

  .course-record-card {
    padding-right: 14px;
  }

  .status-pill {
    position: static;
    width: fit-content;
  }

  .schedule-week-head {
    flex-direction: column;
  }

  .calendar-day {
    min-height: 86px;
    padding: 6px;
  }

  .role-card {
    min-height: 170px;
  }

  .admin-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-hero h2 {
    font-size: 23px;
  }

  .admin-hero > span {
    width: 100%;
  }

  .admin-shortcut {
    min-height: 88px;
  }

  .admin-hub-card {
    min-height: 190px;
  }

  .admin-hub-card .role-icon {
    width: 76px;
    height: 76px;
  }

  .admin-hub-card strong {
    font-size: 26px;
  }

  .project-dashboard-card header {
    flex-direction: column;
  }

  .task-card {
    align-items: stretch;
  }

  .course-manage-list {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .form-actions > * {
    flex: 1 1 100%;
  }

  input,
  select,
  textarea {
    min-height: 52px;
    font-size: 19px;
  }

  .reference-dialog {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 18px);
  }

  .reference-card {
    padding: 14px;
  }

  .reference-table-wrap::before {
    display: block;
    position: sticky;
    left: 0;
    z-index: 3;
  }

  .reference-table {
    min-width: 680px;
    font-size: 16px;
  }

  .reference-table th,
  .reference-table td {
    padding: 12px 10px;
    line-height: 1.55;
  }

  .reference-recent-card {
    min-height: 92px;
  }

  .reference-pick-card {
    min-height: 118px;
    padding: 18px;
  }

  .reference-pick-card strong {
    font-size: 28px;
  }

  .reference-pick-card small,
  .reference-pick-card span {
    font-size: 16px;
  }

  .reference-bottom-nav {
    position: sticky;
    bottom: 10px;
    z-index: 5;
  }

  .reference-bottom-nav > * {
    flex: 1 1 0;
  }

  .reference-table th:first-child,
  .reference-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    max-width: 132px;
    background: #fff;
    box-shadow: 1px 0 0 var(--line);
    white-space: normal;
  }

  .reference-table th:first-child {
    z-index: 4;
    background: var(--soft-blue);
  }

  .reference-section summary {
    min-height: 58px;
    font-size: 17px;
  }
}

@media print {
  @page {
    margin: 12mm;
  }

  body {
    background: #fff;
  }

  .app {
    width: 100%;
    padding: 0;
  }

  .topbar,
  .home-view,
  .view-head,
  .no-print,
  #supervisorView,
  #safetyView,
  #workerView,
  button {
    display: none !important;
  }

  #ownerView,
  #backendView,
  .print-sheet,
  #recordPreview {
    display: block !important;
  }

  #backendView > .panel,
  #backendView > .no-print {
    display: none !important;
  }

  #backendView > .print-sheet {
    display: block !important;
  }

  .print-sheet {
    border: 0;
    padding: 0;
    box-shadow: none;
  }

  .print-section,
  .detail-grid div,
  .photo-print-grid figure {
    break-inside: avoid;
  }
}
