/* TastingKit by Thrane.nu – admin pages */
.tk-help { color: var(--body-color, inherit); opacity: .85; font-size: .9rem; }
.tk-economy dl.tk-economy-sum { display: grid; grid-template-columns: 1fr auto; gap: .25rem 1rem; margin: 1rem 0; }
.tk-economy dd { margin: 0; text-align: end; font-variant-numeric: tabular-nums; }
.tk-economy .tk-strong { font-weight: 700; border-top: 1px solid var(--border-color, #dfe3e7); padding-top: .25rem; }
.tk-economy .tk-neg { color: var(--danger, #c52827); }
.tk-economy-wines td, .tk-economy-wines th { font-variant-numeric: tabular-nums; }
.tk-economy-wines td.tk-needed { opacity: .75; font-style: italic; }
.tk-wines .tk-num { max-width: 8rem; }

/* Font search and preview (as in SideKit) */
.tk-font { position: relative; max-width: 32rem; --tk-muted: var(--bs-secondary-color, #5a6470); --tk-border: var(--bs-border-color, #dfe3e7); }
.tk-font-box { position: relative; }
.tk-font-box .form-control { padding-inline-start: 2.25rem; }
.tk-font-icon { position: absolute; inset-inline-start: .75rem; top: 50%; margin-top: -8px; color: var(--tk-muted); pointer-events: none; }
.tk-font-list { position: absolute; z-index: 20; inset-inline: 0; top: calc(100% + 4px); max-height: 20rem; margin: 0; padding: .25rem 0; overflow-y: auto; list-style: none; border: 1px solid var(--tk-border); border-radius: 4px; background: var(--bs-body-bg, #fff); box-shadow: 0 8px 24px rgba(24, 42, 74, .15); }
.tk-font-opt { display: flex; align-items: baseline; gap: .75rem; padding: .45rem .75rem; cursor: pointer; }
.tk-font-opt:hover, .tk-font-opt[aria-selected="true"] { background: rgba(42, 105, 184, .1); }
.tk-font-name { font-size: .9375rem; }
.tk-font-meta { margin-inline-start: auto; font-size: .75rem; color: var(--tk-muted); white-space: nowrap; }
.tk-font-empty { padding: .5rem .75rem; color: var(--tk-muted); font-size: .875rem; }
.tk-font-preview { margin-top: .75rem; padding: .75rem 1rem; border: 1px solid var(--tk-border); border-radius: .5rem; background: var(--bs-tertiary-bg, #f6f8fa); }
.tk-font-sample { margin: 0 0 .5rem; font-size: 1.375rem; line-height: 1.3; }
.tk-font-weights { display: flex; flex-wrap: wrap; gap: .25rem 1rem; font-size: .9375rem; }
.tk-font-status { margin: .5rem 0 0; font-size: .75rem; color: var(--tk-muted); }
.tk-font-status.tk-warn { color: #8a4b00; }

/* ---------- Template form in the style of SideKit's settings ---------- */
.tk-form {
  --tk-a-border: var(--bs-border-color, #dbe3ee);
  --tk-a-soft: var(--bs-tertiary-bg, #f7f9fc);
  --tk-a-text: var(--bs-body-color, #22262a);
  --tk-a-muted: var(--bs-secondary-color, #5a6470);
  --tk-a-accent: var(--template-link-color, #2a69b8);
  --tk-a-accent-soft: rgba(42, 105, 184, .1);
  --tk-a-dark: #44505c;
  --tk-a-radius: 6px;
}
.tk-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; align-items: start; }
@media (min-width: 1300px) { .tk-layout { grid-template-columns: minmax(0, 1fr) minmax(360px, 34%); } }
.tk-layout-main { min-width: 0; }

/* Cards */
.tk-card { margin: 0 0 1rem; border: 1px solid var(--tk-a-border); border-radius: var(--tk-a-radius); background: var(--bs-body-bg, #fff); }
.tk-card-head { padding: .75rem 1rem; border-bottom: 1px solid var(--tk-a-border); background: var(--tk-a-soft); border-radius: var(--tk-a-radius) var(--tk-a-radius) 0 0; }
.tk-card-title { margin: 0; font-size: 1rem; font-weight: 500; color: var(--tk-a-text); }
.tk-card-desc { margin: .25rem 0 0; font-size: .8125rem; color: var(--tk-a-muted); }
.tk-card-body { padding: 1rem; }
.tk-card-body > .control-group:last-child { margin-bottom: 0; }
/* With help icons the descriptions move into the bubbles. */
.tk-form:not(.tk-no-help) .tk-has-help [id$="-desc"] { display: none; }

/* Help icons */
.tk-form .control-label:has(.tk-help) { display: flex; align-items: flex-start; gap: .3rem; }
.tk-help { display: inline-grid; flex: none; place-items: center; width: 1.5rem; height: 1.5rem; margin: -.05rem 0 0; padding: 0; border: 0; border-radius: 999px; background: none; color: var(--tk-a-muted); cursor: help; }
.tk-help:hover, .tk-help[aria-expanded="true"] { color: var(--tk-a-accent); background: var(--tk-a-accent-soft); }
.tk-help:focus-visible { outline: 2px solid var(--tk-a-accent); outline-offset: 1px; }
.tk-form.tk-no-help .tk-help { display: none; }
.tk-help-pop { position: absolute; z-index: 1080; padding: .6rem .8rem; border-radius: 8px; background: #1f2937; color: #fff; font-size: .8125rem; line-height: 1.45; box-shadow: 0 6px 24px rgba(0, 0, 0, .18); }
.tk-help-pop::before { position: absolute; top: -5px; left: calc(var(--tk-help-x, 24px) - 5px); width: 10px; height: 10px; background: inherit; transform: rotate(45deg); content: ""; }
.tk-help-pop[hidden] { display: none; }
.tk-help-switch { display: inline-flex; align-items: center; gap: .4rem; font-size: .8125rem; color: var(--tk-a-muted); }

/* A select shown as buttons stays in the form for saving and showon. */
.tk-sr-select { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; white-space: nowrap !important; border: 0 !important; padding: 0 !important; }

/* Segmented buttons */
.tk-seg-group { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--tk-a-border); border-radius: 4px; overflow: hidden; background: var(--bs-body-bg, #fff); }
.tk-seg-group button { min-height: 2.25rem; padding: .35rem .9rem; border: 0; border-inline-start: 1px solid var(--tk-a-border); background: transparent; color: var(--tk-a-text); font: inherit; font-size: .875rem; line-height: 1.3; }
.tk-seg-group button:first-child { border-inline-start: 0; }
.tk-seg-group button:hover { background: var(--tk-a-soft); }
.tk-seg-group button[aria-pressed="true"] { background: var(--tk-a-dark); color: #fff; }

/* Picture tiles */
.tk-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr)); gap: .75rem; max-width: 36rem; }
.tk-tiles button { display: flex; flex-direction: column; align-items: center; gap: .5rem; padding: .75rem .5rem; border: 1px solid var(--tk-a-border); border-radius: var(--tk-a-radius); background: var(--bs-body-bg, #fff); color: var(--tk-a-text); font: inherit; font-size: .8125rem; }
.tk-tiles button:hover { background: var(--tk-a-soft); }
.tk-tiles button[aria-pressed="true"] { border-color: var(--tk-a-accent); box-shadow: inset 0 0 0 1px var(--tk-a-accent); background: var(--tk-a-accent-soft); color: var(--tk-a-accent); font-weight: 500; }
.tk-seg-group button:focus-visible, .tk-tiles button:focus-visible { outline: 2px solid var(--tk-a-accent); outline-offset: 2px; position: relative; z-index: 1; }
.tk-tile-svg { display: block; opacity: .85; }

/* Live preview */
.tk-layout-aside { min-width: 0; }
@media (min-width: 1300px) { .tk-layout-aside { position: sticky; top: calc(var(--tk-sticky-top, 0px) + 1rem); } }
.tk-preview { border: 1px solid var(--tk-a-border); border-radius: var(--tk-a-radius); background: var(--bs-body-bg, #fff); padding: 1rem; }
.tk-preview-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .75rem; }
.tk-preview-desk { padding: clamp(8px, 2vw, 18px); border-radius: var(--tk-a-radius); background: #e2dcd8; }
#tk-preview-svg { display: block; width: 100%; height: auto; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .12), 0 6px 18px rgba(0, 0, 0, .12); }
#tk-preview-svg .tk-safe, #tk-preview-svg .tk-zones { display: none; }
.tk-preview-note { margin: .6rem 0 0; font-size: .8125rem; color: var(--tk-a-muted); }
.tk-preview-note.tk-warn { color: #a6401c; font-weight: 500; }

/* Own fonts (OwnfontField) */
.tk-own-list { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .4rem; }
.tk-own-item { display: flex; align-items: center; gap: .75rem; padding: .45rem .6rem; border: 1px solid var(--template-bg-dark-10, #dfe3e7); border-radius: .4rem; }
.tk-own-name { font-weight: 600; }
.tk-own-meta { font-size: .8rem; opacity: .75; margin-inline-end: auto; }
.tk-own-empty { font-size: .875rem; opacity: .75; }
.tk-own-add { display: grid; gap: .75rem; }
.tk-own-f { display: grid; gap: .3rem; font-size: .875rem; }
.tk-own-go { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.tk-own-status { font-size: .875rem; }
.tk-own-status.tk-warn { color: var(--danger, #c52827); }
.tk-zoom { margin-bottom: .6rem; }

/* Template gallery */
.tk-gallery-lead { max-width: 60rem; }
.tk-gallery-grid { list-style: none; margin: 0 0 1.5rem; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr)); }
.tk-gallery-card { display: flex; flex-direction: column; overflow: hidden; margin: 0; }
.tk-gallery-pic { padding: .75rem; background: #e2dcd8; }
.tk-gallery-pic svg { display: block; width: 100%; height: auto; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .18); }
.tk-gallery-text { padding: .9rem 1rem 1rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.tk-gallery-text form { margin-top: auto; }
.tk-gallery-importform { display: grid; gap: .5rem; max-width: 32rem; }
.tk-gallery-importform .btn { justify-self: start; }

.tk-gallery-pic .tk-safe, .tk-gallery-pic .tk-zones { display: none; }

/* 2.0.3: Joomla's administrator (Atum) puts an "opens in a new window" icon before every target="_blank" link; the
   help link is a "?" in a ring and needs no second icon. */
a.tk-help[target]::before, a.tk-help[target]::after { content: none !important; display: none !important; }

/* ---------- 2.5.0: a fair's exhibitors and wines (fair-edit.js) ---------- */
.tk-fair-settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr)); gap: 0 1rem; }
.tk-fair-link a { word-break: break-all; }
.tk-fair-import { margin: 0 0 1rem; padding: .5rem .75rem; border: 1px dashed var(--tk-a-border); border-radius: var(--tk-a-radius); }
.tk-fair-import > summary { cursor: pointer; font-weight: 500; }
.tk-fair-import textarea { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8125rem; }
.tk-fair-import-row, .tk-fair-tools { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .5rem 0; }
.tk-fair-tools input[type=search] { max-width: 20rem; }
.tk-fair-list { display: grid; gap: .75rem; margin: 0 0 .75rem; }
.tk-fx { border: 1px solid var(--tk-a-border); border-radius: var(--tk-a-radius); padding: .5rem .75rem; background: var(--tk-a-soft); }
.tk-fx-head { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.tk-fx-head .tk-fx-stand { width: 6.5rem; flex: none; font-weight: 600; }
.tk-fx-head .tk-fx-name { flex: 1 1 14rem; font-weight: 600; }
.tk-fx-head .tk-fx-logo { flex: 0 1 16rem; }
.tk-fx-logoimg { height: 2rem; width: auto; max-width: 6rem; object-fit: contain; }
.tk-fx-count { color: var(--tk-a-muted); white-space: nowrap; }
.tk-fx-wines { margin: .5rem 0 .25rem; background: transparent; }
.tk-fx input.form-control { width: 100%; max-width: none; }
.tk-fx-wines td { padding: .15rem .25rem; vertical-align: middle; background: transparent; border: 0; }
.tk-fx-wines td:nth-child(1) { width: 34%; }
.tk-fx-wines td:nth-child(2) { width: 14%; }
.tk-fx-wines td:nth-child(3) { width: 20%; }
.tk-fw-lists { width: 1%; white-space: nowrap; }
.tk-fw-count { font-size: .75rem; color: var(--tk-a-muted); }
.tk-fw-count.is-on { color: var(--tk-a-text); font-weight: 600; }
/* 2.8.0: PortFamly's answer per wine and the card's counts. */
.tk-pf-badge { display: inline-flex; align-items: center; gap: .3rem; margin-left: .4rem; font-size: .75rem; vertical-align: middle; }
.tk-pf-dot { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; background: #9aa0a6; flex: none; }
.tk-pf-dot.is-shown { background: #2e7d32; }
.tk-pf-dot.is-pending { background: #f0a400; }
.tk-pf-dot.is-rejected { background: #c62828; }
.tk-pf-dot.is-removed, .tk-pf-dot.is-removed_kept { background: #9aa0a6; }
.tk-pf-rating { font-weight: 600; }
.tk-pf-text { white-space: normal; max-width: 16rem; line-height: 1.2; }
.tk-pf-awaiting { font-weight: 500; }
.tk-pf-counts { list-style: none; padding: 0; margin: 0 0 .5rem; display: flex; flex-wrap: wrap; gap: .25rem 1rem; }
.tk-pf-counts li { display: inline-flex; align-items: center; gap: .35rem; }
.tk-pf-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
@media (max-width: 767px) {
    .tk-fx-wines, .tk-fx-wines tbody, .tk-fx-wines tr, .tk-fx-wines td { display: block; width: auto !important; }
    .tk-fx-wines tr { padding: .25rem 0; border-bottom: 1px solid var(--tk-a-border); }
}
