.estimate-hero,
.cat-sidebar,
.feature-panel,
.summary-panel,
.options-section,
.result-card,
.chat-messages,
.dep-modal {
  background: var(--ds-surface);
  border: 1px solid var(--ds-border);
  border-radius: 12px;
  box-shadow: var(--ds-shadow-sm);
}

.estimate-hero,
.options-section,
.result-card {
  padding: 32px;
}

.estimate-hero {
  display: grid;
  gap: 12px;
}

.estimate-note {
  margin: 0;
  color: var(--ds-muted);
  font-size: 0.92rem;
  line-height: 1.7;
}

.mode-tabs {
  display: inline-flex;
  gap: 8px;
  margin-top: 24px;
  padding: 4px;
  background: var(--ds-surface-alt);
  border: 1px solid var(--ds-border);
  border-radius: 10px;
}

.mode-tab {
  min-height: 40px;
  padding: 0 16px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--ds-muted);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.mode-tab:hover {
  color: var(--ds-foreground);
}

.mode-tab.active {
  background: var(--ds-surface);
  color: var(--ds-foreground);
  box-shadow: var(--ds-shadow-sm);
}

.mode-content {
  display: none;
  margin-top: 24px;
}

.mode-content.active {
  display: block;
}

.manual-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 320px;
  gap: 20px;
  align-items: start;
}

.cat-sidebar,
.feature-panel,
.summary-panel {
  padding: 20px;
}

.cat-sidebar,
.summary-panel {
  position: sticky;
  top: 24px;
}

.cat-sidebar {
  display: grid;
  gap: 6px;
}

.cat-sidebar-btn {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.cat-sidebar-btn:hover {
  background: var(--ds-surface-alt);
}

.cat-sidebar-btn.active {
  border-color: var(--ds-border-strong);
  background: var(--ds-surface-alt);
}

.cat-sidebar-name {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ds-foreground);
}

.cat-sidebar-meta {
  color: var(--ds-muted);
  font-size: 0.78rem;
}

.feature-panel {
  min-height: 420px;
}

.feature-group {
  display: none;
}

.feature-group.active {
  display: block;
}

.feature-group-title {
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--ds-border);
}

.feature-group-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ds-foreground);
}

.feature-group-subtitle {
  margin-top: 4px;
  color: var(--ds-muted);
  font-size: 0.86rem;
}

.feature-check-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--ds-border);
  cursor: pointer;
}

.feature-check-item:first-of-type {
  border-top: none;
  padding-top: 0;
}

.feature-check-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--ds-action);
  cursor: pointer;
}

.feature-check-name {
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--ds-foreground);
}

.feature-check-name-en {
  margin-top: 4px;
  color: var(--ds-muted);
  font-size: 0.82rem;
}

.feature-check-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
  color: var(--ds-muted);
  font-size: 0.82rem;
}

.feature-level {
  font-weight: 700;
  color: var(--ds-action);
}

.feature-price {
  font-weight: 600;
  color: var(--ds-foreground);
}

.feature-ops {
  line-height: 1.55;
}

.summary-title {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--ds-border);
  font-size: 1rem;
  font-weight: 700;
  color: var(--ds-foreground);
}

.summary-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  padding: 10px 0;
  border-top: 1px solid var(--ds-border);
  font-size: 0.88rem;
}

.summary-row:first-child {
  border-top: none;
  padding-top: 16px;
}

.summary-row .label {
  color: var(--ds-muted);
}

.summary-row .value {
  font-weight: 600;
  color: var(--ds-foreground);
  text-align: right;
}

.summary-row .value.accent {
  color: var(--ds-action);
}

.summary-row.total .label,
.summary-row.total .value {
  color: var(--ds-foreground);
  font-size: 0.98rem;
  font-weight: 700;
}

.summary-row.is-warning .label,
.summary-row.is-warning .value {
  color: var(--ds-warning);
}

.summary-divider {
  height: 1px;
  margin: 12px 0;
  background: var(--ds-border);
}

.options-section {
  margin-top: 24px;
}

.options-head {
  margin-bottom: 24px;
}

.options-head h2 {
  font-size: 1.1rem;
}

.options-head p {
  margin: 8px 0 0;
  color: var(--ds-muted);
  font-size: 0.92rem;
  line-height: 1.7;
}

.options-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.option-group {
  padding: 20px;
  background: var(--ds-surface-alt);
  border: 1px solid var(--ds-border);
  border-radius: 10px;
}

.option-group-title {
  margin-bottom: 12px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ds-foreground);
}

.option-radio-group {
  display: grid;
  gap: 10px;
}

.option-card {
  display: block;
  padding: 14px 16px;
  border: 1px solid var(--ds-border);
  border-radius: 8px;
  background: var(--ds-surface);
  cursor: pointer;
  position: relative;
}

.option-card:hover {
  border-color: var(--ds-border-strong);
}

.option-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.option-card.checked {
  border-color: var(--ds-action);
}

.option-card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.option-card-head strong {
  font-size: 0.92rem;
}

.option-price {
  color: var(--ds-action);
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.option-price.free {
  color: var(--ds-muted);
}

.option-card-desc,
.option-card-specs,
.option-card-includes {
  margin-top: 8px;
  color: var(--ds-muted);
  font-size: 0.82rem;
  line-height: 1.6;
}

.option-card-specs,
.option-card-includes {
  display: grid;
  gap: 4px;
}

.option-checkbox {
  display: flex;
  gap: 8px;
  align-items: start;
  color: var(--ds-foreground);
  font-size: 0.9rem;
  line-height: 1.6;
}

.option-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--ds-action);
}

.page-count-wrap {
  display: none;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  color: var(--ds-muted);
  font-size: 0.84rem;
}

.page-count-wrap.visible {
  display: flex;
}

.page-count-wrap input {
  width: 72px;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--ds-border-strong);
  border-radius: 8px;
  background: var(--ds-surface);
  color: var(--ds-foreground);
  font: inherit;
  text-align: center;
}

.calculate-section {
  margin-top: 24px;
  padding: 0;
  text-align: left;
}

.btn-calculate,
.btn-send,
.btn-inquiry,
.dep-modal-actions .btn-add,
.dep-modal-actions .btn-cancel {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 8px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.btn-calculate,
.btn-send,
.btn-inquiry,
.dep-modal-actions .btn-add {
  border: 1px solid var(--ds-action);
  background: var(--ds-action);
  color: var(--ds-action-foreground);
}

.btn-calculate:hover,
.btn-send:hover,
.btn-inquiry:hover,
.dep-modal-actions .btn-add:hover {
  background: var(--ds-action-hover);
}

.btn-calculate:disabled,
.btn-send:disabled,
.btn-inquiry:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.result-section {
  display: none;
  margin-top: 24px;
}

.result-section.visible {
  display: block;
}

.result-title {
  font-size: 1.2rem;
  font-weight: 700;
}

.result-block {
  margin-top: 24px;
}

.result-block-title {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--ds-border);
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--ds-foreground);
}

.result-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  padding: 10px 0;
  border-top: 1px solid var(--ds-border);
  font-size: 0.9rem;
}

.result-row .label {
  color: var(--ds-muted);
}

.result-row .value {
  font-weight: 600;
  color: var(--ds-foreground);
}

.result-row .value.accent {
  color: var(--ds-action);
}

.result-row.total .label,
.result-row.total .value {
  color: var(--ds-foreground);
  font-size: 1rem;
  font-weight: 700;
}

.result-row.is-warning .label,
.result-row.is-warning .value {
  color: var(--ds-warning);
}

.result-disclaimer,
.result-warning {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 10px;
  font-size: 0.84rem;
  line-height: 1.7;
}

.result-disclaimer {
  background: var(--ds-error-surface);
  color: var(--ds-error-foreground);
}

.result-warning {
  background: var(--ds-warning-surface);
  color: var(--ds-warning-foreground);
}

.result-warnings {
  margin-top: 16px;
}

.btn-inquiry {
  margin-top: 24px;
}

.btn-inquiry.is-block {
  width: 100%;
}

.dep-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
  background: var(--ds-overlay);
}

.dep-modal-overlay.visible {
  display: flex;
}

.dep-modal {
  width: min(520px, calc(100% - 1.5rem));
  padding: 24px;
}

.dep-modal h3 {
  margin-bottom: 12px;
  font-size: 1.05rem;
}

.dep-modal p {
  margin: 0 0 20px;
  color: var(--ds-muted);
  font-size: 0.92rem;
  line-height: 1.7;
}

.dep-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.dep-modal-actions .btn-cancel {
  border: 1px solid var(--ds-border-strong);
  background: var(--ds-surface);
  color: var(--ds-foreground);
}

.ai-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
  align-items: start;
}

.ai-summary-col .summary-panel {
  position: sticky;
  top: 24px;
}

.ai-summary-col .summary-panel.is-highlighted {
  border-color: var(--ds-border-strong);
}

.chat-messages {
  min-height: 420px;
  max-height: 70vh;
  overflow-y: auto;
  padding: 20px;
}

.chat-msg + .chat-msg {
  margin-top: 16px;
}

.chat-meta {
  margin-bottom: 6px;
  color: var(--ds-muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.chat-bubble {
  max-width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--ds-border);
  border-radius: 10px;
  background: var(--ds-surface);
  color: var(--ds-foreground);
  font-size: 0.92rem;
  line-height: 1.7;
  white-space: pre-wrap;
}

.chat-msg.user .chat-bubble {
  border-color: var(--ds-action);
  background: var(--ds-action-subtle);
}

.chat-msg.ai .chat-bubble {
  background: var(--ds-surface-alt);
}

.chat-bubble-list {
  padding-top: 12px;
  padding-bottom: 12px;
}

.ai-feature-list {
  display: grid;
  gap: 8px;
}

.ai-feature-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid var(--ds-border);
}

.ai-feature-row:first-child {
  border-top: none;
  padding-top: 0;
}

.ai-feature-name {
  font-weight: 600;
}

.ai-feature-code {
  margin-top: 4px;
  color: var(--ds-muted);
  font-size: 0.8rem;
}

.typing-indicator {
  display: none;
  margin-top: 10px;
  color: var(--ds-muted);
  font-size: 0.82rem;
}

.typing-indicator.visible {
  display: block;
}

.chat-input-row {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.chat-input {
  flex: 1;
  min-height: 44px;
  padding: 12px 14px;
  border: 1px solid var(--ds-border-strong);
  border-radius: 8px;
  background: var(--ds-surface);
  color: var(--ds-foreground);
  font: inherit;
  font-size: 0.92rem;
  resize: vertical;
}

.chat-input:focus,
.inquiry-field input:focus,
.inquiry-field textarea:focus {
  outline: none;
  border-color: var(--ds-action);
}

.ai-summary-empty {
  padding: 24px 0 0;
  color: var(--ds-muted);
  font-size: 0.88rem;
  line-height: 1.7;
}

.ai-summary-features .summary-row {
  font-size: 0.84rem;
}

.feat-name {
  color: var(--ds-foreground);
}

.feat-price {
  color: var(--ds-foreground);
  font-weight: 600;
}

.inquiry-help {
  margin: 0 0 20px;
  color: var(--ds-muted);
  font-size: 0.9rem;
  line-height: 1.7;
}

.inquiry-form {
  display: grid;
  gap: 12px;
}

.inquiry-field {
  display: grid;
  gap: 6px;
}

.inquiry-field span {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--ds-foreground);
}

.inquiry-field em {
  color: var(--ds-error);
  font-style: normal;
}

.inquiry-field input,
.inquiry-field textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 14px;
  border: 1px solid var(--ds-border-strong);
  border-radius: 8px;
  background: var(--ds-surface);
  color: var(--ds-foreground);
  font: inherit;
  font-size: 0.9rem;
}

.inquiry-field textarea {
  min-height: 96px;
  resize: vertical;
}

.inquiry-success {
  text-align: left;
}

.inquiry-success h3 {
  margin-bottom: 8px;
}

.inquiry-success p {
  margin: 0;
  color: var(--ds-muted);
}

.inquiry-success .btn-inquiry {
  margin-top: 20px;
}

@media (max-width: 1080px) {
  .manual-layout {
    grid-template-columns: 1fr;
  }

  .cat-sidebar,
  .summary-panel,
  .ai-summary-col .summary-panel {
    position: static;
  }

  .cat-sidebar {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }

  .ai-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .estimate-hero,
  .options-section,
  .result-card,
  .cat-sidebar,
  .feature-panel,
  .summary-panel,
  .chat-messages,
  .dep-modal {
    padding: 24px;
  }

  .options-grid {
    grid-template-columns: 1fr;
  }

  .chat-input-row {
    flex-direction: column;
  }
}
