:root {
  font-family: "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  color: #243f46;
  background: #f5f7f8;
  font-synthesis: none;
  --teal: #126a68;
  --ink: #163a42;
  --muted: #65797f;
  --line: #dce6e8;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select {
  font: inherit;
}
button,
summary,
select {
  cursor: pointer;
}
button {
  transition:
    background 0.16s,
    box-shadow 0.16s;
}
button:disabled {
  cursor: wait;
  opacity: 0.5;
}
button:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: 3px solid #e69e36;
  outline-offset: 4px;
}
input:focus,
select:focus {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}
.skip {
  position: absolute;
  top: -80px;
  background: white;
  padding: 12px;
  z-index: 9;
}
.skip:focus {
  top: 0;
}
.top {
  height: 88px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(32px, calc((100vw - 1360px) / 2));
  gap: 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 25px;
  font-weight: 800;
  letter-spacing: 0.06em;
}
.brand small {
  display: block;
  font-size: 10px;
  letter-spacing: 0.15em;
  color: var(--muted);
  margin-top: 1px;
}
.brandmark {
  width: 43px;
  height: 43px;
  border-radius: 13px;
  background: var(--teal);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 30px;
}
.topright {
  display: flex;
  align-items: center;
  gap: 20px;
}
.demo {
  font-size: 12px;
  background: #fff4da;
  border: 1px solid #ecd8a4;
  border-radius: 30px;
  padding: 8px 12px;
  color: #73500d;
  display: flex;
  align-items: center;
  gap: 7px;
}
.demo i {
  width: 6px;
  height: 6px;
  background: #c38921;
  border-radius: 50%;
}
.local {
  font-size: 12px;
  color: var(--muted);
}
main {
  max-width: 1360px;
  margin: auto;
  padding: 38px 32px 0;
}
.intro {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}
.eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin: 0 0 9px;
}
h1 {
  font-size: 36px;
  line-height: 1.5;
  letter-spacing: 0.01em;
  margin: 0;
  color: var(--ink);
  font-weight: 750;
}
.lead {
  color: var(--muted);
  font-size: 14px;
  margin: 9px 0 0;
}
.mobile {
  display: none;
}
.fresh {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #eaf1ef;
  border: 1px solid #d9e6e1;
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 12px;
}
.fresh strong {
  display: block;
  font-size: 12px;
  color: #36675e;
}
.fresh span:not(.status-dot) {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #397b6e;
  margin-top: 5px;
}
.workspace {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}
.filters {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px;
  position: sticky;
  top: 20px;
}
.sectionhead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 26px;
}
h2 {
  font-size: 19px;
  margin: 0;
}
.sectionhead h2 {
  font-size: 16px;
}
.textbutton {
  border: 0;
  background: none;
  color: var(--teal);
  font-size: 10px;
  padding: 8px 0;
}
.field {
  margin-bottom: 24px;
}
.field > label {
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.step {
  width: 23px;
  height: 23px;
  border-radius: 50%;
  background: #edf4f3;
  color: var(--teal);
  display: inline-grid;
  place-items: center;
  font-size: 12px;
}
select,
input[type="date"] {
  width: 100%;
  min-height: 46px;
  border: 1px solid #cad9dc;
  border-radius: 9px;
  background: white;
  color: var(--ink);
  padding: 10px 9px;
  font-size: 13px;
}
.hint {
  font-size: 11px;
  line-height: 1.7;
  color: var(--muted);
  margin: 9px 0;
}
.presets {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr;
  gap: 5px;
}
.preset {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 9px 2px;
  font-size: 12px;
  color: var(--muted);
}
.preset.active {
  background: var(--teal);
  color: white;
  border-color: var(--teal);
}
.dates {
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
}
.dates > span {
  display: none;
}
.sublabel {
  font-size: 10px;
  color: var(--muted);
  display: block;
  margin-bottom: 4px;
}
details {
  border-radius: 9px;
}
summary {
  font-size: 12px;
  line-height: 1.6;
  padding: 12px 0;
  color: var(--teal);
  font-weight: 600;
}
#metricPanel {
  border: 1px solid #cad9dc;
}
#metricPanel > summary {
  padding: 12px;
}
#selectionCount {
  float: right;
  font-size: 10px;
  color: var(--muted);
}
#metricOptions {
  padding: 0 12px 12px;
}
fieldset {
  border: 0;
  border-top: 1px solid var(--line);
  padding: 8px 0;
  margin: 8px 0;
}
legend {
  font-size: 10px;
  color: var(--muted);
  padding: 0 6px 0 0;
}
fieldset label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  padding: 8px 0;
  line-height: 1.5;
}
input[type="checkbox"] {
  accent-color: var(--teal);
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  margin: 1px 0;
}
.pending-label {
  font-size: 10px;
  color: #876834;
  display: block;
}
.primary {
  width: 100%;
  background: var(--teal);
  color: white;
  border: 0;
  border-radius: 10px;
  padding: 15px;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 5px 12px #126a6818;
}
.primary span {
  float: right;
}
.primary:hover {
  background: #0b5554;
}
.applynote {
  font-size: 10px;
  text-align: center;
  color: var(--muted);
  min-height: 16px;
  margin: 9px 0 0;
}
.applynote.changed {
  color: #985d07;
  font-weight: 700;
}
#formerror {
  font-size: 12px;
  color: #a3342c;
  line-height: 1.6;
}
#formerror:empty {
  display: none;
}
.flow {
  margin-top: 26px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 10px;
  color: #819196;
}
.flow strong {
  color: var(--teal);
}
.resulthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 20px;
}
.resulthead h2 {
  font-size: 24px;
  letter-spacing: 0.01em;
}
.comparison {
  font-size: 11px;
  color: var(--muted);
  margin: 7px 0 0;
}
.secondary {
  border: 1px solid #ccdadd;
  background: #fff;
  padding: 10px 13px;
  color: var(--ink);
  border-radius: 8px;
  font-size: 11px;
  white-space: nowrap;
}
.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}
.card {
  display: block;
  text-align: left;
  width: 100%;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 21px;
  color: var(--ink);
  position: relative;
  min-height: 164px;
}
.card.selected {
  border-color: #73a9a3;
  box-shadow: 0 0 0 1px #73a9a335;
}
.cardlabel {
  font-size: 13px;
  font-weight: 650;
  display: block;
}
.card .smalltag {
  float: right;
  background: #f0f5f4;
  border-radius: 5px;
  font-size: 9px;
  padding: 3px 6px;
  color: var(--muted);
  margin-left: 5px;
}
.cardvalue {
  display: block;
  font-size: 35px;
  font-weight: 750;
  letter-spacing: -0.03em;
  margin: 15px 0 12px;
  line-height: 1.1;
}
.cardvalue .unit {
  font-size: 14px;
  font-weight: 500;
  margin-left: 5px;
  letter-spacing: 0;
}
.cardvalue.pending {
  font-size: 20px;
  margin: 24px 0;
}
.delta {
  font-size: 12px;
  color: var(--teal);
  background: #eef6f5;
  padding: 4px 7px;
  border-radius: 5px;
  display: inline-block;
}
.delta.neutral {
  color: #6d7078;
  background: #f2f3f5;
}
.prevvalue {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-top: 9px;
}
.chartpanel {
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
}
.charthead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
h3 {
  font-size: 17px;
  margin: 0;
  font-weight: 650;
}
.legend {
  display: flex;
  gap: 14px;
  font-size: 10px;
  color: var(--muted);
}
.legend span {
  display: flex;
  align-items: center;
  gap: 5px;
}
.legend i {
  display: inline-block;
  width: 14px;
  height: 3px;
  background: #126a68;
}
.legend i.previous {
  height: 2px;
  background: #abbcc7;
}
.chartpanel > .hint {
  margin: 7px 0 12px;
  font-size: 10px;
}
#chart {
  min-height: 240px;
}
#chart svg {
  width: 100%;
  height: auto;
  display: block;
}
.chartnote {
  font-size: 11px;
  color: var(--muted);
  margin: 12px 0;
}
.chart-empty {
  min-height: 240px;
  display: grid;
  place-content: center;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  background: #f7f9fa;
  border-radius: 10px;
}
#tablePanel {
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 3px;
}
.tablewrap {
  max-height: 320px;
  overflow: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 11px;
}
caption {
  text-align: left;
  color: var(--muted);
  padding: 8px 0;
}
th,
td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
}
th {
  background: #f4f7f8;
  position: sticky;
  top: 0;
  color: var(--muted);
}
th:first-child,
td:first-child {
  text-align: left;
}
.budget {
  margin-top: 20px;
  display: flex;
  gap: 15px;
  padding: 21px 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #eef2f4;
}
.budgeticon {
  font-size: 26px;
  color: #72858d;
}
.budget h3 {
  font-size: 14px;
}
.budget p {
  font-size: 12px;
  color: var(--muted);
  margin: 8px 0 11px;
  line-height: 1.7;
}
.tag {
  display: inline-block;
  font-size: 10px;
  border: 1px solid #ccd8dd;
  border-radius: 5px;
  padding: 3px 6px;
  color: #647982;
  margin-right: 8px;
}
.notes {
  margin-top: 10px;
  padding: 0 4px;
}
.notes p {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.9;
}
.notes summary {
  font-size: 11px;
  color: var(--muted);
}
.notice {
  font-size: 12px;
  padding: 12px 16px;
  line-height: 1.8;
  background: #fff4df;
  border: 1px solid #eed8ad;
  border-radius: 10px;
  margin-bottom: 16px;
  color: #795816;
}
.notice[hidden] {
  display: none;
}
footer {
  display: flex;
  justify-content: space-between;
  padding: 35px 0 25px;
  font-size: 11px;
  color: #7c9096;
  border-top: 1px solid var(--line);
  margin-top: 35px;
}
footer span {
  font-size: 10px;
}
@media (min-width: 1500px) {
  .filters {
    padding: 26px;
  }
}
@media (max-width: 1000px) {
  .workspace {
    grid-template-columns: 265px minmax(0, 1fr);
    gap: 20px;
  }
  .card {
    padding: 17px;
  }
  .cardvalue {
    font-size: 28px;
  }
  .fresh {
    display: none;
  }
  .charthead {
    align-items: flex-start;
    flex-direction: column;
  }
  .local {
    display: none;
  }
  main {
    padding: 28px 22px 0;
  }
  .filters {
    padding: 20px;
  }
  .cardlabel {
    font-size: 12px;
  }
  .card .smalltag {
    float: none;
    display: inline-block;
    margin: 0 0 5px;
  }
  .top {
    padding: 0 24px;
  }
}
@media (max-width: 720px) {
  .top {
    height: 73px;
    padding: 0 18px;
  }
  .brand {
    font-size: 22px;
  }
  .brandmark {
    width: 37px;
    height: 37px;
  }
  .brand small {
    font-size: 9px;
  }
  .demo {
    font-size: 10px;
    padding: 7px 9px;
  }
  .workspace {
    grid-template-columns: 1fr;
    gap: 26px;
  }
  .filters {
    position: static;
    padding: 20px;
  }
  .intro {
    margin-bottom: 22px;
  }
  h1 {
    font-size: 29px;
  }
  .lead {
    font-size: 12px;
  }
  .eyebrow {
    font-size: 10px;
  }
  main {
    padding: 24px 16px 0;
  }
  .dates {
    grid-template-columns: minmax(0, 1fr) 15px minmax(0, 1fr);
    align-items: end;
  }
  .dates > span {
    display: block;
    padding-bottom: 14px;
  }
  .dates input {
    font-size: 12px;
    min-width: 0;
  }
  .field {
    margin-bottom: 20px;
  }
  .flow {
    display: none;
  }
  .sectionhead {
    margin-bottom: 18px;
  }
  .card {
    min-height: 155px;
    padding: 16px 13px;
  }
  .cardvalue {
    font-size: 27px;
  }
  .cardvalue .unit {
    font-size: 11px;
  }
  .delta {
    font-size: 10px;
  }
  .cards {
    gap: 10px;
  }
  .chartpanel {
    padding: 18px 14px;
  }
  .charthead {
    gap: 12px;
  }
  .charthead h3 {
    font-size: 16px;
  }
  .resulthead h2 {
    font-size: 21px;
  }
  .budget {
    padding: 18px 15px;
  }
  .prevvalue {
    font-size: 9px;
  }
  .comparison {
    font-size: 10px;
  }
  .cardvalue.pending {
    font-size: 17px;
  }
  footer {
    gap: 20px;
    font-size: 10px;
  }
  footer span {
    max-width: 180px;
    text-align: right;
    font-size: 9px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

[hidden] {
  display: none !important;
}
.reportmodes {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr;
  gap: 4px;
  background: #edf2f3;
  padding: 4px;
  border-radius: 10px;
  margin: 12px 0;
}
.reportmodes button {
  border: 0;
  background: none;
  border-radius: 7px;
  padding: 10px 2px;
  color: #647a80;
  font-size: 12px;
  min-height: 40px;
}
.reportmodes button.active {
  background: white;
  box-shadow: 0 1px 5px #163a4215;
  color: #126a68;
  font-weight: 700;
}
input[type="month"] {
  width: 100%;
  min-height: 46px;
  border: 1px solid #cad9dc;
  border-radius: 9px;
  background: white;
  color: #163a42;
  padding: 10px 9px;
  font: inherit;
  font-size: 13px;
}
.resulthead > div {
  min-width: 0;
}
#resultcoverage {
  font-size: 10px;
  line-height: 1.7;
}
.presets {
  margin-bottom: 8px;
}
.periodhint {
  font-size: 10px;
}
@media (max-width: 720px) {
  .field {
    margin-bottom: 15px;
  }
  .field > label {
    margin-bottom: 8px;
  }
  .filters {
    padding: 17px;
  }
  .intro {
    margin-bottom: 18px;
  }
  .presets {
    display: none;
  }
  .reportmodes {
    margin: 6px 0 10px;
  }
  .periodhint {
    margin: 5px 0;
  }
  .resulthead {
    align-items: flex-start;
  }
  .resulthead h2 {
    font-size: 23px;
  }
  .secondary {
    padding: 9px 10px;
    margin-top: 5px;
  }
  .cardvalue {
    font-size: 29px;
  }
  .chartpanel {
    overflow: hidden;
  }
  #chart {
    min-height: 0;
  }
  .primary {
    min-height: 50px;
  }
  .reportmodes button {
    min-height: 44px;
  }
  .textbutton {
    min-height: 40px;
  }
  .notes summary,
  #tablePanel summary {
    min-height: 44px;
  }
  .mobile {
    display: block;
  }
  h1 {
    font-size: 28px;
    line-height: 1.4;
  }
  .lead {
    font-size: 11px;
  }
}

/* Compact KPI categories: only the category being edited is expanded. */
.metric-group {
  margin-top: 8px;
  border: 1px solid var(--line);
  background: #fff;
  overflow: hidden;
}
.metric-group > summary {
  padding: 12px 10px;
  min-height: 46px;
  font-size: 12px;
  color: var(--ink);
}
.metric-group > summary:hover,
.metric-group[open] > summary {
  background: #edf5f3;
}
.metric-group > summary::marker {
  color: var(--teal);
}
.group-count {
  float: right;
  font-size: 10px;
  font-weight: 500;
  color: var(--muted);
  padding: 2px 5px;
  border-radius: 5px;
}
.group-count.has-selection {
  color: var(--teal);
  background: #e2efeb;
}
.metric-group fieldset {
  border: 0;
  margin: 0;
  padding: 4px 10px 10px;
}
.metric-group fieldset label {
  min-height: 44px;
}

/* Account management shares the mobile-first dashboard layout. */
[hidden] {
  display: none !important;
}
.admin-layout {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(320px, 2fr);
  gap: 24px;
  align-items: start;
}
.admin-panel {
  background: white;
  border: 1px solid #dce8e7;
  border-radius: 20px;
  padding: 24px;
}
.admin-panel h2 {
  margin: 0 0 18px;
}
.admin-panel h3 {
  margin: 24px 0 12px;
}
.admin-panel input[type="email"] {
  width: 100%;
  min-height: 48px;
  padding: 12px;
  border: 1px solid #b5c9c8;
  border-radius: 10px;
  margin-top: 10px;
}
.admin-actions {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
}
.user-list {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}
.user-entry {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  overflow-wrap: anywhere;
  padding: 16px;
  background: #f1f8f7;
  border: 1px solid #dce8e7;
  border-radius: 12px;
}
.user-entry span {
  color: #586e72;
  font-size: 13px;
}
.checkrow {
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 48px;
}
.checkrow input {
  width: 20px;
  height: 20px;
  accent-color: #126a68;
}
.login-card {
  max-width: 520px;
  margin: 8vh auto;
  padding: 32px;
}
.login-card h1 {
  margin-top: 32px;
}
.passkey-wide { width:100%; min-height:52px; white-space:normal; line-height:1.5; }
.login-card input { width:100%; min-height:48px; font-size:16px; }
.key-entry { margin:16px 0; padding:12px; border:1px solid #cbdcda; border-radius:12px; overflow-wrap:anywhere; }
.login-card p { overflow-wrap:anywhere; }
@media(max-width:480px){.login-card{margin:3vh auto;padding:20px 16px}.login-card h1{font-size:28px}}
.action-link {
  display: block;
  text-align: center;
  text-decoration: none;
  margin-top: 24px;
  padding: 16px;
}
#message {
  min-height: 28px;
  overflow-wrap: anywhere;
}
#clearMetrics {
  padding: 12px;
  margin: 6px;
}
.topright {
  flex-wrap: wrap;
}
@media (max-width: 720px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }
  .admin-panel {
    padding: 18px;
  }
  .topright {
    max-width: 60%;
    font-size: 12px;
  }
  .user-entry {
    width: 100%;
  }
}

.admin-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid #126a68;
  border-radius: 10px;
  color: #126a68;
  text-decoration: none;
  font-weight: 700;
}

.metric-group .metric-group {
  margin: 6px 4px 6px 12px;
  border-left: 2px solid #cde3df;
  border-radius: 8px;
}
.metric-row {
  display: flex;
  font-size: 14px;
  line-height: 1.5;
  cursor: pointer;
  gap: 10px;
  align-items: center;
  padding: 12px;
  min-height: 44px;
}
.metric-row input {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
  accent-color: #126a68;
}
.metric-row small {
  color: #647a7a;
  margin-left: auto;
  white-space: nowrap;
}
.metric-group summary {
  gap: 8px;
}
.group-count {
  white-space: nowrap;
}
.reportmodes {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
.results article.card {
  cursor: default;
  text-align: left;
  min-width: 0;
}
.result-groups {
  display: grid;
  gap: 28px;
}
.result-group {
  min-width: 0;
}
.result-group > summary {
  margin: 0;
  padding: 10px 14px;
  border-left: 4px solid #126a68;
  border-radius: 4px;
  background: #eaf4f2;
  color: #174f4d;
  font-size: 18px;
}
.card h3 {
  font-size: 18px;
  overflow-wrap: anywhere;
}
.card .smalltag {
  white-space: normal;
}
.pending {
  color: #667b80;
  font-size: 15px;
}
.filters input[type="date"],
.filters input[type="month"] {
  width: 100%;
  min-height: 44px;
}
.field > label {
  margin-top: 12px;
}
#selectionCount {
  font-size: 12px;
  color: #126a68;
}
@media (min-width: 1000px) {
  .workspace {
    grid-template-columns: 360px minmax(0, 1fr);
  }
}

/* 条件と結果の表示切替。管理画面には適用しない。 */
.dashboard main { max-width: 1720px; }
.dashboard .top { padding-inline: max(24px, calc((100vw - 1720px) / 2 + 32px)); }
.dashboard [hidden] { display: none !important; }
.view-toolbar { position: sticky; top: 8px; z-index: 5; margin-bottom: 16px; width: fit-content; }
.view-toolbar button { min-height: 44px; background: white; box-shadow: 0 3px 12px #163a4214; }
.dashboard .results { min-width: 0; }
@media (min-width: 721px) {
  .dashboard .workspace { grid-template-columns: minmax(320px, 390px) minmax(0, 1fr); gap: 24px; }
  .dashboard .filters {
    top: 72px;
    max-height: var(--filter-available-height, calc(100dvh - 88px));
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scrollbar-gutter: stable;
  }
  .dashboard.filters-collapsed .workspace { grid-template-columns: minmax(0, 1fr); }
  .dashboard .cards { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
}
@media (max-width: 720px) {
  .view-toolbar { display: none; }
  .dashboard.mobile-results .intro { display: none; }
  .dashboard.mobile-results main { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .dashboard .cards { grid-template-columns: 1fr; }
  .floating-filters { position: fixed; bottom: calc(16px + env(safe-area-inset-bottom)); left: 16px; right: 16px; width: calc(100% - 32px); min-height: 52px; z-index: 10; box-shadow: 0 4px 18px #163a4233; }
}
@media (max-width: 720px) {
  .dashboard .top { height: auto; min-height: 73px; padding: 12px 16px; flex-wrap: wrap; }
  .dashboard .brand { white-space: nowrap; flex-shrink: 0; }
  .dashboard .topright { max-width: 100%; gap: 10px; }
  .dashboard .resulthead { flex-direction: column; align-items: stretch; gap: 12px; }
  .dashboard #download { align-self: flex-start; }
}

.result-group > summary { min-height: 48px; cursor: pointer; }
.result-group > summary h2 { display: inline; font-size: 18px; }
.result-group > summary::marker { color: #126a68; }
.result-group[open] > summary { margin-bottom: 14px; }
.result-group > summary:hover { background: #dceeea; }
.result-group-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}
.result-group-actions button { min-height: 44px; }
.finance-amount { font-size: clamp(24px, 3vw, 34px); font-weight: 700; margin: 12px 0; overflow-wrap: anywhere; }
.finance-basis { padding: 8px 10px; background: #edf4f8; border-radius: 8px; font-size: 14px; }
.finance-definition { margin-top: 16px; border-top: 1px solid #dbe5e5; padding-top: 8px; }
.finance-definition summary { cursor: pointer; min-height: 44px; padding-block: 12px; font-size: 14px; }
.finance-definition li { font-size: 13px; line-height: 1.7; margin-bottom: 6px; }
.finance-definition ul { padding-left: 20px; }
.finance-formula { font-size: 14px; font-weight: 600; line-height: 1.8; }
.finance-controls { padding: 16px; margin-bottom: 20px; background: #f0f6f8; border-radius: 12px; }
.finance-controls label { display: block; font-weight: 600; margin-bottom: 8px; }
.finance-controls select { width: 100%; max-width: 420px; min-height: 44px; }
.fiscal-shortcuts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.fiscal-shortcuts button { min-height: 44px; border: 1px solid #bad4d1; border-radius: 8px; padding: 6px 10px; }
.period-series { margin-top: 1rem; min-width: 0; }
.period-series summary { cursor: pointer; padding: .7rem 0; }
.series-scroll { max-width: 100%; overflow-x: auto; }
.period-series table { border-collapse: collapse; min-width: 720px; font-size: .85rem; }
.period-series th, .period-series td { border-bottom: 1px solid #dce5e7; padding: .65rem; text-align: left; vertical-align: top; }
.period-series td div { margin-top: .35rem; }

/* 見る順番を統一：項目名 → 実績 → 前年比 → 前年実績・差 → 期間。 */
.dashboard .metric-card { padding: 28px; color: #152f36; }
.dashboard .metric-card .metric-title { font-size: 22px; line-height: 1.5; margin: 0 0 18px; font-weight: 750; }
.metric-value { font-size: clamp(28px, 2.6vw, 42px); font-weight: 750; line-height: 1.25; letter-spacing: -.025em; font-variant-numeric: tabular-nums; margin: 0 0 18px; overflow-wrap: anywhere; }
.metric-change { font-size: 21px; font-weight: 700; margin: 0 0 20px; line-height: 1.5; }
.metric-change strong { font-weight: 750; }
.metric-comparison, .metric-breakdown { display: grid; grid-template-columns: auto minmax(0,1fr); align-items: baseline; column-gap: 12px; row-gap: 6px; margin: 0 0 20px; font-size: 15px; line-height: 1.6; }
.metric-comparison dt, .metric-breakdown dt { margin: 0; }
.metric-comparison dd, .metric-breakdown dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.metric-breakdown { border-top: 1px solid #e4e9ea; padding-top: 16px; font-size: 14px; }
.metric-period { margin-top: 22px; font-size: 14px; line-height: 1.7; }
.metric-period p { margin: 0; }
.metric-state, .metric-comparison-state { font-size: 13px; line-height: 1.5; color: #5b6c70; margin: 0 0 12px; }
.metric-state { display: inline-block; border: 1px solid #d8dfe1; border-radius: 5px; padding: 2px 8px; }
.report-notes { margin: 28px 0 12px; }
.report-notes > summary { display: list-item; width: fit-content; border: 1px solid #cbd8da; border-radius: 8px; padding: 12px 20px; min-height: 46px; background: white; font-size: 15px; font-weight: 600; color: var(--ink); }
.report-notes-content { margin-top: 16px; padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: 12px; font-size: 14px; line-height: 1.8; }
.report-notes-content .card { margin: 20px 0 0; box-shadow: none; }
.report-notes-content .card h3 { font-size: 18px; }
.report-notes-content .finance-amount { font-size: 20px; }
.dashboard .intro { margin-bottom: 20px; }
.dashboard .intro h1 { font-size: 26px; }
.dashboard #adminWorkSession { display: none; }
.reportviews { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.reportviews button { border: 2px solid var(--ink); border-radius: 8px; background: white; color: var(--ink); font-size: 15px; min-height: 56px; padding: 8px 4px; }
.reportviews button small { display: block; font-size: 12px; font-weight: 400; }
.reportviews button.active { background: #e6f2f1; font-weight: 700; box-shadow: inset 0 0 0 1px var(--ink); }
.quick-period { font-size: 13px; margin: 12px 0 0; line-height: 1.6; color: var(--muted); }
.metric-row.metric-unavailable { opacity: .5; cursor: default; }
.daily-trend { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 16px; }
.daily-trend h4 { margin: 0 0 12px; font-size: 16px; }
.trend-chart { width: 100%; min-width: 0; min-height: 230px; }
.trend-chart svg { display: block; width: 100%; height: 230px; overflow: visible; }
.trend-grid { stroke: #dce6e8; stroke-width: 1; }
.trend-axis { font-family: inherit; font-size: 12px; fill: #50666c; }
.trend-line { stroke: var(--teal); stroke-width: 2.5; fill: none; vector-effect: non-scaling-stroke; }
.trend-dot { fill: var(--teal); stroke: white; stroke-width: 1; }
.trend-chart > p { font-size: 13px; color: var(--muted); line-height: 1.7; }
.daily-trend .series-scroll { max-height: 280px; overflow: auto; overscroll-behavior: contain; }
.daily-trend .period-series table { min-width: 0; width: 100%; font-size: 13px; }
.daily-trend .period-series th, .daily-trend .period-series td { padding: 8px 6px; }
.daily-trend thead th { position: sticky; top: 0; background: #fff; z-index: 1; }
@media (min-width: 721px) {
  .dashboard .cards { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); align-items: start; }
}
@media (max-width: 720px) {
  .dashboard .metric-card { padding: 24px; }
  .dashboard .metric-card .metric-title { font-size: 23px; }
  .metric-value { font-size: clamp(28px, 8vw, 40px); }
  .metric-change { font-size: 21px; }
  .metric-comparison, .metric-breakdown { font-size: 14px; column-gap: 8px; }
  .metric-period { font-size: 14px; }
  .report-notes-content { padding: 16px; }
}

/* 2026-10: period totals with a category-wide matrix and comparison chart. */
.breakdown-modes {display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:6px;background:none;padding:0;margin:14px 0;}
.breakdown-modes button {grid-column:span 2;min-height:44px;padding:6px 2px;border:1px solid var(--line);border-radius:8px;background:white;color:var(--ink);font-size:16px;}
.breakdown-modes button:nth-child(4) {grid-column:span 6;}
.breakdown-modes button.active {background:#dceeea;border-color:var(--teal);font-weight:700;}
.period-picker-label {font-size:17px;font-weight:600;margin:20px 0 8px;}
.period-picker-label span {color:var(--teal);margin-left:10px;}
.category-layout {display:grid;grid-template-columns:minmax(0,1fr);gap:20px;align-items:start;min-width:0;}
.dashboard .category-summaries {display:flex;flex-direction:column;gap:16px;min-width:0;}
.category-analysis {min-width:0;max-width:100%;background:#fff;border:1px solid var(--line);border-radius:14px;padding:20px;}
.category-analysis h3 {font-size:17px;margin:0 0 12px;}
.category-analysis>h3 {margin-top:24px;}
.chart-key,.chart-panel-items {font-size:12px;color:var(--muted);line-height:1.6;margin:8px 0;overflow-wrap:anywhere;}
.chart-legend {display:flex;flex-wrap:wrap;gap:6px;margin:12px 0 18px;}
.chart-toggle {min-height:36px;max-width:100%;font-size:12px;line-height:1.4;padding:5px 9px;border:1px solid var(--series-color);border-left:5px solid var(--series-color);border-radius:7px;color:var(--ink);background:white;text-align:left;overflow-wrap:anywhere;}
.chart-toggle[aria-pressed="false"] {opacity:.5;border-color:#b6c1c3;background:#f1f3f4;text-decoration:line-through;}
.chart-toggle[aria-pressed="true"] {box-shadow:0 0 0 1px var(--series-color);}
.chart-panel {margin-bottom:16px;}
.category-charts svg {display:block;width:100%;height:auto;min-height:210px;overflow:visible;}
.chart-axis-label {font-size:11px;fill:#536a72;font-family:inherit;}
.matrix-scroll {max-width:100%;max-height:650px;overflow:auto;overscroll-behavior:contain;border:1px solid var(--line);border-radius:8px;}
.period-matrix {border-collapse:separate;border-spacing:0;width:100%;font-size:13px;font-variant-numeric:tabular-nums;}
.period-matrix th,.period-matrix td {padding:12px 10px;min-width:106px;border-bottom:1px solid var(--line);text-align:right;vertical-align:top;background:#fff;}
.period-matrix thead th {position:sticky;top:0;z-index:2;background:#eaf4f2;font-size:12px;white-space:nowrap;}
.period-matrix th:first-child {position:sticky;left:0;text-align:left;min-width:150px;max-width:210px;width:180px;z-index:1;border-right:1px solid var(--line);}
.period-matrix thead th:first-child {z-index:3;background:#eaf4f2;}
.matrix-value {display:block;white-space:nowrap;font-size:15px;font-weight:600;}
.matrix-comparison,.matrix-money {display:block;font-size:11px;font-weight:400;color:var(--muted);margin-top:5px;white-space:nowrap;}
@media(min-width:1100px) {.category-layout.has-analysis {grid-template-columns:minmax(260px,330px) minmax(0,1fr);}}
@media(max-width:720px) {.category-analysis {padding:14px;}.chart-toggle {min-height:44px;}.period-matrix th:first-child {min-width:125px;width:125px;}.category-charts svg {min-height:210px;}}

.period-unit-button {width:100%;min-height:48px;padding:12px 10px;background:#fff;border:1px solid #b9cccf;border-radius:8px;color:var(--ink);text-align:left;font-size:14px;line-height:1.6;}
.period-unit-button[aria-expanded="true"] {border-color:var(--teal);box-shadow:0 0 0 1px var(--teal);}
.week-calendar {margin:12px 0;padding:12px 8px;background:#fff;border:1px solid #b9cccf;border-radius:10px;}
.week-calendar-title,.week-month-nav {display:flex;align-items:center;justify-content:space-between;gap:6px;margin-bottom:8px;}
.week-calendar-title {font-size:14px;}
.week-calendar-title button,.week-month-nav button {min-height:44px;min-width:40px;padding:4px 10px;background:#f1f7f6;border:1px solid var(--line);border-radius:6px;color:var(--ink);font-size:20px;}
.week-month-nav input {min-width:0;flex:1;width:100%;font-size:15px;padding:10px 4px;}
.week-day-head,.week-row {display:grid;grid-template-columns:repeat(7,minmax(0,1fr));text-align:center;}
.week-day-head {font-size:12px;color:var(--muted);padding:6px 0;}
.week-row {width:100%;min-height:44px;margin:3px 0;padding:10px 0;border:1px solid var(--line);border-radius:6px;background:white;color:var(--ink);font-size:14px;}
.week-row:hover:not(:disabled),.week-row[aria-pressed="true"] {background:#dceeea;border-color:var(--teal);}
.week-row:focus-visible {outline:2px solid var(--teal);outline-offset:1px;}
.week-row .outside-month {color:#84969a;}
.week-row:disabled {opacity:.4;cursor:default;}
.unit-days {display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:3px;text-align:center;font-size:13px;}
.unit-months {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;}
.unit-calendar button {min-height:40px;min-width:0;}
.unit-days button,.unit-months button {background:white;color:var(--ink);border:1px solid var(--line);border-radius:5px;padding:5px 0;font-size:14px;}
.unit-calendar button[aria-pressed="true"] {background:#dceeea;border-color:var(--teal);}
.unit-calendar button:disabled {opacity:.35;cursor:default;}
.unit-calendar .outside-month {color:#84969a;}
.unit-calendar button:focus-visible {outline:2px solid var(--teal);outline-offset:1px;}
