/* ASNET components — buttons, forms, alerts, badges, cards, pagination,
 * empty states, selection tiles/segmented controls (shared by checkout and
 * anywhere else a choice needs to be a tap target, not a <select>). */

/* ---- Buttons ---- */
.asnet-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 22px;
  border-radius: var(--asnet-radius-sm);
  border: 1px solid transparent;
  font-size: var(--asnet-fs-sm);
  font-weight: 650;
  cursor: pointer;
  text-align: center;
  transition: background var(--asnet-transition-fast) var(--asnet-ease-out),
              border-color var(--asnet-transition-fast) var(--asnet-ease-out),
              color var(--asnet-transition-fast) var(--asnet-ease-out);
}
.asnet-btn:disabled { opacity: 0.55; cursor: not-allowed; }
/* ASNET DOMAIN-01J Part K: .asnet-btn's own `display: inline-flex` above
 * has the same CSS specificity as the browser's built-in `[hidden] {
 * display: none }` UA rule and wins the cascade (author stylesheets
 * always beat UA stylesheets at equal specificity), so the HTML `hidden`
 * attribute was silently doing nothing on any asnet-btn - the root cause
 * of both the domain lock/unlock page rendering "Otključaj" and
 * "Zaključaj" simultaneously and the identical bug on the Privacy
 * Protection Enable/Disable buttons. This single rule restores standard
 * `hidden` semantics for every asnet-btn everywhere, not just those two
 * call sites - no server/JS-side toggle logic needed to change. */
.asnet-btn[hidden] { display: none; }
.asnet-btn--sm { min-height: 38px; padding: 0 16px; font-size: var(--asnet-fs-xs); }
.asnet-btn--lg { min-height: 52px; padding: 0 28px; font-size: var(--asnet-fs-base); }
.asnet-btn--block { width: 100%; }

.asnet-btn--primary { background: var(--asnet-primary); color: #fff; }
.asnet-btn--primary:hover { background: var(--asnet-primary-strong); color: #fff; }

.asnet-btn--outline { background: transparent; border-color: var(--asnet-border-strong); color: var(--asnet-text); }
.asnet-btn--outline:hover { border-color: var(--asnet-primary); color: var(--asnet-primary); }

.asnet-btn--ghost { background: transparent; color: var(--asnet-text-on-dark); border-color: var(--asnet-border-on-dark); }
.asnet-btn--ghost:hover { background: #ffffff14; color: #fff; }

.asnet-btn--danger { background: var(--asnet-danger-bg); color: var(--asnet-danger); border-color: var(--asnet-danger-border); }
.asnet-btn--danger:hover { background: var(--asnet-danger); color: #fff; }

.asnet-btn--link { min-height: auto; padding: 0; background: none; color: var(--asnet-primary); font-weight: 600; }
.asnet-btn--link:hover { color: var(--asnet-primary-strong); text-decoration: underline; }

/* ---- Forms ---- */
.asnet-field { margin-bottom: var(--asnet-space-sm); }
.asnet-field-block { margin-bottom: var(--asnet-space-sm); }
.asnet-label {
  display: block;
  font-size: var(--asnet-fs-sm);
  font-weight: 600;
  color: var(--asnet-text);
  margin-bottom: 6px;
}
.asnet-label .asnet-optional { color: var(--asnet-text-muted); font-weight: 400; }
.asnet-help-text { font-size: var(--asnet-fs-xs); color: var(--asnet-text-muted); margin-top: 6px; }

.asnet-input,
.asnet-select,
.asnet-textarea {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--asnet-border-strong);
  border-radius: var(--asnet-radius-sm);
  background: var(--asnet-surface);
  color: var(--asnet-text);
  font-family: inherit;
  font-size: var(--asnet-fs-base);
  transition: border-color var(--asnet-transition-fast) var(--asnet-ease-out),
              box-shadow var(--asnet-transition-fast) var(--asnet-ease-out);
}
.asnet-textarea { min-height: 110px; padding: 12px 14px; resize: vertical; }
.asnet-input--qty { max-width: 96px; text-align: center; }

.asnet-input:hover, .asnet-select:hover, .asnet-textarea:hover { border-color: var(--asnet-border-strong); }
.asnet-input:focus, .asnet-select:focus, .asnet-textarea:focus {
  outline: none;
  border-color: var(--asnet-primary);
  box-shadow: 0 0 0 3px var(--asnet-primary-soft);
}
.asnet-input::placeholder, .asnet-textarea::placeholder { color: var(--asnet-text-muted); }

.asnet-input:disabled, .asnet-select:disabled, .asnet-textarea:disabled {
  background: var(--asnet-surface-muted);
  color: var(--asnet-text-muted);
  cursor: not-allowed;
}

.asnet-field.has-error .asnet-input,
.asnet-field.has-error .asnet-select,
.asnet-field.has-error .asnet-textarea,
.asnet-input.is-invalid, .asnet-select.is-invalid, .asnet-textarea.is-invalid {
  border-color: var(--asnet-danger-border);
}
.asnet-field.has-error .asnet-input:focus,
.asnet-input.is-invalid:focus {
  box-shadow: 0 0 0 3px var(--asnet-danger-bg);
}
.asnet-field-error {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--asnet-fs-xs);
  color: var(--asnet-danger);
  margin-top: 6px;
}

.asnet-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235b6b80' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 36px;
}

.asnet-input-group { display: flex; gap: 8px; }

/* Light-touch adaptation of the vendored intl-tel-input widget
   (assets/vendor/intl-tel-input/, see .js-phone-input fields) to ASNET
   tokens. Intentionally minimal - overriding a third-party widget's
   internals extensively without the ability to visually test it in this
   workspace is its own risk, so this only touches the input's own
   border/radius/height/focus to match .asnet-input and leaves the
   dropdown/flag internals as shipped. */
.iti { width: 100%; }
.iti input.asnet-input,
.iti__tel-input { border-radius: var(--asnet-radius-sm); min-height: 46px; }
.iti input.asnet-input:focus,
.iti__tel-input:focus {
  outline: none;
  border-color: var(--asnet-primary);
  box-shadow: 0 0 0 3px var(--asnet-primary-soft);
}
.asnet-input-group .asnet-input { flex: 1; }

.asnet-checkbox, .asnet-radio {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: var(--asnet-fs-sm);
  color: var(--asnet-text);
  cursor: pointer;
}
.asnet-checkbox input, .asnet-radio input {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  accent-color: var(--asnet-primary);
  flex-shrink: 0;
}

.asnet-form-row { display: flex; gap: var(--asnet-space-sm); flex-wrap: wrap; }
.asnet-form-row > .asnet-field { flex: 1 1 200px; }

.asnet-field-group {
  border: 1px solid var(--asnet-border);
  border-radius: var(--asnet-radius-md);
  padding: var(--asnet-space-md);
  margin-bottom: var(--asnet-space-md);
}
.asnet-field-group__title { font-size: var(--asnet-fs-base); font-weight: 700; color: var(--asnet-ink); margin-bottom: 4px; }
.asnet-field-group__hint { font-size: var(--asnet-fs-sm); color: var(--asnet-text-muted); margin-bottom: var(--asnet-space-sm); }

/* ---- Alerts ---- */
.asnet-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: var(--asnet-space-sm);
  border-radius: var(--asnet-radius-sm);
  border: 1px solid;
  font-size: var(--asnet-fs-sm);
  margin-bottom: var(--asnet-space-sm);
  text-align: left;
}
.asnet-alert p { margin: 0; }
/* Icons rendered by the m.icon() macro carry no width/height of their own
   (see macro_functions.html.twig - plain <svg viewBox="0 0 24 24"> with no
   size attributes, entirely dependent on the class it's given). The base
   .asnet-icon class supplies that (18px), but every .asnet-alert__icon call
   site passes only "asnet-alert__icon" as the class, replacing rather than
   extending .asnet-icon - so without a size of its own here, the icon fell
   back to the browser's intrinsic default SVG size (a few hundred px) and
   blew out every .asnet-alert box that renders one (dashboard's on-hold
   ticket notice, profile's email-verification banner, the support ticket
   closed/reopen notices, the check-email info banner, and this theme's own
   flash-message partial - not just the invoice page, that was just the
   first place it got noticed). Sized directly here, self-sufficiently,
   the same way .asnet-icon--sm/--lg size themselves rather than depending
   on being combined with .asnet-icon. */
.asnet-alert__icon { width: 20px; height: 20px; margin-top: 1px; flex-shrink: 0; }
.asnet-alert--info { background: var(--asnet-info-bg); border-color: var(--asnet-info-border); color: var(--asnet-info); }
.asnet-alert--success { background: var(--asnet-success-bg); border-color: var(--asnet-success-border); color: var(--asnet-success); }
.asnet-alert--warning { background: var(--asnet-warning-bg); border-color: var(--asnet-warning-border); color: var(--asnet-warning); }
.asnet-alert--danger { background: var(--asnet-danger-bg); border-color: var(--asnet-danger-border); color: var(--asnet-danger); }

/* ---- Badges ---- */
.asnet-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--asnet-radius-full);
  font-size: var(--asnet-fs-xs);
  font-weight: 700;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
}
.asnet-badge--success { background: var(--asnet-success-bg); color: var(--asnet-success); border-color: var(--asnet-success-border); }
.asnet-badge--warning { background: var(--asnet-warning-bg); color: var(--asnet-warning); border-color: var(--asnet-warning-border); }
.asnet-badge--danger { background: var(--asnet-danger-bg); color: var(--asnet-danger); border-color: var(--asnet-danger-border); }
.asnet-badge--info { background: var(--asnet-info-bg); color: var(--asnet-info); border-color: var(--asnet-info-border); }
.asnet-badge--muted { background: var(--asnet-surface-muted); color: var(--asnet-text-muted); border-color: var(--asnet-border); }
.asnet-badge--neutral { background: var(--asnet-surface-muted); color: var(--asnet-text); border-color: var(--asnet-border); }

/* ---- Cards / surfaces ---- */
.asnet-card {
  background: var(--asnet-surface-elevated);
  border: 1px solid var(--asnet-border);
  border-radius: var(--asnet-radius-md);
  box-shadow: var(--asnet-shadow-soft);
  padding: var(--asnet-space-md);
}
.asnet-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--asnet-space-sm);
  margin-bottom: var(--asnet-space-sm);
}
.asnet-card__title { margin: 0; font-size: var(--asnet-fs-lg); }
/* ASNET DOMAIN-01J Part L: the domain-management page's Bootstrap tab
 * strip (nav.nav-tabs.card-header-tabs, e.g. Detalji/Zaštita/Privatnost/
 * Name serveri/Kontakt/Transfer) previously had no bottom spacing and no
 * separator, so the first tab pane's own heading (e.g. "Detalji domena")
 * rendered flush against it. Scoped to .asnet-card so this never touches
 * the byte-preserved *.stock.html.twig fallback pages, which use plain
 * Bootstrap .card, not .asnet-card. */
.asnet-card .nav-tabs.card-header-tabs {
  flex-wrap: wrap;
  row-gap: 4px;
  padding: var(--asnet-space-sm) 0 var(--asnet-space-sm);
  margin-bottom: var(--asnet-space-md);
  border-bottom: 1px solid var(--asnet-border);
}
.asnet-card .tab-content > .tab-pane { padding-top: 2px; }
.asnet-surface {
  background: var(--asnet-surface-elevated);
  border: 1px solid var(--asnet-border);
  border-radius: var(--asnet-radius-md);
}

/* ---- Selection tiles / segmented control (billing period, domain
   choice, payment method - anywhere a <select> would be worse than a tap
   target) ---- */
.asnet-segmented {
  display: inline-flex;
  max-width: 100%;
  padding: 4px;
  gap: 4px;
  background: var(--asnet-surface-muted);
  border: 1px solid var(--asnet-border);
  border-radius: var(--asnet-radius-sm);
  overflow-x: auto;
  /* Defensive: if a product ever has many enabled billing periods, the
     control scrolls internally instead of forcing page-level horizontal
     overflow on narrow viewports (375/430px acceptance widths). */
}
.asnet-segmented__option { position: relative; }
.asnet-segmented__option input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}
.asnet-segmented__label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 18px;
  border-radius: calc(var(--asnet-radius-sm) - 2px);
  font-size: var(--asnet-fs-sm);
  font-weight: 600;
  color: var(--asnet-text-muted);
  cursor: pointer;
  white-space: nowrap;
}
.asnet-segmented__label .asnet-segmented__meta { font-size: var(--asnet-fs-xs); font-weight: 500; color: var(--asnet-text-muted); }
.asnet-segmented__option input:checked + .asnet-segmented__label {
  background: var(--asnet-surface-elevated);
  color: var(--asnet-ink);
  box-shadow: var(--asnet-shadow-soft);
}
.asnet-segmented__option input:checked + .asnet-segmented__label .asnet-segmented__meta { color: var(--asnet-success); }
.asnet-segmented__option input:focus-visible + .asnet-segmented__label { outline: 2px solid var(--asnet-primary); outline-offset: 2px; }

.asnet-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--asnet-space-xs);
}
.asnet-tile { position: relative; }
.asnet-tile input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}
.asnet-tile__label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: var(--asnet-space-sm);
  border: 1.5px solid var(--asnet-border);
  border-radius: var(--asnet-radius-sm);
  cursor: pointer;
  transition: border-color var(--asnet-transition-fast) var(--asnet-ease-out),
              box-shadow var(--asnet-transition-fast) var(--asnet-ease-out);
}
.asnet-tile__title { font-weight: 700; color: var(--asnet-ink); font-size: var(--asnet-fs-sm); display: flex; align-items: center; gap: 8px; }
.asnet-tile__desc { font-size: var(--asnet-fs-xs); color: var(--asnet-text-muted); }
.asnet-tile input:checked + .asnet-tile__label {
  border-color: var(--asnet-primary);
  box-shadow: 0 0 0 3px var(--asnet-primary-soft);
}
.asnet-tile input:focus-visible + .asnet-tile__label { outline: 2px solid var(--asnet-primary); outline-offset: 2px; }
.asnet-tile__check {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--asnet-border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  background: var(--asnet-surface);
}
.asnet-tile input:checked ~ .asnet-tile__check {
  background: var(--asnet-primary);
  border-color: var(--asnet-primary);
  color: #fff;
}
.asnet-tile__check .asnet-icon { width: 11px; height: 11px; }

/* ---- Modal dialog (see assets/js/modal.js) ---- */
.asnet-modal { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: var(--asnet-space-sm); }
.asnet-modal[hidden] { display: none; }
.asnet-modal__backdrop {
  position: absolute; inset: 0; background: #050b14b3;
  opacity: 0; transition: opacity var(--asnet-transition-base) var(--asnet-ease-out);
}
.asnet-modal.is-open .asnet-modal__backdrop { opacity: 1; }
.asnet-modal__dialog {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--asnet-surface-elevated);
  border-radius: var(--asnet-radius-lg);
  box-shadow: var(--asnet-shadow-lifted);
  padding: var(--asnet-space-lg);
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  transition: opacity var(--asnet-transition-base) var(--asnet-ease-out), transform var(--asnet-transition-base) var(--asnet-ease-out);
}
.asnet-modal.is-open .asnet-modal__dialog { opacity: 1; transform: translateY(0) scale(1); }
.asnet-modal__dialog--lg { max-width: 860px; }
.asnet-modal__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--asnet-space-sm); margin-bottom: var(--asnet-space-md); }
.asnet-modal__head h2 { margin: 0; font-size: var(--asnet-fs-lg); }
.asnet-modal__subtitle { margin: 4px 0 0; color: var(--asnet-text-muted); font-size: var(--asnet-fs-sm); }
.asnet-modal__close {
  width: 32px; height: 32px; border-radius: var(--asnet-radius-sm); border: none;
  background: var(--asnet-surface-muted); color: var(--asnet-text-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.asnet-modal__close:hover { color: var(--asnet-text); }
.asnet-modal__actions { display: flex; justify-content: flex-end; gap: var(--asnet-space-sm); margin-top: var(--asnet-space-md); }

/* Required-field marker, used wherever a form needs to spell out which
   fields are mandatory (e.g. the new-ticket dialog below). */
.asnet-required { color: var(--asnet-danger); font-weight: 700; }

/* New-ticket dialog: form + contextual help sidebar, side by side once
   there's room for both; stacked (help above the form) on narrow modals /
   mobile so the form itself stays a single column. */
.asnet-ticket-form { display: grid; grid-template-columns: 1fr; gap: var(--asnet-space-lg); }
.asnet-ticket-form__legend { font-size: var(--asnet-fs-xs); color: var(--asnet-text-muted); margin: 0; }
.asnet-ticket-form__aside {
  background: var(--asnet-surface-muted);
  border: 1px solid var(--asnet-border);
  border-radius: var(--asnet-radius-md);
  padding: var(--asnet-space-sm) var(--asnet-space-md);
  align-self: start;
}
.asnet-ticket-form__aside h3 { margin: 0 0 var(--asnet-space-xs); font-size: var(--asnet-fs-sm); }
.asnet-ticket-form__aside ul { margin: 0; padding-left: 1.1em; display: flex; flex-direction: column; gap: 6px; }
.asnet-ticket-form__aside li { font-size: var(--asnet-fs-xs); color: var(--asnet-text-muted); }
@media (min-width: 640px) {
  .asnet-ticket-form { grid-template-columns: minmax(0, 1fr) 220px; }
  .asnet-ticket-form__main { order: 1; }
  .asnet-ticket-form__aside { order: 2; }
}

/* ---- Pagination ---- */
.asnet-pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px; margin-top: var(--asnet-space-md); }
.asnet-pagination__pages { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; margin: 0; padding: 0; }
.asnet-pagination__link, .asnet-pagination__page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 6px;
  border-radius: var(--asnet-radius-sm);
  color: var(--asnet-text);
  font-size: var(--asnet-fs-sm);
  font-weight: 600;
}
.asnet-pagination__page:hover, .asnet-pagination__link:hover { background: var(--asnet-surface-muted); }
.asnet-pagination__page.is-current { background: var(--asnet-primary); color: #fff; }
.asnet-pagination__link.is-disabled { pointer-events: none; opacity: 0.4; }

/* ---- Empty states ---- */
.asnet-empty-state {
  text-align: center;
  padding: var(--asnet-space-xl) var(--asnet-space-md);
  color: var(--asnet-text-muted);
}
.asnet-empty-state .asnet-icon { width: 34px; height: 34px; margin-bottom: var(--asnet-space-sm); color: var(--asnet-border-strong); }
.asnet-empty-state h1, .asnet-empty-state h2, .asnet-empty-state h3 { color: var(--asnet-ink); }
.asnet-empty-state__title { color: var(--asnet-ink); font-weight: 700; margin: 0 0 var(--asnet-space-sm); }
.asnet-empty-state__hint { margin-bottom: var(--asnet-space-md); }
.asnet-empty-state--page { padding: var(--asnet-space-2xl) var(--asnet-space-md); }
.asnet-empty-state__code {
  font-size: var(--asnet-fs-3xl);
  font-weight: 800;
  color: var(--asnet-border-strong);
  margin: 0 0 var(--asnet-space-sm);
}

/* ---- Price box (partial_pricing.html.twig) ---- */
.asnet-price-box { display: flex; flex-direction: column; gap: var(--asnet-space-xs); }
.asnet-price-box__label { font-size: var(--asnet-fs-sm); color: var(--asnet-text-muted); margin: 0; }
.asnet-price-box__amount { font-size: var(--asnet-fs-2xl); font-weight: 800; color: var(--asnet-ink); }
.asnet-price-box__row { display: flex; justify-content: space-between; font-size: var(--asnet-fs-sm); }
.asnet-price-box__breakdown { display: flex; flex-direction: column; gap: 4px; padding: var(--asnet-space-xs); background: var(--asnet-surface-muted); border-radius: var(--asnet-radius-sm); }
.asnet-price-box__qty { display: flex; align-items: center; gap: 8px; font-size: var(--asnet-fs-sm); }

/* ---- Support ticket attachments (SUPPORT-01B) ----
   Shared by the pre-submit picker (new-ticket modal, client/admin reply
   forms) and the persisted attachment cards rendered under each message.
   overrides/theme-asnet/assets/js/support-attachments.js drives the
   pre-submit strip and the shared preview modal below. */
.asnet-attachments { display: flex; flex-direction: column; gap: var(--asnet-space-xs); }
.asnet-attachments__strip {
  display: flex;
  flex-wrap: nowrap;
  gap: var(--asnet-space-xs);
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
  scrollbar-color: var(--asnet-border-strong) transparent;
}
.asnet-attachments__strip:empty { display: none; }
.asnet-attachments__strip::-webkit-scrollbar { height: 6px; }
.asnet-attachments__strip::-webkit-scrollbar-track { background: transparent; }
.asnet-attachments__strip::-webkit-scrollbar-thumb {
  background: var(--asnet-border-strong);
  border-radius: var(--asnet-radius-full);
}
.asnet-attachments__controls { display: flex; align-items: center; gap: var(--asnet-space-sm); flex-wrap: wrap; }
.asnet-attachments__add { cursor: pointer; }
.asnet-attachments__input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.asnet-attachments__error { color: var(--asnet-danger); font-size: var(--asnet-fs-xs); margin: 0; }

/* Compact uniform card: fixed width/preview height regardless of file type
   (JPG/PNG/PDF/TXT) so a strip of up to 5 never grows taller than one row -
   see SUPPORT-01B UX follow-up final report. */
.asnet-attachment-card {
  position: relative;
  flex: 0 0 150px;
  width: 150px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1px solid var(--asnet-border);
  border-radius: var(--asnet-radius-sm);
  background: var(--asnet-surface);
  padding: 8px;
  transition: border-color var(--asnet-transition-fast) var(--asnet-ease-out),
              box-shadow var(--asnet-transition-fast) var(--asnet-ease-out);
}
.asnet-attachment-card:hover,
.asnet-attachment-card:focus-within {
  border-color: var(--asnet-border-strong);
  box-shadow: var(--asnet-shadow-soft);
}
.asnet-attachment-card__thumb {
  width: 100%;
  height: 112px;
  flex: 0 0 112px;
  border-radius: 6px;
  background: var(--asnet-surface-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--asnet-text-muted);
}
/* object-fit: contain - the thumbnail never crops or stretches, and never
   uses the image's natural dimensions to size the card. */
.asnet-attachment-card__thumb img { width: 100%; height: 100%; object-fit: contain; }
.asnet-attachment-card__thumb .asnet-icon { width: 28px; height: 28px; }
.asnet-attachment-card__thumb--pdf-fallback {
  font-size: 10px; font-weight: 700; letter-spacing: 0.04em; color: var(--asnet-primary);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
/* TXT mini-preview: a few lines of the real file content, escaped via
   textContent only. */
.asnet-attachment-card__thumb-text {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 6px 7px;
  overflow: hidden;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 9px;
  line-height: 1.35;
  color: var(--asnet-text-muted);
  text-align: left;
  white-space: pre-wrap;
  word-break: break-word;
}
.asnet-attachment-card__meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.asnet-attachment-card__name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  height: 2.6em;
  line-height: 1.3em;
  font-size: var(--asnet-fs-xs);
  color: var(--asnet-text);
  overflow: hidden;
  word-break: break-word;
}
.asnet-attachment-card__size { font-size: 11px; color: var(--asnet-text-muted); }
.asnet-attachment-card__actions {
  display: flex;
  gap: 4px;
  opacity: 1;
}
/* Desktop with real hover capability: Preview/Remove stay hidden until the
   card is hovered or a control inside it has focus (:focus-within, so
   keyboard users are never dependent on hover). Touch/coarse-pointer
   devices fall outside this query, so their actions stay permanently
   visible (opacity: 1 above). Opacity-only transition - never resizes the
   card or shifts neighboring cards. */
@media (hover: hover) and (pointer: fine) {
  .asnet-attachment-card__actions { opacity: 0; transition: opacity var(--asnet-transition-fast) var(--asnet-ease-out); }
  .asnet-attachment-card:hover .asnet-attachment-card__actions,
  .asnet-attachment-card:focus-within .asnet-attachment-card__actions {
    opacity: 1;
  }
}
.asnet-attachment-card__action {
  flex: 1;
  min-height: 26px;
  padding: 0 6px;
  font-size: 11px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  border-radius: 6px;
  border: 1px solid var(--asnet-border);
  background: var(--asnet-surface);
  color: var(--asnet-text-muted);
  cursor: pointer;
  transition: color var(--asnet-transition-fast) var(--asnet-ease-out),
              border-color var(--asnet-transition-fast) var(--asnet-ease-out);
}
.asnet-attachment-card__action:hover,
.asnet-attachment-card__action:focus-visible { color: var(--asnet-text); border-color: var(--asnet-border-strong); }
.asnet-attachment-card__action--remove:hover,
.asnet-attachment-card__action--remove:focus-visible { color: var(--asnet-danger); border-color: var(--asnet-danger-border); }

/* Shared preview modal, injected once by support-attachments.js and reused
   for every card on the page. */
.asnet-attachment-preview__body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  max-height: 65vh;
  overflow: auto;
  background: var(--asnet-surface-muted);
  border-radius: var(--asnet-radius-sm);
}
.asnet-attachment-preview__body img,
.asnet-attachment-preview__body object,
.asnet-attachment-preview__body iframe {
  max-width: 100%;
  width: 100%;
  min-height: 60vh;
  border: none;
  display: block;
}
.asnet-attachment-preview__body img { min-height: 0; height: auto; object-fit: contain; }
.asnet-attachment-preview__text {
  width: 100%;
  max-height: 60vh;
  overflow: auto;
  margin: 0;
  padding: var(--asnet-space-sm);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: var(--asnet-fs-xs);
  white-space: pre-wrap;
  word-break: break-word;
}
.asnet-attachment-preview__fallback { padding: var(--asnet-space-lg); text-align: center; color: var(--asnet-text-muted); }
