/* Text keys, 5.11.2026 («בכל מקום שיש כפתורים כאלה פשוטים תעשה יותר עם נוכחות אבל גם אסתטי ונקי», ג׳ «שורה»).
   Loaded last, over each room's own rules. One class (.text-btn / .text-link) is split by what the word is doing where it stands:
     action  – the default: a white paper pill you can see is a button
     quiet   – beside a real key, or the same tool on every row (לא עכשיו, ביטול, הגדרות): an outline, never competes
     danger  – removing something: the err colour, the same shape as quiet
     inline  – inside a sentence or on a dark band: stays an underlined word
   In a customer's card the keys are whole-width rows with a way forward at the far side. */

:root {
  --act-bg: var(--sheet);
  --act-bg-hover: #fff;
  --act-r: 999px;
  --act-edge: 0 0 0 1px rgba(27, 26, 23, 0.075);
  --act-lift: 0 1px 1px rgba(27, 26, 23, 0.04), 0 6px 14px -6px rgba(27, 26, 23, 0.2);
  --act-lift-hover: 0 2px 3px rgba(27, 26, 23, 0.06), 0 10px 20px -8px rgba(27, 26, 23, 0.28);
  --act-quiet-edge: rgba(27, 26, 23, 0.2);
  --act-quiet-hover: rgba(27, 26, 23, 0.05);
  --act-dot: var(--ivory);
}
@media (prefers-color-scheme: dark) {
  :root {
    --act-bg: rgba(246, 243, 236, 0.1);
    --act-bg-hover: rgba(246, 243, 236, 0.16);
    --act-edge: inset 0 0 0 0.5px rgba(246, 243, 236, 0.2);
    --act-lift: 0 6px 14px -8px rgba(0, 0, 0, 0.6);
    --act-lift-hover: 0 10px 20px -8px rgba(0, 0, 0, 0.7);
    --act-quiet-edge: rgba(246, 243, 236, 0.26);
    --act-quiet-hover: rgba(246, 243, 236, 0.07);
    --act-dot: rgba(246, 243, 236, 0.14);
  }
}

/* ── action: one class's weight, so a room's own rule still wins, as it does today ── */
:is(.text-btn, .text-link) {
  position: relative;
  min-height: 44px;
  padding: 6px 18px;
  gap: 8px;
  justify-content: center;
  color: var(--ink);
  background: var(--act-bg);
  border-radius: var(--act-r);
  box-shadow: var(--act-edge), var(--act-lift);
  font: 16px/1.25 var(--f-ui);
  text-decoration: none;
  white-space: normal;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: background-color 0.16s var(--ease), box-shadow 0.16s var(--ease), transform 0.12s var(--ease);
}
@media (hover: hover) {
  html:root :is(.text-btn, .text-link):hover {
    background: var(--act-bg-hover);
    box-shadow: var(--act-edge), var(--act-lift-hover);
    text-decoration: none;
    transform: translateY(-1px);
  }
}
html:root :is(.text-btn, .text-link):active {
  transform: scale(0.97);
  box-shadow: var(--act-edge);
  opacity: 1;
  transition-duration: 0.08s;
}
html:root :is(.text-btn, .text-link):focus-visible,
html:root .text-btn:has(input:focus-visible) { outline: 3px solid var(--ink); outline-offset: 3px; }

/* the plus sits in its own small round seat, so a row of them reads as «one more of these» */
html:root :is(.text-btn, .text-link) > .icon { width: 18px; height: 18px; }
html:root :is(.text-btn, .text-link) > .icon:first-child:has(use[href="#i-plus"]) {
  box-sizing: content-box;
  width: 14px;
  height: 14px;
  padding: 4px;
  margin-inline: -7px 0;
  background: var(--act-dot);
  border-radius: 50%;
  stroke-width: 2.4;
}
html:root :is(.text-btn, .text-link):disabled {
  color: var(--ink-soft);
  background: none;
  box-shadow: inset 0 0 0 1px var(--act-quiet-edge);
  transform: none;
}

/* ── quiet: beside a real key, or the way back ── */
html:root :is(.btn ~ .text-btn, .text-btn:has(~ .btn), .btn ~ .text-link, .tor-sheet__back, .cust-back, .gate__card > .text-btn, .qs-quiet, .text-btn[data-logout], .room__how, :is(.day__tools, .appt, .qs-row, .tor-svc__row, .cs-payrow) > :is(.text-btn, .text-link)) {
  color: var(--ink-2);
  background: none;
  box-shadow: inset 0 0 0 1px var(--act-quiet-edge);
}
@media (hover: hover) {
  html:root :is(.btn ~ .text-btn, .text-btn:has(~ .btn), .btn ~ .text-link, .tor-sheet__back, .cust-back, .gate__card > .text-btn, .qs-quiet, .text-btn[data-logout], .room__how, :is(.day__tools, .appt, .qs-row, .tor-svc__row, .cs-payrow) > :is(.text-btn, .text-link)):hover {
    background: var(--act-quiet-hover);
    box-shadow: inset 0 0 0 1px var(--act-quiet-edge);
    transform: none;
  }
}

/* ── danger ── */
html:root :is(.text-btn[data-remove], .text-btn.cs-del, #learn-forget, #contacts-clear, .text-btn.is-danger) {
  color: var(--err);
  background: none;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--err) 34%, transparent);
}
@media (hover: hover) {
  html:root :is(.text-btn[data-remove], .text-btn.cs-del, #learn-forget, #contacts-clear, .text-btn.is-danger):hover {
    background: color-mix(in srgb, var(--err) 8%, transparent);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--err) 50%, transparent);
    transform: none;
  }
}

/* ── small: a line's own tools, where a full key would outweigh the line ── */
html:root :is(.cc-fact, .edit-row__tools, .day__tools, .cc-next__pay, .cc-past, .cc-pk__foot, .cc-pay, .vc__older, .cc-answers, .appt, .acct-phones__row, .cs-fnew__keys, .qs-row, .tor-svc__row, .cs-payrow, .tor-next__more) :is(.text-btn, .text-link) {
  min-height: 36px;
  padding: 4px 14px;
  font-size: 15px;
}
html:root :is(.cc-fact, .edit-row__tools, .day__tools, .cc-next__pay, .cc-past, .cc-pk__foot, .cc-pay, .vc__older, .cc-answers, .appt, .acct-phones__row, .cs-fnew__keys, .qs-row, .tor-svc__row, .cs-payrow, .tor-next__more) :is(.text-btn, .text-link)::after {
  content: "";
  position: absolute;
  inset: -4px 0;
}
html:root .vc__older { display: flex; flex-wrap: wrap; gap: 8px; }

/* ── inline: inside a sentence, or on a band that has its own colour ── */
html:root :is(.hint, .notice, .lockline, .sign-guide__note, .from-chip, .off-note, .off-mm, .appfoot__help, .gate__foot, .gate__app, .cc-by, .mock-badge, .offertoast, .cust-undo, .tourtoast, .tour__acts, .cust-bars__rest, .sibling, .cs-inline, .demobar) :is(.text-btn, .text-link),
html:root .cc-visit.text-btn,
html:root .sign-guide__note :is(.text-btn, .text-link) {
  display: inline;
  min-height: 0;
  padding: 0;
  color: inherit;
  background: none;
  border-radius: 0;
  box-shadow: none;
  font-size: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.25em;
  transform: none;
}
html:root .cc-visit.text-btn { display: block; font-weight: 400; line-height: 1.5; text-align: start; text-decoration: none; }
html:root :is(.cust-bars__rest, .tour__acts, .tourtoast, .cust-undo) :is(.text-btn, .text-link) { display: inline-flex; min-height: 44px; }
html:root .cust-undo .text-btn { color: var(--yellow); }

/* ── the underlined ones outside these two classes: «לכל התורים», «כל הנתונים», «מה השתנה לאחרונה», what opens more.
   #_ only lifts the weight over a room's own #id rule. A key that opens has a chevron that turns. ── */
html:root :is(.more, .famcard__go, .dl-more > summary, .explain > summary, .settings-more > summary, .optional-details > summary, .settings-example > summary, .calm-how > summary, .learn__what > summary, .howvideo > summary, .plans__fine > summary, .contacts__how > summary, #f-style.is-learned .style-presets > summary, .sign-help > summary, .codein > summary, .gsheet__title, #_):not([hidden]) {
  display: inline-flex;
  width: fit-content;
  min-height: 44px;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  color: var(--ink);
  background: none;
  border: 0;
  border-radius: var(--act-r);
  box-shadow: inset 0 0 0 1px var(--act-quiet-edge);
  font: 16px/1.25 var(--f-ui);
  text-decoration: none;
  list-style: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.16s var(--ease);
}
html:root :is(.dl-more, .explain, .settings-more, .optional-details, .settings-example, .calm-how, .learn__what, .howvideo, .plans__fine, .contacts__how, .style-presets, .sign-help, .codein, .gsheet, #_) > summary::-webkit-details-marker { display: none; }
html:root :is(.dl-more, .explain, .settings-more, .optional-details, .settings-example, .calm-how, .learn__what, .plans__fine, .contacts__how, .style-presets, .sign-help, .codein, #_) > summary::after,
html:root .gsheet__title::after {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  margin-block-start: -3px;
  border-inline-end: 1.5px solid currentColor;
  border-block-end: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.16s var(--ease);
}
html:root :is(.dl-more, .explain, .settings-more, .optional-details, .settings-example, .calm-how, .learn__what, .plans__fine, .contacts__how, .style-presets, .sign-help, .codein, #_)[open] > summary::after,
html:root [open] > .gsheet__title::after { margin-block-start: 3px; transform: rotate(-135deg); }
@media (hover: hover) {
  html:root :is(.more, .famcard__go, .dl-more > summary, .explain > summary, .settings-more > summary, .optional-details > summary, .settings-example > summary, .calm-how > summary, .learn__what > summary, .howvideo > summary, .plans__fine > summary, .contacts__how > summary, #f-style.is-learned .style-presets > summary, .sign-help > summary, .codein > summary, .gsheet__title, #_):hover { background: var(--act-quiet-hover); text-decoration: none; }
}
html:root :is(.more, .famcard__go, .dl-more > summary, .explain > summary, .settings-more > summary, .optional-details > summary, .settings-example > summary, .calm-how > summary, .learn__what > summary, .howvideo > summary, .plans__fine > summary, .contacts__how > summary, #f-style.is-learned .style-presets > summary, .sign-help > summary, .codein > summary, .gsheet__title, #_):focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
/* smaller, where the word stands inside a row that is itself the key */
html:root :is(.place__go, .cs-payrow__go, .co-shelf__all, .dl-key, .dl-cloud__head button, .note__act, .fi-more, .fi-in, #_):not([hidden]) {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  padding: 2px 12px;
  color: var(--ink-2);
  background: none;
  border: 0;
  border-radius: var(--act-r);
  box-shadow: inset 0 0 0 1px var(--act-quiet-edge);
  font: 14.5px/1.25 var(--f-ui);
  text-decoration: none;
}

/* ── a room's head: keys that wrap keep their distance ── */
html:root .room__head > :is(.text-btn, .text-link) { margin-block-start: 8px; margin-inline-end: 4px; }
html:root .room__head > .room__how { margin: 0; }
html:root .qs-quiet { margin-block-end: 14px; }

/* ── a customer's card: the keys breathe ── */
html:root .cc__acts { margin-block-start: 4px; }
html:root .cc__sec { gap: 10px; }

/* ── the card's keys: whole-width rows, with a way forward at the far side ── */
html:root .cc__acts { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
html:root .cc__acts :is(.text-btn, .text-link) {
  justify-content: flex-start;
  width: 100%;
  min-height: 56px;
  padding: 8px 16px;
  border-radius: 18px;
  text-align: start;
}
html:root .cc__acts :is(.text-btn, .text-link) { background: var(--sheet); box-shadow: inset 0 0 0 1.5px var(--line-strong); }   /* the card's frames (8.11.2026) */
html:root .cc__acts :is(.text-btn, .text-link):active { transform: scale(0.985); }
html:root .cc__acts :is(.text-btn, .text-link) > .icon:first-child:has(use[href="#i-plus"]) { margin-inline: -4px 2px; padding: 6px; }
html:root .cc__acts :is(.text-btn, .text-link)::after {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  margin-inline-start: auto;
  border-inline-end: 2px solid var(--ink-soft);
  border-block-end: 2px solid var(--ink-soft);
  transform: rotate(45deg);
}

@media (prefers-reduced-motion: reduce) {
  html:root :is(.text-btn, .text-link) { transition: none; }
  html:root :is(.text-btn, .text-link):hover, html:root :is(.text-btn, .text-link):active { transform: none; }
}
