/* Builelib stylesheet layer: 20-results.css */

/* 統一デザイン（ロゴ・アップロード・サマリー） */
:root {
  --ink: #10243a;
  --muted: #405b73;
  --line: #d7e3ee;
  --surface-soft: #f3f8fc;
  --brand: #006b9b;
  --brand-dark: #00577f;
  --brand-pale: #eaf5fb;
  --accent: #f2a009;
  --shadow-sm: 0 10px 30px rgba(14, 73, 111, 0.08);
}

body {
  font-family: "Noto Sans JP", "Source Sans 3", sans-serif;
  font-size: 16px;
  font-weight: 400;
  color: var(--ink);
  background: #f7fafe;
}

.header-inner {
  width: min(100% - 48px, 1380px);
}

.brand {
  width: 218px;
  height: 60px;
  overflow: hidden;
}

.brand-logo-frame {
  width: 218px;
  height: 58px;
  position: relative;
  display: block;
  overflow: hidden;
}

.brand-logo {
  position: absolute;
  width: 245px;
  height: auto;
  left: -14px;
  top: -38px;
  display: block;
}

.language-switch {
  order: 3;
  margin-left: 8px;
}

header nav.pc-nav {
  order: 2;
  margin-left: auto;
}

.language-switch button.active {
  color: #fff;
  background: var(--brand-dark);
}

.container {
  max-width: 1380px;
}

.workspace {
  padding-top: 28px;
}

.container .top-row > .tile {
  min-height: 382px;
}

body #drop-zone {
  flex-basis: 42%;
  padding: 30px 34px 24px;
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: space-between;
  background: linear-gradient(145deg, #eff9f6 0%, #e2f2ee 100%);
  border-color: rgba(8, 122, 116, 0.5) !important;
}

.upload-heading {
  width: 100%;
  text-align: left;
}

.upload-purpose {
  display: block;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.02em;
}

.upload-heading h1 {
  margin: 5px 0 0;
  color: var(--ink);
  font-size: clamp(22px, 2vw, 29px);
  font-weight: 650;
  letter-spacing: -0.035em;
}

#drop-message {
  margin: 10px 0;
}

.upload-icon {
  width: 52px;
  height: 52px;
  font-size: 22px;
}

#drop-message .upload-button {
  min-width: 240px;
  margin-top: 12px;
  background: linear-gradient(135deg, var(--brand-dark), #0b8c82);
}

.upload-template-link {
  color: var(--brand-dark);
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
}

body #history-zone {
  min-width: 0;
  padding: 24px 26px;
}

#history-list {
  width: 100%;
  overflow-x: auto;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 10px;
}

.history-table th,
.history-table td {
  height: 45px;
  padding: 7px 8px;
  overflow: hidden;
  border-bottom: 1px solid #e8efed;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-table thead th {
  height: 29px;
  color: #71848a;
  background: transparent;
  font-size: 9px;
  font-weight: 600;
}

.history-table th:nth-child(1), .history-table td:nth-child(1) { width: 45px; }
.history-table th:nth-child(2), .history-table td:nth-child(2) { width: 32%; }
.history-table th:nth-child(3), .history-table td:nth-child(3) { width: 58px; text-align: center; }
.history-table th:nth-child(4), .history-table td:nth-child(4) { width: 132px; }
.history-table th:nth-child(5), .history-table td:nth-child(5) { width: 72px; text-align: center; }
.history-table th:nth-child(6), .history-table td:nth-child(6) { width: 34px; text-align: center; }

.history-table tbody tr:not(.history-slot-empty) {
  cursor: pointer;
  transition: background-color 0.18s ease;
}

.history-table tbody tr:not(.history-slot-empty):hover,
.history-table tbody tr.selected {
  background: var(--brand-pale);
}

.history-table .history-slot-empty {
  color: #aab7b4;
  background: #fafcfb;
}

.history-table .history-number {
  color: #8da09d;
  font-weight: 700;
}

.history-table .filename {
  color: var(--ink);
  font-weight: 600;
}

.history-table .bei {
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 700;
}

.history-table .datetime {
  color: var(--muted);
}

.history-table .status {
  display: inline-flex;
  padding: 3px 8px;
  color: #fff;
  background: var(--brand);
  border-radius: 999px;
  font-size: 9px;
  line-height: 1.4;
}

.history-table .status.error {
  background: #bc5353;
}

/* 結果表示用のタブの設定 */
.tab_item {
  width: calc(100% / 9);
  height: 44px;
  line-height: 44px;
  font-size: 11px;
}

#summary:checked ~ #summary_content,
#all:checked ~ #all_content,
#AC:checked ~ #AC_content,
#V:checked ~ #V_content,
#L:checked ~ #L_content,
#HW:checked ~ #HW_content,
#EV:checked ~ #EV_content,
#PV:checked ~ #PV_content,
#CGS:checked ~ #CGS_content {
  display: block;
}

.summary-toolbar,
.breakdown-heading,
.chart-card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.summary-toolbar h4,
.breakdown-heading h4,
.chart-card-heading h4,
.breakdown-chart-card h4 {
  margin: 3px 0 0;
  color: var(--ink) !important;
  font-size: 16px;
  font-weight: 650;
}

.result-export-link,
.primary-link {
  display: inline-flex;
  padding: 8px 13px;
  color: var(--brand-dark);
  background: var(--brand-pale);
  border-radius: 8px;
  font-size: 10px;
  font-weight: 650;
  text-decoration: none;
}

.summary-kpis {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.summary-kpi {
  min-height: 112px;
  padding: 18px 22px;
  position: relative;
  display: grid;
  align-content: center;
  background: linear-gradient(135deg, #fff 0%, #f2f8f6 100%);
  border: 1px solid #cddedb;
  border-left: 4px solid var(--brand);
  border-radius: 13px;
  box-shadow: 0 8px 22px rgba(8, 94, 91, 0.07);
}

.summary-kpi-bei {
  border-left-color: var(--accent);
  background: linear-gradient(135deg, #fff 0%, #fff9e9 100%);
}

.summary-kpi-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.summary-kpi strong {
  margin-top: 2px;
  color: var(--ink);
  font-family: "Source Sans 3", "Noto Sans JP", sans-serif;
  font-size: 34px;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.summary-kpi-unit {
  position: absolute;
  right: 19px;
  bottom: 17px;
  color: var(--muted);
  font-size: 9px;
}

.summary-kpi-badge {
  position: absolute;
  right: 18px;
  top: 17px;
  padding: 4px 9px;
  color: #146e4e;
  background: #dff4e8;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
}

.summary-kpi-badge.is-warning {
  color: #9a4b22;
  background: #fff0dc;
}

.summary-chart-card,
.breakdown-chart-card,
.breakdown-table-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 13px;
}

.summary-chart-card {
  margin-top: 16px;
  padding: 17px 18px 8px;
}

.chart-card-heading > span {
  color: var(--muted);
  font-size: 9px;
}

.summary-chart {
  height: 290px;
}

.shared-chart-legend {
  width: fit-content;
  max-width: 100%;
  margin: 14px auto -2px;
  padding: 9px 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px 15px;
  background: #f2f7f5;
  border: 1px solid #e1eae7;
  border-radius: 999px;
}

.shared-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.shared-chart-legend i {
  width: 8px;
  height: 8px;
  background: var(--legend-color);
  border-radius: 2px;
}

.shared-chart-legend b {
  color: #52636a;
  font-size: 9px;
  font-weight: 550;
}

.breakdown-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(320px, 1.2fr);
  gap: 16px;
}

.breakdown-chart-card,
.breakdown-table-card {
  padding: 18px;
}

.breakdown-chart {
  height: 270px;
}

.breakdown-energy-table {
  margin-top: 16px;
}

#chartdiv1 text,
#chartdiv_monthly text,
#chartdiv_breakdown text {
  fill: #102d3a !important;
}

.about-page {
  padding-bottom: 70px;
}

.about-intro {
  padding-top: 58px;
  padding-bottom: 12px;
}

.about-intro h1 {
  margin: 6px 0 12px;
  font-size: clamp(30px, 4vw, 48px);
  letter-spacing: -0.045em;
}

.about-intro p {
  max-width: 760px;
  margin: 0 0 22px;
  color: #52636a;
  font-size: 14px;
}

.about-page .information {
  padding-top: 22px;
  padding-bottom: 20px;
}

@media screen and (max-width: 1000px) {
  .brand { width: 190px; }
  .brand-logo-frame { width: 190px; }
  .brand-logo { width: 218px; top: -33px; }
  .language-switch { order: 2; margin-left: auto; }
  .tab_item { width: 25%; }
  .breakdown-grid { grid-template-columns: 1fr; }
}

@media screen and (max-width: 700px) {
  .brand { width: 150px; height: 54px; }
  .brand-logo-frame { width: 150px; height: 54px; }
  .brand-logo { width: 176px; top: -25px; left: -12px; }
  .container .top-row > .tile { min-height: 330px; }
  body #drop-zone { padding: 25px 22px 20px; }
  .upload-heading h1 { font-size: 22px; }
  .history-table { min-width: 620px; }
  .summary-kpis { grid-template-columns: 1fr; }
  .summary-toolbar, .chart-card-heading { align-items: flex-start; flex-direction: column; gap: 8px; }
  .summary-chart { height: 250px; }
  .shared-chart-legend { border-radius: 13px; }
}
