.app-detail-main { flex: 1; padding: 116px 24px 104px; }
.app-detail-container { width: min(100%, 760px); margin: 0 auto; }
.app-detail-heading { margin-bottom: 24px; display: flex; align-items: center; gap: 10px; }
.app-detail-title { min-width: 0; }
.app-detail-title h1 { font-size: 1.35rem; font-weight: 650; }
.app-detail-back { width: 34px; height: 34px; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-secondary); background: var(--surface); }
.app-detail-back:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.app-detail-back:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.app-detail-back svg { width: 18px; height: 18px; }
.tool-card { min-height: 540px; display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.tool-body { min-height: 0; flex: 1; padding: 28px; display: flex; flex-direction: column; justify-content: center; }
.tool-body > * { width: 100%; }
.tool-btn { min-height: 40px; padding: 0 18px; border: 1px solid transparent; border-radius: var(--radius-sm); font: inherit; font-size: 0.85rem; font-weight: 600; cursor: pointer; }
.tool-btn-primary { border-color: var(--primary); color: var(--on-primary); background: var(--primary); }
.tool-btn-primary:hover { background: var(--primary-dark); }
.tool-btn-secondary { border-color: var(--border); color: var(--text); background: var(--bg-secondary); }
.tool-btn-secondary:hover { background: var(--bg-tertiary); }

@media (max-width: 768px) {
    .app-detail-main { padding: 88px 12px calc(96px + env(safe-area-inset-bottom)); }
    .app-detail-heading { margin-bottom: 16px; }
    .app-detail-title h1 { font-size: 1.1rem; }
    .tool-card { min-height: 520px; }
    .tool-body { padding: 20px 14px; }
}

.random-picker { max-width: 560px; margin: 0 auto; }
.random-picker-field { display: flex; flex-direction: column; gap: 7px; }
.random-picker-field-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.random-picker-field-heading > span, .random-picker-count span { color: var(--text-secondary); font-size: 0.82rem; font-weight: 600; }
.random-picker-field-heading button { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-secondary); background: var(--surface); cursor: pointer; }
.random-picker-field-heading button:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.random-picker-field-heading button:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.random-picker-field-heading button:disabled { cursor: wait; opacity: 0.55; }
.random-picker-field-heading button svg { width: 16px; height: 16px; }
.random-picker-options-editor { min-height: 148px; max-height: 260px; overflow-y: auto; padding: 6px; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); background: var(--bg-secondary); font-size: 0.9rem; outline: none; }
.random-picker-options-editor:focus-within { border-color: var(--primary); outline: 2px solid var(--primary-soft); outline-offset: 1px; }
.random-picker-option { width: 100%; height: 34px; box-sizing: border-box; display: flex; align-items: center; padding: 0; overflow: hidden; border-radius: var(--radius-sm); transition: color var(--transition), background-color var(--transition), transform var(--transition); }
.random-picker-option-input { width: 100%; height: 34px; box-sizing: border-box; padding: 0 9px; border: none; outline: none; color: inherit; caret-color: var(--text); background: transparent; font: inherit; line-height: 34px; }
.random-picker-option-input::placeholder { color: var(--text-muted); }
.random-picker-option-input:disabled { opacity: 1; -webkit-text-fill-color: currentColor; }
.random-picker-option:focus-within { background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); }
.random-picker-option.is-active { color: var(--primary-dark); background: var(--primary-soft); transform: translateX(3px); }
.random-picker-option.is-selected { color: var(--primary-dark); background: var(--primary-soft); box-shadow: inset 3px 0 0 var(--primary); font-weight: 650; }
[data-theme="dark"] .random-picker-option.is-active, [data-theme="dark"] .random-picker-option.is-selected { color: var(--primary); }
.random-picker-count input:focus { border-color: var(--primary); outline: 2px solid var(--primary-soft); outline-offset: 1px; }
.random-picker-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 18px; margin-top: 12px; }
.random-picker-count { display: flex; align-items: center; gap: 9px; }
.random-picker-count input { width: 64px; height: 38px; box-sizing: border-box; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); background: var(--surface); text-align: center; }
.random-picker-remove { display: inline-flex; align-items: center; gap: 8px; color: var(--text-secondary); font-size: 0.84rem; cursor: pointer; }
.random-picker-actions { display: flex; gap: 10px; margin-top: 14px; }
.random-picker-actions .tool-btn { flex: 1; }
.random-picker-actions .tool-btn:disabled { cursor: wait; opacity: 0.65; }
.random-picker-message { min-height: 1.4em; margin-top: 8px; color: var(--text-muted); font-size: 0.8rem; }
.random-picker-message.is-error { color: var(--danger); }
.random-picker-output, .random-picker-history { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.random-picker-output h2, .random-picker-history h2 { margin-bottom: 8px; color: var(--text-secondary); font-size: 0.8rem; font-weight: 600; }
.random-picker-result { min-height: 66px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; padding: 12px; border-radius: var(--radius-sm); color: var(--text-muted); background: var(--bg-secondary); }
.random-picker-result strong { max-width: 100%; padding: 5px 10px; overflow-wrap: anywhere; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); background: var(--surface); font-size: 1rem; }
.random-picker-history ol { margin: 0; padding-left: 24px; color: var(--text-secondary); font-size: 0.82rem; }
.random-picker-history li { padding: 2px 0; overflow-wrap: anywhere; }
.random-picker-history .random-picker-history-empty { list-style: none; margin-left: -24px; color: var(--text-muted); }

@media (max-width: 520px) {
    .random-picker-controls { align-items: flex-start; flex-direction: column; gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
    .random-picker-option { transition: none; }
}
