 /* =========================================
   CODE TO TEXT RATIO — PREMIUM UI (.c2t-)
   ========================================= */
:root { --pink: #ec4899; }
.c2t-wrapper {
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    justify-content: center;
    padding: clamp(0px, 5vw, 0px) 20px;
}

.c2t-panel {
    position: relative;                
    width: 100%;
    max-width: 1400px;
    border-radius: 28px;
    padding: clamp(28px, 5vw, 56px);
}

#bgCanvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; opacity: 0.5; z-index: 0; }
.c2t-content { position: relative; z-index: 1; }

/* ---------- SEARCH/START BOX ---------- */
.search-box-start { background: var(--bg-body); border: 1px solid var(--border-color); border-radius: 20px; padding: 20px; display: flex; flex-direction: column; gap: 16px; max-width: 800px; margin: 0 auto; position: relative; z-index: 10; box-shadow: 0 12px 30px rgba(0,0,0,0.03); transition: all 0.3s; }

.sb-url-row { display: flex; gap: 8px; align-items: center; background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 12px; padding: 6px; }
.sb-url-ico { color: var(--text-muted); margin-left: 12px; }
.sb-url-input { flex: 1; border: none; background: transparent; padding: 8px; font-size: 14.5px; color: var(--text-main); }
.sb-url-input:focus { outline: none; }

.sb-textarea { width: 100%; min-height: 150px; padding: 16px; border-radius: 12px; border: 1px solid var(--border-color); background: var(--card-bg); color: var(--text-main); font-size: 14px; resize: vertical; font-family: 'Space Mono', monospace; }
.sb-textarea:focus { outline: none; border-color: var(--primary-color); }

.sb-actions { display: flex; gap: 8px; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.sb-btns-left { display: flex; gap: 8px; }
.sb-btns-right { display: flex; gap: 8px; }

.c2t-btn-ghost { background: transparent; border: 1px solid var(--border-color); border-radius: 10px; padding: 8px 16px; font-size: 13.5px; font-weight: 700; color: var(--text-muted); cursor: pointer; display: inline-flex; align-items: center; gap: 8px; transition: all 0.2s; }
.c2t-btn-ghost:hover { border-color: var(--primary-color); color: var(--primary-color); }

.search-btn { padding: 12px 24px; border-radius: 12px; border: none; color: #fff; background: linear-gradient(135deg, var(--primary-color), var(--primary-gradient-end)); font-size: 15px; font-weight: 800; cursor: pointer; transition: all 0.25s var(--ease-out); display: flex; align-items: center; justify-content: center; gap: 8px; box-shadow: 0 4px 15px var(--primary-shadow); }
.search-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 20px var(--primary-shadow); }
.search-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- LOADING STATE ---------- */
.c2t-loading { text-align: center; padding: 40px 0; }
.c2t-orb { width: 80px; height: 80px; border-radius: 50%; background: var(--bg-body); border: 2px solid var(--primary-light); margin: 0 auto 24px auto; display: flex; align-items: center; justify-content: center; color: var(--primary-color); font-size: 32px; box-shadow: 0 0 0 16px var(--primary-light); transition: all 0.3s; animation: pulse 2s infinite ease-in-out; }

.c2t-thinking-log { list-style: none; margin: 0; padding: 0 10px; display: flex; flex-direction: column; gap: 12px; max-width: 400px; margin: 0 auto; }
.c2t-thinking-log li { display: flex; align-items: flex-start; gap: 10px; font-size: 14.5px; color: var(--text-muted); animation: slideInUp 0.4s ease forwards; }
.c2t-thinking-log li.active { color: var(--text-main); font-weight: 700; }
.c2t-thinking-log li.done { color: var(--text-muted); opacity: 0.6; }
.c2t-log-dot { flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border-color); display: flex; align-items: center; justify-content: center; color: var(--text-muted); }
.c2t-thinking-log li.active .c2t-log-dot { border-color: var(--primary-color); color: var(--primary-color); }
.c2t-thinking-log li.done .c2t-log-dot { background: var(--primary-color); border-color: var(--primary-color); color: #fff; }

/* ---------- RESULTS DASHBOARD ---------- */
.c2t-result { animation: fadeIn 0.5s ease; }
.c2t-topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 30px; flex-wrap: wrap; }

.workspace-grid { display: grid; grid-template-columns: 1fr; gap: 24px; align-items: start; margin-bottom: 24px; }
 @media (min-width: 1000px) { .workspace-grid { grid-template-columns: 1fr 1fr; } }
 
 /* Workspace Panel */
 .ws-panel { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 20px; overflow: hidden; display: flex; flex-direction: column; height: 100%; }
 .panel-body { padding: 24px; display: flex; flex-direction: column; flex: 1; }
 .panel-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; border-bottom: 1px solid var(--border-color); background: var(--bg-body); flex-wrap: wrap; gap: 12px;}
 .panel-title { font-size: 16px; font-weight: 800; color: var(--text-main); display: flex; align-items: center; gap: 8px; margin: 0; }

 /* ---------- DONUT CHART (Custom) ---------- */
 .donut-wrap { display: flex; align-items: center; justify-content: center; position: relative; width: 100%; height: 220px; margin-bottom: 20px; }
 .donut-svg { width: 180px; height: 180px; transform: rotate(-90deg); }
 .donut-track { fill: none; stroke: var(--bg-body); stroke-width: 14; }
 .donut-code { fill: none; stroke: var(--primary-light); stroke-width: 14; stroke-dasharray: 408.41; stroke-dashoffset: 0; transition: stroke-dashoffset 1s var(--ease-spring); }
 .donut-text { fill: none; stroke: var(--primary-color); stroke-width: 14; stroke-dasharray: 408.41; stroke-dashoffset: 408.41; stroke-linecap: round; transition: stroke-dashoffset 1s var(--ease-spring); }
 .donut-center { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; }
 .dc-pct { font-size: 32px; font-weight: 900; font-family: 'Space Mono', monospace; line-height: 1; margin-bottom: 4px; transition: color 0.5s ease; }
 .dc-label { font-size: 13px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 1px; }

 /* Ratio Bars */
 .ratio-bars { display: flex; flex-direction: column; gap: 16px; margin-bottom: 24px; }
 .rb-row { display: flex; align-items: center; gap: 12px; }
 .rb-label { width: 60px; font-size: 13.5px; font-weight: 700; color: var(--text-main); display: flex; align-items: center; gap: 6px; }
 .rb-dot { width: 8px; height: 8px; border-radius: 50%; }
 .rb-track { flex: 1; height: 8px; background: var(--bg-body); border-radius: 4px; overflow: hidden; position: relative; }
 .rb-fill { height: 100%; border-radius: 4px; transition: width 1s var(--ease-spring); }
 .rb-pct { width: 45px; text-align: right; font-size: 13.5px; font-weight: 800; font-family: 'Space Mono', monospace; color: var(--text-main); }

 /* Rating Badge */
 .rating-badge { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 24px; border-radius: 100px; font-size: 15px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; margin: 0 auto; width: 100%; }
 .rating-badge.excellent { background: rgba(16, 185, 129, 0.1); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.2); }
 .rating-badge.good { background: rgba(59, 130, 246, 0.1); color: #3b82f6; border: 1px solid rgba(59, 130, 246, 0.2); }
 .rating-badge.average { background: rgba(245, 158, 11, 0.1); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.2); }
 .rating-badge.poor { background: rgba(239, 68, 68, 0.1); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.2); }
 .pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: pulse 2s infinite; }

 /* Mini Stats */
 .mini-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-bottom: 24px; }
 .ms-card { background: var(--bg-body); border: 1px solid var(--border-color); border-radius: 16px; padding: 20px; text-align: center; }
 .ms-val { font-size: 24px; font-weight: 900; color: var(--text-main); font-family: 'Space Mono', monospace; margin: 12px 0 4px 0; }
 .ms-lbl { font-size: 13px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
 
 .ms-ico { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; margin: 0 auto; }
 .ms-ico.r { background: rgba(239, 68, 68, 0.1); color: #ef4444; }
 .ms-ico.b { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }
 .ms-ico.g { background: rgba(16, 185, 129, 0.1); color: #10b981; }
 .ms-ico.w { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }

 /* Tips */
 .tips-list { display: flex; flex-direction: column; gap: 12px; }
 .tip-item { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--text-muted); line-height: 1.5; background: var(--bg-body); border: 1px solid var(--border-color); padding: 12px 16px; border-radius: 12px; }

 /* Tables */
 .tag-table, .rating-table { width: 100%; border-collapse: collapse; margin-top: 16px; background: var(--card-bg); border-radius: 16px; overflow: hidden; border: 1px solid var(--border-color); }
 .tag-table th, .rating-table th { background: var(--bg-body); padding: 16px; text-align: left; font-size: 13px; font-weight: 800; color: var(--text-main); text-transform: uppercase; letter-spacing: 1px; border-bottom: 1px solid var(--border-color); }
 .tag-table td, .rating-table td { padding: 16px; border-bottom: 1px solid var(--border-color); font-size: 14.5px; }
 .tag-table tr:last-child td, .rating-table tr:last-child td { border-bottom: none; }
 .tag-table tr:hover { background: rgba(0,0,0,0.01); }
 
 .tag-name { display: inline-block; padding: 4px 8px; background: rgba(59, 130, 246, 0.1); color: #3b82f6; border-radius: 6px; font-family: 'Space Mono', monospace; font-size: 13px; font-weight: bold; }
 
 .tcb-wrap { display: flex; align-items: center; gap: 8px; }
 .tcb-track { flex: 1; height: 6px; background: var(--bg-body); border-radius: 3px; overflow: hidden; }
 .tcb-fill { height: 100%; background: var(--primary-color); border-radius: 3px; }
 .tcb-num { font-size: 12px; font-weight: bold; width: 30px; text-align: right; color: var(--text-muted); }

 .rt-badge { display: inline-block; padding: 4px 10px; border-radius: 100px; font-size: 12px; font-weight: 800; text-transform: uppercase; }

 /* ---------- INFO SECTION (Tool Specs) ---------- */
 .info-section { margin-top: 40px; }
 .info-divider { display: flex; align-items: center; margin: 40px 0 20px 0; }
 .info-divider::before, .info-divider::after { content: ''; flex: 1; height: 1px; background: var(--border-color); }
 .info-divider-text { padding: 0 16px; font-size: 13px; font-weight: 800; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; display: flex; align-items: center; gap: 8px; }

 .info-grid { display: grid; grid-template-columns: 1fr; gap: 20px; margin-bottom: 30px; }
 @media (min-width: 800px) { .info-grid { grid-template-columns: repeat(3, 1fr); } }
 .i-card { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 16px; padding: 24px; display: flex; flex-direction: column; align-items: flex-start; }
 .ic-ico { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
 .ic-ico.r { background: rgba(239, 68, 68, 0.1); color: #ef4444; }
 .ic-ico.b { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }
 .ic-ico.g { background: rgba(16, 185, 129, 0.1); color: #10b981; }
 .ic-title { font-size: 15px; font-weight: 800; color: var(--text-main); margin-bottom: 12px; }
 .ic-body { font-size: 14px; color: var(--text-muted); line-height: 1.6; }

 /* Zero-Inline Enhancements */
 .sb-url-ico { width: 16px; height: 16px; }
 .sb-url-row .search-btn { padding: 10px 16px; font-size: 14px; border-radius: 8px; }
 .sb-url-row .search-btn i { width: 14px; height: 14px; }
 .sb-textarea-wrap { position: relative; }
 .sb-char-counter { position: absolute; bottom: 12px; right: 12px; font-size: 12px; font-family: 'Space Mono', monospace; color: var(--text-muted); background: var(--bg-body); padding: 2px 6px; border-radius: 4px; border: 1px solid var(--border-color); }
 .c2t-btn-ghost i { width: 14px; height: 14px; }
 .c2t-btn-ghost.text-danger { color: #ef4444; }
 .search-btn i { width: 16px; height: 16px; }
 .c2t-history-panel { margin-top: 24px; margin-bottom: 24px; background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 12px; padding: 20px; }
 .c2t-hist-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
 .c2t-hist-title { font-size: 16px; font-weight: 800; color: var(--text-main); margin: 0; display: flex; align-items: center; gap: 8px; }
 .c2t-hist-title i { width: 16px; height: 16px; color: var(--primary-color); }
 .c2t-btn-ghost.hist-clear-btn { color: #ef4444; font-size: 13px; padding: 4px 8px; }
 .c2t-btn-ghost.hist-clear-btn i { width: 13px; height: 13px; }
 .c2t-hist-list { display: flex; flex-direction: column; gap: 8px; max-height: 250px; overflow-y: auto; }
 .c2t-hist-item { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; background: var(--bg-body); border: 1px solid var(--border-color); border-radius: 8px; cursor: pointer; transition: all 0.2s ease; }
 .c2t-hist-info { display: flex; align-items: center; gap: 12px; overflow: hidden; }
 .c2t-hist-ico { width: 16px; height: 16px; color: var(--text-muted); flex-shrink: 0; }
 .c2t-hist-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
 .c2t-hist-name { font-weight: 600; font-size: 14px; color: var(--text-main); text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }
 .c2t-hist-date { font-size: 11px; color: var(--text-muted); }
 .c2t-hist-meta { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
 .c2t-hist-del { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 4px; border-radius: 4px; display: flex; align-items: center; }
 .c2t-hist-del i { width: 14px; height: 14px; }
 .c2t-orb i { width: 36px; height: 36px; }
 .c2t-log-dot i { width: 12px; height: 12px; }
 .c2t-topbar h2 { font-size: 24px; font-weight: 900; color: var(--text-main); margin: 0; }
 .c2t-topbar p { color: var(--text-muted); margin: 4px 0 0 0; font-size: 14px; }
 .panel-title i { width: 16px; height: 16px; color: var(--primary-color); }
 .panel-title i.text-success { color: var(--success); }
 .panel-title i.text-purple { color: #a78bfa; }
 .panel-body.text-center { align-items: center; text-align: center; }
 .w-full { width: 100%; }
 .rb-dot.text-color, .rb-fill.text-fill { background: var(--primary-color); }
 .rb-dot.code-color, .rb-fill.code-fill { background: var(--primary-light); }
 .recommendations-title { font-size: 14px; font-weight: 800; color: var(--text-main); margin: 0 0 16px 0; text-transform: uppercase; letter-spacing: 1px; }
 .tip-icon { flex-shrink: 0; margin-top: 2px; }
 .ws-panel.mb-lg { margin-bottom: 24px; }
 .panel-body.p-0 { padding: 0; }
 .tag-table-wrap { max-height: 400px; overflow-y: auto; }
 .th-freq { width: 50%; }
