/* Builelib stylesheet layer: 50-analysis-report.css */

/* ケース管理と比較 */
.history-actionbar {
  margin: -6px 0 10px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #f4f8f6;
  border: 1px solid #e3ebe8;
  border-radius: 9px;
}

.history-actionbar > span {
  color: #71847f;
  font-size: 9px;
}

.history-actionbar > div {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.history-actionbar button {
  padding: 5px 9px;
  color: var(--brand-dark);
  background: #fff;
  border: 1px solid #d6e3df;
  border-radius: 6px;
  font-size: 9px;
  font-weight: 600;
  cursor: pointer;
}

.history-actionbar #history-compare {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}

.history-actionbar button:disabled {
  color: #a7b3b0;
  background: #f2f5f4;
  border-color: #e5ebe9;
  cursor: not-allowed;
}

.history-table th:nth-child(1),
.history-table td:nth-child(1) { width: 34px; text-align: center; }
.history-table th:nth-child(2),
.history-table td:nth-child(2) { width: auto; text-align: left; }
.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: 120px; text-align: left; }
.history-table th:nth-child(5),
.history-table td:nth-child(5) { width: 70px; text-align: center; }

.history-table .filename {
  position: relative;
  white-space: normal;
}

.history-table .case-name {
  max-width: 100%;
  display: inline-block;
  overflow: hidden;
  vertical-align: middle;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-table .filename small {
  max-width: 100%;
  margin-top: 1px;
  display: block;
  overflow: hidden;
  color: #879793;
  font-size: 8px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.baseline-badge {
  margin-left: 5px;
  padding: 2px 5px;
  display: inline-flex;
  vertical-align: middle;
  color: #795a14;
  background: #fff1c9;
  border-radius: 999px;
  font-size: 7px;
  font-weight: 700;
}

.comparison-zone {
  margin-top: 20px;
  padding: 28px;
}

.comparison-zone[hidden] {
  display: none !important;
}

.comparison-heading {
  padding-bottom: 17px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid #e7eeeb;
}

.comparison-heading h2 {
  margin: 3px 0 0;
  color: var(--ink);
  font-size: 21px;
  font-weight: 650;
}

.comparison-heading > button {
  padding: 7px 11px;
  color: #60747a;
  background: #f4f7f6;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 9px;
  cursor: pointer;
}

.comparison-loading,
.comparison-error {
  margin: 35px 0;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.comparison-error {
  color: #a64a4a;
}

.comparison-kpi-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.comparison-kpi {
  min-height: 145px;
  padding: 16px;
  background: #f8fbfa;
  border: 1px solid var(--line);
  border-radius: 11px;
}

.comparison-kpi.is-baseline {
  background: #fffaf0;
  border-top: 3px solid var(--accent);
}

.comparison-kpi > div {
  min-height: 38px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.comparison-kpi h3 {
  margin: 0;
  color: var(--ink);
  font-size: 12px;
  font-weight: 650;
}

.comparison-kpi > div > span {
  padding: 3px 6px;
  flex: 0 0 auto;
  color: #795a14;
  background: #fff0c3;
  border-radius: 999px;
  font-size: 7px;
  font-weight: 700;
}

.comparison-kpi dl {
  margin: 10px 0 0;
  display: grid;
  grid-template-columns: 0.75fr 1.25fr;
  gap: 8px;
}

.comparison-kpi dl > div {
  display: flex;
  flex-direction: column;
}

.comparison-kpi dt {
  color: var(--muted);
  font-size: 8px;
}

.comparison-kpi dd {
  margin: 2px 0 0;
  color: var(--ink);
  font-family: "Source Sans 3", sans-serif;
  font-size: 21px;
  font-weight: 650;
}

.comparison-kpi dd small {
  color: var(--muted);
  font-size: 8px;
  font-weight: 500;
}

.comparison-kpi > p {
  margin: 9px 0 0;
  color: #6c817c;
  font-size: 8px;
}

.comparison-kpi .comparison-bei-delta {
  min-height: 30px;
  margin-top: 11px;
  padding: 6px 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #21445f;
  background: #edf5fa;
  border: 1px solid #c7dce9;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 700;
}

.comparison-kpi .comparison-bei-delta strong {
  color: #123f78;
  font-family: "Source Sans 3", "Noto Sans JP", sans-serif;
  font-size: 16px;
  line-height: 1;
}

.comparison-kpi .comparison-bei-delta.is-improved {
  color: #075f50;
  background: #e9f7f2;
  border-color: #9fd4c3;
}

.comparison-kpi .comparison-bei-delta.is-improved strong {
  color: #006c5b;
}

.comparison-kpi .comparison-bei-delta.is-increased {
  color: #8b3b32;
  background: #fff2ef;
  border-color: #efc0b8;
}

.comparison-kpi .comparison-bei-delta.is-increased strong {
  color: #a43d32;
}

.comparison-panel {
  margin-top: 14px;
  padding: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 11px;
}

.comparison-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.comparison-panel-heading h3 {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
}

.comparison-panel-heading span {
  color: var(--muted);
  font-size: 8px;
}

.comparison-energy-bars {
  margin-top: 18px;
  display: grid;
  gap: 13px;
}

.comparison-energy-row {
  display: grid;
  align-items: center;
  grid-template-columns: minmax(100px, 160px) minmax(250px, 1fr) 92px 105px;
  gap: 10px;
}

.comparison-energy-row > strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comparison-energy-bar {
  height: 24px;
  display: flex;
  align-items: stretch;
  background: #edf2f1;
  border-radius: 5px;
  overflow: hidden;
}

.comparison-energy-bar i {
  height: 100%;
  display: block;
}

.comparison-energy-row > span {
  color: var(--ink);
  font-family: "Source Sans 3", sans-serif;
  font-size: 11px;
  font-weight: 650;
  text-align: right;
}

.comparison-energy-row > small {
  color: #7c718c;
  font-size: 8px;
  text-align: right;
}

#comparison-monthly-chart {
  width: 100%;
  height: 290px;
}

#comparison-annual-chart {
  width: 100%;
  height: 390px;
}

.comparison-table {
  width: 100%;
  margin-top: 15px;
  border-collapse: collapse;
  font-size: 9px;
}

.comparison-table th,
.comparison-table td {
  padding: 9px 10px;
  color: #17252b;
  border-bottom: 1px solid #e6eeeb;
  text-align: right;
}

.comparison-table thead th {
  color: #5d7177;
  background: #eef5f2;
  font-weight: 650;
}

.comparison-table th:first-child {
  text-align: left;
}

.comparison-table tbody th {
  font-weight: 550;
}

.comparison-table tbody th i,
.report-energy-table tbody th i {
  width: 7px;
  height: 7px;
  margin-right: 6px;
  display: inline-block;
  border-radius: 2px;
}

.case-edit-dialog {
  width: min(92vw, 520px);
  padding: 0;
  color: var(--ink);
  background: #fff;
  border: 0;
  border-radius: 16px;
  box-shadow: 0 28px 80px rgba(16,45,58,0.22);
}

.case-edit-dialog::backdrop {
  background: rgba(9,35,43,0.52);
  backdrop-filter: blur(3px);
}

.case-edit-dialog form {
  padding: 26px;
}

.case-dialog-heading {
  margin-bottom: 21px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.case-dialog-heading h2 {
  margin: 3px 0 0;
  color: var(--ink);
  font-size: 20px;
  font-weight: 650;
}

.case-dialog-heading > button {
  width: 30px;
  height: 30px;
  color: #71827f;
  background: #f2f6f4;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
}

.case-edit-dialog label:not(.case-baseline-option) {
  margin: 13px 0 6px;
  display: block;
  color: #52676d;
  font-size: 10px;
  font-weight: 650;
}

.case-edit-dialog input[type="text"],
.case-edit-dialog textarea {
  width: 100%;
  padding: 10px 12px;
  color: var(--ink);
  background: #f8fbfa;
  border: 1px solid #cfddda;
  border-radius: 8px;
  font-size: 12px;
}

.case-edit-dialog textarea {
  resize: vertical;
}

.case-edit-dialog input:focus,
.case-edit-dialog textarea:focus {
  border-color: var(--brand);
  outline: 3px solid rgba(8,122,116,0.1);
}

.case-baseline-option {
  margin-top: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #52676d;
  font-size: 10px;
  cursor: pointer;
}

.case-dialog-actions {
  margin-top: 22px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.case-dialog-actions button {
  padding: 8px 15px;
  color: #5c7076;
  background: #f3f7f5;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 10px;
  font-weight: 650;
  cursor: pointer;
}

.case-dialog-actions button:last-child {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}

/* 簡易レポート */
.report-body {
  min-height: 100vh;
  color: var(--ink);
  background: #edf2f0;
}

.report-toolbar {
  height: 68px;
  padding: 0 max(20px, calc((100vw - 1100px) / 2));
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: rgba(255,255,255,0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

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

.report-toolbar-brand .brand-logo-frame {
  width: 218px;
  height: 58px;
}

.report-toolbar-brand .brand-logo {
  width: 245px;
  left: -14px;
  top: -38px;
}

.report-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.report-toolbar .language-switch {
  order: initial;
  margin: 0 5px 0 0;
}

.report-toolbar-actions > a,
.report-toolbar-actions > button {
  padding: 8px 12px;
  color: var(--brand-dark);
  background: #f3f7f5;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 9px;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
}

.report-toolbar-actions > button {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}

.report-document {
  width: min(calc(100% - 32px), 1050px);
  min-height: 1280px;
  margin: 28px auto 60px;
  padding: 42px 50px;
  background: #fff;
  box-shadow: 0 20px 60px rgba(16,45,58,0.12);
}

.report-loading,
.report-error {
  padding: 80px 20px;
  color: var(--muted);
  text-align: center;
}

.report-error {
  color: #a24e4e;
}

.report-cover-header {
  padding-bottom: 20px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 2px solid var(--brand-dark);
}

.report-cover-header > div {
  display: flex;
  flex-direction: column;
}

.report-cover-header > div span {
  color: var(--brand-dark);
  font-family: "Source Sans 3", sans-serif;
  font-size: 25px;
  font-weight: 700;
}

.report-cover-header > div small {
  color: var(--muted);
  font-size: 7px;
  letter-spacing: 0.06em;
}

.report-cover-header > p {
  margin: 0;
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  color: var(--ink);
  font-size: 12px;
  font-weight: 650;
}

.report-cover-header > p small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 500;
}

.report-title-section {
  padding: 31px 0 25px;
  position: relative;
}

.report-title-section h1 {
  margin: 6px 0 17px;
  color: var(--ink);
  font-size: 30px;
  font-weight: 650;
  letter-spacing: -0.04em;
}

.report-baseline-badge {
  position: absolute;
  right: 0;
  top: 34px;
  padding: 5px 9px;
  color: #745715;
  background: #fff0c5;
  border-radius: 999px;
  font-size: 8px;
  font-weight: 700;
}

.report-baseline-badge[hidden] {
  display: none !important;
}

.report-meta {
  margin: 0;
  padding: 13px 16px;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 15px;
  background: #f5f8f7;
  border-radius: 8px;
}

.report-meta > div {
  min-width: 0;
}

.report-meta dt {
  color: #7a8c88;
  font-size: 7px;
}

.report-meta dd {
  margin: 3px 0 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-memo-block {
  margin-top: 14px;
  padding: 12px 15px;
  background: #fffaf0;
  border-left: 3px solid var(--accent);
  border-radius: 6px;
}

.report-memo-block h2 {
  margin: 0 0 4px;
  color: #705b2d;
  font-size: 9px;
}

.report-memo-block p {
  margin: 0;
  color: #6e6653;
  font-size: 9px;
  white-space: pre-wrap;
}

.report-section {
  padding: 25px 0;
  border-top: 1px solid #dce6e3;
}

.report-section-heading {
  margin-bottom: 17px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.report-section-heading > span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--brand-dark);
  border-radius: 50%;
  font-family: "Source Sans 3", sans-serif;
  font-size: 9px;
  font-weight: 700;
}

.report-section-heading small {
  color: var(--brand);
  font-family: "Source Sans 3", sans-serif;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.report-section-heading h2 {
  margin: 1px 0 0;
  color: var(--ink);
  font-size: 16px;
  font-weight: 650;
}

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

.report-kpis article {
  min-height: 108px;
  padding: 16px;
  position: relative;
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  justify-content: center;
  background: #f4f9f7;
  border-left: 3px solid var(--brand);
  border-radius: 8px;
}

.report-kpis article.report-kpi-bei {
  background: #fffaf0;
  border-left-color: var(--accent);
}

.report-kpis article > span {
  color: var(--muted);
  font-size: 8px;
}

.report-kpis strong {
  margin-top: 3px;
  color: var(--ink);
  font-family: "Source Sans 3", sans-serif;
  font-size: 27px;
}

.report-kpis small {
  position: absolute;
  right: 12px;
  bottom: 11px;
  color: var(--muted);
  font-size: 7px;
}

.report-chart {
  width: 100%;
  height: 290px;
}

.report-shared-legend {
  margin-top: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 14px;
}

.report-shared-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #17364d;
  font-size: 13px;
  font-weight: 600;
}

.report-shared-legend i {
  width: 11px;
  height: 11px;
  display: block;
  border-radius: 2px;
}

.report-energy-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.report-energy-table th,
.report-energy-table td {
  padding: 8px 10px;
  color: #172b3e;
  border-bottom: 1px solid #e0e9e6;
  font-weight: 500;
  text-align: right;
}

.report-energy-table thead th {
  color: #17364d;
  background: #edf4f1;
  font-weight: 700;
}

.report-energy-table th:first-child {
  text-align: left;
}

.report-total-row th,
.report-total-row td {
  color: var(--brand-dark);
  background: #f3f8f6;
  font-weight: 700;
}

.report-total-excluding-other-row th,
.report-total-excluding-other-row td {
  background: #e9f2f8;
  border-top: 1px solid #bfd3e2;
}

.report-total-excluding-renewables-row th,
.report-total-excluding-renewables-row td {
  background: #dfeef7;
  border-top: 1px solid #a9c8dc;
}

.report-document-footer {
  padding-top: 18px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 25px;
  color: #71827f;
  border-top: 2px solid var(--brand-dark);
}

.report-document-footer p {
  max-width: 690px;
  margin: 0;
  font-size: 7px;
  line-height: 1.7;
}

.report-document-footer > span {
  flex: 0 0 auto;
  font-family: "Source Sans 3", sans-serif;
  font-size: 7px;
}
