/* 添付モックアップ準拠のダッシュボードレイアウト */
/* 確定版スナップショット: src/lib/layoutBaseline.ts（2025-06-15）, standalone css v49 */
.dashboard-root {
  --page-bg: #b0b0b0;
  --panel-top: #bebefc;
  --panel-combined: #b3ffc4;
  --title-top: #2f00ff;
  --title-combined: #009a45;
  --btn-sampling: #2f00ff;
  --btn-orange: #e69138;
  --control-bg: #efefef;
  --layout-scale: 1;
  --viewport-scale: 1;
  --reference-width: calc(100vw - 16px);
  --reference-height: calc(100vh - 16px);
  --sidebar-width: calc(300px * var(--layout-scale));
  --sidebar-ui-scale: 1.15;
  --panel-section-gap: calc(32px * var(--layout-scale));
  --dashboard-main-margin-left: 0px;
  --data-log-width: 210px;
  --data-log-offset-x: 50px;

  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  align-items: flex-start;
  overflow: hidden;
  background: var(--page-bg);
  font-family: "Meiryo", "MS PGothic", "Segoe UI", sans-serif;
  padding: 8px;
  box-sizing: border-box;
}

.dashboard-scale-layer {
  position: relative;
  width: var(--reference-width);
  height: var(--reference-height);
  flex: 1;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  transform-origin: top left;
  overflow: hidden;
  box-sizing: border-box;
}

.dashboard-root:not(.is-mobile) .dashboard-mobile-scroll {
  flex: 1;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.dashboard-root:not(.is-mobile) .dashboard-scale-layer {
  transform: none;
}

.dashboard-root:not(.is-mobile) {
  flex-direction: column;
}

.dashboard-data-log {
  position: absolute;
  left: var(--data-log-offset-x);
  top: 0;
  bottom: 0;
  width: var(--data-log-width);
  z-index: 20;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  background: #000;
  color: #fff;
  overflow: hidden;
  border-radius: 4px;
  font-size: 14px;
  line-height: 1.4;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.dashboard-root.is-data-log-visible .dashboard-data-log {
  transform: translateX(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.dashboard-root:not(.is-data-log-visible) .dashboard-data-log:not(.dashboard-data-log--overlay) {
  display: none;
  transform: translateX(calc(-1 * (var(--data-log-width) + var(--data-log-offset-x) + 24px)));
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.dashboard-data-log-header {
  flex-shrink: 0;
  padding: 10px 18px 6px;
  font-size: 15px;
  font-weight: bold;
  letter-spacing: 0.05em;
}

.dashboard-data-log-list {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-rows: repeat(var(--data-log-entry-count, 1), minmax(0, 1fr));
  gap: 6px;
  padding: 0 8px 8px;
  overflow: hidden;
}

.dashboard-data-log-list.is-scrollable {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.dashboard-data-log-list.is-scrollable .dashboard-data-log-entry {
  flex-shrink: 0;
  padding: 6px 8px;
  min-height: auto;
}

.dashboard-data-log-list.is-grouped {
  gap: 0;
  padding: 0 10px 10px;
}

.dashboard-data-log-group + .dashboard-data-log-group {
  margin-top: 14px;
}

.dashboard-data-log-group-title {
  margin: 0 0 6px;
  padding: 0 2px;
  font-size: 15px;
  font-weight: bold;
  letter-spacing: 0.03em;
}

.dashboard-data-log-group-entry {
  padding: 3px 2px;
  font-size: 13px;
  line-height: 1.45;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.dashboard-data-log-entry {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
  min-height: 0;
}

.dashboard-data-log-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: bold;
  color: #fff;
  flex-shrink: 0;
}

.dashboard-data-log-tag--G1 {
  background: #4472c4;
}

.dashboard-data-log-tag--G2 {
  background: #00b050;
}

.dashboard-data-log-tag--G3 {
  background: #e69138;
}

.dashboard-data-log-datetime {
  font-size: 14px;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.dashboard-main {
  flex: 1;
  min-height: 0;
  min-width: 0;
  align-self: center;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  width: max-content;
  max-width: calc(100% - 16px);
  box-sizing: border-box;
  overflow: hidden;
}

.dashboard-content-block {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--panel-section-gap);
  width: max-content;
  max-width: 100%;
  min-width: 0;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  margin-right: calc(54px * var(--layout-scale));
  box-sizing: border-box;
}

.dashboard-root.is-data-log-visible .dashboard-main {
  position: relative;
  z-index: 1;
  align-self: flex-end;
  margin-left: var(--dashboard-main-margin-left);
  margin-right: 8px;
  width: calc(100% - var(--dashboard-main-margin-left) - 8px);
  max-width: calc(100% - var(--dashboard-main-margin-left) - 8px);
  overflow-x: clip;
  align-items: flex-end;
}

.dashboard-root:not(.is-data-log-visible) .dashboard-main {
  margin-left: 0;
  margin-right: auto;
}

.dashboard-top {
  margin-top: calc(16px * var(--layout-scale));
  min-height: 0;
  min-width: 0;
  width: auto;
  max-width: 100%;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--panel-top);
  border-radius: calc(10px * var(--layout-scale));
  overflow: visible;
  padding-inline: calc(23px * var(--layout-scale));
  box-sizing: border-box;
}

.dashboard-top-title {
  margin: 0;
  padding: calc(10px * var(--layout-scale)) 0 calc(2px * var(--layout-scale));
  text-align: center;
  font-size: calc(30px * var(--layout-scale));
  font-weight: bold;
  color: var(--title-top);
  letter-spacing: 0.12em;
  flex-shrink: 0;
}

/* standalone 等: PC ではタイトル行を通常表示（display:contents は使わない） */
.dashboard-root:not(.is-mobile) .dashboard-top-title-row {
  display: block;
  text-align: center;
}

.dashboard-root:not(.is-mobile) .dashboard-top-title-row .dashboard-data-log-btn {
  display: none;
}

.dashboard-top .dashboard-graphs-row {
  flex: 0 0 auto;
  align-items: flex-start;
  padding: calc(4px * var(--layout-scale)) calc(8px * var(--layout-scale)) 0;
  gap: calc(32px * var(--layout-scale));
  overflow: visible;
}

.dashboard-top .dashboard-graph-slot-label {
  font-size: calc(22px * var(--layout-scale));
  margin-top: calc(8px * var(--layout-scale));
}

.dashboard-lower {
  flex: 1;
  min-height: 0;
  min-width: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: calc(40px * var(--layout-scale));
  overflow: hidden;
}

.dashboard-sidebar {
  width: var(--sidebar-width);
  flex: 0 0 auto;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: calc(14px * var(--layout-scale));
  padding: 0 calc(2px * var(--layout-scale)) calc(4px * var(--layout-scale));
  box-sizing: border-box;
}

.dashboard-sidebar-middle {
  position: relative;
}

.dashboard-filter-popover {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 15;
  background: var(--control-bg);
  border: calc(2px * var(--layout-scale)) solid #000;
  border-radius: calc(8px * var(--layout-scale));
  padding: calc(28px * var(--layout-scale)) calc(10px * var(--layout-scale)) calc(12px * var(--layout-scale));
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
  box-sizing: border-box;
}

.dashboard-filter-popover-close {
  position: absolute;
  top: calc(4px * var(--layout-scale));
  right: calc(6px * var(--layout-scale));
  width: calc(26px * var(--layout-scale));
  height: calc(26px * var(--layout-scale));
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  font-size: calc(22px * var(--layout-scale));
  line-height: 1;
  cursor: pointer;
  color: #444;
  padding: 0;
  font-family: inherit;
}

.dashboard-filter-popover-close:hover {
  color: #000;
}

.dashboard-filter-popover .dashboard-filter-fields {
  margin-top: 0;
}

.dashboard-combined {
  flex: 0 0 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  min-height: 0;
  background: transparent;
  overflow: hidden;
}

.dashboard-combined-panel {
  width: fit-content;
  max-width: 100%;
  flex: 0 0 auto;
  align-self: flex-end;
  display: flex;
  flex-direction: column;
  background: var(--panel-combined);
  border-radius: calc(10px * var(--layout-scale));
  overflow: hidden;
  padding-inline: calc(20px * var(--layout-scale));
  box-sizing: border-box;
}

.dashboard-combined-title {
  margin: 0;
  padding: calc(10px * var(--layout-scale)) 0 calc(2px * var(--layout-scale));
  text-align: center;
  font-size: calc(30px * var(--layout-scale));
  font-weight: bold;
  color: var(--title-combined);
  letter-spacing: 0.12em;
  flex-shrink: 0;
}

.dashboard-combined-panel .dashboard-graph-slot-label:not(.dashboard-graph-slot-label--combined) {
  font-size: calc(22px * var(--layout-scale));
  margin-top: calc(8px * var(--layout-scale));
}

.dashboard-combined-panel .dashboard-graph-slot-label--combined {
  display: inline-flex;
  align-items: baseline;
  gap: 0;
  line-height: 1;
  margin-top: calc(8px * var(--layout-scale));
}

.dashboard-combined-panel .dashboard-graph-slot-label--combined .dashboard-graph-slot-label-main {
  font-size: calc(22px * var(--layout-scale));
  font-weight: bold;
}

.dashboard-combined-panel .dashboard-graph-slot-label--combined .dashboard-graph-slot-label-sub {
  font-size: calc(12px * var(--layout-scale)) !important;
  font-weight: bold;
  letter-spacing: 0.02em;
  line-height: 1;
}

.dashboard-combined-panel .dashboard-graphs-row {
  flex: 0 0 auto;
  align-items: flex-start;
  padding: calc(4px * var(--layout-scale)) calc(12px * var(--layout-scale)) calc(8px * var(--layout-scale));
  gap: calc(32px * var(--layout-scale));
}

.dashboard-graphs-row {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: calc(8px * var(--layout-scale));
  overflow: hidden;
  padding: calc(12px * var(--layout-scale));
}

.dashboard-graph-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  min-width: 0;
  max-height: 100%;
}

.dashboard-graph-frame {
  position: relative;
  overflow: hidden;
  background: #fff;
  flex-shrink: 0;
}

.dashboard-graph-frame-viewport {
  position: relative;
  overflow: hidden;
  transform-origin: top left;
}

.dashboard-graph-frame-canvas {
  position: absolute;
}

.dashboard-graph-slot-label {
  margin-top: calc(4px * var(--layout-scale));
  font-size: calc(18px * var(--layout-scale));
  font-weight: bold;
  color: #000;
  line-height: 1;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.dashboard-control-group {
  width: 100%;
}

.dashboard-control-title {
  text-align: center;
  font-size: calc(18px * var(--layout-scale));
  font-weight: bold;
  color: #000;
  margin-bottom: calc(4px * var(--layout-scale));
}

.dashboard-control-box {
  border: calc(2px * var(--layout-scale)) solid #000;
  background: var(--control-bg);
  padding: calc(12px * var(--layout-scale)) calc(10px * var(--layout-scale));
  border-radius: calc(8px * var(--layout-scale));
}

.dashboard-control-group--sampling {
  display: flex;
  flex-direction: column;
  gap: calc(8px * var(--layout-scale));
}

.dashboard-sampling-frame {
  border: calc(2px * var(--layout-scale)) solid #000;
  border-radius: calc(8px * var(--layout-scale));
  padding: calc(12px * var(--layout-scale)) calc(10px * var(--layout-scale)) calc(14px * var(--layout-scale));
  box-sizing: border-box;
}

.dashboard-sampling-title {
  margin-bottom: calc(10px * var(--layout-scale));
  text-align: center;
  font-size: calc(18px * var(--layout-scale));
  font-weight: bold;
  color: #000;
  letter-spacing: 0.05em;
  line-height: 1.2;
}

.dashboard-sampling-frame .dashboard-radio-row:last-child {
  margin-bottom: 0;
}

.dashboard-control-box--filters[hidden] {
  display: none !important;
}

.dashboard-control-box--filters .dashboard-filter-fields {
  margin-top: 0;
}

.dashboard-sampling-btns {
  display: flex;
  gap: calc(10px * var(--layout-scale));
}

.dashboard-sampling-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(58px * var(--layout-scale));
  padding: calc(14px * var(--layout-scale)) calc(8px * var(--layout-scale));
  font-size: calc(20px * var(--layout-scale));
  font-weight: bold;
  color: #fff;
  border: calc(4px * var(--layout-scale)) solid #fff;
  border-radius: calc(12px * var(--layout-scale));
  cursor: pointer;
  background: var(--btn-sampling);
  font-family: inherit;
  box-sizing: border-box;
  line-height: 1;
}

.dashboard-sampling-btn:hover {
  background: #2600cc;
}

.dashboard-sampling-btn.is-active {
  background: #2600cc;
  border-color: #fff;
}

.dashboard-filter-fields {
  margin-top: calc(10px * var(--layout-scale));
  display: flex;
  flex-direction: column;
  gap: calc(8px * var(--layout-scale));
  font-size: calc(12px * var(--layout-scale));
  color: #333;
}

.dashboard-filter-fields[hidden],
.dashboard-filter-clear[hidden] {
  display: none !important;
}

.dashboard-filter-fields label {
  display: flex;
  flex-direction: column;
  gap: calc(3px * var(--layout-scale));
}

.dashboard-filter-fields input {
  border: 1px solid #888;
  padding: calc(4px * var(--layout-scale)) calc(6px * var(--layout-scale));
  font-size: calc(13px * var(--layout-scale));
  background: #fff;
}

.dashboard-filter-clear {
  margin-top: calc(6px * var(--layout-scale));
  background: none;
  border: none;
  color: #555;
  font-size: calc(11px * var(--layout-scale));
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  text-align: left;
  font-family: inherit;
}

.dashboard-radio-row {
  display: flex;
  align-items: center;
  gap: calc(10px * var(--layout-scale));
  font-size: calc(14px * var(--layout-scale));
  margin-bottom: calc(8px * var(--layout-scale));
  padding: calc(4px * var(--layout-scale)) calc(2px * var(--layout-scale));
  width: 100%;
  border: none;
  background: none;
  color: #000;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  box-sizing: border-box;
}

.dashboard-radio-row:hover {
  opacity: 0.85;
}

.dashboard-radio-row.is-selected {
  font-weight: bold;
}

.dashboard-radio-dot {
  display: inline-block;
  width: calc(18px * var(--layout-scale));
  height: calc(18px * var(--layout-scale));
  border-radius: 50%;
  border: calc(2px * var(--layout-scale)) solid #000;
  flex-shrink: 0;
  background: #fff;
  box-sizing: border-box;
}

.dashboard-radio-dot.is-filled {
  background: #000;
  box-shadow: inset 0 0 0 3px #fff;
}

.dashboard-btn-sieve {
  width: 100%;
  padding: calc(14px * var(--layout-scale)) calc(8px * var(--layout-scale));
  background: var(--btn-orange);
  color: #fff;
  font-size: calc(14px * var(--layout-scale));
  font-weight: bold;
  border: none;
  border-radius: calc(10px * var(--layout-scale));
  cursor: pointer;
  font-family: inherit;
}

.dashboard-btn-sieve:hover {
  filter: brightness(0.95);
}

.dashboard-btn-sieve.is-active {
  box-shadow: inset 0 0 0 2px #fff;
}

.dashboard-sieve-overlay {
  position: absolute;
  inset: 0;
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.35);
  box-sizing: border-box;
}

.dashboard-sieve-overlay[hidden] {
  display: none !important;
}

.dashboard-sieve-overlay-inner {
  max-width: 100%;
  max-height: 100%;
}

.dashboard-sieve-panel {
  width: min(520px, 100%);
  max-height: min(90vh, 720px);
  display: flex;
  flex-direction: column;
  background: var(--control-bg);
  border: 2px solid #000;
  border-radius: 10px;
  overflow: hidden;
  box-sizing: border-box;
}

.dashboard-sieve-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid #000;
  flex-shrink: 0;
}

.dashboard-sieve-panel-title {
  font-size: 16px;
  font-weight: bold;
  color: #000;
}

.dashboard-sieve-panel-close {
  width: 28px;
  height: 28px;
  border: 1px solid #000;
  border-radius: 4px;
  background: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
}

.dashboard-sieve-table-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 8px 10px;
}

.dashboard-sieve-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.dashboard-sieve-table th,
.dashboard-sieve-table td {
  border: 1px solid #888;
  padding: 4px 6px;
  text-align: center;
}

.dashboard-sieve-table th {
  background: #ddd;
  font-weight: bold;
}

.dashboard-sieve-th-size,
.dashboard-sieve-td-size {
  text-align: left;
  white-space: nowrap;
  background: #f5f5f5;
  font-weight: bold;
}

.dashboard-sieve-input {
  width: 100%;
  min-width: 0;
  border: 1px solid #888;
  padding: 4px 6px;
  font-size: 13px;
  background: #fff;
  box-sizing: border-box;
  text-align: right;
  font-family: inherit;
}

.dashboard-sieve-clear {
  background: none;
  border: none;
  color: #555;
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  font-family: inherit;
}

.dashboard-sieve-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 8px 10px 10px;
}

.dashboard-sieve-actions .dashboard-sieve-clear {
  margin: 0;
}

.dashboard-sieve-submit {
  flex: 1;
  padding: 12px 8px;
  background: var(--btn-orange);
  color: #fff;
  font-size: 14px;
  font-weight: bold;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
}

.dashboard-sieve-submit:disabled {
  opacity: 0.7;
  cursor: wait;
}

.dashboard-sieve-error {
  margin: 0 10px 6px;
  color: #b71c1c;
  font-size: 12px;
}

.dashboard-system-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  background: #9e9e9e;
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px;
  transition: height 0.15s, opacity 0.15s;
  z-index: 100;
}

.dashboard-system-bar.is-visible,
.dashboard-system-bar:hover,
.dashboard-system-bar:focus-within {
  height: 24px;
  opacity: 1;
  pointer-events: auto;
}

.dashboard-system-bar button {
  background: none;
  border: none;
  font-size: 11px;
  cursor: pointer;
  text-decoration: underline;
  font-family: inherit;
  padding: 0;
}

.dashboard-system-bar .ml-auto {
  margin-left: auto;
}

.dashboard-error-toast {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  background: #ffcdd2;
  color: #b71c1c;
  border: 1px solid #e57373;
  padding: 6px 14px;
  font-size: 12px;
  border-radius: 4px;
  z-index: 200;
  max-width: 90%;
  text-align: center;
}

/* サイドバー（サンプリング・表示データ・ふるい分け）のみ拡大 */
.dashboard-sidebar .dashboard-sampling-frame {
  padding: calc(12px * var(--layout-scale) * var(--sidebar-ui-scale))
    calc(10px * var(--layout-scale) * var(--sidebar-ui-scale))
    calc(14px * var(--layout-scale) * var(--sidebar-ui-scale));
}

.dashboard-sidebar .dashboard-sampling-title {
  margin-bottom: calc(10px * var(--layout-scale) * var(--sidebar-ui-scale));
  font-size: calc(18px * var(--layout-scale) * var(--sidebar-ui-scale));
}

.dashboard-sidebar .dashboard-sampling-btn {
  min-height: calc(58px * var(--layout-scale) * var(--sidebar-ui-scale));
  padding: calc(14px * var(--layout-scale) * var(--sidebar-ui-scale))
    calc(8px * var(--layout-scale) * var(--sidebar-ui-scale));
  font-size: calc(20px * var(--layout-scale) * var(--sidebar-ui-scale));
  border-width: calc(4px * var(--layout-scale) * var(--sidebar-ui-scale));
  border-radius: calc(12px * var(--layout-scale) * var(--sidebar-ui-scale));
}

.dashboard-sidebar .dashboard-control-box {
  padding: calc(12px * var(--layout-scale) * var(--sidebar-ui-scale))
    calc(10px * var(--layout-scale) * var(--sidebar-ui-scale));
}

.dashboard-sidebar .dashboard-radio-row {
  gap: calc(10px * var(--layout-scale) * var(--sidebar-ui-scale));
  font-size: calc(14px * var(--layout-scale) * var(--sidebar-ui-scale));
  margin-bottom: calc(8px * var(--layout-scale) * var(--sidebar-ui-scale));
  padding: calc(4px * var(--layout-scale) * var(--sidebar-ui-scale))
    calc(2px * var(--layout-scale) * var(--sidebar-ui-scale));
}

.dashboard-sidebar .dashboard-radio-dot {
  width: calc(18px * var(--layout-scale) * var(--sidebar-ui-scale));
  height: calc(18px * var(--layout-scale) * var(--sidebar-ui-scale));
  border-width: calc(2px * var(--layout-scale) * var(--sidebar-ui-scale));
}

.dashboard-sidebar .dashboard-filter-fields {
  font-size: calc(12px * var(--layout-scale) * var(--sidebar-ui-scale));
}

.dashboard-sidebar .dashboard-filter-fields input {
  padding: calc(4px * var(--layout-scale) * var(--sidebar-ui-scale))
    calc(6px * var(--layout-scale) * var(--sidebar-ui-scale));
  font-size: calc(13px * var(--layout-scale) * var(--sidebar-ui-scale));
}

.dashboard-sidebar .dashboard-filter-clear {
  font-size: calc(11px * var(--layout-scale) * var(--sidebar-ui-scale));
}

.dashboard-sidebar .dashboard-btn-sieve {
  padding: calc(14px * var(--layout-scale) * var(--sidebar-ui-scale))
    calc(8px * var(--layout-scale) * var(--sidebar-ui-scale));
  font-size: calc(14px * var(--layout-scale) * var(--sidebar-ui-scale));
  border-radius: calc(10px * var(--layout-scale) * var(--sidebar-ui-scale));
}

/* ── モバイル（767px 以下） ── */
.dashboard-root.is-mobile {
  width: 100%;
  max-width: 100%;
  height: 100vh;
  height: 100dvh;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}

.dashboard-root.is-mobile .dashboard-mobile-header {
  position: sticky;
  top: 0;
  z-index: 60;
  flex-shrink: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 4px;
  align-items: stretch;
  width: 100%;
  padding: 8px 4px;
  box-sizing: border-box;
  background: var(--page-bg);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.dashboard-root.is-mobile .dashboard-mobile-header > .dashboard-control-group--sampling,
.dashboard-root.is-mobile .dashboard-mobile-header-display {
  min-width: 0;
  max-width: 100%;
  width: 100%;
}

.dashboard-root.is-mobile .dashboard-mobile-header-display {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.dashboard-root.is-mobile .dashboard-mobile-header .dashboard-control-group {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.dashboard-root.is-mobile .dashboard-mobile-header .dashboard-sampling-frame {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  flex: 1;
  padding: 10px 8px 12px;
  min-height: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

.dashboard-root.is-mobile .dashboard-mobile-header .dashboard-sampling-title {
  font-size: 15px;
  margin-bottom: 8px;
  flex-shrink: 0;
}

.dashboard-root.is-mobile .dashboard-mobile-header .dashboard-sampling-btns {
  flex: 1;
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.dashboard-root.is-mobile .dashboard-mobile-header .dashboard-sampling-btn {
  flex: 1;
  min-height: 52px;
  padding: 10px 4px;
  font-size: 17px;
  border-width: 3px;
  border-radius: 10px;
}

.dashboard-root.is-mobile .dashboard-mobile-header .dashboard-radio-row {
  font-size: 15px;
  gap: 8px;
  margin-bottom: 8px;
  padding: 6px 0;
  flex-shrink: 0;
}

.dashboard-root.is-mobile .dashboard-mobile-header .dashboard-radio-row:last-child {
  margin-bottom: 0;
}

.dashboard-root.is-mobile .dashboard-mobile-header .dashboard-radio-dot {
  width: 17px;
  height: 17px;
  border-width: 2px;
  flex-shrink: 0;
}

.dashboard-root.is-mobile .dashboard-filter-popover {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 70;
}

.dashboard-root.is-mobile .dashboard-scale-layer {
  flex: 1;
  min-height: 0;
  width: 100%;
  height: auto;
  transform: none !important;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.dashboard-root.is-mobile .dashboard-mobile-scroll {
  flex: 1;
  min-height: 0;
  width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.dashboard-root.is-mobile .dashboard-main {
  flex: none;
  min-height: 0;
  width: 100%;
  max-width: 100%;
  align-self: stretch;
  overflow: visible;
  display: flex;
  flex-direction: column;
}

.dashboard-root.is-mobile .dashboard-content-block {
  flex: 0 0 auto;
  min-height: auto;
  margin-right: 0;
  width: 100%;
  max-width: 100%;
  overflow: visible;
  gap: 16px;
}

.dashboard-root.is-mobile .dashboard-top {
  margin-top: 8px;
  padding-inline: 12px;
  border-radius: 8px;
}

.dashboard-root.is-mobile .dashboard-top-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-inline: 4px;
}

.dashboard-root.is-mobile .dashboard-top-title-row .dashboard-top-title {
  flex: 1;
  text-align: left;
  font-size: 22px;
  padding: 8px 0 4px;
}

.dashboard-root.is-mobile .dashboard-data-log-btn {
  flex-shrink: 0;
  margin-left: 8px;
  padding: 4px 12px;
  font-size: 13px;
  font-weight: bold;
  color: #fff;
  background: #2f00ff;
  border: 2px solid #1a00a8;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.4;
}

.dashboard-root.is-mobile .dashboard-top .dashboard-graphs-row,
.dashboard-root.is-mobile .dashboard-combined .dashboard-graphs-row {
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 12px;
  padding-inline: 8px;
  padding-bottom: 8px;
  box-sizing: border-box;
}

.dashboard-root.is-mobile .dashboard-lower {
  flex: 0 0 auto;
  min-height: auto;
  flex-direction: column;
  gap: 16px;
  overflow: visible;
}

.dashboard-root.is-mobile .dashboard-sidebar {
  display: none;
}

.dashboard-root.is-mobile .dashboard-combined {
  width: 100%;
  align-items: stretch;
  overflow: visible;
}

.dashboard-root.is-mobile .dashboard-combined-panel {
  width: 100%;
  max-width: 100%;
  align-self: stretch;
  padding-inline: 12px;
  box-sizing: border-box;
}

.dashboard-root.is-mobile .dashboard-combined-title {
  font-size: 22px;
}

.dashboard-root.is-mobile .dashboard-combined-panel .dashboard-graphs-row {
  padding-inline: 8px;
}

.dashboard-root.is-mobile .dashboard-graph-slot {
  width: 100%;
  max-width: 100%;
}

.dashboard-root.is-mobile .dashboard-graph-frame {
  max-width: 100%;
  box-sizing: border-box;
}

.dashboard-root.is-mobile .dashboard-combined .dashboard-graph-frame {
  max-width: 100%;
  box-sizing: border-box;
}

.dashboard-root.is-mobile .dashboard-combined .dashboard-graph-frame > div {
  max-width: 100%;
}

.dashboard-root.is-mobile .dashboard-mobile-sieve-footer {
  flex-shrink: 0;
  margin-top: 8px;
  padding: 12px 12px 28px;
  box-sizing: border-box;
}

.dashboard-root.is-mobile .dashboard-mobile-sieve-footer .dashboard-btn-sieve {
  width: 100%;
  padding: 14px 12px;
  font-size: 15px;
}

.dashboard-root:not(.is-data-log-visible) #data-log {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.dashboard-root:not(.is-mobile) .dashboard-data-log-overlay {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.dashboard-root.is-mobile .dashboard-data-log-overlay:not([hidden]) {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

.dashboard-root.is-mobile .dashboard-data-log-overlay-inner {
  position: relative;
  width: min(100%, 360px);
  max-height: min(80vh, 560px);
  display: flex;
  flex-direction: column;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.dashboard-root.is-mobile .dashboard-data-log-overlay-close {
  position: absolute;
  top: 6px;
  right: 8px;
  z-index: 2;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
}

.dashboard-root.is-mobile .dashboard-data-log--overlay {
  position: relative;
  left: auto;
  top: auto;
  bottom: auto;
  width: 100%;
  height: 100%;
  max-height: min(80vh, 560px);
  transform: none !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

.dashboard-root.is-mobile .dashboard-data-log--overlay .dashboard-data-log-list {
  max-height: calc(min(80vh, 560px) - 48px);
}
