#customer-panel { display: flex; flex-direction: column; flex: 1; min-height: 0; }
#customer-panel .card { display: flex; flex-direction: column; flex: 1; min-height: 0; }
#site { min-width: 0; max-width: 100%; }
.site-filter { display: flex; align-items: center; gap: 8px; }
.site-filter label { font-size: 16px; font-weight: 700; flex: none; }
.price { text-align: right; font-variant-numeric: tabular-nums; }
td { white-space: nowrap; }
td:last-child { white-space: pre-wrap; min-width: 140px; }

#site-address { margin: 0; overflow-wrap: anywhere; }

.site-filter { margin-bottom: 6px; }
th, td { height: 28px; }

.site-filter { flex-wrap: wrap; }
#site { flex: none; }
#account-name { overflow-wrap: anywhere; }
#site-address { flex: 0 1 auto; }
table { table-layout: fixed; }
td { white-space: normal; overflow-wrap: anywhere; }

#history-status { margin: 4px 0; }

#customer-panel > .site-filter { flex: none; }
#contract-section, #history-section { overflow: hidden; }
#contracts button { padding: 1px 5px; }
.history-toolbar h2 { flex: none; }
#history-filter { flex: none; }

.history-toolbar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; flex: none; margin-bottom: 6px; }
.history-toolbar h2, #history-filter, #history-status { margin: 0; }
#contracts td:nth-child(-n+2) { text-align: center; }
#history-rows td.date { white-space: nowrap; overflow-wrap: normal; font-variant-numeric: tabular-nums; }

#contracts td:nth-child(-n+3) { white-space: nowrap; overflow-wrap: normal; }

#customer-panel #contract-section, #customer-panel #history-section { flex: none; }
#table-divider { position: relative; flex: none; height: 22px; cursor: row-resize; touch-action: none; background: linear-gradient(transparent 10px, #8b9eab 10px, #8b9eab 12px, transparent 12px); }
#table-divider::after { content: ""; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 36px; height: 8px; border: 1px solid #8b9eab; border-radius: 2px; background: repeating-linear-gradient(to bottom, #f4f6f7 0 2px, #8b9eab 2px 3px); pointer-events: none; }
#table-divider:hover::after, #table-divider:focus-visible::after { border-color: #004ea2; background: repeating-linear-gradient(to bottom, #d1edf7 0 2px, #004ea2 2px 3px); }
#table-divider:hover, #table-divider:focus-visible { background-color: #d1edf7; outline: 1px solid #004ea2; }

#history-rows td:first-child { text-align: center; white-space: nowrap; }

:is(#reservation-dialog, #license-dialog) { width: min(1400px, 98vw); max-width: 98vw; max-height: calc(100vh - 12px); padding: 8px; overflow: auto; color: #18222b; border: 1px solid #608398; border-radius: 0; box-shadow: 0 8px 30px #0006; }
:is(#reservation-dialog, #license-dialog)::backdrop { background: rgb(0 0 0 / 35%); }
#calendar-grid { display: grid; gap: 16px; text-align: center; }
.calendar-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.calendar-panel h3 { margin: 8px 0; }
#calendar-grid button { min-height: 40px; }
#calendar-grid button[aria-pressed="true"] { background: #004ea2; color: white; }
#selected-dates label { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
#selected-dates textarea { flex: 1; }

.calendar-days button > span:last-child { white-space: nowrap; }
.calendar-days button { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.calendar-days .sunday { color: #b3261e; }
.calendar-days .saturday { color: #004ea2; }
.calendar-days button:disabled { opacity: .65; }
.calendar-days button.today { outline: 2px solid #004ea2; outline-offset: -2px; }
.calendar-legend { font-size: 12px; }

.calendar-shell { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; gap: 8px; align-items: center; }
.calendar-shell > button { min-height: 44px; padding: 3px; }

.reservation-titlebar { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; background: #004ea2; color: white; margin: -8px -8px 4px; padding: 3px 8px; min-height: 31px; }
.reservation-titlebar h2 { margin: 0; font-size: 16px; }
.reservation-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.reservation-actions button { min-width: 72px; }
#reservation-close { background: #fff4ff; border-color: #b984be; }


.reservation-titlebar h2 { flex: 0 0 auto; }
.reservation-actions { flex: 0 0 auto; }
:is(#reservation-contract, #license-contract) { margin: 8px 0; }
:is(#reservation-contract, #license-contract) table { width: 100%; table-layout: fixed; }
:is(#reservation-contract, #license-contract) caption { text-align: left; font-size: 16px; font-weight: 700; margin-bottom: 4px; }
:is(#reservation-contract, #license-contract) th, :is(#reservation-contract, #license-contract) td { text-align: left; overflow-wrap: anywhere; padding: 4px; }
.calendar-guide { container-type: inline-size; margin: 10px 0; padding: 8px; background: #f4f6f7; border: 1px solid #b4c5cf; text-align: center; }
.calendar-guide p { margin: 0; }
.calendar-guide .calendar-legend { display: grid; grid-template-columns: repeat(2, max-content); grid-template-rows: repeat(2, auto); grid-auto-flow: column; gap: 4px 24px; width: fit-content; max-width: 100%; margin: 6px auto 0; text-align: left; }

.calendar-left { display: flex; flex-direction: column; gap: 8px; }
.calendar-left button { padding: 3px; min-height: 44px; }
.selection-actions { display: flex; justify-content: center; align-items: center; gap: 16px; margin: 10px 0; }
.selection-actions h3 { margin: 0; }
#reservation-register { min-width: 72px; }
#selection-guide { margin: 0; text-align: left; }

.legend-entry { display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: center; }
.legend-mark { font-size: 16px; line-height: 1.25; }
.legend-entry:last-child .legend-mark { font-weight: 700; }
.operation-dialog { width: min(560px, 92vw); max-height: 90vh; overflow: auto; padding: 8px; color: #18222b; border: 1px solid #608398; border-radius: 0; box-shadow: 0 8px 30px #0006; }
.operation-dialog::backdrop { background: rgb(0 0 0 / 35%); }
.operation-dialog > p, .operation-dialog > div:not(.reservation-titlebar) { text-align: center; overflow-wrap: anywhere; }
.operation-buttons { display: flex; justify-content: center; gap: 16px; margin: 12px 0 4px; }
.operation-buttons button { min-width: 88px; }
@container (max-width: 1000px) { .calendar-guide .calendar-legend { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-auto-flow: row; } }

/* Login landing page */
.login-page main { overflow-y: auto; }
.login-card { width: min(100%, 400px); margin: 32px auto; padding: 24px; flex: none; box-shadow: 0 4px 18px rgb(0 40 80 / 9%); border-radius: 6px; }
.login-logo { display: block; width: 155px; max-width: 100%; height: auto; margin: 0 auto 16px; }
.login-requirements { margin: 8px 0 0; font-size: 14px; line-height: 1.5; text-align: center; }
.login-environment-message { margin: 0; color: #a31818; font-size: 14px; line-height: 1.5; }
#login-title { color: white; background: #004ea2; text-align: center; font-size: 18px; padding: 12px 8px; margin: 0 0 24px; }
#login-form { display: grid; gap: 8px; }
#login-form label { font-weight: 700; }
#login-form input { width: 100%; min-width: 0; min-height: 40px; padding: 8px 10px; margin-bottom: 12px; }
#login-form button { min-height: 40px; background: #004ea2; color: white; font-weight: 700; border-color: #004ea2; }
#login-form button:hover:not(:disabled) { background: #003d80; }
#login-form button:disabled { opacity: .6; }
.login-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: #52616a; }
.login-divider::before, .login-divider::after { content: ''; height: 1px; background: #b4c5cf; flex: 1; }
.website-button { display: flex; justify-content: center; align-items: center; text-align: center; min-height: 40px; padding: 8px; color: #004ea2; border: 1px solid #004ea2; border-radius: 2px; background: white; text-decoration: none; font-weight: 700; }
.website-button:hover { background: #edf9fd; }
.website-button:focus-visible { outline: 2px solid #004ea2; outline-offset: 3px; }
[hidden] { display: none !important; }
@media (max-width: 420px) { .login-card { padding: 16px; margin: 16px auto; } #login-title { font-size: 16px; } }

#login-title { padding: 0; height: 44px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
#login-title img { display: block; width: 200px; max-width: 100%; height: auto; }

.function-menu { width: max-content; max-width: 100%; margin: 24px auto; padding: 20px; }
.function-menu h2 { margin-bottom: 16px; }
.function-entry { width: 100%; padding: 20px; text-align: left; display: flex; flex-direction: column; gap: 8px; }
.function-entry + .function-entry { margin-top: 12px; }
.function-entry strong { color: #004ea2; font-size: 18px; }
.function-entry span { color: #263740; }

#login-form #error { margin: 0; padding: 8px 10px; color: #a31818; background: #fff2f2; border: 1px solid #e5b4b4; overflow-wrap: anywhere; }
#login-form #error:empty { display: none; }
.license-link { display: inline-block; margin: .15rem .3rem; padding: .35rem .5rem; border: 1px solid #245b9d; border-radius: .25rem; color: #154b87; text-decoration: none; }
.license-link:hover, .license-link:focus-visible { background: #e8f1fb; }

#license-dialog-lists { margin: 24px 0 12px; }

#usage-panel { display: flex; flex: 1; flex-direction: column; min-height: 0; }
.usage-search { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.usage-filter, .usage-modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--usage-field-width)), var(--usage-field-width))); gap: 8px; width: calc(var(--usage-field-width) * 2 + 8px); max-width: 100%; }
#usage-panel { --usage-field-width: calc(6em + 8px + var(--usage-select-width, 500px)); }
.usage-filter { margin: 4px 0 8px; }
.usage-filter-field, .usage-mode-option { display: grid; grid-template-columns: 6em minmax(0, 1fr); gap: 8px; min-width: 0; align-items: start; }
.usage-filter label { font-weight: 700; white-space: nowrap; min-height: 29px; display: flex; align-items: center; }
.usage-filter select { min-width: 0; max-width: 100%; }
.usage-mode-label, #usage-month-field, #usage-range-fields label { display: flex; align-items: center; gap: 8px; white-space: nowrap; min-width: 0; }
.usage-mode-label { font-weight: 700; cursor: pointer; min-height: 29px; }
.usage-mode-label input { margin: 0; accent-color: #004ea2; }
#usage-range-fields { display: grid; grid-template-columns: 112px auto 112px; align-items: center; justify-content: start; gap: 8px; min-width: 0; }
#usage-month-field { justify-self: start; max-width: 100%; }
.usage-filter select, #usage-month, #usage-from, #usage-to { height: 29px; }
#usage-month { width: 112px; max-width: 100%; min-width: 0; }
#usage-from, #usage-to { width: 112px; min-width: 0; }
@media(max-width:400px) {
  #usage-range-fields { grid-template-columns: 112px auto; }
  #usage-to { grid-column: 1; }
}
.usage-inactive { opacity: .5; }
.usage-explanation { margin: 6px 0 8px; }
#usage-summary { margin: 6px 0; }
#usage-summary:empty { display: none; }
.usage-notice { color: #52616a; }
.usage-list { flex: 1; min-height: 0; display: flex; margin-top: 0; }
#usage-table .usage-date { white-space: nowrap; overflow-wrap: normal; }
#usage-table .usage-number { overflow-wrap: anywhere; }
#usage-table td:nth-child(7), #usage-table td:nth-child(9), #usage-table td:nth-child(10) { text-align: right; font-variant-numeric: tabular-nums; }
#license-dialog-lists table { width: calc(96ch + 60px); max-width: 100%; margin-inline: auto; table-layout: fixed; font-size: 12px; }
#license-dialog-lists th, #license-dialog-lists td { white-space: normal; overflow-wrap: anywhere; }
#license-dialog-lists th:last-child, #license-dialog-lists td:last-child { text-align: center; white-space: nowrap; }

:is(#reservation-contract, #license-contract) tr:hover, :is(#reservation-contract, #license-contract) tr:hover > td { background: transparent; color: inherit; }
:is(#reservation-contract, #license-contract) tr:nth-child(even), :is(#reservation-contract, #license-contract) tr:nth-child(even):hover, :is(#reservation-contract, #license-contract) tr:nth-child(even):hover > td { background: #fafafa; }

#usage-total th { text-align: left; white-space: normal; overflow-wrap: anywhere; }
#usage-total { font-size: 12px; font-weight: 400; }
#usage-total td:nth-child(2), #usage-total td:nth-child(4), #usage-total td:nth-child(5) { text-align: right; }
#usage-total .usage-total-amount { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }

#app-header { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; align-items: center; }
#app-header h1 { grid-row: 1; grid-column: 1; min-width: 0; overflow-wrap: anywhere; }
#header-account { display: contents; }
#account-name { grid-row: 1; grid-column: 2; justify-self: start; text-align: left; white-space: nowrap; }
#back-top { grid-row: 1; grid-column: 3; white-space: nowrap; }
#logout { grid-row: 1; grid-column: 4; white-space: nowrap; }
#app-header.header-wrapped { grid-template-columns: minmax(0, 1fr) auto auto; align-items: start; row-gap: 2px; }
#app-header.header-wrapped #account-name { grid-row: 2; grid-column: 1 / -1; white-space: normal; }
#app-header.header-wrapped #back-top { grid-column: 2; }
#app-header.header-wrapped #logout { grid-column: 3; }

#app-header.header-wrapped h1 { align-self: end; }
.usage-search.usage-wide { display: grid; grid-template-columns: var(--usage-field-width) 6em auto auto; justify-content: start; }
.usage-wide .usage-modes { width: var(--usage-field-width); grid-template-columns: auto 1fr; }
.usage-wide .usage-mode-option:last-child { display: flex; justify-self: end; }
.usage-wide #usage-search { grid-column: 3; }
.usage-wide #usage-copy { grid-column: 4; }

.usage-filter-field > label, .usage-mode-label { justify-self: end; }
#usage-table { table-layout: fixed; }
#usage-table :is(thead th:nth-child(10), tbody td:nth-child(10), .usage-total-amount) { position: sticky; right: 0; z-index: 3; background: #fff; box-shadow: -1px 0 #859ba8; }
#usage-table thead th:nth-child(10) { z-index: 4; background: #dceaf1; }
#usage-table tbody tr:nth-child(even) td:nth-child(10) { background: #fafafa; }
#usage-table tbody tr:hover td:nth-child(10) { background: #e8f5fb; }

#usage-table.usage-overflow :is(thead th:nth-child(10), tbody td:nth-child(10), .usage-total-amount) { left: calc(100% - 115px); }

.usage-search:not(.usage-wide) #usage-search { margin-left: calc(6em + 8px); }

/* 操作説明書 */
.login-manual { text-align: center; margin-top: 12px; }
.manual-link { font-size: 14px; color: #004ea2; white-space: nowrap; }
.function-menu-heading { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.function-menu .function-menu-heading h2 { margin: 0; }

.login-manual { display: flex; justify-content: center; gap: 20px; }
.terms-notice { margin: 8px 0 0; font-size: 12px; line-height: 1.6; text-align: center; }

.terms-page, .terms-page * { box-sizing: border-box; }
.terms-page { margin: 0; background: #f4f6f7; color: #172a38; font: 16px/1.8 "Meiryo", sans-serif; }
.terms-page main { max-width: 1000px; margin: 24px auto; padding: 24px; background: white; border: 1px solid #b4c5cf; }
.terms-page h1 { font-size: 22px; margin: 0 0 24px; color: #004ea2; }
.terms-page h2 { font-size: 18px; margin: 28px 0 12px; }
.terms-page p { margin: 12px 0; overflow-wrap: anywhere; }
@media (max-width: 600px) { .terms-page main { margin: 8px; padding: 16px; } .terms-page h1 { font-size: 20px; } }

.terms-page h1.terms-banner { background: #324797 url("images/terms-stripe.png") center / 100% 100% no-repeat; color: white; font-size: 17px; line-height: 30px; min-height: 30px; text-align: center; padding: 0 82px; }
@media (max-width: 600px) { .terms-page h1.terms-banner { font-size: 13px; line-height: 1.4; min-height: 38px; display: flex; align-items: center; justify-content: center; padding-inline: 74px; position: relative; background-image: none; } }

@media (max-width: 600px) { .terms-banner::before, .terms-banner::after { content: ""; position: absolute; top: 0; height: 100%; background-image: url("images/terms-stripe.png"); background-repeat: no-repeat; } .terms-banner::before { left: 0; width: 55px; background-position: left center; background-size: auto 30px; } .terms-banner::after { right: 0; width: 74px; background-position: right center; background-size: auto 22px; } }

footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2px 16px; }
footer .app-version { margin-left: auto; white-space: nowrap; }

#camera-dialog { width: min(560px, 96vw); max-width: 96vw; max-height: calc(100vh - 12px); padding: 8px; overflow: auto; color: #18222b; border: 1px solid #608398; border-radius: 0; box-shadow: 0 8px 30px #0006; }
#camera-dialog::backdrop { background: rgb(0 0 0 / 35%); }
#camera-details { padding: 4px 12px 16px; }
.camera-fields { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px 12px; margin: 20px 0; }
.camera-fields input { width: 100%; min-width: 0; }
#camera-open { display: block; width: fit-content; max-width: 100%; margin-inline: auto; padding: 8px 20px; border: 1px solid #004ea2; background: #004ea2; color: white; text-align: center; text-decoration: none; font: inherit; }
#camera-status { padding-inline: 12px; }
