.tools-main { max-width: 1100px; margin: 0 auto; padding: 46px 0 70px; }
.tool-hero { margin-bottom: 25px; }
.tool-hero p { color: var(--muted); max-width: 640px; line-height: 1.6; }
.tool-grid { display: grid; grid-template-columns: 1.15fr 1fr; align-items: start; gap: 16px; }
.tool-panel { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: clamp(16px, 3vw, 27px); min-width: 0; }
.tool-panel h2 { margin: 4px 0 14px; }
.tool-panel h3 { margin: 8px 0; }
.tool-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.tool-panel button, .tool-panel select { cursor: pointer; }
.tools-main .primary-button, .tools-main .secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid;
  border-radius: 8px;
  padding: 8px 12px;
  font: inherit;
  font-weight: 700;
  font-size: .87rem;
  text-decoration: none;
}
.tools-main .primary-button { border-color: #245c70; background: #245c70; color: #fff; }
.tools-main .secondary-button { border-color: #a5bac2; background: #fff; color: #285463; }
.tools-main .primary-button:hover { background: #1b4a5b; }
.tools-main .secondary-button:hover { background: #edf3f4; }
.tools-main button:disabled { opacity: .65; cursor: wait; }
.tool-muted, .tool-panel label { color: var(--muted); font-size: .9rem; }
.tool-panel label { display: grid; gap: 6px; font-weight: 650; }
.tool-panel input, .tool-panel select { width: 100%; min-height: 42px; border: 1px solid var(--line); border-radius: 8px; background: #f8faf9; color: var(--text); padding: 7px 9px; font: inherit; }
.tool-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tool-note { border-top: 1px solid var(--line); padding-top: 14px; line-height: 1.5; margin: 18px 0 0; }
.tool-details { margin: 16px 0 8px; }
.tool-details summary { cursor: pointer; }
.tool-details ol { max-height: 190px; overflow: auto; padding-left: 22px; color: var(--muted); }
.roll-result { min-height: 145px; margin: 17px 0 14px; padding: 19px; display: flex; align-items: center; gap: 15px; border-radius: 12px; background: linear-gradient(120deg,#e8f2f3,#eff1fa); }
.roll-result.roll-rare { background: linear-gradient(120deg,#eae3fb,#fff4d7); }
.roll-die { flex: 0 0 54px; width: 54px; height: 54px; display: grid; place-items: center; border-radius: 13px; color: white; background: #28566c; font-size: 32px; }
.roll-rare .roll-die { background: #573c86; }
.roll-result strong, .roll-result small { display: block; }
.roll-result strong { font-size: clamp(1.3rem, 3vw, 2.1rem); }
#roll-kicker { font-size: .68rem; letter-spacing: .08em; font-weight: 800; color: #284a5a; }
.roll-result small { color: #3a5360; line-height: 1.4; }
.tool-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin: 15px 0; }
.tool-metrics div { padding: 8px; background: #f3f6f5; border-radius: 7px; }
.tool-metrics span, .tool-metrics strong { display: block; }
.tool-metrics span { color: var(--muted); font-size: .75rem; }
.chance-display { padding: 12px 0 0; margin-bottom: 3px; }
.chance-display strong { display: block; font-size: 2.45rem; color: #20586c; }
.chance-display span { line-height: 1.4; }
.trait-table { margin-top: 16px; }
.trait-table table { border-collapse: collapse; width: 100%; }
.trait-table th, .trait-table td { padding: 8px 5px; border-bottom: 1px solid var(--line); text-align: left; }
.trait-table th:last-child, .trait-table td:last-child { text-align: right; }
.board-grid { grid-template-columns: minmax(0, 1.28fr) minmax(0, 1fr); }
.board-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 12px 0; }
.board-toolbar p { margin: 0; color: var(--muted); }
.listing-card { border-top: 1px solid var(--line); padding: 9px 0 15px; }
.listing-card a, #verify-profile { color: #245c70; }
.listing-card .tool-actions, .tool-panel form > button, #verify-steps .tool-actions, .report-dialog .tool-actions { margin-top: 12px; }
.listing-items, .draft-items { list-style: none; margin: 7px 0; padding: 0; }
.listing-items li { font-size: .88rem; margin: 4px 0; overflow-wrap: anywhere; }
.draft-items li { display: flex; align-items: center; justify-content: space-between; gap: 5px; background: #f2f6f4; border-radius: 6px; padding: 5px 8px; margin: 5px 0; }
#offer-form fieldset { border: 1px solid var(--line); border-radius: 10px; margin: 14px 0 0; padding: 10px; min-width: 0; }
#offer-form legend { font-weight: 700; padding: 0 4px; }
#offer-form fieldset .tool-fields, #offer-form fieldset button.secondary-button { margin-top: 8px; }
#verify-steps { margin-top: 15px; padding-top: 4px; border-top: 1px solid var(--line); }
#verify-code { background: #f1f5f4; color: #245c70; border-radius: 6px; padding: 7px 9px; overflow-wrap: anywhere; }
#trade-message, #report-message { font-size: .9rem; color: #285463; }
.report-dialog { width: min(420px, calc(100% - 24px)); color: var(--text); }
.report-dialog::backdrop { background: #10293870; }
@media (max-width: 740px) {
  .tools-main { padding-top: 27px; }
  .tool-grid, .board-grid { grid-template-columns: 1fr; }
}
