* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 16px;
  font-family: Arial, "Noto Sans JP", sans-serif;
  background: #f5f6f8;
}

h1 {
  margin: 0;
  font-size: 24px;
}

h2 {
  margin: 8px 0 18px;
  font-size: 18px;
  font-weight: normal;
}

/* Dashboard: reserve separate rows for mold, machine name and status. */
#machine-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

#machine-list .machine-card {
  min-width: 0;
  min-height: 156px;
  padding: 12px;
  border-radius: 16px;
  background: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.10);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: minmax(38px, auto) 1fr auto;
  gap: 8px;
  align-items: center;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

#machine-list .machine-card:active {
  transform: scale(0.98);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.16);
}

/* Applies if the card becomes focusable; CSS cannot add keyboard access. */
#machine-list .machine-card:focus-visible {
  outline: 3px solid #262626;
  outline-offset: 3px;
}

#machine-list .machine-name {
  grid-column: 1 / -1;
  grid-row: 2;
  min-width: 0;
  font-size: clamp(24px, 7vw, 34px);
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
  color: inherit;
  overflow-wrap: anywhere;
  pointer-events: none;
}

#machine-list .machine-mold,
#machine-list .machine-product {
  grid-column: 1 / -1;
  grid-row: 1;
  min-width: 0;
  margin: 0;
  padding: 5px 7px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: #262626;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

#machine-list .machine-status {
  grid-column: 1;
  grid-row: 3;
  justify-self: start;
  margin: 0;
  padding: 5px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: #262626;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
}

#machine-list .issue-count {
  grid-column: 2;
  grid-row: 3;
  min-width: 30px;
  min-height: 30px;
  padding: 3px 7px;
  border: 2px solid white;
  border-radius: 16px;
  background: #a8071a;
  color: white;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.4;
  display: flex;
  align-items: center;
  justify-content: center;
}

#machine-list .machine-card.status-normal {
  background: #52c41a;
  color: #183008;
}

#machine-list .machine-card.status-warning {
  background: #faad14;
  color: #332100;
}

#machine-list .machine-card.status-error {
  background: #ff4d4f;
  color: #360608;
}

/* Preserve the existing special-card colors. */
#machine-list .machine-card.status-equipment {
  background: #1677ff;
  color: #fff;
}

#machine-list .machine-card.status-claim {
  background: #7225ed;
  color: #fff;
}

#machine-list .machine-card.status-other {
  background: #595959;
  color: #fff;
}

@media (prefers-reduced-motion: reduce) {
  #machine-list .machine-card {
    transition: none;
  }
}
#machine-list .machine-illustration {
  display: none;
}

/* Compact factory cards on phones; desktop presentation stays unchanged. */
@media (max-width: 600px) {
  #machine-list .machine-card[class] {
    --machine-color: #d9d9d9;
    --machine-accent: var(--machine-color);
    --machine-ink: #595959;
    --machine-tint: #f5f5f5;
    background: white;
    color: #262626;
    min-height: 156px;
    padding: 10px;
    grid-template-rows: auto auto auto auto;
    gap: 6px;
    border: 1px solid #e5e9ef;
  }

  #machine-list .machine-card.status-normal {
    --machine-color: #52c41a;
    --machine-ink: #237804;
    --machine-tint: #f6ffed;
  }

  #machine-list .machine-card.status-warning {
    --machine-color: #faad14;
    --machine-ink: #874d00;
    --machine-tint: #fffbe6;
  }

  #machine-list .machine-card.status-error {
    --machine-color: #ff4d4f;
    --machine-ink: #a8071a;
    --machine-tint: #fff1f0;
  }

  #machine-list .machine-card.status-equipment { --machine-color: #1677ff; }
  #machine-list .machine-card.status-claim { --machine-color: #7225ed; }
  #machine-list .machine-card.status-other { --machine-color: #595959; }

  #machine-list .machine-illustration {
    display: block;
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    min-width: 0;
    aspect-ratio: 900 / 270;
  }

  #machine-list .machine-illustration svg {
    display: block;
    width: 100%;
    height: auto;
  }

  /* Special cards keep their identity without a molding-machine illustration. */
  #machine-list .machine-card.machine-block,
  #machine-list .machine-card.status-equipment,
  #machine-list .machine-card.status-claim,
  #machine-list .machine-card.status-other {
    border-top: 4px solid var(--machine-color);
    grid-template-rows: auto 1fr auto auto;
  }

  #machine-list .machine-name {
    grid-row: 1;
    font-size: clamp(22px, 6vw, 28px);
  }

  #machine-list .machine-product,
  #machine-list .machine-mold {
    grid-row: 3;
    padding: 0;
    background: transparent;
    font-size: 13px;
    line-height: 1.4;
  }

  #machine-list .machine-status {
    grid-row: 4;
    padding: 3px 7px;
    background: var(--machine-tint);
    color: var(--machine-ink);
    font-size: 12px;
    line-height: 1.5;
  }

  #machine-list .issue-count {
    grid-row: 4;
    min-width: 26px;
    min-height: 26px;
    padding: 2px 6px;
    font-size: 13px;
  }
}

/* Desktop/tablet dashboard only; the phone layout above stays unchanged. */
@media (min-width: 601px) {
  #app-content:has(#machine-list) {
    max-width: 1800px;
    margin-inline: auto;
  }

  #machine-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

  #machine-list .machine-card {
    min-height: 180px;
    padding: 18px;
    gap: 12px;
  }
}

@media (min-width: 1024px) {
  #machine-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1440px) {
  #machine-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* ========================================
   MACHINE DETAIL
======================================== */

.machine-detail-page {
  max-width: 720px;
  color: #262626;
  overflow-wrap: anywhere;
  margin: 0 auto;
}

.machine-detail-page .back-button {
  border: none;
  background: white;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid #d9dfe7;
  border-radius: 12px;
  margin-bottom: 12px;

  font-size: 16px;
  font-weight: 600;

  cursor: pointer;
}

.machine-detail-page #detail-machine-name {
  margin-bottom: 20px;

  font-size: clamp(30px, 9vw, 40px);
  line-height: 1.25;
  font-weight: 800;

  text-align: center;
}


/* Khối thông tin */

.machine-detail-page .detail-current-mold,
.machine-detail-page .detail-current-status {
  background: white;

  padding: 16px;
  margin-bottom: 12px;

  border-radius: 14px;

  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.08);
}


/* Tiêu đề nhỏ */

.machine-detail-page .detail-label {
  margin-bottom: 6px;

  font-size: 14px;
  color: #595959;
}


/* Nội dung chính */

.machine-detail-page .detail-value {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.5;
}


/* Số vấn đề */

.machine-detail-page .detail-issue-count {
  display: inline-block;

  margin-top: 10px;
  padding: 8px 12px;

  border-radius: 12px;

  background: #a8071a;
  color: white;

  font-size: 16px;
  font-weight: 700;
}

/* 本日の履歴 */
.machine-detail-page .machine-history {
  margin-top: 28px;
  color: #262626;
}

.machine-detail-page .history-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.machine-detail-page .history-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}

.machine-detail-page .history-count {
  padding: 3px 9px;
  border-radius: 12px;
  background: #e8ebef;
  font-size: 13px;
  font-weight: 700;
}

.machine-detail-page .history-caption {
  margin: 7px 0 16px;
  color: #666;
  font-size: 14px;
  line-height: 1.6;
}

.machine-detail-page .history-item {
  --history-color: #d9d9d9;
  --history-tint: #f5f5f5;
  --history-ink: #595959;
  margin-bottom: 12px;
  padding: 16px;
  border: 1px solid #e8ebef;
  border-left: 4px solid var(--history-color);
  border-radius: 14px;
  background: white;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  overflow-wrap: anywhere;
}

.machine-detail-page .history-normal {
  --history-color: #52c41a;
  --history-tint: #f6ffed;
  --history-ink: #237804;
}

.machine-detail-page .history-warning {
  --history-color: #faad14;
  --history-tint: #fffbe6;
  --history-ink: #874d00;
}

.machine-detail-page .history-error {
  --history-color: #ff4d4f;
  --history-tint: #fff1f0;
  --history-ink: #a8071a;
}

.machine-detail-page .history-item-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.machine-detail-page .history-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--history-tint);
  color: var(--history-ink);
  font-size: 13px;
  font-weight: 700;
}

.machine-detail-page .history-status::before {
  content: "";
  width: 7px;
  height: 7px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--history-color);
}

.machine-detail-page .history-time {
  flex-shrink: 0;
  color: #595959;
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.machine-detail-page .history-mold {
  margin-top: 12px;
  font-size: 13px;
  line-height: 1.6;
  color: #595959;
}

.machine-detail-page .history-mold-label {
  margin-right: 6px;
  color: #666;
}

.machine-detail-page .history-note {
  margin-top: 10px;
  font-size: 16px;
  line-height: 1.75;
  white-space: pre-line;
}

.machine-detail-page .history-empty {
  padding: 28px 16px;
  border: 1px dashed #d9d9d9;
  border-radius: 14px;
  background: white;
  text-align: center;
  color: #595959;
}

.machine-detail-page .history-empty strong,
.machine-detail-page .history-empty span {
  display: block;
}

.machine-detail-page .history-empty span {
  margin-top: 8px;
  font-size: 13px;
}

.machine-detail-page .history-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  font-size: 14px;
}

.machine-detail-page .history-pagination button,
.machine-detail-page .history-retry {
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid #d9d9d9;
  border-radius: 10px;
  background: white;
  color: #262626;
  font: inherit;
  cursor: pointer;
}

.machine-detail-page .history-pagination button:disabled {
  color: #999;
  background: #f0f0f0;
  cursor: default;
}

.machine-detail-page .history-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.machine-detail-page .history-controls .history-caption {
  margin: 0;
}

.machine-detail-page .history-controls button {
  flex-shrink: 0;
}

.machine-detail-page .history-controls button:disabled {
  opacity: 0.5;
  cursor: default;
}

/* Current status: keep text labels as well as the status color. */
.machine-detail-page .detail-current-status {
  --detail-color: #d9d9d9;
  --detail-tint: #f5f5f5;
  --detail-ink: #595959;
  border-left: 5px solid var(--detail-color);
}

.machine-detail-page .detail-current-status[data-status="正常"] {
  --detail-color: #52c41a;
  --detail-tint: #f6ffed;
  --detail-ink: #237804;
}

.machine-detail-page .detail-current-status[data-status="注意"] {
  --detail-color: #faad14;
  --detail-tint: #fffbe6;
  --detail-ink: #874d00;
}

.machine-detail-page .detail-current-status[data-status="異常"] {
  --detail-color: #ff4d4f;
  --detail-tint: #fff1f0;
  --detail-ink: #a8071a;
}

.machine-detail-page .detail-current-status .detail-value {
  display: table;
  padding: 6px 14px;
  border-radius: 10px;
  background: var(--detail-tint);
  color: var(--detail-ink);
}

.machine-detail-page .history-today .history-heading {
  padding-left: 12px;
  border-left: 4px solid #1677ff;
}

.machine-detail-page .history-past {
  padding-top: 24px;
  border-top: 1px solid #d9dfe7;
}

.machine-detail-page .history-past .history-heading {
  padding-left: 12px;
  border-left: 4px solid #8c8c8c;
}

.machine-detail-page button:focus-visible {
  outline: 3px solid #1677ff;
  outline-offset: 3px;
}

.machine-detail-page button:active:not(:disabled) {
  background: #e6f4ff;
}

/* Keep the existing spacing while respecting standalone device safe areas. */
@media (display-mode: standalone) {
  body {
    padding-top: max(16px, env(safe-area-inset-top, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
    padding-bottom: max(16px, env(safe-area-inset-bottom, 0px));
    padding-left: max(16px, env(safe-area-inset-left, 0px));
  }
}

/* Overview and filters are exclusive to the PC dashboard. */
#desktop-monitor { display: none; }

@media (min-width: 1024px) {
  #desktop-monitor { display: block; margin-bottom: 20px; }
  #desktop-monitor .machine-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin: 0;
  }
  #desktop-monitor .machine-summary > div {
    padding: 16px 20px;
    border: 1px solid #e5e9ef;
    border-radius: 14px;
    background: white;
  }
  #desktop-monitor dt { color: #595959; font-size: 14px; }
  #desktop-monitor dd { margin: 8px 0 0; font-size: 30px; font-weight: 800; }
  #desktop-monitor #summary-normal { color: #237804; }
  #desktop-monitor #summary-warning { color: #874d00; }
  #desktop-monitor #summary-error { color: #a8071a; }
  #desktop-monitor #summary-message { color: #595959; font-size: 13px; line-height: 1.6; }
  #desktop-monitor .machine-filters { display: flex; gap: 10px; flex-wrap: wrap; }
  #desktop-monitor button {
    min-height: 44px;
    padding: 8px 20px;
    border: 1px solid #d9dfe7;
    border-radius: 10px;
    background: white;
    color: #262626;
    font: inherit;
    cursor: pointer;
  }
  #desktop-monitor button[aria-pressed="true"] { background: #163752; color: white; border-color: #163752; }
  #desktop-monitor button:disabled { opacity: 0.5; cursor: default; }
  #desktop-monitor button:focus-visible { outline: 3px solid #1677ff; outline-offset: 3px; }
}

/* PC issue visibility: neutral surfaces with stable, status-colored outlines. */
@media (min-width: 1024px) {
  #machine-list .machine-card.status-normal,
  #machine-list .machine-card.status-warning,
  #machine-list .machine-card.status-error {
    background: white;
    color: #262626;
    border: 2px solid #e5e9ef;
  }

  #machine-list .machine-card.status-warning {
    border-color: #faad14;
    box-shadow: 0 2px 8px rgba(135, 77, 0, 0.12);
  }

  #machine-list .machine-card.status-error {
    border-color: #ff4d4f;
    box-shadow: 0 0 0 2px #ff4d4f, 0 4px 12px rgba(168, 7, 26, 0.14);
  }

  #machine-list .machine-card.status-normal .machine-status {
    background: #f6ffed;
    color: #237804;
  }

  #machine-list .machine-card.status-warning .machine-status {
    background: #fffbe6;
    color: #874d00;
  }

  #machine-list .machine-card.status-error .machine-status {
    background: #fff1f0;
    color: #a8071a;
  }

  #machine-list .machine-card.status-normal .machine-status::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 6px;
    border-radius: 50%;
    background: #52c41a;
  }
}

/* Compact PC cards: title/status above mold/issue count, no reserved empty row. */
@media (min-width: 1024px) {
  #machine-list .machine-card {
    min-height: 112px;
    padding: 16px;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    gap: 12px;
    align-content: center;
  }

  #machine-list .machine-name {
    grid-column: 1;
    grid-row: 1;
    font-size: 24px;
    line-height: 1.3;
    text-align: left;
  }

  #machine-list .machine-status {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    font-size: 13px;
    padding: 4px 8px;
  }

  #machine-list .machine-product,
  #machine-list .machine-mold {
    grid-column: 1;
    grid-row: 2;
    padding: 4px 7px;
    font-size: 14px;
    line-height: 1.5;
  }

  #machine-list .issue-count {
    grid-column: 2;
    grid-row: 2;
    justify-self: end;
  }
}

@media (min-width: 1024px) and (hover: hover) and (pointer: fine) {
  #machine-list .machine-card:hover {
    transform: translateY(-2px);
  }

  #machine-list .machine-card:active {
    transform: scale(0.98);
  }
}

/* PC navigation stays inside the authenticated application. */
#desktop-navigation { display: none; }

@media (min-width: 1024px) {
  #app-content:has(#machine-list) > h1 {
    padding-block: 12px 24px;
    text-align: center;
  }
  .desktop-shell {
    display: block;
  }
  #desktop-navigation {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 24px;
    margin-bottom: 24px;
    border-bottom: 1px solid #d9dfe7;
    background: white;
  }
  #desktop-navigation button {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 16px 24px;
    border: 0;
    border-bottom: 3px solid transparent;
    background: transparent;
    color: #262626;
    font: inherit;
    cursor: pointer;
  }
  #desktop-navigation svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  #desktop-navigation button[aria-current="page"] { color: #1677ff; border-bottom-color: #1677ff; }
  #desktop-navigation button:focus-visible { outline: 3px solid #1677ff; outline-offset: 3px; }
  .dashboard-views { min-width: 0; }
  .navigation-placeholder { padding: 24px; border: 1px dashed #d9dfe7; border-radius: 14px; background: white; color: #595959; line-height: 1.7; }
}

/* Reuse the approved JSW illustration for production machines on PC only. */
@media (min-width: 1024px) {
  #machine-list .machine-card:has(.machine-illustration) {
    --machine-accent: #d9d9d9;
    background: white;
    color: #262626;
    grid-template-rows: auto auto auto;
  }
  #machine-list .status-normal:has(.machine-illustration) { --machine-accent: #52c41a; }
  #machine-list .status-warning:has(.machine-illustration) { --machine-accent: #faad14; }
  #machine-list .status-error:has(.machine-illustration) { --machine-accent: #ff4d4f; }

  #machine-list .machine-illustration {
    display: block;
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    min-width: 0;
    aspect-ratio: 900 / 270;
  }
  #machine-list .machine-illustration svg {
    display: block;
    width: 100%;
    height: auto;
  }
  #machine-list .machine-card:has(.machine-illustration) .machine-product,
  #machine-list .machine-card:has(.machine-illustration) .machine-mold,
  #machine-list .machine-card:has(.machine-illustration) .issue-count {
    grid-row: 3;
  }
}

/* D1 mold list below the existing add controls. */
#mold-catalog { margin-top: 16px; }
.mold-search label { display: block; margin-bottom: 6px; }
.mold-search > div { display: flex; gap: 8px; max-width: 560px; }
.mold-search input { flex: 1; min-width: 0; padding: 10px; font: inherit; }
.mold-search button, #mold-catalog-retry { min-height: 44px; padding: 8px 16px; }
.mold-table-scroll { overflow-x: auto; }
.mold-table { width: 100%; border-collapse: collapse; background: white; }
.mold-table th, .mold-table td { padding: 12px; text-align: left; border-bottom: 1px solid #e5e7eb; overflow-wrap: anywhere; }
.mold-table th { background: #f5f7fa; }

.daily-history-layout { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 20px; }
#daily-history-days { display: flex; flex-direction: column; gap: 8px; align-self: start; }
#daily-history-days button, #daily-history-retry { min-height: 44px; padding: 10px; }
#daily-history-days [aria-pressed="true"] { border: 2px solid #1677ff; color: #1677ff; background: #e6f4ff; }
.daily-note-table td { white-space: pre-wrap; }
.daily-note-table [data-status="正常"] { color: #237804; background: #f6ffed; }
.daily-note-table [data-status="注意"] { color: #874d00; background: #fffbe6; }
.daily-note-table [data-status="異常"] { color: #a8071a; background: #fff1f0; }
@media (max-width: 767px) { .daily-history-layout { grid-template-columns: minmax(0,1fr); } #daily-history-days { flex-direction: row; flex-wrap: wrap; } }

/* The same navigation and views are available on phones and tablets. */
@media (max-width: 1023px) {
  #desktop-navigation { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 0; margin-bottom: 16px; border-bottom: 1px solid #d9dfe7; background: white; }
  #desktop-navigation button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; min-width: 0; min-height: 56px; padding: 8px 2px; border: 0; border-bottom: 3px solid transparent; background: transparent; color: #262626; font: inherit; font-size: 12px; cursor: pointer; }
  #desktop-navigation svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  #desktop-navigation button[aria-current="page"] { color: #1677ff; border-bottom-color: #1677ff; }
  #desktop-navigation button:focus-visible { outline: 3px solid #1677ff; outline-offset: -3px; }
  .desktop-shell, .dashboard-views { min-width: 0; }
}

.daily-date-picker { display: grid; gap: 8px; align-self: start; }
.daily-date-picker input { width: 100%; min-width: 0; box-sizing: border-box; min-height: 44px; padding: 8px; font: inherit; }
#mold-edit-dialog input, #mold-edit-dialog select { max-width: 100%; }
.mold-table button { min-height: 44px; padding: 8px 12px; }

/* Mold creation stays in the viewport instead of below the catalog. */
.mold-create-dialog {
  width: min(460px, calc(100% - 32px)); max-height: calc(100dvh - 32px);
  box-sizing: border-box; overflow-y: auto; padding: 28px; margin: auto;
  border: 1px solid #dfe6ef; border-radius: 18px; background: white; color: #243047;
  box-shadow: 0 24px 80px rgba(22, 55, 82, .22);
}
.mold-create-dialog::backdrop { background: rgba(15, 35, 53, .55); }
.mold-create-heading { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.mold-create-icon { display: grid; place-items: center; width: 48px; height: 48px; flex-shrink: 0; border-radius: 12px; background: #e6f4ff; color: #1677ff; }
.mold-create-icon svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }
.mold-create-heading h3 { margin: 0; font-size: 23px; color: #163752; }
.mold-create-heading p { margin: 5px 0 0; font-size: 13px; color: #6a7b91; }
.mold-create-dialog label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 600; }
.mold-create-dialog input { width: 100%; min-height: 48px; box-sizing: border-box; padding: 12px 14px; border: 1px solid #c8d0dc; border-radius: 10px; font: inherit; }
.mold-create-dialog input:focus-visible { outline: 3px solid #b4d7ff; border-color: #1677ff; outline-offset: 2px; }
#mold-create-message { color: #596579; font-size: 14px; line-height: 1.7; overflow-wrap: anywhere; white-space: pre-wrap; margin: 16px 0; }
#mold-create-message:empty { display: none; }
.mold-create-dialog footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; padding-top: 18px; border-top: 1px solid #edf0f4; }
.mold-create-dialog button { min-height: 46px; padding: 10px 20px; border: 1px solid #c8d0dc; border-radius: 10px; background: white; color: #243047; font: inherit; cursor: pointer; }
.mold-create-dialog #save-mold-btn { background: #1677ff; border-color: #1677ff; color: white; font-weight: 600; }
.mold-create-dialog button:disabled, .mold-create-dialog input:disabled { opacity: .6; cursor: default; }
.mold-create-dialog button:focus-visible { outline: 3px solid #b4d7ff; outline-offset: 2px; }
@media (max-width: 480px) {
  .mold-create-dialog { padding: 22px; border-radius: 16px; }
  .mold-create-dialog footer button { flex: 1; padding-inline: 10px; }
}

/* Summary cards are the desktop filter controls; explanatory text follows the list. */
#summary-message { display: none; }
@media (min-width: 1024px) {
  #desktop-monitor .machine-summary > div { position: relative; }
  #desktop-monitor .machine-summary dt { min-height: 21px; }
  #desktop-monitor .machine-summary .summary-filter,
  #desktop-monitor .machine-summary .summary-filter[aria-pressed="true"] {
    position: absolute; inset: 0; display: flex; align-items: flex-start; justify-content: flex-start;
    width: 100%; padding: 16px 20px; border: 0; border-radius: inherit;
    background: transparent; color: #595959; font-size: 14px; text-align: left;
  }
  #desktop-monitor .machine-summary dd { position: relative; pointer-events: none; }
  #desktop-monitor .machine-summary > div:has([aria-pressed="true"]) { border-color: #1677ff; box-shadow: inset 0 0 0 1px #1677ff; }
  #desktop-monitor .machine-summary .summary-filter:hover:not(:disabled) { background: rgba(22,119,255,.04); }
  #desktop-monitor .machine-summary .summary-filter:focus-visible { outline: 3px solid #1677ff; outline-offset: 3px; }
  #summary-message { display: block; margin: 24px 0 0; padding-top: 16px; border-top: 1px solid #e5e9ef; color: #595959; font-size: 13px; line-height: 1.7; }
}
.history-past .history-pagination { display:none; }
.server-note-pagination { display:flex; gap:12px; align-items:center; justify-content:center; margin:16px 0; }
