/* Builelib stylesheet layer: 10-interface.css */

/* モダンインターフェイス */
:root {
  --ink: #17252b;
  --muted: #65747a;
  --line: #dce6e3;
  --surface: #ffffff;
  --surface-soft: #f3f7f5;
  --brand: #087f6b;
  --brand-dark: #075e52;
  --brand-pale: #e3f4ef;
  --accent: #d6f06f;
  --danger: #c14343;
  --shadow-sm: 0 8px 24px rgba(26, 55, 49, 0.07);
  --shadow-lg: 0 24px 70px rgba(26, 55, 49, 0.12);
}

html {
  scroll-behavior: smooth;
}

body {
  padding: 0;
  color: var(--ink);
  background: #f7faf8;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--brand-dark);
  text-underline-offset: 3px;
}

.footerFixed {
  min-height: 100vh;
  padding-bottom: 0;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

/* 既存の補助ページも読みやすい幅に揃える */
.footerFixed > h2,
.footerFixed > p,
.footerFixed > ul {
  width: min(100% - 48px, 1120px);
  margin-right: auto;
  margin-left: auto;
}

.footerFixed > h2 {
  margin-top: 30px;
  margin-bottom: 10px;
  color: var(--ink);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.footerFixed > p,
.footerFixed > ul {
  color: #52636a;
  font-size: 13px;
}

.footerFixed > ul {
  padding: 18px 22px 18px 40px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}

.footerFixed > ul li {
  margin: 0;
  padding: 5px 0;
  font-size: 13px;
}

/* ヘッダーの新しい見た目 */
header {
  height: 76px;
  padding: 0;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.94);
  background-image: none;
  border-bottom: 1px solid rgba(220, 230, 227, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.header-inner {
  width: min(100% - 48px, 1320px);
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 18px;
}

.header-spacer {
  flex: 0 0 76px;
  height: 76px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: #fff;
  background: var(--brand);
  font: 700 21px/1 "Source Sans Pro", sans-serif;
  box-shadow: 0 8px 18px rgba(8, 127, 107, 0.2);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.08;
}

.brand-copy strong {
  font-family: "Source Sans Pro", "Noto Sans JP", sans-serif;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.brand-copy small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.version-badge {
  padding: 4px 9px;
  color: var(--brand-dark);
  background: var(--brand-pale);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.header-inner > .version-badge {
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: 11px;
}

header nav.pc-nav {
  margin: 0;
}

.language-switch {
  margin-left: auto;
  padding: 3px;
  display: flex;
  gap: 2px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 9px;
}

.language-switch button {
  min-width: 42px;
  padding: 5px 9px;
  color: #65747a;
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.language-switch button.active {
  color: #fff;
  background: var(--brand);
  box-shadow: 0 3px 8px rgba(8, 127, 107, 0.18);
}

header ul.header {
  align-items: center;
  gap: 8px;
}

header li.header {
  margin: 0;
  padding: 0;
}

header a.header {
  display: block;
  padding: 9px 14px;
  border-radius: 9px;
  color: #405158;
  font-size: 13px;
  font-weight: 600;
  transition: color 0.2s ease, background-color 0.2s ease;
}

header a.header:hover {
  color: var(--brand-dark);
  background: var(--surface-soft);
}

header a.nav-github {
  padding-inline: 16px;
  color: #fff;
  background: var(--ink);
}

header a.nav-github:hover {
  color: #fff;
  background: var(--brand-dark);
}

#hamburger {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

/* ファーストビュー */
.hero {
  position: relative;
  margin-top: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 78% 15%, rgba(214, 240, 111, 0.35) 0, rgba(214, 240, 111, 0) 27%),
    linear-gradient(135deg, #edf7f3 0%, #f8fbf9 58%, #eef4e1 100%);
  border-bottom: 1px solid var(--line);
}

.hero::after {
  content: "";
  position: absolute;
  top: 50%;
  right: max(5vw, 40px);
  width: 280px;
  height: 280px;
  border: 1px solid rgba(8, 127, 107, 0.17);
  border-radius: 52% 48% 60% 40%;
  transform: translateY(-50%) rotate(18deg);
  box-shadow: inset 0 0 0 48px rgba(255, 255, 255, 0.22), inset 0 0 0 49px rgba(8, 127, 107, 0.1);
}

.hero-inner {
  position: relative;
  z-index: 1;
  width: min(100% - 48px, 1320px);
  margin: 0 auto;
  padding: 74px 0 66px;
}

.eyebrow,
.section-kicker,
.card-kicker {
  color: var(--brand);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  text-transform: uppercase;
}

.eyebrow span {
  width: 28px;
  height: 2px;
  background: var(--brand);
}

.hero h1 {
  margin: 20px 0 18px;
  max-width: 820px;
  color: var(--ink);
  font-size: clamp(34px, 5vw, 64px);
  font-weight: 600;
  line-height: 1.32;
  letter-spacing: -0.055em;
}

.hero h1 em {
  color: var(--brand);
  font-style: normal;
}

.hero-lead,
.hero-en {
  max-width: 680px;
  margin: 0;
  padding: 0;
}

.hero-lead {
  color: #37494f;
  font-size: 17px;
  font-weight: 500;
}

.hero-en {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.hero-points span {
  padding: 7px 12px;
  color: #38514f;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(8, 127, 107, 0.14);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

/* 計算ワークスペース */
.container {
  max-width: 1320px;
  gap: 24px;
  padding: 0 24px;
}

.workspace {
  padding-top: 40px;
  padding-bottom: 64px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.section-heading h2 {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.035em;
}

.workspace-heading-copy {
  max-width: 760px;
}

.section-heading h1 {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.035em;
}

.section-heading h1 small {
  display: inline-block;
  margin-left: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0;
}

.workspace-intro {
  margin: 8px 0 0;
  padding: 0;
  color: #52636a;
  font-size: 13px;
  line-height: 1.55;
}

.workspace-intro span {
  color: #879590;
  font-size: 11px;
}

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

.text-link small {
  margin-left: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
}

.text-link span {
  display: inline-block;
  margin-left: 4px;
  transition: transform 0.2s ease;
}

.text-link:hover span {
  transform: translateX(4px);
}

.container .top-row {
  gap: 20px;
}

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

.tile {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

body #drop-zone {
  flex: 0 0 43%;
  position: relative;
  margin: 0;
  padding: 42px 28px;
  color: var(--ink);
  background: var(--brand-pale);
  border: 1.5px dashed rgba(8, 127, 107, 0.48) !important;
  border-radius: 18px;
  cursor: pointer;
  outline: none;
  transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

body #drop-zone:hover,
body #drop-zone:focus-visible,
body #drop-zone.highlight {
  border-color: var(--brand) !important;
  background: #d8f0e9;
  box-shadow: 0 18px 45px rgba(8, 127, 107, 0.13);
  transform: translateY(-2px);
}

#drop-message {
  display: flex;
  align-items: center;
  flex-direction: column;
  text-align: center;
}

#drop-message strong {
  margin-top: 16px;
  font-size: 18px;
  font-weight: 600;
}

#drop-message .upload-button {
  min-width: 220px;
  margin-top: 16px;
  padding: 11px 20px;
  color: #fff;
  background: var(--brand);
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(8, 127, 107, 0.18);
}

#drop-message .upload-button small {
  display: block;
  margin: 1px 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 9px;
  font-weight: 500;
}

#drop-message > span:not(.upload-icon) {
  margin-top: 5px;
  color: #47645e;
  font-size: 13px;
}

#drop-message small {
  margin-top: 2px;
  color: #758983;
  font-size: 11px;
}

.upload-icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--brand);
  font-size: 25px;
  line-height: 1;
  box-shadow: 0 10px 24px rgba(8, 127, 107, 0.22);
}

.upload-icon.calculating {
  animation: spin 1.1s linear infinite;
}

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

body #history-zone {
  flex: 1 1 0;
  padding: 28px;
}

.history-header {
  align-items: flex-start;
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid #edf1ef;
}

body #history-zone h3,
body #result-zone h3 {
  margin: 3px 0 0;
  color: var(--ink);
  font-size: 18px;
  font-weight: 600;
}

body #history-zone h3 small,
body #result-zone h3 small {
  margin-left: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
}

.history-actions {
  margin: 0;
}

.history-actions button {
  padding: 7px 11px;
  border-color: var(--line);
  background: var(--surface-soft);
  border-radius: 8px;
  color: #52636a;
  font-size: 11px;
}

.history-actions button:hover {
  color: var(--danger);
  border-color: rgba(193, 67, 67, 0.25);
  background: #fff4f4;
}

.empty-state {
  margin: 52px 0 0;
  padding: 0;
  color: #8a9995;
  font-size: 12px;
  text-align: center;
}

.empty-state span {
  color: #a0aca8;
  font-size: 10px;
}

#history-list li {
  margin: 0;
  padding: 10px 8px;
  min-height: 48px;
  border-bottom-color: #edf1ef;
  border-radius: 8px;
}

#history-list li:hover {
  background: var(--surface-soft);
}

#history-list li.selected {
  background: var(--brand-pale);
}

#history-list .history-slot-empty {
  color: #9aa8a4;
  background: #fafcfb;
  border: 1px dashed #e0e8e5;
  cursor: default;
}

#history-list .history-slot-empty + .history-slot-empty {
  margin-top: 5px;
}

#history-list .history-slot-empty:hover {
  background: #fafcfb;
}

.slot-number {
  width: 30px;
  color: #afbbb7;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.slot-label {
  color: #9aa8a4;
  font-size: 11px;
}

#history-list .status.success {
  background: var(--brand);
}

body #result-zone {
  padding: 28px;
  border: 1px solid var(--line);
}

.result-heading {
  margin-bottom: 20px;
}

/* 計算結果のタブと表 */
.tabs {
  width: 100%;
  margin: 0;
  padding: 8px 8px 26px;
  overflow: hidden;
  background: #f8faf9;
  border: 1px solid #e7eeeb;
  border-radius: 14px;
  box-shadow: none;
}

.tab_item {
  width: calc(100% / 8);
  height: 42px;
  line-height: 42px;
  color: #65747a;
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.tab_item:hover {
  color: var(--brand-dark);
  background: #ecf3f0;
  opacity: 1;
}

.tabs input:checked + .tab_item {
  color: #fff;
  background: var(--brand);
  box-shadow: 0 6px 14px rgba(8, 127, 107, 0.2);
}

.tab_content {
  padding: 30px 14px 0;
}

.ac-subtabs {
  flex-wrap: wrap;
  gap: 7px;
  margin: 4px 0 20px;
}

.ac-subtab-button,
.v-subtab-button,
.l-subtab-button,
.hw-subtab-button,
.ev-subtab-button,
.pv-subtab-button,
.cgs-subtab-button {
  padding: 8px 13px;
  color: #56686f;
  background: #fff;
  border-color: var(--line);
  border-radius: 8px;
  font-size: 12px;
}

.ac-subtab-button.active,
.v-subtab-button.active,
.l-subtab-button.active,
.hw-subtab-button.active,
.ev-subtab-button.active,
.pv-subtab-button.active,
.cgs-subtab-button.active {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
  box-shadow: 0 5px 12px rgba(8, 127, 107, 0.18);
}

table.result-table {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 12px;
}

table.result-table th,
table.result-table td {
  padding: 9px 12px;
  border-color: #e7eeeb;
}

#result-zone table.result-table,
#result-zone table.result-table th,
#result-zone table.result-table td,
#result-zone table.ac-detail-table,
#result-zone table.ac-detail-table th,
#result-zone table.ac-detail-table td,
#result-zone table.tablesorter,
#result-zone table.tablesorter th,
#result-zone table.tablesorter td {
  color: #111 !important;
}

#result-zone h4,
#result-zone .tab_item,
#result-zone .ac-subtab-button,
#result-zone .v-subtab-button,
#result-zone .l-subtab-button,
#result-zone .hw-subtab-button,
#result-zone .ev-subtab-button,
#result-zone .pv-subtab-button,
#result-zone .cgs-subtab-button {
  color: #111;
}

#result-zone .tabs input:checked + .tab_item,
#result-zone .ac-subtab-button.active,
#result-zone .v-subtab-button.active,
#result-zone .l-subtab-button.active,
#result-zone .hw-subtab-button.active,
#result-zone .ev-subtab-button.active,
#result-zone .pv-subtab-button.active,
#result-zone .cgs-subtab-button.active {
  color: #fff !important;
}

#chartdiv1 text {
  fill: #111 !important;
}

table.result-table th,
.table-scroll thead th {
  color: #405158;
  background: #edf4f1;
}

.result-table tr:hover td,
.result-table tr:hover th {
  background: #e6f3ee !important;
}

.chartdiv {
  width: 100%;
}

/* 補足情報を折りたたんで整理 */
.information {
  padding-top: 12px;
  padding-bottom: 88px;
}

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

.detail-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 5px 18px rgba(26, 55, 49, 0.04);
}

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

.detail-card summary {
  min-height: 88px;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  list-style: none;
  cursor: pointer;
}

.detail-card summary::-webkit-details-marker {
  display: none;
}

.detail-card summary::after {
  content: "+";
  width: 30px;
  height: 30px;
  margin-left: auto;
  display: grid;
  place-items: center;
  color: var(--brand);
  background: var(--brand-pale);
  border-radius: 50%;
  font-size: 18px;
  font-weight: 400;
}

.detail-card[open] summary::after {
  content: "−";
}

.detail-number {
  color: #99aaa5;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

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

.detail-card summary strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
}

.detail-card summary small {
  margin-top: 1px;
  color: var(--muted);
  font-size: 10px;
}

.latest-version {
  margin-left: auto;
  padding: 5px 9px;
  color: var(--brand-dark);
  background: var(--brand-pale);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
}

.detail-card summary .latest-version + * {
  margin-left: 0;
}

.detail-content {
  margin: 0;
  padding: 0 22px 22px;
  color: #4e6067;
  border-top: 1px solid #edf1ef;
}

.detail-content ul {
  margin: 16px 0 0;
  padding: 0 0 0 18px;
}

.detail-content li {
  margin: 0;
  padding: 4px 0;
  color: #4e6067;
  font-size: 12px;
}

.detail-content span[style] {
  color: var(--muted) !important;
}

html[lang="ja"] .bilingual-pairs > :nth-child(odd),
html[lang="en"] .bilingual-pairs > :nth-child(even) {
  display: none;
}

.info {
  width: auto;
  height: min(45vh, 420px);
  overflow: auto;
  background: #fbfdfc;
  font-size: 11px;
  line-height: 1.55;
}

.info dl {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 12px;
  margin: 0;
  padding: 12px 0;
  border-bottom-color: #e7eeeb;
}

.info dt,
.info dd {
  width: auto;
  margin: 0;
}

/* フッターの新しい見た目 */
footer {
  position: static;
  margin-top: auto;
  padding: 26px 0;
  color: #cbd9d5;
  background: var(--ink);
  background-image: none;
}

.footer-inner {
  width: min(100% - 48px, 1320px);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.footer-brand {
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
}

p.footer {
  margin: 0;
  padding: 0;
  color: #9fb0ac;
  font-size: 10px;
}

@media screen and (max-width: 1000px) {
  .header-inner {
    width: min(100% - 32px, 1320px);
  }

  .language-switch {
    margin-left: auto;
  }

  #hamburger {
    width: 30px;
    height: 25px;
    margin-left: auto;
  }

  #hamburger span,
  #hamburger::before,
  #hamburger::after {
    height: 2px;
    background-color: var(--ink);
  }

  .sp-nav {
    margin: 0;
    background: rgba(23, 37, 43, 0.97);
  }

  .sp-nav li a,
  .sp-nav li span {
    color: #fff;
  }

  .hero::after {
    right: -130px;
    opacity: 0.65;
  }

  .top-row {
    flex-direction: column;
  }

  body #drop-zone {
    flex-basis: auto;
    min-height: 270px;
  }
}

@media screen and (max-width: 700px) {
  header {
    height: 68px;
  }

  .header-spacer {
    flex-basis: 68px;
    height: 68px;
  }

  .brand-copy small,
  .version-badge {
    display: none;
  }

  .language-switch button {
    min-width: 36px;
    padding-inline: 7px;
  }

  .hero-inner {
    width: min(100% - 36px, 1320px);
    padding: 54px 0 48px;
  }

  .hero h1 {
    margin-top: 16px;
    font-size: clamp(31px, 10vw, 46px);
    line-height: 1.35;
  }

  .hero-lead {
    font-size: 14px;
  }

  .hero-en {
    font-size: 10px;
  }

  .workspace {
    padding-top: 30px;
    padding-bottom: 46px;
  }

  .container {
    padding-inline: 18px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .section-heading h1 small {
    display: block;
    margin: 3px 0 0;
    font-size: 12px;
  }

  .section-heading h2 {
    font-size: 24px;
  }

  .text-link {
    margin-top: 7px;
    font-size: 11px;
  }

  .tile,
  body #history-zone,
  body #result-zone {
    padding: 20px;
    border-radius: 14px;
  }

  .history-header {
    flex-direction: column;
  }

  .history-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .tabs {
    padding: 6px 6px 20px;
  }

  .tab_item {
    width: 25%;
    font-size: 10px;
  }

  .tab_content {
    padding: 24px 4px 0;
  }

  .details-grid {
    grid-template-columns: 1fr;
  }

  .detail-card-wide {
    grid-column: auto;
  }

  .detail-card summary {
    min-height: 78px;
    padding: 15px 17px;
  }

  .latest-version {
    display: none;
  }

  .detail-content {
    padding: 0 17px 18px;
  }

  .info dl {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .info dt {
    color: var(--brand-dark);
    font-weight: 700;
  }

  .footer-inner {
    width: min(100% - 36px, 1320px);
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
