/* Contacts */
.app-contacts { --ct-accent: #f07a1a; }
.app-contacts .ct-split { min-height: 0; }
.app-contacts .ct-side { width: 210px; }
.app-contacts .ct-glabel { display: flex; align-items: center; justify-content: space-between; padding-right: 2px; }
.app-contacts .ct-gadd { width: 24px; height: 24px; border-radius: 7px; color: var(--text-3); }
.app-contacts .ct-side-hint { font-size: 12px; color: var(--text-3); padding: 4px 10px 8px; }
.app-contacts .side-item .ic { color: var(--ct-accent); }

/* list */
.app-contacts .ct-listpane { width: 300px; flex: 0 0 auto; display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); background: var(--surface); }
.app-contacts .ct-listhead { display: flex; gap: 6px; align-items: center; padding: 10px 10px 8px; }
.app-contacts .ct-listhead .search-field { flex: 1; }
.app-contacts .ct-listhead .input { height: 32px; background: var(--tile); box-shadow: none; }
.app-contacts .ct-listhead .input:focus { box-shadow: inset 0 0 0 2px var(--ct-accent); }
.app-contacts .ct-groupsel { display: none; margin: 0 10px 8px; height: 32px; }
.app-contacts .ct-list { flex: 1; padding: 0 6px 8px; display: flex; flex-direction: column; }
.app-contacts .ct-letter { position: sticky; top: 0; z-index: 1; font-size: 11.5px; font-weight: 800; color: var(--ct-accent); padding: 8px 10px 3px; background: var(--surface); }
.app-contacts .ct-row { display: flex; align-items: center; gap: 11px; width: 100%; padding: 7px 10px; border: 0; border-radius: 10px; background: none; color: var(--text); text-align: left; flex: 0 0 auto; min-width: 0; }
.app-contacts .ct-row:hover { background: var(--hover); }
.app-contacts .ct-row.on { background: rgba(240, 122, 26, .16); }
.app-contacts .ct-row:focus-visible { outline: 2px solid var(--ct-accent); outline-offset: -2px; }
.app-contacts .ct-row-t { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.app-contacts .ct-row-t b { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-contacts .ct-row-t small { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-contacts .ct-row-fav { color: #f5b301; display: grid; }
.app-contacts .ct-row-fav svg { fill: currentColor; }
.app-contacts .ct-count { font-size: 11.5px; font-weight: 600; color: var(--text-3); padding: 7px 16px; border-top: 1px solid var(--line); flex: 0 0 auto; }
.app-contacts .ct-av { display: inline-grid; place-items: center; border-radius: 50%; color: #fff; font-weight: 700; flex: 0 0 auto; background-size: cover; background-position: center; letter-spacing: .02em; user-select: none; }
.app-contacts .ct-empty-ic { width: 60px; height: 60px; border-radius: 18px; display: grid; place-items: center; color: #fff; background: linear-gradient(160deg, #fdba74, #ea580c); box-shadow: 0 10px 24px -12px rgba(234, 88, 12, .8); }
.app-contacts .ct-empty .btn { margin-top: 8px; }

/* detail */
.app-contacts .ct-detail { flex: 1; min-width: 0; background: var(--surface); display: flex; flex-direction: column; padding: 0 24px 28px; }
.app-contacts .ct-dtop { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 8px; padding: 10px 0; background: var(--surface); }
.app-contacts .ct-back { display: none; }
.app-contacts .ct-hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; margin: 6px 0 14px; }
.app-contacts .ct-hero h2 { margin: 10px 0 0; font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.app-contacts .ct-hero p { margin: 0; font-size: 13.5px; }
.app-contacts .ct-actions { display: flex; justify-content: center; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.app-contacts .ct-act { display: grid; justify-items: center; gap: 5px; width: 76px; padding: 10px 4px 8px; border: 0; border-radius: 14px; background: var(--tile); color: var(--text); }
.app-contacts .ct-act span { color: var(--ct-accent); display: grid; }
.app-contacts .ct-act small { font-size: 11.5px; font-weight: 600; color: var(--text-2); }
.app-contacts .ct-act:hover { background: var(--tile-hover); }
.app-contacts .ct-act:disabled { opacity: .4; pointer-events: none; }
.app-contacts .ct-act.on span { color: #f5b301; }
.app-contacts .ct-act.on svg { fill: currentColor; }
.app-contacts .ct-fields { max-width: 620px; width: 100%; align-self: center; overflow: hidden; }
.app-contacts .ct-field { display: flex; align-items: center; gap: 12px; padding: 10px 14px; min-height: 54px; }
.app-contacts .ct-field + .ct-field { border-top: 1px solid var(--line); }
.app-contacts .ct-field-ic { color: var(--text-3); display: grid; flex: 0 0 auto; }
.app-contacts .ct-field-t { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; font-size: 14px; overflow-wrap: anywhere; }
.app-contacts .ct-field-t small { font-size: 11.5px; font-weight: 600; color: var(--text-3); text-transform: capitalize; }
.app-contacts .ct-field-t a { color: var(--ct-accent); text-decoration: none; font-weight: 500; }
.app-contacts .ct-field-t a:hover { text-decoration: underline; }
.app-contacts .ct-field-a { display: flex; gap: 2px; flex: 0 0 auto; }
.app-contacts .ct-field-a .icon-btn { width: 30px; height: 30px; color: var(--text-2); }
.app-contacts .ct-pre { white-space: pre-line; }
.app-contacts .ct-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.app-contacts .ct-nofields { padding: 18px; text-align: center; color: var(--text-2); font-size: 13px; }

/* editor */
.app-contacts .ct-editor { max-width: 620px; width: 100%; align-self: center; display: flex; flex-direction: column; gap: 4px; }
.app-contacts .ct-etitle { flex: 1; text-align: center; font-size: 14px; }
.app-contacts .ct-photo { display: flex; align-items: center; gap: 16px; margin: 6px 0 8px; }
.app-contacts .ct-photo-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.app-contacts .ct-esect { display: flex; flex-direction: column; gap: 8px; padding: 12px 0; border-top: 1px solid var(--line); }
.app-contacts .ct-esect h4 { margin: 0; font-size: 12px; font-weight: 700; color: var(--text-3); }
.app-contacts .ct-esect .input, .app-contacts .ct-esect .textarea { width: 100%; }
.app-contacts .ct-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.app-contacts .ct-multi { display: flex; flex-direction: column; gap: 6px; }
.app-contacts .ct-multi-row { display: flex; align-items: center; gap: 8px; }
.app-contacts .ct-multi-row .input { flex: 1; min-width: 0; }
.app-contacts .ct-lbl { width: 104px; flex: 0 0 auto; text-transform: capitalize; }
.app-contacts .ct-addline { align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--ct-accent); padding: 2px 0; }
.app-contacts .ct-check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
.app-contacts .ct-delete { align-self: flex-start; margin-top: 10px; color: #e5484d; }

/* narrower windows: groups become a menu; phone-width: one pane at a time */
.app-contacts.ct-medium .ct-side { display: none; }
.app-contacts.ct-medium .ct-groupsel { display: block; }
.app-contacts.ct-narrow .ct-listpane { width: 100%; border-right: 0; }
.app-contacts.ct-narrow .ct-detail { display: none; padding: 0 16px 24px; }
.app-contacts.ct-narrow.ct-show-detail .ct-listpane { display: none; }
.app-contacts.ct-narrow.ct-show-detail .ct-detail { display: flex; }
.app-contacts.ct-narrow .ct-back { display: inline-grid; }
.app-contacts.ct-narrow .ct-grid2 { grid-template-columns: 1fr; }
