

html { overflow-y: scroll; }

body {
  font-family: 'Ubuntu', sans-serif;
  background: #fff;
  color: #333;
  padding: 20px;
  max-width: 360px;
  margin: auto;
  line-height: 1.4;
}

h1 { font-size: 24px; color: #008351; text-align: center; margin-bottom: 30px; }

.topbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 16px; }
.topbar-back { color: #008351; text-decoration: none; font-size: 14px; }
.topbar-back:hover { text-decoration: underline; }
.topbar-share { background: #fff; border: 1px solid #008351; color: #008351; border-radius: 6px; padding: 6px 10px; font-size: 13px; cursor: pointer; }

.group { margin-bottom: 16px; border: 1px solid #008351; border-radius: 8px; padding: 16px; }
.group-title { font-weight: bold; font-size: 18px; color: #008351; margin-bottom: 12px; }
.group-header { cursor: pointer; display: flex; justify-content: space-between; align-items: center; padding: 12px 0; transition: opacity 0.2s ease; }
.group-header:hover { opacity: 0.8; }
.group-header .group-title { margin: 0; }
.expand-icon { color: #666; font-size: 14px; opacity: 0.7; user-select: none; transition: transform 0.3s ease, opacity 0.2s ease; }
.expand-icon:hover { opacity: 1; }
.group.collapsed .expand-icon { transform: rotate(-90deg); }

.group-close { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 16px; padding: 8px 0 2px; border-top: 1px solid #e0e0e0; cursor: pointer; user-select: none; }
.group-close-text { font-size: 13px; color: #666; }
.group-close-icon { font-size: 14px; color: #666; opacity: 0.7; }
.group-close:hover .group-close-text, .group-close:hover .group-close-icon { color: #008351; opacity: 1; }
.group-close:focus { outline: none; }
.group-close:focus-visible { outline: none; box-shadow: inset -3px 0 0 0 #c00000; transition: all 0.2s ease; }

html { overflow-y: scroll; }

.group-content { transition: opacity 0.3s ease; overflow: hidden; }
.group.collapsed .group-content { max-height: 0; opacity: 0; padding-top: 0; padding-bottom: 0; }

.input-group { margin-bottom: 12px; }
.input-group:last-child { margin-bottom: 0; }
label { display: block; margin-bottom: 4px; font-weight: 420; }
input, select, textarea { width: 100%; padding: 8px; font-size: 16px; box-sizing: border-box; border: 1px solid #ccc; border-radius: 4px; font-family: 'Ubuntu', sans-serif; transition: border-color 0.2s; }
input:focus, select:focus { outline: none; border-color: #008351; }
input:invalid { border-color: #c00000; }
#manualPower::placeholder { color: #ce0000; }
textarea { resize: vertical; min-height: 60px; line-height: 1.4; }
.input-clear { display: flex; gap: 5px; }
.input-clear input, .input-clear select { flex: 1; min-width: 0; }
.btn-clear { padding: 8px 12px; background: #fff; border: 1px solid #ccc; border-radius: 4px; cursor: pointer; color: #666; }

.notice { font-size: 14px; margin-top: 4px; padding: 6px 8px; border-radius: 4px; border-left: 3px solid; }
.notice.info { color: #008351; background: #f0f8f5; border-left-color: #008351; }
.notice.warning { color: #333; background: #f0f8f5; border-left-color: #c00000; }
.notice.error { color: #c00000; background: #fdf2f2; border-left-color: #c00000; }

.state-note { color: #008351; font-size: 11px; line-height: 14px; min-height: 14px; margin-top: 4px; }
.state-note:empty { visibility: hidden; }

.result-grid { display: grid; gap: 8px; }
.result-item { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; border-bottom: 1px solid #eee; }
.result-item:last-child { border-bottom: none; }
.result-label { font-weight: 420; flex: 1; }
.result-value { color: #c00000; font-weight: 420; text-align: right; }
.result-value.placeholder { color: #999; }
.result-value.calc { color: #008351; }
.result-value.chosen { color: #333; }
.result-value.suggested { color: #c00000; }

.btn-row { display: flex; justify-content: space-between; gap: 10px; margin-top: 20px; }
.btn { background: #008351; color: #fff; border: none; border-radius: 4px; padding: 10px 12px; font-weight: bold; cursor: pointer; transition: background-color 0.2s; font-size: 14px; flex: 1; }
.btn:hover:not(:disabled) { background: #006b42; }
.btn:disabled { background: #ccc; cursor: not-allowed; }
.btn-block { width: 100%; flex: none; }

a.btn { display: inline-block; box-sizing: border-box; text-align: center; text-decoration: none; }
.btn-stack { display: flex; flex-direction: column; gap: 10px; }
.btn-stack .btn { flex: none; width: 100%; margin: 0; }

.suggestion-nav { display: flex; justify-content: space-between; gap: 10px; margin: 12px 0; }
.suggestion-nav .btn { flex: none; width: 56px; }
.suggestion-item h4 { color: #008351; margin: 0 0 8px 0; }

.checkbox-container { display: flex; align-items: flex-start; cursor: pointer; font-size: 14px; line-height: 1.4; margin: 0; padding: 0; }
.checkbox-container input[type="checkbox"] { opacity: 0; position: absolute; width: 0; height: 0; }
.checkmark { height: 18px; width: 18px; background: #fff; border: 2px solid #ddd; border-radius: 3px; margin-right: 10px; margin-top: 1px; flex-shrink: 0; transition: all 0.2s ease; position: relative; }
.checkbox-container:hover .checkmark { border-color: #008351; }
.checkbox-container input:checked ~ .checkmark { border-color: #008351; }
.checkbox-container input:checked ~ .checkmark:after { display: block; }
.checkmark:after { content: "\2713"; position: absolute; display: none; left: 4px; top: 0; color: #008351; font-size: 14px; font-weight: bold; }

@media (max-width: 400px) {
  body { padding: 15px; }
  .btn-row { flex-direction: column; }
  .btn-row .btn { margin-bottom: 8px; }
}

.group-header:focus { outline: none; }
.group-header:focus-visible {
  outline: none;
  box-shadow: inset -3px 0 0 0 #c00000;
  transition: all 0.2s ease; }

.combo-list { display: none; position: fixed; z-index: 1000;
  background: #fff; border: 1px solid #ccc; border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12); max-height: 240px; overflow-y: auto; }
.combo-item { padding: 4px 10px; cursor: pointer; font-size: 15px;
  font-family: 'Segoe UI', system-ui, Arial, sans-serif; line-height: 1.5; }
.combo-item:hover, .combo-item.active { background: #f0f7f4; }
.combo-item.current { color: #008351; font-weight: bold; }

.formula { color: #333; font-size: 14px; margin-top: 6px; }

.sym { color: inherit; }
.reserve-box { margin-top: 12px; }
.reserve-box .checkbox-container { margin-bottom: 6px; }

details.lowdelta > summary { cursor: pointer; list-style: none; color: #008351; font-weight: 600; padding: 8px 0; }
details.lowdelta > summary::-webkit-details-marker { display: none; }
details.lowdelta > summary::before { content: "+ "; font-weight: bold; }
details.lowdelta[open] > summary::before { content: "– "; }
details.lowdelta > summary:focus-visible { outline: 2px solid #008351; outline-offset: 2px; }
