/* Instagram Character Counter - tool-specific styles. Composes shared
 * primitives in tools.css; only this tool's layout lives here. */

:root {
    --icc-accent: #d62976;
    --icc-accent-dark: #962fbf;
    --icc-accent-tint: #fdf2f8;
    --icc-near: #d97706;
    --icc-over: #dc2626;
    --icc-ok: #16a34a;
}

.page-hero h1 .icc-hero-mark {
    width: 1em;
    height: 1em;
    vertical-align: -0.12em;
    margin-right: 0.4rem;
    color: var(--icc-accent);
}

/* ---- Input ---- */
.icc-field-label { display: block; font-weight: 600; font-size: 0.92rem; color: #333; margin-bottom: 6px; }
.icc-textarea {
    width: 100%;
    box-sizing: border-box;
    min-height: 150px;
    resize: vertical;
    line-height: 1.6;
}
.icc-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 12px;
}
.icc-toolbar-actions { display: flex; gap: 8px; }
.icc-toolbar-hint { font-size: 0.82rem; color: #94a3b8; }

/* ---- Gauge card ---- */
.icc-gauge-card {
    margin: 18px 0 4px;
    background: #fff;
    border: 1px solid #e6e8eb;
    border-radius: 14px;
    padding: 20px 22px;
}
.icc-gauge-top {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
}
.icc-count-wrap { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.icc-count {
    font-size: 2.6rem;
    font-weight: 800;
    line-height: 1;
    color: var(--icc-accent-dark);
    font-variant-numeric: tabular-nums;
}
.icc-count-of { font-size: 1rem; color: #64748b; font-weight: 600; }
.icc-target-wrap { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.icc-target-label { font-size: 0.85rem; color: #475569; font-weight: 600; }
.icc-target-select {
    font: inherit;
    font-size: 0.9rem;
    padding: 7px 30px 7px 11px;
    border: 1px solid #d7dbe0;
    border-radius: 8px;
    background-color: #fff;
    color: #1f2937;
    cursor: pointer;
    max-width: 100%;
}
.icc-target-select:focus { outline: 2px solid var(--icc-accent); border-color: var(--icc-accent); }
.icc-custom-input {
    font: inherit;
    font-size: 0.9rem;
    width: 110px;
    padding: 7px 10px;
    border: 1px solid #d7dbe0;
    border-radius: 8px;
}
.icc-custom-input[hidden] { display: none; }
.icc-bar { height: 8px; border-radius: 999px; background: #eef0f3; overflow: hidden; margin-top: 14px; }
.icc-bar-fill { height: 100%; width: 0; background: var(--icc-accent); border-radius: 999px; transition: width 0.15s, background-color 0.15s; }
.icc-remaining { margin: 8px 0 0; font-size: 0.9rem; color: #64748b; }
.icc-field-note { margin: 6px 0 0; font-size: 0.85rem; color: #6b213f; background: var(--icc-accent-tint); border-radius: 8px; padding: 8px 10px; }
.icc-field-note[hidden] { display: none; }
.icc-field-note.is-bad { color: #991b1b; background: #fef2f2; }
.icc-gauge-card.is-near .icc-bar-fill { background: var(--icc-near); }
.icc-gauge-card.is-near .icc-remaining { color: var(--icc-near); }
.icc-gauge-card.is-over .icc-bar-fill { background: var(--icc-over); }
.icc-gauge-card.is-over .icc-remaining { color: var(--icc-over); font-weight: 600; }
.icc-gauge-card.is-over .icc-count { color: var(--icc-over); }

/* ---- Feed preview (Caption mode only; hidden for other fields) ---- */
.icc-preview-card {
    margin: 14px 0 4px;
    background: #fff;
    border: 1px solid #e6e8eb;
    border-radius: 14px;
    padding: 18px 20px;
}
.icc-preview-head { margin-bottom: 12px; }
.icc-preview-title { margin: 0 0 4px; font-size: 1rem; font-weight: 700; color: #1f2937; }
.icc-preview-hint { margin: 0; font-size: 0.85rem; line-height: 1.5; color: #64748b; }
/* The mock post: Instagram's white card, hairline border, ring avatar,
 * a short photo band, then "username caption... more". */
.icc-feed {
    max-width: 440px;
    border: 1px solid #dbdbdb;
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
}
.icc-feed-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.icc-feed-avatar {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    padding: 2px;
    border-radius: 50%;
    background: conic-gradient(from 30deg, #feda75, #fa7e1e, #d62976, #962fbf, #4f5bd5, #feda75);
}
.icc-feed-avatar span {
    display: block;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #efefef;
}
.icc-feed-user { font-size: 0.88rem; font-weight: 600; color: #262626; }
.icc-feed-photo {
    height: 72px;
    background: linear-gradient(135deg, #fdf2f8 0%, #ede9fe 100%);
    border-top: 1px solid #efefef;
    border-bottom: 1px solid #efefef;
}
.icc-feed-caption {
    margin: 0;
    padding: 10px 12px 12px;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #262626;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.icc-feed-caption strong { font-weight: 600; }
.icc-feed-more { color: #8e8e8e; }
.icc-feed-empty { color: #94a3b8; }
.icc-preview-note { margin: 10px 0 0; font-size: 0.85rem; color: #166534; }
.icc-hidden { margin-top: 10px; }
.icc-hidden-label { margin: 0; font-size: 0.85rem; color: #6b213f; }
.icc-hidden-label strong { font-weight: 700; }

/* ---- Stats ---- */
.icc-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin: 14px 0 4px;
}
.icc-stat {
    background: #fff;
    border: 1px solid #e6e8eb;
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.icc-stat-num { font-size: 1.5rem; font-weight: 800; line-height: 1.1; color: #1f2937; font-variant-numeric: tabular-nums; }
.icc-stat-label { font-size: 0.8rem; color: #64748b; }

/* ---- Limits table ---- */
.icc-table-card {
    margin: 14px 0 4px;
    background: #fff;
    border: 1px solid #e6e8eb;
    border-radius: 14px;
    padding: 18px 20px 8px;
}
.icc-table-title { margin: 0 0 10px; font-size: 1rem; font-weight: 700; color: #1f2937; }
.icc-table-wrap { overflow-x: auto; }
.icc-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.icc-table th, .icc-table td { padding: 9px 10px; border-bottom: 1px solid #eef0f3; text-align: left; vertical-align: middle; }
.icc-table th { font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.04em; color: #64748b; }
.icc-table tbody tr:last-child td { border-bottom: 0; }
.icc-table .icc-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.icc-table .icc-note-col { color: #64748b; font-size: 0.82rem; }
.icc-pill {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 700;
    white-space: nowrap;
}
.icc-pill-ok { background: #dcfce7; color: #166534; }
.icc-pill-near { background: #fef3c7; color: #92400e; }
.icc-pill-over { background: #fee2e2; color: #991b1b; }
.icc-table tr.is-active td { background: var(--icc-accent-tint); }

@media (max-width: 640px) {
    .icc-stats { grid-template-columns: 1fr 1fr; }
    .icc-table .icc-note-col { display: none; }
    .icc-count { font-size: 2.1rem; }
}
