/* ============================================================
   깨알도구
   멀티탭 사용량 계산기 전용 CSS
   ============================================================ */

.tool-page {
  --tool-page-max-width: 960px;
}

/* ============================================================
   CALCULATOR
   ============================================================ */

.power-strip-calculator {
  align-items: start;
}

/* ============================================================
   RATING
   ============================================================ */

.rating-input-grid {
  display: grid;

  grid-template-columns: repeat(2, minmax(0, 1fr));

  gap: 8px;
}

.rating-help {
  margin-top: -5px;

  padding: 7px 9px;

  border-radius: 8px;

  background: var(--surface-soft);

  color: var(--text-soft);

  font-size: 12px;

  line-height: 1.5;
}

/* ============================================================
   DEVICE HEAD
   ============================================================ */

.device-section-head {
  display: flex;

  align-items: flex-start;
  justify-content: space-between;

  gap: 10px;

  margin-top: 7px;
  margin-bottom: 10px;
}

.device-section-head p {
  margin: 3px 0 0;

  color: var(--text-soft);

  font-size: 12px;
}

.add-device-button {
  flex: 0 0 auto;

  min-height: 32px;

  padding: 0 10px;

  border: 1px solid var(--line);

  border-radius: 9px;

  background: #fff;

  color: var(--text);

  font-size: 12px;

  font-weight: 800;

  cursor: pointer;
}

.add-device-button:hover {
  background: var(--surface-soft);
}

.add-device-button:disabled {
  opacity: 0.45;

  cursor: default;
}

/* ============================================================
   DEVICE LIST
   ============================================================ */

.device-list {
  display: flex;

  flex-direction: column;

  gap: 7px;
}

.device-row {
  display: grid;

  grid-template-columns:
    30px
    minmax(0, 1fr)
    minmax(110px, 0.55fr)
    26px;

  align-items: center;

  gap: 6px;

  padding: 8px;

  border: 1px solid var(--line);

  border-radius: 10px;

  background: #fff;
}

.device-number {
  display: flex;

  align-items: center;
  justify-content: center;

  width: 27px;
  height: 27px;

  border-radius: 7px;

  background: var(--surface-soft);

  color: var(--text);

  font-size: 12px;

  font-weight: 900;
}

.device-name-input,
.device-power-input {
  width: 100%;
  height: 38px;

  padding: 0 9px;

  border: 1px solid var(--line);

  border-radius: 8px;

  background: #fff;

  color: var(--text);

  outline: none;

  font: inherit;

  font-size: 12px;

  font-weight: 700;
}

.device-name-input:focus,
.device-power-input:focus {
  border-color: var(--accent);

  box-shadow: 0 0 0 3px rgba(217, 164, 65, 0.1);
}

.device-power-wrap {
  position: relative;
}

.device-power-input {
  padding-right: 31px;

  text-align: right;
}

.device-power-unit {
  position: absolute;

  top: 50%;
  right: 9px;

  transform: translateY(-50%);

  color: var(--text-soft);

  font-size: 12px;

  font-weight: 700;

  pointer-events: none;
}

.remove-device-button {
  width: 26px;
  height: 32px;

  border: 0;

  background: transparent;

  color: var(--text-soft);

  font-size: 16px;

  cursor: pointer;
}

.remove-device-button:hover {
  color: var(--text);
}

/* ============================================================
   STATUS
   ============================================================ */

.load-status {
  display: flex;

  align-items: center;

  gap: 10px;

  padding: 12px;

  border-radius: 12px;

  background: var(--surface-soft);
}

.load-status.within {
  background: #f3f8ee;
}

.load-status.over {
  background: #fff0ed;
}

.load-status-icon {
  display: flex;

  align-items: center;
  justify-content: center;

  width: 40px;
  height: 40px;

  flex: 0 0 40px;

  border-radius: 10px;

  background: #fff;

  font-size: 20px;
}

.load-status-copy {
  min-width: 0;
}

.load-status-copy strong {
  display: block;

  color: var(--text);

  font-size: 12px;

  font-weight: 900;
}

.load-status-copy span {
  display: block;

  margin-top: 3px;

  color: var(--text-soft);

  font-size: 12px;

  line-height: 1.5;
}

/* ============================================================
   PROGRESS
   ============================================================ */

.load-progress {
  margin-top: 16px;
}

.load-progress-head {
  display: flex;

  align-items: center;
  justify-content: space-between;

  gap: 10px;

  margin-bottom: 6px;

  color: var(--text-soft);

  font-size: 12px;
}

.load-progress-head strong {
  color: var(--text);

  font-size: 12px;

  font-weight: 900;
}

.load-progress-track {
  width: 100%;
  height: 10px;

  overflow: hidden;

  border-radius: 999px;

  background: #ebe9e2;
}

.load-progress-fill {
  width: 0;
  height: 100%;

  border-radius: inherit;

  background: var(--brand);

  transition: width 0.3s ease;
}

.load-status.over + .tool-result-label {
  margin-top: 16px;
}

/* ============================================================
   SUMMARY
   ============================================================ */

.power-summary-grid {
  margin-top: 14px;
}

/* ============================================================
   DEVICE RESULT
   ============================================================ */

.device-result-title {
  margin-top: 18px;
  margin-bottom: 6px;

  color: var(--text);

  font-size: 12px;

  font-weight: 800;
}

.device-result-list {
  border-top: 1px solid var(--line);
}

.device-result-row {
  display: flex;

  align-items: center;
  justify-content: space-between;

  gap: 10px;

  min-height: 40px;

  border-bottom: 1px solid #efeee9;
}

.device-result-name {
  min-width: 0;

  color: var(--text-soft);

  font-size: 12px;

  overflow-wrap: anywhere;
}

.device-result-value {
  flex: 0 0 auto;

  color: var(--text);

  font-size: 12px;

  font-weight: 800;
}

.power-result-note {
  margin-top: 12px;

  padding: 9px 10px;

  border-radius: 9px;

  background: var(--surface-soft);

  color: var(--text-soft);

  font-size: 12px;

  line-height: 1.55;
}

/* ============================================================
   MOBILE
   ============================================================ */

@media (max-width: 520px) {
  .device-row {
    grid-template-columns:
      26px
      minmax(0, 1fr)
      92px
      22px;

    padding: 7px 5px;

    gap: 4px;
  }

  .device-number {
    width: 24px;
    height: 24px;
  }

  .device-name-input,
  .device-power-input {
    padding-left: 7px;

    font-size: 12px;
  }

  .device-power-input {
    padding-right: 25px;
  }

  .rating-input-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
