/* ============================================================
   깨알도구
   비율 배분 계산기 전용 CSS

   공통:
   ../../css/tool-common.css
   ============================================================ */

/* ============================================================
   PAGE
   ============================================================ */

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

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

.allocation-calculator {
  align-items: start;
}

/* ============================================================
   VALUE INPUT
   ============================================================ */

.value-input-grid {
  display: grid;

  grid-template-columns:
    minmax(0, 1.5fr)
    minmax(0, 0.5fr);

  gap: 8px;
}

/* ============================================================
   RATIO INPUT
   ============================================================ */

.ratio-input {
  display: block;

  width: 100%;
  min-height: 86px;

  padding: 11px 13px;

  resize: vertical;

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

  border-radius: var(--tool-input-radius);

  background: #ffffff;

  color: var(--text);

  outline: none;

  font: inherit;

  font-size: 15px;

  font-weight: 700;

  line-height: 1.6;

  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.ratio-input:focus {
  border-color: var(--accent);

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

.ratio-input::placeholder {
  color: #aaa9a2;
}

/* ============================================================
   MODE
   ============================================================ */

.allocation-mode-buttons {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.allocation-mode-button {
  min-height: 50px;
}

.allocation-mode-button small {
  display: block;

  margin-top: 2px;

  font-size: 12px;

  font-weight: 600;

  opacity: 0.75;
}

.allocation-mode-help {
  margin-top: 8px;

  padding: 8px 10px;

  border-radius: 8px;

  background: var(--surface-soft);

  color: var(--text-soft);

  font-size: 12px;

  line-height: 1.5;
}

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

.allocation-summary-grid {
  margin-top: 8px;
}

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

  color: var(--text);

  font-size: 12px;

  font-weight: 800;
}

/* ============================================================
   ALLOCATION LIST
   ============================================================ */

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

.allocation-row {
  display: grid;

  grid-template-columns:
    44px
    minmax(0, 1fr)
    minmax(0, 1fr);

  align-items: center;

  gap: 8px;

  min-height: 48px;

  padding: 7px 2px;

  border-bottom: 1px solid #efeee9;
}

.allocation-index {
  color: var(--text);

  font-size: 12px;

  font-weight: 800;
}

.allocation-ratio {
  min-width: 0;
}

.allocation-ratio strong {
  display: block;

  color: var(--text);

  font-size: 12px;

  font-weight: 800;
}

.allocation-ratio small {
  display: block;

  margin-top: 2px;

  color: var(--text-soft);

  font-size: 12px;
}

.allocation-value {
  min-width: 0;

  color: var(--brand);

  font-size: 12px;

  font-weight: 900;

  text-align: right;

  overflow-wrap: anywhere;
}

/* ============================================================
   CHECK
   ============================================================ */

.allocation-check {
  display: flex;

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

  gap: 10px;

  margin-top: 12px;

  padding: 10px 11px;

  border-radius: 9px;

  background: var(--surface-soft);

  color: var(--text-soft);

  font-size: 12px;
}

.allocation-check strong {
  flex: 0 0 auto;

  color: var(--text);

  font-size: 12px;

  font-weight: 900;
}

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

@media (max-width: 520px) {
  .value-input-grid {
    grid-template-columns:
      minmax(0, 1.35fr)
      minmax(0, 0.65fr);
  }

  .allocation-row {
    grid-template-columns:
      36px
      minmax(0, 0.8fr)
      minmax(0, 1.2fr);

    gap: 5px;
  }
}
