/* Native V2 Contacts. Layout follows the width of the Contacts area (the shell sidebar takes 252 px or a 60 px rail). */
.ct { position: absolute; inset: 0; display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 0; background: #f1f1f1; font-size: 14px; color: var(--ink); overflow: hidden; }
.ct.off { visibility: hidden; pointer-events: none; }
.ct-loading { grid-column: 1 / -1; padding: 24px; color: var(--muted); text-align: center; }
.ct-busy { position: absolute; top: 0; left: 0; right: 0; height: 3px; z-index: 40; background: linear-gradient(90deg, transparent, var(--green), transparent); background-size: 40% 100%; background-repeat: no-repeat; opacity: 0; animation: ct-slide 1s linear infinite; pointer-events: none; }
.ct-busy.on { opacity: 1; }
@keyframes ct-slide { from { background-position: -40% 0; } to { background-position: 140% 0; } }

/* phonebook column */
.ct-books { background: #fff; overflow-y: auto; padding: 24px 16px; min-height: 0; }
.ct-art { width: 100%; max-width: 218px; display: block; margin: 0 auto 8px; }
.ct-booktitle { text-align: center; color: gray; font-weight: 600; margin: 8px 0; }
.ct-books hr { border: 0; border-top: 1px solid #e3e3e3; margin: 12px 0; }
.ct-booklist { display: grid; gap: 14px; }
.ct-book { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.ct-bookmain { display: flex; align-items: flex-start; gap: 6px; min-width: 0; }
.ct-add { color: #1976d2; } .ct-del { color: #d32f2f; }
.ct-bookname { display: grid; min-width: 0; line-height: 1.3; } .ct-bookname b { font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .ct-bookname small { color: gray; }

/* add-phonebook bar */
.ct-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 0 16px 16px; }
.ct-bar { padding: 16px 0 12px; display: grid; gap: 12px; }
.ct-rule { display: flex; align-items: center; gap: 14px; color: gray; font-size: 13px; font-weight: 500; } .ct-rule span { flex: 1; border-bottom: 1px solid #e3e3e3; } .ct-rule em { font-style: normal; }
.ct-barrow { display: flex; align-items: center; gap: 12px; }
.ct-barrow .wk-field { flex: 1; min-width: 0; }
.ct-burger { display: none; color: var(--green); }
.ct .wk-cta { white-space: nowrap; }

/* grid */
.ct-card { flex: 1; min-height: 0; background: #fff; border-radius: 14px; display: flex; flex-direction: column; overflow: hidden; }
.ct-toolbar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
.ct-toolbar h2 { margin: 0; font-size: 20px; font-weight: 500; }
.ct-grow { flex: 1; }
.ct-tool { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--green); font-weight: 500; cursor: pointer; padding: 6px 8px; border-radius: 8px; } .ct-tool:hover { background: var(--mint); }
.ct-delsel { color: #d32f2f; } .ct-delsel:disabled { color: #bdbdbd; cursor: not-allowed; } .ct-selcount { color: gray; }
.ct-scroll { flex: 1; min-height: 0; overflow: auto; position: relative; padding: 0 12px; }
.ct-table { width: 100%; border-collapse: collapse; table-layout: auto; }
.ct-table th, .ct-table td { text-align: left; padding: 0 10px; height: 52px; white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; border-bottom: 1px solid #ececec; }
.ct-table th { position: sticky; top: 0; z-index: 2; background: #fff; font-weight: 600; font-size: 13.5px; height: 56px; min-width: 120px; }
.ct-table th .ct-sort { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; font: inherit; font-weight: 600; cursor: pointer; padding: 6px 2px; color: inherit; }
.ct-colmenu { border: 0; background: none; color: #777; cursor: pointer; border-radius: 50%; width: 26px; height: 26px; vertical-align: middle; opacity: 0; } .ct-table th:hover .ct-colmenu, .ct-colmenu:focus-visible { opacity: 1; }
@media (hover: none) { .ct-colmenu { opacity: 1; } }
.ct-table .ct-chk { width: 48px; min-width: 48px; padding: 0 0 0 8px; } .ct-table input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--green); cursor: pointer; }
.ct-table tbody tr:hover { background: #f7f7f7; } .ct-table tbody tr.sel { background: var(--mint2); }
.ct-norows { text-align: center; padding: 40px 0; }
.ct-foot { display: flex; align-items: center; gap: 12px; padding: 6px 12px; border-top: 1px solid #ececec; font-size: 13px; flex-wrap: wrap; min-height: 52px; }
.ct-rpp { display: inline-flex; align-items: center; gap: 8px; } .ct-size { border: 0; background: none; font: inherit; cursor: pointer; }
.ct-range { min-width: 90px; text-align: center; }

/* popovers (column menu, filter, columns, export) */
.ct-pop { position: absolute; z-index: 60; background: #fff; border-radius: 10px; box-shadow: 0 6px 24px rgba(0, 0, 0, .22); padding: 6px; min-width: 190px; max-width: min(320px, 92vw); }
.ct-pop:not(.menu) { padding: 12px; min-width: 260px; }
.ct-mi { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; padding: 9px 10px; border-radius: 8px; cursor: pointer; text-align: left; font-size: 13.5px; } .ct-mi:hover { background: var(--mint); }
.ct-filter { display: grid; gap: 8px; } .ct-lbl { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.ct-cols { display: grid; gap: 8px; } .ct-collist { display: grid; gap: 4px; max-height: 240px; overflow: auto; } .ct-check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; } .ct-colfoot { display: flex; justify-content: flex-end; }

/* add-contacts dialog */
.ct-dialog { width: min(560px, 94vw); }
.ct-tabs { display: flex; justify-content: flex-end; gap: 10px; }
.ct-chip { border: 1px solid var(--green); color: var(--green); background: #fff; border-radius: 16px; padding: 4px 16px; cursor: pointer; font-size: 13px; } .ct-chip.on { background: var(--green); color: #fff; }
.ct-three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ct-dialog .wk-two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ct-save, .ct-import { justify-self: center; }
.ct-sample { display: inline-flex; align-items: center; gap: 8px; color: var(--green); font-weight: 500; text-decoration: none; }
.ct-drop { display: grid; justify-items: center; gap: 6px; background: #f1f1f1; border-radius: 10px; padding: 28px; cursor: pointer; color: gray; } .ct-drop:hover { background: var(--mint); }
.ct-printframe { position: fixed; width: 0; height: 0; border: 0; }

/* narrow: the phonebook column becomes a drawer */
.ct[data-layout="narrow"] { grid-template-columns: minmax(0, 1fr); }
.ct[data-layout="narrow"] .ct-books { position: absolute; top: 0; left: 0; bottom: 0; width: min(280px, 86%); z-index: 30; transform: translateX(-102%); transition: transform .2s ease; }
.ct[data-layout="narrow"][dir="rtl"] .ct-books { left: auto; right: 0; transform: translateX(102%); }
.ct[data-layout="narrow"].drawer-open .ct-books { transform: none; box-shadow: 4px 0 24px rgba(0, 0, 0, .2); }
.ct[data-layout="narrow"] .ct-burger { display: inline-grid; }
.ct[data-layout="narrow"].drawer-open .ct-scrim { display: block; position: absolute; inset: 0; background: rgba(20, 30, 20, .35); z-index: 25; }
.ct-scrim { display: none; }
.ct[data-layout="narrow"] .ct-main { padding: 0 8px 8px; }
.ct[data-layout="narrow"] .ct-barrow { flex-wrap: wrap; } .ct[data-layout="narrow"] .ct-barrow .wk-cta { flex: 1 1 100%; }
.ct[data-layout="narrow"] .ct-three { grid-template-columns: 1fr; } .ct[data-layout="narrow"] .ct-dialog .wk-two { grid-template-columns: 1fr; }
.ct[data-layout="narrow"] .ct-rpp { font-size: 0; gap: 0; } .ct[data-layout="narrow"] .ct-size { font-size: 13px; } .ct[data-layout="narrow"] .ct-foot { gap: 6px; flex-wrap: nowrap; }
