:root {
    --panel-color: #fff;
    --accent-color: #1A73E8;
    --box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 5px 0px;
    --border: 1px #ccc solid;
    --form-border: 1px #acacac solid;
    --bold-font-weight: 600;
    --bold-font-color: #222;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    border: none;
    line-height: 1rem;
}
*::before, *::after {
    box-sizing: border-box;
}
html {
    font-size: 16px;
}
body {
    width: 100%;
    color: #000;
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 1rem;
    background-color: #f2f2f3;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* header */
header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--panel-color);
    margin-bottom: 0.5rem;
    padding: 0.75rem 2rem;
    position: sticky;
    top: 0;
    box-shadow: var(--box-shadow);
}
header h1 {
    display: inline-block;
    color: var(--bold-font-color);
    font-weight: var(--bold-font-weight);
    font-size: 1rem;
}
ul#navList {
    list-style: none;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
}
ul#navList li {
    display: inline-block;
    margin: 0 0 0 1.25rem;
    cursor: pointer;
}

div#container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-bottom: 1rem;
}

/* main */
main {padding: 0.5rem;}
div#row01 { display: flex }
div#row02 h2, div#row02 table { min-width: 900px;}

div.panel {
    padding-bottom: 0.25rem;
    background-color: var(--panel-color);
    border-radius: 8px;
    margin-bottom: 1.5rem;
    box-shadow: var(--box-shadow);
}
div#row01 div.panel:last-child {
    margin-left: 1.5rem;    
    flex-grow: 1;
}
div.panel h2 {
    color: #fff;
    font-weight: normal;
    background-color: #666;
    font-size: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 8px 8px 0 0;
}
div.panel table {
    margin: 0.5rem;
}
div.flexrow {
    display: flex;
    flex-direction: row;
    justify-content: space-around;
}
section#info {
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
    width: 100%;
    padding: 0 1rem;
    margin-top: 1rem;
}
section#info div.memo {
    font-size: 0.725rem;
    padding: 0.5rem;
    line-height: 1.25rem;
    background-color: #fff;
    border: var(--border);
}

/* table */
main table {
    table-layout: fixed;
    border-collapse: collapse;
    box-sizing: border-box;
}
th,
td {
    padding: 0.5rem 0.25rem;
    line-height: 2rem;
}
th {
    color: var(--bold-font-color);
    font-weight: var(--bold-font-weight)
}

/* table#defTable */ 
table#defTable td { min-width: 18rem }

/* table#typeDescTable */
table#typeDescTable { }
table#typeDescTable td { width: 15rem }
table#typeDescTable tr { border-bottom: var(--border) }

/* table#uTable */
table#uTable thead tr th,
table#uTable tbody.label tr th { line-height: 1rem }
table#uTable thead tr th { padding: 0 }

table#uTable thead tr th:first-child,
table#uTable tfoot th {
    text-align: right;
    padding-right: 1rem;
}

table#uTable thead tr:last-child { border-bottom: var(--border) }
table#uTable tfoot tr:first-child { border-top: var(--border) }

table#uTable col#colNum { width: 2.5rem }
table#uTable col#colMethod { width: 9rem }
table#uTable col#colValue { width: 5rem }
table#uTable col#colButton { width: 4rem }

table#uTable thead tr:last-child td:last-child,
table#uTable tfoot tr:first-child td:last-child {
    border: none;
    background-color: #fff;
}

/* template */
td.materialNumber { text-align: center }
input.custom-material { width: 15rem }

/* input */
input, select {
    font-family: inherit;
    font-size: 0.875rem;
    line-height: 0.875rem;
    width: 100%;
    height: 2rem;
    padding: 0 0.5rem;
    border: var(--form-border);
    outline: none;
    background-color: #fff;
    border-radius: 8px;
}

select {
    appearance: none;         /* 標準の矢印を消す */
    -webkit-appearance: none; /* Safari用 */
    -moz-appearance: none;    /* Firefox用 */
    
    background: url(images/arrow-down0.png) no-repeat right 0.5em center/1em auto;
    background-color: #fff;
    padding-right: 2em;       /* 矢印分の余白 */
}
option { background-color: #fff }

/* Chrome, Safari, Edge: スピンボタンを消す */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none }

input[type=number] {
    appearance: none;
    -webkit-appearance: none; /* Safari, Chrome */
    -moz-appearance: textfield; /* Firefox */
    padding-right: 0.5rem;
    text-align: right;
}

input[readonly] {
    background-color: #eee;
    border: none;
}

tbody.surfaceR tr td input{
    text-align: center;
}

input#uWeighted {
    height: 2rem;
    color: #fff;
    background-color: #000;
    font-size: 1.25rem
}

button.icon {
    display: inline-block;
    background-color: transparent;
}
button:hover { cursor: pointer }

img.icon {
    width: 1rem;
    height: 1rem;
    box-shadow: none;
}
span.smaller { font-size: 0.75em }

/* footer */
footer {
    display: flex;
    justify-content:space-between;
    width: 100%;
    padding: 0.5rem 1rem;
    background-color: var(--panel-color);
}
footer p {
    font-size: 0.75rem;
    color: #333;
}

/* class */
.flex1 { flex: 1 }

[data-tooltip] {
  position: relative;
  cursor: pointer;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  top: 200%;
  left: 50%;
  transform: translateX(-50%);
  background: #000000;
  color: #ffffff;
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
  font-size: 0.725rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease-in-out;
  z-index: 2000;
}

[data-tooltip]:hover::after { opacity: 1 }

input:focus:not([readonly]),
select:focus {
  outline: 2px solid var(--accent-color);
  outline-offset: 0px;
}


@media screen and (max-width: 900px) {
    header {
        margin: 0;
        padding: 0.5rem;
    }
    ul#navList li:not(:has(#navi-new)) { display: none }
    main {
        max-width: 100%;
        padding: 0;
    }
    div#row01 { flex-direction: column }
    div#row02 {
        overflow-x: auto;
        overflow-y: hidden;
     }
    div.panel {
        margin: 0;
        padding: 0;
        box-shadow: none;
        border-radius: 0;
    }
    div#row01 div.panel:last-child { margin: 0}
    div.panel h2 { border-radius: 0 }
    section#info div.memo { width: 100% }
}

@media print {
    * {
        box-shadow: none !important;
        background: none !important;
        border-radius: 0;
        color: #000 !important;
    }
    body {
        width: 100%;
        font-family: "Noto Sans JP", sans-serif;
        margin: 0;
        padding: 0;
    }
    footer,
    ul#navList,
    section#info,
    table#uTable td:last-child,
    table#uTable col#colButton {
        display: none
    }
    div.panel h2 {
        margin: 0;
        padding: 0 0 0.5rem;
    }
    div.panel table {
        margin: 0;
        padding: 0;
    }
    th,td {font-size: 1rem }

    table,
    thead,
    tfoot {
        border: 2px solid #000;
    }
    th, td,
    table#uTable td,
    table#uTable th,
    tbody#layerBody td {
        border: 1px solid #000;
    }

    input, select {
        font-size: 1rem;
        border: none;
        appearance: none;
    }
    table#uTable colgroup:last-child,
    template#materialRow tr:last-child {
        visibility: hidden;
    }
}