/* Quiet text links and aligned action groups. Load after simplify.css. */
.tag,
.projecttile .tag,
.status,
.status.ok,
.status.late,
.status.unknown,
.status.unissued:not(.unknown):not(.ok),
.alerttag {
  background: transparent !important;
  background-image: none !important;
  border: 0 !important;
  box-shadow: none !important;
}
.tag {padding:0;border-radius:0}
.projecttile .tag {display:inline-flex;align-items:center;line-height:1.5}

/* Suppress only automatic/pointer focus on close controls, never Tab focus. */
:root[data-hity-input-mode="pointer"] .modalhead .close:focus {outline:none}
:root[data-hity-input-mode="keyboard"] .modalhead .close:focus {
  outline:2px solid var(--hity-accent,#5831a9);
  outline-offset:3px;
  border-radius:14px;
}
.modalhead .close {display:inline-grid;place-items:center;flex:0 0 44px;width:44px;height:44px;min-width:44px;min-height:44px;padding:0;line-height:1}

/* Two explicit actions read as one compact split control for this service. */
:is(.row-actions,.card-actions):has(.service-quick-action) {
  display:inline-flex;
  width:max-content;
  max-width:100%;
  flex:0 1 auto;
  flex-wrap:nowrap;
  align-items:center;
  justify-content:flex-end;
  gap:0;
  padding:0;
  border:1px solid var(--hity-field-border,#c6d1df);
  border-radius:13px;
  background:var(--hity-field,#fff);
  box-shadow:none;
}
.line>.row-actions:last-child:not(:first-child) {align-self:center;gap:0;margin-left:auto}
.table .row-actions {width:max-content;margin-left:auto}
.mobilecard .card-actions:has(.service-quick-action) {width:max-content;margin:12px 0 0 auto;padding:0;border:1px solid var(--hity-field-border,#c6d1df)}
:is(.row-actions,.card-actions) .service-quick-action,
:is(.row-actions,.card-actions) .service-details-action {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:44px;
  height:44px;
  margin:0;
  color:var(--hity-accent,#5831a9);
  background:transparent;
  box-shadow:none;
  border:0;
  line-height:1.35;
}
:is(.row-actions,.card-actions) .service-quick-action {flex:0 1 auto;min-width:0;padding:9px 12px;font-size:13px;white-space:nowrap;border-radius:12px 0 0 12px}
:is(.row-actions,.card-actions) .service-details-action {flex:0 0 44px;width:44px;min-width:44px;max-width:44px;padding:0;border-radius:0 12px 12px 0}
:is(.row-actions,.card-actions) .service-quick-action+.service-details-action {border-left:1px solid var(--hity-line,#d7dfe9)}
:is(.row-actions,.card-actions) .service-details-action:only-child {border-radius:12px}
.service-details-action .ui-icon {display:block;width:18px;height:18px}
.project-service-row>.line {display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:16px 24px}
.project-service-row>.line>div:first-child {min-width:0;text-align:left}
.project-service-row>.line>.row-actions {max-width:100%;margin:0;justify-self:end}
.project-service-expenses {margin-left:0;padding-top:12px}
.service-cost-entry {align-items:center;gap:16px;padding-block:10px}
.service-cost-entry strong {white-space:nowrap;max-width:none;line-height:1.4}

/* Monetary values and their menus share a centre line and one stable gap. */
.expense-row {display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:14px 24px}
.expense-row>div:first-child {min-width:0;text-align:left}
.line>.expense-row-actions:last-child:not(:first-child) {
  display:flex;
  flex-direction:row;
  flex-wrap:nowrap;
  align-items:center;
  justify-content:flex-end;
  gap:10px;
  flex:none;
  max-width:100%;
  min-width:0;
  margin:0;
  text-align:right;
}
.expense-row-amount {display:block;min-width:0;font-variant-numeric:tabular-nums;white-space:nowrap;line-height:1.4}
.expense-row-actions>button {flex:none;margin:0!important}
.expense-row-actions>.expense-more-action {
  position:relative;
  isolation:isolate;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:44px;
  min-width:44px;
  height:44px;
  min-height:44px;
  padding:0;
  border:0;
  border-radius:12px;
  background:transparent;
  box-shadow:none;
  color:var(--hity-accent,#5831a9);
  font-size:18px;
  letter-spacing:1px;
  line-height:1;
}
.expense-row-actions>.expense-more-action::before {content:"";position:absolute;inset:6px;z-index:-1;border:1px solid var(--hity-field-border,#c6d1df);border-radius:10px;background:var(--hity-field,#fff);pointer-events:none}
.expense-row-actions>.expense-more-action .ui-icon {width:18px;height:18px}
.expense-amount-actions {font-variant-numeric:tabular-nums}

/* A project image is rendered only when present; the text has no empty slot. */
.project-avatar {display:block;flex:0 0 40px;width:40px;height:40px;overflow:hidden;border-radius:12px;background:transparent;box-shadow:none}
.project-avatar img {display:block;width:100%;height:100%;object-fit:cover;border-radius:inherit}
.table-name,.mobile-name {align-items:center;gap:12px}
.project-avatar-editor {margin:18px 0;min-width:0}
.project-avatar-controls {display:flex;align-items:center;flex-wrap:wrap;gap:12px;min-width:0}
.project-avatar-controls input[type=file] {flex:1 1 230px;min-width:0;max-width:100%}
.project-avatar-preview {display:block;flex:0 0 64px;width:64px;height:64px;object-fit:cover;border:1px solid var(--hity-line,#d7dfe9);border-radius:16px}
.project-avatar-preview[hidden] {display:none}
.project-receipt-group {margin:16px 0 4px;font-size:14px;line-height:1.4;color:var(--hity-ink,#162b3a)}
.project-receipt-group:first-child {margin-top:0}
#project-avatar-remove {min-height:44px;padding:9px 12px;font-size:13px;white-space:normal}
#project-avatar-error {min-height:0;margin:8px 0 0;color:var(--hity-danger,#ad2537);font-size:13px;line-height:1.5}
#project-avatar-error:empty {display:none}

@media(hover:hover){
  :is(.row-actions,.card-actions) :is(.service-quick-action,.service-details-action):hover:not(:disabled) {background:var(--hity-field-hover,#f2f5fa);color:var(--hity-accent-active,#472184)}
  .expense-row-actions>.expense-more-action:hover:not(:disabled) {background:transparent;border:0;box-shadow:none}
  .expense-row-actions>.expense-more-action:hover:not(:disabled)::before {background:var(--hity-field-hover,#f2f5fa);border-color:var(--hity-accent,#5831a9)}
}
.expense-row-actions>.expense-more-action:active {background:transparent;box-shadow:none}
.expense-row-actions>.expense-more-action:active::before {background:var(--hity-selected,#eee8fa)}
@media(max-width:600px){
  .project-service-row>.line {grid-template-columns:minmax(0,1fr);gap:12px}
  .project-service-row>.line>.row-actions {justify-self:end}
  .expense-row {grid-template-columns:minmax(0,1fr);gap:8px}
  .expense-row>.expense-row-actions {justify-self:end}
  .line>.expense-row-actions:last-child:not(:first-child) {display:grid;grid-template-columns:minmax(0,1fr) 44px;align-items:center;gap:8px 10px}
  .expense-row-actions>.expense-row-amount {grid-column:1;grid-row:1}
  .expense-row-actions>.expense-more-action {grid-column:2;grid-row:1}
  .expense-row-actions>[data-action="city-allocate"] {grid-column:1/-1;grid-row:2;justify-self:end;max-width:100%;white-space:normal}
  .expense-row-amount {font-size:15px}
  .service-cost-entry {gap:10px}
  .project-avatar-controls {gap:10px}
}
@media(max-width:359px){
  :is(.row-actions,.card-actions) .service-quick-action {padding-inline:9px;font-size:12px}
  .expense-row-actions {column-gap:8px}
}
