/* Дизайн плитки послуги: кольори, ефекти (пульс / біжить смужка / блиск), рамка, шрифт, висота назви.
   Класи t-* ставить TileStyle.apply(); працюють на будь-якій плитці з маркером .ts-t (онлайн-запис і прев'ю в редакторі). */
@property --ts-a { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
:root { --ts-bg: #fff; }
html[data-theme="dark"] { --ts-bg: #1e222a; }

.ts-t { --tc: 160, 107, 255; }
.ts-t.t-gold { --tc: 245, 196, 81; } .ts-t.t-amber { --tc: 255, 176, 32; } .ts-t.t-violet { --tc: 160, 107, 255; }
.ts-t.t-blue { --tc: 62, 166, 255; } .ts-t.t-brown { --tc: 185, 119, 60; } .ts-t.t-steel { --tc: 124, 106, 200; } .ts-t.t-mix { --tc: 201, 160, 255; }
.ts-t.t-gold, .ts-t.t-amber, .ts-t.t-violet, .ts-t.t-blue, .ts-t.t-brown {
    background-image: linear-gradient(135deg, rgba(var(--tc), .20), rgba(var(--tc), .06));
    border-color: rgba(var(--tc), .55) !important;
}
.ts-t.t-steel { background-image: linear-gradient(135deg, rgba(168, 166, 190, .30), rgba(124, 92, 220, .20)); border-color: rgba(124, 106, 200, .5) !important; }
.ts-t.t-mix { background-image: linear-gradient(135deg, rgba(245, 196, 81, .22), rgba(160, 107, 255, .20), rgba(62, 166, 255, .22)); border-color: rgba(160, 107, 255, .45) !important; }
.ts-t.t-frame { box-shadow: inset 0 0 0 1.5px rgb(var(--tc)) !important; border-color: rgb(var(--tc)) !important; }
.ts-t.t-serif .service-name, .ts-t.t-serif .ts-name { font-family: Georgia, 'Times New Roman', serif; font-style: italic; letter-spacing: .01em; }

/* Пульс: м'яке внутрішнє світіння */
.ts-t.t-pulse { animation: tsPulse 2.4s ease-in-out infinite; }
@keyframes tsPulse {
    0%, 100% { box-shadow: inset 0 0 0 rgba(var(--tc), 0); }
    50% { box-shadow: inset 0 0 18px rgba(var(--tc), .55); }
}
.ts-t.t-frame.t-pulse { animation-name: tsPulseFrame; }
@keyframes tsPulseFrame {
    0%, 100% { box-shadow: inset 0 0 0 1.5px rgb(var(--tc)), inset 0 0 0 rgba(var(--tc), 0); }
    50% { box-shadow: inset 0 0 0 1.5px rgb(var(--tc)), inset 0 0 18px rgba(var(--tc), .55); }
}

/* Біжить смужка по контуру: конічний градієнт під рамкою, що крутиться */
.ts-t.t-run {
    border: 1.5px solid transparent !important;
    background-image: linear-gradient(var(--ts-bg), var(--ts-bg)), conic-gradient(from var(--ts-a), rgba(var(--tc), 0) 0 52%, rgb(var(--tc)) 76%, #fff 82%, rgba(var(--tc), 0) 92%) !important;
    background-origin: border-box; background-clip: padding-box, border-box;
    animation: tsRun 3.2s linear infinite;
}
@keyframes tsRun { to { --ts-a: 360deg; } }

/* Блиск, що пробігає по плитці */
.ts-t.t-shine {
    background-image: linear-gradient(110deg, rgba(255, 255, 255, 0) 38%, rgba(255, 255, 255, .85) 50%, rgba(255, 255, 255, 0) 62%), linear-gradient(135deg, rgba(var(--tc), .20), rgba(var(--tc), .08)) !important;
    background-size: 260% 100%, 100% 100% !important; background-repeat: no-repeat !important;
    animation: tsShine 3.4s linear infinite;
}
html[data-theme="dark"] .ts-t.t-shine { background-image: linear-gradient(110deg, rgba(255, 255, 255, 0) 38%, rgba(255, 255, 255, .22) 50%, rgba(255, 255, 255, 0) 62%), linear-gradient(135deg, rgba(var(--tc), .24), rgba(var(--tc), .10)) !important; }
@keyframes tsShine { 0% { background-position: 160% 0, 0 0; } 100% { background-position: -60% 0, 0 0; } }
@media (prefers-reduced-motion: reduce) { .ts-t.t-pulse, .ts-t.t-run, .ts-t.t-shine { animation: none; } }

/* Висота назви: 1 рядок (з трикрапкою) або до 2 рядків */
.ts-t.t-one .service-name, .ts-t.t-one .ts-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ts-t.t-two .service-name, .ts-t.t-two .ts-name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; word-break: break-word; }
.ts-t.t-three .service-name, .ts-t.t-three .ts-name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; word-break: break-word; }
.ts-t.t-one { min-height: 0; }
.ts-t.t-two { min-height: 74px; }
.ts-t.t-three { min-height: 92px; }

/* Шторка-редактор */
.ts-sheet { gap: 10px; }
.ts-prev-wrap { display: flex; justify-content: center; padding: 6px 0 2px; }
.ts-prev { width: 150px; min-height: 64px; padding: 10px 12px; border-radius: 14px; border: 1px solid rgba(0, 0, 0, .1); background-color: var(--ts-bg); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 3px; box-sizing: border-box; overflow: hidden; }
.ts-prev .ts-name { font-size: 14px; font-weight: 600; color: #333; line-height: 1.2; }
.ts-prev .ts-price { font-size: 12px; color: #777; }
html[data-theme="dark"] .ts-prev .ts-name { color: #e6e8ea; } html[data-theme="dark"] .ts-prev .ts-price { color: #a7b0bb; }
.ts-grp { display: grid; gap: 4px; }
.ts-grp > span { font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: #8a867c; }
.ts-sw { display: flex; flex-wrap: wrap; gap: 8px; }
.ts-c { width: 32px; height: 32px; border-radius: 50%; border: 2px solid transparent; box-shadow: 0 0 0 1px rgba(0, 0, 0, .15); cursor: pointer; padding: 0; transition: transform .1s ease; font-size: 14px; color: #888; background: #fff; }
.ts-c:active { transform: scale(.9); }
.ts-c.on { border-color: #fff; box-shadow: 0 0 0 2.5px #544e6e; }
.ts-seg { display: flex; flex-wrap: wrap; gap: 5px; }
.ts-seg button { height: 32px; padding: 0 12px; border: 0; border-radius: 9px; background: rgba(0, 0, 0, .06); font: 700 12.5px Inter, sans-serif; color: #3b3552; cursor: pointer; transition: transform .1s ease; }
.ts-seg button:active { transform: scale(.95); }
.ts-seg button.on { background: linear-gradient(135deg, #544e6e, #6b6585); color: #fff; box-shadow: 0 0 0 1.5px #d9b24c; }

/* Розмір шрифту назви: у кожному контексті базовий розмір множиться на --ts-fs */
.ts-t.t-fsm { --ts-fs: .88; } .ts-t.t-fxs { --ts-fs: .78; }
.ts-t.t-fsm .ts-name { font-size: calc(14px * .88); } .ts-t.t-fxs .ts-name { font-size: calc(14px * .78); }
.ts-fs1 { font-size: 15px !important; } .ts-fs2 { font-size: 12.5px !important; } .ts-fs3 { font-size: 10.5px !important; }
.ts-fs button, .ts-seg button.ts-fs1, .ts-seg button.ts-fs2, .ts-seg button.ts-fs3 { font-family: Georgia, serif; }

/* Кілька ефектів разом (пульс + біг + блиск у будь-якому поєднанні) */
:root { --ts-sh: 255, 255, 255; --ts-sha: .85; --ts-hi: 255, 255, 255; }
html[data-theme="dark"] { --ts-sh: 255, 255, 255; --ts-sha: .2; --ts-hi: 46, 46, 46; }
@keyframes tsShineB { 0% { background-position: 160% 0, 0 0, 0 0; } 100% { background-position: -60% 0, 0 0, 0 0; } }
html:root .ts-t.t-run.t-shine {
    border: 1.5px solid transparent !important;
    background-image: linear-gradient(110deg, rgba(var(--ts-sh), 0) 38%, rgba(var(--ts-sh), var(--ts-sha)) 50%, rgba(var(--ts-sh), 0) 62%), linear-gradient(var(--ts-bg), var(--ts-bg)),
        conic-gradient(from var(--ts-a), rgba(var(--tc), 0) 0 52%, rgb(var(--tc)) 76%, rgb(var(--ts-hi)) 82%, rgba(var(--tc), 0) 92%) !important;
    background-size: 260% 100%, 100% 100%, 100% 100% !important; background-repeat: no-repeat !important;
    background-origin: border-box; background-clip: padding-box, padding-box, border-box;
    animation: tsRun 3.2s linear infinite, tsShineB 3.4s linear infinite;
}
.ts-t.t-pulse.t-run { animation: tsRun 3.2s linear infinite, tsPulse 2.4s ease-in-out infinite; }
.ts-t.t-pulse.t-shine { animation: tsShine 3.4s linear infinite, tsPulse 2.4s ease-in-out infinite; }
html:root .ts-t.t-pulse.t-run.t-shine { animation: tsRun 3.2s linear infinite, tsShineB 3.4s linear infinite, tsPulse 2.4s ease-in-out infinite; }
.ts-t.t-frame.t-pulse.t-run { animation: tsRun 3.2s linear infinite, tsPulseFrame 2.4s ease-in-out infinite; }
.ts-t.t-frame.t-pulse.t-shine { animation: tsShine 3.4s linear infinite, tsPulseFrame 2.4s ease-in-out infinite; }
html:root .ts-t.t-frame.t-pulse.t-run.t-shine { animation: tsRun 3.2s linear infinite, tsShineB 3.4s linear infinite, tsPulseFrame 2.4s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { html:root .ts-t.t-run.t-shine, .ts-t.t-pulse.t-run, .ts-t.t-pulse.t-shine, html:root .ts-t.t-pulse.t-run.t-shine { animation: none !important; } }
