* { box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
body { background: #fdfaf5; display: flex; justify-content: center; padding: 40px 20px; }
.container { max-width: 480px; width: 100%; }
header { text-align: center; margin-bottom: 28px; }
.logo-lockup { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 6px; }
.logo-lockup img { width: 44px; height: 44px; }
h1 { margin: 0; color: #1a2b3c; font-size: 2em; font-weight: 800; letter-spacing: -0.02em; }
header p { font-size: 0.72em; color: #999; text-transform: uppercase; letter-spacing: 0.1em; margin-top: 6px; }

.card { background: #fff; padding: 28px; border-radius: 24px; box-shadow: 0 4px 20px rgba(0,0,0,0.05); border: 1px solid #f0ede8; }

.input-box { background: #f8f9fa; border: 1px solid #eaece8; border-radius: 16px; padding: 20px; margin-bottom: 16px; }
.input-group { margin-bottom: 16px; }
.input-group:last-child { margin-bottom: 0; }
label { display: block; margin-bottom: 6px; font-weight: 800; color: #6c757d; font-size: 0.68em; text-transform: uppercase; letter-spacing: 0.08em; }
input { width: 100%; padding: 11px 13px; border: 1px solid #dee2e6; border-radius: 8px; font-size: 1em; background: #fff; }
input:focus { outline: none; border-color: #3056a0; }

.toggle-container { display: flex; gap: 8px; margin-bottom: 16px; }
.toggle-btn { flex: 1; padding: 10px; border: 1px solid #dee2e6; background: #fff; cursor: pointer; border-radius: 8px; font-size: 0.85em; font-weight: 600; color: #555; transition: all 0.15s; }
.toggle-btn.active { background: #e7effc; color: #3056a0; border-color: #3056a0; }

.hidden { display: none; }
.row { display: flex; gap: 10px; }

#calculateBtn { width: 100%; padding: 15px; background: #3056a0; color: white; border: none; border-radius: 8px; font-size: 1em; font-weight: 700; cursor: pointer; transition: background 0.2s; margin-top: 4px; }
#calculateBtn:hover { background: #254080; }

#results { margin-top: 24px; }

/* Loading bar */
#loadingMsg { margin-top: 14px; }
#loadingMsg p { text-align: center; font-size: 0.8em; color: #888; margin: 0 0 6px; }
.loading-track { background: #eaece8; border-radius: 99px; height: 5px; overflow: hidden; }
#loadingBar { height: 100%; width: 0%; background: linear-gradient(90deg, #3056a0, #6a8fd8); border-radius: 99px; transition: width 0.4s ease; }

/* Results card */
.result-card { background: #fff; border-radius: 24px; box-shadow: 0 4px 20px rgba(0,0,0,0.05); border: 1px solid #f0ede8; padding: 28px; margin-bottom: 16px; }
.result-label { font-size: 0.68em; font-weight: 800; color: #3056a0; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 14px; }
.result-company-row { display: flex; align-items: center; gap: 14px; margin-bottom: 6px; }
.result-company-row img { width: 44px; height: 44px; border-radius: 8px; object-fit: contain; border: 1px solid #eee; }
.result-company-name { font-size: 1.4em; font-weight: 800; color: #1a2b3c; margin: 0; }
.result-emp-count { font-size: 0.7em; color: #bbb; text-transform: uppercase; letter-spacing: 0.08em; margin: 2px 0 0; }
.result-sentence { font-size: 0.93em; color: #444; line-height: 1.55; margin: 18px 0 8px; }

.result-divider { border: none; border-top: 1px solid #f0ede8; margin: 20px 0; }

.result-detail { font-size: 0.88em; color: #555; line-height: 1.6; margin: 0 0 10px; }
.result-detail strong { color: #1a2b3c; }
.result-detail a { color: #3056a0; }
.result-detail-small { font-size: 0.76em; color: #999; margin: 2px 0 8px; }

.result-flag { padding: 10px 13px; border-radius: 8px; font-size: 0.83em; line-height: 1.5; margin-bottom: 10px; }
.result-flag.warn { background: #fff3e0; border-left: 3px solid #e65100; color: #7a3800; }
.result-flag.loss { background: #fce4ec; border-left: 3px solid #c62828; color: #b71c1c; }
.result-flag.context { background: #fff8e1; border-left: 3px solid #f9a825; color: #6a3d00; }

.money-flow-box { background: #fff8f0; border: 1px solid #fde8cc; border-radius: 16px; padding: 16px 18px; margin-bottom: 14px; }
.money-flow-label { font-size: 0.68em; font-weight: 800; color: #e07a20; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 8px; }

.coop-box { background: #f0f7f0; border: 1px solid #c8e6c9; border-radius: 16px; padding: 16px 18px; font-size: 0.83em; color: #2e7d32; line-height: 1.6; margin-top: 14px; margin-bottom: 14px; }
.coop-box a { color: #1b5e20; }

.sources-line { font-size: 0.7em; color: #bbb; margin-top: 10px; }

/* Autocomplete */
.autocomplete-wrapper { position: relative; }
#ac-dropdown {
    position: absolute; top: calc(100% - 1px); left: 0; right: 0;
    background: white; border: 1px solid #3056a0; border-top: none;
    border-radius: 0 0 10px 10px; box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    z-index: 100; max-height: 280px; overflow-y: auto; display: none;
}
.ac-item {
    padding: 10px 14px; cursor: pointer;
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid #f5f5f5; font-size: 0.9em;
}
.ac-item:last-child { border-bottom: none; }
.ac-item:hover, .ac-item.active { background: #f0f5ff; }
.ac-item-name { color: #1a1a1a; }
.ac-item-ticker { color: #888; font-family: monospace; font-size: 0.82em; }

/* Share buttons */
.share-section { margin-top: 10px; }
.share-label { font-size: 0.72em; font-weight: 800; color: #bbb; text-transform: uppercase; letter-spacing: 0.08em; text-align: center; margin-bottom: 8px; }
.share-row { display: flex; gap: 8px; margin-bottom: 8px; justify-content: center; }
.share-btn { display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 7px 15px; border-radius: 20px; font-size: 0.78em; font-weight: 700; text-decoration: none; cursor: pointer; border: none; }

/* Guidance note */
.guidance-note { max-width: 480px; margin: 10px auto 0; padding: 18px 22px; background: #f8f9fa; border: 1px solid #eaece8; border-radius: 16px; font-size: 0.8em; color: #666; line-height: 1.6; }
.guidance-note h3 { margin: 0 0 8px; font-size: 0.95em; color: #444; }
.guidance-note p { margin: 0 0 6px; }
.guidance-note p:last-child { margin-bottom: 0; }
